JP2008232814A - Device for inspecting x-ray foreign matter - Google Patents

Device for inspecting x-ray foreign matter Download PDF

Info

Publication number
JP2008232814A
JP2008232814A JP2007072567A JP2007072567A JP2008232814A JP 2008232814 A JP2008232814 A JP 2008232814A JP 2007072567 A JP2007072567 A JP 2007072567A JP 2007072567 A JP2007072567 A JP 2007072567A JP 2008232814 A JP2008232814 A JP 2008232814A
Authority
JP
Japan
Prior art keywords
sub
pixel
content
area
contents
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
JP2007072567A
Other languages
Japanese (ja)
Inventor
Toshimichi Masaki
俊道 政木
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.)
Shimadzu Corp
Original Assignee
Shimadzu Corp
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 Shimadzu Corp filed Critical Shimadzu Corp
Priority to JP2007072567A priority Critical patent/JP2008232814A/en
Publication of JP2008232814A publication Critical patent/JP2008232814A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide a device for inspecting X-ray foreign matter capable of detecting foreign matter in an inspection target, without determining appended product as a foreign matter, regardless of the position of the appended product in the inspection target. <P>SOLUTION: In the device for inspecting X-ray foreign matter, body region searching operation is performed so as to determine whether the pixels P of an X-ray perspective image are pixels which constitute the body region of sub-content, on the basis of the relation between the gradation data of all of the pixels in the first searching unit which surrounds a single pixel P of the X-ray perspective image and a content level threshold (th), magnified sub-content region searching operation is successively performed to form the magnified sub-content region extracted image B3(x, y) of a magnified sub-content region and the gradation data of the respective pixels of the X-ray perspective image img (x, y), corresponding to a region, other than the magnified sub-content region of the magnified sub-content region extracted image B3 (x, y), is determined on the basis of a first foreign matter determining level so as to determine the presence of foreign matters. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、被検査物のX線透視画像を撮影して被検査物中の異物の有無を検査するX線異物検査装置に関し、さらに詳細には、異物検査を行いたい主内容物と、異物検査の障害となる副内容物(添付品等)とが含まれる被検査物についての異物検査を行うX線異物検査装置に関する。
具体的には、菓子、加工食品、医薬のような内容物(主内容物)に、脱酸素剤、粉末スープ、おまけ玩具等の添付品(副内容物)が含まれている被検査物、あるいは、生肉、魚の切り身(主内容物)の一部に、骨(副内容物)が混在する被検査物、あるいは、衣服や袋類(主内容物)に、ボタンやファスナー(副内容物)が固定された被検査物などについてのX線異物検査装置に関する。
The present invention relates to an X-ray foreign substance inspection apparatus for taking an X-ray fluoroscopic image of an inspection object and inspecting the presence or absence of a foreign substance in the inspection object. The present invention relates to an X-ray foreign matter inspection apparatus that performs foreign matter inspection on an object to be inspected that includes sub-contents (attachments, etc.) that are obstacles to inspection.
Specifically, inspected items that contain accessories (sub-contents) such as oxygen scavengers, powdered soups, extra toys, etc. in contents (main contents) such as confectionery, processed foods, and medicines, Or, inspected objects in which bone (sub-contents) is mixed in part of raw meat or fish fillet (main contents), or buttons or fasteners (sub-contents) on clothes or bags (main contents) The present invention relates to an X-ray foreign matter inspection apparatus for an object to be inspected and the like.

従来より、例えば、生肉、魚、加工食品、医薬等の被検査物中(表面も含む)の異物(金属、骨、ガラス、石、合成樹脂材等)を検出するためにX線異物検査装置が用いられている(例えば、特許文献1参照)。図16は、X線異物検査装置の一部の構成を示す図である。このようなX線異物検査装置110においては、ベルトコンベア5の上方に配置されたX線管1でX線を発生させ、そのX線を、コリメータ(図示せず)を用いて扇状に広がるX線ビームとし、そのX線ビームを、上側搬送ベルト5bの下方に配置された多数のX線検出素子からなる直線状のX線検出器3で検出する。   Conventionally, for example, an X-ray foreign substance inspection apparatus for detecting foreign matter (metal, bone, glass, stone, synthetic resin material, etc.) in an inspected object (including the surface) such as raw meat, fish, processed food, medicine, etc. Is used (see, for example, Patent Document 1). FIG. 16 is a diagram showing a partial configuration of the X-ray foreign substance inspection apparatus. In such an X-ray foreign matter inspection apparatus 110, X-rays are generated by the X-ray tube 1 disposed above the belt conveyor 5, and the X-rays are spread in a fan shape using a collimator (not shown). The X-ray beam is detected by a linear X-ray detector 3 including a large number of X-ray detection elements disposed below the upper conveyor belt 5b.

ベルトコンベア5は、ローラ5aの間に掛け回された搬送ベルト5bを有する。そして、上側搬送ベルト5bの上面に、被検査物7が載置される。モータ等の駆動手段(図示せず)によってローラ5aを駆動することにより、搬送ベルト5bが循環して移動し、被検査物7が移動することになる。
コリメータは、被検査物7の移動方向と直交するように、扇状に広がるX線ビームを形成する。X線検出器3は、扇状に広がるX線ビームを検出できるように、被検査物7の移動方向と直交するように配置されている。
The belt conveyor 5 has a conveyor belt 5b wound between rollers 5a. Then, the inspection object 7 is placed on the upper surface of the upper conveyance belt 5b. By driving the roller 5a by a driving means (not shown) such as a motor, the conveyor belt 5b circulates and moves, and the inspection object 7 moves.
The collimator forms an X-ray beam that spreads in a fan shape so as to be orthogonal to the moving direction of the inspection object 7. The X-ray detector 3 is arranged so as to be orthogonal to the moving direction of the inspection object 7 so that the X-ray beam spreading in a fan shape can be detected.

これにより、X線異物検査装置110では、移動してくる被検査物7にX線を照射し、コンピュータ109で被検査物7のX線透過像データを作成して、そのX線透過像データを収集して時間軸に沿って並べると、2次元的なX線透視画像を得ることができる。このとき、被検査物7中に異物が存在し、その異物の透過X線量が被検査物7自体の透過X線量と異なれば、X線透視画像上に異物が陰として表れることになる。したがって、操作者が、モニタ画面に映し出されたX線透視画像を観察することで、被検査物7中の異物を発見することができるようにしている。   As a result, the X-ray foreign substance inspection apparatus 110 irradiates the moving inspection object 7 with X-rays, creates X-ray transmission image data of the inspection object 7 with the computer 109, and transmits the X-ray transmission image data. Are collected and arranged along the time axis, a two-dimensional X-ray fluoroscopic image can be obtained. At this time, if a foreign object exists in the inspection object 7 and the transmitted X-ray dose of the foreign object is different from the transmitted X-ray amount of the inspection object 7 itself, the foreign object appears as a shadow on the X-ray fluoroscopic image. Therefore, the operator can find a foreign object in the inspection object 7 by observing the X-ray fluoroscopic image displayed on the monitor screen.

このようなX線異物検査装置で、生肉、魚、加工食品等の内容物と、内容物の収容状態を保持するためのクリップ(例えばソーセージの両端を密封するために留められる金属クリップ)とからなる被検査体中の異物の有無を判定する場合に、クリップがあると想定される所定の位置にマスク領域を予め設定し、検査対象からマスク領域を除外することにより、クリップを異物と判定することを防止するものが知られている(例えば、特許文献2参照)。   With such an X-ray foreign substance inspection apparatus, from contents such as raw meat, fish, processed food, etc., and clips for holding the contents contained (for example, metal clips that are fastened to seal both ends of the sausage) When determining whether or not there is a foreign object in the object to be inspected, a clip area is determined in advance by setting a mask area at a predetermined position where a clip is assumed to be present, and excluding the mask area from the inspection target. What prevents this is known (see, for example, Patent Document 2).

しかしながら、X線異物検査装置において、内容物と、内容物と一緒に包装された脱酸素剤、粉末スープ、玩具(おまけ)等の添付品とからなる被検査体7中の異物の有無を判定する場合、添付品が内容物上の何れの位置に存在するか不明であるときには、X線透視画像中にマスク領域を設定することができず、添付品を異物と判定しないようにすることができないという問題点があった。   However, in the X-ray foreign matter inspection apparatus, the presence or absence of foreign matter in the inspected body 7 consisting of the contents and accessories such as oxygen scavenger, powder soup and toys (bonus) packaged together with the contents is determined. In this case, when it is unclear at which position on the contents the attachment is present, the mask area cannot be set in the X-ray fluoroscopic image, and the attachment may not be determined as a foreign object. There was a problem that it was not possible.

これを解決するために、透過X線量に基づいて生成されたX線画像のうち被検査体中の添付品に対応する添付品領域、及び、添付品外領域を分割するための分割閾値を設定し、X線画像の画素の濃度及び分割閾値に基づいて添付品領域及び添付品外領域を分割し、分割した添付品外領域のX線画像に対してX線画層の画素の濃度および所定の閾値に基づいて異物の有無を判断することが開示されている。さらに添付品領域に対しても、他の閾値に基づいて異物の有無を判断することが開示されている(特許文献3参照)。
特開2006−275853号公報 特開2002−243665号公報 特開2006−308315号公報
In order to solve this, a division threshold value is set for dividing an attachment region corresponding to an attachment in the object to be inspected and an outside region of the attachment in the X-ray image generated based on the transmitted X-ray dose. Then, the accessory region and the non-attachment region are divided based on the pixel density of the X-ray image and the division threshold, and the pixel density of the X-ray image layer and a predetermined value are divided with respect to the X-ray image of the divided non-attachment region. It is disclosed that the presence or absence of a foreign object is determined based on a threshold value. Furthermore, it is disclosed that the presence / absence of a foreign object is determined based on another threshold value for an accessory region (see Patent Document 3).
JP 2006-275853 A JP 2002-243665 A JP 2006-308315 A

上述した特許文献3の異物検査装置によれば、異物の有無を検査する際に障害となる添付品の位置に拘わらず、添付品の位置をマスク領域として除外しつつ検査を行うことができるので、添付品が異物として検出される誤検出を低減することができる。また、添付品領域についても、分割閾値の設定を調整することにより、添付品と重なって存在する異物を検出することができるようになる。   According to the foreign substance inspection apparatus of Patent Document 3 described above, the inspection can be performed while excluding the position of the accessory as a mask region regardless of the position of the accessory that becomes an obstacle when inspecting the presence or absence of the foreign substance. In addition, it is possible to reduce erroneous detection in which an accessory is detected as a foreign object. Also, with respect to the accessory area, it is possible to detect foreign matter that overlaps with the accessory by adjusting the setting of the division threshold.

しかしながら、この特許文献に記載された方法では、予め設定してあるレベル(分割閾値)を基準にして、各画素の濃度(すなわち階調データ)との比較を行うことにより、添付品領域であるか添付品外領域であるかを判定するようにしているため、X線透視画像に画素単位程度の小さな何らかのノイズ画像が映っていると、ノイズ画像部分を添付品領域と誤って判定することがあり、誤った検出結果を生じるおそれがあった。例えば、添付品によっては添付品の周縁に突起部分を有するものがあり、その突起部分を添付品の一部としてではなく、異物と判定する誤検出を生じることがあった。   However, in the method described in this patent document, it is an accessory region by comparing with the density (that is, gradation data) of each pixel on the basis of a preset level (division threshold). Or if it is a region outside the attachment, if some noise image of about a pixel unit appears in the X-ray fluoroscopic image, the noise image portion may be erroneously determined as the attachment region. There was a possibility of producing an erroneous detection result. For example, some attachments have protrusions on the periphery of the attachment, and erroneous detection that determines that the protrusion is not a part of the attachment but a foreign object may occur.

このことは、内容物と添付品との関係だけではなく、生肉と骨の関係のように、検査を行いたい領域(主内容物)と検査の障害となる領域(副内容物)とが、いずれも内容物として混在する被検査物の場合でも同様である。   This is not only the relationship between contents and attachments, but the relationship between the area you want to inspect (main contents) and the area that obstructs the inspection (sub-contents), such as the relationship between raw meat and bones. The same applies to the case of inspected objects mixed as contents.

そこで、本発明は主内容物と副内容物(以後、主内容物と副内容物という場合には、内容物と添付品との関係も含まれるものとする(この場合、内容物を主内容物、添付品を副内容物として扱う))とが含まれる被検査物について、階調レベル(分割閾値)のみを基準とするだけではなく、他の基準も合わせて判定基準とすることにより、ノイズの影響を除去しつつ異物検査を行うことができるようにしたX線異物検査装置を提供することを目的とする。   Therefore, the present invention includes main contents and sub-contents (hereinafter, the main contents and sub-contents include the relationship between the contents and attachments (in this case, the contents are the main contents). In addition to using only the gradation level (division threshold) as a reference, the other criteria are also used as the determination criteria. An object of the present invention is to provide an X-ray foreign substance inspection apparatus which can perform foreign substance inspection while removing the influence of noise.

また、本発明は検査の障害となる副内容物領域をマスク領域として除外する際に、実際に副内容物が映し出される領域のまわりに、その周辺領域も含めて拡大した領域をマスク領域とすることで、副内容物の周囲に不規則に生じる突起等の異常部分を異物と誤って検出するエラーを除くことを目的とする。   Further, in the present invention, when a sub-content area that becomes an obstacle to inspection is excluded as a mask area, a mask area is an area that is enlarged around the area where the sub-content is actually displayed, including the peripheral area. Thus, an object is to eliminate an error that erroneously detects an abnormal portion such as a protrusion irregularly generated around the subsidiary contents as a foreign object.

上記課題を解決するためになされた本発明のX線異物検査装置では、主内容物に対する異物検査の障害となる副内容物領域を、主内容物の領域から分離し、従来と同様のマスク領域を設けるための境界を求める演算を行うのであるが、その演算において、副内容物領域を抽出する際に、副内容物領域(さらには異物領域についても同様)は、ある程度の面積からなる同じX線レベルの階調データを有する領域の拡がり(画素の集合)が存在することを利用して、単に個々の画素の階調データの閾値のみで境界を判定するのではなく、隣接する画素の階調データも境界の判定に利用することにより、ノイズの影響を除去しつつ境界を判定するようにしている。さらに、実際の副内容物領域の周辺領域も含めた拡大副内容物領域をマスク領域にするための演算を追加するようにして、境界を定めるようにしている。   In the X-ray foreign matter inspection apparatus of the present invention made to solve the above-mentioned problems, a sub-content region that becomes an obstacle to the foreign matter inspection for the main content is separated from the main content region, and a mask region similar to the conventional one is obtained. In the calculation, when the sub-content area is extracted, the sub-content area (and the same for the foreign substance area) is the same X having a certain area. Taking advantage of the presence of an extension (a set of pixels) of a region having line-level gradation data, the boundary is not determined based on only the threshold value of the gradation data of each pixel, but the level of adjacent pixels is determined. The key data is also used for determining the boundary, so that the boundary is determined while removing the influence of noise. Further, a boundary is defined by adding an operation for making the enlarged sub-content area including the peripheral area of the actual sub-content area a mask area.

すなわち、本発明のX線異物検査装置は、主内容物と副内容物とが含まれる被検査物を映した二次元のX線透視画像img(x,y)を取得し、このX線透視画像を形成する各画素の階調データに対して演算処理を行うことにより被検査物中の主内容物および副内容物以外の異物の有無を検査するX線異物検査装置であって、主内容物の透過X線量に対応する階調レベルと副内容物の透過X線量に対応する階調レベルとを分割するための階調レベル値を、内容物レベル閾値(th)として設定する内容物レベル閾値設定部と、画素の二次元形状の集合からなる第一塊領域を、X線透視画像に映る副内容物領域のうち本体領域を抽出するための演算に用いる第一探索ユニット(S1)として設定する第一探索ユニット設定部と、X線透視画像の一の画素P(x,y)に対し、前記画素Pを取り囲むように第一探索ユニットを設定し、画素Pを含む第一探索ユニット内の全画素の階調データと内容物レベル閾値との関係に基づいて前記画素Pが副内容物の本体領域を構成する画素か否かを判定する本体領域探索演算を行い、X線透視画像の全画素について前記本体領域探索演算を行うことにより、副内容物の本体領域を抽出した副内容物本体領域抽出画像B2(x,y)を作成する副内容物本体領域袖出部と、画素の二次元形状の集合であって前記第一塊領域より大きな第二塊領域を、副内容物本体領域抽出画像B2(x、y)に映る副内容物の本体領域の周辺領域も含めた拡大副内容物領域を抽出するための演算に用いる第二探索ユニット(S2)として設定する第二探索ユニット領域設定部と、副内容物本体領域抽出画像B2(x,y)の一の画素Q(x,y)に対し、前記画素Qを取り囲むように第二探索ユニットを設定し、画素Qを含む第二探索ユニット内の全画素の階調データと副内容物本体領域抽出画像B2(x、y)に映る副内容物の本体領域の階調データとの比較結果に基づいて前記画素Qが拡大副内容物領域を構成する画素か否かを判定する拡大副内容物領域探索演算を行い、副内容物本体領域抽出画像B2(x,y)の全画素について前記拡大副内容物領域探索演算を行うことにより、拡大副内容物領域を抽出した拡大副内容物領域抽出画像B3(x,y)を作成する拡大副内容物領域袖出部と、拡大副内容物領域以外の領域の異物判定に用いる階調レベル値を第一異物判定レベル値(th1)として設定する第一異物判定レベル値設定部と、拡大副内容物領域抽出画像B3(x,y)の拡大副内容物領域以外の領域に対応するX線透視画像img(x,y)の各画素を第一検査範囲として、第一検査範囲に含まれる各画素の階調データを第一異物判定レベル値に基づいて判定することにより異物の有無を判定する拡大副内容物領域外異物検査部とを備えるようにしている。   That is, the X-ray foreign substance inspection apparatus according to the present invention acquires a two-dimensional X-ray fluoroscopic image img (x, y) showing an inspection object including main contents and sub-contents, and performs this X-ray fluoroscopy. An X-ray foreign matter inspection apparatus for inspecting the presence or absence of foreign matter other than main contents and sub-contents in an inspection object by performing arithmetic processing on gradation data of each pixel forming an image. Content level for setting a gradation level value for dividing the gradation level corresponding to the transmitted X-ray dose of the object and the gradation level corresponding to the transmitted X-ray dose of the sub-contents as the content level threshold (th) As a first search unit (S1) used for calculation for extracting a main body region from a sub-content region shown in an X-ray fluoroscopic image, a threshold setting unit and a first mass region formed of a set of two-dimensional shapes of pixels A first search unit setting unit to be set, and an X-ray fluoroscopic image The first search unit is set so as to surround the pixel P with respect to the pixel P (x, y), and the relationship between the gradation data of all the pixels in the first search unit including the pixel P and the content level threshold value Based on the sub-contents, a main body region search calculation is performed to determine whether or not the pixel P is a pixel constituting the main body region of the sub-contents, and the main body region search calculation is performed for all the pixels of the fluoroscopic image. A sub-contents body region extraction image B2 (x, y) for extracting a sub-contents body region extraction image B2 (x, y), and a two-dimensional shape set of pixels, which is larger than the first lump region The second search unit used for the calculation for extracting the expanded sub-content area including the peripheral area of the main content area of the sub-contents shown in the sub-content main area extraction image B2 (x, y). Second search unit area set as (S2) A second search unit is set so as to surround the pixel Q with respect to one pixel Q (x, y) of the setting unit and the sub-contents body region extraction image B2 (x, y). Based on the comparison result between the gradation data of all the pixels in the second search unit and the gradation data of the sub-contents main body area shown in the sub-contents main body area extraction image B2 (x, y), the pixel Q is expanded An enlarged sub-content area search operation for determining whether or not the pixel is a content area is performed, and the expanded sub-content area search operation is performed for all the pixels of the sub-content body area extracted image B2 (x, y). Thus, the enlarged sub-content area extraction image B3 (x, y) obtained by extracting the enlarged sub-content area is used for the foreign substance determination of the enlarged sub-content area crest and the area other than the enlarged sub-content area. Set the gradation level value as the first foreign substance determination level value (th1) Each pixel of the X-ray fluoroscopic image img (x, y) corresponding to a region other than the enlarged sub-contents region of the first sub-contents region extraction image B3 (x, y). As the first inspection range, an enlarged sub-contents area foreign matter inspection unit that determines the presence or absence of foreign matter by determining gradation data of each pixel included in the first inspection range based on the first foreign matter determination level value I have to prepare.

ここで、「階調データ」とは、画像中の各画素の明暗の濃度を表すデータをいう。典型的な階調データとしては、明暗の濃度を256段階に分けた256階調データが一般的であるが、ここでいう「階調データ」は、画像の濃度差を表現することができるデータであればこれに限定されない。例えば画素の濃度をカラー表示したものも、階調データとして扱う。   Here, “gradation data” refers to data representing the light and dark density of each pixel in the image. Typical gradation data is generally 256 gradation data in which light and dark densities are divided into 256 levels. The “gradation data” referred to here is data that can express an image density difference. If it is, it will not be limited to this. For example, a color display of pixel density is also handled as gradation data.

また、内容物レベル閾値(th)は、主内容物のみの領域を透過するX線量と、主内容物とそれ以外(副内容物および異物)とが重なる領域を透過するX線量とを分割するための基準として用いられる閾値であり、主内容物を透過する透過X線量に対応する階調レベルより小さな階調レベル(主内容物領域より暗い階調)であることが要求されるが、主内容物とそれ以外(副内容物および異物)との重なり領域を透過するX線量に対応する階調レベルよりは大きな階調レベル(重なり領域より明るい階調)であることが必要となる。   In addition, the content level threshold (th) divides the X-ray dose that passes through the region of the main content only and the X-ray dose that passes through the region where the main content and the other (sub-contents and foreign matter) overlap. Is a threshold value used as a reference for this purpose, and is required to be a gradation level smaller than the gradation level corresponding to the transmitted X-ray dose that passes through the main contents (a gradation that is darker than the main contents region). It is necessary that the gradation level is higher than the gradation level corresponding to the X-ray dose transmitted through the overlapping region between the contents and the other (sub-contents and foreign matter) (brighter gradation than the overlapping region).

また、第一探索ユニット(S1)は、X線透視画像に映る副内容物領域のうち本体領域を抽出するための演算において、画像に含まれる小さなノイズ(例えば不規則に発生する副内容物の突起部、異物)の影響を除外するために用いる演算範囲であり、画素の二次元形状の集合からなる。この二次元形状は、方形の画素集合や円形の画素集合にするのが好ましいが、それ以外の二次元形状の画素集合でもよい。なお第一探索ユニット(S1)を方形形状(正方形または長方形)にすれば、演算範囲に含まれる各画素を、xy座標を用いて簡単に表現できるようになる。例えば、第一探索ユニット(S1)を正方形にする場合にはxy方向にそれぞれN個ずつ並んだ集合からなるN×N個(例えばx方向×y方向:10個×10個)の画素集合を第一探索ユニット(S1)として簡単に設定することができる。また、第一探索ユニット(S1)を円形形状にする場合は、演算範囲に含まれる画素を、xy座標を用いて演算する点では複雑になるが、二次元の画像上で全方向に対し均等な演算範囲を設定することができることになる。   In addition, the first search unit (S1) performs a small noise included in the image (for example, irregularly generated sub-contents) in the operation for extracting the main body area from the sub-content areas shown in the fluoroscopic image. This is a calculation range used for excluding the influence of projections and foreign matter), and consists of a set of two-dimensional shapes of pixels. The two-dimensional shape is preferably a rectangular pixel set or a circular pixel set, but other two-dimensional pixel sets may be used. If the first search unit (S1) has a square shape (square or rectangular), each pixel included in the calculation range can be easily expressed using xy coordinates. For example, in the case where the first search unit (S1) is square, N × N pixel sets (for example, x direction × y direction: 10 × 10 pixels) composed of a set of N pixels in the xy direction are arranged. It can be easily set as the first search unit (S1). In addition, when the first search unit (S1) is formed in a circular shape, the pixels included in the calculation range are complicated in that they are calculated using the xy coordinates, but are equal in all directions on the two-dimensional image. It is possible to set a simple calculation range.

また、第二探索ユニット(S2)は、拡大副内容物領域を抽出するための演算において、副内容物の本体領域の周辺領域も含めるようにして副内容物を完全にマスクするための演算に用いる演算範囲であり、画素の二次元形状の集合からなるが、この二次元形状についても、第一探索ユニットと同様に、方形の画素集合であってもよいし、その他の形状の画素集合であってもよい。なお、本体領域よりも大きくなるように拡大するため、第一塊領域より大きな領域を、第二探索ユニット(S2)として設定する(例えば、第一探索ユニットがx方向×y方向:10個×10個の画素集合である場合に、第二探索ユニットがx方向×y方向:16×16個の画素集合に設定する)。さらにX方向に並ぶ画素数とy方向に並ぶ画素数とを個別に設定できるようにし拡大量を縦横で異なるようにしてもよい。   Further, the second search unit (S2) performs an operation for completely masking the sub-contents so as to include the peripheral region of the main content region of the sub-contents in the operation for extracting the expanded sub-contents region. The calculation range to be used is composed of a set of two-dimensional shapes of pixels, but this two-dimensional shape may also be a square pixel set as in the first search unit, or a pixel set of other shapes. There may be. In addition, in order to expand so that it may become larger than a main body area | region, an area | region larger than a 1st block area | region is set as a 2nd search unit (S2) (for example, a 1st search unit is x direction xy direction: 10 piece x In the case of 10 pixel sets, the second search unit sets x direction × y direction: 16 × 16 pixel sets). Further, the number of pixels arranged in the X direction and the number of pixels arranged in the y direction can be set individually, and the enlargement amount may be different vertically and horizontally.

本発明の異物検査装置によれば、主内容物と副内容物とが含まれる被検査物を映した二次元のX線透視画像img(x,y)を取得する。
そして、副内容物本体領域袖出部が、X線透視画像の各画素P(x、y)に対し、一画素ずつ、その画素が副内容物の本体領域を構成する画素であるかを判定する「本体領域探索演算」を行う。この「副内容物の本体領域」は、簡単に言えば、画像に映る副内容物領域のうちで外周部分を除いた中心寄りの部分のみを抽出した領域であり、具体的には、副内容物本体領域抽出部が利用する判定式に基づいて抽出される領域である。
すなわち、X線透視画像の一の画素P(x,y)に対し、画素P(x,y)を取り囲むように第一探索ユニット(S1)を演算範囲として設定し、画素P(x,y)を含む第一探索ユニット(S1)内の全画素の階調データと内容物レベル閾値との関係に基づいて画素P(x,y)が副内容物の本体領域を構成する画素か否かを判定する本体領域探索演算を行う。
この演算は、画素P(x,y)および画素P(x,y)を取り囲む第一探索ユニット(S1)内の各画素の階調データを対象とし、直接的に、あるいは後述する二値化関数を用いて間接的に、各画素の階調データと内容物レベル閾値(th)との比較が行われ、画素P(x、y)が副内容物の本体領域を構成する画素であるか否かを判定する。
According to the foreign matter inspection apparatus of the present invention, a two-dimensional X-ray fluoroscopic image img (x, y) showing an inspection object including main contents and sub contents is acquired.
Then, for each pixel P (x, y) of the X-ray fluoroscopic image, the sub-content main body region crest portion determines whether the pixel is a pixel constituting the sub-content main region. The “main body area search calculation” is performed. In short, this “sub-content body area” is an area in which only the portion near the center excluding the outer peripheral portion is extracted from the sub-content area shown in the image. It is an area extracted based on a determination formula used by the object body area extraction unit.
That is, the first search unit (S1) is set as the calculation range so as to surround the pixel P (x, y) for one pixel P (x, y) of the X-ray fluoroscopic image, and the pixel P (x, y) ), Whether or not the pixel P (x, y) is a pixel constituting the main content area of the sub-content based on the relationship between the gradation data of all the pixels in the first search unit (S1) including A body region search calculation is performed to determine
This calculation is applied to the gradation data of each pixel in the first search unit (S1) surrounding the pixel P (x, y) and the pixel P (x, y), and is binarized directly or described later. Whether the pixel P (x, y) is a pixel constituting the main body region of the sub-contents by comparing the gradation data of each pixel and the content level threshold value (th) indirectly using a function Determine whether or not.

例えば、図15(a)に示すように、X線透視画像img(x,y)上の画素P(x,y)を中心とする円形の画素集合を第一探索ユニット(S1)とし、第一探索ユニット(S1)内の各画素ごとに、直接、その階調データと内容別レベル閾値(th)との比較を行い、第一探索ユニット(S1)内の全画素(あるいは一定基準以上の画素数)が内容物レベル閾値(th)より小さい階調データ(主内容物領域より暗い)であるときに画素P(x,y)は副内容物の本体領域を構成する画素であると判定する。(後述するように、予め、内容物レベル閾値(th)に基づいて二値化した画像B1を作成し、二値化画像B1を利用して判定を行うようにしてもよい。)   For example, as shown in FIG. 15A, a circular pixel set centered on a pixel P (x, y) on the fluoroscopic image img (x, y) is defined as the first search unit (S1). For each pixel in one search unit (S1), the gradation data is directly compared with the level threshold (th) for each content, and all the pixels in the first search unit (S1) (or more than a certain standard) are compared. The pixel P (x, y) is determined to be a pixel constituting the main body region of the sub-contents when the number of pixels) is gradation data (darker than the main content region) smaller than the content level threshold (th). To do. (As will be described later, a binarized image B1 may be created in advance based on the content level threshold (th), and the determination may be performed using the binarized image B1.)

そして、一の画素P(x、y)に対して行った本体領域探索演算を、X線透視画像img(x,y)の全画素にわたって行うことにより、図15(b)に示すように、X線透視画像img(x,y)上で内容物レベル閾値(th)未満の階調データを有する領域U(すなわち副内容物領域)が存在するときに、その周辺を除いた中央部分を、副内容物本体領域Vとして抽出した副内容物本体領域抽出画像B2(x,y)を作成する。これにより、副内容物本体領域抽出画像B2(x,y)上には、第一探索ユニット(S1)よりも小さなノイズ画像部分(異物部分や副内容物の突起部分を含む)は完全に消去されることとなり、実質的に副内容物領域Uの中心部分だけが抽出されるようになる。作成された副内容物本体領域抽出画像B2(x,y)は、副内容物本体領域Vの領域が「1」で、それ以外の領域が「0」になるように二値化しておく。   Then, by performing the body region search calculation performed on one pixel P (x, y) over all the pixels of the X-ray fluoroscopic image img (x, y), as shown in FIG. When there is a region U (that is, a sub-content region) having gradation data less than the content level threshold (th) on the fluoroscopic image img (x, y), A sub-content body area extracted image B2 (x, y) extracted as the sub-content body area V is created. As a result, a noise image portion (including a foreign matter portion and a protruding portion of the subsidiary content) smaller than the first search unit (S1) is completely erased on the subsidiary content body region extraction image B2 (x, y). As a result, only the central portion of the sub-content region U is extracted. The created sub-content body area extraction image B2 (x, y) is binarized so that the sub-content body area V is “1” and the other areas are “0”.

続いて、拡大副内容物領域袖出部が、副内容物本体領域抽出画像B2(x,y)の各画素Q(x、y)に対し、一画素ずつ、その画素が拡大副内容物領域を構成する画素か否かを判定する「拡大副内容物領域探索演算」を行う。この「拡大副内容物領域」は、簡単に言えば、副内容物本体領域抽出画像B2(x,y)に映る副内容本体領域に対し、この領域を中心としてその外周部分を拡大することにより、副内容物領域全体を完全に覆いつくすようにした領域(副内容物に不規則に生じる突起等も含まれるように拡大量が設定される)であり、具体的には、拡大副内容物領域袖出部が利用する判定式に基づいて抽出される領域である。
すなわち、副内容物本体領域抽出画像B2(x,y)の一の画素Q(x,y)に対し、画素Q(x,y)を取り囲むようにして第一探索ユニットよりも大きな領域の第二探索ユニット(S2)を設定し、画素Qを含む第二探索ユニット(S2)内の全画素の階調データと副内容物本体領域抽出画像B2(x、y)に映る副内容物の本体領域Vの階調データ(二値化しているときは「1」)との比較結果に基づいて画素Q(x,y)が拡大副内容物領域を構成する画素か否かを判定する拡大副内容物領域探索演算を行う。
Subsequently, the expanded sub-content area heading portion is one pixel at a time for each pixel Q (x, y) of the sub-content main body area extraction image B2 (x, y), and the pixel is the expanded sub-content area. The “enlarged sub-content area search operation” is performed to determine whether or not the pixel is included in the image. In short, this “enlarged sub-content area” is obtained by enlarging an outer peripheral portion around this area with respect to the sub-content main area shown in the sub-content main area extraction image B2 (x, y). , An area in which the entire sub-content area is completely covered (the amount of enlargement is set so that irregular projections etc. appear in the sub-content) are included. This is an area that is extracted based on the determination formula used by the area head portion.
That is, for the pixel Q (x, y) of the sub-contents main body region extraction image B2 (x, y), the first region of the area larger than the first search unit so as to surround the pixel Q (x, y). The main body of the sub-contents set in the second search unit (S2) and the gradation data of all the pixels in the second search unit (S2) including the pixel Q and the sub-contents main body region extraction image B2 (x, y) Based on the comparison result with the gradation data of the region V (“1” when binarized), the enlarged sub-subject determines whether or not the pixel Q (x, y) is a pixel constituting the enlarged sub-content region. Perform content area search calculation.

例えば、図15(c)に示すように、副内容物本体領域抽出画像B2(x,y)上の画素Q(x,y)を中心とする円形の画素集合を第二探索ユニット(S2)(ただし、第一探索ユニット(S1)より大きい領域とする)とし、第二探索ユニット(S2)内の各画素ごとに、その階調データと本体領域の階調データ(二値化しているときは「1」)の比較を行い、第二探索ユニット(S2)内のいずれか1つ(あるいは一定基準以下の画素数)が本体領域Vの階調データであるときに画素Q(x,y)は拡大副内容物領域を構成する画素であると判定する。
なお、第二探索ユニット(S2)の領域が大きくなるほど拡大される領域は大きくなるので、副内容物に突起等の突出部分が発生する被検査物の場合には、発生しうる突起の大きさを考慮して、第二探索ユニット(S2)の領域を設定することで、突起が発生しても拡大副内容物領域内に含まれるようになる。
For example, as shown in FIG. 15C, a circular pixel set centering on the pixel Q (x, y) on the sub-contents body region extraction image B2 (x, y) is defined as the second search unit (S2). (However, the region is larger than the first search unit (S1)), and for each pixel in the second search unit (S2), the gradation data and the gradation data of the main body region (when binarized) Are compared with each other, and when any one of the second search units (S2) (or the number of pixels below a certain reference) is the gradation data of the main body region V, the pixel Q (x, y ) Is determined to be a pixel constituting the enlarged sub-content area.
In addition, since the area | region expanded as the area | region of 2nd search unit (S2) becomes large becomes large, in the case of the to-be-inspected object in which protrusion parts, such as a protrusion, generate | occur | produce in a subcontent, the magnitude | size of the protrusion which can generate | occur | produce In consideration of the above, by setting the area of the second search unit (S2), even if a protrusion occurs, it is included in the enlarged sub-content area.

そして、一の画素Q(x、y)に対して行った拡大副内容物領域探索演算を、副内容物本体領域抽出画像B2(x,y)の全画素にわたって行うことにより、図15(d)に示すように、副内容物本体領域Vを拡大し、拡大副内容物領域Wとして抽出した拡大副内容物領域抽出画像B3(x,y)を作成する。これにより、拡大副内容物領域抽出画像B3(x,y)上には、突起部分も含めて副内容物領域が完全に覆われることになる。作成された拡大副内容物領域抽出画像B3(x,y)は、拡大副内容物領域Wの領域が「1」で、それ以外の領域が「0」になるように二値化しておく。   Then, the enlarged sub-content area search operation performed on one pixel Q (x, y) is performed over all the pixels of the sub-content body area extraction image B2 (x, y), thereby obtaining the result shown in FIG. ), The sub-content body area V is enlarged, and an enlarged sub-content area extraction image B3 (x, y) extracted as the enlarged sub-content area W is created. As a result, the sub-content area is completely covered on the enlarged sub-content area extraction image B3 (x, y), including the protrusions. The created enlarged sub-content area extraction image B3 (x, y) is binarized so that the area of the enlarged sub-content area W is “1” and the other areas are “0”.

続いて、拡大副内容物領域外異物検査部は、拡大副内容物領域抽出画像B3(x,y)の拡大副内容物領域W以外の領域に対応するX線透視画像img(x,y)の各画素を第一検査範囲として、第一検査範囲に含まれる各画素の階調データを第一異物判定レベル値(th1)に基づいて判定することにより異物の有無を判定する。   Subsequently, the enlarged sub-contents region outside foreign matter inspection unit performs an X-ray fluoroscopic image img (x, y) corresponding to a region other than the enlarged sub-contents region W of the enlarged sub-contents region extraction image B3 (x, y). Each pixel is determined as the first inspection range, and the gradation data of each pixel included in the first inspection range is determined based on the first foreign matter determination level value (th1), thereby determining the presence or absence of foreign matter.

以上のように、本発明のX線異物検査装置によれば、X線の内容物レベル閾値(th)のみを基準とするだけではなく、第一探索ユニット(S1)に含まれる画素の集合の階調データも合わせて判定基準に含めることにより、小さなノイズ(副内容物の突起部分、異物)の影響を除去しつつマスク領域を作成し、異物検査を行うことができる。   As described above, according to the X-ray foreign substance inspection apparatus of the present invention, not only the X-ray content level threshold (th) is used as a reference but also the set of pixels included in the first search unit (S1). By including the gradation data together in the determination criterion, it is possible to create a mask area while removing the influence of small noise (protrusions of sub-contents, foreign matter) and perform foreign matter inspection.

また、本発明の異物検査装置によれば、検査の障害となる副内容物領域をマスク領域として除外する際に、実際に副内容物が映し出される領域のまわりに、その周辺領域も含めて拡大した拡大副内容物領域をマスク領域とするようにしたので、副内容物の周囲に不規則に生じる突起等の異常部分を異物と誤って検出するエラーを除くことができる。
そして、拡大副内容物領域外の検査範囲にある異物については、誤って副内容物の一部と判定するエラーを完全になくすことができる。
Further, according to the foreign matter inspection apparatus of the present invention, when the sub-content area that becomes an obstacle to the inspection is excluded as a mask area, the area around the area where the sub-content is actually displayed is enlarged including the peripheral area. Since the enlarged sub-content area is used as a mask area, it is possible to eliminate an error that erroneously detects an abnormal portion such as a protrusion irregularly generated around the sub-content as a foreign object.
Further, it is possible to completely eliminate an error that erroneously determines that a foreign substance is in the inspection range outside the enlarged sub-contents area as a part of the sub-contents.

(その他の課題を解決するための手段および効果)
上記発明において、X線透視画像img(x,y)を内容物レベル閾値(th)に基づいて二値化した二値化画像B1(x,y)を作成する二値化画像抽出部をさらに備え、副内容物本体領域抽出部は、X線透視画像img(x,y)の一の画素P(x,y)に代えて、二値化画像B1(x,y)の一の画素P(x,y)に対して本体領域探索演算を行い、二値化画像B1(x,y)の全画素について本体領域探索演算を行うことにより、副内容物の本体領域を抽出した副内容物本体領域抽出画像B2(x,y)を作成するようにしてもよい。
(Means and effects for solving other problems)
In the above invention, the binarized image extraction unit for creating the binarized image B1 (x, y) obtained by binarizing the fluoroscopic image img (x, y) based on the content level threshold (th) is further provided. The sub-contents main body region extraction unit includes one pixel P of the binarized image B1 (x, y) instead of one pixel P (x, y) of the X-ray fluoroscopic image img (x, y). Sub-contents obtained by extracting the main body region of the sub-contents by performing the main body region search calculation on (x, y) and performing the main body region search calculation on all the pixels of the binarized image B1 (x, y). The main body region extraction image B2 (x, y) may be created.

例えば、二値化を行う式として次式(5)を用いることができる。
For example, the following expression (5) can be used as an expression for binarization.

本発明によれば、予め、内容物レベル閾値(th)に基づいて二値化した画像B1(x,y)を作成し、二値化画像B1(x,y)を利用して本体領域探索演算を行うようにする。これにより、二値化演算を用いた本体領域探索演算を行うことができるようになる。     According to the present invention, the binarized image B1 (x, y) is created in advance based on the content level threshold (th), and the body region search is performed using the binarized image B1 (x, y). Do the calculation. As a result, the body region search calculation using the binarization calculation can be performed.

また、上記発明において、副内容物本体領域袖出部は、画素P(x,y)を含む第一探索ユニット(S1)内の全画素の階調データが内容物レベル閾値(th)以下であることを条件として画素P(x,y)を副内容物の本体領域を構成する画素と判定する本体領域探索演算を行い、拡大副内容物領域袖出部は、画素Q(x,y)を含む第二探索ユニット(S2)内の少なくとも1つの画素の階調データが副内容物本体領域の階調データであることを条件として画素Q(x,y)を拡大副内容物領域と判定する拡大副内容物領域探索演算を行うようにしてもよい。   In the above invention, the sub-contents main body region crest portion is such that the gradation data of all the pixels in the first search unit (S1) including the pixel P (x, y) is equal to or less than the content level threshold (th). On the condition that the pixel P (x, y) is a pixel that constitutes the main content region of the sub-contents, a main body region search calculation is performed. The pixel Q (x, y) is determined to be an enlarged sub-content area on condition that the gray-scale data of at least one pixel in the second search unit (S2) including the sub-content main body area You may make it perform the expansion subcontents area search calculation to perform.

本発明によれば、一の画素P(x,y)が、その回りの第一探索ユニット内の画素がすべて内容物レベル閾値(th)以下である場合に、画素P(x,y)を副内容物本体領域と判定するので、小さなノイズ部分は確実に除去され、副内容物領域の中央部分だけが本体領域として抽出されることになる。さらに、一の画素Q(x,y)が、その回りの第二探索ユニットの画素の少なくとも1つが副内容物本体領域であれば副内容物本体領域を拡大した拡大副内容物領域と判定するので、副内容物の中心部分(本体領域部分)だけを拡大して、拡大副内容物領域とすることができ、しかも第二探索ユニットを適切に設定することにより、副内容物の突起部分も含めた副内容物全体を完全に覆うような拡大内容物領域を抽出することができる。   According to the present invention, when one pixel P (x, y) is less than or equal to the content level threshold (th) in the surrounding first search unit, the pixel P (x, y) Since it is determined as the sub-contents main body region, the small noise portion is surely removed, and only the central portion of the sub-contents region is extracted as the main body region. Furthermore, if at least one of the pixels of the second search unit around the one pixel Q (x, y) is a sub-contents main body region, the sub-contents main body region is determined to be an enlarged sub-contents region. Therefore, it is possible to enlarge only the central portion (main body region portion) of the subsidiary content to be an enlarged subsidiary content region, and by appropriately setting the second search unit, the projecting portion of the subsidiary content is also It is possible to extract an enlarged content region that completely covers the entire sub-contents included.

また、上記発明において、副内容物本体領域袖出部は、次式(1)を用いて本体領域探索演算を行うようにしてもよい。

In the above invention, the sub-contents main body region starting portion may perform a main body region search calculation using the following equation (1).

本発明によれば、二値化画像B1(x,y)を用いて、x方向、y方向を縦横とする方形の第一探索ユニット(S1)(x方向×y方向:N個×N個)内を演算範囲とする二値化演算を行い、第一探索ユニット内のすべての画素が「1」である場合に、B2(x,y)は「1」すなわち副内容物本体領域を構成する画素となる。
これにより、方形の第一探索ユニット(S1)を用いた簡単な計算により、本体領域であるか否かの判定を行うことができる。
According to the present invention, using the binarized image B1 (x, y), a rectangular first search unit (S1) having x and y directions in the vertical and horizontal directions (x direction × y direction: N × N) ) When a binarization operation is performed in the operation range, and all the pixels in the first search unit are “1”, B2 (x, y) is “1”, that is, a sub-content body area is formed. Pixel.
Thereby, it can be determined whether it is a main body area | region by simple calculation using the square 1st search unit (S1).

また、上記発明において、拡大副内容物領域袖出部は、次式(2)を用いて拡大副内容物領域探索演算を行うようにしてもよい。
In the above invention, the enlarged sub-content area starting portion may perform an enlarged sub-content area search operation using the following equation (2).

本発明によれば、副内容物本体領域抽出画像B2(x,y)を用いて、x方向、y方向を縦横とする方形の第二探索ユニット(S2)(x方向×y方向:kx個×ky個)内を演算範囲とする二値化演算を行い、第二探索ユニット内のいずれか1つの画素が「1」である場合に、B3(x,y)は「1」、すなわち拡大副内容物領域を構成する画素となる。
これにより、方形の第二探索ユニット(S2)を用いた簡単な計算により、拡大副内容物領域であるか否かの判定を行うことができる。
According to the present invention, the second search unit (S2) having the x and y directions in the vertical and horizontal directions (x direction x y direction: kx pieces) using the sub-content body region extraction image B2 (x, y). When binarization is performed with the calculation range within (× ky), and any one pixel in the second search unit is “1”, B3 (x, y) is “1”, that is, enlargement This is a pixel constituting the sub-content area.
As a result, it is possible to determine whether or not the region is the enlarged sub-content region by simple calculation using the square second search unit (S2).

また、上記発明において、拡大副内容物領域外異物検査部は、次式(3)を用いて拡大副内容物領域外の異物の有無を判定するようにしてもよい。
In the above invention, the foreign substance inspection unit outside the enlarged sub-content area may determine the presence or absence of a foreign substance outside the enlarged sub-content area using the following equation (3).

本発明によれば、拡大副内容物領域抽出画像B3(x,y)を用いて、xy座標で表現される画像全体の演算を行い、拡大副内容物領域外のいずれか一の画素が内容物レベル閾値以下である場合に、M1が「0」以外、すなわち異物ありと判定する。
これにより、簡単な計算により、拡大副内容物領域であるか否かの判定を行うことができる。
According to the present invention, the entire sub-content area is calculated using the enlarged sub-content area extraction image B3 (x, y), and any one pixel outside the enlarged sub-content area is the content. When it is below the object level threshold, it is determined that M1 is other than “0”, that is, there is a foreign object.
As a result, it is possible to determine whether or not the area is the enlarged sub-content area by simple calculation.

また、上記発明において、X線透視画像img(x,y)の全領域に対する異物判定に用いる階調レベル値を第二異物判定レベル値(th2)として設定する第二異物判定レベル値設定部と、画素の二次元形状の集合からなる第三の塊領域が、X線透視画像img(x,y)の全領域から異物領域を抽出するための演算に用いる第三探索ユニット(S3)として設定されている状態で、第三探索ユニット(S3)に含まれる全画素の階調データと第二異物判定レベル値(th2)との関係に基づいて異物認定を行うときの判定基準とする画素数閾値(MS3)を設定する画素数閾値設定部と、X線透視画像Img(x,y)の一の画素R(x,y)に対し、前記画素R(x,y)を取り囲むように第三探索ユニット(S3)を設定し、画素R(x,y)を含む第三探索ユニット(S3)内の各画素の階調データと第二異物判定レベル値(th2)との比較により抽出した画素の数と画素数閾値(MS3)とに基づいて、前記画素R(x,y)が異物を構成する画素であるか否かを判定する異物領域探索演算を行い、X線透視画像img(x,y)の全画素を第二検査範囲として、前記第二検査範囲の各画素について異物領域探索演算を行うことにより異物の有無を判定する全体領域異物検査部とをさらに備えるようにしてもよい。     In the above invention, a second foreign substance determination level value setting unit that sets a gradation level value used for foreign substance determination for the entire region of the fluoroscopic image img (x, y) as a second foreign substance determination level value (th2); A third mass region composed of a set of two-dimensional shapes of pixels is set as a third search unit (S3) used for calculation for extracting a foreign substance region from the entire region of the fluoroscopic image img (x, y). In this state, the number of pixels used as a determination criterion when performing foreign object recognition based on the relationship between the gradation data of all the pixels included in the third search unit (S3) and the second foreign object determination level value (th2) The pixel number threshold setting unit for setting the threshold (MS3) and the pixel R (x, y) of the X-ray fluoroscopic image Img (x, y) are arranged so as to surround the pixel R (x, y). Three search units (S3) are set and pixel R Based on the number of pixels extracted by comparing the gradation data of each pixel in the third search unit (S3) including x, y) and the second foreign substance determination level value (th2) and the pixel number threshold (MS3). Then, a foreign substance region search calculation is performed to determine whether or not the pixel R (x, y) is a pixel constituting a foreign substance, and all the pixels of the X-ray fluoroscopic image img (x, y) are set as the second inspection range. A whole area foreign substance inspection unit that determines the presence or absence of foreign substances by performing a foreign substance area search operation for each pixel in the second inspection range may be further provided.

ここで、第三探索ユニット(S3)は、異物領域を抽出するための演算において、画像に含まれる小さなノイズの影響を除外するために用いる演算範囲であり、画素の二次元形状の集合からなる。この二次元形状は、第一探索ユニットや第二探索ユニットと同様に、方形の画素集合や円形の画素集合にするのが好ましいが、形状は特に限定されない。例えば、第三探索ユニット(S3)として、x方向×y方向:7個×7個(合計49個)の画素集合を設定する。第三探索ユニット(S3)の設定は、任意の値に設定変更できるようにしてもよいし、固定値としてもよい。
一方、画素数閾値(MS3)は、第三探索ユニット(S3)に含まれる画素の全数に対する個数として設定される閾値である。例えば画素数閾値を20個として設定すると、第三探索ユニットが49個として設定されている場合には、20/49が異物領域か否かの判定基準となる。
Here, the third search unit (S3) is a calculation range used to exclude the influence of small noise included in the image in the calculation for extracting the foreign substance region, and is composed of a set of two-dimensional shapes of pixels. . The two-dimensional shape is preferably a rectangular pixel set or a circular pixel set, like the first search unit and the second search unit, but the shape is not particularly limited. For example, as the third search unit (S3), a pixel set of x direction × y direction: 7 × 7 (total of 49) is set. The setting of the third search unit (S3) may be changed to an arbitrary value or may be a fixed value.
On the other hand, the pixel number threshold value (MS3) is a threshold value set as the number with respect to the total number of pixels included in the third search unit (S3). For example, if the pixel number threshold is set to 20, and if the third search unit is set to 49, 20/49 is a criterion for determining whether or not it is a foreign object region.

本発明によれば、全体領域異物検査部は、X線透視画像img(x,y)の全領域内に含まれる画素に、異物領域探索演算を行う。
すなわちX線透視画像img(x,y)の一の画素R(x,y)に対し、画素R(x,y)を取り囲むように第三探索ユニット(S3)を設定する。そして、画素R(x,y)を含む第三探索ユニット(S3)内の各画素の階調データと第二異物判定レベル値(th2)(とを比較し、第二異物判定レベル以下の階調データの画素(すなわち第二異物判定レベル値以下の暗い階調データを有する画素)を抽出し、抽出された画素の数を算出する。そして、算出された画素の数と画素数閾値(MS3)とを比較し、画素数閾値(MS3)以上の数が検出された場合に、画素R(x,y)は異物領域を構成する画素であると判定し、それ以外は異物領域を構成しない画素であると判定する。画素R(x,y)に対して行ったこのような異物領域探索演算を、X線透視画像数のimg(x,y)の全画素に対し実行することにより、異物の有無を判定する。
これにより、拡大副内容物領域外異物検査部による拡大副内容物領域外の検査では、マスク領域として検査から除外される拡大副内容物領域が存在していたが、この部分も含めて、被検査物全体を検査することができる。また、拡大副内容物領域外異物検査部、全体領域異物検査部による2つのモードで続けて検査を行うことにより、拡大副内容物領域外、拡大副内容物領域のそれぞれに適した閾値に基づいて検査を行うことができるので、精度よく検査を行うことができる。
According to the present invention, the entire region foreign matter inspection unit performs a foreign matter region search operation on the pixels included in the entire region of the X-ray fluoroscopic image img (x, y).
That is, the third search unit (S3) is set so as to surround the pixel R (x, y) for one pixel R (x, y) of the X-ray fluoroscopic image img (x, y). Then, the gradation data of each pixel in the third search unit (S3) including the pixel R (x, y) is compared with the second foreign matter determination level value (th2) (the level below the second foreign matter determination level). Pixels of tone data (that is, pixels having dark gradation data equal to or lower than the second foreign substance determination level value) are extracted, and the number of extracted pixels is calculated, and the calculated number of pixels and the pixel number threshold (MS3) ) And a pixel number threshold (MS3) or more is detected, it is determined that the pixel R (x, y) is a pixel that constitutes a foreign substance region, and otherwise no foreign matter area is constituted. By performing such a foreign substance region search operation performed on the pixel R (x, y) for all the pixels of img (x, y) of the number of fluoroscopic images, The presence or absence of foreign matter is determined.
As a result, in the inspection outside the enlarged sub-content area by the foreign substance inspection section outside the enlarged sub-content area, there was an enlarged sub-content area excluded from the inspection as a mask area. The entire inspection object can be inspected. In addition, the inspection is continuously performed in two modes by the enlarged sub-contents region foreign matter inspection unit and the entire region foreign matter inspection unit, and based on thresholds suitable for the outside of the enlarged sub-content region and the enlarged sub-content region, respectively. The inspection can be performed with high accuracy.

ここで、全体領域異物検査部は、次式(4)を用いて画像全体の異物探索演算を行うようにしてもよい。
Here, the whole area foreign matter inspection unit may perform foreign matter search calculation of the entire image using the following equation (4).

本発明によれば、X線透視画像img(x,y)の一の画素R(x,y)に対し異物領域探索演算を行う。すなわち、x方向、y方向を縦横とする方形の第三探索ユニット(S3)(x方向×y方向:M個×M個)内を演算範囲として、各画素の階調データと第二異物判定レベル値(th2)との大小を比較する演算を行い、第二異物判定レベル値(th2)以下の画素の数を算出する。算出された画素の数が、画素数閾値(MS3)以下であるときに、一の画素R(x,y)は異物領域を構成する画素(画素R(x,y)の二値化データが「1」)と判定し、それ以外は異物を構成しない画素(画素R(x,y)の二値化データが「0」)と判定する。このような異物領域探索演算を、X線透視画像img(x,y)の全領域の画素にわたって実行し、少なくとも1つの画素が異物領域を構成する画素であるとき、すなわちM2の値が「0」以外であるとき、異物ありと判定する。
これにより、方形の第三探索ユニット(S3)を用いた簡単な計算により、異物領域の有無についての判定を行うことができる。
According to the present invention, the foreign object region search calculation is performed on one pixel R (x, y) of the X-ray fluoroscopic image img (x, y). That is, the gradation data of each pixel and the second foreign object determination are set in the rectangular third search unit (S3) (x direction × y direction: M × M) whose vertical and horizontal directions are the x direction and the y direction. An operation of comparing the level value with the level value (th2) is performed, and the number of pixels equal to or smaller than the second foreign matter determination level value (th2) is calculated. When the calculated number of pixels is equal to or less than the pixel number threshold value (MS3), one pixel R (x, y) is the binarized data of the pixels (pixel R (x, y) constituting the foreign substance region. “1”), and other than that, it is determined that the pixel that does not form a foreign object (the binarized data of the pixel R (x, y) is “0”). Such a foreign substance region search operation is performed over the pixels of the entire region of the X-ray fluoroscopic image img (x, y), and when at least one pixel is a pixel constituting the foreign substance region, that is, the value of M2 is “0”. ", It is determined that there is a foreign object.
Thereby, the presence or absence of the foreign substance region can be determined by a simple calculation using the square third search unit (S3).

また、上記発明において、画素の二次元形状の集合からなる第四の塊領域を、副内容物の欠落を判定するための演算に用いる欠落判定閾値(S4)として設定する欠落判定閾値設定部と、副内容物本体領域抽出画像B2(x,y)に映る副内容物の本体領域と欠落判定閾値(S4)とに基づいて、被検査物中の副内容物の有無を判定する副内容物欠落検査部とをさらに備えてもよい。   Further, in the above invention, a missing determination threshold value setting unit that sets a fourth mass region formed of a set of two-dimensional shapes of pixels as a missing determination threshold value (S4) used in a calculation for determining the loss of sub-contents; The sub-contents for determining the presence / absence of the sub-contents in the inspected object based on the main content area of the sub-contents shown in the sub-contents main body region extraction image B2 (x, y) and the lack determination threshold (S4) You may further provide a missing inspection part.

ここで、欠落判定閾値(S4)は、副内容物の本体領域として抽出された領域と比較される閾値であり、具体的には副内容物の本体領域として抽出されうる領域よりもひと回り小さな領域(画素集合)が設定される。
本発明によれば、副内容物欠落検査部が、副内容物本体領域抽出画像B2(x,y)に映る副内容物の本体領域と欠落判定閾値(S4)との領域を比較することにより、その本体領域が欠落判定閾値(S4)より小さな領域であるとき、あるいは本体領域がないときに、被検査物中に副内容物が欠落していると判定する。また、欠落判定閾値(S4)より大きな領域が複数存在するときに、副内容物が余分に含まれていると判定する。
これにより、本来存在するはずの副内容物が不足していたり、多すぎたりする被検査物を見つけることができる。
Here, the missing determination threshold (S4) is a threshold that is compared with the area extracted as the main body area of the sub-content, and specifically, an area that is slightly smaller than the area that can be extracted as the main-body area of the sub-content. (Pixel set) is set.
According to the present invention, the subsidiary content missing inspection unit compares the body content region of the subsidiary content shown in the subsidiary content body region extracted image B2 (x, y) with the region of the missing determination threshold (S4). When the main body area is smaller than the missing determination threshold (S4), or when there is no main body area, it is determined that the sub-content is missing in the inspection object. Further, when there are a plurality of regions larger than the missing determination threshold (S4), it is determined that an extra sub-content is included.
As a result, it is possible to find an inspection object in which the sub-contents that should originally exist are insufficient or too much.

以下、本発明の実施形態について図面を用いて説明する。なお、本発明は、以下の実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲で種々の態様が含まれることはいうまでもない。
以下の実施形態では、被検査物には内容物(主内容物)と添付品(副内容物)とが含まれるものとする。そして、例外的に添付品が欠落した不良品が存在する。また、内容物に異物が含まれていないものが良品であり、例外的に異物が混入したものが不良品となる。
Hereinafter, embodiments of the present invention will be described with reference to the drawings. In addition, this invention is not limited to the following embodiment, It cannot be overemphasized that various aspects are included in the range which does not deviate from the meaning of this invention.
In the following embodiments, the inspected object includes contents (main contents) and attachments (sub contents). There are exceptionally defective products with missing attachments. Further, a product that does not contain foreign matter in the contents is a non-defective product, and a product that contains foreign matter in exceptional cases is a defective product.

(装置構成)
図1は、本発明の一実施形態であるX線異物検査装置の外観を示す斜視図であり、図2は、X線異物検査装置の一部の構成を示す概略ブロック図である。
X線異物検査装置80は、本体70と、入口ベルトコンベア60と、出口ベルトコンベア50と、X線異物検査装置80全体の制御を行う制御系(コンピュータ)20とにより構成される。
入口ベルトコンベア60は、本体70の入口部6aに設けられるとともに、出口ベルトコンベア50は、本体70の出口部6bに設けられる。
(Device configuration)
FIG. 1 is a perspective view showing an appearance of an X-ray foreign substance inspection apparatus according to an embodiment of the present invention, and FIG. 2 is a schematic block diagram showing a partial configuration of the X-ray foreign substance inspection apparatus.
The X-ray foreign substance inspection apparatus 80 includes a main body 70, an entrance belt conveyor 60, an outlet belt conveyor 50, and a control system (computer) 20 that controls the entire X-ray foreign substance inspection apparatus 80.
The inlet belt conveyor 60 is provided at the inlet portion 6 a of the main body 70, and the outlet belt conveyor 50 is provided at the outlet portion 6 b of the main body 70.

本体70は、入口部6aと出口部6bとを有する防護箱6と、X線を発生するX線管1と、X線管1からのX線を検出するX線検出器3と、X線管1とX線検出器3との間を被検査物7が通過するように被検査物7を搬送するためのベルトコンベア(搬送機構)5と、ベルトコンベア5を駆動する駆動機構(図示せず)とを備える。   The main body 70 includes a protection box 6 having an inlet 6a and an outlet 6b, an X-ray tube 1 that generates X-rays, an X-ray detector 3 that detects X-rays from the X-ray tube 1, and an X-ray A belt conveyor (conveying mechanism) 5 for conveying the inspection object 7 so that the inspection object 7 passes between the tube 1 and the X-ray detector 3 and a drive mechanism (not shown) for driving the belt conveyor 5. Z)).

防護箱6は、全体の構造を支えるフレームであり、入口部6aから被検査物7を入れるとともに、出口部6bから被検査物7を出すものである。また、防護箱6の内部から有害な量のX線が防護箱6の外部に漏洩しないように、放射線遮蔽材料を用いて形成されている。さらに、入口部6aと出口部6bとには、防護箱6の内部から有害な量のX線が防護箱6の外部に漏洩しないように、防護のれん8が下げられている。   The protective box 6 is a frame that supports the entire structure, and puts the inspection object 7 from the inlet portion 6a and takes out the inspection object 7 from the outlet portion 6b. Further, a radiation shielding material is used so that a harmful amount of X-rays does not leak from the inside of the protection box 6 to the outside of the protection box 6. In addition, protective entrances 8 are lowered at the entrance 6 a and the exit 6 b so that harmful amounts of X-rays do not leak from the inside of the protection box 6 to the outside of the protection box 6.

ベルトコンベア5は、一対のローラ5aの間に掛け回された搬送ベルト5bを有する。そして、上側の搬送ベルト5bの上面に、被検査物7が載置される。駆動機構でいずれかのローラ5aが駆動することにより、搬送ベルト5bが循環して移動して、被検査物7が、入口部6aから出口部6bに移動することになる。   The belt conveyor 5 has a conveyor belt 5b that is wound between a pair of rollers 5a. Then, the inspection object 7 is placed on the upper surface of the upper conveyor belt 5b. When one of the rollers 5a is driven by the drive mechanism, the conveyor belt 5b circulates and moves, and the object 7 to be inspected moves from the inlet 6a to the outlet 6b.

駆動機構は、例えば、回転駆動用モータを有する。なお、駆動機構の制御は、後述する搬送機構制御部34から出力された駆動信号が与えられることによって実行される。   The drive mechanism has, for example, a rotation drive motor. The drive mechanism is controlled by receiving a drive signal output from a transport mechanism control unit 34 described later.

X線管1は、防護箱6の上部に配置され、防護箱6の下部に配置されるX線検出器3に向けてX線を照射するものである。このとき、発生させたX線を、コリメータ(図示せず)を用いて、ベルトコンベア5が移動させる被検査物7の移動方向と直交するように、扇状に広がるX線ビームとして形成する。   The X-ray tube 1 is arranged at the upper part of the protection box 6 and emits X-rays toward the X-ray detector 3 arranged at the lower part of the protection box 6. At this time, the generated X-ray is formed as an X-ray beam spreading in a fan shape so as to be orthogonal to the moving direction of the inspection object 7 moved by the belt conveyor 5 using a collimator (not shown).

図3は、X線検出器の平面図であり、図4は、図3に示すA−A線の断面図である。X線検出器3は、X線を光に変換する蛍光体91と光ダイオード列92と支持体93とからなる。また、X線検出器3は、上側になっている搬送ベルト5bの下方に配置されるとともに、下側になっている搬送ベルト5bの上方に配置される。光ダイオード列92は、1画素(1ch)を構成する光ダイオード(92a、92b、・・)を多数個(例えば、256個)直線状に並べてなるものであって、蛍光体91からの光を信号(検出信号)に変換するものである。この信号が、コンピュータ20に出力される。
このとき、X線検出器3は、X線管からの扇状に広がるX線ビームを検出できるように、ベルトコンベア5が移動させる被検査物7の移動方向と直交するように配置されている。
FIG. 3 is a plan view of the X-ray detector, and FIG. 4 is a cross-sectional view taken along line AA shown in FIG. The X-ray detector 3 includes a phosphor 91 that converts X-rays into light, a photodiode array 92, and a support 93. The X-ray detector 3 is disposed below the upper conveyor belt 5b and is disposed above the lower conveyor belt 5b. The photodiode array 92 is formed by arranging a large number (eg, 256) of photodiodes (92a, 92b,...) Constituting one pixel (1ch) in a straight line. This is converted into a signal (detection signal). This signal is output to the computer 20.
At this time, the X-ray detector 3 is arranged so as to be orthogonal to the moving direction of the inspection object 7 to be moved by the belt conveyor 5 so that the fan-shaped X-ray beam from the X-ray tube can be detected.

コンピュータ20は、ハードウェアとして、各種機能を実現するための制御を行うCPU21、入力装置であるキーボード22aやマウス22b、モニタ画面23aを有する表示装置23、メモリ25(RAM、ROM、HDD等)を備える。   The computer 20 includes, as hardware, a CPU 21 that performs control for realizing various functions, a keyboard 22a and a mouse 22b as input devices, a display device 23 having a monitor screen 23a, and a memory 25 (RAM, ROM, HDD, etc.). Prepare.

CPU21が処理する機能を説明するため、機能ごとにブロック化して説明すると、設定部31と、X線透過像データ記憶制御部32と、X線透過像データ表示部33と、搬送機構制御部34と、二値化画像抽出部35と、副内容物本体領域抽出部36と、拡大副内容物領域抽出部37と、拡大副内容物領域外検査部38と、全体領域検査部39と、副内容物欠落検査部40とを有する。   In order to explain the functions processed by the CPU 21, each function will be described as a block. The setting unit 31, the X-ray transmission image data storage control unit 32, the X-ray transmission image data display unit 33, and the transport mechanism control unit 34. A binarized image extraction unit 35, a sub-contents main body region extraction unit 36, an enlarged sub-contents region extraction unit 37, an enlarged sub-contents region outside inspection unit 38, an entire region inspection unit 39, And a content missing inspection unit 40.

また、メモリ25は、設定データを記憶する設定データ記憶領域41と、X線検出器3により取得された検出信号に基づいて作成されたX線透視画像(X線透過像データA)を記憶する検出信号記憶領域42、X線透視画像(X線透過像データA)から作成される各種画像(後述する二値化画像B1、副内容物本体領域抽出画像B2、拡大副内容物領域抽出画像B3)を記憶する画像記憶領域43とを有する。
設定データ記憶領域41には、内容物レベル閾値(th)、第一探索ユニット(S1)、第二探索ユニット(S2)、第三探索ユニット(S3)、欠落判定閾値(S4)、第一異物判定レベル値(th1)、第二異物判定レベル値(th2)、画素数閾値(MS3)の設定値が記憶されており、必要に応じて設定値を変更することにより、変更後の設定値が記憶されるようにしてある。
The memory 25 also stores a setting data storage area 41 for storing setting data, and an X-ray fluoroscopic image (X-ray transmission image data A) created based on the detection signal acquired by the X-ray detector 3. Various images (binarized image B1, sub-contents main body region extraction image B2, and enlarged sub-contents region extraction image B3 described later) created from the detection signal storage region 42, X-ray fluoroscopic image (X-ray transmission image data A) ) Is stored.
The setting data storage area 41 includes a content level threshold (th), a first search unit (S1), a second search unit (S2), a third search unit (S3), a missing determination threshold (S4), and a first foreign object. The setting values of the determination level value (th1), the second foreign substance determination level value (th2), and the pixel number threshold value (MS3) are stored. By changing the setting value as necessary, the changed setting value is It is supposed to be memorized.

これら設定データの具体的な設定内容について説明する。図5は、設定データを入力(設定変更)したり確認したりするために、画像表示される入力用モニタ画面23aの一例を示す図である。また、図6は画像表示されるX線透視画像の一例を示す模式図である。
なお、入力用モニタ画面では、操作者が設定データを入力しやすくするために、設定データ名を操作者にわかり易い表現に代えているものがある。そのため、入力用モニタ画面に表示される設定データ名と設定データ記憶領域41の設定データ名とが異なるデータについては、対応を付けながら、設定データ記憶領域41に記憶される設定内容を説明する。
説明の便宜上、正常な被検査物7は、内容物と、包装袋に封入された脱酸素剤である1個の添付品とから構成されるものとする。そして、X線透視画像に映し出された内容物の階調レベルは150とする。また、脱酸素剤の階調レベルは40であり、大きさが60×60であるとする。
The specific setting contents of these setting data will be described. FIG. 5 is a diagram illustrating an example of an input monitor screen 23a displayed as an image for inputting (changing settings) or confirming setting data. FIG. 6 is a schematic diagram showing an example of an X-ray fluoroscopic image displayed as an image.
In some input monitor screens, in order to make it easier for an operator to input setting data, the name of the setting data is replaced with an expression that is easy for the operator to understand. For this reason, the setting contents stored in the setting data storage area 41 will be described with respect to data in which the setting data name displayed on the input monitor screen is different from the setting data name in the setting data storage area 41.
For convenience of explanation, it is assumed that a normal inspection object 7 is composed of contents and one accessory that is an oxygen scavenger enclosed in a packaging bag. The gradation level of the content displayed on the X-ray fluoroscopic image is set to 150. Further, it is assumed that the gradation level of the oxygen scavenger is 40 and the size is 60 × 60.

「内容物レベル閾値(th)」は、内容物81(階調レベル:150)を示す階調データと、添付品82(階調レベル:40)や異物83を示す階調データとを分割する二値化の演算に用いる閾値であり、X線透視画像から、二値化画像B1を抽出する際の閾値である。具体的には、内容物の階調レベル「150」と添付品部分の階調レベル「40」との中間の階調レベル、例えば、階調レベル「50」が設定される。   The “content level threshold (th)” divides gradation data indicating the content 81 (gradation level: 150) and gradation data indicating the accessory 82 (gradation level: 40) and the foreign object 83. It is a threshold value used for the binarization calculation, and is a threshold value when extracting the binarized image B1 from the X-ray fluoroscopic image. Specifically, a gradation level intermediate between the gradation level “150” of the contents and the gradation level “40” of the accessory part, for example, the gradation level “50” is set.

「演算範囲(S1)」は、第一探索ユニット(S1)を設定する。この第一探索ユニット(S1)は、画素の二次元形状の集合で形成される範囲である。上述した二値化画像B1を用いて副内容物本体領域を抽出する「本体領域探索演算」を行う際の演算範囲であり、演算の際に、小さい異物83や、添付品82である脱酸素剤の突起部分82bの影響を除外するための設定データである。ここでは、正方形の画素集合を設定するものとする。例えば、「10」と入力すると、「10×10」と設定され、100個の正方形の画素集合(x方向×y方向:10個×10個)が設定される。   “Calculation range (S1)” sets the first search unit (S1). The first search unit (S1) is a range formed by a set of two-dimensional shapes of pixels. This is a calculation range when performing the “main body region search calculation” for extracting the sub-contents main body region using the binarized image B1 described above, and in the calculation, the small foreign matter 83 and the deoxygenation that is the accessory 82 This is setting data for excluding the influence of the protruding portion 82b of the agent. Here, a square pixel set is set. For example, if “10” is input, “10 × 10” is set, and 100 square pixel sets (x direction × y direction: 10 × 10) are set.

内容物レベル閾値(th)を用いた二値化演算と、第一探索ユニット(S1)を用いた本体領域探索演算の結果、添付品82である脱酸素剤(副内容物)の本体部分82a(正確には本体部分82aの周辺を除いた中央部分)を抽出した副内容物本体領域抽出画像B2が作成されることになる。   As a result of the binarization operation using the content level threshold (th) and the main body region search operation using the first search unit (S1), the main body portion 82a of the oxygen scavenger (sub-content) which is the attachment 82 The sub-contents main body region extraction image B2 in which (exactly the central portion excluding the periphery of the main body portion 82a) is extracted is created.

「拡大範囲 横(kx)、縦(ky)」は、第二探索ユニット(S2)を設定する。この第二探索ユニット(S2)は、上述した第一探索ユニット(S1)よりも大きな画素の二次元形状の集合で形成される範囲である。これは、副内容物本体領域抽出画像B2を用いて、添付品82全体(本体部分82aおよび突起部分82b)を覆った拡大副内容物領域(82’)を抽出した拡大副内容物領域抽出画像B3を求める「拡大副内容物領域探索演算」を行う際の演算範囲を設定する設定データである。ここでは拡大範囲を縦、横で個別に調整できるようにするため、2つの値を設定するものとする。例えば、「16」と「16」とを設定すると、「横×縦:16×16」と設定され、256個の画素集合が設定される。   “Enlarged range horizontal (kx), vertical (ky)” sets the second search unit (S2). The second search unit (S2) is a range formed by a set of two-dimensional shapes of pixels larger than the first search unit (S1) described above. This is an enlarged sub-content area extraction image obtained by extracting an enlarged sub-content area (82 ') that covers the entire attachment 82 (main body portion 82a and protrusion 82b) using the sub-content main area extraction image B2. This is setting data for setting a calculation range when performing “enlarged sub-content area search calculation” for obtaining B3. Here, two values are set so that the enlargement range can be individually adjusted vertically and horizontally. For example, when “16” and “16” are set, “horizontal × vertical: 16 × 16” is set, and 256 pixel sets are set.

「添付品範囲(S4)」は欠落判定閾値(S4)を設定する。欠落判定閾値(S4)は、画素の二次元集合からなり、被検査物7中の添付品82の有無を判定するための閾値であり、後述する「添付品モード」で、添付品82の有無を判定する演算に用いる閾値である。副内容物(大きさ:60×60)の大きさよりも、ひと回り小さな値、例えば「50×50」とされる。   “Attachment range (S4)” sets a missing determination threshold (S4). The missing determination threshold value (S4) is a threshold value for determining the presence / absence of the accessory 82 in the inspection object 7, which is a two-dimensional set of pixels. In the “attachment mode” described later, the presence / absence of the accessory 82 is determined. It is a threshold value used for the calculation which determines. A value slightly smaller than the size of the sub-contents (size: 60 × 60), for example, “50 × 50”.

「第一異物判定レベル値(th1)」は、拡大副内容物領域抽出画像B3上で、添付品82全体(本体部分82aおよび突起部分82b)を覆った拡大副内容物領域外に対して異物検査を行う(「検査モード1」という)ときの階調レベルの閾値であり、例えば、階調レベル「100」が設定される。これにより、後述する検査モード1で拡大副内容物領域外における異物83の有無の判定が行われる。   The “first foreign matter determination level value (th1)” is a foreign matter outside the enlarged subsidiary content area that covers the entire attachment 82 (main body portion 82a and protruding portion 82b) on the enlarged subsidiary content region extraction image B3. This is a threshold of the gradation level when performing inspection (referred to as “inspection mode 1”). For example, gradation level “100” is set. Thereby, the presence / absence of the foreign matter 83 outside the enlarged sub-content area is determined in the inspection mode 1 described later.

「第二異物判定レベル値(th2)」は、X線透視画像の全領域上で、異物検査を行う(「検査モード2」という)ときの階調レベルの閾値であり、例えば階調レベル「30」が設定される。これにより、後述する検査モード2で、全領域における異物83の有無の判定が行われ、特に内容物81に添付品82が重なった重なり領域についての異物83の有無の判定が行われる。   The “second foreign matter determination level value (th2)” is a gradation level threshold value when foreign matter inspection is performed on the entire region of the X-ray fluoroscopic image (referred to as “inspection mode 2”). 30 "is set. Thereby, in the inspection mode 2 described later, the presence / absence of the foreign matter 83 in the entire region is determined, and in particular, the presence / absence of the foreign matter 83 is determined in the overlapping region where the attachment 82 overlaps the contents 81.

「画素数範囲(MS3/S3)」は、第三探索ユニット(S3)と画素数閾値(MS3)とを設定する。
第三探索ユニットS3は、画素の二次元形状の集合で形成される範囲である。第三探索ユニット(S3)は、後述する「検査モード2」で異物領域を抽出するための演算において、画像に含まれる小さなノイズの影響を除外するために用いる演算範囲である。ここでは、「7×7」の正方形の画素集合(合計「49」)が設定されているものとする。また、この設定は固定値とする(設定可能にしてもよいが、画素数閾値(MS3)の設定で足りるため固定値としている)。
画素数閾値(MS3)は、第三探索ユニット(S3)に含まれる画素の全数(すなわち「49」)に対する個数として設定される閾値である。例えば画素数閾値を「20」と設定すると、第三探索ユニットが「49」と設定されている場合には、「20/49」が異物領域か否かの判定基準となる。後述する検査モード2で、異物83の有無を判定が行われるときに用いられる。
The “pixel number range (MS3 / S3)” sets a third search unit (S3) and a pixel number threshold (MS3).
The third search unit S3 is a range formed by a set of two-dimensional shapes of pixels. The third search unit (S3) is a calculation range used for excluding the influence of small noise included in the image in the calculation for extracting a foreign substance region in “examination mode 2” to be described later. Here, it is assumed that a square pixel set of “7 × 7” (total “49”) is set. In addition, this setting is a fixed value (it may be settable, but it is a fixed value because setting of the pixel number threshold (MS3) is sufficient).
The pixel number threshold value (MS3) is a threshold value set as the number with respect to the total number of pixels (that is, “49”) included in the third search unit (S3). For example, when the pixel number threshold is set to “20”, if the third search unit is set to “49”, “20/49” is a criterion for determining whether or not it is a foreign object region. This is used when the presence / absence of the foreign matter 83 is determined in inspection mode 2 to be described later.

次に、CPUの各機能ブロックについて説明する。
設定部31は、図5に示した入力用モニタ画面を用いて、上述した各種の設定データの初期設定値を表示するとともに、操作者に入力や変更を促し、最終的に設定されたデータを設定データ記憶領域41に記憶する制御を行う。
Next, each functional block of the CPU will be described.
The setting unit 31 uses the input monitor screen shown in FIG. 5 to display the initial setting values of the various setting data described above, and prompts the operator to input or change the final set data. Control to store in the setting data storage area 41 is performed.

X線透過像データ記憶制御部32は、X線検出器1からの信号(X線透過像データA)を取得して、取得した時間tとともに信号を検出信号記憶領域42に記憶する制御を行う。   The X-ray transmission image data storage control unit 32 performs control to acquire a signal (X-ray transmission image data A) from the X-ray detector 1 and store the signal in the detection signal storage area 42 along with the acquired time t. .

X線透過像データ表示部33は、X線透過像データAに基づいて、モニタ画面23aにX線透視画像img(x,y)の画像表示を行う制御を行う。なお、X線透過像データAは、ある瞬間の一次元的なデータであるので、X線透過像データAを時間軸に沿って並べることにより、被検査物7の二次元的なX線透視画像img(x,y)が得られる。このとき、被検査物7中に異物83が存在し、異物83のX線透過量が被検査物7自体のX線透過量と異なれば、X線透視画像img(x,y)に異物83が陰として表れることになる。
なお、X線透視画像img(x,y)において、2次元xy座標系が設定されるが、1画素(1ch)を順番に並べたものをx軸(0ch〜255ch)とし、時間軸がy軸方向とするように定義するようにしてある。y方向は被検査物の長さにより、変化するようにすればよいが、ここでは、説明の便宜上、y軸も(0ch〜255ch)であるとする。
Based on the X-ray transmission image data A, the X-ray transmission image data display unit 33 performs control to display the X-ray transmission image img (x, y) on the monitor screen 23a. Since the X-ray transmission image data A is one-dimensional data at a certain moment, the X-ray transmission image data A is arranged along the time axis so that the two-dimensional X-ray transmission of the inspection object 7 is performed. An image img (x, y) is obtained. At this time, if the foreign object 83 exists in the inspection object 7 and the X-ray transmission amount of the foreign object 83 is different from the X-ray transmission amount of the inspection object 7 itself, the foreign object 83 appears in the X-ray fluoroscopic image img (x, y). Will appear as a shade.
In the X-ray fluoroscopic image img (x, y), a two-dimensional xy coordinate system is set, but an arrangement of one pixel (1ch) in order is an x axis (0ch to 255ch), and a time axis is y. It is defined to be axial. The y direction may be changed according to the length of the object to be inspected, but here, for convenience of explanation, it is assumed that the y axis is also (0 ch to 255 ch).

搬送機構制御部34は、キーボード22aやマウス22bの種々の操作によって入力される入力信号を受信することによって、ベルトコンベア5を駆動する駆動信号を駆動機構に出力する制御を行う。   The transport mechanism control unit 34 performs control to output a drive signal for driving the belt conveyor 5 to the drive mechanism by receiving input signals input by various operations of the keyboard 22a and the mouse 22b.

二値化画像抽出部35は、X線透視画像img(x,y)に対し、内容物レベル閾値(th)に基づいて二値化した二値化画像B1(x,y)を作成する制御を行う。
具体的には、式(5)を用いてX線透視画像img(x,y)の各画素の二値化を行い、二値化画像B1(x,y)を抽出する。
The binarized image extraction unit 35 creates a binarized image B1 (x, y) that is binarized based on the content level threshold (th) for the fluoroscopic image img (x, y). I do.
Specifically, binarization of each pixel of the X-ray fluoroscopic image img (x, y) is performed using Expression (5), and a binarized image B1 (x, y) is extracted.

二値化画像B1(x,y)は、「1」の画素が階調レベル0(暗)で表示され、「0」の画素が階調レベル255(明)で表示されるものとする。   In the binarized image B1 (x, y), a pixel “1” is displayed at a gradation level 0 (dark), and a pixel “0” is displayed at a gradation level 255 (bright).

副内容物本体領域抽出部36は、二値化画像B1(x,y)において、一の画素P(x,y)を中心にして、画素P(x,y)を取り囲むように第一探索ユニット(S1)を設定し、画素P(x,y)を含む第一探索ユニット(S1)内の全画素の二値化データが「1」(すなわち階調レベル0(暗))であることを条件として、一の画素P(x,y)が副内容物の本体領域を構成する画素であると判定する本体領域探索演算を行う。   The sub-content main body region extraction unit 36 performs the first search so as to surround the pixel P (x, y) with the one pixel P (x, y) as the center in the binarized image B1 (x, y). The unit (S1) is set, and the binarized data of all the pixels in the first search unit (S1) including the pixel P (x, y) is “1” (that is, gradation level 0 (dark)). As a condition, a body region search calculation is performed to determine that one pixel P (x, y) is a pixel constituting the body region of the subsidiary content.

そして、二値化画像B1(x,y)上の全画素(あるいはX線透視画像img(x,y)上の全画素)に対して、本体領域探索演算を行うことにより、副内容物の本体領域を抽出した副内容物本体領域抽出画像B2(x,y)を作成する制御を行う。
具体的には、式(1)を用いて本体領域探索演算を行う。
Then, by performing a body region search operation on all pixels on the binarized image B1 (x, y) (or all pixels on the X-ray fluoroscopic image img (x, y)), Control is performed to create a sub-contents body region extraction image B2 (x, y) from which the body region is extracted.
Specifically, the body region search calculation is performed using equation (1).

作成された副内容物本体領域抽出画像B2(x,y)は、「1」の画素が階調レベル0(暗)で表示され、「0」の画素が階調レベル255(明)で表示されるものとする。
これにより、副内容物本体領域抽出画像B2(x,y)上において、添付品である副内容物の本体領域(添付品の中央部分)が黒く表示され、それ以外が白く表示される。
(なお、上述した二値化の演算から本体領域探索演算までの演算は、X線透視画像img(x,y)において、一の画素P(x,y)を中心にして、画素P(x,y)を取り囲むように第一探索ユニット(S1)を設定し、画素P(x,y)を含む第一探索ユニット(S1)内の全画素の階調データが内容物レベル閾値(th)以下であることを条件として画素P(x,y)を副内容物の本体領域を構成する画素と判定する本体領域探索演算を行うことと実質的に同じである。)
In the created sub-contents body region extraction image B2 (x, y), the “1” pixel is displayed at the gradation level 0 (dark), and the “0” pixel is displayed at the gradation level 255 (bright). Shall be.
As a result, on the subsidiary content body region extraction image B2 (x, y), the body region of the subsidiary content that is an accessory (the central portion of the accessory) is displayed in black, and the others are displayed in white.
(It should be noted that the operations from the binarization calculation to the main body region search calculation described above are performed with the pixel P (x, x) centered on one pixel P (x, y) in the X-ray fluoroscopic image img (x, y). , Y) is set to surround the first search unit (S1), and the gradation data of all the pixels in the first search unit (S1) including the pixel P (x, y) is the content level threshold (th). (This is substantially the same as performing a body region search operation for determining the pixel P (x, y) as a pixel constituting the body region of the subsidiary contents on condition that

拡大副内容物領域袖出部37は、副内容物本体領域抽出画像B2(x,y)において、一の画素Q(x,y)を中心にして、画素Q(x,y)を取り囲むように第二探索ユニット(S2)を設定し、画素Q(x,y)を含む第二探索ユニット(S2)内の全画素の二値化データのうち、いずれか1つが「1」(すなわち階調レベル0(暗))であることを条件として、一の画素Q(x,y)が拡大副内容物領域を構成する画素であると判定する拡大副内容物領域探索演算を行う。   The enlarged sub-content area crest portion 37 surrounds the pixel Q (x, y) around the one pixel Q (x, y) in the sub-content body area extraction image B2 (x, y). Is set to the second search unit (S2), and any one of the binarized data of all the pixels in the second search unit (S2) including the pixel Q (x, y) is “1” (that is, the floor). On the condition that the tone level is 0 (dark)), an enlarged sub-content area search operation for determining that one pixel Q (x, y) is a pixel constituting the enlarged sub-content area is performed.

そして、副内容物本体領域抽出画像B2(x,y)上の全画素に対して、拡大副内容物領域探索演算を行うことにより、拡大副内容物領域を抽出した拡大副内容物領域抽出画像B3(x,y)を作成する。
具体的には、式(2)を用いて本体領域探索演算を行う。
Then, an enlarged sub-content area extraction image obtained by extracting an enlarged sub-content area by performing an enlarged sub-content area search operation on all the pixels on the sub-content main body area extraction image B2 (x, y). B3 (x, y) is created.
Specifically, the body region search calculation is performed using equation (2).

作成された拡大副内容物領域抽出画像B3(x,y)は、「1」の画素が階調レベル0(暗)で表示され、「0」の画素が階調レベル255(明)で表示されるものとする。
これにより、拡大副内容物領域抽出画像B3(x,y)上において、添付品である副内容物の本体部分(添付品の中央部分)および副内容物の突起部分や副内容物の周辺部分も含めた拡大副内容物領域が黒く表示され、それ以外が白く表示され、副内容物の領域全体を覆うように黒い部分(マスク領域)が形成される。
In the created enlarged sub-content region extraction image B3 (x, y), the “1” pixel is displayed at the gradation level 0 (dark), and the “0” pixel is displayed at the gradation level 255 (bright). Shall be.
As a result, on the enlarged sub-content area extraction image B3 (x, y), the main body portion (the center portion of the accessory) of the sub-content that is an accessory, the protruding portion of the sub-content, and the peripheral portion of the sub-content The enlarged sub-content area including the sub-contents is displayed in black, and other areas are displayed in white, and a black portion (mask area) is formed so as to cover the entire sub-content area.

拡大副内容物領域外異物検査部38は、拡大副内容物領域抽出画像B3(x,y)の拡大副内容物領域(すなわちマスク領域)以外の領域に対応するX線透視画像img(x,y)の各画素を第一検査範囲として、第一検査範囲に含まれる各画素の階調データを第一異物判定レベル値(th1)に基づいて判定することにより、異物の有無を判定する制御を行う。
具体的には、式(3)を用いて、異物の有無の判定を行う。
The enlarged sub-content area non-foreign particle inspection unit 38 includes an X-ray fluoroscopic image img (x, x, y) corresponding to an area other than the enlarged sub-content area (ie, mask area) of the enlarged sub-content area extraction image B3 (x, y). Control for determining the presence / absence of a foreign object by determining each pixel of y) as the first inspection range and determining the gradation data of each pixel included in the first inspection range based on the first foreign object determination level value (th1). I do.
Specifically, the presence / absence of a foreign substance is determined using Expression (3).

全体領域異物検査部39は、X線透視画像img(x,y)において、一の画素R(x,y)に対し、画素R(x,y)を取り囲むように第三探索ユニット(S3)を設定し、画素Rを含む第三探索ユニット(S3)内の各画素の階調データと第二異物判定レベル値(th2)との比較により抽出した画素の数と画素数閾値(NS3)とに基づいて、画素R(x,y)が異物を構成する画素であるか否かを判定する異物領域探索演算を行う。そしてX線透視画像img(x,y)の全画素を第二検査範囲として、第二検査範囲の各画素について異物領域探索演算を行うことにより異物の有無を判定する制御を行う。
具体的には、式(4)を用いて、異物の有無の判定を行う。
The whole area foreign matter inspection unit 39 includes a third search unit (S3) so as to surround the pixel R (x, y) with respect to one pixel R (x, y) in the fluoroscopic image img (x, y). And the number of pixels extracted by comparing the gradation data of each pixel in the third search unit (S3) including the pixel R with the second foreign substance determination level value (th2) and the pixel number threshold (NS3), Based on the above, a foreign substance region search calculation is performed to determine whether or not the pixel R (x, y) is a pixel constituting the foreign substance. Then, control is performed to determine the presence / absence of a foreign object by performing a foreign object region search operation for each pixel in the second inspection range, with all pixels of the X-ray fluoroscopic image img (x, y) as the second inspection range.
Specifically, the presence / absence of a foreign substance is determined using Expression (4).

副内容物欠落検査部40は、副内容物本体領域抽出画像B2(x,y)に映る副内容物の本体領域と欠落判定閾値(S4)とを比較することにより、その本体領域が欠落判定閾値(S4)より小さな領域であるとき、あるいは本体領域がないときに、被検査物中に副内容物が欠落していると判定する制御を行う。また、欠落判定閾値(S4)より大きな領域が複数存在するときに、副内容物が余分に含まれていると判定する制御を行う。     The subsidiary content missing inspection unit 40 compares the body content of the subsidiary content shown in the subsidiary content body region extracted image B2 (x, y) with the missing determination threshold (S4), thereby determining that the body region is missing. When the area is smaller than the threshold (S4), or when there is no main body area, control is performed to determine that the sub-contents are missing in the inspection object. In addition, when there are a plurality of areas larger than the missing determination threshold (S4), control is performed to determine that the subsidiary contents are included in excess.

(異物検査の動作手順)
次に、X線異物検査装置80による異物検査の動作手順について説明する。最初に異物検査の大きな流れについて説明する。図7は動作手順全体の流れを説明するフローチャートである。また、図8は、検査途中で作成される画像の模式図である。
(Operation procedure for foreign matter inspection)
Next, an operation procedure of foreign matter inspection by the X-ray foreign matter inspection apparatus 80 will be described. First, a large flow of foreign object inspection will be described. FIG. 7 is a flowchart for explaining the flow of the entire operation procedure. FIG. 8 is a schematic diagram of an image created during the inspection.

最初に、s10の処理において、X線透視画像img(x,y)を作成する(図8(a))。
次に、s11の処理において、X線透視画像img(x,y)に基づいて、式(5)により、二値化画像B1(x,y)を作成する(図8(b))。
次に、s12の処理において、二値化画像B1(x,y)に基づいて、式(1)により、副内容物本体領域抽出画像B2(x,y)を作成する(図8(c))。
次に、s13の処理において、内容物本体領域抽出画像B2(x,y)に基づいて、式(2)により拡大副内容物領域抽出画像B3(x,y)を作成する(図8(d))。
次に、s14において、拡大副内容物領域抽出画像B3(x,y)に基づいて、式(3)により、拡大副内容物領域外の異物検査(検査モード1)を行う。
次に、s15において、X線透視画像img(x,y)に基づいて、式(4)により、全体領域の異物検査を行う。ここでは、特にs14では検査していない副内容物領域の異物検査(検査モード2)を行う。
次に、s16において、副内容物本体領域抽出画像B2(x,y)に基づいて、副内容物の欠落の検査を行う。
First, in the process of s10, an X-ray fluoroscopic image img (x, y) is created (FIG. 8A).
Next, in the process of s11, based on the X-ray fluoroscopic image img (x, y), a binarized image B1 (x, y) is created by Expression (5) (FIG. 8B).
Next, in the process of s12, the sub-contents main body region extraction image B2 (x, y) is created by Expression (1) based on the binarized image B1 (x, y) (FIG. 8C). ).
Next, in the process of s13, based on the content main body region extraction image B2 (x, y), an enlarged sub-content region extraction image B3 (x, y) is created by Expression (2) (FIG. 8D )).
Next, in s14, based on the enlarged sub-content area extraction image B3 (x, y), a foreign object inspection (inspection mode 1) outside the enlarged sub-content area is performed by Expression (3).
Next, in s15, the foreign substance inspection of the entire region is performed by Expression (4) based on the X-ray fluoroscopic image img (x, y). Here, the foreign matter inspection (inspection mode 2) of the sub-content area not inspected in s14 is performed.
Next, in s16, based on the sub-contents main body region extraction image B2 (x, y), an inspection for sub-contents is performed.

以上が、基本的な流れであるが、検査モード選択(図示しないモード設定ボタンの操作)を行うことにより、検査モード1のみを単独で実施したり、検査モード2、あるいは副内容物の欠落検査のみを単独で実施したりするようにしてもよい。   The above is the basic flow. By selecting the inspection mode (operation of a mode setting button (not shown)), only inspection mode 1 can be carried out alone, inspection mode 2 or sub-content missing inspection Or may be performed alone.

次に、具体的な動作手順について説明する。図9〜図14はX線透視画像の作成から異物検査を終了するまでの具体的な動作フローを示す図である。   Next, a specific operation procedure will be described. 9 to 14 are diagrams showing a specific operation flow from the creation of the fluoroscopic image to the end of the foreign substance inspection.

まず、ステップS101の処理において、操作者のキーボード22aやマウス22bの種々の操作によって検査開始信号が入力される。
次に、ステップS102の処理において、X線検出器3からの信号(X線透過像データA)を取得して、取得した時間tとともに、被検査物7のX線透視画像を作成するために必要な所定時間間隔分(例えば、被検査物7の長さ分)を検出信号記憶領域42に記憶する。そして記憶した信号(X線透過像データA)をy方向に沿って時系列的に並べることにより、X線透視画像img(x,y)を作成する。
First, in the process of step S101, a test start signal is input by various operations of the operator's keyboard 22a and mouse 22b.
Next, in step S102, in order to acquire a signal (X-ray transmission image data A) from the X-ray detector 3 and create an X-ray fluoroscopic image of the inspection object 7 along with the acquired time t. The necessary predetermined time interval (for example, the length of the inspection object 7) is stored in the detection signal storage area 42. Then, the stored signals (X-ray transmission image data A) are arranged in time series along the y direction to create an X-ray fluoroscopic image img (x, y).

次に、X線透視画像img(x,y)を二値化した二値化画像B1(x,y)を作成するため、ステップS103の処理において、一の画素P(x、y)を検査点Pとし、この検査点Pの位置パラメータの初期値としてx=0、y=0と設定する。
次に、ステップS104の処理において、X線透視画像img(x,y)において、検査点P(最初は座標(0,0)の画素が検査点P)が内容物レベル閾値(th)(階調レベル50が設定済み)以上であるか否かを判定する。
内容物レベル閾値(th)未満であると判定した場合には、ステップS105の処理に進むことにより、検査点P(x,y)の二値化画像B1(x、y)の値を「1」とする。
一方、内容物レベル閾値(th)以上であると判定した場合には、ステップS106の処理に進むことにより、検査点P(x,y)の二値化画像B1(x,y)の値を「0」とする。
Next, in order to create a binarized image B1 (x, y) obtained by binarizing the fluoroscopic image img (x, y), one pixel P (x, y) is inspected in the process of step S103. A point P is set, and x = 0 and y = 0 are set as initial values of the position parameter of the inspection point P.
Next, in the process of step S104, in the X-ray fluoroscopic image img (x, y), the inspection point P (initially, the pixel at the coordinates (0, 0) is the inspection point P) is the content level threshold (th) (floor It is determined whether or not the key level 50 is already set) or higher.
If it is determined that the content level threshold value (th) is less than the threshold value (th), the process proceeds to step S105 to set the value of the binarized image B1 (x, y) at the inspection point P (x, y) to “1”. "
On the other hand, if it is determined that the content level threshold value (th) is equal to or greater than the threshold value (th), the process proceeds to step S106 to obtain the value of the binarized image B1 (x, y) at the inspection point P (x, y). “0”.

次に、ステップS107の処理において、x=255(x方向の最後の画素の座標)であるか否かを判定する。x=255でないと判定した場合には、ステップS108の処理に進むことにより、x=x+1と記憶され、さらにステップS104の処理に戻る。つまり、x=255であると判定するときまで、ステップS104〜S107の処理は繰り返し実行される。
一方、x=255であると判定した場合には、ステップS109の処理において、y=255(y方向の最後の画素の座標)であるか否かを判定する。y=255でないと判定した場合には、ステップS110の処理に進むことにより、y=y+1と記憶され、さらにステップS104の処理に戻る。つまり、y=255であると判定するときまで、ステップS104〜S109の処理は繰り返し実行される。
すべての検査点Pでの処理が実行されると、二値化画像B1(x,y)のすべての画素の値(「1」または「0」)が定まることになり、二値化画像B1(x,y)が完成する。
Next, in step S107, it is determined whether x = 255 (the coordinate of the last pixel in the x direction). If it is determined that x is not 255, the process proceeds to step S108, where x = x + 1 is stored, and the process returns to step S104. That is, the processing of steps S104 to S107 is repeatedly executed until it is determined that x = 255.
On the other hand, if it is determined that x = 255, it is determined in the process of step S109 whether y = 255 (the coordinates of the last pixel in the y direction). If it is determined that y is not 255, the process proceeds to step S110 to store y = y + 1, and the process returns to step S104. That is, the processes in steps S104 to S109 are repeatedly executed until it is determined that y = 255.
When the processing at all inspection points P is executed, the values (“1” or “0”) of all the pixels of the binarized image B1 (x, y) are determined, and the binarized image B1. (X, y) is completed.

そして、y=255であると判定した場合には、副内容物の本体領域を探索する「本体領域探索演算」を実行するため、ステップS111の処理において、検査点Pの位置パラメータの初期値としてx=0、y=0を記憶する。   If it is determined that y = 255, the “main body region search calculation” for searching the main body region of the sub-contents is executed. Therefore, in the process of step S111, as the initial value of the position parameter of the inspection point P Store x = 0, y = 0.

次に、ステップS112の処理において、式(1)により、二値化画像B1(x,y)における検査点P(x+i,y+j)(i=0,j=0)を中心とした10×10の正方形の第一探索ユニット(S1)、すなわち演算範囲(i=−5〜4,j=−5〜4)で、全ての値が「1」であるか否かを判定する。
全ての値が「1」であると判定した場合には、ステップS113の処理に進むことにより、副内容物本体領域抽出画像B2(x,y)における検査点P(x,y)で値を「1」(副内容物本体領域の画素が検査点であることを示す)とする。
一方、ある値が「0」であると判定した場合には、ステップS114の処理に進むことにより、副内容物本体領域抽出画像B2(x,y)における検査点P(x,y)で値を「0」(副内容物本体領域外の画素が検査点であることを示す)とする。
Next, in the processing of step S112, 10 is centered on the inspection point P (x + i, y + j) (i = 0, j = 0) in the binarized image B1 (x, y) according to the equation (1). It is determined whether or not all the values are “1” in the first search unit (S1) of × 10 square, that is, the calculation range (i = −5 to 4, j = −5 to 4).
If it is determined that all the values are “1”, the process proceeds to the process of step S113, and the value is determined at the inspection point P (x, y) in the sub-contents body region extraction image B2 (x, y). “1” (indicating that the pixel in the sub-content body area is an inspection point).
On the other hand, if it is determined that a certain value is “0”, the process proceeds to the process of step S114, whereby a value is obtained at the inspection point P (x, y) in the sub-contents body region extracted image B2 (x, y). Is “0” (indicating that a pixel outside the sub-contents main body area is an inspection point).

次に、ステップS115の処理において、x=255であるか否かを判定する。x=255でないと判定した場合には、ステップS116の処理に進むことにより、x=x+1と記憶され、さらにステップS112の処理に戻る。つまり、x=255であると判定するときまで、ステップS112〜S115の処理は繰り返し実行される。
一方、x=255であると判定した場合には、ステップS117の処理において、y=255であるか否かを判定する。y=255でないと判定した場合には、ステップS118の処理に進むことにより、y=y+1と記憶され、さらにステップS112の処理に戻る。つまり、y=255であると判定するときまで、ステップS112〜S117の処理は繰り返し実行される。
すべての検査点の処理が実行されると、副内容物本体領域抽出画像B2(x,y)のすべての画素の値(「1」または「0」)が定まることになり、副内容物本体領域抽出画像B2(x,y)が完成する。
Next, in the process of step S115, it is determined whether x = 255. If it is determined that x is not 255, the process proceeds to step S116, where x = x + 1 is stored, and the process returns to step S112. That is, the processes in steps S112 to S115 are repeatedly executed until it is determined that x = 255.
On the other hand, if it is determined that x = 255, it is determined in the process of step S117 whether y = 255. If it is determined that y is not 255, the process proceeds to step S118, whereby y = y + 1 is stored, and the process returns to step S112. That is, the processes in steps S112 to S117 are repeatedly executed until it is determined that y = 255.
When the processing of all the inspection points is executed, the values (“1” or “0”) of all the pixels of the sub-contents main body region extraction image B2 (x, y) are determined. The region extraction image B2 (x, y) is completed.

一方、y=255であると判定した場合には、拡大副内容物領域を探索する「拡大副内容物領域探索演算」を実行するため、ステップS119の処理において、検査点Qの位置パラメータの初期値としてx=0、y=0を記憶する。   On the other hand, if it is determined that y = 255, an “expanded sub-content area search operation” for searching for an expanded sub-content area is executed, so that in the process of step S119, the initial position parameter of the inspection point Q is initialized. As a value, x = 0 and y = 0 are stored.

次に、ステップS120の処理において、式(2)により、拡大副内容物領域抽出画像B3(x,y)における検査点Q(x+i,t+j)(i=0,j=0)を中心とした第二探索ユニット(S2)、すなわち拡大範囲kx、kt(i=−8〜7,j=−8〜7)で、いずれかひとつの値が「1」であるか否かを判定する。
いずれかひとつの値が「1」であると判定した場合には、ステップS121の処理に進むことにより、拡大副内容物領域抽出画像B3(x,y)における検査点Q(x,y)で値を「1」(拡大副内容物領域82’の画素が検査点であることを示す)とする。
一方、全ての値が「0」であると判定した場合には、ステップS122の処理に進むことにより、拡大副内容物領域抽出画像B3(x,y)における検査点Q(x,y)で値を「0」(拡大副内容物領域82’以外の画素が検査点であることを示す)とする。
Next, in the process of step S120, the center of the inspection point Q (x + i, t + j) (i = 0, j = 0) in the enlarged sub-content area extraction image B3 (x, y) is obtained by the equation (2). It is determined whether any one value is “1” in the second search unit (S2), that is, the expansion ranges kx and kt (i = −8 to 7, j = −8 to 7). .
If it is determined that any one of the values is “1”, the process proceeds to step S121 so that the inspection point Q (x, y) in the enlarged sub-content area extracted image B3 (x, y) is obtained. The value is “1” (indicating that the pixel in the enlarged sub-content region 82 ′ is an inspection point).
On the other hand, if it is determined that all the values are “0”, the process proceeds to step S122, so that the inspection point Q (x, y) in the enlarged sub-content area extraction image B3 (x, y) is obtained. The value is “0” (indicating that pixels other than the enlarged sub-content region 82 ′ are inspection points).

次に、ステップS123の処理において、x=255であるか否かを判定する。x=255でないと判定した場合には、ステップS124の処理に進むことにより、x=x+1と記憶され、さらにステップS120の処理に戻る。つまり、x=255であると判定するときまで、ステップS120〜S123の処理は繰り返し実行される。
次に、x=255であると判定した場合には、ステップS125の処理において、y=255であるか否かを判定する。y=255でないと判定した場合には、ステップS126の処理に進むことにより、y=y+1と記憶され、さらにステップS120の処理に戻る。つまり、y=255であると判定するときまで、ステップS120〜S125の処理は繰り返し実行される。
すべての検査点の処理が実行されると、拡大副内容物領域抽出画像B3(x,y)のすべての画素の値(「1」または「0」)が定まることになり、拡大副内容物領域抽出画像B3(x,y)が完成する。
る。
Next, in the process of step S123, it is determined whether x = 255. If it is determined that x is not 255, the process proceeds to step S124 so that x = x + 1 is stored, and the process returns to step S120. That is, the processes of steps S120 to S123 are repeatedly executed until it is determined that x = 255.
Next, when it is determined that x = 255, it is determined whether or not y = 255 in the process of step S125. If it is determined that y is not 255, the process proceeds to step S126 so that y = y + 1 is stored, and the process returns to step S120. That is, the processes of steps S120 to S125 are repeatedly executed until it is determined that y = 255.
When the processing of all inspection points is executed, the values (“1” or “0”) of all the pixels of the enlarged sub-content area extraction image B3 (x, y) are determined, and the enlarged sub-contents are determined. The region extraction image B3 (x, y) is completed.
The

y=255であると判定した場合には、異物判定を開始する。すなわち、ステップS127の処理において、「検査モード1」が実行される。なお、検査モード1の詳細については後述するが、拡大副内容物領域以外の画素に対して、被検査物7中の異物83の有無が判定されることになる。   If it is determined that y = 255, the foreign object determination is started. That is, in the process of step S127, “inspection mode 1” is executed. Although details of the inspection mode 1 will be described later, the presence / absence of the foreign matter 83 in the inspection object 7 is determined for pixels other than the enlarged sub-content area.

次に、ステップS128の処理において、「検査モード2」が実行される。なお、検査モード2の詳細についても後述するが、拡大副内容物領域を含む全領域について、被検査物7中の異物83の有無が判定されることになる。   Next, in the process of step S128, “inspection mode 2” is executed. Although details of the inspection mode 2 will be described later, the presence / absence of the foreign matter 83 in the inspection object 7 is determined for all areas including the enlarged sub-content area.

次に、ステップS129の処理において、「添付品モード」が実行される。なお、添付品モードの詳細についても後述するが、被検査物7中の添付品82の有無が判定されることになる。   Next, in the process of step S129, the “attachment mode” is executed. Although details of the accessory mode will be described later, the presence / absence of the accessory 82 in the inspection object 7 is determined.

次に、ステップS130の処理において、操作者のキーボード22aやマウス22bの種々の操作によって検査終了信号が入力されたか否か判定する。
検査終了信号が入力されてない場合には、さらにステップS102の処理に戻る。
一方、検査終了信号が入力された場合には、本フローチャートを終了させることになる。
Next, in the process of step S130, it is determined whether or not an examination end signal has been input by various operations of the operator's keyboard 22a and mouse 22b.
If the inspection end signal has not been input, the process returns to step S102.
On the other hand, when the inspection end signal is input, this flowchart is ended.

次に、「検査モード1」の処理(s127)について説明する。図12は、検査モード1を説明するフローチャートである。
ここでは、拡大副内容物領域抽出画像B3(x,y)、X線透視画像img(x,y)、第一異物判定レベル値(th1)(階調レベル100)に基づいて、式(3)の演算を行い、被検査物7中の異物83の有無を判定する。
Next, the “inspection mode 1” process (s127) will be described. FIG. 12 is a flowchart for explaining the inspection mode 1.
Here, based on the enlarged sub-content region extraction image B3 (x, y), the fluoroscopic image img (x, y), and the first foreign object determination level value (th1) (tone level 100), the expression (3 ) To determine the presence or absence of the foreign matter 83 in the inspection object 7.

まず、ステップS201の処理において、検査点R(x,y)の位置パラメータの初期値としてx=0、y=0を記憶する。     First, in the process of step S201, x = 0 and y = 0 are stored as initial values of the position parameter of the inspection point R (x, y).

次に、ステップS202の処理において、検査点R(x,y)が拡大副内容物領域内か拡大副内容物領域外かを調べるため、検査点R(x,y)における拡大副内容物領域抽出画像B3(x,y)の値を判定する。
検査点R(x,y)の値が「1」であると判定した場合には、ステップS205の処理に進むことにより、M1(式(3)参照)の値に「+0」を加算する。
一方、検査点R(x,y)の値が「0」であると判定した場合には、ステップS203の処理に進み、検査点R(x,y)におけるX線透視画像img(x,y)の階調データが、第一異物判定レベル値(th1)以下であるか否かを判定する。
第一異物判定レベル値(th1)を超えていると判定した場合には、ステップS205の処理に進むことにより、M1の値に「+0」を加算する。
一方、第一異物判定レベル値(th1)以下であると判定した場合には、ステップS204の処理に進むことにより、M1の値に「+1」を加算する。
Next, in the process of step S202, in order to check whether the inspection point R (x, y) is inside the enlarged sub-contents region or outside the enlarged sub-contents region, the enlarged sub-contents region at the inspection point R (x, y) The value of the extracted image B3 (x, y) is determined.
If it is determined that the value of the inspection point R (x, y) is “1”, the process proceeds to step S205 to add “+0” to the value of M1 (see Expression (3)).
On the other hand, if it is determined that the value of the inspection point R (x, y) is “0”, the process proceeds to step S203, and the fluoroscopic image img (x, y) at the inspection point R (x, y). ) Gradation data is less than or equal to the first foreign matter determination level value (th1).
If it is determined that the first foreign matter determination level value (th1) has been exceeded, the process proceeds to step S205 to add “+0” to the value of M1.
On the other hand, if it is determined that the value is equal to or less than the first foreign substance determination level value (th1), the process proceeds to step S204 to add “+1” to the value of M1.

次に、ステップS206の処理において、x=255であるか否かを判定する。x=255でないと判定した場合には、ステップS207の処理に進むことにより、x=x+1と記憶され、さらにステップS202の処理に戻る。つまり、x=255であると判定するときまで、ステップS202〜S206の処理は繰り返し実行される。
一方、x=255であると判定した場合には、ステップS208の処理において、y=255であるか否かを判定する。y=255でないと判定した場合には、ステップS209の処理に進むことにより、y=y+1と記憶され、さらにステップS202の処理に戻る。つまり、y=255であると判定するときまで、ステップS202〜S208の処理は繰り返し実行される。
y=255であると判定した場合には、本フローチャートを終了させることになる。
Next, in step S206, it is determined whether x = 255. If it is determined that x is not 255, the process proceeds to step S207, where x = x + 1 is stored, and the process returns to step S202. That is, the processes in steps S202 to S206 are repeatedly executed until it is determined that x = 255.
On the other hand, if it is determined that x = 255, it is determined whether y = 255 in the process of step S208. If it is determined that y is not 255, the process proceeds to step S209 to store y = y + 1, and the process returns to step S202. That is, the processes in steps S202 to S208 are repeatedly executed until it is determined that y = 255.
If it is determined that y = 255, this flowchart is terminated.

次に、「検査モード2」の処理(s128)について説明する。図13は、検査モード2を説明するフローチャートである。
ここでは、X線透視画像img(x,y)、第二異物判定レベル値(th1)(階調レベル30)、画素数範囲(画素数閾値(MS3)/第三探索ユニット(S3)=20/49)に基づいて、式(4)の演算を行い、被検査物7中の異物83の有無を判定する。
Next, the “inspection mode 2” process (s128) will be described. FIG. 13 is a flowchart for explaining the inspection mode 2.
Here, the fluoroscopic image img (x, y), the second foreign substance determination level value (th1) (gradation level 30), the pixel number range (pixel number threshold (MS3) / third search unit (S3) = 20 / 49), the calculation of the equation (4) is performed to determine the presence or absence of the foreign matter 83 in the inspection object 7.

まず、ステップS301の処理において、検査点R(x,y)の位置パラメータの初期値としてx=0、y=0を記憶する。
次に、ステップS302の処理において、X線透視画像img(x,y)における検査点R(x+i,y+j)(i=0,j=0)を中心とした49(7×7)の画素からなる第三探索ユニット(S3)、すなわち演算範囲(i=−3〜3,j=−3〜3)の各画素のうち階調データが第二異物判定レベル値(th2)以下である画素の数が画素数閾値(MS3)である「20」以上であるか否かを判定する。
第二判定レベル値(th2)以下である個数が画素数閾値(MS3)個以上であると判定した場合には、ステップS303の処理に進むことにより、M2(式(4)参照)の値に「+1」を加算する。
一方、第二判定レベル値(th2)以下である個数が画素数閾値(MS3)未満であると判定した場合には、ステップS304の処理に進むことにより、M2の値に「+0」を加算する。
First, in the process of step S301, x = 0 and y = 0 are stored as initial values of the position parameter of the inspection point R (x, y).
Next, in the process of step S302, 49 (7 × 7) centered on the inspection point R (x + i, y + j) (i = 0, j = 0) in the fluoroscopic image img (x, y). In the third search unit (S3) composed of pixels, that is, among the pixels in the calculation range (i = -3 to 3, j = -3 to 3), the gradation data is equal to or less than the second foreign substance determination level value (th2). It is determined whether or not the number of pixels is equal to or greater than “20”, which is a pixel number threshold (MS3).
If it is determined that the number equal to or less than the second determination level value (th2) is equal to or greater than the pixel number threshold (MS3), the process proceeds to step S303, and the value of M2 (see Expression (4)) is obtained. Add "+1".
On the other hand, when it is determined that the number equal to or smaller than the second determination level value (th2) is less than the pixel number threshold (MS3), the process proceeds to step S304, and “+0” is added to the value of M2. .

次に、ステップS305の処理において、x=255であるか否かを判定する。x=255でないと判定した場合には、ステップS306の処理に進むことにより、x=x+1と記憶され、さらにステップS302の処理に戻る。つまり、x=255であると判定するときまで、ステップS302〜S305の処理は繰り返し実行される。
一方、x=255であると判定した場合には、ステップS307の処理において、y=255であるか否かを判定する。y=255でないと判定した場合には、ステップS308の処理に進むことにより、y=y+1と記憶され、さらにステップS302の処理に戻る。つまり、y=255であると判定するときまで、ステップS302〜S307の処理は繰り返し実行される。
y=255であると判定した場合には、検査モード2による異物検査を終えるが、続いて、検査モード1と検査モード2とを含めた総合判定を行う。
Next, in the process of step S305, it is determined whether x = 255. If it is determined that x is not 255, the process proceeds to step S306, where x = x + 1 is stored, and the process returns to step S302. That is, the processes in steps S302 to S305 are repeatedly executed until it is determined that x = 255.
On the other hand, if it is determined that x = 255, it is determined whether y = 255 in the process of step S307. If it is determined that y is not 255, the process proceeds to step S308 to store y = y + 1, and the process returns to step S302. That is, the processes in steps S302 to S307 are repeatedly executed until it is determined that y = 255.
When it is determined that y = 255, the foreign object inspection in the inspection mode 2 is completed, and then comprehensive determination including the inspection mode 1 and the inspection mode 2 is performed.

すなわち、ステップS309の処理において、M1+M2=0であるか否かを判定する。
M1+M2=0であると判定した場合には、ステップS310の処理に進むことにより、被検査物7中に異物が存在しないと判定する。
一方、M1+M2=0でないと判定した場合には、ステップS311の処理に進むことにより、被検査物7中に異物が存在すると判定する。
次に、ステップS310又はS311の処理が終了した場合には、本フローチャートを終了させることになる。
That is, in the process of step S309, it is determined whether M1 + M2 = 0.
If it is determined that M1 + M2 = 0, the process proceeds to step S310 to determine that there is no foreign object in the inspection object 7.
On the other hand, if it is determined that M1 + M2 = 0 is not satisfied, the process proceeds to step S311 to determine that there is a foreign object in the inspection object 7.
Next, when the process of step S310 or S311 is completed, this flowchart is ended.

次に、「添付品モード」の処理(s129)について説明する。図14は、添付品モードを説明するフローチャートである。
ここでは、副内容物本体領域抽出画像B2(x,y)、添付品範囲(S4)(50×50)に基づいて演算を行い、被検査物7中に添付品(副内容物)(60×60)が欠落していないかを判定する。
Next, the “attachment mode” process (s129) will be described. FIG. 14 is a flowchart for explaining the accessory mode.
Here, calculation is performed based on the sub-contents main body region extraction image B2 (x, y) and the accessory range (S4) (50 × 50), and the accessory (sub-content) (60 It is determined whether or not x60) is missing.

まず、ステップS401の処理において、添付品判定部39は、副内容物本体領域抽出画像B2(x,y)上で副内容物本体領域と判定された領域(B2(x,y)が「1」の領域)の範囲が、添付品範囲(S4)、すなわち欠落判定閾値(S4)以上であるか否かを判定する。
添付品範囲(S4)以上であると判定した場合には、ステップS402の処理に進むことにより、被検査物7中に添付品82が存在すると判定する。
一方、添付品範囲(S3)未満であると判定した場合には、ステップS403の処理に進むことにより、被検査物7中に添付品82が存在しないと判定する。
次に、ステップS402又はS403の処理が終了した場合には、本フローチャートを終了させる。
First, in the process of step S401, the attachment determination unit 39 sets the area (B2 (x, y)) determined as the sub-content body area on the sub-content body area extraction image B2 (x, y) to “1”. It is determined whether the range of “)” is equal to or greater than the accessory range (S4), that is, the missing determination threshold (S4).
If it is determined that the size is greater than or equal to the attachment range (S4), the process proceeds to step S402 to determine that the attachment 82 exists in the inspection object 7.
On the other hand, when it is determined that it is less than the accessory range (S3), it is determined that the accessory 82 does not exist in the inspection object 7 by proceeding to the process of step S403.
Next, when the process of step S402 or S403 is completed, this flowchart is ended.

以上のように、X線異物検査装置80によれば、X線透視画像img(x,y)において、被検査体7中の添付品82(副内容物)に対応する領域を拡大した拡大副内容物領域82’(マスク領域)と、拡大副内容物領域外とを分割するようにし、拡大副内容物領域外については階調レベルが大きい第一判定レベル値(th1)(すなわち明るい階調レベル)を基準として異物83の有無を判定するので、被検査体7中の添付品82の位置に拘らず、添付品82を誤って異物83と判定するエラーを生じることなく、しかも精度よく被検査物7中の異物83を検出することができる。
このとき、実際の副内容物よりも拡大された拡大副内容物領域82’をマスク領域としているため、例えば、脱酸素剤が添付品であるときに脱酸素剤中の酸化鉄粉末の一部が他の酸化鉄粉末から突出した突起形状に分布されているような場合であっても、被検査体7中の添付品82の全体を、確実に検査対象から除外することができる。
また、異物83と重なる位置に存在する添付品82と、それ以外の添付品82とは、階調データ(すなわちX線透過量)が異なるので、第二判定レベル値(th2)に基づいて、被検査物7中の添付品82と重なった異物83の有無を判定することができる。
さらに、被検査体7中の添付品82の位置に拘らず、添付品82の欠落を判定することができる。
As described above, according to the X-ray foreign substance inspection apparatus 80, the enlarged sub-area in which the region corresponding to the attachment 82 (sub-contents) in the inspection object 7 is enlarged in the X-ray fluoroscopic image img (x, y). The content area 82 ′ (mask area) and the outside of the enlarged sub-content area are divided, and the first determination level value (th1) (ie, bright gradation) having a large gradation level outside the enlarged sub-content area. Level) as a reference, the presence or absence of the foreign object 83 is determined, so that an error for erroneously determining the accessory 82 as the foreign object 83 does not occur regardless of the position of the accessory 82 in the inspection object 7, and the object is accurately covered. The foreign object 83 in the inspection object 7 can be detected.
At this time, since the enlarged sub-content region 82 ′ enlarged from the actual sub-content is used as a mask region, for example, when the oxygen scavenger is an accessory, part of the iron oxide powder in the oxygen scavenger Even in the case where is distributed in the shape of protrusions protruding from other iron oxide powders, the entire attachment 82 in the inspection object 7 can be surely excluded from the inspection object.
Further, since the accessory 82 present at the position overlapping the foreign object 83 and the other accessory 82 are different in gradation data (that is, X-ray transmission amount), based on the second determination level value (th2), The presence or absence of the foreign matter 83 that overlaps the attachment 82 in the inspection object 7 can be determined.
Further, it is possible to determine the lack of the attachment 82 regardless of the position of the attachment 82 in the inspection object 7.

本発明は、生肉、魚、加工食品、医薬等の被検査物にX線を照射したときのX線透視画像から被検査物中の異物を検出するX線異物検査装置に利用することができる。   INDUSTRIAL APPLICATION This invention can be utilized for the X-ray foreign material inspection apparatus which detects the foreign material in a to-be-inspected object from an X-ray fluoroscopic image when X-rays are irradiated to to-be-inspected objects, such as raw meat, fish, processed food, and medicine. .

本発明の一実施形態であるX線異物検査装置の外観を示す斜視図。The perspective view which shows the external appearance of the X-ray foreign material inspection apparatus which is one Embodiment of this invention. X線異物検査装置の一部の構成を示すブロック図。The block diagram which shows the structure of a part of X-ray foreign material inspection apparatus. X線検出器の平面図。The top view of a X-ray detector. 図3に示すA−A線の断面図。Sectional drawing of the AA shown in FIG. 設定データを設定するために、画像表示されたモニタ画面の一例を示す図。The figure which shows an example of the monitor screen displayed as an image in order to set setting data. X線透視画像が画像表示されたモニタ画面の模式図。FIG. 4 is a schematic diagram of a monitor screen on which an X-ray fluoroscopic image is displayed. 異物検査の動作手順の大きな流れを示すフローチャート。The flowchart which shows the big flow of the operation | movement procedure of a foreign material inspection. 異物検査途中で作成される各画像の模式図。Schematic diagram of each image created during foreign object inspection. 異物検査の動作手順の流れの一例を示すフローチャート。The flowchart which shows an example of the flow of the operation | movement procedure of a foreign material inspection. 異物検査の動作手順の流れの一例を示すフローチャート。The flowchart which shows an example of the flow of the operation | movement procedure of a foreign material inspection. 異物検査の動作手順の流れの一例を示すフローチャート。The flowchart which shows an example of the flow of the operation | movement procedure of a foreign material inspection. 検査モード1の動作手順を示すフローチャート。5 is a flowchart showing an operation procedure in inspection mode 1; 検査モード2の動作手順を示すフローチャート。7 is a flowchart showing an operation procedure in inspection mode 2; 添付品モードの動作手順を示すフローチャート。The flowchart which shows the operation | movement procedure in attachment mode. X線透視画像から副内容物本体領域抽出画面、拡大副内容物領域抽出画面を作成する状態を説明する図。The figure explaining the state which produces a subcontents main body area | region extraction screen and an expansion subcontents area | region extraction screen from a X-ray fluoroscopic image. 従来の異物検査装置の構成を示す図。The figure which shows the structure of the conventional foreign material inspection apparatus.

符号の説明Explanation of symbols

1: X線源
3: X線検出器
5: ベルトコンベア(搬送機構)
7: 被検査物
20: 制御系(コンピュータ)
22: 入力装置
23: 表示装置
25: メモリ(設定データ記憶部)
31: 設定部
35: 二値化画像抽出部
36: 副内容物本体領域抽出部
37: 拡大副内容物領域抽出部
38: 拡大副内容物領域外異物検査部
39: 全体領域異物検査部
40: 副内容物欠落検査部
41: 設定データ記憶領域
42: 検出信号記憶領域
43: 画像記憶領域
1: X-ray source 3: X-ray detector 5: Belt conveyor (conveyance mechanism)
7: Inspected object 20: Control system (computer)
22: Input device 23: Display device 25: Memory (setting data storage unit)
31: Setting unit 35: Binarized image extracting unit 36: Sub-contents body region extracting unit 37: Enlarged sub-contents region extracting unit 38: Enlarged sub-contents region foreign matter inspection unit 39: Whole region foreign matter inspection unit 40: Sub-content missing inspection unit 41: setting data storage area 42: detection signal storage area 43: image storage area

Claims (9)

主内容物と副内容物とが含まれる被検査物を映した二次元のX線透視画像img(x,y)を取得し、このX線透視画像を形成する各画素の階調データに対して演算処理を行うことにより被検査物中の主内容物および副内容物以外の異物の有無を検査するX線異物検査装置であって、
主内容物の透過X線量に対応する階調レベルと副内容物の透過X線量に対応する階調レベルとを分割するための階調レベル値を、内容物レベル閾値(th)として設定する内容物レベル閾値設定部と、
画素の二次元形状の集合からなる第一塊領域を、X線透視画像に映る副内容物領域のうち本体領域を抽出するための演算に用いる第一探索ユニット(S1)として設定する第一探索ユニット設定部と、
X線透視画像の一の画素P(x,y)に対し、前記画素Pを取り囲むように第一探索ユニットを設定し、画素Pを含む第一探索ユニット内の全画素の階調データと内容物レベル閾値との関係に基づいて前記画素Pが副内容物の本体領域を構成する画素か否かを判定する本体領域探索演算を行い、X線透視画像の全画素について前記本体領域探索演算を行うことにより、副内容物の本体領域を抽出した副内容物本体領域抽出画像B2(x,y)を作成する副内容物本体領域袖出部と、
画素の二次元形状の集合であって前記第一塊領域より大きな第二塊領域を、副内容物本体領域抽出画像B2(x、y)に映る副内容物の本体領域の周辺領域も含めた拡大副内容物領域を抽出するための演算に用いる第二探索ユニット(S2)として設定する第二探索ユニット領域設定部と、
副内容物本体領域抽出画像B2(x,y)の一の画素Q(x,y)に対し、前記画素Qを取り囲むように第二探索ユニットを設定し、画素Qを含む第二探索ユニット内の全画素の階調データと副内容物本体領域抽出画像B2(x、y)に映る副内容物の本体領域の階調データとの比較結果に基づいて前記画素Qが拡大副内容物領域を構成する画素か否かを判定する拡大副内容物領域探索演算を行い、副内容物本体領域抽出画像B2(x,y)の全画素について前記拡大副内容物領域探索演算を行うことにより、拡大副内容物領域を抽出した拡大副内容物領域抽出画像B3(x,y)を作成する拡大副内容物領域袖出部と、
拡大副内容物領域以外の領域の異物判定に用いる階調レベル値を第一異物判定レベル値(th1)として設定する第一異物判定レベル値設定部と、
拡大副内容物領域抽出画像B3(x,y)の拡大副内容物領域以外の領域に対応するX線透視画像img(x,y)の各画素を第一検査範囲として、第一検査範囲に含まれる各画素の階調データを第一異物判定レベル値に基づいて判定することにより異物の有無を判定する拡大副内容物領域外異物検査部とを備えたことを特徴とするX線異物検査装置。
A two-dimensional X-ray fluoroscopic image img (x, y) reflecting the inspection object including the main contents and the sub-contents is acquired, and the gradation data of each pixel forming the X-ray fluoroscopic image is obtained. An X-ray foreign matter inspection apparatus for inspecting the presence or absence of foreign matters other than the main contents and sub-contents in the inspected object by performing arithmetic processing,
Contents for setting the gradation level value for dividing the gradation level corresponding to the transmitted X-ray dose of the main content and the gradation level corresponding to the transmitted X-ray dose of the sub-content as the content level threshold (th) An object level threshold setting unit;
A first search that sets a first block region composed of a set of two-dimensional shapes of pixels as a first search unit (S1) used in an operation for extracting a main body region from sub-content regions shown in an X-ray fluoroscopic image A unit setting section;
For a pixel P (x, y) of an X-ray fluoroscopic image, a first search unit is set so as to surround the pixel P, and gradation data and contents of all pixels in the first search unit including the pixel P Based on the relationship with the object level threshold value, a body area search calculation is performed to determine whether or not the pixel P is a pixel constituting the body area of the subsidiary content, and the body area search calculation is performed for all the pixels of the fluoroscopic image. A sub-contents main body region cuffing section for creating a sub-contents main body region extraction image B2 (x, y) obtained by extracting the sub-contents main body region;
A second lump area that is a set of two-dimensional shapes of pixels and that is larger than the first lump area includes the peripheral area of the sub-contents main body area shown in the sub-contents main body area extraction image B2 (x, y) A second search unit region setting unit that is set as a second search unit (S2) used in the calculation for extracting the expanded sub-content region;
A second search unit is set so as to surround the pixel Q with respect to one pixel Q (x, y) of the sub-contents main body region extraction image B2 (x, y), and within the second search unit including the pixel Q Based on the comparison result between the gradation data of all the pixels and the gradation data of the main body region of the subsidiary content shown in the subsidiary content body region extraction image B2 (x, y), the pixel Q defines the enlarged subsidiary content region. An enlarged sub-content area search operation for determining whether or not the pixel is a constituent pixel is performed, and the enlarged sub-content area search operation is performed on all the pixels of the sub-content body area extracted image B2 (x, y) to expand An enlarged sub-content area extracting section for creating an enlarged sub-content area extraction image B3 (x, y) obtained by extracting the sub-content area;
A first foreign matter determination level value setting unit that sets a gradation level value used for foreign matter determination in a region other than the enlarged sub-content region as a first foreign matter determination level value (th1);
Each pixel of the X-ray fluoroscopic image img (x, y) corresponding to an area other than the enlarged sub-content area of the enlarged sub-content area extraction image B3 (x, y) is set as the first inspection area. An X-ray foreign substance inspection comprising: an enlarged sub-contents out-of-area foreign substance inspection unit that determines the presence or absence of a foreign substance by determining gradation data of each pixel included based on a first foreign substance determination level value apparatus.
X線透視画像img(x,y)を内容物レベル閾値(th)に基づいて二値化した二値化画像B1(x,y)を作成する二値化画像抽出部をさらに備え、
副内容物本体領域抽出部は、X線透視画像img(x,y)の一の画素P(x,y)に代えて、二値化画像B1(x,y)の一の画素P(x,y)に対して前記本体領域探索演算を行い、二値化画像B1(x,y)の全画素について前記本体領域探索演算を行うことにより、副内容物の本体領域を抽出した副内容物本体領域抽出画像B2(x,y)を作成することを特徴とする請求項1に記載のX線異物検査装置。
A binarized image extraction unit that creates a binarized image B1 (x, y) obtained by binarizing the fluoroscopic image img (x, y) based on the content level threshold (th);
The sub-contents body region extraction unit replaces one pixel P (x, y) of the X-ray fluoroscopic image img (x, y) with one pixel P (x) of the binarized image B1 (x, y). , Y), the main body area search calculation is performed, and the main body area search calculation is performed for all the pixels of the binarized image B1 (x, y), thereby extracting the sub-contents of the sub-contents. 2. The X-ray foreign substance inspection apparatus according to claim 1, wherein the main body region extraction image B2 (x, y) is created.
前記副内容物本体領域袖出部は、画素Pを含む第一探索ユニット内の全画素の階調データが内容物レベル閾値(th)以下であることを条件として前記画素Pを副内容物の本体領域を構成する画素と判定する本体領域探索演算を行い、
前記拡大副内容物領域袖出部は、画素Qを含む第二探索ユニット内の少なくとも1つの画素の階調データが副内容物本体領域の階調データであることを条件として前記画素Qを拡大副内容物領域と判定する拡大副内容物領域探索演算を行うことを特徴とする請求項1または請求項2のいずれかに記載のX線異物検査装置。
The sub-contents main body region cuffing portion sets the pixel P to the sub-contents on condition that gradation data of all pixels in the first search unit including the pixel P is equal to or less than a content level threshold (th). Perform body area search calculation to determine the pixels constituting the body area,
The enlarged sub-content area cuff expands the pixel Q on condition that the gradation data of at least one pixel in the second search unit including the pixel Q is the gradation data of the sub-content body area. The X-ray foreign substance inspection apparatus according to claim 1, wherein an enlarged sub-content area search operation for determining a sub-content area is performed.
副内容物本体領域袖出部は、次式(1)を用いて本体領域探索演算を行うことを特徴とする請求項3に記載のX線異物検査装置。
The X-ray foreign substance inspection apparatus according to claim 3, wherein the sub-contents main body region protuberance performs a main body region search operation using the following equation (1).
拡大副内容物領域袖出部は、次式(2)を用いて拡大副内容物領域探索演算を行うことを特徴とする請求項1〜請求項4のいずれかに記載のX線異物検査装置。
5. The X-ray foreign substance inspection apparatus according to claim 1, wherein the expanded sub-content area crest portion performs an enlarged sub-content area search operation using the following equation (2): .
拡大副内容物領域外異物検査部は、次式(3)を用いて拡大副内容物領域外の異物の有無を判定することを特徴とする請求項1〜請求項5のいずれかに記載のX線異物検査装置。
6. The foreign matter inspection unit outside the enlarged sub-content area determines whether or not there is a foreign substance outside the enlarged sub-content area using the following equation (3). X-ray foreign substance inspection device.
X線透視画像img(x,y)の全領域に対する異物判定に用いる階調レベル値を第二異物判定レベル値(th2)として設定する第二異物判定レベル値設定部と、
画素の二次元形状の集合からなる第三の塊領域が、X線透視画像img(x,y)の全領域から異物領域を抽出するための演算に用いる第三探索ユニット(S3)として設定されている状態で、第三探索ユニットに含まれる全画素の階調データと第二異物判定レベル値との関係に基づいて異物認定を行うときの判定基準とする画素数閾値(MS3)を設定する画素数閾値設定部と、
X線透視画像img(x,y)の一の画素R(x,y)に対し、前記画素Rを取り囲むように第三探索ユニット(S3)を設定し、画素Rを含む第三探索ユニット内の各画素の階調データと第二異物判定レベル値(th2)との比較により抽出した画素の数と画素数閾値(MS3)とに基づいて、前記画素Rが異物を構成する画素であるか否かを判定する異物領域探索演算を行い、X線透視画像の全画素を第二検査範囲として、前記第二検査範囲の各画素について異物領域探索演算を行うことにより異物の有無を判定する全体領域異物検査部とをさらに備えたことを特徴とする請求項1〜請求項6のいずれかに記載のX線異物検査装置。
A second foreign matter determination level value setting unit that sets a gradation level value used for foreign matter determination for the entire region of the X-ray fluoroscopic image img (x, y) as a second foreign matter determination level value (th2);
A third lump area composed of a set of two-dimensional shapes of pixels is set as a third search unit (S3) used for calculation to extract a foreign substance area from the entire area of the fluoroscopic image img (x, y). In this state, a pixel number threshold value (MS3) is set as a criterion for foreign object recognition based on the relationship between the gradation data of all pixels included in the third search unit and the second foreign substance determination level value. A pixel number threshold setting unit;
A third search unit (S3) is set so as to surround the pixel R for one pixel R (x, y) of the X-ray fluoroscopic image img (x, y). Whether the pixel R is a pixel constituting a foreign object based on the number of pixels extracted by comparing the gradation data of each pixel and the second foreign substance determination level value (th2) and the pixel number threshold (MS3) The entire foreign matter region search calculation is performed to determine whether or not there is a foreign matter by performing the foreign matter region search calculation for each pixel in the second inspection range with all pixels of the fluoroscopic image as the second inspection range. The X-ray foreign substance inspection apparatus according to claim 1, further comprising an area foreign substance inspection unit.
全体領域異物検査部は、次式(4)を用いて異物領域探索演算を行うことを特徴とする請求項7に記載のX線異物検査装置。
The X-ray foreign substance inspection apparatus according to claim 7, wherein the whole area foreign substance inspection unit performs a foreign substance area search calculation using the following equation (4).
画素の二次元形状の集合からなる第四の塊領域を、副内容物の欠落を判定するための演算に用いる欠落判定閾値(S4)として設定する欠落判定閾値設定部と、
副内容物本体領域抽出画像B2(x,y)に映る副内容物の本体領域と欠落判定閾値(S4)とに基づいて、被検査物中の副内容物の有無を判定する副内容物欠落検査部とをさらに備えたことを特徴とする請求項1〜請求項8のいずれかに記載のX線異物検査装置。
A missing determination threshold value setting unit that sets a fourth mass region formed of a set of two-dimensional shapes of pixels as a missing determination threshold value (S4) used for calculation for determining the loss of sub-contents;
Sub-contents missing for determining presence / absence of sub-contents in inspected object based on sub-contents main body region shown in sub-contents main body region extraction image B2 (x, y) and lack determination threshold (S4) The X-ray foreign matter inspection apparatus according to claim 1, further comprising an inspection unit.
JP2007072567A 2007-03-20 2007-03-20 Device for inspecting x-ray foreign matter Pending JP2008232814A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007072567A JP2008232814A (en) 2007-03-20 2007-03-20 Device for inspecting x-ray foreign matter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007072567A JP2008232814A (en) 2007-03-20 2007-03-20 Device for inspecting x-ray foreign matter

Publications (1)

Publication Number Publication Date
JP2008232814A true JP2008232814A (en) 2008-10-02

Family

ID=39905791

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007072567A Pending JP2008232814A (en) 2007-03-20 2007-03-20 Device for inspecting x-ray foreign matter

Country Status (1)

Country Link
JP (1) JP2008232814A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014041019A (en) * 2012-08-21 2014-03-06 Ishida Co Ltd X-ray inspection device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6284390A (en) * 1985-10-09 1987-04-17 Fujitsu Ltd Area extraction system
JP2001326815A (en) * 2000-05-17 2001-11-22 Minolta Co Ltd Image processing method and image processing unit
JP2002228428A (en) * 2001-02-02 2002-08-14 Nikon Corp Foreign matter detecting device and exposing device
JP2005069918A (en) * 2003-08-26 2005-03-17 Sharp Corp Image processing device and image processing method
JP2005083775A (en) * 2003-09-05 2005-03-31 Seirei Ind Co Ltd Grain classifier
JP2005326226A (en) * 2004-05-13 2005-11-24 Dainippon Screen Mfg Co Ltd Defect detector, wiring area extractor, defect detection method, and wiring area extracting method
JP2006308315A (en) * 2005-04-26 2006-11-09 Anritsu Sanki System Co Ltd X-ray foreign matter detector

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6284390A (en) * 1985-10-09 1987-04-17 Fujitsu Ltd Area extraction system
JP2001326815A (en) * 2000-05-17 2001-11-22 Minolta Co Ltd Image processing method and image processing unit
JP2002228428A (en) * 2001-02-02 2002-08-14 Nikon Corp Foreign matter detecting device and exposing device
JP2005069918A (en) * 2003-08-26 2005-03-17 Sharp Corp Image processing device and image processing method
JP2005083775A (en) * 2003-09-05 2005-03-31 Seirei Ind Co Ltd Grain classifier
JP2005326226A (en) * 2004-05-13 2005-11-24 Dainippon Screen Mfg Co Ltd Defect detector, wiring area extractor, defect detection method, and wiring area extracting method
JP2006308315A (en) * 2005-04-26 2006-11-09 Anritsu Sanki System Co Ltd X-ray foreign matter detector

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014041019A (en) * 2012-08-21 2014-03-06 Ishida Co Ltd X-ray inspection device

Similar Documents

Publication Publication Date Title
JP4317566B2 (en) X-ray inspection apparatus and method for generating image processing procedure of X-ray inspection apparatus
JP4574478B2 (en) X-ray foreign matter detection method and X-ray foreign matter detection device
KR20210126163A (en) Inspection device
US8254656B2 (en) Methods and system for selective resolution improvement in computed tomography
KR20200097344A (en) Inspection device
JP2016156647A (en) Inspection device using electromagnetic wave
JP5864404B2 (en) X-ray inspection equipment
JP4585915B2 (en) X-ray inspection equipment
JP2006308467A (en) X-ray inspection device
JP2009139230A (en) X-ray foreign-material detecting device
JP3888623B2 (en) X-ray foreign matter detection method and X-ray foreign matter detection device
JP6979672B2 (en) X-ray inspection equipment
JP6355232B2 (en) X-ray inspection equipment
JP2005091015A (en) X-ray inspection device
JP6480171B2 (en) X-ray inspection device
JP2008232814A (en) Device for inspecting x-ray foreign matter
JP2015137858A (en) Inspection device
JP6388826B2 (en) X-ray inspection equipment
JP3917019B2 (en) X-ray foreign object detection device
JP2006308315A (en) X-ray foreign matter detector
JP2010281681A (en) X-ray inspection apparatus
JP2008224483A (en) X-ray inspection device
KR102498829B1 (en) Inspection apparatus
JP2009080031A (en) X-ray inspection device
JP4291123B2 (en) Radiation foreign matter inspection apparatus and radiation foreign matter inspection method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090610

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20090917

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110830

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110906

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120110