JPH07229715A - Edge position detector - Google Patents

Edge position detector

Info

Publication number
JPH07229715A
JPH07229715A JP4767194A JP4767194A JPH07229715A JP H07229715 A JPH07229715 A JP H07229715A JP 4767194 A JP4767194 A JP 4767194A JP 4767194 A JP4767194 A JP 4767194A JP H07229715 A JPH07229715 A JP H07229715A
Authority
JP
Japan
Prior art keywords
light
threshold value
edge
edge position
threshold
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
JP4767194A
Other languages
Japanese (ja)
Inventor
Morihito Hamamoto
守人 濱本
Tetsuya Kusanagi
徹也 草薙
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.)
Keyence Corp
Original Assignee
Keyence Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Keyence Corp filed Critical Keyence Corp
Priority to JP4767194A priority Critical patent/JPH07229715A/en
Publication of JPH07229715A publication Critical patent/JPH07229715A/en
Pending legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)

Abstract

PURPOSE:To reduce the detection error at edge position as a result of the variation of the level of quantity of bright and dark light for improving measuring precision by providing means for mainly detecting edges and calculating threshold value. CONSTITUTION:The edge detecting mans 5 is provided with a threshold value memory 8 to memorize threshold value Th as the reference to detect edges E1, E2. In accordance with quantity of light received by light receiving elements 11-1n, a threshold value calculating means 12 calculates the threshold value Th. When quantity of light from a light source 100 is varied, the threshold value Th is changed with the variation and so a detection error at an edge position is reduced. Instead that the threshold value Th as the reference to detect the edges E1, E2 is made always constant, the threshold value Th is calculated in accordance with quantity of light received by the receiving elements 11-1n. Therefore, when there is disturbing light or dirt on a window, or when the level of quantity of light from the light source 100 is varied, the threshold value Th can be changed with the variation and so a detection error at the edge position is reduced, resulting in more measuring precision.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、対象物に光を照射して
エッジを検出するエッジ位置検出装置に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an edge position detecting device for detecting an edge by irradiating an object with light.

【0002】[0002]

【従来の技術】従来より、一次元イメージセンサを用い
ることで、エッジの位置を検出し、このエッジ位置に基
づいて物体の寸法や物体間の間隔,位置などを測定する
寸法測定器がある。この種の測定器の一例を図6に示
す。
2. Description of the Related Art Conventionally, there is a dimension measuring instrument which detects the position of an edge by using a one-dimensional image sensor and measures the dimension of the object, the interval between the objects, and the position based on the edge position. An example of this type of measuring device is shown in FIG.

【0003】図6において、光源100は、近似的に点
光源とみなせるもので、たとえば可視レーザ光のような
レーザ光Lを出射する。レーザ光Lは、コリメータレン
ズ101を通過することで平行光L1となって、対象物
102に照射され、平行光L1の一部(透過光)が、一
次元イメージセンサ1に照射される。一次元イメージセ
ンサ1は、たとえばCCDのような受光素子11 〜1n
を多数リニアに並べたもので、光のエネルギを電気信号
に変換するものである。図示しない信号処理回路および
マイクロコンピュータ(以下、「マイコン」という)
は、各受光素子11 〜1n からの出力に基づいて、対象
物102のエッジE1 ,E2 の位置を検出し、たとえば
対象物102の寸法A、つまり、所定の2つのエッジE
1 ,E2 を基準とした寸法を測定する。
In FIG. 6, a light source 100 can be regarded approximately as a point light source and emits a laser beam L such as a visible laser beam. The laser light L becomes parallel light L1 by passing through the collimator lens 101, and is irradiated onto the object 102, and a part (transmission light) of the parallel light L1 is irradiated onto the one-dimensional image sensor 1. The one-dimensional image sensor 1 includes light receiving elements 1 1 to 1 n such as CCDs.
Are arranged in a linear fashion and convert light energy into electric signals. Signal processing circuit and microcomputer not shown (hereinafter referred to as "microcomputer")
Detects the positions of the edges E 1 and E 2 of the object 102 based on the outputs from the light receiving elements 1 1 to 1 n , for example, the dimension A of the object 102, that is, two predetermined edges E.
Measure the dimensions based on 1 and E 2 .

【0004】[0004]

【発明が解決しようとする課題】ここで、上記エッジ位
置の基準となる図7のエッジアドレスX1 ,X2 は、ま
ず、各受光素子11 〜1n (図6)が受光した光量をデ
ジタル値に変換し、図7(a)のように、予め設定した
一定の閾値と、上記デジタル値とを比較して求められ
る。上記閾値は、「明」,「暗」の間のレベルの下から
25%程度のレベルに設定するのが好ましいとされてい
る。しかし、受光素子1i が受光する光量、たとえば
「明」のレベルは、図7(a),(b)に示すように、
外乱光や窓の汚れ、光源100(図6)からの光量の変
化などに応じて変動する。そのため、破線で示すように
閾値のレベルを一定の値に固定していると、エッジアド
レスX1,X2 の位置が図7(a)と(b)とでは若干
相違し、その結果、エッジの検出位置に誤差が生じる。
Here, the edge addresses X 1 and X 2 in FIG. 7, which are the reference of the edge position, first indicate the amount of light received by each of the light receiving elements 1 1 to 1 n (FIG. 6). It is converted into a digital value, and as shown in FIG. 7A, it is obtained by comparing a preset constant threshold value with the digital value. It is said that the threshold value is preferably set to a level of about 25% from the level between "bright" and "dark". However, as shown in FIGS. 7A and 7B, the amount of light received by the light receiving element 1 i , for example, the “bright” level is
It fluctuates according to ambient light, stains on windows, changes in the amount of light from the light source 100 (FIG. 6), and the like. Therefore, when the threshold level is fixed to a constant value as shown by the broken line, the positions of the edge addresses X 1 and X 2 are slightly different between FIGS. 7A and 7B, and as a result, the edge An error occurs in the detection position of.

【0005】本発明は上記従来の課題に鑑みてなされた
もので、その目的は、明、暗の光量のレベルの変動に起
因するエッジ位置の検出誤差を小さくして、測定精度を
向上させることができるエッジ位置検出装置を提供する
ことである。
The present invention has been made in view of the above-mentioned conventional problems, and an object thereof is to reduce the detection error of the edge position caused by the fluctuation of the level of the light quantity of bright and dark and improve the measurement accuracy. It is to provide an edge position detecting device capable of performing the above.

【0006】[0006]

【課題を解決するための手段および作用】上記目的を達
成するために本発明は、受光素子が受光した光量とエッ
ジを検出する基準となる閾値に基づいてエッジの位置を
求めるエッジ検出手段と、上記受光素子が受光した光量
に基づいて上記閾値を算出する閾値算出手段とを備えて
いる。
In order to achieve the above object, the present invention provides an edge detecting means for obtaining the position of an edge based on the amount of light received by a light receiving element and a threshold value serving as a reference for detecting the edge. And a threshold value calculating means for calculating the threshold value based on the amount of light received by the light receiving element.

【0007】本発明によれば、エッジを検出する基準と
なる閾値を、受光素子が受光した光量に基づいて算出す
る。たとえば、「明」のレベルが図7(a)から(b)
のように低下した場合は、閾値を二点鎖線で示すレベル
に下げる。したがって、図7(a),(b)のように
「明」のレベルが変動しても、エッジアドレスX1 ,X
2 が変化しないから、エッジ位置の測定誤差が小さくな
る。
According to the present invention, the threshold serving as a reference for detecting an edge is calculated based on the amount of light received by the light receiving element. For example, the level of “bright” is shown in FIGS.
If it falls like the above, the threshold value is lowered to the level shown by the chain double-dashed line. Therefore, even if the "bright" level changes as shown in FIGS. 7A and 7B, the edge addresses X 1 and X
Since 2 does not change, the measurement error of the edge position becomes small.

【0008】なお、本発明においては、受光素子が受光
した光量をデジタル変換したデジタル値から、各デジタ
ル値に対するデータ数を算出するヒストグラム作成手段
を備え、上記閾値算出手段が各デジタル値に対するデー
タ数から閾値を求めるのが好ましい。
In the present invention, a histogram creating means for calculating the number of data for each digital value from the digital value obtained by digitally converting the light amount received by the light receiving element is provided, and the threshold value calculating means has the number of data for each digital value. It is preferable to obtain the threshold value from

【0009】また、上記閾値算出手段は、少なくとも
「明」におけるデータ数のピーク値を示すデジタル値に
基づいて閾値を求めるのが好ましい。
Further, it is preferable that the threshold value calculating means calculates the threshold value based on at least a digital value indicating a peak value of the number of data in "bright".

【0010】[0010]

【実施例】以下、本発明の一実施例を図面にしたがって
説明する。図1において、一次元イメージセンサ1は、
図示しないタイミング発生器から出力されるリセット信
号、スタート信号およびシフト信号によって、CCD
(受光素子)11 〜1n の配列方向に一定周期で走査を
繰り返しつつ、受光素子1iに入射した光L1の光電変
換を行う。一次元イメージセンサ1からの出力は、サン
プルホールド回路2を介して、A/Dコンバータ3に入
力される。A/Dコンバータ3は、受光素子1i 〜1n
が受光した光量をデジタル値Dに変換し、このデジタル
値Dを、光量データメモリ4およびエッジ検出手段(回
路)5に出力する。上記光量データメモリ4には、図2
(a)に示すように、受光素子のアドレスに対応してデ
ジタル値(光量)が記憶される。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. In FIG. 1, the one-dimensional image sensor 1 is
A CCD is generated by a reset signal, a start signal and a shift signal output from a timing generator (not shown).
(Light receiving element) The photoelectric conversion of the light L1 incident on the light receiving element 1 i is performed while repeating scanning in a fixed cycle in the array direction of 1 1 to 1 n . The output from the one-dimensional image sensor 1 is input to the A / D converter 3 via the sample hold circuit 2. The A / D converter 3 includes light receiving elements 1 i to 1 n.
The amount of light received by is converted into a digital value D, and this digital value D is output to the light amount data memory 4 and the edge detection means (circuit) 5. The light amount data memory 4 has a structure shown in FIG.
As shown in (a), a digital value (light quantity) is stored corresponding to the address of the light receiving element.

【0011】図1の上記エッジ検出手段5は、デジタル
コンパレータ6および閾値メモリ8を備えている。上記
閾値メモリ8には、エッジE1 ,E2 を検出する基準と
なる閾値Thが記憶されており、上記デジタルコンパレ
ータ6が上記閾値Thを閾値メモリ8から読み出して、
デジタル値Dと上記閾値Thとを比較して2値化する。
つまり、デジタルコンパレータ6は、受光素子11 〜1
n が受光した図4(a)の光量と、閾値Thとを比較し
て破線で示す閾値Thよりも上のレベルを「明」とし、
下のレベルを「暗」とする。図1の上記エッジ検出手段
5は、i番目のアドレスと(i+1)番目のアドレスの
2値化情報(明または暗の情報)を次々と比較し、両ア
ドレスの情報が変化した位置にエッジ(明暗の境界)E
i が存在すると判定し、そのエッジEi のアドレスXi
をエッジアドレスメモリ7に記憶させる。
The edge detecting means 5 in FIG. 1 comprises a digital comparator 6 and a threshold memory 8. The threshold memory 8 stores a threshold Th that serves as a reference for detecting the edges E 1 and E 2 , and the digital comparator 6 reads the threshold Th from the threshold memory 8,
The digital value D and the threshold value Th are compared and binarized.
That is, the digital comparator 6 includes the light receiving elements 1 1 to 1 1.
The amount of light received by n in FIG. 4A is compared with the threshold Th, and the level above the threshold Th indicated by the broken line is set to "bright",
The lower level is "dark". The edge detecting means 5 of FIG. 1 successively compares the binarized information (bright or dark information) of the i-th address and the (i + 1) -th address, and detects the edge ( The boundary between light and dark) E
It is determined that i exists, and the address X i of the edge E i is determined.
Are stored in the edge address memory 7.

【0012】また、上記A/Dコンバータ3からのデジ
タル値Dは、ヒストグラム作成手段30に出力される。
ヒストグラム作成手段30は、図2(b)のように、各
デジタル値Dに対応する光量を受光した受光素子の数
(データ数)を算出して、図4(b)のヒストグラムを
作成するもので、図1のヒストグラムメモリ31、ワン
インクリメントアダー32およびラッチ回路33を備え
ている。なお、上記ヒストグラム作成手段30は、後述
する図3のフローチャートに従ってヒストグラムを作成
する。また、以上の構成からなる信号処理回路におい
て、種々のアンプは、その図示および説明を省略してい
る。
The digital value D from the A / D converter 3 is output to the histogram creating means 30.
As shown in FIG. 2B, the histogram creating means 30 creates the histogram of FIG. 4B by calculating the number of light receiving elements (the number of data) that have received the light amount corresponding to each digital value D. The histogram memory 31, the one increment adder 32, and the latch circuit 33 of FIG. 1 are provided. The histogram creating means 30 creates a histogram according to the flowchart of FIG. 3 described later. Further, in the signal processing circuit configured as described above, illustration and description of various amplifiers are omitted.

【0013】図1の上記光量データメモリ4、エッジア
ドレスメモリ7およびヒストグラムメモリ31の情報
は、CPU10によって読み出される。上記CPU10
は、寸法算出手段11、閾値算出手段12およびピーク
位置算出手段13を備えている。
Information of the light amount data memory 4, the edge address memory 7 and the histogram memory 31 of FIG. 1 is read by the CPU 10. CPU 10
Includes a dimension calculation means 11, a threshold value calculation means 12, and a peak position calculation means 13.

【0014】上記寸法算出手段11は、エッジアドレス
メモリ7から寸法測定の基準となるエッジアドレス
2 ,X1 を読み出し、下記の(1)式に従って、たと
えば対象物102の寸法Aを算出する。 A=(X2 −X1 )・P …(1) 但し、P:受光素子のピッチ
The dimension calculating means 11 reads the edge addresses X 2 and X 1 which are the reference for dimension measurement from the edge address memory 7 and calculates the dimension A of the object 102, for example, according to the following equation (1). A = (X 2 −X 1 ) · P (1) where P is the pitch of the light receiving elements

【0015】上記ピーク位置算出手段13は、図2
(b)のヒストグラムメモリ31の各アドレスから受光
素子の数Mを読み出して、「明」および「暗」の領域に
おいて受光素子の数Mが最も多いアドレス、つまり、図
4(b)の「明」および「暗」において受光素子数Mが
ピークとなるデジタル値(ピーク位置)DP1,DP2を求
める。
The peak position calculating means 13 is shown in FIG.
The number M of light-receiving elements is read from each address of the histogram memory 31 in (b), and the address having the largest number M of light-receiving elements in the “bright” and “dark” regions, that is, “bright” in FIG. 4B. , And “dark”, digital values (peak positions) D P1 and D P2 at which the number M of light receiving elements reaches a peak are obtained.

【0016】図1の上記閾値算出手段12は、一次元イ
メージセンサ1のたとえば一走査ごとに、上記2つのピ
ーク位置DP1,DP2から、下記の(2)式に従って閾値
Thを求める。 Th=DP2+(DP1−DP2)/4 …(2) こうして、閾値算出手段12は、受光素子11 〜1n
受光した光量に基づいて閾値Thを算出し、この算出し
た閾値Thを、前述の閾値メモリ8に書き込む。したが
って、閾値Thは、一次元イメージセンサ1が一回走査
されるごとに、書き換えられる。
The threshold value calculating means 12 of FIG. 1 obtains a threshold value Th from the above two peak positions D P1 and D P2 according to the following equation (2) for each scan of the one-dimensional image sensor 1, for example. Th = D P2 + (D P1 −D P2 ) / 4 (2) Thus, the threshold value calculation means 12 calculates the threshold value Th based on the amount of light received by the light receiving elements 1 1 to 1 n, and the calculated threshold value Th. Th is written in the threshold memory 8 described above. Therefore, the threshold Th is rewritten each time the one-dimensional image sensor 1 is scanned.

【0017】つぎに、前述のヒストグラムの作成方法に
ついて、図3のフローチャートを用いて説明する。ま
ず、ステップS1において、図1のヒストグラム作成手
段30が、ヒストグラムメモリ31のデータをクリアし
た後、図3のステップS2に進む。ステップS2では、
A/Dコンバータ3(図1)のデジタル値Dに相当する
図2(b)のアドレスを検索し、ステップS3(図3)
に進んで、当該アドレスのデータ(受光素子数)aを読
み出す。つづいて、ステップS4(図3)に進んで、図
1のワンインクリメントアダー32にデータaが入力さ
れ、ステップS5(図3)において、ワンインクリメン
トアダー32が(a+1)をラッチ回路33に出力す
る。ラッチ回路33は、ステップS6(図3)において
(a+1)を微小時間保持し、ステップS7に進んで、
ヒストグラムメモリ31に(a+1)を書き込み、図3
のステップS8に移行する。ステップS8では、図1の
一次元イメージセンサ1の一走査が終了したか否かが判
断され、一走査が終了していなければ、図3のステップ
S2に戻り、一方、終了していれば、ステップS9に進
んで、ヒストグラムの作成が完了する。
Next, a method of creating the above-mentioned histogram will be described with reference to the flowchart of FIG. First, in step S1, the histogram creating means 30 in FIG. 1 clears the data in the histogram memory 31, and then the process proceeds to step S2 in FIG. In step S2,
The address of FIG. 2B corresponding to the digital value D of the A / D converter 3 (FIG. 1) is searched, and step S3 (FIG. 3) is searched.
Then, the process proceeds to step 1 to read the data (the number of light receiving elements) a of the address. Subsequently, the process proceeds to step S4 (FIG. 3), the data a is input to the one-increment adder 32 of FIG. 1, and the one-increment adder 32 outputs (a + 1) to the latch circuit 33 in step S5 (FIG. 3). . The latch circuit 33 holds (a + 1) for a minute time in step S6 (FIG. 3), proceeds to step S7,
Write (a + 1) in the histogram memory 31 and
Then, the process proceeds to step S8. In step S8, it is determined whether or not one scan of the one-dimensional image sensor 1 of FIG. 1 is completed. If one scan is not completed, the process returns to step S2 of FIG. 3, while if it is completed, Proceeding to step S9, the creation of the histogram is completed.

【0018】なお、その他の構成は、図6の従来例と同
様であり、同一部分または相当部分に同一符号を付し
て、その説明を省略する。
The other structure is the same as that of the conventional example shown in FIG. 6, and the same portions or corresponding portions are designated by the same reference numerals and the description thereof will be omitted.

【0019】つぎに、エッジアドレスX1 ,X2 の検出
方法について説明する。図1において、たとえば対象物
102が矢印B方向から移送されてくると、光源100
からレーザ光L1が一次元イメージセンサ1に照射さ
れ、一次元イメージセンサ1が一定周期で走査を繰り返
す。この一走査ごとに、A/Dコンバータ3からデジタ
ル値Dが光量データメモリ4、エッジ検出手段5および
ヒストグラム作成手段30に出力される。この出力で、
ヒストグラム作成手段30が前述の方法でヒストグラム
(図2(b))を作成し、ピーク位置算出手段13がヒ
ストグラムメモリ31から受光素子数Mを読み出し、ピ
ーク位置DP1,DP2を算出する。この算出後、ピーク位
置DP1,DP2に基づいて、閾値算出手段12により図4
(a)の閾値Thが算出され、閾値Thが図1の閾値メ
モリ8に入力されて書き換えられる。
Next, a method of detecting the edge addresses X 1 and X 2 will be described. In FIG. 1, for example, when an object 102 is transferred in the direction of arrow B, the light source 100
The laser beam L1 is emitted to the one-dimensional image sensor 1, and the one-dimensional image sensor 1 repeats scanning at a constant cycle. The digital value D is output from the A / D converter 3 to the light amount data memory 4, the edge detecting means 5, and the histogram creating means 30 for each scan. With this output,
The histogram creating means 30 creates a histogram (FIG. 2B) by the method described above, and the peak position calculating means 13 reads the number M of light receiving elements from the histogram memory 31 and calculates the peak positions D P1 and D P2 . After this calculation, based on the peak positions D P1 and D P2 , the threshold value calculation means 12 calculates the value shown in FIG.
The threshold value Th in (a) is calculated, and the threshold value Th is input to the threshold value memory 8 in FIG. 1 and rewritten.

【0020】デジタルコンパレータ6は、この書き換え
られた閾値Thと、次の走査の際に入力されたデジタル
値Dとを比較し、デジタル値Dを2値化する。この2値
化後、エッジ検出手段5は、2値化信号が変化した位置
にエッジがあると判断し、エッジアドレスメモリ7にエ
ッジアドレスXi を記憶させる。寸法算出手段11は、
エッジアドレスXi に基づいて、対象物102の寸法A
を算出し、対象物102が所定の測定位置まで搬送され
てきた際に算出した寸法Aを表示器(図示せず)などに
出力する。
The digital comparator 6 compares the rewritten threshold value Th with the digital value D input in the next scanning, and binarizes the digital value D. After the binarization, the edge detection means 5 determines that the edge is at the position where the binarized signal changes, and stores the edge address X i in the edge address memory 7. The dimension calculation means 11 is
The dimension A of the object 102 based on the edge address X i
Is calculated and the dimension A calculated when the object 102 is conveyed to a predetermined measurement position is output to a display (not shown) or the like.

【0021】ここで、図4(a)の閾値Thは、
「明」、「暗」の間のレベルの下から25%程度のレベ
ルに設定するのが好ましい。したがって、図7(a)か
ら(b)のように、たとえば、「明」のレベルが変動す
れば、閾値Thのレベルも、二点鎖線で示すように変化
させる必要がある。
Here, the threshold Th in FIG. 4A is
It is preferable to set a level of about 25% from the level between "bright" and "dark". Therefore, as shown in FIGS. 7A to 7B, for example, when the level of “bright” changes, the level of the threshold Th also needs to be changed as shown by the chain double-dashed line.

【0022】これに対し、本寸法測定器では、図1の受
光素子11 〜1n が受光した光量に基づいて、閾値算出
手段12が図4(a)の閾値Thを算出する。したがっ
て、図1の光源100からの光量が変動した場合などに
は、その変動に応じて、閾値Thを変化させるので、エ
ッジ位置の検出誤差が小さくなる。その結果、寸法測定
の精度が向上する。
On the other hand, in this dimension measuring device, the threshold value calculating means 12 calculates the threshold value Th in FIG. 4A based on the amount of light received by the light receiving elements 1 1 to 1 n in FIG. Therefore, when the amount of light from the light source 100 in FIG. 1 fluctuates, the threshold Th is changed in accordance with the fluctuation, so that the edge position detection error is reduced. As a result, the accuracy of dimension measurement is improved.

【0023】ところで、上記実施例では、閾値Thを、
一次元イメージセンサ1の一走査ごとに算出したが、本
発明では、複数回の走査ごとに閾値Thを算出してもよ
い。また、対象物102が図1に示す測定位置に到着す
る直前回の走査においてのみ閾値Thを算出してもよ
い。あるいは、一走査ごとに閾値Thを算出し、複数個
の過去の閾値Thを記憶して、その平均値ThAVE を算
出して、この平均値ThAVE に基づいて2値化を行って
もよい。
By the way, in the above embodiment, the threshold Th is
Although the calculation is performed for each scan of the one-dimensional image sensor 1, the threshold Th may be calculated for each of a plurality of scans in the present invention. The threshold Th may be calculated only in the scan immediately before the object 102 arrives at the measurement position shown in FIG. Alternatively, the threshold Th may be calculated for each scanning, a plurality of past thresholds Th may be stored, the average value Th AVE may be calculated, and binarization may be performed based on the average value Th AVE. .

【0024】ところで、上記実施例では、図4(a)の
ヒストグラムを作成して、閾値Thを求めたが、本発明
では必ずしもヒストグラムを作成する必要はない。たと
えば、図4(a)の「明」および「暗」における中心C
1,C2,C3を求め、その前後の多数の受光素子1i
の光量の平均値DAVE から、「明」および「暗」のレベ
ルを検出し、この検出値に基づいて閾値Thを算出して
もよい。
By the way, in the above-mentioned embodiment, the threshold value Th is obtained by making the histogram of FIG. 4A, but the present invention does not necessarily need to make the histogram. For example, the center C in “bright” and “dark” in FIG.
1, C2, C3 are obtained, and a large number of light receiving elements 1 i before and after that are obtained.
It is also possible to detect the levels of “bright” and “dark” from the average value D AVE of the light amount and calculate the threshold Th based on the detected values.

【0025】しかし、かかる方法では、一般に、その算
出が面倒であるうえ、正確さに欠けるおそれがあるの
で、本実施例のように、ヒストグラムを作成し、そのピ
ーク位置DP1,DP2から閾値Thを求めるのが好まし
い。
However, in such a method, the calculation is generally troublesome and the accuracy may be lacking. Therefore, as in the present embodiment, a histogram is prepared and the threshold values are calculated from the peak positions D P1 and D P2. It is preferable to determine Th.

【0026】また、本実施例では、「明」および「暗」
の両方のピーク位置DP1,DP2を求めたが、必ずしも両
方のピーク位置DP1,DP2を求める必要はなく、一方の
ピーク値を求めたのでもよい。たとえば、外乱光の入射
するおそれのない場所では、「暗」のレベルが安定して
いる場合があり、このような場合には、「暗」のレベル
が一定値であるとみなし、「明」のピーク位置DP1のみ
を求めて、閾値Thを算出してもよい。
Further, in this embodiment, "bright" and "dark"
Both peak positions D P1 and D P2 are obtained, but it is not always necessary to obtain both peak positions D P1 and D P2 , and one peak value may be obtained. For example, the "dark" level may be stable in a place where ambient light is not likely to enter, and in such a case, the "dark" level is considered to be a constant value and the "bright" level is considered to be constant. The threshold value Th may be calculated by obtaining only the peak position D P1 of

【0027】ところで、図1の光源100としてレーザ
を用いた場合は、対象物102のエッジE1 ,E2 で回
折したレーザ光L1が干渉を起こす。そのため、一次元
イメージセンサ1の受光波形は、図5(a)のように乱
れ、図5(b)のように、「明」のレベルの範囲に広が
りが生じる。ここで、本実施例では、ヒストグラムから
ピーク位置DP1を求めるので、「明」のレベルを正確に
求めることができる。したがって、エッジ位置をより一
層正確に求めることができる。
When a laser is used as the light source 100 in FIG. 1, the laser light L1 diffracted by the edges E 1 and E 2 of the object 102 causes interference. Therefore, the received light waveform of the one-dimensional image sensor 1 is disturbed as shown in FIG. 5A and spreads in the range of “bright” level as shown in FIG. 5B. Here, in this embodiment, since the peak position D P1 is obtained from the histogram, the “bright” level can be obtained accurately. Therefore, the edge position can be obtained more accurately.

【0028】なお、本発明は、細いレーザ光または線状
のレーザ光を、ガルバノミラーやポリゴンミラーでスキ
ャンさせ、時間から影の寸法を測定する走査型の寸法測
定器についても適用し得る。
The present invention can also be applied to a scanning type size measuring device for measuring the size of a shadow from time by scanning a thin laser beam or a linear laser beam with a galvano mirror or a polygon mirror.

【0029】また、上記実施例では透過型のエッジ位置
検出装置について説明したが、本発明は対象物からの反
射光を一次元イメージセンサに受光させる反射型のエッ
ジ位置検出装置についても適用し得る。また、対象物間
の距離や位置だけでなく、対象物における特定の部分の
寸法測定についても適用し得ることはいうまでもない。
さらに、受光素子としてはCCDに限らずCPDなどで
もよく、また、図1のエッジ検出手段5やヒストグラム
作成手段30などからなる信号処理回路をマイコンで構
成してもよい。逆に、CPU10の閾値算出手段12や
ピーク位置算出手段13を信号処理回路で構成してもよ
い。
Further, although the transmission type edge position detecting device has been described in the above embodiment, the present invention can be applied to a reflection type edge position detecting device in which reflected light from an object is received by a one-dimensional image sensor. . Further, it goes without saying that the present invention can be applied not only to the distance and position between objects but also to the dimension measurement of a specific portion of the object.
Further, the light receiving element is not limited to CCD but may be CPD or the like, and the signal processing circuit including the edge detecting means 5 and the histogram creating means 30 in FIG. On the contrary, the threshold value calculation means 12 and the peak position calculation means 13 of the CPU 10 may be configured by a signal processing circuit.

【0030】[0030]

【発明の効果】以上説明したように、本発明によれば、
エッジを検出する基準となる閾値を、常に一定値とする
のではなく、受光素子が受光した光量に基づいて、上記
閾値を算出するので、外乱光や窓の汚れ、あるいは、光
源からの光量のレベルが変動した場合には、その変動に
応じて閾値を変化させることができるから、エッジ位置
の検出誤差が小さくなる。したがって、測定精度が向上
する。
As described above, according to the present invention,
The threshold value that is the reference for detecting edges is not always set to a constant value, but the threshold value is calculated based on the amount of light received by the light receiving element.Therefore, ambient light, window stains, or the amount of light from the light source When the level changes, the threshold value can be changed according to the change, so that the detection error of the edge position becomes small. Therefore, the measurement accuracy is improved.

【0031】また、請求項2の発明のように、ヒストグ
ラムを作成すれば、上記閾値の算出が容易になる。
If a histogram is created as in the second aspect of the invention, the threshold value can be calculated easily.

【0032】さらに、請求項3の発明のように、少なく
とも、「明」におけるピーク値を示すデジタル値に基づ
いて閾値を算出すれば、干渉による受光波形の乱れがあ
っても、閾値を精度良く求めることができるから、エッ
ジ位置の検出誤差が小さくなる。
Further, as in the third aspect of the present invention, if the threshold value is calculated based on at least the digital value indicating the peak value in "bright", the threshold value can be accurately set even if the received light waveform is disturbed by interference. Since it can be obtained, the detection error of the edge position becomes small.

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

【図1】本発明の一実施例にかかる寸法測定器の概略構
成図である。
FIG. 1 is a schematic configuration diagram of a dimension measuring device according to an embodiment of the present invention.

【図2】光量データメモリおよびヒストグラムメモリの
メモリマップを示す概念図である。
FIG. 2 is a conceptual diagram showing a memory map of a light amount data memory and a histogram memory.

【図3】ヒストグラム作成手段の動作を示すフローチャ
ートである。
FIG. 3 is a flowchart showing an operation of a histogram creating means.

【図4】エッジの検出方法を示す概念図である。FIG. 4 is a conceptual diagram showing an edge detection method.

【図5】同じく、エッジの検出方法を示す概念図であ
る。
FIG. 5 is a conceptual diagram similarly showing an edge detection method.

【図6】一般的な寸法測定器の概略構成図である。FIG. 6 is a schematic configuration diagram of a general dimension measuring device.

【図7】従来のエッジ検出の方法を示す概念図である。FIG. 7 is a conceptual diagram showing a conventional edge detection method.

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

1:一次元イメージセンサ 12:閾値算出手段 13:ピーク位置算出手段 5:エッジ検出手段 30:ヒストグラム作成手段 102:対象物 D:デジタル値 Th:閾値 DP1,DP2:ピーク位置1: One-dimensional image sensor 12: Threshold calculation means 13: Peak position calculation means 5: Edge detection means 30: Histogram creation means 102: Object D: Digital value Th: Threshold values D P1 , D P2 : Peak position

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 対象物に光を照射し、その透過光または
反射光を受光素子に受光させて、受光素子からの出力に
基づいてエッジの位置を検出するエッジ位置検出装置で
あって、 上記受光素子が受光した光量と、エッジを検出する基準
となる閾値に基づいてエッジの位置を求めるエッジ検出
手段と、 上記受光素子が受光した光量に基づいて上記閾値を算出
する閾値算出手段とを備えたエッジ位置検出装置。
1. An edge position detecting device, which irradiates an object with light, causes the light-receiving element to receive the transmitted light or reflected light, and detects the edge position based on the output from the light-receiving element. An edge detection unit that obtains the position of the edge based on the light amount received by the light receiving element and a threshold value that serves as a reference for detecting the edge, and a threshold value calculation unit that calculates the threshold value based on the light amount received by the light receiving element. Edge position detector.
【請求項2】 請求項1において、上記受光素子が受光
した光量をデジタル変換したデジタル値から、各デジタ
ル値に対するデータ数を算出するヒストグラム作成手段
を備え、上記閾値算出手段が上記各デジタル値に対する
データ数から上記閾値を求めることを特徴とするエッジ
位置検出装置。
2. The method according to claim 1, further comprising a histogram creating means for calculating the number of data for each digital value from a digital value obtained by digitally converting the amount of light received by the light receiving element, and the threshold value calculating means for each digital value. An edge position detecting device, characterized in that the threshold value is obtained from the number of data.
【請求項3】 請求項2において、上記閾値算出手段
は、少なくとも「明」におけるデータ数がピークとなる
上記デジタル値に基づいて上記閾値を求めることを特徴
とするエッジ位置検出装置。
3. The edge position detecting device according to claim 2, wherein the threshold value calculating unit calculates the threshold value based on the digital value at which the number of data in “bright” has a peak.
JP4767194A 1994-02-21 1994-02-21 Edge position detector Pending JPH07229715A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4767194A JPH07229715A (en) 1994-02-21 1994-02-21 Edge position detector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4767194A JPH07229715A (en) 1994-02-21 1994-02-21 Edge position detector

Publications (1)

Publication Number Publication Date
JPH07229715A true JPH07229715A (en) 1995-08-29

Family

ID=12781736

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4767194A Pending JPH07229715A (en) 1994-02-21 1994-02-21 Edge position detector

Country Status (1)

Country Link
JP (1) JPH07229715A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190088386A (en) * 2018-01-18 2019-07-26 오므론 가부시키가이샤 Optical measurement apparatus and optical measurement method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190088386A (en) * 2018-01-18 2019-07-26 오므론 가부시키가이샤 Optical measurement apparatus and optical measurement method
CN110058249A (en) * 2018-01-18 2019-07-26 欧姆龙株式会社 Optical measuring device and measuring method
US11194047B2 (en) 2018-01-18 2021-12-07 Omron Corporation Optical measurement device and optical measurement method
CN110058249B (en) * 2018-01-18 2023-09-15 欧姆龙株式会社 Optical measurement device and optical measurement method

Similar Documents

Publication Publication Date Title
EP0118199B1 (en) An apparatus for measuring carrier lifetimes in a semiconductor
US4983827A (en) Linescan apparatus for detecting salient pattern of a product
JP4215220B2 (en) Surface inspection method and surface inspection apparatus
EP0008010B1 (en) Method of detecting flaws on surfaces
EP0921491A1 (en) Method of estimating the mid-points of bar code elements"
JPH07229715A (en) Edge position detector
JPH08247726A (en) Dimension measuring instrument
KR100310259B1 (en) Method and apparatus for checking shape
JPH05322562A (en) Electronic level and level rod therefor
JPH08247722A (en) Dimension measuring instrument
KR920004214B1 (en) Optical type displacement testing apparatus
US6976630B2 (en) Bar-code reader, method of reading a bar code, and computer product
JPS61225604A (en) Dimension measurement apparatus
JP3454905B2 (en) Measuring device positioning device
JP3650945B2 (en) Outside diameter measuring device
JPH07208933A (en) Measuring equipment of dimension
EP1258701B1 (en) A process for reading fractions of an interval between contiguous photo-sensitive elements in a linear optical sensor
JP2821047B2 (en) Setting method of binarization threshold
JP3085341B2 (en) Outline measuring device and method of arranging object to be measured
JPH09210639A (en) Outer diameter measuring device
JP3123324B2 (en) Image binarization processing device
JPH0724256B2 (en) Size measuring device
JPH10227617A (en) Mocroline width measuring method and apparatus
JPS60243778A (en) Character reader
JPH047091B2 (en)