JPH11248646A - Device for inspecting inner face of container - Google Patents

Device for inspecting inner face of container

Info

Publication number
JPH11248646A
JPH11248646A JP5168398A JP5168398A JPH11248646A JP H11248646 A JPH11248646 A JP H11248646A JP 5168398 A JP5168398 A JP 5168398A JP 5168398 A JP5168398 A JP 5168398A JP H11248646 A JPH11248646 A JP H11248646A
Authority
JP
Japan
Prior art keywords
image
value
pixel
container
defect
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5168398A
Other languages
Japanese (ja)
Inventor
Yutaka Ishizaka
豊 石坂
Tatsuo Yamamura
辰男 山村
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 JP5168398A priority Critical patent/JPH11248646A/en
Publication of JPH11248646A publication Critical patent/JPH11248646A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To define as critical defects of rupture or thickness of light darkness without defining harmless defects of fine black points of thick darkness as defects when inspecting defects of darkness from a variable density image on the inner face of a food container. SOLUTION: Figures (a), (b) show variable density image distributions on a scanning line passing through a defect D1 of light darkness and a defect D2 of heavy darkness, respectively. An inspecting device detects defects of darkness by binarizing a difference (a deeping amount of darkness) between density values for two background picture elements a width α apart from the picture elements to forward and backward directions on the scanning line by using predetermined threshold values, where two threshold values THD1 and THD2, THD1<L1, L1<THD2<L2, are provided, L1 is in the maximum value for the difference between the density values for the defect D1, and L2 is the maximum value for the difference between the density values for the defect 2. Binary image distributions at the threshold value THD1 corresponding to the (a), (b) are (c), (d) and similarly binary image distributions at the threshold value THD2 are (e), (f), and the defects D1, D2 are subdivided from two binary images to judge whether they are good or not in accordance with area values for the defects.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、2次元撮像装置に
より生産ライン上の樹脂容器,紙容器のような食品容器
等の内面を撮像し、そのデジタル濃淡画像(多値濃淡画
像又は単に濃淡画像ともいう)をもとに、容器の内面に
生ずる暗い欠陥部を検査する容器内面検査装置に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a digital gray image (multi-value gray image or simply gray image) of an inner surface of a food container such as a resin container or a paper container on a production line by using a two-dimensional imaging device. The present invention also relates to a container inner surface inspection apparatus for inspecting a dark defective portion generated on the inner surface of a container based on the same.

【0002】なお以下各図において同一の符号は同一も
しくは相当部分を示す。
[0002] In the drawings, the same reference numerals indicate the same or corresponding parts.

【0003】[0003]

【従来の技術】この種の容器の内面に発生する、暗く見
える欠陥としては、黒点、破れ、肉薄等があるが、これ
らの欠陥のうち微小な欠陥までを検出する方法として、
容器内面の濃淡画像に各種の微分を施して欠陥部分の画
像を強調した上、この画像を2値化する方法が知られて
いる。
2. Description of the Related Art Dark spots appearing on the inner surface of a container of this type include black spots, tears, thin walls, and the like.
There has been known a method of performing various differentiations on a grayscale image of an inner surface of a container to emphasize an image of a defective portion, and then binarizing the image.

【0004】なお、ここでいう欠陥とは、正常部分とは
異なって見える部分をいい、この欠陥が直ちに容器の不
良につながるものではない。また、近傍の背景より暗い
微小部分のみを検出するように工夫された特殊な2値化
を用いる方法も、本出願人の先願になる特開平5−10
7200号公報において提案されている。
The term "defect" as used herein refers to a portion that looks different from a normal portion, and this defect does not immediately lead to a defective container. A method using a special binarization designed to detect only a minute part darker than the neighboring background is disclosed in Japanese Patent Application Laid-Open No. H05-1010 filed by the present applicant.
7200.

【0005】この後者(先願)の方法は、近傍の背景と
の多値濃淡画像信号(単に濃淡画像信号ともいう)のレ
ベル(濃淡値、画素値、或いは輝度情報ともいう)の差
が一定のしきい値以上の画素の値を“1”、その他の画
素の値を“0”とする2値化を行うことにより、2値化
画素値“1”の画素からなる欠陥部分のみを検出するも
ので、この方法によれば、容器内面の明るさが一様でな
く、明るさに多少の変化があっても欠陥を検出すること
ができる。
In the latter method (prior application), the difference in level (also referred to as a gray value, a pixel value, or luminance information) of a multi-valued gray image signal (also simply referred to as a gray image signal) from a nearby background is constant. By performing binarization with the value of the pixel equal to or more than the threshold value of “1” and the values of the other pixels being “0”, only the defective portion consisting of the pixel with the binarized pixel value of “1” is detected. According to this method, the defect can be detected even if the brightness of the inner surface of the container is not uniform and the brightness slightly changes.

【0006】[0006]

【発明が解決しようとする課題】ところで、黒点と共に
破れや肉薄等が発生する樹脂容器のような食品容器を前
記した後者の方法で検査しようとする場合、黒点、破
れ、肉薄等の欠陥部分は、何れもその近傍の背景より暗
くはなるものの、欠陥部分とその近傍の背景との濃淡画
像信号のレベル差は、黒点よりも破れや肉薄の方が小さ
いため、同一の2値化しきい値で欠陥部分を検出しよう
とすると、破れや肉薄の方が検出感度が低くなる。
In the case of inspecting a food container such as a resin container which is torn or thin with black spots by the latter method, defective portions such as black spots, tears and thinning are required. Although each of them becomes darker than the background in the vicinity, the level difference of the grayscale image signal between the defective portion and the background in the vicinity is smaller than that of the black point in the degree of breakage or thinness, so that the same binary threshold value is used. When trying to detect a defective portion, the detection sensitivity is lower when the portion is torn or thin.

【0007】しかし、欠陥としては黒点よりも破れや肉
薄のほうが致命的であり、高い検出精度が要求される。
そこで検出感度を高くするため2値化しきい値を小さく
すると、今度は不良とする必要のないような、非常に微
細な黒点までも検出されて、無駄な不良判定が行われて
しまう。そこで、本発明は暗さは薄いが致命的な欠陥で
ある破れや肉薄を不良と一方で、暗さは濃いが無害な欠
陥である微細な黒点を不良としないようにすることがで
きる容器内面検査装置を提供することを課題とする。
However, a defect is more fatal if it is broken or thinner than a black spot, and high detection accuracy is required.
Therefore, if the binarization threshold is reduced in order to increase the detection sensitivity, even a very fine black point, which does not need to be determined to be defective, is detected, and useless defect determination is performed. Therefore, the present invention is not limited to tearing and thinning, which are fatal defects, which are thin but dark, while preventing fine black spots, which are dark but harmless defects, from being defective. It is an object to provide an inspection device.

【0008】[0008]

【課題を解決するための手段】前記の課題を解決するた
めに請求項1の容器内面検査装置は、2次元の撮像手段
(1)を介し撮像された容器内面の映像をラスタ走査し
て得られる映像信号を(A/D変換手段1’を介して)
A/D変換し、この変換出力から作られる容器内面の濃
淡画像を画像メモリ(2)に記憶し、この画像メモリの
全体または一部の検査領域を(走査手段3を介し)水平
方向または垂直方向に走査して容器内面の暗い欠陥部を
検査する容器内面検査装置において、前記検査領域の走
査によって読み出される濃淡画像信号を用い、この検査
領域の濃淡画像を所定のしきい値で2値化する2値化手
段(4など)と、この2値化手段により得られる2値化
画像を互いに離れた白画像部分毎に分離する画像分離手
段(5など)との組を、前記しきい値を異にして複数組
(4と5の組、8と9の組など)備え、さらに、この各
組毎に、当該組の画像分離手段によって分離された白画
像の内、前記しきい値が当該組に次いで大きい組の白画
像と空間的に重なりを持たない白画像毎の面積値を夫々
当該組に対応する所定の基準値と比較する手段(面積検
出手段6,10、判定手段7,11など)を備えたもの
とする。
According to a first aspect of the present invention, there is provided a container inner surface inspection apparatus which raster-scans an image of a container inner surface imaged via a two-dimensional image pickup means. Video signal (via A / D conversion means 1 ')
A / D conversion is performed, and a grayscale image of the inner surface of the container formed from the converted output is stored in an image memory (2), and the whole or a part of the inspection area of the image memory is horizontally or vertically (via a scanning unit 3). In a container inner surface inspection apparatus that scans in a direction to inspect a dark defective portion on the inner surface of a container, a grayscale image of the inspection region is binarized by a predetermined threshold value using a grayscale image signal read by scanning the inspection region. A set of binarizing means (e.g., 4) that performs the binarizing operation and an image separating means (e.g., 5) that separates the binarized image obtained by the binarizing means into white images separated from each other. And a plurality of sets (sets of 4 and 5, sets of 8 and 9), and for each set, the threshold value of the white image separated by the image separating means of the set is It is spatially overlapped with the next larger white image Means (area detection means 6, 10, etc. determination means 7, 11) for comparing a predetermined reference value corresponding to each said set area value of each white image with no and those with.

【0009】また請求項2の容器内面検査装置では、請
求項1に記載の容器内面検査装置において、前記2値化
手段が、前記検査領域の走査によって読み出される濃淡
画像信号上の各画素についての、当該画素の所定の近傍
を背景とする暗さの深まり量を前記しきい値で2値化す
るものであるようにする。
In the container inner surface inspection apparatus according to a second aspect of the present invention, in the container inner surface inspection apparatus according to the first aspect, the binarizing means is provided for each pixel on a grayscale image signal read by scanning the inspection area. The depth of darkness with a predetermined neighborhood of the pixel as a background is binarized by the threshold value.

【0010】また請求項3の容器内面検査装置では、請
求項2に記載の容器内面検査装置において、前記2値化
手段が、当該走査線上において着目画素(正常部着目点
51,欠陥部着目点54など)の前後に着目画素から所
定の幅(画素数α)だけ離れた各背景画素(正常部背景
点52,53、欠陥部背景点55,56など)の値から
夫々、着目画素の値を減じた2つの差分の画素値(L
1,L2など)を前記暗さの深まり量とし、この2つの
差分の画素値が共に前記しきい値より大きいか否かに応
じて、着目画素の値を夫々“1”,“0”に2値化する
ものであるようにする。
In the container inner surface inspection apparatus according to a third aspect of the present invention, in the container inner surface inspection apparatus according to the second aspect, the binarizing means includes a target pixel (a normal part target point 51, a defective part target point) on the scanning line. 54, etc., before and after the pixel of interest by a predetermined width (the number of pixels α), the value of the pixel of interest is calculated from the value of each of the background pixels (normal part background points 52, 53, defective part background points 55, 56, etc.). The pixel value of the two differences (L
1, L2) as the depth of the darkness, and the value of the pixel of interest is set to “1” and “0”, respectively, depending on whether the pixel values of the two differences are both larger than the threshold value. It is to be binarized.

【0011】また請求項4の容器内面検査装置では、請
求項3に記載の容器内面検査装置において、前記背景画
素の値に代えて、当該走査線上におけるこの背景画素を
含む一連の所定個数分の画素の画素値の平均値を用いる
ようにする。また請求項5の容器内面検査装置では、請
求項1ないし4のいずれかに記載の容器内面検査装置に
おいて、前記画像分離手段が、前記2値化手段から得ら
れる2値化信号の“1”の画素数を投影データ(15,
16など)として走査線ごとに検出し、走査線毎の1以
上の前記投影データが走査線間で連続して並ぶ投影デー
タの部分(P11〜P15、P22,P23,P25な
ど)が前記白画像の1つに対応するものと見做すように
する。
According to a fourth aspect of the present invention, in the container inner surface inspection apparatus according to the third aspect, instead of the value of the background pixel, a series of a predetermined number of pixels including the background pixel on the scanning line is used. The average value of the pixel values of the pixels is used. In a container inner surface inspection apparatus according to a fifth aspect, in the container inner surface inspection apparatus according to any one of the first to fourth aspects, the image separation unit outputs a binary signal “1” obtained from the binarization unit. Of the projection data (15,
16) is detected for each scanning line, and one or more of the projection data for each scanning line are continuously arranged between the scanning lines (P11 to P15, P22, P23, P25, etc.) are the white image. Is considered to correspond to one of the following.

【0012】[0012]

【発明の実施の形態】図1は本発明の一実施例としての
構成を示すブロック図である。この例では検査対象の軸
対称の食品容器の内面がその軸方向から軸対称に照明さ
れるものとする。 同図において、1はこの容器の内面
をその軸方向から撮像してその映像をラスタ走査し、映
像信号(ビデオ信号)として出力するTVカメラなどの
2次元の撮像手段、1’はこの映像信号をを順次サンプ
リングしつつA/D変換して多値の画素データ列(つま
り画素別の多値濃淡画像信号の列)とするA/D変換手
段である。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention. In this example, it is assumed that the inner surface of the axisymmetric food container to be inspected is illuminated axisymmetrically from the axial direction. In FIG. 1, reference numeral 1 denotes a two-dimensional image pickup means such as a TV camera for imaging the inner surface of the container from its axial direction, raster-scanning the image, and outputting the image as a video signal (video signal); A / D conversion means for performing A / D conversion while sequentially sampling data to obtain a multi-valued pixel data sequence (that is, a sequence of multi-valued gray-scale image signals for each pixel).

【0013】2はこの各画素別の多値濃淡画像信号を、
撮像手段1によって撮像された映像に対応する多値濃淡
画像として記憶する濃淡画像メモリ、3は濃淡画像メモ
リ2に格納された画像のうち、検査を要する部分を水平
方向または垂直方向に走査して読み出す走査手段であ
る。濃淡画像メモリ2の後段には、第1の2値化手段
4,第1の画像分離手段5,第1の面積検出手段6,第
1の判定手段7の配列と、第2の2値化手段8,第2の
画像分離手段9,第2の面積検出手段10,第2の判定
手段11の配列との2組の配列が並列に設けられてい
る。
Reference numeral 2 denotes a multi-valued gray-scale image signal for each pixel,
A gray-scale image memory 3 stores a multi-level gray-scale image corresponding to a video imaged by the imaging unit 1, and scans a portion of the image stored in the gray-scale image memory 2 that needs to be inspected in the horizontal or vertical direction. It is a scanning means for reading. An array of first binarizing means 4, first image separating means 5, first area detecting means 6, first judging means 7 and second binarizing means Two sets of arrangements of the means 8, the second image separation means 9, the second area detection means 10, and the arrangement of the second determination means 11 are provided in parallel.

【0014】ここで濃淡画像メモリ2から走査手段3に
より読み出された濃淡画像は、一方では第1の2値化手
段4により或るしきい値で2値化されて2値化画像とな
り、この2値化画像は第1の画像分離手段5により互い
に分離した白画像部分ごとに分離され、この各白画像部
分ごとの面積値が第1の面積検出手段6により求められ
る。そしてこの白画像部分ごとの面積値の内、次に述べ
る第2の画像分離手段9によって分離された白画像と空
間的に重なりを持たない白画像部分ごとの面積値が第1
の判定手段7により基準値と比較され、容器の良否が判
定される。
On the other hand, the grayscale image read out from the grayscale image memory 2 by the scanning means 3 is binarized by a first thresholding means 4 at a certain threshold value to form a binary image. The binarized image is separated for each white image portion separated from each other by the first image separating means 5, and the area value for each white image portion is obtained by the first area detecting means 6. Then, of the area values for each white image portion, the area value for each white image portion that does not spatially overlap with the white image separated by the second image separation unit 9 described below is the first value.
Is compared with the reference value to determine the acceptability of the container.

【0015】他方、濃淡画像メモリ2から走査手段3に
より読み出された同じ濃淡画像は、第2の2値化手段8
により、第1の2値化手段4より大きいしきい値で2値
化され、この2値化画像は第1の画像分離手段5の場合
と同様に、第2の画像分離手段9により互いに分離した
白画像部分ごとに分離され、この各白画像部分ごとの面
積値が第1の面積検出手段6の場合と同様に、第2の面
積検出手段10により求められ、この求められた白画像
部分ごとの面積値が第2の判定手段11により、第1の
判定手段7とは別の基準値と比較され、容器の良否が判
定される。
On the other hand, the same gray-scale image read out from the gray-scale image memory 2 by the scanning means 3 is stored in the second binarizing means 8.
, The binarized images are separated from each other by the second image separating unit 9 in the same manner as in the case of the first image separating unit 5. Each of the white image portions is separated, and the area value of each of the white image portions is obtained by the second area detecting means 10 as in the case of the first area detecting means 6, and the obtained white image portion is obtained. The area value of each container is compared with a reference value different from that of the first determination means 7 by the second determination means 11 to determine the quality of the container.

【0016】図2は、近傍の背景より暗い微小部分のみ
を検出するように工夫された特殊な2値化手段としての
第1の2値化手段4及び第2の2値化手段8の動作原理
の説明図であり、同図は前記した特開平5−10720
0号公報中の図1と同等のものである。次にこの図2を
用いてこの2値化手段4及び8の動作原理を簡単に説明
する。
FIG. 2 shows the operation of the first binarizing means 4 and the second binarizing means 8 as special binarizing means designed to detect only a minute portion darker than the neighboring background. FIG. 3 is an explanatory view of the principle, which is the same as that of the above-mentioned Japanese Patent Application Laid-Open No. Hei 5-10720.
This is equivalent to FIG. Next, the operation principle of the binarizing means 4 and 8 will be briefly described with reference to FIG.

【0017】同図(a)は2値化手段に入力された多値
濃淡画像のj列目(つまり垂直座標y=jの水平走査線
Q−Q1上の画素列)の多値濃淡画像信号PO(x,
y)の例を示す。但しxは当該画素の水平座標としての
行番号で、この図の横軸の座標に相当する。ここで、5
1は正常部分(黒汚れの無い部分)における着目点、5
2と53は夫々この着目点51に対し、j列目上で所定
の幅、即ち前と後に画素数αだけ離れた背景点としての
正常部前方背景点と正常部後方背景点である。
FIG. 2A shows a multi-valued gray-scale image signal of the j-th column of the multi-valued gray-scale image input to the binarizing means (ie, a pixel column on the horizontal scanning line Q-Q1 with the vertical coordinate y = j). PO (x,
The example of y) is shown. Here, x is a row number as the horizontal coordinate of the pixel, and corresponds to the coordinate on the horizontal axis in this figure. Where 5
1 is a point of interest in a normal part (a part without black dirt),
Reference numerals 2 and 53 denote a normal part front background point and a normal part rear background point as background points separated by a predetermined width on the j-th column with respect to the point of interest 51, ie, before and after the number of pixels α.

【0018】同様に54は欠陥部分(黒汚れの存在する
部分)における着目点、55と56は夫々この着目点5
4に対し、j列目上で同じく所定の幅、即ち前と後に画
素数αだけ離れた背景点としての欠陥部前方背景点と欠
陥部後方背景点である。いま、着目点の座標をx=i,
y=jとすると、前方背景点の座標はx=i+α,y=
j、後方背景点の座標はx=i−α,y=jで表され、
そこで着目点,前方背景点,後方背景点の夫々の多値濃
淡画像信号の値(濃淡値,画素値)をPO(i,j),
PO(i+α,j),PO(i−α,j)としたとき、
Similarly, reference numeral 54 denotes a point of interest in a defective portion (a portion where black dirt is present), and reference numerals 55 and 56 denote points of interest 5 respectively.
In contrast to the above, a background point in front of the defective portion and a background point behind the defective portion as background points separated by the same width on the j-th column by the same number of pixels, ie, before and after the number of pixels α. Now, let the coordinates of the point of interest be x = i,
If y = j, the coordinates of the front background point are x = i + α, y =
j, the coordinates of the rear background point are represented by x = i−α, y = j,
Therefore, the values (shading values, pixel values) of the multi-valued shading image signals at the point of interest, the front background point, and the back background point are represented by PO (i, j),
PO (i + α, j) and PO (i−α, j),

【0019】[0019]

【数1】 PO(i−α,j)−PO(i,j)>THD ・・・(1) PO(i+α,j)−PO(i,j)>THD ・・・(2) 但しTHDは所定のしきい値(正値)とする。上記
(1),(2)式の関係があれば、着目点における2値
化関数値POD(i,j)=“1”として、この着目点
を谷(即ち黒汚れ有り)と判断し、一方、その他の場合
にはPOD(i,j)=“0”として、この着目点を正
常部(即ち黒汚れ無し)と判断する。従って、この2値
化手段は、図2(a)の正常部分では上式(2)が成立
しないので黒汚れ無しと判断して出力し、欠陥部分では
上式(1),(2)が共に成立するので黒汚れ有りと判
断して出力する(図2(b)参照)。
PO (i−α, j) −PO (i, j)> THD (1) PO (i + α, j) −PO (i, j)> THD (2) where THD Is a predetermined threshold value (positive value). If there is a relationship of the above equations (1) and (2), the binarized function value POD (i, j) at the point of interest is set to "1", and the point of interest is determined to be a valley (that is, a black stain is present). On the other hand, in other cases, POD (i, j) is set to "0", and this point of interest is determined to be a normal part (that is, no black stain). Therefore, this binarization means determines that there is no black stain because the above equation (2) does not hold in the normal part of FIG. 2 (a), and outputs it. In a defective part, the above equations (1) and (2) are used. Since both are satisfied, it is determined that there is black stain, and output (see FIG. 2B).

【0020】なお、ここで前方背景点の濃淡値(画素
値)を、その自らを含み、更に予め定める数だけその前
方までの画素の濃淡値(画素値)の平均に置換え、且つ
後方背景点の濃淡値(画素値)を、その自らを含み、更
に予め定める数だけその後方までの画素の濃淡値(画素
値)の平均に置換えて、上式(1),(2)の成立可否
を判断するようにすると、画素値に含まれるノイズの影
響を軽減させることが可能であり、好都合である。
Here, the gray value (pixel value) of the front background point is replaced by an average of the gray values (pixel values) of the pixels up to and including the self, and the rear background point is included. Is replaced by the average of the gray values (pixel values) of the pixels up to and including the gray value (pixel value) of the pixel including itself, and it is determined whether the above expressions (1) and (2) are satisfied. If the determination is made, it is possible to reduce the influence of noise included in the pixel value, which is convenient.

【0021】次に第1の2値化手段4及び第2の2値化
手段8の実際の動作を図3,図4を用いて説明する。図
3は欠陥を含む容器内面の画像の一例を示したものであ
る。同図において12は容器を示し、D1〜D5は欠陥
を示す。このうち、D1,D4は薄い欠陥、D2,D
3,D5は濃い欠陥とする。また13は薄い欠陥D1を
通る走査線を示し、14は濃い欠陥D2を通る走査線を
示す。
Next, the actual operation of the first binarizing means 4 and the second binarizing means 8 will be described with reference to FIGS. FIG. 3 shows an example of an image of the inner surface of the container including the defect. In the figure, reference numeral 12 indicates a container, and D1 to D5 indicate defects. Among them, D1 and D4 are thin defects, D2 and D4
3, D5 is a dark defect. Reference numeral 13 denotes a scan line passing through the light defect D1, and reference numeral 14 denotes a scan line passing through the dark defect D2.

【0022】図4はこの2つの走査線上の画像分布を示
し、同図(a)は走査線13上の濃淡値(画素値)の分
布を、また同図(b)は走査線14上の濃淡値(画素
値)の分布を夫々示す。ところで、次式(3)で定義さ
れる、画素の濃淡値の差分L(i,j)を用いるとき、
式(1),(2)の関係は以下の式(4)の関係に置き
換えることができる。
FIGS. 4A and 4B show image distributions on these two scanning lines. FIG. 4A shows the distribution of grayscale values (pixel values) on the scanning line 13, and FIG. The distribution of gray values (pixel values) is shown respectively. By the way, when using the difference L (i, j) of the gray value of a pixel defined by the following equation (3),
The relationship of Expressions (1) and (2) can be replaced by the relationship of Expression (4) below.

【0023】[0023]

【数2】 L(i,j)=min{PO(i−α,j)−PO(i,j) ,PO(i+α,j)−PO(i,j)} ・・・(3) L(i,j)>THD ・・・(4) 即ち、式(4)を満たす濃淡値PO(i,j)の画素の
み、その2値化関数値POD(i,j)が“1”とな
る。
L (i, j) = min {PO (i−α, j) −PO (i, j), PO (i + α, j) −PO (i, j)} (3) L (I, j)> THD (4) That is, only the pixel of the gray value PO (i, j) satisfying the expression (4) has the binarized function value POD (i, j) of “1”. Become.

【0024】いま、図4(a)に示すように薄い欠陥D
1における画素濃淡値の差分L(i,j)の最大値をL
1とし、また同図(b)に示すように濃い欠陥D2にお
ける画素濃淡値の差分L(i,j)の最大値をL2とす
ると、L1≦L2である。この最大値L1,L2を用い
て、下式(5),(6)が満たされるように、式(4)
のしきい値THDに相当する2値化手段4のしきい値T
HD1と、同じく2値化手段8のしきい値THD2とを
定める。
Now, as shown in FIG.
The maximum value of the difference L (i, j) of the pixel grayscale value at 1 is L
Assuming that the maximum value of the pixel density difference L (i, j) in the dark defect D2 is L2 as shown in FIG. 2B, L1 ≦ L2. Using the maximum values L1 and L2, the equation (4) is set so that the following equations (5) and (6) are satisfied.
Threshold value T of the binarizing means 4 corresponding to the threshold value THD
HD1 and a threshold value THD2 of the binarizing means 8 are determined.

【0025】[0025]

【数3】 THD1<L1 ・・・(5) L1<THD2<L2 ・・・(6) 図4(c)は走査線13上の濃淡画像を第1の2値化手
段4により、しきい値THD1で2値化した画像の分布
を、同図(e)は同じく走査線13上の濃淡画像を第2
の2値化手段8により、しきい値THD2で2値化した
画像の分布を夫々示す。 同様に同図(d)は走査線1
4上の濃淡画像を第1の2値化手段4により、しきい値
THD1で2値化した画像の分布を、同図(f)は同じ
く走査線14上の濃淡画像を第2の2値化手段8によ
り、しきい値THD2で2値化した画像の分布を夫々示
す。
## EQU00003 ## THD1 <L1 (5) L1 <THD2 <L2 (6) FIG. 4C shows the threshold value of the grayscale image on the scanning line 13 by the first binarizing means 4. FIG. FIG. 3E shows the distribution of the image binarized by the value THD1, and FIG.
The distribution of the image binarized by the threshold value THD2 by the binarizing means 8 is shown. Similarly, FIG.
4 shows the distribution of an image obtained by binarizing the grayscale image on the scanning line 14 with the threshold value THD1 by the first binarizing means 4, and FIG. The distribution of the image binarized by the thresholding means 8 by the threshold value THD2 is shown.

【0026】即ち、図4(c),(e)のように、薄い
欠陥D1は、第1の2値化手段4では2値化されるが、
第2の2値化手段8では2値化されない。他方、同図
(d),(f)のように、濃い欠陥D2は、第1の2値
化手段4でも、第2の2値化手段8でも2値化される。
以上の動作に基づき、図3に示した欠陥を含む容器内面
の画像全体を第1の2値化手段4で2値化した画像を図
5(a)に、同じく第2の2値化手段8で2値化した画
像を図6(a)に夫々示す。
That is, as shown in FIGS. 4C and 4E, the thin defect D1 is binarized by the first binarizing means 4,
The second binarizing means 8 does not binarize. On the other hand, the dark defect D2 is binarized by the first binarization unit 4 and the second binarization unit 8 as shown in FIGS.
Based on the above operation, an image obtained by binarizing the entire image of the inner surface of the container including the defect shown in FIG. 3 by the first binarizing unit 4 is shown in FIG. The images binarized in 8 are shown in FIG.

【0027】次に第1の画像分離手段5及び第2の画像
分離手段9の動作を夫々図5及び図6により説明する。
図5(b)の15は第1の画像分離手段5により、同図
(a)に示した2値化画像において、各水平走査線ごと
に2値化関数値POD(i,j)=“1”となる画素の
数を求めて得られた水平方向の投影データを示す。ここ
でP11〜P15は、夫々欠陥D1〜D5に対応した投
影データの部分である。
Next, the operation of the first image separating means 5 and the second image separating means 9 will be described with reference to FIGS. 5 and 6, respectively.
In FIG. 5B, reference numeral 15 denotes a binarized function value POD (i, j) = "" for each horizontal scanning line in the binarized image shown in FIG. The horizontal direction projection data obtained by calculating the number of pixels that become 1 ″ is shown. Here, P11 to P15 are portions of the projection data corresponding to the defects D1 to D5, respectively.

【0028】この各投影データ部分P11〜P15の夫
々の画素数の総和を第1の面積検出手段6により求め、
この各総和をS11〜S15とすると、S11〜S15
は欠陥D1〜D5をしきい値THD1で2値化したとき
の各欠陥D1〜D5部分の夫々の面積値を表す。同様に
図6(b)の16は第2の画像分離手段9により、同図
(a)に示した2値化画像において、各水平走査線ごと
に2値化関数値POD(i,j)=“1”となる画素の
数を求めて得られた水平方向の投影データを示す。ここ
でP22,P23,P25は、夫々欠陥D2,D3,D
5に対応した投影データの部分である。
The total number of pixels of each of the projection data portions P11 to P15 is obtained by the first area detecting means 6,
Assuming that the respective sums are S11 to S15, S11 to S15
Represents the area value of each of the defects D1 to D5 when the defects D1 to D5 are binarized by the threshold value THD1. Similarly, in FIG. 6B, reference numeral 16 denotes a binarized function value POD (i, j) for each horizontal scanning line in the binarized image shown in FIG. = Horizontal projection data obtained by calculating the number of pixels where "1" is obtained. Here, P22, P23, and P25 are defects D2, D3, and D, respectively.
5 is a portion of the projection data corresponding to 5.

【0029】この各投影データ部分P22,P23,P
25の夫々の画素数の総和を第2の面積検出手段10に
より求め、この各総和をS22,S23,S25とする
と、S22,S23,S25は欠陥D2,D3,D5を
しきい値THD2で2値化したときの各欠陥D2,D
3,D5部分の夫々の面積値を表す。次に第1の判定手
段7の動作を説明する。
Each of the projection data portions P22, P23, P
The sum of the number of pixels of each of the 25 pixels is obtained by the second area detecting means 10, and when the sums of the respective pixels are S22, S23, and S25, the defects D2, D3, and D5 are determined by the threshold THD2 as 2 Each defect D2 and D when digitized
3 and D5 represent the respective area values. Next, the operation of the first determination means 7 will be described.

【0030】図7は第1の判定手段7が実行する、薄い
欠陥と濃い欠陥との分離方法を示す図で、この図は図5
(b)の投影データ15と図6(b)の投影データ16
とを垂直座標を共通にして対応させたものである。第1
の判定手段7は、投影データ15において、垂直座標上
の投影値が0以外の値を持つ各区間について、投影デー
タ16における同一の水平走査線上の投影値を読み出
し、当該区間内で投影データ16のこの読み出した投影
値が0以外の値を持たなければ、その区間は薄い欠陥に
対応すると判断し、他方、当該区間内で投影データ16
のこの読み出した投影値が0以外の値を持てば、その区
間は濃い欠陥に対応すると判断する。
FIG. 7 is a diagram showing a method of separating a light defect from a dark defect, which is performed by the first determining means 7. FIG.
The projection data 15 in FIG. 6B and the projection data 16 in FIG.
Are made to correspond by using the same vertical coordinate. First
The determination means 7 reads the projection value on the same horizontal scanning line in the projection data 16 for each section in which the projection value on the vertical coordinate has a value other than 0 in the projection data 15, and reads the projection data 16 If the read projection value has no value other than 0, it is determined that the section corresponds to a thin defect.
If the read projection value has a value other than 0, it is determined that the section corresponds to a dark defect.

【0031】このようにして、第1の判定手段7は、投
影データ15の各部分P11〜P15のうち、P11,
P14は薄い欠陥に対応する部分、P12,P13,P
15は濃い欠陥に対応する部分と判断する。そして第1
の判定手段7は、薄い欠陥と判断した各投影データ部分
ごとに、第1の面積検出手段6により検出された面積値
(一般にS1kとする)を所定の判定基準値STD1と
比較し、次式(7)に該当する欠陥があれば、その容器
は不良とする。
As described above, the first determination means 7 determines P11, P11 and P11 of the respective portions P11 to P15 of the projection data 15.
P14 is a portion corresponding to a thin defect, P12, P13, P
15 is determined as a portion corresponding to a dark defect. And the first
The determination means 7 compares the area value (generally, S1k) detected by the first area detection means 6 with a predetermined determination reference value STD1 for each projection data portion determined to be a thin defect. If there is a defect corresponding to (7), the container is determined to be defective.

【0032】[0032]

【数4】 S1k>STD1 ・・・(7) 次に第2の判定手段11の動作を説明する。第2の画像
分離手段9により検出された各投影データ部分ごとに、
第2の面積検出手段10で求められた面積値(一般にS
2kとする)を所定の判定基準値STD2と比較し、次
式(8)に該当する欠陥があれば、その容器は不良とす
る。
S1k> STD1 (7) Next, the operation of the second determination unit 11 will be described. For each projection data portion detected by the second image separation means 9,
The area value obtained by the second area detecting means 10 (generally S
2k) is compared with a predetermined reference value STD2. If there is a defect corresponding to the following equation (8), the container is determined to be defective.

【0033】[0033]

【数5】 S2k>STD2 ・・・(8) なお、第1の判定手段7により、濃い欠陥と判断された
各投影データ部分ごとに、第1の面積検出手段6により
求められた面積値S1kを判定基準値STD2と比較
し、次式(9)に該当する欠陥があれば、その容器を不
良とする方法もある。
S2k> STD2 (8) Note that the area value S1k obtained by the first area detection means 6 for each projection data portion determined as a dark defect by the first determination means 7 Is compared with the criterion value STD2, and if there is a defect corresponding to the following equation (9), there is a method of making the container defective.

【0034】[0034]

【数6】 S1k>STD2 ・・・(9) ところで、第1,第2の画像分離手段5,9の上述した
画像分離方法においては、投影データを生成した際に、
共通の水平走査線が複数の欠陥領域を通過する場合、こ
の複数の欠陥が1個の欠陥と見做されてしまうことがあ
る。
S1k> STD2 (9) By the way, in the above-described image separation method of the first and second image separation means 5 and 9, when the projection data is generated,
When a common horizontal scanning line passes through a plurality of defect areas, the plurality of defects may be regarded as one defect.

【0035】このような問題を回避するには、一般的な
ラベリング処理を適用し、欠陥2値化画像を含む容器全
体の画面をラスタ走査しつつ、欠陥2値化画像の連結す
る領域を抽出してラベル付けを行う、2次元での画像分
離を行えば良い。ただし、ラベリング処理は複雑になる
ため、処理に時間が掛かって現実的でない場合もある。
このような場合には、水平方向の走査による欠陥部分の
分離だけでなく、垂直方向の走査によっても同様に欠陥
部分の分離を行い、分離された欠陥数の多い方の分離結
果を採用すれば良い。
In order to avoid such a problem, a general labeling process is applied to extract a region to which the binarized defect image is connected while raster-scanning the entire screen of the container including the binarized defect image. Then, two-dimensional image separation in which labeling is performed may be performed. However, since the labeling process becomes complicated, the process takes time and may not be realistic.
In such a case, not only the separation of the defective portion by scanning in the horizontal direction but also the separation of the defective portion by the scanning in the vertical direction in the same manner, and the separation result of the larger number of separated defects may be adopted. good.

【0036】[0036]

【発明の効果】本発明によれば、食品容器等の内面に発
生する黒点,破れ,肉薄等の暗く見える欠陥を、容器内
面の検査対象領域の多値濃淡画像内の各画素について
の、当該画素の近傍を背景とする暗さの深まり量を所定
のしきい値で2値化することによって検出することと
し、この際、暗い欠陥を別々のしきい値で検出して薄い
欠陥部分と濃い欠陥部分とを区分したのち、欠陥の面積
値に応じて夫々の良,不良を判定するようにしたので、
微細黒点等の暗さは濃いが無害な欠陥を不良とすること
なく、容器の破れ,肉薄等の暗さは薄いが致命的な欠陥
を不良とすることができる。
According to the present invention, dark-looking defects, such as black spots, tears, and thinness, that occur on the inner surface of a food container or the like are removed from the pixels in the multi-valued grayscale image of the inspection target area on the inner surface of the container. The depth of darkness in the vicinity of the pixel is detected by binarizing it with a predetermined threshold value. At this time, dark defects are detected with different threshold values, and a light defect portion and a dark defect portion are detected. After classifying the defect from the defective part, the quality of each defect is determined according to the area value of the defect.
It is possible to make a defect such as a broken container or a thin wall which is thin but a fatal defect without making a dark but harmless defect dark, such as a fine black spot.

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

【図1】本発明の一実施例としての装置の要部の構成を
示すブロック図
FIG. 1 is a block diagram showing a configuration of a main part of an apparatus as one embodiment of the present invention.

【図2】欠陥近傍の背景より暗い微小部分のみを検出す
るように工夫された、本発明に関わる2値化手段の動作
原理を説明する図
FIG. 2 is a diagram for explaining the operation principle of a binarizing unit according to the present invention, which is devised so as to detect only a minute portion darker than a background near a defect.

【図3】欠陥を含む容器内面の画像の例を示す図FIG. 3 is a diagram showing an example of an image of the inner surface of a container including a defect.

【図4】本発明に基づく走査線上の画像分布の実施例を
示す図
FIG. 4 is a diagram showing an embodiment of an image distribution on a scanning line according to the present invention.

【図5】図3の画像全体を図1の第1の2値化手段で2
値化した画像を示す図
FIG. 5 is a diagram showing an example in which the entire image of FIG. 3 is binarized by the first binarizing unit of FIG. 1;
Diagram showing a binarized image

【図6】図3の画像全体を図1の第2の2値化手段で2
値化した画像を示す図
FIG. 6 shows the entire image of FIG. 3 converted into a binary image by the second binarizing means of FIG. 1;
Diagram showing a binarized image

【図7】本発明に基づく薄い欠陥と濃い欠陥の分離方法
を示す図
FIG. 7 is a diagram showing a method for separating a thin defect and a dark defect according to the present invention.

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

1 撮像手段 1’ A/D変換手段 2 濃淡画像メモリ 3 走査手段 4 第1の2値化手段 5 第1の画像分離手段 6 第1の面積検出手段 7 第1の判定手段 8 第2の2値化手段 9 第2の画像分離手段 10 第2の面積検出手段 11 第2の判定手段 12 容器 13 薄い欠陥D1を通る走査線 14 濃い欠陥D2を通る走査線 15 第1の2値化手段で2値化した画像の投影デー
タ 16 第2の2値化手段で2値化した画像の投影デー
タ 51 正常部着目点 52 正常部前方背景点 53 正常部後方背景点 54 欠陥部着目点 55 欠陥部前方背景点 56 欠陥部後方背景点 L1 薄い欠陥D1における近傍背景との濃淡値の差
分の最大値 L2 濃い欠陥D2における近傍背景との濃淡値の差
分の最大値 α 着目点と背景点との幅の画素数 D1 薄い欠陥 D2,D3 濃い欠陥 D4 薄い欠陥 D5 濃い欠陥 P11〜P15 投影データ15の欠陥に対応する部
分 P22,P23,P25 投影データ16の欠陥に対
応する部分
DESCRIPTION OF SYMBOLS 1 Image pick-up means 1 'A / D conversion means 2 Grayscale image memory 3 Scanning means 4 First binarization means 5 First image separation means 6 First area detection means 7 First judgment means 8 Second 2 Value conversion means 9 Second image separation means 10 Second area detection means 11 Second determination means 12 Container 13 Scan line passing through thin defect D1 14 Scan line passing through dense defect D2 15 First binarization means Projection data of binarized image 16 Projection data of image binarized by the second binarization means 51 Normal part attention point 52 Normal part front background point 53 Normal part rear background point 54 Defective part attention point 55 Defective part Front background point 56 Defect portion rear background point L1 Maximum value of difference in gray value between neighboring background in thin defect D1 L2 Maximum value of difference in gray value of neighboring defect in dark defect D2 α Width between target point and background point Number of pixels D1 Thin defect 2, portions corresponding to the defects D3 dark defect D4 thin defect D5 dark defect P11~P15 projection data 15 P22, P23, P25 portions corresponding to the defects of the projection data 16

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】2次元の撮像手段を介し撮像された容器内
面の映像をラスタ走査して得られる映像信号をA/D変
換し、この変換出力から作られる容器内面の濃淡画像を
画像メモリに記憶し、この画像メモリの全体または一部
の検査領域を水平方向または垂直方向に走査して容器内
面の暗い欠陥部を検査する容器内面検査装置において、 前記検査領域の走査によって読み出される濃淡画像信号
を用い、この検査領域の濃淡画像を所定のしきい値で2
値化する2値化手段と、 この2値化手段により得られる2値化画像を互いに離れ
た白画像部分毎に分離する画像分離手段との組を、前記
しきい値を異にして複数組備え、 さらに、この各組毎に、当該組の画像分離手段によって
分離された白画像の内、前記しきい値が当該組に次いで
大きい組の白画像と空間的に重なりを持たない白画像毎
の面積値を夫々当該組に対応する所定の基準値と比較す
る手段を備えたことを特徴とする容器内面検査装置。
An A / D conversion of a video signal obtained by raster-scanning an image of an inner surface of a container taken through a two-dimensional imaging means, and a grayscale image of the inner surface of the container formed from the converted output is stored in an image memory. A container inner surface inspection apparatus for storing and inspecting a whole or a part of an inspection area of the image memory in a horizontal direction or a vertical direction to inspect a dark defect portion on an inner surface of the container. A grayscale image signal read by scanning the inspection area. Is used to convert the grayscale image of this inspection area to a predetermined threshold value.
A plurality of sets of binarizing means for binarizing, and image separating means for separating a binarized image obtained by the binarizing means for each white image part separated from each other, with a different threshold value. Furthermore, for each of the sets, of the white images separated by the image separating means of the set, for each white image not having a spatial overlap with the set of white images having the next largest threshold value after the set. A means for comparing each area value of the container with a predetermined reference value corresponding to the set.
【請求項2】請求項1に記載の容器内面検査装置におい
て、 前記2値化手段が、前記検査領域の走査によって読み出
される濃淡画像信号上の各画素についての、当該画素の
所定の近傍を背景とする暗さの深まり量を前記しきい値
で2値化するものであることを特徴とする容器内面検査
装置。
2. The container inner surface inspection apparatus according to claim 1, wherein the binarizing means sets a predetermined neighborhood of each pixel on the grayscale image signal read by scanning the inspection area as a background. Wherein the depth of darkness is binarized by the threshold value.
【請求項3】請求項2に記載の容器内面検査装置におい
て、 前記2値化手段が、当該走査線上において着目画素の前
後に着目画素から所定の幅だけ離れた各背景画素の値か
ら夫々、着目画素の値を減じた2つの差分の画素値を前
記暗さの深まり量とし、この2つの差分の画素値が共に
前記しきい値より大きいか否かに応じて、着目画素の値
を夫々“1”,“0”に2値化するものであることを特
徴とする容器内面検査装置。
3. The container inner surface inspection apparatus according to claim 2, wherein the binarizing unit is configured to determine a value of each background pixel that is separated from the pixel of interest by a predetermined width before and after the pixel of interest on the scanning line. The pixel value of the two differences obtained by subtracting the value of the pixel of interest is defined as the depth of darkness, and the values of the pixel of interest are respectively determined according to whether or not both the pixel values of the two differences are greater than the threshold value. A container inner surface inspection apparatus, which is binarized into "1" and "0".
【請求項4】請求項3に記載の容器内面検査装置におい
て、 前記背景画素の値に代えて、当該走査線上におけるこの
背景画素を含む一連の所定個数分の画素の画素値の平均
値を用いるようにしたことを特徴とする容器内面検査装
置。
4. The container inner surface inspection apparatus according to claim 3, wherein an average value of pixel values of a series of a predetermined number of pixels including the background pixel on the scan line is used instead of the value of the background pixel. A container inner surface inspection device, characterized in that:
【請求項5】請求項1ないし4のいずれかに記載の容器
内面検査装置において、 前記画像分離手段が、前記2値化手段から得られる2値
化信号の“1”の画素数を投影データとして走査線ごと
に検出し、走査線毎の1以上の前記投影データが走査線
間で連続して並ぶ投影データの部分が前記白画像の1つ
に対応するものと見做すことを特徴とする容器内面検査
装置。
5. The container inner surface inspection apparatus according to claim 1, wherein said image separation means determines the number of pixels of “1” of a binary signal obtained from said binary means as projection data. Detecting for each scanning line, and assuming that a portion of the projection data in which one or more of the projection data for each scanning line is continuously arranged between the scanning lines corresponds to one of the white images. Container inner surface inspection device.
JP5168398A 1998-03-04 1998-03-04 Device for inspecting inner face of container Pending JPH11248646A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5168398A JPH11248646A (en) 1998-03-04 1998-03-04 Device for inspecting inner face of container

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5168398A JPH11248646A (en) 1998-03-04 1998-03-04 Device for inspecting inner face of container

Publications (1)

Publication Number Publication Date
JPH11248646A true JPH11248646A (en) 1999-09-17

Family

ID=12893698

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5168398A Pending JPH11248646A (en) 1998-03-04 1998-03-04 Device for inspecting inner face of container

Country Status (1)

Country Link
JP (1) JPH11248646A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115254674A (en) * 2022-09-28 2022-11-01 南通思诺船舶科技有限公司 Bearing defect sorting method
CN115953776A (en) * 2023-03-09 2023-04-11 聊城市检验检测中心 Food detection system based on machine learning

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115254674A (en) * 2022-09-28 2022-11-01 南通思诺船舶科技有限公司 Bearing defect sorting method
CN115953776A (en) * 2023-03-09 2023-04-11 聊城市检验检测中心 Food detection system based on machine learning

Similar Documents

Publication Publication Date Title
US4492476A (en) Defect detecting method and apparatus
JPH11132959A (en) Method and device for inspecting defect
JP3357001B2 (en) Pattern inspection apparatus and pattern inspection method for semiconductor integrated device
JP4104213B2 (en) Defect detection method
JP4743231B2 (en) Appearance inspection method and appearance inspection apparatus
JP3788586B2 (en) Pattern inspection apparatus and method
JPH11248646A (en) Device for inspecting inner face of container
JP4743230B2 (en) Appearance inspection method and appearance inspection apparatus
JP5136277B2 (en) Defect detection method for netted or lined glass
JPH05126750A (en) Apparatus for inspecting inner surface of circular
US6335982B1 (en) Method and apparatus for inspecting streak
JP4178923B2 (en) Appearance inspection method and appearance inspection apparatus
JP3055322B2 (en) Circular container inner surface inspection device
JP2988059B2 (en) Circular container inner surface inspection device
JP3055323B2 (en) Circular container inner surface inspection device
JPH09161056A (en) Inspecting method for inner surface of circular container
JP2021064215A (en) Surface property inspection device and surface property inspection method
JPH06160289A (en) Inner face inspection equipment for circular vessel
JP2737418B2 (en) Pass / fail inspection device
JPH1166305A (en) Binarizing device
JPH06235702A (en) Inner face inspection system for circular container
JPH0319990B2 (en)
JP2634064B2 (en) Binarization device
JPH0572141A (en) Circular container inside surface inspecting device
JPH09281056A (en) Surface inspection apparatus