JPH05165965A - Edge detection device - Google Patents

Edge detection device

Info

Publication number
JPH05165965A
JPH05165965A JP3333636A JP33363691A JPH05165965A JP H05165965 A JPH05165965 A JP H05165965A JP 3333636 A JP3333636 A JP 3333636A JP 33363691 A JP33363691 A JP 33363691A JP H05165965 A JPH05165965 A JP H05165965A
Authority
JP
Japan
Prior art keywords
value
edge
image
average value
local area
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
JP3333636A
Other languages
Japanese (ja)
Inventor
Yoshiki Kuno
良樹 久野
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP3333636A priority Critical patent/JPH05165965A/en
Publication of JPH05165965A publication Critical patent/JPH05165965A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To securely detect only the edge part of an object image in an image which includes a background by comparing a statistical quantity ratio with a threshold value and deciding whether or not image data is edge data. CONSTITUTION:The square mu<2> of the mean value mu of image data in a local area which is obtained by passing the image data through a mean value calculating means 3, a variance value V found by a variance value calculating means 4, and their statistical quantity ratio V/mu<2> are used as materials to decide the edge. The statistical quantity ratio V/mu<2> does not depend upon lighting conditions and increases at the image edge part. For the purpose, the statistical quantity ratio V/mu<2> is compared with the threshold value for edge decision making which is previously set by statistical experiments, etc., to judge the edge by an edge decision means 9. Consequently, only the edge part of the object image in the image which includes the background can securely be detected without depending upon the lighting conditions.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は画像からエッジを検出す
るエッジ検出装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an edge detecting device for detecting edges from an image.

【0002】[0002]

【従来の技術】一般に、画像の特徴抽出等を行う画像処
理において、画像のエッジ検出は最も基本的な処理の一
つである。なお、ここでいうエッジとは対象物体と、そ
の対象物体の背景との境界部分のことをいい、一般に画
像の輝度が大きく変化する部分のことを意味している。
2. Description of the Related Art Generally, in image processing such as image feature extraction, image edge detection is one of the most basic processes. It should be noted that the edge mentioned here means a boundary portion between the target object and the background of the target object, and generally means a portion where the brightness of the image largely changes.

【0003】図5は従来のエッジ検出装置の概略ブロッ
ク図を示し、図5において、11は画像メモリで、あらか
じめ画像データが記憶されている。12は空間フィルタで
局所領域内の輝度差を求める。13は比較器で、前記空間
フィルタ12により得られたデータをしきい値と比較す
る。14は固定値であり、これをしきい値とする。
FIG. 5 shows a schematic block diagram of a conventional edge detecting apparatus. In FIG. 5, 11 is an image memory in which image data is stored in advance. Reference numeral 12 is a spatial filter for finding the brightness difference in the local region. Reference numeral 13 is a comparator, which compares the data obtained by the spatial filter 12 with a threshold value. 14 is a fixed value, which is used as a threshold value.

【0004】以上のように構成された従来のエッジ検出
装置の動作は、まず、画像メモリ11に記憶されている画
像データを空間フィルタ12に通すことにより、画像の輝
度が大きく変化する場所における画素の輝度のみが強調
される。この空間フィルタ12には差分型オペレータがよ
く用いられている。これは、局所領域内(たとえばm×
n画素)における画像データI(1,1)〜I(m,n)と
重み係数w(1,1)〜w(m,n)との次式数1の積和演
In the operation of the conventional edge detecting apparatus configured as described above, first, the image data stored in the image memory 11 is passed through the spatial filter 12 so that the pixel in the place where the luminance of the image greatly changes. Only the brightness of is emphasized. A differential operator is often used for the spatial filter 12. This is within a local region (eg m ×
Image data I (1,1) to I (m, n) and weighting factors w (1,1) to w (m, n) in n pixels)

【0005】[0005]

【数1】 [Equation 1]

【0006】によって局所領域内の輝度差ΔIを求める
方法である。この重み係数の行列のことをオペレーショ
ンマスクという。例えば、局所領域内の画像データが図
6(a)のような場合、図6(b)に示すような3×3画素の
オペレーションマスクを用いて重みづけを行うと、局所
領域内の画素I(2,2)における輝度差ΔIは数2とな
る。
Is a method for obtaining the brightness difference ΔI in the local area by. This matrix of weighting factors is called an operation mask. For example, when the image data in the local region is as shown in FIG. 6A, if weighting is performed using an operation mask of 3 × 3 pixels as shown in FIG. The luminance difference ΔI in (2, 2) is given by

【0007】[0007]

【数2】 ΔI=|−I(1,2)−I(2,1)+4I(2,2)−I(2,3)−I(3,2)
| このようなオペレーションマスクを用いた空間フィルタ
をラプラシアンフィルタという。また、図7に示すよう
な水平方向と垂直方向に別々のオペレーションマスクを
用いた場合、水平方向および垂直方向の輝度差ΔIx
ΔIyは数3となる。
[Expression 2] ΔI = | −I (1,2) −I (2,1) + 4I (2,2) −I (2,3) −I (3,2)
| A spatial filter using such an operation mask is called a Laplacian filter. Further, when different operation masks are used in the horizontal direction and the vertical direction as shown in FIG. 7, the brightness difference ΔI x between the horizontal direction and the vertical direction,
ΔI y is given by Equation 3.

【0008】[0008]

【数3】 ΔIx=I(1,3)+2I(2,3)+I(3,3)−(I(1,1)+2I(2,1)+I(3,1)) ΔIy=I(3,1)+2I(3,2)+I(3,3)−(I(1,1)+2I(1,2)+I(1,3)) そして局所領域内の画素I(2,2)における輝度差ΔI
は次式数4で得られる。
## EQU3 ## ΔI x = I (1,3) + 2I (2,3) + I (3,3)-(I (1,1) + 2I (2,1) + I (3,1)) ΔI y = I (3,1) + 2I (3,2) + I (3,3) − (I (1,1) + 2I (1,2) + I (1,3)) and the pixel I (2,2) in the local area Difference in brightness ΔI
Is obtained by the following equation 4.

【0009】[0009]

【数4】 [Equation 4]

【0010】このようなマスクを用いた空間フィルタを
ソーベルフィルタという。これらの差分型オペレータに
よる空間フィルタリング処理については、例えば画像処
理ハンドブック初版3刷発行(平成1年3月)の第280頁
から第283頁に記載されている。
A spatial filter using such a mask is called a Sobel filter. The spatial filtering processing by these difference type operators is described, for example, on pages 280 to 283 of the first edition of the third edition of the image processing handbook (March, 1991).

【0011】こうして得た画素の輝度差を図5の比較器
13で固定値14のしきい値と比較し、しきい値より大きけ
れば比較器13が“1”を出力し、小さければ“0”を出
力することによって、注目している画素がエッジである
かどうかを判定し、図8に示されるように画像のエッジ
部分のみが出力されてエッジが検出される。
The pixel brightness difference thus obtained is compared with the comparator of FIG.
The threshold value of 13 is compared with the threshold value of the fixed value 14. If it is larger than the threshold value, the comparator 13 outputs "1", and if it is smaller than "0", the pixel of interest is an edge. It is determined whether or not, and as shown in FIG. 8, only the edge portion of the image is output and the edge is detected.

【0012】ここで、上記輝度差を用いて画像中からエ
ッジを検出する原理について説明する。対象物体と背景
との違いは、一般にその表面反射率の差に現れる。い
ま、入射光をi,対象物体の反射光をI,背景の反射光
をI′,対象物体の表面反射率をr,背景の表面反射率
をr′とすると反射光I,I′は数5で現わされる。
Now, the principle of detecting an edge in an image by using the brightness difference will be described. The difference between the target object and the background generally appears in the difference in surface reflectance. Now, assuming that the incident light is i, the reflected light of the target object is I, the reflected light of the background is I ′, the surface reflectance of the target object is r, and the surface reflectance of the background is r ′, the reflected light I, I ′ is several. Represented in 5.

【0013】[0013]

【数5】I =r ×i I′=r′×i また、対象物体と背景との反射光の差ΔIは数6のよう
になり、
## EQU00005 ## I = r.times.i I '= r'.times.i Also, the difference .DELTA.I in the reflected light between the target object and the background is given by

【0014】[0014]

【数6】ΔI=|I−I′|=|r−r′|×i 表面反射率の差は反射光の差となって現れてくる。この
反射光とは、すなわち画像データの輝度であり、反射光
の差ΔIは対象物体と背景との輝度差である。対象物体
と背景の反射率の差が大きければ、輝度差ΔIは大きく
なり、したがってエッジを検出することができる。
ΔI = | I−I ′ | = | r−r ′ | × i The difference in surface reflectance appears as a difference in reflected light. The reflected light is the brightness of the image data, and the difference ΔI in the reflected light is the brightness difference between the target object and the background. If the difference in the reflectance between the target object and the background is large, the brightness difference ΔI becomes large, and therefore the edge can be detected.

【0015】[0015]

【発明が解決しようとする課題】しかしながら、上述の
ような従来のエッジ検出装置では、数6から明らかなよ
うに、輝度差ΔIは入射光iに依存し、画像入力時の照
明条件に左右されることがわかる。すなわち、暗い照明
下で入力した画像の場合は、対象物体と背景との反射率
の差が大きくても、入射光iが小さければ輝度差ΔIは
小さくなり、エッジとして検出することが困難になる。
However, in the conventional edge detecting apparatus as described above, the brightness difference ΔI depends on the incident light i, and is dependent on the illumination condition at the time of image input, as is clear from the equation (6). Understand that That is, in the case of an image input under dark illumination, even if the difference in reflectance between the target object and the background is large, if the incident light i is small, the brightness difference ΔI will be small, and it will be difficult to detect it as an edge. ..

【0016】また逆に、画像入力時の照明が非常に明る
い場合は、対象物体以外の部分と背景との反射率の差が
小さくても、入射光iが非常に大きいので輝度差ΔIが
大きくなり、誤ってエッジとして検出する恐れがある。
On the contrary, when the illumination at the time of image input is very bright, the incident light i is very large and the luminance difference ΔI is large even if the difference in reflectance between the portion other than the target object and the background is small. Therefore, there is a possibility that the edge will be erroneously detected.

【0017】このように従来の技術では、画像入力時の
照明条件によって検出すべき対象部分のエッジが検出で
きなかったり、誤り検出してしまうという問題があっ
た。
As described above, the conventional technique has a problem that the edge of the target portion to be detected cannot be detected or the error is detected depending on the illumination condition at the time of image input.

【0018】本発明は上記の問題を解決するため照明条
件に依存することなく、背景を含む画像中から対象とす
る画像のエッジ部分のみを確実に検出することができる
エッジ検出装置の提供を目的とする。
In order to solve the above problems, the present invention aims to provide an edge detecting apparatus capable of reliably detecting only the edge portion of an image of interest from an image including a background without depending on illumination conditions. And

【0019】[0019]

【課題を解決するための手段】本発明は、画像データか
ら局所領域内での平均値を求める平均値算出手段と、上
記局所領域内の分散値を求める分散値算出手段と、上記
平均値算出手段により求めた平均値を2乗する手段と、
上記平均値の2乗と上記分散値算出手段により求めた分
散値の比を算出する統計量比算出手段と、該統計量比算
出手段の出力をしきい値と比較することにより、上記画
像データがエッジであるか否かを判定するエッジ判定手
段とを備えたものである。
According to the present invention, an average value calculating means for calculating an average value in a local area from image data, a dispersion value calculating means for calculating a dispersion value in the local area, and the average value calculation. Means for squaring the average value obtained by means,
The image data is obtained by comparing the output of the statistical value ratio calculating means with a threshold value, and the statistical value ratio calculating means for calculating a ratio between the square of the average value and the distributed value calculated by the distributed value calculating means. Edge determination means for determining whether or not the edge is an edge.

【0020】[0020]

【作用】本発明によれば、画像データの局所領域内にお
ける画像データの平均値μの2乗μ2及び分散値Vを求
め、それらの統計量比V/μ2をエッジの判定資料とし
ており、その統計量比V/μ2は照明条件に依存せず、
また、画像エッジ部分では大きくなる性質があるので、
あらかじめ統計的な実験等によって設定したエッジを判
断するしきい値と、上記の統計量比V/μ2を比較して
エッジか否かを判断すれば、背景を含む画像からエッジ
部分を画像の照明に依存されずに確実に検出することが
できる。
According to the present invention, the mean value μ squared μ 2 and the variance value V of the image data in the local area of the image data are obtained, and the statistical value ratio V / μ 2 is used as the edge judgment data. , The statistic ratio V / μ 2 does not depend on the lighting condition,
Also, since there is a property that it becomes large at the image edge part,
By comparing the above-mentioned statistic ratio V / μ 2 with a threshold value for judging an edge set in advance by a statistical experiment or the like, and judging whether it is an edge or not, an edge portion of an image including a background It is possible to reliably detect the light without depending on the illumination.

【0021】[0021]

【実用例】図1は本発明の一実施例の構成を示すブロッ
ク図で、1は画像メモリで、あらかじめ用意した画像デ
ータが記憶されている。2は遅延手段で、画像メモリ1
から送られた画像データを3つの水平ラインデータに分
ける。3は平均値算出手段で、局所領域内での平均値を
求める。4は分散値算出手段で、局所領域内での分散値
を求める。5は乗算器で、平均値算出手段3の出力を2
乗する。6および7はバッファで、平均値算出手段3お
よび分散値算出手段4を通して送られてくるデータを順
次蓄えるためのものである。8は統計量比算出手段で、
前記バッファ6に記憶されている局所領域内での平均値
の2乗と、バッファ7に記憶される局所領域内での分散
値との統計量比を求める。9はエッジ判定手段で、上記
統計量比としきい値を比較して、エッジであるか否かを
判定する手段、10は制御部で、バッファ6に記憶されて
いる平均値算出手段3の出力を2乗した値と、バッファ
7により記憶されている分散値算出手段4の出力とを、
バッファ6およびバッファ7を制御することにより、統
計量比算出手段8の入力に同じ画素位置(アドレス)のデ
ータを同期して入力させる。
[Practical Example] FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention. Reference numeral 1 is an image memory in which image data prepared in advance is stored. 2 is a delay means, which is the image memory 1
The image data sent from is divided into three horizontal line data. Reference numeral 3 denotes an average value calculating means, which calculates an average value in the local area. Reference numeral 4 denotes a variance value calculating means, which obtains a variance value in the local area. Reference numeral 5 denotes a multiplier, which outputs the output of the average value calculation means 3 to 2
Get on. Buffers 6 and 7 are for sequentially storing the data sent through the average value calculating means 3 and the variance value calculating means 4. 8 is a statistic ratio calculation means,
A statistical amount ratio between the square of the average value in the local area stored in the buffer 6 and the variance value in the local area stored in the buffer 7 is obtained. Reference numeral 9 denotes an edge determination means, which compares the statistic ratio with a threshold value to determine whether it is an edge, 10 is a control unit, which is an output of the average value calculation means 3 stored in the buffer 6. And the output of the variance value calculation means 4 stored in the buffer 7,
By controlling the buffer 6 and the buffer 7, the data of the same pixel position (address) is synchronously input to the input of the statistic ratio calculating means 8.

【0022】以上のように構成された本発明の動作は、
まず、制御部10が画像メモリ1の出力を制御して、記憶
されている画像データの水平ラインのうち、上下に連続
した3ライン分のデータだけを遅延手段2を通して平均
値算出手段3と分散値算出手段4に夫々送る。平均値算
出手段3では、送られてきた3ライン分のデータから局
所領域(マスク)を1画素ずつずらしながら、局所領域内
(マスク内)での平均値を順次求めて乗算器5に送る。
The operation of the present invention configured as above is as follows.
First, the control unit 10 controls the output of the image memory 1 so that among the horizontal lines of the stored image data, only the data of three consecutive lines in the vertical direction is dispersed through the delay unit 2 with the average value calculation unit 3. It is sent to the value calculation means 4, respectively. In the average value calculation means 3, the local area (mask) is shifted pixel by pixel from the sent data for three lines, and
The average value (in the mask) is sequentially obtained and sent to the multiplier 5.

【0023】ここで、この平均値算出手段3による局所
領域内の平均値μは、図6(a)に示されるマスク内の画
像データを数7の演算をすることにより求められる。
Here, the average value μ in the local area by the average value calculating means 3 is obtained by calculating the image data in the mask shown in FIG.

【0024】[0024]

【数7】 [Equation 7]

【0025】この平均値μは、乗算器5により2乗され
μ2となって順次バッファ6に送られ、1ライン分のμ2
がバッファ6に蓄えられる。分散値算出手段4では、送
られてきた3ライン分のデータから図6(a)に示される
ような局所領域内(マスク内)に対して、そのマスク内に
おける平均値μを前述の平均値算出手段3と同様な処理
を行なうことにより求め、つぎに上記マスク内における
分散値Vを数8の演算を行なうことによって求める。
This average value μ is squared by the multiplier 5 to become μ 2 , which is sequentially sent to the buffer 6, and μ 2 for one line is sent.
Are stored in the buffer 6. In the variance value calculating means 4, the average value μ in the mask is calculated from the received three lines of data in the local area (in the mask) as shown in FIG. 6A. It is obtained by performing the same processing as that of the calculating means 3, and then the variance value V in the mask is obtained by performing the operation of Eq.

【0026】[0026]

【数8】 [Equation 8]

【0027】こうして得られた局所領域内の分散値V
は、上記マスクを1画素ずつずらしながら、1ライン分
がバッファ7に蓄えられる。結局、平均値算出手段3の
出力は乗算器5を通してバッファ6に、分散値算出手段
4の出力はバッファ7に送られていることになる。
The variance value V in the local area thus obtained
Is stored in the buffer 7 for one line while shifting the mask by one pixel at a time. After all, the output of the average value calculating means 3 is sent to the buffer 6 through the multiplier 5, and the output of the variance value calculating means 4 is sent to the buffer 7.

【0028】つぎに、制御部10によって、バッファ6か
ら1画素分のデータを統計量比算出手段8に送り、これ
と同時にバッファ7から、前記バッファ6の出力と同じ
アドレスのデータを統計量比算出手段8に送る。これを
全ラインにわたって1ラインずつずらしながら繰り返し
行うことにより、1画面すべての局所領域内における平
均値の2乗と、その局所領域内の分散値が同期して順
次、統計量比算出手段8に送られることになる。
Next, the control unit 10 sends the data for one pixel from the buffer 6 to the statistic amount calculating means 8, and at the same time, the buffer 7 outputs the data at the same address as the output of the buffer 6 to the statistic amount ratio. It is sent to the calculation means 8. By repeating this while shifting one line at a time over all the lines, the square of the average value in the local regions of all the one screen and the variance value in the local regions are sequentially synchronized and sequentially sent to the statistic ratio calculating means 8. Will be sent.

【0029】こうして統計量比算出手段8に送られた2
つのデータから局所領域内の、平均値の2乗μ2、及び
分散値の統計量比V/μ2が求められる。この求めた統
計量比と、しきい値とをエッジ判定手段9において比較
され、しきい値より大きければエッジ判定手段9が
“1”を、小さければ“0”を出力して上記局所領域中
心の画素がエッジであるか否かを判定する。
2 sent to the statistical quantity ratio calculating means 8 in this way
From the two data, the mean squared μ 2 and the statistic ratio V / μ 2 of the variances in the local region are obtained. The obtained statistic ratio and the threshold value are compared by the edge determination means 9, and if larger than the threshold value, the edge determination means 9 outputs "1", and if smaller, outputs "0" to output the center of the local area. It is determined whether the pixel of is an edge.

【0030】ここで上記統計量比の性質について説明す
る。いま図2(a)のような画像データがあるとすると、
この画像の局所領域のヒストグラムは図2(b)のように
なり、分散値Vは局所領域内が画像のエッジ部分を含む
ところでは、大きくなり、含まないところでは小さくな
ることがわかる。
The nature of the statistical ratio will be described below. If there is image data as shown in Fig. 2 (a),
The histogram of the local area of this image is as shown in FIG. 2 (b), and it can be seen that the variance value V is large when the local area includes the edge portion of the image and is small when it does not.

【0031】一方、局所領域内の平均値μは、その局所
領域における背景の輝度として考えることができるの
で、統計量比V/μ2は、局所領域の背景輝度に対して
その局所領域内の輝度変化がどれだけ大きいかを調べる
尺度となることがわかる。したがって、上記統計量比V
/μ2は画像中のエッジの強度に応じて変化することに
なり、これをしきい値と比較することによりエッジが検
出できるわけである。
On the other hand, since the average value μ in the local area can be considered as the background brightness in the local area, the statistic ratio V / μ 2 is calculated as follows: It can be seen that this is a measure for examining how large the brightness change is. Therefore, the statistic ratio V
/ Μ 2 changes depending on the intensity of the edge in the image, and the edge can be detected by comparing this with a threshold value.

【0032】また、上記統計量比が照度に影響されない
性質について説明する。いま再び入射光をi、局所領域
内(N=m×n画素)における画像データをI(1,1)〜
I(m,n)とし、この領域内における表面反射率をr
(1,1)〜r(m,n)、背景輝度をI′、背景の表面反
射率をr′と定義する。このとき入射光iは局所領域内
でほぼ一定であると考えることができる。また、画像デ
ータを平均値算出手段3を通すことにより得た局所領域
内での平均値μは、近似的に背景輝度I′に置き換えら
れると考えると前述の数5により数9が成り立つ。
Further, the property that the statistic ratio is not influenced by the illuminance will be described. Now, the incident light is i again, and the image data in the local region (N = m × n pixels) is I (1,1)-
I (m, n), and the surface reflectance in this region is r
(1,1) to r (m, n), the background brightness is defined as I ', and the surface reflectance of the background is defined as r'. At this time, the incident light i can be considered to be substantially constant in the local region. Further, if it is considered that the average value μ in the local area obtained by passing the image data through the average value calculating means 3 is approximately replaced by the background luminance I ′, then the above-mentioned expression 5 holds and the expression 9 is established.

【0033】[0033]

【数9】μ=I′=i×r′ すると、画像データを分散値算出手段4を通すことによ
り得られる局所領域内での分散値Vは数8および数9に
より数10のようになる。
When μ = I ′ = i × r ′, the variance value V in the local area obtained by passing the image data through the variance value calculating means 4 is given by the following equations 8 and 9: ..

【0034】[0034]

【数10】 [Equation 10]

【0035】したがって、局所領域内の上記統計量比V
/μ2は数11のように求まる。
Therefore, the statistic ratio V in the local region is
/ Μ 2 is calculated as in Eq.

【0036】[0036]

【数11】 [Equation 11]

【0037】すなわち、統計量比V/μ2は反射率r及
びr′の値のみによって決定され、入射光iに依存しな
いことがわかる。
That is, it can be seen that the statistic ratio V / μ 2 is determined only by the values of the reflectances r and r'and does not depend on the incident light i.

【0038】したがって数11によれば、図3(a)のよう
に照明が暗くて、検出すべき対象の輝度レベルと背景の
輝度レベルとの差(ΔI)が小さくても、対象部分の反射
率rの変化が背景の反射率r′にくらべて顕著であれ
ば、統計量比V/μ2は相対的に大きくなりエッジとし
て検出することができる。
Therefore, according to equation 11, even if the illumination is dark as shown in FIG. 3A and the difference (ΔI) between the luminance level of the object to be detected and the luminance level of the background is small, the reflection of the object part is reflected. If the change in the rate r is more significant than the background reflectance r ', the statistic ratio V / μ 2 becomes relatively large and can be detected as an edge.

【0039】また反対に図3(b)のように照明が明るく
て、対象外の輝度と背景との輝度差(ΔI)が大きくて
も、対象外の部分の反射率rの変化が背景の反射率r′
にくらべて顕著でなければ、統計量比V/μ2は相対的
に小さくなり、誤ってエッジとして検出されることはな
い。
On the contrary, as shown in FIG. 3 (b), even if the illumination is bright and the difference in brightness (ΔI) between the non-target luminance and the background is large, the change in the reflectance r of the non-target portion causes the background Reflectance r '
If it is not remarkable as compared with the above, the statistic ratio V / μ 2 becomes relatively small and is not erroneously detected as an edge.

【0040】ところで実施例における統計量比V/μ2
に、対数変換を施した輝度比対数値log(V/μ2)は、数
12のようになる。
By the way, the statistics ratio V / μ 2 in the embodiment
And the logarithmically converted luminance ratio logarithmic value log (V / μ 2 ) is
It looks like 12.

【0041】[0041]

【数12】 [Equation 12]

【0042】そこで分散値V及び平均値の2乗μ2に対
数変換を施した後の差分値を用いて、図1における統計
量比算出手段8を図4のような構成にしても本発明は実
施可能である。
Therefore, the statistical value ratio calculating means 8 in FIG. 1 is configured as shown in FIG. 4 by using the difference value after logarithmic conversion of the variance value V and the square μ 2 of the average value. Is feasible.

【0043】すなわち、図4において、対数変換を行う
ために、対数変換手段81と82を用意し、対数変換後の差
分値を求めるため差分値算出手段83を用いる。このよう
にすると図1のバッファ6の、局所領域内の平均値の2
乗μ2の出力と、バッファ7が出力する局所領域内の分
散値Vは、それぞれ、図4の対数変換手段81,82により
夫々対数変換され、log(μ2),log(V)が得られる。つ
ぎに差分値算出手段83により統計量比対数値=log(V)
−log(μ2)が求められ、上記統計量比算出手段が実現で
きる。このようにすれば、構造が複雑な除算器を用いな
くて済むという利点がある。
That is, in FIG. 4, logarithmic conversion means 81 and 82 are prepared to perform logarithmic conversion, and the difference value calculation means 83 is used to obtain the difference value after logarithmic conversion. In this way, the average value of 2 in the local area of the buffer 6 in FIG.
The output of the power μ 2 and the variance value V in the local area output by the buffer 7 are logarithmically converted by the logarithmic conversion means 81 and 82 of FIG. 4, respectively, to obtain log (μ 2 ) and log (V). Be done. Next, the difference value calculating means 83 calculates the statistical ratio logarithmic value = log (V).
−log (μ 2 ) is obtained, and the statistic ratio calculating means can be realized. This has the advantage that it is not necessary to use a divider with a complicated structure.

【0044】以上本発明を説明したが、本発明は画像デ
ータを平均値算出手段を通すことにより得た局所領域内
での平均値を2乗した値と、画像データを分散値算出手
段を通すことにより得た局所領域内での分散値の比を用
いてエッジを検出しているので、照明条件によって検出
すべき対象の輝度レベルと背景の輝度レベルとの輝度差
が小さい場合や、対象外の輝度と背景の輝度との輝度差
が大きい場合でも、背景を含む画像中から対象とする画
像のエッジ部分のみを確実に検出することができる。ま
た本発明は局所領域内の統計量、すなわち平均値と分散
値を用いているので、画像データ中にランダムノイズ等
が含まれる場合においても、その影響が少なく、エッジ
を正しく検出することができる。
Although the present invention has been described above, the present invention passes the value obtained by squaring the average value in the local area obtained by passing the image data through the average value calculating means, and the image data through the variance value calculating means. Since the edge is detected using the ratio of the variance values in the local area obtained by the above, if the brightness difference between the target brightness level to be detected and the background brightness level is small depending on the lighting conditions, Even if there is a large difference in brightness between the background brightness and the background brightness, it is possible to reliably detect only the edge portion of the target image from the image including the background. Further, since the present invention uses the statistic in the local area, that is, the average value and the variance value, even when random noise is included in the image data, the influence is small and the edge can be detected correctly. ..

【0045】なお、上記統計量比を算出するときに用い
た分散値は、局所領域内の各画像データを2乗し、これ
を平均した値、すなわち2乗平均値を用いて代用しても
良い。なぜならば、数11の右辺から明らかなように、上
記2乗平均と、平均の2乗によるその統計量比は数が1
つ増えるだけであるので、しきい値を1つ小さくすれ
ば、実施できるからである。このように上記分散値の代
わりに上記2乗平均値を用いることにより、分散値を算
出する場合の平均値を算出する前処理を省くことができ
る。
The variance value used when calculating the statistic ratio may be obtained by squaring each image data in the local area and averaging the squared values, that is, the mean square value may be used instead. good. This is because, as is clear from the right side of Equation 11, the square mean and the statistic ratio by the square of the mean are 1
This is because it only increases by one, and can be implemented by reducing the threshold value by one. Thus, by using the square mean value instead of the variance value, it is possible to omit the preprocessing for calculating the mean value when the variance value is calculated.

【0046】また、統計量比は、その逆数を用いてもよ
い。この場合、エッジ判定手段は上記統計量比の逆数
が、しきい値より小さければ“1”を出力し、大きけれ
ば“0”を出力するような手段になる。
The reciprocal of the statistical quantity ratio may be used. In this case, the edge determining means outputs "1" if the reciprocal of the statistic ratio is smaller than the threshold value, and outputs "0" if it is larger.

【0047】さらに、局所領域(マスク)の画素サイズは
3×3の場合を示したが、これに限らず、4×4,5×
5,あるいはそれ以外の画素サイズであってもよい。
Furthermore, although the pixel size of the local area (mask) is 3 × 3, it is not limited to this, and 4 × 4, 5 ×
The pixel size may be 5, or any other pixel size.

【0048】[0048]

【発明の効果】以上説明にしたように本発明のエッジ検
出装置は、画像データを平均値算出手段を通して得た局
所領域内での平均値を2乗した値と、画像データを分散
値算出手段を通すことにより得た局所領域内での分散値
の比を用いてエッジを検出しているので、照明条件によ
って検出すべき対象の輝度レベルと背景の輝度レベルと
の輝度差が小さい場合や、対象外の輝度と背景の輝度と
の輝度差が大きい場合であっても、背景を含む画像中か
ら対象とする画像のエッジ部分のみを確実に検出するこ
とができる。また、画像中にランダムノイズ等が含まれ
る場合でもノイズに影響されずに正しくエッジを検出で
きる効果を有する。
As described above, in the edge detecting apparatus of the present invention, the value obtained by squaring the average value of the image data in the local region obtained through the average value calculating means and the image data variance value calculating means. Since the edge is detected using the ratio of the variance values in the local area obtained by passing through, when the brightness difference between the brightness level of the target to be detected and the brightness level of the background depending on the illumination condition is small, or Even if the difference in brightness between the non-target brightness and the background brightness is large, it is possible to reliably detect only the edge portion of the target image from the image including the background. Further, even when random noise or the like is included in the image, there is an effect that an edge can be correctly detected without being affected by noise.

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

【図1】本発明の一実施例の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention.

【図2】図1の動作説明用の画像データの図である。FIG. 2 is a diagram of image data for explaining the operation of FIG.

【図3】本発明の照明により変化する動作特性を説明す
る図である。
FIG. 3 is a diagram illustrating an operating characteristic that changes according to the illumination of the present invention.

【図4】図1における統計量比算出手段の他の例の構成
を示すブロック図である。
FIG. 4 is a block diagram showing the configuration of another example of the statistic ratio calculating means in FIG.

【図5】従来のエッジ検出装置の概略ブロック図であ
る。
FIG. 5 is a schematic block diagram of a conventional edge detection device.

【図6】本発明の実施例と従来例を説明するための局所
領域内の画像データの配置図(a)、及び従来例における
空間フィルタのオペレーションマスク構成図(b)であ
る。
FIG. 6 is a layout diagram (a) of image data in a local area for explaining an embodiment of the present invention and a conventional example, and an operation mask configuration diagram (b) of a spatial filter in the conventional example.

【図7】従来例を説明するソーベルフィルタの水平方向
のオペレーションマスク構成図(a)、及び垂直方向のオ
ペレーションマスク構成図(b)である。
FIG. 7 is a horizontal operation mask configuration diagram (a) and a vertical operation mask configuration diagram (b) of a Sobel filter for explaining a conventional example.

【図8】従来例における動作特性を説明する図である。FIG. 8 is a diagram illustrating operating characteristics in a conventional example.

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

1…画像メモリ、 2…遅延手段、 3…平均値算出手
段、 4…分散値算出手段、 5…乗算器、 6,7…
バッファ、 8…統計量比算出手段、 9…エッジ判定
手段、 10…制御部、 81,82…対数変換手段、 83…
差分値算出手段。
DESCRIPTION OF SYMBOLS 1 ... Image memory, 2 ... Delay means, 3 ... Average value calculation means, 4 ... Variance value calculation means, 5 ... Multiplier, 6, 7 ...
Buffer, 8 ... Statistics ratio calculation means, 9 ... Edge determination means, 10 ... Control section, 81, 82 ... Logarithmic conversion means, 83 ...
Difference value calculation means.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 画像データから局所領域内での平均値を
求める平均値算出手段と、上記局所領域内の分散値を求
める分散値算出手段と、上記平均値算出手段より求めた
平均値を2乗する手段と、上記平均値の2乗と上記分散
値算出手段より求めた分散値の比を算出する統計量比算
出手段と、該統計量比算出手段の出力を、しきい値と比
較することにより上記画像データがエッジであるか否か
を判定するエッジ判定手段とを備えたことを特徴とする
エッジ検出装置。
1. An average value calculating means for calculating an average value in a local area from image data, a dispersion value calculating means for calculating a dispersion value in the local area, and an average value calculated by the average value calculating means is 2 Means for multiplying, a statistic amount ratio calculating unit for calculating a ratio of the square of the average value and the variance value calculated by the variance value calculating unit, and an output of the statistic amount ratio calculating unit is compared with a threshold value. An edge detection device comprising: an edge determination unit that determines whether or not the image data is an edge.
【請求項2】 統計量比算出手段は、平均値算出手段よ
り求めた局所領域内の平均値を2乗した値と、分散値算
出手段より求めた局所領域内の分散値を各々対数変換す
る手段と、該対数変換手段による対数変換後の出力の差
分値を求める差分値算出手段により構成したことを特徴
とする請求項1記載のエッジ検出装置。
2. The statistic ratio calculation means logarithmically transforms a value obtained by squaring the average value in the local area obtained by the average value calculation means and a variance value in the local area obtained by the variance value calculation means. 2. The edge detecting apparatus according to claim 1, further comprising: a means and a difference value calculating means for obtaining a difference value of the output after the logarithmic conversion by the logarithmic converting means.
JP3333636A 1991-12-17 1991-12-17 Edge detection device Pending JPH05165965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3333636A JPH05165965A (en) 1991-12-17 1991-12-17 Edge detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3333636A JPH05165965A (en) 1991-12-17 1991-12-17 Edge detection device

Publications (1)

Publication Number Publication Date
JPH05165965A true JPH05165965A (en) 1993-07-02

Family

ID=18268267

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3333636A Pending JPH05165965A (en) 1991-12-17 1991-12-17 Edge detection device

Country Status (1)

Country Link
JP (1) JPH05165965A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006029891A (en) * 2004-07-14 2006-02-02 Toppan Printing Co Ltd Pattern image measurement method and pattern image measurement device using it

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006029891A (en) * 2004-07-14 2006-02-02 Toppan Printing Co Ltd Pattern image measurement method and pattern image measurement device using it
JP4604582B2 (en) * 2004-07-14 2011-01-05 凸版印刷株式会社 Pattern image measurement method

Similar Documents

Publication Publication Date Title
CN108827970B (en) AOI system-based method and system for automatically judging defects of different panels
US6269194B1 (en) Method and apparatus using image subtraction and dynamic thresholding
JP3083918B2 (en) Image processing device
US8000501B2 (en) Method and product for detecting abnormalities
CN111968144A (en) Image edge point acquisition method and device
US6531707B1 (en) Machine vision method for the inspection of a material for defects
US6721461B1 (en) Method and apparatus using image subtraction and dynamic thresholding
US20040120599A1 (en) Detection and enhancement of backlit images
US6681037B1 (en) Apparatus for locating features of an object using varied illumination
US20080246862A1 (en) Defect and maintenance detection for image capture device
JP3189588B2 (en) Surface defect inspection equipment
JPH06130513A (en) Method for identifying film form
JPH05165965A (en) Edge detection device
JP2961962B2 (en) Edge detection device
Tattersall et al. Adaptive shadow identification through automatic parameter estimation in video sequences
JP2005283197A (en) Detecting method and system for streak defect of screen
US6768812B1 (en) Method for locating features on an object using varied illumination
JP2000180375A (en) Method and apparatus for inspecting flat panel display device
JP3464182B2 (en) Processing color images
JP2003141550A (en) Position detection method
JP3038092B2 (en) Appearance inspection method
JPH034150A (en) Evaluating method for recording quality
JP3912063B2 (en) Detection method of image shading unevenness
JP2697258B2 (en) Quality inspection method of surface treated steel sheet
JP6690316B2 (en) Defect inspection apparatus, defect inspection method and defect inspection system for sheet-like inspected object