JPH03261803A - Detection of edge position - Google Patents

Detection of edge position

Info

Publication number
JPH03261803A
JPH03261803A JP2059864A JP5986490A JPH03261803A JP H03261803 A JPH03261803 A JP H03261803A JP 2059864 A JP2059864 A JP 2059864A JP 5986490 A JP5986490 A JP 5986490A JP H03261803 A JPH03261803 A JP H03261803A
Authority
JP
Japan
Prior art keywords
range
formula
edge
data
edge position
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
JP2059864A
Other languages
Japanese (ja)
Inventor
Mitsuhiro Ishihara
満宏 石原
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.)
Takaoka Toko Co Ltd
Original Assignee
Takaoka Electric Mfg 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 Takaoka Electric Mfg Co Ltd filed Critical Takaoka Electric Mfg Co Ltd
Priority to JP2059864A priority Critical patent/JPH03261803A/en
Publication of JPH03261803A publication Critical patent/JPH03261803A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To achieve instrumentation with high accuracy by determining the position of an edge from values of means for performing first order differentiation of image data and the position of the center of gravity in the range including the edge of the data subjected to the first order differentiation. CONSTITUTION:A linear measuring line 16 is set at an optional position of an image 15 from a video camera 14. By measuring edges that cross the line 16 various kinds of size of an object is detected. Supposing that the data of luminance on the measuring line is expressed by f(x), the difference according to formula I is regarded to represent the first order differentiation. If f'(x) satisfies L>¦f'(x)¦ for a level L determined by the result of the difference calculation, it is neglected regarded as a noise. A continuous part with the same sign exceeding the level L is within the range of formula I to formula III. The cumulative distribution of the first order derivative is obtained for each range, and only the range not smaller than a certain threshold value, it is judged that there is included an edge. If this condition is satisfied only for the range C, a position Mo where Y/2 of the cumulative distribution Y of the primary differential values in the range C is given is obtained, and is represented by a formula V from a formula IV. The coordinates of the center of gravity in the range are expressed by a formula VI from which a formula VII is held.

Description

【発明の詳細な説明】 「産業上の利用分野」 本発明は、デジタル画像データ処理装置におけるエツジ
位置の自動計測技術に関する。
DETAILED DESCRIPTION OF THE INVENTION "Field of Industrial Application" The present invention relates to an automatic edge position measurement technique in a digital image data processing apparatus.

「従来の技術」 デジタル画像データ処理装置を利用した自動検査、計測
は生産技術の一つとして重要なものである。デジタル画
像データ処理装置で用いられるデータ処理手法は数多く
あるが、エツジ位置を検出することは、もっとも重要な
ことの一つと言える。
"Conventional Technology" Automatic inspection and measurement using digital image data processing equipment is an important production technology. There are many data processing techniques used in digital image data processing devices, but detecting edge positions can be said to be one of the most important.

例えば、エツジ間の距離で物体の幅を計測したり、2つ
のエツジで物体の傾きを計測するなど、エツジ位置の検
出は、デジタル画像計測の基本である。
For example, edge position detection is the basis of digital image measurement, such as measuring the width of an object using the distance between edges or measuring the inclination of an object using two edges.

エツジ位置の検出方法としては、従来、第2図に示すよ
うにあるしきい値7をもうけ、該しきい値より画素の出
力値が大きいか小さいかに分け(以下2値化と呼ぶ〉そ
の境界8を物体のエツジとみなす方法が一般的だった。
Conventionally, as an edge position detection method, a threshold value 7 is set as shown in Fig. 2, and the output value of a pixel is divided into whether it is larger or smaller than the threshold value (hereinafter referred to as binarization). A common method was to regard boundary 8 as the edge of the object.

「発明が解決しようとする課題ヨ しかし、この方法では次のような問題点があった。``The problem that the invention seeks to solve However, this method had the following problems.

(1)照明器の経年劣化等により、対象物体に照射され
る光量が変動した場合に大きな誤差9が発生する。(第
3図) (2)しきい値決定が微妙でありわずられしい。
(1) A large error 9 occurs when the amount of light irradiated onto the target object changes due to aging deterioration of the illuminator or the like. (Figure 3) (2) The determination of the threshold value is delicate and troublesome.

また、第4図に示すような輝度値の異なるエツジが混在
する場合、2つのしきい値1、12をもち、2度計測を
行なう必要がある。
Further, when edges with different brightness values coexist as shown in FIG. 4, it is necessary to have two threshold values 1 and 12 and perform measurement twice.

(3〉検出されたエツジは、第5図に示すように±17
2画素間隔の誤差13をもつ、つまり画素間隔以下の精
度は望めない。
(3) The detected edges are ±17 as shown in Figure 5.
It has an error 13 of 2 pixel spacing, that is, accuracy less than the pixel spacing cannot be expected.

本発明は、以上のような従来技術の問題点を解決するこ
とを目的とするものである。
The present invention aims to solve the problems of the prior art as described above.

「問題を解決するための手段」 そこで、本発明は2値化することなく、エツジ位置を検
出するために、画像データの一次微分のピークを検出す
る手法を′採用する。一般に輝度変化の最も急な位置が
エツジと考えられるからである。ピークの検出を次のよ
うに行なう。まず、画像データに対して一次微分を施こ
し、一次微分を行なったデータ中のエツジを十分に含む
範囲内での重心(Gとする)を与える位置(Mとする)
と該範囲での一次微分データの累積分布において、最終
累積値の1/2を与える位置(M、とする)を求め、こ
の求めた値M、M、から一次微分の最大値を与える位置
(M。とする〉を推定する。
"Means for Solving the Problem" Therefore, the present invention adopts a method of detecting the peak of the first-order differential of image data in order to detect edge positions without binarizing. This is because the position where the brightness change is the steepest is generally considered to be the edge. Peak detection is performed as follows. First, first-order differentiation is applied to the image data, and the position (denoted as M) gives the center of gravity (denoted as G) within a range that sufficiently includes the edges in the data subjected to the first-order differentiation.
In the cumulative distribution of first-order differential data in this range, find the position (M) that gives 1/2 of the final cumulative value, and from the found values M, M, find the position (let it be M) that gives the maximum value of the first-order differential. Estimate M.

また、M、M、を求めるためのデータ範囲の設定は、一
次微分値が同符号でかつ、その絶対値があるしきい値を
越える連続するデータとして決定し、また、このように
して決定された範囲内のエツジの有無は、最終累積値が
あるしきい値を越えることを条件として判定する。
In addition, the data range for determining M and M is determined as continuous data whose first-order differential values have the same sign and whose absolute value exceeds a certain threshold. The presence or absence of an edge within the specified range is determined on the condition that the final cumulative value exceeds a certain threshold.

「作用」 以上のような方法は対象物への光量の違いが、直接計測
に影響する訳ではない。また、範囲やエツジの有無の決
定のために設けられるしきい値も大雑把でよく、対象物
ごとに変える必要などない。
"Effect" In the methods described above, the difference in the amount of light to the object does not directly affect the measurement. Furthermore, the threshold values set for determining the range and the presence or absence of edges may be rough, and there is no need to change them for each object.

また、微分処理に基づくため、輝度値の異なるエツジが
混在していても問題はない。そして最大の利点は、画素
間隔以下の精度でエツジ検出が可能となることである。
Furthermore, since it is based on differential processing, there is no problem even if edges with different brightness values coexist. The biggest advantage is that edge detection can be performed with accuracy less than the pixel interval.

「実施例」 以下、図に示す本発明の実施例について説明する。第6
図は、2次元的な画像が得られるビデオカメラ14から
の画像15に対して、任意の位置に直線状の計測線16
を設定し、該計測線を横ぎるエツジを検出することによ
って、物体の各種寸法をはかる装置の例である。ある計
測線上の輝度が第7図のようであったとする。
"Example" Hereinafter, an example of the present invention shown in the drawings will be described. 6th
The figure shows a linear measurement line 16 at an arbitrary position with respect to an image 15 from a video camera 14 that can obtain a two-dimensional image.
This is an example of a device that measures various dimensions of an object by setting the measurement line and detecting edges that cross the measurement line. Assume that the luminance on a certain measurement line is as shown in FIG.

このデータをf (x)で表すとして、f−(x>=f
 (x+1>−f (x−1>で表わされる差分をもっ
て1次微分とする。
Assuming that this data is represented by f (x), f-(x>=f
(x+1>-f (x-1>) is the first-order differential.

この式によって得られた結果が第8図である。FIG. 8 shows the results obtained using this formula.

第8図中破線4で示されたレベルをLとすると、L>l
 f ” (x)Iを満たすf−(x)はノイズとして
無視する。Lを越えて、かつ同符号で連続する部分を抽
出すると、 A= (x l x=106) B = (x l x=108) C=(xl 111≦X≦117) の3つの範囲となる。各範囲毎に1次微分値の累積分布
を求め、その最終累積値5.f−(x>・Σf−(x)
・Σf−(x)・があるしきい値以x(B      
        X(C上となる範囲についてのみ、そ
の内部にエツジを含むと判定する。ここでは、Cの範囲
についてのみ、この条件を満足したとして説明を進める
。第9図は、Cの範囲での1次微分値の累積分布である
If the level indicated by the broken line 4 in FIG. 8 is L, then L>l
f - (x) that satisfies f'' (x)I is ignored as noise. Extracting continuous parts with the same sign beyond L, A = (x l x = 106) B = (x l x = 108) There are three ranges: C = (xl 111≦X≦117).Find the cumulative distribution of the first-order differential value for each range, and calculate the final cumulative value 5.f-(x>・Σf-(x )
・Σf−(x)・Below a certain threshold x(B
It is determined that an edge is included only in the range that is on This is the cumulative distribution of the derivative values.

Y=11°(X)とすると、累積分布でのY/2x(C を与える位置M、を求める。このときM、は、累積分布
を関数F (x>で表すとするとF (xo )≦Y/
 2 < F (Xo +1 >となるXoを用いて Y/2F(Xo) として算出する。また、該範囲での重心の位置座を計算
する。
Assuming Y=11°(X), find the position M that gives Y/2x(C) in the cumulative distribution.In this case, M is the cumulative distribution expressed by the function F(x>), then F(xo)≦ Y/
Calculate as Y/2F(Xo) using Xo such that 2 < F (Xo +1 >). Also, calculate the position of the center of gravity in the range.

一次微分値のピークを与える位置M。は度数分布グラフ
が対象形に近いときによくあてはまるとされる、ピアソ
ンの実験式を用いて、 M−MO=3 (IVI−M、 ) から求める。
Position M that gives the peak of the first-order differential value. is obtained from M-MO=3 (IVI-M, ) using Pearson's empirical formula, which is said to apply well when the frequency distribution graph is close to the symmetrical shape.

尚、第10図のように計測線16が画素配列に対して斜
めとなる場合は、2次元的な一次微分を行ない。第10
図斜線で示される、計測線が横ぎる画素を(Pl、P2
 、・・・・・・、 PN )として表すとして、正方
形画素の工辺を1としたときの、横ぎる計測線のその画
素中での長さをN(P、)とすれば、各画素の一次微分
値に対して、1!(P、)の重みをつけてやることにす
れば、画素配列に沿って計測する場合と同様に計算でき
る。
Incidentally, when the measurement line 16 is oblique to the pixel array as shown in FIG. 10, two-dimensional first-order differentiation is performed. 10th
The pixels crossed by the measurement line (Pl, P2
, ......, PN ), and when the square pixel's edge is 1, and the length of the measurement line that crosses that pixel is N (P, ), each pixel is For the first derivative of , 1! By adding weights of (P,), calculations can be made in the same way as when measuring along the pixel array.

「発明の効果」 本発明のエツジ位置検出方法によれば、2値化を基本と
した検出方法で問題となった、しきい値の決定に伴う、
わずられしさおよび光量変動による誤差生成、画素間隔
に制限される精度などが一挙に解決できる。
"Effects of the Invention" According to the edge position detection method of the present invention, problems associated with threshold determination, which were problems with detection methods based on binarization, can be solved.
Problems such as tediousness, error generation due to light intensity fluctuations, and accuracy limited by pixel spacing can be solved all at once.

これにより、デジタル画像データ処理装置を用いた検査
、計測がより高精度に、より信頼性高くなり、生産性の
向上に大きく寄与すると思われる。
As a result, inspection and measurement using the digital image data processing device will become more accurate and reliable, and it is believed that this will greatly contribute to improving productivity.

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

第1図は、この発明の原理を示す図であり、(a)は画
像原データを、(b)は一次微分後のデータを、(C)
は累積分布を表している。第2図は、従来法を説明する
ための図であり、(a)は画像原データを、(b)は2
値化処理後のデータを表している。第3図は光量変動に
より生じる誤差を示す図、第4図は2段階のエツジをも
つデータの図、第5図は2値化処理の精度を示す図であ
る。第6図は本発明の実施例を示す図、第7図はデジタ
ル化された画像原データを示す図、第8図は一次微分後
のデータを示す図、第9図は累積分布を示す図である。 第↑0図は画素配列に対して斜めに設定された計測線を
示す図である。 ↓・・・・・・重心の位置座標、 2・・・・・・累積分布の中央値を与える位置座標、3
・・・・・・エツジ位置、 44−・・・・・・ノイズカットのためのしきいイ直、
5・・・・・・エツジを含む範囲、 6・・・・・・最終累積値、 7・・・・・・2値化のためのしきい値、8・・・・・
・従来法で求めたエツジ位置、9・・・・・・光量変動
による誤差、 10.10−・・・・・・画像データ 1、12・・・・・・しきい値、 13・・・・・・誤差範囲、 14・・・・・・ビデオカメラ、 15・・・・・・画像データ、 16・・・・・・計測線
FIG. 1 is a diagram showing the principle of this invention, in which (a) shows the original image data, (b) shows the data after first differentiation, and (C) shows the data after first differentiation.
represents the cumulative distribution. FIG. 2 is a diagram for explaining the conventional method, where (a) shows the original image data, and (b) shows the 2
Represents data after value processing. FIG. 3 is a diagram showing errors caused by variations in light amount, FIG. 4 is a diagram of data with two-stage edges, and FIG. 5 is a diagram showing the accuracy of binarization processing. Fig. 6 is a diagram showing an embodiment of the present invention, Fig. 7 is a diagram showing digitized original image data, Fig. 8 is a diagram showing data after first differentiation, and Fig. 9 is a diagram showing cumulative distribution. It is. Figure ↑0 is a diagram showing measurement lines set diagonally with respect to the pixel array. ↓・・・Positional coordinates of the center of gravity, 2・・・Positional coordinates that give the median of the cumulative distribution, 3
...Edge position, 44-...Threshold straightness for noise cutting,
5...Range including edges, 6...Final cumulative value, 7...Threshold value for binarization, 8...
・Edge position obtained by conventional method, 9...Error due to light intensity fluctuation, 10.10-...Image data 1, 12...Threshold value, 13... ...Error range, 14...Video camera, 15...Image data, 16...Measurement line

Claims (1)

【特許請求の範囲】 1、1次元的なデジタル画像データに対して、該画像デ
ータ中に含まれる物体のエッジ位置を検出する方法にお
いて、画像データの一次微分を行なう手段と、一次微分
を行なったデータ中のエッジを十分に含む範囲5での重
心を与える位置1と該範囲での一次微分データの累積分
布において最終累積値6の1/2を与える位置2を求め
る手段を有し、求めた値を用いてエッジ位置3を決定す
ることを特徴としたエッジ位置検出方法。 2、該範囲は、一次微分値が同符号でかつ、その絶対値
があるしきい値4を越える連続するデータとして決定し
、また、このようにして決定された範囲内のエッジの有
無は、最終累積値があるしきい値を越えることを条件と
して判定することを特徴とする第1項のエッジ位置検出
方法。
[Claims] 1. A method for detecting an edge position of an object included in one-dimensional digital image data, comprising means for performing first-order differentiation of image data; and means for performing first-order differentiation of image data. means for determining a position 1 giving the center of gravity in a range 5 that sufficiently includes edges in the data, and a position 2 giving 1/2 of the final cumulative value 6 in the cumulative distribution of first-order differential data in the range; An edge position detection method characterized in that an edge position 3 is determined using a value obtained by determining an edge position 3. 2. The range is determined as continuous data whose primary differential values have the same sign and whose absolute value exceeds a certain threshold value 4, and the presence or absence of edges within the range thus determined is as follows: The edge position detection method according to the first item, characterized in that the determination is made on the condition that the final cumulative value exceeds a certain threshold value.
JP2059864A 1990-03-13 1990-03-13 Detection of edge position Pending JPH03261803A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2059864A JPH03261803A (en) 1990-03-13 1990-03-13 Detection of edge position

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2059864A JPH03261803A (en) 1990-03-13 1990-03-13 Detection of edge position

Publications (1)

Publication Number Publication Date
JPH03261803A true JPH03261803A (en) 1991-11-21

Family

ID=13125469

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2059864A Pending JPH03261803A (en) 1990-03-13 1990-03-13 Detection of edge position

Country Status (1)

Country Link
JP (1) JPH03261803A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06294621A (en) * 1993-04-07 1994-10-21 Kobe Steel Ltd Optical profile measuring equipment
JPH07210694A (en) * 1994-01-18 1995-08-11 Asia Electron Inc Picture processor
JP2003035522A (en) * 2001-07-25 2003-02-07 Nippon Soken Inc Method and device for measuring distance
JP2010516977A (en) * 2007-01-30 2010-05-20 ピルツ ゲーエムベーハー アンド コー.カーゲー Safety device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06294621A (en) * 1993-04-07 1994-10-21 Kobe Steel Ltd Optical profile measuring equipment
JPH07210694A (en) * 1994-01-18 1995-08-11 Asia Electron Inc Picture processor
JP2003035522A (en) * 2001-07-25 2003-02-07 Nippon Soken Inc Method and device for measuring distance
JP4529327B2 (en) * 2001-07-25 2010-08-25 株式会社日本自動車部品総合研究所 Distance measurement method
JP2010516977A (en) * 2007-01-30 2010-05-20 ピルツ ゲーエムベーハー アンド コー.カーゲー Safety device

Similar Documents

Publication Publication Date Title
Fathy et al. Real-time image processing approach to measure traffic queue parameters
CN111968144B (en) Image edge point acquisition method and device
CN108510476B (en) Mobile phone screen circuit detection method based on machine vision
JPH02285475A (en) Method and equipment for extracting edge and line
US20070183667A1 (en) Image processing apparatus
KR20090101356A (en) Defect detecting device, and defect detecting method
CN106530271B (en) A kind of infrared image conspicuousness detection method
JP2007071586A (en) Image defect inspection device, image defect inspection system, defect classification device, and image defect inspection method
US10109045B2 (en) Defect inspection apparatus for inspecting sheet-like inspection object, computer-implemented method for inspecting sheet-like inspection object, and defect inspection system for inspecting sheet-like inspection object
KR910017328A (en) Position Recognition Device
Rockett The Accuracy of Sub-Pixel Localisation in the Canny Edge Detector.
US7352901B2 (en) Contour inspection method and apparatus
CN111861979A (en) Positioning method, positioning equipment and computer readable storage medium
JP2005172559A (en) Method and device for detecting line defect on panel
JP4479877B2 (en) Defect inspection method by image recognition
JPH03261803A (en) Detection of edge position
JP2002243428A (en) Method and device for pattern inspection
JPH06308256A (en) Cloudy fog detecting method
KR101910453B1 (en) Apparatus and method for extracting salient-line informative signs
JPWO2018198916A1 (en) Image processing apparatus, image processing method, and storage medium
Kaur et al. Performance Evaluation of various thresholding methods using canny edge detector
CN111473944B (en) PIV data correction method and device for observing complex wall surface in flow field
CN114529555A (en) Image recognition-based efficient cigarette box in-and-out detection method
RU2519005C1 (en) Method of prestart check of printboards
JP2007263696A (en) Profile-defect detection method and program