JP5906033B2 - Image processing apparatus, image processing method, and program - Google Patents

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

Info

Publication number
JP5906033B2
JP5906033B2 JP2011163235A JP2011163235A JP5906033B2 JP 5906033 B2 JP5906033 B2 JP 5906033B2 JP 2011163235 A JP2011163235 A JP 2011163235A JP 2011163235 A JP2011163235 A JP 2011163235A JP 5906033 B2 JP5906033 B2 JP 5906033B2
Authority
JP
Japan
Prior art keywords
image data
captured image
captured
image
output
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
JP2011163235A
Other languages
Japanese (ja)
Other versions
JP2013027023A5 (en
JP2013027023A (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 JP2011163235A priority Critical patent/JP5906033B2/en
Publication of JP2013027023A publication Critical patent/JP2013027023A/en
Publication of JP2013027023A5 publication Critical patent/JP2013027023A5/ja
Application granted granted Critical
Publication of JP5906033B2 publication Critical patent/JP5906033B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Studio Devices (AREA)

Description

本発明は、複数の視点から撮像された撮像画像データから、被写界深度の浅い画像データを生成する技術に関する。   The present invention relates to a technique for generating image data having a shallow depth of field from captured image data captured from a plurality of viewpoints.

従来、撮像画像データに対して画像処理を施すことにより被写界深度の浅い画像データを生成する方法が提案されている。特許文献1では、一枚の画像データに対して距離に応じて異なるぼけを付与するフィルタ処理を施すことにより、被写界深度の浅い画像データを生成している。特許文献2では、視点の異なる複数枚の画像データから生成した被写体の3次元モデルに対してレンダリング処理を施すことにより、被写界深度の浅い画像データを生成している。   Conventionally, a method for generating image data with a shallow depth of field by performing image processing on captured image data has been proposed. In Patent Literature 1, image data with a shallow depth of field is generated by applying a filter process that gives different blur to a single image data according to the distance. In Patent Literature 2, image data having a shallow depth of field is generated by performing rendering processing on a three-dimensional model of a subject generated from a plurality of image data having different viewpoints.

特開2011―10194号JP 2011-10194 特願2009−211254号Japanese Patent Application No. 2009-212254

しかしながら、特許文献1では手前側をぼかした場合に、被写体の境界が不自然にぼけるなどの画質的な課題がある。特許文献2では手前側も自然にぼかせるものの、計算コストが大きいという課題がある。
そこで、本発明は、複数の視点から被写体を撮像して得られた複数の撮像画像データから、出力画像を示す出力画像データを生成する際に、画質を保ちつつ、計算コストを低減させることを目的とする。
However, in Patent Document 1, there is an image quality problem such as unnatural blurring of the subject when the front side is blurred. In Patent Document 2, although the near side is naturally blurred, there is a problem that the calculation cost is high.
Therefore, the present invention reduces the calculation cost while maintaining the image quality when generating output image data indicating an output image from a plurality of captured image data obtained by imaging a subject from a plurality of viewpoints. Objective.

上記の目的を達成するために本発明の画像処理装置は、複数の視点から被写体を撮像して得られた複数の撮像画像データを入力する画像入力手段と、前記複数の撮像画像データを用いて、前記複数の撮像画像データのそれぞれよりも被写界深度が浅い出力画像データを生成する生成手段とを有し、前記生成手段は、前記出力画像データにおいて、所定の距離よりも手前に存在する被写体に対応する第一の画像領域と、前記所定の距離よりも奥に存在する被写体に対応する第二の画像領域とで、異なる数の撮像画像データを用いて前記出力画像データを生成し、前記出力画像データの生成において、前記生成手段が前記第一の画像領域で用いる撮像画像データの数は、前記生成手段が前記第二の画像領域で用いる撮像画像データの数よりも大きいことを特徴とする画像処理装置。 In order to achieve the above object, an image processing apparatus of the present invention uses an image input means for inputting a plurality of captured image data obtained by capturing an image of a subject from a plurality of viewpoints, and the plurality of captured image data. Generating means for generating output image data having a shallower depth of field than each of the plurality of captured image data, and the generating means is present in front of a predetermined distance in the output image data. The output image data is generated using a different number of captured image data in a first image region corresponding to a subject and a second image region corresponding to a subject existing behind the predetermined distance , In the generation of the output image data, the number of captured image data used by the generation unit in the first image region is larger than the number of captured image data used by the generation unit in the second image region. The image processing apparatus characterized by.

本発明によれば、複数の視点から被写体を撮像して得られた複数の撮像画像データから、出力画像を示す出力画像データを生成する際に、画質を保ちつつ、計算コストを低減させることが可能となる。   According to the present invention, when generating output image data indicating an output image from a plurality of captured image data obtained by imaging a subject from a plurality of viewpoints, the calculation cost can be reduced while maintaining the image quality. It becomes possible.

本実施形態における画像処理装置のシステム構成を示すブロック図。1 is a block diagram showing a system configuration of an image processing apparatus in the present embodiment. 本実施形態における撮像装置を表す図。The figure showing the imaging device in this embodiment. 本実施形態における概要機能構成を表す図。The figure showing the outline functional composition in this embodiment. 本実施形態における処理の流れを示すフローチャート。The flowchart which shows the flow of the process in this embodiment. 本実施形態における奥行き推定処理の流れを示すフローチャート。The flowchart which shows the flow of the depth estimation process in this embodiment. 本実施形態における視点位置の間隔と被写体までの距離との関係を示す図。The figure which shows the relationship between the space | interval of the viewpoint position in this embodiment, and the distance to a to-be-photographed object. 本実施形態における領域分割処理の流れを示すフローチャート。The flowchart which shows the flow of the area | region division process in this embodiment. 本実施形態における領域分割画像の例を示す図。The figure which shows the example of the area | region division image in this embodiment. 本実施形態における深度変更処理の流れを示すフローチャート。The flowchart which shows the flow of the depth change process in this embodiment. 本実施形態における基準画像とデプス画像を用いた深度変更処理の流れを示すフローチャート。The flowchart which shows the flow of the depth change process using the reference | standard image and depth image in this embodiment. 本実施形態におけるデプス値とフィルタ径の関係を示す図。The figure which shows the relationship between the depth value and filter diameter in this embodiment. 本実施形態における多視点画像を用いた深度変更処理の流れを示すフローチャート。The flowchart which shows the flow of the depth change process using the multiview image in this embodiment. 本実施形態における仮想絞りパラメータに含まれる重み係数の例を示す図。The figure which shows the example of the weighting coefficient contained in the virtual aperture parameter in this embodiment. 実施例2における深度変更処理の流れを示すフローチャート。10 is a flowchart illustrating a flow of depth change processing according to the second embodiment. 本実施形態におけるブロック分割の例。An example of block division in the present embodiment.

[実施例1]
本実施例では、図2に示すような複数のカメラユニット201〜209をからなる撮像装置107で撮像した複数の画像データ(撮像画像データ)を基に被写界深度の浅い画像を生成する。この際、ピントを合わせたい距離(仮想ピント距離)よりも手前側の領域では複数の画像データを、奥側の領域では一枚の画像データをそれぞれ使用し被写界深度の浅い画像データ(合成画像データ)を生成する。なお、本実施例においてカメラユニット201〜209は格子状に等間隔になるよう配置されており、各カメラユニットの上下軸、左右軸、光軸は全て同じ方向であるとする。そして、撮像画像データは、パンフォーカスで撮像された画像データであることが望ましい。また、本実施例で生成する合成画像データは、カメラユニット205で撮像された画像データの被写界深度を浅くしたものである。
[Example 1]
In the present embodiment, an image with a shallow depth of field is generated based on a plurality of image data (captured image data) captured by an image capturing apparatus 107 including a plurality of camera units 201 to 209 as shown in FIG. At this time, image data with a shallow depth of field (composite) is used by using a plurality of image data in the area in front of the distance to be focused (virtual focus distance) and one image data in the area in the back. Image data). In the present embodiment, the camera units 201 to 209 are arranged at regular intervals in a lattice shape, and the vertical axis, the horizontal axis, and the optical axis of each camera unit are all in the same direction. The captured image data is preferably image data captured with pan focus. The composite image data generated in the present embodiment is obtained by reducing the depth of field of the image data captured by the camera unit 205.

まず、本実施例における画像処理装置のシステム構成例について、図1を用いて説明する。同図において、CPU101は、RAM102をワークメモリとしてROM103及びハードディスクドライブ(HDD)105に格納されたプログラムを実行し、システムバス112を介して後述する各構成を制御する。これにより、後述する様々な処理が実行される。HDDインタフェイス(I/F)104は、HDD105や光ディスクドライブなどの二次記憶装置を接続する、例えばシリアルATA(SATA)等のインタフェイスである。CPU101は、HDDI/F104を介して、HDD105からのデータ読み出し、およびHDD105へのデータ書き込みが可能である。さらにCPU101は、HDD105に格納されたデータをRAM102に展開し、同様に、RAM102に展開されたデータをHDD105に保存することが可能である。そしてCPU101は、RAM102に展開したデータをプログラムとみなし、実行することができる。撮像インタフェイス(I/F)106は、図2に示すような複数のカメラユニット201〜209からなる撮像装置107などを接続する、例えばUSBやIEEE1394などのシリアルバスインタフェイスである。CPU101は、撮像I/F106を介して撮像装置107を制御し、撮像を行うことが可能である。さらに、CPU101は、撮像I/Fを介して撮像装置107から撮像したデータを読み込むことが可能である。入力インタフェイス(I/F)108は、キーボードやマウスなどの入力デバイス109を接続する、例えばUSBやIEEE1394等のシリアルバスインタフェイスである。CPU101は、入力I/F108を介して入力デバイス109からデータを読み込むことが可能である。出力インタフェイス(I/F)110は、画像表示装置等の出力デバイス111を接続する、例えばDVIやHDMI等の映像出力インタフェイスである。CPU101は、出力I/F110を介して出力デバイス111にデータを送り、表示を実行させることができる。   First, a system configuration example of the image processing apparatus according to the present embodiment will be described with reference to FIG. In the figure, a CPU 101 executes a program stored in a ROM 103 and a hard disk drive (HDD) 105 using a RAM 102 as a work memory, and controls each component to be described later via a system bus 112. Thereby, various processes described later are executed. The HDD interface (I / F) 104 is an interface such as serial ATA (SATA) for connecting a secondary storage device such as the HDD 105 or an optical disk drive. The CPU 101 can read data from the HDD 105 and write data to the HDD 105 via the HDD I / F 104. Further, the CPU 101 can expand the data stored in the HDD 105 in the RAM 102 and similarly store the data expanded in the RAM 102 in the HDD 105. The CPU 101 can execute the data expanded in the RAM 102 as a program. The imaging interface (I / F) 106 is a serial bus interface such as USB or IEEE 1394 for connecting the imaging device 107 including a plurality of camera units 201 to 209 as shown in FIG. The CPU 101 can control the imaging device 107 via the imaging I / F 106 to perform imaging. Further, the CPU 101 can read data captured from the image capturing apparatus 107 via the image capturing I / F. An input interface (I / F) 108 is a serial bus interface such as USB or IEEE 1394 for connecting an input device 109 such as a keyboard and a mouse. The CPU 101 can read data from the input device 109 via the input I / F 108. An output interface (I / F) 110 is a video output interface, such as DVI or HDMI, for connecting an output device 111 such as an image display device. The CPU 101 can send data to the output device 111 via the output I / F 110 to execute display.

次に、本実施例に係る一連の処理を行う際の概要機能構成について、図3を用いて説明する。CPU101の機能部としての撮像画像データ入力部301は、撮像画像データ307および撮像装置情報308を撮像装置107あるいはROM103、HDD105等の記憶装置から取得する。なお、撮像画像データ307は撮像装置107によって異なる視点位置(撮像位置)から被写体を撮像して得られる複数の画像を示すデータである。また、撮像装置情報308は、撮像装置107の撮影時の画角や視点位置を含む情報である。   Next, an outline functional configuration when performing a series of processes according to the present embodiment will be described with reference to FIG. The captured image data input unit 301 as a functional unit of the CPU 101 acquires the captured image data 307 and the imaging device information 308 from the imaging device 107 or a storage device such as the ROM 103 and the HDD 105. The captured image data 307 is data indicating a plurality of images obtained by capturing an image of a subject from different viewpoint positions (imaging positions) by the imaging device 107. Further, the imaging device information 308 is information including an angle of view and a viewpoint position at the time of shooting by the imaging device 107.

また、CPU101の機能部としてのパラメータ入力部302は、仮想ピントパラメータ309および仮想絞りパラメータ310を、入力デバイス109あるいはROM103、HDD105等の記憶装置から取得する。仮想ピントパラメータ309は仮想的なピント面までの距離を含む情報である。即ち、仮想ピントパラメータ309は、一連の処理による出力画像のピント距離の情報を含む。また、仮想絞りパラメータ310は奥行きに応じて画像をぼかす際に使用するフィルタ径及び重み係数に関する情報を含む。CPU101の機能部としての距離推定処理部303は、撮像画像データ307および撮像装置情報308に基づき、ステレオマッチング法により撮像シーンのデプス値を推定し、デプス画像データ311を生成する。デプス画像データ311は、撮像装置107から被写体までの画素ごとの距離に係る情報を有する。デプス画像データ311の距離情報は、領域ごと(例:矩形ブロックごと)に設定されていても良い。CPU101の機能部としての領域分割処理部304は、仮想ピントパラメータ309及びデプス画像データ311に基づき、撮像シーンを仮想的なピント面よりも手前の領域(前ぼけ領域)と奥の領域(後ぼけ領域)に分割し、領域分割画像データ312を生成する。即ち、前ぼけ領域は、仮想的なピント面よりも手前に被写体が存在する領域を、後ぼけ領域は、仮想的ピント面よりも奥に被写体が存在する領域を示している。CPU101の機能部としての深度変更処理部305は、撮像装置情報308、仮想ピントパラメータ309、仮想絞りパラメータ310、領域分割画像データ312に基づいて、撮像画像データ307を用いて、深度変更画像データ313を生成する。最後に、CPU101の機能部としての画像出力部306は、深度変更画像データ313(出力画像データ313)を出力デバイス111へ出力したり、HDD105へ保存したりする。   The parameter input unit 302 as a functional unit of the CPU 101 acquires the virtual focus parameter 309 and the virtual aperture parameter 310 from the input device 109 or a storage device such as the ROM 103 and the HDD 105. The virtual focus parameter 309 is information including the distance to the virtual focus surface. That is, the virtual focus parameter 309 includes information on the focus distance of the output image by a series of processes. The virtual aperture parameter 310 includes information on a filter diameter and a weight coefficient used when blurring an image according to the depth. The distance estimation processing unit 303 as a functional unit of the CPU 101 estimates the depth value of the imaging scene by the stereo matching method based on the captured image data 307 and the imaging device information 308, and generates the depth image data 311. The depth image data 311 includes information related to the distance for each pixel from the imaging device 107 to the subject. The distance information of the depth image data 311 may be set for each region (eg, for each rectangular block). Based on the virtual focus parameter 309 and the depth image data 311, the area division processing unit 304 as a functional unit of the CPU 101, based on the virtual focus parameter 309 and the depth image data 311, captures an imaging scene in front of the virtual focus plane (front blur area) and back area (back blur). Region divided image data 312 is generated. That is, the front blur area indicates an area where the subject exists before the virtual focus surface, and the rear blur area indicates an area where the subject exists behind the virtual focus surface. A depth change processing unit 305 as a function unit of the CPU 101 uses the captured image data 307 based on the imaging device information 308, the virtual focus parameter 309, the virtual aperture parameter 310, and the area division image data 312, and uses the captured image data 307. Is generated. Finally, the image output unit 306 as a functional unit of the CPU 101 outputs the depth change image data 313 (output image data 313) to the output device 111 or stores it in the HDD 105.

図4は、本実施例の画像処理装置における一連の処理の動作手順を示すフローチャートである。詳細には、図4のフローチャートに示す手順を記述したコンピュータ実行可能なプログラムをROM103あるいはHDD105からRAM102上に読み込んだ後に、CPU101によって該プログラムを実行することによって当該処理が実行される。以下、図4に示す各処理について説明する。   FIG. 4 is a flowchart illustrating an operation procedure of a series of processes in the image processing apparatus according to the present exemplary embodiment. More specifically, after a computer-executable program describing the procedure shown in the flowchart of FIG. 4 is read from the ROM 103 or the HDD 105 onto the RAM 102, the CPU 101 executes the program to execute the process. Hereinafter, each process shown in FIG. 4 will be described.

まずステップS401において、撮像画像データ入力部301は、撮像装置107を用いて撮像画像データ307を撮像し、撮像画像データ307およびカメラユニット201〜209の画角や視点位置を含む撮像装置情報308を取得する。あるいは、予めROM103やHDD105などの記録装置に撮像画像データ307および撮像装置情報308を保持しておき、これを撮像画像データ入力部301が取得するようにしてもよい。   First, in step S <b> 401, the captured image data input unit 301 captures captured image data 307 using the imaging device 107, and captures captured image data 307 and imaging device information 308 including the angle of view and viewpoint position of the camera units 201 to 209. get. Alternatively, the captured image data 307 and the imaging device information 308 may be held in a recording device such as the ROM 103 or the HDD 105 in advance, and the captured image data input unit 301 may acquire the captured image data.

次にステップS402において、パラメータ入力部302は入力デバイス109から仮想ピント距離を含む仮想ピントパラメータ309および画像合成時に使用する各画像データの重み係数を含む仮想絞りパラメータ310を取得する。あるいは、予めROM103やHDD105などの記録装置に仮想ピントパラメータ309および仮想絞りパラメータ310を保持しておき、これをパラメータ入力部302が取得するようにしてもよい。   In step S <b> 402, the parameter input unit 302 acquires from the input device 109 a virtual focus parameter 309 including a virtual focus distance and a virtual aperture parameter 310 including a weight coefficient of each image data used at the time of image synthesis. Alternatively, the virtual focus parameter 309 and the virtual aperture parameter 310 may be stored in advance in a recording device such as the ROM 103 or the HDD 105, and the parameter input unit 302 may acquire them.

次にステップS403において、距離推定処理部303はS401で取得した撮像画像データ307および撮像装置情報308を用いて距離推定処理を行い、撮像したシーンの奥行きを推定しシーンのデプス画像データ311を生成する。S403で行う距離推定処理については後に詳述する。   In step S403, the distance estimation processing unit 303 performs distance estimation processing using the captured image data 307 and the imaging device information 308 acquired in S401, estimates the depth of the captured scene, and generates depth image data 311 of the scene. To do. The distance estimation process performed in S403 will be described in detail later.

次にステップS404において、S402で取得した仮想ピントパラメータ309およびS403で取得したデプス画像データ311を基に、シーンを2領域に分割した領域分割画像データ312を生成する。ここで、2領域とはピントを合わせたい距離よりも被写体が手前側に存在する領域(前ぼけ領域)と、ピントを合わせたい距離よりも被写体が奥側に存在する領域(後ぼけ領域)である。S404で行う領域分割処理については後に詳述する。   Next, in step S404, based on the virtual focus parameter 309 acquired in step S402 and the depth image data 311 acquired in step S403, region divided image data 312 is generated by dividing the scene into two regions. Here, the two areas are an area where the subject is in front of the distance to be focused (front blur area), and an area where the subject is in the back of the distance to be focused (rear blur area). is there. The area dividing process performed in S404 will be described in detail later.

次にステップS405において、撮像装置情報308、仮想絞りパラメータ310、領域分割画像データ312を基に、撮像画像データ307から撮像画像データ307よりも被写界深度の浅い深度変更画像データ313(出力画像データ313)を生成する。S405で行う画像合成処理については後に詳述する。   In step S 405, based on the imaging device information 308, the virtual aperture parameter 310, and the segmented image data 312, the depth-changed image data 313 (output image) having a shallower depth of field than the captured image data 307 from the captured image data 307. Data 313) is generated. The image composition processing performed in S405 will be described in detail later.

次にステップS406において、画像出力部306は深度変更画像データ313を出力デバイス111に表示したり、HDD105などの記録装置に記録したりする。   In step S <b> 406, the image output unit 306 displays the depth change image data 313 on the output device 111 or records it on a recording device such as the HDD 105.

<距離推定処理>
ここでは、ステップS403で行う距離推定処理について説明する。距離推定処理では、視点位置の異なる複数の撮像画像データ307を基に、撮像したシーンの距離を推定することでデプス画像データ311を生成する。距離推定方法としては既存の方法を利用する。例えば、ステレオ法、マルチベースラインステレオ法などが利用可能である。本実施例では、ステレオ法によって距離推定を行う。以下、図5に示すフローチャートを用い、距離推定処理の詳細を説明する。
<Distance estimation processing>
Here, the distance estimation process performed in step S403 will be described. In the distance estimation process, the depth image data 311 is generated by estimating the distance of the captured scene based on the plurality of captured image data 307 having different viewpoint positions. An existing method is used as the distance estimation method. For example, a stereo method and a multi-baseline stereo method can be used. In this embodiment, distance estimation is performed by a stereo method. Hereinafter, the details of the distance estimation process will be described using the flowchart shown in FIG.

まずステップS501において、撮像画像データ307から処理に使用する2画像を選択する。本実施例では撮像装置107の中央のカメラユニット205で撮像された画像データと、カメラユニット205と横方向に隣接するカメラユニット206で撮像された画像データを選択するものとする。以下、前者を基準画像を示す基準画像データ、後者を対象画像を示す対象画像データと呼ぶ。   First, in step S501, two images to be used for processing are selected from the captured image data 307. In this embodiment, it is assumed that image data captured by the camera unit 205 at the center of the image capturing apparatus 107 and image data captured by the camera unit 206 that is adjacent to the camera unit 205 in the horizontal direction are selected. Hereinafter, the former is referred to as reference image data indicating a reference image, and the latter is referred to as target image data indicating a target image.

次にステップS502において、最初の画素を注目画素として初期化する。   In step S502, the first pixel is initialized as a target pixel.

次にステップS503において、全画素で距離値が求められているかを判定する。全画素で距離値が求められている場合はステップS507へ進み、距離値の求められていない画素がある場合はステップS504へ進む。   In step S503, it is determined whether distance values are obtained for all pixels. If the distance value is obtained for all the pixels, the process proceeds to step S507, and if there is a pixel for which the distance value is not obtained, the process proceeds to step S504.

次にステップS504では、まず基準画像の注目画素とその周囲の画素からなる領域を選択する。そして選択した領域を用いて対象画像とパターンマッチングを行い、対象画像中から注目画素に対応する画素(対応画素)を求める。   In step S504, first, an area composed of the target pixel of the reference image and surrounding pixels is selected. Then, pattern matching is performed with the target image using the selected region, and a pixel (corresponding pixel) corresponding to the target pixel is obtained from the target image.

次にステップS505において、撮像装置情報308と注目画素とS504で求めた対応画素を基に注目画素に対応する距離値pを求める。距離値pは、図6に示すα、β、sを基に以下の式で表される。   In step S505, a distance value p corresponding to the target pixel is obtained based on the imaging device information 308, the target pixel, and the corresponding pixel obtained in step S504. The distance value p is expressed by the following equation based on α, β, and s shown in FIG.

Figure 0005906033
Figure 0005906033

ここで、αはカメラユニット205の水平画角、基準画像データの視点位置、注目画素の座標から算出される角度である。βはカメラユニット206の水平画角、対象画像データの視点位置、対応画素の座標から算出される。sはカメラユニット間の距離であり、基準画像データおよび対象画像データの視点位置より算出される。   Here, α is an angle calculated from the horizontal angle of view of the camera unit 205, the viewpoint position of the reference image data, and the coordinates of the pixel of interest. β is calculated from the horizontal angle of view of the camera unit 206, the viewpoint position of the target image data, and the coordinates of the corresponding pixel. s is the distance between the camera units, and is calculated from the viewpoint position of the reference image data and the target image data.

次にステップS506において、注目画素を次の画素へ更新しS503へ戻る。   Next, in step S506, the target pixel is updated to the next pixel, and the process returns to S503.

最後にステップS507において、デプス画像データ311を出力する。   Finally, in step S507, the depth image data 311 is output.

なお、本実施例ではステップS501において、カメラユニット205、206で撮像した画像データを選択し距離推定を行ったが、距離推定可能なカメラの組み合わせはこれに限るものではない。例えば、対象画像データとして他のカメラユニットで撮像した画像データを選択しても構わない。また、本実施例では画素ごとに距離情報を取得するとしたが、矩形ブロック等の領域ごとに距離情報を取得しても良い。   In this embodiment, in step S501, image data captured by the camera units 205 and 206 is selected and distance estimation is performed. However, the combination of cameras capable of distance estimation is not limited to this. For example, image data captured by another camera unit may be selected as target image data. In this embodiment, distance information is acquired for each pixel. However, distance information may be acquired for each area such as a rectangular block.

<領域分割処理>
ここでは、ステップS404で行う領域分割処理について説明する。領域分割処理では、仮想ピントパラメータ309及びデプス画像データ311を基に、ピントを合わせたい距離よりも被写体が手前側に存在する領域(前ぼけ領域)と、奥側に存在する領域(後ぼけ領域)にシーンを分割し、領域分割画像データ312を生成する。以下、図7に示すフローチャートを用い、領域分割処理の詳細を説明する。
<Area division processing>
Here, the region division processing performed in step S404 will be described. In the area division processing, based on the virtual focus parameter 309 and the depth image data 311, an area where the subject is in front of the distance to be focused (front blur area) and an area behind the area (back blur area). ) To divide the scene into region-divided image data 312. Hereinafter, the details of the region division processing will be described with reference to the flowchart shown in FIG.

まずステップS701において、前ぼけ領域の領域特定を行う。仮想ピントパラメータ309より得られる仮想ピント距離をdp、デプス画像データ311の画素値をD(i,j)とする。このとき、D(i,j)≦dpとなる画素(i,j)と、の周囲r1画素以内に含まれる画素の集合を前ぼけ領域とする。ここで、r1はあらかじめ定めたぼけの最大半径とする。   First, in step S701, the area of the front blurred area is specified. It is assumed that the virtual focus distance obtained from the virtual focus parameter 309 is dp, and the pixel value of the depth image data 311 is D (i, j). At this time, a pixel (i, j) satisfying D (i, j) ≦ dp and a set of pixels included within the surrounding r1 pixels are defined as a front blur region. Here, r1 is a predetermined maximum radius of blur.

次にステップS702において、後ぼけ領域の領域特定を行う。デプス画像データ311において前ぼけ領域以外の画素の集合を後ぼけ領域とする。   Next, in step S702, the area of the back blur area is specified. A set of pixels other than the front blur area in the depth image data 311 is set as a rear blur area.

最後にステップS703において、前ぼけ領域、後ぼけ領域にそれぞれ異なるラベル値を割り当てた画像データを領域分割画像データ312として出力する。   Finally, in step S703, image data in which different label values are assigned to the front blurred area and the rear blurred area are output as area divided image data 312.

以上の処理によって得られる領域分割画像データ312の例を図8に示す。デプス画像データ311を距離値d0、d1、d2からなる画像データとし、仮想ピントパラメータ309から得られる仮想ピント距離dpの値がd2であるとする。この場合、デプス画像データ311において距離値がd2となる画素とその周囲r画素以内に含まれる画素の集合が前ぼけ領域、それ以外の画素の集合が後ぼけ領域となる。   An example of the area division image data 312 obtained by the above processing is shown in FIG. It is assumed that the depth image data 311 is image data composed of distance values d0, d1, and d2, and the value of the virtual focus distance dp obtained from the virtual focus parameter 309 is d2. In this case, a set of pixels in the depth image data 311 whose distance value is d2 and pixels included within the surrounding r pixels is a front blurred area, and a set of other pixels is a back blurred area.

なお、本実施例ではステップS701において、前ぼけ領域を決める際の距離rはあらかじめ定めた値としたが、距離値rの設定方法はこれに限るものではない。例えば、仮想ピントパラメータより、ぼけの最大半径を計算しこの値を距離rとしてしてもよい。こうすることで、仮想ピントパラメータに応じて最適な前ぼけ領域を設定可能である。   In this embodiment, in step S701, the distance r for determining the front blur area is a predetermined value, but the method for setting the distance value r is not limited to this. For example, the maximum radius of blur may be calculated from the virtual focus parameter, and this value may be used as the distance r. By doing so, it is possible to set an optimal front blur area according to the virtual focus parameter.

<深度変更処理>
ここでは、ステップS405で行う深度変更処理について説明する。深度変更処理では、領域分割画像データ312を参照しながら、前ぼけ領域と後ぼけ領域とでそれぞれ異なる処理を適用し深度の浅い深度変更画像データ313(出力画像データ313)を生成する。その際、前ぼけ領域では撮像画像データ307の中から視点位置の異なる複数の画像データを合成することにより、深度変更画像データ313の画素値を算出する。また、後ぼけ領域ではカメラユニット205で撮像した基準画像データとデプス画像データ311とを用いることにより深度変更画像データ313の画素値を算出する。以下、図9に示すフローチャートを用い、深度変更処理の詳細を説明する。
<Depth change processing>
Here, the depth changing process performed in step S405 will be described. In the depth changing process, different processes are applied to the front blurred area and the rear blurred area while referring to the area-divided image data 312, and the depth changed image data 313 (output image data 313) having a shallow depth is generated. At this time, the pixel value of the depth-changed image data 313 is calculated by combining a plurality of pieces of image data having different viewpoint positions from the captured image data 307 in the front blur region. Further, in the back blur area, the pixel value of the depth change image data 313 is calculated by using the reference image data captured by the camera unit 205 and the depth image data 311. Hereinafter, the depth change process will be described in detail with reference to the flowchart shown in FIG.

まずステップS901において、領域分割画像データ312を複数のブロックに分割する。後述するステップS905及びステップS906処理はここで定めたブロック毎に行う。ブロックの分割例を図15(a)に示す。   First, in step S901, the area division image data 312 is divided into a plurality of blocks. Steps S905 and S906 described later are performed for each block determined here. An example of block division is shown in FIG.

次にステップS902において、注目ブロックを最初のブロックに初期化する。   In step S902, the block of interest is initialized to the first block.

次にS903において、全ブロックに対して後述するステップS905あるいはステップS906の処理が行われたか否かを判定する。全ブロックで処理が行われている場合はステップS908へ進み、そうでない場合はS904へ進む。   Next, in step S903, it is determined whether or not processing in step S905 or step S906 described later has been performed on all blocks. If processing has been performed for all blocks, the process proceeds to step S908, and if not, the process proceeds to S904.

次にステップS904において、注目ブロック内に前ぼけ領域が含まれているかを判定する。含まれていない場合はステップS905へ進み、含まれている場合はステップS906へ進む。   Next, in step S904, it is determined whether or not a front blur area is included in the block of interest. If not included, the process proceeds to step S905. If included, the process proceeds to step S906.

ステップS905では、一つの基準画像データとデプス画像データ311とを用いて深度を浅くする処理を行い、深度変更画像データ313の注目ブロックに対応する領域の画素値を算出する。詳細は後述する。   In step S <b> 905, a process for reducing the depth is performed using one reference image data and depth image data 311, and a pixel value of a region corresponding to the target block of the depth-changed image data 313 is calculated. Details will be described later.

ステップS906では、複数の撮像画像データ307を用いて深度を浅くする処理を行い、深度変更画像データ313の注目ブロックに対応する領域の画素値を算出する。詳細は後述する。   In step S <b> 906, a process for reducing the depth is performed using the plurality of captured image data 307, and the pixel value of the region corresponding to the target block of the depth-changed image data 313 is calculated. Details will be described later.

ステップS907では、注目ブロックを次の未処理ブロックへ更新し、ステップS903へ戻る。   In step S907, the target block is updated to the next unprocessed block, and the process returns to step S903.

最後にステップS908において、深度変更画像データ313を出力する。   Finally, in step S908, the depth change image data 313 is output.

以上説明した処理を行うことで、複数の画像データからより被写界深度の浅い画像データを生成する際に、ぼけの画質を保ちつつ計算コストを低減させる効果を奏する。   By performing the processing described above, when generating image data with a shallower depth of field from a plurality of image data, an effect of reducing the calculation cost while maintaining the blurred image quality is obtained.

<<基準画像データとデプス画像データを用いた深度変更処理>>
ステップS905で行う前ボケ領域を含まないブロックに対して行う深度変更処理について説明する。ここでは、デプス画像データ311を参照することで被写体の前後関係を考慮しつつ基準画像データを平滑化することにより、深度変更画像データ313の注目ブロックに対応する画素値を算出する。以降、深度変更画像データ313の画素(i,j)に対応する画素値をH(i,j)と表す。以下、図10に示すフローチャートを用い、処理の詳細を説明する。
<< Depth change processing using reference image data and depth image data >>
Depth change processing performed on a block that does not include the previous blurred region performed in step S905 will be described. Here, the pixel value corresponding to the target block of the depth-changed image data 313 is calculated by smoothing the reference image data while referring to the depth image data 311 and taking into account the context of the subject. Hereinafter, the pixel value corresponding to the pixel (i, j) of the depth change image data 313 is represented as H (i, j). Hereinafter, details of the processing will be described using the flowchart shown in FIG.

まずステップS1001において、注目画素(i,j)を最初の画素に初期化する。   First, in step S1001, the target pixel (i, j) is initialized to the first pixel.

次にステップS1002において、注目ブロック内の全画素について処理を行ったか否かを判定する。全画素が処理済みである場合はステップS905を終了し、そうでない場合はステップS1003へ進む。   Next, in step S1002, it is determined whether or not processing has been performed for all pixels in the block of interest. If all the pixels have been processed, step S905 is ended, and if not, the process proceeds to step S1003.

次にステップS1003において、以降の処理で使用する変数val,sumをそれぞれ0に初期化する。ここで、valは出力画素値を計算するための変数、sumは以降で述べる係数の和を計算するための変数である。   In step S1003, variables val and sum used in the subsequent processes are initialized to 0. Here, val is a variable for calculating the output pixel value, and sum is a variable for calculating the sum of coefficients described below.

次にステップS1004において、近傍画素(i’,j’)を初期化する。近傍画素(i’,j’)は、注目画素(i,j)からr2画素以内の領域(以降近傍領域と呼ぶ)に含まれる画素である。ここでr2はあらかじめ定めた定数とする。   In step S1004, the neighboring pixel (i ′, j ′) is initialized. The neighboring pixel (i ′, j ′) is a pixel included in an area within r2 pixels from the target pixel (i, j) (hereinafter referred to as a neighboring area). Here, r2 is a predetermined constant.

次にステップS1005において、近傍領域内の全画素を近傍画素として参照したかを判定する。未参照の画素がある場合はステップS1006へ進み、全画素を参照している場合はステップS1011へ進む。   Next, in step S1005, it is determined whether all the pixels in the neighborhood area have been referred to as neighborhood pixels. If there are unreferenced pixels, the process proceeds to step S1006. If all the pixels are referenced, the process proceeds to step S1011.

次にステップS1006において、注目画素(i,j)と近傍画素(i’,j’)のフィルタ径を算出する。フィルタ径は、仮想絞りパラメータに含まれる値であり、デプス値に応じて異なる値を持つ。デプス値とフィルタ径の関係を図11に示す。フィルタ径Rfは、仮想ピントパラメータ309に含まれる仮想ピント距離dpと、デプス画像データ311から得られる各画素のデプス値が等しい場合に0となり、デプス値が仮想ピント距離から前後に離れるにつれ大きな値となる。画素(x、y)に対応するデプス値をD(x,y)とすると、注目画素のフィルタ径Rf1、近傍画素のフィルタ径Rf2は以下の式により求められる。   In step S1006, the filter diameters of the pixel of interest (i, j) and the neighboring pixels (i ', j') are calculated. The filter diameter is a value included in the virtual aperture parameter, and has a different value depending on the depth value. The relationship between the depth value and the filter diameter is shown in FIG. The filter diameter Rf is 0 when the virtual focus distance dp included in the virtual focus parameter 309 and the depth value of each pixel obtained from the depth image data 311 are equal, and increases as the depth value moves back and forth from the virtual focus distance. It becomes. When the depth value corresponding to the pixel (x, y) is D (x, y), the filter diameter Rf1 of the target pixel and the filter diameter Rf2 of the neighboring pixel are obtained by the following equations.

Figure 0005906033
Figure 0005906033

次にステップS1007において、近傍画素(i’,j’)が処理対象画素か否かの判定を行う。処理対象画素の場合はステップS1008へ進み、処理対象画素でない場合はステップS1010へ進む。判定には、注目画素及び近傍画素のデプス値、注目画素のフィルタ径rfを用いた以下に示す2つの判定式を用いる。   In step S1007, it is determined whether the neighboring pixel (i ′, j ′) is a processing target pixel. If it is a processing target pixel, the process proceeds to step S1008, and if it is not a processing target pixel, the process proceeds to step S1010. For the determination, the following two determination formulas using the depth values of the target pixel and neighboring pixels and the filter diameter rf of the target pixel are used.

Figure 0005906033
Figure 0005906033

ここで、式(4)は近傍画素が注目画素より手前側か奥側かを判定している。近傍画素が注目画素よりも手前側の場合は「真」、奥側の場合は「偽」となる。式(5)は注目画素と近傍画素の間の距離が注目画素のフィルタ径よりも大きいか否かを判定している。注目画素と近傍画素の間の距離が注目画素のフィルタ径よりも小さければ「真」、大きければ「偽」となる。これらの式により、オクルージョンの有無を判定している。式(4)または式(5)が真の場合は、近傍画素(i’,j’)を処理対象画素とみなしステップS1008へ進む。式(4)式(5)がともに偽の場合は、近傍画素(i’,j’)を処理対象画素から除外しステップS1010へ進む。なお、対象画素の選択方法はこれに限るものではない。例えば、式(4)のみを判定式に用いてもよいし、オクルージョンの有無を判定する他の判定式を用いるなどしても構わない。   Here, Expression (4) determines whether the neighboring pixel is on the near side or the far side with respect to the target pixel. When the neighboring pixel is on the near side of the target pixel, “true” is indicated, and when the neighboring pixel is on the rear side, “false” is indicated. Expression (5) determines whether or not the distance between the target pixel and neighboring pixels is larger than the filter diameter of the target pixel. If the distance between the pixel of interest and the neighboring pixel is smaller than the filter diameter of the pixel of interest, it is “true”, and if it is larger, it is “false”. The presence or absence of occlusion is determined by these equations. When the formula (4) or the formula (5) is true, the neighboring pixel (i ′, j ′) is regarded as a processing target pixel, and the process proceeds to step S1008. When both the formula (4) and the formula (5) are false, the neighboring pixel (i ′, j ′) is excluded from the processing target pixels, and the process proceeds to step S1010. Note that the method of selecting the target pixel is not limited to this. For example, only formula (4) may be used as a judgment formula, or another judgment formula for judging the presence or absence of occlusion may be used.

次にステップS1008において、処理対象画素となる近傍画素の重み係数cを算出する。ここでは、注目画素から近傍画素までの距離を用いて下記の式に従い係数cを算出する。   In step S1008, the weighting coefficient c of the neighboring pixel that is the processing target pixel is calculated. Here, the coefficient c is calculated according to the following equation using the distance from the target pixel to the neighboring pixels.

Figure 0005906033
Figure 0005906033

なお、上式ではぼけを滑らかにするためにガウシアンを使用しているが、係数の決め方はこれに限るものではない。例えば、フィルタ係数を多項式関数に基づいて決定するなどしてもよい。   In the above equation, Gaussian is used to smooth the blur, but the method of determining the coefficients is not limited to this. For example, the filter coefficient may be determined based on a polynomial function.

次にステップS1009において、変数val,sumの値をそれぞれ下記のように更新する。   In step S1009, the values of variables val and sum are updated as follows.

Figure 0005906033
Figure 0005906033

ここでI(x’,y’)は近傍画素の画素値である。   Here, I (x ′, y ′) is a pixel value of a neighboring pixel.

次にステップS1010において、近傍画素(i’,j’)を更新しステップS1005へ戻る。   In step S1010, the neighboring pixel (i ', j') is updated, and the process returns to step S1005.

ステップS1011では、深度変更画像データ313における注目画素(i,j)の画素値H(i,j)を次式に従い算出する。   In step S1011, the pixel value H (i, j) of the target pixel (i, j) in the depth change image data 313 is calculated according to the following equation.

Figure 0005906033
Figure 0005906033

ここでは、近傍画素の重み付け和を係数の合計値で正規化することにより、処理対象画素の有無による画素値のばらつきを補正している。
次にステップS1012において、近傍画素(i,j)を更新しステップS1012へ戻る。
Here, the variation in the pixel value due to the presence or absence of the processing target pixel is corrected by normalizing the weighted sum of the neighboring pixels with the total value of the coefficients.
Next, in step S1012, the neighboring pixel (i, j) is updated, and the process returns to step S1012.

以上の処理により、深度変更画像データ313の注目ブロックに対応する領域を生成する。   Through the above processing, an area corresponding to the target block of the depth change image data 313 is generated.

なお、本実施例ではステップS1004において、近傍領域を決める際の距離値Rの値はあらかじめ定めた値としたが、距離値Rの設定方法はこれに限るものではない。例えば、フィルタ径の最大値をRにしてもよい。こうすることで、仮想ピントパラメータに応じて最適な大きさの近傍領域を設定可能である。   In the present embodiment, in step S1004, the distance value R when determining the neighborhood region is a predetermined value, but the method of setting the distance value R is not limited to this. For example, the maximum value of the filter diameter may be R. By doing this, it is possible to set a neighborhood area of an optimal size according to the virtual focus parameter.

<<多視点画像データを用いた深度変更処理>>
ステップS906で行う前ボケ領域を含むブロックに対して行う深度変更処理について説明する。ここでは、合成開口法を用いて複数の撮像画像データ307からより深度の浅い画像データを生成する例を述べる。本処理によって、深度変更画像データ313の注目ブロックに対応する領域を生成する。以下、図12に示すフローチャートを用い、処理の詳細を説明する。
<< Depth change processing using multi-viewpoint image data >>
Depth change processing performed on the block including the previous blurred region performed in step S906 will be described. Here, an example will be described in which image data having a shallower depth is generated from a plurality of captured image data 307 using the synthetic aperture method. By this processing, an area corresponding to the target block of the depth change image data 313 is generated. The details of the processing will be described below using the flowchart shown in FIG.

まずステップS1201において、ステップS402で取得した仮想絞りパラメータ310に含まれる重み係数を用いて、画像データを合成する際に用いる重み係数wを設定する。仮想絞りパラメータ310に含まれる重み係数は複数の撮像画像データ307に対する係数のセットである。図13に示すように、撮像画像データ307の視点位置をそれぞれPmと表し、Pmに対応する撮像画像データ307を画像データImとする。このとき、Imに対応する重み係数の値をW(m)とする。ここでW(m)はP4を中心としたガウス関数に従い、総和が1になるよう正規化された値を設定している。W(m)をガウス関数に従うように設定することにより、合成時に画像データを滑らかにぼかすことができる。   First, in step S1201, a weighting factor w used when combining image data is set using the weighting factor included in the virtual aperture parameter 310 acquired in step S402. The weighting coefficient included in the virtual aperture parameter 310 is a set of coefficients for a plurality of captured image data 307. As shown in FIG. 13, the viewpoint position of the captured image data 307 is represented as Pm, and the captured image data 307 corresponding to Pm is defined as image data Im. At this time, the value of the weighting factor corresponding to Im is set to W (m). Here, W (m) is set to a normalized value according to a Gaussian function centered on P4 so that the sum is 1. By setting W (m) so as to follow a Gaussian function, the image data can be smoothly blurred during synthesis.

次にステップS1202において、撮像装置情報308を基に各画像データのシフト量を算出する。ピント距離をdとした際の画像データImの水平方向のシフト量△i(m、d)および垂直方向のシフト量△j(m、d)は以下の式で表される。   In step S1202, the shift amount of each image data is calculated based on the imaging device information 308. The horizontal shift amount Δi (m, d) and the vertical shift amount Δj (m, d) of the image data Im when the focus distance is d are expressed by the following equations.

Figure 0005906033
Figure 0005906033

ここで、W、Hはそれぞれ画像データの水平方向、垂直方向の画像サイズ、θwはカメラユニットの水平視野角、θhはカメラユニットの垂直視野角である。また、(sm,tm)はxy平面上におけるPmの座標、(s‘,t’)はカメラユニット205の視点位置P4の座標である。   Here, W and H are the horizontal and vertical image sizes of the image data, θw is the horizontal viewing angle of the camera unit, and θh is the vertical viewing angle of the camera unit. Further, (sm, tm) is the coordinate of Pm on the xy plane, and (s ′, t ′) is the coordinate of the viewpoint position P4 of the camera unit 205.

次にステップS1103において、ステップS1102で求めたシフト量、ステップS1101で求めた重み係数を用いて、撮像画像データ307に対して重み付け加算処理を行い、注目ブロック内の深度変更画像データ313の画素値H(i,j)を算出する。画素値H(i,j)は以下の式で算出する。   Next, in step S1103, weighted addition processing is performed on the captured image data 307 using the shift amount obtained in step S1102 and the weighting coefficient obtained in step S1101, and the pixel value of the depth-changed image data 313 in the block of interest. H (i, j) is calculated. Pixel value H (i, j) is calculated by the following equation.

Figure 0005906033
Figure 0005906033

以上の処理により、深度変更画像データ313の注目ブロックに対応する領域を生成する。   Through the above processing, an area corresponding to the target block of the depth change image data 313 is generated.

なお、ここでは撮像画像データを合成開口撮像法を用いて合成する方法について述べたが、他の方法用いても構わない。例えば、撮像画像データから視点位置を内装するように補間画像データを生成し、合成開口撮像法によって撮像画像データと補間画像データとを合成することにより深度変更画像データを生成しても構わない。あるいは、撮像画像データからシーンの3次元的なモデルを生成し、それを用いてレンダリングを行うことで深度変更画像データを生成しても構わない。これらの方法を用いた場合には、よりぼけの画質が良好な深度変更画像データを得ることができる。   Although a method of combining captured image data using the synthetic aperture imaging method has been described here, other methods may be used. For example, the depth-change image data may be generated by generating the interpolation image data so as to incorporate the viewpoint position from the captured image data and combining the captured image data and the interpolation image data by the synthetic aperture imaging method. Alternatively, the depth-change image data may be generated by generating a three-dimensional model of the scene from the captured image data and performing rendering using the model. When these methods are used, depth-changed image data with better blurred image quality can be obtained.

<<深度変更処理の比較>>
一般的に、前ぼけ領域に対する深度変更処理は複数の撮像画像データに基づく処理であるため、計算コストは高い。仮に、前ぼけ領域に対する深度変更処理を基準画像データとデプス画像データとに基づいて行ったとすると、ぼけ領域の画質は著しく悪いものとなる。これは前ボケになる手前の被写体に、後ろの被写体の一部が隠れているためである。前ボケにより本来後ろの被写体の隠れていた部分が見えてくるはずだが、その情報がないため画質が著しく低下してしまう。複数の撮像画像データを用いることで、隠れた部分の情報を基準画像データ以外の撮像画像データから得ることができる。これにより前述した前ボケ領域の画質の低下を防ぐことができる。
<< Comparison of depth change processing >>
In general, the depth change processing for the front blur region is processing based on a plurality of captured image data, and thus the calculation cost is high. If the depth changing process for the front blur area is performed based on the reference image data and the depth image data, the image quality of the blur area is extremely bad. This is because a part of the rear subject is hidden behind the front subject that becomes the front blur. Although the hidden part of the subject behind the camera should be visible due to the front blur, the image quality is significantly reduced because there is no information. By using a plurality of captured image data, information on a hidden portion can be obtained from captured image data other than the reference image data. As a result, it is possible to prevent the deterioration of the image quality of the previous blurred area.

一方で、後ぼけ領域に対する深度変更処理は基準画像データとデプス画像データとに基づく処理であるため、計算コストは低い。仮に、後ぼけ領域に対する深度変更処理を複数の撮像画像データに基づいて行ったとしても、ぼけ領域の画質の向上は高くない。これは、手前の被写体に後ろの被写体の一部が隠れてしまうが、この隠れた部分は後ろの被写体をぼかす際に画質にほとんど影響しないためである。   On the other hand, the depth change process for the back blur area is a process based on the reference image data and the depth image data, and thus the calculation cost is low. Even if the depth change process for the back blur area is performed based on a plurality of captured image data, the improvement in the image quality of the blur area is not high. This is because a part of the rear subject is hidden behind the front subject, but this hidden portion hardly affects the image quality when blurring the rear subject.

本実施例は、前ぼけ領域に対して複数の撮像画像データに基づいて深度変更処理を行う一方で、後ぼけ領域に対して基準画像データとデプス画像データとに基づいて深度変更処理を行う。これにより、ぼけ領域の画質を維持しながら、深度変更処理に要する計算コストを低減させることができる。   In this embodiment, the depth changing process is performed on the front blurred area based on the plurality of captured image data, while the depth changing process is performed on the rear blurred area based on the reference image data and the depth image data. Thereby, it is possible to reduce the calculation cost required for the depth changing process while maintaining the image quality of the blurred area.

<変形例>
・本実施例では、後ぼけ領域に対して基準画像データとデプス画像データとに基づいて深度変更処理を行うこととした。しかしながら、後ぼけ領域に対する深度変更処理はこれに限らず、前ぼけ領域に対する深度変更処理に要する計算コストよりも低い計算コストで実現される深度変更処理であれば、何であっても構わない。例えば、後ぼけ領域に対する深度変更処理をN枚の撮像画像データに基づく処理とし、前ぼけ領域に対する深度変更処理をM枚(M>N)の撮像画像データに基づく処理としても良い。
<Modification>
In this embodiment, the depth changing process is performed on the back blur area based on the reference image data and the depth image data. However, the depth changing process for the rear blur area is not limited to this, and any depth changing process can be used as long as the calculation cost is lower than the calculation cost required for the depth changing process for the front blur area. For example, the depth changing process for the rear blurred area may be a process based on N pieces of captured image data, and the depth changing process for the front blurred area may be a process based on M (M> N) captured image data.

[実施例2]
実施例1ではシーンを前ぼけ領域と後ぼけ領域の2領域に分割した。実施例2では、これらの境界に中間領域を設定することで、前ぼけ領域と後ぼけ領域の境界を滑らかに接続する。
[Example 2]
In the first embodiment, the scene is divided into two areas, a front blur area and a rear blur area. In the second embodiment, by setting an intermediate region at these boundaries, the boundary between the front blur region and the rear blur region is smoothly connected.

実施例2では実施例1と比較し、ステップS405で行う深度変更処理が異なる。以下、深度変更処理の詳細を説明する。   The second embodiment is different from the first embodiment in the depth change process performed in step S405. Details of the depth change process will be described below.

実施例1ではブロック毎に異なる処理を適用して深度を浅くしていたが、実施例2ではブロックの境界部分において処理結果をブレンドすることでブロックの境界を滑らかに接続する。以下、図14に示すフローチャートを用い詳細を説明する。   In the first embodiment, different processing is applied to each block to reduce the depth, but in the second embodiment, the block boundaries are smoothly connected by blending the processing results at the block boundary portions. Details will be described below with reference to the flowchart shown in FIG.

まずステップS1401において、領域分割画像データ312を基に画像データを複数の領域に分割する。まずは、ステップS902と同様に複数のブロックに分割した後、前ぼけ領域を含むブロックと前ぼけ領域を含まない領域とに分類し、その境界領域を中間領域とする。分割結果の例を図15(b)に示す。ここでは、前ぼけ領域を含むブロックと、前ぼけ領域を含まないブロックの境界から距離r内に含まれる画素の集合を中間領域としている。   First, in step S1401, the image data is divided into a plurality of regions based on the region divided image data 312. First, after dividing into a plurality of blocks in the same manner as in step S902, the blocks are classified into blocks including the front blur region and regions not including the front blur region, and the boundary region is set as an intermediate region. An example of the division result is shown in FIG. Here, a set of pixels included within the distance r from the boundary between the block including the front blur area and the block not including the front blur area is used as the intermediate area.

次にステップS1402において、以降の処理を行う注目領域を初期化する。   Next, in step S1402, a region of interest for subsequent processing is initialized.

次にステップS1403において、全領域で処理が行われたかを判定する。全領域で処理が行われている場合はステップS1409へ進み、未処理の領域がある場合はステップS1404に進む。   In step S1403, it is determined whether processing has been performed for all regions. If processing has been performed for all areas, the process proceeds to step S1409, and if there is an unprocessed area, the process proceeds to step S1404.

次にステップS1404において、領域の判定を行う。注目領域が前ぼけ領域を含まない場合はステップS1405へ進み、前ぼけ領域を含む場合はステップS1406へ進み、中間領域の場合はステップS1407へ進む。   In step S1404, the area is determined. When the attention area does not include the front blur area, the process proceeds to step S1405. When the attention area includes the front blur area, the process proceeds to step S1406. When the attention area includes the front blur area, the process proceeds to step S1407.

ステップS1405では、実施例1のステップS905と同様に基準画像データとデプス画像データとを用いて深度変更処理を行う。   In step S1405, the depth changing process is performed using the reference image data and the depth image data as in step S905 of the first embodiment.

ステップS1406では、実施例1のステップS906と同様に複数の撮像画像データ307を用いて深度変更処理を行う。   In step S1406, similarly to step S906 of the first embodiment, depth change processing is performed using a plurality of captured image data 307.

ステップS1407では、実施例1のステップS905の方法と実施例1のステップS906の方法とで2種類の深度変更処理を行い、その結果をブレンドする。ステップS905の方法で得られた画像データH1、ステップS906の方法で得られた画像データH2とすると、深度変更画像データHは下記の式に基づいて算出する。   In step S1407, two types of depth change processing are performed by the method of step S905 of the first embodiment and the method of step S906 of the first embodiment, and the results are blended. Assuming that the image data H1 obtained by the method of step S905 and the image data H2 obtained by the method of step S906 are used, the depth change image data H is calculated based on the following equation.

Figure 0005906033
Figure 0005906033

ここで、αは中間領域の範囲を決める距離rと、前ぼけ領域を含まない領域から画素(i,j)までの距離によって定まる0以上1以下の係数である。αの値は画素(i,j)が前ぼけ領域を含まない領域に近いほど1に近づき、前ぼけ領域を含む領域に近づくほど0に近い値となる。   Here, α is a coefficient of 0 or more and 1 or less determined by the distance r that determines the range of the intermediate region and the distance from the region that does not include the previous blurred region to the pixel (i, j). The value of α is closer to 1 as the pixel (i, j) is closer to the region not including the front blur region, and is closer to 0 as the pixel (i, j) is closer to the region including the front blur region.

次にステップS1408では、注目領域を更新しステップS1403へ戻る。   In step S1408, the attention area is updated, and the process returns to step S1403.

最後にステップS1309において、深度変更画像データ313を出力する。   Finally, in step S1309, the depth change image data 313 is output.

以上説明した処理を行うことで、複数の画像からより被写界深度の浅い画像を生成する際に、前ぼけ領域と後ぼけ領域との境界を滑らかに接続しながら、ぼけの画質を保ちつつ計算コストを低減させる効果を奏する。   By performing the processing described above, when generating an image with a shallower depth of field from a plurality of images, the boundary between the front blur region and the rear blur region is smoothly connected, and the image quality of blur is maintained. There is an effect of reducing the calculation cost.

<その他の変形例>
実施例1及び実施例2ではステップS403の距離推定処理によりデプス画像データ311を生成していたが、デプス画像データ311の生成方法はこれに限るものではない。例えば、シーンの奥行きを外部のセンサを利用して測定し、それを基にデプス画像データを生成してもかまわない。あるいは、新たに撮像装置107に測距センサを設け、それを基にデプス画像データを生成してもかまわない。
<Other variations>
In the first and second embodiments, the depth image data 311 is generated by the distance estimation process in step S403. However, the generation method of the depth image data 311 is not limited to this. For example, the depth of the scene may be measured using an external sensor, and depth image data may be generated based on the measurement. Alternatively, a distance measuring sensor may be newly provided in the imaging apparatus 107, and depth image data may be generated based on the distance measuring sensor.

(その他の実施例)
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施例の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
(Other examples)
The present invention can also be realized by executing the following processing. That is, software (program) for realizing the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, etc.) of the system or apparatus reads the program. It is a process to be executed.

Claims (12)

複数の視点から被写体を撮像して得られた複数の撮像画像データを入力する画像入力手段と、
前記複数の撮像画像データを用いて、前記複数の撮像画像データのそれぞれよりも被写界深度が浅い出力画像データを生成する生成手段とを有し、
前記生成手段は、前記出力画像データにおいて、所定の距離よりも手前に存在する被写体に対応する第一の画像領域と、前記所定の距離よりも奥に存在する被写体に対応する第二の画像領域とで、異なる数の撮像画像データを用いて前記出力画像データを生成し、
前記出力画像データの生成において、前記生成手段が前記第一の画像領域で用いる撮像画像データの数は、前記生成手段が前記第二の画像領域で用いる撮像画像データの数よりも大きいことを特徴とする画像処理装置。
Image input means for inputting a plurality of captured image data obtained by imaging a subject from a plurality of viewpoints;
Generation means for generating output image data having a shallower depth of field than each of the plurality of captured image data using the plurality of captured image data ;
In the output image data, the generation means includes a first image region corresponding to a subject existing before a predetermined distance, and a second image region corresponding to a subject existing behind the predetermined distance. And generating the output image data using a different number of captured image data ,
In the generation of the output image data, the number of captured image data used by the generation unit in the first image region is larger than the number of captured image data used by the generation unit in the second image region. An image processing apparatus.
ピント距離を示すピントパラメータを入力するパラメータ入力手段を更に有し、
前記生成手段は、前記出力画像データにおいて、前記ピント距離よりも手前に存在する被写体に対応する第一の画像領域と、前記ピント距離よりも奥に存在する被写体に対応する第二の画像領域とで異なる数の撮像画像データを用いて、前記出力画像データとして、前記ピントパラメータが示すピント距離にピントが合った画像データを生成することを特徴とする請求項1に記載の画像処理装置。
It further has parameter input means for inputting a focus parameter indicating the focus distance,
In the output image data, the generation means includes a first image area corresponding to a subject existing in front of the focus distance, and a second image area corresponding to a subject existing in the back of the focus distance. The image processing apparatus according to claim 1, wherein image data that is in focus at a focus distance indicated by the focus parameter is generated as the output image data using different numbers of captured image data.
前記被写体までの距離を示す距離情報を取得する取得手段と、
前記距離情報と前記ピントパラメータとに基づいて、前記第一の画像領域と前記第二の画像領域とを特定する特定手段とを更に有し、
前記生成手段は、前記特定手段により特定された前記第一の画像領域と前記第二の画像領域とに基づいて、前記出力画像データを生成することを特徴とする請求項2に記載の画像処理装置。
Obtaining means for obtaining distance information indicating a distance to the subject;
A specifying unit for specifying the first image area and the second image area based on the distance information and the focus parameter;
Said generating means, on the basis of the said and identified the first image area the second image area by the specific means, the image processing according to claim 2, characterized in that to generate the output image data apparatus.
前記取得手段は、前記複数の撮像画像データに基づいて前記距離情報を取得することを特徴とする請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the acquisition unit acquires the distance information based on the plurality of captured image data. 前記生成手段は、前記第一の画像領域において、前記第二の画像領域において前記出力画像データの生成に用いる撮像画像データの数よりも多くの数の撮像画像データを用いて、前記出力画像データを生成することを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。   The generation means uses the output image data in the first image region using a larger number of captured image data than the number of captured image data used for generating the output image data in the second image region. 5. The image processing apparatus according to claim 1, wherein the image processing apparatus generates an image. 前記生成手段は、前記第一の画像領域において少なくとも2つの撮像画像データを用いて、更に、前記第二の画像領域において1つの撮像画像データを用いて前記出力画像データを生成することを特徴とする請求項5に記載の画像処理装置。   The generating means generates the output image data using at least two captured image data in the first image area and further using one captured image data in the second image area. The image processing apparatus according to claim 5. 前記生成手段は、前記第二の画像領域において、撮像画像データにぼけを付与するフィルタ処理を行うことにより前記出力画像データを生成することを特徴とする請求項1乃至6のいずれか1項に記載の画像処理装置。   The said generation | production means produces | generates the said output image data by performing the filter process which gives blurring to captured image data in said 2nd image area | region, The any one of Claim 1 thru | or 6 characterized by the above-mentioned. The image processing apparatus described. 前記生成手段は、前記第一の画像領域において、複数の撮像画像データをシフトさせ、重み付き加算することにより、前記出力画像データを生成することを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。   8. The output unit according to claim 1, wherein the generation unit generates the output image data by shifting a plurality of captured image data and performing weighted addition in the first image region. The image processing apparatus according to item. 前記出力画像データのぼけ量にかかる絞りパラメータを入力する手段を更に有し、
前記生成手段は、前記絞りパラメータに基づいて前記出力画像データを生成することを特徴とする請求項1乃至8のいずれか1項に記載の画像処理装置。
Means for inputting an aperture parameter related to a blur amount of the output image data;
The image processing apparatus according to claim 1, wherein the generation unit generates the output image data based on the aperture parameter.
請求項1乃至9のいずれか一項に記載の画像処理装置としての機能を有し、前記複数の撮像画像データを撮像する複数の撮像部を有することを特徴とする撮像装置。   10. An imaging apparatus having a function as the image processing apparatus according to claim 1, and having a plurality of imaging units that capture the plurality of captured image data. 複数の視点から被写体を撮像して得られた複数の撮像画像データを入力する画像入力工程と、
前記複数の撮像画像データを用いて、前記複数の撮像画像データのそれぞれよりも被写界深度が浅い出力画像データを生成する生成工程とを含み、
前記生成工程では、前記出力画像データにおいて、所定の距離よりも手前に存在する被写体に対応する第一の画像領域と、前記所定の距離よりも奥に存在する被写体に対応する第二の画像領域とで、異なる数の撮像画像データを用いて前記出力画像データを生成し、前記出力画像データの生成において、前記生成工程が前記第一の画像領域で用いる撮像画像データの数は、前記生成工程が前記第二の画像領域で用いる撮像画像データの数よりも大きいことを特徴とする画像処理方法。
An image input step of inputting a plurality of captured image data obtained by imaging a subject from a plurality of viewpoints;
Generating output image data having a shallower depth of field than each of the plurality of captured image data using the plurality of captured image data; and
In the generation step, in the output image data, a first image region corresponding to a subject existing before a predetermined distance and a second image region corresponding to a subject existing behind the predetermined distance The output image data is generated using a different number of captured image data, and in the generation of the output image data, the number of captured image data used in the first image region in the generation step is the generation step. Is larger than the number of captured image data used in the second image region.
コンピュータを請求項1乃至9のいずれか1項に記載の画像処理装置として機能させるためのプログラム。   The program for functioning a computer as an image processing apparatus of any one of Claims 1 thru | or 9.
JP2011163235A 2011-07-26 2011-07-26 Image processing apparatus, image processing method, and program Active JP5906033B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011163235A JP5906033B2 (en) 2011-07-26 2011-07-26 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011163235A JP5906033B2 (en) 2011-07-26 2011-07-26 Image processing apparatus, image processing method, and program

Publications (3)

Publication Number Publication Date
JP2013027023A JP2013027023A (en) 2013-02-04
JP2013027023A5 JP2013027023A5 (en) 2014-08-07
JP5906033B2 true JP5906033B2 (en) 2016-04-20

Family

ID=47784844

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011163235A Active JP5906033B2 (en) 2011-07-26 2011-07-26 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP5906033B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6319972B2 (en) 2013-08-26 2018-05-09 キヤノン株式会社 Image processing apparatus, imaging apparatus, image processing method, and program
JP6270413B2 (en) 2013-10-29 2018-01-31 キヤノン株式会社 Image processing apparatus, imaging apparatus, and image processing method
CN107454328B (en) * 2017-08-24 2019-08-23 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and computer equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8559705B2 (en) * 2006-12-01 2013-10-15 Lytro, Inc. Interactive refocusing of electronic images
JP5067154B2 (en) * 2007-12-27 2012-11-07 ソニー株式会社 Imaging device
JP5396940B2 (en) * 2009-03-16 2014-01-22 株式会社ニコン Imaging apparatus and image processing apparatus
JP2011022796A (en) * 2009-07-15 2011-02-03 Canon Inc Image processing method and image processor

Also Published As

Publication number Publication date
JP2013027023A (en) 2013-02-04

Similar Documents

Publication Publication Date Title
JP5818514B2 (en) Image processing apparatus, image processing method, and program
US9412151B2 (en) Image processing apparatus and image processing method
JP5156837B2 (en) System and method for depth map extraction using region-based filtering
US20200234397A1 (en) Automatic view mapping for single-image and multi-view captures
JP6016061B2 (en) Image generation apparatus, image display apparatus, image generation method, and image generation program
US20200258309A1 (en) Live in-camera overlays
US11783443B2 (en) Extraction of standardized images from a single view or multi-view capture
US8213708B2 (en) Adjusting perspective for objects in stereoscopic images
JP4658223B2 (en) Image generating method, apparatus, program thereof, and recording medium recording program
KR100793076B1 (en) Edge-adaptive stereo/multi-view image matching apparatus and its method
CN104980651A (en) Image processing apparatus and control method
JP2011060216A (en) Device and method of processing image
WO2013074561A1 (en) Modifying the viewpoint of a digital image
EP2757789A1 (en) Image processing system, image processing method, and image processing program
JP2018040789A (en) Image distance calculation device, image distance calculation method, and program for image distance calculation
JP7444172B2 (en) Information processing device, video generation method and program
JP6610535B2 (en) Image processing apparatus and image processing method
JP4892113B2 (en) Image processing method and apparatus
JP5809607B2 (en) Image processing apparatus, image processing method, and image processing program
Bleyer et al. Temporally consistent disparity maps from uncalibrated stereo videos
JPWO2019244944A1 (en) 3D reconstruction method and 3D reconstruction device
JP5832211B2 (en) Image processing apparatus, image processing method, and program
JP5906033B2 (en) Image processing apparatus, image processing method, and program
KR101841750B1 (en) Apparatus and Method for correcting 3D contents by using matching information among images
CN115546027B (en) Image suture line determination method, device and storage medium

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140623

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140623

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150209

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150217

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150420

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150915

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151116

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160318

R151 Written notification of patent or utility model registration

Ref document number: 5906033

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151