JP2014035196A - Shape measurement apparatus - Google Patents

Shape measurement apparatus Download PDF

Info

Publication number
JP2014035196A
JP2014035196A JP2012174854A JP2012174854A JP2014035196A JP 2014035196 A JP2014035196 A JP 2014035196A JP 2012174854 A JP2012174854 A JP 2012174854A JP 2012174854 A JP2012174854 A JP 2012174854A JP 2014035196 A JP2014035196 A JP 2014035196A
Authority
JP
Japan
Prior art keywords
straight line
curve
group
extracting
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012174854A
Other languages
Japanese (ja)
Other versions
JP6055228B2 (en
Inventor
Hideyo Takeuchi
英世 竹内
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.)
Chuo Hatsujo KK
Chuo Spring Co Ltd
Original Assignee
Chuo Hatsujo KK
Chuo Spring 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 Chuo Hatsujo KK, Chuo Spring Co Ltd filed Critical Chuo Hatsujo KK
Priority to JP2012174854A priority Critical patent/JP6055228B2/en
Publication of JP2014035196A publication Critical patent/JP2014035196A/en
Application granted granted Critical
Publication of JP6055228B2 publication Critical patent/JP6055228B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

PROBLEM TO BE SOLVED: To reduce the calculation amount required for processing of identifying the coordinates of a reference point on the basis of a calibration image.SOLUTION: The shape measurement apparatus 10 comprises a computation device 22 for calculating positional data of a reference point for calibration on the basis of the image of a lattice pattern photographed by a photographing device 16. The lattice pattern comprises: a first straight line group including lines that are disposed at intervals in a first direction; and a second straight line group including lines that are disposed at intervals in a second direction crossing the first direction. The computation device extracts, from the photographed lattice pattern image, a first curve group corresponding to the first straight line group and a second curve group corresponding to the second straight line group. Then, the computation device extracts a first region including each first curve and a second region including each second curve. The computation device then identifies the coordinates of the intersection of each first curve and each second curve in the extracted first region and second region.

Description

本明細書に開示の技術は、撮影したワークの画像からワーク形状を計測する形状計測装置に関する。   The technology disclosed in the present specification relates to a shape measuring apparatus that measures a workpiece shape from a photographed workpiece image.

工業部品等のワークを撮影装置によって撮影し、その撮影したワーク画像からワークの形状を計測する形状計測装置が開発されている。この形状計測装置では、撮影装置の機構等に起因して撮影された画像に歪みが生じるため、画像の歪みを補正する処理が必要となる。画像の歪みを補正するには、画像内の位置情報(座標値)と、実際の位置とを結びつけるためのキャリブレーションが必要となる。   2. Description of the Related Art A shape measuring device that takes a workpiece such as an industrial part with a photographing device and measures the shape of the workpiece from the photographed workpiece image has been developed. In this shape measuring apparatus, since a photographed image is distorted due to the mechanism of the photographing apparatus, a process for correcting the distortion of the image is necessary. In order to correct image distortion, calibration is required to link position information (coordinate values) in the image and the actual position.

キャリブレーションでは、まず、寸法が既知のパターン(例えば、市松模様、ドットパターン等)が印刷されたキャリブレーションボードを用意する。次いで、キャリブレーションボードを撮影し、撮影されたキャリブレーション画像から基準点(例えば、市松模様の交点)の座標を特定する。キャリブレーションボードのパターンは寸法が既知であるため、基準点の実際の位置(例えば、市松模様の交点の位置)も既知である。したがって、撮影されたキャリブレーション画像内における基準点の座標と、その基準点の実際の位置とを対応付けることで、画像の歪みを補正することができる。なお、特許文献1には、キャリブレーションに関する従来技術が開示されている。   In calibration, first, a calibration board on which a pattern having a known dimension (for example, checkered pattern, dot pattern, etc.) is printed is prepared. Next, the calibration board is photographed, and the coordinates of a reference point (for example, an intersection of checkered patterns) are specified from the photographed calibration image. Since the dimensions of the calibration board pattern are known, the actual position of the reference point (for example, the position of the intersection of the checkerboard pattern) is also known. Therefore, the image distortion can be corrected by associating the coordinates of the reference point in the captured calibration image with the actual position of the reference point. Note that Patent Document 1 discloses a conventional technique related to calibration.

特開2007−292619号公報JP 2007-292619 A

特許文献1の技術では、キャリブレーション画像内の基準点の座標を特定するために、キャリブレーション画像内に適宜の大きさの正方形状のウィンドウを設定する。そして、キャリブレーション画像内でウィンドウを走査し、これによって基準点の座標を特定する。したがって、特許文献1の技術では、キャリブレーション画像の全体に対してウィンドウを走査するため、その計算量が大きくなるという問題がある。   In the technique of Patent Document 1, a square window having an appropriate size is set in the calibration image in order to specify the coordinates of the reference point in the calibration image. Then, a window is scanned in the calibration image, thereby specifying the coordinates of the reference point. Therefore, in the technique of Patent Document 1, since the window is scanned over the entire calibration image, there is a problem that the amount of calculation becomes large.

本明細書は、キャリブレーション画像から基準点の座標を特定する処理に必要な計算量を少なくすることができる技術を開示する。   The present specification discloses a technique capable of reducing the amount of calculation required for the process of specifying the coordinates of the reference point from the calibration image.

本明細書が開示する形状計測装置は、ワークの形状を計測する計測装置である。この形状計測装置は、撮影装置と、撮影装置によって撮影される格子パターンの画像から、キャリブレーション用の基準点の位置データを算出する演算装置を有している。格子パターンは、第1方向に間隔を空けて配置されている第1直線群と、第1方向と交差する第2方向に間隔を空けて配置されている第2直線群とを有している。演算装置は、撮影された格子パターンの画像から、前記第1直線群に相当する第1曲線群を抽出する第1曲線群抽出手段と、撮影された格子パターンの画像から、前記第2直線群に相当する第2曲線群を抽出する第2曲線群抽出手段と、抽出された第1曲線群に含まれる各第1曲線を直線に近似する第1直線近似手段と、抽出された第2曲線群に含まれる各第2曲線を直線に近似する第2直線近似手段と、第1直線近似手段で近似された各直線を第1方向にシフトさせて、対応する第1曲線を包含する第1領域を抽出する第1領域抽出手段と、第2直線近似手段で近似された各直線を第2方向にシフトさせて、対応する第2曲線を包含する第2領域を抽出する第2領域抽出手段と、第1領域抽出手段で抽出した第1領域及び第2領域抽出手段で抽出した第2領域内において、第1曲線群を構成する各曲線と第2曲線群を構成する各曲線との各交点の座標を特定して、基準点の位置データを算出する位置データ算出手段と、を有している。   The shape measuring device disclosed in this specification is a measuring device that measures the shape of a workpiece. This shape measuring device has a photographing device and a computing device that calculates position data of a reference point for calibration from a lattice pattern image photographed by the photographing device. The lattice pattern has a first straight line group that is spaced apart in the first direction and a second straight line group that is spaced apart in the second direction intersecting the first direction. . The computing device includes: a first curve group extracting unit that extracts a first curve group corresponding to the first line group from the photographed grid pattern image; and the second line group from the photographed grid pattern image. Second curve group extracting means for extracting a second curve group corresponding to the first curve group, first linear approximation means for approximating each first curve included in the extracted first curve group to a straight line, and the extracted second curve A second straight line approximation means for approximating each second curve included in the group to a straight line, and a first straight line including the corresponding first curve by shifting each straight line approximated by the first straight line approximation means in the first direction. First area extracting means for extracting an area, and second area extracting means for extracting a second area including a corresponding second curve by shifting each straight line approximated by the second straight line approximating means in the second direction. And a first area extraction means and a second area extraction means extracted by the first area extraction means In the extracted second region, position data calculating means for calculating the position data of the reference point by specifying the coordinates of each intersection of each curve constituting the first curve group and each curve constituting the second curve group And have.

この形状計測装置では、格子パターンを撮影した画像(キャリブレーション画像)から第1曲線群及び第2曲線群を抽出し、これらの曲線を直線で近似する。そして、近似した直線を第1方向又は第2方向にシフトさせて、対応する第1曲線又は第2曲線を包含する領域(第1領域又は第2領域)を抽出する。そして、抽出された第1領域と第2領域の内部で、基準点の位置データを特定する。したがって、キャリブレーション画像から基準点が含まれる比較的に狭い領域を抽出し、この抽出した領域内において基準点の座標を特定する。その結果、基準点の座標を特定する処理に必要となる計算量を少なくすることができる。   In this shape measuring apparatus, a first curve group and a second curve group are extracted from an image (calibration image) obtained by photographing a lattice pattern, and these curves are approximated by straight lines. Then, the approximate straight line is shifted in the first direction or the second direction, and a region (first region or second region) including the corresponding first curve or second curve is extracted. Then, the position data of the reference point is specified inside the extracted first area and second area. Therefore, a relatively narrow region including the reference point is extracted from the calibration image, and the coordinates of the reference point are specified in the extracted region. As a result, the amount of calculation required for the process of specifying the coordinates of the reference point can be reduced.

また、本明細書は、キャリブレーション画像から基準点の位置データを算出する方法を開示する。ここで、キャリブレーション画像は、第1方向に間隔を空けて配置されている複数の第1直線群と、第1方向と交差する第2方向に間隔を空けて配置されている複数の第2直線群とを有する格子パターンを撮影した画像である。この算出方法は、コンピュータに下記の処理、即ち、撮影された格子パターンの画像から、第1直線群に相当する第1曲線群を抽出する第1曲線群抽出処理と、撮影された格子パターンの画像から、第2直線群に相当する第2曲線群を抽出する第2曲線群抽出処理と、抽出された第1曲線群に含まれる各第1曲線を直線に近似する第1直線近似処理と、抽出された第2曲線群に含まれる各第2曲線を直線に近似する第2直線近似処理と、第1直線近似処理で近似された各直線を第1方向にシフトさせて、対応する第1曲線を包含する第1領域を抽出する第1領域抽出処理と、第2直線近似処理で近似された各直線を第2方向にシフトさせて、対応する第2曲線を包含する第2領域を抽出する第2領域抽出処理と、第1領域抽出処理で抽出した第1領域及び第2領域抽出処理で抽出した第2領域内において、第1曲線群を構成する各曲線と第2曲線群を構成する各曲線との各交点の座標を特定して、基準点の位置データを算出する位置データ算出処理と、を実行させる。   The present specification also discloses a method for calculating the position data of the reference point from the calibration image. Here, the calibration image includes a plurality of first line groups arranged at intervals in the first direction and a plurality of second lines arranged at intervals in the second direction intersecting the first direction. It is the image which image | photographed the lattice pattern which has a straight line group. This calculation method includes the following processing on a computer: a first curve group extraction process for extracting a first curve group corresponding to the first straight line group from an image of a captured lattice pattern; A second curve group extraction process for extracting a second curve group corresponding to the second line group from the image; a first line approximation process for approximating each first curve included in the extracted first curve group to a straight line; The second straight line approximation process for approximating each second curve included in the extracted second curve group to a straight line, and the respective straight lines approximated by the first straight line approximation process are shifted in the first direction to correspond to the second straight line approximation process. A first area extraction process for extracting a first area including one curve and a straight line approximated by the second straight line approximation process are shifted in the second direction, and a second area including a corresponding second curve is obtained. Extracted by the second region extraction processing and the first region extraction processing to be extracted In the second region extracted by the first region and the second region extraction process, the coordinates of each intersection of each curve constituting the first curve group and each curve constituting the second curve group are specified, and the reference point And a position data calculation process for calculating position data.

この方法によっても、キャリブレーション画像から抽出した比較的に狭い領域内で、基準点の座標(位置データ)を算出する。したがって、基準点の座標を特定する処理に必要となる計算量を少なくすることができる。   Also by this method, the coordinates (position data) of the reference point are calculated within a relatively narrow region extracted from the calibration image. Therefore, it is possible to reduce the amount of calculation required for the process of specifying the coordinates of the reference point.

また、本明細書は、キャリブレーション画像から基準点の位置データを算出するためのプログラムを開示する。ここで、キャリブレーション画像は、第1方向に間隔を空けて配置されている複数の第1直線群と、第1方向と交差する第2方向に間隔を空けて配置されている複数の第2直線群とを有する格子パターンを撮影した画像である。このプログラムは、コンピュータに下記の処理、即ち、撮影された格子パターンの画像から、第1直線群に相当する第1曲線群を抽出する第1曲線群抽出処理と、撮影された格子パターンの画像から、第2直線群に相当する第2曲線群を抽出する第2曲線群抽出処理と、抽出された第1曲線群に含まれる各第1曲線を直線に近似する第1直線近似処理と、抽出された第2曲線群に含まれる各第2曲線を直線に近似する第2直線近似処理と、第1直線近似処理で近似された各直線を第1方向にシフトさせて、対応する第1曲線を包含する第1領域を抽出する第1領域抽出処理と、第2直線近似処理で近似された各直線を第2方向にシフトさせて、対応する第2曲線を包含する第2領域を抽出する第2領域抽出処理と、第1領域抽出処理で抽出した第1領域及び第2領域抽出処理で抽出した第2領域内において、第1曲線群を構成する各曲線と第2曲線群を構成する各曲線との各交点の座標を特定して、基準点の位置データを算出する位置データ算出処理を実行させる。   The present specification also discloses a program for calculating the position data of the reference point from the calibration image. Here, the calibration image includes a plurality of first line groups arranged at intervals in the first direction and a plurality of second lines arranged at intervals in the second direction intersecting the first direction. It is the image which image | photographed the lattice pattern which has a straight line group. This program performs the following processing on a computer, that is, a first curve group extraction process for extracting a first curve group corresponding to the first straight line group from a captured grid pattern image, and a captured grid pattern image. A second curve group extraction process for extracting a second curve group corresponding to the second line group, a first line approximation process for approximating each first curve included in the extracted first curve group to a straight line, A second straight line approximation process for approximating each second curve included in the extracted second curve group to a straight line, and each straight line approximated by the first straight line approximation process are shifted in the first direction to correspond to the first line. A first area extraction process for extracting a first area including a curve and a straight line approximated by the second straight line approximation process are shifted in the second direction to extract a second area including the corresponding second curve. To be extracted by the second area extraction process and the first area extraction process In the second region extracted by the first region and the second region extraction processing, the coordinates of each intersection of each curve constituting the first curve group and each curve constituting the second curve group are specified, and a reference point The position data calculation process for calculating the position data is executed.

このプログラムにより、コンピュータを用いて、キャリブレーション画像から基準点の位置データを、少ない計算量で算出することができる。   With this program, the position data of the reference point can be calculated from the calibration image with a small amount of calculation using a computer.

形状計測装置の構成を示す図。The figure which shows the structure of a shape measuring device. キャリブレーションの手順を示すフローチャート。The flowchart which shows the procedure of a calibration. 露光時間決定処理の手順を示すフローチャート。The flowchart which shows the procedure of exposure time determination processing. 歪み量算出処理の手順を示すフローチャート。The flowchart which shows the procedure of distortion amount calculation processing. 撮影されたキャリブレーション画像の一例を示す図。The figure which shows an example of the image | photographed calibration image. 撮影された画像から得られた垂直方向エッジ強調画像の一例を示す図。The figure which shows an example of the vertical direction edge emphasis image obtained from the image | photographed image. 撮影された画像から得られた水平方向エッジ強調画像の一例を示す図。The figure which shows an example of the horizontal direction edge emphasis image obtained from the image | photographed image. ρ−θ空間上の処理を説明するための図。The figure for demonstrating the process on (rho) -theta space. 垂直方向の処理対象領域の一例を示す図。The figure which shows an example of the process target area | region of a perpendicular direction. 水平方向の処理対象領域の一例を示す図。The figure which shows an example of the process target area | region of a horizontal direction. 垂直方向エッジ強調画像を垂直方向に分割した状態を示す図。The figure which shows the state which divided | segmented the vertical direction edge emphasis image to the vertical direction. 垂直方向エッジ強調画像の歪み量を算出する処理を説明するための図。The figure for demonstrating the process which calculates the distortion amount of a vertical direction edge emphasis image. 水平方向エッジ強調画像の歪み量を算出する処理を説明するための図。The figure for demonstrating the process which calculates the distortion amount of a horizontal direction edge emphasis image. キャリブレーションデータ作成処理の手順を示すフローチャート。The flowchart which shows the procedure of a calibration data creation process. キャリブレーション画像と、そのキャリブレーション画像から得られた基準点を示す図。The figure which shows the calibration image and the reference point obtained from the calibration image. ワークの形状を計測する処理の手順を示すフローチャート。The flowchart which shows the procedure of the process which measures the shape of a workpiece | work. ワークの厚み補正の考えを説明するための図。The figure for demonstrating the idea of thickness correction of a workpiece | work. 画像の歪み補正処理を説明するための図。The figure for demonstrating the distortion correction process of an image. 画像の歪み補正処理を説明するための図。The figure for demonstrating the distortion correction process of an image. 露光時間を変えて撮影したキャリブレーション画像を示す図。The figure which shows the calibration image image | photographed changing exposure time. 露光時間決定処理の他の手順を示すフローチャート。The flowchart which shows the other procedure of exposure time determination processing. 露光時間決定処理の他の手順を示すフローチャート。The flowchart which shows the other procedure of exposure time determination processing. キャリブレーションボードの撮影面に印刷されるパターンの他の例。Another example of the pattern printed on the photographing surface of the calibration board.

以下、本明細書で開示する実施例の技術的特徴の幾つかを記載する。なお、以下に記載する事項は、各々単独で技術的な有用性を有している。   Hereinafter, some technical features of the embodiments disclosed in this specification will be described. In addition, each matter described below has technical usefulness independently.

(特徴1)本明細書で開示する実施例では、位置データ算出手段は、第1領域抽出手段で抽出された第1領域を第2方向に複数の第1分割領域に分割すると共に、第2領域抽出手段で抽出された第2領域を第1方向に複数の第2分割領域に分割してもよい。また、位置データ算出手段は、分割された第1分割領域のそれぞれにおいて、当該第1分割領域内に位置する第1曲線を直線に近似して第1分割直線を特定すると共に、分割された第2分割領域のそれぞれにおいて、当該第2分割領域内に位置する第2曲線を直線に近似して第2分割直線を特定してもよい。そして、位置データ算出手段は、第1分割直線と第2分割直線の交点の座標を特定することで、基準点の位置データを算出してもよい。このような構成によると、基準点の位置データを効率的に算出することができる。 (Feature 1) In the embodiment disclosed in the present specification, the position data calculation means divides the first area extracted by the first area extraction means into a plurality of first divided areas in the second direction, and the second area The second area extracted by the area extracting means may be divided into a plurality of second divided areas in the first direction. Further, the position data calculating means specifies the first divided line by approximating the first curve located in the first divided area to a straight line in each of the divided first divided areas, and the divided first divided areas. In each of the two divided areas, the second divided line may be specified by approximating the second curve located in the second divided area to a straight line. Then, the position data calculation means may calculate the position data of the reference point by specifying the coordinates of the intersection of the first divided line and the second divided line. According to such a configuration, the position data of the reference point can be calculated efficiently.

(特徴2)本明細書で開示する実施例では、第1直線近似手段は、第1曲線をHough変換によりρ−θ平面に投影し、ρ−θ平面に投影された各点の重心を求めることで直線に近似してもよい。また、第2直線近似手段は、第2曲線をHough変換によりρ−θ平面に投影し、ρ−θ平面に投影された各点の重心を求めることで直線に近似してもよい。こうような構成によると、ノイズが含まれた画像から好適に近似直線を得ることができる。 (Feature 2) In the embodiment disclosed in the present specification, the first linear approximation means projects the first curve on the ρ-θ plane by the Hough transform, and obtains the center of gravity of each point projected on the ρ-θ plane. Thus, it may be approximated to a straight line. Further, the second straight line approximating means may project the second curve onto the ρ-θ plane by Hough transformation and approximate the straight line by obtaining the center of gravity of each point projected on the ρ-θ plane. According to such a configuration, an approximate straight line can be suitably obtained from an image including noise.

(特徴3)本明細書で開示する実施例では、第1直線近似手段は、ρ−θ平面に投影された各点を、ρ−θ平面の濃度値のn乗で重み付けした重心を求めることで直線に近似してもよい。また、第2直線近似手段は、ρ−θ平面に投影された各点を、ρ−θ平面の濃度値のn乗で重み付けした重心を求めることで直線に近似してもよい。このような構成によると、安定して近似直線を得ることができる。 (Characteristic 3) In the embodiment disclosed in the present specification, the first linear approximation means obtains a center of gravity obtained by weighting each point projected on the ρ-θ plane by the nth power of the density value of the ρ-θ plane. You may approximate it with a straight line. The second straight line approximating unit may approximate each point projected on the ρ-θ plane to a straight line by obtaining a centroid weighted by the nth power of the density value on the ρ-θ plane. According to such a configuration, an approximate straight line can be stably obtained.

本実施例の形状計測装置10は、ワーク(例えば、渦巻きばね等)を撮影し、撮影した画像からワークの形状を計測する。形状計測装置10は、例えば、工業製品を出荷する際の形状検査に用いられる。図1に示すように、形状計測装置10は、ステージ12と、ステージ12に固定されているCCDカメラ16と、CCDカメラ16に通信線18を介して接続されているコンピュータ22と、コンピュータ22に接続されているディスプレイ20及び入力装置24(例えば、キーボード等)を備えている。   The shape measuring apparatus 10 according to the present embodiment images a workpiece (for example, a spiral spring) and measures the shape of the workpiece from the captured image. The shape measuring apparatus 10 is used, for example, for shape inspection when shipping industrial products. As shown in FIG. 1, the shape measuring apparatus 10 includes a stage 12, a CCD camera 16 fixed to the stage 12, a computer 22 connected to the CCD camera 16 via a communication line 18, and a computer 22. The display 20 and the input device 24 (for example, a keyboard etc.) connected are provided.

ステージ12上には、較正時にキャリブレーションボード14が載置され、形状計測時にはワーク(図示しない)が載置される。CCDカメラ16は、ステージ12上に配置されており、ステージ12上に載置されたキャリブレーションボード14又はワークを撮影する。CCDカメラ16は、撮影時の露光時間が調整可能となっている。なお、ステージ12上に載置されたキャリブレーションボード14又はワークは、図示しない照明器によって照明されるようになっている。   A calibration board 14 is placed on the stage 12 during calibration, and a workpiece (not shown) is placed during shape measurement. The CCD camera 16 is disposed on the stage 12 and photographs the calibration board 14 or work placed on the stage 12. The CCD camera 16 can adjust the exposure time during photographing. The calibration board 14 or work placed on the stage 12 is illuminated by an illuminator (not shown).

CCDカメラ16が撮影した画像データは、通信線18を介してコンピュータ22に入力される。また、コンピュータ22には、入力装置24からワークの厚みが入力される。コンピュータ22には、後述する各種処理を実行するためのプログラムが記憶されている。コンピュータ22は、CCDカメラ16が撮影したキャリブレーションボード14の画像データを処理してキャリブレーションデータを作成し、また、CCDカメラ16が撮影したワークの画像データを処理してワークの形状を計測する。コンピュータ22は、計測されたワークの形状データをディスプレイ20に表示する。   Image data captured by the CCD camera 16 is input to the computer 22 via the communication line 18. In addition, the thickness of the workpiece is input to the computer 22 from the input device 24. The computer 22 stores a program for executing various processes described later. The computer 22 processes the image data of the calibration board 14 photographed by the CCD camera 16 to create calibration data, and processes the image data of the workpiece photographed by the CCD camera 16 to measure the shape of the workpiece. . The computer 22 displays the measured workpiece shape data on the display 20.

図2は、形状計測装置10によるキャリブレーションデータを作成する処理の流れを示すフローチャートである。形状計測装置10は、図2に示す各処理を経て、キャリブレーションデータを作成する。以下、図2に示すフローチャートに沿って、形状計測装置10による処理の流れを説明する。   FIG. 2 is a flowchart showing a flow of processing for creating calibration data by the shape measuring apparatus 10. The shape measuring apparatus 10 creates calibration data through each process shown in FIG. Hereinafter, the flow of processing by the shape measuring apparatus 10 will be described with reference to the flowchart shown in FIG.

まず、図2のステップS10において、作業者は、キャリブレーションボード14をステージ12上の撮影位置にセットする。キャリブレーションボード14の撮影面には、寸法が既知のパターン(例えば、格子パターン、ドットパターン等)が形成されている。本実施例では、図5に示すように、キャリブレーションボード14の撮影面には市松模様が印刷されている。ステップS10では、キャリブレーションボード14の撮影面(パターン)がCCDカメラ16で撮影されるように、キャリブレーションボード14をステージ12上にセットする。   First, in step S <b> 10 of FIG. 2, the operator sets the calibration board 14 at the photographing position on the stage 12. A pattern having a known dimension (for example, a lattice pattern, a dot pattern, etc.) is formed on the imaging surface of the calibration board 14. In this embodiment, as shown in FIG. 5, a checkered pattern is printed on the imaging surface of the calibration board 14. In step S <b> 10, the calibration board 14 is set on the stage 12 so that the photographing surface (pattern) of the calibration board 14 is photographed by the CCD camera 16.

次に、図2のステップS20では、CCDカメラ16でキャリブレーションボード14を撮影するときの露光時間を決定する処理を行う。すなわち、図20に示すように、露光時間が短すぎると、CCDカメラ16で撮影される画像内のキャリブレーションボード14のパターンが不鮮明となる。また、露光時間が長すぎても、CCDカメラ16で撮影される画像内のキャリブレーションボード14のパターンが不鮮明となる。画像内のパターンが不鮮明であると、得られるキャリブレーションデータも不正確な値となる。そこで、ステップS20を実行することで、撮影時の露光時間を決定する。   Next, in step S20 of FIG. 2, a process for determining an exposure time when the calibration board 14 is photographed by the CCD camera 16 is performed. That is, as shown in FIG. 20, if the exposure time is too short, the pattern of the calibration board 14 in the image taken by the CCD camera 16 becomes unclear. Even if the exposure time is too long, the pattern of the calibration board 14 in the image taken by the CCD camera 16 becomes unclear. If the pattern in the image is unclear, the obtained calibration data also has an incorrect value. Therefore, by executing step S20, the exposure time at the time of shooting is determined.

図3は、露光時間決定処理(図2のステップS20の処理)の流れを示すフローチャートである。まず、図3のステップS22において、コンピュータ22は、CCDカメラ16の露光時間を初期値に設定する。次いで、図3のステップS24では、CCDカメラ16によってキャリブレーションボード14を撮影する。これによって、図5に示すキャリブレーション画像30が取得される。キャリブレーション画像30では、白色の正方形状の白色領域32と、黒色の正方形状の黒色領域34が、xy方向に交互に配置されている。なお、CCDカメラ16で撮影された画像(キャリブレーション画像)は、コンピュータ22に入力される。   FIG. 3 is a flowchart showing the flow of the exposure time determination process (the process of step S20 in FIG. 2). First, in step S22 of FIG. 3, the computer 22 sets the exposure time of the CCD camera 16 to an initial value. Next, in step S <b> 24 of FIG. 3, the calibration board 14 is photographed by the CCD camera 16. Thereby, the calibration image 30 shown in FIG. 5 is acquired. In the calibration image 30, white square-shaped white areas 32 and black square-shaped black areas 34 are alternately arranged in the xy direction. An image (calibration image) captured by the CCD camera 16 is input to the computer 22.

次に、図3のステップS26では、コンピュータ22は、ステップS24で撮影されたキャリブレーション画像30の歪み量を算出する。歪み量は、露光時間が適切であるか否かを評価するために用いられるパラメータである。すなわち、図20に例示するように、露光時間が短いと、キャリブレーション画像30内の黒色領域34が膨らむ。一方、露光時間が長いと、キャリブレーション画像30内の白色領域32が膨らむ。このため、露光時間が適切でないと、白色領域32と黒色領域34の四角形状の歪みが大きくなる。したがって、キャリブレーション画像30の歪み量を算出することで、露光時間が適切か否かを評価する。   Next, in step S26 of FIG. 3, the computer 22 calculates the distortion amount of the calibration image 30 photographed in step S24. The distortion amount is a parameter used for evaluating whether or not the exposure time is appropriate. That is, as illustrated in FIG. 20, when the exposure time is short, the black region 34 in the calibration image 30 expands. On the other hand, when the exposure time is long, the white area 32 in the calibration image 30 swells. For this reason, when the exposure time is not appropriate, the rectangular distortion of the white region 32 and the black region 34 increases. Therefore, by calculating the distortion amount of the calibration image 30, it is evaluated whether or not the exposure time is appropriate.

図4は、歪み量を算出する処理の流れを示すフローチャートである。まず、図4のステップS38では、コンピュータ22は、ステップS24で撮影されたキャリブレーション画像から、水平方向(x方向)及び垂直方向(y方向)のエッジ強調画像を作成する。すなわち、コンピュータ22は、図5に示すキャリブレーション画像30の白色領域32と黒色領域34の境界線のうち、図6に示すように垂直方向(y方向)の境界線38を強調した画像36と、図7に示すように水平方向(x方向)の境界線42を強調した画像40を作成する。図6に示すように、垂直方向エッジ強調画像36には複数の垂直方向の境界線38が含まれており、図7に示すように、水平方向エッジ強調画像40には複数の水平方向の境界線42が含まれている。エッジ強調画像36,40は、例えば、キャリブレーション画像30にソベルフィルタをかけることで作成することができる。   FIG. 4 is a flowchart showing a flow of processing for calculating the distortion amount. First, in step S38 in FIG. 4, the computer 22 creates edge-enhanced images in the horizontal direction (x direction) and the vertical direction (y direction) from the calibration image photographed in step S24. That is, the computer 22 selects the image 36 in which the boundary line 38 in the vertical direction (y direction) is emphasized among the boundary lines of the white region 32 and the black region 34 of the calibration image 30 illustrated in FIG. As shown in FIG. 7, an image 40 is created in which the boundary line 42 in the horizontal direction (x direction) is emphasized. As shown in FIG. 6, the vertical edge enhanced image 36 includes a plurality of vertical boundary lines 38, and as shown in FIG. 7, the horizontal edge enhanced image 40 includes a plurality of horizontal boundaries. Line 42 is included. The edge-enhanced images 36 and 40 can be created, for example, by applying a Sobel filter to the calibration image 30.

次に、図4のステップS40では、コンピュータ22は、ステップS38で作成した水平及び垂直方向エッジ強調画像40,36の境界線42,38から代表直線を算出する。すなわち、垂直方向エッジ強調画像36の境界線38は、CCDカメラ16のレンズの歪み等のために湾曲しており、水平方向エッジ強調画像40の境界線42も、同様に湾曲している。ステップS40では、これらのエッジ強調画像36,40の境界線38,42を直線近似することで、代表直線を算出する。   Next, in step S40 of FIG. 4, the computer 22 calculates a representative straight line from the boundary lines 42 and 38 of the horizontal and vertical edge enhanced images 40 and 36 created in step S38. That is, the boundary line 38 of the vertical edge enhanced image 36 is curved due to distortion of the lens of the CCD camera 16 and the like, and the boundary line 42 of the horizontal edge enhanced image 40 is similarly curved. In step S40, a representative straight line is calculated by linearly approximating the boundary lines 38 and 42 of these edge enhanced images 36 and 40.

ここで、エッジ強調画像36,40の境界線38,42から代表直線を算出する方法としては、例えば、Hough変換を利用することができる。なお、垂直方向エッジ強調画像36の境界線38から代表直線を算出する方法と、水平方向エッジ強調画像40の境界線42から代表直線を算出する方法とは、同一であるため、ここでは、垂直方向エッジ強調画像36の境界線38から代表直線を算出する方法について説明する。   Here, as a method of calculating the representative straight line from the boundary lines 38 and 42 of the edge-enhanced images 36 and 40, for example, Hough transformation can be used. Note that the method for calculating the representative straight line from the boundary line 38 of the vertical edge-enhanced image 36 and the method for calculating the representative straight line from the boundary line 42 of the horizontal edge-enhanced image 40 are the same. A method of calculating the representative straight line from the boundary line 38 of the direction edge enhanced image 36 will be described.

まず、垂直方向エッジ強調画像36を2値化し、それをHough変換する。Hough変換することで、xy平面上のデータが、図8(a)に示すようにρ−θ平面に展開される。図6に示すように、垂直方向エッジ強調画像36には8本の境界線38が含まれている。このため、図8(a)には8つのデータ群が存在する。次に、図8(a)のデータ群にガウスの窓をかけて平滑化し(図8(b))、次いで、その平滑化したデータ群(図8(b))を2値化し(図8(c))、次いで、2値化したデータ群(図8(c))をラベリングする(図8(d))。そして、ラベルの面積が所定の閾値以上となるものを抽出する。次に、ρ−θ平面上で抽出した各ラベルの重心を算出する。重心の算出には、相加平均による重心算出の式を濃度値h(θ,ρ)のn乗で重み付けした式を用いる。i番目のラベル(LABEL(i))に対応する重み付け重心(θ(i),ρ(i))は、次の式(1)で算出される。ここで、Nは、LABEL(i)に属する画素数である。ただし、ここでは垂直方向エッジ強調画像36を2値化しているが、エッジ強調画像の濃淡値をそのままρ−θ平面に展開してもよい。 First, the vertical edge-enhanced image 36 is binarized and subjected to Hough conversion. By performing the Hough transform, the data on the xy plane is developed on the ρ-θ plane as shown in FIG. As shown in FIG. 6, the vertical edge-enhanced image 36 includes eight boundary lines 38. For this reason, there are eight data groups in FIG. Next, the data group of FIG. 8A is smoothed by applying a Gaussian window (FIG. 8B), and then the smoothed data group (FIG. 8B) is binarized (FIG. 8). (C)) Then, the binarized data group (FIG. 8C) is labeled (FIG. 8D). Then, a label whose area is equal to or greater than a predetermined threshold is extracted. Next, the center of gravity of each label extracted on the ρ-θ plane is calculated. For the calculation of the center of gravity, an expression obtained by weighting the expression for calculating the center of gravity by arithmetic mean by the nth power of the density value h (θ, ρ) is used. The weighted centroid (θ c (i), ρ c (i)) corresponding to the i-th label (LABEL (i)) is calculated by the following equation (1). Here, N i is the number of pixels belonging to LABEL (i). However, although the vertical edge-enhanced image 36 is binarized here, the gray value of the edge-enhanced image may be developed as it is on the ρ-θ plane.

上記の式によりラベルの重心(θ(i),ρ(i))が算出されると、これを用いて下記の式(2)により代表直線に変換する。ここで、a=cos(θ(i)),b=sin(θ(i)),c=ρ(i)である。 When the center of gravity (θ c (i), ρ c (i)) of the label is calculated by the above formula, it is converted into a representative straight line by the following formula (2) using this. Here, a i = cos (θ c (i)), b i = sin (θ c (i)), and c i = ρ c (i).

上記のようにxy平面上のデータをHough変換によってρ−θ平面に展開することで、ノイズが含まれた画像から好適に代表直線を算出することができる。また、ρ−θ平面に展開された各点を濃度値のn乗で重み付けして得られた重心から代表直線を算出するため、安定して代表直線を算出することができる。   As described above, the data on the xy plane is developed on the ρ-θ plane by the Hough transform, so that the representative straight line can be suitably calculated from the image including noise. In addition, since the representative line is calculated from the center of gravity obtained by weighting each point developed on the ρ-θ plane by the nth power of the density value, the representative line can be calculated stably.

なお、本実施例では、各ラベルの重心を用いて直線を検出するため、一度に複数の直線を検出することができるという利点を有する。すなわち、Hough変換では、通常、ρ−θ平面から濃度最大点を1つ抽出し、これを1本の直線とする。したがって、Hough変換を用いた通常の方法では、一度に1本の直線しか検出できない。しかしながら、本実施例では、各ラベルの重心を用いて直線を検出するため、一度に複数の直線を検出することができる。   In addition, in a present Example, since a straight line is detected using the gravity center of each label, it has the advantage that a several straight line can be detected at once. That is, in the Hough transform, one density maximum point is usually extracted from the ρ-θ plane and is set as one straight line. Therefore, the normal method using the Hough transform can detect only one straight line at a time. However, in the present embodiment, since a straight line is detected using the center of gravity of each label, a plurality of straight lines can be detected at a time.

また、本実施例では、各点を濃度値のn乗で重み付けするため、検出される直線がぶれ難く、直線検出の繰り返し精度を高くすることができるという利点を有する。すなわち、キャリブレーションボード14をCCDカメラ16で撮影すると、CCDカメラ16のレンズの歪みによって、画像内の直線が湾曲する。湾曲した曲線をHough変換によってρ−θ平面に写像すると、濃度最大点が定まらないことがある。その結果、従来の方法(濃度最大点から直線を検出する方法)では、検出した直線がぶれ易く、直線検出の繰り返し精度が低い。一方、本実施例では、各点を濃度値のn乗で重み付けするため、検出される直線がぶれ難くなり、直線検出の繰り返し精度を高めることができる。   Further, in this embodiment, since each point is weighted by the nth power of the density value, there is an advantage that the detected straight line is hardly shaken and the repeatability of the straight line detection can be increased. That is, when the calibration board 14 is photographed by the CCD camera 16, a straight line in the image is curved due to distortion of the lens of the CCD camera 16. When a curved curve is mapped to the ρ-θ plane by Hough transform, the maximum density point may not be determined. As a result, in the conventional method (method of detecting a straight line from the maximum density point), the detected straight line is likely to be blurred, and the repeatability of the straight line detection is low. On the other hand, in this embodiment, since each point is weighted by the nth power of the density value, the detected straight line is less likely to be blurred, and the repeatability of the straight line detection can be increased.

次に、図4のステップS42では、コンピュータ22は、ステップS40で得られた代表直線を用いて処理対象領域を決定する。すなわち、図9に示すように、代表直線を水平方向にシフトした直線46a,46bによって挟まれる領域46に垂直方向境界線38が含まれるようにする。そして、シフトした直線46a,46bによって挟まれる領域46を処理対象領域とする。水平方向境界線42に対しても同様に、図10に示すように、代表直線を垂直方向にシフトした直線48a,48bによって挟まれる領域48に水平方向境界線42が含まれるようにする。そして、シフトした直線48a,48bによって挟まれる領域48を処理対象領域とする。   Next, in step S42 of FIG. 4, the computer 22 determines a processing target area using the representative straight line obtained in step S40. That is, as shown in FIG. 9, a vertical boundary line 38 is included in a region 46 sandwiched between straight lines 46a and 46b obtained by shifting the representative straight line in the horizontal direction. Then, a region 46 sandwiched between the shifted straight lines 46a and 46b is set as a processing target region. Similarly, with respect to the horizontal boundary line 42, as shown in FIG. 10, the horizontal boundary line 42 is included in a region 48 sandwiched between straight lines 48a and 48b obtained by shifting the representative straight line in the vertical direction. A region 48 sandwiched between the shifted straight lines 48a and 48b is set as a processing target region.

次に、図4のステップS44では、コンピュータ22は、エッジ強調画像36,40を複数の領域に分割する。具体的には、図11に示すように、垂直方向エッジ強調画像36を、水平方向に伸びる切断線50(l〜l)によって垂直方向にJ等分する(図11ではJ=7)。これによって、垂直方向に伸びる境界線38が、垂直方向にJ等分される。同様に、水平方向エッジ強調画像40に対して、図13に示すように、垂直方向に伸びる切断線52(m〜m)によって水平方向にI等分する。これによって、水平方向に伸びる境界線42が、水平方向にI等分される。 Next, in step S44 of FIG. 4, the computer 22 divides the edge-enhanced images 36 and 40 into a plurality of regions. Specifically, as shown in FIG. 11, the vertical edge-enhanced image 36 is equally divided into J in the vertical direction by a cutting line 50 (l 0 to l J ) extending in the horizontal direction (J = 7 in FIG. 11). . As a result, the boundary line 38 extending in the vertical direction is equally divided into J in the vertical direction. Similarly, as shown in FIG. 13, the horizontal edge-enhanced image 40 is equally divided in the horizontal direction by cutting lines 52 (m 0 to m I ) extending in the vertical direction. Thus, the boundary line 42 extending in the horizontal direction is equally divided into I in the horizontal direction.

次に、図4のステップS46では、コンピュータ22は、ステップS44で分割された各領域において、境界線38,42を直線近似する。すなわち、図12に示すように、垂直方向エッジ強調画像36は、ステップS44によって垂直方向に分割されている。これによって、境界線38及び処理対象領域46も垂直方向に分割される。したがって、分割された各処理対象領域46i,jにおいて、分割された境界線38i,jを直線近似する。これによって、複数の分割境界線38i,jを直線近似した分割境界近似直線(x=αi,jy+βi,j(i=0〜7,j=0〜6))が得られる。なお、分割された境界線38i,jを直線近似する方法としては、最小二乗法や、既に説明したHough変換を用いることができる。また、水平方向エッジ強調画像40についても、図13に示すように、水平方向に分割された各処理対象領域48i,jにおいて、分割された境界線42i,jを直線近似する。これによって、複数の分割境界線42i,jを直線近似した分割境界近似直線(y=Ai,jx+Bi,j(i=0〜12,j=0〜5))が得られる。なお、分割境界近似直線を算出する際は、計算対象領域が処理対象領域46i,j,48i,jに限定されているため、計算処理量を大幅に軽減することができる。 Next, in step S46 of FIG. 4, the computer 22 linearly approximates the boundary lines 38 and 42 in each region divided in step S44. That is, as shown in FIG. 12, the vertical edge-enhanced image 36 is divided in the vertical direction by step S44. Accordingly, the boundary line 38 and the processing target area 46 are also divided in the vertical direction. Therefore, the divided boundary lines 38 i, j are linearly approximated in each of the divided processing target areas 46 i, j . As a result, a division boundary approximation line (x = α i, j y + β i, j (i = 0 to 7, j = 0 to 6)) obtained by linear approximation of the plurality of division boundary lines 38 i, j is obtained. As a method for linearly approximating the divided boundary lines 38 i, j , the least square method or the Hough transform described above can be used. As for the horizontal edge-enhanced image 40, as shown in FIG. 13, in each processing target area 48 i, j divided in the horizontal direction, the divided boundary lines 42 i, j are linearly approximated. As a result, a division boundary approximation line (y = A i, j x + B i, j (i = 0-12, j = 0-5)) obtained by linear approximation of the plurality of division boundary lines 42 i, j is obtained. Note that, when calculating the divided boundary approximate straight line, the calculation target area is limited to the processing target areas 46 i, j , 48 i, j , so that the calculation processing amount can be greatly reduced.

次に、図4のステップS48では、コンピュータ22は、図3のステップS24においてCCDカメラ16で撮影された画像の歪み量を算出する。具体的には、まず、図12に示すように、垂直方向の境界線38(すなわち、垂直方向に伸びるi番目(i=0〜7)の境界線38)のそれぞれについて、ステップS46で算出された垂直方向の分割境界近似直線(x=αi,jy+βi,j(i=0〜7,j=0〜6))のx切片の分散σβ (i)を算出する。x切片の分散σβ (i)は、下記の式(3)により算出される。なお、βave(i)はx切片の平均である。また、Nは分割後の区間数である。 Next, in step S48 in FIG. 4, the computer 22 calculates the distortion amount of the image captured by the CCD camera 16 in step S24 in FIG. Specifically, first, as shown in FIG. 12, each vertical boundary line 38 i (ie, the i-th (i = 0 to 7) boundary line 38 extending in the vertical direction) is calculated in step S46. The variance σ β 2 (i) of the x-intercept of the vertical division boundary approximation straight line (x = α i, j y + β i, j (i = 0-7, j = 0-6)) is calculated. The variance σ β 2 (i) of the x intercept is calculated by the following equation (3). Note that β ave (i) is an average of x-intercepts. N y is the number of sections after division.

垂直方向の境界線38のそれぞれについて分散σβ (i)を算出すると、下記の式(4)によって、これらの分散σβ (i)の平均値σβ aveを算出する。なお、Nは分割後の区間数である。 After calculating the variance sigma beta 2 (i) for each of the vertical boundary line 38 i, the equation (4) below, calculates the average value sigma beta 2 ave of these variance σ β 2 (i). N x is the number of sections after division.

同様に、図13に示すように、水平方向の境界線42(すなわち、水平方向に伸びるj番目(j=0〜5)の境界線42)のそれぞれについて、ステップS46で算出された水平方向の分割境界近似直線(y=Ai,jx+Bi,j(i=0〜12,j=0〜5))のy切片の分散σ (j)を算出する。y切片の分散σ (j)は、下記の式(5)により算出される。なお、Bave(j)はy切片の平均である。 Similarly, as shown in FIG. 13, the horizontal direction calculated in step S46 for each of the horizontal boundary lines 42 j (that is, the jth (j = 0 to 5) boundary lines 42 extending in the horizontal direction). The variance σ B 2 (j) of the y intercept of the divided boundary approximation straight line (y = A i, j x + B i, j (i = 0-12, j = 0-5)) is calculated. The variance σ B 2 (j) of the y intercept is calculated by the following equation (5). B ave (j) is an average of y-intercepts.

水平方向の境界線42のそれぞれについて分散σ (j)を算出すると、下記の式(6)によって、これらの分散σ (j)の平均値σ aveを算出する。 After calculating the horizontal boundary line 42 variance sigma B 2 for each of the j (j), the following equation (6), calculates the average value sigma B 2 ave of these variance σ B 2 (j).

最後に、上記のように算出された垂直方向の境界線38についての分散の平均値σβ aveと、水平方向の境界線42についての分散の平均値σ aveとの和を、図3のステップS24においてCCDカメラ16で撮影された画像の歪み量とする。 Finally, the sum of the average variance σ β 2 ave for the vertical boundary 38 calculated as described above and the average variance σ B 2 ave for the horizontal boundary 42 is shown in FIG. 3, the distortion amount of the image taken by the CCD camera 16 in step S24.

ここで、ステップS48で算出される歪み量σの意味を簡単に説明しておく。図20に示すように、露光時間が適切でないキャリブレーション画像30では、黒色領域34又は白色領域32が膨らむ。一方、キャリブレーション画像30では、白色領域32と黒色領域34とがxy方向に交互に配置される。このため、露光時間が適切でないキャリブレーション画像30では、エッジ強調画像36,40の境界線38,42が交互に左右又は上下方向にずれることとなる。したがって、垂直方向の境界線38についての分散の平均値σβ aveと、水平方向の境界線42についての分散の平均値σ aveとの和をとることで、キャリブレーション画像の露光時間が適切か否かを評価することができる。 Here, the meaning of the distortion amount σ 2 calculated in step S48 will be briefly described. As shown in FIG. 20, in the calibration image 30 where the exposure time is not appropriate, the black region 34 or the white region 32 swells. On the other hand, in the calibration image 30, white areas 32 and black areas 34 are alternately arranged in the xy direction. For this reason, in the calibration image 30 in which the exposure time is not appropriate, the boundary lines 38 and 42 of the edge enhanced images 36 and 40 are alternately shifted left and right or up and down. Accordingly, the exposure time of the calibration image is obtained by taking the sum of the average value σ β 2 ave of the dispersion for the vertical boundary line 38 and the average value σ B 2 ave of the dispersion for the horizontal boundary line 42. It is possible to evaluate whether or not is appropriate.

ステップS48で歪み量σが算出されると、図3のステップS28に戻って、コンピュータ22は、算出された歪み量σが最小歪み量σmin より小さいか否かを判断する。露光時間が初期値の場合は、コンピュータ22のメモリ内に最小歪み量σmin が記憶されていないので、ステップS26で算出された歪み量σが最小歪み量σmin より小さいと判断する。一方、露光時間が初期値でない場合は、コンピュータ22のメモリ内に最小歪み量σmin が既に記憶されているので、ステップS26で算出された歪み量σが記憶されている最小歪み量σmin より小さいか否かを判断する。 When the distortion amount σ 2 is calculated in step S48, the process returns to step S28 in FIG. 3, and the computer 22 determines whether or not the calculated distortion amount σ 2 is smaller than the minimum distortion amount σ min 2 . When the exposure time is the initial value, the minimum distortion amount σ min 2 is not stored in the memory of the computer 22, and therefore it is determined that the distortion amount σ 2 calculated in step S 26 is smaller than the minimum distortion amount σ min 2. . On the other hand, when the exposure time is not the initial value, the minimum amount of distortion sigma min 2 in the memory of the computer 22 has already been stored, the minimum amount of distortion the distortion amount calculated in step S26 sigma 2 is stored sigma It is determined whether or not it is smaller than min 2 .

算出された歪み量σが最小歪み量σmin より小さい場合は、図3のステップS30に進み、コンピュータ22は、算出された歪み量σを最小歪み量σmin として記憶する。これによって、最小歪み量σmin が更新される。一方、算出された歪み量σが最小歪み量σmin より大きい場合は、図3のステップS30をスキップしてステップS32に進み、コンピュータ22は、露光時間が終値になったか否かを判断する。 When the calculated strain amount σ 2 is smaller than the minimum strain amount σ min 2 , the process proceeds to step S30 in FIG. 3, and the computer 22 stores the calculated strain amount σ 2 as the minimum strain amount σ min 2 . As a result, the minimum distortion amount σ min 2 is updated. On the other hand, when the calculated distortion amount σ 2 is larger than the minimum distortion amount σ min 2 , the process skips step S30 in FIG. 3 and proceeds to step S32, and the computer 22 determines whether or not the exposure time has reached the final value. To do.

露光時間が終値となっていない場合は、図3のステップS36に進み、コンピュータ22は露光時間を変更し、ステップS24からの処理を繰り返す。これによって、露光時間を変えてキャリブレーションボード14が撮影され、その撮影されたキャリブレーション画像について歪み量σが算出され、最小歪み量σmin が更新されていくこととなる。一方、露光時間が終値となっている場合は、図3のステップS34に進み、コンピュータ22は、最小歪み量σmin が算出されたときの露光時間を、最終的な露光時間として決定する。これによって、予め定められた範囲内(すなわち、初期値〜終値)の露光時間の中から、適切な露光時間が決定される。 If the exposure time is not the final price, the process proceeds to step S36 in FIG. 3, and the computer 22 changes the exposure time and repeats the processing from step S24. Thus, the calibration board 14 is photographed while changing the exposure time, the distortion amount σ 2 is calculated for the photographed calibration image, and the minimum distortion amount σ min 2 is updated. On the other hand, if the exposure time is the final value, the process proceeds to step S34 in FIG. 3, and the computer 22 determines the exposure time when the minimum distortion amount σ min 2 is calculated as the final exposure time. Thus, an appropriate exposure time is determined from the exposure time within a predetermined range (that is, the initial value to the final value).

露光時間が決定されると、図2のステップS50に進み、コンピュータ22は、キャリブレーションデータ作成処理を実行する。キャリブレーションデータ作成処理について、図14のフローチャートに沿って説明する。   When the exposure time is determined, the process proceeds to step S50 in FIG. 2, and the computer 22 executes calibration data creation processing. The calibration data creation process will be described with reference to the flowchart of FIG.

まず、図14のステップS52では、コンピュータ22は、図3のステップS34で決定された露光時間で撮影されたキャリブレーション画像を特定する。そして、その特定したキャリブレーション画像に対して、図14のステップS54〜S62の処理を実行する。ここで、ステップS54〜S62の処理は、図4のステップS38〜S46の処理と同一の処理である。したがって、ステップS54〜S62の処理を実行することで、垂直方向の複数の境界線38に対して、分割境界近似直線(x=αi,jy+βi,j(i=0〜7,j=0〜6))が得られる。また、水平方向の複数の境界線42に対して、分割境界近似直線(y=Ai,jx+Bi,j(j=0〜5,i=0〜12))が得られる。なお、図4のステップS40〜S46の処理を実行することで得られる分割境界近似直線を予め記憶しておけば、図14のステップS54〜S62の処理を実行しなくてもよい。 First, in step S52 of FIG. 14, the computer 22 specifies a calibration image photographed with the exposure time determined in step S34 of FIG. And the process of step S54-S62 of FIG. 14 is performed with respect to the specified calibration image. Here, the processes of steps S54 to S62 are the same as the processes of steps S38 to S46 of FIG. Therefore, by executing the processing of steps S54 to S62, the divided boundary approximate straight line (x = α i, j y + β i, j (i = 0 to 7, j = 0-6)) are obtained. Further, a divided boundary approximate straight line (y = A i, j x + B i, j (j = 0 to 5, i = 0 to 12)) is obtained for a plurality of boundary lines 42 in the horizontal direction. In addition, if the division | segmentation boundary approximation straight line obtained by performing the process of step S40-S46 of FIG. 4 is memorize | stored previously, the process of step S54-S62 of FIG. 14 does not need to be performed.

次に、図14のステップS64では、コンピュータ22は、分割境界近似直線(x=αi,jy+βi,j(i=0〜7,j=0〜6))と分割境界近似直線(y=Ai,jx+Bi,j(j=0〜5,i=0〜12))との交点(基準点)の位置データを算出する。次いで、図14のステップS66で、コンピュータ22は、ステップS64で得られた交点の座標データを、キャリブレーションデータとして記憶する。これによって、図2のキャリブレーションデータ作成処理が終了する。キャリブレーションデータ作成処理が終了すると、図15に示すように、キャリブレーション画像30内の、白色領域32の頂点(すなわち、黒色領域34の頂点)の位置(pxi,j,pyi,j)が、キャリブレーションデータとしてメモリ内に記憶される。 Next, in step S64 of FIG. 14, the computer 22 determines that the division boundary approximate line (x = α i, j y + β i, j (i = 0-7, j = 0-6)) and the division boundary approximation line (y = A i, j x + B i, j (j = 0 to 5, i = 0 to 12)) and the position data of the intersection (reference point) are calculated. Next, in step S66 of FIG. 14, the computer 22 stores the coordinate data of the intersection obtained in step S64 as calibration data. Thus, the calibration data creation process in FIG. 2 is completed. When the calibration data creation processing is completed, as shown in FIG. 15, the position (pxi , j , pyi , j ) of the vertex of the white area 32 (that is, the vertex of the black area 34) in the calibration image 30. Is stored in the memory as calibration data.

次に、形状計測装置10によりワークの形状を測定する処理を説明する。図16は、ワークの形状を測定する処理の流れを示すフローチャートである。形状計測装置10は、図16に示す各処理を経て、ワークの形状を測定したデータを作成する。以下、図16に示すフローチャートに沿って、形状計測装置10による処理の流れを説明する。   Next, processing for measuring the shape of the workpiece by the shape measuring apparatus 10 will be described. FIG. 16 is a flowchart showing the flow of processing for measuring the shape of a workpiece. The shape measuring apparatus 10 creates data obtained by measuring the shape of the workpiece through each process shown in FIG. Hereinafter, the flow of processing by the shape measuring apparatus 10 will be described along the flowchart shown in FIG.

まず、図16のステップS70では、作業者は、入力装置24を用いてワークの厚みをコンピュータ22に入力する。すなわち、図17に示すように、キャリブレーションボード14の厚みとワークWの厚みが相違すると、撮影された画像内の位置が同一でも実際の大きさは相違する。したがって、キャリブレーションボード14の厚みとワークWの厚みの相違を考慮するため、ワークWの厚みをコンピュータ22に入力する。   First, in step S <b> 70 of FIG. 16, the worker inputs the workpiece thickness into the computer 22 using the input device 24. That is, as shown in FIG. 17, when the thickness of the calibration board 14 and the thickness of the work W are different, the actual size is different even if the positions in the photographed image are the same. Therefore, the thickness of the workpiece W is input to the computer 22 in order to take into account the difference between the thickness of the calibration board 14 and the thickness of the workpiece W.

次に、図16のステップS72では、コンピュータ22は、ワークWを撮影するときの露光時間を設定する。例えば、コンピュータ22は、図3のステップS34で決定した露光時間に設定してもよい。あるいは、照明条件により、これとは異なる露光時間に設定してもよい。次に、図16のステップS74では、作業者は、ステージ12上にワークWを設置する。次いで、図16のステップS76では、コンピュータ22は、CCDカメラ16によってワークWを撮影する。CCDカメラ16で撮影されたワークWの画像は、通信線18を介してコンピュータ22に入力される。   Next, in step S <b> 72 of FIG. 16, the computer 22 sets an exposure time when photographing the workpiece W. For example, the computer 22 may set the exposure time determined in step S34 in FIG. Alternatively, an exposure time different from this may be set depending on illumination conditions. Next, in step S <b> 74 of FIG. 16, the worker installs the workpiece W on the stage 12. Next, in step S <b> 76 of FIG. 16, the computer 22 photographs the work W by the CCD camera 16. An image of the workpiece W photographed by the CCD camera 16 is input to the computer 22 via the communication line 18.

次に、図16のステップS78では、コンピュータ22は、図2のステップS50で作成したキャリブレーションデータを読み出す。次いで、図16のステップS80に進み、コンピュータ22は、ステップS78で読み出したキャリブレーションデータを、ステップS70で入力したワークWの厚みによって修正する。すなわち、キャリブレーションボード14の厚みとワークWの厚みの差を考慮して、キャリブレーションデータを補正する。なお、ステップS80によるワークWの厚み補正は、従来公知の方法によって行うことができる。   Next, in step S78 of FIG. 16, the computer 22 reads the calibration data created in step S50 of FIG. Next, the process proceeds to step S80 in FIG. 16, and the computer 22 corrects the calibration data read out in step S78 with the thickness of the workpiece W input in step S70. That is, the calibration data is corrected in consideration of the difference between the thickness of the calibration board 14 and the thickness of the workpiece W. The thickness correction of the workpiece W in step S80 can be performed by a conventionally known method.

次に、図16のステップS82では、コンピュータ22は、ステップS80で修正したキャリブレーションデータを用いて、ステップS76で撮影されたワークWの画像を補正する。すなわち、上述したように、キャリブレーションデータは、キャリブレーション画像内の基準点の位置座標を記憶している。したがって、撮影された画像が歪んでいると、図18のように、隣接する4つの基準点(pxi,j,pyi,j),(pxi+1,j,pyi+1,j),(pxi,j+1,pyi,j+1),(pxi+1,j+1,pyi+1,j+1)を結んで形成される四角形54も歪んでいる。一方、キャリブレーションボード14に印刷されたパターン(四角形)は歪んでおらず、また、このパターンは寸法が既知である。したがって、図19に示すように、画像内の隣接する4つの基準点によって形成される四角形54を、キャリブレーションボード14に印刷された正しい形状56に変換することで、撮影された画像の歪みを修正する。そして、ステップS83で、コンピュータ22は、歪みが補正された画像から、ワークWの寸法を計測する。計測された結果(ワークWの寸法)は、モニタ20に表示される。 Next, in step S82 of FIG. 16, the computer 22 corrects the image of the workpiece W photographed in step S76 using the calibration data corrected in step S80. That is, as described above, the calibration data stores the position coordinates of the reference point in the calibration image. Therefore, if the captured image is distorted, as shown in FIG. 18, four adjacent reference points (pxi , j , pyi , j ), (pxi i + 1, j , py i + 1, j ), (px A square 54 formed by connecting i, j + 1 , py i, j + 1 ), (pxi + 1, j + 1 , py i + 1, j + 1 ) is also distorted. On the other hand, the pattern (rectangle) printed on the calibration board 14 is not distorted, and the size of this pattern is known. Therefore, as shown in FIG. 19, by converting a square 54 formed by four adjacent reference points in the image into a correct shape 56 printed on the calibration board 14, distortion of the captured image can be reduced. Correct it. In step S83, the computer 22 measures the dimension of the workpiece W from the image whose distortion has been corrected. The measured result (the dimension of the workpiece W) is displayed on the monitor 20.

上述したように、本実施例の形状計測装置10では、露光時間を変化させながらCCDカメラ16によってキャリブレーションボード14を撮影し、その撮影により得られた各キャリブレーション画像30の歪み量を算出する。そして、算出された歪み量が最も小さくなる露光時間を、キャリブレーションボード14及びワークWを撮影するときの露光時間として決定する。したがって、作業者の熟練を要することなく適切な光量に自動的に調整され、適切な露光時間でキャリブレーションボード14及びワークWを撮影することができる。   As described above, in the shape measuring apparatus 10 of this embodiment, the calibration board 14 is photographed by the CCD camera 16 while changing the exposure time, and the distortion amount of each calibration image 30 obtained by the photographing is calculated. . Then, the exposure time at which the calculated amount of distortion becomes the smallest is determined as the exposure time when photographing the calibration board 14 and the workpiece W. Therefore, the light amount is automatically adjusted to an appropriate light amount without requiring the skill of the operator, and the calibration board 14 and the work W can be photographed with an appropriate exposure time.

また、本実施例の形状計測装置10では、市松模様が印刷されたキャリブレーションボード14の画像から、垂直方向及び水平方向の境界線38,42を抽出し、これらの境界線38,42を直線で近似する。そして、近似した直線(代表直線)を水平方向又は垂直方向にシフトさせて、対応する境界線38又は42を包含する領域46又は48を抽出する。そして、抽出された領域46,48の内部で基準点の位置データを特定する。したがって、キャリブレーション画像30から基準点が含まれる比較的に狭い領域46,48を抽出し、その抽出した領域46,48の中で基準点の座標を特定する。このため、基準点の座標を特定する処理に必要となる計算量を少なくすることができる。   Further, in the shape measuring apparatus 10 of the present embodiment, the boundary lines 38 and 42 in the vertical direction and the horizontal direction are extracted from the image of the calibration board 14 on which the checkered pattern is printed, and the boundary lines 38 and 42 are straight lines. Approximate. Then, the approximated straight line (representative straight line) is shifted in the horizontal direction or the vertical direction, and the region 46 or 48 including the corresponding boundary line 38 or 42 is extracted. Then, the position data of the reference point is specified within the extracted areas 46 and 48. Therefore, relatively narrow areas 46 and 48 including the reference point are extracted from the calibration image 30, and the coordinates of the reference point are specified in the extracted areas 46 and 48. For this reason, it is possible to reduce the amount of calculation required for the process of specifying the coordinates of the reference point.

本実施例と特許請求の範囲の記載の対応関係を説明する。CCDカメラ16が、「撮影装置」の一例である。コンピュータ22によるCCDカメラ16の露光時間の調整処理が、「光量調整手段」の一例である。市松模様が、「格子パターン」の一例である。黒色領域と34と白色領域32の境界線のうち垂直方向に伸びる境界線群が「第1直線群」の一例であり、黒色領域34と白色領域32の境界線のうち水平方向に伸びる境界線群が「第2直線群」の一例である。コンピュータ22によるステップS38の処理(図4参照)が、「第1曲線抽出手段」及び「第2曲線抽出手段」の一例である。コンピュータ22によるステップS40の処理(図4参照)が、「第1直線近似手段」及び「第2直線近似手段」の一例である。コンピュータ22によるステップS42の処理(図4参照)が、「第1領域抽出手段」及び「第2領域抽出手段」の一例である。領域46,48が、それぞれ「第1領域」、「第2領域」の一例である。コンピュータ22によるステップS64及びS66の処理(図14参照)が、「位置データ算出手段」の一例である。分割境界近似直線(x=αi,jy+βi,j(i=0〜7,j=0〜6))が、「第1分割直線」の一例である。分割境界近似直線(y=Ai,jx+Bi,j(i=0〜12,j=0〜5))が、「第2分割直線」の一例である。 The correspondence relationship between the present embodiment and the claims will be described. The CCD camera 16 is an example of a “photographing device”. The adjustment process of the exposure time of the CCD camera 16 by the computer 22 is an example of the “light quantity adjusting unit”. A checkered pattern is an example of a “lattice pattern”. The boundary line group extending in the vertical direction among the boundary lines between the black area 34 and the white area 32 is an example of the “first straight line group”, and the boundary line extending in the horizontal direction among the boundary lines between the black area 34 and the white area 32. The group is an example of a “second straight line group”. The process of step S38 by the computer 22 (see FIG. 4) is an example of “first curve extraction means” and “second curve extraction means”. The process of step S40 by the computer 22 (see FIG. 4) is an example of “first linear approximation means” and “second linear approximation means”. The process of step S42 by the computer 22 (see FIG. 4) is an example of “first region extraction unit” and “second region extraction unit”. The areas 46 and 48 are examples of “first area” and “second area”, respectively. The processing of steps S64 and S66 (see FIG. 14) by the computer 22 is an example of “position data calculation means”. The division boundary approximate straight line (x = α i, j y + β i, j (i = 0 to 7, j = 0 to 6)) is an example of the “first division straight line”. The division boundary approximate straight line (y = A i, j x + B i, j (i = 0 to 12, j = 0 to 5)) is an example of the “second division straight line”.

以上、本発明の具体例を詳細に説明したが、これらは例示にすぎず、特許請求の範囲を限定するものではない。特許請求の範囲に記載の技術には、以上に例示した具体例を様々に変形、変更したものが含まれる。   Specific examples of the present invention have been described in detail above, but these are merely examples and do not limit the scope of the claims. The technology described in the claims includes various modifications and changes of the specific examples illustrated above.

例えば、上述した実施例では、予め定められた露光時間の範囲内で最も歪み量が小さくなる露光時間を探索し、その最も歪み量が小さくなる露光時間を撮影時の露光時間としたが、本明細書に開示の技術はこのような形態に限られない。例えば、図21に示すように、コンピュータ22は、露光時間を初期値に設定し(ステップS84)、キャリブレーションボード14を撮影し(ステップS86)、その撮影して得られたキャリブレーション画像30の歪み量σを算出する(ステップS88)。そして、コンピュータ22は、算出された歪み量σが閾値より小さくなったか否かを判断する(ステップS90)。算出された歪み量σが閾値より小さくない場合(ステップS90でNO)は、コンピュータ22は、露光時間を変更し(ステップS94)、ステップS86からの処理を繰返す。一方、算出された歪み量σが閾値より小さい場合(ステップS90でYES)は、コンピュータ22は、歪み量σを閾値より小さくする露光時間を、撮影時の露光時間に決定する(ステップS92)。このような方法によっても、歪み量σを充分に小さくする露光時間を決定でき、キャリブレーションボード14及びワークWの撮影を好適に行うことができる。 For example, in the above-described embodiment, the exposure time with the smallest distortion amount is searched for within the predetermined exposure time range, and the exposure time with the smallest distortion amount is set as the exposure time at the time of shooting. The technology disclosed in the specification is not limited to such a form. For example, as shown in FIG. 21, the computer 22 sets the exposure time to an initial value (step S84), images the calibration board 14 (step S86), and obtains a calibration image 30 obtained by the imaging. A distortion amount σ 2 is calculated (step S88). Then, the computer 22 determines whether or not the calculated distortion amount σ 2 has become smaller than the threshold value (step S90). If the calculated distortion amount σ 2 is not smaller than the threshold value (NO in step S90), the computer 22 changes the exposure time (step S94) and repeats the processing from step S86. On the other hand, if the calculated distortion amount σ 2 is smaller than the threshold value (YES in step S90), the computer 22 determines the exposure time for making the distortion amount σ 2 smaller than the threshold value as the exposure time at the time of shooting (step S92). ). Also by such a method, the exposure time for sufficiently reducing the distortion amount σ 2 can be determined, and the calibration board 14 and the workpiece W can be suitably photographed.

あるいは、図22に示すように、コンピュータ22は、露光時間を初期値に設定し(ステップS96)、キャリブレーションボード14を撮影し(ステップS98)、その撮影して得られたキャリブレーション画像30の歪み量σを算出する(ステップS100)。そして、コンピュータ22は、算出された歪み量σが第1設定値より小さくなったか否か、及び、算出された歪み量σの変化量Δσの絶対値が第2設定値より小さくなったか否かを判断する(ステップS102)。そして、算出された歪み量σが第1設定値より小さくなく、あるいは、算出された歪み量σの変化量Δσの絶対値が第2設定値より小さくない場合(ステップS102でNO)は、コンピュータ22は、露光時間を変更し(ステップS106)、ステップS98からの処理を繰返す。一方、算出された歪み量σが第1設定値より小さく、かつ、算出された歪み量σの変化量Δσの絶対値が第2設定値より小さい場合(ステップS102でYES)は、コンピュータ22は、そのときの露光時間を、撮影時の露光時間に決定する(ステップS104)。このような方法によっても、歪み量σが最小値となる近傍において露光時間を決定でき、キャリブレーションボード14及びワークWの撮影を好適に行うことができる。 Alternatively, as shown in FIG. 22, the computer 22 sets the exposure time to an initial value (step S96), images the calibration board 14 (step S98), and obtains a calibration image 30 obtained by the imaging. A distortion amount σ 2 is calculated (step S100). Then, the computer 22 determines whether or not the calculated strain amount σ 2 is smaller than the first set value, and the absolute value of the calculated change amount Δσ 2 of the strain amount σ 2 is smaller than the second set value. It is determined whether or not (step S102). Then, when the calculated strain amount σ 2 is not smaller than the first set value or the absolute value of the calculated change amount Δσ 2 of the strain amount σ 2 is not smaller than the second set value (NO in step S102). The computer 22 changes the exposure time (step S106) and repeats the processing from step S98. On the other hand, when the calculated strain amount σ 2 is smaller than the first set value and the absolute value of the calculated change amount Δσ 2 of the strain amount σ 2 is smaller than the second set value (YES in step S102), The computer 22 determines the exposure time at that time as the exposure time at the time of photographing (step S104). Also by such a method, the exposure time can be determined in the vicinity where the distortion amount σ 2 becomes the minimum value, and the calibration board 14 and the workpiece W can be suitably photographed.

また、上述した実施例において、露光時間を決定する処理(図3)を、粗探索と詳細探索の2段階で行うようにし、露光時間決定処理を高速化するようにしてもよい。さらに、キャリブレーション画像30の歪み量σを評価関数とし、2分探索法やニュートン法を用いて、歪み量σが最小値となる露光時間を探索してもよい。なお、撮影画像の光量の調整は、CCDカメラ16の露光時間(露出時間)の調整に代えて、照明装置の照明強度や、CCDカメラ16の絞りや、CCDカメラ16のゲインによって調整してもよい。また、これらを組み合わせて調整してもよい。 In the above-described embodiment, the process for determining the exposure time (FIG. 3) may be performed in two stages, that is, the coarse search and the detailed search, so that the exposure time determination process can be speeded up. Further, the exposure time at which the distortion amount σ 2 becomes the minimum value may be searched using the binary search method or Newton method with the distortion amount σ 2 of the calibration image 30 as an evaluation function. The light amount of the captured image may be adjusted by adjusting the illumination intensity of the illumination device, the aperture of the CCD camera 16, and the gain of the CCD camera 16, instead of adjusting the exposure time (exposure time) of the CCD camera 16. Good. Moreover, you may adjust combining these.

さらに、上述した実施例においては、市松模様のキャリブレーションボード14を用いたが、図23に示すような格子模様のキャリブレーションボード58を用いてもよい。図23に示す格子模様のキャリブレーションボード58を用いる場合は、撮影されたキャリブレーション画像の歪み量は、上述した実施例と同様の方法で算出することができる。すなわち、垂直方向の直線の歪み量と水平方向の直線の歪み量から、撮影画像の歪み量を算出することができる。   Furthermore, in the embodiment described above, the checkerboard calibration board 14 is used, but a lattice pattern calibration board 58 as shown in FIG. 23 may be used. When the lattice-pattern calibration board 58 shown in FIG. 23 is used, the distortion amount of the captured calibration image can be calculated by the same method as in the above-described embodiment. In other words, the distortion amount of the captured image can be calculated from the distortion amount of the straight line in the vertical direction and the distortion amount of the straight line in the horizontal direction.

本明細書または図面に説明した技術要素は、単独であるいは各種の組合せによって技術的有用性を発揮するものであり、出願時の請求項記載の組合せに限定されるものではない。また、本明細書または図面に例示した技術は、複数目的を同時に達成するものであり、そのうちの一つの目的を達成すること自体で技術的有用性を持つものである。   The technical elements described in this specification or the drawings exhibit technical usefulness alone or in various combinations, and are not limited to the combinations described in the claims at the time of filing. In addition, the technology exemplified in this specification or the drawings achieves a plurality of objects at the same time, and has technical utility by achieving one of the objects.

10:形状計測装置
12:ステージ
14:キャリブレーションボード
16:CCDカメラ
18:通信線
20:ディスプレイ
22:コンピュータ
24:入力装置
10: shape measuring device 12: stage 14: calibration board 16: CCD camera 18: communication line 20: display 22: computer 24: input device

Claims (6)

ワークの形状を計測する計測装置であり、
撮影装置と、
撮影装置によって撮影される格子パターンの画像から、キャリブレーション用の基準点の位置データを算出する演算装置と、を有しており、
格子パターンは、第1方向に間隔を空けて配置されている第1直線群と、第1方向と交差する第2方向に間隔を空けて配置されている第2直線群とを有しており、
演算装置は、
撮影された格子パターンの画像から、前記第1直線群に相当する第1曲線群を抽出する第1曲線群抽出手段と、
撮影された格子パターンの画像から、前記第2直線群に相当する第2曲線群を抽出する第2曲線群抽出手段と、
抽出された第1曲線群に含まれる各第1曲線を直線に近似する第1直線近似手段と、
抽出された第2曲線群に含まれる各第2曲線を直線に近似する第2直線近似手段と、
第1直線近似手段で近似された各直線を第1方向にシフトさせて、対応する第1曲線を包含する第1領域を抽出する第1領域抽出手段と、
第2直線近似手段で近似された各直線を第2方向にシフトさせて、対応する第2曲線を包含する第2領域を抽出する第2領域抽出手段と、
第1領域抽出手段で抽出した第1領域及び第2領域抽出手段で抽出した第2領域内において、第1曲線群を構成する各曲線と第2曲線群を構成する各曲線との各交点の座標を特定して、基準点の位置データを算出する位置データ算出手段と、
を有する形状計測装置。
A measuring device that measures the shape of a workpiece,
A photographing device;
An arithmetic unit that calculates position data of a reference point for calibration from an image of a lattice pattern photographed by the photographing device;
The lattice pattern has a first straight line group that is spaced apart in the first direction and a second straight line group that is spaced apart in the second direction intersecting the first direction. ,
The arithmetic unit is
First curve group extraction means for extracting a first curve group corresponding to the first line group from the captured image of the lattice pattern;
Second curve group extraction means for extracting a second curve group corresponding to the second line group from the captured image of the lattice pattern;
First straight line approximation means for approximating each first curve included in the extracted first curve group to a straight line;
Second straight line approximation means for approximating each second curve included in the extracted second curve group to a straight line;
First area extracting means for shifting each straight line approximated by the first straight line approximating means in the first direction and extracting a first area including the corresponding first curve;
Second area extracting means for shifting each straight line approximated by the second straight line approximating means in the second direction and extracting a second area including the corresponding second curve;
In the first region extracted by the first region extracting means and the second region extracted by the second region extracting means, each intersection of each curve constituting the first curve group and each curve constituting the second curve group Position data calculating means for specifying coordinates and calculating position data of a reference point;
A shape measuring device having
位置データ算出手段は、
第1領域抽出手段で抽出された第1領域を第2方向に複数の第1分割領域に分割すると共に、第2領域抽出手段で抽出された第2領域を第1方向に複数の第2分割領域に分割し、
分割された第1分割領域のそれぞれにおいて、当該第1分割領域内に位置する第1曲線を直線に近似して第1分割直線を特定すると共に、分割された第2分割領域のそれぞれにおいて、当該第2分割領域内に位置する第2曲線を直線に近似して第2分割直線を特定し、
第1分割直線と第2分割直線の交点の座標を特定することで、基準点の位置データを算出する、請求項1に記載の形状計測装置。
The position data calculation means
The first area extracted by the first area extracting means is divided into a plurality of first divided areas in the second direction, and the second area extracted by the second area extracting means is divided into a plurality of second divided areas in the first direction. Divided into areas,
In each of the divided first divided areas, the first curve located in the first divided area is approximated to a straight line to identify the first divided line, and in each of the divided second divided areas, Approximating the second curve located in the second divided region to a straight line to identify the second divided line,
The shape measuring apparatus according to claim 1, wherein the position data of the reference point is calculated by specifying the coordinates of the intersection of the first divided line and the second divided line.
第1直線近似手段は、第1曲線をHough変換によりρ−θ平面に投影し、ρ−θ平面に投影された各点の重心を求めることで直線に近似し、
第2直線近似手段は、第2曲線をHough変換によりρ−θ平面に投影し、ρ−θ平面に投影された各点の重心を求めることで直線に近似する、請求項1又は2に記載の形状計測装置。
The first straight line approximating means projects the first curve onto the ρ-θ plane by Hough transform, approximates the straight line by obtaining the center of gravity of each point projected on the ρ-θ plane,
The second straight line approximating means projects the second curve onto the ρ-θ plane by Hough transform, and approximates the straight line by obtaining the center of gravity of each point projected on the ρ-θ plane. Shape measuring device.
第1直線近似手段は、ρ−θ平面に投影された各点を、ρ−θ平面の濃度値のn乗で重み付けした重心を求めることで直線に近似し、
第2直線近似手段は、ρ−θ平面に投影された各点を、ρ−θ平面の濃度値のn乗で重み付けした重心を求めることで直線に近似する、請求項3に記載の形状計測装置。
The first straight line approximating means approximates a straight line by obtaining a centroid obtained by weighting each point projected on the ρ-θ plane by the nth power of the density value of the ρ-θ plane,
The shape measurement according to claim 3, wherein the second straight line approximating means approximates a straight line by obtaining a center of gravity obtained by weighting each point projected on the ρ-θ plane by the nth power of the density value on the ρ-θ plane. apparatus.
第1方向に間隔を空けて配置されている複数の第1直線群と、第1方向と交差する第2方向に間隔を空けて配置されている複数の第2直線群とを有する格子パターンを撮影した画像から、キャリブレーション用の基準点の位置データを算出する方法であり、コンピュータに下記の処理、即ち、
撮影された格子パターンの画像から、第1直線群に相当する第1曲線群を抽出する第1曲線群抽出処理と、
撮影された格子パターンの画像から、第2直線群に相当する第2曲線群を抽出する第2曲線群抽出処理と、
抽出された第1曲線群に含まれる各第1曲線を直線に近似する第1直線近似処理と、
抽出された第2曲線群に含まれる各第2曲線を直線に近似する第2直線近似処理と、
第1直線近似処理で近似された各直線を第1方向にシフトさせて、対応する第1曲線を包含する第1領域を抽出する第1領域抽出処理と、
第2直線近似処理で近似された各直線を第2方向にシフトさせて、対応する第2曲線を包含する第2領域を抽出する第2領域抽出処理と、
第1領域抽出処理で抽出した第1領域及び第2領域抽出処理で抽出した第2領域内において、第1曲線群を構成する各曲線と第2曲線群を構成する各曲線との各交点の座標を特定して、基準点の位置データを算出する位置データ算出処理と、
を実行させる位置データ算出方法。
A lattice pattern having a plurality of first straight line groups arranged at intervals in the first direction and a plurality of second straight line groups arranged at intervals in a second direction intersecting the first direction. This is a method for calculating the position data of a reference point for calibration from a photographed image.
A first curve group extraction process for extracting a first curve group corresponding to the first line group from the captured image of the lattice pattern;
A second curve group extraction process for extracting a second curve group corresponding to the second line group from the photographed lattice pattern image;
A first straight line approximation process for approximating each first curve included in the extracted first curve group to a straight line;
A second straight line approximation process for approximating each second curve included in the extracted second curve group to a straight line;
A first area extraction process for shifting each straight line approximated in the first straight line approximation process in the first direction and extracting a first area including the corresponding first curve;
A second area extracting process for shifting each straight line approximated in the second straight line approximating process in the second direction and extracting a second area including the corresponding second curve;
In the first region extracted by the first region extraction processing and the second region extracted by the second region extraction processing, each intersection of each curve constituting the first curve group and each curve constituting the second curve group A position data calculation process that specifies coordinates and calculates position data of a reference point;
Position data calculation method for executing
第1方向に間隔を空けて配置されている複数の第1直線群と、第1方向と交差する第2方向に間隔を空けて配置されている複数の第2直線群とを有する格子パターンを撮影した画像から、キャリブレーション用の基準点の位置データを算出するためのプログラムであり、コンピュータに下記の処理、即ち、
撮影された格子パターンの画像から、第1直線群に相当する第1曲線群を抽出する第1曲線群抽出処理と、
撮影された格子パターンの画像から、第2直線群に相当する第2曲線群を抽出する第2曲線群抽出処理と、
抽出された第1曲線群に含まれる各第1曲線を直線に近似する第1直線近似処理と、
抽出された第2曲線群に含まれる各第2曲線を直線に近似する第2直線近似処理と、
第1直線近似処理で近似された各直線を第1方向にシフトさせて、対応する第1曲線を包含する第1領域を抽出する第1領域抽出処理と、
第2直線近似処理で近似された各直線を第2方向にシフトさせて、対応する第2曲線を包含する第2領域を抽出する第2領域抽出処理と、
第1領域抽出処理で抽出した第1領域及び第2領域抽出処理で抽出した第2領域内において、第1曲線群を構成する各曲線と第2曲線群を構成する各曲線との各交点の座標を特定して、基準点の位置データを算出する位置データ算出処理と、
を実行させるプログラム。
A lattice pattern having a plurality of first straight line groups arranged at intervals in the first direction and a plurality of second straight line groups arranged at intervals in a second direction intersecting the first direction. A program for calculating the position data of a reference point for calibration from a photographed image.
A first curve group extraction process for extracting a first curve group corresponding to the first line group from the captured image of the lattice pattern;
A second curve group extraction process for extracting a second curve group corresponding to the second line group from the photographed lattice pattern image;
A first straight line approximation process for approximating each first curve included in the extracted first curve group to a straight line;
A second straight line approximation process for approximating each second curve included in the extracted second curve group to a straight line;
A first area extraction process for shifting each straight line approximated in the first straight line approximation process in the first direction and extracting a first area including the corresponding first curve;
A second area extracting process for shifting each straight line approximated in the second straight line approximating process in the second direction and extracting a second area including the corresponding second curve;
In the first region extracted by the first region extraction processing and the second region extracted by the second region extraction processing, each intersection of each curve constituting the first curve group and each curve constituting the second curve group A position data calculation process that specifies coordinates and calculates position data of a reference point;
A program that executes
JP2012174854A 2012-08-07 2012-08-07 Shape measuring device Active JP6055228B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012174854A JP6055228B2 (en) 2012-08-07 2012-08-07 Shape measuring device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012174854A JP6055228B2 (en) 2012-08-07 2012-08-07 Shape measuring device

Publications (2)

Publication Number Publication Date
JP2014035196A true JP2014035196A (en) 2014-02-24
JP6055228B2 JP6055228B2 (en) 2016-12-27

Family

ID=50284261

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012174854A Active JP6055228B2 (en) 2012-08-07 2012-08-07 Shape measuring device

Country Status (1)

Country Link
JP (1) JP6055228B2 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017110071A1 (en) * 2015-12-25 2017-06-29 パナソニックIpマネジメント株式会社 Size measurement device, delivery box apparatus, and size measurement method
JP2017150908A (en) * 2016-02-23 2017-08-31 パナソニックIpマネジメント株式会社 Dimension measuring method
JP2017150907A (en) * 2016-02-23 2017-08-31 パナソニックIpマネジメント株式会社 Dimension measuring device
EP3352136A1 (en) 2016-11-18 2018-07-25 Panasonic Intellectual Property Management Co., Ltd. Crossing point detector, camera calibration system, crossing point detection method, camera calibration method, and recording medium
US10388030B2 (en) 2016-11-18 2019-08-20 Panasonic Intellectual Property Management Co., Ltd. Crossing point detector, camera calibration system, crossing point detection method, camera calibration method, and recording medium
CN111999314A (en) * 2020-10-28 2020-11-27 南京大量数控科技有限公司 Device and method for automatically checking deformation of flexible PCB in processing process
US10872432B2 (en) 2018-01-05 2020-12-22 Panasonic Intellectual Property Management Co., Ltd. Disparity estimation device, disparity estimation method, and program
KR102385461B1 (en) * 2021-06-21 2022-04-12 주식회사 앤트랩 Apparatus of thermal pattern, method and apparatus for thermal camera calibration

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06341821A (en) * 1993-06-01 1994-12-13 Matsushita Electric Ind Co Ltd Travel lane detector
WO1997047942A1 (en) * 1996-06-13 1997-12-18 K.U. Leuven Research & Development Method and system for acquiring a three-dimensional shape description
JP2000036037A (en) * 1998-07-16 2000-02-02 Toyota Central Res & Dev Lab Inc Travel path recognition device
JP2001349706A (en) * 2000-06-09 2001-12-21 Oojisu Soken:Kk Position detection method and device, image processing method, sheet and recording medium
JP2003157499A (en) * 2001-11-20 2003-05-30 Nissan Motor Co Ltd White road line recognizing device
JP2005250628A (en) * 2004-03-02 2005-09-15 Mitsubishi Electric Corp Pattern, device and method for camera calibration
JP2006250889A (en) * 2005-03-14 2006-09-21 Omron Corp Calibration method for 3-dimensional measurement, and 3-dimensional measurement system using the same
JP2007292619A (en) * 2006-04-25 2007-11-08 Matsushita Electric Works Ltd Image distortion correction method, and three-dimensional shape measuring instrument

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06341821A (en) * 1993-06-01 1994-12-13 Matsushita Electric Ind Co Ltd Travel lane detector
WO1997047942A1 (en) * 1996-06-13 1997-12-18 K.U. Leuven Research & Development Method and system for acquiring a three-dimensional shape description
JP2000036037A (en) * 1998-07-16 2000-02-02 Toyota Central Res & Dev Lab Inc Travel path recognition device
JP2001349706A (en) * 2000-06-09 2001-12-21 Oojisu Soken:Kk Position detection method and device, image processing method, sheet and recording medium
JP2003157499A (en) * 2001-11-20 2003-05-30 Nissan Motor Co Ltd White road line recognizing device
JP2005250628A (en) * 2004-03-02 2005-09-15 Mitsubishi Electric Corp Pattern, device and method for camera calibration
JP2006250889A (en) * 2005-03-14 2006-09-21 Omron Corp Calibration method for 3-dimensional measurement, and 3-dimensional measurement system using the same
JP2007292619A (en) * 2006-04-25 2007-11-08 Matsushita Electric Works Ltd Image distortion correction method, and three-dimensional shape measuring instrument

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10748297B2 (en) 2015-12-25 2020-08-18 Panasonic Intellectual Property Management Co., Ltd. Dimension measurement device, parcel locker system, and dimension measurement method
WO2017110071A1 (en) * 2015-12-25 2017-06-29 パナソニックIpマネジメント株式会社 Size measurement device, delivery box apparatus, and size measurement method
JP2017150908A (en) * 2016-02-23 2017-08-31 パナソニックIpマネジメント株式会社 Dimension measuring method
JP2017150907A (en) * 2016-02-23 2017-08-31 パナソニックIpマネジメント株式会社 Dimension measuring device
EP3352136A1 (en) 2016-11-18 2018-07-25 Panasonic Intellectual Property Management Co., Ltd. Crossing point detector, camera calibration system, crossing point detection method, camera calibration method, and recording medium
EP3605463A1 (en) 2016-11-18 2020-02-05 Panasonic Intellectual Property Management Co., Ltd. Crossing point detector, camera calibration system, crossing point detection method, camera calibration method, and recording medium
US10388030B2 (en) 2016-11-18 2019-08-20 Panasonic Intellectual Property Management Co., Ltd. Crossing point detector, camera calibration system, crossing point detection method, camera calibration method, and recording medium
US10885668B2 (en) 2016-11-18 2021-01-05 Panasonic Intellectual Property Management Co., Ltd. Crossing point detector, camera calibration system, crossing point detection method, camera calibration method, and recording medium
US11615552B2 (en) 2016-11-18 2023-03-28 Panasonic Intellectual Property Management Co., Ltd. Crossing point detector, camera calibration system, crossing point detection method, camera calibration method, and recording medium
US10872432B2 (en) 2018-01-05 2020-12-22 Panasonic Intellectual Property Management Co., Ltd. Disparity estimation device, disparity estimation method, and program
CN111999314A (en) * 2020-10-28 2020-11-27 南京大量数控科技有限公司 Device and method for automatically checking deformation of flexible PCB in processing process
CN111999314B (en) * 2020-10-28 2021-02-05 南京大量数控科技有限公司 Device and method for automatically checking deformation of flexible PCB in processing process
KR102385461B1 (en) * 2021-06-21 2022-04-12 주식회사 앤트랩 Apparatus of thermal pattern, method and apparatus for thermal camera calibration

Also Published As

Publication number Publication date
JP6055228B2 (en) 2016-12-27

Similar Documents

Publication Publication Date Title
JP6055228B2 (en) Shape measuring device
US10775160B2 (en) System and method for efficient surface measurement using a laser displacement sensor
US10937146B2 (en) Image evaluation method and image evaluation device
JP5699788B2 (en) Screen area detection method and system
JP4154374B2 (en) Pattern matching device and scanning electron microscope using the same
US9621793B2 (en) Information processing apparatus, method therefor, and measurement apparatus
CN108596878B (en) Image definition evaluation method
JP6115214B2 (en) Pattern processing apparatus, pattern processing method, and pattern processing program
CN106017313B (en) Edge detection deviation correction value calculation method, edge detection deviation correction method and device
JP6043735B2 (en) Image evaluation apparatus and pattern shape evaluation apparatus
JP6899189B2 (en) Systems and methods for efficiently scoring probes in images with a vision system
CN111025701B (en) Curved surface liquid crystal screen detection method
US10181202B2 (en) Control apparatus, robot, and control method
JP2009259036A (en) Image processing device, image processing method, image processing program, recording medium, and image processing system
JP6278842B2 (en) Inspection device, inspection method, and program
JP6405124B2 (en) Inspection device, inspection method, and program
JP6585793B2 (en) Inspection device, inspection method, and program
JP4801697B2 (en) Image forming method, image forming apparatus, and computer program
JP6425406B2 (en) INFORMATION PROCESSING APPARATUS, INFORMATION PROCESSING METHOD, AND PROGRAM
CN113375555A (en) Power line clamp measuring method and system based on mobile phone image
JP5945188B2 (en) Shape measuring device
CN116908185A (en) Method and device for detecting appearance defects of article, electronic equipment and storage medium
Frangione et al. Multi-step approach for automated scaling of photogrammetric micro-measurements
KR101692159B1 (en) Edge position detecting apparatus and edge position detecting method
JP2010243209A (en) Defect inspection method and defect detection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150610

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160408

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160419

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160616

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20161122

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161202

R150 Certificate of patent or registration of utility model

Ref document number: 6055228

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150