JP2019184587A - Parallax detection device, parallax detection method, and parallax detection device control program - Google Patents

Parallax detection device, parallax detection method, and parallax detection device control program Download PDF

Info

Publication number
JP2019184587A
JP2019184587A JP2019052735A JP2019052735A JP2019184587A JP 2019184587 A JP2019184587 A JP 2019184587A JP 2019052735 A JP2019052735 A JP 2019052735A JP 2019052735 A JP2019052735 A JP 2019052735A JP 2019184587 A JP2019184587 A JP 2019184587A
Authority
JP
Japan
Prior art keywords
parallax
image set
map
magnification
original 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.)
Granted
Application number
JP2019052735A
Other languages
Japanese (ja)
Other versions
JP7344660B2 (en
JP2019184587A5 (en
Inventor
誠 大井川
Makoto Oigawa
誠 大井川
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 US16/364,752 priority Critical patent/US11037316B2/en
Publication of JP2019184587A publication Critical patent/JP2019184587A/en
Publication of JP2019184587A5 publication Critical patent/JP2019184587A5/ja
Application granted granted Critical
Publication of JP7344660B2 publication Critical patent/JP7344660B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Measurement Of Optical Distance (AREA)
  • Image Analysis (AREA)

Abstract

To solve the problem in which it is difficult to set a condition for obtaining a prescribed calculation speed and range-finding accuracy regarding a technique of contracting a pair of raw images acquired by using pattern projections, and calculating an amount of parallax.SOLUTION: A parallax detection device of the present invention comprises: acquisition means that photographs a measurement object having pattern light projected, and acquires a pair of raw images having parallax; contraction means that contracts the pair of raw images; and calculation means that calculates a parallax map serving a distribution of an amount of parallax having a prescribed search range in each area and a search window therein and corresponding to each area of the pair of raw images from the pair of raw images to be obtained from the contraction means. In order to obtain the parallax map having a prescribed number of data, the calculation means is configured to deem a hierarchy of the parallax map to be calculated using the pair of images of the smallest magnification to be obtained from the contraction means as the lowest layer, and a prescribed search range upon calculating the parallax map in each hierarchy is determined on the basis of the parallax map below one hierarchy.SELECTED DRAWING: Figure 1

Description

本発明は、視差算出装置、視差算出方法及び視差算出装置の制御プログラムに関する。   The present invention relates to a parallax calculation device, a parallax calculation method, and a control program for a parallax calculation device.

撮像画像を取得し、取得した撮像画像から距離情報を算出する手法が提案されている。例えば、異なる視点からの複数の画像を取得し、各画像間の相関値から視差量を求め、距離情報を取得する手法がある。具体的には、視差を有する画像組のそれぞれから探索ウィンドウ(以下、単にウィンドウともいう。)と呼ばれる一部領域の信号を抜き出す。そして、探索ウィンドウの位置を変えながら相関値を計算することにより視差量を算出する。このとき、撮像画像中に模様(以下、テクスチャともいう。)の乏しい領域がある場合、信号のコントラストが低いことにより相関値の算出精度が低下し、測距精度が低下する。これに対してパターン光の投影を使用して撮像画像を取得し、元々は模様の乏しい領域でも測距精度の低下の影響を低減する手法がある。   A method for acquiring a captured image and calculating distance information from the acquired captured image has been proposed. For example, there is a method of acquiring a plurality of images from different viewpoints, obtaining a parallax amount from a correlation value between the images, and acquiring distance information. Specifically, a signal of a partial area called a search window (hereinafter also simply referred to as a window) is extracted from each of the image sets having parallax. Then, the parallax amount is calculated by calculating the correlation value while changing the position of the search window. At this time, when there is a region with a poor pattern (hereinafter also referred to as a texture) in the captured image, the correlation accuracy is lowered due to the low contrast of the signal, and the ranging accuracy is lowered. On the other hand, there is a method of acquiring a captured image using pattern light projection and reducing the influence of a decrease in distance measurement accuracy even in an originally poor pattern area.

特許文献1では、縞模様のパターン光を物体に投影し、異なる位置から撮像した2つの画像(画像組)を用いて視差量を算出する手法が提案されている。   Japanese Patent Application Laid-Open No. 2004-228561 proposes a method of calculating a parallax amount by projecting striped pattern light onto an object and using two images (image sets) captured from different positions.

特開2015−137933号公報JP2015-137933A

しかしながら、特許文献1のようなパターン光の投影を使用した測距技術において、処理の高速化や負荷低減に関する検討は十分になされていなかった。   However, in the distance measuring technique using the projection of pattern light as in Patent Document 1, sufficient studies on speeding up processing and reducing the load have not been made.

本発明は上記問題点を鑑みてなされたものであり、パターン投影を使用したステレオ測距において、階層処理を用いて視差量を計算することができる視差算出装置、視差算出方法及び視差算出装置の制御プログラムを提供することを目的とする。   The present invention has been made in view of the above problems, and in stereo distance measurement using pattern projection, a parallax calculation apparatus, a parallax calculation method, and a parallax calculation apparatus capable of calculating a parallax amount using hierarchical processing An object is to provide a control program.

上記目的を達成するために、本発明の一例としての視差算出装置は、パターン光が投影された測定対象を撮像して、視差を有する原画像組を取得する取得手段と、前記原画像組を縮小する縮小手段と、前記縮小手段から得られる画像組から、各領域で所定の探索範囲及び探索ウィンドウをもって前記画像組の各領域に対応する視差量の分布である視差マップを算出する算出手段と、を備え、所定のデータ数を有する視差マップを得るために、前記算出手段は、前記縮小手段から得られる最も倍率の小さい画像組を用いて算出される視差マップの階層を最下層として、複数の階層においてそれぞれ視差マップを算出し、各階層ので視差マップを算出する際の前記所定の探索範囲は、1階層下の視差マップに基づいて決定されることを特徴とする。   In order to achieve the above object, a parallax calculation device as an example of the present invention includes an acquisition unit that captures a measurement target on which pattern light is projected and acquires an original image set having parallax, and the original image set. Reduction means for reducing, and calculation means for calculating a disparity map that is a distribution of the amount of parallax corresponding to each area of the image set with a predetermined search range and search window in each area from the image set obtained from the reduction means. In order to obtain a parallax map having a predetermined number of data, the calculation means includes a plurality of parallax map hierarchies calculated using the image set with the smallest magnification obtained from the reduction means, The parallax map is calculated in each layer, and the predetermined search range when calculating the parallax map in each layer is determined based on the parallax map one layer below

本発明によれば、パターン投影を使用したステレオ測距において、階層処理を用いて視差量を計算することで処理の高速化あるいは処理の負荷低減を図ることができる。   According to the present invention, in stereo ranging using pattern projection, the processing speed can be increased or the processing load can be reduced by calculating the amount of parallax using hierarchical processing.

第1実施形態に係る距離測定装置の一例を示す模式図である。It is a mimetic diagram showing an example of a distance measuring device concerning a 1st embodiment. 第1実施形態に係る撮像装置の一例を示す模式図である。It is a schematic diagram which shows an example of the imaging device which concerns on 1st Embodiment. Aは第1実施形態に係る画素の一例を示す断面図であり、Bは第1実施形態に係る射出瞳を示す模式図である。A is a cross-sectional view illustrating an example of a pixel according to the first embodiment, and B is a schematic diagram illustrating an exit pupil according to the first embodiment. 第1実施形態に係る投影パターンの一例を示す。An example of the projection pattern which concerns on 1st Embodiment is shown. 第1実施形態に係る投影装置の一例を示す。1 shows an example of a projection apparatus according to a first embodiment. 第1実施形態に係る距離検出方法のフローの一例を示す。An example of the flow of the distance detection method which concerns on 1st Embodiment is shown. Aはパターン光を投影して撮像した画像の一例を示す模式図であり、Bは第1画素の信号と第2画素の信号の振幅及び周期を示すグラフの一例である。A is a schematic diagram showing an example of an image captured by projecting pattern light, and B is an example of a graph showing the amplitude and period of a signal of a first pixel and a signal of a second pixel. Aは空間周波数とサンプリング画素とを示すグラフの一例であり、Bは倍率m1で縮小してサンプリングした信号を示すグラフの一例である。A is an example of a graph showing a spatial frequency and sampling pixels, and B is an example of a graph showing a signal sampled after being reduced by a magnification m1. Aは空間周波数とサンプリング画素とを示すグラフの一例であり、Bは倍率m2で縮小してサンプリングした信号を示すグラフの一例である。A is an example of a graph showing a spatial frequency and a sampling pixel, and B is an example of a graph showing a signal sampled after being reduced by a magnification m2. 第1実施形態に係る撮像装置の他の例を示す模式図である。It is a schematic diagram which shows the other example of the imaging device which concerns on 1st Embodiment. 第2実施形態に係るロボットの一例を示す模式図である。It is a schematic diagram which shows an example of the robot which concerns on 2nd Embodiment. 第2実施形態に係る距離検出方法のフローの一例を示す。An example of the flow of the distance detection method which concerns on 2nd Embodiment is shown. 仮撮像において取得した画像の一例を示す。An example of the image acquired in provisional imaging is shown. 第2実施形態に係るユーザインタフェースの一例を示す模式図である。It is a schematic diagram which shows an example of the user interface which concerns on 2nd Embodiment.

本発明について、例示的な実施形態を、図面を用いて詳細に説明する。同じ構成を指す場合は同じ参照番号を用いた。本発明は各実施形態に記載された内容に限定されない。また、各実施形態を適宜組み合わせてもよい。   Exemplary embodiments of the present invention will be described in detail with reference to the drawings. The same reference numbers have been used to refer to the same configuration. The present invention is not limited to the contents described in each embodiment. Moreover, you may combine each embodiment suitably.

(第1実施形態)
本実施形態では、パターン投影を使用したステレオ測距の高速化あるいは負荷低減を目的として、階層処理を適用した手法を提案する。階層処理では、撮像画像を例えば一定の画素間隔で間引いて作成した縮小画像を用いて視差量の計算を行うことにより、演算負荷を低減し、処理を高速化する。さらに、画素数の多い元画像での視差量の計算において、低階層で求めた視差量をもとに探索範囲を限定することにより、演算負荷を低減し、処理を高速化する。
(First embodiment)
In the present embodiment, a method using hierarchical processing is proposed for the purpose of increasing the speed of stereo ranging using pattern projection or reducing the load. In the hierarchical processing, the calculation load is reduced and the processing speed is increased by calculating the amount of parallax using a reduced image created by thinning out a captured image at a fixed pixel interval, for example. Further, in the calculation of the amount of parallax in the original image with a large number of pixels, the search range is limited based on the amount of parallax obtained in the lower hierarchy, thereby reducing the computation load and speeding up the processing.

縮小画像を生成するときの倍率(縮小された画像のサイズ)は、所定の計算速度、及び所定の距離情報の算出精度に応じて決定されるのが好ましい。また、パターン光を投影して撮像されたパターン投影画像においては、倍率がパターンに影響を及ぼす。すなわち、倍率とパターン投影の空間周波数の組み合わせが適していないと、生成した画像組の各画像中において、パターンによるテクスチャのコントラストS/N比が低下する。これにより、視差の算出精度、つまり測距精度が低下する。そこで本実施形態では、パターン投影を使用したステレオ測距において、階層処理を用いて処理負荷の低減を図り、さらに測距精度 (視差量及び位相差の算出精度)の低下を抑制する各種条件について提案する。   The magnification (size of the reduced image) when generating a reduced image is preferably determined according to a predetermined calculation speed and a calculation accuracy of predetermined distance information. In the pattern projection image captured by projecting pattern light, the magnification affects the pattern. In other words, if the combination of the magnification and the spatial frequency of pattern projection is not suitable, the texture S / N ratio of the texture due to the pattern decreases in each image of the generated image set. Thereby, the calculation accuracy of parallax, that is, the distance measurement accuracy decreases. Therefore, in this embodiment, in stereo ranging using pattern projection, various processing conditions are used to reduce the processing load by using hierarchical processing and further suppress the decrease in ranging accuracy (parallax amount and phase difference calculation accuracy). suggest.

(装置構成及びパターン撮像部)
図1は、距離の測定対象にパターン光を投影して撮像することによって、原画像組を取得するパターン撮像部100を備えた視差算出装置の一例としての距離測定装置を示す。取得手段の一例としてのパターン撮像部100は、パターン光を投影する投影装置101(投影部)と、視差を持った原画像組を撮像する撮像装置103(撮像部)とを備える。投影装置101は、測定対象である被写体102へパターン光を投影する。そして、撮像装置103は、原画像組を撮像する。また、投影装置101及び撮像装置103は、同期等の制御を行うと共に、原画像組を縮小して得られた画像組から視差量を算出する計算機104(算出部)に接続されている。本実施形態では、投影装置101及び撮像装置103を備えるパターン撮像部100と計算機104とが別装置として設けられているが、一体となっていてもよい。また、投影装置101及び計算機104が一体であってもよく、撮像装置103が別装置であってもよく、装置構成は上述した構成に限らない。撮像装置103と計算機104が一体となっている場合、図2に示す、撮像装置103の演算処理部204が計算機104の構成・機能を兼ねていてもよい。
(Device configuration and pattern imaging unit)
FIG. 1 shows a distance measuring apparatus as an example of a parallax calculating apparatus including a pattern imaging unit 100 that acquires an original image set by projecting pattern light onto a distance measurement target. The pattern imaging unit 100 as an example of an acquisition unit includes a projection device 101 (projection unit) that projects pattern light and an imaging device 103 (imaging unit) that captures an original image set having parallax. The projection device 101 projects pattern light onto a subject 102 that is a measurement target. Then, the imaging device 103 captures the original image set. The projection apparatus 101 and the imaging apparatus 103 are connected to a computer 104 (calculation unit) that performs control such as synchronization and calculates a parallax amount from an image set obtained by reducing an original image set. In the present embodiment, the pattern imaging unit 100 including the projection device 101 and the imaging device 103 and the computer 104 are provided as separate devices, but may be integrated. Further, the projection apparatus 101 and the computer 104 may be integrated, and the imaging apparatus 103 may be a separate apparatus, and the apparatus configuration is not limited to the above-described configuration. When the imaging device 103 and the computer 104 are integrated, the arithmetic processing unit 204 of the imaging device 103 illustrated in FIG. 2 may also serve as the configuration / function of the computer 104.

計算機104はリサイズ部1040、相関演算部1041、視差量算出部1042、距離算出部1043、メモリ1044、及び制御部1045を有する。縮小手段の一例としてのリサイズ部1040は、撮像装置103より入力された視差を有する原画像組を所定の倍率で縮小し、相関演算部1041に出力する。相関演算部1041は、リサイズ部1040より入力された視差を有する画像組を相対的に移動させながら、例えばSAD(Sum of Absolute Difference)を用いて該画像組の相関値マップを算出する。算出手段の一例としての視差量算出部1042は、相関演算部1041で得られた相関値マップから、例えば相関が最も高くなる相関値を決定して画像組の視差量(像ずれ量)を算出する。距離算出部1043は、視差量算出部1042で得られた視差量(像ずれ量)を現在の光学系の状態に対応する換算係数を用いてデフォーカス量に変換し、さらに被写体までの距離を示す被写体距離を算出する。計算機104は、撮像装置103から順次入力される原画像(信号)組あるいは一旦メモリ1044に記憶された原画像組に基づき、視差量、デフォーカス量、あるいは被写体距離の少なくともいずれかを演算結果としてメモリ1044に記憶または外部に出力する。本実施形態では、上述した視差量、デフォーカス量、及び被写体距離をまとめて、画像に対応し、画像内の被写体の深さ方向(奥行方向)の位置あるいは位置関係を示す情報として深度情報と呼ぶことにする。制御部1045は、計算機104内の各部に指示を送り、各部を制御する。   The computer 104 includes a resizing unit 1040, a correlation calculation unit 1041, a parallax amount calculation unit 1042, a distance calculation unit 1043, a memory 1044, and a control unit 1045. A resizing unit 1040 as an example of a reducing unit reduces an original image set having parallax input from the imaging device 103 at a predetermined magnification and outputs the reduced image to the correlation calculation unit 1041. The correlation calculation unit 1041 calculates a correlation value map of the image set using, for example, SAD (Sum of Absolute Difference) while relatively moving the image set having the parallax input from the resizing unit 1040. The parallax amount calculation unit 1042 as an example of a calculation unit determines, for example, a correlation value that provides the highest correlation from the correlation value map obtained by the correlation calculation unit 1041, and calculates the parallax amount (image shift amount) of the image set. To do. The distance calculation unit 1043 converts the parallax amount (image shift amount) obtained by the parallax amount calculation unit 1042 into a defocus amount using a conversion coefficient corresponding to the current state of the optical system, and further calculates the distance to the subject. The subject distance shown is calculated. The computer 104 uses at least one of a parallax amount, a defocus amount, and a subject distance as a calculation result based on an original image (signal) set sequentially input from the imaging device 103 or an original image set temporarily stored in the memory 1044. Store in memory 1044 or output to outside. In the present embodiment, the parallax amount, the defocus amount, and the subject distance described above are combined, and the depth information and the information indicating the position or positional relationship of the subject in the image in the depth direction (depth direction) correspond to the image. I will call it. The control unit 1045 sends an instruction to each unit in the computer 104 to control each unit.

図2は、撮像装置103の構成を示す。撮像装置103は、カメラボディ201、撮像レンズ202、撮像素子203、演算処理部204(演算部)、及び本体メモリ205を備える。本実施形態では、撮像装置103が原画像組を取得できるように、撮像素子203の各画素は少なくとも一方向に対し分割されている。撮像素子203の1つの画素は、図3Aに示す断面図のように、マイクロレンズ311、フィルタ312、及び光電変換部310A、310Bを有している。撮像素子203は、画素毎にフィルタ312によって検出する波長帯域に応じた分光特性が与えられ、所定の配色パターン(例えばRGB(Red,Green,Blue)のカラーフィルタによるベイヤ-配列)でxy平面上に配置されている。基板313には、検出する波長帯域に感度を有する光電変換部310A、310Bが形成されている。検出する波長帯域としては可視光に限らないが、少なくとも一部の光電変換部が感度良く受光可能な波長帯域に、投影装置101が投光する光の波長帯域が含まれるものとする。また、各画素は、図示しない配線を備えている。   FIG. 2 shows the configuration of the imaging device 103. The imaging device 103 includes a camera body 201, an imaging lens 202, an imaging element 203, a calculation processing unit 204 (calculation unit), and a main body memory 205. In the present embodiment, each pixel of the image sensor 203 is divided in at least one direction so that the image capturing apparatus 103 can acquire the original image set. One pixel of the image sensor 203 includes a microlens 311, a filter 312, and photoelectric conversion units 310 </ b> A and 310 </ b> B as illustrated in a cross-sectional view in FIG. 3A. The image sensor 203 is provided with a spectral characteristic corresponding to the wavelength band detected by the filter 312 for each pixel, and has a predetermined color arrangement pattern (for example, a Bayer-array using RGB (Red, Green, Blue) color filters) on the xy plane. Is arranged. On the substrate 313, photoelectric conversion units 310A and 310B having sensitivity in the wavelength band to be detected are formed. The wavelength band to be detected is not limited to visible light, but it is assumed that the wavelength band of light projected by the projection apparatus 101 is included in the wavelength band in which at least some of the photoelectric conversion units can receive light with high sensitivity. Each pixel includes a wiring (not shown).

図3Bに示す第1瞳領域321A及び第2瞳領域321Bは、それぞれ撮像レンズ202の射出瞳320の異なる領域である。光電変換部310Aには第1瞳領域321Aを通過した第1光束が入射し、光電変換部310Bには第2瞳領域321Bを通過した第2光束が入射する。撮像素子203内の第1画素である光電変換部310Aが取得した第1光束から、第1信号が取得される。同様に、第2画素である光電変換部310Bが取得した第2光束から、第2信号が取得される。そして、演算処理部204(図2)は、第1信号からA像を形成し、第2信号からB像を形成する。形成されたA像とB像は本体メモリ205に蓄えられ、当該A像及びB像を用いて計算機104(図1)が測距演算処理を行い、視差マップ及び距離マップを計算する。   A first pupil region 321A and a second pupil region 321B shown in FIG. 3B are different regions of the exit pupil 320 of the imaging lens 202, respectively. The first light beam that has passed through the first pupil region 321A is incident on the photoelectric conversion unit 310A, and the second light beam that has passed through the second pupil region 321B is incident on the photoelectric conversion unit 310B. A first signal is acquired from the first light flux acquired by the photoelectric conversion unit 310A, which is the first pixel in the image sensor 203. Similarly, the second signal is acquired from the second light flux acquired by the photoelectric conversion unit 310B that is the second pixel. Then, the arithmetic processing unit 204 (FIG. 2) forms an A image from the first signal and forms a B image from the second signal. The formed A image and B image are stored in the main body memory 205, and the computer 104 (FIG. 1) performs a distance measurement calculation process using the A image and the B image to calculate a parallax map and a distance map.

測距演算処理は公知の手法によって行われ、例えば計算機104は、相関値マップを算出し、相関値マップから視差マップを求め、視差マップを距離マップへ換算する。投影装置101からパターン光を被写体102へ投影し、被写体102の表面にテクスチャを重畳した状態で撮像装置103が撮像する。これにより、相関値ピークの算出、ひいては測距演算の精度が向上する。   The ranging calculation process is performed by a known method. For example, the computer 104 calculates a correlation value map, obtains a parallax map from the correlation value map, and converts the parallax map into a distance map. Pattern light is projected onto the subject 102 from the projection device 101, and the imaging device 103 captures an image with the texture superimposed on the surface of the subject 102. Thereby, the calculation of the correlation value peak, and thus the accuracy of the distance measurement calculation is improved.

図4は、投影するパターン光のパターン401を示している。当該パターン401は限定されないが、取得した原画像組内でのパターンの空間周波数の制御が容易となるように、視差分割方向402に対し一定周期のパターン401が望ましい。また、視差分割方向402に垂直な方向403への制約は少ない。ただし、取得した原画像組及び相関値の平滑化が容易になるため、同様な繰り返しパターン、つまりパターン401のような、視差分割方向402において一定周期の縦縞パターンが望ましい。   FIG. 4 shows a pattern 401 of pattern light to be projected. The pattern 401 is not limited, but a pattern 401 having a fixed period with respect to the parallax division direction 402 is desirable so that the spatial frequency of the pattern in the acquired original image set can be easily controlled. In addition, there are few restrictions on the direction 403 perpendicular to the parallax division direction 402. However, since the acquired original image set and the correlation value can be easily smoothed, a similar repeated pattern, that is, a vertical stripe pattern having a constant period in the parallax dividing direction 402 such as the pattern 401 is desirable.

図5に示す投影装置101は、ボディ501、光源502、調整レンズ503、空間変調器504、及び投影レンズ505を備える。光源502は白色LEDを有し、光源502から出射した光は、調整レンズ503により空間変調器504に結像される。その後、空間変調器504がパターン光を形成し、投影レンズ505により被写体102の表面へパターン光が結像される。空間変調器504は、DMD(Digital Mirror Device)で形成されている。投影装置101は、この構成に限定されない。拡散板を導入して光量分布を一様にしてもよく、又はケーラー照明若しくは入射瞳に光源像を結ばせる光学系等の各種投影光学系が適用されてもよい。   A projection apparatus 101 illustrated in FIG. 5 includes a body 501, a light source 502, an adjustment lens 503, a spatial modulator 504, and a projection lens 505. The light source 502 has a white LED, and the light emitted from the light source 502 is imaged on the spatial modulator 504 by the adjustment lens 503. Thereafter, the spatial modulator 504 forms pattern light, and the pattern light is imaged on the surface of the subject 102 by the projection lens 505. Spatial modulator 504 is formed of DMD (Digital Mirror Device). The projection apparatus 101 is not limited to this configuration. A diffuser plate may be introduced to make the light quantity distribution uniform, or various projection optical systems such as Koehler illumination or an optical system that forms a light source image on the entrance pupil may be applied.

(基本処理フロー及び階層処理)
原画像組を取得し距離マップを算出する基本処理フローと、縮小した画像組を用いた階層処理について説明する。本実施形態では、所定のデータ数を有する視差マップを得るために、原画像組から縮小処理によって最も倍率を小さく縮小した画像組を用いる処理を最下層とする。この最下層の縮小画像を生成するときの倍率は、測距精度の低下を抑制することのできる倍率とするのが好ましい。なお、最下層の縮小画像の倍率については、詳細に後述する。そして、段階的に画像組の倍率が大きくなっていく(あまり縮小されなくなっていく)複数の階層において、順次視差マップを算出する。このとき各階層での探索範囲あるいは探索ウィンドウは1階層下の演算結果に基づいて限定的な探索範囲あるいは探索ウィンドウのサイズで決定することで、視差マップ算出にかかる処理負荷および処理速度を大幅に低減する。
(Basic processing flow and hierarchical processing)
A basic processing flow for acquiring an original image set and calculating a distance map, and a hierarchical process using the reduced image set will be described. In the present embodiment, in order to obtain a parallax map having a predetermined number of data, processing using an image set that is reduced from the original image set by reducing the magnification by the reduction process is set as the lowest layer. The magnification for generating the reduced image of the lowermost layer is preferably set to a magnification that can suppress a decrease in distance measurement accuracy. Note that the magnification of the lowermost reduced image will be described later in detail. Then, the parallax map is sequentially calculated in a plurality of hierarchies where the magnification of the image set is increased step by step (not reduced so much). At this time, the search range or search window in each layer is determined by the limited search range or search window size based on the calculation result of one layer below, thereby greatly increasing the processing load and processing speed for calculating the parallax map. To reduce.

図6は、第1実施形態に係る基本処理フローを示す。ステップS601にて、投影装置101が被写体102にパターン光を投影し、パターン光が投影された被写体102の原画像組を撮像装置103が取得する(パターン撮像ステップ)。ステップS602にて、計算機104のリサイズ部1040は、原画像組を倍率mで縮小して、最下層の縮小画像の画像組を作成する。ここで倍率mは画像組を形成する際に読み出す画素数の割合に相当する。従って、ステップS601にて取得した原画像組の画素数に対しa画素おきに出力することによって間引いて作成する縮小画像の倍率mは、下記式(1)により表すことができる。   FIG. 6 shows a basic processing flow according to the first embodiment. In step S601, the projection apparatus 101 projects pattern light onto the subject 102, and the imaging apparatus 103 acquires an original image set of the subject 102 onto which the pattern light is projected (pattern imaging step). In step S <b> 602, the resizing unit 1040 of the computer 104 reduces the original image set by the magnification m, and creates an image set of the lowermost reduced image. Here, the magnification m corresponds to the ratio of the number of pixels read out when forming an image set. Accordingly, the magnification m of the reduced image created by thinning out by outputting every a pixels with respect to the number of pixels of the original image group acquired in step S601 can be expressed by the following equation (1).

m=1/a …(1)
従って、ステップS601にて取得した原画像組の画素からa画素おきに出力することによって、倍率mの縮小画像を得ることができる。
m = 1 / a (1)
Therefore, a reduced image with a magnification factor m can be obtained by outputting every a pixels from the pixels of the original image set acquired in step S601.

次にステップS603にて倍率mで縮小して得られた画像組を用いて、上述したような公知の演算手法にて相関値マップ(画像組の各領域に対応する相関値の分布)を算出する。このとき、画素数を間引いて縮小された画像組を用いて相関値マップを算出するため、従来の原画像組から相関値マップを算出する場合に比べて面内解像度(サンプリング数、データ数)が減少する。一方、相関値マップの探索範囲及び計算に用いる探索ウィンドウ内の画素数が原画像組を用いて計算するときと比較して少なくなるため、計算速度が向上する。ステップS604において、求めた相関値マップから、画像組のA像とB像間の視差マップを算出する(算出ステップ)。   Next, a correlation value map (correlation value distribution corresponding to each region of the image set) is calculated by the known calculation method as described above using the image set obtained by reducing the magnification m in step S603. To do. At this time, since the correlation value map is calculated using the image set reduced by thinning out the number of pixels, the in-plane resolution (sampling number, data number) is compared with the case where the correlation value map is calculated from the conventional original image set. Decrease. On the other hand, since the search range of the correlation value map and the number of pixels in the search window used for calculation are smaller than when calculating using the original image set, the calculation speed is improved. In step S604, a parallax map between the A and B images of the image set is calculated from the obtained correlation value map (calculation step).

ステップS605にて、視差マップが所望の出力解像度(データ数、画素数)以上であるか否かを判断し、所望の出力解像度以上でない場合は(ステップS605にてNO)、ステップS606に処理を進める。なお、所望の出力解像度は、任意に設定することが可能であり、その設定方法は特に制限されない。所望の出力解像度が得られない場合、計算機104は、原画像組をより大きい倍率で縮小して得られた他の画像組から視差マップを算出する。すなわち、ステップS606にて、距離マップを算出する際の所望の出力解像度に応じて、原画像組の画素数に対し、aよりも少ないb画素おきに出力することによって間引いて他の画像組を作成し、1階層上の相関演算に用いる画像組とする(a>bである)。そのため、他の画像組の倍率は先に作成した画像組の倍率よりも大きく、先に作成した画像組と比較すると出力解像度の高い画像組となる。   In step S605, it is determined whether or not the parallax map has a desired output resolution (number of data, number of pixels) or more. If not, the process proceeds to step S606. Proceed. The desired output resolution can be arbitrarily set, and the setting method is not particularly limited. When the desired output resolution cannot be obtained, the calculator 104 calculates a parallax map from another image set obtained by reducing the original image set at a larger magnification. That is, in step S606, according to the desired output resolution at the time of calculating the distance map, another image set is thinned out by outputting every b pixels smaller than a with respect to the number of pixels of the original image set. An image set is created and used for correlation calculation on one layer (a> b). Therefore, the magnification of the other image set is larger than the magnification of the previously created image set, and the image set has a higher output resolution than the previously created image set.

次にステップS607にて、ステップS604で先に求めた視差マップをもとに、1階層上での相関演算における探索範囲を設定し、ステップS606で生成した他の画像組を用いて相関値マップを算出する。本実施形態では、対応する領域で先に求めた視差量をもとに、探索範囲、すなわち相関演算において画像組の画素を相対的にずらす画素ずらし量(例えばある階層で±10Pixelなど)を、当該視差量の値もしくはその近傍の値に設定する。   Next, in step S607, based on the disparity map previously obtained in step S604, a search range in the correlation calculation on one layer is set, and the correlation value map is generated using the other image set generated in step S606. Is calculated. In the present embodiment, based on the amount of parallax previously obtained in the corresponding region, a pixel shift amount (for example, ± 10 Pixel in a certain hierarchy) that relatively shifts the pixels of the image set in the search range, that is, the correlation calculation, It is set to the value of the parallax amount or a value in the vicinity thereof.

また、画像組において相関演算の対象とする領域のサイズである探索ウィンドウサイズ(例えばある階層で垂直方向に4行、水平方向に20Pixelなど)は、各階層の倍率(a、bなど)あるいは解像度に応じて設定される。すなわち、各階層における相関演算の対象領域(対象としている被写体)が略同一になるように、探索ウィンドウのサイズ(解像度、画素数)を設定する。   In addition, the search window size (for example, 4 lines in the vertical direction and 20 pixels in the horizontal direction in a certain hierarchy) that is the size of the area to be subjected to correlation calculation in the image set is the magnification (a, b, etc.) or resolution of each hierarchy. Is set according to That is, the size (resolution, number of pixels) of the search window is set so that the correlation calculation target regions (subjects to be processed) in each layer are substantially the same.

さらに、下層において先に求めた相関値の信頼度に応じて、信頼度が高い領域は算出された視差量の信頼度も高い(算出誤差を吸収するべくサイズを大きくする必要がない)として、探索ウィンドウサイズを倍率から換算されるサイズより小さく設定するようにしてもよい。ここでいう相関値の信頼度とは、相関演算によって得られる像ずれ量と相関値をプロットする曲線における傾きや、画像信号そのものが相関を取りやすい、エッジ成分の大きいものであるかを測るために画像組の対象領域におけるエッジ積分値や、画像信号のSN比を用いてもよい。   Furthermore, according to the reliability of the correlation value obtained earlier in the lower layer, the region with high reliability has high reliability of the calculated amount of parallax (there is no need to increase the size to absorb the calculation error), The search window size may be set smaller than the size converted from the magnification. Here, the reliability of the correlation value is used to measure the slope of the curve plotting the image shift amount obtained by the correlation calculation and the correlation value, or whether the image signal itself is easily correlated and has a large edge component. Alternatively, the edge integral value in the target region of the image set or the SN ratio of the image signal may be used.

また、探索ウィンドウサイズを各階層の倍率によらず一定値(例えば全ての階層で垂直方向に4行、水平方向に20Pixelなど)に設定するようにしてもよい。階層が上がるにつれ画像の解像度は上がるが探索ウィンドウサイズは一定値のため、相関値マップの面内解像度が向上する。さらに下層での算出視差量をもとに正解視差量の近傍で相関値を算出するため、探索ウィンドウサイズを階層に応じて変更せず一定値としたことで相関演算の対象領域(対象としている被写体)が変わることによる相関値算出エラーを回避できる。   Further, the search window size may be set to a constant value (for example, four rows in the vertical direction and 20 pixels in the horizontal direction in all layers) regardless of the magnification of each layer. The resolution of the image increases as the hierarchy increases, but the in-plane resolution of the correlation value map is improved because the search window size is a constant value. In addition, since the correlation value is calculated in the vicinity of the correct parallax amount based on the calculated parallax amount in the lower layer, the search window size is not changed according to the hierarchy but is set to a constant value (target area of the correlation calculation) Correlation value calculation errors due to changes in the subject can be avoided.

以上の処理により、視差量が不明な状態で画像全体に一律で大きな探索範囲及び探索ウィンドウを設定する場合に比べて、視差量の算出処理にかかる処理負荷と処理速度を大幅に低減することができる。   With the above processing, the processing load and processing speed for the calculation processing of the amount of parallax can be significantly reduced as compared to the case where a uniform large search range and search window are set for the entire image when the amount of parallax is unknown. it can.

その後、ステップS608にて視差マップ(画像組の各領域に対応する視差量の分布)を算出する。このように、ステップS604にて求めた画像組の視差マップが、次回の他の画像組での探索範囲及び探索ウィンドウの設定に反映されるため、探索範囲及び探索ウィンドウの設定が不必要に大きくならない。これにより、縮小して得られた画像組の計算を介さない場合と比較して計算速度が向上する。ステップS609にて視差マップが所望の出力解像度以上であるか否かを判断し、所望の出力解像度以上でない場合は(ステップS609にてNO)、ステップS606〜S608を所望の出力解像度以上となるまで繰り返す。すなわち、原画像組の縮小により他の画像組より倍率が大きい画像組を作成して、作成した新たな画像組を用いて相関値マップを算出した後、視差マップを算出する。   Thereafter, in step S608, a parallax map (a distribution of parallax amounts corresponding to each region of the image set) is calculated. As described above, since the parallax map of the image set obtained in step S604 is reflected in the setting of the search range and search window in the next other image set, the setting of the search range and search window is unnecessarily large. Don't be. Thereby, the calculation speed is improved as compared with the case where the calculation of the image group obtained by the reduction is not performed. In step S609, it is determined whether or not the parallax map is equal to or higher than the desired output resolution. repeat. That is, an image set having a higher magnification than the other image sets is created by reducing the original image set, a correlation value map is calculated using the created new image set, and then a parallax map is calculated.

所望の出力解像度以上の視差マップが得られた場合は(ステップS609にてYES)、ステップS610にてカメラの光学系情報をもとに視差マップから距離マップ(画像組の各領域に対応する距離値の分布)を算出する。倍率mにより作成された画像組(a画素間引いて作成する画像組)の解像度が所望の出力解像度以上である場合は(ステップS605にてYES)、当該画像組の視差マップを用いて距離マップを算出する。この場合は、ステップS606へ進むことなく、ステップS610に処理を進めて距離マップを算出する。   If a parallax map with a desired output resolution or higher is obtained (YES in step S609), a distance map (distance corresponding to each area of the image set) from the parallax map based on the optical system information of the camera in step S610. Value distribution). If the resolution of the image set created by the magnification m (image set created by thinning out a pixels) is equal to or higher than the desired output resolution (YES in step S605), a distance map is generated using the parallax map of the image set. calculate. In this case, without proceeding to step S606, the process proceeds to step S610 to calculate the distance map.

(変数決定方法、及び倍率mと空間周波数fの関係)
続いて、第1実施形態に係る視差マップの算出において、ステップS602で行われる原画像組を最も小さく縮小する最下層の階層処理における、原画像組を縮小する倍率mと、パターン光を投影して撮像して得られた原画像中の空間周波数fとの関係を説明する。
(Variable determination method and relationship between magnification m and spatial frequency f)
Subsequently, in the calculation of the parallax map according to the first embodiment, the magnification m for reducing the original image set and the pattern light are projected in the lowest layer hierarchical processing for reducing the original image set to the smallest in step S602. The relationship with the spatial frequency f in the original image obtained by imaging will be described.

図1に示したような構成で被写体102にパターン401を投影して撮像して得られた原画像701を図7Aに示す。ここで説明を簡便にするため、原画像701(原画像組の一方の画像)中の線分702上の、パターン光が投影された被写体102に対応する区間703の画像信号を図7Bに抜き出して示す。区間703の画像信号は、パターン401の一定周期に対応した第1信号711(実線)と第2信号712(破線)とを含む。ここで、第1信号711は、第1画素である光電変換部310Aが取得したA像の信号である。また、第2信号712は、第2画素である光電変換部310Bが取得したB像の信号である。第1信号711と第2信号712は互いに視差量に対応した位相のずれ713を持っている。   FIG. 7A shows an original image 701 obtained by projecting the pattern 401 onto the subject 102 with the configuration shown in FIG. In order to simplify the description here, the image signal of the section 703 corresponding to the subject 102 on which the pattern light is projected on the line segment 702 in the original image 701 (one image of the original image set) is extracted in FIG. 7B. Show. The image signal in the section 703 includes a first signal 711 (solid line) and a second signal 712 (broken line) corresponding to a certain period of the pattern 401. Here, the first signal 711 is a signal of an A image acquired by the photoelectric conversion unit 310A that is the first pixel. The second signal 712 is a B image signal acquired by the photoelectric conversion unit 310B, which is the second pixel. The first signal 711 and the second signal 712 have a phase shift 713 corresponding to the amount of parallax.

図8A,図8Bを用いて、倍率mと取得した原画像組における測定対象上のパターン空間周波数である基準周波数f(以下、空間周波数fともいう)との関係について示す。図8Aは、図7Bで示した第1信号711と第2信号712の一部区間を示し、撮像画素801との関係を1次元で示している。第1信号711は、取得した原画像上において区間802で示される周期Tに対応する基準周波数f(=1/T)を持っている(第2信号712も同様)。これに対し、区間803に対応する画素数a1を間引いて、図8Aに太枠で示したサンプリング画素804のみで作成した、すなわち、倍率m1(=1/a1)で縮小してサンプリングした画像組の画像信号を図8Bに示す。   8A and 8B, the relationship between the magnification m and the reference frequency f (hereinafter also referred to as the spatial frequency f) that is the pattern spatial frequency on the measurement target in the acquired original image set will be described. FIG. 8A shows a partial section of the first signal 711 and the second signal 712 shown in FIG. 7B and shows the relationship with the imaging pixel 801 in one dimension. The first signal 711 has a reference frequency f (= 1 / T) corresponding to the period T indicated by the section 802 on the acquired original image (the same applies to the second signal 712). On the other hand, the number of pixels a1 corresponding to the section 803 is thinned out, and the image set is created by using only the sampling pixel 804 indicated by a thick frame in FIG. The image signal is shown in FIG. 8B.

第1信号711を倍率m1で縮小してサンプリングした画像の画像信号が実線で示した信号811である。また、第2信号712を倍率m1で縮小してサンプリングした画像の画像信号が破線で示した信号812である。このとき、サンプリング画素804は、サンプリング定理を満たすように、m1=2fの関係で設定した。図8Bに示すように、第1信号711に対応する信号811はもとの信号形状を残しているのに対し、第2信号712に対応する信号812はもとの信号形状が消失してしまう。   An image signal of an image sampled by reducing the first signal 711 at the magnification m1 is a signal 811 indicated by a solid line. An image signal of an image sampled by reducing the second signal 712 at the magnification m1 is a signal 812 indicated by a broken line. At this time, the sampling pixel 804 is set in a relationship of m1 = 2f so as to satisfy the sampling theorem. As shown in FIG. 8B, the signal 811 corresponding to the first signal 711 retains the original signal shape, whereas the signal 812 corresponding to the second signal 712 loses the original signal shape. .

これは、第1信号711と第2信号712が視差量に起因した位相ずれを持っているため、一方の信号に対しサンプリング定理を適応しても他方の信号の形状が保存・復元されないからである。このように被写体102へパターン光を投影して取得した原画像組に対し、適切な倍率を設定しないと、縮小して形成した画像組のA像またはB像の信号形状(テクスチャ)のコントラストが低下してしまう。その結果、相関値マップの算出精度、ひいては視差マップ及び距離マップの算出精度が低下する。   This is because the first signal 711 and the second signal 712 have a phase shift due to the amount of parallax, so that even if the sampling theorem is applied to one signal, the shape of the other signal is not saved or restored. is there. If an appropriate magnification is not set for the original image set acquired by projecting the pattern light onto the subject 102 in this way, the contrast of the signal shape (texture) of the A image or B image of the reduced image set is set. It will decline. As a result, the calculation accuracy of the correlation value map, and hence the calculation accuracy of the parallax map and the distance map, is reduced.

一方の信号の形状を最大限に残す最小のサンプリングに対し、他方の信号の形状が最も消失してしまうのは、位相ずれが±π/4のときである。したがって、m≧4fの関係を満たすように倍率(サンプリング画素)を設定すれば、A信号もB信号も信号形状を残しながら最小画素数でサンプリングできる。この最小画素数でサンプリングした様子を図9A,図9Bに示す。   It is when the phase shift is ± π / 4 that the shape of the other signal disappears most with respect to the minimum sampling that keeps the shape of one signal to the maximum. Therefore, if the magnification (sampling pixel) is set so as to satisfy the relationship of m ≧ 4f, both the A signal and the B signal can be sampled with the minimum number of pixels while leaving the signal shape. FIGS. 9A and 9B show a state of sampling with the minimum number of pixels.

図8Aと同様に図9Aにおいて、第1信号711は取得した原画像上において区間802で示される周期Tに対応する空間周波数f(=1/T)を持っている(第2信号712も同様)。これに対し、区間903に対応する画素数a2を間引いて、図9Aに太枠で示したサンプリング画素904のみで作成した、すなわち、倍率m2(=1/a2)で縮小してサンプリングした画像の画像信号を図9Bに示す。第1信号711を倍率m2で縮小してサンプリングした画像の画像信号が、実線で示した信号911である。また、第2信号712を倍率m2で縮小してサンプリングした画像の画像信号が、破線で示した信号912である。ここで、倍率m2と空間周波数fの関係はm2=4fである。このとき、縮小して形成した画像組においてもA像に対応する信号911とB像に対応する信号912は、ともにもとの画像信号の信号形状を反映している。そのため、相関値マップの算出精度が低下することなく、視差マップを算出できる。また、第1実施形態の効果を得るためにはサンプリング画素の間隔で決まる倍率mと空間周波数fの関係が、下記式(2)を満たせばよい。   As in FIG. 8A, in FIG. 9A, the first signal 711 has a spatial frequency f (= 1 / T) corresponding to the period T indicated by the section 802 on the acquired original image (the second signal 712 is also the same). ). On the other hand, the number of pixels a2 corresponding to the section 903 is thinned out, and only the sampling pixel 904 indicated by a thick frame in FIG. 9A is created, that is, the image sampled after being reduced by the magnification m2 (= 1 / a2) The image signal is shown in FIG. 9B. An image signal of an image sampled by reducing the first signal 711 at the magnification m2 is a signal 911 indicated by a solid line. An image signal of an image sampled by reducing the second signal 712 at the magnification m2 is a signal 912 indicated by a broken line. Here, the relationship between the magnification m2 and the spatial frequency f is m2 = 4f. At this time, even in a reduced image set, the signal 911 corresponding to the A image and the signal 912 corresponding to the B image both reflect the signal shape of the original image signal. Therefore, the parallax map can be calculated without reducing the calculation accuracy of the correlation value map. In order to obtain the effect of the first embodiment, the relationship between the magnification m determined by the sampling pixel interval and the spatial frequency f should satisfy the following formula (2).

m≧4f …(2)       m ≧ 4f (2)

しかしながら、上記式(2)は空間周波数fを限りなく小さくすれば、つまり投影するパターン光のパターン401の周期Tを限りなく大きくすれば、倍率mの値に関係なく成立する。一方で、距離マップの算出対象である被写体102に対し、不必要に大きすぎる周期Tは距離マップを算出する面内分解能の観点から好適ではない。したがって、倍率mに対し、倍率m=4fの関係を満たすように、取得した原画像組上での空間周波数fを投影装置101と撮像装置103を備えるパターン撮像部100にて制御する。ここで、倍率mは所定の空間分解能及び計算速度によって決定され、空間周波数fは最大の面内分解能が得られるパターン光の取得画像組上での空間周波数である。空間周波数fは、順次取得される画像組においてパターン検出により算出してもよいし、投影装置101及び撮像装置103の光学条件、被写体との位置関係などが予め分かっている場合には、対応する空間周波数fを予めメモリ1044に記憶しておいてもよい。   However, the above equation (2) is established regardless of the value of the magnification m if the spatial frequency f is reduced as much as possible, that is, if the period T of the pattern light pattern 401 to be projected is increased as much as possible. On the other hand, a period T that is unnecessarily large for the subject 102 for which the distance map is calculated is not suitable from the viewpoint of in-plane resolution for calculating the distance map. Therefore, the pattern imaging unit 100 including the projection device 101 and the imaging device 103 controls the spatial frequency f on the acquired original image set so as to satisfy the relationship of the magnification m = 4f with respect to the magnification m. Here, the magnification m is determined by a predetermined spatial resolution and calculation speed, and the spatial frequency f is a spatial frequency on an acquired image set of pattern light that provides the maximum in-plane resolution. The spatial frequency f may be calculated by pattern detection in sequentially acquired image sets, and corresponds when the optical conditions of the projection apparatus 101 and the imaging apparatus 103, the positional relationship with the subject, and the like are known in advance. The spatial frequency f may be stored in the memory 1044 in advance.

ここで空間周波数fの設定精度を説明する。パターン撮像部100の投影装置101及び撮像装置103の光学系により重畳される誤差、及び被写体102を含む各装置間の互いの相対距離により生じる誤差を重畳する。すると、取得した原画像上での空間周波数fは±25%の誤差を持つ。したがって、倍率mと基準周波数fの関係は、下記式(3)を満たせばよい。   Here, the setting accuracy of the spatial frequency f will be described. An error superimposed by the optical system of the projection device 101 and the imaging device 103 of the pattern imaging unit 100 and an error caused by the relative distance between the devices including the subject 102 are superimposed. Then, the spatial frequency f on the acquired original image has an error of ± 25%. Therefore, the relationship between the magnification m and the reference frequency f may satisfy the following formula (3).

5f≧m≧3f …(3)       5f ≧ m ≧ 3f (3)

取得画像上での被写体102のパターン401の空間周波数である基準周波数fと、間引き画素数によって決まる倍率mとの関係が式(3)を満たすことによって、視差マップの算出精度を保ちながら縮小して形成した画像組により相関値マップを算出できる。つまり、所定の計算速度及び解像度を満たす倍率mを、測距精度が低下することなく設定するという効果が得られる。例えば計算機104は、上記式(3)を満たすように投影パターン又は撮像条件を設定する(設定ステップ)。すなわち、計算機104は、投影装置101内の空間変調器504での生成パターン若しくはパターンマスク、又は投影レンズ505の倍率、及び撮像装置103が取得する画像の画角若しくは倍率を設定する。または、上記式(3)を満たすように、計算機104が階層処理の倍率mを設定する(設定ステップ)。   When the relationship between the reference frequency f, which is the spatial frequency of the pattern 401 of the subject 102 on the acquired image, and the magnification m determined by the number of thinned pixels satisfies Expression (3), the parallax map is reduced while maintaining the calculation accuracy. A correlation value map can be calculated from the image set formed in this way. That is, the effect of setting the magnification m satisfying the predetermined calculation speed and resolution without reducing the distance measurement accuracy is obtained. For example, the computer 104 sets a projection pattern or an imaging condition so as to satisfy the above formula (3) (setting step). That is, the computer 104 sets the generation pattern or pattern mask in the spatial modulator 504 in the projection apparatus 101 or the magnification of the projection lens 505 and the angle of view or magnification of the image acquired by the imaging apparatus 103. Alternatively, the computer 104 sets the hierarchical processing magnification m so as to satisfy the above formula (3) (setting step).

(その他の構成)
原画像組を取得する撮像装置103は、2つ以上の複数の光学系とそれに対応する撮像素子を有するステレオカメラであってもよい。ステレオカメラを用いることにより、基線長の設計自由度が向上し、測距分解能が向上する。また、第1実施形態に係るパターン撮像部100は、撮像装置103に投影装置101を搭載したひとつの装置であってもよい。この装置は、撮像装置103と投影装置101の位置関係が固定された状態となるため、耐環境性の向上、及び画角又は倍率の条件設定の容易化を実現できる。具体的には図10に示すように、第1実施形態に係る撮像装置は、カメラボディ201の上部に投影装置1001を搭載し、制御装置1010を用いて、互いのパラメータ及び同期を制御する、撮像装置1000としてもよい。
(Other configurations)
The imaging device 103 that acquires the original image set may be a stereo camera having two or more optical systems and imaging elements corresponding thereto. By using a stereo camera, the design flexibility of the baseline length is improved and the ranging resolution is improved. In addition, the pattern imaging unit 100 according to the first embodiment may be a single device in which the projection device 101 is mounted on the imaging device 103. Since this apparatus is in a state in which the positional relationship between the imaging apparatus 103 and the projection apparatus 101 is fixed, it is possible to improve environmental resistance and facilitate setting of the angle of view or magnification condition. Specifically, as illustrated in FIG. 10, the imaging apparatus according to the first embodiment includes a projection apparatus 1001 mounted on the upper part of the camera body 201 and controls each other's parameters and synchronization using the control apparatus 1010. The imaging device 1000 may be used.

計算機104を撮像装置1000内に備えられたCPU(Cental Processing Unit)とすることにより、撮像装置1000を小型化できる。パターン制御部である空間変調器504は、反射型LCOS(Liquid Crystal On Silicon)、透過型LCOS、及びDMD(Digital Micromirr or Device)のいずれでもよい。これらの空間変調器504を用いることで、画素数が多いパターンを高い応答速度で生成することができる。これにより、面内解像度を向上できると共に、パターンを高速切り替えでき、画像の取得速度を向上できる。   By using the computer 104 as a CPU (Central Processing Unit) provided in the imaging apparatus 1000, the imaging apparatus 1000 can be reduced in size. The spatial modulator 504 serving as a pattern control unit may be any one of a reflective LCOS (Liquid Crystal On Silicon), a transmissive LCOS, and a DMD (Digital Micromirror or Device). By using these spatial modulators 504, a pattern with a large number of pixels can be generated at a high response speed. Thereby, the in-plane resolution can be improved, the pattern can be switched at high speed, and the image acquisition speed can be improved.

パターン制御部は、すりガラス又は金属板等の、パターンがあらかじめ形成されているパターンマスクを、投影装置101,1001の光路へ出し入れすることによってパターンを投影してもよい。これにより、装置コストの低減化、及び装置の小型化を実現できる。さらに投影装置101,1001内の光源は、LD(Laser Diode)、LED(Light Emitting Diode)、及びハロゲンランプのような熱光源のいずれであってもよい。装置ならびに被写体の大きさを鑑みて、適切な光量ならびに光源の大きさを設計することによって、装置の小型化及び低コスト化を実現できる。   The pattern control unit may project the pattern by putting a pattern mask in which a pattern is formed in advance, such as ground glass or a metal plate, into and out of the optical path of the projection apparatuses 101 and 1001. Thereby, reduction of apparatus cost and size reduction of an apparatus are realizable. Furthermore, the light source in the projection apparatuses 101 and 1001 may be any of a heat source such as an LD (Laser Diode), an LED (Light Emitting Diode), and a halogen lamp. In view of the size of the device and the subject, the device can be reduced in size and cost by designing an appropriate light amount and light source size.

投影装置101,1001の光源は、波長が可視光域の全域を含む白色光を出射できる。これにより、第1実施形態の手法において、被写体の分光反射率によらず第1実施形態の効果が得られる。また、投影装置101,1001の光源は、R、G、Bの3色の光を出射してもよい。これにより、撮像装置のカラーフィルタ透過帯域と光の波長とを一致させ、使用エネルギーに対する光利用効率を高くできる。   The light sources of the projection apparatuses 101 and 1001 can emit white light whose wavelength includes the entire visible light range. Thereby, in the method of the first embodiment, the effect of the first embodiment can be obtained regardless of the spectral reflectance of the subject. Further, the light sources of the projection apparatuses 101 and 1001 may emit light of three colors of R, G, and B. Thereby, the color filter transmission band of the imaging device and the wavelength of light can be matched, and the light utilization efficiency with respect to the energy used can be increased.

また、投影装置101,1001の光源の波長がIR(Infrared)領域であり、IR領域に対応した透過帯域ならびに受光感度を持つカラーフィルタが配された撮像素子を備えた撮像装置を用いて被写体を撮像してもよい。これにより、RGB帯域を用いた鑑賞用画像を、測距と同時に撮像できる。特にIRの波長帯域が800nmから1100nmの間である場合、光電変換部にSiを用いることができる。これにより、カラーフィルタの配列を変更することで、ひとつの撮像素子によりRGB帯域の鑑賞画像とIR帯域の測距画像を取得することができる。   Further, the wavelength of the light source of the projectors 101 and 1001 is an IR (Infrared) region, and an object is captured using an imaging device including an imaging element in which a color filter having a transmission band corresponding to the IR region and a light receiving sensitivity is arranged. You may image. Thereby, an image for viewing using the RGB band can be taken simultaneously with the distance measurement. In particular, when the IR wavelength band is between 800 nm and 1100 nm, Si can be used for the photoelectric conversion portion. Thereby, by changing the arrangement of the color filters, a viewing image in the RGB band and a ranging image in the IR band can be acquired by one image sensor.

縮小画像は、間引き画素数に相当する画素を加算平均して生成してもよい。これにより、測距精度にかかるパターンやテクスチャの識別性能は低下するものの、平滑化により耐環境性が向上する。相関値マップの算出手法は、SSD(Sum of Squared Difference)、SAD(Sum of Absolute Difference)、及びPOC(Phase Only Correlation)のいずれでもよいが、これらの手法に限定されない。   The reduced image may be generated by averaging the pixels corresponding to the number of thinned pixels. Thereby, although the identification performance of the pattern and texture concerning ranging accuracy falls, environmental resistance improves by smoothing. The calculation method of the correlation value map may be any of SSD (Sum of Squared Difference), SAD (Sum of Absolute Difference), and POC (Phase Only Correlation), but is not limited to these methods.

第1実施形態は、撮像装置の他に、コンピュータプログラムをも包含する。第1実施形態のコンピュータプログラムは、距離マップあるいは視差マップの算出のために、コンピュータに所定の工程を実行させる。第1実施形態のプログラムは、距離検出装置、視差量検出装置またはそのいずれかを備えるデジタルカメラ等の撮像装置のコンピュータにインストールされる。インストールされたプログラムがコンピュータによって実行されることにより、上記の機能が実現し、距離マップ及び視差マップを高速かつ高精度で検出できる。一例として、このプログラムは、原画像組を取得するパターン撮像部100と、原画像組を縮小して得られた画像組から視差マップを計算する計算機104とを備える撮像装置1000の制御プログラムである。当該制御プログラムは、コンピュータに、算出ステップと、設定ステップとを実行させる。この算出ステップでは、原画像組を縮小して得られた画像組から視差マップを算出する。また、設定ステップでは、縮小する際の倍率である倍率mと、原画像上での基準周波数fとの関係が、上記式(3)を満たすように、パターン撮像部100及び計算機104のいずれかの条件を設定する。   The first embodiment includes a computer program in addition to the imaging apparatus. The computer program of the first embodiment causes a computer to execute a predetermined process for calculating a distance map or a parallax map. The program of the first embodiment is installed in a computer of an imaging apparatus such as a digital camera equipped with a distance detection apparatus, a parallax amount detection apparatus, or any one thereof. When the installed program is executed by the computer, the above function is realized, and the distance map and the parallax map can be detected at high speed and with high accuracy. As an example, this program is a control program for the imaging apparatus 1000 including a pattern imaging unit 100 that acquires an original image set and a calculator 104 that calculates a parallax map from an image set obtained by reducing the original image set. . The control program causes the computer to execute a calculation step and a setting step. In this calculation step, a parallax map is calculated from an image set obtained by reducing the original image set. In the setting step, either the pattern imaging unit 100 or the computer 104 is set so that the relationship between the magnification m, which is a magnification at the time of reduction, and the reference frequency f on the original image satisfies the above equation (3). Set the conditions.

(第2実施形態)
(高速測定モード、FA検査装置)
図11から図13を参照して、第2実施形態に係る撮像装置1100を用いたFA(Factory Automation)検査装置及び速度設定モードに関して説明する。
(Second Embodiment)
(High-speed measurement mode, FA inspection device)
With reference to FIGS. 11 to 13, a FA (Factory Automation) inspection apparatus using the imaging apparatus 1100 according to the second embodiment and a speed setting mode will be described.

図11は第2実施形態に係るFA検査装置のロボット2000を示す。ロボット2000は、撮像装置1100、作業ステージ1101、ロボットアーム1102、ロボットハンド1103、及び制御装置1105(算出部)を備える。撮像装置1100を用いて取得した深度情報をもとに、制御装置1105がロボットアーム1102及びロボットハンド1103を制御して、主被写体であるワーク1104(測定対象)を把持する。当該把持動作のなかで、深度情報の算出に係るフローを図12に示す。   FIG. 11 shows a robot 2000 of the FA inspection apparatus according to the second embodiment. The robot 2000 includes an imaging device 1100, a work stage 1101, a robot arm 1102, a robot hand 1103, and a control device 1105 (calculation unit). Based on the depth information acquired using the imaging device 1100, the control device 1105 controls the robot arm 1102 and the robot hand 1103 to grip the work 1104 (measurement target) that is the main subject. FIG. 12 shows a flow related to the calculation of depth information in the gripping operation.

ステップS1201では、計測速度、基準周波数、注目領域、間引きする画素数、倍率、投影条件、及び撮像条件等の各種条件を設定する。例えば、使用者は計測速度を設定する。計測速度は実際の速度でもよいし、「高速/中速/低速」のようなあらかじめ設定された段階から使用者が選択してもよい。計測速度に応じて、撮像装置1100を用いて仮撮像を行い、倍率mと、投影するパターン光(投影パターン)または撮像装置1100の撮像条件を設定し、基準周波数fを設定する。   In step S1201, various conditions such as a measurement speed, a reference frequency, a region of interest, the number of pixels to be thinned out, a magnification, a projection condition, and an imaging condition are set. For example, the user sets the measurement speed. The measurement speed may be an actual speed or may be selected by a user from a preset stage such as “high speed / medium speed / low speed”. In accordance with the measurement speed, provisional imaging is performed using the imaging device 1100, the magnification m, the pattern light to be projected (projection pattern) or the imaging conditions of the imaging device 1100 are set, and the reference frequency f is set.

ワーク1104を仮撮像して取得した撮像画像1301を図13に示す。制御装置1105は、ステップS1202にて、ワーク1104が写っている領域を注目領域:ROI(Region Of Interest)1302として設定する。次に、制御装置1105は、ステップS1201において設定した計測速度に対応した倍率を算出する。具体的に、「高速」モードを設定したとき、制御装置1105は、ROI1302の画像から10画素おきに画素を間引きするように倍率m_ROIを算出する。このとき、倍率m_ROIと、撮像画像1301(ワーク1104に重畳されるパターン光)の空間周波数fとの関係が、下記式(4)を満たすように、制御装置1105は、投影装置(不図示)または撮像装置1100の条件を設定する(設定ステップ)。または、制御装置1105は、下記式(4)を満たすように倍率m_ROIを設定する(設定ステップ)。   A captured image 1301 acquired by provisional imaging of the workpiece 1104 is shown in FIG. In step S <b> 1202, the control device 1105 sets an area in which the workpiece 1104 is captured as a region of interest: ROI (Region Of Interest) 1302. Next, the control device 1105 calculates a magnification corresponding to the measurement speed set in step S1201. Specifically, when the “high speed” mode is set, the control device 1105 calculates the magnification m_ROI so that pixels are thinned out every 10 pixels from the image of the ROI 1302. At this time, the control device 1105 causes the projection device (not shown) so that the relationship between the magnification m_ROI and the spatial frequency f of the captured image 1301 (pattern light superimposed on the workpiece 1104) satisfies the following formula (4). Alternatively, the conditions of the imaging apparatus 1100 are set (setting step). Alternatively, the control device 1105 sets the magnification m_ROI so as to satisfy the following formula (4) (setting step).

5f ≧ m_ROI ≧ 3f …(4)       5f ≧ m_ROI ≧ 3f (4)

例えば、撮像装置1100の条件を固定する場合、制御装置1105は、投影装置内の空間変調器504の条件を変更し、撮像画像1301の空間周波数fが上記式(4)の関係を満たすように制御する。その後、ステップS1202からステップS1210までの処理を行い、制御装置1105がステップS1211にて距離マップを算出する。なお、ステップS1202からステップS1210は、第1実施形態において説明したステップS601からステップS609と同じであるため、その説明は省略する。ステップS1211にて算出された距離マップをもとに、制御装置1105は、ロボットアーム1102及びロボットハンド1103を制御し、ワーク1104を把持させる。   For example, when the conditions of the imaging device 1100 are fixed, the control device 1105 changes the conditions of the spatial modulator 504 in the projection device so that the spatial frequency f of the captured image 1301 satisfies the relationship of the above formula (4). Control. Thereafter, the processing from step S1202 to step S1210 is performed, and the control device 1105 calculates a distance map in step S1211. Note that steps S1202 to S1210 are the same as steps S601 to S609 described in the first embodiment, and a description thereof will be omitted. Based on the distance map calculated in step S <b> 1211, the control device 1105 controls the robot arm 1102 and the robot hand 1103 to grip the workpiece 1104.

このように、第2実施形態の撮像装置は、測定対象の撮像画像の注目領域を設定することにより、所定の速度で視差マップを算出する、速度設定モードを搭載している。これにより、注目する主被写体に対し、ROIを設定し、目的に応じた倍率を設定し、縮小することで、所定の計算速度で距離マップを算出できる。また、制御装置1105は、深度情報(深度マップ)を距離値(距離マップ)の形態でなく、視差量(視差マップ)やデフォーカス量(デフォーカスマップ)の形態で受け取り、ロボットアーム1102及びロボットハンド1103を制御可能であってもよい。この場合、S1206の距離マップの算出ステップは必要ない。   As described above, the imaging apparatus according to the second embodiment includes a speed setting mode in which a parallax map is calculated at a predetermined speed by setting a region of interest of a captured image to be measured. Thus, the distance map can be calculated at a predetermined calculation speed by setting the ROI for the main subject of interest, setting the magnification according to the purpose, and reducing the scale. Further, the control device 1105 receives the depth information (depth map) not in the form of the distance value (distance map) but in the form of the parallax amount (parallax map) or the defocus amount (defocus map), and receives the robot arm 1102 and the robot. The hand 1103 may be controllable. In this case, the distance map calculation step of S1206 is not necessary.

ステップS1201においては、間引きする画素数または倍率を、ユーザが直接設定してもよい。これにより、ユーザが目的に応じて微調整できるため、ユーザビリティを向上できる。また、ステップS1201において、予め設定された速度項目のそれぞれに対し、間引きする画素数または倍率を事前にユーザが設定してもよい。これにより、ユーザビリティを向上できる。   In step S1201, the user may directly set the number of pixels to be thinned out or the magnification. Thereby, since a user can finely adjust according to the objective, usability can be improved. In step S1201, the user may set the number of pixels to be thinned out or the magnification in advance for each of the preset speed items. Thereby, usability can be improved.

ステップS1201の仮撮像は、事前に対象ワークの形状、及び測定に用いる撮像画角をメモリに記憶しておくことにより省略できる。また、第2実施形態の撮像装置は、測定対象の撮像画像から被写体を認識し、各種変数を自動で決定する自動決定モードを搭載していてもよい。例えば、制御装置1105は、各種画像認識技術を用いることにより、撮像されたワークと事前登録された形状情報をもとに、随時自動で倍率と基準周波数を設定してもよい。これにより、ユーザビリティを向上できる。また、ROIはユーザが手動で設定してもよいし、各種画像認識から対象ワークが認識されたときに制御装置1105がROIを自動設定してもよい。   The provisional imaging in step S1201 can be omitted by storing in advance the shape of the target workpiece and the imaging angle of view used for measurement in the memory. The imaging apparatus of the second embodiment may be equipped with an automatic determination mode that recognizes a subject from a captured image to be measured and automatically determines various variables. For example, the control device 1105 may automatically set the magnification and the reference frequency as needed based on the imaged workpiece and pre-registered shape information by using various image recognition techniques. Thereby, usability can be improved. The ROI may be set manually by the user, or the control device 1105 may automatically set the ROI when the target workpiece is recognized from various image recognitions.

基準周波数fは、原画像組における空間周波数の分布における最多の成分とすることができる。例えば、仮撮像によって得られた画像組(原画像組)を周波数解析することにより、最多の空間周波数成分をもつ領域をROIに設定し、ROIの空間周波数を基準周波数fに設定できる。これにより、ROI及び基準周波数fを自動的に設定できる。加えて、基準周波数fは、原画像組における合焦面での空間周波数とすることができる。例えば、仮撮像時の画像組(原画像組)の合焦位置をコントラスト解析または仮距離値測定によって算出し、合焦位置の領域をROIに設定する。合焦位置の領域の空間周波数を基準周波数fに設定することにより、ROI及び基準周波数fを自動的に設定できる。さらに、基準周波数fは、原画像組における最も高い空間周波数とすることができる。例えば、仮撮像によって得られた画像を周波数解析することにより、最も高い空間周波数成分をもつ領域をROIに設定する。当該領域の空間周波数を基準周波数fに設定することにより、ROI及び基準周波数fを自動的に設定できる。   The reference frequency f can be the largest number of components in the spatial frequency distribution in the original image set. For example, by analyzing the frequency of an image group (original image group) obtained by provisional imaging, the region having the most spatial frequency components can be set as the ROI, and the spatial frequency of the ROI can be set as the reference frequency f. Thereby, the ROI and the reference frequency f can be automatically set. In addition, the reference frequency f can be a spatial frequency on the focal plane in the original image set. For example, the in-focus position of the image set (original image set) at the time of provisional imaging is calculated by contrast analysis or provisional distance value measurement, and the in-focus position area is set to ROI. The ROI and the reference frequency f can be automatically set by setting the spatial frequency in the focus position area to the reference frequency f. Furthermore, the reference frequency f can be the highest spatial frequency in the original image set. For example, the region having the highest spatial frequency component is set as the ROI by performing frequency analysis on an image obtained by provisional imaging. By setting the spatial frequency of the region to the reference frequency f, the ROI and the reference frequency f can be automatically set.

第2実施形態に係る測定条件を満たすように、ロボット2000は、ユーザに対し投影条件及び撮像条件等の設定のアシストを行うユーザインタフェースを備えていてもよい。このユーザインタフェースにより、操作を容易にすることができる。図14は、ROIを設定するためのユーザインタフェースの一例を示す。ロボット2000は、撮像した画像を表示するタッチパネルである表示素子1401を備える。この表示素子1401上にて、ユーザが測定範囲1402に触れることによりROIを設定する。このとき、表示素子1401は、事前に設定した測定速度または間引きする画素数に対応する倍率に対し、上記式(4)を満たす空間周波数の投影パターンをグリッド1403として表示する。この表示をもとにユーザは、投影装置によるパターン形状(投影パターン)、又は投影若しくは撮像の光学条件を変更する。   In order to satisfy the measurement conditions according to the second embodiment, the robot 2000 may include a user interface that assists the user in setting projection conditions, imaging conditions, and the like. This user interface can facilitate the operation. FIG. 14 shows an example of a user interface for setting the ROI. The robot 2000 includes a display element 1401 that is a touch panel that displays a captured image. On the display element 1401, the user touches the measurement range 1402 to set the ROI. At this time, the display element 1401 displays, as a grid 1403, a projection pattern having a spatial frequency that satisfies the above formula (4) with respect to a magnification corresponding to a preset measurement speed or the number of pixels to be thinned out. Based on this display, the user changes the pattern shape (projection pattern) by the projection apparatus or the optical conditions for projection or imaging.

(第3実施形態)
(高精度モード)
続いて、第3実施形態に係る撮像装置が搭載する高精度モードを説明する。縮小画像を生成する倍率を設定するうえで、最も面内分解能が高い縮小画像が作成されるのは、間引きする画素数a=2のときである。このとき、倍率M=1/aは、最大の0.5となる。第3実施形態に係る撮像装置は、倍率Mを最も大きい値とする高精度モードを搭載している。この2画素おきでサンプリングした場合の倍率Mは、撮像素子によって、すなわち撮像素子の画素間隔によって決まるナイキスト周波数f_nyqに一致する。
(Third embodiment)
(High accuracy mode)
Subsequently, a high-accuracy mode mounted on the imaging apparatus according to the third embodiment will be described. In setting the magnification for generating the reduced image, the reduced image with the highest in-plane resolution is created when the number of pixels to be thinned out a = 2. At this time, the magnification M = 1 / a is 0.5 at the maximum. The imaging apparatus according to the third embodiment is equipped with a high accuracy mode in which the magnification M is the largest value. The magnification M when sampling is performed every two pixels coincides with the Nyquist frequency f_nyq determined by the image sensor, that is, the pixel interval of the image sensor.

従って、第3実施形態の高精度モードにおいては、倍率M=f_nyqを満たしたうえで、基準周波数fが上記式(3)を満たす。つまり、高精度モードとしてサンプリング画素を2画素おきに設定する場合、式(5)を満たすように、取得した原画像組上での基準周波数fを設定する。例えば、式(5)を満たすように、パターン撮像部の投影条件若しくは撮像条件を設定する。   Therefore, in the high accuracy mode of the third embodiment, the reference frequency f satisfies the above formula (3) after satisfying the magnification M = f_nyq. That is, when the sampling pixels are set every two pixels as the high accuracy mode, the reference frequency f on the acquired original image set is set so as to satisfy the equation (5). For example, the projection condition or the imaging condition of the pattern imaging unit is set so as to satisfy Expression (5).

(1/3)*f_nyq ≧ f ≧ (1/5)*f_nyq …(5)
このように基準周波数fを設定することにより、最も高精度な縮小画像でも(サンプリング画素を2画素おきに設定した場合でも)、原画像組の互いの信号形状が劣化することを抑制できる。これにより、高精度で視差マップを算出でき、ひいては高精度で測距できる。
(1/3) * f_nyq ≧ f ≧ (1/5) * f_nyq (5)
By setting the reference frequency f in this way, it is possible to suppress deterioration of the signal shape of the original image set even in the most accurate reduced image (even when sampling pixels are set every two pixels). As a result, the parallax map can be calculated with high accuracy, and thus the distance can be measured with high accuracy.

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

100 取得手段
102 測定対象
1040 縮小手段
1042 算出手段
DESCRIPTION OF SYMBOLS 100 Acquisition means 102 Measuring object 1040 Reduction means 1042 Calculation means

Claims (13)

パターン光が投影された測定対象を撮像して、視差を有する原画像組を取得する取得手段と、
前記原画像組を縮小する縮小手段と、
前記縮小手段から得られる画像組から、各領域で所定の探索範囲及び探索ウィンドウをもって前記画像組の各領域に対応する視差量の分布である視差マップを算出する算出手段と、を備え、
所定のデータ数を有する視差マップを得るために、前記算出手段は、前記縮小手段から得られる最も倍率の小さい画像組を用いて算出される視差マップの階層を最下層として、複数の階層においてそれぞれ視差マップを算出し、各階層の視差マップを算出する際の前記所定の探索範囲は、1階層下の視差マップに基づいて決定されることを特徴とする、視差算出装置。
An acquisition unit that captures an image of a measurement target onto which pattern light is projected and acquires an original image set having parallax;
Reduction means for reducing the original image set;
Calculating means for calculating a disparity map that is a distribution of the amount of disparity corresponding to each area of the image set with a predetermined search range and search window in each area from the image set obtained from the reducing means;
In order to obtain a parallax map having a predetermined number of data, the calculation means sets the parallax map hierarchy calculated using the image set with the smallest magnification obtained from the reduction means as the lowest hierarchy, The parallax calculation device, wherein the predetermined search range when calculating the parallax map of each hierarchy is determined based on the parallax map of one hierarchy below.
前記縮小手段が前記原画像組を縮小する際に前記最下層の視差マップを得るための倍率である倍率mと、前記測定対象に投影された前記パターン光の前記原画像組上での基準周波数fとが、所定の条件を満たすことを特徴とする、請求項1に記載の視差算出装置。   A magnification m, which is a magnification for obtaining the lowermost parallax map when the reduction means reduces the original image set, and a reference frequency on the original image set of the pattern light projected on the measurement object The parallax calculation apparatus according to claim 1, wherein f satisfies a predetermined condition. 前記倍率mと、前記基準周波数fとの関係が、以下の条件
5f ≧ m ≧ 3f
を満たすことを特徴とする、請求項2に記載の視差算出装置。
The relationship between the magnification m and the reference frequency f is as follows: 5f ≧ m ≧ 3f
The parallax calculation device according to claim 2, wherein:
前記条件を満たすように、前記倍率mを設定することを特徴とする、請求項2または3に記載の視差算出装置。   The parallax calculation apparatus according to claim 2, wherein the magnification m is set so as to satisfy the condition. 前記条件を満たすように、前記パターン光の投影パターンまたは前記取得手段による撮像条件が設定されることを特徴とする、請求項2乃至4のいずれか1項に記載の視差算出装置。   5. The parallax calculation device according to claim 2, wherein a projection pattern of the pattern light or an imaging condition by the acquisition unit is set so as to satisfy the condition. 6. 前記基準周波数fは、前記原画像組における空間周波数の分布における最多の成分であることを特徴とする、請求項2乃至4のいずれか1項に記載の視差算出装置。   5. The parallax calculation apparatus according to claim 2, wherein the reference frequency f is a maximum number of components in a spatial frequency distribution in the original image set. 6. 前記基準周波数fは、前記原画像組における合焦面での空間周波数であることを特徴とする、請求項2乃至4のいずれか1項に記載の視差算出装置。   5. The parallax calculation device according to claim 2, wherein the reference frequency f is a spatial frequency on a focal plane in the original image set. 前記基準周波数fは、前記原画像組における最も高い空間周波数であることを特徴とする、請求項2乃至4のいずれか1項に記載の視差算出装置。   The parallax calculation device according to any one of claims 2 to 4, wherein the reference frequency f is a highest spatial frequency in the original image set. 前記測定対象に対応するの撮像画像における注目領域を設定することにより、前記算出手段により所定の速度で視差マップを算出する、速度設定モードを搭載したことを特徴とする、請求項1乃至8のいずれか1項に記載の視差算出装置。   9. A speed setting mode in which a parallax map is calculated at a predetermined speed by the calculating means by setting a region of interest in a captured image corresponding to the measurement object is mounted. The disparity calculating apparatus according to any one of the above. 前記縮小手段が前記原画像組を縮小する際の倍率を最も大きい値とする高精度モードを搭載し、撮像素子によって決まるナイキスト周波数f_nyqに対し、前記倍率と、前記測定対象に投影された前記パターン光の前記原画像組上での基準周波数fが、以下の条件
(1/3)*f_nyq ≧ f ≧ (1/5)*f_nyq
を満たすように、前記取得手段及び前記算出手段の少なくとも一方の条件を設定することを特徴とする、請求項1乃至9のいずれか1項に記載の視差算出装置。
A high-accuracy mode in which the reduction means reduces the original image set with the largest magnification is mounted, and with respect to the Nyquist frequency f_nyq determined by the image sensor, the magnification and the pattern projected onto the measurement target The reference frequency f of the light on the original image set satisfies the following condition (1/3) * f_nyq ≧ f ≧ (1/5) * f_nyq
The parallax calculation device according to claim 1, wherein at least one condition of the acquisition unit and the calculation unit is set so as to satisfy the above.
パターン光が投影された測定対象を撮像して、視差を有する原画像組を取得する取得手段と、前記原画像組を縮小する縮小手段と、前記縮小手段から得られる画像組から、各領域で所定の探索範囲及び探索ウィンドウをもって前記画像組の各領域に対応する視差量の分布である視差マップを算出する算出手段と、を備える視差算出装置を用いた視差算出方法であって、
所定のデータ数を有する視差マップを得るために、前記算出手段は、前記縮小手段から得られる最も倍率の小さい画像組を用いて算出される視差マップの階層を最下層として、複数の階層においてそれぞれ視差マップを算出するステップを有し、
各階層ので視差マップを算出する際の前記所定の探索範囲は、1階層下の視差マップに基づいて決定されることを特徴とする、視差算出方法。
From the acquisition unit that captures the measurement target on which the pattern light is projected and acquire the parallax original image set, the reduction unit that reduces the original image set, and the image set obtained from the reduction unit, in each region A parallax calculation method using a parallax calculation device comprising: a parallax map that calculates a parallax map corresponding to each area of the image set with a predetermined search range and search window;
In order to obtain a parallax map having a predetermined number of data, the calculation means sets the parallax map hierarchy calculated using the image set with the smallest magnification obtained from the reduction means as the lowest hierarchy, Calculating a parallax map;
The parallax calculation method, wherein the predetermined search range when calculating a parallax map for each layer is determined based on a parallax map one layer below.
パターン光が投影された測定対象を撮像して、視差を有する原画像組を取得する取得手段と、前記原画像組を縮小する縮小手段と、前記縮小手段から得られる画像組から、各領域で所定の探索範囲及び探索ウィンドウをもって前記画像組の各領域に対応する視差量の分布である視差マップを算出する算出手段と、を備える視差算出装置の制御プログラムであって、
所定のデータ数を有する視差マップを得るために、前記算出手段に、前記縮小手段から得られる最も倍率の小さい画像組を用いて算出される視差マップの階層を最下層として、複数の階層においてそれぞれ視差マップを算出するステップを実行させ、
各階層で視差マップを算出する際の前記所定の探索範囲は、1階層下の視差マップに基づいて決定されることを特徴とする、視差算出装置の制御プログラム。
From the acquisition unit that captures the measurement target on which the pattern light is projected and acquire the parallax original image set, the reduction unit that reduces the original image set, and the image set obtained from the reduction unit, in each region A control program for a parallax calculation device comprising: a calculation unit that calculates a parallax map that is a distribution of a parallax amount corresponding to each region of the image set with a predetermined search range and a search window;
In order to obtain a parallax map having a predetermined number of data, the calculation means uses a parallax map hierarchy calculated using the image set with the smallest magnification obtained from the reduction means as the lowest layer, and each of the plurality of hierarchies Performing a step of calculating a parallax map;
The control program for a parallax calculation device, wherein the predetermined search range when calculating a parallax map in each hierarchy is determined based on a parallax map one hierarchy below.
請求項12に記載のプログラムを記憶したことを特徴とするコンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 12.
JP2019052735A 2018-03-30 2019-03-20 Parallax calculation device, parallax calculation method, and control program for the parallax calculation device Active JP7344660B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/364,752 US11037316B2 (en) 2018-03-30 2019-03-26 Parallax calculation apparatus, parallax calculation method, and control program of parallax calculation apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018067512 2018-03-30
JP2018067512 2018-03-30

Publications (3)

Publication Number Publication Date
JP2019184587A true JP2019184587A (en) 2019-10-24
JP2019184587A5 JP2019184587A5 (en) 2022-03-31
JP7344660B2 JP7344660B2 (en) 2023-09-14

Family

ID=68340085

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019052735A Active JP7344660B2 (en) 2018-03-30 2019-03-20 Parallax calculation device, parallax calculation method, and control program for the parallax calculation device

Country Status (1)

Country Link
JP (1) JP7344660B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210076853A (en) * 2019-12-13 2021-06-24 넥스트브이피유 (상하이) 코포레이트 리미티드 Disparity estimation system and method, electronic device, and computer-readable storage medium
JP2021143960A (en) * 2020-03-12 2021-09-24 オムロン株式会社 Inspection device and inspection method
JP7449096B2 (en) 2020-01-10 2024-03-13 株式会社野村総合研究所 order management device

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07103734A (en) * 1993-10-01 1995-04-18 Sharp Corp Apparatus for searching stereocorrespondence
JPH1031742A (en) * 1996-07-15 1998-02-03 Mitsubishi Electric Corp Image processor and object transfer device
JP2003187261A (en) * 2001-12-14 2003-07-04 Canon Inc Device and method for generating three-dimensional image, three-dimensional image processing apparatus, three-dimensional image photographing display system, three-dimensional image processing method and storage medium
JP2004184240A (en) * 2002-12-03 2004-07-02 Topcon Corp Image profiling apparatus, image-measuring method and image processing apparatus
US20040222987A1 (en) * 2003-05-08 2004-11-11 Chang Nelson Liang An Multiframe image processing
JP2005292017A (en) * 2004-04-02 2005-10-20 Dainippon Screen Mfg Co Ltd Apparatus for acquiring amount of position deviation, and defect detector
JP2007213353A (en) * 2006-02-09 2007-08-23 Honda Motor Co Ltd Apparatus for detecting three-dimensional object
JP2008082707A (en) * 2006-09-25 2008-04-10 Topcon Corp Survey method, survey system, and survey data processing program
WO2012137511A1 (en) * 2011-04-07 2012-10-11 パナソニック株式会社 Image processing apparatus and image processing method
JP2015137933A (en) * 2014-01-22 2015-07-30 富士通株式会社 Distance metering device, distance metering method and distance metering program
JP2015173430A (en) * 2014-02-18 2015-10-01 パナソニック インテレクチュアル プロパティ コーポレーション オブアメリカPanasonic Intellectual Property Corporation of America Projection system, semiconductor integrated circuit and image correction method
JP2016024052A (en) * 2014-07-18 2016-02-08 国立大学法人 鹿児島大学 Three-dimensional measurement system, three-dimensional measurement method and program
JP2016514867A (en) * 2013-03-18 2016-05-23 フォトネーション リミテッド Method and apparatus for motion estimation
JP2016095808A (en) * 2014-11-17 2016-05-26 キヤノン株式会社 Object detection device, object detection method, image recognition device and computer program
JP2017027101A (en) * 2015-07-15 2017-02-02 凸版印刷株式会社 Depth map generation device, depth map generation method, and program

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07103734A (en) * 1993-10-01 1995-04-18 Sharp Corp Apparatus for searching stereocorrespondence
JPH1031742A (en) * 1996-07-15 1998-02-03 Mitsubishi Electric Corp Image processor and object transfer device
JP2003187261A (en) * 2001-12-14 2003-07-04 Canon Inc Device and method for generating three-dimensional image, three-dimensional image processing apparatus, three-dimensional image photographing display system, three-dimensional image processing method and storage medium
JP2004184240A (en) * 2002-12-03 2004-07-02 Topcon Corp Image profiling apparatus, image-measuring method and image processing apparatus
US20040222987A1 (en) * 2003-05-08 2004-11-11 Chang Nelson Liang An Multiframe image processing
JP2005292017A (en) * 2004-04-02 2005-10-20 Dainippon Screen Mfg Co Ltd Apparatus for acquiring amount of position deviation, and defect detector
JP2007213353A (en) * 2006-02-09 2007-08-23 Honda Motor Co Ltd Apparatus for detecting three-dimensional object
JP2008082707A (en) * 2006-09-25 2008-04-10 Topcon Corp Survey method, survey system, and survey data processing program
WO2012137511A1 (en) * 2011-04-07 2012-10-11 パナソニック株式会社 Image processing apparatus and image processing method
JP2016514867A (en) * 2013-03-18 2016-05-23 フォトネーション リミテッド Method and apparatus for motion estimation
JP2015137933A (en) * 2014-01-22 2015-07-30 富士通株式会社 Distance metering device, distance metering method and distance metering program
JP2015173430A (en) * 2014-02-18 2015-10-01 パナソニック インテレクチュアル プロパティ コーポレーション オブアメリカPanasonic Intellectual Property Corporation of America Projection system, semiconductor integrated circuit and image correction method
JP2016024052A (en) * 2014-07-18 2016-02-08 国立大学法人 鹿児島大学 Three-dimensional measurement system, three-dimensional measurement method and program
JP2016095808A (en) * 2014-11-17 2016-05-26 キヤノン株式会社 Object detection device, object detection method, image recognition device and computer program
JP2017027101A (en) * 2015-07-15 2017-02-02 凸版印刷株式会社 Depth map generation device, depth map generation method, and program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210076853A (en) * 2019-12-13 2021-06-24 넥스트브이피유 (상하이) 코포레이트 리미티드 Disparity estimation system and method, electronic device, and computer-readable storage medium
KR102289239B1 (en) 2019-12-13 2021-08-12 넥스트브이피유 (상하이) 코포레이트 리미티드 Disparity estimation system and method, electronic device, and computer-readable storage medium
US11158077B2 (en) 2019-12-13 2021-10-26 NextVPU (Shanghai) Co., Ltd. Disparity estimation
JP7449096B2 (en) 2020-01-10 2024-03-13 株式会社野村総合研究所 order management device
JP2021143960A (en) * 2020-03-12 2021-09-24 オムロン株式会社 Inspection device and inspection method
JP7452121B2 (en) 2020-03-12 2024-03-19 オムロン株式会社 Inspection equipment and inspection method

Also Published As

Publication number Publication date
JP7344660B2 (en) 2023-09-14

Similar Documents

Publication Publication Date Title
US8199335B2 (en) Three-dimensional shape measuring apparatus, three-dimensional shape measuring method, three-dimensional shape measuring program, and recording medium
EP3531066A1 (en) Three-dimensional scanning method including a plurality of lasers with different wavelengths, and scanner
CN107113370B (en) Image recording apparatus and method of recording image
JP7344660B2 (en) Parallax calculation device, parallax calculation method, and control program for the parallax calculation device
TWI567364B (en) Structured light generating apparatus, measuring system and method thereof
US10832052B2 (en) IR illumination module for MEMS-based eye tracking
US9131219B2 (en) Method and apparatus for triangulation-based 3D optical profilometry
KR101824328B1 (en) 3-D scanner and the scanning method using the chromatic aberration
US11803982B2 (en) Image processing device and three-dimensional measuring system
US10838489B2 (en) IR illumination module for MEMS-based eye tracking
JP2016024052A (en) Three-dimensional measurement system, three-dimensional measurement method and program
JP2009025189A (en) Measuring instrument
US11954766B2 (en) Method for carrying out a shading correction and optical observation device system
JP7005175B2 (en) Distance measuring device, distance measuring method and imaging device
US11624906B2 (en) IR illumination module for MEMS-based eye tracking
JP2017134561A (en) Image processing device, imaging apparatus and image processing program
JPWO2020183710A1 (en) Image processing equipment and 3D measurement system
JP2017138199A (en) Image processing device, imaging device, and image processing method
TWI598565B (en) Method of measuring thickness of thin film
US11037316B2 (en) Parallax calculation apparatus, parallax calculation method, and control program of parallax calculation apparatus
JP2009236696A (en) Three-dimensional image measurement method, measurement system, and measurement program for subject
JP7118776B2 (en) IMAGING DEVICE, IMAGE PROCESSING METHOD, IMAGE PROCESSING PROGRAM AND RECORDING MEDIUM
US20170270688A1 (en) Positional shift amount calculation apparatus and imaging apparatus
US20190301855A1 (en) Parallax detection device, distance detection device, robot device, parallax detection method, and distance detection method
JP7213686B2 (en) Shape measuring device, control method and 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

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220322

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220322

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230120

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230307

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230526

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230721

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230904

R151 Written notification of patent or utility model registration

Ref document number: 7344660

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151