JPH0713836B2 - Binarization circuit - Google Patents

Binarization circuit

Info

Publication number
JPH0713836B2
JPH0713836B2 JP63285620A JP28562088A JPH0713836B2 JP H0713836 B2 JPH0713836 B2 JP H0713836B2 JP 63285620 A JP63285620 A JP 63285620A JP 28562088 A JP28562088 A JP 28562088A JP H0713836 B2 JPH0713836 B2 JP H0713836B2
Authority
JP
Japan
Prior art keywords
image
density
pixels
circuit
contrast
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP63285620A
Other languages
Japanese (ja)
Other versions
JPH02132568A (en
Inventor
道明 宮川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP63285620A priority Critical patent/JPH0713836B2/en
Publication of JPH02132568A publication Critical patent/JPH02132568A/en
Publication of JPH0713836B2 publication Critical patent/JPH0713836B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、パターン認識技術を利用して各種部品(ワー
ク)の傷,形状を検査する自動外観検査装置、特にその
2値化回路に関するものである。
The present invention relates to an automatic visual inspection apparatus for inspecting scratches and shapes of various parts (workpieces) by utilizing pattern recognition technology, and more particularly to a binarization circuit thereof. Is.

〔従来の技術〕[Conventional technology]

従来、この種の回路としては、二次元撮像装置(例えば
TVカメラ)の出力を適宜に増幅したのち、TVカメラから
の信号を固定のしきい値で比較する固定2値化回路と、
カメラからの信号をCR不完全積分回路を介して得た信号
をしきい値とし、これをカメラ信号と比較する浮動2値
化回路が代表的なものとして知られている。
Conventionally, as a circuit of this type, a two-dimensional imaging device (for example,
A fixed binarization circuit that compares the signal from the TV camera with a fixed threshold value after appropriately amplifying the output of the TV camera),
A floating binarization circuit which compares a signal from a camera with a camera signal with a signal obtained through a CR incomplete integration circuit as a threshold value is known as a typical one.

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

ところで、傷検査等ではワークがベルトコンベア等で連
続的に搬送されるのが一般的であり、また欠陥部分が小
さく、かつ欠陥部分と正常部分とのコントラストが小さ
いものが多い。したがつて、TVカメラから得られる信号
も正常部分と欠陥部分とのコントラストが小さく、従来
の2値化回路では、これらの傷の検出が困難な場合が多
いと云う大きな問題があつた。なお、従来から検出困難
な傷不良の代表的なものとして、食品や薬品容器に付着
した髪の毛、または金属等の引つ掻き傷などがある。
By the way, in a scratch inspection or the like, a work is generally conveyed continuously by a belt conveyor or the like, and in many cases, the defective portion is small and the contrast between the defective portion and the normal portion is small. Therefore, the signal obtained from the TV camera has a small contrast between the normal portion and the defective portion, and there is a big problem that it is often difficult to detect these scratches by the conventional binarizing circuit. It should be noted that, as a typical defect that is difficult to detect from the past, there is hair attached to a food or drug container, or scratches caused by metal or the like.

したがつて、本発明は従来から検出困難とされていた傷
をワークが連続的に移動する場合でも高精度に検出する
ことが可能な2値化回路を提供することを目的とする。
Therefore, it is an object of the present invention to provide a binarization circuit that can detect a scratch, which has been conventionally difficult to detect, with high accuracy even when a work continuously moves.

〔課題を解決するための手段〕[Means for Solving the Problems]

こゝでは主として移動物体を対象とすることから、ワー
クがTVカメラの視野内に入つたときの1フレームの信号
のみを有効とし、判定の対象とする。すなわち、TVカメ
ラの信号を画素分割し、各画素に対してTVカメラの信号
をA/D変換(例えば8bit)して濃淡画像として捉え、こ
の濃淡画像に対し信号強調演算を行なつて、傷等のコン
トラストを強調する。信号強調の方法としては、従来検
出困難であつた傷の代表的なものが線状の特徴をもつこ
と、即ち方向性をもつことに着目し、線状の濃淡があれ
ばこれを強調する手法としている。このため、着目画素
ijの濃淡値S0とm×mの2次近傍周辺の画素の濃淡値S1
〜Smに対し、4方向の(線状)複数画素の組合せに分割
し、各方向に対して積和演算を行ない、4方向の演算値
の中で最も濃淡値の小さい(または大きい)値を検出
し、その値を着目点ijの濃淡として強調する。この操作
を全ての画像につき実行してコントラスト強調画像とす
る。この二次元局部面m×mの内、4方向の(線状)複
数画素の濃淡の積和をとり、かつ4方向の内の最小濃淡
(黒キズの場合)または最大濃淡(白キズの場合)をと
る。よつて、キズが存在したときキズの方向に沿つてキ
ズ濃度を積分する効果を有し、無欠陥部に対してはノイ
ズを減少させる効果をもつのでS/Nが向上し、かつコン
トラスト強調が行なわれる。
Since mainly moving objects are targeted here, only the signal of one frame when the work enters the field of view of the TV camera is valid and is the target of judgment. That is, the signal of the TV camera is divided into pixels, the signal of the TV camera is A / D converted (for example, 8 bits) for each pixel, and is captured as a grayscale image. Etc. to emphasize the contrast. As a signal enhancement method, attention is paid to the fact that typical scratches that have been difficult to detect in the past have linear characteristics, that is, they have directionality, and if there are linear shades, this method is emphasized. I am trying. Therefore, the pixel of interest
The shade value S 0 of ij and the shade value S 1 of pixels around the secondary neighborhood of m × m
~ Sm is divided into a combination of four (linear) pixels in four directions, and the product-sum operation is performed for each direction, and the value with the smallest grayscale value (or the largest) is calculated among the calculated values in the four directions. It is detected and the value is emphasized as the shade of the point of interest ij. This operation is executed for all the images to obtain contrast-enhanced images. In this two-dimensional local surface m × m, the product sum of the shades of a plurality of (linear) pixels in four directions is calculated, and the minimum shade (in the case of black flaws) or the maximum shade (in the case of white flaws) in the four directions is calculated. ). Therefore, when a flaw is present, it has the effect of integrating the flaw concentration along the direction of the flaw, and has the effect of reducing noise for the defect-free portion, improving S / N and enhancing contrast. Done.

このコントラスト強調をした信号を着目点画素ijの濃度
とし、周辺近傍画素との濃度演算をしてキズ検出を行な
うが、このとき周辺近傍画素の濃度として、同一画素ア
ドレスのコントラスト強調前の画像の濃淡データを用い
るようにする。これは、キズ検出を高精度に検出するに
は、コントラスト強調した画像は着目点ijだけでよく、
着目点に対する周辺近傍画素はむしろコントラスト強調
しない方がパターンの拡大の効果がなく、良い効果が得
られることに依る。とくに、良品のパターンが複雑な濃
淡模様であるときに顕著な効果をもつ。このため、異な
るメモリ間でn×nの二次元局部空間に対する濃淡演算
を行なうが、その方法として方向別に、着目点とそれを
挟む両側の濃淡値によつて差分濃度を求め、方向に着目
してキズを2値化するようにする。さらに、着目点とそ
れを挟む両側の濃淡に谷(黒キズの場合)または山(白
キズの場合)が形成されていることを確認することが望
ましい。
This contrast-enhanced signal is used as the density of the target pixel ij, and the density is calculated with surrounding neighboring pixels to detect flaws. At this time, the neighboring neighboring pixels are used as the density of the image before contrast enhancement at the same pixel address. Use grayscale data. This is because in order to detect flaw detection with high precision, the contrast-enhanced image needs only the point of interest ij,
This is because if the peripheral neighboring pixels with respect to the point of interest are not subjected to contrast enhancement, the effect of enlarging the pattern is not obtained and a good effect is obtained. In particular, it has a remarkable effect when the pattern of the non-defective product is a complicated shade pattern. For this reason, the grayscale operation is performed on the n × n two-dimensional local space between different memories. As a method, the difference density is obtained for each direction by the focus point and the grayscale values on both sides of the focus point, and the direction is focused. So that the scratches are binarized. Furthermore, it is desirable to confirm that a valley (in the case of a black flaw) or a mountain (in the case of a white flaw) is formed in the light and shade on both sides of the point of interest.

〔作用〕[Action]

(1) 撮像装置を介して得られる濃淡画像に対し、m
×mの二次元局部メモリによる二次元局部空間につい
て、着目点を中心として複数方向に分割し、その各々の
方向について、複数画素Nの濃淡値の積和をとる。した
がつて、キズがあればキズの濃淡はN倍の深さでコント
ラスト強調され、無欠陥部であればノイズは となり、信号強調と同時にノイズ除去がなされ、高S/N
となる。
(1) For a grayscale image obtained via the imaging device, m
The two-dimensional local space of the × m two-dimensional local memory is divided into a plurality of directions around the point of interest, and the sum of the gray values of the plurality of pixels N is calculated in each direction. Therefore, if there are any scratches, the contrast of the scratches will be contrast-enhanced at a depth of N times, and if there is no defect, noise will be reduced. , And noise is removed at the same time as signal enhancement, resulting in high S / N.
Becomes

(2) 方向別に複数画素の積和をとるので、従来検出
困難であつた線状のキズに沿つてコントラストが拡大さ
れ、単一画素の濃度のみに頼る従来方式よりも著しく検
出感度が向上する。
(2) Since the sum of products of a plurality of pixels is obtained for each direction, the contrast is expanded along a linear flaw that has been difficult to detect in the past, and the detection sensitivity is significantly improved as compared with the conventional method that relies only on the density of a single pixel. .

(3) 画素の方向を複数(4つ)方向にとるので、発
生するキズの方向に無関係にコントラスト強調される。
(3) Since the pixels are arranged in a plurality of directions (four directions), the contrast is enhanced regardless of the direction of the scratch.

(4) 着目点画素のデータとして、方向別に求めた積
和濃淡値に対し、最小濃淡値(黒キズの場合)または最
大濃淡値(白キズの場合)を与える濃淡値を着目点ijの
濃淡値とするので、キズのコントラスト強調が高精度に
できる。
(4) As the data of the target pixel, the gray value of the target point ij is the gray value that gives the minimum gray value (in the case of black flaws) or the maximum gray value (in the case of white flaws) of the product-sum gray value obtained for each direction. Since it is a value, it is possible to enhance the contrast of scratches with high accuracy.

(5) 以上のコントラスト強調を濃淡2次元局部メモ
リを使用して行なうので、有効画面領域全域にわたりコ
ントラスト強調できる。
(5) Since the above contrast enhancement is performed using the grayscale two-dimensional local memory, the contrast enhancement can be performed over the entire effective screen area.

(6) コントラスト強調した画像を着目点ijの濃淡と
し、周辺近傍画素をコントラスト強調する前の画像のij
の周辺近傍画素の濃度を使用して濃度差検知をするの
で、コントラスト強調による濃度パターンの拡大効果が
なく、キズ検出が安定にできる。
(6) The contrast-enhanced image is set as the shade of the point of interest ij, and ij of the image before the peripheral-enhanced pixels are subjected to the contrast enhancement
Since the density difference is detected by using the densities of the peripheral neighboring pixels, the effect of enlarging the density pattern by the contrast enhancement is not exerted, and the flaw detection can be stabilized.

(7) (6)項の処理を2次元局部メモリを使つて行
なうので、有効画面全域で安定な検出ができる。
(7) Since the processing of item (6) is performed using the two-dimensional local memory, stable detection can be performed over the entire effective screen.

(8) キズ検出演算についても方向別に濃度差検出を
行なうので、線状のキズに対し高精度の検出が可能とな
る。
(8) Since the density difference detection is also performed for each direction in the flaw detection calculation, it is possible to detect a linear flaw with high accuracy.

(9) 着目点を挟む両側の画素との関係から谷または
山検出をするので、著しく高精度の検出ができる。
(9) Since valleys or ridges are detected based on the relationship with the pixels on both sides of the point of interest, remarkably highly accurate detection can be performed.

(10) 以上の処理をTVカメラ内にワークが入つた1フ
レームの信号だけ行なうので、移動する物体に対しても
全く同様の効果が得られる。
(10) Since the above processing is performed only for the signal of one frame in which the work enters the TV camera, the same effect can be obtained for a moving object.

(11) 高速処理が可能となる。(11) High-speed processing becomes possible.

〔実施例〕 第1図は本発明の実施例を示すブロツク図である。同図
において、1はコンベア、2はワーク(物品)、3は位
置センサ、4は判定タイミング回路、5はTVカメラ、6
は増幅器、7は画面分割回路、8はアナログ/デイジタ
ル(A/D)変換器、9,9Aは濃淡2次元局部メモリ、10は
方向別積和演算回路、11は最小/最大濃淡値検出回路、
12は2次元空間濃度演算回路、13は比較回路、14はしき
い値設定回路、15は理論回路、16は認識回路である。
[Embodiment] FIG. 1 is a block diagram showing an embodiment of the present invention. In the figure, 1 is a conveyor, 2 is a work (article), 3 is a position sensor, 4 is a determination timing circuit, 5 is a TV camera, and 6
Is an amplifier, 7 is a screen division circuit, 8 is an analog / digital (A / D) converter, 9 and 9A are grayscale two-dimensional local memories, 10 is a product-sum calculation circuit for each direction, and 11 is a minimum / maximum grayscale value detection circuit. ,
Reference numeral 12 is a two-dimensional spatial density calculation circuit, 13 is a comparison circuit, 14 is a threshold value setting circuit, 15 is a theoretical circuit, and 16 is a recognition circuit.

まず、TVカメラ5でコンベア1上を常時撮像し、ワーク
(物品)2がTVカメラ視野内の適切な位置に到着したこ
とを位置センサ3で検知する。TVカメラの信号(撮像信
号)は増幅器6を介して常時適切なレベルに増幅され
る。画面分割回路7では、TVカメラの走査線とそれに同
期した例えば12MHzの高周波クロツクにより、TVカメラ
信号を空間的に多数の画素(例えば512×512)に離散化
すると同時に、各画素に対応するアナログ信号をサンプ
ルホールドする。判定タイミング回路4は、位置センサ
3の信号を受けてワークがTVカメラ視野内に入つたこと
を知り、TVカメラの同期信号とのタイミングをとつて1
フレーム期間だけ有効期間信号として出力する。回路7
はこの指令を受けて、1フレーム期間だけ信号を出力す
る。A/D変換回路8はTVカメラの濃淡を例えば8ビツト
に多値化し、濃淡画像をうる。この濃淡画像データをm
×m(ex.3×3)の8ビツトの濃淡をもつ濃淡2次元局
部メモリ9に入力し、二次元局部面の濃度を並列に出力
する。第2図に3×3の場合の局部空間の例を示す。な
お、同図のS0〜S8は各画素の濃淡値を示している。
First, the TV camera 5 constantly images the conveyor 1 and the position sensor 3 detects that the work (article) 2 has arrived at an appropriate position within the field of view of the TV camera. The signal of the TV camera (imaging signal) is always amplified to an appropriate level via the amplifier 6. In the screen division circuit 7, the TV camera signal is spatially discretized into a large number of pixels (for example, 512 × 512) by a scanning line of the TV camera and a high-frequency clock of, for example, 12 MHz synchronized with the scanning line, and at the same time, an analog signal corresponding to each pixel is obtained. Sample and hold the signal. The judgment timing circuit 4 receives the signal from the position sensor 3 and knows that the work has entered the field of view of the TV camera.
It is output as a valid period signal only during the frame period. Circuit 7
In response to this command, outputs a signal only for one frame period. The A / D conversion circuit 8 multi-values the gradation of the TV camera into, for example, 8 bits to obtain a gradation image. This grayscale image data is m
The density of the two-dimensional local surface is output in parallel by inputting it to the density two-dimensional local memory 9 having a density of 8 bits of xm (ex.3x3). FIG. 2 shows an example of the local space in the case of 3 × 3. It should be noted that S 0 to S 8 in the figure indicate the grayscale value of each pixel.

つぎに、方向別積和演算回路10と最小/最大濃淡値検出
回路11により、着目点ijの濃度S0と周辺近傍画素の濃度
S1〜S8とから所定の演算を行ない、コントラスト強調画
像Ic(i,j)を得る。この操作を有効画面領域全域につ
いて行なう。これは、公知の2次元局部メモリを使うこ
とにより自動的に実行される。この考え方を図示したの
が第3図(イ),(ロ)で、オリジナル画像I0(i,j)
に対し、I0の着目点ijと周辺近傍画素(点線によりI
0(i±Δx,j±Δy)として図示されている)の濃度に
対してF1なる関数をかけ、コントラスト強調画像Ic(i,
j)を得る様子が示されている。
Next, by the direction-wise product-sum calculation circuit 10 and the minimum / maximum gray value detection circuit 11, the density S 0 of the point of interest ij and the density of the neighboring pixels
A predetermined calculation is performed from S 1 to S 8 to obtain a contrast-enhanced image Ic (i, j). This operation is performed for the entire effective screen area. This is done automatically by using the known two-dimensional local memory. This idea is illustrated in Fig. 3 (a) and (b), which shows the original image I 0 (i, j).
On the other hand, the target point ij of I 0 and the neighboring pixels (I
The density of 0 (illustrated as i ± Δx, j ± Δy) is multiplied by the function F 1 to obtain the contrast-enhanced image Ic (i,
j) is shown.

具体的なF1の関数として本発明では、まずm×mの二次
元局部空間を第4図にA−A′,B−B′,C−C′,D−
D′で示すように、着目点を中心とする4方向の(線
状)複数画素に分割する。この4方向の(線状)画素の
各々の方向別に複数画素(3×3画素のときは3画素)
の濃度について積和演算をする。積和の式としては、例
えば次式がある。
In the present invention, as a concrete function of F 1 , first, an m × m two-dimensional local space is shown in FIG. 4 as AA ′, BB ′, CC ′, D−.
As indicated by D ′, the pixel is divided into a plurality of (linear) pixels in four directions centering on the point of interest. A plurality of pixels for each direction of the four-direction (linear) pixels (3 pixels for 3 × 3 pixels)
Calculate the sum of products for the concentration of. Examples of the product-sum formula include the following formulas.

A−A′:S1+kS0+S5=SijA B−B′:S2+kS0+S6=SijB C−C′:S3+kS0+S7=SijC D−D′:S4+kS0+S8=SijD ……(1) なお、kは重み係数であり、例えば2が採用される。方
向が予め定められているので、画素の組み合わせも一義
的に決定される。よつて、例えば第5図のように、濃淡
2次元局部メモリ9の濃度値を濃淡抽出部21A〜21Dによ
り方向別にラツチし、積和演算部22A〜22Dにより方向別
に積和演算することにより、(1)式の演算を容易に行
なうことができる。このように濃度演算した4組の濃淡
値に対し、回路11でその最小濃度(黒キズの場合)また
は最大濃度(白キズの場合)を検出し、着目点ijのコン
トラスト強調画像とする。こうして方向別の複数(線
状)画素(N画素)の積和をとることにより、もしキズ
があればキズに沿つて濃度が積分されることからキズ濃
度は拡大し、無欠陥部のノイズは減少する。よつて、コ
ントラスト強調されると同時に、低ノイズ画面が形成さ
れることになる。この方向別(線状)画素の積和を4方
向で行い、その4組の内から最小(または最大)濃度を
とることにより、キズの方向性に無関係にコントラスト
強調ができる。以上はm×mとして3×3で例示した
が、5×5でもよく、その方向分割例を第6図に示す。
A-A ': S 1 + kS 0 + S 5 = Sij A BB-: S 2 + kS 0 + S 6 = Sij B C-C': S 3 + kS 0 + S 7 = Sij C D-D ': S 4 + kS 0 + S 8 = Sij D (1) Note that k is a weighting coefficient, and for example, 2 is adopted. Since the direction is predetermined, the pixel combination is also uniquely determined. Therefore, as shown in FIG. 5, for example, the density values of the grayscale two-dimensional local memory 9 are latched by the grayscale extraction units 21A to 21D for each direction, and the sum of products calculation units 22A to 22D calculate the sum of products for each direction. The calculation of the equation (1) can be easily performed. The circuit 11 detects the minimum density (in the case of a black defect) or the maximum density (in the case of a white defect) of the four sets of density values calculated in this way, and sets it as the contrast-enhanced image of the point of interest ij. In this way, by multiplying and summing a plurality of (linear) pixels (N pixels) for each direction, if there is a flaw, the density is integrated along the flaw, so that the flaw density increases and the noise in the defect-free portion is reduced. Decrease. Therefore, the contrast is enhanced, and at the same time, a low noise screen is formed. Contrast enhancement can be performed irrespective of the directionality of scratches by performing the sum of products of the (pixel) pixels for each direction in four directions and taking the minimum (or maximum) density from the four sets. In the above, 3 × 3 is illustrated as m × m, but 5 × 5 may be used, and an example of the direction division is shown in FIG.

以上のようにして、回路11よりコントラスト強調された
画像Ic(i,j)が出力される。
As described above, the circuit 11 outputs the contrast-enhanced image Ic (i, j).

つぎに、キズ検出の方法について説明する。キズ検出す
るために、着目点とその周辺近傍画素との濃度差にもと
ずいてキズの有無を検出する。このとき本発明では、着
目点ijの濃淡値をIc(i,j)の濃淡値とし、周辺近傍画
素として、同一アドレスのオリジナル画像I0(i,j)の
周辺近傍画素i±Δx′,j±Δy′の濃度値を採用す
る。その考え方を示すのが第3図(ハ)で、こゝではキ
ズ検出の濃淡演算の関数をF2としている。
Next, a flaw detection method will be described. In order to detect flaws, the presence or absence of flaws is detected based on the difference in density between the point of interest and its neighboring pixels. At this time, in the present invention, the gray value of the point of interest ij is set to the gray value of Ic (i, j), and the neighboring pixels i ± Δx ′, of the original image I 0 (i, j) at the same address are set as the neighboring pixels. The density value of j ± Δy ′ is adopted. The concept is shown in Fig. 3 (c), where the gray level calculation function for flaw detection is F 2 .

具体的な関数としては、まず、キズ検出用のn×nの二
次元局部空間として第7図の如き5×5の空間を考え、
その内周辺近傍8画素を同図のように離散的にとる。な
お、この2次元局部演算はオリジナル画像I0(i,j)に
対してかけられる。第1図ではメモリ回路9から着目点
画素以外を2次元局部メモリ回路(II)9Aに入力し、2
次元局部メモリ9Aの出力から離散的な8画素について、
周辺近傍画素の濃度としてキズ検出用の2次元空間演算
回路12に入力する。一方、濃淡値検出回路11から回路12
へ着目点画素ijの濃度が入力される。なお、回路12の着
目点と近傍画素との位置関係は、1枚の画像の着目点と
周辺画素の関係のように、対応関係が狂わないようタイ
ミング合わせをすることとする。そして、2次元空間濃
度演算回路12では、方向別に近傍点を4方向の組合せに
し、方向別に第8図の左辺のような濃淡差演算(ex.
S1′+S5′−Ic(i,j))を実行する。この4組の濃淡
差をしきい値αと比較回路13で比較し、αよりも大きい
とき論理“1"として出力する。これを論理回路15で4方
向についてチエツクし、いずれかの方向で成立すればij
なる着目画素はキズ有として出力する。したがつて、回
路15はOR回路と云うことになり、この論理回路15の出力
が2値化信号として認識回路16に送られ、キズ認識が行
なわれる。
As a concrete function, first, consider a 5 × 5 space as shown in FIG. 7 as an n × n two-dimensional local space for flaw detection,
8 pixels in the vicinity of the inside are taken discretely as shown in FIG. The two-dimensional local calculation is applied to the original image I 0 (i, j). In FIG. 1, pixels other than the pixel of interest are input from the memory circuit 9 to the two-dimensional local memory circuit (II) 9A, and
For 8 discrete pixels from the output of the dimensional local memory 9A,
The density of peripheral neighboring pixels is input to the two-dimensional space calculation circuit 12 for flaw detection. On the other hand, the gray value detection circuit 11 to the circuit 12
The density of the target pixel ij is input to. It should be noted that the positional relationship between the target point of the circuit 12 and the neighboring pixels is adjusted so that the correspondence relationship does not change like the relationship between the target point of one image and the peripheral pixels. Then, in the two-dimensional spatial density calculation circuit 12, the neighboring points are combined in four directions for each direction, and the grayscale difference calculation (ex.
Perform S 1 ′ + S 5 ′ −Ic (i, j)). The comparison circuit 13 compares the gradation differences of these four groups with the threshold value α, and when the difference is larger than α, it is output as a logic “1”. This is checked in the logic circuit 15 in four directions, and if it is established in either direction, ij
Pixels of interest are output as scratched. Therefore, the circuit 15 is called an OR circuit, and the output of the logic circuit 15 is sent to the recognition circuit 16 as a binarized signal, and the scratches are recognized.

キズ検出のための二次元空間演算の他の例としては例え
ば第9図に示すように、着目点を挟む両側の2画素
S1′,S5′についてその方向別に、着目点濃度が両側の
2画素の濃度より共に所定しきい値α以上あるとき、キ
ズと検出する方法も考えられる。この操作により、方向
別に着目点が谷(黒キズ)であることがチエツクされる
ことになる。この谷検出を4方向について実行し、いず
れかの方向で条件が成立すればその画素ijをキズとして
出力する。
As another example of the two-dimensional space calculation for detecting the flaw, for example, as shown in FIG. 9, two pixels on both sides of the target point are provided.
For S 1 ′ and S 5 ′, a method of detecting a flaw when the density of the point of interest is higher than the density of two pixels on both sides by a predetermined threshold value α or more depending on the direction may be considered. By this operation, it is checked that the point of interest is a valley (black scratch) for each direction. This valley detection is executed in four directions, and if the condition is satisfied in either direction, the pixel ij is output as a flaw.

〔発明の効果〕〔The invention's effect〕

(1) オリジナル画像に対して、4方向の方向別の
(線状)画素に着目した積和演算を行ない、キズの方向
に沿つてキズ濃度を拡大し、無欠陥部のノイズを低下さ
せる如きコントラスト強調演算を行なうようにしたの
で、従来困難であつたキズの検出が容易になる。
(1) For the original image, a product-sum operation focusing on four (direction) pixels in each direction is performed, the defect density is expanded along the direction of the defect, and noise in the defect-free portion is reduced. Since the contrast enhancement calculation is performed, it becomes easy to detect a flaw which has been difficult in the past.

(2) キズ検出のための2次元局部空間演算に当た
り、着目点ijの画像にはコントラスト強調画像のij点の
データを用い、周辺近傍画素にはコンストラスト強調す
る前の画像I0(i,j)の対応する画素データを用いてお
り、コンストラスト強調による低濃度差部分の拡大(膨
張)効果が周辺近傍画素にはないので、複雑な濃淡状態
をもつパターンに対しても高精度に検出できる。
(2) In the two-dimensional local space calculation for flaw detection, the image of the point of interest ij uses the data of the point ij of the contrast-enhanced image, and the neighboring pixels include the image I 0 (i, Since the pixel data corresponding to j) is used and the effect of expanding (expanding) the low density difference part by the contrast emphasis is not in the peripheral neighboring pixels, it is possible to detect with high accuracy even for a pattern having a complicated shade state. it can.

(3) キズ検出のための濃度演算に当たり、二次元局
部面に方向性をもたせた演算を行なうようにしたので、
キズの方向に沿つた2値化が可能となる。
(3) In the density calculation for detecting scratches, the calculation is performed by giving directionality to the two-dimensional local surface.
Binarization along the direction of scratches is possible.

(4) 以上のことから、従来困難であつた髪の毛や引
き掻きキズを高精度に検出することができる。また、刻
印文字のような低コントラストの形状検出にも効果的に
作用することが確認されている。
(4) From the above, it is possible to detect hair and scratches that have been difficult in the past with high accuracy. Further, it has been confirmed that it also works effectively for detecting low-contrast shapes such as engraved characters.

(5) TVカメラの1フレームだけの信号を使用してい
るので、移動物体についても確実かつ高精度な検出が可
能となる。
(5) Since the signal of only one frame of the TV camera is used, it is possible to reliably and highly accurately detect a moving object.

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

第1図は本発明の実施例を示すブロツク図、第2図は3
×3の二次元局部空間を説明するための説明図、第3図
は本発明におけるコントラスト強調演算および二次元空
間濃度演算の概念を説明するための説明図、、第4図は
第2図に示す二次元局部空間の方向割付例を説明するた
めの説明図、第5図は第1図に示す積和演算回路の具体
例を示すブロツク図、第6図は5×5の二次元局部空間
と方向割付例を説明するための説明図、第7図はキズ検
知に用いられる二次元局部空間の一例を説明するための
説明図、第8図は二次元空間濃度演算の概要を示す概念
図、第9図は二次元空間濃度演算の他の例の概要を示す
概念図である。 符号説明 1……コンベア、2……ワーク、3……位置センサ、4
……判定タイミング回路、5……TVカメラ、6……増幅
器、7……画面分割回路、8……アナログ/デイジタル
(A/D)変換器、9,9A……2次元局部メモリ、10……方
向別積和演算回路、11……最小/最大濃淡値検出回路、
12……2次元空間濃度演算回路、13……比較回路、14…
…しきい値設定回路、15……論理回路、16……認識回
路、21A〜21D……濃淡抽出部、22A〜22D……積和演算
部。
FIG. 1 is a block diagram showing an embodiment of the present invention, and FIG. 2 is a block diagram.
FIG. 3 is an explanatory view for explaining a two-dimensional local space of × 3, FIG. 3 is an explanatory view for explaining the concept of the contrast enhancement calculation and the two-dimensional spatial density calculation in the present invention, and FIG. 4 is shown in FIG. FIG. 5 is an explanatory view for explaining an example of direction allocation of the two-dimensional local space shown in FIG. 5, FIG. 5 is a block diagram showing a concrete example of the product-sum calculation circuit shown in FIG. 1, and FIG. 6 is a two-dimensional local space of 5 × 5. And FIG. 7 is an explanatory diagram for explaining an example of direction allocation, FIG. 7 is an explanatory diagram for explaining an example of a two-dimensional local space used for flaw detection, and FIG. 8 is a conceptual diagram showing an outline of a two-dimensional spatial density calculation. FIG. 9 is a conceptual diagram showing the outline of another example of the two-dimensional spatial density calculation. Reference numeral 1 ... Conveyor, 2 ... Work, 3 ... Position sensor, 4
...... Judgment timing circuit, 5 …… TV camera, 6 …… Amplifier, 7 …… Screen division circuit, 8 …… Analog / digital (A / D) converter, 9,9A …… 2D local memory, 10 ・ ・ ・… Side-by-direction product-sum operation circuit, 11 …… Minimum / maximum gray value detection circuit,
12 …… two-dimensional spatial concentration calculation circuit, 13 …… comparison circuit, 14 ・ ・ ・
... Threshold setting circuit, 15 ... Logic circuit, 16 ... Recognition circuit, 21A-21D ... Gray level extraction section, 22A-22D ... Sum of products operation section.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】対象物を撮像する撮像手段と、 対象物が該撮像手段の視野内に入つたとき撮像信号を有
効とするタイミング制御手段と、 該撮像信号を画素単位でアナログ/デイジタル変換して
原濃淡画像を得る原画像抽出手段と、 原濃淡画像に対し着目点の濃淡情報と着目点近傍周辺画
素の濃淡情報とから二次元局部空間を複数方向に分割し
てそれぞれ積和演算をし方向別積和値の内で最も小さい
かまたは大きい濃度を着目点のコントラスト強調濃度と
する処理を原濃淡画像の全画素について行ないコントラ
スト強調画像を得る強調画像抽出手段と、 着目点にはコントラスト強調画像を用い周辺近傍画素に
は前記原濃淡画像の対応画素を用いて二次元局部空間毎
に濃度演算を行なう演算手段と、 を備え、該演算値を所定のしきい値と比較して2値化す
ることを特徴とする2値化回路。
1. An image pickup means for picking up an image of an object, a timing control means for making an image pickup signal effective when the object enters the field of view of the image pickup means, and an analog / digital conversion of the image pickup signal in pixel units. A two-dimensional local space is divided into a plurality of directions from the original image extraction means that obtains the original grayscale image, and the grayscale information of the point of interest and the grayscale information of pixels around the point of interest for the original grayscale image, and the sum of products operation is performed for each. Emphasizing image extraction means that obtains a contrast-enhanced image by performing processing for all pixels of the original gray-scale image by using the density that is the smallest or the largest of the direction-wise product sum values as the contrast-enhancing density. And a calculation means for calculating density for each two-dimensional local space using corresponding pixels of the original gray image as peripheral neighboring pixels using an image, and comparing the calculated value with a predetermined threshold value. Binarizing circuit, characterized in that binarization.
【請求項2】請求項1)に記載の2値化回路において、
前記演算手段は少なくとも複数の方向性に着目した方向
別の濃度差を求める濃度差演算手段をもち、該濃度差が
しきい値以上となる方向が少なくとも1つあるとき有意
とすることを特徴とする2値化回路。
2. The binarization circuit according to claim 1, wherein:
The calculating means has a density difference calculating means for obtaining a density difference for each direction focusing on at least a plurality of directionalities, and is significant when there is at least one direction in which the density difference is equal to or more than a threshold value. Binarization circuit to do.
JP63285620A 1988-11-14 1988-11-14 Binarization circuit Expired - Lifetime JPH0713836B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63285620A JPH0713836B2 (en) 1988-11-14 1988-11-14 Binarization circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63285620A JPH0713836B2 (en) 1988-11-14 1988-11-14 Binarization circuit

Publications (2)

Publication Number Publication Date
JPH02132568A JPH02132568A (en) 1990-05-22
JPH0713836B2 true JPH0713836B2 (en) 1995-02-15

Family

ID=17693888

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63285620A Expired - Lifetime JPH0713836B2 (en) 1988-11-14 1988-11-14 Binarization circuit

Country Status (1)

Country Link
JP (1) JPH0713836B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005275900A (en) * 2004-03-25 2005-10-06 Noritsu Koki Co Ltd Image processing method and program for suppressing particulate noise, and image processing apparatus for implementing the method
CN111412864B (en) * 2020-02-26 2021-12-07 长安大学 Automatic grinding crack angle detection method based on grinding crack gray scale similarity

Also Published As

Publication number Publication date
JPH02132568A (en) 1990-05-22

Similar Documents

Publication Publication Date Title
US5081689A (en) Apparatus and method for extracting edges and lines
CN101600957A (en) Defect detecting device and defect inspection method
Xia et al. An automatic machine vision-based algorithm for inspection of hardwood flooring defects during manufacturing
CN112085700A (en) Automatic extraction method, system and medium for weld joint region in X-ray image
US6597805B1 (en) Visual inspection method for electronic device, visual inspecting apparatus for electronic device, and record medium for recording program which causes computer to perform visual inspecting method for electronic device
JPH0713836B2 (en) Binarization circuit
JP3044951B2 (en) Circular container inner surface inspection device
JPH04147045A (en) Surface inspection device
CN114387333B (en) A method for detecting concave points of coal gangue dual-energy X-ray images
JPH06103275B2 (en) Defect extraction method by visual inspection
JP3508518B2 (en) Appearance inspection method
JP3367449B2 (en) Electronic component appearance inspection method, appearance inspection apparatus, and recording medium storing a program for causing a computer to execute the appearance inspection process
JP2710685B2 (en) Defect detection method by visual inspection
JP4799426B2 (en) Contour inspection method and apparatus
JPH08304302A (en) Method for detecting surface flaws on inspection object
JP2018128261A (en) Inspection apparatus and method
JPH0217832B2 (en)
JPH02132567A (en) Binarizing circuit
JPH067171B2 (en) Moving object detection method
JP3367450B2 (en) Electronic component appearance inspection method, appearance inspection apparatus, and recording medium storing a program for causing a computer to execute the appearance inspection process
JPH05280958A (en) Defect inspection device
JPH1114317A (en) Appearance inspection method and apparatus
JPH07280746A (en) Metal plate surface flaw extraction device
JP2956151B2 (en) Image processing method and apparatus
JP3113039B2 (en) Shape inspection device