[go: up one dir, main page]

JP2017138240A - Image processing device, image processing method, and program - Google Patents

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

Info

Publication number
JP2017138240A
JP2017138240A JP2016020287A JP2016020287A JP2017138240A JP 2017138240 A JP2017138240 A JP 2017138240A JP 2016020287 A JP2016020287 A JP 2016020287A JP 2016020287 A JP2016020287 A JP 2016020287A JP 2017138240 A JP2017138240 A JP 2017138240A
Authority
JP
Japan
Prior art keywords
error
value
distance
shift amount
pixel shift
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.)
Pending
Application number
JP2016020287A
Other languages
Japanese (ja)
Inventor
澤田 圭一
Keiichi Sawada
圭一 澤田
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 JP2016020287A priority Critical patent/JP2017138240A/en
Publication of JP2017138240A publication Critical patent/JP2017138240A/en
Pending legal-status Critical Current

Links

Landscapes

  • Studio Devices (AREA)
  • Image Analysis (AREA)
  • Measurement Of Optical Distance (AREA)
  • Image Processing (AREA)

Abstract

【課題】プレノプティックカメラによって得られる複数視点画像から導出される距離情報の精度を、より高くするようなF値を求めることができる。
【解決手段】入力される任意のF値から、撮像装置によって得られる複数視点画像から導出される被写体との距離の誤差を推定する誤差推定手段と、誤差推定手段に入力するF値を更新しながら、誤差推定手段によって推定される被写体との距離の誤差を最小にするF値を、撮像装置に設定可能なF値の中から探索し、探索したF値を撮像装置の撮像時におけるF値として決定するF値決定手段と、を備える。
【選択図】図7
It is possible to obtain an F-number that increases the accuracy of distance information derived from a plurality of viewpoint images obtained by a plenoptic camera.
An error estimator for estimating an error in distance to a subject derived from a plurality of viewpoint images obtained by an imaging device from an arbitrary F value input, and an F value input to the error estimator are updated. However, an F value that minimizes the error in distance to the subject estimated by the error estimation unit is searched from among F values that can be set in the imaging apparatus, and the searched F value is an F value at the time of imaging of the imaging apparatus. F value determining means for determining as follows.
[Selection] Figure 7

Description

本発明は、撮像装置の撮像時におけるF値を決定する画像処理装置、画像処理方法、および、プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program for determining an F value at the time of imaging by an imaging apparatus.

異なる瞳領域を通過する光を撮像素子上の異なる画素に集光する撮像装置(プレノプティックカメラ)が知られている。また、プレノプティックカメラにより撮像して得られる画像、すなわち、上記異なる瞳領域を通過する光から生成される複数の画像(複数視点画像)を用いて、ステレオマッチングを行うことにより、被写体との距離を推定する技術が知られている(特許文献1)。   An imaging device (plenoptic camera) that collects light passing through different pupil regions on different pixels on an imaging device is known. In addition, by performing stereo matching using an image obtained by imaging with a plenoptic camera, that is, a plurality of images (multi-viewpoint images) generated from light passing through the different pupil regions, A technique for estimating the distance is known (Patent Document 1).

非特許文献1には、基線長が長いほどステレオマッチングによって導出される、距離情報の精度が高くなることが示されている。プレノプティックカメラはF値が小さいほど基線長が長くなる。そのため、非特許文献1に示される内容に従えば、プレノプティックカメラによって得られる複数視点画像から被写体との距離を推定する場合には、できるだけ小さいF値をプレノプティックカメラに設定して撮影を行うことが望ましい。   Non-Patent Document 1 shows that the longer the baseline length, the higher the accuracy of distance information derived by stereo matching. In the plenoptic camera, the smaller the F value, the longer the baseline length. Therefore, according to the contents shown in Non-Patent Document 1, when estimating the distance to the subject from a plurality of viewpoint images obtained by the plenoptic camera, an F value as small as possible is set in the plenoptic camera. It is desirable to shoot.

特開2009−229125号公報JP 2009-229125 A Masatoshi Okutomi and Takeo Kanade, "A Multiple-Baseline Stereo", IEEE Trans. on Pattern Analysis and Machine Intelligence, 1993Masatoshi Okutomi and Takeo Kanade, "A Multiple-Baseline Stereo", IEEE Trans. On Pattern Analysis and Machine Intelligence, 1993

しかし、基線長を長くするためにF値を小さくすると、撮像画像上のボケが大きくなる。そのため、ステレオマッチングの精度が低下し、その結果、ステレオマッチングにより導出される距離情報の精度も低下してしまう。つまり、プレノプティックカメラでは、F値によって基線長とボケの大きさという2つのパラメータが決まり、それら2つのパラメータの間に距離情報の精度に関するトレードオフが存在する。そこで、本発明では、プレノプティックカメラによって得られる複数視点画像から導出される距離情報の精度を、より高くするようなF値を求めることができるようにする。   However, if the F value is decreased to increase the baseline length, the blur on the captured image increases. Therefore, the accuracy of stereo matching is lowered, and as a result, the accuracy of distance information derived by stereo matching is also lowered. That is, in the plenoptic camera, two parameters, the base line length and the blur size, are determined by the F value, and there is a trade-off regarding the accuracy of the distance information between the two parameters. Therefore, in the present invention, it is possible to obtain an F value that increases the accuracy of distance information derived from a plurality of viewpoint images obtained by a plenoptic camera.

本発明による画像処理装置は、プレノプティック方式の撮像装置の撮像時におけるF値を決定する画像処理装置であって、入力される任意のF値から、撮像装置によって得られる複数視点画像から導出される被写体との距離の誤差を推定する誤差推定手段と、誤差推定手段に入力するF値を更新しながら、誤差推定手段によって推定される被写体との距離の誤差を最小にするF値を、撮像装置に設定可能なF値の中から探索し、探索したF値を撮像装置の撮像時におけるF値として決定するF値決定手段と、を備えることを特徴とする。   An image processing apparatus according to the present invention is an image processing apparatus that determines an F value at the time of imaging by a plenoptic imaging apparatus, and from an arbitrary F value that is input, from a plurality of viewpoint images obtained by the imaging apparatus. An error estimator that estimates an error in the distance to the subject to be derived, and an F value that minimizes the error in the distance to the subject estimated by the error estimator while updating the F value input to the error estimator. F value determination means for searching from among F values that can be set in the imaging apparatus and determining the searched F value as an F value at the time of imaging of the imaging apparatus.

本発明によれば、プレノプティックカメラによって得られる複数視点画像から導出される距離情報の精度を、より高くするようなF値を求めることができる。   According to the present invention, it is possible to obtain an F value that increases the accuracy of distance information derived from a multi-viewpoint image obtained by a plenoptic camera.

第1の実施例に係る画像処理装置の構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the image processing apparatus which concerns on a 1st Example. 撮像装置の構成を示す図である。It is a figure which shows the structure of an imaging device. 撮像装置の機能を説明するための図である。It is a figure for demonstrating the function of an imaging device. 撮像装置における距離情報の導出方法を説明するための図である。It is a figure for demonstrating the derivation | leading-out method of the distance information in an imaging device. 画素ずれ量の誤差と距離情報の誤差との関係を示した図である。It is the figure which showed the relationship between the error of pixel deviation | shift amount, and the error of distance information. 絞り径と距離情報の誤差との関係を示した図である。It is the figure which showed the relationship between an aperture diameter and the error of distance information. 第1の実施例に係る画像処理装置のソフトウェア構成を示すブロック図である。FIG. 3 is a block diagram illustrating a software configuration of the image processing apparatus according to the first embodiment. 第1の実施例に係る画像処理装置における最適F値の探索処理を示すフローチャートである。It is a flowchart which shows the search process of the optimal F value in the image processing apparatus which concerns on a 1st Example. 画素ずれ量の誤差がボケの直径によらず一定の場合におけるF値と距離情報の誤差との関係を示す図である。It is a figure which shows the relationship between F value and the error of distance information in case the error of pixel deviation | shift amount is constant irrespective of the diameter of a blur. 画素ずれ量の誤差がボケの直径に比例する場合におけるF値と距離情報の誤差との関係を示す図である。It is a figure which shows the relationship between F value and the error of distance information in case the error of pixel deviation | shift amount is proportional to the diameter of a blur. ボケの直径が大きくなるに従って、画素ずれ量の誤差が急激に大きくなる場合におけるF値と距離情報の誤差との関係を示す図である。It is a figure which shows the relationship between F value and the error of distance information in case the error of pixel shift amount increases rapidly as the diameter of blur increases. ボケの直径があらかじめ決められたしきい値を超えると、画素ずれ量の誤差が急激に大きくなる場合におけるF値と距離情報の誤差との関係を示す図である。It is a figure which shows the relationship between F value and the error of distance information in case the error of pixel shift | displacement increases rapidly when the diameter of a blur exceeds a predetermined threshold value. 撮像装置の他の構成を示す図である。It is a figure which shows the other structure of an imaging device. ボケの大きさと画素ずれ量の誤差との関係を示すテーブルの例である。It is an example of the table which shows the relationship between the magnitude | size of a blur, and the difference | error of a pixel shift amount.

以下、図面を参照して、本発明を実施する形態について説明する。なお、以下に示す構成は一例に過ぎず、本発明は図示された構成に限定されるものではない。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. The configuration shown below is merely an example, and the present invention is not limited to the illustrated configuration.

<実施例1>
図1は、第1の実施例に係る画像処理装置の構成の一例を示すブロック図である。
<Example 1>
FIG. 1 is a block diagram illustrating an example of the configuration of the image processing apparatus according to the first embodiment.

画像処理装置100は、CPU101と、RAM102と、ROM103と、HDDI/F104と、HDD105と、入力部106と、システムバス107とを備える。画像処理装置100には、撮像装置108と、外部メモリ109とが接続される。画像処理装置100は、例えば、撮像装置108とともにデジタルカメラに搭載される。外部メモリ109は、例えば、デジタルカメラが搭載するカードスロットに装着される。   The image processing apparatus 100 includes a CPU 101, a RAM 102, a ROM 103, an HDD I / F 104, an HDD 105, an input unit 106, and a system bus 107. An imaging device 108 and an external memory 109 are connected to the image processing device 100. For example, the image processing apparatus 100 is mounted on a digital camera together with the imaging apparatus 108. The external memory 109 is installed in, for example, a card slot installed in a digital camera.

CPU101は、RAM102をワークメモリとして、ROM103に格納されたプログラムを実行し、システムバス107を介して各構成要素を統括的に制御する。これにより、後述する様々な処理が実行される。   The CPU 101 executes a program stored in the ROM 103 using the RAM 102 as a work memory, and comprehensively controls each component via the system bus 107. Thereby, various processes described later are executed.

HDDI/F104は、例えばシリアルATA(SATA)等のインタフェイスであり、二次記憶装置としてのHDD105を接続する。CPU101は、HDDI/F104を介してHDD105からデータを読み出す。また、CPU101は、HDDI/F104を介してHDD105へデータを書き込む。   The HDD I / F 104 is an interface such as serial ATA (SATA), for example, and connects the HDD 105 as a secondary storage device. The CPU 101 reads data from the HDD 105 via the HDD I / F 104. Further, the CPU 101 writes data to the HDD 105 via the HDD I / F 104.

HDD105は、ハードディスクドライブである。なお、二次記憶装置はHDDの他、光ディスクドライブ等の記憶デバイスでもよい。   The HDD 105 is a hard disk drive. The secondary storage device may be a storage device such as an optical disk drive in addition to the HDD.

入力部106は、例えばUSBやIEEE1394等のシリアルバスインタフェイスである。CPU101は、入力部106を介して、撮像装置108、外部メモリ109(例えば、ハードディスク、メモリーカード、CFカード、SDカード、USBメモリ)などからデータを取得する。   The input unit 106 is a serial bus interface such as USB or IEEE1394. The CPU 101 acquires data from the imaging device 108, the external memory 1009 (for example, a hard disk, a memory card, a CF card, an SD card, a USB memory) and the like via the input unit 106.

撮像装置108は、プレノプティック方式のカメラである。撮像装置108の詳細については後述する。   The imaging device 108 is a plenoptic camera. Details of the imaging device 108 will be described later.

なお、画像処理装置100は、その他の構成要素を備えていてもよい。   Note that the image processing apparatus 100 may include other components.

[撮像装置108の詳細]
図2は、撮像装置(プレノプティックカメラ)108の内部構成の一例を示す図である。撮像装置108は、メインレンズ201、絞り202、シャッター203、マイクロレンズアレイ204、光学ローパスフィルタ205、iRカットフィルタ206、カラーフィルタ207、撮像素子208及びA/D変換部(単にA/Dという)209を含む。以下では、メインレンズ201は一枚のレンズであるとして説明を行うが、実際は複数のズームレンズ、フォーカスレンズから構成される。
[Details of Imaging Device 108]
FIG. 2 is a diagram illustrating an example of an internal configuration of the imaging apparatus (plenoptic camera) 108. The imaging device 108 includes a main lens 201, an aperture 202, a shutter 203, a microlens array 204, an optical low-pass filter 205, an iR cut filter 206, a color filter 207, an imaging element 208, and an A / D converter (simply referred to as A / D). 209. In the following description, the main lens 201 is assumed to be a single lens, but in actuality, it is composed of a plurality of zoom lenses and focus lenses.

絞り202を調整することにより、撮像装置108の基線長、ボケの大きさ、被写界深度、入射光量を調整することができる。なお、撮像装置108における「基線長」は、ステレオカメラ間の距離を表す「基線長」とは意味が異なる。この点については後述する。   By adjusting the diaphragm 202, the base line length, blur size, depth of field, and incident light amount of the imaging device 108 can be adjusted. Note that the “baseline length” in the imaging device 108 has a different meaning from the “baseline length” that represents the distance between the stereo cameras. This point will be described later.

マイクロレンズアレイ204は、撮像素子208の直前に配置されている集光用マイクロレンズとは異なる。一般的に集光用マイクロレンズは撮像素子の各画素それぞれに一つの光学系(例えば凸レンズ)が配置されるが、マイクロレンズアレイ204は、複数画素に一つの光学系(例えば、2画素に一つの光学系)が配置される。なお、本実施例では、マイクロレンズアレイ204の各レンズのサイズがマイクロメートル単位、あるいはミリメートル単位であっても、各レンズのサイズに関わらずマイクロレンズアレイと呼ぶ。   The microlens array 204 is different from the condensing microlens disposed immediately before the image sensor 208. In general, a condensing microlens is provided with one optical system (for example, a convex lens) for each pixel of an image sensor, but the microlens array 204 has one optical system (for example, one for every two pixels). Two optical systems). In this embodiment, even if the size of each lens of the microlens array 204 is in units of micrometers or millimeters, it is called a microlens array regardless of the size of each lens.

図3は、撮像装置108の機能を説明するための図である。撮像装置(プレノプティックカメラ)108は、メインレンズ201のうち、瞳領域301を通る光束と瞳領域302を通る光束とを異なる画素に集光する機能を有する。図3に示す例では、瞳領域301を通る光束が画素303〜305(R画素)に集光され、瞳領域302を通る光束が画素306〜308(L画素)に集光される。ここで、図3では、画素303〜308に入射する光束のみを示しているが、撮像素子208上の他の画素についても同様である。R画素のみを集めて画像を生成すると、瞳領域301の中心(または重心)309を視点とした画像(右視点画像)を生成することができる。またL画素のみを集めて画像を生成すると、瞳領域302の中心(または重心)310を視点とした画像(左視点画像)を生成することができる。また、両視点の間の距離、すなわち、瞳領域301の中心309と瞳領域302の中心310との間の距離Lを、基線長と呼ぶ。なお、以下ではメインレンズ201の領域を2つの部分瞳領域に分割するプレノプティックカメラを例にして説明するが、これに限定されず、メインレンズ201の領域をより多くの部分瞳領域に分割するプレノプティックカメラに対しても適用可能である。   FIG. 3 is a diagram for explaining the function of the imaging apparatus 108. The imaging device (plenoptic camera) 108 has a function of condensing the light beam passing through the pupil region 301 and the light beam passing through the pupil region 302 of the main lens 201 on different pixels. In the example shown in FIG. 3, the light beam passing through the pupil region 301 is condensed on the pixels 303 to 305 (R pixel), and the light beam passing through the pupil region 302 is collected on the pixels 306 to 308 (L pixel). Here, FIG. 3 shows only the light beams incident on the pixels 303 to 308, but the same applies to other pixels on the image sensor 208. When only R pixels are collected to generate an image, an image (right viewpoint image) with the center (or centroid) 309 of the pupil region 301 as a viewpoint can be generated. Further, when an image is generated by collecting only L pixels, an image (left viewpoint image) with the center (or centroid) 310 of the pupil region 302 as a viewpoint can be generated. The distance between the two viewpoints, that is, the distance L between the center 309 of the pupil region 301 and the center 310 of the pupil region 302 is referred to as a baseline length. In the following, a plenoptic camera that divides the area of the main lens 201 into two partial pupil areas will be described as an example. However, the present invention is not limited to this, and the area of the main lens 201 is increased to more partial pupil areas. The present invention can also be applied to a plenoptic camera that divides.

[距離情報の推定方法]
図4は、撮像装置108における距離情報の導出方法を説明するための図である。被写体点401は、被写体上のある一点を表す。被写体面402は、メインレンズ201からメインレンズ201と垂直な方向に対して被写体点401と同距離にある、点の集合で表される面である。集光面403は、被写体面402上の各点から出た光がカメラ内で集光する点の集合で表される面である。ピント面404は、撮像装置108がピントを合わせた距離にある面である。マイクロレンズ面405は、マイクロレンズアレイ204が配置される面である。
[Distance information estimation method]
FIG. 4 is a diagram for explaining a method for deriving distance information in the imaging apparatus 108. A subject point 401 represents a certain point on the subject. The subject surface 402 is a surface represented by a set of points that are at the same distance as the subject point 401 in the direction perpendicular to the main lens 201 from the main lens 201. The condensing surface 403 is a surface represented by a set of points on which light emitted from each point on the object surface 402 is condensed in the camera. The focus surface 404 is a surface at a distance where the imaging apparatus 108 has focused. The microlens surface 405 is a surface on which the microlens array 204 is disposed.

距離情報の導出では、まず、撮像装置108により得られた複数視点画像(右視点画像と左視点画像)とのステレオマッチングにより、図4に示す画素ずれ量Bが導出される。ステレオマッチングには任意の方法を用いることができるが、例えば、右視点画像及び左視点画像を小ブロックに分割し、右視点画像の各小ブロックと最も相関の高い左視点画像の小ブロックを探索することで、画素ずれ量Bを算出できる。その後、画素ずれ量Bから、距離sが算出される。以下、画素ずれ量Bと距離sとの関係を示す。まず、レンズの公式である式(1)から、式(2)を導出できる。   In the derivation of the distance information, first, a pixel shift amount B shown in FIG. 4 is derived by stereo matching with a plurality of viewpoint images (right viewpoint image and left viewpoint image) obtained by the imaging device 108. Any method can be used for stereo matching. For example, the right viewpoint image and the left viewpoint image are divided into small blocks, and the small block of the left viewpoint image having the highest correlation with each small block of the right viewpoint image is searched. By doing so, the pixel shift amount B can be calculated. Thereafter, the distance s is calculated from the pixel shift amount B. Hereinafter, the relationship between the pixel shift amount B and the distance s is shown. First, equation (2) can be derived from equation (1), which is the lens formula.

ここで、iはメインレンズ201から集光面403までの距離(以下、像距離という)である。fはメインレンズの焦点距離である。像距離iは、図4に示される相似関係に基づいて、式(3)で表すことができる。   Here, i is a distance from the main lens 201 to the condensing surface 403 (hereinafter referred to as an image distance). f is the focal length of the main lens. The image distance i can be expressed by Expression (3) based on the similarity relationship shown in FIG.

ここで、Dは絞り径である。mは、メインレンズ201からマイクロレンズ面405までの距離(以下、マイクロレンズ距離という)である。マイクロレンズ距離mは、レンズの公式である式(4)を用いて、式(5)で表すことができる。   Here, D is the aperture diameter. m is a distance from the main lens 201 to the microlens surface 405 (hereinafter referred to as a microlens distance). The microlens distance m can be expressed by Expression (5) using Expression (4) which is a lens formula.

また、F値の定義から式(6)が成り立つ。   Moreover, Formula (6) is formed from the definition of F value.

式(1)〜(6)より、F値、メインレンズの焦点距離f、ピント距離pが事前に分かっていれば、距離sを算出することができる。具体的には、式(5)、(6)により算出したマイクロレンズ距離mと絞り径Dを式(3)に代入して像距離iを算出し、算出した像距離iを式(2)に代入することで、距離sを算出することができる。このようにして、距離sが距離情報として距離sが導出される。なお、式(1)〜(6)におけるs,f,D,i,m,p,Bの単位は全て同じとする(例えば、[mm])。ステレオマッチングにより算出できる画素ずれ量の単位は[pixel]である。したがって、ステレオマッチングにより算出できる画素ずれ量と、撮像素子208の画素ピッチμ[mm/pixel]との積を、画素ずれ量Bとして算出することで単位を揃える。   If the F value, the focal length f of the main lens, and the focus distance p are known in advance from the equations (1) to (6), the distance s can be calculated. Specifically, the image distance i is calculated by substituting the microlens distance m and the aperture diameter D calculated by the equations (5) and (6) into the equation (3), and the calculated image distance i is expressed by the equation (2). By substituting into, the distance s can be calculated. In this way, the distance s is derived using the distance s as distance information. Note that the units of s, f, D, i, m, p, and B in the equations (1) to (6) are all the same (for example, [mm]). The unit of the pixel shift amount that can be calculated by stereo matching is [pixel]. Therefore, the unit is aligned by calculating the product of the pixel shift amount that can be calculated by stereo matching and the pixel pitch μ [mm / pixel] of the image sensor 208 as the pixel shift amount B.

[画素ずれ量、F値、ボケ、距離情報の誤差の関係]
ステレオマッチングにより算出した画素ずれ量Bに誤差が含まれていると、距離情報にも誤差が生じる。図5は、式(1)〜(6)に従って、画素ずれ量Bの誤差と距離情報の誤差との関係を示した図である。具体的には、被写体距離1250.0[mm]、F値8.0として算出された画素ずれ量Bに誤差を付加して算出された距離(後述する距離s´)と、被写体距離1250.0[mm]との差をプロットした図である。図5に示すように、画素ずれ量Bの誤差が大きいほど、距離情報の誤差も大きくなる。画素ずれ量Bに誤差が含まれる要因の1つが、画像上のボケによるステレオマッチングの精度低下である。この精度低下は、例えば、画素ずれ量の誤差がボケの大きさに比例する場合には、画像上のボケを小さくすることで抑制できる。画像上のボケを小さくするには、F値を大きくすればよい。
[Relationship between pixel shift amount, F value, blur, and distance information error]
If the pixel shift amount B calculated by stereo matching includes an error, an error also occurs in the distance information. FIG. 5 is a diagram showing the relationship between the error of the pixel shift amount B and the error of distance information according to the equations (1) to (6). Specifically, a distance calculated by adding an error to the pixel shift amount B calculated as an object distance 1250.0 [mm] and an F value 8.0 (distance s ′ described later), and an object distance 1250. It is the figure which plotted the difference with 0 [mm]. As shown in FIG. 5, the error in the distance information increases as the error in the pixel shift amount B increases. One of the factors that include an error in the pixel shift amount B is a decrease in stereo matching accuracy due to blurring on the image. This decrease in accuracy can be suppressed, for example, by reducing the blur on the image when the error of the pixel shift amount is proportional to the size of the blur. In order to reduce the blur on the image, the F value may be increased.

図6は、式(1)〜(6)に従って、絞り径Dと距離情報の誤差との関係を示した図である。図6に示すように、画素ずれ量Bの誤差が同じでも、絞り径Dが小さい(基線長が短い)ほど、距離情報の誤差が大きくなる。距離情報の誤差を小さくするために、絞り径Dを大きくするには、F値を小さくすればよい。   FIG. 6 is a diagram showing the relationship between the aperture diameter D and the distance information error according to the equations (1) to (6). As shown in FIG. 6, even if the error of the pixel shift amount B is the same, the smaller the aperture diameter D (the shorter the base line length), the greater the error in distance information. In order to increase the aperture diameter D in order to reduce the error in the distance information, the F value may be decreased.

このように、画素ずれ量の誤差とボケの大きさとの関係によっては、画像上のボケを小さくし、かつ、絞り径Dを大きくすることで、距離情報の誤差を小さくすることができる。しかし、画像上のボケを小さくするにはF値を大きくしなければならい。一方、絞り径Dを大きくするにはF値を小さくしなければならない。つまり、画素ずれ量の誤差とボケの大きさとの関係によっては、ボケの大きさと絞り径Dとの間に、距離情報の精度に関するトレードオフが存在する。そこで、本実施例に係る画像処理装置は、このようなトレードオフを考慮して、距離情報の精度ができるだけ高くなるようなF値を算出する。   As described above, depending on the relationship between the error of the pixel shift amount and the size of the blur, the error in the distance information can be reduced by reducing the blur on the image and increasing the aperture diameter D. However, to reduce the blur on the image, the F value must be increased. On the other hand, to increase the aperture diameter D, the F value must be decreased. That is, depending on the relationship between the error of the pixel shift amount and the size of the blur, there is a trade-off regarding the accuracy of the distance information between the size of the blur and the aperture diameter D. Therefore, the image processing apparatus according to the present embodiment calculates the F value so that the accuracy of the distance information is as high as possible in consideration of such a trade-off.

[実施例1の処理の流れ]
画像処理装置100の処理を説明する。図7は、第1の実施例に係る画像処理装置100のソフトウェア構成を示すブロック図である。図7に示すように、画像処理装置100は、初期F値入力部701と、基線長算出部702と、ボケ量算出部703と、画素ずれ量誤差推定部704と、距離誤差推定部705と、F値決定部706とを含む。画像処理装置100は、これらの構成要素により、距離情報の推定に適したF値(以下、最適F値という)を算出する。
[Processing Flow of Example 1]
Processing of the image processing apparatus 100 will be described. FIG. 7 is a block diagram illustrating a software configuration of the image processing apparatus 100 according to the first embodiment. As illustrated in FIG. 7, the image processing apparatus 100 includes an initial F value input unit 701, a baseline length calculation unit 702, a blur amount calculation unit 703, a pixel shift amount error estimation unit 704, and a distance error estimation unit 705. F value determination unit 706. The image processing apparatus 100 calculates an F value (hereinafter referred to as an optimal F value) suitable for estimation of distance information using these components.

図8は、第1の実施例に係る画像処理装置100における最適F値の算出処理を示すフローチャートである。本実施例では、ROM103やHDD105に、図8に示す処理を司るプログラムが格納されていて、CPU101が、当該プログラムをロードして実行することにより、図7に示される各構成要素が機能する。   FIG. 8 is a flowchart illustrating the optimal F value calculation process in the image processing apparatus 100 according to the first embodiment. In this embodiment, the ROM 103 and the HDD 105 store a program for performing the processing shown in FIG. 8, and each component shown in FIG. 7 functions when the CPU 101 loads and executes the program.

ここでは、デジタルカメラに搭載された画像処理装置100を例にする。また、本実施例では、デジタルカメラが備える撮像制御装置(図示せず)によってプレ撮影が実行されると、画像処理装置100が、図8に示す処理を開始する。   Here, the image processing apparatus 100 mounted on the digital camera is taken as an example. In this embodiment, when pre-photographing is executed by an imaging control device (not shown) included in the digital camera, the image processing device 100 starts the processing shown in FIG.

ステップS801で、初期F値入力部701が、初期F値を入力する。初期F値としてどのような値を用いてもよいが、本実施例では、過去の距離推定において最適F値として選ばれる回数が多かったF値を初期F値として入力する。   In step S801, the initial F value input unit 701 inputs an initial F value. Although any value may be used as the initial F value, in this embodiment, an F value that has been frequently selected as the optimum F value in the past distance estimation is input as the initial F value.

ステップS802で、基線長算出部702が、基線長を算出する。基線長Lは、以下の式で算出する。   In step S802, the baseline length calculation unit 702 calculates the baseline length. The baseline length L is calculated by the following formula.

ここで、Dは絞り径であり、式(6)を用いて算出される。nはプレノプティックカメラの視点数であり、本実施例ではn=2である。   Here, D is the aperture diameter, and is calculated using Equation (6). n is the number of viewpoints of the plenoptic camera, and n = 2 in this embodiment.

ステップS803で、ボケ量算出部703が、ボケの大きさを算出する。本実施例では、ボケ量算出部703は、ボケの大きさとして、ボケの直径を算出する。ボケの直径rは以下の式で算出する。   In step S803, the blur amount calculation unit 703 calculates the size of the blur. In this embodiment, the blur amount calculation unit 703 calculates the blur diameter as the blur size. The blur diameter r is calculated by the following equation.

ここで、Dは絞り径であり、式(6)を用いて算出される。iは像距離であり、式(3)を用いて算出される。mはマイクロレンズ距離であり、式(5)を用いて算出される。nはプレノプティックカメラの視点数であり、本実施例ではn=2である。   Here, D is the aperture diameter, and is calculated using Equation (6). i is an image distance, and is calculated using Equation (3). m is the microlens distance, and is calculated using Equation (5). n is the number of viewpoints of the plenoptic camera, and n = 2 in this embodiment.

ステップS804で、画素ずれ量誤差推定部704が、画素ずれ量の誤差を推定する。画素ずれ量誤差推定部704の処理の詳細は後述する。   In step S804, the pixel shift amount error estimation unit 704 estimates a pixel shift amount error. Details of the processing of the pixel shift amount error estimation unit 704 will be described later.

ステップS805で、距離誤差推定部705が、距離情報の誤差を推定する。距離誤差推定部705の処理の詳細は後述する。   In step S805, the distance error estimation unit 705 estimates an error in distance information. Details of the processing of the distance error estimation unit 705 will be described later.

ステップS806で、F値決定部706が、ステップS805で推定した距離情報の誤差がより小さくなるようにF値を更新する。F値の更新には、任意の手法を用いることができるが、例えば、最急降下法を用いることができる。   In step S806, the F value determination unit 706 updates the F value so that the error in the distance information estimated in step S805 becomes smaller. An arbitrary method can be used to update the F value, for example, the steepest descent method can be used.

ステップS807で、F値決定部706が、F値の更新の終了判定を行う。終了判定には、任意の判定基準を用いてよい。例えば、F値の更新量があらかじめ決められたしきい値よりも小さくなった場合に更新を終了するようにしてもよい。   In step S807, the F value determination unit 706 determines whether or not to update the F value. An arbitrary determination criterion may be used for the end determination. For example, the update may be terminated when the F value update amount becomes smaller than a predetermined threshold value.

更新終了と判定された場合(ステップS807のYes)、画像処理装置100は処理を終える。このようにして、最適F値が算出される。   When it is determined that the update is finished (Yes in step S807), the image processing apparatus 100 finishes the process. In this way, the optimum F value is calculated.

更新終了と判定されなかった場合(ステップS807のNo)、画像処理装置100は、ステップS802に戻り、更新終了と判定されるまで、ステップS802〜S806の処理を繰り返す。なお、撮像装置108に設定可能なすべてのF値に対してステップS802〜S806の処理を繰り返しても、更新終了と判定されない場合には、ステップS805で推定した距離情報の誤差が最も小さいF値が、最適F値として算出される。   If it is not determined that the update has ended (No in step S807), the image processing apparatus 100 returns to step S802 and repeats the processes in steps S802 to S806 until it is determined that the update has ended. If it is not determined that the update is completed even if the processes in steps S802 to S806 are repeated for all the F values that can be set in the imaging apparatus 108, the F value with the smallest error in the distance information estimated in step S805 is used. Is calculated as the optimum F value.

F値決定部706は、算出した最適F値を、撮像装置108の撮像時におけるF値として決定する。   The F value determination unit 706 determines the calculated optimum F value as the F value at the time of image capturing by the image capturing apparatus 108.

[画素ずれ量誤差推定部704の処理の詳細]
画素ずれ量誤差推定部704は、現在のF値における画素ずれ量の誤差を推定する。画素ずれ量の誤差は、画素ずれ量の算出に用いられるステレオマッチング方式によって異なる。そこで、本実施例では、ボケの直径と画素ずれ量の誤差との関係をステレオマッチング方式に基づいて4つに分類した上でモデル化する。当該モデル化により生成された誤差推定情報(以下に示す式(9)〜(12)に相当)は、ROM103等の記憶部に格納される。画素ずれ量誤差推定部704は、誤差推定情報に基づいて、画素ずれ量の誤差を推定する。
[Details of Processing of Pixel Deviation Amount Error Estimating Unit 704]
The pixel shift amount error estimation unit 704 estimates an error of the pixel shift amount in the current F value. The error of the pixel shift amount differs depending on the stereo matching method used for calculating the pixel shift amount. Therefore, in the present embodiment, the relationship between the blur diameter and the pixel shift error is modeled after being classified into four based on the stereo matching method. Error estimation information (corresponding to equations (9) to (12) shown below) generated by the modeling is stored in a storage unit such as the ROM 103. The pixel shift amount error estimation unit 704 estimates a pixel shift amount error based on the error estimation information.

1つ目の分類は、画素ずれ量の誤差がボケの直径によらず一定の場合である。例えば、画素値ノイズや撮像装置の設計誤差などが無視できるほど小さい場合、この分類に含まれると考えることができる。なぜなら、ステレオマッチングの精度低下は、ボケによって被写体表面のテクスチャ情報が失われ、誤差要因の影響が相対的に大きくなることから発生すると考えられるからである。すなわち、誤差要因が無視できる場合、ステレオマッチングの精度は低下しないと考えられる。この分類においては、画素ずれ量の誤差eは、以下の式で算出される。   The first classification is a case where the error of the pixel shift amount is constant regardless of the blur diameter. For example, when the pixel value noise and the design error of the imaging device are so small that they can be ignored, it can be considered that they are included in this classification. This is because the stereo matching accuracy degradation is considered to occur because the texture information on the surface of the subject is lost due to the blur and the influence of the error factor becomes relatively large. That is, when the error factor can be ignored, it is considered that the accuracy of stereo matching does not decrease. In this classification, the error e of the pixel shift amount is calculated by the following equation.

ここで、αは任意の定数である。なお、画素ずれ量の誤差eは、本来画素ごとに異なる値をとるが、本実施例では、その中の代表値として、ある1つの値を設定するものとする。   Here, α is an arbitrary constant. Note that the pixel shift amount error e originally takes a different value for each pixel, but in this embodiment, a certain value is set as a representative value.

2つ目の分類は、画素ずれ量の誤差がボケの直径に比例する場合である。一般的なステレオマッチング(例えば、ブロック間の相関計算にSum of Absolute Differenceを使う方式)は、この分類に含まれると考えることができる。この分類においては、画素ずれ量の誤差eは、以下の式で算出される。   The second classification is a case where the error of the pixel shift amount is proportional to the blur diameter. General stereo matching (for example, a scheme using Sum of Absolute Difference for calculating correlation between blocks) can be considered to be included in this classification. In this classification, the error e of the pixel shift amount is calculated by the following equation.

ここで、kは任意の比例定数、rはボケの直径である。   Here, k is an arbitrary proportional constant, and r is a blur diameter.

3つ目の分類は、ボケの直径が大きくなるに従って、画素ずれ量の誤差が2つ目の分類よりも急激に大きくなる場合である。例えば、ブロック間の相関計算にSum of Squared Differenceを使うなど、誤差要因に対するロバスト性を犠牲にして、精度をより重視したステレオマッチング方式は、この分類に含まれると考えることができる。この分類においては、画素ずれ量の誤差eは、以下の式で算出される。   The third classification is a case where the error of the pixel shift amount increases more rapidly than the second classification as the blur diameter increases. For example, a stereo matching method that emphasizes accuracy at the expense of robustness against error factors, such as using Sum of Squared Difference for the correlation calculation between blocks, can be considered to be included in this classification. In this classification, the error e of the pixel shift amount is calculated by the following equation.

ここで、βは任意の累乗根である。   Here, β is an arbitrary power root.

4つ目の分類は、ボケの直径があらかじめ決められたしきい値を超えると、画素ずれ量の誤差が急激に大きくなる場合である。例えば、画素ずれ量を算出する際のブロックサイズがボケの直径に関わらず一定であるようなステレオマッチング方式は、この分類に含まれると考えることができる。この分類においては、画素ずれ量の誤差eは、以下の式で算出される。   The fourth classification is a case where the error of the pixel shift amount increases rapidly when the diameter of the blur exceeds a predetermined threshold value. For example, a stereo matching method in which the block size for calculating the pixel shift amount is constant regardless of the blur diameter can be considered to be included in this classification. In this classification, the error e of the pixel shift amount is calculated by the following equation.

ここで、zは任意のしきい値である。なお、本実施例では、画素ずれ量誤差推定部704は、式(9)〜(12)のいずれの式を用いるかを、デジタルカメラに設定されているステレオマッチング方式に基づいて決定する。例えば、デジタルカメラが複数のステレオマッチング方式に対応している場合には、各ステレオマッチング方式に対応する誤差推定情報が、ROM103等の記憶部に予め格納される。画素ずれ量誤差推定部704は、ユーザが選択したステレオマッチング方式を判定し、判定結果に基づいて、いずれの誤差推定情報を用いるかを決定する。また、画素ずれ量誤差推定部704は、画素ずれ量の誤差に対する画素値ノイズや撮像装置の設計誤差などによる影響が小さいことが予め分かっている場合には、ユーザが選択したステレオマッチング方式によらずに、誤差推定情報として式(9)を用いると決定する。   Here, z is an arbitrary threshold value. In this embodiment, the pixel shift amount error estimation unit 704 determines which one of the equations (9) to (12) is used based on the stereo matching method set in the digital camera. For example, when the digital camera supports a plurality of stereo matching methods, error estimation information corresponding to each stereo matching method is stored in advance in a storage unit such as the ROM 103. The pixel shift amount error estimation unit 704 determines the stereo matching method selected by the user, and determines which error estimation information to use based on the determination result. In addition, when it is known in advance that the pixel deviation amount error estimation unit 704 has a small influence on the pixel deviation amount due to pixel value noise, the design error of the imaging apparatus, or the like, the pixel deviation amount estimation unit 704 uses the stereo matching method selected by the user. Without using equation (9) as the error estimation information, it is determined.

また、本実施例では、ボケの直径と画素ずれ量の誤差との関係をモデル化しているが、F値と画素ずれ量の誤差との関係をモデル化してもよい。すなわち、F値から画素ずれ量の大きさを推定可能な誤差推定情報を、ROM103等の記憶部に予め格納させてもよい。そのような形態によれば、ボケ量を算出する必要がなくなり画像処理装置100の構成および処理を簡略化することができる。また、本実施例では、ボケの直径と画素ずれ量の誤差との関係を4つに分類しているが、5つ以上に分類してもよい。また、画素ずれ量誤差推定部704は、上記方法に限定されず、任意の方法で画素ずれ量の誤差を推定してかまわない。   In this embodiment, the relationship between the blur diameter and the pixel shift amount error is modeled. However, the relationship between the F value and the pixel shift amount error may be modeled. That is, error estimation information that can estimate the magnitude of the pixel shift amount from the F value may be stored in advance in a storage unit such as the ROM 103. According to such a form, it is not necessary to calculate the amount of blur, and the configuration and processing of the image processing apparatus 100 can be simplified. Further, in this embodiment, the relationship between the blur diameter and the pixel shift amount error is classified into four, but may be classified into five or more. In addition, the pixel shift amount error estimation unit 704 is not limited to the above method, and the pixel shift amount error may be estimated by an arbitrary method.

[距離誤差推定部705の処理の詳細]
距離誤差推定部705は、基線長L、画素ずれ量の誤差e、被写体距離sから、距離情報の誤差dを推定する。ここで、基線長Lについては基線長算出部702が算出した値を利用する。また、画素ずれ量の誤差eについては画素ずれ量誤差推定部704が推定した値を利用する。また、被写体距離sについては、前述のプレ撮影によって取得した画像から推定した距離情報の他、Time of Flightなどの手法によって算出した距離情報を利用してもよい。なお、被写体距離sを算出する対象の被写体(以下、重要被写体という)を選択する方法は任意である。例えば、撮影画角の中央付近にある被写体を重要被写体として選択してもよい。本実施例では、被写体距離sは、最終的に算出する距離情報ではなく、距離情報の誤差を見積もるために利用するものなので、必ずしも高精度である必要はない。
[Details of Processing of Distance Error Estimation Unit 705]
The distance error estimation unit 705 estimates the distance information error d from the baseline length L, the pixel shift amount error e, and the subject distance s. Here, for the baseline length L, the value calculated by the baseline length calculation unit 702 is used. For the pixel shift amount error e, the value estimated by the pixel shift amount error estimation unit 704 is used. For the subject distance s, distance information calculated by a method such as Time of Flight may be used in addition to the distance information estimated from the image acquired by the above-described pre-shooting. Note that a method of selecting a target subject (hereinafter referred to as an important subject) for calculating the subject distance s is arbitrary. For example, a subject near the center of the shooting angle of view may be selected as an important subject. In the present embodiment, the subject distance s is not necessarily the distance information to be finally calculated, but is used for estimating an error in the distance information, and therefore does not necessarily have to be highly accurate.

距離sにある被写体の画素ずれ量Bは以下の式で算出できる。   The pixel shift amount B of the subject at the distance s can be calculated by the following equation.

ここで、Dは絞り径である。iは像距離であって、式(1)により算出される。mはマイクロレンズ距離であって、式(5)により算出される。なお、プレ撮影によって取得した画像から推定した距離情報を利用する場合には、被写体距離sの算出過程において、ステレオマッチングにより画素ずれ量Bが算出されるので、式(13)による画素ずれ量Bの算出は行われない。   Here, D is the aperture diameter. i is an image distance, and is calculated by the equation (1). m is a microlens distance, and is calculated by the equation (5). Note that, when using the distance information estimated from the image acquired by the pre-photographing, the pixel shift amount B is calculated by stereo matching in the calculation process of the subject distance s. Is not calculated.

一方、画素ずれ量誤差推定部704によって推定した誤差eが画素ずれ量に含まれる場合、画素ずれ量B´は以下の式のようになる。   On the other hand, when the error e estimated by the pixel shift amount error estimation unit 704 is included in the pixel shift amount, the pixel shift amount B ′ is expressed by the following equation.

画素ずれ量B´を用いて推定した距離s´は、以下の式で算出できる。   The distance s ′ estimated using the pixel shift amount B ′ can be calculated by the following equation.

よって、距離情報の誤差dは以下の式によって推定することができる。   Therefore, the error d of the distance information can be estimated by the following equation.

以下、距離情報の誤差dを推定する手順をまとめる。   The procedure for estimating the distance information error d will be summarized below.

まず、距離誤差推定部705は、F値から、基線長とボケの直径とを算出する。次に、距離誤差推定部705は、式(9)〜(12)を用いて、ボケの直径から画素ずれ量の誤差を算出する。最後に、距離誤差推定部705は、式(13)〜(16)を用いて、距離情報の誤差dを推定する。   First, the distance error estimation unit 705 calculates a baseline length and a blur diameter from the F value. Next, the distance error estimation unit 705 calculates an error of the pixel shift amount from the blur diameter using the equations (9) to (12). Finally, the distance error estimation unit 705 estimates the error d of the distance information using the equations (13) to (16).

なお、上記では重要被写体を1つ選択し、重要被写体における距離情報の誤差を算出したが、これに限定されない。重要被写体を複数選択し、それら複数の重要被写体における距離情報の誤差の平均値を、式(16)における距離情報の誤差dとして算出してもよい。   In the above description, one important subject is selected and the error of the distance information in the important subject is calculated. However, the present invention is not limited to this. A plurality of important subjects may be selected, and an average value of distance information errors in the plurality of important subjects may be calculated as the distance information error d in Equation (16).

[実施例1の効果]
ボケの直径と画素ずれ量の誤差の関係の4分類それぞれについて、算出した最適F値による距離情報の誤差と、F値1.0〜32.0で算出した距離情報の誤差の平均値とを比較することで、本実施例の効果を示す。なお、以下では、f=50.0,p=1000.0,s=1250.0として、距離情報の誤差を算出した。
[Effect of Example 1]
For each of the four categories of the relationship between the blur diameter error and the pixel deviation amount error, the distance information error calculated by the optimum F value and the average value of the distance information error calculated by the F value of 1.0 to 32.0. By comparing, the effect of the present embodiment is shown. In the following, the error of distance information is calculated with f = 50.0, p = 1000.0, and s = 1250.0.

図9は、1つ目の分類(画素ずれ量の誤差がボケの直径によらず一定の場合)におけるF値と距離情報の誤差との関係を示す図である。図9に示される最適F値=1.0(図9において破線の丸で囲った部分)における距離情報の誤差は、次のように算出される。まず、Time of Flightなどの手法により被写体距離s=1250.0が算出される。次いで、距離s´が式(15)から算出される。式(15)から距離s´を算出する際に必要となる、B´(=B+e)は、式(13)から算出されるBを用いて算出される。なお、ここでは、誤差eを0.03とする。式(13)からBを算出する際に必要となるL,m,iは、それぞれ、式(7),式(5),式(1)から算出される。このようにして、距離s´が1251.9と算出される。式(17)より、距離情報の誤差dは、1.9[mm]と算出される。このように、最適F値=1.0における距離情報の誤差=1.9[mm]は、全F値における距離情報の誤差の平均値31.6[mm]と比べて小さく、最適F値で算出される距離情報が高精度であることがわかる。   FIG. 9 is a diagram illustrating the relationship between the F value and the distance information error in the first classification (when the error of the pixel shift amount is constant regardless of the blur diameter). The error of the distance information at the optimum F value shown in FIG. 9 = 1.0 (the portion surrounded by a broken-line circle in FIG. 9) is calculated as follows. First, the subject distance s = 1250.0 is calculated by a method such as Time of Flight. Next, the distance s ′ is calculated from the equation (15). B ′ (= B + e) required when calculating the distance s ′ from the equation (15) is calculated using B calculated from the equation (13). Here, the error e is 0.03. L, m, and i required when calculating B from Expression (13) are calculated from Expression (7), Expression (5), and Expression (1), respectively. In this way, the distance s ′ is calculated as 1251.9. From equation (17), the error d in the distance information is calculated as 1.9 [mm]. Thus, the error of distance information = 1.9 [mm] at the optimum F value = 1.0 is smaller than the average value 31.6 [mm] of the error of distance information at all F values, and the optimum F value It can be seen that the distance information calculated by is highly accurate.

図10は、2つ目の分類(画素ずれ量の誤差がボケの直径に比例する場合)におけるF値と距離情報の誤差との関係を示す図である。図10に示されるように、本分類では、F値によらず距離情報の誤差が一定となる。このことから、本分類に含まれるステレオマッチングを行う場合は、任意のF値で撮影を行っても構わないことが分かる。   FIG. 10 is a diagram illustrating a relationship between the F value and the error of distance information in the second classification (when the error of the pixel shift amount is proportional to the blur diameter). As shown in FIG. 10, in this classification, the error of the distance information is constant regardless of the F value. From this, it is understood that when performing stereo matching included in this classification, photographing may be performed with an arbitrary F value.

図11は、3つ目の分類(ボケの直径が大きくなるに従って、画素ずれ量の誤差が2つ目の分類よりも急激に大きくなる場合)におけるF値と距離情報の誤差との関係を示す図である。図11に示されるように、最適F値=32.0(図11において破線の丸で囲った部分)における距離情報の誤差は79.7[mm]であり、全F値における距離情報の誤差の平均値である88.3[mm]と比べて、高精度となっている。   FIG. 11 shows the relationship between the F value and the distance information error in the third classification (when the error in pixel shift increases more rapidly than in the second classification as the diameter of the blur increases). FIG. As shown in FIG. 11, the error of the distance information at the optimum F value = 32.0 (the portion surrounded by the broken-line circle in FIG. 11) is 79.7 [mm], and the error of the distance information in all the F values Compared with the average value of 88.3 [mm], the accuracy is high.

図12は、4つ目の分類(ボケの直径があらかじめ決められたしきい値を超えると、画素ずれ量の誤差が急激に大きくなる場合)におけるF値と距離情報の誤差との関係を示す図である。ここで、しきい値は3.0[pixel]とした。図12に示されるように、最適F値=8.0(図12において破線の丸で囲った部分)における距離情報の誤差は15.0[mm]であり、全F値における距離情報の誤差の平均値である69.1[mm]と比べて、高精度となっている。   FIG. 12 shows the relationship between the F value and the distance information error in the fourth classification (when the blur diameter exceeds a predetermined threshold value, the error of the pixel shift amount increases rapidly). FIG. Here, the threshold value was set to 3.0 [pixel]. As shown in FIG. 12, the error of the distance information at the optimum F value = 8.0 (the portion surrounded by the broken-line circle in FIG. 12) is 15.0 [mm], and the error of the distance information in all the F values Compared to the average value of 69.1 [mm], the accuracy is high.

なお、上記では、メインレンズ201の焦点面上にマイクロレンズアレイ204を配置するプレノプティックカメラを例に説明を行ったが、撮像装置108の構成はこれに限定されない。したがって、本発明は、マイクロレンズアレイ204によってメインレンズ201の各領域を通る光を別々の画素に受光させる任意の撮像装置に適用可能である。例えば、本発明は、図13に示されるような、マイクロレンズアレイ204に対してメインレンズ201の焦点面1301と撮像素子208とが共役な位置となるようにマイクロレンズアレイ204を配置したプレノプティックカメラにも適用可能である。図13に示すプレノプティックカメラで撮像した画像も、図3に示すプレノプティックカメラのように、左右視点画像への変換が可能であり、この左右視点画像に前述と同様の処理を施すことで、距離情報を推定することができる。なお、図13に示すプレノプティックカメラの撮像データを左右視点画像に変換する方法については、本発明の主眼ではないため、説明を省略する。   In the above description, the plenoptic camera in which the microlens array 204 is disposed on the focal plane of the main lens 201 has been described as an example. However, the configuration of the imaging device 108 is not limited thereto. Therefore, the present invention can be applied to an arbitrary imaging device in which light passing through each region of the main lens 201 is received by separate pixels by the microlens array 204. For example, in the present invention, as shown in FIG. 13, the microlens array 204 is arranged so that the focal plane 1301 of the main lens 201 and the image sensor 208 are conjugate to the microlens array 204. It can also be applied to optic cameras. The image picked up by the plenoptic camera shown in FIG. 13 can be converted into a left and right viewpoint image like the plenoptic camera shown in FIG. 3, and the same processing as described above is applied to this left and right viewpoint image. By applying, distance information can be estimated. Note that the method of converting the imaging data of the plenoptic camera shown in FIG. 13 into the left and right viewpoint images is not the main point of the present invention, and thus the description thereof is omitted.

また、上記では、プレ撮影やTime of Flightなどの手法によって取得した距離の概算を利用して距離情報の誤差を見積もり、その距離情報の誤差から距離情報の推定に適したF値(最適F値)を算出したが、最適F値の算出方法はこれに限定されない。図9〜12に示すように、ボケの直径と画素ずれ量の誤差との関係をモデル化できれば、距離情報の推定に適したF値が分かる。そこで、距離情報の概算や距離情報の誤差の見積もりを行わずに、ボケの直径と画素ずれ量の誤差との関係のモデルから直接、最適F値を算出してもよい。   In the above, the distance information error is estimated by using the distance estimation obtained by the pre-photographing method or the Time of Flight method, and the F value (optimum F value) suitable for the distance information estimation from the distance information error. ) Is calculated, but the method of calculating the optimum F value is not limited to this. As shown in FIGS. 9 to 12, if the relationship between the blur diameter and the pixel shift amount error can be modeled, an F value suitable for estimating the distance information can be obtained. Therefore, the optimum F value may be calculated directly from the model of the relationship between the blur diameter and the pixel shift amount error without estimating the distance information or estimating the error of the distance information.

また、撮影モードの中に「距離推定モード」を設け、画像処理装置100は、撮影モードが距離推定モードである時のみ、上記の処理を行うようにしてもよい。   Further, a “distance estimation mode” may be provided in the shooting mode, and the image processing apparatus 100 may perform the above processing only when the shooting mode is the distance estimation mode.

以上述べたように、本実施例では、ボケの大きさと画素ずれ量の誤差との関係をモデル化する。そして、その関係に基づいて、画素ずれ量の誤差が最小となるF値を算出する。それにより、距離情報の精度ができるだけ高くなるようなF値を算出することができる。   As described above, in the present embodiment, the relationship between the blur size and the pixel shift amount error is modeled. Then, based on the relationship, an F value that minimizes the error of the pixel shift amount is calculated. Thereby, it is possible to calculate the F value so that the accuracy of the distance information is as high as possible.

[実施例2]
第1の実施例では、ボケの大きさと画素ずれ量の誤差との関係をモデル化し、当該関係に基づいて、最適F値を探索した。第2の実施例では、画像処理装置が、ボケの大きさ、画素ずれ量の誤差、F値、距離情報の誤差などのパラメータ間の関係をテーブルとして、ROM103等の記憶部に予め記憶する。そして、画像処理装置は、上記テーブルを参照して、距離情報の誤差を算出することで、最適F値を算出する。上記テーブルは、例えば、過去の距離推定において得られた、各パラメータ間の関係に基づいて作成される。なお、ROM103等には、ステレオマッチング方式のそれぞれに対応するテーブルが記憶されていてもよい。
[Example 2]
In the first embodiment, the relationship between the blur size and the pixel shift error is modeled, and the optimum F value is searched based on the relationship. In the second embodiment, the image processing apparatus stores in advance in a storage unit such as the ROM 103 as a table the relationship between parameters such as blur size, pixel shift error, F value, and distance information error. Then, the image processing apparatus calculates the optimum F value by calculating the error of the distance information with reference to the table. The table is created based on, for example, the relationship between parameters obtained in past distance estimation. The ROM 103 or the like may store a table corresponding to each stereo matching method.

図14は、ボケの直径と画素ずれ量の誤差の関係を示すテーブルの例である。本実施例における画素ずれ量誤差推定部704は、上記テーブルを参照して、画素ずれ量の誤差を算出する。なお、本実施例におけるその他の処理は、第1の実施例と同様であるため、説明を省略する。   FIG. 14 is an example of a table showing the relationship between the blur diameter and the pixel shift amount error. The pixel shift amount error estimation unit 704 in the present embodiment calculates a pixel shift amount error with reference to the table. The other processes in the present embodiment are the same as those in the first embodiment, and a description thereof will be omitted.

このように、本実施例では、画素ずれ量誤差推定部704が、ROM103等に記憶された上記テーブルを参照して、ボケの大きさから画素ずれ量の誤差を算出する。ボケの大きさと画素ずれ量の誤差との関係をテーブルとして保持しておくことにより、図8に示されるような最適F値の探索処理をする必要がなくなり、最適F値の導出に要する処理時間を短縮することができる。また、ボケの大きさと画素ずれ量の誤差との関係をテーブルとして保持しておくことにより、ボケの大きさと画素ずれ量の誤差とをモデル化困難な場合においても、距離情報の精度をより高くするようなF値を算出することができる。   As described above, in this embodiment, the pixel shift amount error estimation unit 704 refers to the table stored in the ROM 103 or the like, and calculates the pixel shift amount error from the size of the blur. By storing the relationship between the blur size and the pixel shift amount as a table, it is not necessary to search for the optimum F value as shown in FIG. 8, and the processing time required to derive the optimum F value is as follows. Can be shortened. Also, by maintaining the relationship between blur size and pixel shift error as a table, even when it is difficult to model the blur size and pixel shift error, the accuracy of distance information is increased. The F value can be calculated.

なお、上記では、ボケの大きさと画素ずれ量の誤差の関係を示すテーブルを用いたが、距離情報の誤差の算出に用いるテーブルはこれに限定されず、任意のテーブルを用いることができる。例えば、F値と画素ズレ量の誤差との関係を示すテーブル、F値と距離情報の誤差との関係を示すテーブルを用いて、最適F値を算出してもよい。そのような形態によれば、F値から直接、画素ズレ量の誤差や距離情報の誤差を推定することができるので、最適F値の導出に要する処理時間をさらに短縮することができる。   In the above description, a table indicating the relationship between the blur size and the pixel shift error is used. However, the table used for calculating the error of the distance information is not limited to this, and an arbitrary table can be used. For example, the optimal F value may be calculated using a table indicating the relationship between the F value and the error in the pixel shift amount, and a table indicating the relationship between the F value and the error in the distance information. According to such a configuration, it is possible to estimate the error of the pixel shift amount and the error of the distance information directly from the F value, so that it is possible to further reduce the processing time required to derive the optimum F value.

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

704 画素ずれ量誤差推定部
705 距離誤差推定部
706 F値決定部
704 Pixel shift amount error estimation unit 705 Distance error estimation unit 706 F value determination unit

Claims (12)

プレノプティック方式の撮像装置の撮像時におけるF値を決定する画像処理装置であって、
入力される任意のF値から、前記撮像装置によって得られる複数視点画像から導出される被写体との距離の誤差を推定する誤差推定手段と、
前記誤差推定手段に入力するF値を更新しながら、前記誤差推定手段によって推定される前記被写体との距離の誤差を最小にするF値を、前記撮像装置に設定可能なF値の中から探索し、探索したF値を前記撮像装置の撮像時におけるF値として決定するF値決定手段と、を備える
ことを特徴とする画像処理装置。
An image processing apparatus for determining an F value at the time of imaging by a plenoptic imaging apparatus,
Error estimation means for estimating an error of a distance from a subject derived from a plurality of viewpoint images obtained by the imaging device from an arbitrary F value input;
While updating the F value input to the error estimation unit, search for an F value that minimizes an error in distance to the subject estimated by the error estimation unit from among F values that can be set in the imaging apparatus. And an F value determining means for determining the searched F value as an F value at the time of image capturing by the image capturing apparatus.
前記誤差推定手段は、
入力される任意のF値から、前記撮像装置によって得られる複数視点画像の画素ずれ量の誤差を推定し、
前記推定した画素ずれ量の誤差から、前記複数視点画像から導出される被写体との距離の誤差を推定する
請求項1に記載の画像処理装置。
The error estimation means includes
From an arbitrary F value that is input, an error of the pixel shift amount of the multi-viewpoint image obtained by the imaging device is estimated,
The image processing apparatus according to claim 1, wherein an error in a distance from a subject derived from the multi-viewpoint image is estimated from an error in the estimated pixel shift amount.
入力される任意のF値から、前記撮像装置によって得られる複数視点画像におけるボケの大きさを算出するボケ量算出手段と、
前記複数視点画像におけるボケの大きさから画素ずれ量の誤差を推定可能な誤差推定情報を記憶する記憶手段と、を備え、
前記誤差推定手段は、
前記記憶手段が記憶する前記誤差推定情報を用いて、前記ボケ量算出手段が算出したボケの大きさから画素ずれ量の誤差を推定する
請求項2に記載の画像処理装置。
A blur amount calculating means for calculating a blur size in a plurality of viewpoint images obtained by the imaging device from an arbitrary F value input;
Storage means for storing error estimation information capable of estimating an error of a pixel shift amount from the size of blur in the plurality of viewpoint images,
The error estimation means includes
The image processing apparatus according to claim 2, wherein an error of a pixel shift amount is estimated from a blur size calculated by the blur amount calculation unit using the error estimation information stored in the storage unit.
前記誤差推定情報は、
画素ずれ量の導出に用いられるステレオマッチングの方式に基づいてモデル化した、ボケの大きさと画素ずれ量の誤差との関係を示す式である
請求項3に記載の画像処理装置。
The error estimation information is
The image processing apparatus according to claim 3, wherein the image processing apparatus is a formula representing a relationship between a blur size and an error of a pixel shift amount modeled based on a stereo matching method used for deriving a pixel shift amount.
F値から画素ずれ量の誤差を推定可能な誤差推定情報を記憶する記憶手段を備え、
前記誤差推定手段は、
前記記憶手段が記憶する前記誤差推定情報を用いて、入力される任意のF値から画素ずれ量の誤差を推定する
請求項2に記載の画像処理装置。
Storage means for storing error estimation information capable of estimating the error of the pixel shift amount from the F value;
The error estimation means includes
The image processing apparatus according to claim 2, wherein an error of a pixel shift amount is estimated from an arbitrary input F value using the error estimation information stored in the storage unit.
前記誤差推定情報は、
画素ずれ量の導出に用いるステレオマッチングの方式に基づいてモデル化した、F値と画素ずれ量の誤差との関係を示す式である
請求項5に記載の画像処理装置。
The error estimation information is
The image processing apparatus according to claim 5, wherein the image processing apparatus is an expression indicating a relationship between an F value and an error of a pixel shift amount modeled based on a stereo matching method used for deriving the pixel shift amount.
前記記憶手段は、複数の誤差推定情報を記憶し、
前記誤差推定手段は、
前記複数の誤差推定情報のうち、画素ずれ量の導出に用いるステレオマッチングの方式に対応する誤差推定情報に基づいて、画素ずれ量の誤差を推定する
請求項3から請求項6のいずれか1項に記載の画像処理装置。
The storage means stores a plurality of error estimation information,
The error estimation means includes
The error of the pixel shift amount is estimated based on error estimation information corresponding to a stereo matching method used for derivation of the pixel shift amount among the plurality of error estimation information. An image processing apparatus according to 1.
前記誤差推定手段は、
前記複数視点画像をステレオマッチングして導出される画素ずれ量を用いて、前記被写体との距離を示す第1の被写体距離を導出し、
前記複数視点画像をステレオマッチングして導出される画素ずれ量に、前記推定した画素ずれ量の誤差を付加した値を用いて、前記被写体との距離を示す第2の被写体距離を導出し、
前記第1の被写体距離と前記第2の被写体距離との差を、前記被写体との距離の誤差であると推定する
請求項2から請求項7のうちのいずれか1項に記載の画像処理装置。
The error estimation means includes
Using a pixel shift amount derived by stereo-matching the multi-viewpoint images, deriving a first subject distance indicating a distance from the subject;
Using a value obtained by adding an error of the estimated pixel shift amount to a pixel shift amount derived by stereo matching of the multiple viewpoint images, a second subject distance indicating a distance from the subject is derived,
The image processing apparatus according to claim 2, wherein a difference between the first subject distance and the second subject distance is estimated as an error in the distance to the subject. .
プレノプティック方式の撮像装置の撮像時におけるF値を決定する画像処理装置であって、
前記撮像装置に設定可能な各F値と、前記各F値を設定した前記撮像装置によって得られる、複数視点画像から導出される被写体との距離の誤差との対応を示すテーブルを記憶する記憶手段と、
前記記憶手段が記憶する前記テーブルを参照して、前記被写体との距離の誤差を最小にするF値を判定し、判定して得られたF値を前記撮像装置の撮像時におけるF値として決定するF値決定手段と、を備える
ことを特徴とする画像処理装置。
An image processing apparatus for determining an F value at the time of imaging by a plenoptic imaging apparatus,
Storage means for storing a table indicating correspondence between each F value that can be set in the imaging apparatus and an error in distance from a subject derived from a plurality of viewpoint images, which is obtained by the imaging apparatus in which each F value is set When,
With reference to the table stored in the storage means, an F value that minimizes an error in distance to the subject is determined, and the F value obtained by the determination is determined as an F value at the time of image capturing by the image capturing apparatus. An image processing apparatus comprising: an F value determination unit that performs the processing.
前記記憶手段は、複数の前記テーブルを保持し、
前記F値決定手段は、
前記記憶手段が記憶する複数の前記テーブルのうち、前記被写体との距離を導出する際に用いられるステレオマッチングの方式に対応するテーブルを参照して、前記被写体との距離の誤差を最小にするF値を判定する
請求項9に記載の画像処理装置。
The storage means holds a plurality of the tables,
The F value determining means includes
Of the plurality of tables stored in the storage means, refer to a table corresponding to a stereo matching method used when deriving the distance to the subject, and minimize an error in the distance to the subject. The image processing apparatus according to claim 9, wherein a value is determined.
プレノプティック方式の撮像装置の撮像時におけるF値を決定する画像処理方法であって、
任意のF値から、前記撮像装置によって得られる複数視点画像から導出される被写体との距離の誤差を推定する誤差推定ステップと、
F値を更新しながら、前記誤差推定ステップを繰り返して、前記撮像装置に設定可能なF値のうち、前記誤差推定ステップにおいて推定される前記被写体との距離の誤差を最小にするF値を探索し、探索したF値を前記撮像装置の撮像時におけるF値として決定するF値決定ステップと、を含む
ことを特徴とする画像処理方法。
An image processing method for determining an F value at the time of imaging by a plenoptic imaging device,
An error estimation step of estimating an error of a distance from a subject derived from a plurality of viewpoint images obtained by the imaging device from an arbitrary F value;
While updating the F value, the error estimation step is repeated, and among the F values that can be set in the imaging apparatus, an F value that minimizes the error in the distance to the subject estimated in the error estimation step is searched for And an F value determination step of determining the searched F value as an F value at the time of imaging by the imaging apparatus.
コンピュータを、請求項1から請求項10のうちのいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the image processing apparatus of any one of Claims 1-10.
JP2016020287A 2016-02-04 2016-02-04 Image processing device, image processing method, and program Pending JP2017138240A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016020287A JP2017138240A (en) 2016-02-04 2016-02-04 Image processing device, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016020287A JP2017138240A (en) 2016-02-04 2016-02-04 Image processing device, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2017138240A true JP2017138240A (en) 2017-08-10

Family

ID=59564813

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016020287A Pending JP2017138240A (en) 2016-02-04 2016-02-04 Image processing device, image processing method, and program

Country Status (1)

Country Link
JP (1) JP2017138240A (en)

Similar Documents

Publication Publication Date Title
US10269130B2 (en) Methods and apparatus for control of light field capture object distance adjustment range via adjusting bending degree of sensor imaging zone
US9501834B2 (en) Image capture for later refocusing or focus-manipulation
WO2019105214A1 (en) Image blurring method and apparatus, mobile terminal and storage medium
US9619886B2 (en) Image processing apparatus, imaging apparatus, image processing method and program
US8144974B2 (en) Image processing apparatus, method, and program
JP6415179B2 (en) Image processing apparatus, image processing method, imaging apparatus, and control method thereof
CN105659580A (en) A kind of automatic focusing method, device and electronic equipment
US11032533B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP5776771B2 (en) Corresponding point search device and distance measurement device
JP6071257B2 (en) Image processing apparatus, control method therefor, and program
JP2016152027A (en) Image processing device, image processing method and program
JP6395429B2 (en) Image processing apparatus, control method thereof, and storage medium
JP6655869B2 (en) Image processing apparatus, image processing method, and program
JP6305232B2 (en) Information processing apparatus, imaging apparatus, imaging system, information processing method, and program.
JP2009047498A (en) Stereoscopic imaging device, stereoscopic imaging device control method, and program
KR20150097251A (en) Camera alignment method using correspondences between multi-images
CN106973199B (en) Multi-aperture camera system using focus distance scanning to improve depth accuracy
JP5769248B2 (en) Stereo matching processing device, stereo matching processing method, and program
JP6602412B2 (en) Information processing apparatus and method, information processing system, and program.
CN107592455B (en) Shallow depth of field effect imaging method and device and electronic equipment
JP2017138240A (en) Image processing device, image processing method, and program
JP2019083580A (en) Image processing apparatus, image processing method, and program
KR102061087B1 (en) Method, apparatus and program stored in storage medium for focusing for video projector
Srivastava et al. Design and implementation of a real-time autofocus algorithm for thermal imagers
JP2009237652A (en) Image processing apparatus and method, and program