JP2015122669A - Image processing system, control method of the same, and program - Google Patents

Image processing system, control method of the same, and program Download PDF

Info

Publication number
JP2015122669A
JP2015122669A JP2013266127A JP2013266127A JP2015122669A JP 2015122669 A JP2015122669 A JP 2015122669A JP 2013266127 A JP2013266127 A JP 2013266127A JP 2013266127 A JP2013266127 A JP 2013266127A JP 2015122669 A JP2015122669 A JP 2015122669A
Authority
JP
Japan
Prior art keywords
image
image processing
parallax
light source
parallax images
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2013266127A
Other languages
Japanese (ja)
Other versions
JP6381206B2 (en
JP2015122669A5 (en
Inventor
木村 正史
Masashi Kimura
正史 木村
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 JP2013266127A priority Critical patent/JP6381206B2/en
Publication of JP2015122669A publication Critical patent/JP2015122669A/en
Publication of JP2015122669A5 publication Critical patent/JP2015122669A5/ja
Application granted granted Critical
Publication of JP6381206B2 publication Critical patent/JP6381206B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)
  • Color Television Image Signal Generators (AREA)
  • Studio Devices (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a method of precisely estimating a light source color by a simple constitution.SOLUTION: The method acquires plural parallax images whose exposure periods are overlapped and corresponding points between the parallax images, calculates a luminance difference at the corresponding points between the parallax images, and estimates the light source color.

Description

本発明は画像処理装置、その制御方法およびプログラムに関し、特には多視点画像を用いた光源色の推定技術に関するものである。   The present invention relates to an image processing apparatus, a control method thereof, and a program, and more particularly to a light source color estimation technique using a multi-viewpoint image.

従来、撮像装置には、様々な色温度の光源のもとで、白色の被写体が正しく白色に表現されるように色成分のゲインを調整するホワイトバランス調整機能が備わっている。より容易な撮影を実現するために、自動ホワイトバランス調整機能が搭載された撮像装置もある。自動ホワイトバランス調整を実現する方法には、画像全体で平均した被写体色がグレイになると仮定してゲインを調整する方法と、より正確な色表現を実現するための方法として光源(の色温度)を推定した上でゲインを調整する方法が知られている。   2. Description of the Related Art Conventionally, an imaging apparatus has a white balance adjustment function that adjusts a gain of a color component so that a white subject is correctly expressed in white under light sources having various color temperatures. In order to realize easier shooting, there is also an imaging apparatus equipped with an automatic white balance adjustment function. There are two methods for automatic white balance adjustment: gain adjustment assuming that the subject color averaged over the entire image is gray, and light source (color temperature) as a method for realizing more accurate color expression. There is known a method of adjusting the gain after estimating.

光源を推定する方法として、光源色を反映する鏡面反射成分を画像から抽出する方法が知られている(特許文献1および特許文献2)。   As a method of estimating a light source, a method of extracting a specular reflection component reflecting a light source color from an image is known (Patent Document 1 and Patent Document 2).

特開2007−13415号公報JP 2007-13415 A 特開2001−16613号公報JP 2001-16613 A

特許文献1の方法では、画像を複数のブロックに分割し、各ブロック内の画素を輝度値に応じて複数の段階に分類し、最も明るい段階に分類された画素の平均輝度(A値)と、2番目に明るい段階に分類された画素の平均輝度(B値)を求める。そして、全ブロックでのA値とB値の平均値の差分値を鏡面反射成分として抽出する。この方法では、ブロック内で求めた平均値をさらにブロック間で平均する統計処理を行っているため、画像上の様々な被写体の影響を受けて推定精度が低下する可能性がある。   In the method of Patent Document 1, an image is divided into a plurality of blocks, pixels in each block are classified into a plurality of stages according to luminance values, and the average luminance (A value) of the pixels classified in the brightest stage is determined. The average luminance (B value) of the pixels classified in the second brightest stage is obtained. And the difference value of the average value of A value and B value in all the blocks is extracted as a specular reflection component. In this method, statistical processing for further averaging the average value obtained in the block is performed between the blocks, so that the estimation accuracy may be reduced due to the influence of various subjects on the image.

特許文献2の方法では、複数の視差画像のそれぞれから視点の移動の方向に異なる位置の一次元領域を切り出して順に並べた2次元画像を生成し、画像内の各画素の移動軌跡が直線的或いは曲線的であるかを判定することにより鏡面反射成分の抽出を行っている。画像内の各画素について視差画像間の移動の軌跡の形状を判定する必要があるため、多数の視差画像が必要になるうえ、計算量が多く複雑な処理が必要である。また、1台の撮像装置を移動させて視差画像を取得するため、撮像装置を駆動するための装置が必要なほか、視差画像の取得時刻に差が生じ、被写体が移動する場合には適用が困難であるほか、動画像撮影への適用ができない問題もある。   In the method of Patent Document 2, a two-dimensional image in which one-dimensional regions at different positions are cut out from each of a plurality of parallax images and arranged in order is generated, and the movement locus of each pixel in the image is linear. Alternatively, the specular reflection component is extracted by determining whether it is curved. Since it is necessary to determine the shape of the trajectory between the parallax images for each pixel in the image, a large number of parallax images are required, and a complicated process with a large calculation amount is required. In addition, since a parallax image is acquired by moving one imaging device, a device for driving the imaging device is required, and in addition, when the subject moves, a difference occurs in the acquisition time of the parallax image. In addition to difficulties, there are also problems that cannot be applied to moving image shooting.

本発明では、上述の従来技術の問題点に鑑みてなされたものであり、簡便な構成で精度の良い光源色の推定が可能な画像処理装置、その制御方法およびプログラムを提供することを目的とする。   The present invention has been made in view of the above-described problems of the prior art, and an object thereof is to provide an image processing apparatus capable of accurately estimating a light source color with a simple configuration, a control method thereof, and a program. To do.

この課題を解決するため、例えば本発明の画像処理装置は以下の構成を備える。すなわち、露光時間が重複した複数の視差画像を取得する取得手段と、複数の視差画像間の対応する画素位置を取得する対応点取得手段と、複数の視差画像間の対応する画素位置における輝度差を算出する算出手段と、算出手段により算出された輝度差から光源色を推定する推定手段を有することを特徴とする。   In order to solve this problem, for example, an image processing apparatus of the present invention has the following configuration. That is, an acquisition unit that acquires a plurality of parallax images with overlapping exposure times, a corresponding point acquisition unit that acquires corresponding pixel positions between the plurality of parallax images, and a luminance difference at corresponding pixel positions between the plurality of parallax images And calculating means for calculating the light source color from the luminance difference calculated by the calculating means.

本発明によれば、簡便な構成で精度の良い光源色の推定が可能になる。   According to the present invention, it is possible to estimate a light source color with high accuracy with a simple configuration.

拡散反射および鏡面反射の状態と撮像装置における撮像状態を説明する図The figure explaining the state of diffuse reflection and specular reflection, and the imaging state in an imaging device 本実施形態に係る画像処理装置の一例としてカメラの構成例を示すブロック図1 is a block diagram illustrating a configuration example of a camera as an example of an image processing apparatus according to an embodiment. 本実施形態に係る画像処理装置の一連の処理を示すフローチャートThe flowchart which shows a series of processes of the image processing apparatus which concerns on this embodiment. カメラシステム制御部のより詳細な構成を示すブロック図Block diagram showing a more detailed configuration of the camera system control unit 撮影光学系の一例としてマイクロレンズアレイを備えた光学系を説明する図The figure explaining the optical system provided with the micro lens array as an example of an imaging optical system ケラレ状態を説明する図Diagram explaining the vignetting state 視差画像の位置合わせ処理の概要と処理後の画素の輝度値を示す図The figure which shows the outline of the alignment processing of a parallax image, and the luminance value of the pixel after processing 異なる被写体における拡散反射および鏡面反射の状態と撮像装置における撮像状態を説明する図The figure explaining the state of diffuse reflection and specular reflection in different subjects, and the imaging state in the imaging device

以下、本発明の例示的な実施形態について、図面を参照して詳細に説明する。なお、以下では、画像処理装置の一例としての、光線空間情報を記録可能なライトフィールドカメラ(LFC)に本発明を適用した例を説明する。しかし、本発明は露光時間が重複した視差画像を取得可能な多眼カメラ(例えば撮像装置を直線上または格子状に配置して多眼撮像装置を構成するもの)を有する電子機器はもとより、視差画像の撮影や記録に関する機能を有さない電子機器にも適用可能である。これらの電子機器には、携帯電話機、ゲーム機、タブレット端末、パーソナルコンピュータなどが含まれるが、これらは単なる例示である。   Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the drawings. Hereinafter, an example in which the present invention is applied to a light field camera (LFC) capable of recording light space information as an example of an image processing apparatus will be described. However, the present invention is not limited to an electronic apparatus having a multi-lens camera (for example, a multi-lens imaging device configured by arranging imaging devices on a straight line or in a grid) that can obtain parallax images with overlapping exposure times. The present invention can also be applied to electronic devices that do not have functions related to image capturing and recording. These electronic devices include mobile phones, game machines, tablet terminals, personal computers, etc., but these are merely examples.

図2は本実施形態のライトフィールドカメラの機能構成例を示すブロック図である。   FIG. 2 is a block diagram showing a functional configuration example of the light field camera of the present embodiment.

ライトフィールドカメラは、例えばマイクロレンズアレイの各マイクロレンズに対して複数の画素が割り当てられた構造の撮像素子を用いて、光束の位置と角度の情報(光線空間(ライトフィールド)情報と呼ばれることもある)を記録可能なカメラである。1つのマイクロレンズの出射光を複数の画素で受光することで、各画素では異なる角度でマイクロレンズに入射した光の強度を得ることができる。また、同じマイクロレンズに割り当てられた複数の画素の各々は射出瞳面における異なる領域を通過した光束を受光するため、マイクロレンズに対して異なる位置の画素の信号から視差画像を生成することができる。   A light field camera uses, for example, an image sensor having a structure in which a plurality of pixels are assigned to each microlens of a microlens array, and is also referred to as light beam position and angle information (light space information). Is a camera capable of recording. By receiving light emitted from one microlens by a plurality of pixels, the intensity of light incident on the microlens at different angles can be obtained in each pixel. In addition, since each of the plurality of pixels assigned to the same microlens receives light beams that have passed through different regions on the exit pupil plane, a parallax image can be generated from signals of pixels at different positions with respect to the microlens. .

本実施形態のLFCは、本体1と、着脱可能なレンズ2とから構成される。本体1とレンズ2とは、レンズマウント(不図示)を通じて機械的に接続されるとともに、レンズマウントに設けられた電気接点11を通じて電気的に接続される。なお、レンズ2が本体1と一体である構成であってもよい。   The LFC of the present embodiment includes a main body 1 and a detachable lens 2. The main body 1 and the lens 2 are mechanically connected through a lens mount (not shown) and electrically connected through an electrical contact 11 provided on the lens mount. The lens 2 may be integrated with the main body 1.

物体からの光は、撮影光軸4を有する撮影光学部3を介して撮像素子6の撮像面に結像される。本実施形態の撮影素子6はマイクロレンズが格子状に配置されたいわゆるマイクロレンズアレイ(MLA)を有し、1つのマイクロレンズの出射光を複数の画素で受光する構成を有している。MLAの機能や配置の詳細については図5を用いて後述する。撮影素子6の各画素は入射光の強度に応じて電気信号(画像信号)を出力する。   Light from the object is imaged on the imaging surface of the imaging device 6 via the imaging optical unit 3 having the imaging optical axis 4. The imaging element 6 of the present embodiment has a so-called microlens array (MLA) in which microlenses are arranged in a lattice pattern, and has a configuration in which light emitted from one microlens is received by a plurality of pixels. Details of the functions and arrangement of the MLA will be described later with reference to FIG. Each pixel of the imaging element 6 outputs an electrical signal (image signal) according to the intensity of incident light.

画像処理部7は、撮像素子6が出力した画像信号に対して処理を行う各種回路を有する。画像処理部7は例えば、A/D変換器、ホワイトバランス回路、ガンマ補正回路、補間演算回路等を有している。また、画像処理部7は、予め定められた方法を用いて画像、動画、音声などのデータを圧縮・伸長する回路を有し、記録用のデータを生成したり、記録されたデータを再生したりする。   The image processing unit 7 includes various circuits that process the image signal output from the image sensor 6. The image processing unit 7 includes, for example, an A / D converter, a white balance circuit, a gamma correction circuit, an interpolation calculation circuit, and the like. Further, the image processing unit 7 has a circuit for compressing / decompressing data such as images, moving images, and sounds using a predetermined method, and generates data for recording or reproduces recorded data. Or

記録部8は記録媒体および記録媒体にデータを読み書きするための回路を備えている。記録部8は、画像処理部7の出力したデータを記録媒体に記録する。また、記録媒体に記録されたデータを読み出して表示部9に表示するために画像処理部7へ出力する。表示部9は液晶モニタ等に撮影時や再生時のデータを表示するほか、カメラシステム制御部5の指示に従って撮影に必要な情報を表示する。操作部10は、レリーズボタン、合焦距離や絞り等の操作のほか、記録データの再生やメニュー画面による操作指示を検出する。   The recording unit 8 includes a recording medium and a circuit for reading / writing data from / to the recording medium. The recording unit 8 records the data output from the image processing unit 7 on a recording medium. Further, the data recorded on the recording medium is read out and output to the image processing unit 7 for display on the display unit 9. The display unit 9 displays data necessary for shooting in accordance with instructions from the camera system control unit 5 in addition to displaying data at the time of shooting and playback on a liquid crystal monitor or the like. The operation unit 10 detects a release button, an in-focus distance, an aperture, and the like, as well as playback of recorded data and an operation instruction on a menu screen.

カメラシステム制御部5は、例えばCPUやMPUなどのプログラマブルプロセッサであり、不揮発性メモリに記憶されたプログラムを実行することにより各機能ブロックを制御し、LFCの機能を実現する。   The camera system control unit 5 is a programmable processor such as a CPU or MPU, for example, and controls each functional block by executing a program stored in a nonvolatile memory, thereby realizing an LFC function.

カメラシステム制御部5は画像処理部7で処理された画像信号に基づいて撮像光学部3の合焦状態や被写体輝度を求める。カメラシステム制御部5は、撮像光学部3が有するフォーカスレンズの位置をレンズシステム制御部12を通じて制御し、撮像光学部3の合焦距離を調整する。また、カメラシステム制御部5は、被写体輝度に応じて絞り値、シャッタスピード、撮影感度などの露出条件を決定する。カメラシステム制御部5は、撮像光学部3が有する絞りの開口量についてもレンズシステム制御部12を通じて制御する。レンズシステム制御部12には不図示の手ぶれ検出センサが接続されており、手ぶれ補正を行うモードにおいては、手ぶれ検出センサの信号を元にレンズ駆動部13を介してブレ補正レンズを適切に制御する。カメラシステム制御部5はまた、必要に応じて、画像データやメニュー画面などを表示部9に出力する。
カメラシステム制御部5は、画像処理部7により処理された画像データに対して、後に説明する輝度調整処理、視差画像位置合わせ処理、輝度差算出処理、光源色推定処理を行う。
The camera system control unit 5 obtains the in-focus state and subject brightness of the imaging optical unit 3 based on the image signal processed by the image processing unit 7. The camera system control unit 5 controls the focus lens position of the imaging optical unit 3 through the lens system control unit 12 and adjusts the focusing distance of the imaging optical unit 3. Further, the camera system control unit 5 determines exposure conditions such as an aperture value, a shutter speed, and shooting sensitivity according to the subject brightness. The camera system control unit 5 also controls the aperture amount of the diaphragm included in the imaging optical unit 3 through the lens system control unit 12. A camera shake detection sensor (not shown) is connected to the lens system control unit 12, and in the camera shake correction mode, the camera shake correction sensor is appropriately controlled via the lens drive unit 13 based on the signal from the camera shake detection sensor. . The camera system control unit 5 also outputs image data, a menu screen, and the like to the display unit 9 as necessary.
The camera system control unit 5 performs luminance adjustment processing, parallax image alignment processing, luminance difference calculation processing, and light source color estimation processing described later on the image data processed by the image processing unit 7.

(光源色推定処理の流れ)
本実施形態の光源色推定処理について、図3に示すフローチャートおよび、図2および図4に示すブロック図を用いて説明する。
(Flow of light source color estimation process)
The light source color estimation process of the present embodiment will be described with reference to the flowchart shown in FIG. 3 and the block diagrams shown in FIGS.

図4は、カメラシステム制御部5の光源色推定処理に係る機能構成例を示すブロック図である。カメラシステム制御部5は、輝度調整部501、視差画像位置合わせ部502、輝度差算出部503、光源色推定部504、出力画像生成部505および制御部506を有する。制御部506は501から505の各処理部の機能以外について、カメラシステム制御部5として機能するための処理を行う。制御部506以外の各処理部の機能は、カメラシステム制御部5が画像処理部7を用いて実現してもよい。   FIG. 4 is a block diagram illustrating a functional configuration example related to the light source color estimation process of the camera system control unit 5. The camera system control unit 5 includes a luminance adjustment unit 501, a parallax image alignment unit 502, a luminance difference calculation unit 503, a light source color estimation unit 504, an output image generation unit 505, and a control unit 506. The control unit 506 performs processing for functioning as the camera system control unit 5 other than the functions of the processing units 501 to 505. The functions of the processing units other than the control unit 506 may be realized by the camera system control unit 5 using the image processing unit 7.

図3においてシステム制御部5は操作部10に含まれるレリーズボタンの押下を検出すると、画像取得指示が入力されたものとして以降の各ステップを開始する。   In FIG. 3, when detecting that the release button included in the operation unit 10 is pressed, the system control unit 5 starts the subsequent steps assuming that an image acquisition instruction has been input.

S101は視差画像の取得を行うステップである。カメラシステム制御部5は、電気接点11を通じてレンズシステム制御部12に指示を出し、レンズ駆動部13を制御してシャッタ兼絞りの動作を制御し、適切な露出条件で撮像素子6を露光する。さらに、カメラシステム制御部5は、撮像素子6から取得した画像データに対して画像処理部7が上述した補正等の処理を施した画像データを入手する。なお、LFCは1回の露光動作で複数の視差画像を得ることができる。   S101 is a step of acquiring a parallax image. The camera system control unit 5 issues an instruction to the lens system control unit 12 through the electrical contact 11, controls the lens driving unit 13 to control the operation of the shutter and diaphragm, and exposes the image sensor 6 under appropriate exposure conditions. Further, the camera system control unit 5 obtains image data obtained by performing the above-described correction and the like on the image data acquired from the image sensor 6 by the image processing unit 7. Note that the LFC can obtain a plurality of parallax images in one exposure operation.

S102において輝度調整部501は、画像処理部7から画像データを取得して輝度調整処理を行い、視差画像位置合わせ部502へ補正後の視差画像データを出力する。輝度調整の詳細については図6(a)から図6(c)を用いて後述するが、輝度調整部501は、瞳距離等のケラレの決定要因に基づいて予め設定された、各画素に対する補正値を、予め保存された補正値テーブルから読み出して各画素の輝度調整を行う。なお、本実施形態では、複数の視差画像に対して輝度補正処理を行うが、複数の視差画像を生成する前の各画素値に対して行ってもよい。   In S <b> 102, the luminance adjustment unit 501 acquires image data from the image processing unit 7, performs luminance adjustment processing, and outputs the corrected parallax image data to the parallax image registration unit 502. Details of the brightness adjustment will be described later with reference to FIGS. 6A to 6C. The brightness adjustment unit 501 performs correction for each pixel that is set in advance based on a vignetting determination factor such as a pupil distance. The value is read from a correction value table stored in advance, and the brightness of each pixel is adjusted. In the present embodiment, the luminance correction process is performed on a plurality of parallax images, but may be performed on each pixel value before generating a plurality of parallax images.

S103において視差画像位置合わせ部502は、被写体像の位置が一致するように視差画像間の位置合わせを行う。本実施形態における視差画像位置合わせ処理の詳細な動作については図7を用いて後述するが、視差画像位置合わせ部502は、公知の技術を用いて位置合わせすることができる。例えば、処理対象となる2つの視差画像に対して、視差画像のエピポーラ拘束の条件下で最もマッチングが良い画素の対応点を探すステレオマッチングにより位置合わせすることができる。   In step S103, the parallax image alignment unit 502 performs alignment between the parallax images so that the positions of the subject images match. The detailed operation of the parallax image registration processing in the present embodiment will be described later with reference to FIG. 7, but the parallax image registration unit 502 can perform registration using a known technique. For example, it is possible to align two parallax images to be processed by stereo matching that searches for corresponding points of the best matching pixels under the epipolar constraint conditions of the parallax images.

視差画像間の位置のずれ(位相差)は視差(図5での瞳領域30−aと30−eなどの重心間の距離)および被写体の距離に依存する。一般に平面物体でかつ物体表面がランバート面と仮定できる場合は、ステレオマッチングは容易である。一方で、本発明で対象とする鏡面反射成分を含む場合や位置合わせのブロック内に近距離の被写体と遠距離の被写体が混在する状況ではステレオマッチングの精度が下がる場合がある。   The positional shift (phase difference) between the parallax images depends on the parallax (the distance between the centers of gravity of the pupil regions 30-a and 30-e in FIG. 5) and the distance of the subject. In general, stereo matching is easy when it is a planar object and the object surface can be assumed to be a Lambertian surface. On the other hand, the accuracy of stereo matching may be lowered in the case where a specular reflection component that is a subject of the present invention is included or in a situation where a short distance object and a long distance object are mixed in the alignment block.

この対策として、視差画像位置合わせ部502は、位置合わせに用いるブロックの大きさを被写体の倍率に応じて設定してもよい。また、鏡面反射成分に起因するローカルミニマムに陥らないようにするためには、位置合わせに用いるブロックを大き目に設定してもよい。視差画像位置合わせ部502は、複数の視差画像と共に、視差画像の位置合わせの結果求めた視差画像間の対応する画素位置についての情報を出力する。また、視差画像位置合わせ部502は、後述する視差画像の像の一致度に基づいて光源色推定に適する画像上の領域を特定し、特定の一致度である領域を示す情報を出力する。   As a countermeasure against this, the parallax image alignment unit 502 may set the size of the block used for alignment according to the magnification of the subject. Further, in order not to fall into a local minimum due to the specular reflection component, the block used for alignment may be set large. The parallax image alignment unit 502 outputs information on the corresponding pixel positions between the parallax images obtained as a result of the parallax image alignment together with the plurality of parallax images. Further, the parallax image alignment unit 502 specifies an area on the image suitable for light source color estimation based on the degree of coincidence of parallax images described later, and outputs information indicating the area having the specific degree of coincidence.

S104において輝度差算出部503は、視差画像間の対応する画素における輝度差を算出する。輝度差算出部503は、視差画像位置合わせ部502において求めた視差画像間の対応する画素位置の情報と視差画像を取得した上で、それぞれの視差画像の対応する画素位置から輝度値を取得してその差分を算出する。また、詳細は後述するがS101で取得した視差画像の数が3以上の場合には、同位置に対応する画素の輝度値の最大値と最小値の差(最大輝度差)を算出する。   In S104, the luminance difference calculation unit 503 calculates a luminance difference in corresponding pixels between parallax images. The luminance difference calculation unit 503 acquires information on the corresponding pixel positions between the parallax images obtained by the parallax image registration unit 502 and the parallax images, and then acquires luminance values from the corresponding pixel positions of the respective parallax images. The difference is calculated. Although details will be described later, when the number of parallax images acquired in S101 is 3 or more, the difference between the maximum value and the minimum value (maximum luminance difference) of the luminance values of the pixels corresponding to the same position is calculated.

S105で光源色推定部504は、R,G,B各色の輝度差を用いて、光源色(波長特性)を推定する。光源色推定の詳細は後述する。   In step S105, the light source color estimation unit 504 estimates the light source color (wavelength characteristic) using the luminance difference between the R, G, and B colors. Details of the light source color estimation will be described later.

S106で出力画像生成部505は、例えば、視差画像に基づく光線空間情報のうち角度情報を積分して出力像を生成する。角度に関して積分する前に各視差画像をずらすことでいわゆるリフォーカスして出力像を生成してもよい。   In S106, for example, the output image generation unit 505 generates an output image by integrating the angle information in the light space information based on the parallax image. The output image may be generated by so-called refocusing by shifting each parallax image before integrating with respect to the angle.

S107において画像処理部7は、光源色推定部504がS105で求めた光源色の推定結果に基づいて入力画像のホワイトバランス調整を行ない、S106で生成した出力像にホワイトバランス調整を施す。また、画像処理部7は、ホワイトバランス調整後の画像を用い、記録フォーマットに応じた形式の記録用画像ファイルを生成する。画像処理部7は、画像ファイルを生成する際、必要に応じて画像の圧縮符号化も行う。   In S107, the image processing unit 7 performs white balance adjustment of the input image based on the light source color estimation result obtained by the light source color estimation unit 504 in S105, and performs white balance adjustment on the output image generated in S106. The image processing unit 7 uses the image after white balance adjustment to generate a recording image file in a format corresponding to the recording format. When generating the image file, the image processing unit 7 also performs compression encoding of the image as necessary.

S103,S104,S105,S107の処理は画像を複数の領域に分けて行うことができる。例えば、外光とは異なる光源特性をもつ光源が撮影装置近傍にある場合、光源の影響を受ける領域と影響を受けない(外光のみの)領域では光源色が異なる。このため領域ごとに光源色を求めてホワイトバランス調整を施すと良い。このような方法を用いれば、例えば日中シンクロと呼ばれる太陽光とストロボ光が当たるような撮影場面において、ストロボ光が支配的な領域と、太陽光が支配的な領域の双方に適当なホワイトバランス調整を施すことが可能となる。   The processing of S103, S104, S105, and S107 can be performed by dividing the image into a plurality of regions. For example, when a light source having a light source characteristic different from that of outside light is in the vicinity of the photographing apparatus, the light source color is different between a region affected by the light source and a region not affected (only with outside light). For this reason, it is preferable to obtain a light source color for each region and perform white balance adjustment. By using this method, for example, in a shooting scene where sunlight and strobe light hit, such as daytime synchro, white balance suitable for both the area where the strobe light is dominant and the area where the sunlight is dominant Adjustments can be made.

S108において記録部8は、S107で得られた記録用画像ファイルを記録部8に記録して一連の撮像動作を完了する。必要であればカメラシステム制御部5はホワイトバランス調整後の画像を画像処理部7から取得して表示部9に表示させてプレビュー動作なども行う。   In S108, the recording unit 8 records the recording image file obtained in S107 in the recording unit 8, and completes a series of imaging operations. If necessary, the camera system control unit 5 acquires the image after white balance adjustment from the image processing unit 7 and displays it on the display unit 9 to perform a preview operation and the like.

(視差画像取得処理)
図3のS101で行う視差画像の取得処理について図5を示してさらに説明する。図5(a)は撮像素子6とMLA20の関係を模式的に示す図である。図5(b)は撮像素子6の画素とMLA20の対応関係を模式的に示す図である。図5(c)はMLA20のレンズによって、レンズに対応する画素が特定の瞳領域と対応づけられることを示す図である。
(Parallax image acquisition process)
The parallax image acquisition process performed in S101 of FIG. 3 will be further described with reference to FIG. FIG. 5A is a diagram schematically showing the relationship between the image sensor 6 and the MLA 20. FIG. 5B is a diagram schematically showing the correspondence between the pixels of the image sensor 6 and the MLA 20. FIG. 5C is a diagram showing that a pixel corresponding to the lens is associated with a specific pupil region by the lens of the MLA 20.

図5(a)に示すように撮像素子6上にはMLA20が設けられており、MLA20の前側主点は撮影光学部3の結像面近傍になるように配置されている。図5(a)はLFCの横と、正面からMLA20を見た状態を示しており、LFCの正面から見るとMLA20が撮像素子6の画素を覆うように配置されている。なお、図5(a)ではMLA20を構成する各マイクロレンズを見やすくするために、大きく記載したが、実際には図5(b)に示すように各マイクロレンズは画素の数倍から数十倍程度の大きさしかない。   As shown in FIG. 5A, the MLA 20 is provided on the image sensor 6, and the front principal point of the MLA 20 is arranged in the vicinity of the imaging plane of the photographing optical unit 3. FIG. 5A shows a state where the MLA 20 is viewed from the side and front of the LFC, and the MLA 20 is disposed so as to cover the pixels of the image sensor 6 when viewed from the front of the LFC. In FIG. 5 (a), the microlenses constituting the MLA 20 are illustrated in order to make it easy to see, but in actuality, as shown in FIG. 5 (b), each microlens is several to several tens of times the number of pixels. It is only about the size.

図5(b)は図5(a)のLFC正面からみた図を一部拡大した図である。図5(b)に示す格子状の枠は、撮像素子6の各画素を示している。一方、MLA20を構成する各マイクロレンズは太い円で示した。図5(b)から明らかなようにマイクロレンズ1つに対して複数の画素が割り当てられており、図5(b)の例では、5行x5列=25個の画素が1つのマイクロレンズに対して設けられている。(すなわち各マイクロレンズは画素の約25倍の大きさである。)
図5(c)は撮像素子6を、マイクロレンズ光軸を含みセンサの長手方向が図の横方向になるように切断した図である。図5(c)の20−a、20−b、20−c、20−d、20−eのそれぞれは図5(b)に示した位置の画素(1つの光電変換部)を示している。一方、図5(c)の上方に示した図は撮影光学部3の射出瞳面を示している。実際には、図5(c)の下方に示したセンサの図と方向を合わせると、射出瞳面は図5(c)の紙面垂直方向になるが、説明のために投影方向を変化させている。また、図5(c)においては説明を簡単にするために、1次元の投影/信号処理について説明する。実際の装置においては、これを容易に2次元に拡張することができる。
FIG. 5B is a partially enlarged view of the front view of the LFC in FIG. A grid-like frame shown in FIG. 5B indicates each pixel of the image sensor 6. On the other hand, each microlens constituting the MLA 20 is indicated by a thick circle. As apparent from FIG. 5B, a plurality of pixels are assigned to one microlens. In the example of FIG. 5B, 5 rows × 5 columns = 25 pixels are assigned to one microlens. It is provided for. (That is, each microlens is about 25 times the size of a pixel.)
FIG. 5C is a view in which the image pickup device 6 is cut so that the longitudinal direction of the sensor includes the microlens optical axis and the horizontal direction of the drawing. Each of 20-a, 20-b, 20-c, 20-d, and 20-e in FIG. 5C indicates a pixel (one photoelectric conversion unit) at the position illustrated in FIG. 5B. . On the other hand, the figure shown above FIG. 5C shows the exit pupil plane of the photographic optical unit 3. Actually, when the direction is aligned with the sensor diagram shown in the lower part of FIG. 5C, the exit pupil plane is in the direction perpendicular to the plane of FIG. 5C, but the projection direction is changed for the sake of explanation. Yes. In FIG. 5C, one-dimensional projection / signal processing will be described to simplify the description. In an actual device, this can be easily extended to two dimensions.

図5(c)に示すように、MLA20によって各画素は撮影光学部3の射出瞳面上の特定の領域と共役になるように設計されている。図5(c)の例では画素20−aと領域30−aが、画素20−bと領域30−bが、画素20−cと領域30−cが、画素20−dと領域30−dが、画素20−eと領域30−eがそれぞれ対応している。すなわち画素20−aには撮影光学部3の射出瞳面上の領域30−aを通過した光束のみが入射する。他の画素も同様である。結果として、瞳面上での通過領域と撮像素子6上の位置関係から角度の情報を取得することが可能となる。   As shown in FIG. 5C, each pixel is designed to be conjugate with a specific area on the exit pupil plane of the imaging optical unit 3 by the MLA 20. In the example of FIG. 5C, the pixel 20-a and the region 30-a are the pixel 20-b and the region 30-b, the pixel 20-c and the region 30-c are the pixel 20-d, and the region 30-d. However, the pixel 20-e and the region 30-e correspond to each other. That is, only the light beam that has passed through the region 30-a on the exit pupil plane of the photographing optical unit 3 enters the pixel 20-a. The same applies to the other pixels. As a result, it is possible to obtain angle information from the passing area on the pupil plane and the positional relationship on the image sensor 6.

瞳領域30−aを通過した光束のみを捉えている画素20−aと同じ対応関係にある画素のみ集めた画像と、瞳領域30−eを通過した光束のみを捉えている画素20−eと同じ対応関係にある画素のみ集めた画像は視差画像となる。つまり、画素20−aと同じ対応関係にある画素のみ集めた画像は瞳領域30−aから見た画像となっており、画素20−eと同じ対応関係にある画素のみ集めた画像は瞳領域30−eから見た画像となる。このように、LFCでは、一度の露光で得られる信号から、複数の視差画像を得ることができる。   An image obtained by collecting only pixels having the same correspondence as the pixel 20-a that captures only the light beam that has passed through the pupil region 30-a, and a pixel 20-e that captures only the light beam that has passed through the pupil region 30-e An image obtained by collecting only pixels having the same correspondence is a parallax image. In other words, an image obtained by collecting only pixels having the same correspondence with the pixel 20-a is an image viewed from the pupil region 30-a, and an image obtained by collecting only pixels having the same correspondence with the pixel 20-e The image is viewed from 30-e. Thus, in LFC, a plurality of parallax images can be obtained from a signal obtained by one exposure.

本実施形態では、画像処理部7は、補完等の処理を行った画像データに対してx軸及びy軸のそれぞれについて5画素単位で画像全体を走査する。本実施形態ではMLA20のマイクロレンズ1つあたり25画素を対応させているため、1回の露光により視差画像を最大25枚生成することができる。25の画素のうち、画素20−a、画素20−c、画素20−eに対応する画素を集めれば3枚の視差画像が得られるが、光源色推定処理の対象や求められる精度に応じて視差画像の枚数を随時調整してもよい。   In the present embodiment, the image processing unit 7 scans the entire image in units of 5 pixels for each of the x-axis and the y-axis with respect to the image data subjected to processing such as complementation. In the present embodiment, since 25 pixels are associated with each micro lens of the MLA 20, a maximum of 25 parallax images can be generated by one exposure. Of the 25 pixels, three parallax images can be obtained by collecting pixels corresponding to the pixel 20-a, the pixel 20-c, and the pixel 20-e, but depending on the target of the light source color estimation process and the required accuracy. You may adjust the number of parallax images at any time.

露光時間が重複した複数の視差画像を得ることにより、被写体の状態が揃った視差画像が得られるため、一台の撮像装置を利用して複数の視差画像を得る場合よりも位置合わせが容易である。加えて、動きのある被写体に対する撮影や動画像において後述する光源推定が適用可能となる利点がある。LFCのように、露光時間が完全に重複した複数の視差画像が得られる場合、特に高い効果が得られる。   By obtaining multiple parallax images with overlapping exposure times, it is possible to obtain parallax images with the same state of the subject, so positioning is easier than when multiple parallax images are obtained using a single imaging device. is there. In addition, there is an advantage that light source estimation, which will be described later, can be applied to shooting or moving images of a moving subject. A particularly high effect is obtained when a plurality of parallax images with completely overlapping exposure times are obtained as in LFC.

(輝度補正処理)
次に図3のS102における輝度補正処理について図6を示してさらに説明する。まず輝度補正処理が必要となる原因であるケラレについて図6(a)から図6(c)を用いて説明する。
(Brightness correction processing)
Next, the brightness correction processing in S102 of FIG. 3 will be further described with reference to FIG. First, vignetting that is a cause of the necessity of luminance correction processing will be described with reference to FIGS. 6A to 6C.

図6(a)は撮影光軸4、撮像素子6、絞り43、各種レンズ枠42,44(レンズ保持等を行う部分であり、一般的に画面中心40では光線を制限しないが像高に応じて光線を制限する端面となりうる個所)とケラレの関係を模式的に示している。図6(b)は画面中心40での絞り43および各種レンズ枠42,44の位置関係を示す図であり、図6(c)は撮像素子6上のある点41での絞り43および各種レンズ枠42,44の位置関係を示す図である。   FIG. 6A shows the photographing optical axis 4, the image pickup element 6, the aperture 43, and various lens frames 42 and 44 (the lens holding portion etc.). Generally, the light beam is not limited at the center 40 of the screen, but depending on the image height. The relationship between the vignetting and the portion that can be the end face that restricts the light) is schematically shown. FIG. 6B is a diagram showing the positional relationship between the diaphragm 43 and the various lens frames 42 and 44 at the screen center 40, and FIG. 6C shows the diaphragm 43 and various lenses at a certain point 41 on the image sensor 6. It is a figure which shows the positional relationship of the frames 42 and 44. FIG.

図6(a)では説明を容易にするために、絞り43に対して撮像素子6側とその反対側に1つずつのレンズ枠42,44があるものとしたが、これは模式的なものであり必ずしも1つずつである必要はない。図6(a)において絞り43を示す太い直線は開口の大きさを1次元的に示したものである。実際の絞りはほぼ円形であるがその直径を模式的に示していると考えれば良い。これはレンズ枠42,44も同様である。画面中心40から見た場合絞り43に向かう光線はレンズ枠42,44によってケラレが発生することが無い。これを図6(b)に示した。図6(b)は絞り43およびレンズ枠42,44を絞り43の面に投影したものである。この時42,43,44は同心円をなしており且つ絞り43の径が最も小さいためにレンズ枠42,44によってケラレが発生していない。   In FIG. 6 (a), for ease of explanation, one lens frame 42, 44 is provided on the image pickup element 6 side and the opposite side with respect to the stop 43, but this is a schematic one. It is not always necessary to have one by one. In FIG. 6A, a thick straight line indicating the stop 43 indicates the size of the opening in a one-dimensional manner. Although the actual aperture is substantially circular, it can be considered that the diameter is schematically shown. The same applies to the lens frames 42 and 44. When viewed from the center 40 of the screen, vignetting is not caused by the lens frames 42 and 44 on the light beam traveling toward the aperture 43. This is shown in FIG. FIG. 6B shows the aperture 43 and the lens frames 42 and 44 projected onto the surface of the aperture 43. At this time, 42, 43, and 44 are concentric and the diameter of the diaphragm 43 is the smallest, so no vignetting is generated by the lens frames 42 and 44.

一方で、一定の像高がある点41から見た場合、レンズ枠42,44によるケラレが発生する可能性がある。図6(c)の例では撮像素子6側にあるレンズ枠44によって領域45にケラレが発生している。図6(b)と同様に点41からの絞り43およびレンズ枠42,44を絞り43の面に投影したものを図6(c)に示した。レンズ枠44によってケラレが発生し、輝度が低下していることが分かる。   On the other hand, when viewed from a point 41 having a certain image height, vignetting may occur due to the lens frames 42 and 44. In the example of FIG. 6C, vignetting is generated in the region 45 by the lens frame 44 on the image sensor 6 side. FIG. 6C shows the projection of the diaphragm 43 and the lens frames 42 and 44 from the point 41 on the surface of the diaphragm 43 as in FIG. 6B. It can be seen that vignetting is generated by the lens frame 44 and the luminance is lowered.

図6(a)ないし(c)から分かるようにケラレの発生や大きさは、瞳距離、瞳径(Fナンバー)、像高、レンズ枠の距離と径に応じて決定される。なお、図6(a)では、瞳距離は撮像素子6と絞り43との距離で、瞳径は絞り43の幅で、像高は画面中心40と撮像素子6上のある点41との距離で表現される。また同様に、図6(a)では、レンズ枠の距離は撮像素子6とレンズ枠42,44との距離、レンズ枠の径はレンズ枠42,44の幅で表される。   As can be seen from FIGS. 6A to 6C, the occurrence and size of vignetting is determined according to the pupil distance, pupil diameter (F number), image height, and distance and diameter of the lens frame. In FIG. 6A, the pupil distance is the distance between the image sensor 6 and the diaphragm 43, the pupil diameter is the width of the diaphragm 43, and the image height is the distance between the screen center 40 and a certain point 41 on the image sensor 6. It is expressed by Similarly, in FIG. 6A, the distance of the lens frame is represented by the distance between the imaging device 6 and the lens frames 42 and 44, and the diameter of the lens frame is represented by the width of the lens frames 42 and 44.

輝度に変化が生じていると、位置合わせなどの処理を行う際に演算の失敗や誤差要因になる。そこで本実施形態ではそれらの処理に先立ってS102で輝度調整(ケラレ補正)を施すことにより、位置合わせや輝度差の算出精度を高めている。   If there is a change in luminance, it may cause a calculation failure or an error factor when performing processing such as alignment. Therefore, in the present embodiment, by performing brightness adjustment (vignetting correction) in S102 prior to these processes, the accuracy of alignment and brightness difference calculation is increased.

上述したケラレの決定因子のうち、瞳距離およびレンズ枠の距離はレンズ2固有の値である。従って、Fナンバーと像高に応じた補正値を予め用意し、例えば補正値テーブルとして保存しておくことができる。そして、輝度調整部501は現在のFナンバー(絞り値)と画素の像高に応じた補正値をテーブルから取得して輝度補正を行うことで、ケラレによる輝度の変化を補正することができる。なお、Fナンバーやレンズの固有情報を画像データの付加情報などから取得してケラレ補正を行ってもよい。   Among the vignetting determinants described above, the pupil distance and the lens frame distance are values specific to the lens 2. Accordingly, correction values corresponding to the F number and the image height can be prepared in advance and stored, for example, as a correction value table. The luminance adjusting unit 501 can correct a change in luminance due to vignetting by acquiring a correction value corresponding to the current F number (aperture value) and the image height of the pixel from the table and performing luminance correction. Note that vignetting correction may be performed by acquiring F-number and lens specific information from the additional information of the image data.

また、輝度調整部501は、電気接点11を通じて撮影条件やレンズの情報取得を行いケラレ状態を決定し、例えば像高に応じて画面中心40からの距離が所定の画素数より大きくなる領域について補正をするようにしてもよい。視差を持つ画像については、対応する瞳領域に応じて画面中心40の位置が相対的に移動するから、各視差画像においては対応する瞳領域に応じて画面中心40を所定の画素数分ずらした上で補正を行うようにしてもよい。   Also, the brightness adjustment unit 501 determines the vignetting state by acquiring the shooting conditions and lens information through the electrical contact 11, and corrects the region where the distance from the screen center 40 is larger than a predetermined number of pixels according to the image height, for example. You may make it do. For an image having parallax, the position of the screen center 40 is relatively moved according to the corresponding pupil region. Therefore, in each parallax image, the screen center 40 is shifted by a predetermined number of pixels according to the corresponding pupil region. You may make it correct | amend above.

(視差画像位置合わせ処理及び輝度差算出処理)
次に、図3のS103およびS104で行う視差画像の位置合わせ処理および輝度差算出処理について、図7を用いてさらに説明する。図7(a)は複数の視差画像を取得する様子を模式的に示した図である。矢印79は光源からの光線を、80は被写体を表す。矢印81,82,83は各視差画像の視点方向を、84,85,86はそれぞれ81,82,83方向から見たときに被写体を、84a,85a,86aは、それぞれ被写体像84,85,86上の鏡面反射成分の位置を示している。
(Parallax image alignment processing and luminance difference calculation processing)
Next, the parallax image alignment processing and luminance difference calculation processing performed in S103 and S104 in FIG. 3 will be further described with reference to FIG. FIG. 7A is a diagram schematically showing a state where a plurality of parallax images are acquired. An arrow 79 indicates a light beam from the light source, and 80 indicates a subject. Arrows 81, 82, 83 indicate the viewpoint direction of each parallax image, 84, 85, 86 indicate the subject when viewed from the directions 81, 82, 83, respectively, and 84a, 85a, 86a indicate the subject images 84, 85, 86, respectively. The position of the specular reflection component on 86 is shown.

図7(b)は位置合わせを行った後の状態を模式的に示す図である。84(85および86は重なっている)は図7(a)の被写体像を、84a,85a,86aは図7(a)と同じ鏡面反射成分の位置を、81a,82a,83aは視点81,82,83からの像を位置合わせしたことを示す枠である。87は位置合わせのために用いる部分領域を示す枠である。   FIG. 7B is a diagram schematically showing a state after alignment. 84 (85 and 86 overlap) is the subject image of FIG. 7A, 84a, 85a and 86a are the positions of the same specular reflection components as in FIG. 7A, 81a, 82a and 83a are the viewpoints 81, 82 is a frame showing that the images from 82 and 83 are aligned. Reference numeral 87 denotes a frame indicating a partial region used for alignment.

図7(c)は図7(b)の状態での枠87内の輝度分布を模式的に示した図である。図7(c)の横軸は図7(b)の横方向の位置を、縦軸は輝度を示している。図7(c)において91,92,93はそれぞれ被写体84,85,86の輝度を示すグラフ、94は背景の輝度レベル、95は被写体80の拡散反射レベル96は拡散反射と鏡面反射を合わせて輝度レベルを示している。   FIG. 7C is a diagram schematically showing the luminance distribution in the frame 87 in the state of FIG. The horizontal axis of FIG.7 (c) shows the position of the horizontal direction of FIG.7 (b), and the vertical axis | shaft has shown the brightness | luminance. In FIG. 7C, 91, 92, and 93 are graphs showing the luminance of the subjects 84, 85, and 86, 94 is the luminance level of the background, 95 is the diffuse reflection level 96 of the subject 80, and the diffuse reflection and specular reflection are combined. The brightness level is shown.

図7(a)では3つの視点から同一の被写体80を撮影している様子を示している。ここでは複数の視点から示すことを模式的に示しており視点の数や位置には特別な意味はない。図7(a)に示すように複数の視点81,82,83から撮影するとそれぞれの視差画像には同一の被写体80が異なる位置に結像84,85,86する。図3で説明したように視差画像間の相対的な位置は、視差と被写体の距離によって決まる。図7(a)では横方向にずれて結像している様子を示した。   FIG. 7A shows a situation where the same subject 80 is photographed from three viewpoints. Here, what is shown from a plurality of viewpoints is schematically shown, and the number and positions of viewpoints have no special meaning. As shown in FIG. 7A, when photographing from a plurality of viewpoints 81, 82, 83, the same subject 80 is imaged 84, 85, 86 in different positions in each parallax image. As described in FIG. 3, the relative position between the parallax images is determined by the parallax and the distance between the subjects. FIG. 7A shows a state in which the image is shifted in the horizontal direction.

被写体像を適当な大きさで切り出し被写体像が一致するように位置合わせを行うと図7(b)のような像が得られる。すなわち被写体像84,85,86が重なり、反対に像の取得範囲を示す枠81a,82a,83aがずれた状態である。被写体の位置合わせに用いた枠を87で模式的に示した。枠87内の輝度分布は図7(c)に示すようになっている。ここで図7(c)は1次元的な広がりを持つように図示しているが、これはエピポーラ拘束と関連している。図7(a)の説明で横方向にずれて結像していると記載したが、これは視差が横方向にのみ生じているような視差画像を用いていることを意味している。図5の例に対応させると瞳領域30−a,30−c,30−eに対応した視差画像を利用すればx方向にのみ視差を持ちこの例のようになる。この場合は縦方向には被写体像のずれは生じないので、視差方向に直交する方向(図7では縦方向)の信号を加算して画像を1次元的な広がりを持つように扱うことができる。このようにすることで計算量を削減するとともに信号のS/N比をあげて位置合わせを行うことが可能となる。   When the subject image is cut out to an appropriate size and aligned so that the subject images match, an image as shown in FIG. 7B is obtained. That is, the subject images 84, 85, and 86 are overlapped, and the frames 81a, 82a, and 83a indicating the image acquisition ranges are shifted. A frame used for the alignment of the subject is schematically indicated by 87. The luminance distribution in the frame 87 is as shown in FIG. Here, FIG. 7C shows a one-dimensional spread, which is related to epipolar constraint. In the description of FIG. 7A, it is described that the images are shifted in the horizontal direction, but this means that a parallax image in which parallax occurs only in the horizontal direction is used. If the parallax images corresponding to the pupil regions 30-a, 30-c, and 30-e are used in correspondence with the example of FIG. 5, the parallax is only in the x direction as in this example. In this case, since there is no shift in the subject image in the vertical direction, signals in a direction orthogonal to the parallax direction (vertical direction in FIG. 7) can be added to handle the image so as to have a one-dimensional spread. . By doing so, it is possible to reduce the amount of calculation and perform alignment by increasing the S / N ratio of the signal.

鏡面反射による影響が支配的ではない場合、図7(c)に示すように被写体84,85,86は被写体エッジを利用して位置合わせがなされる。被写体の位置合わせに用いる枠87の大きさを適当に設定すれば、鏡面反射成分に引きずられて位置合わせ精度が低下することを避けることができる。   When the influence of the specular reflection is not dominant, the objects 84, 85, and 86 are aligned using the object edge as shown in FIG. If the size of the frame 87 used for subject alignment is appropriately set, it can be avoided that the alignment accuracy is lowered due to the specular reflection component.

視差画像位置合わせ部502は、輝度調整部501による輝度調整のされた画像を取得し、位置合わせ処理を行う。上述のように位置合わせ処理はステレオマッチングとして知られる公知の方法で視差画像間の対応点の探索処理を行えばよい。LFCにより得られた視差画像は、直線上(例えばx方向)にのみ視差をもつ視差画像の組み合わせを容易に選択することができる。視差画像位置合わせ部502は、x方向にのみ視差をもつ視差画像の組み合わせを選択して、位置合わせ処理の対象にしてもよい。また、対応点の探索の前処理として公知の方法で被写体のエッジや特徴点の抽出を行ってもよい。視差画像位置合わせ部502は、位置合わせ処理の結果により、視差画像間の対応する画像位置の情報を生成する。   The parallax image alignment unit 502 acquires an image whose luminance has been adjusted by the luminance adjustment unit 501, and performs alignment processing. As described above, the alignment processing may be performed by searching for corresponding points between parallax images by a known method known as stereo matching. A parallax image obtained by LFC can easily select a combination of parallax images having parallax only on a straight line (for example, in the x direction). The parallax image alignment unit 502 may select a combination of parallax images having parallax only in the x direction and set it as a target for alignment processing. In addition, as a pre-process for searching for corresponding points, the edges and feature points of the subject may be extracted by a known method. The parallax image registration unit 502 generates information of corresponding image positions between parallax images based on the result of the registration process.

また、視差画像の位置合わせ処理は、輝度の一致度に基づいて後の光源色推定処理に適した画像領域を特定することができる。なお、本実施形態で一致度とは、2つの像を位置合わせした後の輝度の差分絶対値の和を指す。例えば、図7では2つの輝度を比較した時に重ならない部分の大きさを指す。   In addition, the parallax image alignment processing can specify an image region suitable for the subsequent light source color estimation processing based on the degree of coincidence of luminance. In the present embodiment, the degree of coincidence refers to the sum of absolute values of luminance differences after aligning two images. For example, FIG. 7 indicates the size of a portion that does not overlap when two luminances are compared.

図7(c)に示す被写体84,85,86の信号91,92,93は鏡面反射を強く含む領域84a,85a,86aでは像の一致度が低い。一方でその周辺部や被写体80のエッジでは非常に良く一致する。   Signals 91, 92, and 93 of the subjects 84, 85, and 86 shown in FIG. 7C have low image coincidence in the regions 84a, 85a, and 86a that strongly include specular reflection. On the other hand, in the peripheral part and the edge of the subject 80, they match very well.

詳細は後述するが、被写体上の同じ位置を観察していても鏡面反射成分は視差によって大きく異なっている。図7(c)の位置84a、85b、86cの部分のように部分的に信号の一致度が低い場合は鏡面反射成分を含むことが考えられるため光源色推定処理に用いるのに適している。換言すれば、視差画像の位置合わせの処理において輝度の一致度が予め定められた範囲となる画像中の部分領域の情報を用いて光源色推定処理を行うと都合が良い。   Although details will be described later, even when the same position on the subject is observed, the specular reflection component varies greatly depending on the parallax. When the signal coincidence is partially low as in the positions 84a, 85b, and 86c in FIG. 7C, it is considered that a specular reflection component is included, so that it is suitable for use in the light source color estimation process. In other words, it is convenient to perform the light source color estimation process using information on partial areas in the image in which the degree of coincidence of luminance is in a predetermined range in the process of aligning parallax images.

像の一致度が非常に高い箇所は、鏡面反射ではなく拡散反射成分が支配的で視差間の像の差がほとんどないことが想定される。他方、像の一致度が非常に低い箇所は、オクルージョンや被写体の位置合わせに用いる枠内に距離の異なる物体が複雑に混在している場合が考えられる。これらの場合は、鏡面反射成分を抽出する場面として適しているとは言えない。従って、これらの間における一致度のうち、光源色推定に用いるのに適した一致度の範囲を例えば実験的に求めておく。   It is assumed that the part where the degree of coincidence of images is very high is not specular reflection but diffuse reflection component is dominant and there is almost no difference in image between parallaxes. On the other hand, in a place where the degree of coincidence of images is very low, it is conceivable that objects with different distances are mixedly mixed in a frame used for occlusion and object positioning. In these cases, it cannot be said that it is suitable as a scene for extracting a specular reflection component. Therefore, of the coincidence between these, a range of coincidence suitable for use in light source color estimation is obtained, for example, experimentally.

別の例として、位置合わせに用いる画像内の一部の領域で一致度が高く、一部の領域で一致度が低い場合に、一致度が低い部分的な領域を利用して光源色推定処理を行うこともできる。これは図7(c)のように鏡面反射光により像の一致度が低下している場合を考えると、鏡面反射光の影響を受ける範囲のみ一致度が低下し、他の部分では一致度が高くなることを利用している。すなわち図7(c)の拡散反射光のレベル95にある部分(被写体である植木鉢の右側付近)や背景は一致度が高く、鏡面反射光を含む領域84a,85a,86aでは像の一致度が低い。一部分のみ一致度が低い場合は、オクルージョンが生じている場合を除いて、光源の鏡面反射の影響を受けている可能性が高い。   As another example, when the degree of coincidence is high in some areas in the image used for alignment and the degree of coincidence is low in some areas, light source color estimation processing is performed using a partial area with low coincidence. Can also be done. Considering the case where the degree of coincidence of the image is lowered due to the specular reflection light as shown in FIG. 7C, the degree of coincidence is reduced only in the range affected by the specular reflection light, and the degree of coincidence is reduced in other parts. Take advantage of becoming higher. That is, the portion at the diffuse reflection light level 95 in FIG. 7C (near the right side of the subject flowerpot) and the background have a high degree of coincidence, and the regions 84a, 85a, and 86a including the specular reflection light have a coincidence of images. Low. When only a part of the degree of coincidence is low, there is a high possibility of being affected by the specular reflection of the light source except when occlusion occurs.

視差画像位置合わせ部502は、視差画像の位置合わせ処理に加えて輝度の一致度を算出する。視差画像位置合わせ部502は、視差画像から対応する画像位置の輝度値を取得して、例えば輝度の差分絶対値の和を一致度として算出する。算出した一致度が、実験等の方法により予め設定された値の範囲に属する場合は、画素位置と対応させた情報にフラグを立てて光源色推定に適した領域(光源色推定対象領域)であることを示す。他方、一致度が設定された値の範囲から外れるときは、フラグを立てずに光源色推定に適さない領域であることを示す。   The parallax image alignment unit 502 calculates the degree of coincidence of luminance in addition to the parallax image alignment process. The parallax image alignment unit 502 acquires the luminance value of the corresponding image position from the parallax image, and calculates, for example, the sum of the absolute difference values of luminance as the degree of coincidence. When the calculated degree of coincidence belongs to a range of values set in advance by a method such as an experiment, a flag is set on the information corresponding to the pixel position and the region is suitable for light source color estimation (light source color estimation target region). It shows that there is. On the other hand, when the degree of coincidence falls outside the set value range, it indicates that the region is not suitable for light source color estimation without setting a flag.

輝度差算出部503は、視差画像位置合わせ部502で位置合わせされた視差画像間の対応する画素位置に関する情報を取得する(対応点取得)。輝度差算出部503は、対応点取得によって得られた視差画像の対応する画素位置において、それぞれの視差画像の対応する画素位置の輝度値を取得してその差分を算出する。輝度差算出部503は、対応する画素位置の情報が存在する全ての画素について輝度差を算出してもよいが、視差画像位置合わせ部502にてフラグが立てられた領域のみ輝度差を算出してもよい。   The luminance difference calculation unit 503 acquires information regarding the corresponding pixel positions between the parallax images aligned by the parallax image alignment unit 502 (acquisition of corresponding points). The luminance difference calculation unit 503 acquires the luminance value of the corresponding pixel position of each parallax image and calculates the difference at the corresponding pixel position of the parallax image obtained by the corresponding point acquisition. The luminance difference calculation unit 503 may calculate the luminance difference for all the pixels for which information on the corresponding pixel position exists, but calculates the luminance difference only for the region flagged by the parallax image alignment unit 502. May be.

輝度差算出部503は、視差画像が3以上の場合には、各画素位置におけるこれらの視差画像の輝度値のうち最大値と最小値の差を求める。これについては光源色推定処理において更に説明する。   When the parallax image is 3 or more, the luminance difference calculation unit 503 obtains a difference between the maximum value and the minimum value among the luminance values of these parallax images at each pixel position. This will be further described in the light source color estimation process.

以上のように、輝度差の算出は視差画像の対応する画素位置の単位で求められるため、画像全体で統計処理をした場合のように他の様々な被写体の影響を受けて推定精度が低下する問題を軽減することができる。   As described above, since the calculation of the luminance difference is obtained in units of the corresponding pixel positions of the parallax image, the estimation accuracy decreases due to the influence of various other subjects as in the case of performing statistical processing on the entire image. The problem can be reduced.

(光源色推定処理)
次に、図1を用いて反射光の状態と光源色推定処理の動作について説明する。図1(a)は被写体がランバート面の場合の拡散反射光の状態を示す図を、図1(b)は鏡面反射光の状態を示す図である。また図1(c)は拡散反射光および鏡面反射光を含む光線を撮像装置でとらえる様子を模式的に示す図を、図1(d)は平行光が物体に当たっている状態を撮像装置でとらえる様子とその時の信号の状態を示す図である。
(Light source color estimation process)
Next, the state of the reflected light and the operation of the light source color estimation process will be described with reference to FIG. FIG. 1A is a diagram showing the state of diffuse reflected light when the subject is a Lambertian surface, and FIG. 1B is a diagram showing the state of specular reflected light. FIG. 1 (c) is a diagram schematically showing how the imaging device captures light rays including diffuse reflection light and specular reflection light, and FIG. 1 (d) shows the imaging device capturing a state in which parallel light strikes an object. It is a figure which shows the state of the signal at that time.

図1(a)において、50は物体を、51は光線を、52は拡散反射光を、θは光線51の入射角を示す。図1(b)において、53は鏡面反射光を、61は光線51の正反射方向を示す線を示す。図1(c)において、3は撮影光学部を、4は撮影光軸を、6は撮像素子であり、54は拡散反射光と鏡面反射光を加えた反射光を示す。また30−a、30−eは図5(c)と対応する撮影光学部3の特定の瞳領域である。φaは30−aと正反射方向61がなす角を、φeは30−eと正反射方向61がなす角である。図1(d)において、50a,50b,50c,50dは物体50上の点を、6a,6b,6c,6dは撮像素子6上の物体上の点50a,50b,50c,50dのそれぞれに対応する点を表す。51a,51b,51c,51dは点50a,50b,50c,50dに入射する光線を、61a,61b,61c,61dは光線51a,51b,51c,51dの正反射方向を示す線である。52−a,52−eは瞳領域30−a、30−eを通過した信号の輝度を、53は瞳領域30−aを通過して点50c上の輝度を、54は瞳領域30−eを通過して点50c上の輝度を、55は拡散反射光のレベルをそれぞれ示している。 In FIG. 1A, 50 indicates an object, 51 indicates a light beam, 52 indicates diffusely reflected light, and θ indicates the incident angle of the light beam 51. In FIG. 1B, 53 indicates specular reflection light, and 61 indicates a line indicating the regular reflection direction of the light beam 51. In FIG. 1C, 3 is a photographing optical unit, 4 is a photographing optical axis, 6 is an image sensor, and 54 is reflected light obtained by adding diffuse reflection light and specular reflection light. Reference numerals 30-a and 30-e denote specific pupil regions of the photographing optical unit 3 corresponding to FIG. φ a is an angle formed by 30-a and the regular reflection direction 61, and φ e is an angle formed by 30-e and the regular reflection direction 61. In FIG. 1D, 50a, 50b, 50c, and 50d correspond to points on the object 50, and 6a, 6b, 6c, and 6d correspond to the points 50a, 50b, 50c, and 50d on the object on the image sensor 6, respectively. Represents a point. Reference numerals 51a, 51b, 51c, and 51d denote rays incident on the points 50a, 50b, 50c, and 50d, and reference numerals 61a, 61b, 61c, and 61d denote lines indicating the regular reflection directions of the rays 51a, 51b, 51c, and 51d. 52-a and 52-e indicate the luminance of the signal that has passed through the pupil regions 30-a and 30-e, 53 indicates the luminance on the point 50c through the pupil region 30-a, and 54 indicates the pupil region 30-e. , The luminance on the point 50c passing through, and 55 indicates the level of diffuse reflected light.

以下に説明する反射モデルはいわゆる2色性反射モデルに基づいている。2色性反射モデルは公知であり、その詳細については、例えば「ディジタル画像処理」 CG-ARTS協会 P.281などを参照されたい。   The reflection model described below is based on a so-called dichroic reflection model. The dichroic reflection model is known, and for details, refer to “Digital Image Processing” CG-ARTS Association P.281, for example.

まず拡散反射を考える。拡散反射光は多くの場合完全に乱反射するような反射でモデル化され、ランバート反射(このような反射をする面をランバート面)と呼ばれる。図1(a)はランバート面でモデル化された反射特性を図示しており、52は各方向への反射が均一な様子を分かりやすく示すために反射光の強度の包絡線で示されている。拡散反射光は見る方向によって輝度が変化しないことが特徴である。これを式で記載すると次のようになる。
Ld(λ)=Ie(λ)Kd (λ)cosθ ・・・(1)
ただしLd(λ)は拡散反射光の輝度、Ie(λ)は光源の輝度、Kd(λ)は拡散反射特性、θは入射角である。
First, consider diffuse reflection. In many cases, the diffusely reflected light is modeled by reflection that completely diffusely reflects, and is called Lambertian reflection (a surface that performs such reflection is a Lambertian surface). FIG. 1A illustrates the reflection characteristics modeled on a Lambertian surface, and 52 is indicated by an envelope of the intensity of reflected light for easy understanding of how the reflection in each direction is uniform. . The diffuse reflected light is characterized in that the luminance does not change depending on the viewing direction. This can be expressed as follows.
Ld (λ) = Ie (λ) Kd (λ) cosθ (1)
However, Ld (λ) is the luminance of the diffuse reflected light, Ie (λ) is the luminance of the light source, Kd (λ) is the diffuse reflection characteristic, and θ is the incident angle.

次に鏡面反射を考える。本実施形態ではCGなどで多く利用されているフォンモデルを示す。鏡面反射光は多くのモデルが提案されているため他のモデルを用いても良い。正反射方向となす角によって大きく輝度が変化するという特徴を利用していれば適用可能である。図1(b)はフォン反射モデルでモデル化された反射特性を図示しており、光線51の正反射方向61に強いピークを持ち角度が変わると急に減衰する。観察する方向によって反射光が変化する様子を分かりやすく示すために反射光の強度の包絡線を53で示した。これを式で記載すると次のようになる。
Ls(λ)=Ie(λ) (cosφ)n ・・・(2)
ただしLs(λ)は鏡面反射光の輝度、φは正反射方向と観察方向のなす角、nは物体の特性によって決まる定数である。数式(2)において鏡面反射光の波長特性は光源の特性と同じという仮定を暗黙に利用している。
Next, specular reflection is considered. In the present embodiment, a phone model frequently used in CG or the like is shown. Since many models of specular reflected light have been proposed, other models may be used. The present invention can be applied if the feature that the luminance greatly changes depending on the angle formed with the regular reflection direction is used. FIG. 1B illustrates the reflection characteristics modeled by the Phong reflection model, which has a strong peak in the regular reflection direction 61 of the light beam 51 and suddenly attenuates when the angle changes. In order to clearly show how the reflected light changes depending on the direction of observation, an envelope of the intensity of the reflected light is indicated by 53. This can be expressed as follows.
Ls (λ) = Ie (λ) (cosφ) n ... (2)
Where Ls (λ) is the brightness of the specular reflection light, φ is the angle between the specular reflection direction and the observation direction, and n is a constant determined by the characteristics of the object. In Equation (2), the assumption that the wavelength characteristic of the specular reflected light is the same as the characteristic of the light source is implicitly used.

観察対象は上記の鏡面反射光と拡散反射光の合成したものであるから、視点pから観察した場合は次の式のように記述される。
L(λ)= Ld(λ) +Ls(λ) =Ie(λ)Kd (λ)cosθ + Ie(λ) (cosφp)n ・・・(3)
ただし、L(λ)は拡散反射光と鏡面反射光を合わせた反射光の輝度、φpは正反射方向と視点pとのなす角である。
Since the observation target is a combination of the specular reflection light and the diffuse reflection light, the observation target is described as the following expression when observed from the viewpoint p.
L (λ) = Ld (λ) + Ls (λ) = Ie (λ) Kd (λ) cosθ + Ie (λ) (cosφ p ) n (3)
However, L (λ) is the luminance of the reflected light obtained by combining the diffuse reflection light and the specular reflection light, and φ p is the angle formed between the specular reflection direction and the viewpoint p.

次に図1(c)を用いて光線の状態について説明する。画像処理装置は、図1(c)に示すように拡散反射光と鏡面反射光が合成された複雑な輝度分布54が処理対象となる。この時、瞳領域30−eを通過する光束は正反射方向61となす角が小さく、この時、瞳領域30−aを通過する光束は正反射方向61となす角が大きい。数式(3)によれば瞳領域30−aと瞳領域30−eを通過する光束を比較した場合に、拡散反射光は同じ量含まれているが、鏡面反射光は強度が異なる。   Next, the state of the light beam will be described with reference to FIG. In the image processing apparatus, as shown in FIG. 1C, a complex luminance distribution 54 in which diffuse reflection light and specular reflection light are combined is a processing target. At this time, the light beam passing through the pupil region 30-e has a small angle with the regular reflection direction 61, and at this time, the light beam passing through the pupil region 30-a has a large angle with the regular reflection direction 61. According to Equation (3), when the light fluxes passing through the pupil region 30-a and the pupil region 30-e are compared, the same amount of diffuse reflected light is included, but the intensity of the specular reflected light is different.

本実施形態で示す画像処理装置は、MLAを利用すれば瞳の通過領域を分別して光束を取得可能であるから、光源色推定には分別して取得した拘束を利用する。画像処理装置は、瞳領域30−aから物体50上の点50aを見た信号と、瞳領域30−eから物体50上の点50aを見た信号の差をとればよい。式で示すと以下のようになる。
Ldiff(λ)= Le(λ) − La(λ)
=(Ie(λ)Kd (λ)cosθ + Ie(λ) (cosφe)n)
− (Ie(λ)Kd (λ)cosθ + Ie(λ) (cosφa)n)
= Ie(λ){ (cosφe)n −(cosφa)n } ・・・(4)
ただし、Ldiff(λ)は、瞳領域30−aから物体50上の点50aを見た信号と瞳領域30−eから物体50上の点50aを見た信号の差を表す。La(λ)、Le(λ)はそれぞれ瞳領域30−aから物体50上の点50aを見た信号と瞳領域30−eから物体50上の点50aを見た信号を表す。φa、φeはそれぞれ瞳領域30−aから物体50上の点50aに向かう線と正反射方向61となす角、瞳領域30−eから物体50上の点50aに向かう線と正反射方向61となす角である。
Since the image processing apparatus shown in the present embodiment can acquire the luminous flux by classifying the pupil passage area by using MLA, the constraint acquired by classification is used for light source color estimation. The image processing apparatus only needs to take a difference between a signal when the point 50a on the object 50 is viewed from the pupil region 30-a and a signal when the point 50a on the object 50 is viewed from the pupil region 30-e. This is expressed as follows.
L diff (λ) = L e (λ) − L a (λ)
= (Ie (λ) Kd (λ) cosθ + Ie (λ) (cosφ e ) n )
− (Ie (λ) Kd (λ) cosθ + Ie (λ) (cosφ a ) n )
= Ie (λ) {(cosφ e ) n − (cosφ a ) n } (4)
However, L diff (λ) represents a difference between a signal when the point 50a on the object 50 is viewed from the pupil region 30-a and a signal when the point 50a on the object 50 is viewed from the pupil region 30-e. L a (λ) and L e (λ) represent a signal when the point 50a on the object 50 is viewed from the pupil region 30-a and a signal when the point 50a on the object 50 is viewed from the pupil region 30-e, respectively. φ a and φ e are the angles formed between the line from the pupil region 30-a to the point 50 a on the object 50 and the specular reflection direction 61, and the line from the pupil region 30-e to the point 50 a on the object 50 and the specular reflection direction. This is the angle between 61 and 61.

数式(4)を見ると明らかなように、”(cosφe)n −(cosφa)n”は視点によって決まる定数であり波長依存性を持たない。光源の色(波長特性)はLdiff(λ)と比例している。そのためLdiff(λ)から光源の波長特性を知ることが可能となる。このように光源の波長特性を知ることを本実施形態では光源色推定と呼んでいる。 As is clear from Equation (4), “(cosφ e ) n − (cos φ a ) n ” is a constant determined by the viewpoint and has no wavelength dependency. The color (wavelength characteristic) of the light source is proportional to L diff (λ). Therefore, it is possible to know the wavelength characteristics of the light source from L diff (λ). In this embodiment, knowing the wavelength characteristics of the light source is called light source color estimation.

図1(d)を用いて実際の撮影状況と数式(4)の関係について説明する。図1(d)は平行光が物体50にあたって、その反射光を撮像している様子を示している。図1(c)の説明では省略したが、撮像素子6上には物体の様々な個所の反射光が結像している。すなわち数式(4)などは位置の関数になっている。例えば図1(d)においては物体50上の点50a,50b,50c,50dはそれぞれ撮像素子上の点6a,6b,6c,6dに対応している。図1(d)の例では簡単のために主レンズピントは物体50にあっているように記載した。つまり瞳通過領域によらず物体側の点は撮像素子上の同じ位置に結像している。一方で、主レンズピントが物体50にあっていない場合は瞳通過領域によって結像する位置がずれる。(これは位相差AFの原理としてよく知られているので説明は省略する。)
このような状況で得られる信号は図1(d)の下段のような信号になる。瞳領域30−aを通過した信号は52−a、瞳領域30−eを通過した信号は52−eとして図示した。ここで物体の拡散反射光レベル55は数式(1)、数式(3)のLd(λ)に対応している。
The relationship between the actual shooting situation and Equation (4) will be described with reference to FIG. FIG. 1D shows a state in which parallel light strikes the object 50 and the reflected light is imaged. Although omitted in the description of FIG. 1C, reflected light from various parts of the object is imaged on the image sensor 6. That is, Equation (4) is a function of position. For example, in FIG. 1D, points 50a, 50b, 50c, and 50d on the object 50 correspond to points 6a, 6b, 6c, and 6d on the image sensor, respectively. In the example of FIG. 1D, the main lens focus is described as being in contact with the object 50 for simplicity. That is, the object-side point is imaged at the same position on the image sensor regardless of the pupil passing area. On the other hand, when the main lens focus is not on the object 50, the image forming position is shifted by the pupil passing region. (This is well known as the principle of phase difference AF, so the description is omitted.)
The signal obtained in such a situation is a signal as shown in the lower part of FIG. The signal passing through the pupil region 30-a is shown as 52-a, and the signal passing through the pupil region 30-e is shown as 52-e. Here, the diffuse reflection light level 55 of the object corresponds to Ld (λ) in the equations (1) and (3).

図1(d)の例では53は物体上の点50cから瞳領域30−aを通過した場合の信号を、54は物体上の点50cから瞳領域30−eを通過した場合の信号を表す。信号53,54に注目すると、鏡面反射光の影響で像の一致度が低下している。これは、図7を用いて説明した状況である。図7を用いて説明したように、図1(d)には不図示の物体の輪郭などで信号52−aと52−eの位置合わせがなされる。さらに、信号53は数式(4)のLa(λ)に対応しており、信号54は数式(4)のLe(λ)に対応している。信号53と信号53では鏡面反射光の大きさが大きく異なるのでこの差から光源色推定を行うことができる。 In the example of FIG. 1D, 53 indicates a signal when the point 50c on the object passes through the pupil region 30-a, and 54 indicates a signal when the point 50c on the object passes through the pupil region 30-e. . When attention is paid to the signals 53 and 54, the degree of coincidence of images is lowered due to the influence of specular reflection light. This is the situation described with reference to FIG. As described with reference to FIG. 7, in FIG. 1D, the signals 52-a and 52-e are aligned based on the contour of an object (not shown). Further, the signal 53 corresponds to L a (λ) in Expression (4), and the signal 54 corresponds to L e (λ) in Expression (4). Since the size of the specular reflected light differs greatly between the signal 53 and the signal 53, the light source color can be estimated from this difference.

さらに一般的に考えると視点は2つよりも多い複数個である場合が考えられるこのような場合には次の式に従えばよい。
Ldiff(λ)= max{Li(λ)} − min{Li(λ)} (i=1,2,…,N) ・・・(5)
ただしmaxは輝度最大の視点を選択する演算子、minは輝度最小の視点を選択する演算子、iは視点に対応する添え字、Nは視点数である。数式(5)において輝度最大、輝度最小としたのは、波長(λの値)ごとに最も大きいものと小さいものの差をとるのではなく、輝度が最大の視点位置と輝度が最小の視点位置を選択したのちに、視点間で波長ごとの値を求めることを示すものである。
More generally, in the case where there are more than two viewpoints, the following equation may be used.
L diff (λ) = max {L i (λ)} − min {L i (λ)} (i = 1,2,…, N) (5)
Here, max is an operator that selects the viewpoint with the highest luminance, min is an operator that selects the viewpoint with the lowest luminance, i is a subscript corresponding to the viewpoint, and N is the number of viewpoints. In Equation (5), the maximum brightness and the minimum brightness are not the difference between the largest and the smallest for each wavelength (value of λ), but the viewpoint position with the highest brightness and the viewpoint with the lowest brightness. It shows that after selection, a value for each wavelength is obtained between viewpoints.

数式(5)は数式(4)の自然な拡張になっている。数式(5)によると数式(4)と異なり2より多い視差を一般的に扱うことが可能となる。また最大値と最小値の差を利用することで、S/N比が良い状態で光源色推定を行うことが可能となる。特に多数の視差画像がある場合は、鏡面反射光を強く含む視点が含まれる可能性がある。このような視点の情報を積極的に活用するには数式(5)を用いると都合が良い。   Equation (5) is a natural extension of Equation (4). According to the equation (5), unlike the equation (4), more than two parallaxes can be generally handled. Further, by using the difference between the maximum value and the minimum value, it is possible to perform light source color estimation with a good S / N ratio. In particular, when there are a large number of parallax images, a viewpoint that strongly includes specular reflection light may be included. It is convenient to use Equation (5) to actively use such viewpoint information.

図1(b)や数式(2)から分かるように、物体の特性によって決まる定数nが大きい場合は正反射方向と観察方向のなす角が大きくなると鏡面反射光の輝度が急激に減衰する。光源色を正しく(S/N比が良い状態で)推定するためには、正反射方向に近い視点があると有利になる。換言すれば、数式(5)を用いて多数の視点を利用することによって、2つの視点を利用する場合に比べてより精度よく光源推定を行うことができる。   As can be seen from FIG. 1B and Equation (2), when the constant n determined by the characteristics of the object is large, the brightness of the specular reflected light is rapidly attenuated when the angle formed between the specular reflection direction and the observation direction is increased. In order to correctly estimate the light source color (with a good S / N ratio), it is advantageous to have a viewpoint close to the regular reflection direction. In other words, by using a large number of viewpoints using Equation (5), it is possible to perform light source estimation more accurately than when using two viewpoints.

図1(d)のように視点によって鏡面反射光の取得状態が異なるということは多くの場面で起こりうる。図8は視点による鏡面反射光の取得状態の異なる例を模式的に示したものである。図8(a)は曲面の物体50に平行光が当たっている状況を、図8(b)は平面に対して拡散光(光源が近い位置にある場合に対応)が当たっている状況をそれぞれ示した。図8に用いる記号は図1(d)と同じものには同じ番号を付した。   As shown in FIG. 1D, the specular reflection light acquisition state varies depending on the viewpoint, which can occur in many situations. FIG. 8 schematically shows an example of different specular reflection light acquisition states depending on the viewpoint. FIG. 8A shows a situation in which parallel light hits a curved object 50, and FIG. 8B shows a situation in which diffused light (corresponding to the case where the light source is close to the plane) is hit. Indicated. The symbols used in FIG. 8 are the same as those in FIG.

図8(a)および図8(b)の例では、いずれも瞳領域30−aを通過した信号52−aは物体上の点50b近傍に鏡面反射光のピークを持ち、瞳領域30−eを通過した信号52−eは物体上の点50c近傍に鏡面反射光のピークをもつ。ここで大切なことは視点の違いによって鏡面反射光が異なり、拡散反射光が等しいことである。この特性を利用すれば、被写体が曲面物体である場合や光源が近い場合であっても数式(4)または数式(5)を利用して光源色の推定を行うことが可能となる。   In the examples of FIGS. 8A and 8B, the signal 52-a that has passed through the pupil region 30-a has a peak of specular reflection light near the point 50b on the object, and the pupil region 30-e. The signal 52-e that has passed through has a peak of specular reflection light near the point 50c on the object. What is important here is that the specular reflection light differs depending on the viewpoint, and the diffuse reflection light is equal. If this characteristic is used, it is possible to estimate the light source color using Equation (4) or Equation (5) even when the subject is a curved object or when the light source is close.

光源色推定部504は、輝度差算出部503が生成した輝度差を用いて光源推定を行う画素位置を決定し、この画素位置におけるR,G,B各色の輝度差の組み合わせから光源の色を推定する。視差画像が3以上の場合には、上述のように輝度差算出部503は、視差画像間の輝度差の算出において、各画素位置におけるこれらの視差画像の輝度値のうち最大値と最小値の差を求める。これは、輝度が最大の視点位置と輝度が最小の視点位置の組み合わせを選択することに相当する。光源色推定部504は、これらの視点位置を構成する各視差画像からR,G,B各色の輝度差の組み合わせを求め、光源の色を推定する。   The light source color estimation unit 504 determines a pixel position for performing light source estimation using the luminance difference generated by the luminance difference calculation unit 503, and determines the color of the light source from the combination of the luminance differences of the R, G, and B colors at this pixel position. presume. When the number of parallax images is 3 or more, as described above, the luminance difference calculation unit 503 calculates the maximum and minimum values of the luminance values of these parallax images at each pixel position in calculating the luminance difference between the parallax images. Find the difference. This corresponds to selecting a combination of a viewpoint position with the highest luminance and a viewpoint position with the lowest luminance. The light source color estimation unit 504 obtains a combination of luminance differences of R, G, and B colors from the parallax images constituting these viewpoint positions, and estimates the color of the light source.

このように輝度差を算出することによって簡易な演算で鏡面反射光を抽出することができる。そして、鏡面反射光から容易に光源色を推定することができるため、全体として簡単な方法で視差画像から光源色を推定することができる。また、視差画像の数が増えた場合においても、輝度の差が最大となる視点を選択するだけであるから、計算量の増加が抑えられる。   By calculating the luminance difference in this way, the specular reflection light can be extracted with a simple calculation. Since the light source color can be easily estimated from the specular reflection light, the light source color can be estimated from the parallax image by a simple method as a whole. Further, even when the number of parallax images increases, only the viewpoint that maximizes the difference in luminance is selected, so that an increase in calculation amount can be suppressed.

本実施形態によれば、同時に露光した視差画像について処理を行うことができるから、動画像撮影における光源色推定に適用することが可能であり、ひいては動画像撮影におけるホワイトバランスの処理も可能となる。   According to this embodiment, since it is possible to perform processing on the simultaneously exposed parallax images, it can be applied to light source color estimation in moving image shooting, and in addition, white balance processing in moving image shooting can also be performed. .

以上に説明したように本発明によれば、簡便な構成で精度の良い光源色の推定が可能な画像処理装置、その制御方法およびプログラムを提供することができる。   As described above, according to the present invention, it is possible to provide an image processing apparatus capable of accurately estimating a light source color with a simple configuration, a control method thereof, and a program.

[その他の実施形態]
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
[Other Embodiments]
The present invention can also be realized by executing the following processing. That is, software (program) that realizes 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, or the like) of the system or apparatus reads the program. It is a process to be executed.

Claims (11)

露光時間が重複した複数の視差画像を取得する取得手段と、
前記複数の視差画像間の対応する画素位置を取得する対応点取得手段と、
前記複数の視差画像間の前記対応する画素位置における輝度差を算出する算出手段と、
算出手段により算出された前記輝度差から光源色を推定する推定手段を有することを特徴とする画像処理装置。
Obtaining means for obtaining a plurality of parallax images with overlapping exposure times;
Corresponding point acquisition means for acquiring corresponding pixel positions between the plurality of parallax images;
Calculating means for calculating a luminance difference at the corresponding pixel position between the plurality of parallax images;
An image processing apparatus comprising: an estimation unit that estimates a light source color from the luminance difference calculated by the calculation unit.
前記推定手段は、前記算出手段により算出した輝度差が、鏡面反射成分であるものとして光源色を推定することを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the estimation unit estimates a light source color on the assumption that the luminance difference calculated by the calculation unit is a specular reflection component. 前記取得手段により3以上の視差画像を取得した場合、前記算出手段は、前記対応する画素位置における最大輝度差を前記輝度差として算出することを特徴とする請求項1または請求項2に記載の画像処理装置。   3. The method according to claim 1, wherein, when three or more parallax images are acquired by the acquisition unit, the calculation unit calculates a maximum luminance difference at the corresponding pixel position as the luminance difference. Image processing device. 前記算出手段および前記推定手段が、視差画像の部分領域ごとに前記輝度差の算出及び前記光源色の推定を行うことを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the calculation unit and the estimation unit calculate the luminance difference and estimate the light source color for each partial region of the parallax image. . 前記算出手段は、輝度の一致度が予め定められた範囲である部分領域について前記輝度差を算出することを特徴とする請求項4に記載の画像処理装置。   The image processing apparatus according to claim 4, wherein the calculation unit calculates the luminance difference for a partial region whose luminance matching degree is a predetermined range. 前記複数の視差画像に対してケラレ補正を行う補正手段をさらに有し、
前記算出手段は、前記補正手段が補正した視差画像を用いて前記輝度差を算出することを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。
A correction unit that performs vignetting correction on the plurality of parallax images;
The image processing apparatus according to claim 1, wherein the calculation unit calculates the luminance difference using the parallax image corrected by the correction unit.
請求項1乃至6のいずれか1項に記載の画像処理装置を有する撮像装置であって、
前記取得手段が、直線上あるいは格子状に配置された多眼撮像装置であることを特徴とする撮像装置。
An imaging apparatus comprising the image processing apparatus according to any one of claims 1 to 6,
An image pickup apparatus, wherein the acquisition means is a multi-lens image pickup apparatus arranged on a straight line or in a grid pattern.
請求項1乃至6のいずれか1項に記載の画像処理装置を有する撮像装置であって、
前記取得手段が、光束の位置と角度の情報を取得する撮像手段であることを特徴とする撮像装置。
An imaging apparatus comprising the image processing apparatus according to any one of claims 1 to 6,
An image pickup apparatus, wherein the acquisition means is an image pickup means for acquiring information on a position and an angle of a light beam.
請求項1乃至6のいずれか1項に記載の画像処理装置を有する撮像装置であって、
前記取得手段が、異なる瞳領域を通過した光束を受光する画素を有する撮像素子を有する撮像手段であることを特徴とする撮像装置。
An imaging apparatus comprising the image processing apparatus according to any one of claims 1 to 6,
An image pickup apparatus, wherein the acquisition means is an image pickup means having an image pickup element having pixels that receive light beams that have passed through different pupil regions.
取得手段が、露光時間が重複した複数の視差画像を取得する工程と、
対応点取得手段が、前記複数の視差画像間の対応する画素位置を取得する対応点取得工程と、
算出手段が、前記複数の視差画像間の前記対応する画素位置における輝度差を算出する算出工程と、
推定手段が、前記算出工程で算出された前記輝度差から光源色を推定する推定工程とを有することを特徴とする画像処理装置の制御方法。
An obtaining unit obtaining a plurality of parallax images with overlapping exposure times;
Corresponding point acquisition means acquires a corresponding pixel position between the plurality of parallax images; and
A calculating step of calculating a luminance difference at the corresponding pixel position between the plurality of parallax images;
A control method for an image processing apparatus, comprising: an estimation unit including an estimation step of estimating a light source color from the luminance difference calculated in the calculation step.
コンピュータを、請求項1乃至6のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the image processing apparatus of any one of Claims 1 thru | or 6.
JP2013266127A 2013-12-24 2013-12-24 Image processing apparatus, control method thereof, and program Active JP6381206B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013266127A JP6381206B2 (en) 2013-12-24 2013-12-24 Image processing apparatus, control method thereof, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013266127A JP6381206B2 (en) 2013-12-24 2013-12-24 Image processing apparatus, control method thereof, and program

Publications (3)

Publication Number Publication Date
JP2015122669A true JP2015122669A (en) 2015-07-02
JP2015122669A5 JP2015122669A5 (en) 2017-02-09
JP6381206B2 JP6381206B2 (en) 2018-08-29

Family

ID=53533928

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013266127A Active JP6381206B2 (en) 2013-12-24 2013-12-24 Image processing apparatus, control method thereof, and program

Country Status (1)

Country Link
JP (1) JP6381206B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017187994A (en) * 2016-04-07 2017-10-12 富士ゼロックス株式会社 Image processing apparatus, image processing method, image processing system, and program
JP2017215851A (en) * 2016-06-01 2017-12-07 キヤノン株式会社 Image processing device, image processing method, and molding system
WO2019017290A1 (en) * 2017-07-20 2019-01-24 エフ・エーシステムエンジニアリング株式会社 Stereoscopic image display device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001016613A (en) * 1999-06-29 2001-01-19 Fuji Photo Film Co Ltd Parallax image pickup device and parallax image processing device and method
JP2012156882A (en) * 2011-01-27 2012-08-16 Canon Inc Solid state imaging device
JP2012220790A (en) * 2011-04-11 2012-11-12 Canon Inc Imaging apparatus
JP2013509092A (en) * 2009-10-20 2013-03-07 アップル インコーポレイテッド System and method for detection and correction of defective pixels in an image sensor
US20130308011A1 (en) * 2012-05-16 2013-11-21 Canon Kabushiki Kaisha Image pickup apparatus and image processing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001016613A (en) * 1999-06-29 2001-01-19 Fuji Photo Film Co Ltd Parallax image pickup device and parallax image processing device and method
JP2013509092A (en) * 2009-10-20 2013-03-07 アップル インコーポレイテッド System and method for detection and correction of defective pixels in an image sensor
JP2012156882A (en) * 2011-01-27 2012-08-16 Canon Inc Solid state imaging device
JP2012220790A (en) * 2011-04-11 2012-11-12 Canon Inc Imaging apparatus
US20130308011A1 (en) * 2012-05-16 2013-11-21 Canon Kabushiki Kaisha Image pickup apparatus and image processing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017187994A (en) * 2016-04-07 2017-10-12 富士ゼロックス株式会社 Image processing apparatus, image processing method, image processing system, and program
JP2017215851A (en) * 2016-06-01 2017-12-07 キヤノン株式会社 Image processing device, image processing method, and molding system
WO2019017290A1 (en) * 2017-07-20 2019-01-24 エフ・エーシステムエンジニアリング株式会社 Stereoscopic image display device

Also Published As

Publication number Publication date
JP6381206B2 (en) 2018-08-29

Similar Documents

Publication Publication Date Title
US9998650B2 (en) Image processing apparatus and image pickup apparatus for adding blur in an image according to depth map
US8810713B2 (en) Image pickup apparatus and image pickup device for performing auto-focusing
KR20170106325A (en) Method and apparatus for multiple technology depth map acquisition and fusion
JP6220148B2 (en) Imaging apparatus and control method thereof
US20130229532A1 (en) Image processing device, image processing method, and program
JP2013123123A (en) Stereo image generation device, stereo image generation method and computer program for stereo image generation
JP2006279546A (en) Electronic camera, image processing program, and image processing method
KR20150047112A (en) Imaging apparatus and its control method, and storage medium
US11808561B2 (en) Electronic apparatus for controlling a projector to project an image onto a screen at an actual size length, control method thereof and computer readable storage medium
JP5857712B2 (en) Stereo image generation apparatus, stereo image generation method, and computer program for stereo image generation
JP6381206B2 (en) Image processing apparatus, control method thereof, and program
JP2015046019A (en) Image processing device, imaging device, imaging system, image processing method, program, and storage medium
CN105391934A (en) Focus-detection device, method for controlling the same, and image capture apparatus
JP2013097154A (en) Distance measurement device, imaging apparatus, and distance measurement method
JP2016001853A (en) Image processing system, imaging device, control method, and program
JP2016018116A (en) Focus adjustment device, focus adjustment method and program, and imaging apparatus
JP6346484B2 (en) Image processing apparatus and control method thereof
US10943328B2 (en) Image capturing apparatus, method for controlling same, and storage medium
JP6645711B2 (en) Image processing apparatus, image processing method, and program
JP2017161941A (en) Reproducer, imaging apparatus, and control method of reproducer
JP6157290B2 (en) REPRODUCTION DEVICE, REPRODUCTION DEVICE CONTROL METHOD, AND PROGRAM
JP2017227792A (en) Focus detector and focus detection method
KR101839357B1 (en) Imaging apparatus and imaging method
JP2016099432A (en) Focus detection device, and method, program and storage medium
US11790600B2 (en) Image processing device, imaging apparatus, image processing method, and recording medium

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161222

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161222

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171018

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20171204

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180130

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180731

R151 Written notification of patent or utility model registration

Ref document number: 6381206

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151