JP2004272885A - Device and method for edge extraction - Google Patents
Device and method for edge extraction Download PDFInfo
- Publication number
- JP2004272885A JP2004272885A JP2004011917A JP2004011917A JP2004272885A JP 2004272885 A JP2004272885 A JP 2004272885A JP 2004011917 A JP2004011917 A JP 2004011917A JP 2004011917 A JP2004011917 A JP 2004011917A JP 2004272885 A JP2004272885 A JP 2004272885A
- Authority
- JP
- Japan
- Prior art keywords
- reference point
- search
- value
- edge
- difference
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 68
- 238000000605 extraction Methods 0.000 title claims abstract description 63
- 230000002093 peripheral effect Effects 0.000 claims description 59
- 238000012360 testing method Methods 0.000 claims description 28
- 230000002950 deficient Effects 0.000 claims description 10
- 230000010354 integration Effects 0.000 abstract description 5
- 230000008569 process Effects 0.000 description 34
- 238000012545 processing Methods 0.000 description 27
- 238000012986 modification Methods 0.000 description 20
- 230000004048 modification Effects 0.000 description 20
- 238000010586 diagram Methods 0.000 description 18
- 238000007689 inspection Methods 0.000 description 13
- 238000005070 sampling Methods 0.000 description 8
- 230000008859 change Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、検査画像中の対象物のエッジを抽出するエッジ抽出装置および方法に関する。 The present invention relates to an edge extracting device and an edge extracting method for extracting an edge of an object in an inspection image.
製品もしくは製造中の製品の部品の位置を特定する場合に、検査領域の輝度分布に基づいて部品のエッジを抽出する方法がある。この方法は、「図形上のエッジ付近では明暗の差が非常に大きい」という性質、すなわち境界付近の輝度勾配を利用したものであり、この方法では、製品の検査領域内の輝度投影値の輝度変化がおよそ最大となるような点の集合をもってエッジとしている(例えば、特許文献1参照)。 When specifying the position of a product or a component of a product being manufactured, there is a method of extracting the edge of the component based on the luminance distribution of the inspection area. This method utilizes the property that "the difference in brightness is very large near the edge on the figure", that is, the brightness gradient near the boundary. In this method, the brightness of the brightness projection value in the inspection area of the product is used. An edge is a set of points at which the change is approximately maximum (for example, see Patent Document 1).
図6は、従来例によるエッジ抽出方法を説明する図である。 FIG. 6 is a diagram illustrating an edge extraction method according to a conventional example.
ここでは、図6(a)に示すような対象物のエッジLを抽出する例について説明する。図示のようにxy座標軸をとる。 Here, an example of extracting an edge L of a target as shown in FIG. 6A will be described. The xy coordinate axes are taken as shown.
まず、検査画像中の対象物Qについて、そのエッジLが存在すると思われるおおよその位置に、このエッジLが含まれるようなある程度の大きさを有するエッジサンプリング領域Rを設定する。 First, for an object Q in an inspection image, an edge sampling region R having a certain size that includes the edge L is set at an approximate position where the edge L is considered to exist.
次に、エッジサンプリング領域R内において、エッジLのおよその方向(図6ではx軸方向)に対して直角の方向(すなわちy軸方向)の輝度分布を測定する。この測定により、図6(b)に示すような明暗の輝度分布が得られる。 Next, in the edge sampling region R, a luminance distribution in a direction perpendicular to the approximate direction of the edge L (x-axis direction in FIG. 6) (that is, y-axis direction) is measured. By this measurement, a bright and dark luminance distribution as shown in FIG. 6B is obtained.
そして、図6(b)に示した輝度分布を、y軸方向に亘って微分する。この微分処理により、図6(c)に示すよう微分値が得られる。このとき、微分値が最大をとる位置、つまり輝度変化が最大である位置が、対象物QのエッジL上の1点を意味する。 Then, the luminance distribution shown in FIG. 6B is differentiated along the y-axis direction. By this differentiation processing, a differential value is obtained as shown in FIG. At this time, the position where the differential value is maximum, that is, the position where the luminance change is maximum means one point on the edge L of the object Q.
上記の処理をエッジサンプリング領域R内のx軸方向に亘って複数実行し、微分値が最大となる点の集合を得る。そして得られた複数の点の集合から最小2乗法を用いてエッジLを抽出する。 A plurality of the above processes are performed in the x-axis direction in the edge sampling region R to obtain a set of points having the maximum differential value. Then, an edge L is extracted from the obtained set of points using the least squares method.
上述の方法は、検査画像の輝度分布が比較的安定し、ノイズ成分が存在しない場合、あるいはエッジに曲線部分を含まない場合には有効である。 The above-described method is effective when the luminance distribution of the inspection image is relatively stable and there is no noise component, or when the edge does not include a curved portion.
しかし、例えば検査対象の製品に傷があったり、明暗のコントラストが弱かったりもしくは反射輝度のムラが大きい場合は、本来のエッジ以外の位置で輝度変化が異常に大きくなることがある。このとき、輝度分布を微分したときに現れる微分値の最大値が、本来あるべき傾向とは極端にずれた位置に異常点として現れてしまう。この場合、上述のように最小2乗法を適用すると、誤差を多く含んだエッジが抽出されてしまうことになる。またこのとき、例えばロバスト推定を用いたとしても、ノイズの影響が大きい場合は誤差を除去するのが困難である。 However, for example, when the product to be inspected is damaged, the contrast between light and dark is weak, or the unevenness of the reflected luminance is large, the luminance change may be abnormally large at a position other than the original edge. At this time, the maximum value of the differential value that appears when the luminance distribution is differentiated appears as an abnormal point at a position that is extremely different from the original tendency. In this case, if the least squares method is applied as described above, an edge containing many errors will be extracted. At this time, even if robust estimation is used, it is difficult to remove the error when the influence of noise is large.
また、対象物が円形もしくは楕円形などのような曲線部分を含む形状である場合は、上述のエッジサンプリング領域の、エッジが存在し得る方向(例えば図6ではx軸方向)の幅を細かくする必要がある。つまり、対象物が曲線部分を含む形状である場合は、この曲線部分を直線近似する必要がある。したがってエッジサンプリング領域をより細かく取るので、特に検査対象の製品に傷があったり、明暗のコントラストが弱かったりもしくは反射輝度のムラが大きい場合は、その後の最小2乗法処理による誤差はより大きくなりやすい。 When the object has a shape including a curved portion such as a circle or an ellipse, the width of the edge sampling area in the direction in which an edge can exist (for example, the x-axis direction in FIG. 6) is reduced. There is a need. That is, when the target has a shape including a curved portion, the curved portion needs to be linearly approximated. Therefore, since the edge sampling area is made finer, the error due to the subsequent least squares process is likely to be larger especially when the product to be inspected is damaged, when the contrast between light and dark is weak, or when the unevenness of the reflected luminance is large. .
従って本発明の目的は、上記問題に鑑み、画像サーチ領域内の対象物のエッジを抽出するエッジ抽出装置および方法において、ノイズ成分を多く含んだエッジ抽出対象画像であっても、安定して対象物のエッジを抽出できるエッジ抽出装置および方法を提供することにある。 Therefore, an object of the present invention is to provide an edge extraction apparatus and method for extracting an edge of an object in an image search area, in which an edge extraction target image containing a large amount of noise components is stably An object of the present invention is to provide an edge extracting device and an edge extracting method capable of extracting an edge of an object.
上記目的を実現するために、本発明によれば、画像サーチ領域内に含まれるエッジ抽出すべき対象物が円形状である場合、次のような処理により、対象物のエッジを抽出する。 In order to achieve the above object, according to the present invention, when an object included in an image search area to be extracted has a circular shape, an edge of the object is extracted by the following processing.
まず、画像サーチ領域内の任意の位置に基準点をとり、この基準点を中心とした同心円状の複数の探査図形の円周に沿った輝度投影値を積算して得られた積算値について、隣接する探査図形間における差分値を計算し、最大となる前記差分値を抽出してこれを当該基準点における最大差分候補値として保持する。 First, a reference point is set at an arbitrary position in the image search area, and an integrated value obtained by integrating luminance projection values along the circumference of a plurality of concentric exploration figures centered on the reference point, A difference value between adjacent search patterns is calculated, and the maximum difference value is extracted and held as a maximum difference candidate value at the reference point.
そして、基準点の位置をずらして上述のようにして得られた複数の最大差分候補値のうち、最大の最大差分候補値を示すときの探査図形を、対象物のエッジとして確定する。 Then, among the plurality of maximum difference candidate values obtained as described above by shifting the position of the reference point, the search pattern showing the largest maximum difference candidate value is determined as the edge of the object.
隣接する探査図形間の積算された輝度投影値の差分値が大きいということは、隣接する探査図形間の円周上の輝度が大きく変化しているということ、すなわち明暗の差が大きいということを意味する。つまり、対象物のエッジが輝度の明暗の境界線となるので、隣接する探査図形間の積算された輝度投影値の差分値が最大となる最大差分候補値が得られるのは、探査図形の円周が、対象物のエッジに最も近くなるときである。対象物のエッジに近い探査図形の円周部分が多ければ多いほど、最大差分候補値は大きくなる。すなわち、複数の最大差分候補値のうち最も大きい差分である最大差分値を示すときの探査図形の近傍は、対象物のエッジが存在する確率が最も高い部分であるといえる。そこで、本発明によるエッジ抽出装置およびその方法では、最大差分値を示すときの探査図形を、エッジ抽出対象物のエッジであると確定する。すなわち、本発明では、対象物のエッジ近傍の輝度勾配を利用している。 The fact that the difference value of the integrated luminance projection values between adjacent search patterns is large means that the luminance on the circumference between adjacent search patterns has changed greatly, that is, the difference in brightness is large. means. In other words, since the edge of the object is the boundary line between the brightness and darkness, the maximum difference candidate value that maximizes the difference between the integrated brightness projection values between adjacent search patterns is obtained only in the circle of the search pattern. This is when the circumference is closest to the edge of the object. The greater the circumference of the search pattern close to the edge of the object, the greater the maximum difference candidate value. In other words, it can be said that the vicinity of the search pattern when the maximum difference value that is the largest difference among the plurality of maximum difference candidate values is present is the portion where the probability that the edge of the target object exists is the highest. Therefore, in the edge extraction device and the method thereof according to the present invention, the search pattern showing the maximum difference value is determined to be the edge of the edge extraction target. That is, in the present invention, the brightness gradient near the edge of the object is used.
図1は、本発明によるエッジ抽出装置の基本ブロック図である。
本発明によれば、画像サーチ領域内に含まれる円形状の対象物のエッジを抽出するエッジ抽出装置1は、
画像サーチ領域内の任意の位置に基準点を設定する第1の手段11と、
複数の探査図形を、基準点を中心する同心円形状となるように設定する第2の手段12と、
各探査図形について、円周に沿った輝度投影値を積算し、積算値の集合を得る第3の手段13と、
隣接する探査図形間において積算値の差分値を計算する第4の手段14と、
第4の手段14で計算された差分値の集合の中から、最大となる差分値を抽出し、これを当該基準点における最大差分候補値として保持する第5の手段15と、
第1の手段11で設定する基準点の位置を画像サーチ領域内で切り替えて第2、第3、第4および第5の手段12、13、14および15によって得られた複数の最大差分候補値のうち、最大となる最大差分候補値を抽出し、これを最大差分値として保持する第6の手段16と、
最大差分値のときの探査図形を、対象物のエッジとして確定する第7の手段17と、を備える。
FIG. 1 is a basic block diagram of an edge extraction device according to the present invention.
According to the present invention, the
First means 11 for setting a reference point at an arbitrary position in the image search area;
A second means 12 for setting a plurality of exploration figures so as to form a concentric circle centering on the reference point;
Third means 13 for integrating the luminance projection values along the circumference for each of the exploration figures to obtain a set of integrated values;
Fourth means 14 for calculating a difference value of an integrated value between adjacent search patterns,
A fifth means 15 for extracting a maximum difference value from a set of difference values calculated by the fourth means 14 and holding the same as a maximum difference candidate value at the reference point;
A plurality of maximum difference candidate values obtained by the second, third, fourth and fifth means 12, 13, 14 and 15 by switching the position of the reference point set by the
Seventh means 17 for determining the search pattern at the time of the maximum difference value as an edge of the object.
また、エッジ抽出すべき対象物の形状が、上述のような円形以外である場合、もしくは予め形状が分かっていないような場合でも、本発明を用いて画像サーチ領域内の対象物のエッジを抽出することが可能である。この場合、エッジ抽出すべき対象物のおおよその輪郭に関する情報を取得する。この情報に基づいて基準探査図形を生成し、基準探査図形を相似の基準とした探査図形を設定する。 Further, even when the shape of the object to be edge-extracted is other than the above-described circular shape or when the shape is not known in advance, the edge of the object in the image search area is extracted using the present invention. It is possible to do. In this case, information on the approximate contour of the object to be edge-extracted is obtained. A reference search pattern is generated based on this information, and a search pattern is set using the reference search pattern as a similar reference.
当然、エッジ抽出すべき対象物の形状が予め分かっている場合でも、本発明を用いて画像サーチ領域内の対象物のエッジを抽出することは可能である。例えば、対象物の形状が、楕円形や多角形などを表す方程式で規定できる場合がこれに相当する。この方程式に基づいて、対象物に相似な探査図形を設定する。 Naturally, even when the shape of the object to be edge extracted is known in advance, it is possible to extract the edge of the object in the image search area using the present invention. For example, this corresponds to a case where the shape of the object can be defined by an equation representing an ellipse, a polygon, or the like. Based on this equation, a search pattern similar to the target object is set.
この探査図形を用いて、次のような処理により、対象物のエッジを抽出する。 Using the search pattern, the edge of the target object is extracted by the following processing.
まず、画像サーチ領域内の任意の位置に基準点をとりこの基準点を基準とした対象物に相似な複数の探査図形の外周に沿った輝度投影値を積算して得られた積算値について、隣接する探査図形間における差分値を計算し、最大となる差分値を抽出してこれを当該基準点における最大差分候補値として保持する。 First, an integrated value obtained by taking a reference point at an arbitrary position in the image search area and integrating luminance projection values along the outer perimeter of a plurality of exploration figures similar to an object based on this reference point, A difference value between adjacent search patterns is calculated, a maximum difference value is extracted, and this is held as a maximum difference candidate value at the reference point.
そして、基準点の位置をずらして得られた複数の最大差分候補値のうち、最大の最大差分候補値を示すときの探査図形を、対象物のエッジとして確定する。 Then, of the plurality of maximum difference candidate values obtained by shifting the position of the reference point, the search pattern showing the largest maximum difference candidate value is determined as the edge of the object.
この場合のシステム構成は上述の図1とほぼ同様であるが、特に次の各手段は、その機能が拡張される。 The system configuration in this case is almost the same as that of FIG. 1 described above, but the functions of the following units are particularly expanded.
すなわち、まず、第1の手段11では、画像サーチ領域内の任意の位置に基準点を設定し、第2の手段12では、基準点を基準とし、かつ、対象物に相似な複数の探査図形を設定する。そして、第3の手段は、各探査図形について、探査図形の外周に沿った輝度投影値を積算し、積算値の集合を得る。そして、第7の手段17は、上述の第4の手段14、第5の手段15および第6の手段16を経て得られた最大差分値のときの探査図形を、対象物のエッジとして確定する。 That is, first, the first means 11 sets a reference point at an arbitrary position in the image search area, and the second means 12 sets a plurality of search patterns based on the reference point and similar to the object. Set. Then, the third means integrates the luminance projection values along the outer periphery of the search pattern with respect to each search pattern to obtain a set of integrated values. Then, the seventh means 17 determines the search pattern at the time of the maximum difference value obtained through the above-described fourth means 14, fifth means 15, and sixth means 16 as an edge of the object. .
このように上記システムは、図1を参照して既に説明したシステムを包含するものである。したがって、対象物が円形状である場合にも当然適用することができる。 Thus, the above system includes the system already described with reference to FIG. Therefore, the present invention can be applied to a case where the target object has a circular shape.
上述の手法によれば、探査図形の位置をずらして複数の最大差分候補値を得て、最大の最大差分候補値を示すときの探査図形を、対象物のエッジとして確定する。エッジ抽出結果に精度を求める場合は、探査図形の基準点の位置は細かく(例えば1ピクセルずつずらすように)設定するのが好ましい。この手法の変形として、システムが処理すべき演算量を減らし、処理の高速化を図るために、上記処理の前処理として、基準点となるべき候補点を予め算出する処理(以下、「粗サーチ処理」と称する。)を設けてもよい。 According to the above-described method, a plurality of maximum difference candidate values are obtained by shifting the position of the search pattern, and the search pattern indicating the maximum maximum difference candidate value is determined as the edge of the object. When accuracy is required for the edge extraction result, it is preferable to set the position of the reference point of the search pattern finely (for example, so as to be shifted by one pixel). As a modification of this method, in order to reduce the amount of calculation to be performed by the system and to speed up the processing, as a pre-processing of the above processing, a processing of calculating a candidate point to be a reference point in advance (hereinafter referred to as “rough search Process).
エッジ抽出すべき対象物の形状が円形である場合の粗サーチ処理は次の通りである。まず、画像サーチ領域内の任意の位置に粗サーチ基準点をとりこの粗サーチ基準点を中心とした所定の半径差を有する2同心円状の粗サーチ図形を設定する。次に、粗サーチ図形の外周および内周に沿った輝度投影値を積算して外周積算値および内周積算値を得る。次いで、外周積算値と内周積算値との差分である外内差分値を計算する。そして、粗サーチ基準点の位置を画像サーチ領域内において所定の半径差以下の距離だけずらして得られた外内差分値を参照して、粗サーチ図形の粗サーチ基準点の中から基準点となるべき候補点を確定する。 The rough search processing when the shape of the object to be edge-extracted is circular is as follows. First, a coarse search reference point is set at an arbitrary position in the image search area, and two concentric coarse search figures having a predetermined radius difference centered on the coarse search reference point are set. Next, the luminance projection values along the outer periphery and the inner periphery of the rough search graphic are integrated to obtain the outer periphery integrated value and the inner periphery integrated value. Next, an outer-internal difference value, which is a difference between the outer peripheral integrated value and the inner peripheral integrated value, is calculated. Then, with reference to the outer-internal difference value obtained by shifting the position of the coarse search reference point by a distance equal to or less than a predetermined radius difference in the image search area, the reference point is determined from the coarse search reference points of the coarse search graphic. Determine candidate points to be formed.
また、エッジ抽出すべき対象物の形状が、上述のような円形以外である場合、もしくは予め形状が分かっていないような場合の粗サーチ処理は、上述の粗サーチ図形を、画像サーチ領域内の任意の位置に設定された粗サーチ基準点を基準とし、かつ、対象物に相似な2つの大きさの異なる外周図形および内周図形からなるように設定する。 Further, when the shape of the object to be edge-extracted is other than the circular shape as described above, or when the shape is not known in advance, the coarse search processing is performed by using the coarse search graphic described above in the image search area. Based on a coarse search reference point set at an arbitrary position, the rough search reference point is set to be composed of two outer peripheral figures and inner peripheral figures having different sizes similar to the object.
本発明によれば、画像サーチ領域内の対象物のエッジを抽出するエッジ抽出装置および方法において、ノイズ成分を多く含んだエッジ抽出対象画像であっても、安定して対象物のエッジを抽出することができる。 According to the present invention, in an edge extraction apparatus and method for extracting an edge of an object in an image search area, an edge of the object is stably extracted even for an edge extraction target image containing a large amount of noise components. be able to.
すなわち、従来例のように最小2乗法を用いずにエッジの方向を特定するので、画像サーチ領域内に大きなノイズがあったとしてもその影響を受けることはない。例えばエッジ抽出対象の製品に傷があったり、明暗のコントラストが弱かったりもしくは反射輝度のムラが大きい場合であっても、安定して対象物のエッジを抽出することができる。 That is, since the direction of the edge is specified without using the least square method as in the conventional example, even if there is a large noise in the image search area, it is not affected. For example, even when a product to be edge-extracted has a flaw, a light-dark contrast is weak, or unevenness of reflection luminance is large, an edge of the object can be stably extracted.
特に本発明によれば、対象物が円形もしくは楕円形などのような曲線部分を含む形状である場合であっても、最小2乗法を使わずに、安定して対象物のエッジを抽出することができる。 In particular, according to the present invention, even when the object has a shape including a curved portion such as a circle or an ellipse, it is possible to stably extract the edge of the object without using the least squares method. Can be.
また、本発明に従ってエッジが抽出された対象物の形状が、どの程度の精度の円形であるか、すなわち、円形として正常なものなのかあるいは不良であるのかについての検査も容易に実現することができる。 In addition, it is possible to easily realize an inspection as to how accurate the shape of the object from which an edge is extracted according to the present invention is, that is, whether the shape is normal or defective as a circle. it can.
また、エッジ抽出すべき対象物の形状が円形以外である場合、予め形状が分かっていないような場合、もしくは対象物の形状を規定する幾何学式が予め分かっている場合でも、本発明を用いて画像サーチ領域内の対象物のエッジを抽出することが可能であり、エッジ抽出すべき対象物の形状が円形状である場合と同様の効果を得ることができる。 The present invention is also used when the shape of the object to be edge-extracted is other than a circle, when the shape is not known in advance, or when the geometrical expression that defines the shape of the object is known in advance. Thus, the edge of the object in the image search area can be extracted, and the same effect as when the shape of the object to be edge-extracted is circular can be obtained.
また、上記処理の前処理として、基準点となるべき候補点を予め算出する粗サーチ処理を設ければ、システムが処理すべき演算量を減らし、処理の高速化を図ることができる。 Further, if a rough search process for calculating in advance a candidate point to be a reference point is provided as a pre-process of the above process, the amount of calculation to be performed by the system can be reduced and the speed of the process can be increased.
ここでは、画像サーチ領域内のエッジ抽出対象物が円形状である実施例について説明する。なお、以下に説明する各処理は、例えばコンピュータ上のソフトウェア上で実現可能である。 Here, an embodiment will be described in which the edge extraction target in the image search area is circular. Note that each process described below can be realized on software on a computer, for example.
図2は、本発明の実施例によるエッジ抽出方法のフローチャートである。 FIG. 2 is a flowchart of an edge extraction method according to an embodiment of the present invention.
まず、ステップS101において、画像サーチ領域内の任意の位置に基準点を設定する。詳細については後述するが、この基準点は最終的には複数個設定されることになる。画像サーチ領域内における基準点の設置の仕方、例えば設置場所や設置間隔などは本発明を特に限定するものではなく、本発明によるエッジ抽出装置の適用場所、用途、コスト、処理時間、その他種々の要因を考慮して決定すればよい。例えば、エッジ抽出結果に精度を求める場合は、基準点は細かく(例えば1ピクセル分ずらすように)設定し、あるいは、コストや処理時間を考慮する場合は、基準点の設置間隔を大きくして粗く設定すればよい。またあるいは、画像サーチ領域内のある特定の場所に基準点を集中的に設置するようにしてもよい。 First, in step S101, a reference point is set at an arbitrary position in the image search area. Although the details will be described later, a plurality of reference points are ultimately set. The method of setting the reference point in the image search area, for example, the setting place and the setting interval are not particularly limited to the present invention, and the application place, application, cost, processing time, and other various points of the edge extracting device according to the present invention are various. What is necessary is just to determine in consideration of a factor. For example, when accuracy is required for the edge extraction result, the reference point is set finely (for example, shifted by one pixel), or when cost and processing time are taken into consideration, the reference point installation interval is increased to make the reference point coarse. Just set it. Alternatively, the reference points may be intensively set at a specific place in the image search area.
ステップS101で基準点を設定したあとは、複数の探査図形を、この基準点を中心とする同心円形状となるように設定して処理を進めていく。なお、本実施例では、エッジ抽出対象物は円形状であるので探査図形は円形となり、半径の異なる複数の円形状の探査図形を、上記基準点を中心として同心円状に設定していく。このように同心円状に設定した各探査図形について、それぞれの円周に沿った輝度投影値を積算し、積算値の集合を生成する。具体的には次のとおりである。 After setting the reference point in step S101, the process proceeds by setting a plurality of exploration figures so as to form a concentric circle centered on the reference point. In this embodiment, since the object to be extracted has a circular shape, the search pattern is circular, and a plurality of circular search patterns having different radii are set concentrically around the reference point. For each of the search patterns set concentrically in this way, the brightness projection values along the respective circumferences are integrated to generate a set of integrated values. The details are as follows.
まずステップS102において、探査図形の半径を設定する。 First, in step S102, the radius of the search pattern is set.
次いでステップS103において、この探査図形の円周に沿った輝度積算値を計算する。 Next, in step S103, a luminance integrated value along the circumference of the search pattern is calculated.
そして、ステップS104において、ステップS101で設定した基準点を中心とする同心円状の探査図形において、輝度投影値を計算すべき全ての探査図形に関して上記処理が終了したか否かが判定される。 Then, in step S104, it is determined whether or not the above-described processing has been completed for all the search patterns for which luminance projection values are to be calculated for the concentric search patterns centered on the reference point set in step S101.
全ての探査図形に関して処理が終了した場合はステップS105へ進む。 If the processing has been completed for all the search patterns, the process proceeds to step S105.
まだ処理が残っている場合はステップS102へ進み、探査図形の半径を別の値に設定してステップS103へ進む。なお、エッジ抽出結果に精度を求めるならば、円状の探査図形の半径を、同心円状に隣接する探査図形の間隔がより狭くなるように(例えば1ピクセル間隔となるように)比較的こまめに設定すればよい。逆にコストや処理時間を考慮するならば、隣接する探査図形の間隔がより広くなるように比較的粗めに設定すればよい。 If the process still remains, the process proceeds to step S102, the radius of the search pattern is set to another value, and the process proceeds to step S103. If accuracy is required for the edge extraction result, the radius of the circular search pattern is relatively frequently set so that the space between the concentrically adjacent search patterns becomes narrower (for example, one pixel interval). Just set it. Conversely, if cost and processing time are taken into consideration, it is only necessary to set a relatively coarse interval so that the interval between adjacent search patterns becomes wider.
ステップS101で設定した基準点に関して、この基準点を中心とする全ての探査図形に関して処理が終了することにより、同心円状の各探査図形に対応した上記積算値の集合が得られる。すなわち、ステップS101〜S104を経ることにより、設定した基準点に対応する積算値の集合が得られることになる。 With respect to the reference point set in step S101, the process is completed for all the search figures centered on this reference point, whereby a set of the integrated values corresponding to each concentric search figure is obtained. That is, by going through steps S101 to S104, a set of integrated values corresponding to the set reference points is obtained.
ステップS105では、上述のようにして複数の探査図形の円周に沿った輝度投影値を積算して得られた各積算値に対し、隣接する探査図形間における差分値を計算する。この計算の結果、種々の大きさを有する差分値が得られることになる。 In step S105, a difference value between adjacent search patterns is calculated for each integrated value obtained by integrating the luminance projection values along the circumference of the plurality of search patterns as described above. As a result of this calculation, difference values having various magnitudes are obtained.
そして、ステップS106において、ステップS105で得られた複数の差分値の中から、最大となる差分値を抽出したのち、この値を保持する。なお、本明細書ではこの値を「最大差分候補値」と呼ぶ。以上のようにしてステップS101〜S106を経ることにより、設定した基準点に1対1に対応した最大差分候補値が得られることになる。 Then, in step S106, a maximum difference value is extracted from the plurality of difference values obtained in step S105, and this value is held. In this specification, this value is referred to as a “maximum difference candidate value”. Through steps S101 to S106 as described above, the maximum difference candidate value corresponding to the set reference point on a one-to-one basis is obtained.
ステップS107では、上記処理が、画像サーチ領域内に設定され得る全ての基準点に関して終了したか否かが判定される。 In step S107, it is determined whether or not the above processing has been completed for all reference points that can be set in the image search area.
全ての基準点に関して処理が終了した場合はステップS108へ進む。まだ処理が残っている場合はステップS101へ進み、基準点の位置を切り替えてステップS102へ進む。 If the processing has been completed for all the reference points, the process proceeds to step S108. If the process still remains, the process proceeds to step S101, the position of the reference point is switched, and the process proceeds to step S102.
画像サーチ領域内の想定した全ての基準点に関して処理が終了することにより、すなわちステップS101〜S107を経ることにより、画像サーチ領域内の各基準点に対応した最大差分候補値が得られる。対象物のエッジは輝度の明暗の境界線となるので、隣接する探査図形間の積算された輝度投影値の差分値が最大となる最大差分候補値が得られるのは、対象物のエッジに探査図形の円周が最接近する部分が最も多いときである。 By completing the processing for all assumed reference points in the image search area, that is, through steps S101 to S107, the maximum difference candidate value corresponding to each reference point in the image search area is obtained. Since the edge of the object is a boundary line between brightness and darkness, the maximum difference candidate value that maximizes the difference value of the integrated brightness projection values between adjacent search patterns is obtained only when the edge of the object is searched. This is when the circumference of the figure is closest to the most.
ステップS108では、上述のようにして得られた複数の最大差分候補値のうち最大となる最大差分候補値を抽出したのち、これを保持する。本明細書ではこの値を「最大差分値」と呼ぶ。 In step S108, the largest maximum difference candidate value among the plurality of maximum difference candidate values obtained as described above is extracted and held. In this specification, this value is referred to as a “maximum difference value”.
隣接する探査図形間の積算された輝度投影値の差分値が大きいということは、隣接する探査図形間の円周上の輝度が大きく変化しているということ、つまり明暗の差が大きいということを意味する。対象物のエッジは輝度の明暗の境界線となるので、隣接する探査図形間の積算された輝度投影値の差分値が最大となる最大差分候補値が得られるのは、対象物のエッジに探査図形の円周が最接近する部分が最も多いときである。対象物のエッジに近い探査図形の円周部分が多ければ多いほど、最大差分候補値は大きくなる。このことから、複数の最大差分候補値のうち最も大きい差分である最大差分値を示すときの探査図形の近傍は、対象物のエッジが存在する確率が最も高い部分であるといえる。 The fact that the difference value of the integrated luminance projection values between adjacent search patterns is large means that the luminance on the circumference between adjacent search patterns changes greatly, that is, the difference in brightness is large. means. Since the edge of the object is a boundary line between brightness and darkness, the maximum difference candidate value that maximizes the difference value of the integrated brightness projection values between adjacent search patterns is obtained only when the edge of the object is searched. This is when the circumference of the figure is closest to the most. The greater the circumference of the search pattern close to the edge of the object, the greater the maximum difference candidate value. From this, it can be said that the vicinity of the search pattern when the maximum difference value which is the largest difference among the plurality of maximum difference candidate values is indicated is the portion where the probability that the edge of the object exists is the highest.
そこでステップS109において、最大差分値のときの探査図形の中心の位置および半径を特定し、この中心の位置および半径で規定された円形図形を、対象物のエッジとして確定する。 Therefore, in step S109, the position and radius of the center of the search pattern at the time of the maximum difference value are specified, and the circular figure defined by the position and radius of the center is determined as the edge of the object.
図3は、本発明の実施例によるエッジ抽出を具体的に例示する説明図である。 FIG. 3 is an explanatory diagram specifically illustrating edge extraction according to the embodiment of the present invention.
ここでは例として、画像サーチ領域内に存在する対象物Qに対し、図3(a)、(b)および(c)にそれぞれ例示するような位置に基準点P1、P2およびP3を設置し、この基準点を中心とする同心円状の探査図形Sa−i、Sb−iおよびSc−i(iは自然数)を設定する場合について説明する。この例では、対象物Qにおいて、円内の輝度は円外の輝度に比べて明るいとする。なお、図3において、同心円を構成する円の半径の間隔については特に模式的に表したものである。 Here, as an example, reference points P1, P2, and P3 are set at positions as illustrated in FIGS. 3A, 3B, and 3C with respect to an object Q existing in the image search area, A case will be described where concentric search figures Sa-i, Sbi and Sc-i (i is a natural number) centered on this reference point are set. In this example, in the object Q, the luminance inside the circle is assumed to be brighter than the luminance outside the circle. In FIG. 3, the intervals between the radii of the circles forming the concentric circles are particularly schematically illustrated.
対象物Qのエッジが輝度の明暗の境界線となるので、隣接する探査図形間の積算された輝度投影値の差分値が最大となる最大差分候補値が得られるのは、探査図形の円周が、対象物のエッジに最接近する部分が最も多いときである。図3(a)〜(c)のそれぞれの場合において、最大差分候補値を求めると次のとおりである。 Since the edge of the object Q becomes the boundary line of brightness, the maximum difference candidate value that maximizes the difference value of the integrated brightness projection values between adjacent search patterns is obtained only in the circumference of the search pattern. However, this is the case where the portion closest to the edge of the object is the most. In each case of FIGS. 3A to 3C, the maximum difference candidate value is obtained as follows.
まず、基準点P1を、対象物Qに対して図3(a)に示すような位置関係になるように設定した場合について考える。図2のステップS101〜S106の処理を経て、最大差分候補値を示す探査図形を得るが、この例ではSa−7とする。 First, a case where the reference point P1 is set so as to have a positional relationship as shown in FIG. An exploration figure indicating the maximum difference candidate value is obtained through the processing of steps S101 to S106 in FIG. 2, but in this example, it is set to Sa-7.
次に、基準点P1とは異なる位置に基準点P2を設定する。この状態を図3(b)に示す。最大差分候補値を示す探査図形を例えばSb−6とする。 Next, a reference point P2 is set at a position different from the reference point P1. This state is shown in FIG. The search figure indicating the maximum difference candidate value is, for example, Sb-6.
さらに、基準点P1もしくは2とは異なる位置に基準点P3を設定する。この状態を図3(c)に示す。最大差分候補値を示す探査図形を例えばSc−2とする。 Further, a reference point P3 is set at a position different from the reference point P1 or 2. This state is shown in FIG. The search pattern indicating the maximum difference candidate value is, for example, Sc-2.
ここでは上記3つの基準点について図示したが、上述のように、基準点Pi(iは自然数)を相対的に位置をずらし、多くの最大差分候補値を得る。そして、得られた数多くの最大微分候補値の中から最大のものを探し出し、これを最大差分値として保持する。 Here, the above three reference points are illustrated, but as described above, the position of the reference point Pi (i is a natural number) is relatively shifted to obtain many maximum difference candidate values. Then, the largest one is searched for from the obtained maximum differential candidate values, and this is held as the maximum difference value.
上述のように、最大差分値は、隣接する探査図形間の円周上の輝度が最も大きく変化しているということ、つまり明暗の差が最も大きいということを意味する。つまり、対象物のエッジに近い探査図形の円周部分が多ければ多いほど、最大差分候補値は大きくなる。図3に示した例でいえば、図3(a)に示すような基準点P1を基準とする探査図形Sa−7、図3(b)に示すような基準点P2を基準とする探査図形Sb−6、および、図3(c)に示すような基準点P3を基準とする探査図形Sc−2のうち、基準点P3を基準とする探査図形Sc−2が、対象物のエッジに近い探査図形の円周部分が最も多く、ほぼ全周にわたって接近しているので、このときの最大差分候補値が最大差分値となる。 As described above, the maximum difference value means that the luminance on the circumference between the adjacent search patterns changes most, that is, the difference between light and dark is the largest. In other words, the greater the circumferential portion of the search pattern closer to the edge of the object, the greater the maximum difference candidate value. In the example shown in FIG. 3, a search pattern Sa-7 based on the reference point P1 as shown in FIG. 3A, and a search pattern based on the reference point P2 as shown in FIG. Of Sb-6 and the search figure Sc-2 based on the reference point P3 as shown in FIG. 3C, the search figure Sc-2 based on the reference point P3 is close to the edge of the target object. Since the circumferential part of the search pattern is the largest and approaches almost the entire circumference, the maximum difference candidate value at this time becomes the maximum difference value.
したがって、図3(c)に示された、最大差分値のときの探査図形Sc−2の中心の位置および半径を特定し、この中心の位置および半径で規定される円形図形を、対象物のエッジとして確定する。 Therefore, the position and radius of the center of the search pattern Sc-2 at the time of the maximum difference value shown in FIG. 3C are specified, and the circular figure defined by the position and radius of the center is determined. Determined as an edge.
以上説明したように、本実施例によれば、検査画像中の対象物のエッジを抽出するエッジ抽出装置および方法において、ノイズ成分を多く含んだエッジ抽出対象画像であっても、安定して対象物のエッジを抽出することができる。 As described above, according to the present embodiment, in the edge extraction apparatus and method for extracting the edge of the target object in the inspection image, even if the edge extraction target image contains many noise components, The edge of an object can be extracted.
このように本実施例によれば、従来例のように最小2乗法を用いずにエッジの方向を特定するので、画像サーチ領域内に大きなノイズがあったとしてもその影響を受けることはない。 As described above, according to this embodiment, the direction of the edge is specified without using the least squares method as in the conventional example. Therefore, even if there is a large noise in the image search area, it is not affected.
なお、本実施例では輝度積算値を計算した後すぐに差分値を計算したが、複数の輝度積算値をメモリ等に蓄積しておき、後でまとめでそれぞれの差分値を計算してエッジ抽出に用いるようにしてもよい。 In the present embodiment, the difference value is calculated immediately after calculating the brightness integrated value. However, a plurality of brightness integrated values are stored in a memory or the like, and the respective difference values are collectively calculated later to extract the edge. May be used.
上述の実施例では、画像サーチ領域内のエッジ抽出対象物が円形状である場合におけるエッジの抽出について示した。本実施例の変形例として、さらに、エッジが抽出された円形状の対象物が、どの程度の精度の円形であるか、すなわち、円形として正常なものなのかあるいは不良であるかを検査するようにしてもよい。以下、これについて説明する。 In the above embodiment, the edge extraction in the case where the edge extraction target in the image search area has a circular shape has been described. As a modified example of the present embodiment, it is further inspected whether the circular object from which the edge is extracted is a circle with a certain degree of accuracy, that is, whether the object is normal or defective as a circle. It may be. Hereinafter, this will be described.
図4は、本発明の実施例の変形例によるエッジ抽出方法のフローチャートである。また、図5は、本発明の実施例の変形例によるエッジ抽出を具体的に例示する説明図である。 FIG. 4 is a flowchart of an edge extraction method according to a modification of the embodiment of the present invention. FIG. 5 is an explanatory diagram specifically illustrating edge extraction according to a modification of the embodiment of the present invention.
ここでは、図5に示すように、基準点Pを中心とするほぼ円形のエッジが抽出された対象物Qが、どの程度の精度の円形であるかを検査する場合について説明する。本変形例では、図5に示すように、キズE1およびE2を有するものとする。 Here, as shown in FIG. 5, a case will be described in which the accuracy of a target object Q from which a substantially circular edge centered on a reference point P is extracted is inspected. In the present modified example, as shown in FIG. 5, it is assumed that scratches E1 and E2 are provided.
まず、図4のステップS201において、本発明に従って予め特定された中心の位置を中心とする少なくとも2つの同心円状の輝度検査図形を、本発明により抽出されたエッジを挟むようにして設定する。図5に示す例では、対象物Qのエッジを挟むように、基準点Pを中心とする輝度検査図形T1およびT2が設定される。また、輝度検査図形の半径の大きさを変えれば検査の精度を調節することができる。 First, in step S201 of FIG. 4, at least two concentric luminance test figures centered on the center position specified in advance according to the present invention are set so as to sandwich the edge extracted according to the present invention. In the example shown in FIG. 5, the luminance test graphics T1 and T2 around the reference point P are set so as to sandwich the edge of the object Q. In addition, the accuracy of the inspection can be adjusted by changing the radius of the luminance inspection graphic.
次にステップS202において、各輝度検査図形について、各輝度検査図形の円周に沿って所定の間隔(以下、「サンプリング間隔」と呼ぶ。)で輝度投影値を計測し保持する。図5に示す例では、輝度検査図形T1およびT2それぞれについて、輝度検査図形の円周に沿って、サンプリング間隔を単位として輝度投影値を計測し、これを保持する。 Next, in step S202, for each luminance test graphic, a luminance projection value is measured and held at predetermined intervals (hereinafter, referred to as "sampling intervals") along the circumference of each luminance test graphic. In the example shown in FIG. 5, for each of the luminance test graphics T1 and T2, a luminance projection value is measured along the circumference of the luminance test graphic in units of a sampling interval, and is held.
次いでステップS203では、各輝度検査図形について、ステップS202で計測した輝度投影値が、所定の範囲に含まれるか否かを判定する。上述のように、エッジは対象物の輝度の明暗の境界線であるので、円周上にキズがなければ、サンプリング間隔単位で測定される輝度投影値はほぼ一定である。しかし、キズがある場合は、測定される輝度投影値に変動が生じる。したがってステップS203では、計測された輝度投影値が所定の範囲に含まれるか否かを判定することで、キズの有無を調べる。図5に示す例では、輝度検査図形T1およびT2それぞれについて計測された輝度投影値が、予め決めておいた範囲に含まれるか否かが判定される。また、この所定の範囲の大きさを変えれば検査の精度を調節することができる。 Next, in step S203, it is determined whether or not the luminance projection value measured in step S202 is included in a predetermined range for each luminance test graphic. As described above, the edge is the boundary line between the brightness of the object and the brightness, and if there is no flaw on the circumference, the brightness projection value measured in the unit of the sampling interval is substantially constant. However, if there is a flaw, the measured luminance projection value fluctuates. Therefore, in step S203, the presence or absence of a flaw is checked by determining whether the measured luminance projection value falls within a predetermined range. In the example shown in FIG. 5, it is determined whether or not the luminance projection values measured for each of the luminance test graphics T1 and T2 fall within a predetermined range. Further, by changing the size of the predetermined range, the accuracy of the inspection can be adjusted.
計測された輝度投影値が所定の範囲に含まれる場合は、許容できないキズは存在しないということであるので正常と判断し、この時点で本変形例による検査処理は終了する。 If the measured luminance projection value falls within the predetermined range, it is determined that there is no unacceptable flaw, and it is determined to be normal. At this point, the inspection processing according to the present modification ends.
計測された輝度投影値が所定の範囲に含まれない場合は、許容できないキズが存在することであるので、ステップS204へ進む。 If the measured luminance projection value is not included in the predetermined range, it means that an unacceptable flaw exists, and the process proceeds to step S204.
ステップS204では、所定の範囲に含まれない輝度投影値の個数をカウントし、これをエラー数として保持する。図5に示す例では、輝度検査図形T1およびT2ともにエラー数が「1」であるとカウントされる。 In step S204, the number of luminance projection values not included in the predetermined range is counted, and this is held as the number of errors. In the example shown in FIG. 5, the number of errors is counted as “1” for both the luminance test graphics T1 and T2.
次いでステップS205において、エラー数が所定の数より大きいか否かを判別する。エラー数が所定の数より小さい場合、当該対象物は正常であり、エラー数が所定の数より大きい場合、当該対象物は不良であると判定する。この「所定の数」を変更すれば、検査の精度を調節することができる。 Next, in step S205, it is determined whether or not the number of errors is greater than a predetermined number. If the number of errors is smaller than the predetermined number, the object is determined to be normal. If the number of errors is larger than the predetermined number, the object is determined to be defective. By changing the “predetermined number”, the accuracy of the inspection can be adjusted.
以上説明したように、本変形例によれば、本発明に従ってエッジが抽出された対象物の形状が、どの程度の精度の円形であるか、すなわち、円形として正常なものなのかあるいは不良であるのかを検査することができる。 As described above, according to the present modification, the accuracy of the shape of the target object from which the edge is extracted according to the present invention is a circle, that is, whether the shape is a normal circle or a defect. Can be inspected.
なお、上記実施例およびその変形例では、エッジ抽出すべき対象物の形状が円形状である場合を示したが、上述のような円形以外である場合、本発明を用いて画像サーチ領域内の対象物のエッジを抽出することが可能である。エッジ抽出すべき対象物の形状が円形以外の場合であって、予め形状が分かっていないような場合は、エッジ抽出すべき対象物のおおよその輪郭に関する情報を、エッジ抽出処理前に事前に取得する。この情報に基づいて、複数の探査図形を設定するための相似の基準となる基準探査図形を生成する。 Note that, in the above-described embodiment and its modifications, the case where the shape of the object to be edge-extracted is a circular shape is described. It is possible to extract the edge of the object. If the shape of the object to be edge-extracted is other than circular and the shape is not known in advance, information about the approximate contour of the object to be edge-extracted is obtained in advance before the edge extraction process. I do. Based on this information, a reference search pattern that is a similar reference for setting a plurality of search patterns is generated.
エッジ抽出すべき対象物が予め形状が分かっていないような場合に関しては、エッジ抽出すべき対象物のおおよその輪郭は、一般的に用いられる輪郭線抽出方法を用いればよい。ここでは、一具体例として、輪郭線追跡のための追跡開始点を設定し、輪郭線の追跡を行う過程で、追跡し終わった点に追跡済マークを付けながら追跡を進行していき、輪郭線を抽出する方法について簡単に説明する。 In the case where the shape of the object to be edge-extracted is not known in advance, the general outline of the object to be edge-extracted may be obtained by using a generally used contour line extraction method. Here, as one specific example, a tracking start point for contour tracking is set, and in the process of tracking the contour, tracking is performed while attaching a tracked mark to a point at which tracking has been completed. A method for extracting a line will be briefly described.
図7〜9は、図形の輪郭線抽出方法の一例を説明する図である。図7に示すような、二値化された探査領域S内に存在する図形Aのおおよその輪郭線を抽出する場合について説明する。ここでは、説明を感銘にするために、図形Aが存在する1画素を「黒」と表現するが、図7〜9では、斜線を施した1マスで示す。図形Aが存在しない1画素は「白」と表現する。 7 to 9 are diagrams illustrating an example of a method of extracting a contour line of a figure. A case will be described in which an approximate contour line of the figure A existing in the binarized search area S as shown in FIG. 7 is extracted. Here, in order to impress the explanation, one pixel in which the figure A is present is expressed as “black”, but is indicated by one hatched box in FIGS. One pixel where the figure A does not exist is expressed as “white”.
探査領域Sをラスタ走査していき、黒で表された画素に初めて遭遇したとする。このときの画素を、図7に示すように「X0」としてラベル付けし、これを追跡の開始点とする。 It is assumed that the search area S is raster-scanned and a pixel represented by black is first encountered. The pixel at this time is labeled as "X0" as shown in FIG. 7, and this is set as the tracking start point.
開始点X0を中央に見る8近傍の画素は、図8(a)に示すとおりである。このとき、図8(a)に示すような番号順に、すなわち半時計周りに1画素ずつ黒で表された画素が存在するか否かチェックしていく。図8(a)の場合は、2番目にチェックした画素が黒であったので、この画素に「X1」をラベル付けする。 Pixels in the vicinity of 8 viewed from the start point X0 at the center are as shown in FIG. At this time, it is checked whether or not there is a pixel represented in black one by one in the numerical order as shown in FIG. In the case of FIG. 8A, since the second checked pixel is black, this pixel is labeled “X1”.
X1を中央に見る8近傍の画素は、図8(b)に示すとおりである。このとき、図8(b)に示すような番号順に、すなわち半時計周りに1画素ずつ黒で表された画素が存在するか否かチェックしていく。図8(b)の場合は、3番目にチェックした画素が黒であったので、この画素に「X2」をラベル付けする。 Pixels in the vicinity of 8 viewed at the center of X1 are as shown in FIG. At this time, it is checked whether or not there is a pixel represented in black one by one in the numerical order as shown in FIG. In the case of FIG. 8B, since the pixel checked third is black, this pixel is labeled “X2”.
X2を中央に見る8近傍の画素は、図9(a)に示すとおりである。このとき、図9(a)に示すような番号順に、すなわち半時計周りに1画素ずつ黒で表された画素が存在するか否かチェックしていく。図9(a)の場合は、6番目にチェックした画素が「1」であったので、この画素に「X3」をラベル付けする。 Pixels in the vicinity of 8 viewed at the center of X2 are as shown in FIG. At this time, it is checked whether or not there is a pixel represented in black one by one in the numerical order as shown in FIG. In the case of FIG. 9A, since the pixel checked sixth is “1”, this pixel is labeled “X3”.
既にX0としてラベル付けされた画素が、「黒である画素」として再び検出されることになるまで、上述のような処理を繰り返す。結果得られたX0〜X6がラベル付けされた画素をたどっていくと、図形Aの輪郭線が得られる。 The process described above is repeated until a pixel already labeled as X0 is detected again as a “black pixel”. When the resulting X0 to X6 follow the labeled pixels, the outline of FIG. A is obtained.
以上のようにして得られた輪郭線を、エッジ抽出すべき対象物のおおよその輪郭に関する情報とし、この情報に基づいて、複数の探査図形を設定するための相似の基準となる基準探査図形を生成する。 The outline obtained as described above is used as information about the approximate outline of the object to be edge-extracted, and based on this information, a reference exploration pattern serving as a similar reference for setting a plurality of exploration figures is obtained. Generate.
このように、エッジ抽出すべき対象物の形状が円形以外であって、エッジ抽出すべき対象物の形状が予め分かっていない場合は、例えば上述の図7〜9を参照して説明した図形の輪郭線抽出方法に基づいて基準探査図形を生成し、エッジ抽出すべき対象物の形状が予め分かっている場合は、該形状を規定する方程式に基づいて、基準探査図形を生成する。 As described above, when the shape of the object to be edge-extracted is other than a circle and the shape of the object to be edge-extracted is not known in advance, for example, the shape of the graphic described with reference to FIGS. A reference search pattern is generated based on the contour line extraction method. If the shape of the object to be edge extracted is known in advance, the reference search pattern is generated based on an equation defining the shape.
なお、エッジ抽出すべき対象物の形状が円形以外であって、エッジ抽出すべき対象物の形状が予め分かっている場合でも、本発明を用いて画像サーチ領域内の対象物のエッジを抽出することが可能である。例えば、対象物の形状が、楕円形や多角形などを表す方程式で規定できる場合がこれに相当する。この方程式に基づいて、複数の探査図形を設定するための相似の基準となる基準探査図形を生成する。 Note that, even when the shape of the object to be edge-extracted is not circular and the shape of the object to be edge-extracted is known in advance, the edge of the object in the image search area is extracted using the present invention. It is possible. For example, this corresponds to a case where the shape of the object can be defined by an equation representing an ellipse, a polygon, or the like. Based on this equation, a reference search pattern serving as a similar reference for setting a plurality of search patterns is generated.
上述の基準探査図形を基準として、該基準探査図形に相似な複数の探査図形を得るが、その後の処理は、図2に示したフローチャートに従う。すなわち、まず、ステップS101において、画像サーチ領域内の任意の位置に基準点を設定する。次に、ステップS102において、ステップS101で設定した基準点を基準とし、かつ、上述の基準探査図形に相似な複数の探査図形を設定する。そして、ステップS102〜S104を繰り返し、各探査図形について、該探査図形の外周に沿った輝度投影値を積算し、積算値の集合を得る。次に、ステップS105において、隣接する探査図形間において積算値の差分値を計算する。次いで、ステップS106では、ステップS105で計算された差分値の集合の中から、最大となる差分値を抽出し、これを当該基準点における最大差分候補値として保持する。そして、ステップS101〜S107を繰り返し、ステップS108において、ステップS101で設定する基準点の位置を画像サーチ領域内で切り替えて得られた最大差分候補値の中から、最大となる最大差分候補値を抽出し、これを最大差分値として保持する。そして、ステップS109において、最大差分値のときの探査図形を、対象物のエッジとして確定する。 A plurality of search patterns similar to the reference search pattern are obtained based on the above-described reference search pattern, and the subsequent processing follows the flowchart shown in FIG. That is, first, in step S101, a reference point is set at an arbitrary position in the image search area. Next, in step S102, a plurality of search patterns similar to the above-described reference search pattern are set based on the reference point set in step S101. Then, steps S102 to S104 are repeated, and for each search pattern, the luminance projection values along the outer periphery of the search pattern are integrated to obtain a set of integrated values. Next, in step S105, a difference value of the integrated value between the adjacent search figures is calculated. Next, in step S106, the maximum difference value is extracted from the set of difference values calculated in step S105, and this is stored as the maximum difference candidate value at the reference point. Then, steps S101 to S107 are repeated, and in step S108, the largest maximum difference candidate value is extracted from the maximum difference candidate values obtained by switching the position of the reference point set in step S101 within the image search area. Then, this is held as the maximum difference value. Then, in step S109, the search figure at the time of the maximum difference value is determined as the edge of the object.
なお、上述のようなエッジ抽出すべき対象物の形状が円形以外である場合では、エッジ抽出すべき対象物と探査図形との傾きを補正しておく必要がある。例えば、エッジ抽出すべき対象物が存在する製品に少なくとも2点のアライメントマークを設け、このアライメントマークを基準に、仮想平面上の探査図形との角度のずれを測定し、傾きを補正すればよい。 When the shape of the object whose edge is to be extracted as described above is other than circular, it is necessary to correct the inclination between the object whose edge is to be extracted and the search pattern. For example, at least two alignment marks are provided on a product in which an object to be edge-extracted is present, and based on the alignment marks, the deviation of the angle from the search pattern on the virtual plane is measured, and the inclination may be corrected. .
なお、上述のフローチャートに対応するシステムブロック構成は図1を参照して説明したとおりである。これにより、エッジ抽出すべき対象物の形状が円形状である場合と同様の効果を得ることができる。 Note that the system block configuration corresponding to the above-described flowchart is as described with reference to FIG. As a result, it is possible to obtain the same effect as when the shape of the object to be edge-extracted is circular.
また、既に説明した対象物が円形である場合同様、上述のようにしてエッジが抽出された対象物が、どの程度の精度を有するか、すなわち、製品として正常なものなのかあるいは不良であるかを検査するようにしてもよい。この処理は、図4に示したフローチャートに従う。すなわち、まず、ステップS201において、図2のステップS109で特定された基準点の位置を基準とする対象物に相似する少なくとも2つの輝度検査図形を、図2のステップS109で確定したエッジを挟むようにして設定する。次に、ステップS202において、各輝度検査図形について、各該輝度検査図形の外周に沿って所定の間隔で輝度投影値を計測し保持する。次いで、ステップS203において、各輝度検査図形について、ステップS202で計測した輝度投影値が所定の範囲に含まれるか否かを判定する。ステップS204では、上記所定の範囲に含まれない輝度投影値の個数をカウントし、これをエラー数として保持する。ステップS205では、エラー数が所定の数より大きいか否かを判別する。このエラー数が所定の数より大きい場合、当該対象物は不良であると判定する。 In addition, similarly to the case where the object described above is circular, the degree of accuracy of the object whose edge is extracted as described above, that is, whether the object is normal or defective as a product May be inspected. This process follows the flowchart shown in FIG. That is, first, in step S201, at least two luminance test figures similar to the object based on the position of the reference point specified in step S109 in FIG. 2 are sandwiched by the edge determined in step S109 in FIG. Set. Next, in step S202, a luminance projection value is measured and held at predetermined intervals along the outer periphery of each luminance test graphic for each luminance test graphic. Next, in step S203, it is determined whether or not the luminance projection value measured in step S202 is included in a predetermined range for each luminance test graphic. In step S204, the number of luminance projection values not included in the predetermined range is counted, and this is held as the number of errors. In step S205, it is determined whether the number of errors is greater than a predetermined number. If the number of errors is larger than a predetermined number, the object is determined to be defective.
このように、上述の各手法によれば、探査図形の位置をずらして複数の最大差分候補値を得て、最大の最大差分候補値を示すときの探査図形を、対象物のエッジとして確定する。エッジ抽出結果に精度を求める場合は、探査図形の基準点の位置は細かく(例えば1ピクセルずつずらすように)設定するのが好ましい。次に、この手法の変形例として、基準点となるべき候補点を予め算出する粗サーチ処理について説明する。この粗サーチ処理は、システムが処理すべき演算量を減らし、処理の高速化を図るために、上記処理の前処理として実行されるものである。 As described above, according to the above-described methods, a plurality of maximum difference candidate values are obtained by shifting the position of the search pattern, and the search pattern indicating the maximum maximum difference candidate value is determined as the edge of the target object. . When accuracy is required for the edge extraction result, it is preferable to set the position of the reference point of the search pattern finely (for example, so as to be shifted by one pixel). Next, as a modified example of this method, a rough search process of calculating a candidate point to be a reference point in advance will be described. This rough search process is executed as a pre-process of the above process in order to reduce the amount of calculation to be performed by the system and to speed up the process.
本変形例では、エッジ抽出すべき対象物の形状が円形である場合は粗サーチ基準点を中心とした所定の半径差を有する2同心円状の粗サーチ図形を、円形以外である場合もしくは予め形状が分かっていないような場合は画像サーチ領域内の任意の位置に設定された粗サーチ基準点を、それぞれ基準とし、かつ、対象物に相似な2つの大きさの異なる外周図形および内周図形からなる粗サーチ図形を用いて、基準点となるべき候補点を確定する。すなわち、本変形例では、エッジ抽出すべき対象物のおよその位置を、基準となるべき候補点を確定する形で予め把握しておく。確定された複数の候補点についてのみ、既に説明した本発明のエッジ抽出処理を実行するので、処理すべき演算量が減り、処理の高速化を図ることが可能となる。 In this modified example, if the shape of the object to be edge-extracted is circular, two concentric coarse search graphics having a predetermined radius difference centered on the coarse search reference point, If it is not known, the rough search reference point set at an arbitrary position in the image search area is used as a reference, and two different sizes of the outer peripheral figure and the inner peripheral figure similar to the object are used. A candidate point to be a reference point is determined using the rough search graphic. That is, in the present modification, the approximate position of the target object from which the edge is to be extracted is grasped in advance in such a manner that a candidate point to be a reference is determined. Since the already described edge extraction processing of the present invention is executed only for a plurality of determined candidate points, the amount of computation to be processed is reduced, and the processing speed can be increased.
図10は、本発明の実施例の変形例による、エッジ抽出すべき対象物の形状が円形である場合における粗サーチ図形を例示する説明図である。 FIG. 10 is an explanatory diagram exemplifying a coarse search graphic in the case where the shape of the object to be edge-extracted is circular according to a modification of the embodiment of the present invention.
エッジ抽出すべき対象物の形状が円形である場合における粗サーチ図形は、粗サーチ基準点Rを中心とした所定の半径差を有する2同心円状を有する。図10では、外周円をUo、内周円をUiとし、それぞれの半径をro、riとする。外周円Uoおよび内周円Uiの各円周の間は幅d(=ro−ri、以下、「半径差」と称する。)を有する。 When the shape of the target object whose edge is to be extracted is circular, the coarse search graphic has two concentric circles having a predetermined radius difference centered on the coarse search reference point R. In FIG. 10, the outer circumference circle is Uo, the inner circumference circle is Ui, and the respective radii are ro and ri. Each of the outer circumference Uo and the inner circumference Ui has a width d (= ro-ri, hereinafter referred to as a “radius difference”) between the circumferences.
図11は、本発明の実施例の変形例による、エッジ抽出すべき対象物の形状が円形である場合における粗サーチ処理の原理を例示する説明図(その1)である。図11では、粗サーチ図形の粗サーチ基準点を、R1からR2へ距離kだけ移動させた(ずらした)場合における粗サーチ図形の外周円および内周円の円周上の輝度投影値を考える。 FIG. 11 is an explanatory diagram (part 1) illustrating the principle of the coarse search process in the case where the shape of the object to be edge-extracted is circular according to a modification of the embodiment of the present invention. In FIG. 11, the luminance projection value on the circumference of the outer and inner circles of the coarse search graphic when the coarse search reference point of the coarse search graphic is moved (shifted) from R1 to R2 by the distance k is considered. .
図11(a)に示すようにd<kである場合は、図中の斜線領域については輝度投影値を検出することができない。すなわち、仮にこの斜線領域内にエッジ抽出すべき対象物が存在していた場合は対象物を検出することができず、正常なエッジ抽出は不可能である。 When d <k as shown in FIG. 11A, the luminance projection value cannot be detected for the hatched area in the figure. That is, if an object to be edge extracted exists in the hatched area, the object cannot be detected, and normal edge extraction cannot be performed.
これに対し、図11(b)に示すようにd=kである場合、および、図11(b)に示すようにd>kである場合は、全領域にわたって輝度投影値を検出することができる。したがって、本変形例では、粗サーチ基準点の位置を、画像サーチ領域内において、d≧kの条件を満たす距離kずつずらして、粗サーチ処理を実行する。 On the other hand, when d = k as shown in FIG. 11B and when d> k as shown in FIG. 11B, it is possible to detect the luminance projection value over the entire area. it can. Therefore, in the present modification, the coarse search processing is executed by shifting the position of the coarse search reference point by a distance k that satisfies the condition d ≧ k in the image search area.
図12は、本発明の実施例の変形例による、エッジ抽出すべき対象物の形状が円形である場合における粗サーチ処理の原理を例示する説明図(その2)である。図12では、粗サーチ図形の粗サーチ基準点を、d≧kの条件を満たす距離kずつずらし、対象物Qのおよその位置を探索する場合を考える。 FIG. 12 is an explanatory diagram (part 2) illustrating the principle of the coarse search process in the case where the shape of the target object whose edge is to be extracted is circular, according to a modification of the embodiment of the present invention. In FIG. 12, a case is considered where the coarse search reference point of the coarse search graphic is shifted by a distance k that satisfies the condition of d ≧ k, and the approximate position of the object Q is searched.
対象物Q内の領域とそれ以外の領域とでは、対象物Qのエッジを境界として輝度差が存在する。粗サーチ図形の外周および内周に沿った輝度投影値を積算して外周積算値および内周積算値を求め、外周積算値と内周積算値との差分である外内差分値を計算したとき、図12(c)に示す位置に粗サーチ図形が存在する場合は外内差分値は最大となり、図12(a)および(b)における場合に比べて外内差分値は大きくなる。すなわち、図12(c)に示すように、粗サーチ図形の外周および内周の間に対象物Qのエッジが存在する場合に外内差分値は最大となる。このことは、外内差分値が最大となるとき、粗サーチ図形の粗サーチ基準点が対象物Qの中心点の近傍に存在するということを意味し、換言すれば、外内差分値が最大となるときの粗サーチ図形の粗サーチ基準点を見つければ、エッジ抽出すべき対象物のおよその位置を予め把握できることを意味する。この後、確定された複数の候補点についてのみ、既に説明した本発明のエッジ抽出処理を実行すれば、処理すべき演算量が減るので、処理の高速化を図ることが可能となる。 There is a brightness difference between the area inside the object Q and the other area with the edge of the object Q as a boundary. When the brightness projection values along the outer circumference and inner circumference of the coarse search figure are integrated to obtain the outer circumference integration value and the inner circumference integration value, and the outer-internal difference value that is the difference between the outer circumference integration value and the inner circumference integration value is calculated. When a rough search graphic exists at the position shown in FIG. 12C, the outer / internal difference value becomes maximum, and the outer / internal difference value becomes larger than in the case of FIGS. 12A and 12B. That is, as shown in FIG. 12C, when the edge of the object Q exists between the outer circumference and the inner circumference of the rough search graphic, the outer-internal difference value becomes maximum. This means that when the external / internal difference value is the maximum, the coarse search reference point of the coarse search graphic exists near the center point of the object Q. In other words, the external / internal difference value is the maximum. If the coarse search reference point of the coarse search graphic is found, it means that the approximate position of the object to be edge-extracted can be grasped in advance. Thereafter, if the above-described edge extraction processing of the present invention is performed only on the determined plurality of candidate points, the amount of computation to be processed is reduced, so that the processing can be sped up.
図13は、本発明の実施例の変形例による、エッジ抽出すべき対象物の形状が円形以外である場合における粗サーチ処理の原理を例示する説明図である。この図では、円形以外の形状の一例として三角形の場合を示しているが、原理的には図12の場合と同様である。 FIG. 13 is an explanatory diagram illustrating the principle of the coarse search processing when the shape of the object to be edge-extracted is other than a circle according to a modification of the embodiment of the present invention. This figure shows a case of a triangle as an example of a shape other than a circle, but is similar in principle to the case of FIG.
図14は、本発明の実施例の変形例における粗サーチ処理のフローチャートである。 FIG. 14 is a flowchart of a rough search process according to a modification of the embodiment of the present invention.
まず、ステップS301において、所定の半径差を有する2同心円状の粗サーチ図形の中心となる粗サーチ基準点を、画像サーチ領域内の任意の位置に設定する。次にステップS302において、粗サーチ図形の外周および内周について、円周に沿った輝度投影値を積算して外周積算値および内周積算値を得る。次いで、ステップS303において、外周積算値と内周積算値との差分である外内差分値を計算する。ステップS301〜S304を繰り返し、ステップS301で設定する粗サーチ基準点の位置を画像サーチ領域内において半径差d以下の距離k(d≧k)だけずらしてステップS303において得られる複数の外内差分値を抽出する。ステップS301〜S304を繰り返して得られた複数の外内差分値を参照して、当該外内差分値が得られる粗サーチ図形の粗サーチ基準点を、図2のステップS101で用いられる基準点となるべき候補点として確定する。 First, in step S301, a coarse search reference point that is the center of two concentric coarse search figures having a predetermined radius difference is set at an arbitrary position in the image search area. Next, in step S302, with respect to the outer circumference and the inner circumference of the rough search graphic, the luminance projection values along the circumference are integrated to obtain an outer circumference integrated value and an inner circumference integrated value. Next, in step S303, an outer / internal difference value which is a difference between the outer peripheral integrated value and the inner peripheral integrated value is calculated. Steps S301 to S304 are repeated, and a plurality of outer / inner difference values obtained in step S303 by shifting the position of the coarse search reference point set in step S301 by a distance k (d ≧ k) less than or equal to the radius difference d in the image search area. Is extracted. With reference to a plurality of outer / inner difference values obtained by repeating steps S301 to S304, the coarse search reference point of the rough search graphic from which the outer / internal difference value is obtained is set to the reference point used in step S101 in FIG. Determine as candidate points to be made.
なお、ステップS301の粗サーチ基準点を有する粗サーチ図形については、対象物の半径が粗サーチ図形の外周の半径と内周の半径との範囲内の値となるよう、粗サーチ図形の外周の半径および内周の半径を設定する。 For the coarse search graphic having the coarse search reference point in step S301, the outer radius of the coarse search graphic is set so that the radius of the object becomes a value within the range between the outer radius and the inner radius of the coarse search graphic. Set the radius and inner radius.
また、エッジ抽出すべき対象物の形状が、上述のような円形以外である場合、もしくは予め形状が分かっていないような場合の粗サーチ処理は、ステップS301の粗サーチ基準点を有する粗サーチ図形を、画像サーチ領域内の任意の位置に設定された粗サーチ基準点を基準とし、かつ、対象物に相似な2つの大きさの異なる外周図形および内周図形からなるように設定すればよい。すなわち、対象物の大きさが、該対象物に相似な粗サーチ図形の内周図形よりも大きくかつ外周図形よりも小さいものとなるよう、粗サーチ図形の外周図形および内周図形の粗サーチ基準点からの距離を設定すればよい。この後の処理については、図14を参照して説明した円形の場合の動作原理と同様である。 When the shape of the object to be edge-extracted is other than the above-described circular shape or when the shape is not known in advance, the coarse search process including the coarse search reference point in step S301 is performed. May be set with reference to a coarse search reference point set at an arbitrary position in the image search area, and to be composed of two outer peripheral figures and inner peripheral figures different in size similar to the object. That is, the coarse search criteria for the outer and inner peripheral figures of the coarse search graphic are set such that the size of the object is larger than the inner peripheral graphic and smaller than the outer peripheral graphic of the coarse search graphic similar to the target object. What is necessary is just to set the distance from the point. The subsequent processing is the same as the operation principle in the case of the circular shape described with reference to FIG.
画像サーチ領域内の対象物のエッジを抽出するエッジ抽出装置および方法として、ノイズ成分を多く含んだエッジ抽出対象画像であっても、安定して対象物のエッジを抽出することができる。 As an edge extraction apparatus and method for extracting an edge of an object in an image search area, an edge of an object can be stably extracted even in an edge extraction target image containing a large amount of noise components.
例えばエッジ抽出対象の製品に傷があったり、明暗のコントラストが弱かったりもしくは反射輝度のムラが大きい場合であっても、安定して対象物のエッジを抽出することができる。 For example, even when a product to be edge-extracted has a flaw, a light-dark contrast is weak, or unevenness of reflection luminance is large, an edge of the object can be stably extracted.
また、エッジが抽出された対象物の形状が、どの程度の精度の円形であるか、すなわち、円形として正常なものなのかあるいは不良であるのかについての検査も容易に実現することができる。 Further, it is also possible to easily realize an inspection as to how accurate the shape of the object from which the edge is extracted is, that is, whether the shape is normal or defective as a circle.
1…エッジ抽出装置
11…第1の手段
12…第2の手段
13…第3の手段
14…第4の手段
15…第5の手段
16…第6の手段
17…第7の手段
P、P1、P2、P3…基準点
Q…対象物
DESCRIPTION OF
Claims (26)
前記画像サーチ領域内の任意の位置に基準点をとり該基準点を中心とした同心円状の複数の探査図形の円周に沿った輝度投影値を積算して得られた積算値について、隣接する前記探査図形間における差分値を計算し、最大となる前記差分値を抽出してこれを当該基準点における最大差分候補値として保持するステップと、
前記基準点の位置をずらして得られた複数の前記最大差分候補値のうち、最大の最大差分候補値を示すときの前記探査図形を、前記対象物のエッジとして確定するステップと、を備えることを特徴とするエッジ抽出方法。 An edge extraction method for extracting an edge of a circular object included in an image search area,
A reference point is set at an arbitrary position in the image search area, and adjacent integrated values obtained by integrating luminance projection values along the circumference of a plurality of concentric search patterns around the reference point are adjacent to each other. Calculating a difference value between the search patterns, extracting the maximum difference value and holding this as a maximum difference candidate value at the reference point,
Among the plurality of maximum difference candidate values obtained by shifting the position of the reference point, determining the search pattern when indicating the largest maximum difference candidate value as an edge of the object. An edge extraction method characterized by the following.
前記画像サーチ領域内の任意の位置に粗サーチ基準点をとり該粗サーチ基準点を中心とした所定の半径差を有する2同心円状の粗サーチ図形を設定するステップと、
前記粗サーチ図形の外周および内周に沿った輝度投影値を積算して外周積算値および内周積算値を得るステップと、
前記外周積算値と前記内周積算値との差分である外内差分値を計算するステップと、
前記粗サーチ基準点の位置を前記画像サーチ領域内において前記所定の半径差以下の距離だけずらして得られた外内差分値を参照して、前記粗サーチ図形の粗サーチ基準点の中から前記基準点となるべき候補点を確定するステップと、を備える請求項2に記載のエッジ抽出方法。 The step of determining a candidate point to be the reference point,
Setting a coarse search reference point at an arbitrary position in the image search area and setting two concentric coarse search graphics having a predetermined radius difference centered on the coarse search reference point;
Obtaining an outer peripheral integrated value and an inner peripheral integrated value by integrating luminance projection values along the outer and inner peripheries of the coarse search graphic;
Calculating an outer-internal difference value that is a difference between the outer peripheral integrated value and the inner peripheral integrated value,
The position of the coarse search reference point is shifted by a distance equal to or smaller than the predetermined radius difference within the image search area, and the outer search result is referred to an outer-internal difference value. 3. The method according to claim 2, further comprising: determining a candidate point to be a reference point.
前記画像サーチ領域内の任意の位置に基準点を設定する第1のステップと、
複数の探査図形を、前記基準点を中心する同心円形状となるように設定する第2のステップと、
各前記探査図形について、円周に沿った輝度投影値を積算し、積算値の集合を得る第3のステップと、
隣接する前記探査図形間において前記積算値の差分値を計算する第4のステップと、
該第4のステップで計算された差分値の集合の中から、最大となる差分値を抽出し、これを当該基準点における最大差分候補値として保持する第5のステップと、
前記第1のステップで設定する前記基準点の位置を前記画像サーチ領域内で切り替えて前記第2、第3、第4および第5のステップによって得られた複数の前記最大差分候補値のうち、最大となる最大差分候補値を抽出し、これを最大差分値として保持する第6のステップと、
前記最大差分値のときの探査図形の中心の位置および半径を特定し、該中心の位置および半径で規定される円形図形を、前記対象物のエッジとして確定する第7のステップと、を備えることを特徴とするエッジ抽出方法。 An edge extraction method for extracting an edge of a circular object included in an image search area,
A first step of setting a reference point at an arbitrary position in the image search area;
A second step of setting a plurality of exploration figures to have a concentric shape centered on the reference point;
A third step of integrating the luminance projection values along the circumference of each of the search patterns to obtain a set of integrated values;
A fourth step of calculating a difference value of the integrated value between adjacent search patterns,
A fifth step of extracting a maximum difference value from the set of difference values calculated in the fourth step, and storing the maximum difference value as a maximum difference candidate value at the reference point;
Of the plurality of maximum difference candidate values obtained in the second, third, fourth and fifth steps by switching the position of the reference point set in the first step within the image search area, A sixth step of extracting the maximum maximum difference candidate value and holding this as the maximum difference value;
A seventh step of specifying the position and radius of the center of the search figure at the time of the maximum difference value, and determining a circular figure defined by the position and radius of the center as the edge of the object. An edge extraction method characterized by the following.
各前記輝度検査図形について、各該輝度検査図形の円周に沿って所定の間隔で輝度投影値を計測し保持する第9のステップと、
各前記輝度検査図形について、前記第9のステップで計測した前記輝度投影値が所定の範囲に含まれるか否かを判定する第10のステップと、
前記所定の範囲に含まれない前記輝度投影値の個数をカウントし、これをエラー数として保持する第11のステップと、
前記エラー数が所定の数より大きいか否かを判別する第12のステップと、
前記エラー数が所定の数より大きい場合、当該対象物は不良であると判定する第13のステップと、をさらに備える請求項4に記載のエッジ抽出方法。 An eighth step of setting at least two concentric luminance test graphics centered on the center position specified in the seventh step so as to sandwich the edge determined in the seventh step;
A ninth step of measuring and holding a luminance projection value at predetermined intervals along a circumference of each of the luminance test graphics, for each of the luminance test graphics;
A tenth step of determining whether or not the luminance projection value measured in the ninth step is included in a predetermined range for each of the luminance test graphics;
An eleventh step of counting the number of the luminance projection values that are not included in the predetermined range, and holding this as an error number;
A twelfth step of determining whether the number of errors is greater than a predetermined number;
The edge extracting method according to claim 4, further comprising: if the error number is larger than a predetermined number, determining that the object is defective.
前記粗サーチ図形の外周および内周について、円周に沿った輝度投影値を積算して外周積算値および内周積算値を得る第15のステップと、
前記外周積算値と前記内周積算値との差分である外内差分値を計算する第16のステップと、
前記第14のステップで設定する前記粗サーチ基準点の位置を前記画像サーチ領域内において前記所定の半径差以下の距離だけずらして前記第15および第16のステップによって得られる複数の外内差分値を抽出する第17のステップと、
前記第17のステップで得られた前記外内差分値を参照して、当該外内差分値が得られる前記粗サーチ図形の粗サーチ基準点を、前記基準点となるべき候補点として確定する第18のステップと、をさらに備える請求項4に記載のエッジ抽出方法。 A fourteenth step of setting a coarse search reference point at the center of the two concentric coarse search graphics having a predetermined radius difference at an arbitrary position in the image search area;
A fifteenth step of, for the outer periphery and the inner periphery of the coarse search graphic, integrating luminance projection values along the circumference to obtain an outer periphery integrated value and an inner periphery integrated value;
A sixteenth step of calculating an outer-internal difference value that is a difference between the outer peripheral integrated value and the inner peripheral integrated value;
A plurality of outer and inner difference values obtained by the fifteenth and sixteenth steps by shifting the position of the coarse search reference point set in the fourteenth step by a distance equal to or less than the predetermined radius difference in the image search area; A seventeenth step of extracting
Referring to the outer / inner difference value obtained in the seventeenth step, a coarse search reference point of the coarse search graphic from which the outer / internal difference value is obtained is determined as a candidate point to be the reference point. The edge extraction method according to claim 4, further comprising:
前記画像サーチ領域内の任意の位置に基準点をとり該基準点を基準とした前記対象物に相似な複数の探査図形の外周に沿った輝度投影値を積算して得られた積算値について、隣接する前記探査図形間における差分値を計算し、最大となる前記差分値を抽出してこれを当該基準点における最大差分候補値として保持するステップと、
前記基準点の位置をずらして得られた複数の前記最大差分候補値のうち、最大の最大差分候補値を示すときの前記探査図形を、前記対象物のエッジとして確定するステップと、を備えることを特徴とするエッジ抽出方法。 An edge extraction method for extracting an edge of an object included in an image search area,
For an integrated value obtained by taking a reference point at an arbitrary position in the image search area and integrating luminance projection values along the outer perimeter of a plurality of search patterns similar to the object based on the reference point, Calculating a difference value between the adjacent search patterns, extracting the maximum difference value, and holding this as a maximum difference candidate value at the reference point;
Among the plurality of maximum difference candidate values obtained by shifting the position of the reference point, determining the search pattern when indicating the largest maximum difference candidate value as an edge of the object. An edge extraction method characterized by the following.
前記画像サーチ領域内の任意の位置に設定された粗サーチ基準点を基準とし、かつ、前記対象物に相似な2つの大きさの異なる外周図形および内周図形からなる粗サーチ図形を設定するステップと、
前記粗サーチ図形の外周図形および内周図形に沿った輝度投影値を積算して外周積算値および内周積算値を得るステップと、
前記外周積算値と前記内周積算値との差分である外内差分値を計算するステップと、
前記粗サーチ基準点の位置を前記画像サーチ領域内において前記外周図形および前記内周図形の前記粗サーチ基準点からの距離の差分値以下の距離だけずらして得られた外内差分値を参照して、前記粗サーチ基準点の中から前記基準点となるべき候補点を確定するステップと、を備える請求項8に記載のエッジ抽出方法。 The step of determining a candidate point to be the reference point,
A step of setting a coarse search graphic made up of two different-sized outer peripheral figures and inner peripheral figures similar to the object with reference to a coarse search reference point set at an arbitrary position in the image search area; When,
Obtaining the outer peripheral integrated value and the inner peripheral integrated value by integrating the luminance projection values along the outer peripheral graphic and the inner peripheral graphic of the coarse search graphic;
Calculating an outer-internal difference value that is a difference between the outer peripheral integrated value and the inner peripheral integrated value,
Referring to an outer / inner difference value obtained by shifting the position of the coarse search reference point within the image search area by a distance equal to or less than the difference value of the distance between the outer peripheral figure and the inner peripheral figure from the coarse search reference point. The method according to claim 8, further comprising: determining a candidate point to be the reference point from the coarse search reference points.
前記画像サーチ領域内の任意の位置に基準点を設定する第1のステップと、
前記基準点を基準とし、かつ、前記対象物に相似な複数の探査図形を設定する第2のステップと、
各前記探査図形について、該探査図形の外周に沿った輝度投影値を積算し、積算値の集合を得る第3のステップと、
隣接する前記探査図形間において前記積算値の差分値を計算する第4のステップと、
該第4のステップで計算された差分値の集合の中から、最大となる差分値を抽出し、これを当該基準点における最大差分候補値として保持する第5のステップと、
前記第1のステップで設定する前記基準点の位置を前記画像サーチ領域内で切り替えて前記第2、第3、第4および第5のステップによって得られた前記最大差分候補値の中から、最大となる最大差分候補値を抽出し、これを最大差分値として保持する第6のステップと、
前記最大差分値のときの探査図形を、前記対象物のエッジとして確定する第7のステップと、を備えることを特徴とするエッジ抽出方法。 An edge extraction method for extracting an edge of an object included in an image search area,
A first step of setting a reference point at an arbitrary position in the image search area;
A second step of setting a plurality of exploration figures similar to the object based on the reference point,
A third step of, for each of the search patterns, integrating luminance projection values along the outer periphery of the search pattern to obtain a set of integrated values;
A fourth step of calculating a difference value of the integrated value between adjacent search patterns,
A fifth step of extracting a maximum difference value from the set of difference values calculated in the fourth step, and storing the maximum difference value as a maximum difference candidate value at the reference point;
The position of the reference point set in the first step is switched within the image search area, and the maximum difference candidate value obtained in the second, third, fourth, and fifth steps is selected. A sixth step of extracting the maximum difference candidate value that becomes, and holding this as the maximum difference value;
A seventh step of determining a search pattern at the time of the maximum difference value as an edge of the object.
各前記輝度検査図形について、各該輝度検査図形の外周に沿って所定の間隔で輝度投影値を計測し保持する第9のステップと、
各前記輝度検査図形について、前記第9のステップで計測した前記輝度投影値が所定の範囲に含まれるか否かを判定する第10のステップと、
前記所定の範囲に含まれない前記輝度投影値の個数をカウントし、これをエラー数として保持する第11のステップと、
前記エラー数が所定の数より大きいか否かを判別する第12のステップと、
前記エラー数が所定の数より大きい場合、当該対象物は不良であると判定する第13のステップと、をさらに備える請求項12に記載のエッジ抽出方法。 Eighth step of setting at least two luminance test graphics similar to the object based on the position of the reference point specified in the seventh step so as to sandwich the edge determined in the seventh step When,
A ninth step of measuring and holding a luminance projection value at predetermined intervals along an outer periphery of each of the luminance test graphics,
A tenth step of determining whether or not the luminance projection value measured in the ninth step is included in a predetermined range for each of the luminance test graphics;
An eleventh step of counting the number of the luminance projection values that are not included in the predetermined range, and holding this as an error number;
A twelfth step of determining whether the number of errors is greater than a predetermined number;
13. The method according to claim 12, further comprising: when the number of errors is larger than a predetermined number, determining that the object is defective.
前記粗サーチ図形の外周図形および内周図形に沿った輝度投影値を積算して外周積算値および内周積算値を得る第15のステップと、
前記外周積算値と前記内周積算値との差分である外内差分値を計算する第16のステップと、
前記第14のステップで設定する前記粗サーチ基準点の位置を前記画像サーチ領域内において前記外周図形および前記内周図形の前記粗サーチ基準点からの距離の差分値以下の距離だけずらして前記第15および第16のステップによって得られる複数の外内差分値を抽出する第17のステップと、
前記第17のステップで得られた前記外内差分値を参照して、当該外内差分値が得られる前記粗サーチ図形の粗サーチ基準点を、前記基準点となるべき候補点として確定する第18のステップと、をさらに備える請求項15に記載のエッジ抽出方法。 A fourteenth step of setting a coarse search reference point, which is a coarse search graphic reference made up of two different-sized outer peripheral graphics and inner peripheral graphics similar to the object, at an arbitrary position in the image search area;
A fifteenth step of integrating luminance projection values along the outer peripheral figure and the inner peripheral figure of the coarse search figure to obtain an outer peripheral integrated value and an inner peripheral integrated value;
A sixteenth step of calculating an outer-internal difference value that is a difference between the outer peripheral integrated value and the inner peripheral integrated value;
The position of the coarse search reference point set in the fourteenth step is shifted by a distance equal to or less than a difference value of a distance from the coarse search reference point of the outer peripheral graphic and the inner peripheral graphic in the image search area. A seventeenth step of extracting a plurality of outer and inner difference values obtained by the fifteenth and sixteenth steps;
Referring to the outer / inner difference value obtained in the seventeenth step, a coarse search reference point of the coarse search graphic from which the outer / internal difference value is obtained is determined as a candidate point to be the reference point. 18. The edge extraction method according to claim 15, further comprising:
前記画像サーチ領域内の任意の位置に基準点を設定する第1の手段と、
複数の探査図形を、前記基準点を中心する同心円形状となるように設定する第2の手段と、
各前記探査図形について、円周に沿った輝度投影値を積算し、積算値の集合を得る第3の手段と、
隣接する前記探査図形間において前記積算値の差分値を計算する第4の手段と、
該第4の手段で計算された差分値の集合の中から、最大となる差分値を抽出し、これを当該基準点における最大差分候補値として保持する第5の手段と、
前記第1の手段で設定する前記基準点の位置を前記画像サーチ領域内で切り替えて前記第2、第3、第4および第5の手段によって得られた複数の前記最大差分候補値のうち、最大となる最大差分候補値を抽出し、これを最大差分値として保持する第6の手段と、
前記最大差分値のときの探査図形を、前記対象物のエッジとして確定する第7の手段と、を備えることを特徴とするエッジ抽出装置。 An edge extraction device for extracting an edge of a circular object included in an image search area,
First means for setting a reference point at an arbitrary position in the image search area;
A second means for setting a plurality of exploration figures so as to have a concentric shape centered on the reference point;
Third means for integrating the luminance projection values along the circumference of each of the exploration figures to obtain a set of integrated values;
Fourth means for calculating a difference value of the integrated value between adjacent search patterns,
A fifth means for extracting a maximum difference value from a set of difference values calculated by the fourth means, and holding the same as a maximum difference candidate value at the reference point;
Among the plurality of maximum difference candidate values obtained by the second, third, fourth and fifth means by switching the position of the reference point set by the first means within the image search area, Sixth means for extracting a maximum maximum difference candidate value and holding this as a maximum difference value;
And a seventh means for determining the search pattern at the time of the maximum difference value as an edge of the object.
各前記輝度検査図形について、各該輝度検査図形の円周に沿って所定の間隔で輝度投影値を計測し保持する第9の手段と、
各前記輝度検査図形について、前記第9の手段で測定した前記輝度投影値が所定の範囲に含まれるか否かを判定する第10の手段と、
前記所定の範囲に含まれない前記輝度投影値の個数をカウントし、これをエラー数として保持する第11の手段と、
前記エラー数が所定の数より大きいか否かを判別する第12の手段と、
前記エラー数が所定の数より大きい場合、当該対象物は不良であると判定する第13の手段と、をさらに備える請求項18に記載のエッジ抽出装置。 Eighth means for setting at least two concentric luminance test figures centered on the center position specified by the seventh means so as to sandwich the edge determined by the seventh means,
Ninth means for measuring and holding a luminance projection value at predetermined intervals along a circumference of each of the luminance test graphics, for each of the luminance test graphics;
A tenth means for determining whether or not the brightness projection value measured by the ninth means is included in a predetermined range for each of the brightness test graphics;
An eleventh means for counting the number of the luminance projection values not included in the predetermined range and holding this as an error number;
Twelfth means for determining whether the number of errors is greater than a predetermined number,
19. The edge extracting apparatus according to claim 18, further comprising: thirteenth means for determining that the object is defective when the number of errors is larger than a predetermined number.
前記粗サーチ図形の外周および内周について、円周に沿った輝度投影値を積算して外周積算値および内周積算値を得る第15の手段と、
前記外周積算値と前記内周積算値との差分である外内差分値を計算する第16の手段と、
前記第14の手段で設定する前記粗サーチ基準点の位置を前記画像サーチ領域内において前記所定の半径差以下の距離だけずらして前記第15および第16の手段によって得られる複数の外内差分値を抽出する第17の手段と、
前記第17の手段で得られた前記外内差分値を参照して、当該外内差分値が得られる前記粗サーチ図形の粗サーチ基準点を、前記基準点となるべき候補点として確定する第18の手段と、をさらに備える請求項18に記載のエッジ抽出装置。 Fourteenth means for setting a coarse search reference point at the center of the two concentric coarse search graphics having a predetermined radius difference at an arbitrary position in the image search area;
A fifteenth means for obtaining an outer peripheral integrated value and an inner peripheral integrated value by integrating luminance projection values along the circumference with respect to the outer periphery and the inner periphery of the coarse search graphic;
Sixteenth means for calculating an outer-internal difference value that is a difference between the outer peripheral integrated value and the inner peripheral integrated value,
A plurality of outer / inner difference values obtained by the fifteenth and sixteenth means by shifting the position of the coarse search reference point set by the fourteenth means by a distance equal to or less than the predetermined radius difference within the image search area. A seventeenth means for extracting
Referring to the outer / inner difference value obtained by the seventeenth means, a coarse search reference point of the coarse search graphic from which the outer / internal difference value is obtained is determined as a candidate point to be the reference point. The edge extraction device according to claim 18, further comprising:
前記画像サーチ領域内の任意の位置に基準点を設定する第1の手段と、
前記基準点を基準とし、かつ、前記対象物に相似な複数の探査図形を設定する第2の手段と、
各前記探査図形について、該探査図形の外周に沿った輝度投影値を積算し、積算値の集合を得る第3の手段と、
隣接する前記探査図形間において前記積算値の差分値を計算する第4の手段と、
該第4の手段で計算された差分値の集合の中から、最大となる差分値を抽出し、これを当該基準点における最大差分候補値として保持する第5の手段と、
前記第1の手段で設定する前記基準点の位置を前記画像サーチ領域内で切り替えて前記第2、第3、第4および第5の手段によって得られた前記最大差分候補値の中から、最大となる最大差分候補値を抽出し、これを最大差分値として保持する第6の手段と、
前記最大差分値のときの探査図形を、前記対象物のエッジとして確定する第7の手段と、を備えることを特徴とするエッジ抽出装置。 An edge extraction device for extracting an edge of an object included in an image search area,
First means for setting a reference point at an arbitrary position in the image search area;
A second means for setting a plurality of exploration figures similar to the target object, based on the reference point,
Third means for each of the search patterns, integrating luminance projection values along the outer periphery of the search pattern to obtain a set of integrated values;
Fourth means for calculating a difference value of the integrated value between adjacent search patterns,
A fifth means for extracting a maximum difference value from a set of difference values calculated by the fourth means, and holding the same as a maximum difference candidate value at the reference point;
The position of the reference point set by the first means is switched in the image search area, and the maximum difference candidate value obtained by the second, third, fourth, and fifth means is selected. A sixth means for extracting a maximum difference candidate value that becomes, and holding this as a maximum difference value;
And a seventh means for determining the search pattern at the time of the maximum difference value as an edge of the object.
各前記輝度検査図形について、各該輝度検査図形の外周に沿って所定の間隔で輝度投影値を計測し保持する第9の手段と、
各前記輝度検査図形について、前記第9の手段で測定した前記輝度投影値が所定の範囲に含まれるか否かを判定する第10の手段と、
前記所定の範囲に含まれない前記輝度投影値の個数をカウントし、これをエラー数として保持する第11の手段と、
前記エラー数が所定の数より大きいか否かを判別する第12の手段と、
前記エラー数が所定の数より大きい場合、当該対象物は不良であると判定する第13の手段と、をさらに備える請求項22に記載のエッジ抽出装置。 Eighth means for setting at least two luminance test figures similar to the object based on the position of the reference point specified by the seventh means so as to sandwich the edge determined by the seventh means When,
Ninth means for measuring and holding a luminance projection value at predetermined intervals along an outer periphery of each of the luminance test graphics, for each of the luminance test graphics,
A tenth means for determining whether or not the brightness projection value measured by the ninth means is included in a predetermined range for each of the brightness test graphics;
An eleventh means for counting the number of the luminance projection values not included in the predetermined range and holding this as an error number;
Twelfth means for determining whether the number of errors is greater than a predetermined number,
23. The edge extracting apparatus according to claim 22, further comprising: thirteenth means for determining that the object is defective when the number of errors is larger than a predetermined number.
前記粗サーチ図形の外周図形および内周図形に沿った輝度投影値を積算して外周積算値および内周積算値を得る第15の手段と、
前記外周積算値と前記内周積算値との差分である外内差分値を計算する第16の手段と、
前記第14の手段で設定する前記粗サーチ基準点の位置を前記画像サーチ領域内において前記外周図形および前記内周図形の前記粗サーチ基準点からの距離の差分値以下の距離だけずらして前記第15および第16の手段によって得られる複数の外内差分値を抽出する第17の手段と、
前記第17の手段で得られた前記外内差分値を参照して、当該外内差分値が得られる前記粗サーチ図形の粗サーチ基準点を、前記基準点となるべき候補点として確定する第18の手段と、をさらに備える請求項22に記載のエッジ抽出装置。 Fourteenth means for setting a coarse search reference point, which is a coarse search graphic reference made up of two different-sized outer peripheral figures and inner peripheral figures similar to the object, at an arbitrary position in the image search area,
A fifteenth means for integrating the luminance projection values along the outer peripheral figure and the inner peripheral figure of the rough search figure to obtain an outer peripheral integrated value and an inner peripheral integrated value;
Sixteenth means for calculating an outer-internal difference value that is a difference between the outer peripheral integrated value and the inner peripheral integrated value,
The position of the coarse search reference point set by the fourteenth means is shifted in the image search area by a distance equal to or less than a difference value of a distance from the coarse search reference point of the outer peripheral figure and the inner peripheral figure. A seventeenth means for extracting a plurality of outside and inside difference values obtained by the fifteenth and sixteenth means;
Referring to the outer / inner difference value obtained by the seventeenth means, a coarse search reference point of the coarse search graphic from which the outer / internal difference value is obtained is determined as a candidate point to be the reference point. 23. The edge extraction device according to claim 22, further comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2004011917A JP2004272885A (en) | 2003-02-21 | 2004-01-20 | Device and method for edge extraction |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2003044221 | 2003-02-21 | ||
| JP2004011917A JP2004272885A (en) | 2003-02-21 | 2004-01-20 | Device and method for edge extraction |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2004272885A true JP2004272885A (en) | 2004-09-30 |
Family
ID=33134231
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2004011917A Pending JP2004272885A (en) | 2003-02-21 | 2004-01-20 | Device and method for edge extraction |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2004272885A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009265998A (en) * | 2008-04-25 | 2009-11-12 | Lambda Systems Inc | Image processing system, image processing method, and image processing program |
| JP2013058036A (en) * | 2011-09-07 | 2013-03-28 | Canon Inc | Image processing system, image processing program, robot device and image processing method |
| CN112529923A (en) * | 2020-12-15 | 2021-03-19 | 北京爱奇艺科技有限公司 | Control identification method and device |
-
2004
- 2004-01-20 JP JP2004011917A patent/JP2004272885A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009265998A (en) * | 2008-04-25 | 2009-11-12 | Lambda Systems Inc | Image processing system, image processing method, and image processing program |
| JP2013058036A (en) * | 2011-09-07 | 2013-03-28 | Canon Inc | Image processing system, image processing program, robot device and image processing method |
| CN112529923A (en) * | 2020-12-15 | 2021-03-19 | 北京爱奇艺科技有限公司 | Control identification method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102084213B (en) | Tire shape inspection method and tire shape inspection device | |
| US8355562B2 (en) | Pattern shape evaluation method | |
| CN1147709C (en) | Detection of irregularitites in a convex surface, such as a tire sidewall, using band-pass filtering | |
| US9171364B2 (en) | Wafer inspection using free-form care areas | |
| US8422759B2 (en) | Image processing method and image processing device | |
| WO2011070750A1 (en) | Device and method for inspecting tyre shape | |
| CN107239742B (en) | Method for calculating scale value of instrument pointer | |
| US9230318B2 (en) | Analysis of the digital image of the external surface of a tyre and processing of false measurement points | |
| JP5302701B2 (en) | Tire shape inspection method, tire shape inspection device | |
| JP2011017705A (en) | Pattern inspection device, pattern inspection method, and recording medium | |
| JP2008164593A (en) | Pattern inspection apparatus and method | |
| JP2005331274A (en) | Inspection method of tire irregularity pattern, and inspection device of tire irregularity pattern | |
| JP5202110B2 (en) | Pattern shape evaluation method, pattern shape evaluation device, pattern shape evaluation data generation device, and semiconductor shape evaluation system using the same | |
| US20160295207A1 (en) | Edge detection bias correction value calculation method, edge detection bias correction method, and edge detection bias correcting program | |
| JP5302702B2 (en) | Tire shape inspection method, tire shape inspection device | |
| CN112435210B (en) | Quality detection method and device for annular device | |
| EP2663998B1 (en) | Method and system of object based metrology for advanced wafer surface nanotopography | |
| CN118351097A (en) | Method and device for detecting glue path quality, electronic equipment and storage medium | |
| JP6496159B2 (en) | Pattern inspection apparatus and pattern inspection method | |
| CN106815830A (en) | The defect inspection method of image | |
| JP7058170B2 (en) | Tire mold side plate inspection method | |
| JP2003139519A (en) | Electronic component inspection device and program | |
| JP4597509B2 (en) | Pattern inspection apparatus and pattern inspection method | |
| CN111046878B (en) | Data processing method and device, computer storage medium and computer | |
| JP2004272885A (en) | Device and method for edge extraction |