JP6800648B2 - Image processing device and its control method, program and imaging device - Google Patents

Image processing device and its control method, program and imaging device Download PDF

Info

Publication number
JP6800648B2
JP6800648B2 JP2016152287A JP2016152287A JP6800648B2 JP 6800648 B2 JP6800648 B2 JP 6800648B2 JP 2016152287 A JP2016152287 A JP 2016152287A JP 2016152287 A JP2016152287 A JP 2016152287A JP 6800648 B2 JP6800648 B2 JP 6800648B2
Authority
JP
Japan
Prior art keywords
image
region
viewpoint
viewpoint image
amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2016152287A
Other languages
Japanese (ja)
Other versions
JP2018022984A (en
Inventor
福田 浩一
浩一 福田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2016152287A priority Critical patent/JP6800648B2/en
Publication of JP2018022984A publication Critical patent/JP2018022984A/en
Application granted granted Critical
Publication of JP6800648B2 publication Critical patent/JP6800648B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

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

撮像装置の焦点検出方法の1つとして、撮像素子で得られる信号を用いて位相差方式の焦点検出を行う撮像面位相差方式が知られている。特許文献1には、1つの画素に対して、1つのマイクロレンズと複数に分割された光電変換部が形成されている2次元撮像素子を用いる撮像装置が開示されている。複数に分割された光電変換部は、1つのマイクロレンズを介して撮影レンズの射出瞳の異なる領域を通過した光束を受光するように構成されているため、いわゆる瞳分割を実現することができる。瞳分割により得られる複数の視点信号間の視差から像ずれ量を算出することができるため、得られた像ずれ量をデフォーカス量に換算することで、位相差方式の焦点検出を行うことができる。また、特許文献2には、複数に分割された光電変換部で受光した複数の視点信号を加算することで、撮像信号を生成することが開示されている。 As one of the focus detection methods of an image pickup device, an imaging surface phase difference method is known in which focus detection is performed by a phase difference method using a signal obtained by an image sensor. Patent Document 1 discloses an image pickup device that uses a two-dimensional image pickup element in which one microlens and a plurality of photoelectric conversion units are formed for one pixel. Since the photoelectric conversion unit divided into a plurality of portions is configured to receive the light flux that has passed through different regions of the exit pupil of the photographing lens via one microlens, so-called pupil division can be realized. Since the amount of image shift can be calculated from the parallax between a plurality of viewpoint signals obtained by pupil division, it is possible to perform focus detection by the phase difference method by converting the obtained amount of image shift into the amount of defocus. it can. Further, Patent Document 2 discloses that an imaging signal is generated by adding a plurality of viewpoint signals received by a plurality of photoelectric conversion units.

米国特許第4410804号明細書U.S. Pat. No. 4,410,804 特開2001−083407号公報Japanese Unexamined Patent Publication No. 2001-083407

ところで、撮影装置を用いた撮影では、主被写体にピントを合わせつつ、前景や背景を大きくボカすことにより、主被写体を効果的に際立たせる撮影表現が用いられる場合がある。撮影後にピント状態を変更可能な技術として、上述の瞳分割により得られる複数の視点信号を用いてピント状態を変更した合成画像を生成するリフォーカス技術が知られている。しかしながら、リフォーカス技術は、仮想的な合焦位置を変更することによって合成画像全体のピント状態を変更する技術であり、画像内の所定の領域に対して他の領域の合焦度合やぼけ具合をより強調するものではない。従って、上述の瞳分割により得られる複数の視点画像を用いて、ボケた前景や背景等の所定の領域との対比により被写体等の他の領域の合焦状態を際立たせる効果を調整可能な技術が望まれている。 By the way, in shooting using a shooting device, a shooting expression that makes the main subject stand out effectively may be used by focusing on the main subject and greatly blurring the foreground and the background. As a technique capable of changing the focus state after shooting, a refocus technique for generating a composite image in which the focus state is changed by using a plurality of viewpoint signals obtained by the above-mentioned pupil division is known. However, the refocusing technique is a technique for changing the focus state of the entire composite image by changing the virtual focusing position, and the degree of focusing or blurring of other areas with respect to a predetermined area in the image. Is not more emphasized. Therefore, a technique capable of adjusting the effect of making the in-focus state of another region such as a subject stand out by comparing with a predetermined region such as a blurred foreground or background by using a plurality of viewpoint images obtained by the above-mentioned pupil division. Is desired.

本発明の目的は、上記の問題点に鑑みてなされたものである。すなわち、複数の視点画像を用いて、画像内の所定の領域との対比により他の領域の合焦状態を変更した画像を、撮影後に生成可能な画像処理装置及びその制御方法、プログラム並びに撮像装置を提供することを目的とする。 An object of the present invention has been made in view of the above problems. That is, an image processing device, a control method thereof, a program, and an imaging device capable of generating an image in which the focusing state of another region is changed by comparison with a predetermined region in the image using a plurality of viewpoint images after shooting. The purpose is to provide.

この課題を解決するため、例えば本発明の画像処理装置は以下の構成を備える。すなわち、結像光学系の異なる瞳部分領域を通過する光束を受光する複数の副画素が設けられた単位画素を複数配列した撮像素子により得られた画像信号を取得する取得手段と、それぞれの単位画素の第1の所定の位置と第2の所定の位置の副画素から得られる信号を画像信号からそれぞれ選択した第1の視点画像と第2の視点画像との間の、像のずれを示す像ずれ量を領域ごとに検出する検出手段と、検出された領域ごとの像ずれ量に基づいて、第1の視点画像と第2の視点画像とを領域ごとに比率を異ならせて合成し、深度を変更した画像を生成する処理手段と、を有し、処理手段は、第1の視点画像と第2の視点画像とを合成するためのそれぞれの重みを、検出された領域ごとの像ずれ量に基づいて領域ごとに設定する設定手段と、設定された領域ごとのそれぞれの重みに基づいて第1の視点画像と第2の視点画像とを加算して、深度の変更された画像を生成する生成手段と、を有し、設定手段は、それぞれの重みを、第1の領域よりも、検出された領域ごとの像ずれ量と撮像された被写体の所定領域における像ずれ量との差が小さい第2の領域において、重みづけの差が大きくなるように設定することを特徴とする。
In order to solve this problem, for example, the image processing apparatus of the present invention has the following configuration. That is, an acquisition means for acquiring an image signal obtained by an image pickup element in which a plurality of unit pixels provided with a plurality of sub-pixels for receiving light beams passing through different pupil region regions of an imaging optical system are arranged, and each unit. Indicates the image shift between the first viewpoint image and the second viewpoint image in which signals obtained from the first predetermined position of the pixel and the sub-pixels at the second predetermined position are selected from the image signals, respectively. Based on the detection means that detects the amount of image shift for each region and the amount of image shift for each detected region, the first viewpoint image and the second viewpoint image are combined at different ratios for each region. possess a processing means for generating an image obtained by changing the depth, and processing means, each of the weights for combining the first viewpoint image and the second viewpoint image, the image shift for each detected region The setting means that is set for each area based on the amount and the first viewpoint image and the second viewpoint image are added based on the respective weights for each set area to generate an image with a changed depth. The setting means has, and the setting means has a difference between the amount of image shift for each detected region and the amount of image shift in a predetermined region of the imaged subject, as compared with the first region. It is characterized in that it is set so that the difference in weighting becomes large in the small second region .

本発明によれば、複数の視点画像を用いて、画像内の所定の領域との対比により他の領域の合焦状態を変更した画像を、撮影後に生成することが可能になる。 According to the present invention, it is possible to generate an image in which the focusing state of another region is changed by comparison with a predetermined region in the image by using a plurality of viewpoint images after shooting.

第1の実施形態に係る画像処理装置の一例としてのデジタルカメラの機能構成例を示すブロック図A block diagram showing a functional configuration example of a digital camera as an example of the image processing device according to the first embodiment. 第1の実施形態における画素配列を概略的に示す図The figure which shows schematic the pixel array in 1st Embodiment 第1の実施形態における画素の概略平面図(A)と概略断面図(B)Schematic plan view (A) and schematic cross-sectional view (B) of pixels in the first embodiment 第1の実施形態における画素と瞳分割の関係を概略的に示す図The figure which shows the relationship between the pixel and pupil division in the 1st Embodiment schematicly. 第1の実施形態における画素内部の光強度分布の例を示す図The figure which shows the example of the light intensity distribution inside a pixel in 1st Embodiment 第1の実施形態における瞳強度分布の例を示す図The figure which shows the example of the pupil intensity distribution in 1st Embodiment 第1の実施形態における撮像素子と瞳分割の関係を概略的に示す図The figure which shows roughly the relationship between the image sensor and pupil division in 1st Embodiment 第1の実施形態における第1視点画像と第2視点画像のデフォーカス量と、像ずれ量との関係を概略的に示す図The figure which shows roughly the relationship between the defocus amount of the 1st viewpoint image and the 2nd viewpoint image and the image shift amount in 1st Embodiment. 第1の実施形態における深度修正処理に係る一連の動作を示すフローチャートA flowchart showing a series of operations related to the depth correction process in the first embodiment. 第1の実施形態における第1視点画像と第2視点画像の瞳ずれによるシェーディングを説明する図The figure explaining the shading by the pupil deviation of the 1st viewpoint image and the 2nd viewpoint image in 1st Embodiment. 第1の実施形態における撮像画像を例示する図The figure which illustrates the captured image in 1st Embodiment 第1の実施形態における撮像画像及び視点画像のコントラスト分布を例示する図The figure which illustrates the contrast distribution of the captured image and the viewpoint image in 1st Embodiment 第1の実施形態における視点画像間の視差と遠近競合の関係を概略的に示す図The figure which shows the relationship between the parallax and the perspective competition between the viewpoint images in the 1st Embodiment schematicly. 第1の実施形態における(A)コントラスト差分量分布、(B)コントラスト分布、(C)像ずれ量分布を例示する図The figure which illustrates (A) contrast difference amount distribution, (B) contrast distribution, (C) image deviation amount distribution in 1st Embodiment. 第1の実施形態における所定シフト量からの像ずれ差分量分布を例示する図The figure which illustrates the image deviation difference amount distribution from the predetermined shift amount in the 1st Embodiment 第1の実施形態における視差を先鋭化する処理の効果を説明する図The figure explaining the effect of the process which sharpens the parallax in the 1st Embodiment. 第1の実施形態における合成処理による深度修正可能範囲を概略的に説明する図The figure which roughly explains the depth correction possible range by the synthesis process in 1st Embodiment 第2の実施形態における画素配列を概略的に示す図The figure which shows schematic the pixel array in 2nd Embodiment 第2の実施形態における画素の概略平面図(A)と概略断面図(B)Schematic plan view (A) and schematic sectional view (B) of pixels in the second embodiment.

以下、例示的な実施形態について図面に基づいて詳細に説明する。以下の実施形態では、本発明を画像処理装置の一例としてのデジタルカメラに適用した場合を例に説明するが、本発明はLFデータを処理可能な任意の機器に適用可能である。任意の機器には、例えばパーソナルコンピュータ、タブレット、ゲーム機、眼鏡型や時計型等のウェアラブル端末、車載用システム、監視カメラ用システム、医療機器が含まれてよい。 Hereinafter, exemplary embodiments will be described in detail with reference to the drawings. In the following embodiments, the case where the present invention is applied to a digital camera as an example of an image processing device will be described as an example, but the present invention can be applied to any device capable of processing LF data. Any device may include, for example, a personal computer, a tablet, a game machine, a wearable terminal such as a spectacle type or a clock type, an in-vehicle system, a system for a surveillance camera, and a medical device.

(第1の実施形態)
図1は、本実施形態に係る画像処理装置の一例のとしてのデジタルカメラ100の機能構成例を示すブロック図である。撮影レンズ(結像光学系)の先端に配置された第1レンズ群101は、レンズ鏡筒にて光軸方向に進退可能に保持される。絞り兼用シャッタ102は、その開口径を調節することで撮影時の光量調節を行う他、静止画撮影時には露光秒時調節用シャッタとしての機能をもつ。第2レンズ群103は、絞り兼用シャッタ102と一体となって光軸方向に進退し、第1レンズ群101の進退動作との連動により、変倍作用(ズーム機能)を有する。第3レンズ群105は、光軸方向の進退により焦点調節を行うフォーカスレンズである。光学的ローパスフィルター106は、撮像画像の偽色やモアレを軽減するための光学素子である。撮像素子107は、例えば2次元CMOS(相補型金属酸化膜半導体)フォトセンサーと周辺回路とを含み、結像光学系の結像面に配置される。撮像素子107の詳細は後述する。
(First Embodiment)
FIG. 1 is a block diagram showing a functional configuration example of the digital camera 100 as an example of the image processing device according to the present embodiment. The first lens group 101 arranged at the tip of the photographing lens (imaging optical system) is held by the lens barrel so as to be able to move forward and backward in the optical axis direction. The aperture combined shutter 102 adjusts the amount of light at the time of shooting by adjusting the aperture diameter thereof, and also has a function as a shutter for adjusting the exposure seconds at the time of shooting a still image. The second lens group 103 advances and retreats in the optical axis direction integrally with the diaphragm and shutter 102, and has a magnification-changing action (zoom function) in conjunction with the advancing and retreating operation of the first lens group 101. The third lens group 105 is a focus lens that adjusts the focus 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 of captured images. The image sensor 107 includes, for example, a two-dimensional CMOS (complementary metal oxide semiconductor) photosensor and peripheral circuits, and is arranged on the image plane of the imaging optical system. Details of the image sensor 107 will be described later.

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

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

制御部121は、例えばCPU(中央演算処理装置)を含み、デジタルカメラ100全体の動作を制御する。制御部121は、演算部、ROM(リード・オンリー・メモリ)、RAM(ランダム・アクセス・メモリ)、A(アナログ)/D(デジタル)コンバーター、D/Aコンバーター、通信インターフェイス回路等を含む。制御部121は、ROMに記憶された所定のプログラムをRAMに展開、実行することにより、デジタルカメラ100の各部を駆動し、AF制御、撮像処理、画像処理、記録処理等の一連の動作を実行する。 The control unit 121 includes, for example, a CPU (Central Processing Unit) and controls the operation of the entire digital camera 100. The control unit 121 includes a calculation 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 control unit 121 drives each unit of the digital camera 100 by expanding and executing a predetermined program stored in the ROM in the RAM, and executes a series of operations such as AF control, imaging processing, image processing, and recording processing. To do.

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

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

表示部131は、例えばLCD(液晶表示装置)等の表示デバイスを含み、カメラの撮影モードに関する情報、撮影前のプレビュー画像と撮影後の確認用画像、後述する深度変更処理により生成された合成画像等を表示する。操作部132は、例えば電源スイッチ、レリーズ(撮影トリガ)スイッチ、ズーム操作スイッチ、撮影モード選択スイッチ等の操作スイッチやタッチパネルを含み、操作指示信号を制御部121に出力する。記録媒体133は、フラッシュメモリ等のデジタルカメラ100に着脱可能な記録媒体であり、撮影済み画像データ、後述するLFデータ、生成された合成画像等を記録する。 The display unit 131 includes a display device such as an LCD (liquid crystal display), and includes information on a shooting mode of the camera, a preview image before shooting and a confirmation image after shooting, and a composite image generated by a depth change process described later. Etc. are displayed. The operation unit 132 includes, for example, an operation switch such as a power switch, a release (shooting trigger) switch, a zoom operation switch, and a shooting mode selection switch, and a touch panel, and outputs an operation instruction signal to the control unit 121. The recording medium 133 is a recording medium that can be attached to and detached from the digital camera 100 such as a flash memory, and records captured image data, LF data described later, a generated composite image, and the like.

(撮像素子の構成)
本実施形態に係る撮像素子107の画素と副画素の配列の概略図を図2に示す。図2の左右方向をx方向(水平方向)、上下方向をy方向(垂直方向)、x方向およびy方向に直交する方向(紙面に垂直な方向)をz方向(光軸方向)とする。図2に示す例は、2次元CMOSセンサー(撮像素子)の画素(単位画素)配列を4列×4行の範囲で、副画素配列を8列×4行の範囲で示している。
(Configuration of image sensor)
FIG. 2 shows a schematic diagram of the arrangement of the pixels and the sub-pixels of the image sensor 107 according to the present embodiment. The horizontal direction in FIG. 2 is the x direction (horizontal direction), the vertical direction is the y direction (vertical direction), and the x direction and the direction orthogonal to the y direction (direction perpendicular to the paper surface) are the z direction (optical axis direction). In the example shown in FIG. 2, the pixel (unit pixel) array of the two-dimensional CMOS sensor (image sensor) is shown in the range of 4 columns × 4 rows, and the sub-pixel array is shown in the range of 8 columns × 4 rows.

2列×2行の画素群200は、例えば左上の位置に第1色のR(赤)の分光感度を有する画素200Rが左上に、第2色のG(緑)の分光感度を有する画素200Gが右上と左下に、第3色のB(青)の分光感度を有する画素200Bが右下に配置される。さらに、各画素(単位画素)は、x方向に2分割(Nx分割)、y方向に1分割(Ny分割)された分割数2(分割数NLF=Nx×Ny)の第1副画素201と第2副画素202(第1副画素から第NLF副画素)の複数の副画素により構成されている。 In the pixel group 200 of 2 columns × 2 rows, for example, the pixel 200R having the spectral sensitivity of R (red) of the first color at the upper left position is the pixel 200G having the spectral sensitivity of G (green) of the second color at the upper left. Is arranged in the upper right and lower left, and the pixel 200B having the spectral sensitivity of B (blue) of the third color is arranged in the lower right. Further, each pixel (unit pixel) is divided into two in the x direction (Nx division) and one division in the y direction (Ny division), and the first sub-pixel 201 has a number of divisions of 2 (division number NLF = Nx × Ny). It is composed of a plurality of sub-pixels of the second sub-pixel 202 (first sub-pixel to NLF sub-pixel).

図2に示す例では、4列×4行の画素(8列×4行の副画素)を撮像面上に配置することで、撮像画像および分割数2(分割数NLF)の複数の視点画像を生成するための画像信号(LFデータ)を取得可能である。本実施形態の撮像素子では、画素の周期Pを4μm(マイクロメートル)とし、画素数Nを横5575列×縦3725行=約2075万画素とする。また、副画素の列方向周期Pを2μmとし、副画素数Nを横11150列×縦3725行=約4150万画素とする。 In the example shown in FIG. 2, by arranging 4 columns × 4 rows of pixels (8 columns × 4 rows of sub-pixels) on the imaging surface, the captured image and a plurality of viewpoints having 2 divisions ( NLF divisions) It is possible to acquire an image signal (LF data) for generating an image. In the image sensor of the present embodiment, the pixel period P is 4 μm (micrometer), and the number of pixels N is 5575 columns (horizontal) x 3725 rows (vertical) = about 20.75 million pixels. Further, the column period P S of the sub-pixel is 2 [mu] m, the sub-pixel number N S horizontal 11150 rows × vertical 3725 lines = from about 41,500,000 pixels.

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

図3(A)および、図3(B)に示すように、画素200Gには、各画素の受光面側(+z方向)にマイクロレンズ305が形成され、このマイクロレンズ305によって入射光が集光される。さらに、x方向に2分割、y方向に1分割された分割数2の第1光電変換部301と第2光電変換部302の複数の光電変換部が形成され、第1光電変換部301と第2光電変換部302が、それぞれ第1副画素201と第2副画素202に対応する。より一般的に、(x方向にNx分割、y方向にNy分割された分割数NLFの)第1光電変換部から第NLF光電変換部の複数の光電変換部が形成され、第1光電変換部から第NLF光電変換部が、それぞれ、第1副画素から第NLF副画素に対応する。 As shown in FIGS. 3A and 3B, a microlens 305 is formed in the pixel 200G on the light receiving surface side (+ z direction) of each pixel, and the incident light is collected by the microlens 305. Will be done. Further, a plurality of photoelectric conversion units of the first photoelectric conversion unit 301 and the second photoelectric conversion unit 302 having two divisions divided into two in the x direction and one division in the y direction are formed, and the first photoelectric conversion unit 301 and the first photoelectric conversion unit 301 are formed. The two photoelectric conversion units 302 correspond to the first sub-pixel 201 and the second sub-pixel 202, respectively. More generally, (x direction Nx divided, the division number N LF which is Ny divided in the y-direction) a plurality of photoelectric conversion units of the first N LF photoelectric conversion unit is formed from the first photoelectric conversion unit, the first photoelectric The conversion unit to the N LF photoelectric conversion unit correspond to the first sub-pixel to the N LF sub-pixel, respectively.

第1光電変換部301と第2光電変換部302は、2つの独立したpn接合フォトダイオードであり、p型ウェル層300と2つに分割されたn型層301とn型層302から構成される。必要に応じて、イントリンシック層を挟み、pin構造フォトダイオードとして形成してもよい。各画素には、マイクロレンズ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, and are composed of a p-type well layer 300 and an n-type layer 301 and an n-type layer 302 divided into two. To. If necessary, an intrinsic layer may be sandwiched and formed as a pin structure photodiode. A color filter 306 is formed in each pixel between the microlens 305 and the first photoelectric conversion unit 301 and the second photoelectric conversion unit 302. If necessary, the spectral transmittance of the color filter 306 may be changed for each pixel or each photoelectric conversion unit, or the color filter may be omitted.

画素200Gに入射した光はマイクロレンズ305が集光し、さらにカラーフィルター306で分光された後に、第1光電変換部301と第2光電変換部302がそれぞれ受光する。第1光電変換部301と第2光電変換部302では、受光量に応じて電子とホール(正孔)が対生成され、空乏層で分離された後、電子が蓄積される。一方、ホールは定電圧源(不図示)に接続されたp型ウェル層を通じて撮像素子107の外部へ排出される。第1光電変換部301と第2光電変換部302に蓄積された電子は、転送ゲートを介して、静電容量部(FD)に転送されて電圧信号に変換される。 The light incident on the pixel 200G is collected by the microlens 305, further separated by the color filter 306, and then received by the first photoelectric conversion unit 301 and the second photoelectric conversion unit 302, respectively. In the first photoelectric conversion unit 301 and the second photoelectric conversion unit 302, electrons and holes are pair-produced according to the amount of light received, and after being separated by the depletion layer, electrons are accumulated. On the other hand, the hole is discharged to the outside of the image sensor 107 through a p-type well layer connected to a constant voltage source (not shown). The electrons accumulated in 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.

図4は、画素構造と瞳分割との対応関係を概略的に示している。図4には、図3(A)に示した画素構造のa−a線での切断面を、+y方向から見た場合の断面図と、結像光学系の射出瞳面を、−z方向から見た図を示す。図4では、射出瞳面の座標軸と対応を取るために、断面図にてx軸とy軸を図3に示す状態とは反転させて示している。 FIG. 4 schematically shows the correspondence between the pixel structure and the pupil division. FIG. 4 shows a cross-sectional view of the cut surface of the pixel structure shown in FIG. 3A on the aa line when viewed from the + y direction, and the exit pupil surface of the imaging optical system in the −z direction. The figure seen from is shown. In FIG. 4, in order to correspond with the coordinate axes of the exit pupil surface, the x-axis and the y-axis are shown in reverse in the cross-sectional view from the state shown in FIG.

撮像素子107は、撮影レンズ(結像光学系)の結像面近傍に配置されており、被写体からの光束は、結像光学系の射出瞳400を通過して、それぞれの画素に入射する。なお、撮像素子107が配置された面を撮像面とする。 The image sensor 107 is arranged near the image plane 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 is incident on each pixel. The surface on which the image sensor 107 is arranged is defined as the image pickup surface.

2×1分割された第1瞳部分領域501と第2瞳部分領域502(Nx×Ny分割された第1瞳部分領域から第NLF瞳部分領域)は、各々、第1光電変換部301と第2光電変換部302(第1光電変換部から第NLF光電変換部)の受光面と、マイクロレンズによって、概ね、光学的に共役な関係になっている。また、第1瞳部分領域501と第2瞳部分領域502(Nx×Ny分割された第1瞳部分領域から第NLF瞳部分領域)は、第1副画素201と第2副画素202(第1副画素から第NLF副画素)でそれぞれ受光可能な瞳領域である。第1副画素201の第1瞳部分領域501は、瞳面上で+X側に重心が偏心しており、第2副画素202の第2瞳部分領域502は、瞳面上で−X側に重心が偏心している。 The 2 × 1 divided first pupil region 501 and the second pupil region 502 (Nx × Ny divided first pupil region to NLF pupil region) are respectively the first photoelectric conversion unit 301. The light receiving surface of the second photoelectric conversion unit 302 (from the first photoelectric conversion unit to the NLF photoelectric conversion unit) and the microlens form an optically conjugated relationship. Further, the first pupil portion region 501 and the second pupil portion region 502 (Nx × Ny-divided first pupil portion region to NLF pupil portion region) are the first sub-pixel 201 and the second sub-pixel 202 (second sub-pixel 201). It is a pupil region that can receive light from the 1st sub-pixel to the NLF sub-pixel). The center of gravity of the first pupil region 501 of the first sub-pixel 201 is eccentric to the + X side on the pupil surface, and the second pupil region 502 of the second sub-pixel 202 has the center of gravity on the −X side on the pupil surface. Is eccentric.

また、瞳領域500は、2×1分割された第1光電変換部301と第2光電変換部302(Nx×Ny分割された第1光電変換部から第NLF光電変換部)を全て合わせた受光面と、マイクロレンズによって、概ね、光学的に共役な関係になっている。また、瞳領域500は、第1副画素201と第2副画素202(第1副画素から第NLF副画素)を全て合わせた画素200G全体での受光可能な瞳領域である。 Further, in the pupil region 500, the first photoelectric conversion unit 301 divided into 2 × 1 and the second photoelectric conversion unit 302 (from the first photoelectric conversion unit divided into Nx × Ny to the NLF photoelectric conversion unit) are all combined. The light-receiving surface and the microlens generally form an optically conjugated relationship. Further, the pupil region 500 is a pupil region that can receive light in the entire pixel 200G in which the first sub-pixel 201 and the second sub-pixel 202 (first sub-pixel to NLF sub-pixel) are all combined.

各画素に形成されたマイクロレンズに光が入射した場合の光強度分布を例示する。図5(A)は、マイクロレンズの光軸に平行な断面における光強度分布を示している。また、図5(B)はマイクロレンズの焦点位置において、マイクロレンズの光軸に垂直な断面における光強度分布を示している。図5において、Hはマイクロレンズ305の凸側の面を、fはマイクロレンズの焦点距離を示している。また、nFΔは後述するリフォーカスによる焦点位置の可動範囲を、φは入射する光束の最大角度を示している。入射光は、マイクロレンズ305により、焦点位置に集光される。しかし、光の波動性による回折の影響により、集光スポットの直径は回折限界Δより小さくすることはできず、有限の大きさとなる。光電変換部の受光面サイズは約1〜2μm程度であり、これに対してマイクロレンズの集光スポットは約1μm程度である。そのため、光電変換部の受光面とマイクロレンズを介して共役の関係にある、図4に示した第1瞳部分領域501と第2瞳部分領域502は、回折ボケのため、明瞭に瞳分割されず、光の入射角に依存した受光率分布(瞳強度分布)となる。 An example shows a light intensity distribution when light is incident on a microlens formed in each pixel. FIG. 5A shows a light intensity distribution in a cross section parallel to the optical axis of the microlens. Further, FIG. 5B shows the light intensity distribution in the cross section perpendicular to the optical axis of the microlens at the focal position of the microlens. In FIG. 5, H indicates the convex surface of the microlens 305, and f indicates the focal length of the microlens. Further, nFΔ indicates the movable range of the focal position due to refocusing described later, and φ indicates the maximum angle of the incident luminous flux. The incident light is focused on the focal position by the microlens 305. 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 focusing spot of the microlens is about 1 μm. Therefore, the first pupil region 501 and the second pupil region 502 shown in FIG. 4, which are conjugate to the light receiving surface of the photoelectric conversion unit via the microlens, are clearly divided into pupils due to diffraction blur. Instead, the light receiving rate distribution (pupil intensity distribution) depends on the incident angle of light.

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

次に、図7を参照して、撮像素子107と瞳分割との対応関係について説明する。第1光電変換部301と第2光電変換部302(第1光電変換部から第NLF光電変換部)が、それぞれ、第1副画素201と第2副画素202(第1副画素から第NLF副画素)に対応する。撮像素子107の各画素において、2×1分割された第1副画素201と第2副画素202(Nx×Ny分割された第1副画素から第NLF副画素)は、それぞれ、結像光学系の第1瞳部分領域501と第2瞳部分領域502(第1瞳部分領域から第NLF瞳部分領域)の異なる瞳部分領域を通過した光束を受光する。各副画素で受光された信号から、光強度の空間分布および角度分布の情報を含む画像信号が取得される。なお、この画像信号はLF(Light Field)データともいわれる。 Next, the correspondence between the image sensor 107 and the pupil division will be described with reference to FIG. 7. The first photoelectric conversion unit 301 and the second photoelectric conversion unit 302 (from the first photoelectric conversion unit to the NLF photoelectric conversion unit) are the first sub-pixel 201 and the second sub-pixel 202 (first sub-pixel to N-th), respectively. LF sub-pixel). In each pixel of the image sensor 107, the 2 × 1 divided first sub-pixel 201 and the second sub-pixel 202 (Nx × Ny-divided first sub-pixel to NLF sub-pixel) are respectively imaging optics. It receives light flux that has passed through different pupil region regions of the first pupil region 501 and the second pupil region 502 (from the first pupil region to the NLF pupil region) of the system. From the signal received by each sub-pixel, an image signal including information on the spatial distribution and the angular distribution of the light intensity is acquired. This image signal is also referred to as LF (Light Field) data.

まず、この画像信号(LFデータ)から、画素ごとに、2×1分割された第1副画素201と第2副画素202(Nx×Ny分割された第1副画素から第NLF副画素)の中から特定の副画素の信号を選択する。これにより、結像光学系の第1瞳部分領域501と第2瞳部分領域502(第1瞳部分領域から第NLF瞳部分領域)の中の特定の瞳部分領域に対応した視点画像を生成することができる。例えば、画素ごとに、第1副画素201の信号を選択することで、結像光学系の第1瞳部分領域501に対応した画素数Nの解像度を有する第1視点画像を生成できる。他の副画素でも同様である。 First, from this image signal (LF data), the first sub-pixel 201 and the second sub-pixel 202 (Nx × Ny-divided first sub-pixel to NLF sub-pixel) are divided into 2 × 1 for each pixel. A signal of a specific sub-pixel is selected from the above. As a result, a viewpoint image corresponding to a specific pupil region in the first pupil region 501 and the second pupil region 502 (from the first pupil region to the NLF pupil region) of the imaging optical system is generated. can do. For example, by selecting the signal of the first sub-pixel 201 for each pixel, it is possible to generate a first viewpoint image having a resolution of the number of pixels N corresponding to the first pupil partial region 501 of the imaging optical system. The same applies to other sub-pixels.

また、LFデータの信号について、画素ごとに、2×1分割された第1副画素201と第2副画素202(Nx×Ny分割された第1副画素から第NLF副画素)の信号を全て合成することにより、画素数Nの解像度を有する撮像画像を生成することができる。なお、上述した視点画像および撮像画像は、制御部121が撮像素子107からLFデータを取得して生成する例を説明するが、撮像素子107の内部で生成されてもよく、画像処理回路125がLFデータを取得して生成してもよい。 Further, regarding the signal of the LF data, the signals of the first sub-pixel 201 and the second sub-pixel 202 (Nx × Ny-divided first sub-pixel to the N- LF sub-pixel) divided into 2 × 1 are used for each pixel. By synthesizing all of them, it is possible to generate an captured image having a resolution of N pixels. The above-mentioned viewpoint image and captured image will be described as an example in which the control unit 121 acquires LF data from the image sensor 107 and generates the image. However, the viewpoint image and the captured image may be generated inside the image sensor 107, and the image processing circuit 125 may generate the image. LF data may be acquired and generated.

以上のように本実施形態の撮像素子107は、結像光学系の異なる瞳部分領域を通過する光束を受光する複数の副画素が設けられた画素が複数配列された構造を有し、LFデータを取得することができる。なお、上述した説明では、瞳領域が水平方向に2つに瞳分割される例を示したが、副画素の分割方法に応じて瞳分割が垂直方向に行われてもよい。 As described above, the image pickup device 107 of the present embodiment has a structure in which a plurality of pixels provided with a plurality of sub-pixels for receiving light flux passing through different pupil region regions of the imaging optical system are arranged, and the LF data. Can be obtained. In the above description, the pupil region is divided into two in the horizontal direction, but the pupil division may be performed in the vertical direction depending on the method of dividing the sub-pixels.

(デフォーカス量と像ずれ量の関係)
さらに、図8を参照して、撮像素子107により取得されるLFデータに基づいて生成可能な第1視点画像と第2視点画像(第1視点画像から第NLF視点画像)のデフォーカス量と像ずれ量との関係について説明する。
(Relationship between defocus amount and image shift amount)
Further, with reference to FIG. 8, the defocus amount of the first viewpoint image and the second viewpoint image (from the first viewpoint image to the NLF viewpoint image) that can be generated based on the LF data acquired by the image sensor 107. The relationship with the amount of image shift will be described.

図8は、第1視点画像と第2視点画像のデフォーカス量と、第1視点画像と第2視点画像との間の像ずれ量の関係を概略的に示している。撮像面600には撮像素子(不図示)が配置され、結像光学系の射出瞳は、図4、図7の場合と同様に、第1瞳部分領域501と第2瞳部分領域502に2×1分割される。 FIG. 8 schematically shows the relationship between the defocus amount 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 image sensor (not shown) is arranged on the image pickup surface 600, and the exit pupils of the imaging optical system are 2 in the first pupil portion region 501 and the second pupil portion region 502 as in the cases of FIGS. 4 and 7. It is divided into × 1.

デフォーカス量dは、その大きさ|d|が被写体像の結像位置から撮像面600までの距離を表す。被写体像の結像位置が撮像面600よりも被写体側にある前ピン状態では、負符号(d<0)とし、これとは反対の後ピン状態では正符号(d>0)として向きを定義する。被写体像の結像位置が撮像面(すなわち合焦位置)にある合焦状態では、d=0である。例えば、被写体801の位置は、合焦状態(d=0)に対応する位置を示しており、被写体802の位置は前ピン状態(d<0)に対応する位置を示している。以下では、前ピン状態(d<0)と後ピン状態(d>0)とを併せて、デフォーカス状態(|d|>0)という。 The defocus amount d has a magnitude | d | representing the distance from the imaging position of the subject image to the imaging surface 600. The orientation is defined as a negative sign (d <0) in the front pin state where the image formation position of the subject image is on the subject side of the imaging surface 600, and as a positive sign (d> 0) in the opposite rear pin state. To do. In the in-focus state where the image formation position of the subject image is on the imaging surface (that is, the in-focus position), d = 0. For example, the position of the subject 801 indicates a position corresponding to the in-focus state (d = 0), and the position of the subject 802 indicates a 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上でボケ像となる。ボケ像は、撮像素子107に配列された各画素部を構成する第1副画素201(または第2副画素202)により受光され、第1視点画像(または第2視点画像)が生成される。よって、第1視点画像(または第2視点画像)は、撮像面600上の重心位置G1(またはG2)にて、幅Γ1(またはΓ2)をもった被写体像(ボケ像)の画像信号としてメモリに記憶される。被写体像の幅Γ1(またはΓ2)は、デフォーカス量dの大きさ|d|が増加するのに伴い、概ね比例して増加する。同様に、第1視点画像と第2視点画像との間の被写体像の像ずれ量を「p」と記すと、その大きさ|p|はデフォーカス量dの大きさ|d|の増加に伴って増加する。例えば、図8に示すように、像ずれ量pは光束の重心位置の差「G1−G2」として定義することができ、その大きさ|p|は、|d|が増加するのに伴い、概ね比例して増加する。なお、後ピン状態(d>0)では、第1視点画像と第2視点画像との間の被写体像の像ずれ方向が前ピン状態とは反対となるが、同様に|p|がデフォーカス量|d|に比例する傾向がある。 In the front pin state (d <0), among the luminous fluxes received from the subject 802, the luminous flux passing through the first pupil region 501 (or the second pupil region 502) is once focused and then the position of the center of gravity of the luminous flux. It extends to a width Γ1 (or Γ2) centered on G1 (or G2). In this case, a blurred image is obtained on the imaging surface 600. The blurred image is received by the first sub-pixel 201 (or the second sub-pixel 202) constituting each pixel portion arranged in the image sensor 107, and the first viewpoint image (or the second viewpoint image) is generated. Therefore, the first viewpoint image (or the second viewpoint image) is stored as an image signal of a subject image (blurred image) having a width Γ1 (or Γ2) at the center of gravity position G1 (or G2) on the imaging surface 600. Is remembered in. The width Γ1 (or Γ2) of the subject image increases substantially proportionally as the magnitude | d | of the defocus amount d increases. Similarly, if the amount of image shift of the subject image between the first viewpoint image and the second viewpoint image is described as "p", the magnitude | p | increases the magnitude | d | of the defocus amount d. It increases with it. For example, as shown in FIG. 8, the image shift amount p can be defined as the difference “G1-G2” in the position of the center of gravity of the luminous flux, and its magnitude | p | becomes as | d | increases. It increases roughly in proportion. In the rear focus 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 | p | is similarly defocused. It tends to be proportional to the amount | d |.

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

(深度修正処理に係る一連の動作)
次に、図9を参照して、撮像画像の被写界深度(単に深度ともいう)を再修正する深度修正処理について説明する。特に、本実施形態では、第1視点画像と第2視点画像(第1視点画像から第NLF視点画像)のデフォーカス量と像ずれ量の関係性から得られる像ずれ量分布に基づいて深度修正処理を行う例について説明する。この深度修正処理では、合焦近傍の被写体の深度を領域ごとに修正した出力画像(合成画像)を生成する。なお、図9に示す深度修正処理に係る一連の動作は、例えば操作部132がユーザによる撮影指示又は予め記録媒体133に記録されたLFデータの選択を検出した場合に開始される。深度修正処理に係る一連の動作は、制御部121が不図示のROMに記録されたプログラムを不図示のRAMに展開、実行し、画像処理回路125等の各部を制御することにより実現される。
(A series of operations related to depth correction processing)
Next, with reference to FIG. 9, a depth correction process for re-correcting the depth of field (also simply referred to as depth) of the captured image will be described. In particular, in the present embodiment, the depth is based on the image shift amount distribution obtained from the relationship between the defocus amount and the image shift amount of the first viewpoint image and the second viewpoint image (from the first viewpoint image to the NLF viewpoint image). An example of performing correction processing will be described. In this depth correction process, an output image (composite image) in which the depth of the subject in the vicinity of focusing is corrected for each area is generated. The series of operations related to the depth correction process shown in FIG. 9 is started when, for example, the operation unit 132 detects a shooting instruction by the user or selection of LF data previously recorded on the recording medium 133. A series of operations related to the depth correction process is realized by the control unit 121 expanding and executing the program recorded in the ROM (not shown) in the RAM (not shown) and controlling each part such as the image processing circuit 125.

<視点画像と撮像画像の生成>
S1では、制御部121は、入力画像信号(すなわちLFデータ)から視点画像と撮影画像を生成する。制御部121は、例えば撮像素子107からLFデータを取得して、結像光学系の異なる瞳部分領域ごとの複数の視点画像を生成するともに、結像光学系の異なる瞳部分領域を合成した撮像画像を生成する。
<Generation of viewpoint image and captured image>
In S1, the control unit 121 generates a viewpoint image and a captured image from the input image signal (that is, LF data). For example, the control unit 121 acquires LF data from the image sensor 107, generates a plurality of viewpoint images for each different pupil region of the imaging optical system, and synthesizes an imaging image in which different pupil regions of the imaging optical system are combined. Generate an image.

より具体的に、まず、制御部121は撮像素子107からLFデータを取得する。もしくは、予め本実施形態の撮像素子107により撮影され、記録媒体133に保存されているLFデータを取得してもよい。次に、制御部121は、結像光学系の異なる瞳部分領域ごとに、第1視点画像と第2視点画像(第1視点画像から第NLF視点画像)を生成する。なお、以下の説明ではLFデータを単にLFとも表す。また、LFデータの各画素信号内での列方向i(1≦i≦Nx)番目、行方向j(1≦j≦Ny)番目の副画素信号を、k=Nx(j−1)+i(1≦k≦NLF)として、第k副画素信号とする。結像光学系の第k瞳部分領域に対応した、列方向i番目、行方向j番目の第k視点画像Ik(j、i)を、式(1)に従って生成する。 More specifically, first, the control unit 121 acquires LF data from the image sensor 107. Alternatively, the LF data previously photographed by the image sensor 107 of the present embodiment and stored in the recording medium 133 may be acquired. Next, the control unit 121 generates a first viewpoint image and a second viewpoint image (from the first viewpoint image to the NLF viewpoint image) for each different pupil region of the imaging optical system. In the following description, the LF data is also simply referred to as LF. Further, in each pixel signal of the LF data, the sub-pixel signal in the column direction i S (1 ≤ i S ≤ Nx) th and the row direction j S (1 ≤ j S ≤ Ny) th sub-pixel signal is k = Nx (j S). -1) As + i S (1 ≦ k ≦ N LF ), the kth sub-pixel signal is used. The k-th viewpoint image Ik (j, i) corresponding to the k-th pupil partial region of the imaging optical system is generated according to the equation (1) at the i-th column direction and the j-th row direction.

なお、本実施形態は、Nx=2、Ny=1、NLF=2としてx方向に2分割する例を示している。制御部121は、更に、LFデータから、画素ごとに、第1副画素201と第2副画素202(Nx×Ny分割された第1副画素から第NLF副画素)のうちの特定の副画素の信号を選択する。すなわち、第1瞳部分領域501と第2瞳部分領域502(第1瞳部分領域から第NLF瞳部分領域)のうち特定の瞳部分領域に対応した、第1視点画像或いは第2視点画像(第1視点画像から第NLF視点画像)を生成する。なお、生成される各視点画像は、画素数Nの解像度を有するベイヤー配列のRGB信号である。 The present embodiment shows an example that bisected the x direction as Nx = 2, Ny = 1, N LF = 2. Further, from the LF data, the control unit 121 further determines a specific sub-pixel of the first sub-pixel 201 and the second sub-pixel 202 (Nx × Ny-divided first sub-pixel to N- LF sub-pixel) for each pixel. Select the pixel signal. That is, a first viewpoint image or a second viewpoint image (1st viewpoint image or a second viewpoint image) corresponding to a specific pupil part region among the first pupil part region 501 and the second pupil part region 502 (the first pupil part region to the NLF pupil part region). The NLF viewpoint image) is generated from the first viewpoint image. Each generated viewpoint image is a Bayer array RGB signal having a resolution of N pixels.

ここで、図10を参照して、第1視点画像と第2視点画像(第1視点画像から第NLF視点画像)の瞳ずれによるシェーディングについて説明する。図10(A)〜(C)には、第1光電変換部301が受光する第1瞳部分領域501と第2光電変換部302が受光する第2瞳部分領域502と結像光学系の射出瞳400との関係を示している。 Here, with reference to FIG. 10, shading due to pupil displacement of the first viewpoint image and the second viewpoint image (from the first viewpoint image to the NLF viewpoint image) will be described. 10 (A) to 10 (C) show the first pupil region 501 received by the first photoelectric conversion unit 301, the second pupil region 502 received by the second photoelectric conversion unit 302, and the ejection of the imaging optical system. It shows the relationship with the pupil 400.

図10(A)は、結像光学系の射出瞳距離Dlと撮像素子107の設定瞳距離Dsが同じ場合を示している。この場合、結像光学系の射出瞳400は、第1瞳部分領域501と第2瞳部分領域502により概ね均等に瞳分割される。これに対して、図10(B)は、結像光学系の射出瞳距離Dlが撮像素子の設定瞳距離Dsより短い場合を示している。この場合、撮像素子107の周辺像高では、結像光学系の射出瞳と撮像素子の入射瞳の瞳ずれが生じ、結像光学系の射出瞳400は不均一に瞳分割されてしまう。図10(B)の例では、第1瞳部分領域501に対応した第1視点画像の実効絞り値が、第2瞳部分領域502に対応した第2視点画像の実効絞り値より小さい(明るい)値となる。反対側の像高(不図示)では、逆に、第1瞳部分領域501に対応した第1視点画像の実効絞り値が、第2瞳部分領域502に対応した第2視点画像の実効絞り値より大きい(暗い)値となる。 FIG. 10A 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 substantially evenly by the first pupil region 501 and the second pupil region 502. On the other hand, FIG. 10B 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. In this case, at the peripheral image height of the image pickup device 107, the exit pupil of the image pickup optical system and the entrance pupil of the image pickup device are displaced from each other, and the exit pupil 400 of the image pickup optical system is unevenly divided. In the example of FIG. 10B, the effective aperture value of the first viewpoint image corresponding to the first pupil region 501 is smaller (brighter) than the effective aperture value of the second viewpoint image corresponding to the second pupil region 502. It becomes a value. On the opposite side of the image height (not shown), on the contrary, the effective aperture value of the first viewpoint image corresponding to the first pupil region 501 is the effective aperture value of the second viewpoint image corresponding to the second pupil region 502. Greater (darker) value.

同様に、図10(C)に示す、結像光学系の射出瞳距離Dlが撮像素子の設定瞳距離Dsより長い場合も、撮像素子107の周辺像高で結像光学系の射出瞳と撮像素子の入射瞳の瞳ずれが生じる。このため、図10(C)に示す場合にも結像光学系の射出瞳400が不均一に瞳分割されてしまう。図10(C)の例では、第1瞳部分領域501に対応した第1視点画像の実効絞り値が、第2瞳部分領域502に対応した第2視点画像の実効絞り値より大きい(暗い)値となる。反対側の像高(不図示)では、逆に、第1瞳部分領域501に対応した第1視点画像の実効絞り値が、第2瞳部分領域502に対応した第2視点画像の実効絞り値より小さい(明るい)値となる。 Similarly, even when the exit pupil distance Dl of the imaging optical system shown in FIG. 10C is longer than the set pupil distance Ds of the image sensor, the peripheral image height of the image sensor 107 is used to image the exit pupil of the image sensor. The pupil of the entrance pupil of the element is displaced. Therefore, even in the case shown in FIG. 10C, the exit pupil 400 of the imaging optical system is unevenly divided into pupils. In the example of FIG. 10C, the effective aperture value of the first viewpoint image corresponding to the first pupil region 501 is larger than the effective aperture value of the second viewpoint image corresponding to the second pupil region 502 (dark). It becomes a value. On the opposite side of the image height (not shown), on the contrary, the effective aperture value of the first viewpoint image corresponding to the first pupil region 501 is the effective aperture value of the second viewpoint image corresponding to the second pupil region 502. It will be a smaller (brighter) value.

このように、瞳分割が不均一になることに伴い、第1視点画像と第2視点画像の強度も不均一になり、第1視点画像と第2視点画像のいずれか一方の強度が大きく、また他方の強度が小さくなるシェーディングが生じる。そして、このシェーディングは画素ごと、すなわちRGBごとに生じる。 As described above, as the pupil division becomes non-uniform, the intensities of the first viewpoint image and the second viewpoint image also become non-uniform, and the intensity of either the first viewpoint image or the second viewpoint image becomes large. In addition, shading occurs in which the strength of the other is reduced. And this shading occurs for each pixel, that is, for each RGB.

このため、制御部121は、必要に応じて、第1視点画像と第2視点画像(第1視点画像から第NLF視点画像)に対して、(RGBごとに)シェーディング補正処理(光学補正処理)を行っても良い。また、必要に応じて、キズ補正処理や、飽和処理、デモザイキング処理などを行っても良い。 Therefore, the control unit 121 performs shading correction processing (optical correction processing) (for each RGB) with respect to the first viewpoint image and the second viewpoint image (from the first viewpoint image to the NLF viewpoint image) as necessary. ) May be performed. Further, if necessary, scratch correction processing, saturation processing, demosiking processing, and the like may be performed.

更に、制御部121は、結像光学系の異なる瞳部分領域を合成した撮像画像を生成する。すなわち、それぞれの視点画像がそれぞれの瞳部分領域に対応するのに対し、撮像画像は瞳領域に対応する。制御部121は、列方向にi番目、行方向にj番目の撮像画像I(j、i)を、式(2)に従って生成する。 Further, the control unit 121 generates an image captured by synthesizing different pupil region regions of the imaging optical system. That is, each viewpoint image corresponds to each pupil region, while the captured image corresponds to the pupil region. The control unit 121 generates the captured image I (j, i) at the i-th in the column direction and the j-th in the row direction according to the equation (2).

制御部121は、入力画像信号(LFデータ)から、画素ごとに、第1副画素201と第2副画素202(Nx×Ny分割された第1副画素から第NLF副画素)の信号を取り出して合成する。これにより、画素数Nの解像度を有するベイヤー配列のRGB信号である撮像画像が生成される。なお、必要に応じて、生成された撮像画像に対するシェーディング補正処理、キズ補正処理、飽和処理、デモザイキング処理などを行っても良い。図11には、上述した処理によって生成され、更にデモザイキング処理が施された撮像画像の例を示している。中央に人物(人形)が配置され、左側に細かい市松模様の平板が手前から奥に渡って傾斜して配置されている。 From the input image signal (LF data), the control unit 121 outputs signals of the first sub-pixel 201 and the second sub-pixel 202 (Nx × Ny-divided first sub-pixel to NLF sub-pixel) for each pixel. Take out and synthesize. As a result, an captured image which is an RGB signal of a Bayer array having a resolution of N pixels is generated. If necessary, shading correction processing, scratch correction processing, saturation processing, demosiking processing, and the like may be performed on the generated captured image. FIG. 11 shows an example of a captured image generated by the above-mentioned processing and further subjected to the demosaiking processing. A person (doll) is placed in the center, and a fine checkered flat plate is placed on the left side at an angle from the front to the back.

このようにS1では、撮像素子107を用いて取得したLFデータから、異なる瞳部分領域ごとの複数の視点画像が生成されるとともに、異なる瞳部分領域の信号を合成した撮像画像が生成される。 As described above, in S1, a plurality of viewpoint images for each different pupil region are generated from the LF data acquired by using the image sensor 107, and an captured image in which signals of different pupil regions are combined is generated.

<コントラスト分布の生成>
S2において、制御部121は、S1において生成した撮像画像と複数の視点画像に対し、空間周波数の高周波帯域成分を領域ごとに抽出したコントラスト分布を生成する。生成されたコントラスト分布は、視点画像間の差に応じた調整に用いられる。
<Generation of contrast distribution>
In S2, the control unit 121 generates a contrast distribution in which the high-frequency band component of the spatial frequency is extracted for each region with respect to the captured image and the plurality of viewpoint images generated in S1. The generated contrast distribution is used for adjustment according to the difference between the viewpoint images.

まず、制御部121は、ベイヤー配列のRGB信号である撮像画像I(j、i)を用いて、撮像輝度信号Yを生成する。例えば、式(3A)に従って、位置(j,i)ごとに、各RGBの色重心が一致するように撮像輝度信号Yを生成する。同様に、ベイヤー配列のRGB信号である第k視点画像Ik(k=1〜NLF)を用いて、第k視点輝度信号Ykを式(3B)に従って生成する。 First, the control unit 121 generates an imaging luminance signal Y using the captured images I (j, i) which are RGB signals of the Bayer array. For example, according to the equation (3A), the imaging luminance signal Y is generated so that the color centroids of each RGB match at each position (j, i). Similarly, the k-th viewpoint image Ik (k = 1 to NLF ), which is an RGB signal of the Bayer array, is used to generate the k-th viewpoint luminance signal Yk according to the equation (3B).

次に、制御部121は、得られた撮像輝度信号Y(j,i)に空間周波数の高周波成分を抽出するバンドパスフィルターを適用して、撮像高周波信号dY(j,i)を生成する。例えば、バントパスフィルタとして2次元バンドパスフィルター{FBPF(jBPF、iBPF)|−nBPF≦jBPF≦nBPF、−mBPF≦iBPF≦mBPF}を適用し、撮像高周波信号dY(j,i)を式(4A)に従って生成する。同様に、バンドパスフィルターを第k視点輝度信号Yk(j,i)(k=1〜NLF)に適用して、第k視点高周波信号dYk(j,i)を式(4B)に従って生成する。 Next, the control unit 121 applies a bandpass filter that extracts high-frequency components of the spatial frequency to the obtained imaging luminance signal Y (j, i) to generate an imaging high-frequency signal dY (j, i). For example, a two-dimensional bandpass filter {F BPF (j BPF , i BPF ) | -n BPF ≤ j BPF ≤ n BPF , -m BPF ≤ i BPF ≤ m BPF } is applied as a buntpass filter, and the imaged high frequency signal dY (J, i) is generated according to the formula (4A). Similarly, by applying the band-pass filter a k viewpoint luminance signal Yk (j, i) to (k = 1 to N LF), to generate the k-th viewpoint RF signal dYk the (j, i) according to equation (4B) ..

本実施形態は、2次元バンドパスフィルターを、例えばx方向(瞳分割方向)の1次元フィルターFx(iBPF)とy方向(瞳分割方向と直交する方向)の1次元フィルターFy(jBPF)との直積により構成する。すなわち、2次元バンドパスフィルターは、FBPF(jBPF、iBPF)=Fy(jBPF)×Fx(iBPF)のように表すことができる。瞳分割方向であるx方向の1次元フィルターFx(iBPF)は、x方向の空間周波数の高周波成分を抽出するためのものであり、例えば0.5×[1、2、0、−2、−1]+1.5×[1、0、−2、0、1]のように混合フィルターとして構成される。すなわち、1次微分型フィルター[1、2、0、−2、−1]と2次微分型フィルター[1、0、−2、0、1]とを組み合わせている。一般的に、微分型フィルター処理を行うと、フィルター処理後の信号において、正符号から負符号に変化する部分に0点が存在する。このため、絶対値演算と組み合わせる場合、空間周波数の高周波成分が含まれる領域に節が生じてしまう場合がある(但し、節が発生する位置は、微分型フィルターの微分の次数により異なる)。このため、本実施形態では、例えば1次微分型フィルターと2次微分型フィルター(一般には、異なる次数の微分型フィルター)を組み合わせた混合型フィルターにより、節の発生を抑制する。なお、必要に応じて、[1、2、0、−2、−1]などの1次微分型フィルター、[1、0、−2、0、1]などの2次微分型フィルター、高次微分型フィルター、及びより一般的な1次元バンドパスフィルターを用いても良い。 In this embodiment, a two-dimensional bandpass filter is used, for example, a one-dimensional filter Fx (i BPF ) in the x direction (pupil division direction) and a one-dimensional filter Fy (j BPF ) in the y direction (direction orthogonal to the pupil division direction). It is composed by direct product with. That is, the two-dimensional bandpass filter can be expressed as F BPF (j BPF , i BPF ) = Fy (j BPF ) × Fx (i BPF ). The one-dimensional filter Fx (i BPF ) in the x direction, which is the pupil division direction, is for extracting high frequency components of the spatial frequency in the x direction, for example, 0.5 × [1, 2, 0, -2, -1] +1.5 × [1, 0, -2, 0, 1] is configured as a mixing filter. That is, a first-order differential filter [1, 2, 0, -2, -1] and a second-order differential filter [1, 0, -2, 0, 1] are combined. Generally, when the differential filter processing is performed, there is a 0 point in the portion where the positive code changes to the negative code in the filtered signal. Therefore, when combined with the absolute value calculation, a node may occur in the region containing the high frequency component of the spatial frequency (however, the position where the node occurs depends on the derivative order of the differential filter). Therefore, in the present embodiment, for example, the generation of nodes is suppressed by a mixed type filter in which a first-order differential type filter and a second-order differential type filter (generally, differential type filters of different orders) are combined. If necessary, a first-order differential filter such as [1, 2, 0, -2, -1], a second-order differential filter such as [1, 0, -2, 0, 1], and a higher-order filter are used. A differential filter and a more general one-dimensional bandpass filter may be used.

また、瞳分割方向と直交する方向であるy方向の1次元フィルターFy(jBPF)には、y方向の高周波ノイズを抑制するために高周波カット(ローパス)フィルターを用いる。この高周波カット(ローパス)フィルターには、例えば、[1、1、1、1、1]や[1、4、6、4、1]などを用いることができる。また、必要に応じて、x方向とy方向のいずれの方向に対しても、空間周波数の高周波成分を抽出するバンドパスフィルター処理を行っても良い。本実施形態では、2つの1次元フィルターの直積で構成される2次元バンドパスフィルターを例示したが、これに限定されず、一般的な2次元バンドパスフィルターを用いることができる。 A high-frequency cut (low-pass) filter is used for the one-dimensional filter Fy (j BPF ) in the y direction, which is orthogonal to the pupil division direction, in order to suppress high-frequency noise in the y-direction. For this high frequency cut (low pass) filter, for example, [1, 1, 1, 1, 1], [1, 4, 6, 4, 1] and the like can be used. Further, if necessary, a bandpass filter process for extracting high frequency components of spatial frequencies may be performed in either the x direction or the y direction. In the present embodiment, a two-dimensional bandpass filter composed of a direct product of two one-dimensional filters has been illustrated, but the present invention is not limited to this, and a general two-dimensional bandpass filter can be used.

さらに、制御部121は、撮像高周波信号dY(j,i)を規格化して規格化撮像高周波信号dZ(j,i)を生成する。例えば、Y>0として、撮像高周波信号dY(j,i)を式(5A)に従って撮像輝度信号Y(j,i)により規格化する。同様に、第k視点高周波信号dYk(j,i)(k=1〜NLF)を、第k視点輝度信号Yk(j,i)により規格化した、規格化第k視点高周波信号dZk(j,i)を、式(5B)に従って生成する。この例では、分母のY>0との最大値判定により0による除算を防止する。また、必要に応じて、制御部121は、式(5A)及び式(5B)における規格化前に、撮像輝度信号Y(j,i)、第k視点輝度信号Yk(j,i)に対してローパスフィルターを適用し、高周波ノイズを抑制しても良い。 Further, the control unit 121 standardizes the image pickup high frequency signal dY (j, i) and generates the standardized image pickup high frequency signal dZ (j, i). For example, with Y 0 > 0, the imaging high frequency signal dY (j, i) is standardized by the imaging luminance signal Y (j, i) according to the equation (5A). Similarly, the k viewpoint RF signal DYK (j, i) the (k = 1 to N LF), the k-th viewpoint luminance signal Yk (j, i) by normalized, the normalized k-th viewpoint RF signal dZk (j , I) are generated according to the equation (5B). In this example, division by 0 is prevented by determining the maximum value with Y 0 > 0 in the denominator. Further, if necessary, the control unit 121 refers to the imaging luminance signal Y (j, i) and the k-th viewpoint luminance signal Yk (j, i) before standardization in the equations (5A) and (5B). A low-pass filter may be applied to suppress high-frequency noise.

次に、制御部121は、規格化撮像高周波信号dZ(j,i)を用いて撮像コントラスト分布C(j,i)を生成する。例えば、撮像コントラスト分布C(j,i)は、低輝度閾値Ymin、コントラスト最大閾値Cmax、指数γとして、式(6A)に従って生成される。撮像輝度信号Y(j,i)が低輝度閾値Yminより小さい場合、撮像コントラスト分布C(j,i)の値が0に設定される(式(6A)の1行目)。一方、規格化撮像高周波信号dZ(j,i)がコントラスト最大閾値Cmaxより大きい場合、撮像コントラスト分布C(j,i)の値は1に設定される(式(6A)の3行目)。それ以外の場合、撮像コントラスト分布C(j,i)は、規格化撮像高周波信号dZ(j,i)をコントラスト最大閾値Cmaxで規格化してγ乗した値に設定される(式(6A)の2行目)。以上のように、撮像コントラスト分布C(j,i)は、[0,1](0以上1以下)の範囲内の値をとる。C(j,i)の値が0に近い場合にはコントラストが低く、1に近い場合にはコントラストが高いことを示す。また、本実施形態では、撮像コントラスト分布C(j,i)の0から1の範囲のトーンカーブを調整するため、γのべき乗を適用している。トーンカーブが低コントラスト側では緩やかに変化し高コントラスト側では急峻に変化するように、例えば指数γは1.5以上2.5以下に設定される。必要に応じて、定義域[0,1]から値域[0,1]への関数F:[0,1]→[0,1]を用いて、合成関数F(C(j,i))を撮像コントラスト分布としても良い。同様に、第k視点コントラスト分布Ck(j,i)(k=1〜NLF)を、式(6B)に従って生成する。 Next, the control unit 121 generates an imaging contrast distribution C (j, i) using the standardized imaging high frequency signal dZ (j, i). For example, the imaging contrast distribution C (j, i) is generated according to the formula (6A) as a low luminance threshold value Ymin, a maximum contrast threshold value Cmax, and an index γ. When the imaging luminance signal Y (j, i) is smaller than the low luminance threshold value Ymin, the value of the imaging contrast distribution C (j, i) is set to 0 (first line of the equation (6A)). On the other hand, when the standardized imaging high frequency signal dZ (j, i) is larger than the maximum contrast threshold Cmax, the value of the imaging contrast distribution C (j, i) is set to 1 (third line of the equation (6A)). In other cases, the imaging contrast distribution C (j, i) is set to a value obtained by normalizing the standardized imaging high frequency signal dZ (j, i) with the maximum contrast threshold Cmax and raising it to the γ power (formula (6A)). 2nd line). As described above, the imaging contrast distribution C (j, i) takes a value within the range of [0,1] (0 or more and 1 or less). When the value of C (j, i) is close to 0, the contrast is low, and when the value is close to 1, the contrast is high. Further, in the present embodiment, a power of γ is applied in order to adjust the tone curve in the range of 0 to 1 of the imaging contrast distribution C (j, i). For example, the index γ is set to 1.5 or more and 2.5 or less so that the tone curve changes gently on the low contrast side and sharply on the high contrast side. If necessary, the composite function F (C (j, i)) is used by using the function F from the domain [0,1] to the range [0,1]: [0,1] → [0,1]. May be used as the imaging contrast distribution. Similarly, the k-th viewpoint contrast distribution Ck (j, i) (k = 1 to NLF ) is generated according to the equation (6B).

本実施形態の撮像コントラスト分布C(j,i)の分布例を図12(A)に、第1視点コントラスト分布C(j,i)の分布例を図12(B)に、第2視点コントラスト分布C(j,i)の分布例を図12(C)に、それぞれ示している。図12(A)から図12(C)に示す分布例では、画像の右側に示す[0、1]の範囲のグレースケール表示にてコントラストの高低の指標を表している。値が1の近傍である白い部分はx方向の空間周波数の高周波成分が多く、高コントラストである領域を示し、値が0の近傍である黒い部分はx方向の空間周波数の高周波成分が少なく、低コントラストである領域を示している。 A distribution example of the imaging contrast distribution C (j, i) of the present embodiment is shown in FIG. 12 (A), and a distribution example of the first viewpoint contrast distribution C 1 (j, i) is shown in FIG. 12 (B). A distribution example of the contrast distribution C 2 (j, i) is shown in FIG. 12 (C), respectively. In the distribution example shown in FIGS. 12 (A) to 12 (C), the high / low contrast index is represented by the gray scale display in the range [0, 1] shown on the right side of the image. The white part where the value is near 1 has many high frequency components of the spatial frequency in the x direction and indicates a high contrast region, and the black part where the value is near 0 has few high frequency components of the spatial frequency in the x direction. It shows a region with low contrast.

<コントラスト分布における遠近競合又はオクルージョン>
本実施形態における複数の視点画像(第1視点画像と第2視点画像)間の視差と、遠近競合やオクルージョンとの関係を、図13(A)〜(C)を用いて説明する。図13(A)〜(C)の撮像面600には撮像素子107(不図示)が配置され、図4、図7、図8と同様に、結像光学系の射出瞳が、第1瞳部分領域501と第2瞳部分領域502に2分割される。
<Perspective competition or occlusion in contrast distribution>
The relationship between the parallax between the plurality of viewpoint images (first viewpoint image and the second viewpoint image) in the present embodiment and the perspective competition and occlusion will be described with reference to FIGS. 13A to 13C. An image sensor 107 (not shown) is arranged on the image pickup surface 600 of FIGS. 13 (A) to 13 (C), and the exit pupil of the imaging optical system is the first pupil as in FIGS. 4, 7, and 8. It is divided into a partial region 501 and a second pupil partial region 502.

図13(A)は、撮影画像において遠近競合が生じている例を示している。すなわち、被写体q1の合焦像p1に、手前の被写体q2のボケ像Γ1+Γ2が重なって撮影され、撮影画像において遠近競合が生じている。この例を、結像光学系の第1瞳部分領域501を通過する光束と、第2瞳部分領域502を通過する光束とに、それぞれ分けて図13(B)、図13(C)に示す。 FIG. 13A shows an example in which perspective competition occurs in the captured image. That is, the focused image p1 of the subject q1 is photographed by superimposing the blurred image Γ1 + Γ2 of the subject q2 in the foreground, and perspective competition occurs in the captured image. An example of this is shown in FIGS. 13 (B) and 13 (C) separately for a light flux passing through the first pupil region 501 of the imaging optical system and a light flux passing through the second pupil region 502, respectively. ..

図13(B)では、被写体q1からの光束は、第1瞳部分領域501を通過して、合焦状態で像p1に結像する。一方、手前の被写体q2からの光束は、第1瞳部分領域501を通過して、デフォーカス状態でボケ像Γ1に広がり、撮像素子107の各画素の副画素201で受光される。このとき、制御部121は、副画素201の受光信号から第1視点画像を生成する。すなわち、第1視点画像では、被写体q1の像p1と手前の被写体q2のボケ像Γ1が重ならずに、異なる位置で撮影される。したがって、図13(B)に示す例における第1視点画像では、複数の被写体(被写体q1と被写体q2)の間で、遠近競合やオクルージョンが生じていない。 In FIG. 13B, the luminous flux from the subject q1 passes through the first pupil portion region 501 and is imaged on the image p1 in the focused state. On the other hand, the luminous flux from the subject q2 in the foreground passes through the first pupil portion region 501, spreads to the blurred image Γ1 in the defocused state, and is received by the sub-pixel 201 of each pixel of the image sensor 107. At this time, the control unit 121 generates a first viewpoint image from the received signal of the sub-pixel 201. That is, in the first viewpoint image, the image p1 of the subject q1 and the blurred image Γ1 of the subject q2 in the foreground do not overlap and are taken at different positions. Therefore, in the first viewpoint image in the example shown in FIG. 13B, perspective competition and occlusion do not occur between the plurality of subjects (subject q1 and subject q2).

一方、図13(C)では、被写体q1からの光束は、第2瞳部分領域502を通過して、合焦状態で像p1に結像する。また、手前の被写体q2からの光束は、第2瞳部分領域502を通過して、デフォーカス状態でボケ像Γ2に広がり、撮像素子の各画素の副画素202で受光される。このとき、制御部121は、副画素202の受光信号から第2視点画像を生成する。すなわち、第2視点画像では、被写体q1の像p1と手前の被写体q2のボケ像Γ2が重なって撮影される。したがって、図13(C)に示す例における第2視点画像では、複数の被写体(被写体q1と被写体q2)の間で、遠近競合やオクルージョンが生じている。 On the other hand, in FIG. 13C, the luminous flux from the subject q1 passes through the second pupil portion region 502 and is imaged on the image p1 in the focused state. Further, the luminous flux from the subject q2 in the foreground passes through the second pupil portion region 502, spreads to the blurred image Γ2 in the defocused state, and is received by the sub-pixel 202 of each pixel of the image sensor. At this time, the control unit 121 generates a second viewpoint image from the received signal of the sub-pixel 202. That is, in the second viewpoint image, the image p1 of the subject q1 and the blurred image Γ2 of the subject q2 in the foreground overlap each other. Therefore, in the second viewpoint image in the example shown in FIG. 13C, perspective competition and occlusion occur between a plurality of subjects (subject q1 and subject q2).

このように、撮影画像において遠近競合やオクルージョンが生じている領域近傍では、第1視点画像と第2視点画像との間で遠近競合やオクルージョンが生じている状態が異なる場合がある。すなわち、図13(A)〜(C)に示した例は、当該領域近傍において第1視点画像と第2視点画像間の差が大きくなる可能性が高いことを示している。したがって、複数の視点画像間の差が大きい領域を検出することにより、遠近競合やオクルージョンが発生している可能性が高い領域を推定することができる。 As described above, in the vicinity of the region where perspective conflict or occlusion occurs in the captured image, the state in which perspective conflict or occlusion occurs may differ between the first viewpoint image and the second viewpoint image. That is, the examples shown in FIGS. 13A to 13C show that there is a high possibility that the difference between the first viewpoint image and the second viewpoint image becomes large in the vicinity of the region. Therefore, by detecting the region where the difference between the plurality of viewpoint images is large, it is possible to estimate the region where there is a high possibility that perspective competition or occlusion has occurred.

第1視点コントラスト分布C(j,i)と第2視点コントラスト分布C(j,i)の差分量分布C(j,i)−C(j,i)を図14(A)に例示する。図14(A)に示す分布例では、右側の[−1、1]の範囲のグレースケール表示にて、第1視点画像のコントラストと第2視点画像のコントラスト間の差(第1視点コントラスト分布と第2視点コントラスト分布の差分量)の大小の指標を表している。値が0の近傍である黒い部分は、第1視点画像のコントラストと第2視点画像のコントラスト間の差が小さい領域を示している。一方、値が±1の近傍である白い部分は、第1視点画像のコントラストと第2視点画像のコントラスト間の差が大きい領域を示している。 FIG. 14 (A) shows the difference distribution C 1 (j, i) -C 2 (j, i) between the first viewpoint contrast distribution C 1 (j, i) and the second viewpoint contrast distribution C 2 (j, i). Illustrate to. In the distribution example shown in FIG. 14 (A), the difference between the contrast of the first viewpoint image and the contrast of the second viewpoint image (first viewpoint contrast distribution) in the grayscale display in the range [-1, 1] on the right side. And the difference amount of the second viewpoint contrast distribution). The black portion where the value is in the vicinity of 0 indicates a region where the difference between the contrast of the first viewpoint image and the contrast of the second viewpoint image is small. On the other hand, the white portion where the value is in the vicinity of ± 1 indicates a region where the difference between the contrast of the first viewpoint image and the contrast of the second viewpoint image is large.

図14(A)では、中央下部における、人物(人形)の胴体と市松模様の平板との境界の領域において、第1視点画像のコントラストと第2視点画像のコントラスト間の差が大きい領域(白い領域)が検出されている。すなわち、コントラスト間の差が大きい領域では、人物の胴体と市松模様の平板とにより遠近競合やオクルージョンが生じていることを示している。また、コントラスト間の差が大きい領域では、遠近競合やオクルージョンが生じている領域以外に、第1視点画像と第2視点画像との間で空間周波数の高周波帯域成分が大きく変化している領域が検出されている。例えば、デフォーカス状態の被写体エッジ部のように、高いコントラストが保たれたまま像ずれ量が大きくなっている領域なども検出される。検出された領域では、第1視点画像と第2視点画像との間で空間周波数成分が大きく異なる被写体像がそれぞれ撮影されている。上述したように、第1視点画像と第2視点画像を合わせた撮像画像では、これらの検出領域は、空間周波数成分が大きく異なる複数の被写体像が混成している領域である。 In FIG. 14A, in the region of the boundary between the body of the person (doll) and the checkered flat plate in the lower center, the region where the difference between the contrast of the first viewpoint image and the contrast of the second viewpoint image is large (white). Area) has been detected. That is, in the region where the difference between the contrasts is large, it is shown that perspective competition and occlusion occur due to the body of the person and the checkered flat plate. Further, in the region where the difference between the contrasts is large, in addition to the region where perspective competition and occlusion occur, there is a region in which the high frequency band component of the spatial frequency changes significantly between the first viewpoint image and the second viewpoint image. It has been detected. For example, a region where the amount of image shift is large while maintaining high contrast, such as a subject edge portion in a defocused state, is also detected. In the detected region, subject images having significantly different spatial frequency components are captured between the first viewpoint image and the second viewpoint image. As described above, in the captured image in which the first viewpoint image and the second viewpoint image are combined, these detection regions are regions in which a plurality of subject images having significantly different spatial frequency components are mixed.

なお、これらの空間周波数成分が異なる複数被写体像の混成領域に先鋭化や平滑化などの画像処理を強く行う場合、画質品位が低下する場合がある。したがって、本実施形態では、第1視点コントラスト分布と第2視点コントラスト分布の差分量分布の絶対値|C(j,i)−C(j,i)|を用いて、空間周波数成分が異なる複数被写体像の混成領域を検出する。これにより検出された混成領域での先鋭化や平滑化などの画像処理を抑制しながら適用することができる。これにより、画質品位を良好に保持しながら、先鋭化や平滑化の画像処理を施すことができる。 When image processing such as sharpening or smoothing is strongly performed on a mixed region of a plurality of subject images having different spatial frequency components, the image quality quality may be deteriorated. Therefore, in the present embodiment, the spatial frequency component is determined by using the absolute value | C 1 (j, i) -C 2 (j, i) | of the difference amount distribution between the first viewpoint contrast distribution and the second viewpoint contrast distribution. Detects a mixed region of different multiple subject images. As a result, it can be applied while suppressing image processing such as sharpening and smoothing in the detected mixed region. As a result, it is possible to perform sharpening and smoothing image processing while maintaining good image quality quality.

次に、制御部121は、空間周波数成分が異なる複数被写体像の混成領域を検出するため、コントラスト差分量分布CDIFF(j,i)を生成する。例えば、制御部121は、第1視点コントラスト分布C(j,i)と第2視点コントラスト分布C(j,i)を用いて、コントラスト差分量分布CDIFF(j,i)を式(7A)に従って生成する。更に、制御部121は、式(7B)に従って、撮像コントラスト分布C(j,i)にコントラスト差分量分布CDIFF(j,i)をかけ合わせ、コントラスト分布MCON(j,i)を生成する。 Next, the control unit 121 generates a contrast difference amount distribution CDIFF (j, i) in order to detect a mixed region of a plurality of subject images having different spatial frequency components. For example, the control unit 121 uses the first viewpoint contrast distribution C 1 (j, i) and the second viewpoint contrast distribution C 2 (j, i) to formulate the contrast difference amount distribution C DIFF (j, i). Generate according to 7A). Further, the control unit 121 multiplies the imaging contrast distribution C (j, i) by the contrast difference amount distribution C DIFF (j, i) according to the equation (7B) to generate the contrast distribution MCON (j, i). ..

コントラスト差分量分布CDIFF(j,i)は、[0、1]の範囲で分布し、視点画像間のコントラスト差が大きく、空間周波数成分が異なる被写体像の混成が多い領域では値が0に近づく。一方、視点画像間のコントラスト差が小さく、空間周波数成分が異なる被写体像の混成が少ない領域では値が1に近づく。すなわち、コントラスト分布MCON(j,i)は、撮像コントラスト分布C(j,i)にコントラスト差分量分布CDIFF(j,i)をかけ合わせた分布であるため、空間周波数成分が異なる複数被写体像の混成領域では値が0の近傍に抑制される。 The contrast difference distribution C DIFF (j, i) is distributed in the range of [0, 1], and the value becomes 0 in a region where the contrast difference between the viewpoint images is large and the spatial frequency components are often mixed. Get closer. On the other hand, the value approaches 1 in a region where the contrast difference between the viewpoint images is small and the mixture of subject images having different spatial frequency components is small. That is, since the contrast distribution MCON (j, i) is a distribution obtained by multiplying the imaging contrast distribution C (j, i) by the contrast difference amount distribution CDIFF (j, i), a plurality of subjects having different spatial frequency components. In the mixed region of the image, the value is suppressed to near 0.

図14(B)には、生成されたコントラスト分布MCON(j,i)の分布例を示している。この分布例では、右側の[0、1]の範囲のグレースケール表示にてコントラストの高低の指標を表している。値が1の近傍である白い部分はx方向の空間周波数の高周波成分が多く、高コントラストな領域を示す。一方、値が0の近傍である黒い部分はx方向の空間周波数の高周波成分が少なく、低コントラストな領域を示している。図12(A)に示した撮像コントラスト分布C(j,i)に対して、視点画像コントラスト分布の差分量分布の絶対値が大きい領域においてコントラスト値が抑制されている。すなわち、第1視点コントラスト分布C(j,i)と第2視点コントラスト分布C(j,i)の差分量分布の絶対値|C(j,i)−C(j,i)|が大きい領域においてコントラスト値が抑制されている。 FIG. 14B shows a distribution example of the generated contrast distribution MCON (j, i). In this distribution example, the grayscale display in the range [0, 1] on the right side represents the index of high and low contrast. The white portion in the vicinity of the value 1 has many high-frequency components of the spatial frequency in the x direction, and indicates a high-contrast region. On the other hand, the black portion where the value is in the vicinity of 0 has few high frequency components of the spatial frequency in the x direction, and indicates a low contrast region. With respect to the imaging contrast distribution C (j, i) shown in FIG. 12A, the contrast value is suppressed in a region where the absolute value of the difference amount distribution of the viewpoint image contrast distribution is large. That is, the absolute value of the difference distribution between the first viewpoint contrast distribution C 1 (j, i) and the second viewpoint contrast distribution C 2 (j, i) | C 1 (j, i) -C 2 (j, i) The contrast value is suppressed in the region where | is large.

なお、上述した説明では、第1視点コントラスト分布と第2視点コントラスト分布の差分量分布の絶対値|C(j,i)−C(j,i)|に対して単調減少な線形関数を用いた。しかし、必要に応じてより一般的な関数を用いても良い。 In the above description, a linear function that is monotonically decreasing with respect to the absolute value | C 1 (j, i) -C 2 (j, i) | of the difference amount distribution between the first viewpoint contrast distribution and the second viewpoint contrast distribution. Was used. However, more general functions may be used if desired.

このように本実施形態では、撮像画像と複数の視点画像とから、視点画像ごとのコントラスト間の差に応じて、コントラスト分布MCON(j,i)を生成する。コントラスト分布MCON(j,i)は、視点画像ごとのコントラスト間の差が大きい領域より、差が小さい領域の方が大きくなり、また、所定の空間周波数帯域において撮像画像の空間周波数成分が少ない領域より、多い領域の方が大きくなる。また、当該コントラスト分布は、撮像画像の輝度が低い領域より、輝度が高い領域の方が大きくなる。なお、繰り返しコントラスト分布MCON(j,i)を生成する場合、生成したコントラスト分布MCON(j,i)を記録媒体133などに記録しておき、2回目以降の処理では生成を省略してもよい。このようにすることで処理を高速化することができる。 As described above, in the present embodiment, the contrast distribution MCON (j, i) is generated from the captured image and the plurality of viewpoint images according to the difference between the contrasts of each viewpoint image. The contrast distribution M CON (j, i) is larger in the region where the difference is small than in the region where the difference between the contrasts of each viewpoint image is large, and the spatial frequency component of the captured image is small in the predetermined spatial frequency band. Many areas are larger than areas. Further, the contrast distribution is larger in the region where the brightness is high than in the region where the brightness of the captured image is low. When the repeated contrast distribution M CON (j, i) is generated, the generated contrast distribution M CON (j, i) is recorded on a recording medium 133 or the like, and the generation is omitted in the second and subsequent processes. May be good. By doing so, the processing can be speeded up.

<像ずれ量分布の生成>
次に、S3において、制御部121は、コントラスト分布MCON(j,i)と第1視点画像と第2視点画像(複数の視点画像)とを用いて像ずれ量分布を生成する。例えば、制御部121は、コントラスト分布MCON(j,i)の値が所定値以上である各位置(j,i)において、第1視点画像と第2視点画像の相関(信号の一致度)に基づく像ずれ量分布を生成する。
<Generation of image shift distribution>
Next, in S3, the control unit 121 generates an image shift amount distribution using the contrast distribution MCON (j, i), the first viewpoint image, and the second viewpoint image (a plurality of viewpoint images). For example, the control unit 121 correlates the first viewpoint image and the second viewpoint image (the degree of signal matching) at each position (j, i) where the value of the contrast distribution M CON (j, i) is equal to or greater than a predetermined value. Generates an image shift distribution based on.

制御部121は、まず、式(3B)に従って生成された第1視点輝度信号Yに対して、瞳分割方向(列方向)に、1次元バンドパスフィルター処理を行って第1焦点検出信号dYAを生成する。また、式(3B)に従って生成された第2視点輝度信号Yに対して、瞳分割方向(列方向)に、1次元バンドパスフィルター処理を行い、第2焦点検出信号dYBを生成する。1次元バンドパスフィルターとしては、例えば、1次微分型フィルター[1、5、8、8、8、8、5、1、−1、−5、−8、−8、−8、−8、−5、−1]などを用いることができる。必要に応じて、1次元バンドパスフィルターの通過帯域を調整しても良い。 Control unit 121, first, the first viewpoint luminance signal Y 1 generated in accordance with equation (3B), in the pupil division direction (column direction), the first focus detection signal by performing a one-dimensional band-pass filter processing dYA To generate. Further, the second viewpoint luminance signal Y 2 which is generated according to equation (3B), in the pupil division direction (column direction), the one-dimensional band-pass filter process to generate a second focus detection signal DYB. Examples of the one-dimensional bandpass filter include first-order differential filters [1, 5, 8, 8, 8, 8, 5, 1, -1, -5, -8, -8, -8, -8, -5, -1] and the like can be used. If necessary, the pass band of the one-dimensional bandpass filter may be adjusted.

次に、制御部121は、コントラスト分布MCON(j,i)の値が所定値(例えば、0.2)以上である各位置(j,i)において、像ずれ量分布MDIS(j,i)を算出する。すなわち、高コントラストで、かつ、遠近競合やオクルージョンが生じていない領域において、像ずれ量の算出を行う。このようにすることで、像ずれ量の算出精度を高精度化し、処理を高速化することができる。例えば、制御部121は、上述した各位置(j,i)において、第1焦点検出信号dYAと第2焦点検出信号dYBを、相対的に瞳分割方向にシフトさせながら、信号の一致度を表す相関量を算出する。そして、相関量に基づいて焦点検出信号が最も一致する際の像ずれ量分布MDIS(j,i)を生成する。一方、コントラスト分布MCON(j,i)の値が所定値(例えば、0.2)未満である各位置(j,i)は、像ずれ量の算出から除外する。 Next, the control unit 121 determines the image shift amount distribution M DIS (j, i) at each position (j, i) where the value of the contrast distribution M CON (j, i) is a predetermined value (for example, 0.2) or more. i) is calculated. That is, the amount of image shift is calculated in a region having high contrast and no perspective competition or occlusion. By doing so, it is possible to improve the accuracy of calculating the image shift amount and speed up the processing. For example, the control unit 121 expresses the degree of signal matching while relatively shifting the first focus detection signal dYA and the second focus detection signal dYB in the pupil division direction at each of the above-mentioned positions (j, i). Calculate the amount of correlation. Then, the image shift amount distribution M DIS (j, i) when the focus detection signals most match based on the correlation amount is generated. On the other hand, each position (j, i) in which the value of the contrast distribution M CON (j, i) is less than a predetermined value (for example, 0.2) is excluded from the calculation of the image shift amount.

焦点検出信号をシフトさせて相関量を算出する処理は、例えば以下のように行うことができる。まず、位置(j,i)を中心として、行方向j(−n≦j≦n)番目、瞳分割方向である列方向i(−m≦i≦m)番目の第1焦点検出信号をdYA(j+j、i+i)、第2焦点検出信号をdYB(j+j、i+i)とする。ここで、シフト量をs(−n≦s≦n)として、各位置(j,i)での相関量COREVEN(j,i、s)を式(8A)に従って算出する。また、同様に、相関量CORODD(j,i、s)を式(8B)に従って算出する。 The process of shifting the focus detection signal and calculating the correlation amount can be performed as follows, for example. First, with the position (j, i) as the center, the row direction j 2 (-n 2 ≤ j 2 ≤ n 2 ) th, and the column direction i 2 (-m 2 ≤ i 2 ≤ m 2 ) th in the pupil division direction. Let the first focus detection signal be dYA (j + j 2 , i + i 2 ) and the second focus detection signal be dYB (j + j 2 , i + i 2 ). Here, the correlation amount COR EVEN (j, i, s) at each position (j, i) is calculated according to the equation (8A), where the shift amount is s (−n s ≦ s ≦ n s ). Similarly, the correlation amount COR ODD (j, i, s) is calculated according to the formula (8B).

相関量CORODD(j,i、s)は、相関量COREVEN(j,i、s)に対して、第1焦点検出信号dYAと第2焦点検出信号dYBのシフト量を半位相−1シフトした相関量である。相関量COREVEN(j,i、s)と相関量CORODD(j,i、s)から、それぞれ、サブピクセル演算により、相関量が最小値となる実数値のシフト量を算出して平均値を算出し、像ずれ量分布MDIS(j,i)を生成する。 The correlation amount COR ODD (j, i, s) shifts the shift amount of the first focus detection signal dYA and the second focus detection signal dYB by half phase-1 with respect to the correlation amount COR EVEN (j, i, s). It is the amount of correlation. From the correlation amount COR EVEN (j, i, s) and the correlation amount COR ODD (j, i, s), the shift amount of the real value that minimizes the correlation amount is calculated by subpixel calculation, and the average value. Is calculated to generate the image shift distribution M DIS (j, i).

なお、コントラスト分布MCON(j,i)の値が所定値(例えば、0,2)未満であり、像ずれ量の算出から除外された領域は、MDIS(j,i)=0とする。必要に応じて、0以外の値を設定しても良い。 The region where the value of the contrast distribution M CON (j, i) is less than a predetermined value (for example, 0, 2) and is excluded from the calculation of the image shift amount is set to M DIS (j, i) = 0. .. If necessary, a value other than 0 may be set.

図14(C)には、像ずれ量分布MDIS(j,i)の分布例を示す。この例では、コントラスト分布MCON(j,i)の値が所定値0.2以上であり、かつ像ずれ量が算出されている領域を、[−6、6]の範囲のグレースケール表示で表示している。なお、図14(C)では、第1視点画像と第2視点画像との間の像ずれ量を、1ピクセル(1画素)単位で示している。マイナス符号の値(黒色で示す値)は前ピン状態の領域を表し、0付近の値は合焦近傍の領域をそれぞれ示している。また、プラス符号の値(白色で示す値)は、後ピン状態の領域を示している。なお、図14(C)の分布例では、コントラスト分布MCON(j,i)の値が所定値0.2未満であり、像ずれ量の算出から除外されてMDIS(j,i)=0に設定された領域に関しては、黒で表示している。 FIG. 14C shows a distribution example of the image shift amount distribution MDIS (j, i). In this example, the area where the contrast distribution MCON (j, i) has a predetermined value of 0.2 or more and the amount of image shift is calculated is displayed in grayscale in the range of [-6,6]. it's shown. Note that, in FIG. 14C, the amount of image shift between the first viewpoint image and the second viewpoint image is shown in units of 1 pixel (1 pixel). A minus sign value (value shown in black) represents a region in the front pin state, and a value near 0 indicates a region near in-focus. The plus sign value (value shown in white) indicates the region in the rear pin state. In the distribution example of FIG. 14C, the value of the contrast distribution MCON (j, i) is less than a predetermined value of 0.2, and is excluded from the calculation of the image shift amount, and MDIS (j, i) =. The area set to 0 is displayed in black.

このように本実施形態では、コントラスト分布MCON(j,i)に応じて像ずれ量分布MDIS(j,i)を算出し、高コントラスト、かつ、遠近競合やオクルージョンが生じていない領域において、複数の視点画像から像ずれ量を算出できるようにしている。なお、先に求めた像ずれ量分布MDIS(j,i)を記録媒体133に記録し、2回目以降における像ずれ量分布MDIS(j,i)の算出を省略してもよい。このようにすれば、処理時間を短縮することができる。また、必要に応じて、像ずれ量分布MDIS(j,i)をデフォーカス分布に変換してもよい。例えば、制御部121は、位置(j,i)と撮像レンズ(結像光学系)の絞り値、射出瞳距離などに応じた変換係数を、像ずれ量分布MDIS(j,i)に適用して、デフォーカス量分布に変換することができる。 As described above, in this embodiment, the contrast distribution M CON (j, i) to calculate the image shift amount distribution M DIS (j, i) in accordance with the high contrast and, in the region where the perspective conflict or occlusion has not occurred , The amount of image shift can be calculated from multiple viewpoint images. The image shift amount distribution M DIS (j, i) obtained earlier may be recorded on the recording medium 133, and the calculation of the image shift amount distribution M DIS (j, i) in the second and subsequent times may be omitted. By doing so, the processing time can be shortened. Further, if necessary, the image shift amount distribution MDIS (j, i) may be converted into a defocus distribution. For example, the control unit 121 applies a conversion coefficient according to the position (j, i), the aperture value of the imaging lens (imaging optical system), the exit pupil distance, and the like to the image shift amount distribution MDIS (j, i). Then, it can be converted into a defocus amount distribution.

<像ずれ差分量分布の生成>
S4において、制御部121は、像ずれ量分布MDIS(j,i)と所定の像ずれ量(単に所定像ずれ量ともいう)とに基づいて像ずれ差分量分布MDIFF(j,i)を生成する。まず、制御部121は、(被写体の所定領域において)深度修正処理を行いたい所定像ずれ量pを設定する。例えば、図14(C)に示した像ずれ量分布MDISの例では、人物(人形)の目の近傍の領域での像ずれ量は約2.5である。例えば、制御部121は、人物(人形)の目の近傍の領域を深度修正処理したい場合、所定像ずれ量p=2.5と設定する。後述するように、画像内の目の近傍の領域との対比により他の領域の合焦状態(深度)を変更した画像を生成する。所定像ずれ量の設定は、例えば、ユーザが操作部132を介して撮像画像上の位置を特定することにより設定してよい。
<Generation of image shift difference distribution>
In S4, the control unit 121 determines the image shift difference amount distribution M DIFF (j, i) based on the image shift amount distribution M DIS (j, i) and a predetermined image shift amount (also simply referred to as a predetermined image shift amount). To generate. First, the control unit 121 sets a predetermined image shift amount p for which depth correction processing is desired (in a predetermined area of the subject). For example, in the example of the image shift amount distribution MDIS shown in FIG. 14C, the image shift amount in the region near the eyes of a person (doll) is about 2.5. For example, when the control unit 121 wants to perform depth correction processing on a region near the eyes of a person (doll), the control unit 121 sets a predetermined image shift amount p = 2.5. As will be described later, an image in which the focusing state (depth) of another region is changed is generated by comparison with the region near the eyes in the image. The predetermined image shift amount may be set, for example, by the user specifying a position on the captured image via the operation unit 132.

次に、制御部121は、像ずれ量分布MDIS(j,i)、所定像ずれ量p、コントラスト分布MCON(j,i)に基づき、像ずれ差分量分布MDIFF(j,i)を式(9)に従って算出する。ただし、σ>0とする。 Next, the control unit 121 sets the image shift difference amount distribution M DIFF (j, i) based on the image shift amount distribution M DIS (j, i), the predetermined image shift amount p, and the contrast distribution M CON (j, i). Is calculated according to the equation (9). However, σ p > 0.

像ずれ差分量分布MDIFF(j,i)は、像ずれ量分布MDIS(j,i)と所定像ずれ量pの差分の絶対値|MDIS(j,i)−p|に対して単調減少する線形関数と、コントラスト分布MCON(j,i)とを、かけ合わせた分布である。像ずれ差分量分布MDIFF(j,i)は、|MDIS(j,i)−p|<σで正、|MDIS(j,i)−p|=σで0、|MDIS(j,i)−p|>σで負となる。なお、コントラスト分布MCON(j,i)の値が所定値(例えば、0.2)未満であるために像ずれ量の算出から除外された領域は、MDIFF(j,i)=(1−|p|/σ)×MCON(j,i)とする。ただし、当該除外された領域については、必要に応じて他の値を設定しても良い。 The image shift difference distribution M DIFF (j, i) is based on the absolute value of the difference between the image shift distribution M DIS (j, i) and the predetermined image shift p | M DIS (j, i) -p |. It is a distribution obtained by multiplying a linear function that decreases monotonically and a contrast distribution MCON (j, i). Image shift difference weight distribution M DIFF (j, i) is, | M DIS (j, i ) -p | < positive in σ p, | M DIS (j , i) -p | = σ p at 0, | M It becomes negative when DIS (j, i) -p |> σ p . The region excluded from the calculation of the image shift amount because the value of the contrast distribution M CON (j, i) is less than a predetermined value (for example, 0.2) is M DIFF (j, i) = (1). − | P | / σ p ) × M CON (j, i). However, other values may be set for the excluded area as needed.

例えば、図15には上述した像ずれ差分量分布MDIFF(j,i)の分布例を示している。コントラスト分布MCONの値が所定値0.2以上であるために像ずれ量が算出されている領域では、右側の[−1、1]の範囲のグレースケール表示にて像ずれ差分量を示している。プラス(+)符号である白側の部分は、像ずれ量分布MDIS(j,i)と所定像ずれ量pとの差分の絶対値|MDIS(j,i)−p|が小さく、かつ、コントラストが高い領域を示している。マイナス(−)符号である黒側の部分は、像ずれ量分布MDIS(j,i)と所定像ずれ量pとの差分の絶対値|MDIS(j,i)−p|が大きく、かつ、コントラストが高い領域を示している。なお、図15の表示例では、コントラスト分布MCON(j,i)の値が所定値0.2未満であるために像ずれ量の算出から除外され、MDIFF(j,i)=(1−|p|/σ)×MCON(j,i)と設定された領域に関しては、黒で表示している。 For example, FIG. 15 shows a distribution example of the above-mentioned image shift difference amount distribution MDIFF (j, i). In the region where the image shift amount is calculated because the contrast distribution MCON value is 0.2 or more, the image shift difference amount is shown in the grayscale display in the range [-1, 1] on the right side. ing. In the white part, which is a plus (+) code, the absolute value of the difference between the image shift amount distribution M DIS (j, i) and the predetermined image shift amount p | M DIS (j, i) -p | is small. Moreover, it shows a region with high contrast. In the black part with a minus (-) sign, the absolute value of the difference between the image shift distribution M DIS (j, i) and the predetermined image shift p | M DIS (j, i) -p | is large. Moreover, it shows a region with high contrast. In the display example of FIG. 15, since the value of the contrast distribution MCON (j, i) is less than the predetermined value 0.2, it is excluded from the calculation of the image shift amount, and MDIFF (j, i) = (1). The area set as − | p | / σ p ) × M CON (j, i) is displayed in black.

<修正視点画像の生成>
S5において、制御部121は、第1視点画像と第2視点画像(第1視点画像から第NLF視点画像)とに対して、像ずれ差分量分布MDIFF(j,i)に応じて、第1の先鋭化および第1の平滑化の処理を行う。制御部121は、この第1の先鋭化および第1の平滑化により、第1修正視点画像と第2修正視点画像(第1修正視点画像から第NLF修正視点画像)を生成する。具体的に、制御部121は、第1視点画像と第2視点画像(複数の視点画像)に対して、像ずれ差分量分布が0以上(MDIFF(j,i)≧0)の領域では、視点画像間の差を拡大して視差を先鋭化する(クロストーク補正、第1の先鋭化)。一方、像ずれ差分量分布が0未満(MDIFF(j,i)<0)の領域に対しては、視点画像間の差を縮小して視差を平滑化する(クロストーク、第1の平滑化)。
<Generation of modified viewpoint image>
In S5, the control unit 121 refers to the first viewpoint image and the second viewpoint image (from the first viewpoint image to the NLF viewpoint image) according to the image shift difference amount distribution MDIFF (j, i). The first sharpening and the first smoothing process are performed. The control unit 121 generates a first modified viewpoint image and a second modified viewpoint image (from the first modified viewpoint image to the NLF modified viewpoint image) by the first sharpening and the first smoothing. Specifically, the control unit 121 sets the control unit 121 in a region where the image shift difference amount distribution is 0 or more (M DIFF (j, i) ≥ 0) with respect to the first viewpoint image and the second viewpoint image (plural viewpoint images). , The difference between the viewpoint images is enlarged to sharpen the parallax (crosstalk correction, first sharpening). On the other hand, for the region where the image shift difference distribution is less than 0 (M DIFF (j, i) <0), the difference between the viewpoint images is reduced to smooth the parallax (crosstalk, first smoothing). ).

まず、第1視点画像と第2視点画像(複数の視点画像)に対して、視点画像間の差を拡大して視差を先鋭化する処理、もしくは、視点画像間の差を縮小して視差を平滑化する処理の強さを指定する第1の強度パラメーターkct(kct≧0)を設定する。次に、第1の強度パラメーター分布Kct(j,i)を、式(10)に従って設定する。本実施形態では、第1の強度パラメーター分布Kct(j,i)は、kctを比例係数として像ずれ差分量分布MDIFF(j,i)に比例する。 First, for the first viewpoint image and the second viewpoint image (plurality of viewpoint images), a process of enlarging the difference between the viewpoint images to sharpen the parallax, or reducing the difference between the viewpoint images to reduce the parallax. A first intensity parameter k ct (k ct ≧ 0) that specifies the strength of the smoothing process is set. Next, the first intensity parameter distribution Kct (j, i) is set according to the equation (10). In the present embodiment, the first intensity parameter distribution K ct (j, i) is proportional to the image shift difference amount distribution M DIFF (j, i) with k ct as a proportional coefficient.

さらに、制御部121は、第1視点画像I(j,i)と第2視点画像I(j,i)(第1視点画像から第NLF視点画像)とに対して、式(11A)および式(11B)に従って第1修正視点画像MI(j,i)と第2修正視点画像MI(j,i)(第1修正視点画像から第NLF修正視点画像)とを生成する。 Further, the control unit 121 refers to the equation (11A) for the first viewpoint image I 1 (j, i) and the second viewpoint image I 2 (j, i) (from the first viewpoint image to the NLF viewpoint image). ) and generates the formula (first modified according 11B) viewpoint image MI 1 (j, i) and the second corrected viewpoint image MI 2 (j, i) (the N LF modified viewpoint image from the first corrected viewpoint image) ..

式(11A)は、第1の強度パラメーター分布(像ずれ差分量分布)が0以上の領域において、第1視点画像と第2視点画像(複数の視点画像)と間の差を拡大し、視差を先鋭化する(クロストーク補正、第1の先鋭化)処理を表す。一方、式(11B)は、第1の強度パラメーター分布(像ずれ差分量分布)が0未満の領域において、第1視点画像と第2視点画像(複数の視点画像)と間の差を縮小して視差を平滑化する(クロストーク、第1の平滑化)処理を表す。 Equation (11A) expands the difference between the first viewpoint image and the second viewpoint image (plurality of viewpoint images) in the region where the first intensity parameter distribution (image shift difference amount distribution) is 0 or more, and parallax. Represents a process of sharpening (crosstalk correction, first sharpening). On the other hand, the equation (11B) reduces the difference between the first viewpoint image and the second viewpoint image (plurality of viewpoint images) in the region where the first intensity parameter distribution (image shift difference amount distribution) is less than 0. It represents a process of smoothing the parallax (crosstalk, first smoothing).

図16は、第1視点画像と第2視点画像(複数の視点画像)間の差を拡大して視差を先鋭化する処理の例を示している。横軸は画素位置を表し、縦軸は画素値(信号レベル)を表す。図16では、先鋭化する処理前の第1視点画像(修正前A)と第2視点画像(修正前B)の例とを破線のグラフで示している。また、式(11A)に従って先鋭化した後の第1修正視点画像(修正後A)と第2修正視点画像(修正後B)との例を実線のグラフで示している。視点画像間の差を拡大して視差を先鋭化する処理を適用することにより、処理前に視点画像間の差が大きかった部分はより拡大されるが、処理前に視点画像間の差が小さかった部分はそれほど変化しない。このように、視点画像間の視差が先鋭化されることがわかる。一方、式(11B)における平滑化する処理を適用することにより、第1視点画像と第2視点画像(複数の視点画像)と間の差が縮小され、視点画像間の視差が平滑化される。なお、上述したコントラスト分布および像ずれ量分布に応じた画像処理は、必要に応じて、先鋭化の処理又は平滑化の処理のいずれかを適用しても良い。 FIG. 16 shows an example of a process of enlarging the difference between the first viewpoint image and the second viewpoint image (a plurality of viewpoint images) to sharpen the parallax. The horizontal axis represents the pixel position, and the vertical axis represents the pixel value (signal level). In FIG. 16, an example of the first viewpoint image (before correction A) and the second viewpoint image (before correction B) before the sharpening process is shown by a broken line graph. Further, an example of the first modified viewpoint image (corrected A) and the second modified viewpoint image (corrected B) after being sharpened according to the equation (11A) is shown by a solid line graph. By applying the process of enlarging the difference between the viewpoint images and sharpening the parallax, the part where the difference between the viewpoint images was large before the process is enlarged, but the difference between the viewpoint images is small before the process. The part does not change much. In this way, it can be seen that the parallax between the viewpoint images is sharpened. On the other hand, by applying the smoothing process in the formula (11B), the difference between the first viewpoint image and the second viewpoint image (plurality of viewpoint images) is reduced, and the parallax between the viewpoint images is smoothed. .. As for the image processing according to the contrast distribution and the image shift amount distribution described above, either a sharpening process or a smoothing process may be applied, if necessary.

このように、式(7A)〜(7B)、式(9)、式(10)、式(11A)および式(11B)により、制御部121は、視点画像毎のコントラスト間の差が大きい領域よりもコントラスト間の差が小さい領域に、各視点画像への先鋭化や平滑化を強く適用する。また、コントラスト分布の値が小さい領域よりも大きい領域に、各視点画像への先鋭化や平滑化を強く適用する。すなわち、式(9)、式(10)、式(11A)および式(11B)を用いることにより、像ずれ量分布の所定シフト量からの差が小さい領域には先鋭化の処理を適用し、差が大きい領域には平滑化の処理を適用することになる。また、式(9)、式(10)、式(11A)を用いることにより、像ずれ量分布の所定シフト量からの差が大きい領域よりも差が小さい領域に先鋭化を強く適用する。一方、式(9)、式(10)、式(11B)を用いることにより、像ずれ量分布の所定シフト量からの差が小さい領域よりも差が大きい領域に平滑化を強く適用する。 As described above, according to the equations (7A) to (7B), the equation (9), the equation (10), the equation (11A) and the equation (11B), the control unit 121 has a region where the difference between the contrasts for each viewpoint image is large. Sharpening and smoothing are strongly applied to each viewpoint image in the region where the difference between contrasts is smaller than that. In addition, sharpening and smoothing are strongly applied to each viewpoint image in a region where the contrast distribution value is larger than the region where the value is small. That is, by using the equations (9), (10), (11A) and (11B), the sharpening process is applied to the region where the difference from the predetermined shift amount of the image shift amount distribution is small. The smoothing process is applied to the region where the difference is large. Further, by using the equations (9), (10), and (11A), sharpening is strongly applied to the region where the difference is smaller than the region where the difference from the predetermined shift amount of the image shift amount distribution is large. On the other hand, by using the equations (9), (10), and (11B), the smoothing is strongly applied to the region where the difference from the predetermined shift amount of the image shift amount distribution is larger than the region where the difference is large.

このように、式(11A)および式(11B)より、複数の視点画像の画素毎に、複数の視点画像間の差を拡大して視差を先鋭化、もしくは、複数の視点画像間の差を縮小して視差を平滑化する処理を行い、複数の修正視点画像を生成する。式(11A)の第1の先鋭化の処理、および、式(11B)の第2の平滑化の処理は、各(j,i)画素に含まれる第1光電変換部に対応する第1視点画像I(j,i)と、第2光電変換部に対応する第2視点画像I(j,i)間の演算処理である。 In this way, from the formulas (11A) and (11B), the difference between the plurality of viewpoint images is enlarged and the parallax is sharpened for each pixel of the plurality of viewpoint images, or the difference between the plurality of viewpoint images is reduced. A process of reducing the size and smoothing the parallax is performed to generate a plurality of modified viewpoint images. The first sharpening process of the formula (11A) and the second smoothing process of the formula (11B) are the first viewpoints corresponding to the first photoelectric conversion unit included in each (j, i) pixel. This is an arithmetic process between the image I 1 (j, i) and the second viewpoint image I 2 (j, i) corresponding to the second photoelectric conversion unit.

<重み係数の設定>
S6において、制御部121は、第1修正視点画像と第2修正視点画像(第1修正視点画像から第NLF修正視点画像)毎の重み係数を設定する。具体的には、像ずれ量分布MDIS(j,i)の値が所定像ずれ量pの近傍である領域(差が小さい領域)では、被写界深度を深くするように一方の視点画像に重み係数を偏らせる(すなわち重み付けの差を大きくする)。一方、像ずれ量分布MDIS(j,i)の値が所定像ずれ量pの近傍でない領域(差が大きい領域)では、被写界深度を浅くするように各視点画像に均等な重みづけを設定する(すなわち重み付けの差を小さくする)。以下の処理では、このような重み係数を像ずれ差分量分布MDIFF(j,i)に基づいて設定する。
<Setting of weighting factor>
In S6, the control unit 121 sets a weighting coefficient for each of the first modified viewpoint image and the second modified viewpoint image (from the first modified viewpoint image to the NLF modified viewpoint image). Specifically, in a region where the value of the image shift amount distribution MDIS (j, i) is near the predetermined image shift amount p (region where the difference is small), one viewpoint image so as to deepen the depth of field. The weighting coefficient is biased to (that is, the difference in weighting is increased). On the other hand, in the region where the value of the image shift amount distribution MDIS (j, i) is not in the vicinity of the predetermined image shift amount p (region with a large difference), each viewpoint image is weighted evenly so as to make the depth of field shallow. (That is, reduce the difference in weighting). In the following processing, such a weighting coefficient is set based on the image shift difference amount distribution MDIFF (j, i).

すなわち、制御部121は、像ずれ差分量分布MDIFF(j,i)から、第1修正視点画像MI(j、i)の第1重み係数分布W(j、i)を、式(12A)に従って算出する。また、第2修正視点画像MI(j、i)の第2重み係数分布W(j、i)を、式(12B)に従って算出する。 That is, the control unit 121 formulates the first weighting coefficient distribution W 1 (j, i) of the first modified viewpoint image MI 1 (j, i) from the image shift difference amount distribution M DIFF (j, i). Calculate according to 12A). Further, the second weighting coefficient distribution W 2 (j, i) of the second modified viewpoint image MI 2 (j, i) is calculated according to the equation (12B).

式(12A)および式(12B)に示すように、第1重み係数分布W(j、i)と第2重み係数分布W(j、i)の差は、|W(j、i)−W(j、i)|=max(MDIFF(j,i)、0)となる。したがって、本実施形態では、像ずれ量分布の所定シフト量からの差が大きい領域よりも差が小さい領域の方が、重み係数間の差|W(j、i)−W(j、i)|が大きい。すなわち、像ずれ量分布MDIS(j,i)の値が所定像ずれ量pの近傍である領域において(重み係数間の差が大きくなるようにして)被写界深度を修正するようにしている。なお、必要に応じて、第1重み係数分布W(j、i)と第2重み係数分布W(j、i)に対して、高周波カット(ローパス)フィルター処理を行って平滑化しても良い。 As shown in the formulas (12A) and (12B), the difference between the first weight coefficient distribution W 1 (j, i) and the second weight coefficient distribution W 2 (j, i) is | W 1 (j, i). ) -W 2 (j, i) | = max (M DIFF (j, i), 0). Therefore, in the present embodiment, the difference between the weighting coefficients is larger in the region where the difference is smaller than in the region where the difference from the predetermined shift amount of the image shift amount distribution is larger | W 1 (j, i) -W 2 (j, i) | is large. That is, the depth of field is corrected in the region where the value of the image shift amount distribution MDIS (j, i) is in the vicinity of the predetermined image shift amount p (so that the difference between the weighting coefficients becomes large). There is. If necessary, the first weight coefficient distribution W 1 (j, i) and the second weight coefficient distribution W 2 (j, i) may be smoothed by performing a high-frequency cut (low-pass) filter process. good.

<合成処理による出力画像の生成>
S7において、制御部121は、加算処理(合成処理)を行って深度修正された出力画像を生成する。具体的には、第1修正視点画像と第2修正視点画像(第1修正視点画像から第NLF修正視点画像)毎に重み係数をかけて、式(13)に従う加算処理(合成処理)を行い、像ずれ量分布MDIS(j,i)に基づき深度修正された出力画像を生成する。
<Generation of output image by compositing processing>
In S7, the control unit 121 performs an addition process (composite process) to generate a depth-corrected output image. Specifically, the weighting coefficient is multiplied for each of the first modified viewpoint image and the second modified viewpoint image (from the first modified viewpoint image to the NLF modified viewpoint image), and the addition process (composite process) according to the equation (13) is performed. This is performed to generate a depth-corrected output image based on the image shift distribution MDIS (j, i).

制御部121は、まず、式(12A)の第1重み係数分布W(j、i)を第1修正視点画像MI(j、i)に乗算するとともに、式(12B)の第2重み係数分布W(j、i)を第2修正視点画像MI(j、i)に乗算する。そして、これらを合成することにより、像ずれ量分布MDIS(j,i)の値が所定像ずれ量p近傍である領域において被写界深度を修正する。このように本実施形態では、複数の視点画像から像ずれ量分布を生成し、像ずれ量分布に基づいて、複数の視点画像毎に重み係数を変更(複数の視点画像の加算比率を変更)して合成し、被写界深度を修正した出力画像を生成する。制御部121は、出力画像の生成を完了すると、深度修正処理に係る一連の動作を終了する。 First, the control unit 121 multiplies the first weighting coefficient distribution W 1 (j, i) of the equation (12A) by the first modified viewpoint image MI 1 (j, i), and the second weight of the equation (12B). The coefficient distribution W 2 (j, i) is multiplied by the second modified viewpoint image MI 2 (j, i). Then, by synthesizing these, the depth of field is corrected in the region where the value of the image shift amount distribution MDIS (j, i) is near the predetermined image shift amount p. As described above, in the present embodiment, the image shift amount distribution is generated from the plurality of viewpoint images, and the weighting coefficient is changed for each of the plurality of viewpoint images based on the image shift amount distribution (the addition ratio of the plurality of viewpoint images is changed). And combine to generate an output image with a corrected depth of field. When the control unit 121 completes the generation of the output image, the control unit 121 ends a series of operations related to the depth correction process.

(修正視点画像の効果)
次に、図17を参照して深度修正範囲を説明したうえで、上述した合成処理において修正視点画像を用いる場合の効果について説明する。撮像面600には撮像素子107(不図示)が配置されており、図4、図7、図8の場合と同様に、結像光学系の射出瞳が第1瞳部分領域501と第2瞳部分領域502に2×1分割される。
(Effect of modified viewpoint image)
Next, after explaining the depth correction range with reference to FIG. 17, the effect when the correction viewpoint image is used in the above-mentioned composition processing will be described. An image sensor 107 (not shown) is arranged on the image pickup surface 600, and the exit pupils of the imaging optical system are the first pupil partial region 501 and the second pupil as in the case of FIGS. 4, 7, and 8. It is divided into 2 × 1 subregions 502.

許容錯乱円径をδとし、結像光学系の絞り値をFとすると、絞り値Fでの被写界深度は、±F×δである。これに対して、Nx×Ny(例えば、2×1)に分割されて狭くなった第1瞳部分領域501(または502)の瞳分割方向(x方向)の実効絞り値F01(またはF02)は、F01=Nx×F(またはF02=Nx×F)となって暗くなる。第1修正視点画像(または第2修正視点画像)ごとの実効的な被写界深度は、±Nx×F×δとなってNx倍深くなるとともに、合焦範囲がNx倍に広がる。実効的な被写界深度「±Nx×F×δ」の範囲内では、第1修正視点画像(または第2修正視点画像)ごとに合焦した被写体像が取得されている。したがって、1つの修正視点画像の重み係数を1(他の修正視点画像の係数を0)とすることにより、瞳分割方向の被写界深度を、概ね、Nx倍に深くすることができる。 Assuming that the permissible circle of confusion diameter 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 (or F 02 ) in the pupil division direction (x direction) of the first pupil partial region 501 (or 502) divided into Nx × Ny (for example, 2 × 1) and narrowed. ) Becomes F 01 = Nx × F (or F 02 = Nx × F) and becomes dark. The effective depth of field for each first modified viewpoint image (or second modified viewpoint image) is ± Nx × F × δ, which is Nx times deeper and the focusing range is expanded Nx times. Within the range of the effective depth of field "± Nx × F × δ", a focused subject image is acquired for each first modified viewpoint image (or second modified viewpoint image). Therefore, by setting the weighting coefficient of one modified viewpoint image to 1 (the coefficient of the other modified viewpoint image is 0), the depth of field in the pupil division direction can be made approximately Nx times deeper.

しかしながら、図6に示した瞳強度分布の例のように、画素部ごとに形成される直径数umのマイクロレンズと複数に分割された光電変換部による瞳分割では、光の波動性による回折ボケのために、緩やかな瞳分割となる。そのため、第1視点画像と第2視点画像(複数の視点画像)の瞳分割方向(x方向)の深度が十分に深くならず、第1視点画像と第2視点画像(複数の視点画像)を用いて深度修正処理をしても、深度修正効果が十分に得られない場合がある。 However, as in the example of the pupil intensity distribution shown in FIG. 6, in the pupil division by the microlens having a diameter of several um formed for each pixel portion and the photoelectric conversion portion divided into a plurality of parts, the diffraction blur due to the wave nature of light is used. Because of this, the pupil division is gentle. Therefore, the depth of the pupil division direction (x direction) of the first viewpoint image and the second viewpoint image (plurality of viewpoint images) is not sufficiently deep, and the first viewpoint image and the second viewpoint image (plurality of viewpoint images) are displayed. Even if the depth correction process is performed using the image, the depth correction effect may not be sufficiently obtained.

このため、上述した深度修正処理では、第1視点画像と第2視点画像(複数の視点画像)に対し、式(11A)に従って第1視点画像と第2視点画像(複数の視点画像)間の差を拡大して視差を先鋭化する(クロストーク補正、第1の先鋭化)ようにした。すなわち、第1の強度パラメーター分布(像ずれ差分量分布)が0以上(Kct(j,i)=kct×MDIFF(j,i)≧0)の画素ごとに、第1視点画像と第2視点画像(複数の視点画像)間の差を拡大して視差を先鋭化する画像処理を適用する。これにより、回折ボケがあっても、生成された第1修正視点画像と第2修正視点画像(複数の修正視点画像)の瞳分割方向(x方向)の実効的な絞り値Fを大きく(深度を深く)修正することができ、深度修正効果を向上させることができる。 Therefore, in the depth correction process described above, for the first viewpoint image and the second viewpoint image (plurality of viewpoint images), between the first viewpoint image and the second viewpoint image (plurality of viewpoint images) according to the equation (11A). The difference was enlarged to sharpen the parallax (crosstalk correction, first sharpening). That is, for each pixel in which the first intensity parameter distribution (image shift difference amount distribution) is 0 or more ( Kct (j, i) = kct × M DIFF (j, i) ≧ 0), the first viewpoint image and Image processing is applied to sharpen the parallax by expanding the difference between the second viewpoint images (plural viewpoint images). As a result, even if there is diffraction blur, the effective aperture value F in the pupil division direction (x direction) of the generated first modified viewpoint image and the second modified viewpoint image (multiple modified viewpoint images) is increased (depth). Can be corrected (deeply), and the depth correction effect can be improved.

以上説明したように本実施形態では、異なる瞳部分領域を通過した信号から得られる複数の視点画像について像ずれ量分布を生成し、当該像ずれ量分布に基づく視点画像ごとの重み係数を用いて、複数の視点画像を合成(出力画像を生成)するようにした。すなわち、像ずれ量分布が所定シフト量からの差が小さい場合には、一方の視点画像に加重を偏らせるように重み係数を算出して複数の視点画像を合成し、深度を深くする。他方、像ずれ量分布が所定シフト量からの差が大きい場合には、複数の視点画像の加重が均等になるように重み係数を算出して複数の視点画像を合成し、深度を浅くする。このようにすることで、合焦近傍の被写体をボケた前景や背景との対比により際立たせる(合成画像の深度修正効果を向上させる)効果を、撮影後に調整することができる。換言すれば、複数の視点画像を用いて、画像内の所定の領域との対比により他の領域の合焦状態を変更した画像を、撮影後に生成することが可能になる。 As described above, in the present embodiment, an image shift amount distribution is generated for a plurality of viewpoint images obtained from signals that have passed through different pupil region regions, and a weighting coefficient for each viewpoint image based on the image shift amount distribution is used. , Multiple viewpoint images are combined (output image is generated). That is, when the difference between the image shift amount distribution and the predetermined shift amount is small, the weighting coefficient is calculated so as to bias the weight to one viewpoint image, and a plurality of viewpoint images are combined to deepen the depth. On the other hand, when the difference between the image shift amount distribution and the predetermined shift amount is large, the weighting coefficient is calculated so that the weights of the plurality of viewpoint images are equal, and the plurality of viewpoint images are combined to make the depth shallow. By doing so, it is possible to adjust the effect of making the subject in the vicinity of focus stand out by contrasting with the blurred foreground or background (improving the depth correction effect of the composite image) after shooting. In other words, using a plurality of viewpoint images, it is possible to generate an image in which the focusing state of another region is changed by comparison with a predetermined region in the image after shooting.

(第2の実施形態)
次に、第2の実施形態を説明する。なお、第1の実施形態では、撮像素子107が、x方向に2分割、y方向に1分割された分割数2の第1光電変換部301と第2光電変換部302を有する単位画素を有する場合を例に説明した。一方、第2の実施形態では、単位画素内の光電変換部がy方向にも2分割された構造の撮像素子を用いる点が異なる。このため、デジタルカメラ100の構成は第1の実施形態と同一である。従って、同様の構成及び処理については同一の符号を付与してそれらの詳細な説明を省略し、相違点を中心に説明する。
(Second Embodiment)
Next, the second embodiment will be described. In the first embodiment, the image sensor 107 has a unit pixel having a first photoelectric conversion unit 301 and a second photoelectric conversion unit 302 having two divisions divided into two in the x direction and one in the y direction. The case has been described as an example. On the other hand, the second embodiment is different in that an image sensor having a structure in which the photoelectric conversion unit in the unit pixel is divided into two in the y direction is used. Therefore, the configuration of the digital camera 100 is the same as that of the first embodiment. Therefore, the same configurations and processes are given the same reference numerals, detailed description thereof will be omitted, and differences will be mainly described.

図18は、本実施形態における撮像素子107の画素と副画素の配列の概略図を示している。図18に示すx方向(水平方向)、y方向(垂直方向)、およびz方向(光軸方向)の定義は実施形態1で示した図2と同様である。図18は、本実施形態に係る撮像素子107の画素配列を4列×4行の範囲(副画素配列については8列×8行の範囲)で示している。2列×2行の画素群200は、左上の位置に第1色のR(赤)の分光感度を有する画素200Rが左上に、第2色のG(緑)の分光感度を有する画素200Gが右上と左下に、第3色のB(青)の分光感度を有する画素200Bが右下に配置されている。さらに、各画素は、x方向に2分割(Nx分割)、y方向に2分割(Ny分割)された分割数4(分割数NLF=Nx×Ny)の第1副画素201から第4副画素204(第1副画素から第NLF副画素)の複数の副画素により構成されている。 FIG. 18 shows a schematic diagram of the arrangement of the pixels and the sub-pixels of the image sensor 107 in the present embodiment. The definitions of the x direction (horizontal direction), the y direction (vertical direction), and the z direction (optical axis direction) shown in FIG. 18 are the same as those of FIG. 2 shown in the first embodiment. FIG. 18 shows the pixel arrangement of the image sensor 107 according to the present embodiment in a range of 4 columns × 4 rows (for the sub-pixel arrangement, a range of 8 columns × 8 rows). In the pixel group 200 of 2 columns × 2 rows, the pixel 200R having the spectral sensitivity of the first color R (red) is in the upper left position, and the pixel 200G having the spectral sensitivity of the second color G (green) is in the upper left position. Pixels 200B having a third color B (blue) spectral sensitivity are arranged in the upper right and lower left in the lower right. Furthermore, each pixel is divided into two (Nx divided) in the x direction, divided into two in the y direction (Ny divided) the first fourth subpixels 201 of the split number 4 (division number N LF = Nx × Ny) sub It is composed of a plurality of sub-pixels of pixel 204 (first sub-pixel to NLF sub-pixel).

図18に示す例では、4列×4行の画素(8列×8行の副画素)を面上に多数配置することで、撮像画像および分割数4(分割数NLF)の複数の視点画像を生成するための入力画像信号を取得可能である。本実施形態の撮像素子では、画素の周期Pを4μm(マイクロメートル)とし、画素数Nを横5575列×縦3725行=約2075万画素とする。また、副画素の周期Pを2μmとし、副画素数Nを横11150列×縦7450行=約8300万画素とする。 In the example shown in FIG. 18, by arranging a large number of pixels of 4 columns × 4 rows (sub-pixels of 8 columns × 8 rows) on the surface, a captured image and a plurality of viewpoints having 4 divisions ( NLF divisions) It is possible to acquire an input image signal for generating an image. In the image sensor of the present embodiment, the pixel period P is 4 μm (micrometer), and the number of pixels N is 5575 columns (horizontal) x 3725 rows (vertical) = about 20.75 million pixels. Also, the period P S of the sub-pixel is 2 [mu] m, the sub-pixel number N S horizontal 11150 rows × vertical 7450 lines = from about 83 million pixels.

図19(A)は、図18に示した1つの画素200Gを、撮像素子の受光面側(+z側)から見た場合の平面図を示している。図19(A)におけるx軸、y軸およびz軸の定義は実施形態1と同様である。また、図19(B)は、図19(A)にてa−a切断線に沿って、−y側から見た場合の断面図を示している。 FIG. 19A shows a plan view of one pixel 200G shown in FIG. 18 when viewed from the light receiving surface side (+ z side) of the image sensor. The definitions of the x-axis, y-axis, and z-axis in FIG. 19A are the same as those in the first embodiment. Further, FIG. 19 (B) shows a cross-sectional view of FIG. 19 (A) when viewed from the −y side along the aa cutting line.

図19(A)および、図19(B)に示すように、画素200Gは、各画素の受光面側(+z方向)に入射光を集光するためのマイクロレンズ305が形成されている。さらに、x方向に2分割(Nx分割)、y方向に2分割(Ny分割)された分割数4(分割数NLF)の第1光電変換部301から第4光電変換部304(第1光電変換部から第NLF光電変換部)の複数の光電変換部が形成されている。第1光電変換部301から第4光電変換部304(第1光電変換部から第NLF光電変換部)が、それぞれ、第1副画素201から第4副画素204(第1副画素から第NLF副画素)に対応する。 As shown in FIGS. 19A and 19B, the pixel 200G is formed with a microlens 305 for condensing incident light on the light receiving surface side (+ z direction) of each pixel. Additionally, bisected (Nx divided) in the x direction, divided into two (Ny divided) were divided number 4 (division number N LF) fourth from the first photoelectric converter 301 of the photoelectric conversion unit 304 (first photoelectric the y-direction A plurality of photoelectric conversion units (from the conversion unit to the NLF photoelectric conversion unit) are formed. The first photoelectric conversion unit 301 to the fourth photoelectric conversion unit 304 (the first photoelectric conversion unit to the NLF photoelectric conversion unit) are the first sub-pixel 201 to the fourth sub-pixel 204 (the first sub-pixel to the Nth sub-pixel), respectively. LF sub-pixel).

(多視点画像と撮像画像)
図9に示したS1において、制御部121は、本実施形態の撮像素子107により取得されたLFデータから、結像光学系の異なる瞳部分領域毎に、複数の視点画像を生成し、結像光学系の異なる瞳部分領域を合成した瞳領域に応じた撮像画像を生成する。もしくは、制御部121は、予め本実施形態の撮像素子107により撮影され、記録媒体に保存されているLFデータを用いても良い。
(Multi-viewpoint image and captured image)
In S1 shown in FIG. 9, the control unit 121 generates a plurality of viewpoint images for each different pupil region of the imaging optical system from the LF data acquired by the image sensor 107 of the present embodiment, and forms an image. A captured image corresponding to the pupil region obtained by synthesizing the pupil region regions having different optical systems is generated. Alternatively, the control unit 121 may use the LF data previously photographed by the image sensor 107 of the present embodiment and stored in the recording medium.

次に、制御部121は、結像光学系の異なる瞳部分領域毎に、第1副画素201から第4副画素204の信号から視点画像(第1視点画像から第NLF視点画像)を生成する。このとき、LFの各画素信号内での列方向i(1≦i≦Nx)番目、行方向j(1≦j≦Ny)番目の副画素信号を、k=Nx(j−1)+i(1≦k≦NLF)として、第k副画素信号とする。結像光学系の第k瞳部分領域に対応した、列方向i番目、行方向j番目の第k視点画像Ik(j、i)を、上述した式(1)に従って生成する。 Next, the control unit 121 generates a viewpoint image (from the first viewpoint image to the NLF viewpoint image) from the signals of the first sub-pixel 201 to the fourth sub-pixel 204 for each different pupil region of the imaging optical system. To do. At this time, the sub-pixel signal in the column direction i S (1 ≦ i S ≦ Nx) th and row direction j S (1 ≦ j S ≦ Ny) th in each pixel signal of LF is set to k = Nx (j S). -1) As + i S (1 ≦ k ≦ N LF ), the kth sub-pixel signal is used. The k-th viewpoint image Ik (j, i) corresponding to the k-th pupil partial region of the imaging optical system at the i-th column direction and the j-th row direction is generated according to the above equation (1).

本実施形態は、Nx=2、Ny=2、NLF=4の4分割の例であり、図18に示した画素配列に対応したLFデータから、画素ごとに特定の副画素の信号を選択する。すなわち、4分割された第1副画素201から第4副画素204(Nx×Ny分割された第1副画素から第NLF副画素)の中から、画素ごとに、特定の副画素の信号を選択する。図18の例では、制御部121は、結像光学系の第1瞳部分領域から第4瞳部分領域における特定の瞳部分領域に対応した、画素数Nの解像度を有するベイヤー配列のRGB信号である第1視点画像から第4視点画像を生成する。 This embodiment is an example of four divisions of Nx = 2, Ny = 2, and NLF = 4, and a signal of a specific sub-pixel is selected for each pixel from the LF data corresponding to the pixel arrangement shown in FIG. To do. That is, a signal of a specific sub-pixel is output for each pixel from the four-divided first sub-pixel 201 to the fourth sub-pixel 204 (Nx × Ny-divided first sub-pixel to NLF sub-pixel). select. In the example of FIG. 18, the control unit 121 is a Bayer array RGB signal having a resolution of the number of pixels N corresponding to a specific pupil region in the first pupil region to the fourth pupil region of the imaging optical system. A fourth viewpoint image is generated from a certain first viewpoint image.

更に、制御部121は、結像光学系の異なる瞳部分領域を通過した光束を合成した撮像画像を生成する。すなわち、列方向にi番目、行方向にj番目の撮像画像I(j、i)を、式(2)に従って生成する。 Further, the control unit 121 generates an image captured by synthesizing the luminous flux passing through different pupil region regions of the imaging optical system. That is, the i-th captured image I (j, i) in the column direction and the j-th captured image I (j, i) in the row direction are generated according to the equation (2).

本実施形態は、Nx=2、Ny=2、NLF=4の4分割の例では、上述のLFデータから、画素ごとに、全ての副画素の信号を取得して合成する。すなわち、制御部121は、4分割された第1副画素201から第4副画素204の信号を全て合成し、画素数Nの解像度を有するベイヤー配列のRGB信号である撮像画像を生成する。 In this embodiment, in the example of four divisions of Nx = 2, Ny = 2, and NLF = 4, the signals of all the sub-pixels are acquired and synthesized for each pixel from the above-mentioned LF data. That is, the control unit 121 synthesizes all the signals of the first sub-pixel 201 to the fourth sub-pixel 204 divided into four, and generates an captured image which is a Bayer array RGB signal having a resolution of the number of pixels N.

図9に示したS2以降の一連の動作は、第1の実施形態と同様である。従って、制御部121は、実施形態1と同様に、S2〜S7の処理を行って、出力画像を生成し、深度修正処理に係る一連の動作を終了する。このようにすることで、合焦近傍の被写体をボケた前景や背景との対比により際立たせる(合成画像の深度修正効果を向上させる)効果を、撮影後に調整することができる。 The series of operations after S2 shown in FIG. 9 is the same as that of the first embodiment. Therefore, the control unit 121 performs the processes of S2 to S7 to generate an output image, and ends a series of operations related to the depth correction process, as in the first embodiment. By doing so, it is possible to adjust the effect of making the subject in the vicinity of focus stand out by contrasting with the blurred foreground or background (improving the depth correction effect of the composite image) after shooting.

なお、上述の実施形態では、撮像素子の各画素部における光電変換部について、分割数を4にする場合を例に説明した。しかし、各画素部における光電変換部の分割数をさらに多くした実施形態(例えば、Nx=3、Ny=3、NLF=9の9分割や、Nx=4、Ny=4、NLF=16の16分割など)も可能である。 In the above-described embodiment, the case where the number of divisions of the photoelectric conversion unit in each pixel portion of the image sensor is set to 4 has been described as an example. However, an embodiment in which the number of divisions of the photoelectric conversion unit in each pixel unit is further increased (for example, 9 divisions of Nx = 3, Ny = 3, NLF = 9 and Nx = 4, Ny = 4, NLF = 16). 16 divisions, etc.) are also possible.

以上説明したように本実施形態では、各単位画素を4分割する副画素から得られる4つの視点画像について像ずれ量分布を生成し、当該像ずれ量分布に基づく視点画像ごとの重み係数を用いて、複数の視点画像を合成するようにした。すなわち、実施形態1と同様、像ずれ量分布が所定シフト量からの差が小さい場合には、一方の視点画像に加重を偏らせるように重み係数を算出して複数の視点画像を合成し、深度を深くする。他方、像ずれ量分布が所定シフト量からの差が大きい場合には、複数の視点画像の加重が均等になるように重み係数を算出して複数の視点画像を合成し、深度を浅くする。このようにすることで、合焦近傍の被写体をボケた前景や背景との対比により際立たせる(合成画像の深度修正効果を向上させる)効果を、撮影後に調整することができる。換言すれば、複数の視点画像を用いて、画像内の所定の領域との対比により他の領域の合焦状態を変更した画像を、撮影後に生成することが可能になる。 As described above, in the present embodiment, an image shift amount distribution is generated for four viewpoint images obtained from sub-pixels that divide each unit pixel into four, and a weighting coefficient for each viewpoint image based on the image shift amount distribution is used. I tried to combine multiple viewpoint images. That is, as in the first embodiment, when the difference between the image shift amount distribution and the predetermined shift amount is small, the weighting coefficient is calculated so as to bias the weight to one viewpoint image, and a plurality of viewpoint images are combined. Increase the depth. On the other hand, when the difference between the image shift amount distribution and the predetermined shift amount is large, the weighting coefficient is calculated so that the weights of the plurality of viewpoint images are equal, and the plurality of viewpoint images are combined to make the depth shallow. By doing so, it is possible to adjust the effect of making the subject in the vicinity of focus stand out by contrasting with the blurred foreground or background (improving the depth correction effect of the composite image) after shooting. In other words, using a plurality of viewpoint images, it is possible to generate an image in which the focusing state of another region is changed by comparison with a predetermined region in the image after shooting.

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

107...撮像素子、121...制御部、125...画像処理回路 107 ... image sensor, 121 ... control unit, 125 ... image processing circuit

Claims (8)

結像光学系の異なる瞳部分領域を通過する光束を受光する複数の副画素が設けられた単位画素を複数配列した撮像素子により得られた画像信号を取得する取得手段と、
それぞれの前記単位画素の第1の所定の位置と第2の所定の位置の副画素から得られる信号を前記画像信号からそれぞれ選択した第1の視点画像と第2の視点画像との間の、像のずれを示す像ずれ量を領域ごとに検出する検出手段と、
検出された領域ごとの前記像ずれ量に基づいて、前記第1の視点画像と前記第2の視点画像とを領域ごとに比率を異ならせて合成し、深度を変更した画像を生成する処理手段と、を有し、
前記処理手段は、
前記第1の視点画像と前記第2の視点画像とを合成するためのそれぞれの重みを、検出された領域ごとの前記像ずれ量に基づいて領域ごとに設定する設定手段と、
設定された領域ごとの前記それぞれの重みに基づいて前記第1の視点画像と前記第2の視点画像とを加算して、深度の変更された画像を生成する生成手段と、を有し、
前記設定手段は、前記それぞれの重みを、第1の領域よりも、検出された領域ごとの前記像ずれ量と撮像された被写体の所定領域における像ずれ量との差が小さい第2の領域において、重みづけの差が大きくなるように設定する、ことを特徴とする画像処理装置。
An acquisition means for acquiring an image signal obtained by an image pickup device in which a plurality of unit pixels provided with a plurality of sub-pixels for receiving a light flux passing through different pupil region regions of an imaging optical system are arranged.
Between the first viewpoint image and the second viewpoint image in which signals obtained from the first predetermined position of each unit pixel and the sub-pixels at the second predetermined position are selected from the image signals, respectively. A detection means that detects the amount of image shift indicating image shift for each region, and
A processing means for generating an image in which the depth is changed by synthesizing the first viewpoint image and the second viewpoint image at different ratios for each region based on the detected image shift amount for each region. and, the possess,
The processing means
A setting means for setting each weight for synthesizing the first viewpoint image and the second viewpoint image for each region based on the amount of image shift for each detected region.
It has a generation means for generating an image having a changed depth by adding the first viewpoint image and the second viewpoint image based on the respective weights of each set region.
The setting means sets each of the weights in a second region where the difference between the amount of image shift for each detected region and the amount of image shift in a predetermined region of the captured subject is smaller than that of the first region. An image processing device characterized in that the difference in weighting is set to be large .
結像光学系の異なる瞳部分領域を通過する光束を受光する複数の副画素が設けられた単位画素を複数配列した撮像素子により得られた画像信号を取得する取得手段と、
それぞれの前記単位画素の第1の所定の位置と第2の所定の位置の副画素から得られる信号を前記画像信号からそれぞれ選択した第1の視点画像と第2の視点画像との間の、像のずれを示す像ずれ量を領域ごとに検出する検出手段と、
検出された領域ごとの前記像ずれ量に基づいて、前記第1の視点画像と前記第2の視点画像とを領域ごとに比率を異ならせて合成し、深度を変更した画像を生成する処理手段と、を有し、
前記処理手段は、
前記第1の視点画像と前記第2の視点画像とを合成するためのそれぞれの重みを、検出された領域ごとの前記像ずれ量に基づいて領域ごとに設定する設定手段と、
設定された領域ごとの前記それぞれの重みに基づいて前記第1の視点画像と前記第2の視点画像とを加算して、深度の変更された画像を生成する生成手段と、を有し、
前記処理手段は、第1の領域よりも、検出された領域ごとの前記像ずれ量と撮像された被写体の所定領域における像ずれ量との差が小さい領域において、前記第1の視点画像と前記第2の視点画像との視差の差が大きくなるように前記第1の視点画像と前記第2の視点画像を修正する修正手段を更に有し、
前記生成手段は、前記修正手段により視差が修正された前記第1の視点画像と前記第2の視点画像とを加算して、深度の変更された画像を生成する、ことを特徴と画像処理装置。
An acquisition means for acquiring an image signal obtained by an image pickup device in which a plurality of unit pixels provided with a plurality of sub-pixels for receiving a light flux passing through different pupil region regions of an imaging optical system are arranged.
Between the first viewpoint image and the second viewpoint image in which signals obtained from the first predetermined position of each unit pixel and the sub-pixels at the second predetermined position are selected from the image signals, respectively. A detection means that detects the amount of image shift indicating image shift for each region, and
A processing means for generating an image in which the depth is changed by synthesizing the first viewpoint image and the second viewpoint image at different ratios for each region based on the detected image shift amount for each region. And have
The processing means
A setting means for setting each weight for synthesizing the first viewpoint image and the second viewpoint image for each region based on the amount of image shift for each detected region.
It has a generation means for generating an image having a changed depth by adding the first viewpoint image and the second viewpoint image based on the respective weights of each set region.
The processing means, than the first region, in the region a small difference between the image shift amount in the predetermined area of the image shift amount and the imaged object for each detected region, the said first viewpoint image It further has a correction means for modifying the first viewpoint image and the second viewpoint image so that the difference in parallax from the second viewpoint image becomes large.
The generation unit adds the second viewpoint image and the first view image in which the parallax is corrected by said correction means, for generating a modified image depth, features and images treatment that apparatus.
結像光学系の異なる瞳部分領域を通過する光束を受光する複数の副画素が設けられた単位画素を複数配列した撮像素子により得られた画像信号を取得する取得手段と、
それぞれの前記単位画素の第1の所定の位置と第2の所定の位置の副画素から得られる信号を前記画像信号からそれぞれ選択した第1の視点画像と第2の視点画像との間の、像のずれを示す像ずれ量を領域ごとに検出する検出手段と、
検出された領域ごとの前記像ずれ量に基づいて、前記第1の視点画像と前記第2の視点画像とを領域ごとに比率を異ならせて合成し、深度を変更した画像を生成する処理手段と、を有し、
前記処理手段は、前記第1の視点画像と前記第2の視点画像との間のコントラストの差が所定の値より小さい領域において前記深度を変更した画像を生成する、ことを特徴とする画像処理装置。
An acquisition means for acquiring an image signal obtained by an image pickup device in which a plurality of unit pixels provided with a plurality of sub-pixels for receiving a light flux passing through different pupil region regions of an imaging optical system are arranged.
Between the first viewpoint image and the second viewpoint image in which signals obtained from the first predetermined position of each unit pixel and the sub-pixels at the second predetermined position are selected from the image signals, respectively. A detection means that detects the amount of image shift indicating image shift for each region, and
A processing means for generating an image in which the depth is changed by synthesizing the first viewpoint image and the second viewpoint image at different ratios for each region based on the detected image shift amount for each region. And have
The processing means, the difference in contrast between the previous SL the first viewpoint image second viewpoint image is generated an image changing the depth in the small area than a predetermined value, characterized in that images processing device.
前記検出手段は、空間周波数成分が異なる複数の被写体が混成する領域を除いて、領域ごとの前記像ずれ量を検出する、ことを特徴とする請求項1からのいずれか1項に記載の画像処理装置。 The method according to any one of claims 1 to 3 , wherein the detection means detects the amount of image shift for each region except for a region where a plurality of subjects having different spatial frequency components are mixed. Image processing device. 結像光学系の異なる瞳部分領域を通過する光束を受光する複数の副画素が設けられた単位画素を複数配列した撮像素子と、
請求項1からのいずれか1項に記載の画像処理装置と、を有することを特徴とする撮像装置。
An image sensor in which a plurality of unit pixels provided with a plurality of sub-pixels for receiving a luminous flux passing through different pupil region regions of the imaging optical system are arranged, and an image sensor.
An image pickup apparatus comprising the image processing apparatus according to any one of claims 1 to 4 .
結像光学系の異なる瞳部分領域を通過する光束を受光する複数の副画素が設けられた単位画素を複数配列して画像信号を取得し、それぞれの前記単位画素の第1の所定の位置と第2の所定の位置の副画素から得られる信号を前記画像信号からそれぞれ選択した第1の視点画像と第2の視点画像とを出力する撮像素子と、
前記第1の視点画像と前記第2の視点画像との間の、像のずれを示す像ずれ量を領域ごとに検出する検出手段と、
検出された領域ごとの前記像ずれ量に基づいて、前記第1の視点画像と前記第2の視点画像とを領域ごとに比率を異ならせて合成し、深度を変更した画像を生成する処理手段と、を有し、
前記処理手段は、
前記第1の視点画像と前記第2の視点画像とを合成するためのそれぞれの重みを、検出された領域ごとの前記像ずれ量に基づいて領域ごとに設定する設定手段と、
設定された領域ごとの前記それぞれの重みに基づいて前記第1の視点画像と前記第2の視点画像とを加算して、深度の変更された画像を生成する生成手段と、を有し、
前記設定手段は、前記それぞれの重みを、第1の領域よりも、検出された領域ごとの前記像ずれ量と撮像された被写体の所定領域における像ずれ量との差が小さい第2の領域において、重みづけの差が大きくなるように設定する、ことを特徴とする撮像装置。
An image signal is acquired by arranging a plurality of unit pixels provided with a plurality of sub-pixels that receive light flux passing through different pupil region regions of the imaging optical system, and the image signal is obtained with the first predetermined position of each unit pixel. An image sensor that outputs a first viewpoint image and a second viewpoint image obtained by selecting signals obtained from sub-pixels at a second predetermined position from the image signals, respectively.
A detection means for detecting the amount of image shift indicating image shift between the first viewpoint image and the second viewpoint image for each region.
A processing means for generating an image in which the depth is changed by synthesizing the first viewpoint image and the second viewpoint image at different ratios for each region based on the detected image shift amount for each region. and, the possess,
The processing means
A setting means for setting each weight for synthesizing the first viewpoint image and the second viewpoint image for each region based on the amount of image shift for each detected region.
It has a generation means for generating an image having a changed depth by adding the first viewpoint image and the second viewpoint image based on the respective weights of each set region.
The setting means sets each of the weights in a second region where the difference between the amount of image shift for each detected region and the amount of image shift in a predetermined region of the captured subject is smaller than that of the first region. An imaging device characterized in that the difference in weighting is set to be large .
取得手段が、結像光学系の異なる瞳部分領域を通過する光束を受光する複数の副画素が設けられた単位画素を複数配列した撮像素子により得られた画像信号を取得する取得工程と、
検出手段が、それぞれの前記単位画素の第1の所定の位置と第2の所定の位置の副画素から得られる信号を前記画像信号からそれぞれ選択した第1の視点画像と第2の視点画像との間の、像のずれを示す像ずれ量を領域ごとに検出する検出工程と、
処理手段が、検出された領域ごとの前記像ずれ量に基づいて、前記第1の視点画像と前記第2の視点画像とを領域ごとに比率を異ならせて合成し、深度を変更した画像を生成する処理工程と、を有し、
前記処理工程では、
前記第1の視点画像と前記第2の視点画像とを合成するためのそれぞれの重みを、検出された領域ごとの前記像ずれ量に基づいて領域ごとに設定する設定工程と、
設定された領域ごとの前記それぞれの重みに基づいて前記第1の視点画像と前記第2の視点画像とを加算して、深度の変更された画像を生成する生成工程と、を有し、
前記設定工程では、前記それぞれの重みを、第1の領域よりも、検出された領域ごとの前記像ずれ量と撮像された被写体の所定領域における像ずれ量との差が小さい第2の領域において、重みづけの差が大きくなるように設定する、ことを特徴とする画像処理装置の制御方法。
An acquisition step in which the acquisition means acquires an image signal obtained by an image pickup device in which a plurality of unit pixels provided with a plurality of sub-pixels for receiving light flux passing through different pupil region regions of the imaging optical system are arranged.
A first viewpoint image and a second viewpoint image in which signals obtained from the first predetermined position and the second predetermined position sub-pixels of the unit pixels are selected from the image signals by the detection means, respectively. A detection step that detects the amount of image shift indicating image shift between regions for each region,
Based on the amount of image shift for each detected region, the processing means synthesizes the first viewpoint image and the second viewpoint image at different ratios for each region, and obtains an image whose depth is changed. a processing step to be generated, was closed,
In the processing step,
A setting step of setting each weight for synthesizing the first viewpoint image and the second viewpoint image for each region based on the amount of image shift for each detected region.
It has a generation step of adding the first viewpoint image and the second viewpoint image based on the respective weights of each set region to generate an image having a changed depth.
In the setting step, each of the weights is applied in the second region where the difference between the image shift amount for each detected region and the image shift amount in the predetermined region of the imaged subject is smaller than that in the first region. , A control method of an image processing apparatus, characterized in that the difference in weighting is set to be large .
コンピュータを、請求項1からのいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。 A program for causing a computer to function as each means of the image processing apparatus according to any one of claims 1 to 4 .
JP2016152287A 2016-08-02 2016-08-02 Image processing device and its control method, program and imaging device Active JP6800648B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016152287A JP6800648B2 (en) 2016-08-02 2016-08-02 Image processing device and its control method, program and imaging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016152287A JP6800648B2 (en) 2016-08-02 2016-08-02 Image processing device and its control method, program and imaging device

Publications (2)

Publication Number Publication Date
JP2018022984A JP2018022984A (en) 2018-02-08
JP6800648B2 true JP6800648B2 (en) 2020-12-16

Family

ID=61165883

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016152287A Active JP6800648B2 (en) 2016-08-02 2016-08-02 Image processing device and its control method, program and imaging device

Country Status (1)

Country Link
JP (1) JP6800648B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7319840B2 (en) 2019-06-25 2023-08-02 キヤノン株式会社 IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5699609B2 (en) * 2011-01-06 2015-04-15 ソニー株式会社 Image processing apparatus and image processing method
JP2013009274A (en) * 2011-06-27 2013-01-10 Canon Inc Image processing device, image processing method, and program
JP5832211B2 (en) * 2011-09-16 2015-12-16 キヤノン株式会社 Image processing apparatus, image processing method, and program

Also Published As

Publication number Publication date
JP2018022984A (en) 2018-02-08

Similar Documents

Publication Publication Date Title
JP6918485B2 (en) Image processing equipment and image processing methods, programs, storage media
JP6972266B2 (en) Image processing method, image processing device, and image pickup device
JP6789833B2 (en) Image processing equipment, imaging equipment, image processing methods and programs
US10325356B2 (en) Image processing device, image processing method, imaging device, and recording medium for exclusively performing adjustment processing or viewpoint change processing
KR20170137633A (en) Image processing apparatus, image capturing apparatus, image processing method, and computer-readable storage medium
JP2017184217A (en) Image processing device, imaging apparatus, method for controlling them, and program
JP6942480B2 (en) Focus detector, focus detection method, and focus detection program
JP6370348B2 (en) Image processing apparatus, image processing method, imaging apparatus, program, and storage medium
US20220137328A1 (en) Image processing method, image processing device, and image pickup apparatus
JP6976754B2 (en) Image processing equipment and image processing methods, imaging equipment, programs
JP7204357B2 (en) Imaging device and its control method
JP6800648B2 (en) Image processing device and its control method, program and imaging device
JP2015210285A (en) Imaging device, manufacturing method of the same, program thereof and recording medium
JP2015145970A (en) Imaging device, control method of the same, program abd recording medium
JP7319840B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM
JP6789810B2 (en) Image processing method, image processing device, and imaging device
WO2017163588A1 (en) Image processing apparatus, image pickup apparatus, and control methods therefor, and program
US10964739B2 (en) Imaging apparatus and control method thereof
JP2016133595A (en) Controller, imaging device, control method, program, and storage medium
JP2019071596A (en) Imaging apparatus and control method therefor
JP2016024402A (en) Focus adjustment device, focus adjustment method and program, as well as imaging device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190702

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200219

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200302

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20200430

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200623

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20201125

R151 Written notification of patent or utility model registration

Ref document number: 6800648

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151