JPH08201022A - Three-dimensional position detecting method and three-dimensional position detecting device - Google Patents
Three-dimensional position detecting method and three-dimensional position detecting deviceInfo
- Publication number
- JPH08201022A JPH08201022A JP7011154A JP1115495A JPH08201022A JP H08201022 A JPH08201022 A JP H08201022A JP 7011154 A JP7011154 A JP 7011154A JP 1115495 A JP1115495 A JP 1115495A JP H08201022 A JPH08201022 A JP H08201022A
- Authority
- JP
- Japan
- Prior art keywords
- image
- detected
- focus
- dimensional position
- detecting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Length Measuring Devices By Optical Means (AREA)
- Complex Calculations (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、3次元位置検出方法及
び3次元位置検出装置に係り、詳しくは、画像センシン
グ、画像認識等において物体を撮像する際、撮像対象面
と撮像手段との焦点ずれを検出し、補正及び測距離を行
う3次元位置検出方法に適用することができる。また、
本発明は、例えば、オートフォーカス機構やカメラを搭
載したロボットのアームの位置決めに応用することがで
きる他、内部にDカットが施してある円筒状の物体の軸
周りの角度検出、Dカット部分の深さ検出等に応用する
ことができる。更に、本発明は、特に、外部にオートフ
ォーカス機構や測距センサを設定しなくても、合焦点位
置を高精度に検出することができる3次元位置検出方法
に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a three-dimensional position detecting method and a three-dimensional position detecting apparatus, and more particularly, to a focus between an image pickup target surface and an image pickup means when picking up an image of an object in image sensing, image recognition or the like. The present invention can be applied to a three-dimensional position detecting method that detects a shift, corrects and measures the distance. Also,
INDUSTRIAL APPLICABILITY The present invention can be applied to, for example, the positioning of an arm of a robot equipped with an autofocus mechanism and a camera, and also detects an angle around an axis of a cylindrical object having a D cut inside and a D cut portion. It can be applied to depth detection and the like. Furthermore, the present invention particularly relates to a three-dimensional position detection method capable of detecting the in-focus position with high accuracy without setting an autofocus mechanism or a distance measuring sensor outside.
【0002】[0002]
【従来の技術】近年、画像処理における3次元位置検出
方法では、オートフォーカスによる課題や測距による課
題がかなり重要なものとなっている。前者のオートフォ
ーカスによる課題を解決する方法には、投光手段及び受
光手段を備え、投光手段から出射し、被照射物から反射
してきた反射光を受光手段で受光し、その時、反射光の
角度より焦点を調整するものや、取り込んだ像をレンズ
群により複数に分けて、それらの結像位置により焦点を
調整するもの等が挙げられる。2. Description of the Related Art In recent years, in a three-dimensional position detecting method in image processing, problems due to autofocus and distance measurement have become quite important. The former method of solving the problem by autofocus is provided with a light projecting means and a light receiving means, and the reflected light emitted from the light projecting means and reflected from the object to be irradiated is received by the light receiving means. Examples thereof include one that adjusts the focus based on the angle, one that divides the captured image into a plurality by a lens group, and adjusts the focus according to their image forming positions.
【0003】後者の測距による課題を解決する方法に
は、複数のカメラによるものと複数の方向からの撮像に
よるステレオ法や、距離センサを用いたもの等が挙げら
れる。また、画像処理のアルゴリズムのなかで焦点位置
を検出するものとして、例えばFFTによる高周波成分
を検出するもの等も挙げられる。さて、画像がぼけた時
のエッジ部分の鮮明度が落ちることを利用し、所用数の
画素に分割または水平方向のスキャン毎に隣接画素の2
次差分をとり、その総和が最大になる時、合焦点位置と
して検出するカメラの自動焦点制御方法については、例
えば、特公平6−16134号公報で報告されたものが
ある。As a method for solving the latter problem by distance measurement, there are a method using a plurality of cameras, a stereo method using images from a plurality of directions, and a method using a distance sensor. Further, as a method for detecting the focus position in the algorithm of the image processing, for example, a method for detecting a high frequency component by FFT can be cited. Now, by utilizing the fact that the sharpness of the edge part when the image is blurred decreases, it is divided into the required number of pixels or two
An automatic focus control method for a camera that takes the next difference and detects it as the in-focus position when the total sum becomes maximum is disclosed in, for example, Japanese Patent Publication No. 6-16134.
【0004】この従来のカメラの自動焦点制御方法で
は、カメラのレンズと結像面との距離を自動的に調整ピ
ント合わせを行う場合の結像鮮明度判断手段において、
結像画の全部または一部を所要数の画素に分割するとと
もに、隣接する画素の明暗あるいは色相の差分の絶対値
を抽出し、これらの互いに隣接する絶対値の差分の絶対
値を最大ならしめる如く、レンズと結像面間の距離若し
くは焦点調整手段を制御するように構成している。In this conventional camera automatic focus control method, the image clarity determination means for automatically adjusting and focusing the distance between the lens of the camera and the image forming surface,
All or part of the formed image is divided into the required number of pixels, and the absolute value of the difference in brightness or hue between adjacent pixels is extracted to maximize the absolute value of the difference between these adjacent absolute values. As described above, the distance between the lens and the image plane or the focus adjusting means is controlled.
【0005】このため、画像そのものの鮮明度を電気信
号に変換してこれを検出しつつ、焦点調整を自動的に行
うことができるので、応答性に優れ、かつ画像に即した
焦点調整、特にSSTV用カメラに適した自動焦点調整
を行うことができるという利点を有する。Therefore, since the focus adjustment can be automatically performed while converting the sharpness of the image itself into an electric signal and detecting the electric signal, focus adjustment excellent in responsiveness and suitable for the image, particularly This has an advantage that automatic focus adjustment suitable for an SSTV camera can be performed.
【0006】[0006]
【発明が解決しようとする課題】しかしながら、上記し
たような従来技術等では、オートフォーカス機構や測距
センサ等を設けた場合、全体のシステムがより複雑とな
るばかりでなく、それらのオートフォーカス機構や測距
センサ等の機構により得られる距離情報と取り込まれる
画像との間にオフセットが生じ、検出精度の点で問題が
あった。However, in the above-mentioned prior arts and the like, when an autofocus mechanism, a distance measuring sensor, etc. are provided, not only the overall system becomes more complicated, but also those autofocus mechanisms. There is a problem in terms of detection accuracy because an offset occurs between the captured image and the distance information obtained by a mechanism such as a distance measuring sensor.
【0007】また、上記した従来例では、処理画像面内
の画素値の総和を特徴量としているため、誤差が大きく
繰り返し精度が得られないという問題があった。また、
実際の画像事態も検出対象物の輪郭部や内部で濃淡の変
化が生じるため、処理画像面内の画素値の総和を求める
だけでは、誤検出の可能性がかなり高く、検出精度の点
で問題があった。Further, in the above-mentioned conventional example, since the sum of the pixel values in the processed image plane is used as the feature amount, there is a problem that the error is large and the repeat accuracy cannot be obtained. Also,
Even in the actual image situation, changes in shading occur in the contour part and inside of the detection target, so there is a high possibility of erroneous detection only by obtaining the sum of pixel values in the processed image plane, and there is a problem in detection accuracy. was there.
【0008】そこで、本発明は、外部にオートフォーカ
ス機構や測距センサを設定しなくても、合焦点位置を高
精度で検出することができる3次元位置検出方法を提供
することを目的とする。Therefore, an object of the present invention is to provide a three-dimensional position detecting method capable of detecting the in-focus position with high accuracy without setting an autofocus mechanism or a distance measuring sensor outside. .
【0009】[0009]
【課題を解決するための手段】請求項1記載の発明は、
物体を撮像して該物体の画像を取り込む工程と、次い
で、取り込んだ該画像に1次微分フィルタを施す工程
と、次いで、1次微分フィルタを施した該画像を2値化
する工程と、次いで、2値化した該画像を細線化する工
程と、次いで、画面上の全画素値の総和を特微量として
求める工程とを有することを特徴とするものである。According to the first aspect of the present invention,
A step of capturing an image of an object and capturing an image of the object; a step of applying a first derivative filter to the captured image; and a step of binarizing the image subjected to the first derivative filter; The method is characterized by including a step of thinning the binarized image and a step of subsequently obtaining a total sum of all pixel values on the screen as an extremely small amount.
【0010】請求項2記載の発明は、上記請求項1記載
の発明において、取り込んだ前記画像に4近傍のラプラ
シアンフィルタを施し、ラプラシアンフィルタを施した
画像の最高画素値と最低画素値の差を検出し、焦点が合
った際、検出した該画像の最高画素値と最低画素値の差
が合焦点位置でピークとなることにより合焦点位置を検
出することを特徴とするものである。According to a second aspect of the present invention, in the above-mentioned first aspect of the present invention, a Laplacian filter of four neighborhoods is applied to the captured image, and a difference between the highest pixel value and the lowest pixel value of the image subjected to the Laplacian filter is calculated. When the image is detected and focused, the difference between the highest pixel value and the lowest pixel value of the detected image has a peak at the in-focus position, so that the in-focus position is detected.
【0011】請求項3記載の発明は、上記請求項2記載
の発明において、取り込んだ前記画像中の合焦点部分の
みを2値画像として抽出することを特徴とするものであ
る。請求項4記載の発明は、上記請求項3記載の発明に
おいて、前記合焦点部分の2値画像の領域を求め、取り
込んだ前記画像から該2値画像領域の画像を抽出するこ
とを特徴とするものである。According to a third aspect of the invention, in the second aspect of the invention, only the focused portion in the captured image is extracted as a binary image. A fourth aspect of the present invention is characterized in that, in the third aspect of the invention, an area of the binary image of the focused portion is obtained, and the image of the binary image area is extracted from the captured image. It is a thing.
【0012】請求項5記載の発明は、上記請求項1,2
記載の発明において、段差を有する物体を検出する際、
撮像系の移動に伴い抽出される合焦点位置の変化に基づ
いて、該段差の距離を検出することを特徴とするもので
ある。請求項6記載の発明は、上記請求項1乃至5記載
の発明において、物体の内部にのみ段差を有する場合、
該物体の内部の合焦点部分の位置を検出することを特徴
とするものである。The invention according to claim 5 is the same as claims 1 and 2 above.
In the invention described above, when detecting an object having a step,
It is characterized in that the distance of the step is detected based on the change of the in-focus position extracted with the movement of the imaging system. In the invention according to claim 6, in the invention according to any one of claims 1 to 5, when a step is provided only inside the object,
It is characterized in that the position of the focused portion inside the object is detected.
【0013】請求項7記載の発明は、上記請求項1乃至
6記載の発明において、撮像位置が合焦点位置からずれ
ている場合、画像全体の明るさと予め設定された明るさ
とを比較し、比較した結果に基づいて遠近どちらかの方
向にずれているかを特定し、所定の範囲の距離まで撮像
系の位置を補正することを特徴とするものである。請求
項8記載の発明は、物体を撮像して該物体の画像を取り
込む撮像手段と、該撮像手段を鉛直上下方向に移動させ
る撮像手段移動手段と、物体を固定するステージを水平
面内左右上下に移動させるステージ移動手段と、ステー
ジを水平面内で回転させる回転手段と、該物体に光を照
射する光照射手段と、該撮像手段により取り込んだ画像
を処理する画像処理装置と、該撮像手段と該ステージを
移動させる制御装置とを有する3次元位置検出装置であ
って、取り込んだ該画像に1次微分フィルタを施す1次
微分フィルタ処理手段と、1次微分フィルタを施した該
画像を2値化する2値化処理手段と、2値化した該画像
を細線化する細線化処理手段と、画面上の全画素値の総
和を特徴量として求める特徴量算出手段とを有すること
を特徴とするものである。According to a seventh aspect of the invention, in the first to sixth aspects of the invention, when the image pickup position is deviated from the in-focus position, the brightness of the entire image is compared with a preset brightness, and the comparison is made. Based on the result, it is characterized in that whether the image is deviated in either of the perspective direction is corrected, and the position of the image pickup system is corrected to a distance within a predetermined range. According to an eighth aspect of the present invention, an image pickup unit that picks up an image of an object and captures an image of the object, an image pickup unit moving unit that moves the image pickup unit in a vertical vertical direction, and a stage that fixes the object are horizontally and vertically above and below the horizontal plane. A stage moving means for moving, a rotating means for rotating the stage in a horizontal plane, a light irradiating means for irradiating the object with light, an image processing device for processing an image captured by the image capturing means, the image capturing means, and the image capturing means. A three-dimensional position detection device having a control device for moving a stage, wherein a first-order differential filter processing means for applying a first-order differential filter to the captured image and the image subjected to the first-order differential filter are binarized. And a thinning processing unit for thinning the binarized image, and a feature amount calculating unit for obtaining a sum of all pixel values on the screen as a feature amount. Than it is.
【0014】請求項9記載の発明は、上記請求項8記載
の発明において、取り込んだ前記画像に4近傍のラプラ
シアンフィルタを施すラプラシアンフィルタ処理手段
と、ラプラシアンフィルタを施した画像の最高画素値と
最低画素値の差を検出し、焦点が合った際、検出した該
画像の最高画素値と最低画素値の差が合焦点位置でピー
クとなることにより合焦点位置を検出する合焦点位置検
出手段とを有することを特徴とするものである。According to a ninth aspect of the present invention, in the above-mentioned eighth aspect of the present invention, the Laplacian filter processing means for applying a Laplacian filter in the vicinity of four to the captured image, and the highest pixel value and the lowest pixel value of the image subjected to the Laplacian filter. A focus position detecting means for detecting the focus position by detecting the difference between the pixel values and, when in focus, detects the difference between the highest pixel value and the lowest pixel value of the detected image at the focus position. It is characterized by having.
【0015】請求項10記載の発明は、上記請求項9記
載の発明において、取り込んだ前記画像中の合焦点部分
のみを2値画像として抽出する2値画像抽出手段を有す
ることを特徴とするものである。請求項11記載の発明
は、上記請求項10記載の発明において、前記合焦点部
分の2値画像の領域を求める2値画像領域算出手段と、
取り込んだ前記画像から求めた該2値画像領域の画像を
抽出する画像抽出手段とを有することを特徴とするもの
である。The invention described in claim 10 is characterized in that, in the invention described in claim 9, it has a binary image extraction means for extracting only a focused portion in the captured image as a binary image. Is. According to an eleventh aspect of the present invention, in the above tenth aspect of the present invention, a binary image area calculating means for obtaining an area of the binary image in the focused portion,
And an image extracting means for extracting an image of the binary image area obtained from the captured image.
【0016】請求項12記載の発明は、上記請求項8,
9記載の発明において、段差を有する物体を検出する
際、撮像系の移動に伴い抽出される合焦点位置の変化に
基づいて、該段差の距離を検出する距離検出手段を有す
ることを特徴とするものである。請求項13記載の発明
は、上記請求項8乃至12記載の発明において、物体の
内部にのみ段差を有する場合、該物体の内部の合焦点部
分の位置を検出する位置検出手段を有することを特徴と
するものである。The invention according to claim 12 is the above-mentioned claim 8,
In the invention described in Item 9, when detecting an object having a step, there is provided distance detection means for detecting a distance of the step based on a change in a focus position extracted with the movement of the imaging system. It is a thing. According to a thirteenth aspect of the present invention, in the above-described eighth to twelfth aspects, when a step is formed only inside the object, a position detecting means for detecting the position of the focused portion inside the object is provided. It is what
【0017】請求項14記載の発明は、上記請求項8乃
至13記載の発明において、撮像位置が合焦点位置から
ずれている場合、画像全体の明るさと予め設定された明
るさとを比較する比較手段と、比較した結果に基づいて
遠近どちらかの方向にずれているかを特定し、所定の範
囲の距離まで撮像系の位置を補正する位置補正手段とを
有することを特徴とするものである。According to a fourteenth aspect of the present invention, in the above-described eighth to thirteenth aspects, when the image pickup position is deviated from the in-focus position, the comparison means compares the brightness of the entire image with a preset brightness. And a position correcting means for correcting the position of the image pickup system up to a distance within a predetermined range by specifying whether the image is deviated in the perspective direction based on the comparison result.
【0018】[0018]
【作用】請求項1記載の発明では、物体を撮像して物体
の画像を取り込み、次いで、輪郭の鮮明度を抽出するた
めに、取り込んだ画像に1次微分フィルタを施し、次い
で、輪郭の鮮明さを際立たせるために、1次微分フィル
タを施した画像を2値化し、次いで、撮像位置の遠近に
関する面積の影響を軽減するために、2値化した画像を
細線化し、次いで、画面上の全画素値の総和を特徴量と
して求めるように構成する。According to the first aspect of the present invention, an image of an object is picked up, an image of the object is captured, and then, in order to extract the sharpness of the contour, a first derivative filter is applied to the captured image, and then the contour is sharpened. The image subjected to the first-order differential filter is binarized in order to make the difference outstanding, and then the binarized image is thinned in order to reduce the influence of the area related to the perspective of the imaging position. The sum of all pixel values is obtained as a feature amount.
【0019】このため、画像処理を行う際、外部にオー
トフォーカス機構や測距センサ等を設けることなく、合
焦点位置で画像の輪郭が鮮明になるように、画像に1次
微分フィルタを施し、更に画像を2値化することによ
り、画像の輪郭が鮮明な合焦点位置を画像処理の1連の
アルゴリズムのなかで検出することができる。しかも、
その際、画像に細線化を施すことにより、撮像位置の遠
近に関して画像の面積の増減の影響、即ち焦点のずれ量
に伴う特徴量の変化が画像中の物体の面積の変化から受
ける影響を軽減して、合焦点位置を誤差が少ないように
検出することができる。For this reason, when performing image processing, a primary differential filter is applied to the image so that the contour of the image becomes clear at the in-focus position without providing an external autofocus mechanism or a distance measuring sensor. Further, by binarizing the image, it is possible to detect the in-focus position where the contour of the image is clear in a series of algorithms for image processing. Moreover,
At that time, by thinning the image, the influence of the increase or decrease of the area of the image with respect to the perspective of the imaging position, that is, the influence of the change of the feature amount due to the shift amount of the focus from the change of the area of the object in the image is reduced. Then, the focus position can be detected so that the error is small.
【0020】請求項2記載の発明では、画像のコントラ
ストを際立たせるために、取り込んだ画像に4近傍のラ
プラシアンフィルタを施し、ラプラシアンフィルタを施
した画像の最高画素値と最低画素値の差を検出し、焦点
が合った際、検出した画像の最高画素値と最低画素値の
差が合焦点位置でピークとなることにより合焦点位置を
検出するように構成する。According to the second aspect of the present invention, in order to enhance the contrast of the image, a Laplacian filter in the vicinity of 4 is applied to the captured image, and the difference between the highest pixel value and the lowest pixel value of the image subjected to the Laplacian filter is detected. Then, when the image is in focus, the difference between the highest pixel value and the lowest pixel value of the detected image has a peak at the in-focus position, so that the in-focus position is detected.
【0021】このため、画像処理を行う際、4近傍のラ
プラシアンフィルタを画像に施すことにより、合焦点位
置で画像のコントラストを鮮明にすることができる。し
かも、そのラプラシアンフィルタを施した画像面内の最
高画素値と最低画素値の差を特徴量とし、その特徴量が
合焦点位置でピークを与えることにより、合焦点位置を
検出することができる。従って、更に高精度な合焦点位
置を更に高速に検出することができる。Therefore, when the image processing is performed, the Laplacian filters in the vicinity of 4 are applied to the image, so that the contrast of the image can be made sharp at the in-focus position. Moreover, the difference between the highest pixel value and the lowest pixel value in the Laplacian filtered image plane is used as the feature amount, and the feature amount gives a peak at the in-focus position, whereby the in-focus position can be detected. Therefore, it is possible to detect the in-focus position with higher accuracy at higher speed.
【0022】請求項3記載の発明では、取り込んだ画像
中の合焦点部分のみを2値画像として抽出するように構
成する。このため、画像処理を行う際、取り込んだ画像
中の合焦点部分のみを2値画像として抽出することによ
り、3次元物体の注目部分の画像のみを2値画像として
抽出することができる。According to the third aspect of the invention, only the focused portion in the captured image is extracted as a binary image. Therefore, when performing image processing, by extracting only the focused portion in the captured image as a binary image, only the image of the attention portion of the three-dimensional object can be extracted as a binary image.
【0023】請求項4記載の発明では、合焦点部分の2
値画像の領域を求め、取り込んだ画像から2値画像領域
の画像を抽出するように構成する。このため、画像処理
を行う際、合焦点部分の2値画像の領域を特定し、その
2値画像領域部分を取り込んだ画像から抽出することに
より、3次元物体の注目部分の合焦点部分の画像のみを
濃淡画像として抽出することができる。According to the fourth aspect of the invention, the focusing point portion 2 is provided.
The area of the value image is obtained, and the image of the binary image area is extracted from the captured image. Therefore, when the image processing is performed, the area of the binary image of the focused area is specified, and the image of the focused area of the attention area of the three-dimensional object is extracted by extracting the binary image area portion from the captured image. Only the grayscale image can be extracted.
【0024】請求項5記載の発明では、段差を有する物
体を検出する際、撮像系の移動に伴い抽出される合焦点
位置の変化に基づいて、段差の距離を検出するように構
成する。このため、画像処理を行う際、段差を有する物
体を検出する時に、撮像系の移動に伴い抽出される合焦
点位置の変化に基づいて段差の距離を検出することによ
り、外部に測距センサ等を設けずに段差の高さ等の測距
を行うことができる。According to the fifth aspect of the invention, when an object having a step is detected, the distance of the step is detected based on the change in the in-focus position extracted with the movement of the image pickup system. Therefore, when performing image processing, when detecting an object having a step, by detecting the step distance based on the change in the in-focus position extracted with the movement of the imaging system, a distance measuring sensor or the like can be externally provided. It is possible to measure the distance such as the height of a step without providing the step.
【0025】請求項6記載の発明では、物体の外部に段
差がなく、内部にのみ段差を有する場合、物体の内部の
合焦点部分の位置を検出するように構成する。このた
め、画像処理を行う際、物体の外部に段差がなく、外部
が滑らかな曲面等、物体の内部にのみ段差を有する場合
でも、物体内部の段差等の特徴より、その段差の方向や
深さを非接触で検出することができ、物体全体の位置や
姿勢を検出することができる。According to the sixth aspect of the present invention, when there is no step outside the object but only inside the object, the position of the focused portion inside the object is detected. Therefore, when performing image processing, even if there is no step outside the object and there is a step only inside the object, such as a smooth curved surface on the outside, due to the characteristics of the step inside the object, the direction and depth of the step Can be detected in a non-contact manner, and the position and orientation of the entire object can be detected.
【0026】次に、画像処理を行う際、請求項1乃至6
の方法により合焦点位置を検出する時に、合焦点位置か
らかなりずれている場合、撮像位置が微少距離動いただ
けでは、特徴量の変化が小さいため、遠近どちらかにず
れているかを特定することができない。そこで、請求項
7記載の発明では、撮像位置が合焦点位置からずれてい
る場合、画像全体の明るさと予め設定された明るさとを
比較し、比較した結果に基づいて遠近どちらかの方向に
ずれているかを特定し、所定範囲の距離まで撮像系の位
置を補正するように構成する。Next, when performing image processing, the method according to any one of claims 1 to 6
When the in-focus position is detected by the method described in (1), if it is significantly deviated from the in-focus position, it is possible to specify whether it is deviated to near or near because the change in the feature amount is small if the imaging position moves only a small distance. Can not. Therefore, in the invention according to claim 7, when the image pickup position is deviated from the in-focus position, the brightness of the entire image is compared with a preset brightness, and the image is deviated in either direction of the perspective based on the comparison result. It is configured to correct the position of the imaging system up to a predetermined range of distance.
【0027】このため、画像面内の明るさと予め設定さ
れた明るさとを比較し、遠近どちらの方向にずれている
かを特定し、ある距離までは素速く撮像位置を補正する
ことにより、合焦点位置よりかなりずれている場合で
も、遠近方向のどちらにずれているかを特定し、撮像手
段を合焦点位置により速く移動させることができる。請
求項8記載の発明では、輪郭の鮮明度を抽出するため
に、撮像手段で取り込んだ画像に1次微分フィルタ処理
手段により1次微分フィルタを施し、輪郭の鮮明さを際
立たせるために、1次微分フィルタを施した画像を2値
化処理手段により2値化し、次いで、撮像位置の遠近に
関する面積の影響を軽減するために2値化した画像を細
線化処理手段により細線化し、次いで、画面上の全画素
値の総和を特徴量算出手段により特徴量として求めるよ
うに構成する。Therefore, by comparing the brightness in the image plane with the preset brightness, it is specified which direction the image is deviated from, the distance or the near direction, and the image pickup position is quickly corrected up to a certain distance to obtain the in-focus point. Even when the position is considerably deviated from the position, it is possible to specify in which direction, the deviating direction, the position is deviated, and move the image pickup unit to the in-focus position faster. According to the invention described in claim 8, in order to extract the sharpness of the contour, the image captured by the image pickup means is subjected to the first-order differential filter by the first-order differential filter processing means to make the sharpness of the contour stand out. The image subjected to the secondary differential filter is binarized by the binarization processing means, and then the binarized image is thinned by the thinning processing means to reduce the influence of the area relating to the perspective of the imaging position, and then the screen is displayed. The sum of all the above pixel values is obtained as a feature amount by the feature amount calculation means.
【0028】このため、画像処理を行う際、外部にオー
トフォーカス機構や測距センサ等を設けることなく、合
焦点位置で画像の輪郭が鮮明になるように、画像1次微
分フィルタを施し、更に画像を2値化することにより、
画像の輪郭が鮮明な合焦点位置を画像処理の1連のアル
ゴリズムのなかで検出することができる。しかも、その
際、画像に細線化を施すことにより、撮像位置の遠近に
関して画像の面積の増減の影響、即ち焦点のずれ量に伴
う特徴量の変化が画像中の物体の面積の変化から受ける
影響を軽減して、合焦点位置を誤差が少ないように検出
することができる。For this reason, when performing image processing, an image primary differential filter is applied so that the contour of the image becomes clear at the in-focus position without providing an external autofocus mechanism or distance measuring sensor. By binarizing the image,
The focus position where the contour of the image is clear can be detected by a series of algorithms for image processing. Moreover, at that time, by thinning the image, the influence of the increase or decrease of the image area with respect to the perspective of the imaging position, that is, the influence of the change of the feature amount due to the shift amount of the focus from the change of the area of the object in the image Can be reduced, and the focus position can be detected with less error.
【0029】請求項9記載の発明では、画像のコントラ
ストを際立たせるために、取り込んだ画像に4近傍のラ
プラシアンフィルタをラプラシアンフィルタ処理手段に
より施し、ラプラシアンフィルタを施した画像の最高画
素値と最低画素値の差を検出し、焦点が合った際、検出
した画像の最高画素値と最低画素値の差が合焦点位置で
ピークとなることにより合焦点位置を合焦点位置検出手
段により検出するように構成する。In order to enhance the contrast of the image, the Laplacian filter processing means applies Laplacian filters in the four neighborhoods to the captured image to obtain the highest pixel value and the lowest pixel value of the image subjected to the Laplacian filter. When the difference between the values is detected and the image is in focus, the difference between the highest pixel value and the lowest pixel value of the detected image has a peak at the in-focus position so that the in-focus position is detected by the in-focus position detecting means. Configure.
【0030】このため、画像処理を行う際、4近傍のラ
プラシアンフィルタを画像に施すことにより、合焦点位
置で画像のコントラストを鮮明にすることができる。し
かも、そのラプラシアンフィルタを施した画像面内の最
高画素値と最低画素値の差を特徴量とし、その特徴量が
合焦点位置でピークを与えることより、合焦点位置を検
出することができる。従って、更に高精度な合焦点位置
を更に高速に検出することができる。Therefore, when the image processing is performed, the Laplacian filters in the vicinity of 4 are applied to the image, so that the contrast of the image can be made clear at the in-focus position. Moreover, the difference between the highest pixel value and the lowest pixel value in the image plane that has been subjected to the Laplacian filter is used as the feature amount, and the feature amount gives a peak at the in-focus position, whereby the in-focus position can be detected. Therefore, it is possible to detect the in-focus position with higher accuracy at higher speed.
【0031】請求項10記載の発明では、取り込んだ画
像中の合焦点部分のみを2値画像抽出手段により2値画
像として抽出するように構成する。このため、画像処理
を行う際、取り込んだ画像中の合焦点部分のみを2値画
像として抽出することにより、3次元物体の注目部分の
画像のみを2値画像として抽出することができる。According to the tenth aspect of the invention, only the in-focus portion in the captured image is extracted as a binary image by the binary image extracting means. Therefore, when performing image processing, by extracting only the focused portion in the captured image as a binary image, only the image of the attention portion of the three-dimensional object can be extracted as a binary image.
【0032】請求項11記載の発明では、合焦点部分の
2値画像の領域を2値画像領域算出手段により求め、取
り込んだ画像から2値画像領域の画像を画像抽出手段に
より抽出するように構成する。このため、画像処理を行
う際、合焦点部分の2値画像の領域を特定し、その2値
画像領域部分を取り込んだ画像から抽出することによ
り、3次元物体の注目部分の合焦点部分の画像のみを濃
淡画像として抽出することができる。In the eleventh aspect of the present invention, the area of the binary image of the focused portion is obtained by the binary image area calculating means, and the image of the binary image area is extracted from the captured image by the image extracting means. To do. Therefore, when the image processing is performed, the area of the binary image of the focused area is specified, and the image of the focused area of the attention area of the three-dimensional object is extracted by extracting the binary image area portion from the captured image. Only the grayscale image can be extracted.
【0033】請求項12記載の発明では、段差を有する
物体を検出する際、撮像系の移動に伴い抽出される合焦
点位置の変化に基づいて、段差の距離を距離検出手段に
より検出するように構成する。このため、画像処理を行
う際、段差を有する物体を検出する時に、撮像系の移動
に伴い抽出される合焦点位置の変化に基づいて段差の距
離を検出することにより、外部に測距センサ等を設けず
に段差の高さ等の測距を行うことができる。According to the twelfth aspect of the present invention, when an object having a step is detected, the distance of the step is detected by the distance detecting means based on the change in the in-focus position extracted with the movement of the image pickup system. Configure. Therefore, when performing image processing, when detecting an object having a step, by detecting the step distance based on the change in the in-focus position extracted with the movement of the imaging system, a distance measuring sensor or the like can be externally provided. It is possible to measure the distance such as the height of a step without providing the step.
【0034】請求項13記載の発明では、物体の外部に
段差がなく、内部にのみ段差を有する場合、物体の内部
の合焦点部分の位置を位置検出手段により検出するよう
に構成する。このため、画像処理を行う際、物体の外部
に段差がなく、外部が滑らかな曲面等、物体の内部にの
み段差を有する場合でも、物体内部の段差等の特徴よ
り、その段差の方向や深さを非接触で検出することがで
き、物体全体の位置や姿勢を検出することができる。According to the thirteenth aspect of the invention, when there is no step outside the object but only inside the object, the position detecting means detects the position of the in-focus portion inside the object. Therefore, when performing image processing, even if there is no step outside the object and there is a step only inside the object, such as a smooth curved surface on the outside, due to the characteristics of the step inside the object, the direction and depth of the step Can be detected in a non-contact manner, and the position and orientation of the entire object can be detected.
【0035】次に、画像処理を行う際、請求項8乃至1
3の方法により合焦点位置を検出する時に、合焦点位置
からかなりずれている場合、撮像位置が微少距離動いた
だけでは、特徴量の変化が小さいため、遠近どちらかに
ずれているかを特定することができない。そこで、請求
項14記載の発明では、撮像位置が合焦点位置からずれ
ている場合、画像全体の明るさと予め設定された明るさ
とを比較手段により比較し、比較した結果に基づいて遠
近どちらの方向にずれているかを特定し、所定の範囲の
距離まで撮像系の位置を位置補正手段により補正するよ
うに構成する。Next, when performing image processing, the method according to any one of claims 8 to 1
When the in-focus position is detected by the method of No. 3, if it deviates considerably from the in-focus position, the change in the feature amount is small if the imaging position moves only a small distance. I can't. Therefore, in the invention according to claim 14, when the image pickup position is deviated from the in-focus position, the comparison means compares the brightness of the entire image with the preset brightness, and based on the result of the comparison, which of the perspective direction is used. It is configured so that the position of the image pickup system is corrected by the position correction means to a distance within a predetermined range.
【0036】このため、画像面内の明るさと予め設定さ
れた明るさとを比較し、遠近どちらの方向にずれている
かを特定し、ある距離までは素速く撮像位置を補正する
ことにより、合焦点位置よりかなりずれている場合で
も、遠近方向のどちらにずれているかを特定し、撮像手
段を合焦点位置により速く移動させることができる。Therefore, by comparing the brightness in the image plane with a preset brightness, it is specified which direction the image is deviated, that is, the direction in which the image is deviated, and the image pickup position is quickly corrected up to a certain distance. Even when the position is considerably deviated from the position, it is possible to specify in which direction, the deviating direction, the position is deviated, and move the image pickup unit to the in-focus position faster.
【0037】[0037]
【実施例】以下、本発明の実施例を図面を参照して説明
する。 (実施例1)図1は本発明に係る実施例1の3次元位置
検出装置の構成を示す図である。本実施例では、物体1
の画像を取り込むCCDカメラ2を鉛直上下方向に移動
させるカメラホルダー3に固定し、物体1を水平面内左
右上下移動させるとともに、回転させるx−y−θステ
ージ4に固定し、LED照明装置等の照明装置5により
物体1に光を照射し、取り込んだ画像を画像処理装置6
により所望の処理を行って特徴量を抽出する。それらの
特徴量からZ軸制御装置7及びx−y−θ制御装置8に
より、CCDカメラ2の位置とx−y−θステージ4の
状態を制御する。Embodiments of the present invention will be described below with reference to the drawings. (Embodiment 1) FIG. 1 is a diagram showing the configuration of a three-dimensional position detecting apparatus according to Embodiment 1 of the present invention. In this embodiment, the object 1
The CCD camera 2 that captures the image of is fixed to the camera holder 3 that moves vertically and vertically, and the object 1 is moved horizontally and vertically in the horizontal plane, and also fixed to the xy stage 6 that rotates. The object 1 is irradiated with light by the illumination device 5, and the captured image is processed by the image processing device 6
Then, a desired amount of data is extracted by performing a desired process. The Z-axis control device 7 and the xy- [theta] control device 8 control the position of the CCD camera 2 and the state of the xy- [theta] stage 4 based on these characteristic quantities.
【0038】本実施例の画像処理装置6は、取り込んだ
画像に1次微分フィルタを施す1次微分フィルタ処理回
路と、輪郭の鮮明さを際立たせるために1次微分フィル
タを施した画像を2値化する2値化処理回路と、撮像位
置の遠近に関する面積の影響を軽減するために2値化し
た画像を細線化する細線化処理回路と、画面上の全画素
値の総和を特徴量として求める特徴量算出回路とを有す
る。The image processing apparatus 6 of the present embodiment uses a primary differential filter processing circuit for applying a primary differential filter to the captured image and an image for which a primary differential filter is applied in order to emphasize the sharpness of the contour. A binarization processing circuit for binarizing, a thinning processing circuit for thinning a binarized image in order to reduce the influence of the area on the perspective of the imaging position, and a sum of all pixel values on the screen as a feature amount. And a feature amount calculation circuit for obtaining.
【0039】ここで、1次微分フィルタ処理回路は、例
えば図2に示す如く、8近傍フィルタを用い、次の
(1)式に示すような1次微分フィルタPrewitt
を設定し、画像に施して輪郭部分の抽出を行う。Here, the first-order differential filter processing circuit uses, for example, an 8-neighbor filter as shown in FIG. 2, and a first-order differential filter Prewitt as shown in the following equation (1).
Is set and applied to the image to extract the contour portion.
【0040】[0040]
【数1】 [Equation 1]
【0041】輪郭部よりも画素値の変化が小さいが、フ
ィルタにより際立ってしまった余分な部分を除去するた
めに、2値化処理回路は、1次微分フィルタを施した画
像の2値化を行う。画像面内の画素値の総和を特徴量と
するため、撮像位置の遠近により撮像される物体の画像
の大きさが影響する。そこで、その影響を軽減するため
に、細線化処理回路は、2値化した画像の細線化を行
う。そして、特徴量算出回路は、画面上の全画素値の総
和を特徴量として求める。ここで、画面上の画素値の総
和を数え上げて、鉛直上下方向の移動との関係を図3に
示す。Although the change of the pixel value is smaller than that of the contour portion, the binarization processing circuit binarizes the image to which the primary differential filter is applied in order to remove the extra portion which is conspicuous by the filter. To do. Since the sum of pixel values in the image plane is used as the feature amount, the size of the image of the object that is imaged affects the distance of the imaging position. Therefore, in order to reduce the influence, the thinning processing circuit thins the binarized image. Then, the feature amount calculation circuit obtains the sum of all pixel values on the screen as the feature amount. Here, the total of the pixel values on the screen is counted and the relationship with the movement in the vertical direction is shown in FIG.
【0042】このように、本実施例(請求項1,8)で
は、輪郭の鮮明度を抽出するために、CCDカメラ2で
取り込んだ画像に画像処理装置6の1次微分フィルタ処
理回路により1次微分フィルタを施し、次いで、輪郭の
鮮明さを際立たせるために、1次微分フィルタを施した
画像を画像処理装置6の2値化処理回路により2値化
し、次いで、撮像位置の遠近に関する面積の影響を軽減
するために2値化した画像を画像処理装置6の細線化処
理回路により細線化し、次いで、画面上の全画素値の総
和を画像処理装置6の特徴量算出回路により特徴量とし
て求めるように構成している。As described above, in this embodiment (claims 1 and 8), in order to extract the sharpness of the contour, the image captured by the CCD camera 2 is processed by the first-order differential filter processing circuit of the image processing device 6 The image subjected to the secondary differential filter and then the primary differential filter in order to emphasize the sharpness of the contour is binarized by the binarization processing circuit of the image processing device 6, and then the area relating to the perspective of the imaging position. In order to reduce the influence of the above, the binarized image is thinned by the thinning processing circuit of the image processing device 6, and then the sum of all pixel values on the screen is used as the feature amount by the feature amount calculation circuit of the image processing device 6. It is configured to ask.
【0043】このため、画像処理を行う際、外部にオー
トフォーカス機構や測距センサ等を設けることなく、合
焦点位置で画像の輪郭が鮮明になるように、画像に1次
微分フィルタを施し、更に画像を2値化することによ
り、画像の輪郭が鮮明な合焦点位置を画像処理の1連の
アルゴリズムのなかで検出することができる。しかも、
その際、画像に細線化を施すことにより、撮像位置の遠
近に関して画像の面積の増減の影響、即ち焦点のずれ量
に伴う特徴量の変化が画像中の物体の面積の変化から受
ける影響を軽減して合焦点位置を誤差が少ないように検
出することができる。 (実施例2)本実施例は、図1の3次元位置検出装置に
適用することができる。Therefore, when performing image processing, a primary differential filter is applied to the image so that the outline of the image becomes clear at the in-focus position without providing an external autofocus mechanism or a distance measuring sensor. Further, by binarizing the image, it is possible to detect the in-focus position where the contour of the image is clear in a series of algorithms for image processing. Moreover,
At that time, by thinning the image, the influence of the increase or decrease of the area of the image with respect to the perspective of the imaging position, that is, the influence of the change of the feature amount due to the shift amount of the focus from the change of the area of the object in the image is reduced. Then, the in-focus position can be detected with a small error. (Embodiment 2) This embodiment can be applied to the three-dimensional position detecting device of FIG.
【0044】本実施例の画像処理装置6は、画像のコン
トラストを際立たせるために取り込んだ画像に4近傍の
ラプラシアンフィルタを施すラプラシアンフィルタ処理
回路と、ラプラシアンフィルタを施した画像の最高画素
値と最低画素値の差を検出し、焦点が合った際、検出し
た画像の最高画素値と最低画素値の差が合焦点位置でピ
ークとなることにより合焦点位置を検出する合焦点位置
検出回路とを有する。The image processing device 6 of the present embodiment includes a Laplacian filter processing circuit for applying a Laplacian filter in the vicinity of 4 to an image captured in order to enhance the contrast of the image, and the maximum pixel value and the minimum pixel value of the image subjected to the Laplacian filter. A focus point position detection circuit that detects the focus point position by detecting the difference between the pixel values, and when the focus is achieved, the difference between the highest pixel value and the lowest pixel value of the detected image has a peak at the focus point position. Have.
【0045】ここで、例えば黒い物体としてCリングを
白い背景をしたステージ上に設置し、その撮像に関して
合焦点位置を検出する場合を図4に示す。ラプラシアン
フィルタ処理回路は、図2のフィルタを用い、次の
(2)式に示す2次微分フィルタ・ラプラシアンを設定
し、画像に施して画像のコントラストを強調する。Here, FIG. 4 shows a case in which, for example, a C ring as a black object is installed on a stage with a white background, and the in-focus position is detected for the image pickup. The Laplacian filter processing circuit uses the filter of FIG. 2 to set a quadratic differential filter Laplacian shown in the following expression (2), and applies it to the image to emphasize the contrast of the image.
【0046】[0046]
【数2】 [Equation 2]
【0047】そして、合焦点位置検出回路は、このフィ
ルタを施した画像面内の最高画素値と最低画素値の差を
特徴量とし、図5に示す如く、合焦点位置でピークとな
ることから合焦点位置を検出する。なお、このフィルタ
以外のものを用いても、検出することができないことは
ないが、このフィルタを用いないと、最高画素値がすぐ
画像の階調を越えて飽和してしまう恐れがあり、合焦点
位置を検出する点で好ましくない。Then, the in-focus position detection circuit uses the difference between the highest pixel value and the lowest pixel value in the filtered image plane as a feature amount, and as shown in FIG. 5, it has a peak at the in-focus position. The focus position is detected. It should be noted that even if a filter other than this filter is used, it cannot be detected, but if this filter is not used, the maximum pixel value may soon exceed the image gradation and become saturated, which means that It is not preferable in terms of detecting the focal position.
【0048】このように、本実施例(請求項2,9)で
は、画像のコントラストを際立たせるために、取り込ん
だ画像に4近傍のラプラシアンフィルタをラプラシアン
フィルタ処理回路により施し、ラプラシアンフィルタを
施した画像の最高画素値と最低画素値の差を検出し、焦
点が合った際、検出した画像の最高画素値と最低画素値
の差が合焦点位置でピークとなることにより合焦点位置
を合焦点位置検出回路により検出するように構成してい
る。As described above, in the present embodiment (claims 2 and 9), the Laplacian filter processing circuit applies the Laplacian filter in the vicinity of 4 to the captured image and the Laplacian filter in order to enhance the contrast of the image. When the difference between the highest pixel value and the lowest pixel value of the image is detected and the focus is achieved, the difference between the highest pixel value and the lowest pixel value of the detected image becomes the peak at the in-focus position, so that the in-focus position is brought into focus. The position detection circuit is configured to detect.
【0049】このため、画像処理を行う際、4近傍のラ
プラシアンフィルタを画像に施すことにより、合焦点位
置で画像のコントラストを鮮明にすることができる。し
かも、そのラプラシアンフィルタを施した画像面内の最
高画素値と最低画素値の差を特徴量とし、その特徴量が
合焦点位置でピークを与えることより、合焦点位置を検
出することができる。従って、更に高精度な合焦点位置
を更に高速に検出することができる。 (実施例3)本実施例は、図1の3次元位置検出装置に
適用することができる。Therefore, when the image processing is performed, the Laplacian filters in the vicinity of 4 are applied to the image, so that the contrast of the image can be made sharp at the in-focus position. Moreover, the difference between the highest pixel value and the lowest pixel value in the image plane that has been subjected to the Laplacian filter is used as the feature amount, and the feature amount gives a peak at the in-focus position, whereby the in-focus position can be detected. Therefore, it is possible to detect the in-focus position with higher accuracy at higher speed. (Embodiment 3) This embodiment can be applied to the three-dimensional position detecting device of FIG.
【0050】本実施例の画像処理装置6は、取り込んだ
画像中の合焦点部分のみを2値画像として抽出する2値
画像抽出回路を有する。ここで、例えば図6,7に、内
部にDカット11を施してあり、外部には段差がない円
筒状の物体のDカット11の画像のみを取り出す場合を
示す。図6は、物体の内部に施したDカット11の様子
を示しており、図7は、物体の上方からの画像の様子を
示している。なお、図6,7において、12は円筒の口
部である。The image processing apparatus 6 of this embodiment has a binary image extraction circuit for extracting only the focused portion in the captured image as a binary image. Here, for example, FIGS. 6 and 7 show a case in which only the image of the D-cut 11 of the cylindrical object having the D-cut 11 inside and having no step outside is taken out. FIG. 6 shows a state of the D-cut 11 applied inside the object, and FIG. 7 shows a state of an image from above the object. In FIGS. 6 and 7, 12 is a cylindrical mouth.
【0051】Dカット11部に焦点があった場合のラプ
ラシアンを施した画像の略図を図8に示す。比較的高周
波成分が存在する合焦点位置が残り、膨張圧縮の前処理
を施した後2値化を行った画像の略図を図9に示す。こ
のように、本実施例(請求項3,10)では、取り込ん
だ画像中の合焦点部分のみを2値画像抽出回路により2
値画像として抽出するように構成している。FIG. 8 shows a schematic diagram of an image subjected to Laplacian when the D-cut 11 part is focused. FIG. 9 shows a schematic diagram of an image in which the focus position where a relatively high frequency component exists remains, and which is binarized after pre-processing of expansion and compression. As described above, in this embodiment (claims 3 and 10), only the in-focus portion in the captured image is converted into a binary image by the binary image extraction circuit.
It is configured to be extracted as a value image.
【0052】このため、画像処理を行う際、取り込んだ
画像中の合焦点部分のみを2値画像として抽出すること
により、3次元物体の注目部分の画像のみを2値画像と
して抽出することができる。 (実施例4)本実施例は、図1の3次元位置検出装置に
適用することができる。Therefore, when performing image processing, by extracting only the focused portion in the captured image as a binary image, only the image of the attention portion of the three-dimensional object can be extracted as a binary image. . (Embodiment 4) This embodiment can be applied to the three-dimensional position detecting device of FIG.
【0053】本実施例の画像処理装置6は、合焦点部分
の2値画像の領域を求める2値画像領域算出回路と、取
り込んだ画像から求めた2値画像領域の画像を抽出する
画像抽出回路とを有する。ここでは、例えば実施例3で
前述した図9の黒画像の部分の各画素の座標を求め、最
初に取り込んだ濃淡画像中のそれらの領域に相当する部
分のみを残し、それ以外を黒または白画像として合焦点
部分のみを濃淡画像として抽出する。The image processing apparatus 6 of this embodiment comprises a binary image area calculation circuit for obtaining an area of a binary image in a focused area and an image extraction circuit for extracting an image of a binary image area obtained from a captured image. Have and. Here, for example, the coordinates of each pixel of the portion of the black image of FIG. 9 described in the third embodiment are obtained, and only the portions corresponding to those regions in the grayscale image captured first are left, and the others are black or white. As the image, only the focused portion is extracted as the grayscale image.
【0054】このように、本実施例(請求項4,11)
では、合焦点部分の2値画像の領域を2値画像領域算出
回路により求め、取り込んだ画像から2値画像領域の画
像を画像抽出回路により抽出するように構成している。
このため、画像処理を行う際、合焦点部分の2値画像の
領域を特定し、その2値画像領域部分を取り込んだ画像
から抽出することにより、3次元物体の注目部分の合焦
点部分の画像のみを濃淡画像として抽出することができ
る。 (実施例5)本実施例は、図1の3次元位置検出装置に
適用することができる。Thus, the present embodiment (claims 4 and 11)
Then, the binary image area of the focused portion is obtained by the binary image area calculation circuit, and the image of the binary image area is extracted by the image extraction circuit from the captured image.
Therefore, when the image processing is performed, the area of the binary image of the focused area is specified, and the image of the focused area of the attention area of the three-dimensional object is extracted by extracting the binary image area portion from the captured image. Only the grayscale image can be extracted. (Embodiment 5) This embodiment can be applied to the three-dimensional position detecting device of FIG.
【0055】本実施例の画像処理装置6は、段差を有す
る物体を検出する際、撮像系の移動に伴い抽出される合
焦点位置の変化に基づいて、段差等の距離を検出する距
離検出回路を有する。ここでは、例えば実施例2で前述
した図6,7のDカット11部と円筒の口部12との距
離を検出する場合に示す如く、前述した実施例2の方法
により、Dカット11部の位置を検出し、更にCCDカ
メラ2を上方向に移動して、再度、前述した実施例2の
方法により、円筒の口部12を検出する。その時のCC
Dカメラ2の移動と特徴量の変化との関係を図10に示
す。The image processing device 6 of this embodiment detects a distance such as a step based on a change in the in-focus position extracted with the movement of the image pickup system when detecting an object having a step. Have. Here, for example, as shown in the case of detecting the distance between the D-cut 11 portion and the cylindrical mouth portion 12 of FIGS. 6 and 7 described in the second embodiment, the D-cut 11 portion of the D-cut 11 portion is detected by the method of the second embodiment. The position is detected, the CCD camera 2 is further moved upward, and the cylindrical mouth portion 12 is detected again by the method of the second embodiment described above. CC at that time
FIG. 10 shows the relationship between the movement of the D camera 2 and the change in the characteristic amount.
【0056】このように、本実施例(請求項5,12)
では、段差を有する物体を検出する際、撮像系の移動に
伴い抽出される合焦点位置の変化に基づいて、段差の距
離を距離検出回路により検出するように構成している。
このため、画像処理を行う際、段差を有する物体を検出
する時に、撮像系の移動に伴い抽出される合焦点位置の
変化に基づいて段差の距離を検出することにより、外部
に測距センサ等を設けずに段差の高さ等の測距を行うこ
とができる。 (実施例6)本実施例は、図1の3次元位置検出装置に
適用することができる。Thus, the present embodiment (claims 5 and 12).
Then, when detecting an object having a step, the distance detection circuit detects the distance of the step based on the change in the in-focus position extracted with the movement of the imaging system.
Therefore, when performing image processing, when detecting an object having a step, by detecting the step distance based on the change in the in-focus position extracted with the movement of the imaging system, a distance measuring sensor or the like can be externally provided. It is possible to measure the distance such as the height of a step without providing the step. (Embodiment 6) This embodiment can be applied to the three-dimensional position detecting device of FIG.
【0057】本実施例の画像処理装置6は、物体の内部
にのみ段差を有する場合、物体の内部の合焦点部分の位
置を検出する位置検出回路を有する。ここでは、例えば
実施例2で前述した図6,7の物体に関して、Dカット
11の方向を検出する場合に示す如く、Dカット11の
画像を前述した実施例3により2値画像として抽出し、
その重心を求める。また、円筒の口部12の輪郭を円と
見做し、その中心座標を求め、中心座標からDカット1
1の方向を検出する。この検出した画像の略図を図11
に示す。The image processing apparatus 6 of the present embodiment has a position detection circuit for detecting the position of the in-focus portion inside the object when the object has a step only inside the object. Here, for example, regarding the object of FIGS. 6 and 7 described in the second embodiment, as shown in the case of detecting the direction of the D cut 11, the image of the D cut 11 is extracted as a binary image by the third embodiment described above,
Find its center of gravity. In addition, the outline of the cylindrical mouth portion 12 is regarded as a circle, its center coordinates are obtained, and the D cut 1 is made from the center coordinates.
The direction of 1 is detected. A schematic diagram of this detected image is shown in FIG.
Shown in
【0058】このように、本実施例(請求項6,13)
では、物体の外部に段差がなく、内部にのみ段差を有す
る場合、物体の内部の合焦点部分の位置を位置検出回路
により検出するように構成している。このため、画像処
理を行う際、物体の外部に段差がなく、外部が滑らかな
曲面等、物体の内部にのみ段差を有する場合でも、物体
内部の段差等の特徴より、その段差の方向や深さを非接
触で検出することができ、物体全体の位置や姿勢を検出
することができる。 (実施例7)本実施例は、図1の3次元位置検出装置に
適用することができる。Thus, the present embodiment (claims 6 and 13).
Then, when there is no step outside the object but only inside the object, the position detection circuit detects the position of the focused portion inside the object. Therefore, when performing image processing, even if there is no step outside the object and there is a step only inside the object, such as a smooth curved surface on the outside, due to the characteristics of the step inside the object, the direction and depth of the step Can be detected in a non-contact manner, and the position and orientation of the entire object can be detected. (Embodiment 7) This embodiment can be applied to the three-dimensional position detecting device of FIG.
【0059】本実施例の画像処理装置6は、撮像位置が
合焦点位置からずれている場合、画像全体の明るさと予
め設定された明るさを比較する比較回路と、比較した結
果に基づいて遠近どちらの方向にずれているかを特定
し、所定の範囲の距離まで撮像系の位置を補正する位置
補正回路とを有する。ここでは、例えば前述した実施例
2において、図4の物体を検出する場合、図5からも判
る通り、合焦点位置に近いところでは、特徴量の変化も
著しいが、合焦点位置から大幅にずれたところでは、特
徴量の変化が見られないため、遠近どちらにずれている
か予測がつかない。そのため、図12に示すように画像
の明るさより、遠近どちら側に大幅にずれているかを予
測し、合焦点位置の近くまでCCDカメラ2を素速く移
動させる。The image processing apparatus 6 of the present embodiment, when the image pickup position is deviated from the in-focus position, compares with the comparison circuit for comparing the brightness of the entire image with the preset brightness, and the perspective based on the comparison result. It has a position correction circuit that identifies in which direction the deviation is made and corrects the position of the imaging system up to a distance within a predetermined range. Here, for example, in the above-described second embodiment, when the object of FIG. 4 is detected, as can be seen from FIG. 5, the change in the feature amount is remarkable at the position close to the in-focus position, but it is significantly deviated from the in-focus position. On the other hand, there is no change in the feature quantity, so it is difficult to predict whether the distance is far or near. Therefore, as shown in FIG. 12, it is predicted from the brightness of the image which side of the image is greatly shifted, the CCD camera 2 is quickly moved to near the in-focus position.
【0060】このように、本実施例(請求項7,14)
では、撮像位置が合焦点位置からずれている場合、画像
全体の明るさと予め設定された明るさとを比較回路によ
り比較し、比較した結果に基づいて遠近どちらの方向に
ずれているかを特定し、所定の範囲の距離まで撮像系の
位置を位置補正回路により補正するように構成してい
る。As described above, this embodiment (claims 7 and 14)
Then, when the imaging position is deviated from the in-focus position, the brightness of the entire image is compared with the preset brightness by the comparison circuit, and based on the comparison result, it is specified in which direction the distance is deviated, The position correction circuit corrects the position of the imaging system up to a distance within a predetermined range.
【0061】このため、画像面内の明るさと予め設定さ
れた明るさとを比較し、遠近どちらの方向にずれている
かを特定し、ある距離までは素速く撮像位置を補正する
ことにより、合焦点位置よりかなりずれている場合で
も、遠近方向のどちらにずれているかを特定し、CCD
カメラ2を合焦点位置により速く移動させることができ
る。For this reason, by comparing the brightness within the image plane with the preset brightness, it is specified which of the perspective and the direction is deviated, and the imaging position is quickly corrected up to a certain distance to obtain the in-focus point. Even if it deviates considerably from the position, identify in which direction it is deviating, the CCD
The camera 2 can be moved faster to the in-focus position.
【0062】[0062]
【発明の効果】本発明によれば、外部にオートフォーカ
ス機構や測距センサを設定しなくても、合焦点位置を高
精度で検出することができるという効果がある。According to the present invention, there is an effect that the in-focus position can be detected with high accuracy without setting an autofocus mechanism or a distance measuring sensor outside.
【図1】本発明に係る実施例1の3次元位置検出装置の
構成を示す図である。FIG. 1 is a diagram showing a configuration of a three-dimensional position detection device according to a first embodiment of the present invention.
【図2】本発明に係る実施例1の8近傍フィルタを示す
図である。FIG. 2 is a diagram showing an eight-neighborhood filter according to a first embodiment of the present invention.
【図3】本発明に係る実施例1の画面上の画素値の総和
を数え上げて鉛直上下方向の移動との関係を示す図であ
る。FIG. 3 is a diagram showing a relationship between a total of pixel values on a screen and a movement in a vertical up and down direction according to the first embodiment of the present invention.
【図4】本発明に係る実施例2の黒い物体としてCリン
グを白い背景をしたステージ上に設置し、その撮像に関
して合焦点位置を検出する場合を示す図である。FIG. 4 is a diagram showing a case where a C ring as a black object according to a second embodiment of the present invention is installed on a stage with a white background, and a focus position is detected for the imaging thereof.
【図5】本発明に係る実施例2の合焦点位置でピークと
なる様子を示す図である。FIG. 5 is a diagram showing a state in which a peak occurs at a focus position of Example 2 according to the present invention.
【図6】本発明に係る実施例3の外部に段差がない円筒
状の物体の内部に施したDカットの様子を示す図であ
る。FIG. 6 is a diagram showing a D-cut state applied to the inside of a cylindrical object having no step on the outside according to Example 3 of the present invention.
【図7】本発明に係る実施例3の外部に段差がない円筒
状の物体の上方からの画像の様子を示す図である。FIG. 7 is a diagram showing a state of an image from above of a cylindrical object having no step on the outside according to the third embodiment of the present invention.
【図8】本発明に係る実施例3のDカット部に焦点があ
った場合のラプラシアンを施した画像を示す図である。FIG. 8 is a diagram showing an image subjected to Laplacian when a D-cut portion of Example 3 according to the present invention is focused.
【図9】本発明に係る実施例3の比較的高周波成分が存
在する合焦点位置が残り、膨張圧縮の前処理を施した
後、2値化を行った画像を示す図である。FIG. 9 is a diagram showing an image obtained by performing binarization after performing a pre-expansion / compression pre-processing with a focus position where a relatively high-frequency component exists according to the third embodiment of the present invention.
【図10】本発明に係る実施例5のCCDカメラの移動
と特徴量の変化との関係を示す図である。FIG. 10 is a diagram showing a relationship between movement of a CCD camera and change in feature quantity according to a fifth embodiment of the present invention.
【図11】本発明に係る実施例6の円筒の口部の輪郭を
円と見做した中心座標からDカットの方向を検出した画
像を示す図である。FIG. 11 is a diagram showing an image in which the direction of D-cut is detected from the center coordinates where the contour of the cylindrical mouth portion of the sixth embodiment according to the present invention is regarded as a circle.
【図12】本発明に係る実施例7の焦点ずれに対する画
素値の総和を示す図である。FIG. 12 is a diagram showing a sum of pixel values with respect to defocus according to a seventh embodiment of the present invention.
1 物体 2 CCDカメラ 3 カメラホルダー 4 x−y−θステージ 5 照明装置 6 画像処理装置 7 Z軸制御装置 8 x−y−θ制御装置 11 Dカット 12 円筒の口部 1 Object 2 CCD Camera 3 Camera Holder 4 xy-θ Stage 5 Illumination Device 6 Image Processing Device 7 Z-Axis Control Device 8 xy-θ Control Device 11 D Cut 12 Cylinder Mouth
───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 G06T 5/20 H04N 5/232 A G06F 15/68 400 A ─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 6 Identification code Internal reference number FI Technical display location G06T 5/20 H04N 5/232 A G06F 15/68 400 A
Claims (14)
程と、次いで、取り込んだ該画像に1次微分フィルタを
施す工程と、次いで、1次微分フィルタを施した該画像
を2値化する工程と、次いで、2値化した該画像を細線
化する工程と、次いで、画面上の全画素値の総和を特微
量として求める工程とを有することを特徴とする3次元
位置検出装置。1. A step of capturing an image of an object and capturing an image of the object, a step of applying a primary differential filter to the captured image, and then binarizing the image subjected to the primary differential filter. A three-dimensional position detecting apparatus, comprising: a step of performing a thinning process on the binarized image; and a step of determining a total sum of all pixel values on the screen as an extremely small amount.
ンフィルタを施し、ラプラシアンフィルタを施した画像
の最高画素値と最低画素値の差を検出し、焦点が合った
際、検出した該画像の最高画素値と最低画素値の差が合
焦点位置でピークとなることにより合焦点位置を検出す
ることを特徴とする請求項1記載の3次元位置検出方
法。2. A Laplacian filter in the vicinity of 4 is applied to the captured image, the difference between the highest pixel value and the lowest pixel value of the image subjected to the Laplacian filter is detected, and when the image is in focus, the highest image value of the detected image is detected. The three-dimensional position detecting method according to claim 1, wherein the in-focus position is detected when the difference between the pixel value and the minimum pixel value reaches a peak at the in-focus position.
2値画像として抽出することを特徴とする請求項2記載
の3次元位置検出方法。3. The three-dimensional position detecting method according to claim 2, wherein only the focused portion in the captured image is extracted as a binary image.
取り込んだ前記画像から該2値画像領域の画像を抽出す
ることを特徴とする請求項3記載の3次元位置検出方
法。4. An area of the binary image of the focused portion is obtained,
4. The three-dimensional position detecting method according to claim 3, wherein an image of the binary image area is extracted from the captured image.
移動に伴い抽出される合焦点位置の変化に基づいて、該
段差の距離を検出することを特徴とする請求項1,2記
載の3次元位置検出方法。5. When detecting an object having a step, the distance of the step is detected based on a change in the focus position extracted with the movement of the imaging system. 3D position detection method.
体の内部の合焦点部分の位置を検出することを特徴とす
る請求項1乃至5記載の3次元位置検出方法。6. The three-dimensional position detecting method according to claim 1, wherein when a step is provided only inside the object, the position of the focused portion inside the object is detected.
合、画像全体の明るさと予め設定された明るさとを比較
し、比較した結果に基づいて遠近どちらかの方向にずれ
ているかを特定し、所定の範囲の距離まで撮像系の位置
を補正することを特徴とする請求項1乃至6記載の3次
元位置検出方法。7. When the image pickup position is deviated from the in-focus position, the brightness of the entire image is compared with a preset brightness, and it is specified whether the image is deviated in the near or far direction based on the comparison result. 7. The three-dimensional position detecting method according to claim 1, wherein the position of the imaging system is corrected to a distance within a predetermined range.
像手段と、該撮像手段を鉛直上下方向に移動させる撮像
手段移動手段と、物体を固定するステージを水平面内左
右上下に移動させるステージ移動手段と、ステージを水
平面内で回転させる回転手段と、該物体に光を照射する
光照射手段と、該撮像手段により取り込んだ画像を処理
する画像処理装置と、該撮像手段と該ステージを移動さ
せる制御装置とを有する3次元位置検出装置であって、
取り込んだ該画像に1次微分フィルタを施す1次微分フ
ィルタ処理手段と、1次微分フィルタを施した該画像を
2値化する2値化処理手段と、2値化した該画像を細線
化する細線化処理手段と、画面上の全画素値の総和を特
徴量として求める特徴量算出手段とを有することを特徴
とする3次元位置検出装置。8. An image pickup means for picking up an image of an object and capturing an image of the object, an image pickup means moving means for moving the image pickup means in a vertical vertical direction, and a stage for moving a stage for fixing the object vertically and horizontally in a horizontal plane. Moving means, rotating means for rotating the stage in a horizontal plane, light irradiating means for irradiating the object with light, an image processing device for processing an image captured by the image capturing means, and moving the image capturing means and the stage. A three-dimensional position detecting device having a control device for
Primary differential filter processing means for applying a primary differential filter to the captured image, binarization processing means for binarizing the image subjected to the primary differential filter, and thinning the binarized image. A three-dimensional position detecting device comprising: a thinning processing means and a feature amount calculating means for obtaining a sum of all pixel values on a screen as a feature amount.
ンフィルタを施すラプラシアンフィルタ処理手段と、ラ
プラシアンフィルタを施した画像の最高画素値と最低画
素値の差を検出し、焦点が合った際、検出した該画像の
最高画素値と最低画素値の差が合焦点位置でピークとな
ることにより合焦点位置を検出する合焦点位置検出手段
とを有することを特徴とする請求項8記載の3次元位置
検出装置。9. A Laplacian filter processing means for applying a Laplacian filter in the vicinity of 4 to the captured image, and a difference between the highest pixel value and the lowest pixel value of the image subjected to the Laplacian filter is detected, and when the image is in focus, it is detected. 9. The three-dimensional position according to claim 8, further comprising: focus position detecting means for detecting the focus position by the peak of the difference between the highest pixel value and the lowest pixel value of the image at the focus position. Detection device.
を2値画像として抽出する2値画像抽出手段を有するこ
とを特徴とする請求項9記載の3次元位置検出装置。10. A three-dimensional position detecting apparatus according to claim 9, further comprising a binary image extracting means for extracting only a focused portion in the captured image as a binary image.
る2値画像領域算出手段と、取り込んだ前記画像から求
めた該2値画像領域の画像を抽出する画像抽出手段とを
有することを特徴とする請求項10記載の3次元位置検
出装置。11. A binary image area calculating means for obtaining an area of a binary image in the focused portion, and an image extracting means for extracting an image of the binary image area obtained from the captured image. The three-dimensional position detection device according to claim 10, which is characterized in that.
の移動に伴い抽出される合焦点位置の変化に基づいて、
該段差の距離を検出する距離検出手段を有することを特
徴とする請求項8,9記載の3次元位置検出装置。12. When detecting an object having a step, based on a change of a focus position extracted with a movement of an imaging system,
10. The three-dimensional position detecting device according to claim 8, further comprising a distance detecting means for detecting a distance of the step.
物体の内部の合焦点部分の位置を検出する位置検出手段
を有することを特徴とする請求項8乃至12記載の3次
元位置検出装置。13. A three-dimensional position detecting apparatus according to claim 8, further comprising position detecting means for detecting a position of a focused portion inside the object when there is a step only inside the object. .
合、画像全体の明るさと予め設定された明るさとを比較
する比較手段と、比較した結果に基づいて遠近どちらか
の方向にずれているかを特定し、所定の範囲の距離まで
撮像系の位置を補正する位置補正手段とを有することを
特徴とする請求項8乃至13記載の3次元位置検出装
置。14. If the image pickup position is deviated from the in-focus position, whether the image is deviated in either of the near and far directions based on the result of the comparison means for comparing the brightness of the entire image with the preset brightness. 14. The three-dimensional position detecting device according to claim 8, further comprising: a position correction unit that specifies the position of the image pickup system and corrects the position of the image pickup system up to a predetermined range of distance.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7011154A JPH08201022A (en) | 1995-01-27 | 1995-01-27 | Three-dimensional position detecting method and three-dimensional position detecting device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7011154A JPH08201022A (en) | 1995-01-27 | 1995-01-27 | Three-dimensional position detecting method and three-dimensional position detecting device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH08201022A true JPH08201022A (en) | 1996-08-09 |
Family
ID=11770111
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP7011154A Pending JPH08201022A (en) | 1995-01-27 | 1995-01-27 | Three-dimensional position detecting method and three-dimensional position detecting device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH08201022A (en) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012073679A (en) * | 2010-09-27 | 2012-04-12 | Fujitsu Ltd | Imaging device, image evaluation method, and focus adjustment control program |
| JP2013200269A (en) * | 2012-03-26 | 2013-10-03 | Dainippon Screen Mfg Co Ltd | Transfer device and transfer method |
| JP2017175936A (en) * | 2016-03-28 | 2017-10-05 | 国立研究開発法人農業・食品産業技術総合研究機構 | Remaining feed amount measuring device and remaining feed amount measuring program |
| JP2020035051A (en) * | 2018-08-28 | 2020-03-05 | 株式会社アイエスピー | Method for automatically acquiring and reading form images such as receipts, program, and portable terminal device |
| CN114577112A (en) * | 2022-01-19 | 2022-06-03 | 格力电器(芜湖)有限公司 | Chassis bolt position detection method and detection device |
| CN115082337A (en) * | 2022-06-15 | 2022-09-20 | 吉林大学 | Hyperspectral mixed noise removing method based on double total variation |
-
1995
- 1995-01-27 JP JP7011154A patent/JPH08201022A/en active Pending
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012073679A (en) * | 2010-09-27 | 2012-04-12 | Fujitsu Ltd | Imaging device, image evaluation method, and focus adjustment control program |
| JP2013200269A (en) * | 2012-03-26 | 2013-10-03 | Dainippon Screen Mfg Co Ltd | Transfer device and transfer method |
| JP2017175936A (en) * | 2016-03-28 | 2017-10-05 | 国立研究開発法人農業・食品産業技術総合研究機構 | Remaining feed amount measuring device and remaining feed amount measuring program |
| JP2020035051A (en) * | 2018-08-28 | 2020-03-05 | 株式会社アイエスピー | Method for automatically acquiring and reading form images such as receipts, program, and portable terminal device |
| CN114577112A (en) * | 2022-01-19 | 2022-06-03 | 格力电器(芜湖)有限公司 | Chassis bolt position detection method and detection device |
| CN114577112B (en) * | 2022-01-19 | 2024-05-24 | 格力电器(芜湖)有限公司 | Method and device for detecting position of chassis bolt |
| CN115082337A (en) * | 2022-06-15 | 2022-09-20 | 吉林大学 | Hyperspectral mixed noise removing method based on double total variation |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106934803B (en) | method and device for detecting surface defects of electronic device | |
| CN119648679A (en) | Circuit board welding fault identification method and system based on machine vision | |
| CN112866689B (en) | SFR algorithm-based optical focusing method | |
| CN109559353B (en) | Camera module calibration method, device, electronic device, and computer-readable storage medium | |
| JP2009259036A (en) | Image processing device, image processing method, image processing program, recording medium, and image processing system | |
| CN118052883A (en) | Binocular vision-based multiple circular target space positioning method | |
| CN114820475B (en) | Edge identification method and system, wafer processing device and method for determining concentric state of wafer and processing table | |
| JP2008158958A (en) | Road surface determination method and road surface determination device | |
| CN114964032B (en) | Blind hole depth measurement method and device based on machine vision | |
| CN115564718A (en) | Crankshaft end face flange plate thread detection device and method based on multi-view vision | |
| CN113375555A (en) | Power line clamp measuring method and system based on mobile phone image | |
| CN121033033B (en) | Wafer defect detection methods, systems and electronic equipment | |
| JPH08201022A (en) | Three-dimensional position detecting method and three-dimensional position detecting device | |
| JP3516118B2 (en) | Object recognition method and object recognition device | |
| CN113516709B (en) | Flange positioning method based on binocular vision | |
| JP4524616B2 (en) | Imaging apparatus, image processing method and program for captured image | |
| CN116503492B (en) | Binocular camera module calibration method and calibration device in automatic driving system | |
| CN111536895A (en) | Shape recognition device, shape recognition system, and shape recognition method | |
| CN116912329A (en) | Binocular vision optimal precision measurement method | |
| CN117593302A (en) | A defective parts traceability method and system | |
| JP2001307017A (en) | Character plate recognition device | |
| JP2000097677A (en) | Image recognition method | |
| JPH10283478A (en) | Feature extraction method and object recognition device using the method | |
| KR20220145080A (en) | Apparatus and method for determining position of dual camera for vehicle | |
| CN114897966B (en) | Visual identification method for large element |