JP5757156B2 - Method, apparatus and program for calculating center position of detection object - Google Patents

Method, apparatus and program for calculating center position of detection object Download PDF

Info

Publication number
JP5757156B2
JP5757156B2 JP2011113615A JP2011113615A JP5757156B2 JP 5757156 B2 JP5757156 B2 JP 5757156B2 JP 2011113615 A JP2011113615 A JP 2011113615A JP 2011113615 A JP2011113615 A JP 2011113615A JP 5757156 B2 JP5757156 B2 JP 5757156B2
Authority
JP
Japan
Prior art keywords
brightness
maximized
input image
cylindrical
detection target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2011113615A
Other languages
Japanese (ja)
Other versions
JP2012242281A (en
Inventor
和志 吉岡
和志 吉岡
健次 本間
健次 本間
正樹 諏訪
正樹 諏訪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron 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 Omron Corp filed Critical Omron Corp
Priority to JP2011113615A priority Critical patent/JP5757156B2/en
Publication of JP2012242281A publication Critical patent/JP2012242281A/en
Application granted granted Critical
Publication of JP5757156B2 publication Critical patent/JP5757156B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)

Description

本発明は、既知の半径を有する円筒または球を少なくとも一部に含む検出対象物の中心位置を算出する方法、装置およびプログラムに関するものである。   The present invention relates to a method, an apparatus, and a program for calculating a center position of a detection object including at least a part of a cylinder or a sphere having a known radius.

たとえば、FA(Factory Automation)分野などにおいては、省力化や自動化の観点から、製造現場で扱われる検出対象物(以下、「ワーク」とも称す。)を撮像して得られる画像に基づいて、各種の処理を自動化するような画像計測技術が開発・実用化されている。   For example, in the field of FA (Factory Automation) and the like, from the viewpoint of labor saving and automation, various types of images are obtained based on images obtained by imaging a detection target (hereinafter also referred to as “work”) handled at a manufacturing site. Image measurement technology that automates this process has been developed and put into practical use.

このような画像計測技術の一例として、円筒状のワークを把持したりするために、当該ワークの中心位置を算出するような手法が提案されている。たとえば、特開2004−294234号公報(特許文献1)には、円筒部分を含む物体を側面から撮影することにより距離画像を入力し、その距離画像から円筒部分の領域である円筒領域距離画像を抽出し、円筒領域距離画像の各点において法線ベクトルを演算し、法線ベクトルから主軸を演算し、主軸に垂直な平面に円筒領域距離画像を射影し、射影した円筒領域距離画像を円に近似するとともに円の中心を求め、円の中心を通る主軸を物体の位置と姿勢とする物体検出方法が開示されている。すなわち、特許文献1には、円筒を三次元計測装置で計測した三次元点群を円筒中心軸方向の平面に投影し、円筒中心と径とを算出する手法が開示されている。   As an example of such an image measurement technique, a method for calculating the center position of a workpiece in order to grip a cylindrical workpiece has been proposed. For example, in Japanese Patent Application Laid-Open No. 2004-294234 (Patent Document 1), a distance image is input by photographing an object including a cylindrical portion from the side surface, and a cylindrical region distance image that is a region of the cylindrical portion is obtained from the distance image. Extract and calculate the normal vector at each point of the cylindrical area distance image, calculate the principal axis from the normal vector, project the cylindrical area distance image on a plane perpendicular to the main axis, and turn the projected cylindrical area distance image into a circle An object detection method is disclosed that approximates and obtains the center of a circle and uses the principal axis passing through the center of the circle as the position and orientation of the object. That is, Patent Document 1 discloses a method of calculating a cylinder center and a diameter by projecting a three-dimensional point group obtained by measuring a cylinder with a three-dimensional measuring device onto a plane in the direction of the cylinder central axis.

また、特開2000−329520号公報(特許文献2)には、スリット光走査装置が、コイルを径方向に見た場合、複数の明るさが変化した部分が存在するようにレーザスリット光を照射し、コイル演算装置が、断面形状データをコイル径方向に投影した際、複数の断面形状データが存在する部分についてコイルの幅及び幅方向中心位置を算出するコイル位置検出装置が開示されている。すなわち、特許文献2には、投光方向を変えながら光切断を行い、光沢を有する円筒状のコイルを三次元計測し、その三次元計測から得られる点群から円筒の幅および径を算出する手法が開示されている。   Japanese Patent Laid-Open No. 2000-329520 (Patent Document 2) irradiates laser slit light so that a slit light scanning device has a plurality of brightness-changing portions when the coil is viewed in the radial direction. A coil position detection device is disclosed that calculates the width of the coil and the center position in the width direction for a portion where a plurality of cross-sectional shape data exists when the coil calculation device projects the cross-sectional shape data in the coil radial direction. That is, in Patent Document 2, light cutting is performed while changing the light projecting direction, a glossy cylindrical coil is three-dimensionally measured, and the width and diameter of the cylinder are calculated from a point group obtained from the three-dimensional measurement. A technique is disclosed.

特開2004−294234号公報JP 2004-294234 A 特開2000−329520号公報JP 2000-329520 A

しかしながら、複数のワークがトレーなどに入れられた状態(すなわち、「ばら積み」されている状態)において、ロボットなどを用いて当該トレーから各ワークを把持するような処理には、上述したような従来技術をそのまま適用しても所望の結果を得ることはできなかった。   However, in a state where a plurality of workpieces are placed in a tray or the like (that is, in a state where they are “unstacked”), a process such as gripping each workpiece from the tray using a robot or the like is performed as described above. Even if the technique was applied as it was, the desired result could not be obtained.

すなわち、特許文献1に開示される手法では、円フィッティングを用いて円筒中心と径とを算出するため、所定の面積を有する点の群が必要である。そのため、その表面が拡散反射するような円筒状のワークには適用できるが、光沢のある表面特性を有する(鏡面反射する)円筒状のワークでは十分な数の計測点を取得することが難しい。そのため、その表面が拡散反射面および鏡面反射面の一方には特定されないワークに対して、特許文献1の記載の発明を汎用的に適用することはできない。   That is, in the method disclosed in Patent Document 1, a group of points having a predetermined area is necessary because the center of the cylinder and the diameter are calculated using circle fitting. Therefore, although it can be applied to a cylindrical workpiece whose surface is diffusely reflected, it is difficult to obtain a sufficient number of measurement points with a cylindrical workpiece having glossy surface characteristics (specular reflection). Therefore, the invention described in Patent Document 1 cannot be applied universally to a workpiece whose surface is not specified as one of the diffuse reflection surface and the specular reflection surface.

また、特許文献2に開示される手法では、十分な数の計測点を取得するために、角度を異ならせて複数回の撮像(光切断)が必要である。そのため、一つのワークについての計測時間が比較的長くなり、実用的な時間で多数のワークを処理することができない。また、ワークについての計測点を十分な数だけ取得するためには、ワークの方向(円筒方向)がある程度既知である必要があり、上述のようなばら積み状態のワークに対しては適用することができない。   Further, in the method disclosed in Patent Document 2, in order to acquire a sufficient number of measurement points, imaging (light cutting) is required a plurality of times at different angles. Therefore, the measurement time for one workpiece becomes relatively long, and a large number of workpieces cannot be processed in a practical time. In addition, in order to obtain a sufficient number of measurement points for a workpiece, the direction of the workpiece (cylindrical direction) needs to be known to some extent, and can be applied to the above-described bulk workpiece. Can not.

そこで、本発明の目的は、複数の検出対象物が任意の方向を向いて配置されている場合であっても、それぞれの検出対象物の中心位置を算出することができる方法、装置およびプログラムを提供することである。   Therefore, an object of the present invention is to provide a method, apparatus, and program capable of calculating the center position of each detection object even when a plurality of detection objects are arranged in an arbitrary direction. Is to provide.

本発明のある局面に従えば、既知の半径を有する円筒または球を少なくとも一部に含む検出対象物の中心位置を算出する方法を提供する。当該方法は、少なくとも1つの検出対象物を撮像した入力画像を取得するステップと、検出対象物の形状に相当する領域を入力画像から抽出するステップと、抽出された領域についての高さ情報を取得するステップと、抽出された領域内において明るさが極大となる部分を特定し、当該部分の法線方向を決定するステップと、決定した法線方向と、既知の半径と、明るさが極大となる部分の位置と、対応する高さ情報とから、検出対象物の中心位置を決定するステップとを含む。   According to one aspect of the present invention, there is provided a method for calculating the center position of a detection object including at least a part of a cylinder or a sphere having a known radius. The method includes obtaining an input image obtained by imaging at least one detection object, extracting a region corresponding to the shape of the detection object from the input image, and obtaining height information about the extracted region. Identifying a portion where the brightness is maximized in the extracted region, determining a normal direction of the portion, determining the normal direction, a known radius, and determining that the brightness is a maximum. Determining the center position of the detection target object from the position of the corresponding portion and the corresponding height information.

好ましくは、法線方向を決定するステップは、検出対象物の光学反射特性に依存して、法線方向の決定方法を異ならせる。   Preferably, in the step of determining the normal direction, the method of determining the normal direction is made different depending on the optical reflection characteristic of the detection target.

さらに好ましくは、入力画像は、少なくとも1つの検出対象物に対して第1の方向から照明光を照射した状態で、第1の方向とは異なる第2の方向に視線を向けて配置された撮像装置を用いて撮像することで取得される。   More preferably, the input image is an image in which at least one detection object is irradiated with illumination light from the first direction and arranged with a line of sight in a second direction different from the first direction. Acquired by imaging using the apparatus.

さらに好ましくは、法線方向を決定するステップは、検出対象物の表面が鏡面反射する場合には、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源に向けて延びる第1のベクトルと、当該三次元座標点を通り、かつ、撮像装置の方向に延びる第2のベクトルとの、二等分角に相当するベクトルを法線ベクトルとして算出するステップを含む。   More preferably, in the step of determining the normal direction, when the surface of the detection target is specularly reflected, the three-dimensional coordinate point determined from the position of the portion where the brightness is maximum and the corresponding height information And a vector corresponding to a bisection angle between a first vector extending toward the light source of the illumination light and a second vector passing through the three-dimensional coordinate point and extending in the direction of the imaging device As a normal vector.

あるいはさらに好ましくは、法線方向を決定するステップは、検出対象物の表面が拡散反射する場合には、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源に向けて延びるベクトルを法線ベクトルとして算出するステップを含む。   Alternatively, more preferably, in the step of determining the normal direction, when the surface of the detection object is diffusely reflected, the three-dimensional coordinates determined from the position of the portion where the brightness is maximum and the corresponding height information Calculating a vector passing through the point and extending toward the light source of the illumination light as a normal vector.

あるいはさらに好ましくは、高さ情報を取得するステップは、少なくとも1つの検出対象物に対して、第1の方向から複数の異なる濃淡パターンを照射するとともに、それぞれの照射時に撮像装置によりそれぞれ撮像された複数の画像を用いて、高さ情報を取得する。   Alternatively, more preferably, the step of acquiring the height information irradiates the at least one detection object with a plurality of different shading patterns from the first direction, and each image is captured by the imaging device at the time of each irradiation. Height information is acquired using a plurality of images.

あるいはさらに好ましくは、入力画像を取得するステップは、少なくとも1つの検出対象物に対して第1の方向から照明光を照射しない状態で撮像装置により取得された第1の画像と、少なくとも1つの検出対象物に対して第1の方向から照明光を照射した状態で撮像装置により取得された第2の画像との差分から入力画像を生成するステップを含む。   Alternatively, more preferably, the step of acquiring the input image includes the first image acquired by the imaging device in a state where the illumination light is not irradiated from the first direction to the at least one detection object, and at least one detection. Including a step of generating an input image from a difference from the second image acquired by the imaging device in a state in which illumination light is irradiated from the first direction to the object.

好ましくは、中心位置を決定するステップは、同一の検出対象物について決定された複数の中心位置から当該検出対象物の中心軸を決定するステップを含む。   Preferably, the step of determining the center position includes a step of determining a center axis of the detection object from a plurality of center positions determined for the same detection object.

好ましくは、本方法は、決定した検出対象物の中心位置を出力するステップをさらに含む。   Preferably, the method further includes a step of outputting the determined center position of the detection object.

この発明の別の局面に従えば、既知の半径を有する円筒または球を少なくとも一部に含む検出対象物の中心位置を算出する装置を提供する。当該装置は、撮像装置と接続され、少なくとも1つの検出対象物を撮像した入力画像を取得するインターフェイスと、検出対象物の形状に相当する領域を入力画像から抽出する手段と、抽出された領域についての高さ情報を取得する手段と、抽出された領域内において明るさが極大となる部分を特定し、当該部分の法線方向を決定する手段と、決定した法線方向と、既知の半径と、明るさが極大となる部分の位置と、対応する高さ情報とから、検出対象物の中心位置を決定する手段とを含む。   According to another aspect of the present invention, there is provided an apparatus for calculating a center position of a detection object including at least a part of a cylinder or a sphere having a known radius. The apparatus is connected to an imaging apparatus, acquires an input image obtained by imaging at least one detection object, means for extracting an area corresponding to the shape of the detection object from the input image, and the extracted area Means for obtaining the height information, means for identifying the part where the brightness is maximized in the extracted region, determining the normal direction of the part, the determined normal direction, and the known radius And means for determining the center position of the detection object from the position of the portion where the brightness is maximum and the corresponding height information.

この発明のさらに別の局面に従えば、既知の半径を有する円筒または球を少なくとも一部に含む検出対象物の中心位置を算出するためのプログラムを提供する。当該プログラムは、コンピュータに、少なくとも1つの検出対象物を撮像した入力画像を取得するステップと、検出対象物の形状に相当する領域を入力画像から抽出するステップと、抽出された領域についての高さ情報を取得するステップと、抽出された領域内において明るさが極大となる部分を特定し、当該部分の法線方向を決定するステップと、決定した法線方向と、既知の半径と、明るさが極大となる部分の位置と、対応する高さ情報とから、検出対象物の中心位置を決定するステップとを実行させる。   According to still another aspect of the present invention, there is provided a program for calculating the center position of a detection object including at least a part of a cylinder or a sphere having a known radius. The program includes, in a computer, obtaining an input image obtained by imaging at least one detection target, extracting a region corresponding to the shape of the detection target from the input image, and height of the extracted region. A step of acquiring information, a step of identifying a portion where brightness is maximized in the extracted region, a step of determining a normal direction of the portion, a determined normal direction, a known radius, and a brightness The step of determining the center position of the detection target object is executed from the position of the portion where is maximum and the corresponding height information.

本発明によれば、複数の検出対象物が任意の方向を向いて配置されている場合であっても、それぞれの検出対象物の中心位置を算出することができる。   According to the present invention, even if a plurality of detection objects are arranged in an arbitrary direction, the center position of each detection object can be calculated.

本発明の実施の形態に係る画像処理装置を含む把持システムの全体構成を示す概略図である。1 is a schematic diagram showing an overall configuration of a gripping system including an image processing apparatus according to an embodiment of the present invention. 本発明の実施の形態に係る画像処理装置の概略構成図である。1 is a schematic configuration diagram of an image processing apparatus according to an embodiment of the present invention. 本実施の形態に係る画像処理装置において実行される全体処理手順を示すフローチャートである。It is a flowchart which shows the whole process sequence performed in the image processing apparatus which concerns on this Embodiment. 本発明の実施の形態に係る前処理の処理例を示す図である。It is a figure which shows the process example of the pre-processing which concerns on embodiment of this invention. 本発明の実施の形態に係るシェーディング処理の処理例を示す図である。It is a figure which shows the process example of the shading process which concerns on embodiment of this invention. 本発明の実施の形態に係る三次元計測処理に用いられるパターンの一例を示す図である。It is a figure which shows an example of the pattern used for the three-dimensional measurement process which concerns on embodiment of this invention. 本発明の実施の形態に係る三次元計測処理の処理例を示す図である。It is a figure which shows the process example of the three-dimensional measurement process which concerns on embodiment of this invention. 本実施の形態に係る法線算出処理の原理的な説明を行うための図である。It is a figure for demonstrating the principle of the normal calculation process which concerns on this Embodiment. 本実施の形態に係る画像処理装置において実行される法線算出処理のより詳細な手順を示すフローチャートである。It is a flowchart which shows the more detailed procedure of the normal calculation process performed in the image processing apparatus which concerns on this Embodiment. 本実施の形態に係る明るさが極大となる部分を抽出する処理の処理例を示す図である。It is a figure which shows the process example of the process which extracts the part which the brightness which concerns on this Embodiment becomes maximum. 本実施の形態に係る光線ベクトルの算出処理を説明するための図である。It is a figure for demonstrating the calculation process of the light vector which concerns on this Embodiment. 本実施の形態に係る法線算出処理を説明するための図である。It is a figure for demonstrating the normal line calculation process which concerns on this Embodiment. 本実施の形態に係る位置算出処理を説明するための図である。It is a figure for demonstrating the position calculation process which concerns on this Embodiment. 本発明の実施の形態に係る画像処理によって生成された認識結果の一例を示す図である。It is a figure which shows an example of the recognition result produced | generated by the image processing which concerns on embodiment of this invention.

本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。   Embodiments of the present invention will be described in detail with reference to the drawings. Note that the same or corresponding parts in the drawings are denoted by the same reference numerals and description thereof will not be repeated.

《A.概要》
本実施の形態に係る画像処理方法は、既知の半径を有する円筒または球を少なくとも一部に含む検出対象物(ワークW)の中心位置を算出する方法に向けられている。本実施の形態に係る画像処理方法においては、一種の面光源であるプロジェクタからワークWに対して照明光(白色光)を投影し、撮像装置を用いて、当該照明光の投影によって生じる反射光を撮像する。この撮像によって得られた入力画像に対して、明るさが極大となる部分(輝度極大部分)の位置情報および高さ情報(すなわち、三次元座標系における座標値)から、ワークWの円筒断面を考慮して、その円筒断面の半径および明るさが極大となる部分(輝度極大部分)の位置情報(三次元座標値)を用いて、ワークWの中心位置を決定する。なお、ワークWの反射特性に依存して、中心位置を算出する方法を異ならせることが好ましい。
<< A. Overview"
The image processing method according to the present embodiment is directed to a method for calculating the center position of a detection target (work W) including at least a part of a cylinder or a sphere having a known radius. In the image processing method according to the present embodiment, illumination light (white light) is projected onto a work W from a projector that is a kind of surface light source, and reflected light generated by projection of the illumination light using an imaging device. Image. From the input image obtained by this imaging, the cylindrical cross section of the workpiece W is obtained from the position information and height information (that is, the coordinate value in the three-dimensional coordinate system) of the portion where the brightness is maximum (the luminance maximum portion). Considering this, the position of the center of the workpiece W is determined using position information (three-dimensional coordinate values) of a portion (luminance maximum portion) where the radius and brightness of the cylindrical cross section are maximum. Depending on the reflection characteristics of the workpiece W, it is preferable to vary the method for calculating the center position.

このように、本実施の形態に係る画像処理方法は、二次元画像に対する画像処理の結果と、同一のワークWを三次元計測することで高さ情報とを用いて、より少ない処理量でワークWの中心位置を順次算出する。   As described above, the image processing method according to the present embodiment uses a result of image processing on a two-dimensional image and height information by three-dimensionally measuring the same workpiece W, and uses a smaller amount of work. The center position of W is calculated sequentially.

《B.全体装置構成》
図1は、本発明の実施の形態に係る画像処理装置100を含む把持システムSYSの全体構成を示す概略図である。図1に例示される把持システムSYSは、生産ラインなどに組み込まれ、トレーなどにばら積みされた検出対象物(ワークW)を1個ずつ把持するような処理を行う。なお、図1には、理解を容易にするため、トレー内に2つのワークWのみが存在する場合を図示するが、多数のワークWが重なった状態で配置されていてもよい。
<< B. Overall device configuration >>
FIG. 1 is a schematic diagram showing an overall configuration of a gripping system SYS including an image processing apparatus 100 according to an embodiment of the present invention. A gripping system SYS illustrated in FIG. 1 performs a process of gripping detection objects (workpieces W) that are incorporated in a production line or the like and stacked in a tray or the like one by one. Note that FIG. 1 illustrates a case where only two workpieces W exist in the tray for easy understanding, but a large number of workpieces W may be arranged in an overlapping state.

ここで、ワークWは、図示しない上流側の製造装置などから搬送されるため、そのトレー内での向きはランダムになっているものとする。そこで、把持システムSYS(主とし、画像処理装置100)は、円筒または球を少なくとも一部に含む検出対象物(ワークW)の中心位置を算出し、この算出した中心位置を利用して把持動作を行う。ここで、ワークWの寸法などは予め分かっているので、円筒部分の半径は既知であるものとする。   Here, since the workpiece | work W is conveyed from the upstream manufacturing apparatus etc. which are not shown in figure, the direction in the tray shall be random. Therefore, the gripping system SYS (mainly, the image processing apparatus 100) calculates the center position of the detection target (work W) including at least a part of the cylinder or the sphere, and uses the calculated center position to perform the gripping operation. I do. Here, since the dimension of the workpiece W is known in advance, the radius of the cylindrical portion is assumed to be known.

なお、以下の説明では、主として、円筒の中でも円柱形状を有するワークW(たとえば、ボルト)を想定して説明を行うが、U字型のパイプのような円筒形状のものや、球状のものであっても同様に適用できる。すなわち、本実施の形態に係る中心位置の算出方法は、円状の断面を有する物体について汎用的に適用可能である。   In the following description, the description will be given mainly assuming a workpiece W (for example, a bolt) having a columnar shape among cylinders, but it is a cylindrical shape such as a U-shaped pipe or a spherical shape. Even if it exists, it is applicable similarly. That is, the calculation method of the center position according to the present embodiment can be generally applied to an object having a circular cross section.

より具体的には、把持システムSYSは、画像処理装置100と、ロボットコントローラ200と、ロボット300とを含む。画像処理装置100には、プロジェクタ(照明装置)7および撮像装置8が接続されている。   More specifically, the gripping system SYS includes an image processing apparatus 100, a robot controller 200, and a robot 300. A projector (illumination device) 7 and an imaging device 8 are connected to the image processing apparatus 100.

後述するように、プロジェクタ7は、一種の面光源として機能するとともに、画像処理装置100からの指示に従って任意の濃淡パターンの照明光を所定位置(ワークWを含むトレーが配置される位置)に投影できるものとする。この任意の濃淡パターンは、照射面内で明るさが均一であるパターンおよび照射面内の所定方向に沿って明るさが周期的に変化するパターンを含む。   As will be described later, the projector 7 functions as a kind of surface light source, and projects illumination light of an arbitrary shade pattern onto a predetermined position (a position where a tray including the workpiece W is disposed) according to an instruction from the image processing apparatus 100. It shall be possible. This arbitrary shading pattern includes a pattern in which the brightness is uniform in the irradiation surface and a pattern in which the brightness changes periodically along a predetermined direction in the irradiation surface.

撮像装置8は、プロジェクタ7によって照射された照明光がワークWの表面で反射した光を撮像する。そして、撮像装置8は、このワークWからの反射光(ワークWの像)を示す画像(以下、「入力画像」とも称す。)を出力する。   The imaging device 8 images the light reflected by the surface of the workpiece W from the illumination light irradiated by the projector 7. Then, the imaging device 8 outputs an image (hereinafter also referred to as “input image”) indicating the reflected light (image of the workpiece W) from the workpiece W.

本実施の形態においては、プロジェクタ7と撮像装置8との間の相対的な位置姿勢関係は既知であるとする。すなわち、プロジェクタ7が照明光を照射する方向(第1の方向)およびその配置位置と、撮像装置8の視線方向(第2の方向)およびその配置位置とは、予め取得されている。なお、このようなプロジェクタ7と撮像装置8との間の相対的な位置姿勢関係は、キャリブレーション処理によって得られるキャリブレーションデータに反映される。このキャリブレーションデータの具体的な内容としては、プロジェクタ7と撮像装置8との三次元的な位置姿勢(三次元座標上の座標(x,y,z)および角度(α,β,γ))やそれらの視野角など情報を含む。   In the present embodiment, it is assumed that the relative position and orientation relationship between the projector 7 and the imaging device 8 is known. That is, the direction in which the projector 7 irradiates illumination light (first direction) and its arrangement position, and the line-of-sight direction (second direction) of the imaging device 8 and its arrangement position are acquired in advance. Note that the relative position and orientation relationship between the projector 7 and the imaging device 8 is reflected in the calibration data obtained by the calibration process. Specific contents of the calibration data include a three-dimensional position and orientation (coordinates (x, y, z) and angles (α, β, γ) on three-dimensional coordinates) between the projector 7 and the imaging device 8. And information such as their viewing angle.

より具体的には、プロジェクタ7は、主要なコンポーネントとして、LED(Light Emitting Diode)やハロゲンランプなどの光源と、プロジェクタ7の照射面の側に配置されたフィルタとを含む。プロジェクタ7に用いられる光源は、波長範囲が比較的広いものが好ましい。また、フィルタは、後述するような三次元計測に必要な濃淡パターンを発生させるものであり、画像処理装置100などからの指令に従って、面内の透光率を任意に変化させることができる。   More specifically, the projector 7 includes, as main components, a light source such as an LED (Light Emitting Diode) or a halogen lamp, and a filter disposed on the irradiation surface side of the projector 7. The light source used for the projector 7 preferably has a relatively wide wavelength range. The filter generates a shading pattern necessary for three-dimensional measurement, which will be described later, and can arbitrarily change the in-plane transmissivity according to a command from the image processing apparatus 100 or the like.

撮像装置8は、主要なコンポーネントとして、レンズなどの光学系と、CCD(Coupled Charged Device)やCMOS(Complementary Metal Oxide Semiconductor)センサといった撮像素子とを含む。   The imaging device 8 includes, as main components, an optical system such as a lens, and an imaging element such as a CCD (Coupled Charged Device) or a CMOS (Complementary Metal Oxide Semiconductor) sensor.

画像処理装置100は、典型的には、汎用的なアーキテクチャを有しているコンピュータであり、予めインストールされたプログラム(命令コード)を実行することで、本実施の形態に係る画像処理機能を提供する。このようなプログラムは、典型的には、各種記録媒体などに格納された状態で流通し、あるいは、ネットワークなどを介して画像処理装置100にインストールされる。   The image processing apparatus 100 is typically a computer having a general-purpose architecture, and provides an image processing function according to the present embodiment by executing a preinstalled program (instruction code). To do. Such a program is typically distributed in a state of being stored in various recording media or installed in the image processing apparatus 100 via a network or the like.

このような汎用的なコンピュータを利用する場合には、本実施の形態に係る機能を提供するためのアプリケーションに加えて、コンピュータの基本的な機能を提供するためのOS(Operating System)がインストールされていてもよい。この場合には、本実施の形態に係るプログラムは、OSの一部として提供されるプログラムモジュールのうち、必要なモジュールを所定の配列で所定のタイミングで呼出して処理を実行させるものであってもよい。すなわち、本実施の形態に係るプログラム自体は、上記のようなモジュールを含んでおらず、OSと協働して処理が実行されてもよい。本実施の形態に係るプログラムとしては、このような一部のモジュールを含まない形態であってもよい。   When using such a general-purpose computer, an OS (Operating System) for providing basic functions of the computer is installed in addition to the application for providing the functions according to the present embodiment. It may be. In this case, the program according to the present embodiment may be a program module that is provided as a part of the OS and calls a necessary module at a predetermined timing in a predetermined arrangement to execute processing. Good. That is, the program itself according to the present embodiment does not include the module as described above, and the process may be executed in cooperation with the OS. The program according to the present embodiment may be a form that does not include some of such modules.

さらに、本実施の形態に係るプログラムは、他のプログラムの一部に組込まれて提供されるものであってもよい。その場合にも、プログラム自体には、上記のような組合せられる他のプログラムに含まれるモジュールを含んでおらず、当該他のプログラムと協働して処理が実行される。すなわち、本実施の形態に係るプログラムとしては、このような他のプログラムに組込まれた形態であってもよい。なお、プログラムの実行により提供される機能の一部もしくは全部を専用のハードウェア回路として実装してもよい。   Furthermore, the program according to the present embodiment may be provided by being incorporated in a part of another program. Even in that case, the program itself does not include the modules included in the other programs to be combined as described above, and the processing is executed in cooperation with the other programs. That is, the program according to the present embodiment may be in a form incorporated in such another program. A part or all of the functions provided by executing the program may be implemented as a dedicated hardware circuit.

図2は、本発明の実施の形態に係る画像処理装置100の概略構成図である。図2を参照して、画像処理装置100は、演算処理部であるCPU(Central Processing Unit)110と、記憶部としてのメインメモリ112およびハードディスク114と、カメラインターフェイス116と、入力インターフェイス118と、表示コントローラ120と、プロジェクタインターフェイス122と、通信インターフェイス124と、データリーダ/ライタ126とを含む。これらの各部は、バス128を介して、互いにデータ通信可能に接続される。   FIG. 2 is a schematic configuration diagram of the image processing apparatus 100 according to the embodiment of the present invention. Referring to FIG. 2, an image processing apparatus 100 includes a CPU (Central Processing Unit) 110 that is an arithmetic processing unit, a main memory 112 and a hard disk 114 as a storage unit, a camera interface 116, an input interface 118, and a display. A controller 120, a projector interface 122, a communication interface 124, and a data reader / writer 126 are included. These units are connected to each other via a bus 128 so that data communication is possible.

CPU110は、ハードディスク114にインストールされたプログラム(コード)をメインメモリ112に展開して、これらを所定順序で実行することで、各種の演算を実施する。メインメモリ112は、典型的には、DRAM(Dynamic Random Access Memory)などの揮発性の記憶装置であり、ハードディスク114から読み出されたプログラムに加えて、撮像装置8によって取得された入力画像、キャリブレーションデータ、計測結果に関する情報などを保持する。さらに、ハードディスク114には、各種設定値などが格納されてもよい。なお、ハードディスク114に加えて、あるいは、ハードディスク114に代えて、フラッシュメモリなどの半導体記憶装置を採用してもよい。   The CPU 110 performs various operations by developing programs (codes) installed in the hard disk 114 in the main memory 112 and executing them in a predetermined order. The main memory 112 is typically a volatile storage device such as a DRAM (Dynamic Random Access Memory), and in addition to a program read from the hard disk 114, an input image acquired by the imaging device 8, calibration, and the like. Data related to measurement data and measurement results. Further, the hard disk 114 may store various setting values. In addition to the hard disk 114 or instead of the hard disk 114, a semiconductor storage device such as a flash memory may be employed.

カメラインターフェイス116は、CPU110と撮像装置8との間のデータ伝送を仲介する。すなわち、カメラインターフェイス116は、ワークWを撮像して入力画像を生成するための撮像装置8と接続される。より具体的には、カメラインターフェイス116は、1つ以上の撮像装置8と接続が可能であり、撮像装置8からの入力画像を一時的に蓄積するための画像バッファ116aを含む。そして、カメラインターフェイス116は、画像バッファ116aに所定コマ数の入力画像が蓄積されると、その蓄積された入力画像をメインメモリ112へ転送する。また、カメラインターフェイス116は、CPU110が発生した内部コマンドに従って、撮像装置8に対して撮像コマンドを与える。   The camera interface 116 mediates data transmission between the CPU 110 and the imaging device 8. That is, the camera interface 116 is connected to the imaging device 8 for imaging the workpiece W and generating an input image. More specifically, the camera interface 116 can be connected to one or more imaging devices 8 and includes an image buffer 116 a for temporarily storing an input image from the imaging device 8. Then, when an input image having a predetermined number of frames is accumulated in the image buffer 116 a, the camera interface 116 transfers the accumulated input image to the main memory 112. In addition, the camera interface 116 gives an imaging command to the imaging device 8 in accordance with an internal command generated by the CPU 110.

入力インターフェイス118は、CPU110とマウス104、キーボード、タッチパネルなどの入力部との間のデータ伝送を仲介する。すなわち、入力インターフェイス118は、ユーザが入力部を操作することで与えられる操作指令を受付ける。   The input interface 118 mediates data transmission between the CPU 110 and an input unit such as a mouse 104, a keyboard, or a touch panel. That is, the input interface 118 accepts an operation command given by the user operating the input unit.

表示コントローラ120は、表示装置の典型例であるディスプレイ102と接続され、CPU110における処理結果などをユーザに通知する。すなわち、表示コントローラ120は、ディスプレイ102に接続され、当該ディスプレイ102での表示を制御する。   The display controller 120 is connected to the display 102 which is a typical example of a display device, and notifies the user of the processing result in the CPU 110. In other words, the display controller 120 is connected to the display 102 and controls display on the display 102.

プロジェクタインターフェイス122は、CPU110とプロジェクタ7との間のデータ伝送を仲介する。より具体的には、プロジェクタインターフェイス122は、CPU110が発生した内部コマンドに従って、プロジェクタ7に対して照明コマンドを与える。   The projector interface 122 mediates data transmission between the CPU 110 and the projector 7. More specifically, the projector interface 122 gives an illumination command to the projector 7 according to an internal command generated by the CPU 110.

通信インターフェイス124は、CPU110とコンソール(あるいは、パーソナルコンピュータやサーバ装置)などとの間のデータ伝送を仲介する。通信インターフェイス124は、典型的には、イーサネット(登録商標)やUSB(Universal Serial Bus)などからなる。   The communication interface 124 mediates data transmission between the CPU 110 and a console (or a personal computer or server device). The communication interface 124 typically includes Ethernet (registered trademark), USB (Universal Serial Bus), or the like.

データリーダ/ライタ126は、CPU110と記録媒体であるメモリカード106との間のデータ伝送を仲介する。すなわち、メモリカード106には、画像処理装置100で実行されるプログラムなどが格納された状態で流通し、データリーダ/ライタ126は、このメモリカード106からプログラムを読出す。また、データリーダ/ライタ126は、CPU110の内部指令に応答して、撮像装置8によって取得された入力画像および/または画像処理装置100における処理結果などをメモリカード106へ書込む。なお、メモリカード106は、CF(Compact Flash)、SD(Secure Digital)などの汎用的な半導体記憶デバイスや、フレキシブルディスク(Flexible Disk)などの磁気記憶媒体や、CD−ROM(Compact Disk Read Only Memory)などの光学記憶媒体等からなる。   The data reader / writer 126 mediates data transmission between the CPU 110 and the memory card 106 that is a recording medium. That is, the memory card 106 circulates in a state where a program executed by the image processing apparatus 100 is stored, and the data reader / writer 126 reads the program from the memory card 106. Further, the data reader / writer 126 writes the input image acquired by the imaging device 8 and / or the processing result in the image processing device 100 to the memory card 106 in response to an internal command of the CPU 110. The memory card 106 is a general-purpose semiconductor storage device such as CF (Compact Flash) or SD (Secure Digital), a magnetic storage medium such as a flexible disk, or a CD-ROM (Compact Disk Read Only Memory). ) And other optical storage media.

また、画像処理装置100には、必要に応じて、プリンタなどの他の出力装置が接続されてもよい。   Further, the image processing apparatus 100 may be connected to another output device such as a printer as necessary.

再度図1を参照して、ロボット300は、ワークWを把持するためのハンド機構と、当該ハンド機構を任意の位置および方向に位置決めするための関節機構とを含む。ロボット300は、ロボットコントローラ200によってその動作が制御される。   Referring to FIG. 1 again, robot 300 includes a hand mechanism for gripping workpiece W and a joint mechanism for positioning the hand mechanism in an arbitrary position and direction. The operation of the robot 300 is controlled by the robot controller 200.

ロボットコントローラ200は、画像処理装置100によって算出されたワークWの中心位置(中心軸)を示す情報に基づいて、ワークWの位置や姿勢を認識するとともに、当該認識された各ワークWの位置や姿勢に基づいて、ロボット300のハンド機構を適切な位置および方向に位置決めするための指令を生成し、ロボット300へ出力する。この指令に応答して、ロボット300は、ワークWの把持動作を開始する。   The robot controller 200 recognizes the position and orientation of the workpiece W based on the information indicating the center position (center axis) of the workpiece W calculated by the image processing apparatus 100, and also recognizes the position of each recognized workpiece W, Based on the attitude, a command for positioning the hand mechanism of the robot 300 in an appropriate position and direction is generated and output to the robot 300. In response to this command, the robot 300 starts gripping the workpiece W.

《C.全体処理》
図3は、本実施の形態に係る画像処理装置100において実行される全体処理手順を示すフローチャートである。図3に示す各ステップは、基本的には、画像処理装置100のCPU110によって実行される。
<< C. Overall processing >>
FIG. 3 is a flowchart showing an overall processing procedure executed in the image processing apparatus 100 according to the present embodiment. Each step shown in FIG. 3 is basically executed by the CPU 110 of the image processing apparatus 100.

図3を参照して、画像処理装置100のCPU110は、前処理を実行する(ステップS1)。この前処理は、ばら積み状態の少なくとも1つのワークWを撮像した入力画像を取得する処理を含む。この入力画像の取得方法の典型例としては、図1に示すような撮像装置8を用いて撮像された画像を画像処理装置100に入力する方法が挙げられる。但し、撮像装置8を用いて撮像して得られた入力画像を蓄積しておき、事後的に画像処理装置100に入力するような形態であってもよい。このような処理方法は、ワークWに対する把持動作に異常があった場合などの原因究明に利用されるようなときに好適である。   Referring to FIG. 3, CPU 110 of image processing apparatus 100 performs preprocessing (step S1). This pre-processing includes processing for acquiring an input image obtained by imaging at least one workpiece W in a bulk state. A typical example of this input image acquisition method is a method of inputting an image captured using the imaging device 8 as shown in FIG. However, the input image obtained by imaging using the imaging device 8 may be stored and input to the image processing device 100 afterwards. Such a processing method is suitable for use in investigating the cause, such as when there is an abnormality in the gripping operation on the workpiece W.

さらに、本実施の形態においては、ワークWの周囲からの外乱光の影響を排除するために、シェーディング画像が生成される。このシェーディング画像は、プロジェクタ7から照明光を照射した状態(環境光+照明光)で撮像して得られる画像と、プロジェクタ7から照明光を照射していない状態(環境光のみ)で撮像して得られる画像との差分によって生成される。言い換えれば、ステップS1に示す前処理は、少なくとも1つのワークWに対して照明光を照射しない状態で撮像装置8により取得された画像と、当該少なくとも1つのワークWに対して照明光を照射した状態で撮像装置8により取得された画像との差分から入力画像を生成する処理を含む。このシェーディング画像生成処理の詳細については、後述する。   Furthermore, in the present embodiment, a shading image is generated in order to eliminate the influence of disturbance light from around the work W. This shading image is captured in an image obtained by illuminating illumination light from the projector 7 (environment light + illumination light) and in a state in which illumination light is not illuminated from the projector 7 (only ambient light). It is generated by the difference from the obtained image. In other words, in the preprocessing shown in step S1, the image acquired by the imaging device 8 in a state where the illumination light is not irradiated on at least one workpiece W and the illumination light is irradiated on the at least one workpiece W. The process which produces | generates an input image from the difference with the image acquired by the imaging device 8 in the state is included. Details of this shading image generation processing will be described later.

前処理の実行後、画像処理装置100のCPU110は、セグメンテーション処理を実行する(ステップS2)。このセグメンテーション処理は、入力画像に含まれるワークWの位置を特定するための処理である。すなわち、セグメンテーション処理は、ワークWの形状に相当する領域を入力画像から抽出する処理を含む。このワークWの形状に相当する領域を便宜上「円筒領域」とも称す。このセグメンテーション処理の詳細については、後述する。   After executing the preprocessing, the CPU 110 of the image processing apparatus 100 executes a segmentation process (step S2). This segmentation process is a process for specifying the position of the workpiece W included in the input image. That is, the segmentation process includes a process of extracting an area corresponding to the shape of the workpiece W from the input image. An area corresponding to the shape of the workpiece W is also referred to as a “cylindrical area” for convenience. Details of this segmentation processing will be described later.

セグメンテーション処理の実行後、画像処理装置100のCPU110は、三次元計測処理を実行する(ステップS3)。この三次元計測処理は、ステップS2において抽出された円筒領域についての高さ情報を取得する処理である。このような三次元計測処理の一例として、本実施の形態においては位相シフト法を採用する。位相シフト法を採用することで、上述のステップS1の前処理に必要なプロジェクタ(照明装置)7および撮像装置8を利用して、高さ情報を取得できるので、装置が簡素化できるという利点がある。   After execution of the segmentation process, the CPU 110 of the image processing apparatus 100 executes a three-dimensional measurement process (step S3). This three-dimensional measurement process is a process for acquiring height information about the cylindrical region extracted in step S2. As an example of such a three-dimensional measurement process, a phase shift method is employed in the present embodiment. By adopting the phase shift method, the height information can be acquired using the projector (illumination device) 7 and the imaging device 8 necessary for the preprocessing in the above-described step S1, so that the apparatus can be simplified. is there.

もちろん、円筒領域についての高さ情報を取得できれば、どのような三次元計測処理を採用してもよい。たとえば、位相シフト法に代えて、空間コード法などを採用することもできる。さらに、画像処理装置100とは別の計測装置を用いて、ワークWの三次元位置情報などを取得し、この取得された三次元位置情報を画像処理装置100に入力するようにしてもよい。この三次元計測処理(位相シフト法)の詳細については、後述する。   Of course, any three-dimensional measurement process may be adopted as long as the height information about the cylindrical region can be acquired. For example, a spatial code method or the like can be employed instead of the phase shift method. Further, a three-dimensional position information of the workpiece W may be acquired using a measuring device different from the image processing apparatus 100, and the acquired three-dimensional position information may be input to the image processing apparatus 100. Details of the three-dimensional measurement process (phase shift method) will be described later.

三次元計測処理の実行後、画像処理装置100のCPU110は、法線算出処理を実行する(ステップS4)。この法線算出処理は、ステップS2において抽出された円筒領域内において明るさ(典型的には、輝度)が極大となる部分を特定し、ワークWにおける当該部分の法線方向を決定する処理である。このステップS4において決定される法線は、三次元空間におけるベクトル量として算出される。   After executing the three-dimensional measurement process, the CPU 110 of the image processing apparatus 100 executes a normal line calculation process (step S4). This normal calculation processing is processing for specifying a portion where brightness (typically luminance) is maximized in the cylindrical region extracted in step S2 and determining the normal direction of the portion in the workpiece W. is there. The normal determined in step S4 is calculated as a vector quantity in a three-dimensional space.

特に、本実施の形態に係る画像処理装置100においては、ワークWの表面における反射特性を利用して法線を算出する。より具体的には、ステップS4の法線算出処理は、ワークWの光学反射特性(鏡面反射/拡散反射)に依存して、法線方向の決定方法を異ならせる。この法線方向の決定方法の詳細については、後述する。   In particular, in the image processing apparatus 100 according to the present embodiment, the normal line is calculated using the reflection characteristics on the surface of the workpiece W. More specifically, the normal line calculation process in step S4 varies the normal direction determination method depending on the optical reflection characteristics (specular reflection / diffuse reflection) of the workpiece W. Details of the method for determining the normal direction will be described later.

法線方向の決定後、画像処理装置100のCPU110は、位置算出処理を実行する(ステップS5)。この位置算出処理は、ステップS4において決定した法線方向と、既知のワークWの半径と、明るさが極大となる部分の位置と、対応する高さ情報(ステップS3において取得)とから、ワークWの中心位置を決定する処理を含む。ワークWの形状に依存して、このステップS5においては、同一のワークWについて決定された複数の中心位置から当該ワークWの中心軸を決定する処理を含む。すなわち、法線と半径情報とを利用して、円筒状のワークWの中心軸が算出される。なお、ワークWが球である場合には、基本的には、一つの中心位置(中心点)のみが算出されるので、中心軸は算出されない。   After determining the normal direction, the CPU 110 of the image processing apparatus 100 executes position calculation processing (step S5). This position calculation process is performed based on the normal direction determined in step S4, the known radius of the workpiece W, the position of the portion where the brightness is maximized, and the corresponding height information (obtained in step S3). The process of determining the center position of W is included. Depending on the shape of the workpiece W, this step S5 includes processing for determining the center axis of the workpiece W from a plurality of center positions determined for the same workpiece W. That is, the central axis of the cylindrical workpiece W is calculated using the normal line and the radius information. When the workpiece W is a sphere, basically only one center position (center point) is calculated, so the center axis is not calculated.

位置算出処理の実行後、画像処理装置100のCPU110は、出力処理を実行する(ステップS6)。この出力処理は、ステップS5において決定されたワークWの中心位置の情報をロボットコントローラ200(図2)などへ出力する処理である。この出力される中心位置の情報は、三次元空間上の座標値やベクトルを示す値を含む。なお、画像処理装置100が三次元計測によって取得する座標系と、ロボット300の処理において利用される座標系とは一致していない場合も多いので、ロボット300が扱う三次元空間上の座標値に変換して出力することが好ましい。また、複数のワークWがばら積みされているような状況では、複数のワークWについて中心位置の情報が取得された場合には、それぞれのワークWを識別するための情報とともに、対応する中心位置の情報を出力するようにしてもよい。あるいは、最上部に位置する、すなわち算出された中心位置が最も確からしいワークWについての情報のみを出力してもよい。図1に示すような把持システムSYSでは、このワークWの中心位置の情報が出力されることに伴って、ロボット300が最上部のワークWを把持するので、当該ワークWが取り除かれた状態で再度計測処理を実行するようにしてもよい。   After execution of the position calculation process, the CPU 110 of the image processing apparatus 100 executes an output process (step S6). This output process is a process of outputting information on the center position of the workpiece W determined in step S5 to the robot controller 200 (FIG. 2) or the like. The output center position information includes a coordinate value in a three-dimensional space and a value indicating a vector. In many cases, the coordinate system acquired by the image processing apparatus 100 through three-dimensional measurement and the coordinate system used in the processing of the robot 300 do not coincide with each other. It is preferable to convert and output. Further, in a situation where a plurality of workpieces W are stacked, when information on the center position is acquired for the plurality of workpieces W, information for identifying each workpiece W and the corresponding center position are obtained. Information may be output. Or you may output only the information about the workpiece | work W located in the uppermost part, ie, the calculated center position most likely. In the gripping system SYS as shown in FIG. 1, the robot 300 grips the uppermost workpiece W as the information on the center position of the workpiece W is output, so that the workpiece W is removed. The measurement process may be executed again.

なお、図3に示すフローチャートにおいて、ステップS2のセグメンテーション処理と、ステップS3の三次元計測処理とを並列的に実行するようにしてもよい。   In the flowchart shown in FIG. 3, the segmentation process in step S2 and the three-dimensional measurement process in step S3 may be executed in parallel.

《D.前処理》
まず、図3に示す前処理(ステップS1)の詳細について説明する。上述したように、前処理は、環境光から撮像装置8に入射する光の影響を取り除き、プロジェクタ7からの照明光がワークWで反射して生じる光(反射光)のみを観測するための処理である。このような環境光の影響を取り除くため、プロジェクタ7から照明光を照射していない状態で取得される画像と、プロジェクタ7から照明光を照射している状態で取得される画像との差分から差分画像(シェーディング画像)が生成される。
<< D. Preprocessing"
First, details of the preprocessing (step S1) shown in FIG. 3 will be described. As described above, the preprocessing is a process for removing only the influence of light incident on the imaging device 8 from the ambient light and observing only light (reflected light) generated when the illumination light from the projector 7 is reflected by the workpiece W. It is. In order to remove the influence of such environmental light, a difference is obtained from a difference between an image acquired without illuminating illumination light from the projector 7 and an image acquired with illuminating illumination light from the projector 7. An image (shaded image) is generated.

図4は、本発明の実施の形態に係る前処理の処理例を示す図である。図4を参照して、本実施の形態に係る画像処理方法においては、ワークWの周囲からの外乱光(環境光)の影響を排除するために、(c)シェーディング画像が生成される。より具体的には、プロジェクタ7から白色パターンを照明光として照射した状態で撮像される画像(図4に示す(a)白色パターン投影+環境光画像)が取得される。白色パターンとは、照射面内における濃淡が均一とみなせるようなパターンを意味し、その照射面内におけるスペクトルの範囲や長さについて特に限定されるものではない。したがって、その照射面内が赤色や青色の光で均一化されているようなパターンを用いてもよい。   FIG. 4 is a diagram showing a processing example of the preprocessing according to the embodiment of the present invention. Referring to FIG. 4, in the image processing method according to the present embodiment, (c) a shading image is generated in order to eliminate the influence of disturbance light (environment light) from around the workpiece W. More specifically, an image ((a) white pattern projection + environment light image shown in FIG. 4) captured in a state where a white pattern is emitted as illumination light from the projector 7 is acquired. The white pattern means a pattern in which the light and shade in the irradiation surface can be regarded as uniform, and the range and length of the spectrum in the irradiation surface are not particularly limited. Therefore, a pattern in which the irradiation surface is uniformed with red or blue light may be used.

また、プロジェクタ7から照明光も照射していない状態で撮像される画像(図4に示す(b)環境光画像)が取得される。   In addition, an image ((b) ambient light image shown in FIG. 4) captured in a state where no illumination light is emitted from the projector 7 is acquired.

そして、これらの画像間の差分が計算されることで、シェーディング画像が生成される。この画像間の差分の計算とは、両画像の間で対応する画素についての色情報(たとえば、R,G,Bの各濃淡値)を減算するような処理を含む。   Then, the shading image is generated by calculating the difference between these images. The calculation of the difference between the images includes a process of subtracting color information (for example, R, G, and B gray values) for the corresponding pixels between the two images.

このような前処理については、特に、太陽光などの時間的に変化する環境光が撮像装置8の視野に入射しているような状況で有効である。言い換えれば、環境光が安定しており、プロジェクタ7が照射する照明光に対して相対的に小さいものであれば、このような前処理を省略してもよい。この場合には、図4に示す(a)白色パターン投影+環境光画像のみで以降の処理を行ってもよい。   Such preprocessing is particularly effective in a situation where ambient light that changes with time, such as sunlight, is incident on the field of view of the imaging device 8. In other words, if the ambient light is stable and relatively small with respect to the illumination light emitted by the projector 7, such pre-processing may be omitted. In this case, the subsequent processing may be performed only with (a) white pattern projection + ambient light image shown in FIG.

《E.セグメンテーション処理》
次に、図3に示すセグメンテーション処理(ステップS2)の詳細について説明する。上述したように、セグメンテーション処理は、入力画像に含まれるワークW(の一部)を示す領域(円筒領域)を抽出するための処理である。なお、入力画像としては、上述したような処理によって得られるシェーディング画像が用いられる。
<< E. Segmentation process >>
Next, the details of the segmentation process (step S2) shown in FIG. 3 will be described. As described above, the segmentation process is a process for extracting an area (cylindrical area) indicating (a part of) the workpiece W included in the input image. As the input image, a shading image obtained by the above-described processing is used.

このようなセグメンテーション処理としては、入力されたシェーディング画像(入力画像)を所定の規則で分割することで、円筒領域が抽出される。このような円筒領域の抽出方法としては、公知の各種の方法を採用することができる。シンプルな方法としては、入力画像内で明るさ(輝度または明度)がほぼ同様の値をもつ領域を特定する方法などが挙げられる。   As such a segmentation process, a cylindrical region is extracted by dividing an input shading image (input image) according to a predetermined rule. As a method for extracting such a cylindrical region, various known methods can be employed. As a simple method, there may be mentioned a method of specifying an area in which the brightness (luminance or brightness) has almost the same value in the input image.

本実施の形態においては、このようなセグメンテーション処理の一例として、"Normalized Cuts"法を採用する。この"Normalized Cuts"法の詳細については、「Jianbo Shi and Jitendra Malik, "Normalized Cuts and Image Segmentation", IEEE Transaction on Pattern Analysis and Machine Intelligence, Vol. 22, No. 8, August 2000」などを参照されたい。   In the present embodiment, the “Normalized Cuts” method is adopted as an example of such segmentation processing. For details of this "Normalized Cuts" method, refer to "Jianbo Shi and Jitendra Malik," Normalized Cuts and Image Segmentation ", IEEE Transaction on Pattern Analysis and Machine Intelligence, Vol. 22, No. 8, August 2000", etc. I want.

図5は、本発明の実施の形態に係るシェーディング処理の処理例を示す図である。図5に示す(a)入力画像に対して、上述の"Normalized Cuts"法を適用することで、(b)セグメンテーション結果のような結果画像が生成される。このようなセグメンテーション結果に対して、ワークWの形状に応じた条件を適用して、領域を抽出すると、(c)円筒領域抽出結果のような結果画像が生成される。基本的には、この抽出された円筒領域について、後続の処理が実行される。この抽出された円筒領域は、入力画像上の二次元座標系における座標値を用いて、その範囲が特定される。   FIG. 5 is a diagram illustrating a processing example of the shading processing according to the embodiment of the present invention. By applying the above-described “Normalized Cuts” method to (a) input image shown in FIG. 5, a result image such as (b) segmentation result is generated. When a region is extracted by applying a condition according to the shape of the workpiece W to such a segmentation result, a result image such as (c) a cylindrical region extraction result is generated. Basically, subsequent processing is performed on the extracted cylindrical region. The range of the extracted cylindrical region is specified using the coordinate value in the two-dimensional coordinate system on the input image.

《F.三次元計測処理》
次に、図3に示す三次元計測処理(ステップS3)の詳細について説明する。上述したように、三次元計測処理は、セグメンテーション処理によって抽出された円筒領域についての高さ情報を取得するための処理である。
<< F. Three-dimensional measurement process >>
Next, details of the three-dimensional measurement process (step S3) shown in FIG. 3 will be described. As described above, the three-dimensional measurement process is a process for acquiring height information about the cylindrical region extracted by the segmentation process.

このような高さ情報を取得する処理としては、公知の三次元計測処理を用いて、ばら積み状態のワークWの各部についての三次元座標値が算出される。上述したように、本実施の形態においては、三次元計測処理の具体例として位相シフト法が採用される。この位相シフト法は、照射面内において正弦波状に濃淡を変化させたパターンを有する照明光を照射した状態で撮像された画像(正弦波投影画像)を用いる方法である。   As a process for acquiring such height information, a three-dimensional coordinate value for each part of the workpiece W in a bulk state is calculated using a known three-dimensional measurement process. As described above, in the present embodiment, the phase shift method is employed as a specific example of the three-dimensional measurement process. This phase shift method is a method using an image (sine wave projection image) captured in a state where illumination light having a pattern in which shading is changed in a sine wave pattern on the irradiation surface is irradiated.

より具体的には、照射面内の濃淡の変化周期や位相を異ならせたパターンを複数用意し、それぞれのパターンを照射したときにそれぞれ撮像される画像を正弦波投影画像群として取得する。そして、これらの正弦波投影画像間における対応する部分の明るさ(輝度や明度)の変化に基づいて、各部分の高さ情報(三次元座標値)が算出される。   More specifically, a plurality of patterns having different shade change periods and phases in the irradiation surface are prepared, and images captured when the respective patterns are irradiated are acquired as sinusoidal projection image groups. Then, height information (three-dimensional coordinate values) of each part is calculated based on a change in brightness (luminance and brightness) of the corresponding part between the sine wave projection images.

図6は、本発明の実施の形態に係る三次元計測処理に用いられるパターンの一例を示す図である。図7は、本発明の実施の形態に係る三次元計測処理の処理例を示す図である。   FIG. 6 is a diagram showing an example of a pattern used in the three-dimensional measurement process according to the embodiment of the present invention. FIG. 7 is a diagram illustrating a processing example of the three-dimensional measurement processing according to the embodiment of the present invention.

図6(a)〜(d)に示すように、位相シフト法では、照射面内における濃淡パターンをその変化周期や位相を異ならせた複数のパターンが用いられる。このように異なる複数の濃淡パターンを用いることで、計測レンジを広げつつ計測対象物の三次元計測を行うことができる。   As shown in FIGS. 6A to 6D, in the phase shift method, a plurality of patterns are used in which the grayscale pattern in the irradiation surface has different change periods and phases. By using a plurality of different shade patterns in this way, it is possible to perform three-dimensional measurement of the measurement object while expanding the measurement range.

このような位相シフト法によって、図7の(a)正弦波投影画像群から(b)高さ画像を生成することができる。なお、図7には、理解を容易化するために、高さ情報を色情報(濃淡変化)で示した高さ画像を例示するが、位相シフト法においては、各部の高さ情報を含む三次元座標値が取得されることになる。   By such a phase shift method, (b) a height image can be generated from the (a) sine wave projection image group of FIG. FIG. 7 illustrates a height image in which height information is represented by color information (shading change) for easy understanding. In the phase shift method, a cubic including the height information of each part is illustrated. The original coordinate value is acquired.

このように、本実施の形態に従う三次元計測処理においては、ワークWに対して、プロジェクタ7が所定方向から複数の異なる濃淡パターンを照射するとともに、それぞれの照射時に撮像装置8によりそれぞれ撮像された複数の画像を用いて高さ情報が取得される。   As described above, in the three-dimensional measurement processing according to the present embodiment, the projector 7 irradiates the workpiece W with a plurality of different shade patterns from a predetermined direction, and each image is captured by the imaging device 8 at each irradiation. Height information is acquired using a plurality of images.

《G.法線算出処理》
次に、図3に示す法線算出処理(ステップS4)の詳細について説明する。上述したように、法線算出処理は、ワークWの表面に対する法線(法線ベクトル)を算出する処理である。
<< G. Normal calculation processing >>
Next, details of the normal calculation processing (step S4) shown in FIG. 3 will be described. As described above, the normal calculation processing is processing for calculating a normal (normal vector) to the surface of the workpiece W.

本実施の形態に係る画像処理方法においては、法線とワークWの半径との関係から、ワークWの中心位置を算出することで、より高速な処理を実現できる。さらに、より計測精度を高める観点から、後述するように、ワークWの光学反射特性(鏡面反射/拡散反射)に依存して、法線方向の決定方法を異ならせることも可能である。   In the image processing method according to the present embodiment, higher-speed processing can be realized by calculating the center position of the workpiece W from the relationship between the normal and the radius of the workpiece W. Furthermore, from the viewpoint of increasing the measurement accuracy, the normal direction determination method can be made different depending on the optical reflection characteristics (specular reflection / diffuse reflection) of the workpiece W, as will be described later.

以下、法線を算出する基本的な処理手順に加えて、このようなワークWの光学反射特性に依存して法線方向の決定方法を異ならせる処理についても説明する。   Hereinafter, in addition to the basic processing procedure for calculating the normal line, a process for changing the method for determining the normal direction depending on the optical reflection characteristics of the workpiece W will be described.

(g1:法線算出原理)
まず、本実施の形態に係る画像処理方法において法線を算出するための原理的な説明を行う。
(G1: Normal calculation principle)
First, the principle for calculating the normal in the image processing method according to the present embodiment will be described.

図8は、本実施の形態に係る法線算出処理の原理的な説明を行うための図である。図8には、ワークWの表面が鏡面反射特性を有する場合と、拡散反射特性を有する場合とに区別して例示している。   FIG. 8 is a diagram for explaining the principle of normal calculation processing according to the present embodiment. FIG. 8 illustrates a case where the surface of the workpiece W has a specular reflection characteristic and a case where the surface of the work W has a diffuse reflection characteristic.

(i)鏡面反射特性を有する場合
まず、ワークWの表面が鏡面反射特性を有する場合について説明する。ワークWが鏡面反射特性を有する場合には、ワークWの表面に入射した光は、その入射した位置の法線に対して定義される角度(入射角)と同じ角度で反射することになる。そのため、ワークWの表面のある位置を基準に見れば、プロジェクタ7からの照明光は、その入射角と同じ角度をもつ方向に大部分が反射されることになる。
(I) When it has specular reflection characteristics First, the case where the surface of the workpiece W has specular reflection characteristics will be described. When the workpiece W has specular reflection characteristics, the light incident on the surface of the workpiece W is reflected at the same angle as the angle (incident angle) defined with respect to the normal of the incident position. Therefore, when viewed from a certain position on the surface of the workpiece W, most of the illumination light from the projector 7 is reflected in a direction having the same angle as the incident angle.

また、撮像装置8に入射する光を示す入力画像内において最も明るい位置は、プロジェクタ7からの照明光が入射したワークWの表面位置に相当する。すなわち、図8に示す入力画像内の最大輝度の観測位置は、撮像装置8によって撮像される入力画像の輝度情報に基づいて取得することができる。そして、図8に示す入力画像内の最大輝度の観測位置を示す三次元座標値についても、上述の三次元計測処理などの結果から取得できる。   The brightest position in the input image indicating the light incident on the imaging device 8 corresponds to the surface position of the workpiece W on which the illumination light from the projector 7 is incident. That is, the maximum luminance observation position in the input image shown in FIG. 8 can be acquired based on the luminance information of the input image captured by the imaging device 8. The three-dimensional coordinate value indicating the maximum luminance observation position in the input image shown in FIG. 8 can also be obtained from the result of the above-described three-dimensional measurement process.

プロジェクタ7と撮像装置8との間の相対的な位置姿勢関係は既知であるので、プロジェクタ7と図8に示す入力画像内の最大輝度の観測位置を示す三次元座標値とを結ぶベクトル(以下、「光源ベクトルl」とも称す。)と、撮像装置8と図8に示す入力画像内の最大輝度の観測位置を示す三次元座標値とを結ぶベクトル(以下、「視線ベクトルv」とも称す。)とを算出することができる。   Since the relative position and orientation relationship between the projector 7 and the imaging device 8 is known, a vector (hereinafter referred to as a vector) connecting the projector 7 and the three-dimensional coordinate value indicating the observation position of the maximum luminance in the input image shown in FIG. , Also referred to as “light source vector l”) and a vector (hereinafter also referred to as “line-of-sight vector v”) connecting the imaging device 8 and the three-dimensional coordinate value indicating the maximum luminance observation position in the input image shown in FIG. ) Can be calculated.

このように算出された光源ベクトルlと視線ベクトルvとの二等分角が法線方向(法線ベクトルn)となる。   The bisected angle between the light source vector l and the line-of-sight vector v thus calculated is the normal direction (normal vector n).

すなわち、図3に示す法線算出処理(ステップS4)においては、ワークWの表面が鏡面反射する場合には、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源(プロジェクタ7)に向けて延びる光源ベクトルl(第1のベクトル)と、当該三次元座標点を通り、かつ、撮像装置8の方向に延びる視線ベクトルvとの、二等分角に相当するベクトルが法線ベクトルnとして算出される。   That is, in the normal calculation processing (step S4) shown in FIG. 3, when the surface of the workpiece W is specularly reflected, the tertiary determined from the position of the portion where the brightness is maximum and the corresponding height information. A light source vector l (first vector) that passes through the original coordinate point and extends toward the light source (projector 7) of the illumination light, and a line-of-sight vector that passes through the three-dimensional coordinate point and extends in the direction of the imaging device 8 A vector corresponding to a bisecting angle with v is calculated as a normal vector n.

(ii)拡散反射特性を有する場合
次に、ワークWの表面が拡散反射特性を有する場合について説明する。ワークWが拡散反射特性を有する場合には、ワークWの表面に入射した光は、基本的には全方位に拡散反射する。そのため、ワークWの表面のある位置を基準に見れば、プロジェクタ7からの照明光は、当該位置の法線方向に最も多く反射されることになる。
(Ii) Case of having diffuse reflection characteristics Next, a case where the surface of the workpiece W has diffuse reflection characteristics will be described. When the workpiece W has diffuse reflection characteristics, the light incident on the surface of the workpiece W is basically diffusely reflected in all directions. Therefore, when viewed from a certain position on the surface of the workpiece W, the illumination light from the projector 7 is reflected most in the normal direction of the position.

また、撮像装置8に入射する光を示す入力画像内において最も明るい位置は、プロジェクタ7からの照明光が入射したワークWの表面位置に相当する。すなわち、図8に示す入力画像内の最大輝度の観測位置は、撮像装置8によって撮像される入力画像の輝度情報に基づいて取得することができる。そして、図8に示す入力画像内の最大輝度の観測位置を示す三次元座標値についても、上述の三次元計測処理などの結果から取得できる。   The brightest position in the input image indicating the light incident on the imaging device 8 corresponds to the surface position of the workpiece W on which the illumination light from the projector 7 is incident. That is, the maximum luminance observation position in the input image shown in FIG. 8 can be acquired based on the luminance information of the input image captured by the imaging device 8. The three-dimensional coordinate value indicating the maximum luminance observation position in the input image shown in FIG. 8 can also be obtained from the result of the above-described three-dimensional measurement process.

プロジェクタ7と撮像装置8との間の相対的な位置姿勢関係は既知であるので、プロジェクタ7と図8に示す入力画像内の最大輝度の観測位置を示す三次元座標値とを結ぶベクトル(光源ベクトルl)を算出すれば、この算出された光源ベクトルlが法線方向(法線ベクトルn)と一致する。   Since the relative position and orientation relationship between the projector 7 and the imaging device 8 is known, a vector (light source) connecting the projector 7 and the three-dimensional coordinate value indicating the observation position of the maximum luminance in the input image shown in FIG. If the vector l) is calculated, the calculated light source vector l matches the normal direction (normal vector n).

すなわち、図3に示す法線算出処理(ステップS4)においては、ワークWの表面が拡散反射する場合には、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源(プロジェクタ7)に向けて延びる光源ベクトルlが法線ベクトルnとして算出される。   That is, in the normal calculation processing (step S4) shown in FIG. 3, when the surface of the workpiece W is diffusely reflected, the tertiary determined from the position of the portion where the brightness is maximum and the corresponding height information. A light source vector l passing through the original coordinate point and extending toward the light source (projector 7) of the illumination light is calculated as a normal vector n.

なお、ワークWが円筒形状である場合には、プロジェクタ7からの照明光は複数の位置に入射するので、「入力画像内において最も明るい位置」は複数検出されることになる。したがって、上述のいずれの場合にも、ワークWが円筒形状を有する場合には、複数の法線ベクトルnが算出される。   When the workpiece W has a cylindrical shape, the illumination light from the projector 7 is incident on a plurality of positions, so that a plurality of “brightest positions in the input image” are detected. Accordingly, in any of the above cases, when the workpiece W has a cylindrical shape, a plurality of normal vectors n are calculated.

(g2:法線算出処理フロー)
図9は、本実施の形態に係る画像処理装置100において実行される法線算出処理のより詳細な手順を示すフローチャートである。図9に示す処理手順は、図3に示すステップS3の処理内容をより詳細に示すものである。
(G2: Normal calculation processing flow)
FIG. 9 is a flowchart showing a more detailed procedure of normal calculation processing executed in the image processing apparatus 100 according to the present embodiment. The processing procedure shown in FIG. 9 shows the processing content of step S3 shown in FIG. 3 in more detail.

図9を参照して、画像処理装置100のCPU110は、入力画像内において明るさが極大となる部分の抽出処理を実行する(ステップS41)。明るさが極大となる部分の抽出処理は、入力画像に対する画像処理によって実現される。この画像処理の内容については、後述する。このステップS41の処理によって、入力画像内において輝度が極大となる部分(以下、「輝度極大部分」とも称す。)が抽出される。   Referring to FIG. 9, the CPU 110 of the image processing apparatus 100 executes an extraction process of a portion where the brightness is maximized in the input image (step S41). The extraction process of the portion where the brightness is maximum is realized by image processing on the input image. The contents of this image processing will be described later. By the processing in step S41, a portion where the luminance is maximum in the input image (hereinafter also referred to as “luminance maximum portion”) is extracted.

続いて、画像処理装置100のCPU110は、対象のワークWの反射特性を取得する(ステップS42)。ワークWの反射特性は、予めユーザが入力しておいてもよいし、画像処理装置100に対して外部の装置(工程管理サーバなど)からワークWについての情報として入力されてもよい。   Subsequently, the CPU 110 of the image processing apparatus 100 acquires the reflection characteristics of the target work W (step S42). The reflection characteristics of the workpiece W may be input in advance by the user, or may be input as information about the workpiece W from an external device (such as a process management server) to the image processing apparatus 100.

続いて、画像処理装置100のCPU110は、光線ベクトル(図8に示す視線ベクトルvおよび光源ベクトルlの総称)の算出処理を実行する(ステップS43)。この光線ベクトルの算出処理は、三次元座標系において実行される三次元処理である。このステップS42においては、画像処理装置100のCPU110は、ステップS41において抽出された輝度極大部分に対応する光線ベクトル(視線ベクトルvおよび光源ベクトルl)を算出する。なお、算出される光線ベクトルの種類は、ステップS42において入力されるワークWの反射特性に依存して変化する。この光線ベクトルの算出処理の詳細については、後述する。   Subsequently, the CPU 110 of the image processing apparatus 100 executes a light ray vector (generic name for the line-of-sight vector v and the light source vector 1 shown in FIG. 8) (step S43). This ray vector calculation process is a three-dimensional process executed in a three-dimensional coordinate system. In step S42, the CPU 110 of the image processing apparatus 100 calculates a light vector (line-of-sight vector v and light source vector l) corresponding to the luminance maximum extracted in step S41. Note that the type of the calculated light vector changes depending on the reflection characteristic of the workpiece W input in step S42. Details of the light ray vector calculation process will be described later.

最終的に、画像処理装置100のCPU110は、法線算出処理を実行する(ステップS44)。この法線算出処理では、反射特性に応じて法線の算出処理が実行される。   Finally, the CPU 110 of the image processing apparatus 100 executes normal calculation processing (step S44). In this normal calculation processing, normal calculation processing is executed in accordance with the reflection characteristics.

以上のように、法線(法線ベクトルn)が算出されると、図3に示すステップS5の処理が引き続いて実行される。   As described above, when the normal line (normal vector n) is calculated, the process of step S5 shown in FIG. 3 is subsequently performed.

(g3:明るさが極大となる部分の抽出)
次に、図9に示すステップS41の処理(明るさが極大となる部分を抽出する処理)の詳細について説明する。図9に示すステップS41においては、セグメンテーション処理(図3のステップS2)によって抽出された円筒領域について、輝度極大部分が抽出される。ステップS41の処理においては、基本的には、円筒領域のうち最も明るい画素とその周辺領域とが輝度極大部分として抽出される。
(G3: Extraction of the part where the brightness is maximized)
Next, details of the process of step S41 shown in FIG. 9 (a process of extracting a portion where the brightness is maximized) will be described. In step S41 shown in FIG. 9, the luminance maximum portion is extracted from the cylindrical region extracted by the segmentation process (step S2 in FIG. 3). In the process of step S41, basically, the brightest pixel in the cylindrical region and its peripheral region are extracted as the maximum luminance portion.

図10は、本実施の形態に係る明るさが極大となる部分を抽出する処理の処理例を示す図である。図10を参照して、まず、セグメンテーション結果に含まれる円筒領域のうち輝度極大部分を抽出する対象が決定される。なお、複数の円筒領域のそれぞれから輝度極大部分を抽出する場合には、以下に説明するような手順をそれぞれの円筒領域に対して実施することになる。   FIG. 10 is a diagram illustrating a processing example of processing for extracting a portion where the brightness is maximum according to the present embodiment. Referring to FIG. 10, first, a target from which a luminance maximum portion is extracted from a cylindrical region included in the segmentation result is determined. In the case where the maximum luminance portion is extracted from each of the plurality of cylindrical regions, the procedure described below is performed on each cylindrical region.

より具体的には、以下の手順(1)〜(6)が対象の円筒領域の数だけ繰返し実行される。   More specifically, the following procedures (1) to (6) are repeatedly executed for the number of target cylindrical regions.

(1)セグメンテーション結果に含まれる円筒領域のうち輝度極大部分を抽出する対象の円筒領域の決定
(2)円筒領域を定義する辺の長さの比から走査方向の決定
(3)入力画像を各走査方向に操作して輝度プロファイルの取得
(4)輝度プロファイルおいてある閾値より輝度が大きい領域(極大値とその周辺領域)の座標値の抽出および記録
(5)(3)および(4)の処理をすべての円筒領域に対して繰返し実行
(6)それぞれの輝度プロファイルにおける極大部分の座標値を統合して、円筒領域内の輝度極大部分の抽出
図10には、(a)セグメンテーション結果に含まれる一つの円筒領域に対して走査方向が決定され、その走査方向に沿って取得された円筒領域の輝度変化を示す((b)円筒領域の輝度変化)。なお、図10には、理解を容易化するために、円筒領域内の輝度の絶対値を色情報(濃淡変化)で示した高さ画像を例示するが、実際には、輝度の大きさの値および極大値をとる座標値などの情報が抽出される。
(1) Determination of a cylindrical region from which a luminance maximum portion is extracted from cylindrical regions included in the segmentation result (2) Determination of a scanning direction from a ratio of lengths of sides defining the cylindrical region (3) Each input image Acquisition of luminance profile by operating in the scanning direction (4) Extraction and recording of coordinate values of area (maximum value and surrounding area) where luminance is higher than threshold value in luminance profile (5) (3) and (4) Processing is repeatedly performed for all cylindrical regions. (6) The maximum coordinate values in each luminance profile are integrated to extract the luminance maximum portion in the cylindrical region. FIG. 10 includes (a) the segmentation result. The scanning direction is determined for one cylindrical region, and the luminance change of the cylindrical region acquired along the scanning direction is indicated ((b) luminance change of the cylindrical region). In order to facilitate understanding, FIG. 10 illustrates a height image in which the absolute value of the luminance in the cylindrical region is shown by color information (change in shading). Information such as a coordinate value that takes a value and a maximum value is extracted.

(g4:光線ベクトルの算出処理)
次に、図9に示すステップS43に示す光線ベクトルの算出処理の詳細について説明する。図9に示すステップS43においては、まず、ステップS41の処理において抽出された輝度極大部分の座標値(x,y,z)を基準として、三次元空間上における光線ベクトルを計算(視線ベクトルvおよび光源ベクトルl)が算出される。
(G4: ray vector calculation process)
Next, details of the light vector calculation processing shown in step S43 shown in FIG. 9 will be described. In step S43 shown in FIG. 9, first, a light vector in a three-dimensional space is calculated (line-of-sight vector v and v) with reference to the coordinate values (x, y, z) of the luminance maximum extracted in the process of step S41. A light source vector l) is calculated.

図11は、本実施の形態に係る光線ベクトルの算出処理を説明するための図である。図11(a)を参照して、入力画像上の輝度極大部分の座標値(x,y,z)と、撮像装置8の座標値(xc,yc,zc)とから視線ベクトルvが算出される。この算出処理は、予め取得されているキャリブレーションデータを利用して実行される。   FIG. 11 is a diagram for explaining the light vector calculation processing according to the present embodiment. With reference to FIG. 11A, the line-of-sight vector v is calculated from the coordinate value (x, y, z) of the luminance maximum portion on the input image and the coordinate value (xc, yc, zc) of the imaging device 8. The This calculation process is executed using calibration data acquired in advance.

すなわち、視線ベクトルv(v1,v2,v3)は、以下のような式に従って算出される。   That is, the line-of-sight vector v (v1, v2, v3) is calculated according to the following equation.

視線ベクトルv(v1,v2,v3)=(x−xc,y−yc,z−zc)
続いて、図11(b)を参照して、入力画像上の輝度極大部分の座標値(x,y,z)と、プロジェクタ7の座標値(xp,yp,zp)とから光源ベクトルlが算出される。この算出処理は、予め取得されているキャリブレーションデータを利用して実行される。
Line-of-sight vector v (v1, v2, v3) = (x-xc, y-yc, z-zc)
Subsequently, referring to FIG. 11B, the light source vector l is obtained from the coordinate values (x, y, z) of the luminance maximum portion on the input image and the coordinate values (xp, yp, zp) of the projector 7. Calculated. This calculation process is executed using calibration data acquired in advance.

すなわち、光源ベクトルl(l1,l2,l3)は、以下のような式に従って算出される。   That is, the light source vector l (l1, l2, l3) is calculated according to the following equation.

光源ベクトルl(l1,l2,l3)=(x−xp,y−yp,z−zp)
なお、視線ベクトルvおよび光源ベクトルlについては、後述の法線ベクトルnの算出処理における便宜上、規格化しておくことが好ましい。
Light source vector l (l1, l2, l3) = (x-xp, y-yp, z-zp)
The line-of-sight vector v and the light source vector l are preferably standardized for convenience in the calculation process of the normal vector n described later.

(g5:法線算出処理)
次に、図9に示すステップS44に示す法線算出処理の詳細について説明する。図9に示すステップS44においては、ワークWの表面における反射特性に依存して法線方向(法線ベクトルn)の算出方法を異ならせる。
(G5: normal calculation processing)
Next, details of the normal calculation processing shown in step S44 shown in FIG. 9 will be described. In step S44 shown in FIG. 9, the calculation method of the normal direction (normal vector n) is varied depending on the reflection characteristics on the surface of the workpiece W.

図12は、本実施の形態に係る法線算出処理を説明するための図である。図12(a)には、ワークWの表面が鏡面反射特性を有する場合の処理例を示し、図12(b)には、ワークWの表面が拡散反射特性を有する場合の処理例を示す。   FIG. 12 is a diagram for explaining the normal calculation processing according to the present embodiment. FIG. 12A shows a processing example when the surface of the workpiece W has specular reflection characteristics, and FIG. 12B shows a processing example when the surface of the workpiece W has diffuse reflection characteristics.

図12(a)を参照して、ワークWの表面が鏡面反射特性を有する場合には、明るさが極大となる部分(輝度極大部分)では正反射光が生じることになる。したがって、上述したように、ワークWの表面における法線ベクトルnは、視線ベクトルvおよび光源ベクトルlを用いて、以下のような式に従って算出される。   Referring to FIG. 12A, when the surface of the workpiece W has specular reflection characteristics, specularly reflected light is generated at a portion where the brightness is maximum (the luminance maximum portion). Therefore, as described above, the normal vector n on the surface of the workpiece W is calculated according to the following equation using the line-of-sight vector v and the light source vector l.

法線ベクトルn=(視線ベクトルv+光源ベクトルl)/2
一方、図12(b)を参照して、ワークWの表面が拡散反射特性を有する場合には、明るさが極大となる部分(輝度極大部分)では拡散反射光が生じることになる。したがって、上述したように、ワークWの表面における法線ベクトルnは、光源ベクトルlと一致するため、以下のような式に従って算出される。
Normal vector n = (line-of-sight vector v + light source vector l) / 2
On the other hand, referring to FIG. 12B, when the surface of the workpiece W has a diffuse reflection characteristic, diffuse reflected light is generated in a portion where the brightness is maximum (luminance maximum portion). Therefore, as described above, the normal vector n on the surface of the workpiece W coincides with the light source vector l and is calculated according to the following equation.

法線ベクトルn=光源ベクトルl
以上のような処理によって、1つ以上の法線ベクトルnが算出される。
Normal vector n = light source vector l
Through the processing as described above, one or more normal vectors n are calculated.

《H.位置算出処理》
次に、図3に示す位置算出処理(ステップS5)の詳細について説明する。上述したように、位置算出処理は、ワークWの位置姿勢を算出するための処理である。本実施の形態においては、ワークWの半径情報(半径)が既知であるので、上述した処理によって算出された法線(法線ベクトル)と、対応する輝度極大部分の三次元座標点とから、ワークWの円筒部分の中心位置(中心軸)が算出される。
<< H. Position calculation process >>
Next, details of the position calculation process (step S5) shown in FIG. 3 will be described. As described above, the position calculation process is a process for calculating the position and orientation of the workpiece W. In the present embodiment, since the radius information (radius) of the workpiece W is known, from the normal (normal vector) calculated by the above-described processing and the corresponding three-dimensional coordinate point of the maximum luminance, The center position (center axis) of the cylindrical portion of the workpiece W is calculated.

図13は、本実施の形態に係る位置算出処理を説明するための図である。
図13(a)に示すように、輝度極大部分の三次元座標点(x,y,z)および対応する法線ベクトルnが算出されており、ワークWの円筒断面における半径情報(半径r)が既知であるので、幾何学的関係から、ワークWの中心位置を一意に特定することができる。
FIG. 13 is a diagram for explaining the position calculation processing according to the present embodiment.
As shown in FIG. 13A, the three-dimensional coordinate point (x, y, z) of the luminance maximum portion and the corresponding normal vector n are calculated, and radius information (radius r) in the cylindrical cross section of the workpiece W is calculated. Is known, the center position of the workpiece W can be uniquely specified from the geometric relationship.

さらに、図13(b)に示すように、同一のワークWに対して、複数の輝度極大部分および対応する法線ベクトルn1,n2,n3,・・・が算出されるのでそれぞれの組み合わせについて、ワークWの中心位置が算出できる。さらに、ワークWから抽出された複数の中心位置を用いて、ワークWの円筒部分の中心軸を決定することができる。なお、この中心軸の決定方法としては、公知のフィッティング方法を採用することができる。   Further, as shown in FIG. 13B, a plurality of luminance maximum portions and corresponding normal vectors n1, n2, n3,... Are calculated for the same workpiece W. The center position of the workpiece W can be calculated. Furthermore, the center axis of the cylindrical portion of the workpiece W can be determined using a plurality of center positions extracted from the workpiece W. As a method for determining the central axis, a known fitting method can be employed.

《I.計測例》
図14は、本発明の実施の形態に係る画像処理によって生成された認識結果の一例を示す図である。図14に示す認識結果は、複数のワークW(図4に示すような多数のボルト)がばら積みされている状態を撮像した入力画像から得られたものである。なお、図14に示す線は、上述した処理によって算出されたワークWの中心軸を示し、その周辺に描かれている円は、対応する法線ベクトルを算出する際に決定されたワークWの半径位置(外形)を示す。
<< I. Measurement example >>
FIG. 14 is a diagram showing an example of a recognition result generated by image processing according to the embodiment of the present invention. The recognition result shown in FIG. 14 is obtained from an input image obtained by imaging a state in which a plurality of workpieces W (a large number of bolts as shown in FIG. 4) are stacked. Note that the line shown in FIG. 14 indicates the central axis of the workpiece W calculated by the above-described processing, and the circle drawn on the periphery of the workpiece W is determined when the corresponding normal vector is calculated. Indicates the radial position (outer shape).

このように、本実施の形態に係る画像処理方法によれば、比較的短時間で、任意の方向に配置されているワークWの位置およびその中心軸を決定することができる。   As described above, according to the image processing method according to the present embodiment, the position of the workpiece W arranged in an arbitrary direction and its central axis can be determined in a relatively short time.

《J.変形例》
上述した例では、主として、円筒形状のワークWに本発明に係る画像処理方法を適用した場合の処理例を示したが、上述したように球状のワークWについても同様に適用することができる。この場合には、原理的には、ワークWの中心位置は一つであるので、一つのワークWからは一つの法線ベクトルのみを抽出さればよい。
<< J. Modifications >>
In the above-described example, the processing example in the case where the image processing method according to the present invention is mainly applied to the cylindrical workpiece W has been described. However, as described above, the processing can be similarly applied to the spherical workpiece W. In this case, in principle, since the center position of the workpiece W is one, only one normal vector needs to be extracted from one workpiece W.

《K.利点》
本実施の形態に係る画像処理装置によれば、二次元画像に対する画像処理の結果と、同一のワークWを三次元計測することで高さ情報とを用いて、より少ない処理量でワークWの中心位置を算出することができる。
<< K. advantage"
According to the image processing apparatus according to the present embodiment, the result of image processing on a two-dimensional image and the height information obtained by three-dimensionally measuring the same workpiece W can be used with a smaller amount of processing. The center position can be calculated.

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

7 プロジェクタ
8 撮像装置
100 画像処理装置
102 ディスプレイ
104 マウス
106 メモリカード
110 CPU
112 メインメモリ
114 ハードディスク
116 カメラインターフェイス
116a 画像バッファ
118 入力インターフェイス
120 表示コントローラ
122 プロジェクタインターフェイス
124 通信インターフェイス
126 データリーダ/ライタ
128 バス
200 ロボットコントローラ
300 ロボット
SYS 把持システム
W ワーク
7 Projector 8 Imaging Device 100 Image Processing Device 102 Display 104 Mouse 106 Memory Card 110 CPU
112 main memory 114 hard disk 116 camera interface 116a image buffer 118 input interface 120 display controller 122 projector interface 124 communication interface 126 data reader / writer 128 bus 200 robot controller 300 robot SYS gripping system W work

Claims (9)

既知の半径を有する円筒または球を少なくとも一部に含む、その表面が鏡面反射する検出対象物について、円筒または球に関する1つ以上の円状断面上の中心位置を算出する方法であって、
少なくとも1つの前記検出対象物に対して第1の方向から照明光を照射した状態で、前記第1の方向と同一平面内にあって、前記第1の方向とは異なる第2の方向に視線を向けて配置された撮像装置を用いて撮像することで入力画像を取得するステップと、
前記検出対象物の円筒部分または球部分の少なくとも一部を含む領域を、前記入力画像内の明るさの情報および前記検出対象物の形状の情報に基づいて、前記入力画像から抽出するステップと、
前記少なくとも1つの検出対象物に対して、前記第1の方向から複数の異なる濃淡パターンを照射するとともに、それぞれの照射時に前記撮像装置によりそれぞれ撮像された複数の画像を用いて、前記抽出された領域についての高さ情報を取得するステップと、
前記抽出された領域に含まれる複数の円筒断面の各々または球断面について、当該断面の外周上の明るさが極大となる部分を特定し、当該明るさが極大となる部分の法線方向を決定するステップと、
前記決定した前記複数の円筒断面のそれぞれの法線方向または前記球断面の法線方向と、前記既知の半径と、前記複数の円筒断面の前記明るさが極大となるそれぞれの部分の位置または前記球断面の前記明るさが極大となる部分の位置と、対応する高さ情報とから、前記検出対象物の円筒部分のそれぞれの中心位置または前記検出対象物の中心位置を決定するステップとを備え、
前記法線方向を決定するステップは、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源に向けて延びる第1のベクトルと、当該三次元座標点を通り、かつ、前記撮像装置の方向に延びる第2のベクトルとの、二等分角に相当するベクトルを法線ベクトルとして算出するステップを含む、方法。
A method for calculating a central position on one or more circular sections of a cylinder or sphere, with respect to a detection object that at least partially includes a cylinder or sphere having a known radius and whose surface is specularly reflected, comprising:
A line of sight in a second direction that is in the same plane as the first direction and is different from the first direction in a state in which illumination light is irradiated from at least one of the detection objects from the first direction. Obtaining an input image by imaging using an imaging device arranged with
Extracting a region including at least a part of a cylindrical portion or a spherical portion of the detection target object from the input image based on brightness information in the input image and information on the shape of the detection target;
The at least one detection object is irradiated with a plurality of different shade patterns from the first direction, and the plurality of images respectively captured by the imaging device at the time of each irradiation are used for the extraction. Obtaining height information about the region;
For each of a plurality of cylindrical cross sections or a spherical cross section included in the extracted region , a portion where the brightness on the outer periphery of the cross section is maximized is specified, and a normal direction of the portion where the brightness is maximized is determined. And steps to
The determined normal direction of each of the plurality of cylindrical sections or the normal direction of the spherical section, the known radius, and the position of each portion at which the brightness of the plurality of cylindrical sections is maximized or the Determining the center position of each cylindrical portion of the detection target object or the center position of the detection target object from the position of the portion where the brightness of the sphere cross-section is maximized and the corresponding height information. ,
The step of determining the normal direction includes a first direction extending through the three-dimensional coordinate point determined from the position of the portion where the brightness is maximized and the corresponding height information and extending toward the light source of the illumination light. Calculating a vector corresponding to a bisector between a vector and a second vector passing through the three-dimensional coordinate point and extending in the direction of the imaging device, as a normal vector.
既知の半径を有する円筒または球を少なくとも一部に含む、その表面が拡散反射する検出対象物について、円筒または球に関する1つ以上の円状断面上の中心位置を算出する方法であって、
少なくとも1つの前記検出対象物に対して第1の方向から照明光を照射した状態で、前記第1の方向とは異なる第2の方向に視線を向けて配置された撮像装置を用いて撮像することで入力画像を取得するステップと、
前記検出対象物の円筒部分または球部分の少なくとも一部を含む領域を、前記入力画像内の明るさの情報および前記検出対象物の形状の情報に基づいて、前記入力画像から抽出するステップと、
前記少なくとも1つの検出対象物に対して、前記第1の方向から複数の異なる濃淡パターンを照射するとともに、それぞれの照射時に前記撮像装置によりそれぞれ撮像された複数の画像を用いて、前記抽出された領域についての高さ情報を取得するステップと、
前記抽出された領域に含まれる複数の円筒断面の各々または球断面について、当該断面の外周上の明るさが極大となる部分を特定し、当該明るさが極大となる部分の法線方向を決定するステップと、
前記決定した前記複数の円筒断面のそれぞれの法線方向または前記球断面の法線方向と、前記既知の半径と、前記複数の円筒断面の前記明るさが極大となるそれぞれの部分の位置または前記球断面の前記明るさが極大となる部分の位置と、対応する高さ情報とから、前記検出対象物の円筒部分のそれぞれの中心位置または前記検出対象物の中心位置を決定するステップとを備え、
前記法線方向を決定するステップは、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源に向けて延びるベクトルを法線ベクトルとして算出するステップを含む、方法。
A method for calculating a center position on one or more circular sections of a cylinder or a sphere with respect to a detection object whose surface is diffusely reflected, the cylinder or sphere having a known radius at least in part.
In a state where illumination light is irradiated from at least one of the detection objects from the first direction, an image is picked up using an imaging device arranged with a line of sight in a second direction different from the first direction. To obtain an input image,
Extracting a region including at least a part of a cylindrical portion or a spherical portion of the detection target object from the input image based on brightness information in the input image and information on the shape of the detection target;
The at least one detection object is irradiated with a plurality of different shade patterns from the first direction, and the plurality of images respectively captured by the imaging device at the time of each irradiation are used for the extraction. Obtaining height information about the region;
For each of a plurality of cylindrical cross sections or a spherical cross section included in the extracted region , a portion where the brightness on the outer periphery of the cross section is maximized is specified, and a normal direction of the portion where the brightness is maximized is determined. And steps to
The determined normal direction of each of the plurality of cylindrical sections or the normal direction of the spherical section, the known radius, and the position of each portion at which the brightness of the plurality of cylindrical sections is maximized or the Determining the center position of each cylindrical portion of the detection target object or the center position of the detection target object from the position of the portion where the brightness of the sphere cross-section is maximized and the corresponding height information. ,
In the step of determining the normal direction, a vector extending through the three-dimensional coordinate point determined from the position of the portion where the brightness is maximized and the corresponding height information and extending toward the light source of the illumination light is used. A method comprising calculating as a line vector.
前記入力画像を取得するステップは、前記少なくとも1つの検出対象物に対して前記第1の方向から照明光を照射しない状態で前記撮像装置により取得された第1の画像と、前記少なくとも1つの検出対象物に対して前記第1の方向から照明光を照射した状態で前記撮像装置により取得された第2の画像との差分から前記入力画像を生成するステップを含む、請求項1または2に記載の方法。 Acquiring the input image, the first image acquired by the imaging device in a state of not irradiated with illumination light from the first direction to at least one of the detection object, wherein the at least one detection comprising the step of generating the input image from the difference between the second image acquired by the imaging device in a state in which illumination light is irradiated from the first direction to the object, according to claim 1 or 2 the method of. 前記中心位置を決定するステップは、前記検出対象物の円筒部分のそれぞれの中心位置から当該検出対象物の中心軸を決定するステップを含む、請求項1〜3のいずれか1項に記載の方法。 The method according to any one of claims 1 to 3, wherein the step of determining the center position includes a step of determining a center axis of the detection target object from a center position of each cylindrical portion of the detection target object. . 前記決定した前記検出対象物の中心位置を前記検出対象物を把持するロボットのコントローラへ出力するステップをさらに備える、請求項1〜4のいずれか1項に記載の方法。   The method according to claim 1, further comprising a step of outputting the determined center position of the detection object to a controller of a robot that holds the detection object. 既知の半径を有する円筒または球を少なくとも一部に含む、その表面が鏡面反射する検出対象物について、円筒または球に関する1つ以上の円状断面上の中心位置を算出する装置であって、
撮像装置と接続され、少なくとも1つの前記検出対象物を撮像した入力画像を取得するインターフェイスとを備え、前記入力画像は、前記少なくとも1つの検出対象物に対して第1の方向から照明光を照射した状態で、前記第1の方向と同一平面内にあって、前記第1の方向とは異なる第2の方向に視線を向けて配置された撮像装置を用いて撮像することで取得され、
前記検出対象物の円筒部分または球部分の少なくとも一部を含む領域を、前記入力画像内の明るさの情報および前記検出対象物の形状の情報に基づいて、前記入力画像から抽出する手段と、
前記少なくとも1つの検出対象物に対して、前記第1の方向から複数の異なる濃淡パターンを照射するとともに、それぞれの照射時に前記撮像装置によりそれぞれ撮像された複数の画像を用いて、前記抽出された領域についての高さ情報を取得する手段と、
前記抽出された領域に含まれる複数の円筒断面の各々または球断面について、当該断面の外周上の明るさが極大となる部分を特定し、当該明るさが極大となる部分の法線方向を決定する手段と、
前記決定した前記複数の円筒断面のそれぞれの法線方向または前記球断面の法線方向と、前記既知の半径と、前記複数の円筒断面の前記明るさが極大となるそれぞれの部分の位置または前記球断面の前記明るさが極大となる部分の位置と、対応する高さ情報とから、前記検出対象物の円筒部分のそれぞれの中心位置または前記検出対象物の中心位置を決定する手段とを備え、
前記法線方向を決定する手段は、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源に向けて延びる第1のベクトルと、当該三次元座標点を通り、かつ、前記撮像装置の方向に延びる第2のベクトルとの、二等分角に相当するベクトルを法線ベクトルとしてとして算出する、装置。
An apparatus for calculating a central position on one or more circular sections of a cylinder or a sphere with respect to a detection target that includes a cylinder or a sphere having a known radius at least in part and whose surface is specularly reflected.
An interface connected to an imaging device and acquiring an input image obtained by imaging at least one of the detection objects, wherein the input image irradiates the at least one detection object with illumination light from a first direction. In such a state, it is acquired by imaging using an imaging device that is in the same plane as the first direction and is arranged with a line of sight in a second direction different from the first direction,
Means for extracting an area including at least a part of a cylindrical portion or a sphere portion of the detection target object from the input image based on brightness information in the input image and information on a shape of the detection target;
The at least one detection object is irradiated with a plurality of different shade patterns from the first direction, and the plurality of images respectively captured by the imaging device at the time of each irradiation are used for the extraction. Means for obtaining height information about the region;
For each of a plurality of cylindrical cross sections or a spherical cross section included in the extracted region , a portion where the brightness on the outer periphery of the cross section is maximized is specified, and a normal direction of the portion where the brightness is maximized is determined. Means to
The determined normal direction of each of the plurality of cylindrical sections or the normal direction of the spherical section, the known radius, and the position of each portion at which the brightness of the plurality of cylindrical sections is maximized or the Means for determining the center position of each cylindrical portion of the detection target object or the center position of the detection target object from the position of the portion where the brightness of the sphere cross-section is maximized and the corresponding height information. ,
The means for determining the normal direction includes a first direction extending through a three-dimensional coordinate point determined from the position of the portion where the brightness is maximized and the corresponding height information and extending toward the light source of the illumination light. An apparatus that calculates, as a normal vector, a vector corresponding to a bisector between a vector and a second vector that passes through the three-dimensional coordinate point and extends in the direction of the imaging apparatus.
既知の半径を有する円筒または球を少なくとも一部に含む、その表面が拡散反射する検出対象物について、円筒または球に関する1つ以上の円状断面上の中心位置を算出する装置であって、
撮像装置と接続され、少なくとも1つの前記検出対象物を撮像した入力画像を取得するインターフェイスとを備え、前記入力画像は、前記少なくとも1つの検出対象物に対して第1の方向から照明光を照射した状態で、前記第1の方向とは異なる第2の方向に視線を向けて配置された撮像装置を用いて撮像することで取得され、
前記検出対象物の円筒部分または球部分の少なくとも一部を含む領域を、前記入力画像内の明るさの情報および前記検出対象物の形状の情報に基づいて、前記入力画像から抽出する手段と、
前記少なくとも1つの検出対象物に対して、前記第1の方向から複数の異なる濃淡パターンを照射するとともに、それぞれの照射時に前記撮像装置によりそれぞれ撮像された複数の画像を用いて、前記抽出された領域についての高さ情報を取得する手段と、
前記抽出された領域に含まれる複数の円筒断面の各々または球断面について、当該断面の外周上の明るさが極大となる部分を特定し、当該明るさが極大となる部分の法線方向を決定する手段と、
前記決定した前記複数の円筒断面のそれぞれの法線方向または前記球断面の法線方向と、前記既知の半径と、前記複数の円筒断面の前記明るさが極大となるそれぞれの部分の位置または前記球断面の前記明るさが極大となる部分の位置と、対応する高さ情報とから、前記検出対象物の円筒部分のそれぞれの中心位置または前記検出対象物の中心位置を決定する手段とを備え、
前記法線方向を決定する手段は、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源に向けて延びるベクトルを法線ベクトルとして算出する、装置。
An apparatus for calculating a central position on one or more circular cross sections of a cylinder or a sphere with respect to a detection object whose surface is diffusely reflected, the cylinder or sphere having a known radius at least in part.
An interface connected to an imaging device and acquiring an input image obtained by imaging at least one of the detection objects, wherein the input image irradiates the at least one detection object with illumination light from a first direction. In such a state, it is acquired by imaging using an imaging device arranged with a line of sight in a second direction different from the first direction,
Means for extracting an area including at least a part of a cylindrical portion or a sphere portion of the detection target object from the input image based on brightness information in the input image and information on a shape of the detection target;
The at least one detection object is irradiated with a plurality of different shade patterns from the first direction, and the plurality of images respectively captured by the imaging device at the time of each irradiation are used for the extraction. Means for obtaining height information about the region;
For each of a plurality of cylindrical cross sections or a spherical cross section included in the extracted region , a portion where the brightness on the outer periphery of the cross section is maximized is specified, and a normal direction of the portion where the brightness is maximized is determined. Means to
The determined normal direction of each of the plurality of cylindrical sections or the normal direction of the spherical section, the known radius, and the position of each portion at which the brightness of the plurality of cylindrical sections is maximized or the Means for determining the center position of each cylindrical portion of the detection target object or the center position of the detection target object from the position of the portion where the brightness of the sphere cross-section is maximized and the corresponding height information. ,
The means for determining the normal direction is a vector that passes through a three-dimensional coordinate point determined from the position of the portion where the brightness is maximum and the corresponding height information and extends toward the light source of the illumination light. Device that calculates as a line vector.
既知の半径を有する円筒または球を少なくとも一部に含む、その表面が鏡面反射する検出対象物について、円筒または球に関する1つ以上の円状断面上の中心位置を算出するためのプログラムであって、当該プログラムは、コンピュータに、
少なくとも1つの前記検出対象物に対して第1の方向から照明光を照射した状態で、前記第1の方向と同一平面内にあって、前記第1の方向とは異なる第2の方向に視線を向けて配置された撮像装置を用いて撮像することで入力画像を取得するステップと、
前記検出対象物の円筒部分または球部分の少なくとも一部を含む領域を、前記入力画像内の明るさの情報および前記検出対象物の形状の情報に基づいて、前記入力画像から抽出するステップと、
前記少なくとも1つの検出対象物に対して、前記第1の方向から複数の異なる濃淡パターンを照射するとともに、それぞれの照射時に前記撮像装置によりそれぞれ撮像された複数の画像を用いて、前記抽出された領域についての高さ情報を取得するステップと、
前記抽出された領域に含まれる複数の円筒断面の各々または球断面について、当該断面の外周上の明るさが極大となる部分を特定し、当該明るさが極大となる部分の法線方向を決定するステップと、
前記決定した前記複数の円筒断面のそれぞれの法線方向または前記球断面の法線方向と、前記既知の半径と、前記複数の円筒断面の前記明るさが極大となるそれぞれの部分の位置または前記球断面の前記明るさが極大となる部分の位置と、対応する高さ情報とから、前記検出対象物の円筒部分のそれぞれの中心位置または前記検出対象物の中心位置を決定するステップとを実行させ、
前記法線方向を決定するステップは、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源に向けて延びる第1のベクトルと、当該三次元座標点を通り、かつ、前記撮像装置の方向に延びる第2のベクトルとの、二等分角に相当するベクトルを法線ベクトルとして算出するステップを含む、プログラム。
A program for calculating a central position on one or more circular sections of a cylinder or a sphere with respect to a detection target that includes a cylinder or a sphere having a known radius at least in part and whose surface is specularly reflected. The program is stored on the computer
A line of sight in a second direction that is in the same plane as the first direction and is different from the first direction in a state in which illumination light is irradiated from at least one of the detection objects from the first direction. Obtaining an input image by imaging using an imaging device arranged with
Extracting a region including at least a part of a cylindrical portion or a spherical portion of the detection target object from the input image based on brightness information in the input image and information on the shape of the detection target;
The at least one detection object is irradiated with a plurality of different shade patterns from the first direction, and the plurality of images respectively captured by the imaging device at the time of each irradiation are used for the extraction. Obtaining height information about the region;
For each of a plurality of cylindrical cross sections or a spherical cross section included in the extracted region , a portion where the brightness on the outer periphery of the cross section is maximized is specified, and a normal direction of the portion where the brightness is maximized is determined. And steps to
The determined normal direction of each of the plurality of cylindrical sections or the normal direction of the spherical section, the known radius, and the position of each portion at which the brightness of the plurality of cylindrical sections is maximized or the The step of determining the center position of each cylindrical portion of the detection target object or the center position of the detection target object from the position of the portion where the brightness of the sphere cross section becomes maximum and the corresponding height information is executed. Let
The step of determining the normal direction includes a first direction extending through the three-dimensional coordinate point determined from the position of the portion where the brightness is maximized and the corresponding height information and extending toward the light source of the illumination light. A program comprising a step of calculating a vector corresponding to a bisector between a vector and a second vector passing through the three-dimensional coordinate point and extending in the direction of the imaging device as a normal vector.
既知の半径を有する円筒または球を少なくとも一部に含む、その表面が拡散反射する検出対象物について、円筒または球に関する1つ以上の円状断面上の中心位置を算出するためのプログラムであって、当該プログラムは、コンピュータに、
少なくとも1つの前記検出対象物に対して第1の方向から照明光を照射した状態で、前記第1の方向とは異なる第2の方向に視線を向けて配置された撮像装置を用いて撮像することで入力画像を取得するステップと、
前記検出対象物の円筒部分または球部分の少なくとも一部を含む領域を、前記入力画像内の明るさの情報および前記検出対象物の形状の情報に基づいて、前記入力画像から抽出するステップと、
前記少なくとも1つの検出対象物に対して、前記第1の方向から複数の異なる濃淡パターンを照射するとともに、それぞれの照射時に前記撮像装置によりそれぞれ撮像された複数の画像を用いて、前記抽出された領域についての高さ情報を取得するステップと、
前記抽出された領域に含まれる複数の円筒断面の各々または球断面について、当該断面の外周上の明るさが極大となる部分を特定し、当該明るさが極大となる部分の法線方向を決定するステップと、
前記決定した前記複数の円筒断面のそれぞれの法線方向または前記球断面の法線方向と、前記既知の半径と、前記複数の円筒断面の前記明るさが極大となるそれぞれの部分の位置または前記球断面の前記明るさが極大となる部分の位置と、対応する高さ情報とから、前記検出対象物の円筒部分のそれぞれの中心位置または前記検出対象物の中心位置を決定するステップとを実行させ、
前記法線方向を決定するステップは、明るさが極大となる部分の位置と対応する高さ情報とから決定される三次元座標点を通り、かつ、照明光の光源に向けて延びるベクトルを法線ベクトルとして算出するステップを含む、プログラム。
A program for calculating a center position on one or more circular cross sections of a cylinder or a sphere with respect to a detection object whose surface is diffusely reflected and including a cylinder or a sphere having a known radius at least in part. The program is stored on the computer
In a state where illumination light is irradiated from at least one of the detection objects from the first direction, an image is picked up using an imaging device arranged with a line of sight in a second direction different from the first direction. To obtain an input image,
Extracting a region including at least a part of a cylindrical portion or a spherical portion of the detection target object from the input image based on brightness information in the input image and information on the shape of the detection target;
The at least one detection object is irradiated with a plurality of different shade patterns from the first direction, and the plurality of images respectively captured by the imaging device at the time of each irradiation are used for the extraction. Obtaining height information about the region;
For each of a plurality of cylindrical cross sections or a spherical cross section included in the extracted region , a portion where the brightness on the outer periphery of the cross section is maximized is specified, and a normal direction of the portion where the brightness is maximized is determined. And steps to
The determined normal direction of each of the plurality of cylindrical sections or the normal direction of the spherical section, the known radius, and the position of each portion at which the brightness of the plurality of cylindrical sections is maximized or the The step of determining the center position of each cylindrical portion of the detection target object or the center position of the detection target object from the position of the portion where the brightness of the sphere cross section becomes maximum and the corresponding height information is executed. Let
In the step of determining the normal direction, a vector extending through the three-dimensional coordinate point determined from the position of the portion where the brightness is maximized and the corresponding height information and extending toward the light source of the illumination light is used. A program comprising the step of calculating as a line vector.
JP2011113615A 2011-05-20 2011-05-20 Method, apparatus and program for calculating center position of detection object Active JP5757156B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011113615A JP5757156B2 (en) 2011-05-20 2011-05-20 Method, apparatus and program for calculating center position of detection object

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011113615A JP5757156B2 (en) 2011-05-20 2011-05-20 Method, apparatus and program for calculating center position of detection object

Publications (2)

Publication Number Publication Date
JP2012242281A JP2012242281A (en) 2012-12-10
JP5757156B2 true JP5757156B2 (en) 2015-07-29

Family

ID=47464139

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011113615A Active JP5757156B2 (en) 2011-05-20 2011-05-20 Method, apparatus and program for calculating center position of detection object

Country Status (1)

Country Link
JP (1) JP5757156B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5757157B2 (en) * 2011-05-20 2015-07-29 オムロン株式会社 Method, apparatus and program for calculating head position and axis direction for detection object
JP6377353B2 (en) * 2013-12-20 2018-08-22 ローランドディー.ジー.株式会社 Printing apparatus and printing method
JP6331587B2 (en) * 2014-03-31 2018-05-30 株式会社東京精密 Three-dimensional coordinate measuring apparatus and method, and calibration apparatus
CN105430255A (en) 2014-09-16 2016-03-23 精工爱普生株式会社 Image processing apparatus and robot system
JP6398509B2 (en) * 2014-09-16 2018-10-03 セイコーエプソン株式会社 Image processing system and robot system
CN107003116A (en) 2014-12-15 2017-08-01 索尼公司 Image capture device component, 3 d shape measuring apparatus and motion detection apparatus
JP6644846B1 (en) * 2018-08-31 2020-02-12 株式会社トキワシステムテクノロジーズ Work position and orientation recognition device and picking system

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04106672A (en) * 1990-08-28 1992-04-08 Hitachi Ltd Methods for estimating illuminating condition and for generating three-dimensional information of object and method and device for generating shape and texture of object
JPH0763515A (en) * 1993-08-25 1995-03-10 Ishikawajima Harima Heavy Ind Co Ltd Method for automatically measuring position of cylinder
JPH09105608A (en) * 1995-10-09 1997-04-22 Nippon Steel Corp Measuring method for position of load
JP4319031B2 (en) * 2001-09-06 2009-08-26 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Object segmentation method and apparatus
JP4555762B2 (en) * 2005-10-11 2010-10-06 ニッテツ北海道制御システム株式会社 LENGTH MEASUREMENT DEVICE, LENGTH MEASUREMENT METHOD, AND LENGTH MEASUREMENT COMPUTER PROGRAM
JP4959520B2 (en) * 2007-11-26 2012-06-27 三菱電機株式会社 Position and orientation recognition apparatus and method, and component picking system
JP5065329B2 (en) * 2009-05-12 2012-10-31 ヴィスコ・テクノロジーズ株式会社 Shape inspection apparatus and shape inspection program
JP5757157B2 (en) * 2011-05-20 2015-07-29 オムロン株式会社 Method, apparatus and program for calculating head position and axis direction for detection object

Also Published As

Publication number Publication date
JP2012242281A (en) 2012-12-10

Similar Documents

Publication Publication Date Title
JP5757156B2 (en) Method, apparatus and program for calculating center position of detection object
JP7011711B2 (en) Systems and methods for extrinsic calibration of cameras and diffractive optics
US11720766B2 (en) Systems and methods for text and barcode reading under perspective distortion
EP3742113B1 (en) System and method for marking images for three-dimensional image generation
US9432655B2 (en) Three-dimensional scanner based on contours from shadow images
US10132613B2 (en) Information processing apparatus, method for controlling information processing apparatus, gripping system, and storage medium
US20070176927A1 (en) Image Processing method and image processor
CN101821580A (en) System and method for three-dimensional measurement of the shape of material objects
WO2020217878A1 (en) Device, method, and program for detecting position and orientation of object
US11398085B2 (en) Systems, methods, and media for directly recovering planar surfaces in a scene using structured light
US20210374978A1 (en) Capturing environmental scans using anchor objects for registration
JP2021086432A (en) Information processing apparatus, information processing method, computer program, measurement apparatus, system, and method of manufacturing article
JP2020512536A (en) System and method for 3D profile determination using model-based peak selection
JP6486083B2 (en) Information processing apparatus, information processing method, and program
JP5445064B2 (en) Image processing apparatus and image processing program
JP6822086B2 (en) Simulation equipment, simulation method and simulation program
JP6906177B2 (en) Intersection detection device, camera calibration system, intersection detection method, camera calibration method, program and recording medium
JP4747293B2 (en) Image processing apparatus, image processing method, and program used therefor
US20240013437A1 (en) Method for providing calibration data for calibrating a camera, method for calibrating a camera, method for producing at least one predefined point-symmetric region, and device
JP5757157B2 (en) Method, apparatus and program for calculating head position and axis direction for detection object
Stavroulakis et al. Combined use of a priori data for fast system self-calibration of a non-rigid multi-camera fringe projection system
JP2006338167A (en) Image data creation method
Araújo et al. Machine vision for industrial robotic manipulator using raspberry Pi
JP2006003276A (en) Three dimensional geometry measurement system
JP7392582B2 (en) Inspection system and method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140307

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141114

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141125

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150126

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150217

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150413

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150520

R150 Certificate of patent or registration of utility model

Ref document number: 5757156

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250