JP2021127998A - Distance information acquisition device and distance information acquisition method - Google Patents
Distance information acquisition device and distance information acquisition method Download PDFInfo
- Publication number
- JP2021127998A JP2021127998A JP2020020888A JP2020020888A JP2021127998A JP 2021127998 A JP2021127998 A JP 2021127998A JP 2020020888 A JP2020020888 A JP 2020020888A JP 2020020888 A JP2020020888 A JP 2020020888A JP 2021127998 A JP2021127998 A JP 2021127998A
- Authority
- JP
- Japan
- Prior art keywords
- distance information
- image
- shadow
- distance
- acquisition device
- 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
Links
Images
Landscapes
- Measurement Of Optical Distance (AREA)
- Stroboscope Apparatuses (AREA)
- Studio Devices (AREA)
Abstract
Description
本発明は、距離情報取得装置および距離情報取得方法に関する。 The present invention relates to a distance information acquisition device and a distance information acquisition method.
被写体を撮影した画像から、被写体の距離情報を取得する手法が知られている。例えば、同一被写体を異なる視点から撮影した1組の画像間の視差量に基づいて、画素ごとに距離情報を取得することができる(特許文献1)。各画素の値が距離情報を示す画像は、距離画像、デプスマップ、距離マップなどとも呼ばれる。 A method of acquiring distance information of a subject from an image of the subject is known. For example, distance information can be acquired for each pixel based on the amount of parallax between a set of images of the same subject taken from different viewpoints (Patent Document 1). An image in which the value of each pixel indicates distance information is also called a distance image, a depth map, a distance map, or the like.
取得した距離情報に誤差があると、距離情報を利用した処理の精度が低下する。例えば被写体を撮影した画像に対して仮想光源によるライティング効果を付加する場合、被写体の距離情報に誤差があると、ライティング効果が不自然になる可能性がある。したがって、距離情報のうち誤差を考慮すべき、信頼性の低い距離情報を検出することが望まれる。 If there is an error in the acquired distance information, the accuracy of processing using the distance information will decrease. For example, when adding a lighting effect by a virtual light source to an image of a subject, if there is an error in the distance information of the subject, the lighting effect may become unnatural. Therefore, it is desired to detect unreliable distance information in which an error should be taken into consideration.
本発明は、取得した距離情報のうち、信頼性の低い距離情報を検出することが可能な距離情報所得装置および距離情報取得方法の提供を目的とする。 An object of the present invention is to provide a distance information income device and a distance information acquisition method capable of detecting unreliable distance information among the acquired distance information.
上述の目的は、被写体の距離情報を取得する取得手段と、補助光源を発光させて撮影された第1の撮像画像を用いて、影領域と照明領域とを表す第1の影画像を生成する第1の生成手段と、距離情報と補助光源の位置情報とを用いて、第2の影画像を生成する第2の生成手段と、第1の影画像と第2の影画像との差異に基づいて、距離情報のうち、信頼性の低い距離情報を検出する検出手段と、を有することを特徴とする距離情報取得装置によって達成される。 The above-mentioned object is to generate a first shadow image representing a shadow area and an illumination area by using an acquisition means for acquiring distance information of a subject and a first captured image taken by emitting an auxiliary light source. The difference between the first shadow image and the second shadow image of the second generation means for generating the second shadow image by using the first generation means and the distance information and the position information of the auxiliary light source. Based on this, it is achieved by a distance information acquisition device characterized by having a detection means for detecting unreliable distance information among the distance information.
本発明によれば、取得した距離情報のうち、信頼性の低い距離情報を検出することが可能な距離情報所得装置および距離情報取得方法を提供することができる。 According to the present invention, it is possible to provide a distance information income device and a distance information acquisition method capable of detecting unreliable distance information among the acquired distance information.
以下、添付図面を参照して本発明をその例示的な実施形態に基づいて詳細に説明する。なお、以下の実施形態は特許請求の範囲に係る発明を限定しない。また、実施形態には複数の特徴が記載されているが、その全てが発明に必須のものとは限らず、また、複数の特徴は任意に組み合わせられてもよい。さらに、添付図面においては、同一若しくは同様の構成に同一の参照番号を付し、重複した説明は省略する。 Hereinafter, the present invention will be described in detail with reference to the accompanying drawings based on an exemplary embodiment. The following embodiments do not limit the invention according to the claims. Further, although a plurality of features are described in the embodiment, not all of them are essential to the invention, and the plurality of features may be arbitrarily combined. Further, in the attached drawings, the same or similar configurations are given the same reference numbers, and duplicate explanations are omitted.
なお、以下の実施形態では、本発明を撮像装置で実施する場合に関して説明する。しかし、本発明は画像処理が可能な任意の電子機器に対して適用可能である。このような電子機器には、ビデオカメラ、コンピュータ機器(パーソナルコンピュータ、タブレットコンピュータ、メディアプレーヤ、PDAなど)、携帯電話機、スマートフォン、ゲーム機、ロボット、ドローン、ドライブレコーダが含まれる。これらは例示であり、本発明は他の電子機器にも適用可能である。 In the following embodiments, a case where the present invention is carried out by an imaging device will be described. However, the present invention is applicable to any electronic device capable of image processing. Such electronic devices include video cameras, computer devices (personal computers, tablet computers, media players, PDAs, etc.), mobile phones, smartphones, game machines, robots, drones, drive recorders and the like. These are examples, and the present invention can be applied to other electronic devices.
●(第1実施形態)
(装置構成)
図1(a)は、本発明の実施形態に係る形状情報取得装置としての撮像装置100の機能構成例を示すブロック図である。図1(a)は上面図に相当する。ここで、撮像装置100はフラッシュやライトなどの補助光源101を利用した撮影が可能なデジタルスチルカメラである。補助光源101は撮像装置100が備えるものであってもよいし、撮像装置100に着脱可能な外付けタイプであってもよい。補助光源101は異なる方向から被写体を照明可能な構成を有する。ここでは、一例として、複数の発光源が同一円周上に配置された補助光源101を用いているが、一般的なフラッシュ装置を複数用いてもよい。図1におけるxyz座標系は、z軸が撮影光学系104の光軸140に平行であり、x軸は鉛直上方とy軸は互いに垂直であり、且つ光軸と垂直な軸とする。
● (1st embodiment)
(Device configuration)
FIG. 1A is a block diagram showing a functional configuration example of an
撮像装置100は、制御部108を有する。制御部108は例えばCPU(MPU、マイクロプロセッサとも呼ばれる)であり、ROM109に記憶されたプログラムをRAM107に読み込んで実行することにより、撮像装置100の各部の動作を制御し、撮像装置100の機能を実現する。なお、撮影光学系104が交換式の場合、制御部108は撮影光学系104が有するコントローラと通信し、撮影光学系104の動作を制御する。
The
ROM109は書き換え可能な不揮発性メモリであり、制御部108が実行するプログラム、撮像装置100の各種の設定値、GUIデータなどを記憶する。RAM107は、制御部108がプログラムを実行する際に用いたり、画像処理回路106が画像データを保持したりするために用いたりする。RAM107の一部はビデオメモリとして用いられてもよい。
The
画像処理回路106は、撮像素子105から得られる画像信号に対して予め定められた画像処理を適用し、信号や画像データを生成したり、各種の情報を取得および/または生成したりする。画像処理回路106は例えば特定の機能を実現するように設計されたASICのような専用のハードウェア回路であってもよいし、DSPのようなプログラマブルプロセッサがソフトウェアを実行することで特定の機能を実現する構成であってもよい。
The
ここで、画像処理回路106が適用する画像処理には、前処理、色補間処理、補正処理、データ加工処理、評価値算出処理、特殊効果処理などが含まれる。前処理には、信号増幅、基準レベル調整、欠陥画素補正などが含まれる。色補間処理は、画素から読み出した画像データに含まれていない色成分の値を補間する処理であり、デモザイク処理や同時化処理とも呼ばれる。補正処理には、ホワイトバランス調整、階調補正(ガンマ処理)、撮影光学系104の光学収差や周辺減光の影響を補正する処理、色を補正する処理などが含まれる。データ加工処理には、合成処理、スケーリング処理、符号化および復号処理、ヘッダ情報生成処理などが含まれる。評価値算出処理は、自動焦点検出(AF)に用いる信号や評価値の生成、自動露出制御(AE)に用いる評価値の算出処理などである。特殊効果処理には、ぼかしの付加、色調の変更、リライティング処理などが含まれる。なお、これらは画像処理回路106が適用可能な画像処理の例示であり、画像処理回路106が適用する画像処理を限定するものではない。
Here, the image processing applied by the
補助光源101の設定や動作は、制御部108が制御する。制御部108は、画像処理回路106が生成する評価値を考慮して補助光源101の設定を行ってもよい。また、撮影光学系104が有するフォーカスレンズおよび、シャッタを兼ねる絞りの駆動制御も制御部108が行う。
The
操作部102は、ユーザが撮像装置100に各種の指示を入力するためのボタンやスイッチなどの入力デバイスの総称である。操作部102を構成する入力デバイスは、割り当てられた機能に応じた名称を有する。例えば、操作部102には、撮影準備動作の開始および撮影開始を指示するためのレリーズスイッチ、撮影モードを選択するための撮影モード選択スイッチ、メニューボタン、方向キー、決定キーなどが含まれる。同一の入力デバイスに複数の機能が割り当てられてもよい。また、入力デバイスはソフトウェアボタン/キーであってもよい。
The
なお、撮像装置100および補助光源101の動作は、PCやモバイル機器などの外部装置が制御してもよい。
The operation of the
図1(b)は、補助光源101を光軸方向から見た正面図である。補助光源101は複数の発光部110を有する。発光部110は、撮影光学系104の光軸140を中心とする円141上に中心が位置するように、また、回転対称に配置されている。なお、補助光源101が鏡筒に正しく取り付けられた際の複数の発光部110の位置は一定であり、撮像装置100との相対的な位置関係も一定である。補助光源101はさらに、1つの投写部111と、補助光源101を撮像装置100の鏡筒に取り付けるための取付部材112とを有する。なお、発光部110の位置は回転対称でなくてもよい。また、発光部110の数や密度についても特に制限はない。複数の発光部110は選択的に発光させることが可能であり、どの発光部110を発光させるかは制御部108が制御可能である。
FIG. 1B is a front view of the
投写部111は、空間的な輝度変化を有するパターン光を投写する。投写部111の構成に特に制限はないが、例えばLED(Light Emitting Diode)のような光源により、すりガラスや金属板などにパターンを形成したパターンマスクを照射した光学像を結像レンズに投写する構成とすることができる。図1(c)にパターン光の一例を示す。パターン光130は、x軸方向に高輝度領域と低輝度領域とが交互に繰り返され、y軸方向に長い線状の輝度領域を有するラインパターン光である。なお、投写部111は発光部110の間に配置しなくてもよい。また、発光部110と光軸方向の位置が異なっていてもよい。なお、補助光源101が有する発光部110および投写部111の位置情報はROM109もしくは補助光源101内のメモリに記憶されているものとする。
The
本実施形態において、撮像素子105は視差画像対を取得できるように構成されている。具体的には、撮像素子105に2次元配列された複数の画素の各々が、1つのマイクロレンズを共有する2つの光電変換部を有し、光電変換部ごとに信号を読み出し可能に構成されている。
In the present embodiment, the
図2に、撮像素子105に配置される複数の画素の1つの構成例を模式的に示す。図2(a)は垂直断面図、図2(b)は上面図である。画素は、マイクロレンズ201と、カラーフィルタ202と、基板204に形成された光電変換部203Aおよび203Bとを有する。図2では画素200が有する配線などは省略している。本実施形態では撮像素子105に原色ベイヤ配列のカラーフィルタが設けられているものとする。この場合、画素200が有するカラーフィルタ202はR(赤)、G(緑)、B(青)のうちの1色を有する。各画素が有するカラーフィルタ202の色は、撮像素子105に設けられるカラーフィルタの種類と画素の位置によって定まる。
FIG. 2 schematically shows a configuration example of one of a plurality of pixels arranged on the
図2(b)は光軸140と撮像素子105の交点(中心像高)から、撮影光学系104の射出瞳130を見た状態を模式的に示した図である。画素200に設けられた光電変換部203Aおよび203Bには、射出瞳130の異なる領域である第1の瞳領域210を通過した第1の光束および第2の瞳領域220を通過した第2の光束がそれぞれ入射する。したがって、撮像素子105が有する複数の画素について、光電変換部203Aで得られた信号から構成される画像(A画像と呼ぶ)と、光電変換部203Bで得られた信号から構成される画像(B画像と呼ぶ)とは、互いに視点が異なる視差画像対を構成する。
FIG. 2B is a diagram schematically showing a state in which the
第1の瞳領域210の重心位置(第1の重心位置)211と、第2の瞳領域220の重心位置(第2の重心位置)221とは、射出瞳130の中心から、第1の軸200に沿って互いに反対方向に偏心(移動)している。第1の軸200に沿った方向を瞳分割方向と呼ぶ。また、第1および第2の重心位置211および221との距離222が視差の基線長に相当する。本実施形態では、図2(b)に示すように、瞳分割方向はx軸方向に等しい。
The center of gravity position (first center of gravity position) 211 of the
撮影範囲におけるある1点(点Pとする)に対応するA画像内の座標と、B画像内の座標とのずれは、点Pの距離に応じて異なる。したがって、A画像とB画像とにおける対応点の位置ずれの大きさを検出することにより、各画素に対応する被写体の距離情報を得ることができる。また、位置ずれの大きさはデフォーカス量の大きさに相当するため、位相差検出方法の自動焦点検出に利用することができる。 The deviation between the coordinates in the A image corresponding to one point (referred to as the point P) in the shooting range and the coordinates in the B image differs depending on the distance of the point P. Therefore, by detecting the magnitude of the positional deviation of the corresponding points between the A image and the B image, it is possible to obtain the distance information of the subject corresponding to each pixel. Further, since the magnitude of the misalignment corresponds to the magnitude of the defocus amount, it can be used for the automatic focus detection of the phase difference detection method.
なお、A画像とB画像とを加算することにより、通常の撮影画像を生成することができる。したがって、通常の撮影画像からA画像(B画像)を減算することによりB画像(A画像)を生成することもできる。なお、通常の撮影画像とは、射出瞳130の全体を通過した光束に相当する画像信号を各画素から取得することによって得られる画像である。
By adding the A image and the B image, a normal photographed image can be generated. Therefore, the B image (A image) can be generated by subtracting the A image (B image) from the normal captured image. The normal captured image is an image obtained by acquiring an image signal corresponding to a light flux passing through the
画像処理回路106は、例えば撮像素子105から通常の撮影画像とA画像とを読み出してRAM107に格納する。そして、画像処理回路106は、通常の撮影画像とA画像との差分としてB画像を生成する。画像処理回路106は、各画素についての位置ずれ量を例えば相関演算に基づいて算出し、さらに位置ずれ量を距離情報に変換することにより、距離画像距離画像を生成する。画像処理回路106は、生成した距離画像をRAM107に格納する。
The
(仮想ライティング効果を付与した画像の生成動作)
本明細書では、被写体を撮影した画像において、光源からの光で照らされている領域を「照明領域」、光源からの光が遮られて影になっている領域を「影領域」と呼ぶ。また、撮像画像の各画素が影領域か照明領域かを示す情報を「影画像」と呼ぶ。影画像は例えば影領域の画素の値を0、照明領域の画素の値を1とした2値画像であってよい。あるいは、影画像は照度が高い領域の画素ほど大きな値を有する多値画像であってもよい。
(Image generation operation with virtual lighting effect)
In the present specification, in an image of a subject, an area illuminated by light from a light source is referred to as an "illumination area", and an area in which the light from the light source is blocked and shadowed is referred to as a "shadow area". Further, information indicating whether each pixel of the captured image is a shadow area or an illumination area is called a “shadow image”. The shadow image may be, for example, a binary image in which the value of the pixel in the shadow region is 0 and the value of the pixel in the illumination region is 1. Alternatively, the shadow image may be a multi-valued image having a larger value as the pixels in the region having higher illuminance.
以下、撮像装置100が影画像を生成し、影画像を利用して仮想ライティング効果を付与した画像を生成する動作について、図3(a)のフローチャートを用いて説明する。この動作は例えば操作部102から仮想ライティング効果を付与した画像の生成が指示されたことに応じて実行することができる。なお、露出条件の決定(補助光源101の発光方法の決定を含む)や焦点調節は公知の方法によって行うことができるため、その詳細については説明を省略する。なお、影画像を生成する間は、少なくとも撮像装置100の位置は固定しておく。
Hereinafter, an operation in which the
ステップ301「画像取得」で制御部108は、補助光源101が有する複数の発光部110のうち1つを発光させて撮影を行う。どの発光部110を発光させるかは任意であり、例えば予め定めておいてもよい。制御部108は、撮像素子105から、A画像とB画像を生成できるように1組の画像信号を読み出す。画像処理回路106は読み出された画像信号に対して所定の画像処理を適用し、所定の形式のA画像とB画像のデータを生成する。画像処理回路106は生成した画像データをRAM107に格納する。ここで生成した画像データは、被写体を特定の方向から照明したときの画像を表すため、「照明画像」もしくは第1の撮像画像と呼ぶ。
In
制御部108は引き続き、補助光源101の発光部101を発光させず、投写部111からパターン光130を投写させた状態で撮影を行う。制御部108は、撮像素子105から、A画像とB画像を生成できるように1組の画像信号を読み出す。画像処理回路106は読み出された画像信号に対して所定の画像処理を適用し、照明画像と同じ形式のA画像とB画像のデータを生成する。画像処理回路106は生成した画像データをRAM107に格納する。ここで生成した画像データは「パターン光画像」と呼ぶ。パターン光を投写した状態で撮像することで、コントラストの低い被写体についての距離情報の取得精度を向上することができる。
The
ステップ302「距離情報取得」で、画像処理回路106(取得手段)は、照明画像もしくはパターン光画像を用いて、被写体の距離情報を取得する。画像処理回路106は、公知の任意の方法を用いて、視差画像対であるA画像とB画像から画素ごとに被写体の距離情報を取得することができる。以下に一例を説明する。
In step 302 “distance information acquisition”, the image processing circuit 106 (acquisition means) acquires the distance information of the subject by using the illumination image or the pattern light image. The
図3(b)は、A画像320AとB画像320Bを模式的に示している。まず画像処理回路106は、A画像とB画像の相関値を算出する。画像処理回路106は、A画像において距離情報を取得する画素321(注目画素と呼ぶ)を含む部分領域を基準画像322として設定する。次に画像処理回路106は、B画像において、基準画像と水平および垂直方向の大きさが同じ領域を参照画像323として設定する。
FIG. 3B schematically shows A
そして、画像処理回路106は基準画像322をテンプレートとしたブロックマッチング法により、基準画像322のずれ量を検出する。ここでは、B画像における参照画像の垂直方向の位置を参照画像と同じとし、瞳分割方向と同じx軸方向に移動させ、各位置における参照画像と基準画像との相関値を算出することで、各位置に対する相関値のデータ列を取得する。参照画像の移動方向を視差算出方向と呼ぶ。
Then, the
視差算出方向を瞳分割方向と同じ方向とすることで、被写体距離に応じて生じるA画像とB画像との視差量を正しく算出することができる。相関値はSAD(Sum of Absolute Difference)やSSD(Sum of Squared Difference)などであってよい。 By setting the parallax calculation direction to the same direction as the pupil division direction, the amount of parallax between the A image and the B image generated according to the subject distance can be calculated correctly. The correlation value may be SAD (Sum of Absolute Difference), SSD (Sum of Squared Difference), or the like.
画像処理回路106は、基準画像について求めた相関値のデータ列に基づいて、注目画素の視差量を算出する。視差量は、既存の手法を用いて算出することができる。例えば、画像処理回路106は、最も高い相関を表す相関値が得られた移動量と、隣接する移動量に対応する相関値とを用いた既知の内挿手法により、最も相関が高くなる移動量をサブピクセル精度で求め、視差量とすることができる。
The
算出した視差量は、既知の手法によりデフォーカス量または被写体距離に変換することができる。視差量からデフォーカス量への変換は、A画像とB画像の基線長を用いた幾何学的関係から算出することができる。また、撮影光学系104のデフォーカス量に応じて定まるフォーカスレンズ位置において撮影光学系が合焦する距離を被写体距離とすることで、デフォーカス量から被写体距離へ変換することができる。視差量に所定の変換係数を乗算することで被写体距離に変換してもよい。デフォーカス量および被写体距離をまとめて距離情報と呼ぶ。
The calculated parallax amount can be converted into a defocus amount or a subject distance by a known method. The conversion from the parallax amount to the defocus amount can be calculated from the geometrical relationship using the baseline lengths of the A image and the B image. Further, by setting the distance at which the photographing optical system is in focus at the focus lens position determined according to the defocus amount of the photographing
このようにして、画像処理回路106は注目画素についての距離情報を取得することができる。A画像の各画素を注目画素として距離情報を取得することにより、距離画像を生成することができる。画像処理回路106は、生成した距離画像をRAM107に格納する。画像処理回路106は、照明画像とパターン光画像の一方、例えばパターン光画像について距離画像を生成すればよいが、それぞれについて距離画像を生成してもよい。
In this way, the
ステップ303「第1の影画像生成」で画像処理回路106(第1の生成手段)は、ステップ301で取得した照明画像から影画像を生成する。具体的には、画像処理回路106は、照明画像のうち、画素値(例えば輝度)が所定の閾値より以下の領域を影領域、画素値が閾値より大きい領域を照明領域とした第1の影画像を生成する。影画像は影領域の画素値を0、照明領域の画素値を1とした2値画像であってよい。なお、ここで用いる照明画像は、A画像、B画像、または通常の撮影画像(A画像とB画像の加算画像)のいずれであってもよい。
In
ステップ304「第2の影画像算出」で画像処理回路106(第2の生成手段)は、照明画像を撮影した際に発光させた発光部110の位置情報と、ステップ302で生成した距離画像とを用いて影画像を生成する。画像処理回路106は、例えば距離画像をシャドウマップとして用いた手法など、公知の手法によって影画像を生成することができる。例えば、カメラの光軸140と撮像素子105との交点を視点として、視点から所定の距離に存在する、光軸に垂直な平面(撮像素子105の投写面)を想定する。そして、撮像素子105の各画素に対応する平面上の点から発光部110までの距離が、その画素に対応する距離画像の値よりも短い場合には、その画素が影領域に含まれるものとする。一方、撮像素子105の各画素に対応する平面上の点から発光部110までの距離が、その画素に対応する距離画像の値と等しい場合には、発光部110とその画素を遮るものがないため、照明領域に含まれるものとする。画像処理回路106は、このようにして生成した第2の影画像をRAM107に格納する。第2の影画像は、照明画像の撮影時に発光させた発光部110と同じ位置に仮想光源を配置して撮影した場合に得られる画像において、影になる部分と影にならない部分とを表す画像に相当する。
The image processing circuit 106 (second generation means) in
ステップ305「影誤差領域の検出」で画像処理回路106(検出手段)は、第2の影画像に含まれる誤差領域を検出する。画像処理回路106は、RAM107に格納されている第1の影画像と第2の影画像を比較し、影領域と照明領域の判定が互いに異っている領域を影誤差領域として検出する。影画像が2値画像の場合、画像処理回路106は第1の影画像と第2の影画像との差分画像を算出し、値が0でない領域を影誤差領域として検出することができる。影画像が多値画像の場合には、画像処理回路106は、第1の影画像と第2の影画像との差分画像において、値の絶対値が閾値以上の領域を影誤差領域として検出することができる。
In
ステップ306「距離誤差領域の算出」で画像処理回路106(検出手段)は、ステップ305で求めた影誤差領域と対応する距離画像内の領域を、距離誤差領域として検出する。また、影誤差領域に対応する、S304において想定した平面内の領域の各点と発光部110との間にある点に対応する距離画像の領域を距離誤差領域として検出する。このようにして、距離画像における誤差領域(距離情報の信頼性が低い領域)を検出することができる。このように、画像処理回路106(検出手段)は、第1の影画像と第2の影画像との差異に基づいて、距離画像を構成する距離情報のうち、信頼性の低い距離情報を検出する。
In
(影付画像の生成)
ステップ307「画像生成」で画像処理回路106は、仮想光源による照明効果(仮想ライティング効果)を付加した画像を生成する。予め設定された仮想光源の位置情報と、ステップ302で生成した距離画像のうち、ステップ306で検出した距離誤差領域を除いた部分を用いて、ステップ304と同様にして影画像を生成する。
(Generation of shaded image)
In step 307 “Image generation”, the
ここでは、ステップ301で取得した照明画像に仮想ライティング効果を付加するものとする。画像処理回路106は、照明画像のうち、ステップ307で生成した仮想光源についての影画像において影領域となる画素について画素値(輝度値)を下げ、照明領域となる画素について画素値(輝度値)を上げるように補正する。画像処理回路106は、距離画像のうち、誤差領域に相当する領域については画素値を変更しない。
Here, it is assumed that a virtual lighting effect is added to the illumination image acquired in
このように、距離画像を用いて仮想ライティング効果を付与する際に、距離画像に含まれる信頼性が低い距離情報は用いないようにすることで、不自然な仮想ライティング効果が付与されることを抑制することができる。なお、仮想ライティング効果を付与する画像はステップ301で取得した画像に限定されない。距離誤差領域が検出済みの距離画像を利用可能な任意の画像に対して仮想ライティング効果を付与することができる。
In this way, when applying the virtual lighting effect using the distance image, by not using the unreliable distance information included in the distance image, an unnatural virtual lighting effect can be applied. It can be suppressed. The image to which the virtual lighting effect is applied is not limited to the image acquired in
●(変形例1)
図4は、第1実施形態の変形例に係る撮像装置100の動作に関するフローチャートである。図3(a)のフローチャートと同じ動作を行うステップについては同じ参照数字を付して説明を省略する。本変形例では、影誤差領域が大きい場合に、距離情報を補正して第2の影画像の生成をやり直すことにより、影誤差領域の縮小を図るものである。
● (Modification example 1)
FIG. 4 is a flowchart relating to the operation of the
ステップ301からステップ306は先に説明した通りであるため、説明を省略する。
ステップ308の「影誤差領域の大きさ検出」で画像処理回路106は、ステップ305で検出した影誤差領域の大きさを検出する。影誤差領域の大きさは、差分画像における横方向の長さ、縦方向の長さ、あるいは縦方向の長さと横方向の長さを乗算した面積、影誤差領域に含まれる画素数などのいずれかであってよい。
Since
In "Detecting the size of the shadow error region" in step 308, the
ステップ309「影誤差領域の大きさ判定」で、画像処理回路106は、ステップ308で算出した大きさが予め定められた閾値以上であるか否かを判定する。なお、ここで用いる閾値は、固定値であってもよいし、仮想ライティング効果を付与するための仮想光源の位置と、距離画像とを考慮して決定してもよい。
In step 309 “Determination of the size of the shadow error region”, the
影誤差が仮想ライティング効果に与える影響は、被写体の平面部においてより顕著である。平面部の面法線に対する仮想光の入射角度が大きい(平面と仮想光とのなす角度が小さい)ほど、距離情報の誤差に伴って生じる影誤差が大きくなる。そのため、例えば距離画像や輝度情報を用いて被写体の主要な平面部を検出し、平面部の面法線と仮想光の入射方向とがなす角度が大きいほど、閾値を小さく決定することができる。これにより、ステップ307で生成する、仮想ライティング効果を付加した画像における不自然さをさらに低減することができる。 The effect of the shadow error on the virtual lighting effect is more pronounced on the flat surface of the subject. The larger the incident angle of the virtual light with respect to the surface normal of the plane portion (the smaller the angle formed by the plane and the virtual light), the larger the shadow error caused by the error of the distance information. Therefore, for example, the main plane portion of the subject can be detected using a distance image or luminance information, and the larger the angle formed by the surface normal of the plane portion and the incident direction of the virtual light, the smaller the threshold value can be determined. As a result, the unnaturalness of the image to which the virtual lighting effect is added, which is generated in step 307, can be further reduced.
ステップ309において、影誤差領域の大きさが閾値以上と判定されなければ、画像処理回路106は先に説明したようにステップ307を実行する。一方、影誤差領域の大きさが閾値以上と判定された場合には、先に説明したようにステップ306を実行し、距離誤差領域を検出する。
If it is not determined in step 309 that the size of the shadow error region is equal to or greater than the threshold value, the
ステップ310「距離補正」で画像処理回路106は、距離画像のうち、距離誤差領域に含まれる距離情報を補正する。補正方法としては、距離誤差領域内の距離情報を、周囲の領域の距離情報から補間したり、周囲の領域の距離情報の平均値で置き換えたりすることができる。あるいは、画像の色情報を使用し、距離誤差領域の周辺領域で、距離誤差領域の画像と同じまたは類似した色の領域の距離情報の平均値で距離誤差領域内の距離情報を置き換えてもよい。周辺に存在する同一または類似色の周辺は、距離誤差領域と同距離もしくは類似した距離である確率が高い。そのため、周辺の同一または類似色の領域の距離情報の平均値を用いることで、補正の精度を高めることができる。
In step 310 “distance correction”, the
距離誤差領域の距離情報を補正すると、画像処理回路106は再度ステップ304を実行して、補正後の距離画像を用いて第2の影画像を再生成する。その後、画像処理回路106はステップ305で影誤差領域を再検出する。
When the distance information in the distance error region is corrected, the
画像処理回路106は、ステップ309で影誤差領域の大きさが閾値以上と判定されなくなるまで、距離情報の補正、第2の影画像生成、影誤差領域の検出および大きさ判定を繰り返す。なお、繰返し回数に制限を設けてもよい。
The
このように、距離情報を補正することで、距離誤差領域を縮小することができ、仮想ライティング効果の精度を向上させることができる。なお、仮想ライティング効果の付加における影誤差の影響は、距離誤差領域が小さくなると目立たなくなる。そのため、距離誤差領域の大きさが閾値以上と判定されなくなった時点で距離情報の補正は打ち切ることで、処理時間の低減を図っている。 By correcting the distance information in this way, the distance error area can be reduced and the accuracy of the virtual lighting effect can be improved. The effect of the shadow error on the addition of the virtual lighting effect becomes less noticeable as the distance error region becomes smaller. Therefore, the processing time is reduced by discontinuing the correction of the distance information when the size of the distance error region is no longer determined to be equal to or larger than the threshold value.
●(変形例2)
(複数の照明位置からの画像で誤差領域を検出)
発光させる発光部110を異ならせて複数の照明画像を取得し、それぞれの照明画像について影誤差領域を検出してもよい。この場合、画像処理回路106は、検出した複数の影誤差領域を統合することで最終的な影誤差領域とする。また、影誤差領域ごとに距離誤差領域を検出してもよい。
● (Modification example 2)
(Error area detected in images from multiple lighting positions)
A plurality of illumination images may be acquired by making the
このように、異なる照明方向ごとに影誤差領域や距離誤差領域を検出することにより、影誤差領域及び距離誤差領域の検出精度を高めることができる。さらに、距離情報の補正についても、個々の距離画像について実施することができる。これにより、より高精度に距離情報を補正することができる。 By detecting the shadow error region and the distance error region for each different illumination direction in this way, the detection accuracy of the shadow error region and the distance error region can be improved. Further, the distance information can be corrected for each distance image. As a result, the distance information can be corrected with higher accuracy.
●(変形例3)
(照明画像と他の照明画像もしくは非照明画像から第1の影画像を算出)
ステップ303「第1の影画像算出」は、他の方法で実現してもよい。例えば、ステップ301で取得した照明画像と、ステップ301における照明位置とは異なる位置から照明して取得した照明画像とを比較し、ステップ301で取得した照明画像の画素値が小さい(暗い)領域を影領域として検出することができる。あるいは、ステップ301で取得した照明画像と、照明を行わないで取得した画像とを比較し、ステップ301で取得した画像の画素値が小さい領域を影領域として検出してもよい。
● (Modification example 3)
(Calculate the first shadow image from the illuminated image and other illuminated or non-illuminated images)
Step 303 “First shadow image calculation” may be realized by another method. For example, the illumination image acquired in
●(変形例4)
(他の距離誤差領域の検出方法)
ステップ306「距離誤差領域の検出」で、より正確に距離誤差領域を検出する方法について、図5を参照して説明する。図5(a)および(b)は、平面501に距離誤差領域502および503が存在し、それによって影誤差領域504が発生する場合を模式的に表している。
● (Modification example 4)
(Detection method for other distance error areas)
A method of detecting the distance error region more accurately in
図5(a)は、照明光505を遮る領域502の距離情報に誤差があり、影領域504の距離情報506には誤差がない状態を表している。図5(b)は、照明光505を遮る領域507の距離情報には誤差がなく、影領域504の距離情報503に誤差がある状態を表している。
FIG. 5A shows a state in which there is an error in the distance information of the
第1実施形態では、照明光を遮る領域と、影が付く領域との両方を距離誤差領域として検出した。しかし、これらの一方を距離誤差領域として検出してもよい。この場合、図5(c)に示すフローチャートのステップを、ステップ305の代わりに実行することができる。
In the first embodiment, both the region that blocks the illumination light and the region that is shaded are detected as the distance error region. However, one of these may be detected as a distance error region. In this case, the steps in the flowchart shown in FIG. 5C can be performed instead of
ステップ510「候補領域検出」で画像処理回路106は、光を遮る領域502または503と、影が付く領域506または507とを候補領域として検出する。
次にステップ511「距離差算出」で画像処理回路106は、各々の候補領域について、候補領域内の距離情報と周辺の距離情報との差520と521、あるいは差522と523を算出する。
In step 510 “Candidate region detection”, the
Next, in step 511 "Distance difference calculation", the
ステップ512「距離誤差領域検出」で画像処理回路106は、差520と521とを比較、あるいは差522と523とを比較する。そして、画像処理回路106は、差が大きい一方を距離誤差領域として検出する。このようにして、距離誤差領域をより正確に検出することができる。
In step 512 “distance error region detection”, the
●(変形例5)
(補助光源の他の構成)
第1実施形態において、補助光源101は、複数の発光部110と投写部111とを有する構成であったが、1つの発光部110を有し、投写部111を有さない構成であってもよい。この場合、距離情報は、発光部110を発光させて、あるいは発光させずに撮影した画像を用いて取得することができる。あるいは補助光源101を、発光部110を有さない構成としてもよい。この場合には、投写部111でパターン光を投写して取得した画像を用いて距離情報の取得と距離誤差領域の検出を行うことができる。補助光源101の構成が異なる場合でも、同様の効果を得ることができる。
● (Modification example 5)
(Other configurations of auxiliary light source)
In the first embodiment, the auxiliary
●(変形例6)
(他の距離情報取得方法)
距離情報は、上述した方法とは異なる方法で取得してもよい。例えば、発光させる発光部110を異ならせて取得した複数の画像から、公知の照度差ステレオ法を用いて、高精度な法線情報を取得することができる。法線情報は被写体の局所的な形状の変化を表す情報であり、取得した距離情報を法線情報を用いて補正することで、高精度な距離情報を得ることが可能である。なお、照度差ステレオ法を実施する際には、照射方向の異なる画像を少なくとも3つ取得する必要があるため、補助光源101は発光部110を3個以上有する必要がある。
● (Modification example 6)
(Other distance information acquisition methods)
The distance information may be acquired by a method different from the method described above. For example, it is possible to acquire highly accurate normal information from a plurality of images acquired by differently emitting light emitting
また、距離情報は、LiDAR(レーザレーダ)ような、反射光の到達時間や周波数変化に基づいて距離情報を検出する装置を用いたり、ステレオカメラによる三角測距を用いたりして取得することもできる。 In addition, the distance information can be acquired by using a device such as LiDAR (laser radar) that detects the distance information based on the arrival time or frequency change of the reflected light, or by using a triangular distance measurement with a stereo camera. can.
●(変形例7)
第1実施形態では撮像装置100に発明を適用した場合について説明した。しかし、本発明に撮影機能は必須でなく、照明画像、パターン光画像、距離画像、発光部の位置情報などを外部装置から取得してもよい。したがって、第1実施形態およびその変形例として説明した構成は、コンピュータ(CPU)を備えた電子機器全般において実施することができる。
● (Modification 7)
In the first embodiment, the case where the invention is applied to the
例えば、図6に示すように、照明画像、パターン光画像、距離画像、発光部の位置情報などを撮像装置100が有する通信I/F150を通じて取得可能な情報処理装置600においても、画像処理回路106と同様の動作を実行することができる。通信I/F150は有線または無線通信I/Fであってよい。また、照明画像、パターン光画像、距離画像、発光部の位置情報などは、撮像装置100からでなく、ネットワーク上のサーバや、記録媒体などから取得してもよい。情報処理装置600が有するCPUは、例えばROMなどの記憶装置に記憶されたプログラムをRAMにロードして実行することにより、上述した画像処理回路106と同様の処理を実現することができる。
For example, as shown in FIG. 6, the
(その他の実施形態)
投写部111は、光源としてLD(Laser Diode)を用いてもよい。また、パターンマスクとして、反射型LCOS(Liquid Crystal On Silicon)や透過型LCOSやDMD(Digital Micromirror Device)を用いてもよい。被写体の大きさや距離に応じて投写パターン130の空間周波数を動的に変更することにより、状況に応じてより高精度な距離情報の取得が可能となる。
(Other embodiments)
The
投写部111の光源の波長が可視光域の全域を含む白色であることは、被写体の分光反射率によらず反射率補正の効果が得られるため好適である。投写部111の光源がR、G、Bの3色から構成される場合には、撮像素子105のカラーフィルタ透過帯域と一致し、使用エネルギーに対する光利用効率の観点で好適である。投写部111が投写する光の波長がIR(Infrared)発光領域であり、撮像素子も赤外光に対応した構成とすることは、RGB帯域を用いた鑑賞用画像を同時に撮影することが可能になり好適である。特にIRの波長帯域が800nmから1100nmの間である場合、光電変換部にSiを用いることができ、カラーフィルタの配列を変更することでひとつの撮像素子でRGB鑑賞画像とIR測距画像を取得することができ好適である。
It is preferable that the wavelength of the light source of the
撮像装置100は、2つ以上の複数の光学系とそれに対応する撮像素子から構成されたステレオカメラで構成してもよい。この場合、基線長の設計自由度が向上し、距離情報の分解能を向上させることができる。また、補助光源は撮像装置の外部装置であってもよい。
The
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
100…撮像装置、101…補助光源、105…撮像素子、106…画像処理回路、108…制御部、120…被写体 100 ... image pickup device, 101 ... auxiliary light source, 105 ... image sensor, 106 ... image processing circuit, 108 ... control unit, 120 ... subject
Claims (12)
補助光源を発光させて撮影された第1の撮像画像を用いて、影領域と照明領域とを表す第1の影画像を生成する第1の生成手段と、
前記距離情報と前記補助光源の位置情報とを用いて、第2の影画像を生成する第2の生成手段と、
前記第1の影画像と前記第2の影画像との差異に基づいて、前記距離情報のうち、信頼性の低い距離情報を検出する検出手段と、を有することを特徴とする距離情報取得装置。 An acquisition method for acquiring the distance information of the subject,
A first generation means for generating a first shadow image representing a shadow area and an illumination area by using a first captured image taken by emitting light from an auxiliary light source.
A second generation means for generating a second shadow image using the distance information and the position information of the auxiliary light source, and
A distance information acquisition device comprising a detection means for detecting unreliable distance information among the distance information based on the difference between the first shadow image and the second shadow image. ..
前記第2の生成手段は、前記補正手段が距離情報を補正した場合、補正後の距離情報を用いて前記第2の影画像を再生成し、
前記検出手段は、前記第1の影画像と前記再生成された第2の影画像との差異に基づいて、前記距離情報のうち、信頼性の低い距離情報を再検出する、ことを特徴とする請求項4に記載の距離情報取得装置。 Further, it has a correction means for correcting the unreliable distance information when the size of the region having the unreliable distance information is equal to or larger than the threshold value in the distance image.
When the correction means corrects the distance information, the second generation means regenerates the second shadow image using the corrected distance information.
The detection means is characterized in that it rediscovers unreliable distance information among the distance information based on the difference between the first shadow image and the regenerated second shadow image. The distance information acquisition device according to claim 4.
前記検出手段は、前記第1の影画像のそれぞれと前記第2の影画像との差異に基づいて、前記信頼性の低い距離情報を検出する、ことを特徴とする請求項1から5のいずれか1項に記載の距離情報取得装置。 The first generation means generates the first shadow image from each of the plurality of first captured images taken by emitting auxiliary light sources at different positions.
Any of claims 1 to 5, wherein the detection means detects the unreliable distance information based on the difference between each of the first shadow images and the second shadow image. The distance information acquisition device according to item 1.
前記付加手段は、前記距離情報のうち、前記検出手段によって検出された、前記信頼性の低い距離情報を用いない、ことを特徴とする請求項1から7のいずれか1項に記載の距離情報取得装置。 Further, it has an additional means for generating an image in which a virtual lighting effect by a virtual light source is added to a captured image of the subject by using the distance information.
The distance information according to any one of claims 1 to 7, wherein the additional means does not use the unreliable distance information detected by the detection means among the distance information. Acquisition device.
請求項1から8のいずれか1項に記載の距離情報取得装置とを有し、
前記距離情報取得装置は、前記撮像素子を用いて撮影された撮像画像を前記第1の撮像画像として用いることを特徴とする、撮像装置。 Image sensor and
It has the distance information acquisition device according to any one of claims 1 to 8.
The distance information acquisition device is an image pickup device, characterized in that an image captured by using the image pickup element is used as the first image pickup image.
前記取得手段は、前記撮像素子を用いて得られた視差画像対に基づいて前記距離情報を取得する、ことを特徴とする請求項9に記載の撮像装置。 Each of the pixels provided in the image sensor has a plurality of photoelectric conversion units, and has a plurality of photoelectric conversion units.
The image pickup apparatus according to claim 9, wherein the acquisition means acquires the distance information based on a parallax image pair obtained by using the image pickup device.
被写体の距離情報を取得する取得工程と、
補助光源を発光させて撮影された第1の撮像画像を用いて、影領域と照明領域とを表す第1の影画像を生成する第1の生成工程と、
前記距離情報と前記補助光源の位置情報とを用いて、第2の影画像を生成する第2の生成工程と、
前記第1の影画像と前記第2の影画像との差異に基づいて、前記距離情報のうち、信頼性の低い距離情報を検出する検出工程と、を有することを特徴とする距離情報取得方法。 It is a distance information acquisition method executed by the distance information acquisition device.
The acquisition process to acquire the distance information of the subject,
A first generation step of generating a first shadow image representing a shadow area and an illumination area by using a first captured image taken by emitting light from an auxiliary light source, and
A second generation step of generating a second shadow image using the distance information and the position information of the auxiliary light source, and
A distance information acquisition method comprising a detection step of detecting unreliable distance information among the distance information based on a difference between the first shadow image and the second shadow image. ..
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020020888A JP2021127998A (en) | 2020-02-10 | 2020-02-10 | Distance information acquisition device and distance information acquisition method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020020888A JP2021127998A (en) | 2020-02-10 | 2020-02-10 | Distance information acquisition device and distance information acquisition method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2021127998A true JP2021127998A (en) | 2021-09-02 |
Family
ID=77488334
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020020888A Pending JP2021127998A (en) | 2020-02-10 | 2020-02-10 | Distance information acquisition device and distance information acquisition method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2021127998A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023195403A1 (en) * | 2022-04-06 | 2023-10-12 | 株式会社Jvcケンウッド | Image processing device and image processing method |
-
2020
- 2020-02-10 JP JP2020020888A patent/JP2021127998A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023195403A1 (en) * | 2022-04-06 | 2023-10-12 | 株式会社Jvcケンウッド | Image processing device and image processing method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109155843B (en) | Image projection system and image projection method | |
JP5108093B2 (en) | Imaging apparatus and imaging method | |
JP6405243B2 (en) | Focus detection apparatus and control method thereof | |
JP5445363B2 (en) | Image processing apparatus, image processing method, and image processing program | |
CN103327273B (en) | The control method of image processing apparatus, projector and projector | |
JPWO2006064751A1 (en) | Compound eye imaging device | |
KR20070030137A (en) | Projecting apparatus and method and recording medium recording the projecting method | |
JP6220148B2 (en) | Imaging apparatus and control method thereof | |
JP2015144416A (en) | Imaging apparatus and control method of the same | |
US9894339B2 (en) | Image processing apparatus, image processing method and program | |
JP2006279546A (en) | Electronic camera, image processing program, and image processing method | |
JP2021010162A (en) | Projection system and projection method thereof | |
JP2019176356A (en) | Projector, and method for controlling projector | |
JP6700818B2 (en) | Image processing device, imaging device, and image processing method | |
TWI398716B (en) | Use the flash to assist in detecting focal lengths | |
JP2021118413A (en) | Control method of projector, projector, and display system | |
JP2016053653A (en) | Focus detection device and method for controlling the same | |
JP2012078490A (en) | Projection image display device, and image adjusting method | |
JP2021127998A (en) | Distance information acquisition device and distance information acquisition method | |
JP2019179463A (en) | Image processing device, control method thereof, program, and recording medium | |
JP2009253575A (en) | Projector, program, and storage medium | |
JP2012168429A (en) | Image pickup apparatus | |
WO2019244667A1 (en) | Information processing device, information processing method, and program | |
JP2000292131A (en) | Three-dimensional information input camera | |
JP6395790B2 (en) | IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND FOCUS CONTROL PROGRAM |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20210103 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210113 |