JP2021127998A - Distance information acquisition device and distance information acquisition method - Google Patents

Distance information acquisition device and distance information acquisition method Download PDF

Info

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
Application number
JP2020020888A
Other languages
Japanese (ja)
Inventor
聖雄 池本
Masao Ikemoto
聖雄 池本
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 JP2020020888A priority Critical patent/JP2021127998A/en
Publication of JP2021127998A publication Critical patent/JP2021127998A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Measurement Of Optical Distance (AREA)
  • Stroboscope Apparatuses (AREA)
  • Studio Devices (AREA)

Abstract

To provide a distance information acquisition device and a distance information acquisition method capable of detecting unreliable distance information among the acquired distance information.SOLUTION: The distance information acquisition device acquires distance information of a subject by a predetermined method. And, the distance information acquisition device generates 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. The distance information acquisition device further generates a second shadow image by using the distance information and the position information of the auxiliary light source. The distance information acquisition device detects unreliable distance information among the distance information based on the difference between the first shadow image and the second shadow image.SELECTED DRAWING: Figure 1

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.

特開2010−177741号公報Japanese Unexamined Patent Publication No. 2010-177741

取得した距離情報に誤差があると、距離情報を利用した処理の精度が低下する。例えば被写体を撮影した画像に対して仮想光源によるライティング効果を付加する場合、被写体の距離情報に誤差があると、ライティング効果が不自然になる可能性がある。したがって、距離情報のうち誤差を考慮すべき、信頼性の低い距離情報を検出することが望まれる。 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.

(a)は実施形態に係る距離情報取得装置としての撮像装置の構成例を示す図、(b)は補助光源の構成例を示す図、(c)はパターン光の例を示す模式図(A) is a diagram showing a configuration example of an imaging device as a distance information acquisition device according to an embodiment, (b) is a diagram showing a configuration example of an auxiliary light source, and (c) is a schematic diagram showing an example of pattern light. 図1の撮影素子が有する画素の構造例を示す模式図Schematic diagram showing a structural example of pixels included in the photographing element of FIG. (a)は実施形態に係る距離情報取得装置の動作に関するフローチャート、(b)は距離情報取得動作に関する模式図(A) is a flowchart regarding the operation of the distance information acquisition device according to the embodiment, and (b) is a schematic diagram regarding the distance information acquisition operation. 実施形態の変形例に係る距離情報取得装置の動作に関するフローチャートFlow chart regarding the operation of the distance information acquisition device according to the modified example of the embodiment 実施形態の他の変形例を説明するための図The figure for demonstrating another modification of embodiment 撮像装置の外部装置を距離情報取得装置として用いる場合の構成例を示す模式図Schematic diagram showing a configuration example when an external device of the image pickup device is used as a distance information acquisition device.

以下、添付図面を参照して本発明をその例示的な実施形態に基づいて詳細に説明する。なお、以下の実施形態は特許請求の範囲に係る発明を限定しない。また、実施形態には複数の特徴が記載されているが、その全てが発明に必須のものとは限らず、また、複数の特徴は任意に組み合わせられてもよい。さらに、添付図面においては、同一若しくは同様の構成に同一の参照番号を付し、重複した説明は省略する。 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 image pickup apparatus 100 as a shape information acquisition apparatus according to an embodiment of the present invention. FIG. 1A corresponds to a top view. Here, the image pickup apparatus 100 is a digital still camera capable of taking a picture using an auxiliary light source 101 such as a flash or a light. The auxiliary light source 101 may be provided in the image pickup apparatus 100, or may be an external type that can be attached to and detached from the image pickup apparatus 100. The auxiliary light source 101 has a configuration capable of illuminating a subject from different directions. Here, as an example, an auxiliary light source 101 in which a plurality of light emitting sources are arranged on the same circumference is used, but a plurality of general flash devices may be used. In the xyz coordinate system in FIG. 1, the z-axis is parallel to the optical axis 140 of the photographing optical system 104, the x-axis is vertically upward and the y-axis is perpendicular to each other, and the axis is perpendicular to the optical axis.

撮像装置100は、制御部108を有する。制御部108は例えばCPU(MPU、マイクロプロセッサとも呼ばれる)であり、ROM109に記憶されたプログラムをRAM107に読み込んで実行することにより、撮像装置100の各部の動作を制御し、撮像装置100の機能を実現する。なお、撮影光学系104が交換式の場合、制御部108は撮影光学系104が有するコントローラと通信し、撮影光学系104の動作を制御する。 The image pickup apparatus 100 has a control unit 108. The control unit 108 is, for example, a CPU (also called an MPU or a microprocessor), and controls the operation of each part of the image pickup apparatus 100 by reading the program stored in the ROM 109 into the RAM 107 and executing the program, and performs the functions of the image pickup apparatus 100. Realize. When the photographing optical system 104 is an interchangeable type, the control unit 108 communicates with the controller of the photographing optical system 104 to control the operation of the photographing optical system 104.

ROM109は書き換え可能な不揮発性メモリであり、制御部108が実行するプログラム、撮像装置100の各種の設定値、GUIデータなどを記憶する。RAM107は、制御部108がプログラムを実行する際に用いたり、画像処理回路106が画像データを保持したりするために用いたりする。RAM107の一部はビデオメモリとして用いられてもよい。 The ROM 109 is a rewritable non-volatile memory, and stores a program executed by the control unit 108, various setting values of the image pickup apparatus 100, GUI data, and the like. The RAM 107 is used by the control unit 108 when executing a program, or is used by the image processing circuit 106 to hold image data. A part of RAM 107 may be used as a video memory.

画像処理回路106は、撮像素子105から得られる画像信号に対して予め定められた画像処理を適用し、信号や画像データを生成したり、各種の情報を取得および/または生成したりする。画像処理回路106は例えば特定の機能を実現するように設計されたASICのような専用のハードウェア回路であってもよいし、DSPのようなプログラマブルプロセッサがソフトウェアを実行することで特定の機能を実現する構成であってもよい。 The image processing circuit 106 applies predetermined image processing to the image signal obtained from the image sensor 105 to generate signals and image data, and acquire and / or generate various types of information. The image processing circuit 106 may be a dedicated hardware circuit such as an ASIC designed to realize a specific function, or a programmable processor such as a DSP may execute the software to perform the specific function. It may be a configuration to be realized.

ここで、画像処理回路106が適用する画像処理には、前処理、色補間処理、補正処理、データ加工処理、評価値算出処理、特殊効果処理などが含まれる。前処理には、信号増幅、基準レベル調整、欠陥画素補正などが含まれる。色補間処理は、画素から読み出した画像データに含まれていない色成分の値を補間する処理であり、デモザイク処理や同時化処理とも呼ばれる。補正処理には、ホワイトバランス調整、階調補正(ガンマ処理)、撮影光学系104の光学収差や周辺減光の影響を補正する処理、色を補正する処理などが含まれる。データ加工処理には、合成処理、スケーリング処理、符号化および復号処理、ヘッダ情報生成処理などが含まれる。評価値算出処理は、自動焦点検出(AF)に用いる信号や評価値の生成、自動露出制御(AE)に用いる評価値の算出処理などである。特殊効果処理には、ぼかしの付加、色調の変更、リライティング処理などが含まれる。なお、これらは画像処理回路106が適用可能な画像処理の例示であり、画像処理回路106が適用する画像処理を限定するものではない。 Here, the image processing applied by the image processing circuit 106 includes preprocessing, color interpolation processing, correction processing, data processing processing, evaluation value calculation processing, special effect processing, and the like. Preprocessing includes signal amplification, reference level adjustment, defective pixel correction, and the like. The color interpolation process is a process of interpolating the values of color components not included in the image data read from the pixels, and is also called a demosaic process or a simultaneous process. The correction processing includes white balance adjustment, gradation correction (gamma processing), processing for correcting the influence of optical aberration and limb darkening of the photographing optical system 104, and processing for correcting color. The data processing process includes synthesis processing, scaling processing, coding and decoding processing, header information generation processing, and the like. The evaluation value calculation process includes generation of signals and evaluation values used for automatic focus detection (AF), calculation process of evaluation values used for automatic exposure control (AE), and the like. Special effects processing includes adding blur, changing color tones, rewriting processing, and the like. Note that these are examples of image processing to which the image processing circuit 106 can be applied, and do not limit the image processing to which the image processing circuit 106 can be applied.

補助光源101の設定や動作は、制御部108が制御する。制御部108は、画像処理回路106が生成する評価値を考慮して補助光源101の設定を行ってもよい。また、撮影光学系104が有するフォーカスレンズおよび、シャッタを兼ねる絞りの駆動制御も制御部108が行う。 The control unit 108 controls the setting and operation of the auxiliary light source 101. The control unit 108 may set the auxiliary light source 101 in consideration of the evaluation value generated by the image processing circuit 106. Further, the control unit 108 also controls the drive of the focus lens of the photographing optical system 104 and the aperture that also serves as the shutter.

操作部102は、ユーザが撮像装置100に各種の指示を入力するためのボタンやスイッチなどの入力デバイスの総称である。操作部102を構成する入力デバイスは、割り当てられた機能に応じた名称を有する。例えば、操作部102には、撮影準備動作の開始および撮影開始を指示するためのレリーズスイッチ、撮影モードを選択するための撮影モード選択スイッチ、メニューボタン、方向キー、決定キーなどが含まれる。同一の入力デバイスに複数の機能が割り当てられてもよい。また、入力デバイスはソフトウェアボタン/キーであってもよい。 The operation unit 102 is a general term for input devices such as buttons and switches for a user to input various instructions to the image pickup device 100. The input devices constituting the operation unit 102 have names according to the assigned functions. For example, the operation unit 102 includes a release switch for instructing the start of the shooting preparation operation and the start of shooting, a shooting mode selection switch for selecting a shooting mode, a menu button, a direction key, a decision key, and the like. Multiple functions may be assigned to the same input device. Further, the input device may be a software button / key.

なお、撮像装置100および補助光源101の動作は、PCやモバイル機器などの外部装置が制御してもよい。 The operation of the image pickup device 100 and the auxiliary light source 101 may be controlled by an external device such as a PC or a mobile device.

図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 auxiliary light source 101 as viewed from the optical axis direction. The auxiliary light source 101 has a plurality of light emitting units 110. The light emitting unit 110 is arranged so that the center is located on the circle 141 centered on the optical axis 140 of the photographing optical system 104 and is rotationally symmetrical. The positions of the plurality of light emitting units 110 when the auxiliary light source 101 is correctly attached to the lens barrel are constant, and the relative positional relationship with the image pickup apparatus 100 is also constant. The auxiliary light source 101 further includes one projection unit 111 and a mounting member 112 for mounting the auxiliary light source 101 on the lens barrel of the image pickup apparatus 100. The position of the light emitting unit 110 does not have to be rotationally symmetric. Further, the number and density of the light emitting units 110 are not particularly limited. The plurality of light emitting units 110 can selectively emit light, and the control unit 108 can control which light emitting unit 110 emits light.

投写部111は、空間的な輝度変化を有するパターン光を投写する。投写部111の構成に特に制限はないが、例えばLED(Light Emitting Diode)のような光源により、すりガラスや金属板などにパターンを形成したパターンマスクを照射した光学像を結像レンズに投写する構成とすることができる。図1(c)にパターン光の一例を示す。パターン光130は、x軸方向に高輝度領域と低輝度領域とが交互に繰り返され、y軸方向に長い線状の輝度領域を有するラインパターン光である。なお、投写部111は発光部110の間に配置しなくてもよい。また、発光部110と光軸方向の位置が異なっていてもよい。なお、補助光源101が有する発光部110および投写部111の位置情報はROM109もしくは補助光源101内のメモリに記憶されているものとする。 The projection unit 111 projects pattern light having a spatial brightness change. The configuration of the projection unit 111 is not particularly limited, but a configuration in which an optical image obtained by irradiating a pattern mask having a pattern formed on frosted glass or a metal plate with a light source such as an LED (Light Emitting Diode) is projected onto an imaging lens. Can be. FIG. 1C shows an example of pattern light. The pattern light 130 is a line pattern light in which high-luminance regions and low-luminance regions are alternately repeated in the x-axis direction and has a long linear luminance region in the y-axis direction. The projection unit 111 does not have to be arranged between the light emitting units 110. Further, the position in the optical axis direction may be different from that of the light emitting unit 110. It is assumed that the position information of the light emitting unit 110 and the projection unit 111 included in the auxiliary light source 101 is stored in the ROM 109 or the memory in the auxiliary light source 101.

本実施形態において、撮像素子105は視差画像対を取得できるように構成されている。具体的には、撮像素子105に2次元配列された複数の画素の各々が、1つのマイクロレンズを共有する2つの光電変換部を有し、光電変換部ごとに信号を読み出し可能に構成されている。 In the present embodiment, the image sensor 105 is configured to be able to acquire a parallax image pair. Specifically, each of the plurality of pixels two-dimensionally arranged on the image sensor 105 has two photoelectric conversion units that share one microlens, and each photoelectric conversion unit is configured to be able to read a signal. There is.

図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 image pickup device 105. FIG. 2A is a vertical cross-sectional view, and FIG. 2B is a top view. The pixel has a microlens 201, a color filter 202, and photoelectric conversion units 203A and 203B formed on the substrate 204. In FIG. 2, the wiring and the like of the pixel 200 are omitted. In the present embodiment, it is assumed that the image sensor 105 is provided with a color filter having a primary color Bayer array. In this case, the color filter 202 included in the pixel 200 has one of R (red), G (green), and B (blue). The color of the color filter 202 possessed by each pixel is determined by the type of the color filter provided in the image sensor 105 and the position of the pixel.

図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 exit pupil 130 of the photographing optical system 104 is viewed from the intersection (center image height) of the optical axis 140 and the image sensor 105. The photoelectric conversion units 203A and 203B provided in the pixel 200 have a first luminous flux that has passed through the first pupil region 210, which is a different region of the exit pupil 130, and a second luminous flux that has passed through the second pupil region 220. Are incident on each. Therefore, for a plurality of pixels of the image sensor 105, an image composed of signals obtained by the photoelectric conversion unit 203A (referred to as an A image) and an image composed of signals obtained by the photoelectric conversion unit 203B (B). (Called an image) constitutes a parallax image pair having different viewpoints from each other.

第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 first pupil region 210 and the center of gravity position (second center of gravity position) 221 of the second pupil region 220 are the first axes from the center of the ejection pupil 130. They are eccentric (moving) in opposite directions along the 200. The direction along the first axis 200 is called the pupil division direction. Further, the distance 222 from the first and second center of gravity positions 211 and 221 corresponds to the baseline length of the parallax. In this embodiment, as shown in FIG. 2B, the pupil division direction is equal to the x-axis direction.

撮影範囲におけるある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 entire exit pupil 130 from each pixel.

画像処理回路106は、例えば撮像素子105から通常の撮影画像とA画像とを読み出してRAM107に格納する。そして、画像処理回路106は、通常の撮影画像とA画像との差分としてB画像を生成する。画像処理回路106は、各画素についての位置ずれ量を例えば相関演算に基づいて算出し、さらに位置ずれ量を距離情報に変換することにより、距離画像距離画像を生成する。画像処理回路106は、生成した距離画像をRAM107に格納する。 The image processing circuit 106 reads, for example, a normal captured image and an A image from the image sensor 105 and stores them in the RAM 107. Then, the image processing circuit 106 generates a B image as a difference between the normal captured image and the A image. The image processing circuit 106 generates a distance image distance image by calculating the amount of misalignment for each pixel based on, for example, a correlation calculation, and further converting the amount of misalignment into distance information. The image processing circuit 106 stores the generated distance image in the RAM 107.

(仮想ライティング効果を付与した画像の生成動作)
本明細書では、被写体を撮影した画像において、光源からの光で照らされている領域を「照明領域」、光源からの光が遮られて影になっている領域を「影領域」と呼ぶ。また、撮像画像の各画素が影領域か照明領域かを示す情報を「影画像」と呼ぶ。影画像は例えば影領域の画素の値を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 image pickup apparatus 100 generates a shadow image and uses the shadow image to generate an image to which a virtual lighting effect is applied will be described with reference to the flowchart of FIG. 3A. This operation can be executed, for example, in response to an instruction from the operation unit 102 to generate an image to which the virtual lighting effect is applied. Since the exposure conditions (including the determination of the light emitting method of the auxiliary light source 101) and the focus adjustment can be performed by a known method, the details thereof will be omitted. At least the position of the image pickup apparatus 100 is fixed while the shadow image is generated.

ステップ301「画像取得」で制御部108は、補助光源101が有する複数の発光部110のうち1つを発光させて撮影を行う。どの発光部110を発光させるかは任意であり、例えば予め定めておいてもよい。制御部108は、撮像素子105から、A画像とB画像を生成できるように1組の画像信号を読み出す。画像処理回路106は読み出された画像信号に対して所定の画像処理を適用し、所定の形式のA画像とB画像のデータを生成する。画像処理回路106は生成した画像データをRAM107に格納する。ここで生成した画像データは、被写体を特定の方向から照明したときの画像を表すため、「照明画像」もしくは第1の撮像画像と呼ぶ。 In step 301 "image acquisition", the control unit 108 causes one of the plurality of light emitting units 110 included in the auxiliary light source 101 to emit light to perform imaging. Which light emitting unit 110 emits light is arbitrary, and may be determined in advance, for example. The control unit 108 reads out a set of image signals from the image sensor 105 so that an A image and a B image can be generated. The image processing circuit 106 applies predetermined image processing to the read image signal to generate data of A image and B image in a predetermined format. The image processing circuit 106 stores the generated image data in the RAM 107. The image data generated here represents an image when the subject is illuminated from a specific direction, and is therefore referred to as an "illuminated image" or a first captured image.

制御部108は引き続き、補助光源101の発光部101を発光させず、投写部111からパターン光130を投写させた状態で撮影を行う。制御部108は、撮像素子105から、A画像とB画像を生成できるように1組の画像信号を読み出す。画像処理回路106は読み出された画像信号に対して所定の画像処理を適用し、照明画像と同じ形式のA画像とB画像のデータを生成する。画像処理回路106は生成した画像データをRAM107に格納する。ここで生成した画像データは「パターン光画像」と呼ぶ。パターン光を投写した状態で撮像することで、コントラストの低い被写体についての距離情報の取得精度を向上することができる。 The control unit 108 continues to take a picture in a state where the light emitting unit 101 of the auxiliary light source 101 does not emit light and the pattern light 130 is projected from the projection unit 111. The control unit 108 reads out a set of image signals from the image sensor 105 so that an A image and a B image can be generated. The image processing circuit 106 applies predetermined image processing to the read image signal to generate data of A image and B image in the same format as the illumination image. The image processing circuit 106 stores the generated image data in the RAM 107. The image data generated here is called a "pattern light image". By taking an image in a state where the pattern light is projected, it is possible to improve the acquisition accuracy of the distance information for a subject having low contrast.

ステップ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 image processing circuit 106 can acquire the distance information of the subject for each pixel from the A image and the B image, which are parallax image pairs, by using any known method. An example will be described below.

図3(b)は、A画像320AとB画像320Bを模式的に示している。まず画像処理回路106は、A画像とB画像の相関値を算出する。画像処理回路106は、A画像において距離情報を取得する画素321(注目画素と呼ぶ)を含む部分領域を基準画像322として設定する。次に画像処理回路106は、B画像において、基準画像と水平および垂直方向の大きさが同じ領域を参照画像323として設定する。 FIG. 3B schematically shows A image 320A and B image 320B. First, the image processing circuit 106 calculates the correlation value between the A image and the B image. The image processing circuit 106 sets a partial region including a pixel 321 (referred to as a pixel of interest) for acquiring distance information in the A image as a reference image 322. Next, the image processing circuit 106 sets, in the B image, a region having the same horizontal and vertical dimensions as the reference image as the reference image 323.

そして、画像処理回路106は基準画像322をテンプレートとしたブロックマッチング法により、基準画像322のずれ量を検出する。ここでは、B画像における参照画像の垂直方向の位置を参照画像と同じとし、瞳分割方向と同じx軸方向に移動させ、各位置における参照画像と基準画像との相関値を算出することで、各位置に対する相関値のデータ列を取得する。参照画像の移動方向を視差算出方向と呼ぶ。 Then, the image processing circuit 106 detects the deviation amount of the reference image 322 by the block matching method using the reference image 322 as a template. Here, the position of the reference image in the B image in the vertical direction is the same as that of the reference image, the reference image is moved in the same x-axis direction as the pupil division direction, and the correlation value between the reference image and the reference image at each position is calculated. Get the data string of the correlation value for each position. The moving direction of the reference image is called the parallax calculation direction.

視差算出方向を瞳分割方向と同じ方向とすることで、被写体距離に応じて生じる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 image processing circuit 106 calculates the parallax amount of the pixel of interest based on the data string of the correlation values obtained for the reference image. The parallax amount can be calculated using an existing method. For example, the image processing circuit 106 has a movement amount having the highest correlation by a known interpolation method using a movement amount for which a correlation value representing the highest correlation is obtained and a correlation value corresponding to an adjacent movement amount. Can be obtained with sub-pixel accuracy and used as the amount of discrimination.

算出した視差量は、既知の手法によりデフォーカス量または被写体距離に変換することができる。視差量からデフォーカス量への変換は、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 optical system 104 as the subject distance, the defocus amount can be converted into the subject distance. It may be converted into a subject distance by multiplying the parallax amount by a predetermined conversion coefficient. The amount of defocus and the subject distance are collectively called distance information.

このようにして、画像処理回路106は注目画素についての距離情報を取得することができる。A画像の各画素を注目画素として距離情報を取得することにより、距離画像を生成することができる。画像処理回路106は、生成した距離画像をRAM107に格納する。画像処理回路106は、照明画像とパターン光画像の一方、例えばパターン光画像について距離画像を生成すればよいが、それぞれについて距離画像を生成してもよい。 In this way, the image processing circuit 106 can acquire the distance information about the pixel of interest. A distance image can be generated by acquiring distance information with each pixel of the A image as a pixel of interest. The image processing circuit 106 stores the generated distance image in the RAM 107. The image processing circuit 106 may generate a distance image for one of the illumination image and the pattern light image, for example, the pattern light image, but may generate a distance image for each of them.

ステップ303「第1の影画像生成」で画像処理回路106(第1の生成手段)は、ステップ301で取得した照明画像から影画像を生成する。具体的には、画像処理回路106は、照明画像のうち、画素値(例えば輝度)が所定の閾値より以下の領域を影領域、画素値が閾値より大きい領域を照明領域とした第1の影画像を生成する。影画像は影領域の画素値を0、照明領域の画素値を1とした2値画像であってよい。なお、ここで用いる照明画像は、A画像、B画像、または通常の撮影画像(A画像とB画像の加算画像)のいずれであってもよい。 In step 303 "first shadow image generation", the image processing circuit 106 (first generation means) generates a shadow image from the illumination image acquired in step 301. Specifically, the image processing circuit 106 is a first shadow in the illumination image, in which a region having a pixel value (for example, brightness) below a predetermined threshold value is a shadow region and a region having a pixel value larger than the threshold value is an illumination region. Generate an image. The shadow image may be a binary image in which the pixel value of the shadow region is 0 and the pixel value of the illumination region is 1. The illumination image used here may be either an A image, a B image, or a normal photographed image (an image obtained by adding an A image and a B image).

ステップ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 step 304 “second shadow image calculation” includes the position information of the light emitting unit 110 that emits light when the illumination image is taken, and the distance image generated in step 302. To generate a shadow image using. The image processing circuit 106 can generate a shadow image by a known method such as a method using a distance image as a shadow map. For example, with the intersection of the optical axis 140 of the camera and the image sensor 105 as a viewpoint, a plane perpendicular to the optical axis (projection surface of the image sensor 105) existing at a predetermined distance from the viewpoint is assumed. When the distance from the point on the plane corresponding to each pixel of the image sensor 105 to the light emitting unit 110 is shorter than the value of the distance image corresponding to that pixel, that pixel is included in the shadow region. do. On the other hand, when the distance from the point on the plane corresponding to each pixel of the image sensor 105 to the light emitting unit 110 is equal to the value of the distance image corresponding to the pixel, there is nothing to block the light emitting unit 110 and its pixel. Therefore, it shall be included in the illumination area. The image processing circuit 106 stores the second shadow image thus generated in the RAM 107. The second shadow image is an image showing a shadowed portion and a non-shadowed portion in an image obtained when a virtual light source is arranged at the same position as the light emitting unit 110 that emits light when the illumination image is taken. Corresponds to.

ステップ305「影誤差領域の検出」で画像処理回路106(検出手段)は、第2の影画像に含まれる誤差領域を検出する。画像処理回路106は、RAM107に格納されている第1の影画像と第2の影画像を比較し、影領域と照明領域の判定が互いに異っている領域を影誤差領域として検出する。影画像が2値画像の場合、画像処理回路106は第1の影画像と第2の影画像との差分画像を算出し、値が0でない領域を影誤差領域として検出することができる。影画像が多値画像の場合には、画像処理回路106は、第1の影画像と第2の影画像との差分画像において、値の絶対値が閾値以上の領域を影誤差領域として検出することができる。 In step 305 “Detection of shadow error region”, the image processing circuit 106 (detection means) detects an error region included in the second shadow image. The image processing circuit 106 compares the first shadow image and the second shadow image stored in the RAM 107, and detects a region in which the determination of the shadow region and the illumination region is different from each other as the shadow error region. When the shadow image is a binary image, the image processing circuit 106 can calculate a difference image between the first shadow image and the second shadow image, and detect a region whose value is not 0 as a shadow error region. When the shadow image is a multi-valued image, the image processing circuit 106 detects a region in which the absolute value of the value is equal to or greater than the threshold value as the shadow error region in the difference image between the first shadow image and the second shadow image. be able to.

ステップ306「距離誤差領域の算出」で画像処理回路106(検出手段)は、ステップ305で求めた影誤差領域と対応する距離画像内の領域を、距離誤差領域として検出する。また、影誤差領域に対応する、S304において想定した平面内の領域の各点と発光部110との間にある点に対応する距離画像の領域を距離誤差領域として検出する。このようにして、距離画像における誤差領域(距離情報の信頼性が低い領域)を検出することができる。このように、画像処理回路106(検出手段)は、第1の影画像と第2の影画像との差異に基づいて、距離画像を構成する距離情報のうち、信頼性の低い距離情報を検出する。 In step 306 “Calculation of distance error area”, the image processing circuit 106 (detection means) detects the area in the distance image corresponding to the shadow error area obtained in step 305 as the distance error area. Further, the area of the distance image corresponding to the point between each point in the plane assumed in S304 and the light emitting unit 110 corresponding to the shadow error area is detected as the distance error area. In this way, an error region (a region where the reliability of the distance information is low) in the distance image can be detected. As described above, the image processing circuit 106 (detection means) detects the unreliable distance information among the distance information constituting the distance image based on the difference between the first shadow image and the second shadow image. do.

(影付画像の生成)
ステップ307「画像生成」で画像処理回路106は、仮想光源による照明効果(仮想ライティング効果)を付加した画像を生成する。予め設定された仮想光源の位置情報と、ステップ302で生成した距離画像のうち、ステップ306で検出した距離誤差領域を除いた部分を用いて、ステップ304と同様にして影画像を生成する。
(Generation of shaded image)
In step 307 “Image generation”, the image processing circuit 106 generates an image to which a lighting effect (virtual lighting effect) by a virtual light source is added. A shadow image is generated in the same manner as in step 304 by using the preset position information of the virtual light source and the portion of the distance image generated in step 302 excluding the distance error region detected in step 306.

ここでは、ステップ301で取得した照明画像に仮想ライティング効果を付加するものとする。画像処理回路106は、照明画像のうち、ステップ307で生成した仮想光源についての影画像において影領域となる画素について画素値(輝度値)を下げ、照明領域となる画素について画素値(輝度値)を上げるように補正する。画像処理回路106は、距離画像のうち、誤差領域に相当する領域については画素値を変更しない。 Here, it is assumed that a virtual lighting effect is added to the illumination image acquired in step 301. The image processing circuit 106 lowers the pixel value (luminance value) of the pixel in the shadow region in the shadow image of the virtual light source generated in step 307 of the illumination image, and reduces the pixel value (luminance value) of the pixel in the illumination region. Correct to raise. The image processing circuit 106 does not change the pixel value in the region corresponding to the error region in the distance image.

このように、距離画像を用いて仮想ライティング効果を付与する際に、距離画像に含まれる信頼性が低い距離情報は用いないようにすることで、不自然な仮想ライティング効果が付与されることを抑制することができる。なお、仮想ライティング効果を付与する画像はステップ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 step 301. A virtual lighting effect can be applied to any image in which the distance image in which the distance error region has been detected can be used.

●(変形例1)
図4は、第1実施形態の変形例に係る撮像装置100の動作に関するフローチャートである。図3(a)のフローチャートと同じ動作を行うステップについては同じ参照数字を付して説明を省略する。本変形例では、影誤差領域が大きい場合に、距離情報を補正して第2の影画像の生成をやり直すことにより、影誤差領域の縮小を図るものである。
● (Modification example 1)
FIG. 4 is a flowchart relating to the operation of the image pickup apparatus 100 according to the modified example of the first embodiment. The same reference numbers will be added to the steps that perform the same operations as the flowchart of FIG. 3A, and the description thereof will be omitted. In this modification, when the shadow error region is large, the shadow error region is reduced by correcting the distance information and regenerating the second shadow image.

ステップ301からステップ306は先に説明した通りであるため、説明を省略する。
ステップ308の「影誤差領域の大きさ検出」で画像処理回路106は、ステップ305で検出した影誤差領域の大きさを検出する。影誤差領域の大きさは、差分画像における横方向の長さ、縦方向の長さ、あるいは縦方向の長さと横方向の長さを乗算した面積、影誤差領域に含まれる画素数などのいずれかであってよい。
Since steps 301 to 306 are as described above, the description thereof will be omitted.
In "Detecting the size of the shadow error region" in step 308, the image processing circuit 106 detects the size of the shadow error region detected in step 305. The size of the shadow error area is any of the horizontal length, the vertical length, the area obtained by multiplying the vertical length and the horizontal length in the difference image, the number of pixels included in the shadow error area, and the like. It may be.

ステップ309「影誤差領域の大きさ判定」で、画像処理回路106は、ステップ308で算出した大きさが予め定められた閾値以上であるか否かを判定する。なお、ここで用いる閾値は、固定値であってもよいし、仮想ライティング効果を付与するための仮想光源の位置と、距離画像とを考慮して決定してもよい。 In step 309 “Determination of the size of the shadow error region”, the image processing circuit 106 determines whether or not the size calculated in step 308 is equal to or greater than a predetermined threshold value. The threshold value used here may be a fixed value, or may be determined in consideration of the position of the virtual light source for imparting the virtual lighting effect and the distance image.

影誤差が仮想ライティング効果に与える影響は、被写体の平面部においてより顕著である。平面部の面法線に対する仮想光の入射角度が大きい(平面と仮想光とのなす角度が小さい)ほど、距離情報の誤差に伴って生じる影誤差が大きくなる。そのため、例えば距離画像や輝度情報を用いて被写体の主要な平面部を検出し、平面部の面法線と仮想光の入射方向とがなす角度が大きいほど、閾値を小さく決定することができる。これにより、ステップ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 image processing circuit 106 executes step 307 as described above. On the other hand, when it is determined that the size of the shadow error region is equal to or larger than the threshold value, step 306 is executed as described above to detect the distance error region.

ステップ310「距離補正」で画像処理回路106は、距離画像のうち、距離誤差領域に含まれる距離情報を補正する。補正方法としては、距離誤差領域内の距離情報を、周囲の領域の距離情報から補間したり、周囲の領域の距離情報の平均値で置き換えたりすることができる。あるいは、画像の色情報を使用し、距離誤差領域の周辺領域で、距離誤差領域の画像と同じまたは類似した色の領域の距離情報の平均値で距離誤差領域内の距離情報を置き換えてもよい。周辺に存在する同一または類似色の周辺は、距離誤差領域と同距離もしくは類似した距離である確率が高い。そのため、周辺の同一または類似色の領域の距離情報の平均値を用いることで、補正の精度を高めることができる。 In step 310 “distance correction”, the image processing circuit 106 corrects the distance information included in the distance error region in the distance image. As a correction method, the distance information in the distance error region can be interpolated from the distance information in the surrounding region, or replaced with the average value of the distance information in the surrounding region. Alternatively, the color information of the image may be used to replace the distance information in the distance error region with the average value of the distance information in the region having the same or similar color as the image in the distance error region in the peripheral region of the distance error region. .. There is a high probability that the periphery of the same or similar color existing in the periphery has the same distance or a similar distance to the distance error region. Therefore, the accuracy of correction can be improved by using the average value of the distance information of the surrounding areas of the same or similar colors.

距離誤差領域の距離情報を補正すると、画像処理回路106は再度ステップ304を実行して、補正後の距離画像を用いて第2の影画像を再生成する。その後、画像処理回路106はステップ305で影誤差領域を再検出する。 When the distance information in the distance error region is corrected, the image processing circuit 106 executes step 304 again to regenerate the second shadow image using the corrected distance image. After that, the image processing circuit 106 rediscovers the shadow error region in step 305.

画像処理回路106は、ステップ309で影誤差領域の大きさが閾値以上と判定されなくなるまで、距離情報の補正、第2の影画像生成、影誤差領域の検出および大きさ判定を繰り返す。なお、繰返し回数に制限を設けてもよい。 The image processing circuit 106 repeats the correction of the distance information, the generation of the second shadow image, the detection of the shadow error region, and the size determination until the size of the shadow error region is not determined to be equal to or larger than the threshold value in step 309. A limit may be set on the number of repetitions.

このように、距離情報を補正することで、距離誤差領域を縮小することができ、仮想ライティング効果の精度を向上させることができる。なお、仮想ライティング効果の付加における影誤差の影響は、距離誤差領域が小さくなると目立たなくなる。そのため、距離誤差領域の大きさが閾値以上と判定されなくなった時点で距離情報の補正は打ち切ることで、処理時間の低減を図っている。 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 light emitting units 110 to emit light different, and a shadow error region may be detected for each illumination image. In this case, the image processing circuit 106 integrates the detected plurality of shadow error regions to obtain the final shadow error region. Further, the distance error region may be detected for each shadow error region.

このように、異なる照明方向ごとに影誤差領域や距離誤差領域を検出することにより、影誤差領域及び距離誤差領域の検出精度を高めることができる。さらに、距離情報の補正についても、個々の距離画像について実施することができる。これにより、より高精度に距離情報を補正することができる。 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 step 301 is compared with the illumination image acquired by illuminating from a position different from the illumination position in step 301, and the area where the pixel value of the illumination image acquired in step 301 is small (dark) is defined. It can be detected as a shadow area. Alternatively, the illumination image acquired in step 301 may be compared with the image acquired without illumination, and a region having a small pixel value of the image acquired in step 301 may be detected as a shadow region.

●(変形例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 step 306 “Detection of the distance error region” will be described with reference to FIG. 5 (a) and 5 (b) schematically show a case where the distance error regions 502 and 503 exist on the plane 501, and the shadow error region 504 is generated by the distance error regions 502 and 503.

図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 region 502 that blocks the illumination light 505, and there is no error in the distance information 506 of the shadow region 504. FIG. 5B shows a state in which there is no error in the distance information of the region 507 that blocks the illumination light 505, and there is an error in the distance information 503 of the shadow region 504.

第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 step 305.

ステップ510「候補領域検出」で画像処理回路106は、光を遮る領域502または503と、影が付く領域506または507とを候補領域として検出する。
次にステップ511「距離差算出」で画像処理回路106は、各々の候補領域について、候補領域内の距離情報と周辺の距離情報との差520と521、あるいは差522と523を算出する。
In step 510 “Candidate region detection”, the image processing circuit 106 detects the light-blocking region 502 or 503 and the shaded region 506 or 507 as candidate regions.
Next, in step 511 "Distance difference calculation", the image processing circuit 106 calculates the difference 520 and 521 or the difference 522 and 523 between the distance information in the candidate area and the surrounding distance information for each candidate area.

ステップ512「距離誤差領域検出」で画像処理回路106は、差520と521とを比較、あるいは差522と523とを比較する。そして、画像処理回路106は、差が大きい一方を距離誤差領域として検出する。このようにして、距離誤差領域をより正確に検出することができる。 In step 512 “distance error region detection”, the image processing circuit 106 compares the differences 520 and 521, or the differences 522 and 523. Then, the image processing circuit 106 detects one having a large difference as a distance error region. In this way, the distance error region can be detected more accurately.

●(変形例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 light source 101 has a configuration having a plurality of light emitting units 110 and a projection unit 111, but even if it has a configuration having one light emitting unit 110 and no projection unit 111. good. In this case, the distance information can be acquired by using an image taken with or without causing the light emitting unit 110 to emit light. Alternatively, the auxiliary light source 101 may be configured not to have a light emitting unit 110. In this case, the distance information can be acquired and the distance error region can be detected by using the image acquired by projecting the pattern light on the projection unit 111. The same effect can be obtained even when the configuration of the auxiliary light source 101 is different.

●(変形例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 units 110 by using a known illuminance difference stereo method. The normal information is information representing a change in the local shape of the subject, and it is possible to obtain highly accurate distance information by correcting the acquired distance information using the normal information. When performing the illuminance difference stereo method, it is necessary to acquire at least three images having different irradiation directions, so that the auxiliary light source 101 needs to have three or more light emitting units 110.

また、距離情報は、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 image pickup apparatus 100 has been described. However, the photographing function is not essential to the present invention, and an illumination image, a pattern light image, a distance image, a position information of a light emitting unit, and the like may be acquired from an external device. Therefore, the first embodiment and the configuration described as a modification thereof can be implemented in all electronic devices provided with a computer (CPU).

例えば、図6に示すように、照明画像、パターン光画像、距離画像、発光部の位置情報などを撮像装置100が有する通信I/F150を通じて取得可能な情報処理装置600においても、画像処理回路106と同様の動作を実行することができる。通信I/F150は有線または無線通信I/Fであってよい。また、照明画像、パターン光画像、距離画像、発光部の位置情報などは、撮像装置100からでなく、ネットワーク上のサーバや、記録媒体などから取得してもよい。情報処理装置600が有するCPUは、例えばROMなどの記憶装置に記憶されたプログラムをRAMにロードして実行することにより、上述した画像処理回路106と同様の処理を実現することができる。 For example, as shown in FIG. 6, the image processing circuit 106 is also used in the information processing device 600 capable of acquiring an illumination image, a pattern light image, a distance image, a position information of a light emitting unit, and the like through a communication I / F 150 included in the image pickup device 100. Can perform the same operation as. The communication I / F 150 may be a wired or wireless communication I / F. Further, the illumination image, the pattern light image, the distance image, the position information of the light emitting unit, and the like may be acquired not from the image pickup apparatus 100 but from a server on the network, a recording medium, or the like. The CPU included in the information processing device 600 can realize the same processing as the image processing circuit 106 described above by loading and executing a program stored in a storage device such as a ROM into the RAM.

(その他の実施形態)
投写部111は、光源としてLD(Laser Diode)を用いてもよい。また、パターンマスクとして、反射型LCOS(Liquid Crystal On Silicon)や透過型LCOSやDMD(Digital Micromirror Device)を用いてもよい。被写体の大きさや距離に応じて投写パターン130の空間周波数を動的に変更することにより、状況に応じてより高精度な距離情報の取得が可能となる。
(Other embodiments)
The projection unit 111 may use an LD (Laser Diode) as a light source. Further, as the pattern mask, a reflective LCOS (Liquid Crystal On Silicon), a transmissive LCOS, or a DMD (Digital Micromirror Device) may be used. By dynamically changing the spatial frequency of the projection pattern 130 according to the size and distance of the subject, it is possible to acquire more accurate distance information according to the situation.

投写部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 projection unit 111 is white including the entire visible light region because the effect of reflectance correction can be obtained regardless of the spectral reflectance of the subject. When the light source of the projection unit 111 is composed of three colors of R, G, and B, it matches the color filter transmission band of the image sensor 105 and is suitable from the viewpoint of light utilization efficiency with respect to the energy used. The wavelength of the light projected by the projection unit 111 is in the IR (Infrared) light emitting region, and the image sensor is also configured to support infrared light, which makes it possible to simultaneously capture viewing images using the RGB band. It is suitable. In particular, when the wavelength band of IR is between 800 nm and 1100 nm, Si can be used for the photoelectric conversion unit, and by changing the arrangement of the color filters, RGB viewing images and IR ranging images can be acquired with one image sensor. It is suitable because it can be used.

撮像装置100は、2つ以上の複数の光学系とそれに対応する撮像素子から構成されたステレオカメラで構成してもよい。この場合、基線長の設計自由度が向上し、距離情報の分解能を向上させることができる。また、補助光源は撮像装置の外部装置であってもよい。 The image pickup device 100 may be composed of a stereo camera composed of two or more optical systems and corresponding image pickup elements. In this case, the degree of freedom in designing the baseline length is improved, and the resolution of the distance information can be improved. Further, the auxiliary light source may be an external device of the imaging device.

本発明は、上述の実施形態の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. ..
前記取得手段は、前記被写体を撮影した視差画像対に基づいて前記距離情報を取得することを特徴とする請求項1に記載の距離情報取得装置。 The distance information acquisition device according to claim 1, wherein the acquisition means acquires the distance information based on a parallax image pair in which the subject is photographed. 前記視差画像対が、前記被写体に特定のパターン光を投写して撮影された画像であることを特徴とする請求項2に記載の距離情報取得装置。 The distance information acquisition device according to claim 2, wherein the parallax image pair is an image taken by projecting a specific pattern light onto the subject. 前記距離情報が、画素ごとに対応する距離情報を有する距離画像であることを特徴とする請求項1から3のいずれか1項に記載の距離情報取得装置。 The distance information acquisition device according to any one of claims 1 to 3, wherein the distance information is a distance image having distance information corresponding to each pixel. 前記距離画像のうち、前記信頼性の低い距離情報を有する領域の大きさが閾値以上である場合に、前記信頼性の低い距離情報を補正する補正手段をさらに有し、
前記第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の生成手段が、互いに異なる位置で補助光源を発光させて撮影された複数の前記第1の撮像画像のそれぞれから前記第1の影画像を生成し、
前記検出手段は、前記第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から6のいずれか1項に記載の距離情報取得装置。 Among the distance information, the detection means detects the distance information of the region that blocks the light of the auxiliary light source and the distance information of the region that blocks the light of the auxiliary light source and becomes a shadow as a candidate region, and detects the candidate. The claim is characterized in that, among the regions, the distance information of the candidate region having a large difference between the distance information of the candidate region and the distance information of the peripheral region of the candidate region is detected as the unreliable distance information. The distance information acquisition device according to any one of 1 to 6. 前記距離情報を用いて、前記被写体を撮影した撮像画像に対して仮想光源による仮想ライティング効果を付加した画像を生成する付加手段をさらに有し、
前記付加手段は、前記距離情報のうち、前記検出手段によって検出された、前記信頼性の低い距離情報を用いない、ことを特徴とする請求項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. ..
コンピュータを、請求項1から8のいずれか1項に記載の距離情報取得装置が有する各手段として機能させるためのプログラム。 A program for causing a computer to function as each means included in the distance information acquisition device according to any one of claims 1 to 8.
JP2020020888A 2020-02-10 2020-02-10 Distance information acquisition device and distance information acquisition method Pending JP2021127998A (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023195403A1 (en) * 2022-04-06 2023-10-12 株式会社Jvcケンウッド Image processing device and image processing method

Cited By (1)

* Cited by examiner, † Cited by third party
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