JPH10105715A - Generation method of template for pattern matching - Google Patents

Generation method of template for pattern matching

Info

Publication number
JPH10105715A
JPH10105715A JP8258604A JP25860496A JPH10105715A JP H10105715 A JPH10105715 A JP H10105715A JP 8258604 A JP8258604 A JP 8258604A JP 25860496 A JP25860496 A JP 25860496A JP H10105715 A JPH10105715 A JP H10105715A
Authority
JP
Japan
Prior art keywords
image
light
point
points
work
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
Application number
JP8258604A
Other languages
Japanese (ja)
Inventor
Koji Oda
幸治 小田
Naoji Yamaoka
直次 山岡
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.)
Honda Motor Co Ltd
Original Assignee
Honda Motor Co Ltd
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 Honda Motor Co Ltd filed Critical Honda Motor Co Ltd
Priority to JP8258604A priority Critical patent/JPH10105715A/en
Publication of JPH10105715A publication Critical patent/JPH10105715A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce the capacity of a storage device for template which is used for pattern matching to calculate the position of a feature part of a light- sectioned picture. SOLUTION: A light cut picture of a master work is scanned at a prescribed pitch, and positions of picture points matching with individual scanning lines of the light-sectioned picture are detected, and stroke data representing the positions of these picture points is generated, and stroke data in a prescribed range having a feature point as the center is stored. At the time of measurement of the work, picture data for a template TP representing the shape of the feature part is generated from stored stroke data by graphic processing. At the time of the graphic processing, expansion processing (B) and smoothing processing (C) are performed after linearization processing (A), where lines connecting individual points of stroke data are plotted, to generate picture data of a luminance distribution approximating a luminance distribution (D) of the light-sectioned picture.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、ワークの屈曲部や
段差部やエッジ部といった特徴部の位置を光切断法によ
って計測する際に行うパターンマッチング処理に用いる
テンプレートの作成方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for creating a template used in a pattern matching process for measuring the position of a characteristic portion such as a bent portion, a step portion, and an edge portion of a work by a light cutting method.

【0002】[0002]

【従来の技術】光切断法は、ワークにスリット光を照射
し、スリット光の光面に対し光軸が斜交するような位置
関係で配置した撮像器により、ワークに照射されたスリ
ット光が描くワークの光切断像を撮像し、撮像画面に現
われるワークの光切断画像からワークの計測を行う方法
である。ワークに屈曲部や段差部やエッジ部といった特
徴部が有ると、ワークの光切断画像もこれら屈曲部等に
対応する特徴部を持つ形状になり、光切断画像の特徴部
の位置からワークの特徴部の位置を計測することができ
る。
2. Description of the Related Art In a light cutting method, a work is irradiated with slit light, and the slit light applied to the work is irradiated by an image pickup device arranged in such a manner that an optical axis is obliquely oblique to the light surface of the slit light. In this method, a light section image of a workpiece to be drawn is captured, and the workpiece is measured from the light section image of the workpiece appearing on an imaging screen. If the workpiece has a characteristic portion such as a bent portion, a step portion, or an edge portion, the light-cut image of the work also has a shape having a characteristic portion corresponding to the bent portion, and the characteristic of the work is determined from the position of the characteristic portion of the light-cut image. The position of the part can be measured.

【0003】そして、従来は、光切断画像の特徴部の位
置を割出すため、特開平5-288513号公報に見られるよう
に、撮像画面を微小ピッチで走査し、ワークの光切断画
像の各走査線に合致する画像点を各走査線上の輝度分布
の面積重心としてその位置を検出し、これら画像点の位
置を表わす点列データを作成して、この点列データから
微分処理等で光切断画像の特徴部の位置を割出すように
している。
[0003] Conventionally, in order to determine the position of the characteristic portion of the light-section image, as shown in Japanese Patent Application Laid-Open No. 5-288513, the imaging screen is scanned at a minute pitch, and each of the light-section images of the workpiece is scanned. The position of an image point that matches the scanning line is detected as the area centroid of the luminance distribution on each scanning line, and point sequence data representing the position of these image points is created. The position of the characteristic part of the image is determined.

【0004】[0004]

【発明が解決しようとする課題】上記従来法では、撮像
画面を全域に亘って微小ピッチで走査する関係で計測に
時間がかかり、オンライン計測を行う場合、計測時間に
合わせてラインのタクトタイムを長くせざるを得なくな
ることがある。
In the above-mentioned conventional method, it takes a long time to perform measurement because the imaging screen is scanned at a small pitch over the entire area. When performing online measurement, the tact time of a line is adjusted in accordance with the measurement time. Sometimes it has to be long.

【0005】かかる不具合を解消する手法として、パタ
ーンマッチングによりワークの光切断画像の特徴部の位
置を割出すことが考えられる。パターンマッチングは、
特徴部の形状を表わすテンプレートを用い、正規化相関
法によりテンプレートに合致する形状部分の位置を割出
す方法であり、比較的短時間でワークの光切断画像の特
徴部の位置を割出すことができる。
As a method of solving such a problem, it is conceivable to determine the position of a characteristic portion of a light-cut image of a workpiece by pattern matching. Pattern matching is
This method uses a template that represents the shape of a feature to determine the position of the shape that matches the template using the normalized correlation method. it can.

【0006】ところで、自動車車体の組立精度を計測す
る場合、車体を多数の計測ポイントで計測する必要があ
り、各計測ポイント毎に計測すべき特徴部の形状が異な
るため、上記の如くパターンマッチングで特徴部の位置
を割出すには、多数のテンプレートを用意しておく必要
がある。テンプレートは、特徴部の形状を表わす画像デ
ータとして記憶されるものであり、多数のテンプレート
を用意する場合には、多大な記憶容量が必要となり、記
憶装置が大型化してコストが高くなる。
When measuring the assembly accuracy of an automobile body, it is necessary to measure the body at a number of measurement points, and since the shape of the characteristic portion to be measured differs at each measurement point, pattern matching is performed as described above. To determine the position of the feature, it is necessary to prepare a large number of templates. The template is stored as image data representing the shape of the characteristic portion. When a large number of templates are prepared, a large storage capacity is required, and the size of the storage device is increased and the cost is increased.

【0007】本発明は、以上の点に鑑み、記憶容量が少
なくて済むテンプレートの作成方法を提供することを課
題としている。
[0007] In view of the above, it is an object of the present invention to provide a method for creating a template that requires a small storage capacity.

【0008】[0008]

【課題を解決するための手段】上記課題を解決すべく、
本発明は、ワークに照射されたスリット光が描くワーク
の光切断像を撮像したときに撮像画面に現われるワーク
の光切断画像の特徴部の位置をパターンマッチングによ
り割出す際に用いるテンプレートの作成方法であって、
マスタワークにスリット光を照射してマスタワークの光
切断像を撮像する工程と、撮像画面を所定ピッチで走査
して、マスタワークの光切断画像の各走査線に合致する
画像点の位置を検出し、これら画像点の位置を表わす点
列データを作成する工程と、前記特徴部を中心とする所
定範囲の点列データを記憶させる工程と、記憶させた点
列データからグラフィック処理により前記特徴部の形状
を表わすテンプレート用の画像データを作成する工程と
を備える、ことを特徴とする。
Means for Solving the Problems In order to solve the above problems,
The present invention relates to a method for creating a template used for determining the position of a characteristic portion of a light-cut image of a work appearing on an imaging screen by pattern matching when a light-cut image of the work is drawn by slit light applied to the work. And
Irradiating the master work with slit light to capture a light cut image of the master work, and scanning the imaging screen at a predetermined pitch to detect the position of image points that match each scanning line of the light cut image of the master work Generating point sequence data representing the positions of these image points; storing a predetermined range of point sequence data centered on the characteristic portion; and performing graphic processing on the stored point sequence data by graphic processing. Creating image data for a template representing the shape of the template.

【0009】本発明によれば、パターンマッチングに際
し点列データからテンプレート用の画像データを作成す
るため、記憶させるのは点列データだけで良い。そのた
め、画像データを記憶させるものに比し記憶容量は遥か
に少なくて済み、多数のテンプレートを用意する必要が
ある場合でも、小型の記憶装置で足り、コストを削減で
きる。
According to the present invention, since image data for a template is created from point sequence data at the time of pattern matching, only the point sequence data needs to be stored. Therefore, the storage capacity is much smaller than that for storing image data, and even when a large number of templates need to be prepared, a small storage device is sufficient and the cost can be reduced.

【0010】尚、ワークの光切断画像は或る程度の幅を
持つから、グラフィック処理に際し膨張処理及び平滑化
処理を行って、実際の光切断画像に近似したテンプレー
トを作成することが望ましい。
Incidentally, since the light-section image of the work has a certain width, it is desirable to perform a dilation process and a smoothing process at the time of graphic processing to create a template that approximates the actual light-section image.

【0011】[0011]

【発明の実施の形態】図1は、自動車車体等のワークA
の計測に用いる光学式測定装置の概要を示しており、該
装置は、ワークAにスリット光を照射するスリットレー
ザ等から成るスリット光源1と、CCDカメラから成る
撮像器2と、撮像器2からの画像信号を入力する画像処
理装置3とで構成されている。
FIG. 1 shows a work A such as an automobile body.
1 shows an outline of an optical measuring device used for measurement of the object A. The device comprises a slit light source 1 composed of a slit laser or the like that irradiates a workpiece A with slit light, an imager 2 composed of a CCD camera, and an imager 2. And an image processing device 3 for inputting the image signal.

【0012】スリット光源1と撮像器2はロボット等の
移動機構の動作端に取付けられる図外の測定ヘッドに搭
載され、測定ヘッドをワークAの複数の計測部位に各対
向する位置に順に移動して、各計測部位の計測を行う。
尚、スリット光源1と撮像器2とは、スリット光の光面
SPに撮像器2の光軸が所定角度θ(例えば45°)で
斜交するような位置関係で測定ヘッドに搭載される。
The slit light source 1 and the image pickup device 2 are mounted on a measuring head (not shown) attached to the operating end of a moving mechanism such as a robot, and the measuring head is sequentially moved to a position facing each of a plurality of measuring parts of the work A. Then, each measurement site is measured.
The slit light source 1 and the image pickup device 2 are mounted on the measuring head in such a positional relationship that the optical axis of the image pickup device 2 obliquely intersects the optical surface SP of the slit light at a predetermined angle θ (for example, 45 °).

【0013】以下、ワークの断面計測について説明す
る。断面計測は、ワークAの屈曲部やエッジ部や段差部
といった特徴部の位置を計測するために行う。計測に際
しては、スリット光源1をワークAに正対させた状態で
スリット光を照射し、スリット光が描くワークAの光切
断像Sを撮像器2で撮像する。ここで、スリット光の光
面SPに直交する、撮像器2の光軸を含む平面に平行な
撮像画面の座標軸をX軸、X軸に直交する座標軸をY軸
とすると、図1に示すような断面S字状の計測部位で
は、撮像画面に、図2に示す如く、ワークAの断面形状
に対応するX軸方向に屈曲したS字状の光切断画像Sが
現われ、該画像Sの特徴部を例えば山折りの屈曲部Sa
としてその位置を計測する。尚、撮像画面には、谷折り
状に屈曲したワーク表面に写る光切断像sの反射像rに
よる外乱画像Rも現れる。
Hereinafter, measurement of a cross section of a work will be described. The cross section measurement is performed to measure the position of a characteristic portion such as a bent portion, an edge portion, or a step portion of the work A. At the time of measurement, a slit light is radiated in a state where the slit light source 1 is directly opposed to the work A, and a light cut image S of the work A drawn by the slit light is captured by the image pickup device 2. Here, assuming that a coordinate axis of the imaging screen orthogonal to the optical plane SP of the slit light and parallel to a plane including the optical axis of the imaging device 2 is an X axis, and a coordinate axis orthogonal to the X axis is a Y axis, as shown in FIG. At a measurement site having a simple S-shaped cross section, an S-shaped light section image S bent in the X-axis direction corresponding to the cross-sectional shape of the work A appears on the imaging screen as shown in FIG. Part is, for example, a mountain-folded bent part Sa
And measure its position. It should be noted that a disturbance image R due to the reflection image r of the light-section image s that appears on the work surface bent in a valley-fold shape also appears on the imaging screen.

【0014】上記屈曲部Saはアールが付いているた
め、その位置を一義的に特定することは困難である。そ
こで、屈曲部Saに連続するY軸方向上側の画像部分に
近似する第1の画像線LS1の方程式と、屈曲部Saに
連続するY軸方向下側の画像部分に近似する第2の画像
線LS2の方程式とを求め、両画像線LS1,LS2の
交点Qの座標に基づいて屈曲部Saの位置を計測する。
Since the bent portion Sa has a radius, it is difficult to uniquely specify the position. Therefore, the equation of the first image line LS1 approximating the upper image portion in the Y-axis direction that is continuous with the bent portion Sa, and the second image line approximating the lower image portion in the Y-axis direction that is continuous with the bent portion Sa LS2 equation is obtained, and the position of the bent portion Sa is measured based on the coordinates of the intersection Q of the two image lines LS1 and LS2.

【0015】ここで、各画像線LS1,LS2の方程式
は、画像処理装置3において、前記各画像部分にこれに
交差するように複数の走査線を設定し、光切断画像の各
走査線に合致する画像点の座標を検出し、これら画像点
から回帰処理によって求めるもので、画像線LS1,L
S2の方程式を正確に求めるには、各走査線の設定精度
と、各走査線における画像点の検出精度との向上が必要
になる。
Here, the equation of each of the image lines LS1 and LS2 is obtained by setting a plurality of scanning lines in the image processing device 3 so as to intersect each of the image portions and matching each scanning line of the light-section image. The coordinates of the image points to be detected are detected by regression processing from these image points.
In order to accurately determine the equation of S2, it is necessary to improve the setting accuracy of each scanning line and the accuracy of detecting image points in each scanning line.

【0016】そこで、本実施形態では、各走査線の設定
精度を向上させるため、光切断画像Sの特徴部たる屈曲
部Saの形状を表わすテンプレートを用いて撮像画面に
対するパターンマチッングを行うことにより屈曲部Sa
の位置を割出し、この位置に基づいて所要の画像部分に
正確に各走査線を設定し得るようにしている。
Therefore, in the present embodiment, in order to improve the setting accuracy of each scanning line, pattern matching is performed on the imaging screen using a template representing the shape of the bent portion Sa, which is a characteristic portion of the light-section image S. Bending section Sa
Is determined, and each scanning line can be accurately set in a required image portion based on this position.

【0017】テンプレートは、マスタワークに対する計
測を行うティーチング時のデータに基づいて作成される
もので、以下ティーチング時の計測について詳述する。
The template is created based on data at the time of teaching for performing measurement on the master work. Hereinafter, the measurement at the time of teaching will be described in detail.

【0018】ティーチング計測では、先ず、マスタワー
クにスリット光を照射して、マスタワークの光切断像s
を撮像する。次に、撮像画面に、図3(A)に示す如
く、X軸に平行な走査線LをY軸方向に所定ピッチで多
数設定し、各走査線上の輝度分布から光切断画像Sの各
走査線に合致する画像点PSのX座標を検出する。以
下、撮像画面のY軸方向に480個のピクセル(画素)
が並んでおり、Y軸方向に5ピクセルピッチで95本の
走査線Lを設定した場合を例にして説明する。
In the teaching measurement, first, the master work is irradiated with slit light, and a light cut image s of the master work is obtained.
Is imaged. Next, as shown in FIG. 3A, a large number of scanning lines L parallel to the X axis are set at a predetermined pitch in the Y axis direction on the imaging screen, and each scanning of the light-cut image S is determined from the luminance distribution on each scanning line. The X coordinate of the image point PS matching the line is detected. Hereinafter, 480 pixels (pixels) in the Y-axis direction of the imaging screen
Are described, and a case where 95 scanning lines L are set at a pitch of 5 pixels in the Y-axis direction will be described as an example.

【0019】図3(A)のLnの走査線上の輝度分布は
図4(A)に示す通りであり、この輝度分布を平滑化す
ると図4(B)に示すような輝度分布グラフが得られ
る。この輝度分布グラフには、光切断画像Sに由来する
左側の山部と、外乱画像Rに由来する右側の山部とが現
われている。
The luminance distribution on the scanning line Ln in FIG. 3A is as shown in FIG. 4A, and when this luminance distribution is smoothed, a luminance distribution graph as shown in FIG. 4B is obtained. . In this brightness distribution graph, a left peak derived from the light section image S and a right peak derived from the disturbance image R appear.

【0020】次に、走査線上の各点の輝度変化のピーク
度Pを求め、走査線上のピーク度Pの分布を表わす図4
(C)に示すようなピーク度分布グラフを作成する。X
座標がnの走査線上の点のピーク度Pは、図5(A)に
示す如く、該点における輝度分布グラフ上の輝度点をa
n、該点を中心にして走査線上に設定する所定幅の計測
範囲Wの両端点における輝度分布グラフ上の輝度点を夫
々bn,cnとして、bnとcnとを結ぶ結線に対する
anの高さを表わす値として求められる。この場合、前
記結線の中点に対するanの高さ(={2an−(bn
+cn)}/2)をピーク度Pとしても良く、また、前
記結線にanから降した垂線の長さをピーク度Pとして
も良い。ここで、図5(A)の輝度分布では、X=n1
の点のピーク度Pは正の値になり、X=n2の点のピー
ク度Pは負の値になる。
Next, the peak degree P of the luminance change at each point on the scanning line is obtained, and the distribution of the peak degree P on the scanning line is shown in FIG.
A peak degree distribution graph as shown in FIG. X
As shown in FIG. 5A, the peak degree P of a point on the scanning line having the coordinate n is represented by a luminance point on the luminance distribution graph at the point.
n, the luminance points on the luminance distribution graph at both end points of the measurement range W of a predetermined width set on the scanning line with the point as the center are bn and cn, and the height of an with respect to the connection line connecting bn and cn is It is obtained as a value to represent. In this case, the height of an with respect to the midpoint of the connection (= {2an− (bn
+ Cn)} / 2) may be set as the peak degree P, and the length of a perpendicular line descending from an in the connection may be set as the peak degree P. Here, in the luminance distribution of FIG. 5A, X = n1
Has a positive value, and the point P at X = n2 has a negative value.

【0021】輝度分布グラフに現われる外乱画像Rに由
来する山部は比較的幅が広いため、ピーク度Pは小さく
なり、一方、光切断画像Sに由来する山部は比較的幅が
狭いためピーク度Pは大きくなる。そして、前記計測範
囲Wの幅を適切な値(例えば10ピクセル)に設定すれ
ば、ピーク度分布グラフの山部のうち所定値以上の高さ
を持つ山部は光切断画像Sに由来するものと判断でき
る。但し、外乱画像Rの幅が狭いと、ピーク度Pが所定
値以上になる可能性がある。ここで、スリット光の再反
射による外乱画像Rは、撮像方向の関係で、撮像画面の
光切断画像Sよりも撮像方向側、即ち、右側にずれた位
置に現われる。そのため、ピーク度分布グラフにおける
最大値の1/2を前記所定値として、それ以下の高さの
山部は処理対象から除き、残った山部のうち一番左側に
位置する山部を光切断画像Sに由来するものとして選定
することが望ましい。また、ノイズによってピーク度P
が大きくなるため、ピーク度Pは図4(B)のような平
滑化した輝度分布グラフから求めることが望ましい。
Since the peaks derived from the disturbance image R appearing in the luminance distribution graph are relatively wide, the peak degree P is small, while the peaks derived from the light-section image S are relatively narrow, so that the peaks are small. The degree P increases. If the width of the measurement range W is set to an appropriate value (for example, 10 pixels), the peaks having a height equal to or more than a predetermined value among the peaks of the peak degree distribution graph are derived from the light-section image S. Can be determined. However, if the width of the disturbance image R is narrow, the peak degree P may become a predetermined value or more. Here, the disturbance image R due to the re-reflection of the slit light appears at a position shifted to the imaging direction side, that is, to the right side of the light-section image S on the imaging screen due to the imaging direction. For this reason, half of the maximum value in the peak degree distribution graph is set to the predetermined value, peaks having a height lower than the predetermined value are excluded from the processing target, and the leftmost peak of the remaining peaks is optically cut. It is desirable to select as the one derived from the image S. In addition, the peak degree P
Therefore, it is desirable to determine the peak degree P from a smoothed luminance distribution graph as shown in FIG.

【0022】上記の如くして選定したピーク度分布グラ
フの山部の頂点の位置を光切断画像Sの走査線に合致す
る画像点の位置とすることも可能であるが、頂点の位置
は計測の度に多少ともばらつくため、ピーク度分布グラ
フの選定された山部に対応する輝度分布グラフの山部の
面積重心の位置を画像点の位置とすることが考えられ
る。この場合、背景照明の影響を受ける山部の両裾部分
を除外して面積重心を求めることが望ましいが、面積重
心の計測範囲をどのようにして規定するかが問題にな
る。
The position of the peak of the peak of the peak degree distribution graph selected as described above can be set as the position of the image point that matches the scanning line of the light-section image S, but the position of the peak is measured. Therefore, it is conceivable that the position of the area centroid of the peak of the luminance distribution graph corresponding to the selected peak of the peak degree distribution graph is used as the position of the image point. In this case, it is desirable to calculate the area center of gravity excluding both skirts of the mountain part affected by the background illumination. However, how to define the measurement range of the area center of gravity becomes a problem.

【0023】ここで、ピーク度分布曲線は、輝度分布グ
ラフの山部の両裾の立上り部で一旦負の値になり、或る
程度立上ったところで正の値になる。そして、ピーク度
分布曲線の山部の両側にピーク度が零になる零点P0が
現われ、零点P0間の区間は背景照明の影響を受けない
部分になる。そのため、図5(B)に示す如く、輝度分
布グラフの零点P0間の区間における面積重心G´を求
めて、その位置を画像点の位置とすれば、背景照明の影
響を排除して画像点の位置を正確に検出できる。
Here, the peak degree distribution curve once becomes a negative value at the rising portions of both skirts of the peak portion of the luminance distribution graph, and becomes a positive value when it rises to some extent. Then, a zero point P0 at which the peak degree becomes zero appears on both sides of the peak of the peak degree distribution curve, and a section between the zero points P0 is a part which is not affected by the background illumination. Therefore, as shown in FIG. 5B, if the area centroid G ′ in the section between the zero point P0 of the luminance distribution graph is obtained and the position is set as the position of the image point, the influence of the background illumination is eliminated and the image point is removed. Position can be accurately detected.

【0024】然し、輝度分布グラフの山部の撮像方向側
(右側)の傾斜は反対側の傾斜よりも緩やかになり勝ち
であり、そのため、山部の面積重心G´が山部の頂点の
位置から撮像方向側にずれてしまう。一方、ピーク度分
布グラフの山部は、輝度分布グラフの山部の傾斜が両側
で異なっても、両側の傾斜がほぼ等しくなる。従って、
ピーク度分布グラフの零点P0間の区間における山部の
面積重心Gはその山部の頂点の位置から左程ずれない。
従って、画像点の検出精度を向上させるには、ピーク度
分布グラフの零点P0間の区間の面積重心Gを求めて、
該重心Gの位置を画像点PSのX座標とすることが望ま
しい。
However, the inclination of the peak of the brightness distribution graph on the imaging direction side (right side) tends to be gentler than the inclination on the opposite side, so that the area center of gravity G 'of the peak is the position of the peak of the peak. From the camera to the imaging direction. On the other hand, the peaks of the peak degree distribution graph have substantially the same inclination on both sides even if the inclinations of the peaks of the luminance distribution graph are different on both sides. Therefore,
The area center of gravity G of the peak in the section between the zero points P0 of the peak degree distribution graph does not shift to the left from the position of the peak of the peak.
Therefore, in order to improve the detection accuracy of the image points, the area centroid G of the section between the zero points P0 of the peak degree distribution graph is obtained,
It is desirable that the position of the center of gravity G be the X coordinate of the image point PS.

【0025】以上の如くして光切断画像の各走査線に合
致する画像点PSの位置を検出すると、これら画像点P
Sの位置を表わす点列データを作成する。点列データを
グラフ化して表わすと図3(B)に示すようになる。次
に、各走査線の画像点PSのX軸方向の位置変化のピー
ク度を求める。Y軸座標がmの走査線のピーク度は、該
走査線の画像点をam、該走査線を中心にして設定する
所定幅の計測範囲の両端の走査線の画像点を夫々bm,
cmとして、bmとcmを結ぶ結線に対するamの離間
距離を表わす値として算出される。この場合、前記結線
の中点とamとの間の距離をピーク度としても良く、ま
た、前記結線にamから降した垂線の長さをピーク度と
しても良い。
As described above, when the positions of the image points PS corresponding to the respective scanning lines of the light-section image are detected, these image points P
Point sequence data representing the position of S is created. FIG. 3B shows a graph of the point sequence data. Next, the peak degree of the change in the position of the image point PS in the X-axis direction of each scanning line is obtained. The peak degree of the scanning line having the Y-axis coordinate m is defined as am at the image point of the scanning line, bm at the image point of the scanning line at both ends of the measurement range of a predetermined width set around the scanning line, and
As cm, it is calculated as a value representing the separation distance of am with respect to the connection line connecting bm and cm. In this case, the distance between the midpoint of the connection and am may be used as the peak degree, and the length of a perpendicular line descending from am on the connection may be used as the peak degree.

【0026】次に、ピーク度が最大となる画像点、図3
(B)ではY軸座標がm1の走査線の画像点am1と、
ピーク度が最小(負の値)となる画像点、図3(B)で
はY軸座標がm2の走査線の画像点am2とを特徴点と
して抽出する。尚、最大ピーク度や最小ピーク度の画像
点が連続して複数個並んでいるときは、それらの中間の
画像点を特徴点として抽出する。また、光切断画像の端
部の画像点、図3(B)ではL1の走査線の画像点am
0及びL95の走査線の画像点am3も特徴点として抽
出する。尚、隣接する2つの走査線の画像点がX軸方向
に所定値(例えば10ピクセル)以上離れている場合は
光切断画像がそこで不連続になっていると判断できるか
ら、該両走査線の画像点を光切断画像の端部の画像点で
あるとして特徴点に抽出する。
Next, the image point where the peak degree becomes maximum, FIG.
In (B), an image point am1 of a scanning line whose Y-axis coordinate is m1,
The image point having the minimum peak value (negative value), and the image point am2 of the scanning line whose m-axis coordinate is m2 in FIG. 3B, are extracted as feature points. When a plurality of image points having the maximum peak degree and the minimum peak degree are continuously arranged, an intermediate image point is extracted as a feature point. Further, an image point at the end of the light-section image, in FIG. 3B, an image point am of the scanning line L1
Image points am3 of the scanning lines 0 and L95 are also extracted as feature points. If the image points of two adjacent scanning lines are separated by a predetermined value (for example, 10 pixels) or more in the X-axis direction, it can be determined that the light-section image is discontinuous there. The image point is extracted as a feature point as an image point at the end of the light-section image.

【0027】次に、特徴点として抽出された画像点のう
ちから外部操作によって所望の画像点を選択する。本実
施形態のように、光切断画像Sの山折れの屈曲部Saを
特徴部としてその位置を計測する場合は、画像点am1
を選択する。このようにして画像点を選択すると、選択
された画像点を中心にしてY軸方向所定範囲の画像点の
位置を表わす点列データがこれら画像点同士の関連性を
示すデータと共にテンプレート作成用のデータとして記
憶される。また、上記画像線LS1,LS2の方程式を
求める画像部分の端部を規定する点として、選択された
画像点に最も近い上下2個の特徴点の画像点も記憶され
る。例えば、画像点am1を選択したときは、画像線を
算出すべき画像部分の端部の位置として画像点am0と
画像点am2の位置データが記憶される。
Next, a desired image point is selected by an external operation from the image points extracted as the feature points. As in the present embodiment, when the position of the light section image S is measured with the bent portion Sa of the mountain cut as a characteristic portion, the image point am1
Select When the image points are selected in this manner, the point sequence data representing the positions of the image points in a predetermined range in the Y-axis direction around the selected image points is displayed together with the data indicating the relevance of these image points together with the data for template creation. Stored as data. The image points of the two upper and lower feature points that are closest to the selected image point are also stored as points defining the end of the image part for which the equations of the image lines LS1 and LS2 are obtained. For example, when the image point am1 is selected, the position data of the image point am0 and the image point am2 is stored as the position of the end of the image part for which the image line is to be calculated.

【0028】図3(C)はテンプレート作成用データと
して記憶される点列データ及び関連性データを示してい
る。この例ではNo10が選択された画像点am1のデ
ータであり、その上下夫々10個、計21個の画像点の
データが記憶されている。関連性データは、「1」が上
端点、「2」が連続点、「3」が下端点であることを示
す。
FIG. 3C shows point sequence data and relevance data stored as template creation data. In this example, No. 10 is the data of the selected image point am1, and data of a total of 21 image points, 10 in each of the upper and lower image points, is stored. The relevance data indicates that “1” is the upper end point, “2” is the continuous point, and “3” is the lower end point.

【0029】ワークの断面計測に際しては、ワークの計
測部位に対応するテンプレート作成用データを読み出し
て、計測すべき特徴部、上記の例では山折れ屈曲部Sa
の形状を表わすテンプレート用の画像データをグラフィ
ック処理により作成する。グラフィック処理に際して
は、先ず、図6(A)に示す如く、点列データ及び関連
性データに基づいて上端点と下端点との連続点同士を線
で結ぶ線状化処理を行い、次に、各ピクセルの周囲8個
のピクセルの輝度を該各ピクセルの輝度と等しくする膨
張化処理を行って、図6(B)に示す如く線を太らせ、
最後に、各ピクセルの輝度を該各ピクセルとその周囲8
個ピクセルの輝度の平均値とする平滑化処理を行い、図
6(C)に示すような輝度分布のテンプレート用画像デ
ータを作成する。光切断画像Sの輝度分布は図6(D)
に示す通りであり、図6(C)の輝度分布はこれに極め
て近似したものになる。図7(A)は、ワークAの光切
断像Sを撮像した撮像画面に対するテンプレートTPに
よるパターンマッチングの実施状況を視界的に表示した
図であり、光切断画像Sの山折れの屈曲部Saの位置、
即ち、上記画像点am1に対応する位置が正規化相関法
等によるパターンマッチングで割り出される。尚、本実
施形態ではパターンマッチングの処理時間を短縮するた
めに、撮像画面とテンプレートTPとを同じ比率(例え
ば1/4)で縮小してパターンマッチングを行ってい
る。
At the time of measuring the cross section of the work, the template creation data corresponding to the measurement site of the work is read out, and the characteristic portion to be measured, in the above example, the mountain bent portion Sa
The image data for the template representing the shape of is created by graphic processing. At the time of graphic processing, first, as shown in FIG. 6A, linearization processing for connecting continuous points between the upper end point and the lower end point with a line based on the point sequence data and the relevancy data is performed. A dilation process is performed to make the luminance of eight pixels around each pixel equal to the luminance of each pixel, and the line is thickened as shown in FIG.
Finally, the brightness of each pixel is calculated by comparing each pixel with its surroundings.
A smoothing process is performed to set the average value of the luminance of the individual pixels, and template image data having a luminance distribution as shown in FIG. 6C is created. The luminance distribution of the light-section image S is shown in FIG.
The luminance distribution in FIG. 6C is very similar to this. FIG. 7A is a view visually showing the state of execution of pattern matching using the template TP with respect to the imaging screen obtained by capturing the light-section image S of the work A. position,
That is, the position corresponding to the image point am1 is determined by pattern matching using the normalized correlation method or the like. In this embodiment, in order to reduce the processing time of the pattern matching, the pattern matching is performed by reducing the imaging screen and the template TP at the same ratio (for example, 1/4).

【0030】また、ワークの段差部では光切断画像Sが
図8(A)に示す如く分断され、分割箇所の上下の走査
線の画像点am(n)、am(n+1)がX軸方向に所
定値以上離れて、画像の端部を表わす特徴点として画像
点am(n)、am(n+1)が抽出される。これら画
像点am(n),am(n+1)がテンプレート作成用
データに取り込まれた場合、画像点am(n)の関連性
データは「3」(下端点)となり、画像点am(n+
1)の関連性データは「1」(上端点)となる。この場
合、テンプレートの画像データを、図8(B)に示す如
く画像点am(n)が下端点、画像点am(n+1)が
上端点になるように作成すると、実際の光切断画像Sに
対する近似度が低下する。そのため、この場合には、テ
ンプレートの画像を、図8(C)に示す如く、画像点a
m(n)の下方と画像点am(n+1)の上方とに夫々
走査ピッチの1/2延長して作成する。
At the step portion of the work, the light-section image S is divided as shown in FIG. 8A, and the image points am (n) and am (n + 1) of the upper and lower scanning lines at the division point in the X-axis direction. Image points am (n) and am (n + 1) are extracted as feature points representing edges of the image at a distance of a predetermined value or more. When these image points am (n) and am (n + 1) are captured in the template creation data, the relevance data of the image point am (n) is “3” (lower end point), and the image point am (n +
The relevance data of 1) is “1” (upper end point). In this case, if the image data of the template is created such that the image point am (n) is the lower end point and the image point am (n + 1) is the upper end point as shown in FIG. The degree of approximation decreases. Therefore, in this case, the image of the template is changed to the image point a as shown in FIG.
It is created by extending 走 査 of the scanning pitch below m (n) and above image point am (n + 1), respectively.

【0031】パターンマッチングによりワークの光切断
画像Sの計測すべき特徴部の位置、即ち、山折れの屈曲
部Saに合致する上記画像点am1に対応する点Pam
1の位置を割り出すと、次に、画像線を算出すべき画像
部分の端部の位置として記憶されている上記2つの画像
点am0,am2の位置を点Pam1の基準位置(ティ
ーチング計測で検出された画像点am1の位置)からの
ずれに応じて補正して、これら画像点am0,am2に
対応する点Pam0,Pam2の位置を算定する。
The position of the characteristic portion of the light cut image S of the work to be measured by pattern matching, that is, the point Pam corresponding to the image point am1 that matches the bent portion Sa of the mountain fold.
Once the position of the image point is determined, the positions of the two image points am0 and am2 stored as the positions of the ends of the image part for which the image line is to be calculated are detected at the reference position of the point Pam1 (detected by the teaching measurement). The position of the points Pam0 and Pam2 corresponding to the image points am0 and am2 is calculated by correcting the deviation from the position of the image point am1).

【0032】尚、点Pam1が基準位置からX軸方向左
側にずれるのは、ワークAが測定ヘッドに近付く方向に
変位しているときであり、点Pam1が基準位置からX
軸方向右側にずれるのは、ワークAが測定ヘッドから離
れる方向に変位しているときであり、撮像器2からの遠
近差により、X軸方向左側にずれたときは多少ではある
が光切断画像Sが拡大され、X軸方向右側にずれたとき
は光切断画像Sが縮小される。そのため、画像点am
0,am2を点Pam1の基準位置からのX,Y両軸方
向のずれに応じてX,Y両軸方向に平行移動させるだけ
でなく、X軸方向のずれによる光切断画像Sの拡大、縮
小も考慮して点Pam0,Pam2の位置を算出するこ
とが望ましい。また、点Pam0、点Pam2の位置が
画面の外側に出るような位置に算定されたときは、その
点をこれと点Pam1とを結ぶ直線と画面の外縁との交
点に置き換える。
The point Pam1 is shifted to the left in the X-axis direction from the reference position when the work A is displaced in the direction approaching the measuring head.
The shift to the right in the axial direction is when the work A is displaced in the direction away from the measuring head. When the work A is shifted to the left in the X-axis direction due to the difference in perspective from the image pickup device 2, the light-cut image is slightly generated. When S is enlarged and shifted to the right in the X-axis direction, the light-section image S is reduced. Therefore, the image point am
In addition to moving 0 and am2 in parallel in both X and Y axes from the reference position of point Pam1 in both X and Y axes, enlargement and reduction of the light-cut image S due to displacement in X axis direction. It is desirable to calculate the positions of the points Pam0 and Pam2 in consideration of the above. When the positions of the points Pam0 and Pam2 are calculated so as to be outside the screen, the points are replaced with the intersections of the straight line connecting the points Pam1 and the outer edge of the screen.

【0033】上記の如く点Pam1,Pam0,Pam
2の位置を求めると、次に、図7(B)に示す如く、点
Pam1と点Pam0との結線及び点Pam1と点Pa
m2との結線を夫々複数等分、例えば、6等分する各等
分点の位置を求め、これら各等分点を中点とするX軸に
平行な所定長さの走査線Lを点Pam1と点Pam0と
の間及び点Pam1と点Pam2との間に夫々5本設定
する。
As described above, the points Pam1, Pam0, Pam
Next, as shown in FIG. 7B, the connection between the points Pam1 and Pam0 and the points Pam1 and Pam1 are determined.
The position of each of the equally dividing points that divides the connection with m2 into a plurality of equal parts, for example, six equal parts, is determined, and a scanning line L having a predetermined length parallel to the X axis and having these respective equally dividing points as a middle point is set as a point Pam1. Five points are respectively set between the point Pam0 and the point Pam1 and the point Pam2.

【0034】次に、各走査線L上の輝度分布から光切断
画像Sの各走査線Lに合致する画像点PSの座標を検出
する。ここで、画像点PSの検出は、ティーチング計測
時の画像点PSの検出と同様に行う。即ち、図5(A)
(B)に示す如く、輝度分布グラフからピーク度分布グ
ラフを作成し、ピーク度分布グラフの山部のうち所定値
以上の高さの山部であって最も左側に位置する山部の零
点P0間の区間における面積重心Gを求め、該重心Gの
位置を画像点PSの位置とする。
Next, the coordinates of an image point PS that matches each scanning line L of the light-section image S is detected from the luminance distribution on each scanning line L. Here, the detection of the image point PS is performed in the same manner as the detection of the image point PS during the teaching measurement. That is, FIG.
As shown in (B), a peak degree distribution graph is created from the luminance distribution graph, and among the peaks of the peak degree distribution graph, the zero point P0 of the leftmost peak located at a height equal to or higher than a predetermined value. The area center of gravity G in the section between them is determined, and the position of the center of gravity G is set as the position of the image point PS.

【0035】次に、図7(C)に示す如く、光切断画像
Sの山折れ屈曲部Saに連続する上側の画像部分に近似
する第1画像線LS1の方程式を、点Pam1と点Pa
m0との間の5個の画像点PSの座標から回帰処理によ
って求め、また、光切断画像Sの山折れ屈曲部Saに連
続する下側の画像部分に近似する第2画像線LS2の方
程式を、点Pam1と点Pam2との間の5個の画像点
PSの座標から回帰処理によって求め、第1と第2の両
画像点LS1,LS2の交点Qの座標を算出する。
Next, as shown in FIG. 7 (C), the equation of the first image line LS1 approximating the upper image portion which is continuous with the mountain-bent bent portion Sa of the light-section image S is expressed by the points Pam1 and Pam1.
The equation of the second image line LS2 that is obtained by regression processing from the coordinates of the five image points PS between m0 and m0 and that approximates the lower image portion that is continuous with the fold-bent portion Sa of the light-section image S , Are obtained by regression processing from the coordinates of the five image points PS between the points Pam1 and Pam2, and the coordinates of the intersection Q of the first and second image points LS1 and LS2 are calculated.

【0036】尚、計測すべき特徴部と画像線を算出すべ
き画像部分の端部とを結ぶ結線、例えば点Pam1と点
Pam2との結線の長さが所定値(例えば100ピクセ
ル)以下になると、この結線を6等分した場合、図9
(A)に示す如く、最上位と最下位の等分点に設定した
走査線が光切断画像Sの山折れの屈曲部や谷折れの屈曲
部のアール部分に交差し、画像線を正しく算定できなく
なる。従って、結線の長さが所定値以下のときは、特徴
部及び端部の近傍部分を除く中間部分を複数等分する各
等分点に走査線を設定する。例えば、図9(B)に示す
如く、結線を8等分して、最上位と最下位の等分点を除
く中間の5個の等分点に走査線Lを設定する。
When the length of the connection between the characteristic portion to be measured and the end of the image portion for which the image line is to be calculated, for example, the connection between the points Pam1 and Pam2 is less than a predetermined value (for example, 100 pixels). When this connection is divided into six equal parts, FIG.
As shown in (A), the scanning lines set at the uppermost and lowermost equal points intersect with the rounded and curved valleys of the light-section image S, and the image line is correctly calculated. become unable. Therefore, when the connection length is equal to or less than the predetermined value, a scanning line is set at each equally dividing point that divides a plurality of intermediate portions excluding the vicinity of the characteristic portion and the end portion. For example, as shown in FIG. 9B, the connection is divided into eight equal parts, and the scanning lines L are set at five intermediate points other than the uppermost and lowermost equal points.

【0037】また、前記画像線LS1,LS2の方程式
を求める回帰処理を短時間で行い得られるように、画像
線を直線として算出するか、円として算出するか、円の
場合は半径がいくつなのかを、予めティーチング時に決
定しておく。その決定方法は図10に示す通りであり、
先ず、STP1でティーチングか否かを判別し、ティー
チング時はSTP2に進み、計測すべき特徴部と画像線
を算出すべき画像部分の端部とを結ぶ結線の長さが所定
値以上か否かを判別する。結線の長さが短いと、画像線
を円として算出した場合、計測の度にばらつきが出る。
ばらつきは結線の長さが100ピクセルのときを境にし
てそれより短いと急激に大きくなる。従って、上記所定
値を100ピクセルとして、結線の長さが所定値未満の
ときは、STP3で画像線を回帰直線(各画像点の直線
からのずれ量の総和が最小になる直線)として算出し、
STP4で算出が成功したか否かを判別して、不成功の
ときはSTP5でエラー処理を行う。
Further, the image line is calculated as a straight line or a circle so that the regression processing for obtaining the equations of the image lines LS1 and LS2 can be performed in a short time. Is determined in advance at the time of teaching. The determination method is as shown in FIG.
First, at STP1, it is determined whether or not teaching is performed. At the time of teaching, the process proceeds to STP2, and whether or not the length of a connection between the characteristic portion to be measured and the end of the image portion for which the image line is to be calculated is greater than or equal to a predetermined value. Is determined. When the length of the connection is short, when the image line is calculated as a circle, there is a variation in measurement every time.
The variation rapidly increases when the connection length is shorter than 100 pixels. Therefore, when the predetermined value is set to 100 pixels and the connection length is shorter than the predetermined value, the image line is calculated as a regression line (a line that minimizes the total amount of deviation from the line of each image point) in STP3. ,
At STP4, it is determined whether or not the calculation is successful. If the calculation is not successful, error processing is performed at STP5.

【0038】結線の長さが所定値以上のときは、STP
6で画像線を回帰円(各画像点の円からのずれ量が最小
になる円)として算出し、STP7で算出が成功したか
否かを判別して、不成功のときはSTP8でエラー処理
を行い、成功のときはSTP9に進み、算出した回帰円
の半径が所定値(例えば5000ピクセル)以上か否か
を判別し、大きいときはSTP3に進んで画像線を回帰
直線として算出する。そして、半径が所定値未満のとき
はSTP10でその半径をティーチングデータとして格
納する。
If the connection length is longer than a predetermined value, the STP
In step 6, the image line is calculated as a regression circle (a circle that minimizes the amount of deviation of each image point from the circle), and it is determined in STP7 whether or not the calculation was successful. If the process is successful, the process proceeds to STP9, and it is determined whether the calculated radius of the regression circle is equal to or larger than a predetermined value (for example, 5000 pixels). If the radius is large, the process proceeds to STP3 to calculate the image line as a regression line. If the radius is smaller than the predetermined value, the radius is stored as teaching data in STP10.

【0039】ワークの断面計測に際しては、STP1か
らSTP11に進み、回帰円をティーチングされた半径
にして算出することが可能か否かを判別する。光切断画
像が基準位置からX軸方向に大きくずれているときは、
光切断画像の拡大、縮小の割合も大きくなって、ティー
チングされた半径で回帰円を算出することはできず、こ
の場合にはSTP2に進み、ティーチング時と同様の処
理を行う。それ以外の場合はSTP12に進み、ティー
チングデータが画像線を直線として算出するように指定
しているか否かを判別し、指定していればSTP3で画
像線を回帰直線として求める。直線指定でないときはS
TP13に進み、画像線をティーチングされた半径の回
帰円として算出し、STP14で算出が成功したか否か
を判別して、不成功のときはSTP15でエラー処理を
行う。
When measuring the cross section of the work, the process proceeds from STP1 to STP11, and it is determined whether or not it is possible to calculate the regression circle as the teaching radius. When the light-section image deviates greatly from the reference position in the X-axis direction,
The ratio of enlargement and reduction of the light-section image also increases, and it is not possible to calculate the regression circle with the radius of teaching. In this case, the process proceeds to STP2, and the same processing as during teaching is performed. Otherwise, the process proceeds to STP12, where it is determined whether or not the teaching data specifies that the image line is calculated as a straight line. If so, the image line is obtained as a regression line in STP3. S if not a straight line
Proceeding to TP13, the image line is calculated as a regression circle having the taught radius, and whether or not the calculation is successful is determined in STP14. If the calculation is not successful, error processing is performed in STP15.

【0040】本実施形態によれば、画像線を算出すべき
画像部分に所要の位置関係で正確に走査線Lを設定で
き、且つ、光切断画像Sの走査線Lに合致する画像点P
Sの座標もピーク度分布を用いることで正確に検出で
き、画像線の算出精度、従って、ワークの断面計測の精
度が向上する。更に、撮像画像の限られた部分を走査す
るだけであるため、計測時間を短縮でき、タクトタイム
の短いラインでのオンライン計測にも充分に対処でき
る。
According to the present embodiment, the scanning line L can be accurately set in a required positional relationship in the image portion where the image line is to be calculated, and the image point P which matches the scanning line L of the light-section image S
The coordinates of S can also be accurately detected by using the peak distribution, and the calculation accuracy of the image line, and therefore, the accuracy of the cross-section measurement of the work is improved. Furthermore, since only a limited portion of the captured image is scanned, the measurement time can be shortened, and online measurement on a line with a short tact time can be sufficiently dealt with.

【0041】また、ティーチング時に特徴点として抽出
される画像点のうちから計測すべき特徴部に対応する画
像点を選択するだけで、その画像点を中心とする所定範
囲の点列データがテンプレート作成用データとして格納
されるため、特徴部の形状を表わすテンプレートを簡
単、且つ正確に作成でき、パターンマッチングの精度も
向上する。
Further, by simply selecting an image point corresponding to a characteristic portion to be measured from image points extracted as characteristic points during teaching, point sequence data in a predetermined range centered on the image point is created. Therefore, a template representing the shape of the characteristic portion can be easily and accurately created, and the accuracy of pattern matching is improved.

【0042】更に、テンプレートの画像データを上記の
如く格納される点列データからグラフィック処理により
作成しているため、画像データ自体を記憶させておく場
合に比し記憶させるべきデータ数が遥かに少なくて済
む。従って、自動車車体のような多数の計測部位を有す
るワークであっても、記憶装置は小型のもので足りる。
Further, since the image data of the template is created by graphic processing from the point sequence data stored as described above, the number of data to be stored is much smaller than when the image data itself is stored. I can do it. Therefore, a small storage device is sufficient for a work having a large number of measurement parts such as an automobile body.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 光学式測定装置の概要を示す斜視図FIG. 1 is a perspective view showing an outline of an optical measuring device.

【図2】 図1に示す状態で撮像した撮像画面を示す図FIG. 2 is a diagram showing an imaging screen imaged in the state shown in FIG. 1;

【図3】 (A)ティーチング計測時の撮像画面に対す
る走査線の設定を示す図、(B)マスタワークの光切断
画像の点列データ及び特徴点の抽出を示す図、(C)テ
ンプレート作成用のデータを示す図
FIGS. 3A and 3B are diagrams showing (A) a setting of a scanning line on an imaging screen at the time of teaching measurement, (B) a diagram showing extraction of point sequence data and a feature point of an optical cutting image of a master work, and (C) a template creation. Diagram showing the data of

【図4】 (A)撮像画面の走査線上の輝度分布を示す
グラフ、(B)平滑処理した輝度分布を示すグラフ、
(C)ピーク度分布を示すグラフ
4A is a graph showing a luminance distribution on a scanning line of an imaging screen, FIG. 4B is a graph showing a luminance distribution after a smoothing process,
(C) Graph showing peak degree distribution

【図5】 (A)ピーク度の求め方を示す図、(B)画
像点の求め方を示す図
FIG. 5A is a diagram illustrating a method of calculating a peak degree, and FIG. 5B is a diagram illustrating a method of calculating an image point.

【図6】 (A)(B)(C)テンプレートの作成方法
を示す図、(D)光切断画像の輝度分布を示す図
FIGS. 6A, 6B, and 6C are diagrams illustrating a method of creating a template, and FIG. 6D is a diagram illustrating a luminance distribution of a light-section image.

【図7】 (A)パターンマッチングの状況を示す図、
(B)画像線を求めるための走査線の設定を示す図、
(C)画像線を示す図
FIG. 7A is a diagram showing a pattern matching situation;
(B) A diagram showing the setting of scanning lines for obtaining image lines,
(C) Diagram showing image lines

【図8】 (A)(B)(C)画像分断部におけるテン
プレートの作成方法を示す図
FIGS. 8A, 8B, and 8C show a method of creating a template in an image dividing unit. FIGS.

【図9】 (A)(B)短い区間での走査線の設定方法
を示す図
9A and 9B are diagrams showing a method of setting a scanning line in a short section.

【図10】 ティーチング時及びワーク計測時の画像線
の算出処理を示すフロー図
FIG. 10 is a flowchart showing image line calculation processing during teaching and work measurement.

【符号の説明】[Explanation of symbols]

1 スリット光源 2 撮像器 3 画像処理装置 S 光切断画像 L 走査線 PS 画像点 TP テンプレート DESCRIPTION OF SYMBOLS 1 Slit light source 2 Imager 3 Image processing device S Light cutting image L Scan line PS Image point TP Template

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 ワークに照射されたスリット光が描くワ
ークの光切断像を撮像したときに撮像画面に現われるワ
ークの光切断画像の特徴部の位置をパターンマッチング
により割出す際に用いるテンプレートの作成方法であっ
て、 マスタワークにスリット光を照射してマスタワークの光
切断像を撮像する工程と、 撮像画面を所定ピッチで走査して、マスタワークの光切
断画像の各走査線に合致する画像点の位置を検出し、こ
れら画像点の位置を表わす点列データを作成する工程
と、 前記特徴部を中心とする所定範囲の点列データを記憶さ
せる工程と、 記憶させた点列データからグラフィック処理により前記
特徴部の形状を表わすテンプレート用の画像データを作
成する工程とを備える、 ことを特徴とするパターンマッチング用テンプレートの
作成方法。
1. Creation of a template for use in pattern-matching to determine the position of a characteristic portion of a light-cut image of a work appearing on an image screen when a light-cut image of the work drawn by slit light applied to the work is picked up. A method of irradiating a slit light on a master work to capture an optical cut image of the master work, and scanning an imaging screen at a predetermined pitch to match an image corresponding to each scanning line of the optical cut image of the master work. A step of detecting point positions and creating point sequence data representing the positions of these image points; a step of storing point sequence data in a predetermined range centering on the feature portion; and a graphic from the stored point sequence data. Generating image data for a template representing the shape of the characteristic portion by processing. Forming method.
【請求項2】 前記グラフィック処理に際し、膨張処理
及び平滑化処理を施すことを特徴とする請求項1に記載
のパターンマッチング用テンプレートの作成方法。
2. The method according to claim 1, wherein an expansion process and a smoothing process are performed in the graphic process.
JP8258604A 1996-09-30 1996-09-30 Generation method of template for pattern matching Pending JPH10105715A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8258604A JPH10105715A (en) 1996-09-30 1996-09-30 Generation method of template for pattern matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8258604A JPH10105715A (en) 1996-09-30 1996-09-30 Generation method of template for pattern matching

Publications (1)

Publication Number Publication Date
JPH10105715A true JPH10105715A (en) 1998-04-24

Family

ID=17322589

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8258604A Pending JPH10105715A (en) 1996-09-30 1996-09-30 Generation method of template for pattern matching

Country Status (1)

Country Link
JP (1) JPH10105715A (en)

Similar Documents

Publication Publication Date Title
JP5217221B2 (en) Method for detecting surface defect shape of welded portion and computer program
JP2001319219A (en) Device and method for generating part program for image measuring apparatus, image measuring apparatus and measure result display method therefor
JP2020047049A (en) Image processing device and image processing method
JPH11151206A (en) Eyeground image analyzing method and device therefor
JP3887807B2 (en) Image measuring device
JP4707249B2 (en) Component position detection method and apparatus
JP3545542B2 (en) Wafer rotation direction detection method
JPH10105717A (en) Generation method of template for pattern matching
JPH10103921A (en) Measuring method for cross section of work by optical cutting method
JP3325120B2 (en) Component recognition method and device
JPH10105715A (en) Generation method of template for pattern matching
JP4053951B2 (en) Method and apparatus for measuring height of protrusion
JP2009192483A (en) Three dimensional shape measuring method and three dimensional shape measuring device
JPH10105716A (en) Detection of position of light-sectioned picture
JP4201321B2 (en) Member inclination recognition method, member inclination recognition control program, readable recording medium, and outer shape recognition apparatus
JP5867787B2 (en) Defect extraction apparatus and defect extraction method
JPH10232110A (en) Method for measuring work by optical cutting method
JPH11190611A (en) Three-dimensional measuring method and three-dimensional measuring processor using this method
JPH10105719A (en) Optical measurement method for hole position
JP3697780B2 (en) Image measuring device
JP2516844B2 (en) Parts detection method and device
JPH06281421A (en) Image processing method
JP2501150B2 (en) Laser welding method
JP2523420B2 (en) Image processing method in optical measuring device
JPH10141928A (en) Non-contacting picture measuring system