JP6555990B2 - Distance measuring device, imaging device, and distance measuring method - Google Patents

Distance measuring device, imaging device, and distance measuring method Download PDF

Info

Publication number
JP6555990B2
JP6555990B2 JP2015172877A JP2015172877A JP6555990B2 JP 6555990 B2 JP6555990 B2 JP 6555990B2 JP 2015172877 A JP2015172877 A JP 2015172877A JP 2015172877 A JP2015172877 A JP 2015172877A JP 6555990 B2 JP6555990 B2 JP 6555990B2
Authority
JP
Japan
Prior art keywords
distance
color plane
color
evaluation value
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2015172877A
Other languages
Japanese (ja)
Other versions
JP2016090568A (en
Inventor
知 小松
知 小松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to US14/921,125 priority Critical patent/US9928598B2/en
Publication of JP2016090568A publication Critical patent/JP2016090568A/en
Application granted granted Critical
Publication of JP6555990B2 publication Critical patent/JP6555990B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は距離計測装置に関連する。   The present invention relates to a distance measuring device.

従来、撮像装置によって取得された画像から撮影シーンの距離を取得する手法として特許文献1のようなDepth from Defocus(DFD)法が提案されている。DFD法では撮像光学系の撮影パラメータを制御することでぼけの異なる複数の画像を取得し、複数の取得画像において測定対象画素およびその周辺画素を用いて互いのぼけの大きさや相関量を算出する。このぼけの大きさや相関量は画像中の被写体の距離に応じて変化するため、その関係を用いて距離を算出する。DFD法による距離計測は、1つの撮像系によって距離を算出することできるため、市販されている撮像装置に組み込むことが可能といった利点を有する。   Conventionally, a depth from focus (DFD) method as disclosed in Patent Document 1 has been proposed as a method for acquiring the distance of a shooting scene from an image acquired by an imaging apparatus. In the DFD method, a plurality of images with different blurs are acquired by controlling shooting parameters of the imaging optical system, and the size and correlation amount of each other are calculated using the measurement target pixel and its surrounding pixels in the plurality of acquired images. . Since the size of the blur and the correlation amount change according to the distance of the subject in the image, the distance is calculated using the relationship. The distance measurement by the DFD method has an advantage that it can be incorporated into a commercially available imaging device because the distance can be calculated by one imaging system.

特許文献1では、被写体距離が空間変動する場合でも高精度に距離計測可能とするために、撮影した輝度画像から局所領域を選択して重みづけを行う距離計測方法が提案されている。   Patent Document 1 proposes a distance measurement method that selects and weights a local region from a captured luminance image in order to enable distance measurement with high accuracy even when the subject distance varies spatially.

特許文献2では、光学系を変えることで1回の撮影で異なる撮影パラメータの画像を取得することを可能にしている。また、被写体の距離によって異なる色の輝度画像を用いて距離計測を行う提案がされている。
また、距離を取得する方法として、異なる瞳領域を通過した光束による画像の像ズレ量を用いた位相差検出方式もある。
In Patent Document 2, it is possible to acquire images of different shooting parameters by one shooting by changing the optical system. In addition, a proposal has been made to measure distances using luminance images of different colors depending on the distance of the subject.
In addition, as a method for acquiring the distance, there is a phase difference detection method using an image shift amount of an image by a light beam that has passed through different pupil regions.

特開2010−016743号公報JP 2010-016743 A 特許第5159986号公報Japanese Patent No. 5159986

特許文献1に記載されているようなDFD法による距離計測は、撮像光学系によるぼけの大きさが被写体までの距離に応じて変化することを利用し、撮影した画像のぼけの大きさから距離を算出している。開示されているDFD法は輝度画像を用いて距離計測を行っているが、輝度画像がモノクロの撮像素子から得られたものである場合は、様々な波長成分が混合した光の輝度値が得られる。光学系に軸上色収差がある場合には、被写体像の色(波長)ごとにぼけ方が異なるために距離計測結果にばらつきが生じる。ベイヤー配列の撮像素子からYUV変換して得られた輝度画像を用いる場合も同様の課題が生じる。また、ベイヤー配列の緑画素の輝度画像(G画像)を用いる場合は、被写体像が緑色成分を含まない場合に正しい距離計測ができない。具体的には、G画像の輝度が低くなるので、SNが悪化し距離計測ができなかったり、距離計測精度が低下したりするといった課題がある。
この課題はDFD法を用いる場合に限定されるものではなく、位相差検出方式を用いる場合にも生じる。
The distance measurement by the DFD method as described in Patent Document 1 utilizes the fact that the blur size by the imaging optical system changes according to the distance to the subject, and the distance from the blur size of the captured image. Is calculated. The disclosed DFD method uses a luminance image to measure distance. However, if the luminance image is obtained from a monochrome image sensor, the luminance value of light in which various wavelength components are mixed is obtained. It is done. When the optical system has axial chromatic aberration, the distance measurement result varies because the blurring method differs for each color (wavelength) of the subject image. A similar problem occurs when using a luminance image obtained by YUV conversion from an image sensor with a Bayer array. When a luminance image (G image) of green pixels in a Bayer array is used, correct distance measurement cannot be performed when the subject image does not include a green component. Specifically, since the luminance of the G image is lowered, there is a problem that SN is deteriorated and distance measurement cannot be performed, or distance measurement accuracy is lowered.
This problem is not limited to the case where the DFD method is used, but also occurs when the phase difference detection method is used.

特許文献2では、軸上色収差を発生させた光学系を用いて、色別に距離計測を行うことで距離計測範囲を拡張しているが、被写体色によっては距離計測ができない課題は残存している。   In Patent Document 2, the distance measurement range is expanded by performing distance measurement for each color using an optical system that generates axial chromatic aberration, but there remains a problem that distance measurement cannot be performed depending on the subject color. .

上記のような問題を考慮して、本発明は、被写体色によらず安定した精度の良い距離計測を行うことを目的とする。   In view of the above problems, an object of the present invention is to perform stable and accurate distance measurement regardless of the subject color.

上記課題を解決するために、本発明に係る距離計測装置は、第一のカラー画像と第二のカラー画像に基づき、被写体の距離情報を算出する距離計測装置であって、前記二つのカラー画像を用いて各カラープレーンにおいて注目画素の距離情報をそれぞれ算出可能な距離算出手段と、前記注目画素における距離情報の信頼度を表す評価値をカラープレーンごとに算出する評価値算出手段と、を有し、前記距離算出手段は、前記評価値に基づいて、どのカラープレーンに基づいて前記注目画素の距離情報を算出するかを決定する。   In order to solve the above problems, a distance measuring device according to the present invention is a distance measuring device that calculates distance information of a subject based on a first color image and a second color image, and the two color images Distance calculation means capable of calculating the distance information of the pixel of interest in each color plane using the color plane, and evaluation value calculation means for calculating an evaluation value representing the reliability of the distance information in the pixel of interest for each color plane. Then, the distance calculating means determines which color plane to calculate the distance information of the target pixel based on the evaluation value.

また、本発明に係る距離計測方法は、第一のカラー画像と第二のカラー画像に基づき、被写体の距離情報を算出する距離計測装置が行う距離計測方法であって、注目画素における距離情報の信頼度を表す評価値をカラープレーンごとに算出する評価値算出ステップと、前記評価値に基づいて、どのカラープレーンを用いて前記注目画素の距離情報を算出するかを決定する選択ステップと、前記決定にしたがって、前記注目画素の距離情報を算出する距離算出ステップと、を含む。   The distance measurement method according to the present invention is a distance measurement method performed by a distance measurement device that calculates distance information of a subject based on a first color image and a second color image, and includes the distance information of a target pixel. An evaluation value calculating step for calculating an evaluation value representing reliability for each color plane; a selection step for determining which color plane is used to calculate the distance information of the target pixel based on the evaluation value; A distance calculating step of calculating distance information of the target pixel according to the determination.

本発明による距離計測方法によれば、被写体色に因らず安定した精度の良い距離計測を行うことができる。   According to the distance measurement method of the present invention, stable and accurate distance measurement can be performed regardless of the subject color.

第一の実施形態に係る撮像装置の構成を示す図。1 is a diagram illustrating a configuration of an imaging apparatus according to a first embodiment. 第一の実施形態における距離計測処理の流れを示すフローチャート。The flowchart which shows the flow of the distance measurement process in 1st embodiment. 第一の実施形態における距離マップ生成処理の流れを示すフローチャート。The flowchart which shows the flow of the distance map production | generation process in 1st embodiment. カラープレーンごとの相関値の違いを説明する図。The figure explaining the difference in the correlation value for every color plane. 第一の実施形態における距離統合処理の流れを示すフローチャート。The flowchart which shows the flow of the distance integration process in 1st embodiment. 第二の実施形態における距離統合処理の流れを示す図。The figure which shows the flow of the distance integration process in 2nd embodiment. 第三の実施形態における距離統合処理の流れを示す図。The figure which shows the flow of the distance integration process in 3rd embodiment. 第四の実施形態における距離マップ生成処理の流れを示すフローチャート。The flowchart which shows the flow of the distance map production | generation process in 4th embodiment. 第四の実施形態における撮像素子を説明する図。The figure explaining the image pick-up element in 4th embodiment. 第四の実施形態における距離計測処理の流れを示すフローチャート。The flowchart which shows the flow of the distance measurement process in 4th embodiment.

(第一実施形態)
<システム構成>
図1は、本発明の第一実施形態に係る撮像装置のシステム構成図である。撮像装置1は、撮像光学系10、撮像素子11、制御部12、信号処理部13、距離計測部14、メモリ15、入力部16、表示部17、記憶部18を有する。
(First embodiment)
<System configuration>
FIG. 1 is a system configuration diagram of an imaging apparatus according to the first embodiment of the present invention. The imaging apparatus 1 includes an imaging optical system 10, an imaging element 11, a control unit 12, a signal processing unit 13, a distance measurement unit 14, a memory 15, an input unit 16, a display unit 17, and a storage unit 18.

撮像光学系10は、複数のレンズから構成され、入射する光を撮像素子11の像面上に結像させる光学系である。撮像光学系10としては可変焦点の光学系が用いられており、制御部12のオートフォーカス機能により自動焦点合わせが可能である。オートフォーカスの方式はパッシブ方式でもアクティブ方式でもよい。   The imaging optical system 10 is an optical system that includes a plurality of lenses and forms incident light on the image plane of the imaging element 11. As the imaging optical system 10, a variable focus optical system is used, and automatic focusing is possible by the autofocus function of the control unit 12. The auto focus method may be either a passive method or an active method.

撮像素子11は、CCDやCMOSなどを有する撮像素子であり、カラー画像を取得する。撮像素子11は、カラーフィルタを有する撮像素子でもよいし、色の異なる三板式の撮像素子でもよい。また、本実施形態の撮像素子11はRGBの3色のカラー画像を取得
するが、可視光以外を含む3色以上のカラー画像を取得する撮像素子であってもよい。
The image sensor 11 is an image sensor having a CCD, a CMOS, or the like, and acquires a color image. The image sensor 11 may be an image sensor having a color filter, or may be a three-plate image sensor having a different color. The image sensor 11 of the present embodiment acquires RGB color images of three colors, but may be an image sensor that acquires three or more color images including other than visible light.

制御部12は、撮像装置1の各部を制御する機能部である。制御部12の機能としては、例えば、オートフォーカス(AF)による自動焦点合わせ、フォーカス位置の変更、F値(絞り)の変更、画像の取り込み、シャッターやフラッシュ(いずれも不図示)の制御、入力部16や表示部17や記憶部18の制御などがある。   The control unit 12 is a functional unit that controls each unit of the imaging apparatus 1. Functions of the control unit 12 include, for example, automatic focusing by autofocus (AF), change of focus position, change of F value (aperture), image capture, control of shutter and flash (both not shown), input There are control of the unit 16, the display unit 17, and the storage unit 18.

信号処理部13は、撮像素子11から出力された信号に対して処理を行う機能部である。具体的な信号処理部13の機能には、アナログ信号のA/D変換やノイズ除去、デモザイキング、輝度信号変換、収差補正、ホワイトバランス調整、色補正などがある。信号処理部13から出力されるデジタル画像データは一時的にメモリ15に蓄積された後、表示部17への表示、記憶部18への記録(保存)、距離計測部14への出力などがされ、所望の処理が行われる。   The signal processing unit 13 is a functional unit that performs processing on a signal output from the image sensor 11. Specific functions of the signal processing unit 13 include analog signal A / D conversion, noise removal, demosaicing, luminance signal conversion, aberration correction, white balance adjustment, color correction, and the like. The digital image data output from the signal processing unit 13 is temporarily stored in the memory 15, and then displayed on the display unit 17, recorded (stored) in the storage unit 18, and output to the distance measurement unit 14. The desired process is performed.

距離計測部14は、画像中の物体までの奥行き方向の距離を算出する機能部である。距離計測部14は、評価値算出部141と距離算出部142とを備える。評価値算出部141は、カラー画像のカラープレーンのそれぞれについて距離算出の信頼度を表す評価値を求める機能を有する。距離算出部142は、カラー画像のカラープレーンのそれぞれから距離を算出する機能と、カラープレーン別の距離と評価値とに基づいて最終的な距離を算出する機能とを有する。距離計測部14の詳しい動作については後述する。   The distance measuring unit 14 is a functional unit that calculates the distance in the depth direction to an object in the image. The distance measurement unit 14 includes an evaluation value calculation unit 141 and a distance calculation unit 142. The evaluation value calculation unit 141 has a function of obtaining an evaluation value representing the reliability of distance calculation for each color plane of the color image. The distance calculation unit 142 has a function of calculating a distance from each color plane of the color image, and a function of calculating a final distance based on the distance and evaluation value for each color plane. Detailed operation of the distance measuring unit 14 will be described later.

入力部16は、ユーザが操作し、撮像装置1に対して情報入力や設定変更を行うためのインターフェイスである。例えばダイヤル、ボタン、スイッチ、タッチパネルなどを利用することができる。   The input unit 16 is an interface that is operated by the user to input information and change settings on the imaging apparatus 1. For example, dials, buttons, switches, touch panels, etc. can be used.

表示部17は、液晶ディスプレイや有機ELディスプレイなどで構成される表示手段である。表示部17は、撮影時の構図確認、撮影・記録した画像の閲覧、各種設定画面やメッセージ情報の表示などに利用される。   The display unit 17 is a display unit configured by a liquid crystal display, an organic EL display, or the like. The display unit 17 is used for composition confirmation at the time of photographing, browsing of photographed / recorded images, display of various setting screens and message information, and the like.

記憶部18は、撮影された画像データや、撮像装置1で利用されるパラメータデータなどが格納される不揮発性の記憶媒体である。記憶部18としては、高速に読み書きでき、且つ、大容量の記憶媒体を用いることが好ましい。例えばフラッシュメモリなどを好適に用いることができる。   The storage unit 18 is a non-volatile storage medium that stores captured image data, parameter data used by the imaging apparatus 1, and the like. The storage unit 18 is preferably a high-capacity storage medium that can read and write at high speed. For example, a flash memory can be suitably used.

<被写体距離の計測方法>
次に、撮像装置1が行う距離計測処理について、処理の流れを示したフローチャートである図2を参照しながら詳細に説明する。
<Subject distance measurement method>
Next, distance measurement processing performed by the imaging apparatus 1 will be described in detail with reference to FIG. 2 which is a flowchart showing the flow of processing.

ユーザが、入力部16を操作して距離計測の実行を指示し撮影を開始すると、オートフォーカス(AF)や自動露光制御(AE)が実行された後に撮影が実行し、フォーカス位置と絞り(Fナンバー)を決定する(ステップS11)。その後、ステップS12にて撮影が実行され、撮像素子11から画像を取り込む。   When the user operates the input unit 16 to instruct the execution of distance measurement and starts shooting, shooting is performed after auto focus (AF) or automatic exposure control (AE) is performed, and the focus position and aperture (F Number) is determined (step S11). Thereafter, shooting is performed in step S <b> 12, and an image is captured from the image sensor 11.

一枚目の撮影が完了すると、制御部12が撮影パラメータを変更する(ステップS13)。変更される撮影パラメータとは、絞り(Fナンバー)、フォーカス位置、焦点距離のうちの少なくともいずれか一つである。パラメータの値として、予め保存された値を読み出して使用してもよいし、ユーザが入力した情報をもとに決定された値を使用してもよい。撮影パラメータの変更が完了すると、処理はステップS14に遷移し、二枚目の撮影が行われる。   When the first shooting is completed, the control unit 12 changes the shooting parameters (step S13). The imaging parameter to be changed is at least one of an aperture (F number), a focus position, and a focal length. As the parameter value, a value stored in advance may be read and used, or a value determined based on information input by the user may be used. When the change of the shooting parameter is completed, the process proceeds to step S14, and the second shooting is performed.

本実施形態では、フォーカス位置を変更して二枚目の画像を撮影する。例えば、一枚目は主被写体に合焦するように撮影を行い、二枚目は主被写体がぼけるようにフォーカス位置を変更して撮影を行う。   In this embodiment, the focus position is changed and a second image is taken. For example, the first image is shot so as to focus on the main subject, and the second image is shot while changing the focus position so that the main subject is blurred.

なお、複数の画像を撮影する際は、シャッター速度が高速であるほど、また、撮影間隔が短いほど、手ぶれや被写体ぶれの影響が軽減される。したがって、より高精度な距離計測を行うためには、シャッター速度を高速にし、かつ、撮影間隔を短くすることが望ましい。ただし、シャッター速度を上げるために感度を上げると、場合によっては手ぶれの影響以上にノイズの影響が増加するため、感度を考慮して適切なシャッター速度を設定する必要がある。   When shooting a plurality of images, the higher the shutter speed and the shorter the shooting interval, the less the influence of camera shake and subject blur. Therefore, in order to perform distance measurement with higher accuracy, it is desirable to increase the shutter speed and shorten the shooting interval. However, if the sensitivity is increased in order to increase the shutter speed, the influence of noise increases more than the influence of camera shake in some cases, so it is necessary to set an appropriate shutter speed in consideration of the sensitivity.

二枚の画像が撮影されると、撮影された画像は、距離計測に適した画像となるように信号処理部13でそれぞれ処理され、一時的にメモリ15に蓄積される。具体的には現像処理が行われるが、信号処理によってぼけが変化しないようにエッジ強調処理などは避ける必要がある。また、以後の処理に利用する画像は、カラー画像の場合ベイヤー配列からデモザイキングまたは特定色のみを画素選択して生成したRGB各画像とする。R画像、G画像、B画像が、本実施形態におけるカラープレーン画像である。また、撮影した2枚の画像のうち少なくとも1枚を、観賞用の画像として信号処理し、メモリ15に蓄積してもよい。   When two images are photographed, the photographed images are each processed by the signal processing unit 13 so as to become an image suitable for distance measurement, and are temporarily stored in the memory 15. Specifically, development processing is performed, but it is necessary to avoid edge enhancement processing or the like so that blur does not change due to signal processing. In the case of a color image, the image used for the subsequent processing is an RGB image generated by demosaicing or selecting only a specific color from the Bayer array. The R image, the G image, and the B image are color plane images in the present embodiment. In addition, at least one of the two captured images may be signal-processed as an ornamental image and stored in the memory 15.

ステップS15では、距離計測部14が、メモリ15に蓄積された距離計測用の2枚のカラー画像を入力として受け付け、これらのカラー画像から距離マップを算出する。距離マップとは、画像中の被写体距離の分布を表すデータである。なお、被写体距離は、撮像装置から被写体までの絶対距離として表されてもよいし、フォーカス位置から被写体までの相対的な距離で表されてもよい。また、被写体距離は、物体距離で表されてもよいし、像距離で表されてもよい。さらには、ぼけの大きさや相関量など距離に換算可能な値を、被写体距離(距離情報)として用いてもよい。算出された被写体距離の分布(距離マップ)は表示部17を通して表示され、また、記録部19に保存される。   In step S15, the distance measuring unit 14 receives as input two color images for distance measurement stored in the memory 15, and calculates a distance map from these color images. A distance map is data representing the distribution of subject distances in an image. The subject distance may be expressed as an absolute distance from the imaging device to the subject, or may be expressed as a relative distance from the focus position to the subject. The subject distance may be represented by an object distance or an image distance. Furthermore, a value that can be converted into a distance, such as the size of the blur or the amount of correlation, may be used as the subject distance (distance information). The calculated subject distance distribution (distance map) is displayed through the display unit 17 and stored in the recording unit 19.

次に、ステップS15で距離計測部14が行う処理(以下、距離マップ生成処理)についてより詳細に説明する。図3は、本実施形態における距離マップ生成ステップS15の流れを示したフローチャート図である。   Next, the process (hereinafter, distance map generation process) performed by the distance measurement unit 14 in step S15 will be described in more detail. FIG. 3 is a flowchart showing the flow of the distance map generation step S15 in the present embodiment.

距離計測部14は、2枚のカラー画像を受け取ると、カラープレーン選択ステップS21において、2枚のカラー画像からそれぞれ同じ色のカラープレーン画像を選択する。ステップS22からS25の処理は全てのカラープレーンを対象として実行されるので、ステップS21におけるカラープレーンの選択順序は特に限定されない。   When the two color images are received, the distance measuring unit 14 selects a color plane image of the same color from the two color images in a color plane selection step S21. Since the processing of steps S22 to S25 is executed for all color planes, the order of selecting color planes in step S21 is not particularly limited.

次に帯域制限ステップS22で、距離算出部142は、生成された2枚のカラープレーン画像に対して所望の空間周波数帯域を抽出するようにフィルタリング処理を実行し、帯域制限されたカラープレーン画像を生成する。ぼけの変化が空間周波数によって異なるので、帯域制限ステップS22では、安定した距離計測を行えるように注目する周波数帯域のみを抽出する。空間周波数帯の抽出は、周波数空間に変換して行ってもよいし、フィルタリングによって行ってもよく、その手法は限定されない。高周波帯域はノイズの影響が大きいため、低域から中域周波数を通過させるのが良い。   Next, in the band limiting step S22, the distance calculation unit 142 executes a filtering process so as to extract a desired spatial frequency band for the two generated color plane images, and the band limited color plane image is obtained. Generate. Since the change in blur differs depending on the spatial frequency, in the band limiting step S22, only the frequency band of interest is extracted so that stable distance measurement can be performed. The extraction of the spatial frequency band may be performed after being converted into a frequency space, or may be performed by filtering, and the method is not limited. Since the influence of noise is large in the high frequency band, it is preferable to pass the low frequency to the middle frequency.

領域選択ステップS23では、距離算出部142は、帯域制限された2枚のカラープレーン画像において同じ座標位置の注目画素およびその周辺の局所領域を選択する。1画素ずつずらして画像全体に渡り注目画素および局所領域を設定し、以下の処理を行うことで入力画像全体の距離画像(距離マップ)を算出することが可能となる。距離マップは必ず
しも入力画像と同じ画素数でなくともよく、入力画像の数画素ごとに算出しても良い。また、局所領域の設定は、予め指定された1つ以上の領域を対象として行っても良いし、入力部16によりユーザがその範囲を指定しても良い。
In the region selection step S23, the distance calculation unit 142 selects the target pixel at the same coordinate position and the surrounding local region in the two band-limited color plane images. It is possible to calculate the distance image (distance map) of the entire input image by setting the pixel of interest and the local region over the entire image by shifting one pixel at a time and performing the following processing. The distance map does not necessarily have the same number of pixels as the input image, and may be calculated for every several pixels of the input image. The local area may be set for one or more areas specified in advance, or the range may be specified by the user using the input unit 16.

次に相関演算ステップS24では、距離算出部142は、前記領域選択ステップS23で選択した第一の画像の局所領域と、第二の画像の局所領域との相関を数式1の式で算出する。

Figure 0006555990
ここで、NCCは注目画素jを中心とする局所領域における相関値を表し、I1,iは一方のカラープレーン画像における画素位置iでの画素値を表し、I2,iは他方のカラープレーン画像における画素位置iでの画素値を表わす。総和は注目画素jを中心とする局所領域を対象として行われる。また、バーのついたIおよびIは、それぞれのカラープレーン画像における局所領域内での画素値の平均値である。 Next, in the correlation calculation step S24, the distance calculation unit 142 calculates the correlation between the local region of the first image selected in the region selection step S23 and the local region of the second image by the equation (1).
Figure 0006555990
Here, NCC j represents the correlation value in the local region centered on the pixel of interest j, I 1, i represents the pixel value at the pixel position i in one color plane image, and I 2, i represents the other color. The pixel value at the pixel position i in the plain image is represented. The summation is performed on a local region centered on the pixel of interest j. Further, I 1 and I 2 with a bar are average values of pixel values in a local region in each color plane image.

収差が無くデフォーカスした場合のぼけ方がフォーカス前後で同じ場合、像側においてフォーカスを移動して撮影した2つのフォーカス位置の中間でぼけが同等となり、その位置での相関が最も高い値となる。この中間位置から離れるに従い、二画像のぼけ方は変化し相関が低下していく。つまりぼけが同じ位置をピークとしてその位置から前後に離れるに従い相関が低下する。相関値はデフォーカスによるぼけに応じた値となるため、相関値がわかれば対応するデフォーカス量を知ることができ、相対的な距離を算出することが可能となる。   If there is no aberration and the defocus is the same before and after the focus, the blur is equivalent between the two focus positions taken by moving the focus on the image side, and the correlation at that position is the highest value. . As the distance from the intermediate position increases, the blurring of the two images changes and the correlation decreases. That is, the correlation decreases as the blur becomes the peak at the same position and moves away from that position. Since the correlation value is a value corresponding to the blur due to defocus, if the correlation value is known, the corresponding defocus amount can be known, and the relative distance can be calculated.

次に距離変換ステップS25では、距離算出部142は、相関演算ステップS24で算出された相関値を像距離に変換する。相関値と像距離の関係を図4に示す。カラープレーンによって相関値のデフォーカス特性の傾きや相関値が最大になる位置が異なる。傾きは波長による深度の違いによるもので、フォーカス位置のずれは軸上色収差に起因するものである。よって、距離算出部142は、カラープレーンごとに相関値から像距離に変換する異なる変換テーブルまたは変換式を保持しておき、カラープレーンごとに異なる変換によって像距離に変換する。変換テーブルまたは変換式は、予め計測によって求めるか光学設計情報を利用したシミュレーションによって求めておく。シミュレーションの場合、カラープレーンごとの変換テーブルおよび変換式は、カラーフィルタごとの中心波長や最も透過率の高い波長を代表波長としてその波長を用いたシミュレーションした結果を適用する。代表波長を求めるに当たり、カラーフィルタ中の波長とその透過率から重心波長を求めて利用しても良い。同じ距離にある物体でもカラープレーンごとに異なる相関値が算出されるが、距離変換ステップS25によりカラープレーンに依存しない像距離が得られる。   Next, in the distance conversion step S25, the distance calculation unit 142 converts the correlation value calculated in the correlation calculation step S24 into an image distance. The relationship between the correlation value and the image distance is shown in FIG. The inclination of the defocus characteristic of the correlation value and the position where the correlation value is maximized differ depending on the color plane. The tilt is due to the difference in depth depending on the wavelength, and the shift of the focus position is due to axial chromatic aberration. Therefore, the distance calculation unit 142 holds different conversion tables or conversion formulas for converting the correlation value into the image distance for each color plane, and converts the image distance to the image distance by different conversion for each color plane. The conversion table or the conversion formula is obtained in advance by measurement or by simulation using optical design information. In the case of simulation, the conversion table and conversion formula for each color plane apply the result of simulation using the wavelength of the center wavelength and the wavelength with the highest transmittance for each color filter as the representative wavelength. In obtaining the representative wavelength, the centroid wavelength may be obtained from the wavelength in the color filter and the transmittance thereof and used. Although different correlation values are calculated for each color plane even for objects at the same distance, an image distance independent of the color plane is obtained by the distance conversion step S25.

本実施形態では演算の方法として数式1を例に説明したが、2つのカラープレーン間のぼけの関係を判断できる数式であればよくこの式に限定するものではない。演算に応じた出力値と像面でのフォーカス位置の関係が既知であれば相対距離への変換が可能である。   In the present embodiment, Formula 1 has been described as an example of the calculation method, but the formula is not limited to this formula as long as the formula can determine the blur relationship between the two color planes. If the relationship between the output value according to the calculation and the focus position on the image plane is known, conversion to a relative distance is possible.

他の演算例としては、以下の数式2などが挙げられる。

Figure 0006555990
As another calculation example, the following formula 2 and the like can be given.
Figure 0006555990

また、フーリエ変換を行い周波数空間での評価による距離算出演算として数式3などが挙げられる。

Figure 0006555990
ここでFはフーリエ変換を表し、OTFは光学伝達関数、Sは撮影シーンのフーリエ変換結果を表している。数式3では、2つの撮影条件における光学伝達関数の比が得られ、予め光学系の設計データからこの値のデフォーカスによる変化を知ることができるため相対距離への変換が可能となる。 Moreover, Formula 3 etc. are mentioned as distance calculation calculation by performing a Fourier transform and evaluating in frequency space.
Figure 0006555990
Here, F represents the Fourier transform, OTF represents the optical transfer function, and S represents the Fourier transform result of the shooting scene. In Formula 3, the ratio of the optical transfer function under the two imaging conditions can be obtained, and the change due to defocusing of this value can be known in advance from the design data of the optical system, so that it can be converted into a relative distance.

距離変換ステップS25が終了すると、領域選択ステップS23に戻り、未処理の注目画素を対象として上述の処理を繰り返す。指定された領域もしくは画像全域に対する演算が終了するまで領域選択ステップS23と相関演算ステップS24を繰り返し実行する。この繰り返し処理により、1つのカラープレーンについての距離マップの生成が行える。距離変換ステップS25が全ての局所領域に対して終了すると、処理は終了判定ステップS26に移る。   When the distance conversion step S25 ends, the process returns to the region selection step S23, and the above-described processing is repeated for the unprocessed target pixel. The area selection step S23 and the correlation calculation step S24 are repeatedly executed until the calculation for the designated area or the entire image is completed. This iterative process can generate a distance map for one color plane. When the distance conversion step S25 is completed for all local regions, the process proceeds to an end determination step S26.

終了判定ステップS26では、距離算出部142は、カラー画像に含まれる全てのカラープレーンに対して処理が完了したかを判定する。処理が終わっていないカラープレーンがある場合は、カラープレーン選択ステップS21に戻って距離変換ステップS25までの処理を繰り返す。全てのカラープレーンについて距離マップの生成が終わると、処理は距離統合ステップS27に移る。   In the end determination step S26, the distance calculation unit 142 determines whether the processing has been completed for all the color planes included in the color image. If there is a color plane that has not been processed, the process returns to the color plane selection step S21 to repeat the processing up to the distance conversion step S25. When the generation of the distance map is completed for all the color planes, the process proceeds to the distance integration step S27.

距離統合ステップS27では、距離計測部14は、距離変換ステップS25で算出された複数のカラープレーンの距離マップから画素ごとに信頼度の高いカラープレーンの距離を選択して最終的な距離マップを生成する。距離統合ステップS27の詳細を、図5Aのフローチャートに示す。   In the distance integration step S27, the distance measurement unit 14 generates a final distance map by selecting the color plane distance with high reliability for each pixel from the distance maps of the plurality of color planes calculated in the distance conversion step S25. To do. Details of the distance integration step S27 are shown in the flowchart of FIG. 5A.

評価値算出部141は、距離マップの注目画素における距離情報の信頼度を表す評価値を、カラープレーンごとに算出する(S31)。本実施形態では、評価値として、カラーフィルタの透過率の補正を行う前のカラープレーンごとの輝度値を用いる。なお、評価値の算出の元となるカラープレーン画像は、2枚のカラー画像のいずれか1枚についてのカラープレーン画像であってもよいし、2枚のカラー画像を合成して得られるカラー画像についてのカラープレーン画像であってもよい。   The evaluation value calculation unit 141 calculates, for each color plane, an evaluation value that represents the reliability of the distance information at the target pixel in the distance map (S31). In the present embodiment, as an evaluation value, a luminance value for each color plane before correcting the transmittance of the color filter is used. The color plane image from which the evaluation value is calculated may be a color plane image for any one of the two color images, or a color image obtained by synthesizing the two color images. May be a color plane image.

距離算出部142は、評価値が最も高いカラープレーンにおける距離を、注目画素における距離として選択する(S32)。これは、輝度値が高いカラープレーンを用いた方が、SNが良く精度の高い測距結果が得られるためである。   The distance calculation unit 142 selects the distance in the color plane having the highest evaluation value as the distance in the target pixel (S32). This is because the use of a color plane having a high luminance value provides a highly accurate ranging result with good SN.

以上の評価値算出ステップS31と距離選択ステップS32を、距離マップの全画素に対して行うことで、カラープレーンごとに算出された距離マップを統合した一つの距離マップが生成される。   By performing the above-described evaluation value calculation step S31 and distance selection step S32 for all the pixels of the distance map, one distance map in which the distance maps calculated for each color plane are integrated is generated.

なお、図5Aのフローチャートでは、画素ごとに評価値算出ステップS31および距離選択ステップS32の処理を行っているが、全画素について評価値算出処理を行ってから、全画素について距離選択ステップS32を行ってもよい。また、評価値を求めるタイミングは、距離選択ステップS32の前であればどのタイミングであっても構わない。   In the flowchart of FIG. 5A, the processing of the evaluation value calculation step S31 and the distance selection step S32 is performed for each pixel. However, after the evaluation value calculation processing is performed for all pixels, the distance selection step S32 is performed for all pixels. May be. The timing for obtaining the evaluation value may be any timing as long as it is before the distance selection step S32.

図5Bは、本実施形態の距離マップ生成ステップS15におけるデータの流れを説明する図である。複数のカラープレーンからなるカラー画像から、距離算出部142によって、カラープレーンごとに、各画素についての距離情報を含む距離マップが生成される(S21〜S26)。また、複数のカラープレーンからなるカラー画像から、評価値算出部103によって、カラープレーンごとに、各画素についての距離情報の信頼度を表す評価値が算出される(S31)。そして、距離算出部142が、画素ごとに、評価値に基づいてどのカラープレーンから得られる距離情報を用いて最終的な距離マップを生成するかを決定する(S32)。   FIG. 5B is a diagram illustrating a data flow in the distance map generation step S15 of the present embodiment. A distance map including distance information for each pixel is generated for each color plane by the distance calculation unit 142 from a color image including a plurality of color planes (S21 to S26). Further, an evaluation value representing the reliability of the distance information for each pixel is calculated for each color plane by the evaluation value calculation unit 103 from a color image composed of a plurality of color planes (S31). Then, the distance calculation unit 142 determines, for each pixel, a final distance map to be generated using distance information obtained from which color plane based on the evaluation value (S32).

ここで、評価値の別の算出方法を説明する。評価値として、注目画素を中心とした周辺領域の輝度値(カラーフィルタの透過率の補正前)の平均値を用いることもできる。ここで、周辺領域の大きさは、距離算出で使用する局所領域(ステップS23で選択される)と同じ大きさとしてもよいし、これと異なる大きさとしてもよい。また、評価値として、カラーフィルタの透過率の補正やホワイトバランスの補正を行った後の、注目画素における輝度値や注目画素の周辺領域での平均輝度値を用いることもできる。さらに別の例として、帯域制限されたカラープレーン画像における周辺領域内での、輝度値が閾値以上であるという条件を満たす画素の数などを用いることもできる。ここでの閾値は、輝度値がそれ以上であると信頼できる距離算出が行える輝度値とすることが好ましい。   Here, another method for calculating the evaluation value will be described. As the evaluation value, an average value of luminance values (before correction of the transmittance of the color filter) in the peripheral region centered on the target pixel can be used. Here, the size of the peripheral region may be the same as or different from the local region used in the distance calculation (selected in step S23). In addition, as the evaluation value, it is also possible to use the luminance value of the target pixel and the average luminance value in the peripheral region of the target pixel after correcting the transmittance of the color filter or correcting the white balance. As yet another example, the number of pixels that satisfy the condition that the luminance value is equal to or greater than a threshold value in the peripheral region of the band-limited color plane image may be used. The threshold value here is preferably a luminance value that enables reliable distance calculation when the luminance value is more than that.

距離計測部14が出力する距離マップに含まれる距離情報は、フォーカス位置からの相対距離であってもよいし、得られた相対距離を焦点距離および物体側におけるフォーカス距離を用いて変換した物体距離であってもよい。   The distance information included in the distance map output by the distance measuring unit 14 may be a relative distance from the focus position, or an object distance obtained by converting the obtained relative distance using the focal distance and the object-side focus distance. It may be.

本実施形態は、複数のカラープレーンから距離情報を算出し、最も信頼できる(最も評価値が高い)カラープレーンの距離情報を選択している。ある特定色のカラープレーンに基づいて距離算出を行う従来技術の手法では、当該色成分が弱い領域では精度の良い距離計測が行えないが、本実施形態では、被写体像の色によらず精度の良い距離計測が可能となる。また、複数色の画像から生成した輝度画像を用いて距離算出を行う従来技術の手法では、複数色が混じった輝度値が得られ、軸上色収差によって相関値は色によって異なる値が得られることから距離計測が正確に行えない。しかし、本実施形態ではカラープレーン別の距離計測を行っているので、光学系に軸上色収差がある場合であっても、精度の良い距離計測が可能となる。したがって、本実施形態によれば、被写体色に対するロバスト性および距離計測精度を向上させることが可能となる。   In this embodiment, distance information is calculated from a plurality of color planes, and distance information of the color plane that is most reliable (having the highest evaluation value) is selected. In the conventional technique that calculates the distance based on a color plane of a specific color, accurate distance measurement cannot be performed in an area where the color component is weak, but in the present embodiment, accurate distance measurement is not performed regardless of the color of the subject image. Good distance measurement is possible. In addition, with the conventional technique that calculates the distance using a luminance image generated from a plurality of color images, a luminance value in which a plurality of colors are mixed is obtained, and the correlation value is different depending on the color due to axial chromatic aberration. Distance measurement cannot be performed accurately. However, since distance measurement is performed for each color plane in the present embodiment, accurate distance measurement is possible even when the optical system has axial chromatic aberration. Therefore, according to the present embodiment, it is possible to improve robustness and distance measurement accuracy with respect to the subject color.

(第二実施形態)
次に、本発明の第二実施形態について説明する。第二実施形態は、カラープレーンごとに算出された距離を統合する方法(S27)が、第一実施形態と相違する。撮像装置1の構成は第一実施形態のものと同様のため、同一の符号を用いて説明を行う。以下、第一の実施形態との処理の相違点について主に説明する。図6は、第二の実施形態における、距離統合ステップS27の流れを示しフローチャートである。
(Second embodiment)
Next, a second embodiment of the present invention will be described. The second embodiment is different from the first embodiment in the method (S27) for integrating the distances calculated for each color plane. Since the configuration of the imaging apparatus 1 is the same as that of the first embodiment, description will be made using the same reference numerals. Hereinafter, differences in processing from the first embodiment will be mainly described. FIG. 6 is a flowchart showing the flow of the distance integration step S27 in the second embodiment.

評価値算出ステップS31は、第一実施形態と同様である。評価値として、第一実施形態で述べた種々のものを採用可能である。以下では、評価値として、カラーフィルタの透過率の補正を行う前のカラープレーンごとの輝度値を用いる場合を例に説明する。   The evaluation value calculation step S31 is the same as that in the first embodiment. Various evaluation values described in the first embodiment can be adopted as evaluation values. Hereinafter, a case where the luminance value for each color plane before correction of the transmittance of the color filter is used as the evaluation value will be described as an example.

本実施形態では、注目画素における距離を、一つのカラープレーンから算出された距離として決定するのではなく、複数のカラープレーンから算出された距離の加重平均値として決定する。加重平均における各カラープレーン別の距離に対する重みは、各カラープレーンでの評価値に応じて決定される。距離算出部142は、加重平均距離算出ステップS33において、まず注目画素におけるカラープレーンごとの評価値(ここでは輝度値)を用い、加重平均のための重みを算出する。カラー画像がRGB画像の場合、各カラープレーンの重みWは数式4のように輝度値の比率で算出する。

Figure 0006555990
ここで、W,W、Wはそれぞれ各カラープレーンに対する重みであり、R,G,Bは各カラープレーンにおける輝度値である。添字のiは注目画素を表す。 In the present embodiment, the distance at the target pixel is not determined as a distance calculated from one color plane, but as a weighted average value of distances calculated from a plurality of color planes. The weight for the distance for each color plane in the weighted average is determined according to the evaluation value for each color plane. In the weighted average distance calculation step S33, the distance calculation unit 142 first calculates the weight for the weighted average using the evaluation value (in this case, the luminance value) for each color plane in the target pixel. When the color image is an RGB image, the weight W of each color plane is calculated as a luminance value ratio as shown in Equation 4.
Figure 0006555990
Here, W R, W G, W B is a weight for each of the color planes, respectively, R, G, B is the intensity value in each color plane. The subscript i represents the pixel of interest.

距離算出部142は、算出された重みを用いて、各カラープレーンの距離マップに対し加重平均を実施する。距離算出部142は、このようにして算出された距離の加重平均値を注目画素における最終的な距離情報として決定する。距離算出部142は、以上の加重平均を用いた統合処理を距離マップの全画素に対して実行し、統合した距離マップを出力する。   The distance calculation unit 142 performs a weighted average on the distance map of each color plane using the calculated weight. The distance calculation unit 142 determines the weighted average value of the distances calculated in this way as final distance information in the target pixel. The distance calculation unit 142 executes the integration process using the above weighted average for all the pixels of the distance map, and outputs the integrated distance map.

上記の例では、評価値として輝度値を採用している場合を例として加重平均処理を説明したが、評価値が輝度値以外の場合であっても同様の手法によって加重平均処理ができることは明らかであろう。具体的には、数式2におけるR,G,Bを各カラープレーンにおける評価値と読み替えて、評価値の比を重みとする加重平均を最終的な距離とすればよい。   In the above example, the weighted average processing has been described as an example where the luminance value is adopted as the evaluation value. However, it is clear that the weighted average processing can be performed by the same method even when the evaluation value is other than the luminance value. Will. Specifically, R, G, and B in Formula 2 may be read as evaluation values for each color plane, and a weighted average with a weight of the evaluation value ratio as a final distance may be used.

また、距離変換ステップS25で算出される距離情報が像距離であり、フォーカス位置を基準とした相対距離の場合には、距離値の符号を考慮して加重平均に用いる距離情報を決定してもよい。より具体的には、距離算出部142は、ステップS33において、各カラープレーンを用いて得られる距離情報のうち、フォーカス位置を基準とした相対距離の符号が同じとなる数が多い距離情報のみを用いて、加重平均距離値を算出する。例えば、カラープレーンがRGBの3色の場合で、RとGのカラープレーンから得られる相対距離が正であり、Bのカラープレーンから得られる相対距離が負の場合には、RとGのカラープレーンから得られる距離情報のみを用いて加重平均距離値が算出される。この際の重みは、加重平均に用いられるカラープレーンの評価値に基づいて決定される。カラープレーンの数が3より多い場合でも同様である。   If the distance information calculated in the distance conversion step S25 is an image distance and is a relative distance based on the focus position, the distance information used for the weighted average may be determined in consideration of the sign of the distance value. Good. More specifically, in step S33, the distance calculation unit 142 calculates only the distance information having a large number of the same relative distance codes based on the focus position among the distance information obtained using each color plane. To calculate a weighted average distance value. For example, when the color plane is three colors of RGB, the relative distance obtained from the R and G color planes is positive, and when the relative distance obtained from the B color plane is negative, the R and G colors A weighted average distance value is calculated using only distance information obtained from the plane. The weight at this time is determined based on the evaluation value of the color plane used for the weighted average. The same applies when the number of color planes is greater than three.

このように相対距離の符号を考慮した加重平均を行うことで、フォーカス近傍において算出した距離に含まれる誤差による符号の違いが生じた場合に、加重平均で距離を統合する際の誤差の混入を防ぐことができる。また、フォーカスから大きく外れた距離においてノイズなどにより符号の反転が生じた場合、距離統合時に異なる符号が含まれることで精度が大きく低下する。このように評価値の算出時に符号を考慮することで、加重平均による距離統合時の精度低下を防ぐことができる。   By performing the weighted average taking into account the sign of the relative distance in this way, if there is a difference in the sign due to the error included in the distance calculated in the vicinity of the focus, mixing of errors when integrating the distance with the weighted average is performed. Can be prevented. In addition, when a sign inversion occurs due to noise or the like at a distance greatly deviating from the focus, the accuracy is greatly reduced due to the inclusion of different codes during distance integration. Thus, by considering the sign when calculating the evaluation value, it is possible to prevent a decrease in accuracy during distance integration due to the weighted average.

なお、カラープレーン数が偶数であり、正負どちらの符号の距離値を与えるカラープレーンの数も同数であった場合には、次のような処理を行うことができる。例えば、正負どちらかの符号を適宜選択して、選択された符号の距離情報のみを用いて加重平均を取ることが考えられる。この際、評価値の平均値や最大値が大きい方の符号の相対距離を選択するようにしても良い。また、いずれの場合も、算出した距離の信頼度が低いといったデータを付加するなどの対応を行うことも好ましい。   If the number of color planes is an even number and the number of color planes giving the distance value of either positive or negative sign is the same, the following processing can be performed. For example, it is conceivable to select either positive or negative sign as appropriate and take a weighted average using only the distance information of the selected sign. At this time, the relative distance of the code having the larger average value or maximum value of the evaluation values may be selected. In any case, it is also preferable to take measures such as adding data that the reliability of the calculated distance is low.

本実施形態によれば、距離統合処理で距離選択されるカラープレーンが異なる境界において、カラープレーンごとの距離変換誤差によって生じる誤差による距離段差を、加重平均を用いることで軽減することができる。また、ノイズや距離変換誤差で生じる像距離の符号エラーが生じた場合、同符号の距離のみを用いて加重平均を行うことで、統合時の距離劣化を低減することが可能となる。   According to the present embodiment, a distance step caused by an error caused by a distance conversion error for each color plane can be reduced by using a weighted average at a boundary where the color planes selected by the distance integration process are different. In addition, when an image distance sign error caused by noise or a distance conversion error occurs, it is possible to reduce distance degradation during integration by performing weighted averaging using only the distance of the same sign.

(第三実施形態)
本発明の第三実施形態について説明する。第三実施形態は、カラープレーンごとに算出された距離を統合する方法(S27)において、距離算出の際に求められた相関値を考慮する点で、第一実施形態および第二実施形態と相違する。第三実施形態における撮像装置1の構成は、第一実施形態および第二実施形態と同様のため、同一の符号を用いて説明を行う。以下、第一実施形態および第二実施形態との処理の相違点について主に説明する。
(Third embodiment)
A third embodiment of the present invention will be described. The third embodiment is different from the first embodiment and the second embodiment in that the correlation value obtained when calculating the distance is considered in the method of integrating the distance calculated for each color plane (S27). To do. Since the configuration of the imaging device 1 in the third embodiment is the same as that of the first embodiment and the second embodiment, description will be made using the same reference numerals. Hereinafter, differences in processing between the first embodiment and the second embodiment will be mainly described.

図7Aおよび図7Bは、本実施形態における、距離統合ステップS27の流れを示したフローチャートである。図7Aは第一実施形態を基にした処理の例を示し、図7Bは第二実施形態を基にした処理の例を示す。   7A and 7B are flowcharts showing the flow of the distance integration step S27 in the present embodiment. FIG. 7A shows an example of processing based on the first embodiment, and FIG. 7B shows an example of processing based on the second embodiment.

本実施形態では、カラープレーンごとに距離を算出する際の相関値(図3のステップS24および数式1等参照)が高いカラープレーンの距離情報は、距離統合処理に用いない。ぼけの大きさが同程度の領域では相関値が高くなるが、ノイズによる相関値の低下が大きくなるため、予め保持した距離変換テーブルや変換式にしたがって得られる距離の誤差も大きくなる場合がある。このように相関値が高い場合は距離計測誤差が大きくなるため、高い相関値から得られた距離を距離統合に用いないようにすることで、距離算出の向上を図れる。   In this embodiment, the color plane distance information having a high correlation value (see step S24 in FIG. 3 and Formula 1) when calculating the distance for each color plane is not used for the distance integration processing. The correlation value is high in the region where the blur is about the same, but the decrease in the correlation value due to noise is large, and the error in the distance obtained according to the distance conversion table or conversion equation stored in advance may be large. . Since the distance measurement error increases when the correlation value is high in this way, the distance calculation can be improved by not using the distance obtained from the high correlation value for the distance integration.

ここで、光学系に軸上色収差が残存していると、カラープレーンにより高相関となる被写体距離が異なる。よって、一つのカラープレーンで相関が高くても、他のカラープレーンは相関が高くないため、少なくともいずれかのカラープレーンは信頼できる相関値を持っており距離計測に利用できる。   Here, if axial chromatic aberration remains in the optical system, the subject distance that is highly correlated differs depending on the color plane. Therefore, even if one color plane has a high correlation, the other color planes do not have a high correlation. Therefore, at least one of the color planes has a reliable correlation value and can be used for distance measurement.

評価値算出部141は、高相関判定ステップS41において、各カラープレーンについて算出された相関値が、所定の閾値よりも大きいか否かを判定する。この閾値は、相関値がそれよりも高ければ、ノイズの影響により距離算出誤差が大きくなると推定される値である。評価値算出部141は、評価値算出ステップS31において、相関値が所定の閾値よりも大きいと判定されたカラープレーンについては、評価値を0(最低値)とする。そして、距離算出部142は、このように決定された評価値を用いて、距離選択ステップS32や加重平均距離算出ステップS33を実施する。これらのステップにおける処理は第一実施形態および第二実施形態と同様である。本実施形態では、上記のように評価値を決定しているので、相関値が上記閾値以下であるカラープレーンから得られる距離情報を用いて注目画素における距離情報を算出できる。   In the high correlation determination step S41, the evaluation value calculation unit 141 determines whether the correlation value calculated for each color plane is larger than a predetermined threshold value. This threshold is a value estimated that the distance calculation error becomes larger due to the influence of noise if the correlation value is higher than that. The evaluation value calculation unit 141 sets the evaluation value to 0 (minimum value) for the color plane for which the correlation value is determined to be larger than the predetermined threshold value in the evaluation value calculation step S31. And the distance calculation part 142 implements distance selection step S32 and weighted average distance calculation step S33 using the evaluation value determined in this way. The processing in these steps is the same as in the first embodiment and the second embodiment. In this embodiment, since the evaluation value is determined as described above, the distance information at the target pixel can be calculated using the distance information obtained from the color plane whose correlation value is equal to or less than the threshold value.

なお、評価値自体は第一実施形態および第二実施形態と同様に算出し、距離選択ステップS32や加重平均距離値算出ステップS33において相関値が閾値より大きい距離情報を用いないようにしても同様の効果が得られる。   The evaluation value itself is calculated in the same manner as in the first embodiment and the second embodiment, and it is the same even if the distance information whose correlation value is larger than the threshold is not used in the distance selection step S32 or the weighted average distance value calculation step S33. The effect is obtained.

本実施形態によれば、高相関領域においても精度良く距離情報を算出することができる。上述したように、光学系に軸上色収差がある場合には、あるカラープレーンでは相関が高くても、別のカラープレーンでは相関が高くない。本実施形態では、ノイズによる測距
性能の低下が少ないカラープレーンから得られる情報に基づいて最終的な距離マップを生成するので、精度低下を避けることができる。
According to this embodiment, distance information can be calculated with high accuracy even in a highly correlated region. As described above, when the optical system has axial chromatic aberration, even if the correlation is high in one color plane, the correlation is not high in another color plane. In the present embodiment, since the final distance map is generated based on information obtained from a color plane in which the distance measurement performance is less deteriorated due to noise, a decrease in accuracy can be avoided.

(第四実施形態)
本発明の第四実施形態では、画素ごとに距離計測に利用するカラープレーンを決定し、利用するカラープレーンについてのみ距離算出を行う。第一実施形態と比較して、全てのカラープレーンについて距離算出を行わない点で相違する。
(Fourth embodiment)
In the fourth embodiment of the present invention, a color plane to be used for distance measurement is determined for each pixel, and distance calculation is performed only for the color plane to be used. Compared to the first embodiment, it is different in that distance calculation is not performed for all color planes.

第四実施形態における撮像装置1の構成は、第一実施形態と同様である。以下、第一実施形態との処理の相違点について説明する。図8は、第四実施形態における、距離マップ生成ステップS15の流れを示したフローチャートである。   The configuration of the imaging device 1 in the fourth embodiment is the same as that in the first embodiment. Hereinafter, differences in processing from the first embodiment will be described. FIG. 8 is a flowchart showing the flow of the distance map generation step S15 in the fourth embodiment.

距離計測部14にカラー画像が入力されると、評価値算出部141が評価値算出ステップS51を実行する。評価値算出ステップS51は、第一実施形態の評価値算出ステップS31(図5A)と同様に、カラープレーンごとおよび画素ごとに評価値を算出する処理である。具体的な評価値としては、各カラープレーンにおける輝度値など、第一の実施形態で説明した種々のものを採用できる。   When a color image is input to the distance measuring unit 14, the evaluation value calculating unit 141 executes an evaluation value calculating step S51. The evaluation value calculation step S51 is a process of calculating an evaluation value for each color plane and for each pixel, as in the evaluation value calculation step S31 (FIG. 5A) of the first embodiment. As specific evaluation values, various values described in the first embodiment such as luminance values in each color plane can be adopted.

次に距離算出部142が、入力されたカラー画像に対して帯域制限ステップS52および領域選択ステップS53を実行する。これらの処理は第一実施形態の帯域制限ステップS22および領域選択ステップS23と同様の処理である。   Next, the distance calculation unit 142 performs a band limiting step S52 and a region selecting step S53 on the input color image. These processes are the same as the band limiting step S22 and the area selecting step S23 of the first embodiment.

距離算出部142は、カラープレーン選択ステップS54において、評価値算出ステップS31で算出された評価値をもとに、注目画素においてどのカラープレーンを距離計測に用いるか選択を行う。具体的には、距離算出部142は、注目画素において最も高い評価値をとるカラープレーンを距離計測に用いると決定する。   In the color plane selection step S54, the distance calculation unit 142 selects which color plane is used for distance measurement in the target pixel based on the evaluation value calculated in the evaluation value calculation step S31. Specifically, the distance calculation unit 142 determines to use the color plane having the highest evaluation value for the pixel of interest for distance measurement.

距離算出部142は、選択されたカラープレーンに対して、相関演算ステップS55および距離変換ステップS56を実行する。これらの処理は第一実施形態の相関演算ステップS24および距離変換ステップS25と同様の処理のため説明は省略する。なお、第三実施形態と同様の効果を得るために、相関演算ステップS55において算出された相関値が所定の閾値よりも大きい場合には、次に評価値が大きいカラープレーンを用いて相関値演算をやり直すこともできる。   The distance calculation unit 142 executes a correlation calculation step S55 and a distance conversion step S56 for the selected color plane. Since these processes are the same as the correlation calculation step S24 and the distance conversion step S25 of the first embodiment, the description thereof is omitted. In order to obtain the same effect as in the third embodiment, when the correlation value calculated in the correlation calculation step S55 is larger than a predetermined threshold value, the correlation value calculation is performed using the color plane having the next highest evaluation value. Can be redone.

終了判定ステップS57では、距離マップの全画素に対して処理が完了したかの判定を行う。全画素の処理が完了するまで、領域選択ステップS53から距離変換ステップS56までの処理を繰り返す。全画素の距離算出が完了したら終了して距離マップを出力する。   In the end determination step S57, it is determined whether or not the processing has been completed for all the pixels of the distance map. Until the processing of all the pixels is completed, the processing from the region selection step S53 to the distance conversion step S56 is repeated. When the distance calculation for all pixels is completed, the process ends and outputs a distance map.

なお、領域選択とカラープレーン選択の処理の順序を変えても同様の距離マップ生成が行える。具体的には、まずカラープレーンを選択してから、当該カラープレーンで評価値が最高となる画素について当該カラープレーンを用いて距離情報を算出すればよい。この処理を、全てのカラープレーンについて実行することで、上記と同様の効果が得られる。   It should be noted that the same distance map generation can be performed even if the processing order of the area selection and the color plane selection is changed. Specifically, after selecting a color plane, distance information may be calculated using the color plane for a pixel having the highest evaluation value in the color plane. By executing this process for all color planes, the same effect as described above can be obtained.

本実施形態における距離計測部14は、いずれのカラープレーンからも距離情報が算出可能であるが、カラープレーン別に全ての画素において距離を算出せず必要なカラープレーンについてのみ距離算出を行うので演算量を削減できる。さらに、複数の距離の統合処理が不要な点でも演算量を削減できる。よって、一つのカラープレーンの距離マップを算出する演算量と同等の演算量で、被写体の色にロバストな距離マップを生成することが可
能となる。
The distance measuring unit 14 according to the present embodiment can calculate distance information from any color plane, but does not calculate distances for all the pixels for each color plane, and calculates distances only for necessary color planes. Can be reduced. Furthermore, the amount of calculation can be reduced even in the point that the integration processing of a plurality of distances is not necessary. Therefore, it is possible to generate a distance map that is robust to the color of the subject with a calculation amount equivalent to the calculation amount for calculating the distance map of one color plane.

(第五実施形態)
本発明の第五実施形態では、位相差方式を用いて距離計測を行う場合に関して述べる。ここでまず、本発明の第五実施形態に係る撮像装置1に含まれる撮像素子11に関して説明する。図9は撮像素子を説明する図である。図9Aにおいて、画素群201及び画素群202はそれぞれ2行×2列の4つの画素から構成される。。画素群201内には、対角方向に緑画素201Gvが配置され、もう一方の対角方向に赤画素201Rvと青画素201Bvが配置されている。同様に画素群202内にも、対角方向に緑画素202Ghが、他方には赤画素202Rhと青画素202Bhが配置されている。これらの二種類の画素群が撮像素子11上に市松模様状に配置されている。
(Fifth embodiment)
In the fifth embodiment of the present invention, a case where distance measurement is performed using a phase difference method will be described. Here, first, the imaging element 11 included in the imaging apparatus 1 according to the fifth embodiment of the present invention will be described. FIG. 9 is a diagram illustrating the image sensor. In FIG. 9A, the pixel group 201 and the pixel group 202 are each composed of four pixels of 2 rows × 2 columns. . In the pixel group 201, a green pixel 201Gv is arranged in the diagonal direction, and a red pixel 201Rv and a blue pixel 201Bv are arranged in the other diagonal direction. Similarly, in the pixel group 202, a green pixel 202Gh is arranged diagonally, and a red pixel 202Rh and a blue pixel 202Bh are arranged on the other side. These two types of pixel groups are arranged on the image sensor 11 in a checkered pattern.

図9Bに、画素群201におけるV−V’概略断面図を示す。201MLはマイクロレンズ、201CFはカラーフィルタ、そして201A及び201Bは光電変換部である。図9Cに、画素群202におけるH−H’概略断面図を示す。202MLはマイクロレンズ、202CFはカラーフィルタ、そして202A及び202Bは光電変換部である。また、図9B及び図9Cにおいて、210は受光面であり、光電変換部の光入射側のxy面(+z側の面)である。図9Bでは緑画素201Gvと青画素Bvの構造を示しているが、赤画素201Rvも同様の構造を有している。また、図9Cでは緑画素202Ghと青画素202Bhの構造を示しているが、赤画素202Rhも同様の構造を有している。   FIG. 9B is a schematic cross-sectional view taken along V-V ′ in the pixel group 201. 201ML is a micro lens, 201CF is a color filter, and 201A and 201B are photoelectric conversion units. FIG. 9C shows an H-H ′ schematic cross-sectional view of the pixel group 202. 202ML is a microlens, 202CF is a color filter, and 202A and 202B are photoelectric conversion units. 9B and 9C, reference numeral 210 denotes a light receiving surface, which is an xy surface (+ z side surface) on the light incident side of the photoelectric conversion unit. FIG. 9B shows the structure of the green pixel 201Gv and the blue pixel Bv, but the red pixel 201Rv also has the same structure. 9C shows the structure of the green pixel 202Gh and the blue pixel 202Bh, the red pixel 202Rh also has the same structure.

本変形形態の撮像素子11では、1つの画素(緑画素などの各画素)内に光電変換部を2つ配置し、受光面210と射出瞳が光学的に共役関係になるようにマイクロレンズ201ML、202MLのパワーを設定している。このような配置とすることで、光電変換部201Aと201B(及び202Aと202B)では、それぞれ、射出瞳の異なる領域EPA,EPBを通過した光束を受光することができる。また、画素群201と画素群202では、2つの光電変換部の配置が90°回転している。このような構成とすることで、画素群201と画素群202では射出瞳を異なる方向に分割した領域を通過した光束を光電変換部で受光することとなる。これにより、画素群201と画素群202では異なる方向にコントラスト変化のある被写体に対して被写体距離の検出を行うことができる。   In the imaging device 11 of this modification, two photoelectric conversion units are arranged in one pixel (each pixel such as a green pixel), and the microlens 201ML is arranged so that the light receiving surface 210 and the exit pupil are optically conjugate. , 202ML power is set. With such an arrangement, the photoelectric conversion units 201A and 201B (and 202A and 202B) can receive light beams that have passed through areas EPA and EPB having different exit pupils, respectively. In the pixel group 201 and the pixel group 202, the arrangement of the two photoelectric conversion units is rotated by 90 °. With such a configuration, in the pixel group 201 and the pixel group 202, a light beam that has passed through an area obtained by dividing the exit pupil in different directions is received by the photoelectric conversion unit. As a result, the subject distance can be detected for subjects whose contrast changes in different directions between the pixel group 201 and the pixel group 202.

各画素群における2つの光電変換部で受光した光から生成される像信号をそれぞれA像、B像として取得する。A像とB像は第一のカラー画像および第二のカラー画像に相当する。   Image signals generated from light received by two photoelectric conversion units in each pixel group are acquired as an A image and a B image, respectively. The A image and the B image correspond to the first color image and the second color image.

次に生成したA像とB像から位相差方式によって距離計測を行う方法を説明する。図10は、位相差方式による距離計測処理の流れを示したフローチャート図である。   Next, a method for measuring the distance from the generated A image and B image by the phase difference method will be described. FIG. 10 is a flowchart showing a flow of distance measurement processing by the phase difference method.

位相差方式では、A像とB像の像ずれ量rを検出することで、被写体像のデフォーカス量Defを検出することが可能となる。像ずれ量rの検出は、A像とB像の相関演算によって求める(ステップS121)。相関演算は公知の手法を用いることができ、例えば数式5により相関値C(k)を算出し、C(k)=0となるkから、像ずれ量rを算出することをできる。

Figure 0006555990

ここで、A(i)はA像の像信号、B(i)はB像の像信号、iは画素番号、kはA像とB像の相対シフト量である。mは、相関値C(k)の演算に用いる対象画素範囲を表して
いる。 In the phase difference method, it is possible to detect the defocus amount Def of the subject image by detecting the image shift amount r between the A image and the B image. The detection of the image shift amount r is obtained by calculating the correlation between the A image and the B image (step S121). For the correlation calculation, a known method can be used. For example, the correlation value C (k) is calculated by Equation 5, and the image shift amount r can be calculated from k where C (k) = 0.
Figure 0006555990

Here, A (i) is an image signal of A image, B (i) is an image signal of B image, i is a pixel number, and k is a relative shift amount between the A image and the B image. m represents the target pixel range used for the calculation of the correlation value C (k).

次に、算出された像ずれ量rを数式6に代入することでデフォーカス量Defを算出する(ステップS122)。

Figure 0006555990

ここでwは基線長(射出瞳EPAと射出瞳EPBの中心間隔)であり、Zは撮像素子から射出瞳までの距離である。 Next, the defocus amount Def is calculated by substituting the calculated image shift amount r into Equation 6 (step S122).
Figure 0006555990

Here, w is a base line length (a center distance between the exit pupil EPA and the exit pupil EPB), and Z is a distance from the image sensor to the exit pupil.

距離計測に用いたA像、B像の全面に対して、同様の処理を行うことでデフォーカス量による距離画像を生成することができる。また、算出したデフォーカス量を撮影時のパラメータを用いて被写体までの距離に換算し、距離画像を生成することもできる。距離計測に用いるA像およびB像は、画素群201および画素群202のいずれか一方から得られるものであってよい。あるいは、画素群201から得られるA像およびB像と画素群202から得られるA像およびB像のそれぞれについて距離計測を行い、各位置において距離計測の信頼度の高い方の距離を選択して距離画像を生成してもよい。   A distance image based on the defocus amount can be generated by performing the same process on the entire surfaces of the A image and the B image used for the distance measurement. In addition, the calculated defocus amount can be converted into a distance to the subject using a parameter at the time of shooting, and a distance image can be generated. The A image and the B image used for distance measurement may be obtained from either the pixel group 201 or the pixel group 202. Alternatively, distance measurement is performed for each of the A image and the B image obtained from the pixel group 201 and the A image and the B image obtained from the pixel group 202, and a distance with higher reliability of distance measurement is selected at each position. A distance image may be generated.

本実施形態における距離計測の信頼度として、カラープレーンごとの輝度値、テクスチャの有無(テクスチャが多いほど高信頼度)、あるいはこれらの組み合わせが利用できる。   As the reliability of distance measurement in the present embodiment, a luminance value for each color plane, the presence / absence of texture (the higher the texture, the higher the reliability), or a combination thereof can be used.

以上の距離計測方法をRGBのカラープレーンごとに実行することで、カラープレーン毎に距離算出が可能となる。各カラープレーンの距離情報は、カラープレーン毎の焦点位置の違いによる算出距離情報のずれを補正する。この補正は、レンズの設計データを用いて行う。距離の選択や統合に関しては第一実施形態から第四実施形態に示した方法と同様に行うことができる。   By executing the above distance measurement method for each RGB color plane, the distance can be calculated for each color plane. The distance information of each color plane corrects the deviation of the calculated distance information due to the difference in focal position for each color plane. This correction is performed using lens design data. The selection and integration of distances can be performed in the same manner as the method shown in the first to fourth embodiments.

上記の説明では撮像素子11が瞳分割方向の異なる画素群201と画素群202を同数有する例を示したが、画素群201と画素群202の数は異なっていてもよいし、画素群201と画素群202のいずれか一方のみを採用してもよい。また上記の説明では画素に入射する光を光電変換部に集光するためにマイクロレンズを用いる例を示したが、マイクロレンズの代わりに導波路を用いて入射光を集光してもよい。あるいは、マイクロレンズと導波路の両方を用いて入射光を集光してもよい。   In the above description, an example in which the imaging element 11 has the same number of pixel groups 201 and pixel groups 202 having different pupil division directions is shown. However, the number of pixel groups 201 and 202 may be different. Only one of the pixel groups 202 may be employed. In the above description, an example in which a microlens is used to collect light incident on a pixel on a photoelectric conversion unit has been described. However, incident light may be collected using a waveguide instead of the microlens. Or you may condense incident light using both a micro lens and a waveguide.

(その他の実施例)
なお、各実施形態の説明は本発明を説明する上での例示であり、本発明は、発明の趣旨を逸脱しない範囲で適宜変更または組み合わせて実施することができる。例えば、本発明は、上記処理の少なくとも一部を含む撮像装置として実施することもできるし、撮像手段を有さない距離計測装置として実施することもできる。また、距離計測方法として実施することもできるし、当該距離計測方法を距離計測装置に実行させる画像処理プログラムとして実施することもできる。各実施形態で説明した処理や手段などの各要素技術は、技術的な矛盾が生じない限りにおいて、自由に組み合わせて実施することができる。
(Other examples)
The description of each embodiment is an exemplification for explaining the present invention, and the present invention can be implemented with appropriate modifications or combinations without departing from the spirit of the invention. For example, the present invention can be implemented as an imaging apparatus that includes at least a part of the above processing, or can be implemented as a distance measuring apparatus that does not include an imaging unit. Moreover, it can also implement as a distance measurement method, and can also be implemented as an image processing program which makes a distance measurement apparatus perform the said distance measurement method. Each elemental technology such as processing and means described in each embodiment can be freely combined and implemented as long as no technical contradiction occurs.

また、実施形態の説明では、撮像装置が二枚の画像を取得する例を述べたが、取得する画像は三枚以上であってもよい。この場合、撮影した画像から二画像を選択して距離計測を行う。三枚以上の画像を取得することで、距離計測可能な範囲が広くなるといった効果や、距離精度が向上するといった効果を得ることができる。   In the description of the embodiment, an example in which the imaging apparatus acquires two images has been described. However, three or more images may be acquired. In this case, two images are selected from the captured images and distance measurement is performed. By acquiring three or more images, it is possible to obtain an effect that the range in which the distance can be measured is widened and an effect that the distance accuracy is improved.

上述した本発明の距離計測技術は、例えば、デジタルカメラやデジタルカムコーダなどの撮像装置、あるいは撮像装置で得られた画像データに対し画像処理を施す画像処理装置やコンピュータなどに好ましく適用できる。また、このような撮像装置或いは画像処理装置を内蔵する各種の電子機器(携帯電話、スマートフォン、スレート型端末、パーソナルコンピュータを含む)にも本発明を適用することができる。   The above-described distance measurement technique of the present invention can be preferably applied to, for example, an imaging apparatus such as a digital camera or a digital camcorder, or an image processing apparatus or computer that performs image processing on image data obtained by the imaging apparatus. Further, the present invention can also be applied to various electronic devices (including mobile phones, smartphones, slate terminals, and personal computers) incorporating such an imaging device or image processing device.

また、実施形態の説明では、撮像装置本体に距離計測の機能を組み込んだ構成を示したが、距離計測は撮像装置以外で行ってもよい。たとえば、撮像装置を有するコンピュータに距離計測の機能を組み込み、撮像装置で撮影した画像をコンピュータが取得して、距離の算出を行うようにしてもよい。また、有線あるいは無線によりネットワークアクセス可能なコンピュータに距離計測の機能を組み込み、当該コンピュータがネットワークを介して複数枚の画像を取得し、距離計測を行うようにしてもよい。   In the description of the embodiment, the configuration in which the distance measurement function is incorporated in the imaging apparatus main body is shown. However, the distance measurement may be performed by other than the imaging apparatus. For example, a distance measurement function may be incorporated into a computer having an imaging device, and the computer may acquire an image captured by the imaging device and calculate the distance. Further, a distance measurement function may be incorporated into a computer that can be accessed via a network by wire or wireless, and the computer may acquire a plurality of images via the network and perform distance measurement.

得られた距離情報は、例えば、画像の領域分割、立体画像や奥行き画像の生成、ボケ効果のエミュレーションなどの各種画像処理に利用することができる。   The obtained distance information can be used, for example, for various image processing such as image segmentation, generation of stereoscopic images and depth images, and emulation of blur effects.

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

この目的のために、上記プログラムは、例えば、ネットワークを通じて、又は、上記記憶装置となり得る様々なタイプの記録媒体(つまり、非一時的にデータを保持するコンピュータ読取可能な記録媒体)から、上記コンピュータに提供される。したがって、上記コンピュータ(CPU、MPU等のデバイスを含む)、上記方法、上記プログラム(プログラムコード、プログラムプロダクトを含む)、上記プログラムを非一時的に保持するコンピュータ読取可能記録媒体は、いずれも本発明の範疇に含まれる。   For this purpose, the program is stored in the computer from, for example, various types of recording media that can serve as the storage device (ie, computer-readable recording media that holds data non-temporarily). Provided to. Therefore, the computer (including devices such as CPU and MPU), the method, the program (including program code and program product), and the computer-readable recording medium that holds the program non-temporarily are all included in the present invention. Included in the category.

14 距離計測部
141 相関値算出部
142 距離算出部
14 Distance measurement unit 141 Correlation value calculation unit 142 Distance calculation unit

Claims (23)

第一のカラー画像と第二のカラー画像に基づき、被写体の距離情報を算出する距離計測装置であって、
前記二つのカラー画像を用いて各カラープレーンにおいて注目画素の距離情報をそれぞれ算出可能な距離算出手段と、
前記注目画素における距離情報の信頼度を表す評価値をカラープレーンごとに算出する評価値算出手段と、
を有し、
前記距離算出手段は、前記評価値に基づいて、どのカラープレーンに基づいて前記注目画素の距離情報を算出するかを決定する、
距離計測装置。
A distance measuring device that calculates distance information of a subject based on a first color image and a second color image,
Distance calculation means capable of calculating distance information of each pixel of interest in each color plane using the two color images;
An evaluation value calculating means for calculating an evaluation value representing the reliability of the distance information in the target pixel for each color plane;
Have
The distance calculation unit determines, based on the evaluation value, which color plane is used to calculate the distance information of the target pixel.
Distance measuring device.
前記評価値算出手段は、前記注目画素におけるカラープレーンの評価値を、前記二つのカラー画像のいずれか1つまたはこれらを合成して得られる画像の当該カラープレーンでの、前記注目画素における輝度値または前記注目画素の周辺領域の輝度値の平均値として算出する、
請求項1に記載の距離計測装置。
The evaluation value calculation means calculates the luminance value at the target pixel in the color plane of the image obtained by combining any one of the two color images or an image obtained by combining the evaluation value of the color plane at the target pixel. Or, it is calculated as an average value of luminance values in the peripheral area of the target pixel.
The distance measuring device according to claim 1.
前記評価値算出手段は、前記注目画素におけるカラープレーンの評価値を、前記二つのカラー画像のいずれか1つまたはこれらを合成して得られる画像の当該カラープレーンにおける前記注目画素の周辺領域内での、輝度値が所定の閾値以上であるという条件を満たす画素の数として算出する、
請求項1に記載の距離計測装置。
The evaluation value calculation means calculates the evaluation value of the color plane in the target pixel within one of the two color images or in the peripheral region of the target pixel in the color plane of the image obtained by combining them. Is calculated as the number of pixels that satisfy the condition that the luminance value is equal to or greater than a predetermined threshold.
The distance measuring device according to claim 1.
前記距離算出手段は、前記評価値が最も高いカラープレーンを用いて前記注目画素の距離情報を算出する、
請求項1から3のいずれか1項に記載の距離計測装置。
The distance calculating means calculates distance information of the pixel of interest using a color plane having the highest evaluation value;
The distance measuring device according to any one of claims 1 to 3.
前記距離算出手段は、複数の画素のそれぞれについて、各カラープレーンを用いて複数の距離情報を算出し、画素ごとに前記評価値が最も高いカラープレーンを用いて得られる距離情報を当該画素の距離情報として選択する、
請求項1から4のいずれか1項に記載の距離計測装置。
The distance calculating means calculates a plurality of distance information using each color plane for each of a plurality of pixels, and calculates the distance information obtained using the color plane having the highest evaluation value for each pixel. Select as information,
The distance measuring device according to any one of claims 1 to 4.
前記距離算出手段は、画素ごとに前記評価値が最も高いカラープレーンを選択し、選択されたカラープレーンを用いて距離情報を算出する、
請求項1から4のいずれか1項に記載の距離計測装置。
The distance calculation means selects a color plane having the highest evaluation value for each pixel, and calculates distance information using the selected color plane.
The distance measuring device according to any one of claims 1 to 4.
前記距離算出手段は、各カラープレーンを用いて得られる距離情報を前記評価値に応じて加重平均した値を、前記注目画素の距離情報として算出する、
請求項1から3のいずれか1項に記載の距離計測装置。
The distance calculation means calculates a weighted average of distance information obtained using each color plane according to the evaluation value as distance information of the target pixel.
The distance measuring device according to any one of claims 1 to 3.
前記距離算出手段は、各カラープレーンを用いて得られる距離情報のうち、フォーカス位置を基準とした距離の符号が同じとなる数が多い距離情報のみを用いて、加重平均を行う、
請求項7に記載の距離計測装置。
The distance calculation means performs a weighted average using only distance information having a large number of the same signs of distances based on the focus position among the distance information obtained using each color plane.
The distance measuring device according to claim 7.
前記距離算出手段は、二つのカラー画像の1つのカラープレーン間の相関値を算出し、カラープレーンごとに異なる変換テーブルまたは変換式により、前記相関値から距離情報を算出する、
請求項1から8のいずれか1項に記載の距離計測装置。
The distance calculation means calculates a correlation value between one color plane of two color images, and calculates distance information from the correlation value by a conversion table or conversion formula that differs for each color plane.
The distance measuring device according to any one of claims 1 to 8.
前記距離算出手段は、前記相関値が閾値以下であるカラープレーンを用いて前記注目画素の距離情報を算出する、
請求項9に記載の距離計測装置。
The distance calculation means calculates distance information of the pixel of interest using a color plane whose correlation value is equal to or less than a threshold value.
The distance measuring device according to claim 9.
前記距離算出手段は、二つのカラー画像の各カラープレーンにおいて位相差の違いから距離情報を算出する、
請求項1から8のいずれか1項に記載の距離計測装置。
The distance calculating means calculates distance information from a difference in phase difference in each color plane of two color images.
The distance measuring device according to any one of claims 1 to 8.
撮像光学系と、
複数のカラープレーンからなるカラー画像を取得する撮像素子と、
請求項1から11のいずれか1項に記載の距離計測装置と、
を有する、撮像装置。
An imaging optical system;
An image sensor for acquiring a color image composed of a plurality of color planes;
The distance measuring device according to any one of claims 1 to 11,
An imaging device.
第一のカラー画像と第二のカラー画像に基づき、被写体の距離情報を算出する距離計測装置が行う距離計測方法であって、
注目画素における距離情報の信頼度を表す評価値をカラープレーンごとに算出する評価値算出ステップと、
前記評価値に基づいて決定されるカラープレーンから得られる距離情報を用いて、前記注目画素の距離情報を算出する距離算出ステップと、
を含む、距離計測方法。
A distance measurement method performed by a distance measurement device that calculates distance information of a subject based on a first color image and a second color image,
An evaluation value calculating step for calculating an evaluation value representing the reliability of the distance information in the target pixel for each color plane;
A distance calculation step of calculating distance information of the pixel of interest using distance information obtained from a color plane determined based on the evaluation value;
Including distance measurement method.
前記評価値算出ステップにおいて、前記注目画素におけるカラープレーンの評価値は、前記二つのカラー画像のいずれか1つまたはこれらを合成して得られる画像の当該カラー
プレーンでの、前記注目画素における輝度値または前記注目画素の周辺領域の輝度値の平均値として算出される、
請求項13に記載の距離計測方法。
In the evaluation value calculating step, the evaluation value of the color plane in the target pixel is the luminance value in the target pixel in the color plane of the image obtained by combining any one of the two color images or the two color images. Or, it is calculated as an average value of luminance values in the peripheral area of the target pixel.
The distance measuring method according to claim 13.
前記評価値算出ステップにおいて、前記注目画素におけるカラープレーンの評価値は、前記二つのカラー画像のいずれか1つまたはこれらを合成して得られる画像の当該カラー
プレーンでの、前記注目画素の周辺領域内における輝度値が所定の閾値以上の画素数として算出される、
請求項13に記載の距離計測方法。
In the evaluation value calculating step, the evaluation value of the color plane in the target pixel is the peripheral region of the target pixel in the color plane of the image obtained by combining any one of the two color images or a combination thereof. The luminance value within is calculated as the number of pixels equal to or greater than a predetermined threshold.
The distance measuring method according to claim 13.
前記距離算出ステップにおいて、前記評価値が最も高いカラープレーンを用いて前記注目画素の距離情報が算出される、
請求項13から15のいずれか1項に記載の距離計測方法。
In the distance calculation step, distance information of the target pixel is calculated using a color plane having the highest evaluation value.
The distance measuring method according to any one of claims 13 to 15.
前記評価値算出ステップにおいて、複数の画素について前記評価値が算出され、
前記距離算出ステップは、
複数の画素のそれぞれについて、各カラープレーンを用いて複数の距離情報を算出するステップと
画素ごとに、前記評価値に基づいて決定されるカラープレーンを用いて得られる距離情報を当該画素の距離情報として選択するステップと、
を含む、請求項13から16のいずれか1項に記載の距離計測方法。
In the evaluation value calculating step, the evaluation values are calculated for a plurality of pixels,
The distance calculating step includes:
For each of a plurality of pixels, a step of calculating a plurality of distance information using each color plane, and for each pixel, distance information obtained using a color plane determined based on the evaluation value is distance information of the pixel. Step to select as,
The distance measuring method according to claim 13, comprising:
前記評価値算出ステップにおいて、複数の画素について前記評価値が算出され、
前記距離算出ステップにおいて、画素ごとに、前記評価値に基づいて決定されるカラープレーンを用いて当該画素の距離情報を算出する、
請求項13から16のいずれか1項に記載の距離計測方法。
In the evaluation value calculating step, the evaluation values are calculated for a plurality of pixels,
In the distance calculating step, for each pixel, the distance information of the pixel is calculated using a color plane determined based on the evaluation value.
The distance measuring method according to any one of claims 13 to 16.
前記距離算出ステップにおいて、各カラープレーンを用いて得られる距離情報を前記評価値に応じて加重平均した値を、前記注目画素の距離情報として算出する、
請求項13から15のいずれか1項に記載の距離計測方法。
In the distance calculating step, a value obtained by weighted averaging distance information obtained using each color plane according to the evaluation value is calculated as distance information of the target pixel.
The distance measuring method according to any one of claims 13 to 15.
前記距離算出ステップにおいて、各カラープレーンを用いて得られる距離情報のうち、フォーカス位置を基準とした距離の符号が同じとなる数が多い方の距離情報のみを用いて、加重平均を行う、
請求項19に記載の距離計測方法。
In the distance calculation step, among the distance information obtained using each color plane, the weighted average is performed using only the distance information having the same number of distances with the same distance code as the reference.
The distance measuring method according to claim 19.
前記距離算出ステップにおいて、二つのカラー画像の1つのカラープレーン間の相関値を算出し、カラープレーンごとに異なる変換テーブルまたは変換式により、前記相関値から距離情報を算出する、
請求項13から20のいずれか1項に記載の距離計測方法。
In the distance calculating step, a correlation value between one color plane of two color images is calculated, and distance information is calculated from the correlation value by a conversion table or a conversion formula that is different for each color plane.
The distance measuring method according to any one of claims 13 to 20.
前記距離算出ステップにおいて、前記相関値が閾値以下であるカラープレーンを用いて前記注目画素の距離情報を算出する、
請求項21に記載の距離計測方法。
In the distance calculating step, the distance information of the target pixel is calculated using a color plane whose correlation value is equal to or less than a threshold value.
The distance measurement method according to claim 21.
請求項13から22のいずれか1項に記載の方法の各ステップをコンピュータに実行させるためのプログラム。   The program for making a computer perform each step of the method of any one of Claim 13 to 22.
JP2015172877A 2014-10-31 2015-09-02 Distance measuring device, imaging device, and distance measuring method Active JP6555990B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/921,125 US9928598B2 (en) 2014-10-31 2015-10-23 Depth measurement apparatus, imaging apparatus and depth measurement method that calculate depth information of a target pixel using a color plane of which a correlation value is at most a threshold

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2014223170 2014-10-31
JP2014223170 2014-10-31

Publications (2)

Publication Number Publication Date
JP2016090568A JP2016090568A (en) 2016-05-23
JP6555990B2 true JP6555990B2 (en) 2019-08-07

Family

ID=56018447

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015172877A Active JP6555990B2 (en) 2014-10-31 2015-09-02 Distance measuring device, imaging device, and distance measuring method

Country Status (1)

Country Link
JP (1) JP6555990B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6983531B2 (en) * 2017-04-24 2021-12-17 キヤノン株式会社 Distance measuring device, distance measuring system, and distance measuring method
JP2019007826A (en) * 2017-06-23 2019-01-17 ミツミ電機株式会社 Distance measuring camera and distance measurement method
JP7002050B2 (en) 2018-07-11 2022-02-10 パナソニックIpマネジメント株式会社 Imaging device
CN116226951A (en) * 2022-12-05 2023-06-06 中山市可讯科技有限公司 Novel online plane measurement method and application thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4990234B2 (en) * 2008-07-07 2012-08-01 オリンパス株式会社 Ranging device, ranging method, ranging program or imaging device
JP5459768B2 (en) * 2009-10-28 2014-04-02 京セラ株式会社 Subject distance estimation device
TWI536826B (en) * 2011-12-27 2016-06-01 鴻海精密工業股份有限公司 Autofocus imaging module and autofocus method
JP5932476B2 (en) * 2012-05-17 2016-06-08 キヤノン株式会社 Image processing apparatus, imaging apparatus, distance measuring method, and distance measuring program
JP6157249B2 (en) * 2012-07-31 2017-07-05 キヤノン株式会社 Imaging apparatus, distance information acquisition method, and program
JP6202927B2 (en) * 2012-08-31 2017-09-27 キヤノン株式会社 Distance detection device, imaging device, program, recording medium, and distance detection method

Also Published As

Publication number Publication date
JP2016090568A (en) 2016-05-23

Similar Documents

Publication Publication Date Title
JP6516429B2 (en) Distance measuring device, imaging device, and distance measuring method
JP6362068B2 (en) Distance measuring device, imaging device, distance measuring method, and program
JP6173156B2 (en) Image processing apparatus, imaging apparatus, and image processing method
KR101364421B1 (en) System and method for generating robust depth maps utilizing a multi-resolution procedure
US9928598B2 (en) Depth measurement apparatus, imaging apparatus and depth measurement method that calculate depth information of a target pixel using a color plane of which a correlation value is at most a threshold
US20150042839A1 (en) Distance measuring apparatus, imaging apparatus, and distance measuring method
US8520081B2 (en) Imaging device and method, and image processing method for imaging device
US20180182075A1 (en) Image processing apparatus, image capturing apparatus, method of image processing, and storage medium
JP2012049773A (en) Imaging apparatus and method, and program
JP2015148532A (en) Distance measuring device, imaging apparatus, distance measuring method, and program
JP2016038414A (en) Focus detection device, control method thereof, and imaging apparatus
JP6555990B2 (en) Distance measuring device, imaging device, and distance measuring method
JP6700818B2 (en) Image processing device, imaging device, and image processing method
US10116865B2 (en) Image processing apparatus and image processing method for calculating motion vector between images with different in-focus positions
JP2013097154A (en) Distance measurement device, imaging apparatus, and distance measurement method
JP2016012901A (en) Image processing system, image processing method and image processing program
WO2016111175A1 (en) Image processing device, image processing method, and program
US11593958B2 (en) Imaging device, distance measurement method, distance measurement program, and recording medium
US20230072475A1 (en) Accuracy estimation apparatus, image capturing apparatus, accuracy estimation method, control method, and storage medium
JP6075835B2 (en) Distance information acquisition device, imaging device, distance information acquisition method, and program
JP6570706B2 (en) Distance measuring device, imaging device, distance measuring method, and program
JP2016201600A (en) Image processing apparatus, imaging device, image processing method, image processing program, and storage medium
JP5942755B2 (en) Image processing circuit, image processing method, and imaging apparatus
JP5352003B2 (en) Image processing apparatus and image processing method
JP6685550B2 (en) Autofocus device and autofocus program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180823

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20181116

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190515

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190611

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190709

R151 Written notification of patent or utility model registration

Ref document number: 6555990

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151