JP2019057908A - Imaging apparatus and control method thereof - Google Patents

Imaging apparatus and control method thereof Download PDF

Info

Publication number
JP2019057908A
JP2019057908A JP2018123774A JP2018123774A JP2019057908A JP 2019057908 A JP2019057908 A JP 2019057908A JP 2018123774 A JP2018123774 A JP 2018123774A JP 2018123774 A JP2018123774 A JP 2018123774A JP 2019057908 A JP2019057908 A JP 2019057908A
Authority
JP
Japan
Prior art keywords
image
viewpoint image
viewpoint
processing
contrast
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2018123774A
Other languages
Japanese (ja)
Other versions
JP2019057908A5 (en
JP7204357B2 (en
Inventor
暁彦 上田
Akihiko Ueda
暁彦 上田
嘉人 玉木
Yoshito Tamaki
嘉人 玉木
英之 浜野
Hideyuki Hamano
英之 浜野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to US16/123,672 priority Critical patent/US10964739B2/en
Publication of JP2019057908A publication Critical patent/JP2019057908A/en
Publication of JP2019057908A5 publication Critical patent/JP2019057908A5/ja
Application granted granted Critical
Publication of JP7204357B2 publication Critical patent/JP7204357B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

To provide an imaging apparatus capable of suppressing capacity of data to be recorded.SOLUTION: An imaging apparatus includes: an image acquisition unit 151 that acquires a plurality of viewpoint images; an operation information acquisition unit 154 that acquires imaging conditions when the viewpoint image is captured; and a compression unit 161 that compresses the viewpoint image to be recorded on a flash memory 133. The compression unit 161 compresses the viewpoint image according to the imaging conditions such as ISO sensitivity and an aperture value or a value of contrast information corresponding to a contrast distribution. The compression unit 161 changes a compression rate for compressing the viewpoint image according to the imaging conditions or the value of the contrast information.SELECTED DRAWING: Figure 19

Description

本発明は、撮像装置およびその制御方法に関する。   The present invention relates to an imaging apparatus and a control method thereof.

撮像装置に採用される撮像面位相差方式では、撮像素子に形成された焦点検出画素により位相差方式の焦点検出が行われる。特許文献1に開示された撮像装置は、1つの画素に対して、1つのマイクロレンズと複数に分割された光電変換部が形成されている2次元撮像素子を用いる。複数に分割された光電変換部は、1つのマイクロレンズを介して撮影レンズの射出瞳の異なる領域を受光するように構成され、瞳分割を行う。各光電変換部が受光した光から視点信号を生成する。複数の視点信号間の視差から像ずれ量を算出してデフォーカス量に換算することで、位相差方式の焦点検出が行われる。特許文献2では、複数に分割された光電変換部によって生成された複数の視点信号を加算することで、撮像信号を生成することが開示されている。   In the imaging surface phase difference method employed in the imaging apparatus, focus detection by the phase difference method is performed by focus detection pixels formed on the imaging element. The imaging apparatus disclosed in Patent Document 1 uses a two-dimensional imaging element in which one microlens and a plurality of photoelectric conversion units are formed for one pixel. The photoelectric conversion units divided into a plurality are configured to receive different regions of the exit pupil of the photographing lens through one microlens, and perform pupil division. A viewpoint signal is generated from the light received by each photoelectric conversion unit. By calculating an image shift amount from the parallax between a plurality of viewpoint signals and converting it to a defocus amount, phase difference type focus detection is performed. Patent Document 2 discloses that an imaging signal is generated by adding a plurality of viewpoint signals generated by a plurality of divided photoelectric conversion units.

複数の視点信号を包含するファイルを生成する場合、通常よりも画像ファイルのデータサイズが大きくなり、記録メディア容量を圧迫してしまう。特願2016−094020号では、視点信号に基づく所定の処理の実行後、視点信号が必要でなくなった場合に削除する制御方法が開示されている。   When a file including a plurality of viewpoint signals is generated, the data size of the image file becomes larger than usual, and the recording medium capacity is compressed. Japanese Patent Application No. 2006-094020 discloses a control method for deleting a viewpoint signal when it is no longer necessary after executing a predetermined process based on the viewpoint signal.

米国特許第4410804号明細書US Pat. No. 4,410,804 特開2001−083407号公報JP 2001-083407 A

しかしながら、特許文献3では、カメラ内で視点信号に基づく所定の処理を実行した後に視点信号の記録の有無を判定する為、撮影直後には記録メディア容量を圧迫してしまう。また、カメラ内で視点信号に基づく所定の処理を実行しない場合には、視点信号を記録メディアに保存するしかないため、記録メディアの容量を圧迫してしまう。   However, in Patent Document 3, since the presence / absence of recording of the viewpoint signal is determined after executing predetermined processing based on the viewpoint signal in the camera, the recording medium capacity is pressed immediately after shooting. Further, when the predetermined processing based on the viewpoint signal is not executed in the camera, the viewpoint signal can only be stored in the recording medium, and thus the capacity of the recording medium is compressed.

本発明は、記録するデータ容量を抑制することが可能な撮像装置を提供することを目的とする。   An object of the present invention is to provide an imaging device capable of suppressing the data volume to be recorded.

上記課題を解決するために、本発明の撮像装置は、複数の視点画像を取得する取得手段と、前記視点画像を撮影した際の撮影条件を取得する撮影条件取得手段と、記録手段に記録する前記視点画像を圧縮する圧縮手段と、を備える。前記圧縮手段は、前記撮影条件に応じて、前記視点画像を圧縮する。   In order to solve the above-described problems, an imaging apparatus according to the present invention records an acquisition unit that acquires a plurality of viewpoint images, an imaging condition acquisition unit that acquires imaging conditions when the viewpoint image is captured, and a recording unit. Compression means for compressing the viewpoint image. The compression means compresses the viewpoint image according to the photographing condition.

また、上記課題を解決するために、本発明の撮像装置は、複数の視点画像を取得する取得手段と、前記視点画像を撮影した際の撮影条件を取得する撮影条件取得手段と、記録手段に記録するデータを決定する決定手段と、を備え、前記決定手段は、前記撮影条件に応じて、前記視点画像を前記記録手段に記録するか否か決定する。   In order to solve the above problems, an imaging apparatus according to the present invention includes an acquisition unit that acquires a plurality of viewpoint images, an imaging condition acquisition unit that acquires imaging conditions when the viewpoint images are captured, and a recording unit. Determining means for determining data to be recorded, and the determining means determines whether or not to record the viewpoint image in the recording means in accordance with the photographing condition.

本発明によれば、記録するデータ容量を抑制することが可能な撮像装置を提供することができる。   ADVANTAGE OF THE INVENTION According to this invention, the imaging device which can suppress the data capacity to record can be provided.

撮像装置の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of an imaging device. 画像処理回路の構成を示すブロック図である。It is a block diagram which shows the structure of an image processing circuit. 画素配列の概略図である。It is the schematic of a pixel arrangement | sequence. 画素の概略平面図および概略断面図である。It is the schematic plan view and schematic sectional drawing of a pixel. 画素と瞳分割の概略説明図である。It is a schematic explanatory drawing of a pixel and pupil division. 画素内部の光強度分布例を示す図である。It is a figure which shows the example of light intensity distribution inside a pixel. 瞳強度分布を例示する図である。It is a figure which illustrates pupil intensity distribution. 撮像素子と瞳分割の概略説明図である。It is a schematic explanatory drawing of an image pick-up element and pupil division. デフォーカス量と、像ずれ量の概略関係図である。FIG. 6 is a schematic relationship diagram between a defocus amount and an image shift amount. 撮像画像のコントラスト分布の例を示す図である。It is a figure which shows the example of the contrast distribution of a captured image. 視点画像間の差を拡大した視差強調の例を説明する図である。It is a figure explaining the example of the parallax emphasis which expanded the difference between viewpoint images. リフォーカス処理の概略を説明する図である。It is a figure explaining the outline of a refocus process. アンシャープネス処理の概要を説明する図である。It is a figure explaining the outline | summary of an unsharpness process. リフォーカス可能範囲を説明する図である。It is a figure explaining the refocus possible range. 視点移動処理の原理を説明する図である。It is a figure explaining the principle of a viewpoint movement process. 撮像素子の周辺像高における瞳ずれを説明する図である。It is a figure explaining the pupil shift in the peripheral image height of an image sensor. 情報を記録する処理を示すフローチャートである。It is a flowchart which shows the process which records information. 記録する情報を決定する処理を示すフローチャートである。It is a flowchart which shows the process which determines the information to record. 視点画像を圧縮する処理を示すフローチャートである。It is a flowchart which shows the process which compresses a viewpoint image.

(第1実施形態)
図1は、撮像素子を有する撮像装置の構成例を示すブロック図である。なお、以下ではLFデータを取得可能な任意のデジタルカメラ等の撮像装置に適用した場合の実施形態を説明するが、本発明は、LFデータを処理可能な画像処理装置や情報処理装置、電子機器等に幅広く適用可能である。また、任意の機器がネットワーク上のプロセッサー等の処理手段を備えたサーバ機器(仮想マシンを含む)にLFデータと操作内容を送信し、LFデータに対する処理の一部又は全部をサーバ機器で実行する構成が含まれていてもよい。
(First embodiment)
FIG. 1 is a block diagram illustrating a configuration example of an imaging apparatus having an imaging element. In the following, an embodiment in which the present invention is applied to an imaging device such as an arbitrary digital camera capable of acquiring LF data will be described. Etc. can be widely applied. Also, an arbitrary device transmits LF data and operation contents to a server device (including a virtual machine) provided with processing means such as a processor on the network, and a part or all of the processing for the LF data is executed by the server device. A configuration may be included.

撮像装置は、第1レンズ群101、絞り兼用シャッタ102、第2レンズ群103、第3レンズ群105、光学的ローパスフィルタ106、撮像素子107、電子フラッシュ115およびAF補助光源116を備える。また、撮像装置は、ズームアクチュエータ111、絞りシャッタアクチュエータ112、フォーカスアクチュエータ114、CPU121、各種回路122〜129、表示部131、操作部132およびフラッシュメモリ133を備える。   The imaging apparatus includes a first lens group 101, a diaphragm / shutter 102, a second lens group 103, a third lens group 105, an optical low-pass filter 106, an imaging element 107, an electronic flash 115, and an AF auxiliary light source 116. The imaging apparatus also includes a zoom actuator 111, an aperture shutter actuator 112, a focus actuator 114, a CPU 121, various circuits 122 to 129, a display unit 131, an operation unit 132, and a flash memory 133.

第1レンズ群101は、撮像光学系(結像光学系)の前端部に配置され、レンズ鏡筒にて光軸方向に進退可能に保持される。絞り兼用シャッタ102は、開口径を調節することで撮影時の光量調節を行う他、静止画撮影時には露光秒時調節用シャッタとしての機能をもつ。第2レンズ群103は、絞り兼用シャッタ102と一体となって光軸方向に進退し、第1レンズ群101の進退動作との連動により、変倍動作を行い、ズーム機能を実現する。第3レンズ群105は、光軸方向の進退により焦点調節を行うフォーカスレンズである。光学的ローパスフィルタ106は、撮影画像の偽色やモアレを軽減するための光学素子である。撮像素子107は、例えば2次元CMOS(相補型金属酸化膜半導体)フォトセンサと周辺回路を備え、撮像光学系の結像面に配置される。   The first lens group 101 is disposed at the front end of the imaging optical system (imaging optical system), and is held by a lens barrel so as to be able to advance and retract in the optical axis direction. The iris / shutter 102 adjusts the light amount at the time of shooting by adjusting the aperture diameter, and also has a function as an exposure time adjustment shutter at the time of still image shooting. The second lens group 103 moves forward and backward in the optical axis direction integrally with the diaphragm / shutter 102 and performs a zooming operation in conjunction with the forward / backward movement of the first lens group 101 to realize a zoom function. The third lens group 105 is a focus lens that performs focus adjustment by advancing and retreating in the optical axis direction. The optical low-pass filter 106 is an optical element for reducing false colors and moire in the captured image. The imaging element 107 includes, for example, a two-dimensional CMOS (complementary metal oxide semiconductor) photosensor and a peripheral circuit, and is disposed on the imaging plane of the imaging optical system.

ズームアクチュエータ111は、レンズ鏡筒のカム筒を回動させることで、第1レンズ群101および第2レンズ群103を光軸方向に移動させて変倍動作を行う。絞りシャッタアクチュエータ112は、絞り兼用シャッタ102の開口径を制御して撮影光量を調節すると共に、静止画撮影時の露光時間制御を行う。フォーカスアクチュエータ114は、第3レンズ群105を光軸方向に移動させて焦点調節動作を行う。   The zoom actuator 111 rotates the cam barrel of the lens barrel to move the first lens group 101 and the second lens group 103 in the optical axis direction and perform a zooming operation. The aperture shutter actuator 112 controls the aperture diameter of the aperture / shutter 102 to adjust the amount of photographing light, and controls the exposure time during still image photographing. The focus actuator 114 performs the focus adjustment operation by moving the third lens group 105 in the optical axis direction.

被写体照明用の電子フラッシュ115は、撮影時に使用し、キセノン管を用いた閃光照明装置または連続発光するLED(発光ダイオード)を備えた照明装置が用いられる。AF(オートフォーカス)補助光源116は、所定の開口パターンを有したマスクの像を、投光レンズを介して被写界に投影する。これにより、低輝度の被写体または低コントラストの被写体に対する焦点検出能力が向上する。   The electronic flash 115 for illuminating the subject is used at the time of photographing, and a flash illumination device using a xenon tube or an illumination device including an LED (light emitting diode) that emits light continuously is used. An AF (autofocus) auxiliary light source 116 projects an image of a mask having a predetermined opening pattern onto a subject field via a light projection lens. This improves the focus detection capability for low-luminance subjects or low-contrast subjects.

カメラ本体部の制御部を構成するCPU(中央演算処理装置)121は、種々の制御を司る制御中枢機能をもつ。CPU121は、演算部、ROM(リード・オンリー・メモリ)、RAM(ランダム・アクセス・メモリ)、A(アナログ)/D(デジタル)コンバータ、D/Aコンバータ、通信インターフェイス回路等を有する。CPU121は、ROMに記憶された所定のプログラムに従って、撮像装置内の各種回路を駆動し、AF制御、撮像処理、画像処理、記録処理等の一連の動作を実行する。AF制御では撮像光学系の焦点状態検出および焦点調節の制御が行われる。   A CPU (Central Processing Unit) 121 that constitutes a control unit of the camera body has a control center function that controls various controls. The CPU 121 includes an arithmetic unit, a ROM (read only memory), a RAM (random access memory), an A (analog) / D (digital) converter, a D / A converter, a communication interface circuit, and the like. The CPU 121 drives various circuits in the imaging apparatus according to a predetermined program stored in the ROM, and executes a series of operations such as AF control, imaging processing, image processing, and recording processing. In AF control, focus state detection and focus adjustment of the imaging optical system are performed.

電子フラッシュ制御回路122は、CPU121の制御指令に従い、撮影動作に同期して電子フラッシュ115を点灯制御する。補助光源駆動回路123は、CPU121の制御指令に従い、焦点検出動作に同期してAF補助光源116を点灯制御する。撮像素子駆動回路124は、撮像素子107の撮像動作を制御するとともに、取得した撮像信号をA/D変換してCPU121に出力する。画像処理回路125は、CPU121の制御指令に従い、撮像素子107により取得された画像のガンマ変換、カラー補間、JPEG(Joint Photographic Experts Group)圧縮等の処理を行う。   The electronic flash control circuit 122 controls lighting of the electronic flash 115 in synchronization with the photographing operation in accordance with a control command from the CPU 121. The auxiliary light source driving circuit 123 controls lighting of the AF auxiliary light source 116 in synchronization with the focus detection operation in accordance with a control command from the CPU 121. The imaging element driving circuit 124 controls the imaging operation of the imaging element 107, A / D converts the acquired imaging signal, and outputs it to the CPU 121. The image processing circuit 125 performs processing such as gamma conversion, color interpolation, and JPEG (Joint Photographic Experts Group) compression of an image acquired by the image sensor 107 in accordance with a control command of the CPU 121.

フォーカス駆動回路126は、CPU121の制御指令に従い、焦点検出結果に基づいてフォーカスアクチュエータ114を駆動し、第3レンズ群105を光軸方向に移動させて焦点調節を行う。絞りシャッタ駆動回路128は、CPU121の制御指令に従い、絞りシャッタアクチュエータ112を駆動し、絞り兼用シャッタ102の開口径を制御する。ズーム駆動回路129は、CPU121の制御指令に従い、撮影者のズーム操作指示に応じてズームアクチュエータ111を駆動する。   The focus drive circuit 126 drives the focus actuator 114 based on the focus detection result in accordance with the control command of the CPU 121, and moves the third lens group 105 in the optical axis direction to perform focus adjustment. The aperture shutter drive circuit 128 drives the aperture shutter actuator 112 in accordance with a control command from the CPU 121 to control the aperture diameter of the aperture / shutter 102. The zoom drive circuit 129 drives the zoom actuator 111 in accordance with a photographer's zoom operation instruction in accordance with a control command from the CPU 121.

表示部131は、LCD(液晶表示装置)等の表示デバイスを有し、撮像装置の撮影モードに関する情報、撮影前のプレビュー画像と撮影後の確認用画像、焦点検出時の合焦状態表示画像等を表示する。操作部132は、各種の操作スイッチを備え、操作指示信号をCPU121に出力する。フラッシュメモリ133は、カメラ本体部に着脱可能な記録媒体であり、撮影済み画像データ等を記録する。所定の画像データが表示部131の画面に表示され、またはフラッシュメモリ133に記録される。所定の画像データとは、例えば撮像素子107により撮像されてから画像処理回路125により処理された複数の視点画像データ、または複数の視点画像データを撮像素子107内または画像処理回路125内で合成した合成画像データである。   The display unit 131 includes a display device such as an LCD (Liquid Crystal Display), and information on the shooting mode of the imaging apparatus, a preview image before shooting and a confirmation image after shooting, a focus state display image at the time of focus detection, and the like. Is displayed. The operation unit 132 includes various operation switches and outputs an operation instruction signal to the CPU 121. The flash memory 133 is a recording medium that can be attached to and detached from the camera body, and records captured image data and the like. Predetermined image data is displayed on the screen of the display unit 131 or recorded in the flash memory 133. The predetermined image data is, for example, a plurality of viewpoint image data captured by the image sensor 107 and then processed by the image processing circuit 125, or a plurality of viewpoint image data synthesized in the image sensor 107 or the image processing circuit 125. This is composite image data.

図2は、画像処理回路125の構成例を示すブロック図である。画像処理回路125は、画像取得部151、減算部152、シェーディング処理部153、操作情報取得部154、視点変更処理部155およびリフォーカス処理部156を備える。また、画像処理回路125は、ホワイトバランス部157、デモザイキング部158、ガンマ変換部159、色調整部160、圧縮部161および出力部163を備える。   FIG. 2 is a block diagram illustrating a configuration example of the image processing circuit 125. The image processing circuit 125 includes an image acquisition unit 151, a subtraction unit 152, a shading processing unit 153, an operation information acquisition unit 154, a viewpoint change processing unit 155, and a refocus processing unit 156. The image processing circuit 125 includes a white balance unit 157, a demosaicing unit 158, a gamma conversion unit 159, a color adjustment unit 160, a compression unit 161, and an output unit 163.

画像取得部151は、フラッシュメモリ133から画像データを取得し、取得した画像データを保存する。画像データは、後述する第1視点画像と第2視点画像とを合成した撮像画像(A+B像)および第1視点画像(もしくは第2視点画像)である。減算部152は、撮像画像(A+B像)から第1視点画像(A像)を減算することで第2視点画像(B像)を生成する。   The image acquisition unit 151 acquires image data from the flash memory 133 and stores the acquired image data. The image data is a captured image (A + B image) and a first viewpoint image (or a second viewpoint image) obtained by combining a first viewpoint image and a second viewpoint image described later. The subtraction unit 152 generates a second viewpoint image (B image) by subtracting the first viewpoint image (A image) from the captured image (A + B image).

シェーディング処理部153は、第1の視点画像と第2の視点画像の像高による光量変化を補正する。操作情報取得部154は、ユーザがユーザインタフェースにて設定した視点移動とピント調整(リフォーカス)の調整値を受け取る。そして、操作情報取得部154は、ユーザが操作した調整値を、視点変更処理部155とリフォーカス処理部156へ転送する。また、操作情報取得部154は、撮影の際の撮影条件を取得する撮影条件取得手段としての機能も有する。撮影条件には、絞り値、ISO値、被写体距離などが含まれる。視点変更処理部155は、操作情報取得部154から取得した調整値に基づき、複数の視点画像を用いて画像処理を行う。視点変更処理部155は、第1視点画像と第2視点画像の加算比率(重み付け)を変更して視点を変更した画像や被写界深度を変更した画像を生成する。リフォーカス処理部156は、第1視点画像と第2視点画像とを瞳分割方向にシフト加算することにより合成画像を生成し、異なるピント位置の画像を生成する。   The shading processing unit 153 corrects the light amount change due to the image heights of the first viewpoint image and the second viewpoint image. The operation information acquisition unit 154 receives adjustment values for viewpoint movement and focus adjustment (refocus) set by the user on the user interface. Then, the operation information acquisition unit 154 transfers the adjustment value operated by the user to the viewpoint change processing unit 155 and the refocus processing unit 156. The operation information acquisition unit 154 also has a function as a shooting condition acquisition unit that acquires shooting conditions at the time of shooting. The shooting conditions include an aperture value, an ISO value, a subject distance, and the like. The viewpoint change processing unit 155 performs image processing using a plurality of viewpoint images based on the adjustment value acquired from the operation information acquisition unit 154. The viewpoint change processing unit 155 generates an image in which the viewpoint is changed or an image in which the depth of field is changed by changing the addition ratio (weighting) of the first viewpoint image and the second viewpoint image. The refocus processing unit 156 generates a composite image by shifting and adding the first viewpoint image and the second viewpoint image in the pupil division direction, and generates images at different focus positions.

次に、画像処理回路125において現像処理を行う構成要素について説明する。ホワイトバランス部157は、ホワイトバランス処理を行う。具体的には、白の領域のR,G,Bが等色になるようにR,G,Bの各色にゲインをかける。ホワイトバランス処理をデモザイキング処理前に行うことにより、彩度を算出する際に色かぶり等により偽色の彩度よりも高い彩度になることを回避し、誤判定を防止することができる。   Next, components that perform development processing in the image processing circuit 125 will be described. The white balance unit 157 performs white balance processing. Specifically, a gain is applied to each color of R, G, and B so that R, G, and B in the white region have the same color. By performing the white balance process before the demosaicing process, it is possible to avoid a saturation higher than the false color saturation due to a color cast or the like when calculating the saturation, thereby preventing erroneous determination.

デモザイキング部158は、各画素において欠落している3原色のうち2色のカラーモザイク画像データを補間することによって、全ての画素においてR,G,Bのカラー画像データが揃ったカラー画像を生成する。具体的には、まず注目画素に対してその周辺の画素を用いてそれぞれの規定方向で補間を行い、その後、方向選択を行うことで、各画素について補間処理結果としてR、G,Bの3原色のカラー画像信号を生成する。   The demosaicing unit 158 generates a color image in which R, G, and B color image data are arranged in all pixels by interpolating two color mosaic image data out of the three primary colors missing in each pixel. To do. Specifically, first, interpolation is performed on the target pixel in the respective specified directions using pixels around the target pixel, and then the direction is selected, so that R, G, and B of 3 as interpolation results for each pixel are obtained. A primary color image signal is generated.

ガンマ変換部159は、各画素のカラー画像データにガンマ補正処理を行い、基本的なカラー画像データを生成する。ガンマ変換部159は、例えば、基本的なカラー画像データとして表示部131の表示特性に整合させたカラー画像データを生成する。色調整部160は、画像の見栄えを改善するための処理である、ノイズ低減、彩度強調、色相補正、エッジ強調といった各種の色調整処理をカラー画像データに適用する。   The gamma conversion unit 159 performs gamma correction processing on the color image data of each pixel to generate basic color image data. For example, the gamma conversion unit 159 generates color image data matched with the display characteristics of the display unit 131 as basic color image data. The color adjustment unit 160 applies various color adjustment processes such as noise reduction, saturation enhancement, hue correction, and edge enhancement, which are processes for improving the appearance of the image, to the color image data.

圧縮部161は、色調整されたカラー画像データをJPEG等の所定の圧縮方式に準拠した方法で圧縮し、記録する際のカラー画像データのデータサイズを小さくする。出力部163は、カラー画像データ、圧縮された画像データ、ユーザインタフェース用の表示データなど各種画像データを撮像装置の表示部131や外部の表示装置、フラッシュメモリ133等に出力する。   The compression unit 161 compresses color-adjusted color image data by a method based on a predetermined compression method such as JPEG, and reduces the data size of the color image data when recording. The output unit 163 outputs various image data such as color image data, compressed image data, and display data for a user interface to the display unit 131 of the imaging device, an external display device, the flash memory 133, and the like.

図3は、撮像素子の画素と副画素の配列の概略図を示す図である。図3の左右方向をx軸方向とし、上下方向をy軸方向とし、x軸方向およびy軸方向に直交する方向(紙面に垂直な方向)をz軸方向と定義する。図3は、本実施形態の2次元CMOSセンサー(撮像素子)の画素配列を4列×4行の範囲で、副画素配列を8列×4行の範囲で示したものである。   FIG. 3 is a diagram illustrating a schematic diagram of an array of pixels and sub-pixels of the image sensor. The left-right direction in FIG. 3 is defined as the x-axis direction, the up-down direction is defined as the y-axis direction, and the direction perpendicular to the x-axis direction and the y-axis direction (direction perpendicular to the paper surface) is defined as the z-axis direction. FIG. 3 shows a pixel array of the two-dimensional CMOS sensor (imaging device) of this embodiment in a range of 4 columns × 4 rows and a sub-pixel array in a range of 8 columns × 4 rows.

図3に示した2列×2行の画素200では、R(赤)の分光感度を有する画素200Rが左上の位置に、G(緑)の分光感度を有する画素200Gが右上と左下の位置に、B(青)の分光感度を有する画素200Bが右下の位置に配置されている。さらに、各画素は、x軸方向に2分割、y軸方向に1分割された第1副画素201と第2副画素202を有している。つまり、x方向における分割数をNxと表記し、y方向における分割数をNyと表記し、分割数をNLFと表記すると、図3はNx=2、Ny=1、NLF=Nx×Ny=2の例を示している。副画素はそれぞれ、焦点検出信号を出力する焦点検出画素としての機能を有する。   In the two columns × two rows of pixels 200 shown in FIG. 3, the pixel 200R having R (red) spectral sensitivity is in the upper left position, and the pixel 200G having G (green) spectral sensitivity is in the upper right and lower left positions. , B (blue) has a pixel 200B having a spectral sensitivity at the lower right position. Further, each pixel has a first subpixel 201 and a second subpixel 202 that are divided into two in the x-axis direction and one in the y-axis direction. That is, if the number of divisions in the x direction is expressed as Nx, the number of divisions in the y direction is expressed as Ny, and the number of divisions is expressed as NLF, FIG. 3 shows Nx = 2, Ny = 1, NLF = Nx × Ny = 2. An example is shown. Each of the sub-pixels has a function as a focus detection pixel that outputs a focus detection signal.

図3に示す例では、4列×4行の画素(8列×4行の副画素)を面上に多数配置することで、表示部131での表示やフラッシュメモリ133への記録などにも用いる撮像画像(A+B像)および複数の視点画像を生成するための信号を取得可能である。本実施形態においては、画素の周期Pが4μm、画素数Nが横5575列×縦3725行=約2075万画素、副画素の列方向周期PSが2μm、副画素数NSが横11150列×縦3725行=約4150万画素の撮像素子として説明を行う。   In the example shown in FIG. 3, by arranging a large number of pixels of 4 columns × 4 rows (8 columns × 4 rows of sub-pixels) on the surface, it is possible to display on the display unit 131 or record in the flash memory 133. A captured image (A + B image) to be used and a signal for generating a plurality of viewpoint images can be acquired. In the present embodiment, the pixel period P is 4 μm, the number of pixels N is 5575 columns × 3725 rows = approximately 2075 million pixels, the column direction period PS of the subpixels is 2 μm, and the number of subpixels NS is 11150 columns × vertical. The description will be made assuming that 3725 rows = an image sensor having about 41.5 million pixels.

図4(A)は、図3に示す撮像素子の1つの画素200Gを、撮像素子の受光面側(+z側)から見た平面図である。図4(A)の紙面に垂直な方向にz軸を設定し、手前側をz軸の正方向と定義する。また、z軸に直交する上下方向にy軸を設定して上方をy軸の正方向とし、z軸およびy軸に直交する左右方向にx軸を設定して右方をx軸の正方向と定義する。図4(B)は、図4(A)のa−a切断線に沿って−y側から見た場合の断面図である。   4A is a plan view of one pixel 200G of the image sensor shown in FIG. 3 as viewed from the light receiving surface side (+ z side) of the image sensor. The z axis is set in a direction perpendicular to the paper surface of FIG. 4A, and the near side is defined as the positive direction of the z axis. Also, the y-axis is set in the vertical direction perpendicular to the z-axis, the upper direction is the positive direction of the y-axis, the x-axis is set in the horizontal direction perpendicular to the z-axis and the y-axis, and the right direction is the positive direction of the x-axis It is defined as FIG. 4B is a cross-sectional view when viewed from the −y side along the line aa in FIG.

図4(A)および図4(B)に示されるように、画素200Gには、各画素の受光面側(+z軸方向)に入射光を集光するためのマイクロレンズ305が形成されている。さらに、x方向に2分割、y方向に1分割された分割数2の複数の光電変換部が形成されている。第1光電変換部301と第2光電変換部302が、それぞれ、第1副画素201と第2副画素202に対応する。なお、光電変換部(副画素)の分割数については2に限定されない。分割の方向もx方向に限定されず、y方向に分割してもよい。   As shown in FIGS. 4A and 4B, the micro lens 305 for condensing incident light is formed on the pixel 200G on the light receiving surface side (+ z-axis direction) of each pixel. . Further, a plurality of photoelectric conversion units having two divisions, that is, two divisions in the x direction and one division in the y direction, are formed. The first photoelectric conversion unit 301 and the second photoelectric conversion unit 302 correspond to the first subpixel 201 and the second subpixel 202, respectively. Note that the number of divisions of the photoelectric conversion unit (subpixel) is not limited to two. The division direction is not limited to the x direction and may be divided in the y direction.

第1光電変換部301と第2光電変換部302は、2つの独立したpn接合フォトダイオードであり、p型層とn型層の間にイントリンシック層を挟んだpin構造フォトダイオードである。また、必要に応じてイントリンシック層を省略し、pn接合フォトダイオードとしてもよい。各画素には、マイクロレンズ305と、第1光電変換部301および第2光電変換部302との間に、カラーフィルター306が形成される。また、必要に応じて、画素毎や光電変換部毎(副画素毎)にカラーフィルター306の分光透過率を変えてもよいし、カラーフィルターを省略しても構わない。   The first photoelectric conversion unit 301 and the second photoelectric conversion unit 302 are two independent pn junction photodiodes, which are pin structure photodiodes in which an intrinsic layer is sandwiched between a p-type layer and an n-type layer. Further, if necessary, the intrinsic layer may be omitted to form a pn junction photodiode. In each pixel, a color filter 306 is formed between the microlens 305 and the first photoelectric conversion unit 301 and the second photoelectric conversion unit 302. Further, if necessary, the spectral transmittance of the color filter 306 may be changed for each pixel or each photoelectric conversion unit (for each sub-pixel), or the color filter may be omitted.

画素200Gに入射した光は、マイクロレンズ305により集光され、カラーフィルター306で分光されたのち、第1光電変換部301と第2光電変換部302それぞれで受光される。第1光電変換部301と第2光電変換部302では、受光量に応じて電子とホール(正孔)が対生成し、空乏層で分離された後、負電荷の電子はn型層(不図示)に蓄積される。一方、ホールは定電圧源(不図示)に接続されたp型層を通じて撮像素子外部へ排出される。第1光電変換部301と第2光電変換部302のn型層(不図示)に蓄積された電子は、転送ゲートを介して、静電容量部(FD)に転送され、電圧信号に変換される。   The light incident on the pixel 200 </ b> G is collected by the microlens 305, dispersed by the color filter 306, and then received by the first photoelectric conversion unit 301 and the second photoelectric conversion unit 302. In the first photoelectric conversion unit 301 and the second photoelectric conversion unit 302, a pair of electrons and holes are generated according to the amount of received light and separated by a depletion layer. Accumulated in the figure). On the other hand, the holes are discharged to the outside of the image sensor through a p-type layer connected to a constant voltage source (not shown). Electrons accumulated in the n-type layers (not shown) of the first photoelectric conversion unit 301 and the second photoelectric conversion unit 302 are transferred to the capacitance unit (FD) via the transfer gate and converted into a voltage signal. The

図5は、画素構造と瞳分割との対応関係を示す概略説明図である。図5には、図4(A)に示した画素構造のa−a切断線での断面を+y側から見た断面図と、結像光学系の射出瞳面を−z軸方向から見た図を示す。図5では、射出瞳面の座標軸と対応を取るために、断面図のx軸とy軸を図4に示す状態に対して反転させて示している。撮像素子は、撮影レンズ(結像光学系)の結像面近傍に配置され、被写体からの光束は、結像光学系の射出瞳400を通過して、それぞれの画素に入射する。撮像素子が配置された面を撮像面とする。   FIG. 5 is a schematic explanatory diagram showing the correspondence between the pixel structure and pupil division. FIG. 5 is a cross-sectional view of the pixel structure shown in FIG. 4A taken along the line aa, viewed from the + y side, and the exit pupil plane of the imaging optical system viewed from the −z-axis direction. The figure is shown. In FIG. 5, in order to correspond to the coordinate axis of the exit pupil plane, the x axis and the y axis of the cross-sectional view are shown inverted with respect to the state shown in FIG. 4. The imaging element is disposed in the vicinity of the imaging surface of the photographing lens (imaging optical system), and the light flux from the subject passes through the exit pupil 400 of the imaging optical system and enters each pixel. The surface on which the image sensor is arranged is defined as an image capturing surface.

第1副画素201の第1瞳部分領域501は、重心が−x方向に偏心している第1光電変換部301の受光面と、マイクロレンズ305によって、概ね光学的に共役関係になっている。第1瞳部分領域501は、第1副画素201で受光可能な瞳領域を表している。第1副画素201の第1瞳部分領域501は、瞳面上で+X側に重心が偏心している。
第2副画素202の第2瞳部分領域502は、重心が+x方向に偏心している第2光電変換部302の受光面と、マイクロレンズ305によって、概ね光学的に共役関係になっている。第2瞳部分領域502は、第2副画素202で受光可能な瞳領域を表している。第2副画素202の第2瞳部分領域502は、瞳面上で−X側に重心が偏心している。
The first pupil partial region 501 of the first subpixel 201 is substantially optically conjugate with the light receiving surface of the first photoelectric conversion unit 301 whose center of gravity is decentered in the −x direction and the microlens 305. The first pupil partial area 501 represents a pupil area that can be received by the first subpixel 201. The first pupil partial region 501 of the first subpixel 201 has a center of gravity decentered on the + X side on the pupil plane.
The second pupil partial region 502 of the second subpixel 202 is substantially optically conjugate with the light receiving surface of the second photoelectric conversion unit 302 whose center of gravity is decentered in the + x direction and the microlens 305. The second pupil partial area 502 represents a pupil area that can be received by the second subpixel 202. The center of gravity of the second pupil partial region 502 of the second subpixel 202 is decentered toward the −X side on the pupil plane.

瞳領域500は、第1光電変換部301と第2光電変換部302を全て合わせた受光面と、マイクロレンズ305によって、概ね光学的に共役な関係になっている。瞳領域500は、第1副画素201と第2副画素202を全て合わせた画素200G全体で受光可能な瞳領域である。   The pupil region 500 has a substantially optically conjugate relationship by the light receiving surface where all of the first photoelectric conversion unit 301 and the second photoelectric conversion unit 302 are combined with the microlens 305. The pupil region 500 is a pupil region that can receive light in the entire pixel 200G including all of the first subpixel 201 and the second subpixel 202.

図6は、各画素に形成されたマイクロレンズに、光が入射した場合の光強度分布の例を示す図である。図6(A)はマイクロレンズの光軸に平行な断面での光強度分布を示す。図6(B)はマイクロレンズの焦点位置において、マイクロレンズの光軸に垂直な断面での光強度分布を示す。入射光は、マイクロレンズにより、焦点位置に集光される。しかし、光の波動性による回折の影響のため、集光スポットの直径は回折限界Δより小さくすることはできず、有限の大きさとなる。光電変換部の受光面サイズは約1〜2μm程度であり、これに対してマイクロレンズの集光スポットが約1μm程度である。そのため、光電変換部の受光面とマイクロレンズを介して共役の関係にある、図5の第1瞳部分領域501と第2瞳部分領域502は、回折ボケのため、明瞭に瞳分割されず、光の入射角に依存した受光率分布(瞳強度分布)となる。   FIG. 6 is a diagram illustrating an example of a light intensity distribution when light is incident on the microlens formed in each pixel. FIG. 6A shows a light intensity distribution in a cross section parallel to the optical axis of the microlens. FIG. 6B shows the light intensity distribution in a cross section perpendicular to the optical axis of the microlens at the focal position of the microlens. Incident light is condensed at the focal position by the microlens. However, due to the influence of diffraction due to the wave nature of light, the diameter of the focused spot cannot be made smaller than the diffraction limit Δ, and has a finite size. The size of the light receiving surface of the photoelectric conversion unit is about 1 to 2 μm, whereas the condensing spot of the microlens is about 1 μm. Therefore, the first pupil partial region 501 and the second pupil partial region 502 in FIG. 5 that are in a conjugate relationship with the light receiving surface of the photoelectric conversion unit via the microlens are not clearly divided into pupils due to diffraction blur. The light reception rate distribution (pupil intensity distribution) depends on the incident angle of light.

図7は、光の入射角に依存した受光率分布(瞳強度分布)の例を示す図である。横軸は瞳座標を表し、縦軸は受光率を表す。図7に実線で示すグラフ線L1は、図5の第1瞳部分領域501のX軸に沿った瞳強度分布を表す。グラフ線L1で示す受光率は、左端から急峻に上昇してピークに到達した後で徐々に低下してから変化率が緩やかになって右端へと至る。また、図7に破線で示すグラフ線L2は、第2瞳部分領域502のX軸に沿った瞳強度分布を表す。グラフ線L2で示す受光率は、グラフ線L1とは反対(左右対称的)に、右端から急峻に上昇してピークに到達した後で徐々に低下してから変化率が緩やかになって左端へと至る。図示のように、緩やかに瞳分割されることがわかる。   FIG. 7 is a diagram illustrating an example of a light reception rate distribution (pupil intensity distribution) depending on the incident angle of light. The horizontal axis represents pupil coordinates, and the vertical axis represents the light reception rate. A graph line L1 indicated by a solid line in FIG. 7 represents a pupil intensity distribution along the X axis of the first pupil partial region 501 in FIG. The light reception rate indicated by the graph line L1 rises steeply from the left end and gradually decreases after reaching the peak, and then the rate of change becomes gentle and reaches the right end. A graph line L2 indicated by a broken line in FIG. 7 represents the pupil intensity distribution along the X axis of the second pupil partial region 502. The light reception rate indicated by the graph line L2 is opposite to the graph line L1 (symmetrical), and rises sharply from the right end and gradually decreases after reaching the peak, and then the rate of change becomes gradual to the left end. And so on. It can be seen that the pupil is gently divided as shown.

図8は、撮像素子と瞳分割との対応関係を示す概略図である。第1光電変換部301と第2光電変換部302が、それぞれ、第1副画素201と第2副画素202に対応する。撮像素子の各画素において、2×1分割された第1副画素201と第2副画素202は、それぞれ結像光学系の第1瞳部分領域501と第2瞳部分領域502の異なる瞳部分領域を通過した光束を受光する。すなわち、第1瞳部分領域501と第2瞳部分領域502の異なる瞳部分領域を通過した光束は、撮像素子の各画素にそれぞれ異なる角度で入射し、2×1分割された第1副画素201と第2副画素202でそれぞれ受光される。   FIG. 8 is a schematic diagram illustrating a correspondence relationship between the image sensor and pupil division. The first photoelectric conversion unit 301 and the second photoelectric conversion unit 302 correspond to the first subpixel 201 and the second subpixel 202, respectively. In each pixel of the imaging element, the first subpixel 201 and the second subpixel 202 divided by 2 × 1 are different pupil partial regions of the first pupil partial region 501 and the second pupil partial region 502 of the imaging optical system, respectively. The light beam that has passed through is received. That is, light beams that have passed through different pupil partial regions of the first pupil partial region 501 and the second pupil partial region 502 are incident on the pixels of the image sensor at different angles, and are divided into 2 × 1 first subpixels 201. And the second sub-pixel 202 receive light.

各副画素で受光された信号から、画素毎に第1副画素201と第2副画素202の中から特定の副画素の信号を選択することで、結像光学系の第1瞳部分領域501と第2瞳部分領域502の中の特定の瞳部分領域に対応した視点画像を生成できる。例えば、各画素において、第1副画素201の信号を選択することで、結像光学系の第1瞳部分領域501に対応した画素数Nの解像度を有する第1視点画像を生成できる。他の副画素でも同様である。本実施形態の撮像素子は、結像光学系の異なる瞳部分領域を通過する光束を受光する複数の光電変換部(副画素)が設けられた画素が複数配列された構造を有し、異なる瞳部分領域毎に複数の視点画像を生成することができる。   By selecting a signal of a specific subpixel from the first subpixel 201 and the second subpixel 202 for each pixel from signals received by each subpixel, the first pupil partial region 501 of the imaging optical system is selected. And a viewpoint image corresponding to a specific pupil partial region in the second pupil partial region 502 can be generated. For example, by selecting the signal of the first subpixel 201 in each pixel, a first viewpoint image having a resolution of N pixels corresponding to the first pupil partial region 501 of the imaging optical system can be generated. The same applies to other sub-pixels. The imaging device of the present embodiment has a structure in which a plurality of pixels provided with a plurality of photoelectric conversion units (sub-pixels) that receive light beams passing through different pupil partial regions of the imaging optical system are arranged, and different pupils A plurality of viewpoint images can be generated for each partial region.

本実施形態では、第1視点画像および第2視点画像は、それぞれベイヤー配列の画像となる。必要に応じて、第1視点画像、第2視点画像に、デモザイキング処理を行ってもよい。また、撮像素子の画素毎に、第1副画素201と第2副画素202の信号を加算して読み出すことで、有効画素数Nの解像度の撮像画像を生成することができる。   In the present embodiment, each of the first viewpoint image and the second viewpoint image is a Bayer array image. If necessary, demosaicing processing may be performed on the first viewpoint image and the second viewpoint image. Further, by adding and reading the signals of the first subpixel 201 and the second subpixel 202 for each pixel of the image sensor, a captured image having a resolution of N effective pixels can be generated.

次に、本実施形態の撮像素子により取得される第1視点画像と第2視点画像のデフォーカス量と像ずれ量の関係について説明する。図9は、第1視点画像と第2視点画像のデフォーカス量と第1視点画像と第2視点画像間の像ずれ量の概略関係を示す図である。撮像面600に撮像素子(不図示)が配置され、図5、図8の場合と同様に、結像光学系の射出瞳が、第1瞳部分領域501と第2瞳部分領域502に2×1分割される。   Next, the relationship between the defocus amount and the image shift amount between the first viewpoint image and the second viewpoint image acquired by the image sensor of the present embodiment will be described. FIG. 9 is a diagram illustrating a schematic relationship between the defocus amounts of the first viewpoint image and the second viewpoint image and the image shift amount between the first viewpoint image and the second viewpoint image. An imaging element (not shown) is arranged on the imaging surface 600, and the exit pupil of the imaging optical system is 2 × in the first pupil partial region 501 and the second pupil partial region 502, as in the case of FIGS. Divided into one.

デフォーカス量dは、その大きさ|d|が被写体像の結像位置から撮像面600までの距離を表す。被写体の結像位置が撮像面より被写体側にある前ピン状態を負符号(d<0)、被写体の結像位置が撮像面より被写体の反対側にある後ピン状態を正符号(d>0)として向きを定義する。被写体の結像位置が撮像面(合焦位置)にある合焦状態は、d=0である。図9で、被写体801は合焦状態(d=0)のに対応する位置の例を示しており、被写体802は前ピン状態(d<0)のに対応する位置の例を示している。以下では、前ピン状態(d<0)と後ピン状態(d>0)を合わせて、デフォーカス状態(|d|>0)という。   The size | d | of the defocus amount d represents the distance from the imaging position of the subject image to the imaging surface 600. A negative sign (d <0) indicates a front pin state where the imaging position of the subject is on the subject side from the imaging surface, and a positive sign indicates a rear pin state where the imaging position of the subject is on the opposite side of the subject from the imaging surface (d> 0). ) To define the orientation. An in-focus state where the imaging position of the subject is on the imaging surface (in-focus position) is d = 0. In FIG. 9, the subject 801 shows an example of the position corresponding to the in-focus state (d = 0), and the subject 802 shows the example of the position corresponding to the front pin state (d <0). Hereinafter, the front pin state (d <0) and the rear pin state (d> 0) are collectively referred to as a defocus state (| d |> 0).

前ピン状態(d<0)では、被写体802からの光束のうち、第1瞳部分領域501(または第2瞳部分領域502)を通過した光束は、一度、集光した後、光束の重心位置G1(G2)を中心として幅Γ1(Γ2)に広がる。この場合、撮像面600上でボケ像となる。ボケ像は、撮像素子に配列された各画素を構成する第1副画素201(または第2副画素202)により受光され、第1視点画像(または第2視点画像)が生成される。よって、被写体802は、第1視点画像(または第2視点画像)では、撮像面600上の重心位置G1(またはG2)にて、ボケ幅Γ1(Γ2)をもった被写体像(ボケ像)の画像データとして記録される。   In the front pin state (d <0), the luminous flux that has passed through the first pupil partial area 501 (or the second pupil partial area 502) out of the luminous flux from the subject 802 is once condensed and then the gravity center position of the luminous flux. G1 (G2) extends around width Γ1 (Γ2). In this case, the image is blurred on the imaging surface 600. The blurred image is received by the first sub-pixel 201 (or the second sub-pixel 202) that constitutes each pixel arranged in the image sensor, and a first viewpoint image (or a second viewpoint image) is generated. Therefore, in the first viewpoint image (or second viewpoint image), the subject 802 is a subject image (blurred image) having a blur width Γ1 (Γ2) at the gravity center position G1 (or G2) on the imaging surface 600. Recorded as image data.

被写体像のボケ幅Γ1(またはΓ2)は、デフォーカス量dの大きさ|d|が増加するのに伴い、概ね比例して増加する。同様に、第1視点画像と第2視点画像間の被写体像の像ずれ量p(=光束の重心位置の差G1−G2)の大きさ|p|も、デフォーカス量dの大きさ|d|が増加するのに伴い、概ね比例して増加する。なお、後ピン状態(d>0)では、第1視点画像と第2視点画像間の被写体像の像ずれ方向が前ピン状態とは反対となるが、同様の傾向がある。   The blur width Γ1 (or Γ2) of the subject image increases substantially in proportion as the magnitude | d | of the defocus amount d increases. Similarly, the magnitude | p | of the image shift amount p of the subject image between the first viewpoint image and the second viewpoint image (= difference G1-G2 in the center of gravity of the light beam) is also the magnitude | d of the defocus amount d. As | increases, it increases approximately proportionally. In the rear pin state (d> 0), the image shift direction of the subject image between the first viewpoint image and the second viewpoint image is opposite to that in the front pin state, but there is a similar tendency.

したがって、本実施形態では、第1視点画像と第2視点画像、または、第1視点画像と第2視点画像を加算した撮像信号のデフォーカス量の大きさが増加するのに伴い、第1視点画像と第2視点画像間の像ずれ量の大きさが増加する。   Therefore, in this embodiment, as the magnitude of the defocus amount of the first viewpoint image and the second viewpoint image or the imaging signal obtained by adding the first viewpoint image and the second viewpoint image increases, The amount of image shift between the image and the second viewpoint image increases.

次に、視点画像を用いた画像処理について説明する。視点画像を用いた画像処理には、リフォーカス処理、視点移動処理、ボケ調整、不要成分低減処理などがある。
視点画像修正処理とリフォーカス処理について説明する。本実施形態のリフォーカス処理では、3段階の処理を実行する。第1段階として、視点変更処理部155が撮像画像の各画素値に基づくコントラストの高低を表すコントラスト分布を算出する。第2段階として、第1段階で算出したコントラスト分布に基づいて、視点変更処理部155が画素毎に複数の視点画像(第1視点画像と第2視点画像)間の差を拡大して視差を強調する変換を行う。この第2段階の処理により、複数の修正視点画像(第1修正視点画像と第2修正視点画像)が生成される。第3段階として、リフォーカス処理部156が複数の修正視点画像(第1修正視点画像と第2修正視点画像)を相対的にシフト加算して、リフォーカス画像を生成する。
Next, image processing using viewpoint images will be described. Image processing using viewpoint images includes refocus processing, viewpoint movement processing, blur adjustment, unnecessary component reduction processing, and the like.
The viewpoint image correction process and the refocus process will be described. In the refocus process of the present embodiment, three stages of processes are executed. As a first stage, the viewpoint change processing unit 155 calculates a contrast distribution representing the level of contrast based on each pixel value of the captured image. As the second stage, based on the contrast distribution calculated in the first stage, the viewpoint change processing unit 155 enlarges the difference between a plurality of viewpoint images (first viewpoint image and second viewpoint image) for each pixel, thereby reducing the parallax. Perform emphasis conversion. By this second stage process, a plurality of corrected viewpoint images (first corrected viewpoint image and second corrected viewpoint image) are generated. As a third stage, the refocus processing unit 156 relatively shift-adds a plurality of corrected viewpoint images (first corrected viewpoint image and second corrected viewpoint image) to generate a refocus image.

以下では、撮像素子107の行方向j番目、列方向i番目の位置を(j,i)と表記する。j,iは整数の変数である。また、位置(j,i)の画素の第1視点画像をA0(j,i)と表記し、第2視点画像をB0(j,i)と表記する。撮像画像をI(j,i)を表記し、I(j,i)=A0(j,i)+B0(j,i)とする。   Hereinafter, the j-th position in the row direction and the i-th position in the column direction of the image sensor 107 are denoted as (j, i). j and i are integer variables. The first viewpoint image of the pixel at the position (j, i) is denoted as A0 (j, i), and the second viewpoint image is denoted as B0 (j, i). The captured image is expressed as I (j, i), and I (j, i) = A0 (j, i) + B0 (j, i).

まず、コントラスト分布の算出について説明する。視点変更処理部155は、ベイヤー配列の撮像画像I(j,i)に対し、式(1)に従って、位置(j,i)ごとに各色RGBの色重心を一致させて、輝度Y(j,i)を算出する。
First, calculation of contrast distribution will be described. The viewpoint change processing unit 155 matches the color centroids of the respective colors RGB for each position (j, i) with respect to the Bayer array captured image I (j, i) according to the equation (1), thereby obtaining luminance Y (j, i) is calculated.

次に、視点変更処理部155は、輝度Y(j,i)に対して、瞳分割方向である水平方向(列i方向)に、[1,2,−1,−4,−1,2,1]などのラプラシアン型フィルタ処理を行い、水平方向の高周波成分dY(j,i)を算出する。視点変更処理部155は、必要に応じて、瞳分割方向ではない垂直方向(行j方向)には、[1,1,1,1,1,1,1]などの高周波カットフィルタ処理を行い、垂直方向の高周波ノイズを抑制してもよい。   Next, the viewpoint change processing unit 155 [1, 2, -1, -4, -1, 2] in the horizontal direction (column i direction) that is the pupil division direction with respect to the luminance Y (j, i). , 1] and the like, and a horizontal high-frequency component dY (j, i) is calculated. The viewpoint change processing unit 155 performs high-frequency cut filter processing such as [1, 1, 1, 1, 1, 1, 1] in the vertical direction (row j direction) that is not the pupil division direction, as necessary. The high frequency noise in the vertical direction may be suppressed.

次に、視点変更処理部155は、規格化(正規化)された水平方向の高周波成分dZ(j,i)を、式(2)に従って算出する。ここで、ゼロでない定数Y0を分母に加えることにより、0で除算することによって式(2)が発散することが防止される。視点変更処理部155は、必要に応じて、式(2)で規格化する前に、輝度Y(j,i)に高周波カットフィルタ処理を施して、高周波ノイズを抑制してもよい。
Next, the viewpoint change processing unit 155 calculates the normalized (normalized) horizontal high-frequency component dZ (j, i) according to the equation (2). Here, by adding a non-zero constant Y0 to the denominator, the division by 0 prevents the expression (2) from diverging. The viewpoint change processing unit 155 may suppress high-frequency noise by performing high-frequency cut filter processing on the luminance Y (j, i) as necessary before normalization by the equation (2).

視点変更処理部155は、コントラスト分布C(j,i)を、式(3)に従って算出する。式(3)の1行目は、撮像画像の輝度が所定輝度Ycよりも小さく、低輝度である場合、コントラスト分布C(j,i)を0とすることを示す。一方、式(3)の3行目は、規格化された高周波成分dZ(j,i)が所定値Zcより大きい場合、コントラスト分布C(j,i)を1とすることを示す。それ以外の場合は、式(3)の2行目で示すように、dZ(j,i)をZcで除算することで規格化した値がコントラスト分布C(j,i)となることを示す。
このように、コントラスト分布C(j,i)は、[0,1](0以上1以下)の範囲の値をとる。C(j,i)の値が、0に近いほどコントラストが低く、1に近いほどコントラストが高くなることを意味する。
The viewpoint change processing unit 155 calculates the contrast distribution C (j, i) according to the equation (3). The first line of Expression (3) indicates that the contrast distribution C (j, i) is set to 0 when the luminance of the captured image is lower than the predetermined luminance Yc and low. On the other hand, the third line of Equation (3) indicates that the contrast distribution C (j, i) is set to 1 when the normalized high-frequency component dZ (j, i) is larger than the predetermined value Zc. Otherwise, as shown in the second line of Equation (3), the value normalized by dividing dZ (j, i) by Zc is the contrast distribution C (j, i). .
Thus, the contrast distribution C (j, i) takes a value in the range of [0, 1] (0 to 1). The closer the value of C (j, i) is to 0, the lower the contrast is, and the closer it is to 1, the higher the contrast is.

図10は、式(3)によって得られる、撮像画像のコントラスト分布C(j,i)の一例を示す図である。図10に示す分布図では、右側のグレースケール表示にてコントラストの高低の指標を表している。白い部分は水平方向の高周波成分が多くコントラストが高いことを示し、黒い部分は水平方向の高周波成分が少なくコントラストが低いことを示している。   FIG. 10 is a diagram illustrating an example of the contrast distribution C (j, i) of the captured image obtained by Expression (3). In the distribution chart shown in FIG. 10, the contrast level index is represented by the gray scale display on the right side. The white part indicates that there are many horizontal high-frequency components and the contrast is high, and the black part indicates that there are few horizontal high-frequency components and the contrast is low.

次に、視差強調処理について説明する。視差強調処理では、まず視点画像の像ずれ分布を算出する。像ずれ分布は、第1視点画像A0と第2視点画像B0の1対の像に対して相関演算を行って、1対の像の相対的な位置ずれ量を計算することにより算出される。相関演算には、様々な公知の方法が知られているが、視点変更処理部155は、例えば、式(4)に示すような一対の像の差の絶対値を加算することにより、像の相関値を算出する。
ここで、A0、B0は、それぞれ第1視点画像A0、第2視点画像B0のi番目の画素の輝度を表す。またniは、演算に用いる画素数を表す数字で、像ずれ分布の最小演算範囲に応じて適切に設定される。
Next, the parallax enhancement process will be described. In the parallax enhancement processing, first, an image shift distribution of the viewpoint image is calculated. The image shift distribution is calculated by performing a correlation operation on a pair of images of the first viewpoint image A0 and the second viewpoint image B0 and calculating a relative positional shift amount of the pair of images. Various known methods are known for the correlation calculation. The viewpoint change processing unit 155, for example, adds the absolute values of the difference between a pair of images as shown in Expression (4), thereby, A correlation value is calculated.
Here, A0 i and B0 i represent the luminance of the i-th pixel of the first viewpoint image A0 and the second viewpoint image B0, respectively. Ni is a number representing the number of pixels used in the calculation, and is appropriately set according to the minimum calculation range of the image shift distribution.

視点変更処理部155は、例えば、式(4)のCOR(k)が最小となるkを、像ずれ量として算出する。すなわち、1対の像をk画素ずらした状態で、行方向のi番目の各A0画素とB0画素の差の絶対値を取り、その絶対値を行方向の複数画素について加算する。そして、視点変更処理部155は、加算された値、すなわちCOR(k)が最も小さくなるときのkをA0とB0の像ずれ量とみなし、ずらし量k画素を算出する。   For example, the viewpoint change processing unit 155 calculates k that minimizes COR (k) in Expression (4) as the image shift amount. That is, with the pair of images shifted by k pixels, the absolute value of the difference between each i-th A0 pixel and B0 pixel in the row direction is taken, and the absolute value is added to a plurality of pixels in the row direction. Then, the viewpoint change processing unit 155 considers the added value, that is, k when COR (k) is smallest, as the image shift amount of A0 and B0, and calculates the shift amount k pixels.

これに対し、2次元的な像を瞳分割方向のみにk画素分動かして第1視点画像A0の画素と第2視点画像B0の差分をとるようにし、複数列について加算する場合、相関演算は式(5)で定義される。
ここで、A0ij、B0ijは、それぞれ第1視点画像A0、第2視点画像B0のj列目i番目の画素の輝度を表す。また、niは演算に用いる画素数を表し、njは相関演算を行う1対の像の列方向の数を表す。
On the other hand, when the two-dimensional image is moved by k pixels only in the pupil division direction so as to take the difference between the pixels of the first viewpoint image A0 and the second viewpoint image B0, and the addition is performed for a plurality of columns, the correlation calculation is It is defined by equation (5).
Here, A0 ij and B0 ij represent the luminance of the i-th pixel in the j-th column of the first viewpoint image A0 and the second viewpoint image B0, respectively. Ni represents the number of pixels used in the calculation, and nj represents the number in the column direction of a pair of images on which the correlation calculation is performed.

視点変更処理部155は、式(4)と同様に、式(5)のCOR(k)が最小となるkを像ずれ量として算出する。なお、添え字kはiにのみ加算されてjとは無関係である。これは、2次元的な像を瞳分割方向のみに移動させながら相関演算をしていることに対応する。視点変更処理部155は、式(5)に従って第1視点画像A0、第2視点画像B0の各領域の像ずれ量を算出し、像ずれ分布を算出する。なお、後述する本実施例のリフォーカス処理では、高コントラスト部分のみに後述のシャープネス処理を行って、リフォーカス処理を行う。従って、上述したコントラスト分布の算出処理において、コントラスト分布C(j,i)が0である領域(すなわち所定輝度Ycよりも低輝度の位置)には、式(5)による相関演算を行わないようにしてもよい。   The viewpoint change processing unit 155 calculates k that minimizes COR (k) in Expression (5) as the image shift amount, similarly to Expression (4). Note that the subscript k is added only to i and is independent of j. This corresponds to performing the correlation calculation while moving the two-dimensional image only in the pupil division direction. The viewpoint change processing unit 155 calculates an image shift amount of each region of the first viewpoint image A0 and the second viewpoint image B0 according to the equation (5), and calculates an image shift distribution. In the refocus process of the present embodiment described later, the refocus process is performed by performing the sharpness process described later only on the high contrast portion. Therefore, in the above-described contrast distribution calculation process, the correlation calculation according to the equation (5) is not performed on the region where the contrast distribution C (j, i) is 0 (that is, a position having a luminance lower than the predetermined luminance Yc). It may be.

次に、具体的な視差強調処理の例について説明する。図7において瞳強度分布の例を示したように、画素ごとに形成されるマイクロレンズと複数に分割された光電変換部による瞳分割では、回折ボケのために、なだらかな瞳分割となる。そのため、複数の視点画像(第1視点画像と第2視点画像)の点像についても、なだらかな分割となり、視差がつきにくく、瞳分割方向の実効F値が十分に暗く(大きく)ならないため、実効的な焦点深度が深くなりにくい。そこで、本実施形態では、視点変更処理部155が、複数の視点画像(第1視点画像と第2視点画像)に対して、画素ごとに視点画像間の差を拡大して視差を強調する処理を行う。この視差を強調する処理により、複数の修正視点画像(第1修正視点画像と第2修正視点画像)が生成される。   Next, a specific example of parallax enhancement processing will be described. As shown in the example of the pupil intensity distribution in FIG. 7, the pupil division by the microlens formed for each pixel and the photoelectric conversion unit divided into a plurality is a gentle pupil division due to diffraction blur. Therefore, the point images of the plurality of viewpoint images (the first viewpoint image and the second viewpoint image) are also gently divided, are not easily parallax, and the effective F value in the pupil division direction is not sufficiently dark (large). Effective depth of focus is unlikely to be deep. Therefore, in the present embodiment, the viewpoint change processing unit 155 increases the difference between viewpoint images for each pixel and enhances parallax with respect to a plurality of viewpoint images (first viewpoint image and second viewpoint image). I do. A plurality of corrected viewpoint images (a first corrected viewpoint image and a second corrected viewpoint image) are generated by the process of enhancing the parallax.

視点変更処理部155は、第1視点画像A(j,i)と第2視点画像B(j,i)に対して、式(6)および式(7)に従って視点画像間の差を拡大し、視差を強調する処理を行う。そして、第1修正視点画像A(j,i)と第2修正視点画像B(j,i)を生成する。ここで、係数kは「0≦k≦1」を満たす実数とし、係数αは「0≦α≦1」を満たす実数とする。
The viewpoint change processing unit 155 calculates the difference between the viewpoint images according to Expression (6) and Expression (7) for the first viewpoint image A 0 (j, i) and the second viewpoint image B 0 (j, i). A process of enlarging and enhancing the parallax is performed. Then, a first modified viewpoint image A (j, i) and a second modified viewpoint image B (j, i) are generated. Here, the coefficient k is a real number that satisfies “0 ≦ k ≦ 1”, and the coefficient α is a real number that satisfies “0 ≦ α ≦ 1”.

なお、kとk、A1(j,i)とB1(j,i)は、第1修正視点画像A(j,i)と第2修正視点画像B(j,i)の算出過程で式(6)にて定義される変数である。A1(j,i)は、第1視点画像A(j,i)と第2視点画像B(j,i)に対して、kとkをそれぞれ乗算した項の和として算出される。またB(j,i)は、第1視点画像A(j,i)と第2視点画像B(j,i)に対して、kとkをそれぞれ乗算した項の和として算出される。 Note that k 1 and k 2 , A 1 (j, i) and B 1 (j, i) are calculated in the process of calculating the first modified viewpoint image A (j, i) and the second modified viewpoint image B (j, i). It is a variable defined by equation (6). A1 (j, i) is calculated as the sum of terms obtained by multiplying the first viewpoint image A 0 (j, i) and the second viewpoint image B 0 (j, i) by k 1 and k 2 respectively. The B 1 (j, i) is a sum of terms obtained by multiplying the first viewpoint image A 0 (j, i) and the second viewpoint image B 0 (j, i) by k 2 and k 1 , respectively. Calculated.

修正視点画像はそれぞれ、式(7)の右辺第1項と右辺第2項との和により算出される。つまり、右辺第1項は、A(j,i)またはB(j,i)と、それらの絶対値との平均値を示す項である。右辺第2項は、B(j,i)またはA(j,i)の絶対値と、B(j,i)またはA(j,i)との差分を2で除算して係数αを乗算した項である。 Each corrected viewpoint image is calculated by the sum of the first term on the right side and the second term on the right side of Equation (7). That is, the first term on the right side is a term indicating an average value of A 1 (j, i) or B 1 (j, i) and their absolute values. The second term on the right side, B 1 (j, i) or A 1 (j, i) of the absolute value, B 1 (j, i) or A 1 (j, i) by dividing the difference between the 2 This is a term multiplied by a coefficient α.

図11は、視差強調処理によって、視点画像間の差が拡大した例を示す図である。横軸は1152番目〜1156番目の画素を副画素(サブピクセル)単位で示し、縦軸は各画素における視差の大きさを示している。つまり、横軸は画素位置を表し、縦軸は画素値(信号レベル)を表す。図11においては、視差強調処理を行う前の第1視点画像A(修正前A)と第2視点画像B(修正前B)を破線で示す。また、式(4)および式(5)による視差強調処理を行った後の第1修正視点画像A(修正後A)と第2修正視点画像B(修正後B)の例を実線で示す。変換前に視点画像間の差が大きい部分は、より拡大され視差が強調されるが、変換前に視点画像間の差が小さい部分はあまり変化しない。 FIG. 11 is a diagram illustrating an example in which the difference between the viewpoint images is enlarged by the parallax enhancement processing. The horizontal axis indicates the 1152st to 1156th pixels in subpixel units, and the vertical axis indicates the magnitude of parallax in each pixel. That is, the horizontal axis represents the pixel position, and the vertical axis represents the pixel value (signal level). In FIG. 11, the first viewpoint image A 0 (before correction) A and the second viewpoint image B 0 (before correction B) before performing the parallax enhancement processing are indicated by broken lines. Moreover, the solid line shows an example of the first corrected viewpoint image A (after correction A) and the second corrected viewpoint image B (after correction B) after performing the parallax enhancement processing according to the expressions (4) and (5). The portion where the difference between the viewpoint images is large before the conversion is further enlarged and the parallax is emphasized, but the portion where the difference between the viewpoint images is small before the conversion is not changed so much.

以上のように、本実施形態では、視点変更処理部155は、複数の視点画像ごとに、複数の視点画像間の差を拡大して視差を強調する処理により、複数の修正視点画像を生成する。視点変更処理部155は、視差強調処理の負荷を抑制するために、式(6)および式(7)のように、画素内に含まれる複数の副画素の信号間の重み付け演算による変換を行う。   As described above, in the present embodiment, the viewpoint change processing unit 155 generates a plurality of corrected viewpoint images for each of the plurality of viewpoint images by a process of enlarging the difference between the plurality of viewpoint images and enhancing the parallax. . The viewpoint change processing unit 155 performs conversion by weighting calculation between signals of a plurality of sub-pixels included in a pixel, as in Expression (6) and Expression (7), in order to suppress the load of parallax enhancement processing. .

式(6)では、kの値を大きくして変換による視差強調の度合いを強くすると、複数の修正視点画像(第1修正視点画像と第2修正視点画像)間の視差が大きくなり、分割方向の実効F値を深く修正することができる。一方、視差強調の度合を過剰に強くすると、修正視点画像のノイズが増加し、S/N比(信号対ノイズ比)が低下してしまう。 そこで、本実施形態では、コントラスト分布C(j,i)に基づいて、視差強調の変換の強さを領域ごとに適応的に調整する。すなわち、視点変更処理部155は、コントラストが相対的に高い領域では、視差を大きくし、分割方向の実効F値を暗く(大きく)するため、視差強調の度合いを強くするように調整する。一方、コントラストが低い領域では、S/N比を維持するため、視差強調の強度を弱くするよう調整する。これにより、S/N比の低下を抑制してリフォーカス効果を向上させることができる。   In Expression (6), when the value of k is increased to increase the degree of parallax enhancement by conversion, the parallax between a plurality of corrected viewpoint images (first corrected viewpoint image and second corrected viewpoint image) increases, and the division direction The effective F value of can be deeply corrected. On the other hand, if the degree of parallax enhancement is excessively increased, the noise of the corrected viewpoint image increases and the S / N ratio (signal-to-noise ratio) decreases. Therefore, in the present embodiment, the strength of the parallax enhancement conversion is adaptively adjusted for each region based on the contrast distribution C (j, i). That is, the viewpoint change processing unit 155 adjusts to increase the degree of parallax enhancement in order to increase the parallax and darken (increase) the effective F value in the division direction in a region where the contrast is relatively high. On the other hand, in the region where the contrast is low, in order to maintain the S / N ratio, the parallax enhancement intensity is adjusted to be weak. As a result, it is possible to improve the refocus effect while suppressing a decrease in the S / N ratio.

視点変更処理部155は、必要に応じて、撮像画像の低輝度の領域よりも高輝度の領域における視差強調の強度を強く調整する処理を行い、S/N低下を抑制する。また、必要に応じて、撮像画像の高周波成分が少ない領域よりも高周波成分が多い領域において、視差強調の強度をより強く調整する処理を行い、S/N低下を抑制することができる。以上のように、複数の修正視点画像(第1修正視点画像と第2修正視点画像)間の視差を大きくすることで、分割方向の実効F値を暗く(大きく)し、分割方向の実効的な焦点深度を深く修正することができる。また、後述するリフォーカス処理では、複数の修正視点画像(第1修正視点画像と第2修正視点画像)を用いてリフォーカス画像を生成ことにより、リフォーカス効果を向上(リフォーカスによる画像の変化を強調)させることができる。   The viewpoint change processing unit 155 performs processing for strongly adjusting the intensity of parallax enhancement in a region with a higher luminance than a region with a low luminance of a captured image, as necessary, and suppresses a decrease in S / N. In addition, if necessary, a process for adjusting the intensity of parallax enhancement more strongly in a region where the high frequency component is larger than a region where the high frequency component of the captured image is small can be performed to suppress the S / N decrease. As described above, by increasing the parallax between the plurality of corrected viewpoint images (the first corrected viewpoint image and the second corrected viewpoint image), the effective F value in the dividing direction is darkened (increased), and the effective in the dividing direction is increased. Deep depth of focus can be corrected. Further, in the refocus processing described later, a refocus image is generated using a plurality of corrected viewpoint images (first corrected viewpoint image and second corrected viewpoint image), thereby improving the refocus effect (change in image due to refocusing). Can be emphasized).

次に、リフォーカス処理について説明する。図10は、複数の修正視点画像(第1修正視点画像と第2修正視点画像)による瞳分割方向(水平方向)のリフォーカス処理(第3の生成処理)について概要を示す説明図である。図12の撮像面600は、図8に示した撮像面600に対応している。図12では、iを整数の変数として、撮像面600に配置された撮像素子の列方向におけるi番目の画素の第1修正視点画像をAiと表記し、第2修正視点画像をBiと表記して、模式的に表している。第1修正視点画像Aiは、(図8の第1瞳部分領域501に対応した)主光線角度θaでi番目の画素に入射した光束の受光信号を含む。第2修正視点画像Biは、(図8の第2瞳部分領域502に対応した)主光線角度θbでi番目の画素に入射した光束の受光信号を含む。つまり、第1修正視点画像Aiと第2修正視点画像Biは、光強度分布情報に加えて入射角度情報も有している。   Next, the refocus process will be described. FIG. 10 is an explanatory diagram showing an overview of the refocusing process (third generation process) in the pupil division direction (horizontal direction) using a plurality of corrected viewpoint images (first corrected viewpoint image and second corrected viewpoint image). The imaging surface 600 in FIG. 12 corresponds to the imaging surface 600 shown in FIG. In FIG. 12, the first modified viewpoint image of the i-th pixel in the column direction of the image sensor arranged on the imaging surface 600 is denoted as Ai, and the second modified viewpoint image is denoted as Bi, where i is an integer variable. This is schematically shown. The first modified viewpoint image Ai includes a light reception signal of a light beam incident on the i-th pixel at the principal ray angle θa (corresponding to the first pupil partial region 501 in FIG. 8). The second modified viewpoint image Bi includes a light reception signal of a light beam incident on the i-th pixel at the principal ray angle θb (corresponding to the second pupil partial region 502 in FIG. 8). That is, the first modified viewpoint image Ai and the second modified viewpoint image Bi have incident angle information in addition to the light intensity distribution information.

第1修正視点画像Aiと第2修正視点画像Biは、光強度分布情報だけでなく、入射角度情報も有している。よって、リフォーカス処理部156は、所定の仮想的な結像面(仮想結像面610)におけるリフォーカス画像を生成することができる。リフォーカス処理部156は、平行移動処理および加算処理を行うことにより、仮想結像面610でのリフォーカス信号を生成する。   The first modified viewpoint image Ai and the second modified viewpoint image Bi have not only light intensity distribution information but also incident angle information. Therefore, the refocus processing unit 156 can generate a refocus image on a predetermined virtual imaging plane (virtual imaging plane 610). The refocus processing unit 156 generates a refocus signal on the virtual imaging plane 610 by performing parallel movement processing and addition processing.

具体的には、まず、リフォーカス処理部156は、第1修正視点画像Aiを主光線角度θaに沿って仮想結像面610まで平行移動させ、第2修正視点画像Biを主光線角度θbに沿って仮想結像面610まで平行移動させる処理を行う。次に、リフォーカス処理部156は、それぞれ平行移動させた第1修正視点画像Aiと第2修正視点画像Biを加算する処理を行う。   Specifically, first, the refocus processing unit 156 translates the first corrected viewpoint image Ai along the principal ray angle θa to the virtual imaging plane 610 and sets the second corrected viewpoint image Bi to the principal ray angle θb. A process of translating along the virtual imaging plane 610 along the line is performed. Next, the refocus processing unit 156 performs a process of adding the first modified viewpoint image Ai and the second modified viewpoint image Bi that have been translated.

第1修正視点画像Aiを角度θaに沿って仮想結像面610まで平行移動させることは、第1修正視点画像Aiを列方向に+0.5画素シフトすることに対応する。また、第2修正視点画像Biを角度θbに沿って仮想結像面610まで平行移動させることは、第2修正視点画像Biを列方向に−0.5画素シフトすることに対応する。したがって、第1修正視点画像Aiと第2修正視点画像Biを相対的に+1画素分シフトさせ、AiとBi+1を対応させて加算することで、仮想結像面610でのリフォーカス信号を生成できる。つまり、第1修正視点画像Aiと第2修正視点画像Biを整数の画素分だけシフトさせて画素ごとに加算することで、整数のシフト量に応じた各仮想結像面におけるリフォーカス画像を生成できる。   Translating the first modified viewpoint image Ai along the angle θa to the virtual imaging plane 610 corresponds to shifting the first modified viewpoint image Ai by +0.5 pixels in the column direction. Further, translating the second corrected viewpoint image Bi to the virtual imaging plane 610 along the angle θb corresponds to shifting the second corrected viewpoint image Bi by −0.5 pixels in the column direction. Therefore, the first modified viewpoint image Ai and the second modified viewpoint image Bi are relatively shifted by +1 pixel, and Ai and Bi + 1 are added in correspondence with each other, thereby generating a refocus signal on the virtual imaging plane 610. . That is, the first modified viewpoint image Ai and the second modified viewpoint image Bi are shifted by an integer number of pixels and added for each pixel, thereby generating a refocused image on each virtual imaging plane corresponding to the integer shift amount. it can.

リフォーカス処理部156は、式(8)に従って、第1修正視点画像Aと第2修正視点画像Bをシフト加算することにより、整数シフト量sに応じた各仮想結像面におけるリフォーカス画像I(j,i;s)を生成する。
本実施形態では、第1修正視点画像Aと第2修正視点画像Bはベイヤー配列で構成されるため、リフォーカス処理部156は、2の倍数のシフト量s=2n(n:整数)で、同色ごとに式(8)に従ったシフト加算を行う。すなわち、リフォーカス処理部156は、画像のベイヤー配列を保ったままリフォーカス画像I(j,i;s)を生成し、その後、生成したリフォーカス画像I(j,i;s)にデモザイキング処理を施す。
The refocus processing unit 156 shift-adds the first modified viewpoint image A and the second modified viewpoint image B according to the equation (8), thereby refocusing the image I on each virtual imaging plane according to the integer shift amount s. (J, i; s) is generated.
In the present embodiment, since the first corrected viewpoint image A and the second corrected viewpoint image B are configured in a Bayer array, the refocus processing unit 156 has a shift amount s = 2n (n: integer) that is a multiple of 2. Shift addition according to the equation (8) is performed for each color. That is, the refocus processing unit 156 generates the refocus image I (j, i; s) while maintaining the Bayer array of the image, and then demosaicing the generated refocus image I (j, i; s). Apply processing.

なお、リフォーカス処理部156は、必要に応じて、まず第1修正視点画像Aと第2修正視点画像Bとにデモザイキング処理を施し、デモザイキング処理後の第1修正視点画像と第2修正視点画像を用いてシフト加算処理を行ってもよい。また、リフォーカス処理部156は、必要に応じて、第1修正視点画像Aと第2修正視点画像Bの各画素間の補間信号を生成して、非整数シフト量に応じたリフォーカス画像を生成してもよい。これにより、仮想結像面の位置をより詳細な粒度で変更したリフォーカス画像を生成することができる。   Note that the refocus processing unit 156 first performs demosaicing processing on the first modified viewpoint image A and the second modified viewpoint image B as necessary, and the first modified viewpoint image and the second modified viewpoint image after the demosaicing processing. Shift addition processing may be performed using the viewpoint image. In addition, the refocus processing unit 156 generates an interpolated signal between the pixels of the first corrected viewpoint image A and the second corrected viewpoint image B as necessary, and generates a refocus image corresponding to the non-integer shift amount. It may be generated. Thereby, it is possible to generate a refocus image in which the position of the virtual imaging plane is changed with a more detailed granularity.

次に、リフォーカス処理部156が、より効果的なリフォーカス画像を生成するために適用する、シャープネス処理について説明する。シャープネス処理は、被写体の輪郭協調を行う処理である。上述したように、リフォーカス処理では、第1修正視点画像Aと第2修正視点画像Bとがシフト加算されて、仮想結像面におけるリフォーカス画像が生成される。シフト加算により第1修正視点画像Aと第2修正視点画像Bの像をずらすため、リフォーカス処理前の画像に対する相対的なずらし量(像ずらし量ともいう)が分かる。リフォーカス処理による整数シフト量sは、この像ずらし量に対応する。リフォーカス処理部156は、像ずらし量sに対応した領域にシャープネス処理を行うことにより、リフォーカス画像における被写体の輪郭強調を実現することができる。   Next, the sharpness process applied by the refocus processing unit 156 to generate a more effective refocus image will be described. The sharpness process is a process for performing contour coordination of a subject. As described above, in the refocus process, the first corrected viewpoint image A and the second corrected viewpoint image B are shift-added to generate a refocus image on the virtual imaging plane. Since the images of the first corrected viewpoint image A and the second corrected viewpoint image B are shifted by shift addition, the relative shift amount (also referred to as image shift amount) with respect to the image before the refocus processing can be known. The integer shift amount s by the refocus processing corresponds to this image shift amount. The refocus processing unit 156 can realize contour enhancement of the subject in the refocus image by performing sharpness processing on the area corresponding to the image shift amount s.

本実施形態では、例えば、シャープネス処理として、アンシャープマスク処理を用いる。図13は、アンシャープマスク処理の概要を説明する図である。アンシャープマスク処理では、注目画素を中心とした局所領域(元の信号)にぼかしフィルタを適用し、ぼかしフィルタ適用後の信号を生成する。そして、ぼかし処理を適用する前後の画素値の差分を注目画素の画素値に反映することにより、輪郭強調を実現する。   In this embodiment, for example, unsharp mask processing is used as sharpness processing. FIG. 13 is a diagram for explaining the outline of the unsharp mask process. In the unsharp mask process, a blur filter is applied to a local region (original signal) centered on the pixel of interest, and a signal after application of the blur filter is generated. Then, the edge enhancement is realized by reflecting the difference between the pixel values before and after applying the blurring process on the pixel value of the target pixel.

処理対象の画素値Pに対するアンシャープマスク処理は、式(9)に従って算出される。式(9)において、P'(i,j)は処理適用後の画素値、Rはぼかしフィルタの半径、T(i,j)は適用量(%)を表す。ぼかしフィルタの半径Rの大きさは、シャープネス処理を適用したい画像上の周波の波長に関係する。すなわち、Rが小さいほど細かい模様が強調され、Rが大きいほど緩やかな模様が強調される。
The unsharp mask process for the pixel value P to be processed is calculated according to Equation (9). In Equation (9), P ′ (i, j) is the pixel value after application of the processing, R is the radius of the blur filter, and T (i, j) is the application amount (%). The size of the radius R of the blur filter is related to the wavelength of the frequency on the image to which the sharpness processing is to be applied. That is, as R is smaller, a finer pattern is emphasized, and as R is larger, a gentler pattern is emphasized.

F(i,j,R)は、画素P(i,j)に対して半径Rのぼかしフィルタを適用して得られる画素値である。ぼかしフィルタには、公知の方法、例えば、ガウスぼかしを用いることができる。ガウスぼかしは、処理対象の画素からの距離に応じてガウス分布に従った重み付けを適用して平均化する処理であり、自然な処理結果を得ることができる。   F (i, j, R) is a pixel value obtained by applying a blurring filter having a radius R to the pixel P (i, j). A known method such as Gaussian blur can be used for the blur filter. Gaussian blur is a process of averaging by applying weighting according to a Gaussian distribution according to the distance from the pixel to be processed, and a natural processing result can be obtained.

適用量T(i,j)は、像ずれ分布に応じてアンシャープマスク処理による輪郭強調の適用量を変化させる値である。各画素の位置の像ずれ量をpred(i,j)とし、リフォーカス処理によるシフト量sとする。|s−pred(i,j)|が小さい値(例えば像ずれ1画素以内)となる領域、すなわち仮想結像面で合焦状態となる領域、では適用量Tを大きくする。一方、|s−pred(i,j)|が大きい値(例えば像ずれ量が3画素以上の場合)となる領域では、適用量Tを小さくする。このようにすることで、デフォーカス量が小さいピント位置または合焦近傍である領域には輪郭強調することができ、かつデフォーカス量が大きいボケ領域にはアンシャープマスク処理をかけないようにすることができる。つまり、リフォーカス処理によるピント位置の移動の効果をより強調することができる。   The application amount T (i, j) is a value that changes the application amount of contour enhancement by unsharp mask processing according to the image shift distribution. The image shift amount at the position of each pixel is pred (i, j), and the shift amount s by refocus processing is set. The application amount T is increased in a region where | s-pred (i, j) | is a small value (for example, within one pixel of image deviation), that is, a region in a focused state on the virtual imaging plane. On the other hand, the application amount T is decreased in a region where | s-pred (i, j) | is a large value (for example, when the image shift amount is 3 pixels or more). By doing this, it is possible to enhance the outline in the focus position where the defocus amount is small or in the vicinity of the focus, and not to apply the unsharp mask process to the blurred region where the defocus amount is large. be able to. That is, the effect of moving the focus position by the refocus processing can be further emphasized.

次に、リフォーカス可能範囲について説明する。リフォーカス可能範囲は、リフォーカス処理によって変更可能なピント位置の範囲である。図14は、本実施例に係るリフォーカス可能範囲を模式的に示す図である。許容錯乱円をδとし、結像光学系の絞り値をFとすると、絞り値Fにおける被写界深度は±F×δである。これに対して、N×N(例えば、2×1)に分割されて狭くなった第1瞳部分領域501(または第2瞳部分領域502)の水平方向の実効絞り値F01(またはF02)は、F01=N×F(またはF02=NH×F)となって暗くなる。第1修正視点画像(または第2修正視点画像)ごとの実効的な被写界深度は、±N×F×δで、N倍深くなり、合焦範囲がN倍に広がる。すなわち、実効的な被写界深度「±N×F×δ」の範囲内では、第1修正視点画像(または第2修正視点画像)ごとに合焦した被写体像が取得されている。よって、リフォーカス処理部156は、図12に示した主光線角度θa(またはθb)に沿って第1修正視点画像(第2修正視点画像)を平行移動させて加算するリフォーカス処理により、撮影後に、ピント位置を再調整(リフォーカス)することができる。 Next, the refocusable range will be described. The refocusable range is a range of focus positions that can be changed by the refocus processing. FIG. 14 is a diagram schematically illustrating a refocusable range according to the present embodiment. If the allowable circle of confusion is δ and the aperture value of the imaging optical system is F, the depth of field at the aperture value F is ± F × δ. On the other hand, the effective aperture value F 01 in the horizontal direction of the first pupil partial region 501 (or the second pupil partial region 502) narrowed by being divided into N H × N V (for example, 2 × 1) (or F 02 ) becomes darker as F 01 = N H × F (or F02 = NH × F). The effective depth of field for each first modified viewpoint image (or second modified viewpoint image) is ± N H × F × δ, which is N H times deeper, and the focus range is widened N H times. That is, within the range of the effective depth of field “± N H × F × δ”, a focused subject image is acquired for each first modified viewpoint image (or second modified viewpoint image). Therefore, the refocus processing unit 156 performs imaging by the refocus processing that translates and adds the first corrected viewpoint image (second corrected viewpoint image) along the principal ray angle θa (or θb) shown in FIG. Later, the focus position can be readjusted (refocused).

撮影後にピント位置を再調整(リフォーカス)可能な、撮像面からのデフォーカス量dは限定される。デフォーカス量dのリフォーカス可能範囲は、概ね、式(10)の範囲である。
The defocus amount d from the imaging surface that can readjust the focus position (refocus) after shooting is limited. The refocusable range of the defocus amount d is approximately the range of Expression (10).

許容錯乱円δは、例えば、δ=2・ΔX(画素周期ΔXのナイキスト周波数1/(2ΔX)の逆数)などで規定される。このように、リフォーカス可能範囲を算出することにより、ユーザ操作によってピント位置を変更(リフォーカス)する際の操作可能な範囲に対応させることができる。また、リフォーカス処理によって合焦させることのできる光線(被写体)を予め把握することができるため、例えば、所定の被写体がリフォーカス可能範囲に含まれるように、結像光学系の状態等の撮像条件を制御して再び撮影することも可能になる。   The allowable circle of confusion δ is defined by, for example, δ = 2 · ΔX (the reciprocal of the Nyquist frequency 1 / (2ΔX) of the pixel period ΔX). As described above, by calculating the refocusable range, it is possible to correspond to the operable range when the focus position is changed (refocused) by the user operation. Further, since the light beam (subject) that can be focused by the refocus processing can be grasped in advance, for example, imaging of the state of the imaging optical system or the like so that the predetermined subject is included in the refocusable range. It is also possible to take a picture again by controlling the conditions.

次に、視点移動処理について説明する。視点移動処理は、手前側の非主被写体のボケが主被写体に被る場合に、非主被写体によるボケを低減するため、視点変更処理部155によって実行される処理である。図15は、視点移動処理の概略を説明する図である。図15においては、撮像素子107が撮像面600に配置されており、図12と同様に、結像光学系の射出瞳が第1瞳部分領域501と第2瞳部分領域502とに2分割される。第1瞳部分領域501を通過した像が第1視点画像となり、第2瞳部分領域502を通過した像が第2視点画像となる。視点移動は、複数の光電変換部を有する撮像素子により取得された、複数の視点画像を用いて行われる。本実施形態では、第1視点画像と第2視点画像により視点移動を行い、合成画像を生成する。   Next, viewpoint movement processing will be described. The viewpoint movement process is a process executed by the viewpoint change processing unit 155 in order to reduce the blur due to the non-main subject when the non-main subject is blurred on the near side. FIG. 15 is a diagram for explaining the outline of the viewpoint movement process. In FIG. 15, the image sensor 107 is arranged on the imaging surface 600, and the exit pupil of the imaging optical system is divided into a first pupil partial region 501 and a second pupil partial region 502, as in FIG. The An image that has passed through the first pupil partial region 501 becomes a first viewpoint image, and an image that has passed through the second pupil partial region 502 becomes a second viewpoint image. The viewpoint movement is performed using a plurality of viewpoint images acquired by an image sensor having a plurality of photoelectric conversion units. In the present embodiment, viewpoint movement is performed using the first viewpoint image and the second viewpoint image to generate a composite image.

図15(A)は、主被写体q1の合焦像p1に、手前の被写体q2のボケ像Γ1+Γ2が重なって撮影され、撮影画像において遠近競合(主被写体への前ボケ被り)が生じている例である。図15(A)に示す例を、結像光学系の第1瞳部分領域501を通過する光束と、第2瞳部分領域502を通過する光束とに、それぞれ分けたものを、図10(B)および図10(C)に示す。   FIG. 15A shows an example in which a focused image p1 of the main subject q1 is overlaid with a blurred image Γ1 + Γ2 of the subject q2 in front, and perspective conflict (front blurring on the main subject) occurs in the captured image. It is. The example shown in FIG. 15A is divided into a light beam that passes through the first pupil partial region 501 and a light beam that passes through the second pupil partial region 502 of the imaging optical system. ) And FIG. 10 (C).

図15(B)では、主被写体q1からの光束は、第1瞳部分領域501を通過して、合焦状態で像p1に結像する。一方、手前の被写体q2からの光束は、第1瞳部分領域501を通過して、デフォーカス状態でボケ像Γ1に広がる。それぞれの光束は、撮像素子107の各画素の第1副画素201により受光され、第1視点画像が生成される。図15(B)に示すように、第1視点画像では、主被写体q1の像p1と手前の被写体q2のボケ像Γ1とは重ならずに受光される   In FIG. 15B, the light beam from the main subject q1 passes through the first pupil partial region 501 and forms an image p1 in a focused state. On the other hand, the light beam from the subject q2 on the near side passes through the first pupil partial region 501 and spreads in the blurred image Γ1 in the defocused state. Each light flux is received by the first sub-pixel 201 of each pixel of the image sensor 107, and a first viewpoint image is generated. As shown in FIG. 15B, in the first viewpoint image, the image p1 of the main subject q1 and the blurred image Γ1 of the subject q2 in front are received without overlapping.

図15(C)では、主被写体q1からの光束は、第2瞳部分領域502を通過して、合焦状態で像p1に結像する。一方、手前の被写体q2からの光束は、第2瞳部分領域502を通過して、デフォーカス状態でボケ像Γ2に広がる。それぞれの光束は、撮像素子107の各画素の第2副画素202で受光されて、第2視点画像が生成される。図15(C)に示すように、第2視点画像では、主被写体q1の像p1と手前の被写体q2のボケ像Γ2が重なって受光される。   In FIG. 15C, the light beam from the main subject q1 passes through the second pupil partial region 502 and forms an image p1 in a focused state. On the other hand, the light beam from the subject q2 on the near side passes through the second pupil partial region 502 and spreads in the blurred image Γ2 in the defocused state. Each light beam is received by the second sub-pixel 202 of each pixel of the image sensor 107, and a second viewpoint image is generated. As shown in FIG. 15C, in the second viewpoint image, the image p1 of the main subject q1 and the blurred image Γ2 of the subject q2 in front are overlapped and received.

図15(B)および図15(C)において、主被写体q1の像p1近傍の領域を、所定領域とする。図15(B)では、所定領域における至近側の被写体q2のボケ像Γ1の範囲は狭くなっており、写りも少ない。そのため、所定領域におけるコントラスト評価値は大きくなる。一方、図15(C)では、所定領域における至近側の被写体q2のボケ像Γ1の範囲は広がっており、写りも多い。そのため、所定領域におけるコントラスト評価値は大きくなる。そのため、所定領域におけるコントラスト評価値は小さくなる。そのため、所定領域において、像p1とボケ像Γ1の重なりが少ない第1視点画像の重みを大きくし、像p1とボケ像Γ2の重なりが多い第2視点画像の重みを小さくして加算する。これにより、主被写体に対する前ボケ被りを低減させることができる。   In FIGS. 15B and 15C, a region near the image p1 of the main subject q1 is set as a predetermined region. In FIG. 15B, the range of the blurred image Γ1 of the subject q2 on the near side in the predetermined area is narrow, and there is little reflection. Therefore, the contrast evaluation value in the predetermined area becomes large. On the other hand, in FIG. 15C, the range of the blurred image Γ1 of the subject q2 on the near side in the predetermined area is wide and there are many reflections. Therefore, the contrast evaluation value in the predetermined area becomes large. For this reason, the contrast evaluation value in the predetermined area becomes small. Therefore, in the predetermined area, the weight of the first viewpoint image with little overlap between the image p1 and the blurred image Γ1 is increased, and the weight of the second viewpoint image with much overlap between the image p1 and the blurred image Γ2 is decreased and added. Thereby, the front blurring with respect to the main subject can be reduced.

次に、視点変更処理部155が、第1視点画像と第2視点画像とを、重みを用いて重ね合わせる処理について説明する。視点変更処理部155は、上述した第1視点画像A(j,i)と第2視点画像B(j,i)とを入力する。   Next, processing in which the viewpoint change processing unit 155 superimposes the first viewpoint image and the second viewpoint image using weights will be described. The viewpoint change processing unit 155 inputs the first viewpoint image A (j, i) and the second viewpoint image B (j, i) described above.

まず、視点変更処理部155は、視点移動を行う所定領域R=[j1,j2]×[i1,i2]および所定領域の境界幅σを設定する。そして、式(11)に従って、所定領域Rと所定領域の境界幅σに応じたテーブル関数T(j,i)を算出する。
テーブル関数T(j,i)の値は、所定領域Rの内側で1、所定領域Rの外側で0となり、所定領域Rの境界幅σで、概ね1から0へ連続的に変化する。なお、視点変更処理部155は、必要に応じて、所定領域を円形やその他の任意の形状としてもよい。また、複数の所定領域および複数の境界幅を設定してもよい。
First, the viewpoint change processing unit 155 sets a predetermined area R = [j1, j2] × [i1, i2] for moving the viewpoint and a boundary width σ of the predetermined area. Then, a table function T (j, i) corresponding to the boundary width σ between the predetermined region R and the predetermined region is calculated according to the equation (11).
The value of the table function T (j, i) is 1 inside the predetermined region R, 0 outside the predetermined region R, and continuously changes from approximately 1 to 0 with the boundary width σ of the predetermined region R. Note that the viewpoint change processing unit 155 may set the predetermined area to be circular or any other shape as necessary. A plurality of predetermined areas and a plurality of boundary widths may be set.

次に、視点変更処理部155は、重み係数を算出する。実係数w(−1≦w≦1)として、第1視点画像A(j,i)の第1重み係数Wa(j,i)は、式(12A)により算出される。第2視点画像B(j,i)の第2重み係数Wb(j,i)は、式(12B)により算出される。
所定領域において、第1視点画像A(j,i)の加算比率を上げて、被写界深度を修正する場合には、−1≦w<0の範囲で設定が行われる。一方、第2視点画像B(j,i)の加算比率を上げて、被写界深度を修正する場合には、0<w≦1の範囲で設定が行われる。w=0に設定して、W1≡W2≡1とし、被写界深度を修正しない場合もある。
Next, the viewpoint change processing unit 155 calculates a weighting coefficient. As the real coefficient w (−1 ≦ w ≦ 1), the first weighting coefficient Wa (j, i) of the first viewpoint image A (j, i) is calculated by the equation (12A). The second weighting coefficient Wb (j, i) of the second viewpoint image B (j, i) is calculated by the equation (12B).
When the depth of field is corrected by increasing the addition ratio of the first viewpoint image A (j, i) in the predetermined area, the setting is performed in the range of −1 ≦ w <0. On the other hand, when the depth of field is corrected by increasing the addition ratio of the second viewpoint image B (j, i), the setting is made in the range of 0 <w ≦ 1. In some cases, w = 0 is set to W1≡W2≡1 and the depth of field is not corrected.

次に、視点変更処理部155は、出力画像I(j,i)を生成する。視点変更処理部155は、式(13)に従い、第1重み係数Wa(j,i)で重み付けした第1視点画像A(j,i)と、第2重み係数Wb(j,i)で重み付けした第2視点画像B(j,i)とを加算し、出力画像I(j,i)を生成する。
Next, the viewpoint change processing unit 155 generates an output image I (j, i). The viewpoint change processing unit 155 weights the first viewpoint image A (j, i) weighted with the first weighting coefficient Wa (j, i) and the second weighting coefficient Wb (j, i) according to the equation (13). The second viewpoint image B (j, i) is added to generate an output image I (j, i).

また、視点変更処理部155は、シフト量sを用いたリフォーカス処理と組み合わせて、式(14A)もしくは式(14B)に従って、出力画像Is(j,i)を生成してもよい。
生成された出力画像I(j,i)は、視点が移動した画像であると共に、ピント位置が再調整(リフォーカス)された画像となる。
Further, the viewpoint change processing unit 155 may generate the output image Is (j, i) according to the formula (14A) or the formula (14B) in combination with the refocus processing using the shift amount s.
The generated output image I s (j, i) is an image in which the viewpoint is moved and an image in which the focus position is readjusted (refocused).

このように、出力画像の領域に応じて連続的に変化する重み係数を用いて、複数の視点画像毎に重み係数をかけて合成し、出力画像を生成する。所定領域において、像p1とボケ像Γ1の重なりが少ない第1視点画像の第1重み係数Wを、第2重み係数Wより大きくして出力画像を生成することで、主被写体q1に対する前ボケ被りを低減した画像を生成することができる。すなわち、前ボケ被り低減のため、視点変更処理部155は、所定領域において、至近側の被写体が最も広い範囲で撮影されている視点画像の重み係数を小さく、もしくは、至近側の被写体が最も狭い範囲で撮影されている視点画像の重み係数を大きくすればよい。同様に、前ボケ被り低減のため、視点変更処理部155は、所定領域において、コントラスト評価値が最も小さい視点画像の重み係数を小さく、もしくは、コントラスト評価値が最も大きい視点画像の重み係数を大きくすればよい。 In this way, using a weighting factor that continuously changes in accordance with the region of the output image, a plurality of viewpoint images are multiplied and combined to generate an output image. In a predetermined area, the first weighting factor W a of the first viewpoint image in which the overlap between the image p1 and the blurred image Γ1 is small is made larger than the second weighting factor W b , thereby generating an output image. An image with reduced blur coverage can be generated. That is, in order to reduce the front blur, the viewpoint change processing unit 155 reduces the weighting coefficient of the viewpoint image in which the closest subject is photographed in the widest range or the closest subject is the narrowest in a predetermined area. What is necessary is just to enlarge the weighting coefficient of the viewpoint image image | photographed in the range. Similarly, the viewpoint change processing unit 155 reduces the weight coefficient of the viewpoint image with the smallest contrast evaluation value or increases the weight coefficient of the viewpoint image with the largest contrast evaluation value in the predetermined area in order to reduce the front blur. do it.

なお、視点変更処理部155は、必要に応じて、視点移動処理を行わない所定領域以外では、結像光学系のボケ形状を変化させないために、複数の視点画像毎の重み係数(第1重み係数、第2重み係数)を、概ね均等に加算し、出力画像を生成してもよい。また、ユーザの指定に応じて重み係数(すなわち加算比率)を変更した出力画像を生成する方法を後述するが、視点移動処理を行う所定領域をユーザが指定するようにしてもよい。   Note that the viewpoint change processing unit 155, as necessary, does not change the blurring shape of the imaging optical system in a region other than the predetermined area where the viewpoint movement process is not performed. The output image may be generated by adding the coefficients and the second weighting coefficient substantially evenly. Further, although a method for generating an output image in which the weighting coefficient (that is, the addition ratio) is changed according to the user's designation will be described later, the user may designate a predetermined area for performing the viewpoint movement process.

次に、撮像素子107の周辺像高における瞳ずれについて説明する。図16は、撮像素子の周辺像高での瞳ずれの概略説明図である。図16は、具体的には、撮像素子に配列された各画素の第1副画素201が受光する第1瞳部分領域501、第2副画素202が受光する第2瞳部分領域502および結像光学系の射出瞳400との関係を示している。   Next, pupil shift in the peripheral image height of the image sensor 107 will be described. FIG. 16 is a schematic explanatory diagram of pupil shift at the peripheral image height of the image sensor. Specifically, FIG. 16 shows a first pupil partial region 501 received by the first subpixel 201 of each pixel arranged in the image sensor, a second pupil partial region 502 received by the second subpixel 202, and imaging. The relationship with the exit pupil 400 of the optical system is shown.

図16(A)は、結像光学系の射出瞳距離Dlと撮像素子107の設定瞳距離Dsが、同じ場合を示している。この場合、結像光学系の射出瞳400は、中央像高の場合も周辺像高の場合も、第1瞳部分領域501と第2瞳部分領域502によって概ね均等に瞳分割される。   FIG. 16A shows a case where the exit pupil distance Dl of the imaging optical system and the set pupil distance Ds of the image sensor 107 are the same. In this case, the exit pupil 400 of the imaging optical system is divided into pupils approximately equally by the first pupil partial region 501 and the second pupil partial region 502 regardless of the central image height or the peripheral image height.

これに対して、図16(B)は、結像光学系の射出瞳距離Dlが撮像素子107の設定瞳距離Dsより短い場合を示している。この場合、周辺像高では、結像光学系の射出瞳400が、第1瞳部分領域501と第2瞳部分領域502によって不均一に瞳分割される。図16(B)の例では、第1瞳部分領域501に対応した第1視点画像の実効絞り値が、第2瞳部分領域502に対応した第2視点画像の実効絞り値より小さい(明るい)値となる。反対側の像高(不図示)では、逆に、第1瞳部分領域501に対応した第1視点画像の実効絞り値が、第2瞳部分領域502に対応した第2視点画像の実効絞り値より大きい(暗い)値となる。   On the other hand, FIG. 16B shows a case where the exit pupil distance Dl of the imaging optical system is shorter than the set pupil distance Ds of the image sensor 107. In this case, at the peripheral image height, the exit pupil 400 of the imaging optical system is non-uniformly divided by the first pupil partial region 501 and the second pupil partial region 502. In the example of FIG. 16B, the effective aperture value of the first viewpoint image corresponding to the first pupil partial region 501 is smaller (brighter) than the effective aperture value of the second viewpoint image corresponding to the second pupil partial region 502. Value. At the opposite image height (not shown), conversely, the effective aperture value of the first viewpoint image corresponding to the first pupil partial region 501 is the effective aperture value of the second viewpoint image corresponding to the second pupil partial region 502. Larger (darker) value.

図16(C)は、結像光学系の射出瞳距離Dlが撮像素子107の設定瞳距離Dsより長い場合を示している。この場合も、周辺像高では、結像光学系の射出瞳400が、第1瞳部分領域501と第2瞳部分領域502によって不均一に瞳分割される。図16(C)の例では、第1瞳部分領域501に対応した第1視点画像の実効絞り値が、第2瞳部分領域502に対応した第2視点画像の実効絞り値より大きい(暗い)値となる。反対側の像高(不図示)では、逆に、第1瞳部分領域501に対応した第1視点画像の実効絞り値が、第2瞳部分領域502に対応した第2視点画像の実効絞り値より小さい(明るい)値となる。   FIG. 16C shows a case where the exit pupil distance Dl of the imaging optical system is longer than the set pupil distance Ds of the image sensor 107. Also in this case, at the peripheral image height, the exit pupil 400 of the imaging optical system is non-uniformly divided by the first pupil partial region 501 and the second pupil partial region 502. In the example of FIG. 16C, the effective aperture value of the first viewpoint image corresponding to the first pupil partial region 501 is larger (darker) than the effective aperture value of the second viewpoint image corresponding to the second pupil partial region 502. Value. At the opposite image height (not shown), conversely, the effective aperture value of the first viewpoint image corresponding to the first pupil partial region 501 is the effective aperture value of the second viewpoint image corresponding to the second pupil partial region 502. Smaller (brighter) value.

すなわち、瞳ずれにより周辺像高で瞳分割が不均一になることに伴って、第1視点画像と第2視点画像の実効F値も不均一になる。このため、第1視点画像と第2視点画像のいずれかのボケの広がり方が大きくなり、他方のボケの広がり方が小さくなる。そのため、視点変更処理部155は、必要に応じて、出力画像の所定領域において、実効絞り値が最も小さい視点画像の重み係数を最も小さく、もしくは、実効絞り値が最も大きい視点画像の重み係数を最も大きくすることが望ましい。このような視点移動処理を行うことにより、主被写体への前ボケ被りを低減させることができる。   That is, as the pupil division becomes nonuniform at the peripheral image height due to the pupil shift, the effective F values of the first viewpoint image and the second viewpoint image also become nonuniform. For this reason, one of the first viewpoint image and the second viewpoint image has a larger spread of blur, and the other blur has a smaller spread. Therefore, the viewpoint change processing unit 155 reduces the weight coefficient of the viewpoint image having the smallest effective aperture value or the viewpoint image having the largest effective aperture value in a predetermined area of the output image as necessary. It is desirable to make it the largest. By performing such viewpoint movement processing, it is possible to reduce front blurring on the main subject.

次に、視点変更処理部155による深度拡大処理について説明する。図15および図16を用いて説明したように、第1瞳部分領域501を通過した像が第1視点画像となり、第2瞳部分領域502を通過した像が第2視点画像となる。各視点画像は、本来の瞳領域の半分を通過して得られる画像であるため、水平方向2分割の瞳分割領域の場合には水平方向の絞り径が半分となる。このため、水平方向の被写界深度は4倍になる。なお、本実施形態は垂直方向に瞳分割した構成ではないため、垂直方向の被写界深度の変化はない。従って、第1視点画像または第2視点画像は、第1視点画像と第2視点画像とを合成した画像(A+B像)の被写界深度に対して、縦横平均として2倍の被写界深度を有する画像となる。   Next, depth expansion processing by the viewpoint change processing unit 155 will be described. As described with reference to FIGS. 15 and 16, an image that has passed through the first pupil partial region 501 is a first viewpoint image, and an image that has passed through the second pupil partial region 502 is a second viewpoint image. Since each viewpoint image is an image obtained by passing through half of the original pupil region, in the case of a pupil division region divided in two in the horizontal direction, the aperture diameter in the horizontal direction is halved. For this reason, the depth of field in the horizontal direction is quadrupled. In addition, since this embodiment does not have a configuration in which pupils are divided in the vertical direction, there is no change in the depth of field in the vertical direction. Therefore, the first viewpoint image or the second viewpoint image has a depth of field that is twice as long as the vertical and horizontal average of the depth of field of the image (A + B image) obtained by combining the first viewpoint image and the second viewpoint image. It becomes the image which has.

視点変更処理部155は、第1視点画像または第2視点画像の加算比率を1:1以外に変更して合成画像を生成することにより、被写界深度が拡大した画像を生成することができる。さらに、視点変更処理部155は、コントラスト分布と像ずれ分布を用いたアンシャープマスク処理を第1視点画像または第2視点画像の加算比率を変更した画像に対して適用することで、被写界深度を拡大しかつ輪郭を強調した合成画像を生成することができる。また、深度拡大処理では、視点移動処理と同様に、所定領域をユーザの指定に応じて処理するようにしてもよい。なお、視点変更処理部155から出力された合成画像には上述した現像処理が適用され、現像処理の適用された画像が画像処理回路125から出力される。   The viewpoint change processing unit 155 can generate an image with an increased depth of field by generating a composite image by changing the addition ratio of the first viewpoint image or the second viewpoint image to other than 1: 1. . Further, the viewpoint change processing unit 155 applies an unsharp mask process using the contrast distribution and the image shift distribution to the image in which the addition ratio of the first viewpoint image or the second viewpoint image is changed, so that the object scene is changed. A composite image in which the depth is enlarged and the contour is emphasized can be generated. Further, in the depth expansion process, as in the viewpoint movement process, a predetermined area may be processed according to the user's designation. Note that the above-described development processing is applied to the composite image output from the viewpoint change processing unit 155, and the image to which the development processing is applied is output from the image processing circuit 125.

また、第1視点画像と第2視点画像を用いた視点変更処理により、主被写体の手前に位置する前景が大きくボケることにより主被写体が隠れてしまう前ボケ被りを低減させる処理(ボケ調整処理)が可能である。また、第1視点画像と第2視点画像を用いた視点変更処理により、撮像光学系に入射した光の一部が撮影画像中に現れるゴーストなどの不要成分と視差成分とを分離し、ゴーストなどの不要成分のみを低減させる処理(不要成分低減処理)が可能である。   In addition, the viewpoint changing process using the first viewpoint image and the second viewpoint image reduces the foreground blurring that causes the main subject to be hidden due to large blurring of the foreground located in front of the main subject (blur adjustment processing). Is possible. In addition, the viewpoint changing process using the first viewpoint image and the second viewpoint image separates an unnecessary component such as a ghost in which a part of light incident on the imaging optical system appears in the captured image from a parallax component, and the ghost. The process which reduces only the unnecessary component (unnecessary component reduction process) is possible.

次に、リフォーカス処理、視点移動処理、ボケ調整、不要成分低減処理などの画像処理に必要な情報を、撮影条件やコントラスト情報、処理情報によって選択し、保存する方法について図17〜図19を用いて説明する。図17は、情報を記録する処理を示すフローチャートである。図18は、記録する情報を決定する処理を示すフローチャートである。図19は、視点画像を圧縮する処理を示すフローチャートである。なお、図17〜図19の処理は、画像処理回路125とCPU121によって実行される。   Next, FIG. 17 to FIG. 19 show how to select and save information necessary for image processing such as refocus processing, viewpoint movement processing, blur adjustment, and unnecessary component reduction processing based on shooting conditions, contrast information, and processing information. It explains using. FIG. 17 is a flowchart showing a process for recording information. FIG. 18 is a flowchart showing processing for determining information to be recorded. FIG. 19 is a flowchart illustrating processing for compressing a viewpoint image. Note that the processing in FIGS. 17 to 19 is executed by the image processing circuit 125 and the CPU 121.

ステップS100で、設定された撮影条件によって、撮像素子駆動回路124が撮像素子107を制御し、視点画像を取得する。撮像条件には、絞り値、シャッタースピード、ISO感度、焦点距離、被写体距離が含まれる。撮像条件、被写体の明度に応じた露出を自動設定して算出した値に基づいて設定してもよいし、ユーザがマニュアルで値を設定してもよい。   In step S <b> 100, the image sensor driving circuit 124 controls the image sensor 107 according to the set shooting condition, and acquires a viewpoint image. The imaging conditions include an aperture value, shutter speed, ISO sensitivity, focal length, and subject distance. The exposure may be set based on a value calculated by automatically setting the exposure according to the imaging condition and the brightness of the subject, or the value may be set manually by the user.

ステップS200で、ステップS100で設定した撮影条件から、視点画像をフラッシュメモリ133に記録するか否かを判定する。ここで、視点画像をフラッシュメモリ133に記録するか否かを判定する方法について、図18を用いて説明する。   In step S200, it is determined whether or not to record the viewpoint image in the flash memory 133 from the shooting conditions set in step S100. Here, a method for determining whether to record the viewpoint image in the flash memory 133 will be described with reference to FIG.

ステップS201で、撮影条件に基づいて視点画像をフラッシュメモリ133に記録するか否かを判定する。視点画像を利用した画像処理により得られる効果が大きい場合は視点画像を記録し、効果が小さい場合は視点画像を記録する。画像処理による効果が大きいか否かは、撮影条件により判断される。ここでの撮像条件とは、例えば、絞り値、ISO感度、焦点距離などである。   In step S201, it is determined whether to record the viewpoint image in the flash memory 133 based on the shooting conditions. When the effect obtained by the image processing using the viewpoint image is large, the viewpoint image is recorded, and when the effect is small, the viewpoint image is recorded. Whether or not the effect of the image processing is great is determined based on the shooting conditions. The imaging conditions here are, for example, an aperture value, ISO sensitivity, focal length, and the like.

まず、絞り値での判定方法について説明する。絞り値が大きいほど、被写界深度が深くなり、第1視点画像と第2視点画像間の視差が小さくなる。第1視点画像と第2視点画像間の視差が小さいと、画像処理(特に、ボケ調整処理や不要成分低減処理)の効果が小さくなる。そのため、絞り値が所定の値以上である場合には視点画像を記録しないと判定する。一方、絞り値が所定の値よりも小さい場合には視点画像を記録すると判定する。   First, a determination method using the aperture value will be described. The larger the aperture value, the deeper the depth of field and the smaller the parallax between the first viewpoint image and the second viewpoint image. If the parallax between the first viewpoint image and the second viewpoint image is small, the effect of image processing (particularly, blur adjustment processing and unnecessary component reduction processing) is small. Therefore, when the aperture value is equal to or greater than a predetermined value, it is determined that the viewpoint image is not recorded. On the other hand, when the aperture value is smaller than a predetermined value, it is determined that the viewpoint image is recorded.

次に、ISO感度での判定方法について説明する。ISO感度が高くなるほど、S/Nが小さくなり(すなわち悪化し)、画像処理前後の変化が視認しづらくなる。画像処理前後の変化が小さいことは、画像処理の効果が小さいことを意味する。そのため、ISO感度が所定の値以上である場合には、視点画像を記録しないと判定する。一方、ISO感度が所定の値よりも低い場合には、視点画像を記録すると判定する。   Next, a determination method using ISO sensitivity will be described. As the ISO sensitivity increases, the S / N decreases (that is, deteriorates), and changes before and after image processing become difficult to visually recognize. A small change before and after the image processing means that the effect of the image processing is small. Therefore, when the ISO sensitivity is equal to or higher than a predetermined value, it is determined that the viewpoint image is not recorded. On the other hand, when the ISO sensitivity is lower than a predetermined value, it is determined that the viewpoint image is recorded.

最後に、焦点距離での判定方法について説明する。リフォーカス処理におけるデフォーカス量の実距離換算値は、縦倍率(横倍率の2乗)に比例し、近距離の被写体ではリフォーカス処理によるデフォーカス変化量の実距離換算値が小さいため、効果が視認しづらい。また、遠距離(例えば、無限遠)では、リフォーカス処理によるデフォーカス変化量の実距離換算値が大きいため、被写体サイズに応じた適切な画像処理(特に、リフォーカス処理)の効果を適用できない。そのため、焦点距離が所定の焦点距離の範囲外の場合には、視点画像を記録しないと判定する。一方、焦点距離が所定の焦点距離の範囲内の場合には、視点画像を記録すると判定する。なお、リフォーカス処理によるデフォーカス変化量の効果を十分得られる所定の焦点距離の範囲は、レンズの焦点距離ごとに設定される。   Finally, a determination method based on the focal length will be described. The actual distance converted value of the defocus amount in the refocus processing is proportional to the vertical magnification (the square of the horizontal magnification), and the short distance subject has a small actual distance converted value of the defocus change amount due to the refocus processing. Is difficult to see. Also, at a long distance (for example, at infinity), the actual distance converted value of the defocus change amount by the refocus process is large, and therefore the effect of appropriate image processing (particularly, refocus process) according to the subject size cannot be applied. . Therefore, when the focal length is out of the predetermined focal length range, it is determined that the viewpoint image is not recorded. On the other hand, when the focal length is within a predetermined focal length range, it is determined to record the viewpoint image. Note that a predetermined focal length range in which the effect of the defocus change amount by the refocus processing can be sufficiently obtained is set for each focal length of the lens.

ステップS201で視点画像を記録すると判定した場合、ステップS201へ移行する。一方、視点画像を記録しないと判定した場合には、ステップS206へ移行する。なお、ステップS201では撮影条件として、絞り値、ISO感度、焦点距離について説明したが、これらに限定されない。例えば、シェーディング処理部153で、第1の視点画像と第2の視点画像の像高による光量変化を補正しきれていない場合に、視点画像をフラッシュメモリ133に記録するか否かを判定することができる。また、撮影者の手振れやパンニング動作、またはレンズのフォーカス状態等に基づいて、視点画像をフラッシュメモリ133に記録するか否かを判定するようにしてもよい。   If it is determined in step S201 that a viewpoint image is to be recorded, the process proceeds to step S201. On the other hand, if it is determined not to record the viewpoint image, the process proceeds to step S206. In step S201, the aperture value, ISO sensitivity, and focal length have been described as shooting conditions. However, the present invention is not limited to these. For example, the shading processing unit 153 determines whether to record the viewpoint image in the flash memory 133 when the change in the light amount due to the image height of the first viewpoint image and the second viewpoint image has not been corrected. Can do. Further, it may be determined whether or not to record the viewpoint image in the flash memory 133 based on the camera shake or panning operation of the photographer or the focus state of the lens.

ステップS202では、視差関連情報である撮像画像のコントラスト情報を生成する。コントラスト情報は、コントラストの分布に対応する情報である。コントラスト情報は、第1視点画像と第2視点画像とを合成して生成される。コントラスト情報を生成した後、ステップS203へ移行する。   In step S202, contrast information of the captured image that is parallax-related information is generated. The contrast information is information corresponding to the contrast distribution. The contrast information is generated by synthesizing the first viewpoint image and the second viewpoint image. After the contrast information is generated, the process proceeds to step S203.

ステップS203では、視差関連情報である像ずれ情報を生成する。像ずれ情報は、像ずれ量の分布に対応する情報である。像ずれ情報は、視点画像から生成される。像ずれ情報を生成した後、ステップS204へ移行する。   In step S203, image shift information that is parallax-related information is generated. The image shift information is information corresponding to the image shift amount distribution. The image shift information is generated from the viewpoint image. After generating the image shift information, the process proceeds to step S204.

ステップS204では、視差関連情報である像ずれ・コントラスト情報を生成する。像ずれ・コントラスト情報は、ステップS202で生成したコントラスト情報とステップS203で生成した像ずれ情報を統合した情報である。像ずれ・コントラスト情報を生成した後、ステップS205へ移行する。   In step S204, image shift / contrast information that is parallax-related information is generated. The image shift / contrast information is information obtained by integrating the contrast information generated in step S202 and the image shift information generated in step S203. After the image shift / contrast information is generated, the process proceeds to step S205.

ステップS205では、ステップS204で生成した像ずれ・コントラスト情報に基づいて、視点画像をフラッシュメモリ133に記録するか否かを判定する。視点画像を記録するか否かは、像ずれ・コントラスト情報において所定のコントラスト以上の領域が、所定の値(所定の領域の大きさ)以上存在するか否かに応じて判定される。像ずれ・コントラスト情報において所定のコントラスト以上の領域が、所定の値以上存在する場合には、画像処理による効果が大きいため、視点画像を記録すると判定する。一方、所定のコントラスト以上の領域が、所定の値未満の場合には、画像処理による効果が小さいため、視点画像を記録しないと判定する。   In step S205, based on the image shift / contrast information generated in step S204, it is determined whether or not the viewpoint image is to be recorded in the flash memory 133. Whether or not to record the viewpoint image is determined depending on whether or not there is a region having a predetermined contrast or more in the image shift / contrast information at a predetermined value (the size of the predetermined region) or more. If there is an area of a predetermined contrast or more in the image shift / contrast information, the image processing is highly effective, and it is determined to record the viewpoint image. On the other hand, if the region having a predetermined contrast or higher is less than the predetermined value, it is determined that the viewpoint image is not recorded because the effect of the image processing is small.

像ずれ・コントラスト情報における所定のコントラスト以上の領域が、所定の値以上存在する場合、すなわち視点画像を記録する場合に、フラッシュメモリ133にコントラスト情報、もしくは像ずれ・コントラスト情報をさらに記録するとしてもよい。ステップS205で、視点画像を記録すると判定した場合には、ステップS206へ移行する。一方、視点画像を記録しないと判定した場合には、ステップS208へ移行する。   When there is a region having a predetermined contrast or more in the image shift / contrast information at a predetermined value or more, that is, when recording a viewpoint image, contrast information or image shift / contrast information may be further recorded in the flash memory 133. Good. If it is determined in step S205 that a viewpoint image is to be recorded, the process proceeds to step S206. On the other hand, if it is determined not to record the viewpoint image, the process proceeds to step S208.

ステップS206では、視点画像に対して画像処理を実施して、合成画像を生成する。生成した後、ステップS207へ移行する。画像処理は、例えば、リフォーカス処理、視点移動処理、ボケ調整、不要成分低減処理などである。   In step S206, image processing is performed on the viewpoint image to generate a composite image. After the generation, the process proceeds to step S207. The image processing includes, for example, refocus processing, viewpoint movement processing, blur adjustment, unnecessary component reduction processing, and the like.

ステップS207では、画像処理に基づいて、視点画像を記録するか否か判定する。ステップS206で実施された視点画像の画像処理において、視点画像を使用する所定の画像処理、例えば、リフォーカス処理、視点移動処理、ボケ調整、不要成分低減処理のうち1つ以上が実施済みであれば、視点画像を記録しないと判定する。また、前述の画像処理を実施していない場合でも、ステップS207以降の画像処理においても視点画像を使用する所定の画像処理を実施しない場合には、視点画像を記録しないと判定してもよい。   In step S207, it is determined whether to record the viewpoint image based on the image processing. In the image processing of the viewpoint image performed in step S206, at least one of predetermined image processing using the viewpoint image, for example, refocus processing, viewpoint movement processing, blur adjustment, and unnecessary component reduction processing has been performed. For example, it is determined that the viewpoint image is not recorded. Even when the above-described image processing is not performed, it may be determined that the viewpoint image is not recorded when the predetermined image processing using the viewpoint image is not performed in the image processing after step S207.

一方で、ステップS206での画像処理において視点画像を使用する所定の画像処理が行われていた場合であっても、ステップS207以降の画像処理において視点画像を使用する所定の画像処理を実施する場合には、視点画像を記録すると判定してもよい。また、ステップS207以降の画像処理において視点画像を使用したリフォーカス処理を実施する場合には、視点画像は記録せず、撮像画像と像ずれ・コントラスト情報を保存するようにしてもよい。なお、ステップS207では、ユーザ指示によって、視点画像を記録するか否かを判定してもよい。視点画像を記録するか否か判定した後、ステップS208へ移行する。   On the other hand, even when the predetermined image processing using the viewpoint image is performed in the image processing in step S206, the predetermined image processing using the viewpoint image is performed in the image processing after step S207. May determine that a viewpoint image is to be recorded. Further, when performing refocus processing using the viewpoint image in the image processing after step S207, the viewpoint image may not be recorded, and the captured image and the image shift / contrast information may be stored. In step S207, it may be determined whether or not to record a viewpoint image according to a user instruction. After determining whether or not to record the viewpoint image, the process proceeds to step S208.

ステップS208では、フラッシュメモリ133に記録する情報を決定する。フラッシュメモリ133に記録する情報は、ステップS201、ステップS205およびステップS207の判定に基づいて決定される。各ステップにおいて視点画像を記録すると判定された場合には、例えば、第1視点画像または第2視点画像、第1視点画像と第2視点画像とを合成した撮像画像およびステップS204で生成した像ずれ・コントラスト情報を記録する。一方、視点画像を記録しないと判定された場合には、第1視点画像と第2視点画像とを合成した撮像画像のみを記録する。フラッシュメモリ133に記録する情報を決定した後、本サブルーチンを終了して、メインルーチンのステップS300へ移行する。   In step S208, information to be recorded in the flash memory 133 is determined. Information to be recorded in the flash memory 133 is determined based on the determinations in step S201, step S205, and step S207. If it is determined to record the viewpoint image in each step, for example, the first viewpoint image or the second viewpoint image, the captured image obtained by combining the first viewpoint image and the second viewpoint image, and the image shift generated in step S204. • Record contrast information. On the other hand, when it is determined not to record the viewpoint image, only the captured image obtained by combining the first viewpoint image and the second viewpoint image is recorded. After determining information to be recorded in the flash memory 133, the present subroutine is terminated, and the process proceeds to step S300 of the main routine.

なお、視点画像を記録するか否かの判定にかかわらず、ステップS204で生成した像ずれ・コントラスト情報を記録するようにしてもよい。像ずれ・コントラスト情報を記録することより、例えば、ステップS201、ステップS205、ステップS207で視点画像を記録しないと判定された場合においても、撮像画像と像ずれ・コントラスト情報を用いた画像処理を実施することが可能になる。   Regardless of whether or not to record the viewpoint image, the image shift / contrast information generated in step S204 may be recorded. By recording the image shift / contrast information, for example, even when it is determined in step S201, step S205, or step S207 that the viewpoint image is not recorded, image processing using the captured image and the image shift / contrast information is performed. It becomes possible to do.

図17の説明に戻る。ステップS300では、ステップS200で視点画像を記録すると決定した場合に、フラッシュメモリ133に記録する視点画像を圧縮するか否か判定する。ここで、ステップS300の視点画像圧縮を実施するか否かの判定及び圧縮処理について、図19を用いて説明する。なお、ステップS300においてユーザが視点画像を圧縮するか否かを選択するようにしてもよい。   Returning to the description of FIG. In step S300, if it is determined in step S200 that the viewpoint image is to be recorded, it is determined whether or not the viewpoint image to be recorded in the flash memory 133 is to be compressed. Here, determination as to whether or not to perform viewpoint image compression in step S300 and compression processing will be described with reference to FIG. In step S300, the user may select whether to compress the viewpoint image.

ステップS301では、視点画像撮影時の撮影条件であるISO感度が所定の値以上であるかを判定する。ISO感度が所定の値以上である場合には、S/Nが小さくなる(悪化する)ため、視点画像を水平垂直加算して圧縮することでS/Nを増加させる。ISO感度が所定の値(例えば、ISO6400)以上である場合には、S303へ移行する。一方、ISO感度が所定の値以上でない場合には、S302へ移行する。   In step S301, it is determined whether the ISO sensitivity, which is a photographing condition at the time of photographing a viewpoint image, is equal to or higher than a predetermined value. When the ISO sensitivity is equal to or higher than a predetermined value, the S / N becomes small (deteriorates), so the S / N is increased by compressing the viewpoint image by horizontal and vertical addition. If the ISO sensitivity is a predetermined value (for example, ISO 6400) or more, the process proceeds to S303. On the other hand, if the ISO sensitivity is not equal to or higher than the predetermined value, the process proceeds to S302.

S302では、S202で生成したコントラスト情報を用いて、コントラストが所定の値以上であるかを判定する。コントラストが所定の値以上でない場合には高周波被写体がいない視点画像と判定できるため、水平垂直加算による視点画像の圧縮をしてもよい。コントラストが所定の値以上でない場合には、S303へ移行する。一方、コントラストが所定の値以上である場合には、視点画像の圧縮を行わず視点画像圧縮判定を終了し、メインフローに戻る。   In S302, using the contrast information generated in S202, it is determined whether the contrast is equal to or higher than a predetermined value. If the contrast is not equal to or higher than a predetermined value, it can be determined that the viewpoint image does not have a high-frequency subject. Therefore, the viewpoint image may be compressed by horizontal and vertical addition. If the contrast is not equal to or greater than the predetermined value, the process proceeds to S303. On the other hand, if the contrast is equal to or higher than a predetermined value, the viewpoint image compression determination is terminated without compressing the viewpoint image, and the process returns to the main flow.

S303では、視点画像を水平または垂直方向にRGBごとに加算し、画素数を低減することで圧縮する。視点画像を圧縮して記録することにより、後処理で像ずれ分布を生成する際にS/Nと像ずれの精度を向上させた像ずれ分布を生成することがでる。また、視点画像の圧縮によりデータ容量を削減できる。なお、本実施形態では、視点画像の圧縮方法を水平、垂直加算で説明したが、ローパスフィルタ処理やデモザイキング処理を用いてもよい。   In S303, the viewpoint image is compressed for each RGB in the horizontal or vertical direction to reduce the number of pixels. By compressing and recording the viewpoint image, it is possible to generate an image shift distribution with improved S / N and image shift accuracy when generating the image shift distribution in post-processing. Further, the data capacity can be reduced by compressing the viewpoint image. In the present embodiment, the viewpoint image compression method has been described by horizontal and vertical addition, but low-pass filter processing or demosaicing processing may be used.

視点画像を圧縮する際の水平または垂直加算数、すなわち圧縮する際の圧縮率を、撮影条件やコントラストの値に応じて変更してもよい。例えば、ISO感度が高いほど、水平垂直加算画素数を増やし、高い圧縮率で圧縮する。また、コントラストの値が高いほど、水平垂直加算画素数を増やし、高い圧縮率で圧縮する。さらに、絞り値が大きいほど、水平垂直加算画素数を増やし、高い圧縮率で圧縮するようにしてもよい。   You may change the horizontal or vertical addition number at the time of compressing a viewpoint image, ie, the compression rate at the time of compression, according to imaging conditions and the value of contrast. For example, as the ISO sensitivity is higher, the number of horizontal and vertical addition pixels is increased and compression is performed at a higher compression rate. Further, as the contrast value is higher, the number of horizontal and vertical added pixels is increased and compression is performed at a higher compression rate. Furthermore, the larger the aperture value, the larger the number of horizontal and vertical addition pixels may be, and compression may be performed at a high compression rate.

図19に示したように、ISO感度はコントラスト値より優先順位の高い判定条件とする。ISO感度が高い場合には、コントラスト値が高い場合でも、S/Nが小さくなるため像ずれの精度が低下する。そのため、ISO感度が高い場合には、コントラスト値に関わらず、視点画像の水平または垂直加算を行いS/Nを向上させてから、相関演算を行った方がよい。ステップS303の圧縮処理が完了した後、視点画像圧縮判定を終了し、メインフローに戻る。   As shown in FIG. 19, the ISO sensitivity is set as a determination condition having a higher priority than the contrast value. When the ISO sensitivity is high, even when the contrast value is high, the S / N is small, so that the accuracy of image shift is lowered. Therefore, when the ISO sensitivity is high, it is better to perform the correlation calculation after improving the S / N by performing horizontal or vertical addition of the viewpoint images regardless of the contrast value. After the compression processing in step S303 is completed, the viewpoint image compression determination is terminated and the process returns to the main flow.

ステップS400では、ステップS200およびステップS300で用意された記録情報をフラッシュメモリ133に記録する。記録した後、本メインフローを終了する。   In step S400, the recording information prepared in steps S200 and S300 is recorded in the flash memory 133. After recording, the main flow is terminated.

また、上述した本実施形態では、撮影条件や画像処理の結果によっては視点画像を記録しない例について説明したが、これに限らず、視点画像の記録の有無を制御する代わりに視点画像を圧縮するあるいは圧縮率を制御するようにしてもよい。すなわち、CPU121はステップS201、ステップS205、ステップS207での各条件の判定の結果、記録の有無ではなく圧縮の有無あるいは圧縮率の制御を行う。このとき、視点画像が記録されない分岐(各判定フローでNO)が、視点画像の圧縮が行われない分岐あるいは圧縮率がより高く設定される分岐と対応する。視点画像が記録される分岐(各判定フローでYES)が視点画像の圧縮が行われないあるいはより低い圧縮率が設定される分岐と対応する。   In the above-described embodiment, the example in which the viewpoint image is not recorded depending on the shooting conditions and the result of the image processing has been described. Alternatively, the compression rate may be controlled. That is, as a result of the determination of each condition in step S201, step S205, and step S207, the CPU 121 controls the presence or absence of compression or the compression rate, not the presence or absence of recording. At this time, the branch where the viewpoint image is not recorded (NO in each determination flow) corresponds to the branch where the viewpoint image is not compressed or the branch where the compression rate is set higher. A branch in which the viewpoint image is recorded (YES in each determination flow) corresponds to a branch in which the viewpoint image is not compressed or a lower compression rate is set.

以上のように、本実施形態によれば、撮影条件や画像処理の実施に応じて、記録するデータを決定し圧縮するため、視点画像を適切な容量で記録することができる。そのため、フラッシュメモリ133に記録するデータ容量を抑制することが可能となる。   As described above, according to the present embodiment, the data to be recorded is determined and compressed according to the shooting conditions and the execution of image processing, so that the viewpoint image can be recorded with an appropriate capacity. Therefore, it is possible to suppress the data volume recorded in the flash memory 133.

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

以上、本発明の好ましい実施形態について説明したが、本発明は、これらの実施形態に限定されず、その要旨の範囲内で種々の変形および変更が可能である。   As mentioned above, although preferable embodiment of this invention was described, this invention is not limited to these embodiment, A various deformation | transformation and change are possible within the range of the summary.

121 CPU
125 画像処理回路
151 画像取得部
154 操作情報取得部
155 視点変更処理部
156 リフォーカス処理部
161 圧縮部
121 CPU
125 Image Processing Circuit 151 Image Acquisition Unit 154 Operation Information Acquisition Unit 155 Viewpoint Change Processing Unit 156 Refocus Processing Unit 161 Compression Unit

Claims (19)

複数の視点画像を取得する取得手段と、
前記視点画像を撮影した際の撮影条件を取得する撮影条件取得手段と、
記録手段に記録する前記視点画像を圧縮する圧縮手段と、を備え、
前記圧縮手段は、前記撮影条件に応じて、前記視点画像を圧縮することを特徴とする撮像装置。
Acquisition means for acquiring a plurality of viewpoint images;
Shooting condition acquisition means for acquiring shooting conditions when shooting the viewpoint image;
Compression means for compressing the viewpoint image to be recorded in the recording means,
The image pickup apparatus, wherein the compression unit compresses the viewpoint image according to the shooting condition.
前記撮影条件は、ISO感度もしくは絞り値であることを特徴とする請求項1に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the photographing condition is an ISO sensitivity or an aperture value. 前記撮影条件はISO感度であり、前記圧縮手段は、前記ISO感度が所定の値以上である場合、前記視点画像を圧縮することを特徴とする請求項1または2に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the photographing condition is ISO sensitivity, and the compression unit compresses the viewpoint image when the ISO sensitivity is equal to or higher than a predetermined value. 前記圧縮手段は、ISO感度に応じて、前記視点画像を圧縮する圧縮率を変更することを特徴とする請求項1乃至3のいずれか1項に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the compression unit changes a compression rate for compressing the viewpoint image in accordance with ISO sensitivity. 前記圧縮手段は、絞り値に応じて、前記視点画像を圧縮する圧縮率を変更することを特徴とする請求項1乃至3のいずれか1項に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the compression unit changes a compression rate for compressing the viewpoint image according to an aperture value. 前記視点画像に基づいて、コントラスト分布に対応するコントラスト情報を算出する算出手段をさらに備え、
前記圧縮手段は、前記コントラスト情報において所定のコントラスト以上の領域が所定の値未満である場合、前記視点画像を圧縮することを特徴とする請求項1乃至5のいずれか1項に記載の撮像装置。
A calculation means for calculating contrast information corresponding to a contrast distribution based on the viewpoint image;
6. The imaging apparatus according to claim 1, wherein the compression unit compresses the viewpoint image when a region having a predetermined contrast or higher in the contrast information is less than a predetermined value. 7. .
前記圧縮手段は、前記コントラスト情報の値に応じて、前記視点画像を圧縮する圧縮率を変更することを特徴とする請求項6に記載の撮像装置。   The imaging apparatus according to claim 6, wherein the compression unit changes a compression rate for compressing the viewpoint image in accordance with a value of the contrast information. 複数の視点画像を取得する取得手段と、
前記視点画像を撮影した際の撮影条件を取得する撮影条件取得手段と、
記録手段に記録するデータを決定する決定手段と、を備え、
前記決定手段は、前記撮影条件に応じて、前記視点画像を前記記録手段に記録するか否か決定することを特徴とする撮像装置。
Acquisition means for acquiring a plurality of viewpoint images;
Shooting condition acquisition means for acquiring shooting conditions when shooting the viewpoint image;
Determining means for determining data to be recorded in the recording means,
The determination unit determines whether to record the viewpoint image in the recording unit according to the shooting condition.
前記撮影条件は、絞り値、ISO感度、被写体距離のいずれかであることを特徴とする請求項8に記載の撮像装置。   The imaging apparatus according to claim 8, wherein the photographing condition is any one of an aperture value, an ISO sensitivity, and a subject distance. 前記撮影条件は絞り値であり、前記決定手段は、前記絞り値が所定の値以上である場合、前記視点画像を記録しないと決定することを特徴とする請求項8または9に記載の撮像装置。   The imaging apparatus according to claim 8 or 9, wherein the photographing condition is an aperture value, and the determination unit determines that the viewpoint image is not recorded when the aperture value is equal to or greater than a predetermined value. . 前記撮影条件はISO感度であり、前記決定手段は、前記ISO感度が所定の値以上である場合、前記視点画像を記録しないと決定することを特徴とする請求項8または9に記載の撮像装置。   10. The imaging apparatus according to claim 8, wherein the photographing condition is ISO sensitivity, and the determination unit determines not to record the viewpoint image when the ISO sensitivity is equal to or higher than a predetermined value. . 前記撮影条件は被写体距離であり、前記決定手段は、前記被写体距離が所定の範囲外である場合、前記視点画像を記録しないと決定することを特徴とする請求項8または9に記載の撮像装置。   The imaging apparatus according to claim 8 or 9, wherein the shooting condition is a subject distance, and the determination unit determines not to record the viewpoint image when the subject distance is outside a predetermined range. . 前記視点画像を用いた画像処理を行う画像処理手段をさらに備え、
前記決定手段は、前記画像処理に応じて、前記視点画像を前記記録手段に記録するか否か決定することを特徴とする請求項8乃至12のいずれか1項に記載の撮像装置。
Image processing means for performing image processing using the viewpoint image,
The imaging apparatus according to claim 8, wherein the determination unit determines whether to record the viewpoint image in the recording unit according to the image processing.
前記決定手段は、前記画像処理として、リフォーカス処理、視点移動処理、ボケ調整、不要成分低減処理のいずれかが実施された場合、前記視点画像を記録しないと決定することを特徴とする請求項13に記載の撮像装置。   The determination means determines that the viewpoint image is not to be recorded when any of refocus processing, viewpoint movement processing, blur adjustment, and unnecessary component reduction processing is performed as the image processing. The imaging device according to 13. 前記決定手段は、前記画像処理として、リフォーカス処理、視点移動処理、ボケ調整、不要成分低減処理のいずれかを実施する場合には、前記視点画像を記録すると決定することを特徴とする請求項13に記載の撮像装置。   The determination unit, when performing any of refocus processing, viewpoint movement processing, blur adjustment, and unnecessary component reduction processing as the image processing, determines to record the viewpoint image. The imaging device according to 13. 前記視点画像に基づいて、コントラスト分布に対応するコントラスト情報を算出する算出手段をさらに備え、
前記決定手段は、前記コントラスト情報において所定のコントラスト以上の領域が所定の値未満である場合、前記視点画像を記録しないと決定することを特徴とする請求項8乃至15のいずれか1項に記載の撮像装置。
A calculation means for calculating contrast information corresponding to a contrast distribution based on the viewpoint image;
The said determination means determines that the said viewpoint image is not recorded when the area | region more than predetermined | prescribed contrast in the said contrast information is less than predetermined | prescribed value, It is characterized by the above-mentioned. Imaging device.
前記決定手段は、前記コントラスト情報において所定のコントラスト以上の領域が所定の値以上である場合、前記コントラスト情報を前記記録手段に記録することを決定することを特徴とする請求項16に記載の撮像装置。   17. The imaging according to claim 16, wherein the determination unit determines to record the contrast information in the recording unit when a region having a predetermined contrast or more in the contrast information is a predetermined value or more. apparatus. 撮像装置の制御手段であって、
複数の視点画像を取得する取得工程と、
前記視点画像を撮影した際の撮影条件を取得する撮影条件取得工程と、
記録手段に記録する前記視点画像を圧縮する圧縮工程と、を備え、
前記圧縮工程では、前記撮影条件に応じて、前記視点画像を圧縮することを特徴とする制御手段。
Control means for the imaging device,
An acquisition step of acquiring a plurality of viewpoint images;
A shooting condition acquisition step of acquiring shooting conditions when shooting the viewpoint image;
A compression step of compressing the viewpoint image to be recorded in the recording means,
In the compression step, the viewpoint image is compressed according to the photographing condition.
撮像装置の制御方法であって、
複数の視点画像を取得する取得工程と、
前記視点画像を撮影した際の撮影条件を取得する撮影条件取得工程と、
記録手段に記録するデータを決定する決定工程と、を有し、
前記決定工程では、前記撮影条件に応じて、前記視点画像を前記記録手段に記録するか否か決定することを特徴とする制御方法。
A method for controlling an imaging apparatus,
An acquisition step of acquiring a plurality of viewpoint images;
A shooting condition acquisition step of acquiring shooting conditions when shooting the viewpoint image;
A determination step for determining data to be recorded in the recording means,
In the determining step, it is determined whether to record the viewpoint image in the recording unit according to the photographing condition.
JP2018123774A 2017-09-20 2018-06-29 Imaging device and its control method Active JP7204357B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/123,672 US10964739B2 (en) 2017-09-20 2018-09-06 Imaging apparatus and control method thereof

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2017180174 2017-09-20
JP2017180177 2017-09-20
JP2017180177 2017-09-20
JP2017180174 2017-09-20

Publications (3)

Publication Number Publication Date
JP2019057908A true JP2019057908A (en) 2019-04-11
JP2019057908A5 JP2019057908A5 (en) 2021-07-26
JP7204357B2 JP7204357B2 (en) 2023-01-16

Family

ID=66106684

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018123774A Active JP7204357B2 (en) 2017-09-20 2018-06-29 Imaging device and its control method

Country Status (1)

Country Link
JP (1) JP7204357B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781560A (en) * 2021-09-08 2021-12-10 未来科技(襄阳)有限公司 Method and device for determining viewpoint width and storage medium
CN117011507A (en) * 2023-09-04 2023-11-07 南京诺源医疗器械有限公司 2CMOS image recognition data analysis method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11215430A (en) * 1998-01-26 1999-08-06 Kokusai Electric Co Ltd Image input device
JP2013258577A (en) * 2012-06-13 2013-12-26 Canon Inc Imaging device, imaging method and program, image encoding device, and image encoding method and program
JP2014064213A (en) * 2012-09-21 2014-04-10 Canon Inc Image processing device, image processing method and program, and image pickup device equipped with image processing device
JP2015061260A (en) * 2013-09-20 2015-03-30 株式会社ニコン Imaging device and imaging processing program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11215430A (en) * 1998-01-26 1999-08-06 Kokusai Electric Co Ltd Image input device
JP2013258577A (en) * 2012-06-13 2013-12-26 Canon Inc Imaging device, imaging method and program, image encoding device, and image encoding method and program
JP2014064213A (en) * 2012-09-21 2014-04-10 Canon Inc Image processing device, image processing method and program, and image pickup device equipped with image processing device
JP2015061260A (en) * 2013-09-20 2015-03-30 株式会社ニコン Imaging device and imaging processing program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781560A (en) * 2021-09-08 2021-12-10 未来科技(襄阳)有限公司 Method and device for determining viewpoint width and storage medium
CN113781560B (en) * 2021-09-08 2023-12-22 未来科技(襄阳)有限公司 Viewpoint width determining method, device and storage medium
CN117011507A (en) * 2023-09-04 2023-11-07 南京诺源医疗器械有限公司 2CMOS image recognition data analysis method and system
CN117011507B (en) * 2023-09-04 2024-01-26 南京诺源医疗器械有限公司 2CMOS image recognition data analysis method and system

Also Published As

Publication number Publication date
JP7204357B2 (en) 2023-01-16

Similar Documents

Publication Publication Date Title
US10681286B2 (en) Image processing apparatus, imaging apparatus, image processing method, and recording medium
JP6789833B2 (en) Image processing equipment, imaging equipment, image processing methods and programs
JP6757184B2 (en) Image processing equipment, imaging equipment and their control methods and programs
JP6972266B2 (en) Image processing method, image processing device, and image pickup device
JP6516510B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP6370348B2 (en) Image processing apparatus, image processing method, imaging apparatus, program, and storage medium
JP7204357B2 (en) Imaging device and its control method
JP2015194736A (en) Imaging device and method for controlling the same
JP6976754B2 (en) Image processing equipment and image processing methods, imaging equipment, programs
JP2015210285A (en) Imaging device, manufacturing method of the same, program thereof and recording medium
WO2017163588A1 (en) Image processing apparatus, image pickup apparatus, and control methods therefor, and program
US10964739B2 (en) Imaging apparatus and control method thereof
CN112492194A (en) Image processing method, image processing apparatus, and image pickup apparatus
JP6800648B2 (en) Image processing device and its control method, program and imaging device
JP2016201600A (en) Image processing apparatus, imaging device, image processing method, image processing program, and storage medium
JP2015225310A (en) Image capturing device, control method therefor, program, and storage medium
US10868953B2 (en) Image processing device capable of notifying an effect of emphasizing a subject before performing imaging, control method thereof, and medium
JP7319840B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM
JP2017102240A (en) Image processing device and image processing method, imaging device, program
JP2017118293A (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP2016201601A (en) Image processing apparatus, imaging device, image processing method, image processing program, and storage medium

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210614

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210614

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220428

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220524

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220721

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20221228

R151 Written notification of patent or utility model registration

Ref document number: 7204357

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151