JP2020170390A - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP2020170390A
JP2020170390A JP2019072017A JP2019072017A JP2020170390A JP 2020170390 A JP2020170390 A JP 2020170390A JP 2019072017 A JP2019072017 A JP 2019072017A JP 2019072017 A JP2019072017 A JP 2019072017A JP 2020170390 A JP2020170390 A JP 2020170390A
Authority
JP
Japan
Prior art keywords
parallax
search range
image
pixels
region
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
JP2019072017A
Other languages
Japanese (ja)
Other versions
JP7334051B2 (en
Inventor
壮 石過
Takeshi Ishika
壮 石過
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.)
Toshiba Development and Engineering Corp
Original Assignee
Toshiba Development and Engineering Corp
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 Toshiba Development and Engineering Corp filed Critical Toshiba Development and Engineering Corp
Priority to JP2019072017A priority Critical patent/JP7334051B2/en
Publication of JP2020170390A publication Critical patent/JP2020170390A/en
Application granted granted Critical
Publication of JP7334051B2 publication Critical patent/JP7334051B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

To efficiently perform matching between stereo camera images.SOLUTION: According to one aspect of the present invention, an image processing device includes an acquisition unit, a search unit, and an identification unit. The acquisition unit acquires a first image in which an object is photographed by a first camera and a second image in which the object is photographed by a second camera. The search unit identifies the parallax of pixels in the first image with respect to corresponding pixels in the second image in descending order from a predetermined upper limit value, and searches for an area including the pixels for which the parallax has been identified, in which the area of the identification completed pixels exceeds a threshold. The identification unit sets a search range including the area, and identifies the parallax of the pixels in the search range.SELECTED DRAWING: Figure 2

Description

本発明は、被写体に対する3D計測のための画像処理技術に関する。 The present invention relates to an image processing technique for 3D measurement of a subject.

従来、例えばピッキング、パッキングなどを行うロボットハンドを制御するために、対象物を撮影したステレオカメラ画像間でマッチングが行われ、当該対象物の3D形状が推定される。さらに、予め用意されている対象物の3Dモデルとのマッチングにより、撮影された対象物がどのような位置でどのような姿勢を取っているかが推定される。そして、かかるロボットハンドは、ピッキング、パッキングなどのアクションを対象物の推定位置姿勢に応じて行うように制御される。 Conventionally, in order to control a robot hand that performs picking, packing, or the like, matching is performed between stereo camera images of an object, and the 3D shape of the object is estimated. Further, by matching with a 3D model of the object prepared in advance, it is estimated what kind of position and what posture the photographed object is taking. Then, the robot hand is controlled so as to perform actions such as picking and packing according to the estimated position and posture of the object.

特許文献1には、距離センサを用いて取得した粗い距離情報に基づいて複数のフォーカス位置で複数回の撮像を行い、これらの画像を合成することにより全焦点画像を得て、高低差のある被写体を精密に計測することが提案されている。 In Patent Document 1, a omnifocal image is obtained by performing multiple imaging at a plurality of focus positions based on the coarse distance information acquired by using a distance sensor and synthesizing these images, and there is a height difference. It has been proposed to measure the subject precisely.

特開2016−020891号公報JP-A-2016-020891

前述のステレオカメラ画像間のマッチングは、通常はカメラの視野全体に亘って行われる。同様に、対象物の位置姿勢を推定するための3Dモデルとのマッチングも、通常はカメラの視野全体に亘って行われる。これらの計算量はステレオカメラ画像の画素数に依存して増大するが、マッチングの精度を確保する観点からすると画像の解像度を不用意に下げることは好ましくない。さらに、多数の対象物が存在する場合には、1つの対象物に対するアクションが終わる度にこれらの処理を再度行う必要があるので、当該処理に関わる計算量が大きいことによる悪影響はより深刻となる。例えば、大量に山積みされた部品をピックアップするなどの作業の高速化が困難となり得る。 The matching between the stereo camera images described above is usually performed over the entire field of view of the camera. Similarly, matching with a 3D model for estimating the position and orientation of an object is usually performed over the entire field of view of the camera. These calculations increase depending on the number of pixels of the stereo camera image, but it is not preferable to carelessly reduce the resolution of the image from the viewpoint of ensuring the accuracy of matching. Further, when a large number of objects exist, it is necessary to perform these processes again every time the action for one object is completed, so that the adverse effect due to the large amount of calculation related to the process becomes more serious. .. For example, it may be difficult to speed up work such as picking up a large number of piled parts.

特許文献1に記載の技法は、マッチングの精度向上に寄与する可能性はあるものの、マッチングに関する計算量そのものは変わらない。 Although the technique described in Patent Document 1 may contribute to improving the accuracy of matching, the amount of calculation itself related to matching does not change.

本発明は、ステレオカメラ画像間のマッチングを効率的に行うことを目的とする。 An object of the present invention is to efficiently perform matching between stereo camera images.

本発明の一態様によれば、画像処理装置は、取得部と、探索部と、同定部とを含む。取得部は、第1のカメラによって対象物を撮影した第1の画像と第2のカメラによって対象物を撮影した第2の画像とを取得する。探索部は、第1の画像内の画素の第2の画像内の対応する画素に対する視差を予め定められた上限値から降順に同定し、視差の同定済みである画素を含み、かつ視差の同定済みである画素の面積が閾値を超える第1の領域を探索する。同定部は、第1の領域を包含する探索範囲を設定し、前記探索範囲内の画素の視差を同定する。 According to one aspect of the present invention, the image processing apparatus includes an acquisition unit, a search unit, and an identification unit. The acquisition unit acquires a first image in which the object is photographed by the first camera and a second image in which the object is photographed by the second camera. The search unit identifies the parallax of the pixels in the first image with respect to the corresponding pixels in the second image in descending order from a predetermined upper limit value, includes the pixels for which the parallax has been identified, and identifies the parallax. The first region where the area of the completed pixel exceeds the threshold is searched. The identification unit sets a search range including the first region, and identifies the parallax of the pixels in the search range.

本発明によれば、ステレオカメラ画像間のマッチングを効率的に行うことができる。 According to the present invention, matching between stereo camera images can be performed efficiently.

第1の実施形態に係る画像処理装置を含む3D計測システムを例示する図。The figure which illustrates the 3D measurement system including the image processing apparatus which concerns on 1st Embodiment. 第1の実施形態に係る画像処理装置を例示するブロック図。The block diagram which illustrates the image processing apparatus which concerns on 1st Embodiment. 図2の画像処理装置によって行われる被写体領域の探索処理の説明図。It is explanatory drawing of the search process of the subject area performed by the image processing apparatus of FIG. 図3の例において視差が25画素の場合の累積結果画像を例示する図。The figure which illustrates the cumulative result image when the parallax is 25 pixels in the example of FIG. 図3の例において視差が21画素の場合の累積結果画像を例示する図。The figure which illustrates the cumulative result image when the parallax is 21 pixels in the example of FIG. 図3の例において視差が17画素の場合の累積結果画像を例示する図。The figure which illustrates the cumulative result image when the parallax is 17 pixels in the example of FIG. 図2の画像処理装置の動作を例示するフローチャート。The flowchart which illustrates the operation of the image processing apparatus of FIG. 図7のステップS210の詳細を例示するフローチャート。The flowchart which illustrates the detail of step S210 of FIG. 図7のステップS220の詳細を例示するフローチャート。The flowchart which illustrates the detail of step S220 of FIG. 図2の画像処理装置によって行われる探索範囲の設定処理の説明図。The explanatory view of the search range setting process performed by the image processing apparatus of FIG. 第2の実施形態に係る画像処理装置を例示するブロック図。The block diagram which illustrates the image processing apparatus which concerns on 2nd Embodiment. 図11の画像処理装置によって行われる被写体領域の探索処理の説明図。FIG. 5 is an explanatory diagram of a subject area search process performed by the image processing apparatus of FIG. 図12の例において視差が20画素の場合の累積結果画像を例示する図。The figure which illustrates the cumulative result image when the parallax is 20 pixels in the example of FIG. 図12の例において視差が16画素の場合の累積結果画像を例示する図。The figure which illustrates the cumulative result image when the parallax is 16 pixels in the example of FIG. 図12の例において視差が12画素の場合の累積結果画像を例示する図。The figure which illustrates the cumulative result image when the parallax is 12 pixels in the example of FIG. 図11の画像処理装置の動作を例示するフローチャート。The flowchart which illustrates the operation of the image processing apparatus of FIG. 図16のステップS420の詳細を例示するフローチャート。FIG. 5 is a flowchart illustrating the details of step S420 of FIG. 図11の画像処理装置によって行われる探索範囲の設定処理の説明図。It is explanatory drawing of the setting process of the search range performed by the image processing apparatus of FIG. 対象物の3Dモデルを例示する図。The figure which illustrates the 3D model of an object.

以下、図面を参照しながら実施形態の説明を述べる。なお、以降、説明済みの要素と同一または類似の要素には同一または類似の符号を付し、重複する説明については基本的に省略する。 Hereinafter, embodiments will be described with reference to the drawings. Hereinafter, elements that are the same as or similar to the elements described will be designated by the same or similar reference numerals, and duplicate explanations will be basically omitted.

(第1の実施形態)
第1の実施形態に係る画像処理装置は、例えば図1に示す3D計測システムに組み込むことができる。この3D計測システムは、多眼カメラ10と、プロジェクタ20と、プロジェクタ/カメラ制御装置30と、本実施形態に係る画像処理装置100とを含む。
(First Embodiment)
The image processing apparatus according to the first embodiment can be incorporated into, for example, the 3D measurement system shown in FIG. This 3D measurement system includes a multi-lens camera 10, a projector 20, a projector / camera control device 30, and an image processing device 100 according to the present embodiment.

多眼カメラ10は、例えばロボットハンドに取り付けられ、被写体60が設置された台70を見下ろす形で当該被写体60を撮影することになる。ここで、被写体60は、対象物と呼ぶこともできる。対象物は、1つの物品を指していてもよいし、同種または異種の複数の物品を指していてもよい。後述する位置姿勢の推定を実現するために、各対象物と同種の物品の3Dモデルが予め用意され得る。なお、図1によれば、多眼カメラ10は2つのカメラを備えているが、3つ以上のカメラを備えていてもよい。 The multi-lens camera 10 is attached to, for example, a robot hand, and takes a picture of the subject 60 while looking down at a table 70 on which the subject 60 is installed. Here, the subject 60 can also be called an object. The object may refer to one article, or may refer to a plurality of articles of the same type or different types. In order to realize the estimation of the position and orientation described later, a 3D model of an article of the same type as each object may be prepared in advance. According to FIG. 1, the multi-lens camera 10 includes two cameras, but may include three or more cameras.

プロジェクタ/カメラ制御装置30は、多眼カメラ10およびプロジェクタ20を制御する。具体的には、プロジェクタ/カメラ制御装置30は、プロジェクタ20に、後述される3D計測を行うための既定の計測用パターンの投影を命令する。また、プロジェクタ/カメラ制御装置30は、計測用パターンが投影されている間に、多眼カメラ10に被写体60の撮影を命令する。 The projector / camera control device 30 controls the multi-eye camera 10 and the projector 20. Specifically, the projector / camera control device 30 instructs the projector 20 to project a default measurement pattern for performing 3D measurement described later. Further, the projector / camera control device 30 instructs the multi-eye camera 10 to shoot the subject 60 while the measurement pattern is projected.

プロジェクタ20は、プロジェクタ/カメラ制御装置30からの命令に従って、計測用パターンを投影する。そして、多眼カメラ10に含まれるカメラ11およびカメラ12は、プロジェクタ/カメラ制御装置30からの命令に従って撮影を行い、それぞれ撮影画像を生成する。 The projector 20 projects a measurement pattern according to a command from the projector / camera control device 30. Then, the camera 11 and the camera 12 included in the multi-lens camera 10 take a picture according to a command from the projector / camera control device 30, and each generate a shot image.

画像処理装置100は、多眼カメラ10から複数枚の撮影画像を取得し、これら画像に対して後述される種々の3D計測を行う。例えば、多眼カメラ10における視差、多眼カメラ10から被写体60までの距離、被写体60の3D形状、および被写体60の位置姿勢などを推定したりする。 The image processing device 100 acquires a plurality of captured images from the multi-lens camera 10 and performs various 3D measurements on these images, which will be described later. For example, the parallax in the multi-eye camera 10, the distance from the multi-eye camera 10 to the subject 60, the 3D shape of the subject 60, the position and orientation of the subject 60, and the like are estimated.

画像処理装置100は、入出力制御、通信制御、読み書き制御、および種々の画像処理(例えば、後述される被写体領域の探索、探索範囲の設定、3D計測、など)を行うプロセッサを含む。 The image processing device 100 includes a processor that performs input / output control, communication control, read / write control, and various image processing (for example, search for a subject area described later, setting a search range, 3D measurement, and the like).

ここで、プロセッサは、典型的にはCPU(Central Processing Unit)および/またはGPU(Graphics Processing Unit)であるが、マイコン、FPGA(Field Programmable Gate Array)、またはDSP(Digital Signal Processor)、などであってもよい。 Here, the processor is typically a CPU (Central Processing Unit) and / or a GPU (Graphics Processing Unit), but is a microcomputer, an FPGA (Field Programmable Gate Array), a DSP (Digital Signal Processor), or the like. You may.

画像処理装置100は、さらに、かかる処理を実現するためにプロセッサによって実行されるプログラムおよび当該プログラムによって使用されるデータ、例えば画像データ、被写体領域を定義するデータ、探索範囲を定義するデータ、視差データ、距離データ、デプスマップデータ、点群データ、3Dデータ、1または複数の物品の3Dモデルデータ、などを一時的に格納するメモリを含んでいる。メモリは、かかるプログラム/データが展開されるワークエリアを有するRAM(Random Access Memory)を含み得る。 Further, the image processing apparatus 100 further includes a program executed by the processor to realize such processing and data used by the program, such as image data, data defining a subject area, data defining a search range, and parallax data. , Distance data, depth map data, point group data, 3D data, 3D model data of one or more articles, and the like. The memory may include a RAM (Random Access Memory) having a work area where such programs / data are deployed.

画像処理装置100は、さらに、例えば多眼カメラ10などの外部装置に接続するためのインタフェース(I/F)を利用可能である。I/Fは、画像処理装置100に内蔵されていてもよいし、画像処理装置100に外付けされていてもよい。 The image processing device 100 can further use an interface (I / F) for connecting to an external device such as a multi-lens camera 10. The I / F may be built in the image processing device 100 or may be externally attached to the image processing device 100.

I/Fは、例えば、多眼カメラ10から画像を受け取る。I/Fは、例えば光ファイバケーブル、HDMI(登録商標)(High−Definition Multimedia Interface)ケーブル、などの有線通信I/Fであってもよいし、例えばBluetooth(登録商標)、Wi−Fi(登録商標)などの無線通信技術を利用する無線通信I/Fであってもよい。 The I / F receives an image from, for example, the multi-lens camera 10. The I / F may be a wired communication I / F such as an optical fiber cable, an HDMI® (High-Definition Multimedia Interface) cable, or the like, for example, Bluetooth®, Wi-Fi®. It may be a wireless communication I / F that uses a wireless communication technology such as (trademark).

以下、図2を用いて画像処理装置100の構成例の説明を続ける。
図2に例示されるように、画像処理装置100は、画像取得部101と、領域探索部102と、視差同定部103と、距離推定部105と、3D形状推定部106と、位置姿勢推定部107と、3Dモデル記憶部108とを含む。
Hereinafter, the description of the configuration example of the image processing apparatus 100 will be continued with reference to FIG.
As illustrated in FIG. 2, the image processing device 100 includes an image acquisition unit 101, a region search unit 102, a parallax identification unit 103, a distance estimation unit 105, a 3D shape estimation unit 106, and a position / orientation estimation unit. It includes 107 and a 3D model storage unit 108.

画像取得部101は、多眼カメラ10に含まれるカメラ11およびカメラ12から、それぞれ、当該カメラ11およびカメラ12によって被写体60(対象物)を撮影した第1の画像および第2の画像をそれぞれ取得する。画像取得部101は、取得した第1の画像および第2の画像を領域探索部102へ送る。画像取得部101は、例えば前述のプロセッサおよびI/Fに相当し得る。 The image acquisition unit 101 acquires a first image and a second image of the subject 60 (object) taken by the camera 11 and the camera 12, respectively, from the camera 11 and the camera 12 included in the multi-lens camera 10. To do. The image acquisition unit 101 sends the acquired first image and the second image to the area search unit 102. The image acquisition unit 101 may correspond to, for example, the above-mentioned processor and I / F.

領域探索部102は、画像取得部101から第1の画像および第2の画像を受け取る。領域探索部102は、被写体60(対象物)のうちカメラ11およびカメラ12からの距離が相対的に近い部分が写っている領域を、第1の画像および/または第2の画像から探索する。かかる領域は、被写体領域と呼ぶこともできる。領域探索部102は、例えば前述のプロセッサに相当し得る。 The area search unit 102 receives the first image and the second image from the image acquisition unit 101. The area search unit 102 searches for a region of the subject 60 (object) in which a portion of the subject 60 (object) that is relatively close to the camera 11 and the camera 12 is captured from the first image and / or the second image. Such an area can also be called a subject area. The area search unit 102 may correspond to, for example, the above-mentioned processor.

例えば、ロボットハンドが、大量に山積みされた対象物をその上方からピックアップするユースケースでは、ロボットハンドは、視野内にどれだけの対象物が存在しようとも、通常はその時々で最も近い、つまり最も高い位置に積まれている対象物から順にピックアップしていくことになる。故に、かかる被写体領域の周辺にマッチングの探索範囲を制限すれば、ロボットハンドの動きを害することなくマッチングに関わる計算量を大幅に削減することができる。 For example, in a use case where a robot hand picks up a large pile of objects from above, the robot hand is usually the closest, or closest, at any given time, no matter how many objects are in the field of view. Objects that are piled up in higher positions will be picked up in order. Therefore, if the matching search range is limited to the periphery of the subject area, the amount of calculation related to matching can be significantly reduced without impairing the movement of the robot hand.

具体的には、領域探索部102は、予め定められた上限値(k)から順に、第1の画像内の画素の、第2の画像内の対応する画素に対する視差を同定する。すなわち、領域探索部102は、図3に例示されるように、25画素、・・・、21画素、・・・17画素、・・・のように、対象となる値を減じながら視差の同定を行う。なお、以降の説明では、第1の画像を基準とし、第2の画像をずらしてマッチングを行っているが、これらは逆であってもよい。ここで、上限値とは、理論上の上限値、例えばエピポーラ線の長さに基づいて定められてもよいし、図1の3D計測システムの実用環境に即した値に定められてもよい。 Specifically, the region search unit 102 identifies the parallax of the pixels in the first image with respect to the corresponding pixels in the second image in order from the predetermined upper limit value (k). That is, as illustrated in FIG. 3, the area search unit 102 identifies the parallax while reducing the target values, such as 25 pixels, ..., 21 pixels, ... 17 pixels, ... I do. In the following description, the first image is used as a reference, and the second image is shifted for matching, but these may be reversed. Here, the upper limit value may be set based on a theoretical upper limit value, for example, the length of the epipolar line, or may be set to a value suitable for the practical environment of the 3D measurement system of FIG.

まず、領域探索部102は、第2の画像に含まれる各画素をエピポーラ線に沿ってk画素ずらして比較用の画像を生成し、第1の画像内の画素毎に当該比較用の画像とのブロックマッチングを行う。例えば、領域探索部102は、第1の画像に含まれる注目画素を中心とする画素ブロックと、比較用の画像において当該注目画素と同一位置にある画素を中心とする画素ブロックとのSAD(Sum of Absolute Differences)を計算する。そして、領域探索部102は、SADが閾値未満、すなわちマッチングが成功であればこの注目画素と同一位置にある画素の値を「1」、逆にSADが閾値以上、すなわちマッチングが失敗であれば当該画素の値を「0」として、視差=kの結果画像(例えば2値画像)を生成する。この結果画像に含まれる各画素の値は、第1の画像において当該画素と同一位置にある画素についての視差がkであるか否か(「1」/「0」)を意味する。領域探索部102は、この視差=kの結果画像を(最初の)累積結果画像(例えば2値画像)として保存する。 First, the area search unit 102 shifts each pixel included in the second image by k pixels along the epipolar line to generate an image for comparison, and for each pixel in the first image, the image for comparison and the image for comparison are generated. Block matching is performed. For example, the area search unit 102 includes a SAD (Sum) of a pixel block centered on a pixel of interest included in the first image and a pixel block centered on a pixel at the same position as the pixel of interest in the comparison image. of Absolute Differences) is calculated. Then, the area search unit 102 sets the value of the pixel at the same position as the pixel of interest to "1" if the SAD is less than the threshold value, that is, if the matching is successful, and conversely, if the SAD is equal to or more than the threshold value, that is, if the matching fails. The value of the pixel is set to "0", and a result image (for example, a binary image) with parallax = k is generated. The value of each pixel included in the resulting image means whether or not the parallax of the pixel at the same position as the pixel in the first image is k (“1” / “0”). The area search unit 102 saves the result image of parallax = k as a (first) cumulative result image (for example, a binary image).

次に、領域探索部102は、より小さな視差について同定を行う。すなわち、領域探索部102は、第2の画像に含まれる各画素をエピポーラ線に沿って、k−1画素ずらして比較用の画像を生成し、第1の画像内の画素毎に当該比較用の画像とのブロックマッチングを行う。例えば、領域探索部102は、第1の画像に含まれる注目画素を中心とする画素ブロックと、比較用の画像において当該注目画素と同一位置にある画素を中心とする画素ブロックとのSADを計算する。そして、領域探索部102は、SADが閾値未満であればこの注目画素と同一位置にある画素の値を「1」、逆にSADが閾値以上であれば当該画素の値を「0」として、視差=k−1の結果画像を生成する。この結果画像に含まれる各画素の値は、第1の画像において当該画素と同一位置にある画素についての視差がk−1であるか否か(「1」/「0」)を意味する。領域探索部102は、累積結果画像にこの視差=k−1の結果画像を加算して更新する。この累積結果画像に含まれる各画素の値は、第1の画像において当該画素と同一位置にある画素についての視差がk−1以上であるか否か、換言すれば視差が同定済みであるか否か(「1」/「0」)を意味する。 Next, the region search unit 102 identifies the smaller parallax. That is, the area search unit 102 shifts each pixel included in the second image by k-1 pixels along the epipolar line to generate an image for comparison, and for each pixel in the first image, the comparison is made. Block matching with the image of. For example, the area search unit 102 calculates the SAD of the pixel block centered on the pixel of interest included in the first image and the pixel block centered on the pixel at the same position as the pixel of interest in the comparison image. To do. Then, the area search unit 102 sets the value of the pixel at the same position as the pixel of interest to be "1" if the SAD is less than the threshold value, and conversely sets the value of the pixel to "0" if the SAD is equal to or more than the threshold value. A result image with parallax = k-1 is generated. The value of each pixel included in the resulting image means whether or not the parallax of the pixel at the same position as the pixel in the first image is k-1 (“1” / “0”). The area search unit 102 updates the cumulative result image by adding the result image of parallax = k-1. The value of each pixel included in this cumulative result image is whether or not the parallax for the pixel at the same position as the pixel in the first image is k-1 or more, in other words, whether the parallax has been identified. It means whether or not ("1" / "0").

このように、領域探索部102は、必要に応じてk−2,k−3,・・・と順に減じながら視差の同定を行い、累積結果画像を更新する。この結果、視差=iの結果画像を加算して更新された累積結果画像に含まれる各画素の値は、第1の画像において当該画素と同一位置にある画素についての視差がi以上であるか否か、換言すれば視差が同定済みであるか否か(「1」/「0」)を意味する。このように、累積結果画像において、「1」の値を持つ画素は段々と増えていくことになる。一例として、図4は視差=25画素の場合の累積結果画像、図5は視差=21の場合の累積結果画像、および図6は視差=17画素の場合の累積結果画像をそれぞれ示す。各図において、「1」の値を持つ画素は黒、「0」の値を持つ画素は白でそれぞれ描かれている。 In this way, the region search unit 102 identifies the parallax while decreasing the number in the order of k-2, k-3, ..., As necessary, and updates the cumulative result image. As a result, the value of each pixel included in the cumulative result image updated by adding the result image of parallax = i is whether the parallax of the pixel at the same position as the pixel in the first image is i or more. Whether or not, in other words, whether or not the parallax has been identified (“1” / “0”). In this way, the number of pixels having a value of "1" in the cumulative result image gradually increases. As an example, FIG. 4 shows a cumulative result image when the parallax = 25 pixels, FIG. 5 shows a cumulative result image when the parallax = 21, and FIG. 6 shows a cumulative result image when the parallax = 17 pixels. In each figure, the pixel having the value of "1" is drawn in black, and the pixel having the value of "0" is drawn in white.

領域探索部102は、累積結果画像が保存され、または更新される毎に、当該累積結果画像において「1」の値を持つ画素を含み、かつ「1」の値を持つ画素の面積が閾値を超える領域(被写体領域)を探索する。ここで、かかる領域は、「1」の値を持つ画素が連続する領域であってもよいし、例えばある画素を基準とした所定形状、例えばN画素*N画素の矩形、の領域であってもよい。また、連続とは、「1」の値を持つ画素が少なくとも水平または垂直方向に隣接している場合を指すが、斜め方向に隣接している場合もさらに指すことがあり得る。また、隣接とは、「1」の値を持つ画素が少なくとも「0」の値を持つ画素によって隔てられることなく並んでいる場合を指すが、「1」の値を持つ画素が1つまたはそれ以上の「1」の値を持つ画素によって隔てられる場合もさらに指すことがあり得る。例えば、水平または垂直方向に、「1」、「1」、「0」、「1」、「1」の順に画素が並んでいた場合に、これら5つの画素は連続すると解されてもよいし、連続しないと解されてもよい。領域探索部102は、かかる被写体領域が探索された場合には、当該領域を定義するデータを生成し、これを第1の画像および第2の画像と共に視差同定部103へ送る。 Each time the cumulative result image is saved or updated, the area search unit 102 includes a pixel having a value of "1" in the cumulative result image, and the area of the pixel having a value of "1" sets a threshold value. Search for an area that exceeds (subject area). Here, such a region may be a region in which pixels having a value of "1" are continuous, or is, for example, a region having a predetermined shape based on a certain pixel, for example, a rectangle of N pixels * N pixels. May be good. Further, the term “continuous” refers to a case where pixels having a value of “1” are adjacent to each other at least in the horizontal or vertical direction, but may further refer to a case where the pixels are adjacent in the diagonal direction. Further, "adjacent" refers to a case where pixels having a value of "1" are lined up without being separated by pixels having a value of "0", but there is one pixel having a value of "1" or a pixel thereof. It may be further pointed out when it is separated by the pixels having the above value of "1". For example, when the pixels are arranged in the order of "1", "1", "0", "1", and "1" in the horizontal or vertical direction, these five pixels may be understood as continuous. , May be understood as non-continuous. When the subject area is searched, the area search unit 102 generates data defining the area and sends the data together with the first image and the second image to the parallax identification unit 103.

視差同定部103は、領域探索部102から、第1の画像、第2の画像、および被写体領域を定義するデータを受け取る。視差同定部103は、被写体領域を包含する探索範囲を設定し、探索範囲内の画素の視差を同定する。視差同定部103は、探索範囲内の画素についての視差の同定結果を表す視差データを生成し、これを距離推定部105へ送る。視差データは、例えば第1の画像の各画素の座標と当該画素に関する視差ベクトルとを含み得る。また、視差同定部103は、視差データを図示されない外部装置へ送ってもよい。視差同定部103は、例えば前述のプロセッサ(およびI/F)に相当し得る。 The parallax identification unit 103 receives data defining the first image, the second image, and the subject area from the area search unit 102. The parallax identification unit 103 sets a search range including the subject area, and identifies the parallax of the pixels in the search range. The parallax identification unit 103 generates parallax data representing the parallax identification result for the pixels in the search range, and sends this to the distance estimation unit 105. The parallax data may include, for example, the coordinates of each pixel of the first image and the parallax vector for that pixel. Further, the parallax identification unit 103 may send the parallax data to an external device (not shown). The parallax identification unit 103 may correspond to, for example, the above-mentioned processor (and I / F).

視差同定部103は、領域探索部102によって同定済みである視差よりも小さな値から順に視差の同定を継続し、被写体領域の拡大とこれに伴う探索範囲の拡大(再設定)とを行ってもよい。 The parallax identification unit 103 continues to identify the parallax in order from a value smaller than the parallax identified by the area search unit 102, and even if the subject area is expanded and the search range is expanded (reset) accordingly. Good.

具体的には、視差同定部103は、領域探索部102によって探索された被写体領域を包含する探索範囲を設定する。例えば、視差同定部103は、被写体領域を包含する矩形を探索範囲としてもよいし、被写体領域の縁に沿って当該被写体よりも大きな探索範囲を設定してもよい。 Specifically, the parallax identification unit 103 sets a search range including the subject area searched by the area search unit 102. For example, the parallax identification unit 103 may set a rectangle including the subject area as the search range, or may set a search range larger than the subject along the edge of the subject area.

そして、視差同定部103は、領域探索部102によって同定済みである値(ここではmとする)よりも小さな視差について同定を行う。すなわち、視差同定部103は、第2の画像に含まれる各画素をエピポーラ線に沿ってm−1画素ずらして比較用の画像を生成し、第1の画像の探索範囲内の画素毎に当該比較用の画像とのブロックマッチングを行う。例えば、視差同定部103は、第1の画像の探索範囲に含まれる注目画素を中心とする画素ブロックと、比較用の画像において当該注目画素と同一位置にある画素を中心とする画素ブロックとのSADを計算する。そして、視差同定部103は、SADが閾値未満であればこの注目画素と同一位置にある画素の値を「1」、逆にSADが閾値以上であれば当該画素の値を「0」として、視差=m−1の結果画像を生成する。この結果画像に含まれる各画素の値は、第1の画像の探索範囲において当該画素と同一位置にある画素についての視差がm−1であるか否か(「1」/「0」)を意味する。視差同定部103は、累積結果画像にこの視差=m−1の結果画像を加算して被写体領域を更新する。この累積結果画像に含まれる各画素の値は、第1の画像の少なくとも探索範囲において当該画素と同一位置にある画素についての視差がm−1以上であるか否か、換言すれば視差が同定済みであるか否か(「1」/「0」)を意味する。 Then, the parallax identification unit 103 identifies the parallax smaller than the value (here, m) identified by the region search unit 102. That is, the parallax identification unit 103 generates an image for comparison by shifting each pixel included in the second image by m-1 pixel along the epipolar line, and corresponds to each pixel within the search range of the first image. Block matching with the image for comparison is performed. For example, the parallax identification unit 103 includes a pixel block centered on a pixel of interest included in the search range of the first image and a pixel block centered on a pixel at the same position as the pixel of interest in the comparison image. Calculate SAD. Then, the parallax identification unit 103 sets the value of the pixel at the same position as the pixel of interest to be "1" if the SAD is less than the threshold value, and conversely sets the value of the pixel to "0" if the SAD is greater than or equal to the threshold value. A result image with parallax = m-1 is generated. As a result, the value of each pixel included in the image determines whether or not the parallax of the pixel at the same position as the pixel in the search range of the first image is m-1 (“1” / “0”). means. The parallax identification unit 103 updates the subject area by adding the result image of parallax = m-1 to the cumulative result image. The value of each pixel included in this cumulative result image identifies whether or not the parallax of the pixel at the same position as the pixel in at least the search range of the first image is m-1 or more, in other words, the parallax is identified. It means whether or not it has been completed (“1” / “0”).

続いて、視差同定部103は、このように更新した被写体領域が、現在設定されている探索範囲の境界に達したか否かを判定する。被写体領域が現在設定されている探索範囲の境界に達していなければ、視差同定部103はより小さな視差の同定を行う。他方、被写体領域が探索範囲の境界に達していれば、視差同定部103は、被写体領域が探索範囲に包含されるように、探索範囲を以下に説明するように拡大して再設定することになる。 Subsequently, the parallax identification unit 103 determines whether or not the subject area updated in this way has reached the boundary of the currently set search range. If the subject area does not reach the boundary of the currently set search range, the parallax identification unit 103 identifies the smaller parallax. On the other hand, if the subject area reaches the boundary of the search range, the parallax identification unit 103 decides to expand and reset the search range as described below so that the subject area is included in the search range. Become.

具体的には、視差同定部103は、現在の累積結果画像における被写体領域を包含するように探索範囲を拡大して再設定する。ただし、前述のように、視差同定部103は、再設定前の探索範囲よりも外側の画素についてマッチングを行っていないので、実際には視差がm−1以上である被写体領域は、再設定後の探索範囲の境界にも達するおそれがある。故に、視差同定部103は、探索範囲のうち再設定により拡大した部分について前述のマッチングを視差=m−1について行って、累積結果画像を再更新する。そして、視差同定部103は、被写体領域が、現在設定されている探索範囲の境界に達したか否かを再判定する。被写体領域が探索範囲の境界に達していれば、視差同定部103は同様の処理を繰り返す必要がある。他方、被写体領域が探索範囲の境界に達していなければ、視差同定部103はより小さな視差の同定と、必要であれば探索範囲の拡大とを行うことになる。最終的に、視差の同定済みである画素を含む領域(被写体領域)のサイズが予め定められた目標値に達した場合に、視差同定部103は視差の同定を終了することになる。 Specifically, the parallax identification unit 103 expands and resets the search range so as to include the subject area in the current cumulative result image. However, as described above, since the parallax identification unit 103 does not match the pixels outside the search range before the reset, the subject area where the parallax is actually m-1 or more is actually set after the reset. It may reach the boundary of the search range of. Therefore, the parallax identification unit 103 re-updates the cumulative result image by performing the above-mentioned matching for the parallax = m-1 for the portion of the search range expanded by the resetting. Then, the parallax identification unit 103 redetermines whether or not the subject area has reached the boundary of the currently set search range. If the subject area reaches the boundary of the search range, the parallax identification unit 103 needs to repeat the same process. On the other hand, if the subject area does not reach the boundary of the search range, the parallax identification unit 103 will identify the smaller parallax and expand the search range if necessary. Finally, when the size of the region (subject region) including the pixel for which the parallax has been identified reaches a predetermined target value, the parallax identification unit 103 ends the parallax identification.

例えば、視差同定部103は、被写体領域に外接する矩形の対角線の長さが、対象物の3D形状に基づいて定められる目標値に達した場合に、視差の同定を終了し得る。ここで、対象物の3D形状は、例えば図19に示される3Dモデルとして登録され得る。3Dモデルは、対象物のCADデータに基づいて作成されてもよいし、対象物の3D撮影データに基づいて作成されてもよい。図19の3Dモデルをロボット(ハンド)が対象物を把持する方向から見たときに外接する最小の矩形の頂点をA、B、C、およびDとする。この矩形の対角線の長さADまたはBCに基づいて、かかる目標値が定められてよい。かかる対角線の長さは、頂点Aおよび頂点Dの間の三次元ユークリッド距離、または頂点Bおよび頂点Cの間の三次元ユークリッド距離として算出可能である。 For example, the parallax identification unit 103 can finish the parallax identification when the length of the diagonal line of the rectangle circumscribing the subject area reaches a target value determined based on the 3D shape of the object. Here, the 3D shape of the object can be registered as, for example, the 3D model shown in FIG. The 3D model may be created based on the CAD data of the object, or may be created based on the 3D imaging data of the object. Let A, B, C, and D be the vertices of the smallest rectangle that circumscribes the 3D model of FIG. 19 when viewed from the direction in which the robot (hand) grips the object. Such a target value may be set based on the diagonal length AD or BC of this rectangle. The length of such a diagonal can be calculated as a three-dimensional Euclidean distance between vertices A and D, or a three-dimensional Euclidean distance between vertices B and C.

視差同定部103による探索範囲の設定例を図10に示す。図10の例では、視差=k−1の時に、被写体領域の探索が済んでいる。故に、段階S1では、視差同定部103は、視差=k−1以上である被写体領域を包含するように探索範囲を設定する。 FIG. 10 shows an example of setting the search range by the parallax identification unit 103. In the example of FIG. 10, the search for the subject area is completed when the parallax = k-1. Therefore, in step S1, the parallax identification unit 103 sets the search range so as to include the subject region where the parallax = k-1 or more.

段階S2では、視差同定部103は、現在設定されている探索範囲内で視差=k−2についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲の境界(右端)に達している。 In step S2, the parallax identification unit 103 performs matching for parallax = k-2 within the currently set search range. As a result, the region having a value of "1" in the cumulative result image reaches the boundary (right end) of the currently set search range.

故に、段階S3では、視差同定部103は、探索範囲を拡大し、この拡大した部分の中で視差=k−2についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲の境界(右端)に達している。 Therefore, in step S3, the parallax identification unit 103 expands the search range and performs matching for parallax = k-2 in the expanded portion. As a result, the region having a value of "1" in the cumulative result image reaches the boundary (right end) of the currently set search range.

故に、段階S4では、視差同定部103は、探索範囲を拡大し、この拡大した部分の中で視差=k−2についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲によって包含されている。 Therefore, in step S4, the parallax identification unit 103 expands the search range and performs matching for parallax = k-2 in the expanded portion. As a result, the region having a value of "1" in the cumulative result image is included by the currently set search range.

次に、段階S5では、視差同定部103は、現在設定されている探索範囲内で視差=k−3についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲の境界(右端)に達している。 Next, in step S5, the parallax identification unit 103 performs matching for parallax = k-3 within the currently set search range. As a result, the region having a value of "1" in the cumulative result image reaches the boundary (right end) of the currently set search range.

故に、段階S6では、視差同定部103は、探索範囲を拡大し、この拡大した部分の中で視差=k−3についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲の境界(右端)に達している。 Therefore, in step S6, the parallax identification unit 103 expands the search range and performs matching for parallax = k-3 in the expanded portion. As a result, the region having a value of "1" in the cumulative result image reaches the boundary (right end) of the currently set search range.

故に、段階S7では、視差同定部103は、探索範囲を拡大し、この拡大した部分の中で視差=k−3についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲によって包含されている。 Therefore, in step S7, the parallax identification unit 103 expands the search range and performs matching for parallax = k-3 in the expanded portion. As a result, the region having a value of "1" in the cumulative result image is included by the currently set search range.

次に、段階S8では、視差同定部103は、現在設定されている探索範囲内で視差=k−4についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域のサイズは予め定められた目標値に達している。故に、視差同定部103は、視差の同定を終了する。 Next, in step S8, the parallax identification unit 103 performs matching for parallax = k-4 within the currently set search range. As a result, the size of the region having a value of "1" in the cumulative result image has reached a predetermined target value. Therefore, the parallax identification unit 103 ends the parallax identification.

距離推定部105は、視差同定部103から視差データを受け取る。距離推定部105は、視差データに基づいて、第1の画像の探索範囲内の(マッチングに成功した)画素毎に、被写体60の表面における当該画素に対応する点からカメラ11およびカメラ12までの推定距離、すなわち推定デプスを算出する。距離推定部105は、推定距離を表す距離データを3D形状推定部106へ送る。距離データは、例えば第1の画像の探索範囲内の各画素の座標と当該画素の距離(デプス)とを含み得る。また、距離推定部105は、距離データを図示されない外部装置へ送ってもよい。距離推定部105は、例えば前述のプロセッサ(およびI/F)に相当し得る。 The distance estimation unit 105 receives the parallax data from the parallax identification unit 103. Based on the parallax data, the distance estimation unit 105 extends from the point corresponding to the pixel on the surface of the subject 60 to the camera 11 and the camera 12 for each pixel (successfully matched) within the search range of the first image. Calculate the estimated distance, i.e. the estimated depth. The distance estimation unit 105 sends distance data representing the estimated distance to the 3D shape estimation unit 106. The distance data may include, for example, the coordinates of each pixel within the search range of the first image and the distance (depth) of the pixel. Further, the distance estimation unit 105 may send the distance data to an external device (not shown). The distance estimation unit 105 may correspond to, for example, the above-mentioned processor (and I / F).

3D形状推定部106は、距離推定部105から距離データを受け取る。3D形状推定部106は、距離データに基づいて、探索範囲における被写体60(対象物)の3D形状を推定する。具体的には、3D形状推定部106は、距離データを例えば画像化し、(探索範囲内の)デプスマップ(データ)を生成してもよい。デプスマップは、例えば画像データであって、各画素がその対応する距離に比例する画素値を有する。また、3D形状推定部106は、デプスマップに加えて、またはデプスマップの代わりに(探索範囲内の)被写体60の点群データを生成してもよい。点群データは、被写体60の表面の多数の点の3D位置データを含み得る。3D形状推定部106は、推定3D形状を表す3Dデータ(例えば、デプスマップおよび/または点群データ)を位置姿勢推定部107へ送る。また、3D形状推定部106は、3Dデータを図示されない外部装置へ送ってもよい。3D形状推定部106は、例えば前述のプロセッサ(およびI/F)に相当し得る。 The 3D shape estimation unit 106 receives the distance data from the distance estimation unit 105. The 3D shape estimation unit 106 estimates the 3D shape of the subject 60 (object) in the search range based on the distance data. Specifically, the 3D shape estimation unit 106 may image the distance data, for example, and generate a depth map (data) (within the search range). The depth map is, for example, image data, where each pixel has a pixel value proportional to its corresponding distance. Further, the 3D shape estimation unit 106 may generate point cloud data of the subject 60 (within the search range) in addition to the depth map or instead of the depth map. The point cloud data may include 3D position data of a large number of points on the surface of the subject 60. The 3D shape estimation unit 106 sends 3D data (for example, depth map and / or point cloud data) representing the estimated 3D shape to the position / orientation estimation unit 107. Further, the 3D shape estimation unit 106 may send 3D data to an external device (not shown). The 3D shape estimation unit 106 may correspond to, for example, the above-mentioned processor (and I / F).

位置姿勢推定部107は、3D形状推定部106から被写体60の3Dデータを受け取り、3Dモデル記憶部108から1または複数の物品の3Dモデルデータを読み出す。位置姿勢推定部107は、被写体60の3Dデータを、読み出した3Dモデルデータとマッチングし、被写体60の位置および/または姿勢を推定する。位置姿勢推定部107は、推定位置および/または推定姿勢を表す位置/姿勢データを図示されない外部装置、例えばロボットハンド(の制御装置)へ送る。位置姿勢推定部107は、例えば前述のプロセッサおよびI/Fに相当し得る。 The position / orientation estimation unit 107 receives the 3D data of the subject 60 from the 3D shape estimation unit 106, and reads out the 3D model data of one or a plurality of articles from the 3D model storage unit 108. The position / orientation estimation unit 107 matches the 3D data of the subject 60 with the read 3D model data, and estimates the position and / or posture of the subject 60. The position / orientation estimation unit 107 sends the estimated position and / or the position / attitude data representing the estimated posture to an external device (for example, a control device) (for example, a robot hand) (not shown). The position / orientation estimation unit 107 may correspond to, for example, the above-mentioned processor and I / F.

ここで、被写体60が複数種類の物品のいずれかに該当する場合には、位置姿勢推定部107は、被写体60の位置姿勢を推定するよりも前に、当該被写体60の物品認識処理を行ってもよい。すなわち、位置姿勢推定部107は、被写体60の3Dデータとマッチングされるべき物品の3Dモデルデータがいずれであるかを判定してもよい。 Here, when the subject 60 corresponds to any of a plurality of types of articles, the position / orientation estimation unit 107 performs the article recognition process of the subject 60 before estimating the position / orientation of the subject 60. May be good. That is, the position / orientation estimation unit 107 may determine which is the 3D model data of the article to be matched with the 3D data of the subject 60.

3Dモデル記憶部108は、予め用意された1または複数の物品の3Dモデルデータを保存する。3Dモデル記憶部108には、例えばピックアップなどの対象となる物品の3Dモデルデータが保存され得る。3Dモデル記憶部108に保存された3Dモデルデータは、位置姿勢推定部107によって読み出される。3Dモデル記憶部108は、例えば前述のメモリまたは補助記憶装置に相当し得る。ここで、補助記憶装置は、HDD(Hard Disk Drive)、SSD(Solid State Drive)、フラッシュメモリ、などであってよい。 The 3D model storage unit 108 stores 3D model data of one or a plurality of articles prepared in advance. The 3D model storage unit 108 can store 3D model data of a target article such as a pickup. The 3D model data stored in the 3D model storage unit 108 is read out by the position / orientation estimation unit 107. The 3D model storage unit 108 may correspond to, for example, the above-mentioned memory or auxiliary storage device. Here, the auxiliary storage device may be an HDD (Hard Disk Drive), an SSD (Solid State Drive), a flash memory, or the like.

以下、図7乃至図9を用いて、図2の画像処理装置の動作を説明する。
まず、同定済みの視差をカウントするための変数pが、予め定められた上限値(k)に初期化される(ステップS201)。
Hereinafter, the operation of the image processing apparatus of FIG. 2 will be described with reference to FIGS. 7 to 9.
First, the variable p for counting the identified parallax is initialized to a predetermined upper limit value (k) (step S201).

領域探索部102は、ステップS201において初期化された変数pを減じながら、第1の画像および第2の画像のマッチングを行い、被写体領域を探索する(ステップS210)。なお、ステップS210の具体例は、図8を用いて後述される。 The area search unit 102 searches the subject area by matching the first image and the second image while subtracting the variable p initialized in step S201 (step S210). A specific example of step S210 will be described later with reference to FIG.

視差同定部103は、被写体領域のサイズが予め定められた目標値に達するまで、ステップS210に引き続き当該変数pを減じながら探索範囲内の画素の視差を同定して被写体領域を拡大させると共に当該被写体領域を包含するように探索範囲を設定する(ステップS220)。なお、ステップS220の具体例は、図9を用いて後述される。 The parallax identification unit 103 identifies the parallax of the pixels in the search range while decreasing the variable p in the step S210 until the size of the subject area reaches a predetermined target value, expands the subject area, and expands the subject area. The search range is set so as to include the region (step S220). A specific example of step S220 will be described later with reference to FIG.

距離推定部105は、ステップS220における各画素についての視差の同定結果(視差データ)に基づいて、当該画素に対応する被写体60(対象物)の表面上の点からカメラ11およびカメラ12までの距離を推定する(ステップS245)。 The distance estimation unit 105 is the distance from the point on the surface of the subject 60 (object) corresponding to the pixel to the camera 11 and the camera 12 based on the parallax identification result (parallax data) for each pixel in step S220. Is estimated (step S245).

3D形状推定部106は、ステップS245における距離の推定結果(距離データ)に基づいて、被写体60の3D形状を推定する(ステップS246)。 The 3D shape estimation unit 106 estimates the 3D shape of the subject 60 based on the distance estimation result (distance data) in step S245 (step S246).

位置姿勢推定部107は、ステップS246における被写体60の3D形状の推定結果(被写体60の3Dデータ)を、3Dモデル記憶部108から読み出した、1または複数の物品の3Dモデルデータとマッチングし、当該被写体60の位置および/または姿勢を推定する(ステップS247)。 The position / orientation estimation unit 107 matches the 3D shape estimation result (3D data of the subject 60) of the subject 60 in step S246 with the 3D model data of one or more articles read from the 3D model storage unit 108, and the said The position and / or posture of the subject 60 is estimated (step S247).

次に、図8を用いて、ステップS210の詳細を説明する。図8の例では、処理はステップS211から開始する。
ステップS211において、領域探索部102は、視差=pについて、ブロックマッチングを行い、結果画像を生成する。具体的には、領域探索部102は、第2の画像に含まれる各画素をエピポーラ線に沿ってp画素ずらして比較用の画像を生成し、第1の画像内の画素毎に当該比較用の画像とのブロックマッチングを行う。例えば、領域探索部102は、第1の画像に含まれる注目画素を中心とする画素ブロックと、比較用の画像において当該注目画素と同一位置にある画素を中心とする画素ブロックとのSADを計算する。そして、領域探索部102は、SADが閾値未満であればこの注目画素と同一位置にある画素の値を「1」、逆にSADが閾値以上であれば当該画素の値を「0」として、視差=pの結果画像を生成し得る。
Next, the details of step S210 will be described with reference to FIG. In the example of FIG. 8, the process starts from step S211.
In step S211 the area search unit 102 performs block matching for parallax = p and generates a result image. Specifically, the area search unit 102 generates an image for comparison by shifting each pixel included in the second image by p pixels along the epipolar line, and for each pixel in the first image, the comparison is made. Block matching with the image of. For example, the area search unit 102 calculates the SAD of the pixel block centered on the pixel of interest included in the first image and the pixel block centered on the pixel at the same position as the pixel of interest in the comparison image. To do. Then, the area search unit 102 sets the value of the pixel at the same position as the pixel of interest to "1" if the SAD is less than the threshold value, and conversely sets the value of the pixel to "0" if the SAD is equal to or more than the threshold value. A resulting image with parallax = p can be generated.

次に、領域探索部102は、累積結果画像にステップS212において生成した視差=pの結果画像を加算して、累積結果画像を更新する(ステップS212)。なお、ステップS212を初めて行う場合には、視差=p=kの結果画像がそのまま(最初の)累積結果画像として保存され得る。 Next, the area search unit 102 adds the result image of parallax = p generated in step S212 to the cumulative result image to update the cumulative result image (step S212). When the step S212 is performed for the first time, the result image of parallax = p = k can be saved as it is as the (first) cumulative result image.

続いて、領域探索部102は、ステップS212において更新した累積結果画像において「1」の値を持つ画素を含む領域を検出する(ステップS213)。領域探索部102は、ステップS213において検出した領域に含まれる「1」の画素の面積が閾値を超えるか否かを判定する(ステップS214)。 Subsequently, the area search unit 102 detects an area including a pixel having a value of "1" in the cumulative result image updated in step S212 (step S213). The area search unit 102 determines whether or not the area of the pixel “1” included in the area detected in step S213 exceeds the threshold value (step S214).

ステップS214において領域に含まれる「1」の画素の面積が閾値以下であると判定された場合に処理はステップS215へ進む。他方、ステップS214において領域に含まれる「1」の画素の面積が閾値を超えると判定された場合に、領域探索部102はステップS213において検出された領域を被写体領域の探索結果として決定し、当該被写体領域を定義するデータを生成、出力して、処理が終了する。ステップS215において、領域探索部102は変数pをデクリメントし、処理はステップS211に戻る。 When it is determined in step S214 that the area of the pixel "1" included in the area is equal to or less than the threshold value, the process proceeds to step S215. On the other hand, when it is determined in step S214 that the area of the pixel "1" included in the area exceeds the threshold value, the area search unit 102 determines the area detected in step S213 as the search result of the subject area. The data that defines the subject area is generated and output, and the process ends. In step S215, the area search unit 102 decrements the variable p, and the process returns to step S211.

次に、図9を用いて、ステップS220の詳細を説明する。図9の例では、処理はステップS221から開始する。
ステップS221において、視差同定部103は、ステップS210において探索された被写体領域を包含する探索範囲を設定し、処理はステップS222に進む。ステップS222において、視差同定部103は、変数pをデクリメントする。
Next, the details of step S220 will be described with reference to FIG. In the example of FIG. 9, the process starts from step S221.
In step S221, the parallax identification unit 103 sets a search range including the subject area searched in step S210, and the process proceeds to step S222. In step S222, the parallax identification unit 103 decrements the variable p.

次に、視差同定部103は、ステップS222においてデクリメントされた視差=pについて、探索範囲内のブロックマッチングを行い、結果画像を生成する(ステップS223)。具体的には、視差同定部103は、第2の画像に含まれる各画素をエピポーラ線に沿ってp画素ずらして比較用の画像を生成し、第1の画像の探索範囲内の画素毎に当該比較用の画像とのブロックマッチングを行う。例えば、視差同定部103は、第1の画像の探索範囲に含まれる注目画素を中心とする画素ブロックと、比較用の画像において当該注目画素と同一位置にある画素を中心とする画素ブロックとのSADを計算する。そして、視差同定部103は、SADが閾値未満であればこの注目画素と同一位置にある画素の値を「1」、逆にSADが閾値以上であれば当該画素の値を「0」として、視差=pの結果画像を生成する。 Next, the parallax identification unit 103 performs block matching within the search range for the parallax = p decremented in step S222, and generates a result image (step S223). Specifically, the parallax identification unit 103 generates an image for comparison by shifting each pixel included in the second image by p pixels along the epipolar line, and for each pixel within the search range of the first image. Block matching is performed with the image for comparison. For example, the parallax identification unit 103 includes a pixel block centered on a pixel of interest included in the search range of the first image and a pixel block centered on a pixel at the same position as the pixel of interest in the comparison image. Calculate SAD. Then, the parallax identification unit 103 sets the value of the pixel at the same position as the pixel of interest to be "1" if the SAD is less than the threshold value, and conversely sets the value of the pixel to "0" if the SAD is greater than or equal to the threshold value. A result image with parallax = p is generated.

続いて、視差同定部103は、累積結果画像にステップS223において生成した視差=pの結果画像を加算して、累積結果画像を更新する(ステップS224)。領域探索部102は、ステップS224において更新した累積結果画像において「1」の値を持つ画素を含む領域を検出する(ステップS225)。 Subsequently, the parallax identification unit 103 adds the result image of parallax = p generated in step S223 to the cumulative result image to update the cumulative result image (step S224). The area search unit 102 detects a region including a pixel having a value of "1" in the cumulative result image updated in step S224 (step S225).

視差同定部103は、ステップS225において検出した領域のサイズが目標値に達したか否かを判定する(ステップS232)。ステップS232において、領域のサイズが目標値に達していると判定されれば処理が終了する。他方、ステップS232において、領域のサイズが目標値に達していないと判定されれば処理はステップS226へ進む。 The parallax identification unit 103 determines whether or not the size of the region detected in step S225 has reached the target value (step S232). If it is determined in step S232 that the size of the area has reached the target value, the process ends. On the other hand, if it is determined in step S232 that the size of the region has not reached the target value, the process proceeds to step S226.

ステップS226では、視差同定部103は、ステップS225において検出した領域が現在設定されている探索範囲の境界に達したか否かを判定する。ステップS226において領域が探索範囲の境界に達していないと判定されれば、処理はステップS222に戻る。他方、ステップS226において領域が探索範囲の境界に達したと判定されれば、処理はステップS227へ進む。 In step S226, the parallax identification unit 103 determines whether or not the region detected in step S225 has reached the boundary of the currently set search range. If it is determined in step S226 that the region does not reach the boundary of the search range, the process returns to step S222. On the other hand, if it is determined in step S226 that the region has reached the boundary of the search range, the process proceeds to step S227.

ステップS227において、視差同定部103は、ステップS225において検出された(拡大した)被写体領域を包含するように、探索範囲を拡大して再設定する。 In step S227, the parallax identification unit 103 expands and resets the search range so as to include the (enlarged) subject area detected in step S225.

次に、視差同定部103は、現在の視差=pについて、探索範囲内、より正確にはステップS227において拡大した部分のブロックマッチングを行い、結果画像を生成する(ステップS228)。具体的には、視差同定部103は、第2の画像に含まれる各画素をエピポーラ線に沿ってp画素ずらして比較用の画像を生成し、第1の画像の探索範囲(の拡大部分)内の画素毎に当該比較用の画像とのブロックマッチングを行う。例えば、視差同定部103は、第1の画像の探索範囲に含まれる注目画素を中心とする画素ブロックと、比較用の画像において当該注目画素と同一位置にある画素を中心とする画素ブロックとのSADを計算する。そして、視差同定部103は、SADが閾値未満であればこの注目画素と同一位置にある画素の値を「1」、逆にSADが閾値以上であれば当該画素の値を「0」として、視差=pの結果画像を生成する。 Next, the parallax identification unit 103 performs block matching of the expanded portion of the current parallax = p within the search range, more accurately in step S227, and generates a result image (step S228). Specifically, the parallax identification unit 103 generates an image for comparison by shifting each pixel included in the second image by p pixels along the epipolar line, and the search range (enlarged portion) of the first image. Block matching is performed for each pixel in the image with the image for comparison. For example, the parallax identification unit 103 includes a pixel block centered on a pixel of interest included in the search range of the first image and a pixel block centered on a pixel at the same position as the pixel of interest in the comparison image. Calculate SAD. Then, the parallax identification unit 103 sets the value of the pixel at the same position as the pixel of interest to be "1" if the SAD is less than the threshold value, and conversely sets the value of the pixel to "0" if the SAD is greater than or equal to the threshold value. A result image with parallax = p is generated.

続いて、視差同定部103は、累積結果画像にステップS228において生成した視差=pの結果画像を加算して、累積結果画像を更新する(ステップS229)。領域探索部102は、ステップS229において更新した累積結果画像において「1」の値を持つ画素を含む領域を検出する(ステップS230)。 Subsequently, the parallax identification unit 103 adds the result image of parallax = p generated in step S228 to the cumulative result image to update the cumulative result image (step S229). The area search unit 102 detects a region including a pixel having a value of “1” in the cumulative result image updated in step S229 (step S230).

視差同定部103は、ステップS230において検出した領域のサイズが目標値に達したか否かを判定する(ステップS233)。ステップS233において、領域のサイズが目標値に達していると判定されれば処理が終了する。他方、ステップS233において、領域のサイズが目標値に達していないと判定されれば処理はステップS231へ進む。 The parallax identification unit 103 determines whether or not the size of the region detected in step S230 has reached the target value (step S233). In step S233, if it is determined that the size of the area has reached the target value, the process ends. On the other hand, if it is determined in step S233 that the size of the region has not reached the target value, the process proceeds to step S231.

ステップS231では、視差同定部103は、ステップS230において検出した領域が現在設定されている探索範囲の境界に達したか否かを判定する。ステップS231において領域が探索範囲の境界に達していないと判定されれば、処理はステップS222に戻る。他方、ステップS231において領域が探索範囲の境界に達したと判定されれば、処理はステップS227に戻る。 In step S231, the parallax identification unit 103 determines whether or not the region detected in step S230 has reached the boundary of the currently set search range. If it is determined in step S231 that the region does not reach the boundary of the search range, the process returns to step S222. On the other hand, if it is determined in step S231 that the region has reached the boundary of the search range, the process returns to step S227.

以上説明したように、第1の実施形態に係る画像処理装置は、ステレオカメラ画像の各画素に関する視差を予め定められた上限値から降順に同定し、カメラに近い被写体の(一部の)領域を早期に探索する。そして、この画像処理装置は、探索された領域を包含するように探索範囲を設定して、当該探索範囲内で視差を同定する。故に、この画像処理装置によれば、視差同定のためのマッチングや、被写体の位置姿勢の推定のためのマッチングを行う範囲をカメラの視野の一部に制限することができる。すなわち、カメラの視野全体を探索範囲とした場合に比べて、マッチングの実行回数を削減する、すなわちマッチングに関する計算量を削減しながらも、カメラに近い被写体に関する視差の同定および/または位置姿勢の推定をすることができる。従って、この画像処理装置によれば、例えば、ロボットハンドが、大量に山積みされた対象物をその上方からピックアップするユースケースにおいて、ロボットハンドが対象物をピックアップしてから次の対象物をピックアップするまでの時間を短縮させることで作業を高速化させることができる。 As described above, the image processing apparatus according to the first embodiment identifies the parallax for each pixel of the stereo camera image in descending order from a predetermined upper limit value, and is a (partial) region of the subject close to the camera. To search early. Then, this image processing device sets the search range so as to include the searched area, and identifies the parallax within the search range. Therefore, according to this image processing device, it is possible to limit the range of matching for parallax identification and matching for estimating the position and orientation of the subject to a part of the field of view of the camera. That is, the number of matching executions is reduced, that is, the amount of calculation related to matching is reduced, while parallax identification and / or position / orientation estimation for a subject close to the camera is performed, as compared with the case where the entire field of view of the camera is used as the search range. Can be done. Therefore, according to this image processing device, for example, in a use case where a robot hand picks up a large number of piled objects from above, the robot hand picks up the object and then picks up the next object. Work can be speeded up by shortening the time required.

(第2の実施形態)
図1に例示した3D計測システムは、前述の画像処理装置100に代えて、第2の実施形態に係る画像処理装置300を組み込むこともできる。
(Second Embodiment)
In the 3D measurement system illustrated in FIG. 1, the image processing device 300 according to the second embodiment can be incorporated in place of the image processing device 100 described above.

画像処理装置300は、前述の画像処理装置100と同様に、多眼カメラ10から複数枚の撮影画像を取得し、これら画像に対して種々の3D計測を行う。また、画像処理装置300は、画像処理装置100と同様のハードウェア構成を有し得る。 Similar to the image processing device 100 described above, the image processing device 300 acquires a plurality of captured images from the multi-eye camera 10 and performs various 3D measurements on these images. Further, the image processing device 300 may have the same hardware configuration as the image processing device 100.

以下、図11を用いて画像処理装置300の構成例の説明を続ける。
図11に例示されるように、画像処理装置300は、画像取得部101と、領域探索部102と、視差同定部303と、距離推定部105と、3D形状推定部106と、位置姿勢推定部107と、3Dモデル記憶部108とを含む。
Hereinafter, the description of the configuration example of the image processing apparatus 300 will be continued with reference to FIG.
As illustrated in FIG. 11, the image processing device 300 includes an image acquisition unit 101, a region search unit 102, a parallax identification unit 303, a distance estimation unit 105, a 3D shape estimation unit 106, and a position / orientation estimation unit. It includes 107 and a 3D model storage unit 108.

視差同定部303は、領域探索部102から、第1の画像、第2の画像、および被写体領域を定義するデータを受け取る。視差同定部303は、被写体領域を包含する探索範囲を設定し、探索範囲内の画素の視差を同定する。視差同定部303は、探索範囲内の画素についての視差の同定結果を表す視差データを生成し、これを距離推定部105へ送る。視差データは、例えば第1の画像の各画素の座標と当該画素に関する視差ベクトルとを含み得る。また、視差同定部303は、視差データを図示されない外部装置へ送ってもよい。視差同定部303は、例えば前述のプロセッサ(およびI/F)に相当し得る。 The parallax identification unit 303 receives data defining the first image, the second image, and the subject area from the area search unit 102. The parallax identification unit 303 sets a search range including the subject area, and identifies the parallax of the pixels in the search range. The parallax identification unit 303 generates parallax data representing the parallax identification result for the pixels in the search range, and sends this to the distance estimation unit 105. The parallax data may include, for example, the coordinates of each pixel of the first image and the parallax vector for that pixel. Further, the parallax identification unit 303 may send the parallax data to an external device (not shown). The parallax identification unit 303 may correspond to, for example, the above-mentioned processor (and I / F).

視差同定部303は、領域探索部102によって同定済みである視差よりも小さな値から順に視差の同定を継続し、被写体領域の拡大とこれに伴う探索範囲の拡大(再設定)とを行ってもよい。後述するように、視差同定部303は、ある値についての視差の同定の結果、探索範囲を拡大した場合に、拡大された探索範囲に対して、予め定められた上限値から当該ある値まで視差を同定する点、そして、拡大された探索範囲内により有望な被写体領域が存在した場合に、設定中の探索範囲をリセットして視差の同定を再開する点で、前述の視差同定部103とは異なる。 The parallax identification unit 303 continues to identify the parallax in order from a value smaller than the parallax identified by the area search unit 102, and even if the subject area is expanded and the search range is expanded (reset) accordingly. Good. As will be described later, when the parallax identification unit 303 identifies the parallax for a certain value and the search range is expanded, the parallax identification unit 303 performs the parallax from a predetermined upper limit value to the certain value with respect to the expanded search range. The parallax identification unit 103 is different from the above-mentioned parallax identification unit 103 in that it identifies the parallax and, when a more promising subject area exists in the expanded search range, the search range being set is reset and the parallax identification is restarted. different.

具体的には、視差同定部303は、領域探索部102によって探索された被写体領域を包含する探索範囲を設定する。例えば、視差同定部303は、被写体領域を包含する矩形を探索範囲としてもよいし、被写体領域の縁に沿って当該被写体よりも大きな探索範囲を設定してもよい。 Specifically, the parallax identification unit 303 sets a search range including the subject area searched by the area search unit 102. For example, the parallax identification unit 303 may set a rectangle including the subject area as the search range, or may set a search range larger than the subject along the edge of the subject area.

そして、視差同定部303は、領域探索部102によって同定済みである値(ここではmとする)よりも小さな視差について同定を行う。すなわち、視差同定部303は、第2の画像に含まれる各画素をエピポーラ線に沿ってm−1画素ずらして比較用の画像を生成し、第1の画像の探索範囲内の画素毎に当該比較用の画像とのブロックマッチングを行う。例えば、視差同定部303は、第1の画像の探索範囲に含まれる注目画素を中心とする画素ブロックと、比較用の画像において当該注目画素と同一位置にある画素を中心とする画素ブロックとのSADを計算する。そして、視差同定部303は、SADが閾値未満であればこの注目画素と同一位置にある画素の値を「1」、逆にSADが閾値以上であれば当該画素の値を「0」として、視差=m−1の結果画像を生成する。この結果画像に含まれる各画素の値は、第1の画像の探索範囲において当該画素と同一位置にある画素についての視差がm−1であるか否か(「1」/「0」)を意味する。視差同定部303は、累積結果画像にこの視差=m−1の結果画像を加算して被写体領域を更新する。この累積結果画像に含まれる各画素の値は、第1の画像の少なくとも探索範囲において当該画素と同一位置にある画素についての視差がm−1以上であるか否か、換言すれば視差が同定済みであるか否か(「1」/「0」)を意味する。 Then, the parallax identification unit 303 identifies a parallax smaller than the value (here, m) identified by the region search unit 102. That is, the parallax identification unit 303 shifts each pixel included in the second image by m-1 pixel along the epipolar line to generate an image for comparison, and corresponds to each pixel within the search range of the first image. Block matching with the image for comparison is performed. For example, the parallax identification unit 303 includes a pixel block centered on a pixel of interest included in the search range of the first image and a pixel block centered on a pixel at the same position as the pixel of interest in the comparison image. Calculate SAD. Then, the parallax identification unit 303 sets the value of the pixel at the same position as the pixel of interest to be "1" if the SAD is less than the threshold value, and conversely sets the value of the pixel to "0" if the SAD is greater than or equal to the threshold value. A result image with parallax = m-1 is generated. As a result, the value of each pixel included in the image determines whether or not the parallax of the pixel at the same position as the pixel in the search range of the first image is m-1 (“1” / “0”). means. The parallax identification unit 303 updates the subject area by adding the result image of parallax = m-1 to the cumulative result image. The value of each pixel included in this cumulative result image identifies whether or not the parallax of the pixel at the same position as the pixel in at least the search range of the first image is m-1 or more, in other words, the parallax is identified. It means whether or not it has been completed (“1” / “0”).

続いて、視差同定部303は、このように更新した被写体領域が、現在設定されている探索範囲の境界に達したか否かを判定する。被写体領域が現在設定されている探索範囲の境界に達していなければ、視差同定部303はより小さな視差の同定を行う。他方、被写体領域が探索範囲の境界に達していれば、視差同定部303は、被写体領域が探索範囲に包含されるように、探索範囲を以下に説明するように拡大して再設定することになる。 Subsequently, the parallax identification unit 303 determines whether or not the subject area updated in this way has reached the boundary of the currently set search range. If the subject area does not reach the boundary of the currently set search range, the parallax identification unit 303 identifies the smaller parallax. On the other hand, if the subject area reaches the boundary of the search range, the parallax identification unit 303 decides to expand and reset the search range as described below so that the subject area is included in the search range. Become.

具体的には、視差同定部303は、現在の累積結果画像における被写体領域を包含するように探索範囲を拡大して再設定する。ただし、前述のように、視差同定部303は、再設定前の探索範囲よりも外側の画素についてマッチングを行っていないので、実際には視差がm−1以上である被写体領域は、再設定後の探索範囲の境界にも達するおそれがある。故に、視差同定部303は、探索範囲のうち再設定により拡大した部分について前述のマッチングを予め定められた上限値からm−1まで行って、累積結果画像を再更新する。 Specifically, the parallax identification unit 303 expands and resets the search range so as to include the subject area in the current cumulative result image. However, as described above, since the parallax identification unit 303 does not match the pixels outside the search range before the resetting, the subject area where the parallax is actually m-1 or more is actually set after the resetting. It may reach the boundary of the search range of. Therefore, the parallax identification unit 303 re-updates the cumulative result image by performing the above-mentioned matching from the predetermined upper limit value to m-1 for the portion of the search range expanded by the resetting.

ここで、探索範囲のうち再設定により拡大した部分に、m−1より大きい、すなわち上限値からmまでの視差が同定された領域が存在し、さらにこの領域が現在の探索範囲内の被写体領域と不連続である場合には、当該領域は現在の探索範囲内の被写体領域に対応する被写体よりもカメラに近い位置にある被写体に対応する可能性がある。そこで、視差同定部303は、設定中の探索範囲(および当該探索範囲によって包含される被写体領域)を破棄してこの(被写体)領域を包含する探索範囲を新たに設定(すなわち、探索範囲をリセット)して、当該探索範囲内の画素について視差の同定を再開する。そして、視差同定部303は、被写体領域が、現在設定されている探索範囲の境界に達したか否かを再判定する。被写体領域が探索範囲の境界に達していれば、視差同定部303は同様の処理を繰り返す必要がある。他方、被写体領域が探索範囲の境界に達していなければ、視差同定部303はより小さな視差の同定と、必要であれば探索範囲の拡大とを行うことになる。最終的に、視差の同定済みである画素を含む領域(被写体領域)のサイズが予め定められた目標値に達した場合に、視差同定部303は視差の同定を終了することになる。 Here, in the portion of the search range expanded by resetting, there is a region larger than m-1, that is, a parallax from the upper limit value to m is identified, and this region is a subject region within the current search range. If it is discontinuous, the area may correspond to a subject located closer to the camera than the subject corresponding to the subject area in the current search range. Therefore, the parallax identification unit 303 discards the search range being set (and the subject area included by the search range) and newly sets a search range including this (subject) area (that is, resets the search range). ), And the parallax identification is restarted for the pixels in the search range. Then, the parallax identification unit 303 redetermines whether or not the subject area has reached the boundary of the currently set search range. If the subject area reaches the boundary of the search range, the parallax identification unit 303 needs to repeat the same process. On the other hand, if the subject area does not reach the boundary of the search range, the parallax identification unit 303 will identify the smaller parallax and expand the search range if necessary. Finally, when the size of the region (subject region) including the pixel for which the parallax has been identified reaches a predetermined target value, the parallax identification unit 303 ends the parallax identification.

ここで、2つの被写体61および被写体62が図12に例示されていたとする。図12の例では、被写体62は、被写体61に被さっており、被写体61よりも被写体62がカメラに近い位置にある。しかしながら、被写体61および被写体62の姿勢の影響で、被写体61の一部が、被写体62よりもカメラに近い位置に突き出ている。 Here, it is assumed that the two subjects 61 and the subject 62 are illustrated in FIG. In the example of FIG. 12, the subject 62 covers the subject 61, and the subject 62 is closer to the camera than the subject 61. However, due to the influence of the postures of the subject 61 and the subject 62, a part of the subject 61 protrudes closer to the camera than the subject 62.

被写体61および被写体62がこのように配置されていたとすると、領域探索部102は、被写体61の一部を被写体領域として探索する可能性がある。それから視差同定部303は、被写体61のうちカメラからより遠い部分について視差を同定し、探索範囲を拡大することになる。ここで、仮に、ある値について探索範囲内の画素の視差を同定し、さらに探索範囲を拡大した場合に、この拡大した部分の画素の視差を当該ある値についてのみ同定したとする。探索範囲の拡大部分の画素の視差をこのように同定すると、被写体61および被写体62の重なった部分では被写体62の方が被写体61よりも視差が大きいので、当該拡大部分に被写体62が存在していたとしても、これが見落とされるおそれがある。 Assuming that the subject 61 and the subject 62 are arranged in this way, the area search unit 102 may search for a part of the subject 61 as a subject area. Then, the parallax identification unit 303 identifies the parallax for the portion of the subject 61 farther from the camera, and expands the search range. Here, it is assumed that when the parallax of the pixels in the search range is identified for a certain value and the search range is further expanded, the parallax of the pixels in the expanded portion is identified only for the certain value. When the parallax of the pixels in the enlarged portion of the search range is identified in this way, the subject 62 has a larger parallax than the subject 61 in the overlapped portion of the subject 61 and the subject 62, so that the subject 62 exists in the enlarged portion. Even so, this can be overlooked.

そこで、視差同定部303は、探索範囲の拡大部分の画素の視差も、予め定められた値から現在注目する値まで同定することで、かかる見落としを防ぐ。図13、図14、および図15に、図12の例において、視差が20画素、16画素、および12画素の場合、の累積結果画像をそれぞれ示す。図13の段階では被写体61の一部が探索範囲に含まれているが、図14の段階では被写体62の一部を包含するように探索範囲がリセットされ、図15の段階では、被写体61および被写体62の位置関係、すなわち被写体62が被写体61に被さっていることが理解できる。 Therefore, the parallax identification unit 303 also identifies the parallax of the pixels in the expanded portion of the search range from a predetermined value to a value of interest at present, thereby preventing such oversight. 13, FIG. 14, and FIG. 15 show cumulative result images when the parallax is 20, 16 pixels, and 12 pixels in the example of FIG. 12, respectively. At the stage of FIG. 13, a part of the subject 61 is included in the search range, but at the stage of FIG. 14, the search range is reset so as to include a part of the subject 62, and at the stage of FIG. 15, the subject 61 and It can be understood that the positional relationship of the subject 62, that is, the subject 62 covers the subject 61.

視差同定部303による探索範囲の設定例を図18に示す。図18の例では、視差=k−1の時に、被写体領域の探索が済んでいる。故に、段階S11では、視差同定部303は、視差=k−1以上である被写体領域を包含するように探索範囲を設定する。 FIG. 18 shows an example of setting the search range by the parallax identification unit 303. In the example of FIG. 18, the search for the subject area is completed when the parallax = k-1. Therefore, in step S11, the parallax identification unit 303 sets the search range so as to include the subject region in which the parallax = k-1 or more.

段階S12では、視差同定部303は、現在設定されている探索範囲内で視差=k−2についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲の境界(上端および右端)に達している。 In step S12, the parallax identification unit 303 performs matching for parallax = k-2 within the currently set search range. As a result, the region having a value of "1" in the cumulative result image reaches the boundary (upper end and right end) of the currently set search range.

故に、段階S13では、視差同定部303は、探索範囲を拡大する。そして、段階S14では、視差同定部303は、この拡大した部分の中で視差=k、k−1およびk−2についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲の境界(上端および右端)に達している。 Therefore, in step S13, the parallax identification unit 303 expands the search range. Then, in step S14, the parallax identification unit 303 performs matching for parallax = k, k-1 and k-2 in this enlarged portion. As a result, the region having a value of "1" in the cumulative result image reaches the boundary (upper end and right end) of the currently set search range.

故に、段階S15では、視差同定部303は、探索範囲をさらに拡大する。そして、段階S16では、視差同定部303は、この拡大した部分の中で視差=k、k−1およびk−2についてのマッチングを行う。この結果、視差=kおよび/またはk−1が同定された領域が検出され、かつ現在の探索範囲内の被写体領域と不連続であったため、探索範囲がリセットされた。さらに、累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲の境界(左端)に達している。 Therefore, in step S15, the parallax identification unit 303 further expands the search range. Then, in step S16, the parallax identification unit 303 performs matching for parallax = k, k-1 and k-2 in this enlarged portion. As a result, the region in which the parallax = k and / or k-1 was identified was detected and was discontinuous with the subject region in the current search range, so the search range was reset. Further, the region having a value of "1" in the cumulative result image reaches the boundary (left end) of the currently set search range.

故に、段階S17では、視差同定部303は、探索範囲をさらに拡大する。そして、段階S18では、視差同定部303は、この拡大した部分の中で視差=k、k−1およびk−2についてのマッチングを行う。累積結果画像において「1」の値を持つ領域は現在設定されている探索範囲によって包含されている。 Therefore, in step S17, the parallax identification unit 303 further expands the search range. Then, in step S18, the parallax identification unit 303 performs matching for parallax = k, k-1 and k-2 in this enlarged portion. The area having a value of "1" in the cumulative result image is included by the currently set search range.

次に、段階S19では、視差同定部303は、現在設定されている探索範囲内で視差=k−3についてのマッチングを行う。この結果、累積結果画像において「1」の値を持つ領域のサイズは目標値に達した。故に、視差同定部303は、視差の同定を終了する。 Next, in step S19, the parallax identification unit 303 performs matching for parallax = k-3 within the currently set search range. As a result, the size of the region having a value of "1" in the cumulative result image reached the target value. Therefore, the parallax identification unit 303 finishes the parallax identification.

以下、図16および図17を用いて、図11の画像処理装置の動作を説明する。図16のフローチャートは、図7のフローチャートにおけるステップS220をステップS420に置き換えたものである。 Hereinafter, the operation of the image processing apparatus of FIG. 11 will be described with reference to FIGS. 16 and 17. The flowchart of FIG. 16 replaces step S220 in the flowchart of FIG. 7 with step S420.

ステップS420において、視差同定部303は、被写体領域のサイズが予め定められた目標値に達するまで、ステップS210に引き続き当該変数pを減じながら探索範囲内の画素の視差を同定して被写体領域を拡大させると共に当該被写体領域を包含するように探索範囲を設定する(ステップS420)。なお、ステップS420の具体例は、図17を用いて後述される。 In step S420, the parallax identification unit 303 identifies the parallax of the pixels in the search range and expands the subject area while decreasing the variable p following step S210 until the size of the subject area reaches a predetermined target value. The search range is set so as to include the subject area (step S420). A specific example of step S420 will be described later with reference to FIG.

次に、図17を用いて、ステップS420の詳細を説明する。図17のフローチャートは、図9のフローチャートにおけるステップS228およびステップS229をステップS428およびステップS429にそれぞれ置き換え、さらにステップS434およびステップS435を追加したものである。 Next, the details of step S420 will be described with reference to FIG. In the flowchart of FIG. 17, step S228 and step S229 in the flowchart of FIG. 9 are replaced with steps S428 and S429, respectively, and steps S434 and S435 are added.

ステップS428において、視差同定部303は、予め定められた上限値(k)から現在の視差=pまで、拡大された探索範囲内、すなわちステップS227において拡大した部分のブロックマッチングを行い、それぞれ結果画像を生成する(ステップS428)。具体的には、視差同定部303は、p≦i≦kを満足する任意の整数iに関して、第2の画像に含まれる各画素をエピポーラ線に沿ってi画素ずらして比較用の画像を生成し、第1の画像の探索範囲の拡大部分内の画素毎に当該比較用の画像とのブロックマッチングを行う。例えば、視差同定部303は、第1の画像の探索範囲に含まれる注目画素を中心とする画素ブロックと、比較用の画像において当該注目画素と同一位置にある画素を中心とする画素ブロックとのSADを計算する。そして、視差同定部303は、SADが閾値未満であればこの注目画素と同一位置にある画素の値を「1」、逆にSADが閾値以上であれば当該画素の値を「0」として、視差=iの結果画像を生成する。 In step S428, the parallax identification unit 303 performs block matching within the expanded search range from the predetermined upper limit value (k) to the current parallax = p, that is, the expanded portion in step S227, and each result image. Is generated (step S428). Specifically, the parallax identification unit 303 generates an image for comparison by shifting each pixel included in the second image by i pixel along the epipolar line with respect to an arbitrary integer i satisfying p ≦ i ≦ k. Then, block matching with the comparison image is performed for each pixel in the expanded portion of the search range of the first image. For example, the parallax identification unit 303 includes a pixel block centered on a pixel of interest included in the search range of the first image and a pixel block centered on a pixel at the same position as the pixel of interest in the comparison image. Calculate SAD. Then, the parallax identification unit 303 sets the value of the pixel at the same position as the pixel of interest to be "1" if the SAD is less than the threshold value, and conversely sets the value of the pixel to "0" if the SAD is greater than or equal to the threshold value. A result image of parallax = i is generated.

続いて、視差同定部103は、視差=k〜p+1について、画素値=「1」の領域が検出され、かつ探索範囲内の被写体領域と不連続であるか否かを判定する(ステップS434)。かかる領域が検出されれば処理はステップS435へ進む、検出されなければ処理はステップS429へ進む。 Subsequently, the parallax identification unit 103 determines whether or not the region of the pixel value = "1" is detected for the parallax = k to p + 1 and is discontinuous with the subject region within the search range (step S434). .. If such a region is detected, the process proceeds to step S435, and if not detected, the process proceeds to step S429.

ステップS435において、視差同定部103は、現在設定中の探索範囲を破棄し、検出された領域を包含する探索範囲を新たに設定して、処理はステップS429へ進む。 In step S435, the parallax identification unit 103 discards the search range currently being set, sets a new search range including the detected area, and the process proceeds to step S429.

ステップS429において、視差同定部303は、累積結果画像にステップS428において生成した視差=k〜pの結果画像を加算して、累積結果画像を更新する。 In step S429, the parallax identification unit 303 updates the cumulative result image by adding the result image of parallax = k to p generated in step S428 to the cumulative result image.

以上説明したように、第2の実施形態に係る画像処理装置は、ある値について探索範囲内の画素の視差を同定し、さらに探索範囲を拡大した場合に、拡大した部分について予め定められた上限値から当該ある値まで視差の同定を行う点、そして、拡大された探索範囲内により有望な被写体領域が存在した場合に、設定中の探索範囲をリセットして視差の同定を再開する点で、第1の実施形態に係る画像処理装置とは異なる。この画像処理装置は、第1の実施形態に係る画像処理装置に比べて、視差の同定のための演算量が増加するおそれはあるものの、最初に探索された被写体領域とは離れた箇所に当該被写体領域に対応する第1の被写体よりもカメラに近い第2の被写体が存在する場合に、当該第2の被写体を見落としにくくなる。 As described above, the image processing apparatus according to the second embodiment identifies the parallax of the pixels in the search range for a certain value, and when the search range is further expanded, a predetermined upper limit is set for the expanded portion. The point of identifying the parallax from the value to the certain value, and the point of resetting the set search range and restarting the parallax identification when a more promising subject area exists in the expanded search range. It is different from the image processing apparatus according to the first embodiment. Although this image processing device may increase the amount of calculation for parallax identification as compared with the image processing device according to the first embodiment, the image processing device corresponds to a location distant from the initially searched subject area. When there is a second subject closer to the camera than the first subject corresponding to the subject area, it becomes difficult to overlook the second subject.

上述の実施形態は、本発明の概念の理解を助けるための具体例を示しているに過ぎず、本発明の範囲を限定することを意図されていない。実施形態は、本発明の要旨を逸脱しない範囲で、様々な構成要素の付加、削除または転換をすることができる。 The above embodiments are merely specific examples to aid in understanding the concepts of the invention and are not intended to limit the scope of the invention. In the embodiment, various components can be added, deleted or converted without departing from the gist of the present invention.

上述の実施形態では、いくつかの機能部を説明したが、これらは各機能部の実装の一例に過ぎない。例えば、1つの装置に実装されると説明された複数の機能部が複数の別々の装置に亘って実装されることもあり得るし、逆に複数の別々の装置に亘って実装されると説明された機能部が1つの装置に実装されることもあり得る。 In the above-described embodiment, some functional parts have been described, but these are only examples of implementation of each functional part. For example, it is possible that a plurality of functional parts described as being mounted on one device may be mounted on a plurality of separate devices, and conversely, it is described as being mounted on a plurality of separate devices. It is also possible that the functional unit is mounted on one device.

上記各実施形態において説明された種々の機能部は、回路を用いることで実現されてもよい。回路は、特定の機能を実現する専用回路であってもよいし、プロセッサのような汎用回路であってもよい。 The various functional parts described in each of the above embodiments may be realized by using a circuit. The circuit may be a dedicated circuit that realizes a specific function, or may be a general-purpose circuit such as a processor.

上記各実施形態の処理の少なくとも一部は、例えば汎用のコンピュータに搭載されたプロセッサを基本ハードウェアとして用いることでも実現可能である。上記処理を実現するプログラムは、コンピュータで読み取り可能な記録媒体に格納して提供されてもよい。プログラムは、インストール可能な形式のファイルまたは実行可能な形式のファイルとして記録媒体に記憶される。記録媒体としては、磁気ディスク、光ディスク(CD−ROM、CD−R、DVD等)、光磁気ディスク(MO等)、半導体メモリなどである。記録媒体は、プログラムを記憶でき、かつ、コンピュータが読み取り可能であれば、何れであってもよい。また、上記処理を実現するプログラムを、インターネットなどのネットワークに接続されたコンピュータ(サーバ)上に格納し、ネットワーク経由でコンピュータ(クライアント)にダウンロードさせてもよい。 At least a part of the processing of each of the above embodiments can be realized by using, for example, a processor mounted on a general-purpose computer as basic hardware. The program that realizes the above processing may be provided by storing it in a computer-readable recording medium. The program is stored on the recording medium as a file in an installable format or a file in an executable format. Examples of the recording medium include magnetic disks, optical disks (CD-ROM, CD-R, DVD, etc.), magneto-optical disks (MO, etc.), semiconductor memories, and the like. The recording medium may be any medium as long as it can store the program and can be read by a computer. Further, the program that realizes the above processing may be stored on a computer (server) connected to a network such as the Internet and downloaded to the computer (client) via the network.

10・・・多眼カメラ
11,12・・・カメラ
20・・・プロジェクタ
30・・・プロジェクタ/カメラ制御装置
60,61,62・・・被写体
70・・・台
100,300・・・画像処理装置
101・・・画像取得部
102・・・領域探索部
103,303・・・視差同定部
105・・・距離推定部
106・・・3D形状推定部
107・・・位置姿勢推定部
108・・・3Dモデル記憶部
10 ... Multi-lens camera 11, 12 ... Camera 20 ... Projector 30 ... Projector / camera control device 60, 61, 62 ... Subject 70 ... Unit 100, 300 ... Image processing Device 101: Image acquisition unit 102: Area search unit 103, 303: Parallax identification unit 105: Distance estimation unit 106: 3D shape estimation unit 107: Position / orientation estimation unit 108 ...・ 3D model storage

Claims (8)

第1のカメラによって対象物を撮影した第1の画像と第2のカメラによって前記対象物を撮影した第2の画像とを取得する取得部と、
前記第1の画像内の画素の前記第2の画像内の対応する画素に対する視差を予め定められた上限値から降順に同定し、前記視差の同定済みである画素を含み、かつ前記視差の同定済みである画素の面積が閾値を超える第1の領域を探索する探索部と、
前記第1の領域を包含する探索範囲を設定し、前記探索範囲内の画素の視差を同定する視差同定部と
を具備する、画像処理装置。
An acquisition unit that acquires a first image in which an object is photographed by a first camera and a second image in which the object is photographed by a second camera.
The parallax of the pixels in the first image with respect to the corresponding pixels in the second image is identified in descending order from a predetermined upper limit value, and the pixels including the identified pixels of the parallax are included, and the parallax is identified. A search unit that searches for a first region in which the area of pixels that have been completed exceeds the threshold, and
An image processing apparatus comprising a parallax identification unit for setting a search range including the first region and identifying parallax of pixels in the search range.
前記同定部は、同定済みの視差よりもさらに小さな第1の値について前記探索範囲内の画素の前記視差を同定して前記第1の領域を更新し、前記第1の領域が前記探索範囲の境界に達した場合に前記探索範囲が当該第1の領域を包含するまで拡大して再設定してから前記第1の値よりもさらに小さな第2の値について前記探索範囲内の画素の前記視差を同定する、請求項1に記載の画像処理装置。 The identification unit identifies the parallax of the pixels in the search range for a first value smaller than the identified parallax and updates the first region, and the first region is the search range. When the boundary is reached, the search range is expanded and reset to include the first region, and then the parallax of the pixels in the search range for a second value smaller than the first value. The image processing apparatus according to claim 1. 前記同定部は、同定済みの視差よりもさらに小さな第1の値について前記探索範囲内の画素の前記視差を同定して前記第1の領域を更新し、前記第1の領域が前記探索範囲の境界に達した場合に前記探索範囲が当該第1の領域を包含するまで拡大して再設定してから、前記上限値から前記第1の値まで、拡大された前記探索範囲内の画素の前記視差を同定する、請求項1に記載の画像処理装置。 The identification unit identifies the parallax of the pixels in the search range for a first value smaller than the identified parallax and updates the first region, and the first region is the search range. When the boundary is reached, the search range is expanded and reset to include the first region, and then the pixels in the search range expanded from the upper limit value to the first value are described. The image processing apparatus according to claim 1, which identifies parallax. 前記同定部は、拡大された前記探索範囲内の画素の中から前記第1の値よりも大きな視差が同定された第2の領域を検出し、かつ前記第2の領域が前記第1の領域と不連続である場合に、設定中の前記探索範囲を破棄し、前記第2の領域を包含する探索範囲を新たに設定して前記視差の同定を再開する、請求項3に記載の画像処理装置。 The identification unit detects a second region in which a parallax larger than the first value is identified from the pixels in the expanded search range, and the second region is the first region. The image processing according to claim 3, wherein the search range being set is discarded, a search range including the second region is newly set, and identification of the parallax is restarted when the search range is discontinuous. apparatus. 前記同定部は、前記探索範囲内で前記視差の同定済みである画素を含む領域のサイズが予め定められた目標値に達した場合に前記視差の同定を終了する、請求項1乃至請求項4のいずれか1項に記載の画像処理装置。 Claims 1 to 4 in which the identification unit ends the identification of the parallax when the size of the region including the pixel for which the parallax has been identified within the search range reaches a predetermined target value. The image processing apparatus according to any one of the above. 同定された前記視差に基づいて、前記探索範囲内の画素に対応する前記対象物の点から前記第1のカメラおよび前記第2のカメラまでの距離を推定する距離推定部をさらに具備する、請求項1乃至請求項5のいずれか1項に記載の画像処理装置。 Claimed to further include a distance estimation unit that estimates the distances from the point of the object corresponding to the pixels in the search range to the first camera and the second camera based on the identified parallax. The image processing apparatus according to any one of items 1 to 5. 前記距離の推定結果に基づいて、前記探索範囲における前記対象物の3D形状を推定する3D形状推定部をさらに具備する、請求項6に記載の画像処理装置。 The image processing apparatus according to claim 6, further comprising a 3D shape estimation unit that estimates the 3D shape of the object in the search range based on the distance estimation result. 前記対象物の3D形状の推定結果を、予め用意されている1または複数の物品の3Dモデルとマッチングし、前記対象物の位置および姿勢の少なくとも一方を推定する位置姿勢推定部をさらに具備する、請求項7に記載の画像処理装置。 It further includes a position / orientation estimation unit that matches the estimation result of the 3D shape of the object with a 3D model of one or a plurality of articles prepared in advance and estimates at least one of the position and the attitude of the object. The image processing apparatus according to claim 7.
JP2019072017A 2019-04-04 2019-04-04 Image processing device Active JP7334051B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019072017A JP7334051B2 (en) 2019-04-04 2019-04-04 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019072017A JP7334051B2 (en) 2019-04-04 2019-04-04 Image processing device

Publications (2)

Publication Number Publication Date
JP2020170390A true JP2020170390A (en) 2020-10-15
JP7334051B2 JP7334051B2 (en) 2023-08-28

Family

ID=72746759

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019072017A Active JP7334051B2 (en) 2019-04-04 2019-04-04 Image processing device

Country Status (1)

Country Link
JP (1) JP7334051B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017030115A (en) * 2015-08-04 2017-02-09 株式会社リコー Picking device, picking method and picking program
JP2017045283A (en) * 2015-08-26 2017-03-02 株式会社ソニー・インタラクティブエンタテインメント Information processing apparatus and information processing method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017030115A (en) * 2015-08-04 2017-02-09 株式会社リコー Picking device, picking method and picking program
JP2017045283A (en) * 2015-08-26 2017-03-02 株式会社ソニー・インタラクティブエンタテインメント Information processing apparatus and information processing method

Also Published As

Publication number Publication date
JP7334051B2 (en) 2023-08-28

Similar Documents

Publication Publication Date Title
CN107990899B (en) Positioning method and system based on SLAM
JP6702453B2 (en) Positioning method, positioning device, and readable storage medium
CN106688013B (en) System and method for attitude estimation
US10510159B2 (en) Information processing apparatus, control method for information processing apparatus, and non-transitory computer-readable storage medium
JP6215442B2 (en) Client-server based dynamic search
KR101725060B1 (en) Apparatus for recognizing location mobile robot using key point based on gradient and method thereof
KR101776621B1 (en) Apparatus for recognizing location mobile robot using edge based refinement and method thereof
US9635251B2 (en) Visual tracking using panoramas on mobile devices
US11037325B2 (en) Information processing apparatus and method of controlling the same
KR101784183B1 (en) APPARATUS FOR RECOGNIZING LOCATION MOBILE ROBOT USING KEY POINT BASED ON ADoG AND METHOD THEREOF
US20140253679A1 (en) Depth measurement quality enhancement
US10818018B2 (en) Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
US10861185B2 (en) Information processing apparatus and method of controlling the same
JP2016177388A (en) Mobile object position/attitude measuring apparatus
JP2012068772A (en) Camera tracking device and program therefor
JP6922348B2 (en) Information processing equipment, methods, and programs
JP5973767B2 (en) Corresponding point search device, program thereof, and camera parameter estimation device
KR20100065037A (en) Apparatus and method for extracting depth information
JP2012114722A (en) Object tracking device, object tracking method, and object tracking program
US20230100238A1 (en) Methods and systems for determining the 3d-locations, the local reference frames and the grasping patterns of grasping points of an object
JP2017184136A (en) Information processing device, information processing method, information processing system, and program
JP7334051B2 (en) Image processing device
CN112509124B (en) Depth map obtaining method and system, unmanned aerial vehicle orthogram generating method and medium
US9591220B2 (en) Selection apparatus, selection method, and storage medium
WO2024009377A1 (en) Information processing device, self-position estimation method, and non-transitory computer-readable medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220329

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20230201

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230309

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230322

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230517

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230816

R150 Certificate of patent or registration of utility model

Ref document number: 7334051

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150