JPH0623643B2 - Edge position detector - Google Patents
Edge position detectorInfo
- Publication number
- JPH0623643B2 JPH0623643B2 JP60158423A JP15842385A JPH0623643B2 JP H0623643 B2 JPH0623643 B2 JP H0623643B2 JP 60158423 A JP60158423 A JP 60158423A JP 15842385 A JP15842385 A JP 15842385A JP H0623643 B2 JPH0623643 B2 JP H0623643B2
- Authority
- JP
- Japan
- Prior art keywords
- edge
- threshold value
- output
- stored
- line sensor
- 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.)
- Expired - Lifetime
Links
- 238000003708 edge detection Methods 0.000 claims description 5
- 230000010354 integration Effects 0.000 claims description 4
- 230000004069 differentiation Effects 0.000 claims 2
- 101100444142 Neurospora crassa (strain ATCC 24698 / 74-OR23-1A / CBS 708.71 / DSM 1257 / FGSC 987) dut-1 gene Proteins 0.000 description 6
- 238000006243 chemical reaction Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 238000012935 Averaging Methods 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000000034 method Methods 0.000 description 1
- 238000012634 optical imaging Methods 0.000 description 1
Landscapes
- Length Measuring Devices By Optical Means (AREA)
- Character Input (AREA)
- Image Analysis (AREA)
Description
【発明の詳細な説明】 (産業上の利用分野) 本発明は物体のエッジ(端縁部)の正確な位置を光学的
に検出するエッジ位置検出装置に関する。Description: TECHNICAL FIELD The present invention relates to an edge position detecting device that optically detects an accurate position of an edge (edge portion) of an object.
(従来の技術) 一般に、物体の光学的撮像からそのエッジの位置を知る
要求が高く、多くの技術分野で組立工程、あるいは作業
の自動化などに利用されている。(Prior Art) Generally, there is a strong demand for knowing the position of an edge of an object from optical imaging, and it is used in many technical fields for an assembly process or automation of work.
第3図はそのような光学的なエッジ検出装置の従来の構
成を示す図である。1はエッジを検出しようとする被測
定物で、光源から照射された光を被測定物が反射する
と、その反射光はCCDなどのラインセンサ2によって
感知,撮像されて、その出力はマルチプレクサ(以下、
MPXという)3によりマルチプレクスされた上、サン
プルホールド(以下、S/Hという)回路4によりサン
プルホールドされて、アナログデジタル(以下、A/D
という)変換回路5に加えられ、ラインセンサ2の出力
がデジタル変換される。すなわち、被測定物1のエッジ
の検出情報を含むラインセンサ2の出力は、デジタル信
号として取り出される。以下、このデジタル信号をライ
ンセンサ2の出力(またはデジタル出力)という。FIG. 3 is a diagram showing a conventional configuration of such an optical edge detecting device. Reference numeral 1 denotes an object to be detected whose edge is to be detected. When the object to be measured reflects light emitted from a light source, the reflected light is sensed and imaged by a line sensor 2 such as a CCD, and its output is a multiplexer (hereinafter ,
After being multiplexed by an MPX 3 and sample-held by a sample-hold (hereinafter referred to as S / H) circuit 4, analog-digital (hereinafter referred to as A / D)
The output of the line sensor 2 is digitally converted. That is, the output of the line sensor 2 including the detection information of the edge of the DUT 1 is taken out as a digital signal. Hereinafter, this digital signal is referred to as the output (or digital output) of the line sensor 2.
さて、ラインセンサ2のデジタル出力は、減算器6に印
加されるとともに、第1のメモリ7に1フレームごと記
憶される。8は第2のメモリで、これには被測定物1が
存在しないときのラインセンサ2の出力(バックグラン
ド信号という)が予め記憶されており、その出力が減算
器6に印加されて、ラインセンサ2のデジタル信号から
減算される。したがって、減算器6の出力は被測定物1
のバックグランド信号が差し引された被測定物1のみの
完全なエッジ情報を含む信号で、それは第3のメモリ9
に記憶される。10は平均化回路で、1フレーム分のライ
ンセンサ2の総デジタル出力を、1フレーム分のビット
数で除算して平均値を算出する。11は演算器で、ある一
定値を平均化回路10の出力に加減乗除して、エッジ検出
のためのしきい値を演算している。12は比較器で、第3
のメモリ9の出力信号と演算器11のしきい値出力とを比
較し、その出力を用いてラインセンサ2のデジタル出力
と走査位置を対応させて、エッジ位置の検出を行ってい
る。13はマイクロコンピュータ(以下、CPUという)
で、比較器12の出力から被測定物1のエッジの位置を算
出している。14はデータバスである。The digital output of the line sensor 2 is applied to the subtractor 6 and stored in the first memory 7 for each frame. Reference numeral 8 denotes a second memory in which an output of the line sensor 2 (referred to as a background signal) when the device under test 1 does not exist is stored in advance, and the output is applied to the subtractor 6 to generate a line. It is subtracted from the digital signal of the sensor 2. Therefore, the output of the subtractor 6 is the DUT 1
Is a signal containing the complete edge information of only the DUT 1 whose background signal has been subtracted, which is the third memory 9
Memorized in. An averaging circuit 10 divides the total digital output of the line sensor 2 for one frame by the number of bits for one frame to calculate an average value. Reference numeral 11 denotes an arithmetic unit that calculates a threshold value for edge detection by adding, subtracting, multiplying, and dividing a certain fixed value to the output of the averaging circuit 10. 12 is a comparator, the third
The output signal of the memory 9 is compared with the threshold output of the arithmetic unit 11, and the output is used to correspond the digital output of the line sensor 2 to the scanning position to detect the edge position. 13 is a microcomputer (hereinafter referred to as CPU)
Then, the position of the edge of the DUT 1 is calculated from the output of the comparator 12. 14 is a data bus.
第4図は上述した第3図の構成によるエッジ検出の結果
を示すもので、aは減算器6の出力で、バックグランド
信号を差し引いたラインセンサ2の出力である。bは演
算器11の出力のしきい値である。したがって、被測定物
1の検出したエッジ位置は、出力がしきい値bを超えた
ビット位置m1になる。FIG. 4 shows the result of edge detection by the configuration of FIG. 3 described above, where a is the output of the subtracter 6, which is the output of the line sensor 2 after subtracting the background signal. b is a threshold value of the output of the calculator 11. Therefore, the edge position detected by the DUT 1 becomes the bit position m 1 at which the output exceeds the threshold value b.
(発明が解決しようとする問題点) しかしながら、従来の光学的エッジ検出装置では、一定
のしきい値を超えたか否かでエッジ位置を判断するた
め、被測定物1のエッジの断面が湾曲した球面のような
ものである場合には、検出したエッジ位置が正確さを欠
くという問題点を有していた。すなわち、第5図に示す
ように正しいエッジ位置がビット位置m3であるにもかか
わらず、エッジの断面が緩やかに変化するため、デジタ
ル出力が緩やかに増加し、しきい値bを超えるビット位
置m2をエッジ位置として検出することとなる。(Problems to be Solved by the Invention) However, in the conventional optical edge detection device, since the edge position is determined by whether or not a certain threshold is exceeded, the cross section of the edge of the DUT 1 is curved. In the case of a spherical surface, there is a problem that the detected edge position lacks accuracy. That is, as shown in FIG. 5, although the correct edge position is the bit position m 3 , the cross section of the edge changes gently, so that the digital output gradually increases and exceeds the threshold value b. m 2 is detected as the edge position.
本発明は、このような従来装置の問題点を排除した優れ
た光学的エッジ位置検出装置の提供を目的としたもので
ある。The present invention aims to provide an excellent optical edge position detecting device which eliminates the problems of the conventional device.
(問題点を解決するための手段) 本発明は、上記の目的を達成するために、第3図の構成
に加え、微分器及び積分器を備えたものであり、この微
分器により、ラインセンサのデジタル出力の隣合うビッ
トの差分をとり、その差分の正負を判断し、この差分が
正の値をとるとき、一時的にそのビット位置Pを記憶
し、負の値をとるとき、積分器によりその差分値を積分
し、この積分値が一定の第1のしきい値に達したか否か
を判断し、第1のしきい値に達していない場合には、記
憶を解除し、第1のしきい値に達した場合には、さらに
ビット位置を変えて積分を行い、この積分値が第1のし
きい値より大きい第2のしきい値に達した場合に、ビッ
ト位置Pをエッジ位置と決定するものである。(Means for Solving the Problems) In order to achieve the above object, the present invention is provided with a differentiator and an integrator in addition to the configuration of FIG. The difference between adjacent bits of the digital output is taken, and whether the difference is positive or negative is judged. When this difference takes a positive value, the bit position P is temporarily stored, and when it takes a negative value, an integrator is taken. The difference value is integrated by, and it is determined whether or not the integrated value has reached a constant first threshold value. If the integrated value has not reached the first threshold value, the memory is canceled and the When the threshold value of 1 is reached, the bit position is further changed and integration is performed. When the integrated value reaches a second threshold value that is larger than the first threshold value, the bit position P is set. It is determined as the edge position.
(作用) 本発明によれば、隣合うビットのデジタル出力の差分を
とって、このデジタル出力が増加したと判断した場合に
は、これをエッジ位置として検出するものである。(Operation) According to the present invention, the difference between the digital outputs of adjacent bits is calculated, and when it is determined that the digital output has increased, this is detected as the edge position.
(実施例) 以下、本発明の実施例を、図面を参照しながら、詳細に
説明する。(Example) Hereinafter, the Example of this invention is described in detail, referring drawings.
第1図は本発明の一実施例の構成を示す図で、第3図の
参照符号と同一符号のものは同一部分を示している。FIG. 1 is a diagram showing the configuration of an embodiment of the present invention, and the same reference numerals as those in FIG. 3 denote the same parts.
1はエッジを検出しようとする被測定物で、光源から照
射された光を被測定物が反射すると、その反射光はCC
Dなどのラインセンサ2によって感知,撮像されて、そ
の出力はMPX3によりマルチプレクスされた、S/H
回路4によってサンプルホールドされて、A/D変換回
路5によりデジタル変換される。すなわち、被測定物1
のエッジの検出情報を含むラインセンサ2の出力は、デ
ジタル信号化されて、減算器6に印加されるとともに、
第1のメモリ7に記憶される。この第1のメモリ7は、
ラインセンサ2のデジタル出力を1フレームごとに記憶
する。減算器6においては、第2のメモリ8に予め記憶
されている被測定物1のバックグランド信号をA/D変
換回路5の出力から減算した上、被測定物1のみのエッ
ジ情報信号を出力して、第3のメモリ9に記憶させる。
15は微分器で、これにより第3のメモリ9の内容のデー
タがCPU13により制御されて、ラインセンサ2のデジ
タル出力の隣合うビットごとに差分が順次検出され、そ
の値は積分器16により積分された後、比較器17及び18に
よって、それぞれ第4のメモリ19及び第5のメモリ20の
値と比較される。この第4のメモリ19及び第5のメモリ
20には、エッジの判定のためのしきい値1及びそれより
高いしきい値2が記憶されており、データバス14,メモ
リ9の制御及びデータの演算などを行うCPU13によっ
て第2図で示すアルゴリズム制御を行い、エッジが検出
される。Reference numeral 1 is an object to be detected whose edge is to be detected. When the object to be measured reflects the light emitted from the light source, the reflected light is CC
S / H, which is detected and imaged by the line sensor 2 such as D, and whose output is multiplexed by MPX3.
It is sampled and held by the circuit 4 and is digitally converted by the A / D conversion circuit 5. That is, the DUT 1
The output of the line sensor 2 including the detection information of the edge of is converted into a digital signal and applied to the subtractor 6, and
It is stored in the first memory 7. This first memory 7 is
The digital output of the line sensor 2 is stored for each frame. In the subtractor 6, the background signal of the device under test 1 stored in advance in the second memory 8 is subtracted from the output of the A / D conversion circuit 5, and the edge information signal of only the device under test 1 is output. Then, it is stored in the third memory 9.
Reference numeral 15 is a differentiator, whereby the data of the contents of the third memory 9 is controlled by the CPU 13, and the difference is sequentially detected for each adjacent bit of the digital output of the line sensor 2, and the value is integrated by the integrator 16. After that, the values are compared with the values in the fourth memory 19 and the fifth memory 20 by the comparators 17 and 18, respectively. The fourth memory 19 and the fifth memory
A threshold value 1 for determining an edge and a threshold value 2 higher than that are stored in the reference numeral 20, and are shown in FIG. Algorithm control is performed to detect edges.
第2図は、第1図に示された本発明の実施例のエッジ検
出アルゴリズムを説明するフローチャートであり、i
(但し、iは任意の正の整数、以下同じ)はラインセン
サ2のデジタル信号出力のビット位置、Diはラインセン
サ2のiビット目の出力、Kは隣合うビット出力の差分
値、TH1及びTH2はそれぞれ第1及び第2のしきい値であ
り、Meはメモリを示している。FIG. 2 is a flow chart for explaining the edge detection algorithm of the embodiment of the present invention shown in FIG.
(However, i is an arbitrary positive integer, the same applies hereinafter) is the bit position of the digital signal output of the line sensor 2, D i is the i-th output of the line sensor 2, K is the difference value between adjacent bit outputs, and TH 1 and TH 2 are the first and second thresholds, respectively, and Me is the memory.
第2図により、本実施例の動作について説明する。ま
ず、ラインセンサ2の端である1ビット目から、隣合う
ビット出力の差分値Kを、 K=Di+1−Di により求め、差分値Kの正負について判断を行う。The operation of this embodiment will be described with reference to FIG. First, the difference value K between adjacent bit outputs is calculated from K = D i + 1 −D i from the first bit, which is the end of the line sensor 2, to determine whether the difference value K is positive or negative.
ここで、差分値が正のときは、差分値Kを積分して、積
分値Sを S=S+K として求め、フラグFlの値が0か1かを判断する。フ
ラグFlの値が0のときは、ビット位置iをメモリMeに
記憶させ、フラグFlの値を1にして、ビット位置iを
1つ増加させる。一方、フラグFlの値が1のときは、
ビット位置を1つ増加させる。Here, when the difference value is positive, the difference value K is integrated to obtain the integrated value S as S = S + K, and it is determined whether the value of the flag Fl is 0 or 1. When the value of the flag Fl is 0, the bit position i is stored in the memory Me, the value of the flag Fl is set to 1, and the bit position i is incremented by 1. On the other hand, when the value of the flag Fl is 1,
Increase the bit position by one.
すなわち、隣合うビット出力が増加する場合に、そのビ
ット位置iを記憶することになる。That is, when the adjacent bit output increases, the bit position i is stored.
また、差分値が正でないときは、差分値Kを積分して積
分値Sを S=S+K として求め、積分値Sと第1のしきい値TH1との大小関
係を判断する。積分値Sが第1のしきい値TH1より小さ
い場合は、フラグFlを0にし、ビット位置iを1つ増
加させる。一方、積分値Sが第1のしきい値TH1より小
さくない場合は、ビット位置を1つ増加させる。When the difference value is not positive, the difference value K is integrated to obtain the integrated value S as S = S + K, and the magnitude relationship between the integrated value S and the first threshold value TH 1 is determined. When the integrated value S is smaller than the first threshold value TH 1 , the flag Fl is set to 0 and the bit position i is incremented by 1. On the other hand, when the integrated value S is not smaller than the first threshold value TH 1 , the bit position is incremented by 1.
すなわち、隣のビット出力が減少するか同じ場合であっ
て、積分値Sがしきい値TH1を超えないときには、フラ
グFlが0となり、それ以前に記憶したメモリが更新さ
れうる状態となり、隣合うビット出力が減少するか同じ
である場合であって、積分値Sがしきい値TH1を超えて
いるときには、そのままビット位置を更新する。That is, when the adjacent bit output decreases or is the same and the integrated value S does not exceed the threshold value TH 1 , the flag Fl becomes 0, and the memory stored before that becomes a state in which the memory can be updated. In the case where the matching bit output decreases or is the same and the integrated value S exceeds the threshold value TH 1 , the bit position is updated as it is.
以上の動作により、積分値Sがしきい値TH1より大きい
ときには、メモリMeに記憶されているビット位置が不変
であるが、しきい値TH1より小さいときは、メモリMeの
記憶は、差分値Kが正となるとき、新しいビット位置に
更新される。With the above operation, when the integrated value S is larger than the threshold value TH 1, the bit position stored in the memory Me remains unchanged, but when it is smaller than the threshold value TH 1 , the memory Me stores the difference. When the value K becomes positive, it is updated with the new bit position.
さらに、積分値Sがしきい値TH2より大か小かを判断
し、小であれば次のビット位置の差分値Kを求め、大で
あればメモリMeに記憶されているビット位置iをエッジ
位置として最終的に検出する。Further, it is determined whether the integrated value S is larger or smaller than the threshold value TH 2 , and if it is smaller, the difference value K of the next bit position is obtained, and if it is larger, the bit position i stored in the memory Me is determined. The edge position is finally detected.
以上、本発明を説明したが、第2のフローチャートでは
ビット位置iを第1番目から開始して説明したが、これ
は、ラインセンサの最大のビット位置から逆方向に、同
様のエッジの検出をすればエッジの両端まで検出するこ
とができる。The present invention has been described above. In the second flow chart, the bit position i is described starting from the first bit. This is to detect the same edge in the reverse direction from the maximum bit position of the line sensor. By doing so, it is possible to detect both ends of the edge.
(発明の効果) 以上説明したように、本発明によれば、ラインセンサ出
力に変化が現われた位置をエッジと判断するので、エッ
ジの断面が球状のように徐々に変化するときであって
も、エッジの位置を正確に検出でき、誤差がなくなる利
点がある。(Effects of the Invention) As described above, according to the present invention, the position where the change in the line sensor output appears is determined to be the edge, and therefore even when the cross section of the edge gradually changes like a sphere. The advantage is that the position of the edge can be detected accurately and there is no error.
第1図は本発明の一実施例を示すエッジ位置検出装置の
ブロック図、第2図はエッジ検出アルゴリズムのフロー
チャート、第3図は従来のエッジ位置検出装置のブロッ
ク図、第4図及び第5図はラインセンサ出力と判定しき
い値の関係を示す図である。 1……被測定物、2……ラインセンサ、3……マルチプ
レクサ(MPX)、4……サンプルホールド回路(S/
H回路)、5……アナログデジタル変換回路(A/D変
換回路)、6……減算器、7,8,9,19,20……メモ
リ、13……マイクロコンピュータ(CPU)、14……デ
ータバス、15……微分器、16……積分器、17,18……比
較器。FIG. 1 is a block diagram of an edge position detecting apparatus showing an embodiment of the present invention, FIG. 2 is a flow chart of an edge detecting algorithm, FIG. 3 is a block diagram of a conventional edge position detecting apparatus, FIGS. The figure shows the relationship between the line sensor output and the determination threshold value. 1 ... DUT, 2 ... Line sensor, 3 ... Multiplexer (MPX), 4 ... Sample and hold circuit (S /
H circuit), 5 ... Analog-digital conversion circuit (A / D conversion circuit), 6 ... Subtractor, 7, 8, 9, 19, 20 ... Memory, 13 ... Microcomputer (CPU), 14 ... Data bus, 15 ... differentiator, 16 ... integrator, 17, 18 ... comparator.
Claims (1)
の差分を走査方向に沿って順次検出する微分器と、 この差分を積分する積分器と、 エッジと判断した走査位置を記憶する記憶手段とを備
え、 前記ラインセンサの一方の端から他方の端に向かって前
記被測定物を走査し、前記微分器による微分結果が正と
なる場合に、この走査位置を前記エッジとして前記記憶
手段に記憶し、一方、前記微分器による微分結果が負あ
るいは0となる場合に、前記積分器による積分結果が第
1のしきい値以上であれば、前記記憶内容を保持し、ま
た、前記積分器による積分結果が第1のしきい値以下で
あれば、微分結果が正となる新たな走査位置を改めて前
記記憶手段に記憶し、前記積分器による積分結果が前記
第1のしきい値よりも大きい第2のしきい値を超えると
き、前記記憶手段に記憶された走査位置を前記エッジと
することを特徴とするエッジ検出位置。1. A line sensor for scanning an object to be measured, a differentiator for sequentially detecting a difference between outputs at adjacent scanning positions on the line sensor along a scanning direction, and an integrator for integrating the difference. A storage unit that stores a scanning position determined as an edge, scans the DUT from one end of the line sensor toward the other end, and when the differentiation result by the differentiator is positive, , The scanning position is stored in the storage means as the edge, and when the differentiation result by the differentiator is negative or 0, if the integration result by the integrator is not less than the first threshold value, If the result of integration by the integrator is less than or equal to the first threshold value while holding the stored contents, a new scanning position at which the differential result is positive is stored in the storage means again, and the new scanning position by the integrator is stored. Integration An edge detection position, characterized in that when the result exceeds a second threshold value that is larger than the first threshold value, the scanning position stored in the storage means is the edge.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60158423A JPH0623643B2 (en) | 1985-07-19 | 1985-07-19 | Edge position detector |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60158423A JPH0623643B2 (en) | 1985-07-19 | 1985-07-19 | Edge position detector |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6221005A JPS6221005A (en) | 1987-01-29 |
| JPH0623643B2 true JPH0623643B2 (en) | 1994-03-30 |
Family
ID=15671433
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP60158423A Expired - Lifetime JPH0623643B2 (en) | 1985-07-19 | 1985-07-19 | Edge position detector |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0623643B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH06201605A (en) * | 1993-01-07 | 1994-07-22 | Kanebo Ltd | Appearance inspecting device |
-
1985
- 1985-07-19 JP JP60158423A patent/JPH0623643B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS6221005A (en) | 1987-01-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4215220B2 (en) | Surface inspection method and surface inspection apparatus | |
| JPH0623643B2 (en) | Edge position detector | |
| JPH0674761A (en) | Range finder | |
| US5834930A (en) | Device for sensing the period of a digitized signal including noise evaluation and averaging over a plurality of zero crossing | |
| JPH0623644B2 (en) | Edge position detector | |
| CN117953036B (en) | Road and bridge foundation settlement displacement monitoring system and method | |
| JPS6230564B2 (en) | ||
| JPH0810130B2 (en) | Object measuring device by optical cutting line method | |
| JPS62218813A (en) | Pressure detector | |
| JP2944183B2 (en) | Dimension measuring device | |
| JP3142123B2 (en) | Data input method and device | |
| JPH0719284B2 (en) | Anomaly detection device | |
| JP2002243501A (en) | Automatic adjustment device for encoder output signal | |
| GB2143700A (en) | Object location | |
| JPS6132324Y2 (en) | ||
| JP3069401B2 (en) | Inspection method of roundness by image processing | |
| JPH0540060A (en) | Device for measuring properties of distribution of light | |
| KR100187010B1 (en) | Automatic adjusting method for the head of vcr | |
| JP2970250B2 (en) | Distance measuring device | |
| JP2992649B2 (en) | Displacement measuring device | |
| JPS61191906A (en) | Automatic film thickness measuring apparatus | |
| JPH052111B2 (en) | ||
| JPS622690Y2 (en) | ||
| JP2005114581A (en) | Distance measurement method | |
| JPH02300617A (en) | Shape measuring device |