【0001】
【発明が属する技術分野】
本発明は、被写体を画像処理する画像処理方法と、被写体を透過照明することにより被写体に混入する異物を検出する異物検出方法と異物検出装置に関する。
【0002】
【従来の技術】
製品の検査において、キズや汚れなどの外観検査や不純物の混入検査などが行われ、例えば、被検査物が食品の場合では、その成分以外の異物が混入しないことが絶対条件として求められ、食品への異物の混入は完全に除去することが食品衛生上の見地からも要求されている。
【0003】
そして、食品製造工程では非破壊の全量検査を必要とするため、多くは目視検査に頼っているのが現状であるが、目視検査は見落としが発生する虞があると共に、工数が大になる問題がある。
【0004】
そこで、自動化のために自動検出機が開発され、その自動検査機としては、異物の物性に着目し、金属検出機やX線検出システム、画像処理システムが用いられている。
【0005】
しかし、金属検出機は、非磁性金属の検出に限界があり、X線検出システムは、X線透過量の違いを利用するもので、透過画像情報を処理し、検査を行い、食品以外でも実用化が図られているが、コスト,操作性,処理速度などに課題が残されている。
【0006】
一方、画像処理システムとして、ラインセンサカメラを用いて被撮像体の欠陥検査を行う欠陥検査装置に適用され、被撮像体における欠陥とその背景のコントラストを強調するための画像入力装置において、欠陥信号と背景信号とのコントラストを強調することにより、欠陥を見落とす虞を軽減する(例えば特許文献1)ようにした画像入力装置がある。
【0007】
しかし、この画像入力装置では光沢フィルムなどの表面が平滑な被検出物において、その表面の凹凸などの欠陥を検出するものであるから、表面に凹凸のある被検出物において、内部の欠陥を検出することはできない。
【0008】
そこで、米菓生地等の被検出物の検出方法として、異物を含まない物体の周辺外側透過光出力と内部内側透過光出力とが同じ値となるようにするため、物体を全方向から一様に照明し、同値化した透過光出力を正常値と定め、該正常値から透過光出力の変化の有無によって異物の有無を判断可能にした光透過度を利用する物体中の異物検出法があり、検査通路の床面下に受光素子(フォトダイオード又はCCDリニアイメージセンサー)を配設し、上部の光源から照射され光拡散された光が遮光した検査通路を通過する被検出物を照射することにより、被検出物の物体の外周辺の透過光出力と内部方向の透過光出力とが同じ値になるようにして照射し、被検出物からの透過光を受光する受光素子の出力信号の変化を電気的に処理することにより、食品に混入した異物の有無を検知する(例えば特許文献2)ものである。
【0009】
【特許文献1】
特開2001−33396号公報(段落0015、0017段)
【特許文献2】
特開平11−183118号公報
【0010】
【発明が解決しようとする課題】
上記特許文献2の装置では、検査通路の床面下に受光素子を配設し、上部の光源から照射され光拡散された光が検査通路を通過する被検出物を照射し、受光素子の出力信号の変化を処理することにより、食品に混入した異物を検出することができる。そして、このような透過照明により得られた画像を効率よく画像処理すれば、一層、検出効率が向上することが予想される。
【0011】
そこで、本発明は、透過照明した被写体の画像処理を簡単に行うことができる画像処理方法を提供することを目的とし、また、被検出物の異物を透過照明する検査方法において、さらに、画像処理法を導入し、精度の高い検出を行うことができる画像処理を用いた異物検出装置を提供することを目的とする。
【0012】
【課題を解決するための手段】
請求項1の画像処理方法は、透過照明された被写体を撮影手段により撮影して画像を取得し、この画像の単峰性濃度ヒストグラムの最大度数の濃度値から定数を減じた濃度値をしきい値として前記画像を2値化処理する方法である。
【0013】
この請求項1の構成によれば、2次元の画像の単峰性濃度ヒストグラムの最大度数の濃度値から予め設定した定数を減じた濃度値をしきい値として2次元の画像を2値化処理するだけで済むから、画像処理時間の短縮が可能で、濃淡画像である2次元の画像を2値化処理した2値画像から、被写体の特徴抽出や画像計測などを行うことができる。
【0014】
また、請求項2の画像処理方法は、前記画像の濃度ヒストグラムが単峰性になるように照明と撮影手段を調整する方法である。
【0015】
この請求項2の構成によれば、濃度ヒストグラムが単峰性になるように設定し、2次元の画像の濃度ヒストグラムの最大度数の濃度値から定数を減じた濃度値をしきい値にして2値化処理することができる。
【0016】
請求項3の異物検出装置は、搬出側コンベヤの搬出端と搬入側コンベヤの搬入端との間に隙間を設け、前記搬出側コンベヤから搬入側コンベヤに受け渡される被写体を透過照明する透過照明手段と、この透過照明手段と前記コンベヤを挟む位置に設けられ透過照明された前記被写体をスキャンニングして画像信号を得るラインセンサとを備え、このラインセンサのスキャニングを前記コンベヤによる被写体の移動量に対応して行い、前記スキャニングにより得られた画像信号から被写体の画像を取得し、この画像の単峰性濃度ヒストグラムの最大度数の濃度値から定数を減じた濃度値をしきい値として前記画像を2値化処理し、この2値化処理して得られた2値画像により前記被写体の異物を検出する処理手段を備える装置である。
【0017】
この請求項3の構成によれば、被写体がコンベヤ間の隙間を通過する間に、ラインセンサにより該被写体の2次元の画像を取得し、2次元の画像の単峰性濃度ヒストグラムの最大度数の濃度値から予め設定した定数を減じた濃度値をしきい値として2次元の画像を2値化処理し、得られた2値画像により被写体を検出することができる。
【0018】
また、請求項4の異物検出装置は、前記2値化処理して得られた2値画像から特徴抽出される画素数が設定基準値を超えるか否かを比較する装置である。
【0019】
この請求項4の構成によれば、2値画像から特徴抽出した画素数が設定基準値を超える場合、異物と判断する。
【0020】
さらに、請求項5の異物検出装置は、前記透過照明手段と前記ラインセンサとが前記画像の濃度ヒストグラムが単峰性になるように調整されている装置である。
【0021】
この請求項5の構成によれば、濃度ヒストグラムが単峰性になるように設定し、2次元の画像の濃度ヒストグラムの最大度数の濃度値から定数を減じた濃度値をしきい値にして2値化処理することにより、処理時間の短縮が可能で、効率よく画像処理を行うことができる。
【0022】
【発明の実施形態】
以下、本発明の実施形態を、添付図面を参照して説明する。図1〜図4は本発明の第1実施形態を示し、同図は本発明の方法を異物検出に適用した例を示し、異物検出装置1は、照明部2と、撮影手段たるカメラ部3と、搬送部4と、処理手段たる画像処理部5とから構成される。
【0023】
前記搬送部4は、搬入側コンベヤ41と搬出側コンベヤ42とを搬送方向に並べると共に、搬入側コンベヤ41の搬出端41Dと、搬出側コンベヤ42の搬入端42Hとの間に上下に貫通する隙間43を設けている。
【0024】
前記照明部2は透過照明手段21を備え、この透過照明手段21として、高周波直流蛍光灯で18W型を、前記隙間43の上方でコンベヤ41,42の上面から10mmの位置に固定し、出力を調整して用いられる。
【0025】
前記カメラ部3はCCDラインセンサカメラにより構成され、前記隙間43の上方でコンベヤ41,42の下面から248mm、俯角0度、焦点距離183mmの集光レンズ31を備える。そして、カメラ部3の位置決め固定にはXYZステージ及び揺動機構を設ける。CCDラインセンサカメラの仕様は、5000ビット、ビデオ周波数40MHz、スキャンレート135μsecである。
【0026】
それら両コンベヤ41,42は一定幅を有する無端状ベルト44が移動して被検査物を搬送するものであり、平面において、搬出端41Dと搬入端42Hが平行をなす。例えば、前記無端状ベルト44の幅は200mmで、搬入側コンベヤ41の長さは300mm、搬出側コンベヤ42の長さは500mmであり、両コンベヤ41,42間を通過する被検査物(被写体)の姿勢変化を防止するため、コンベヤ41,42のシャフト45の直径は10mm以下、例えば8mmで、前記間隔43は20mm以下、好ましくは10mm以下であり、間隔43よりシャフト45の直径を小さく設定する。
【0027】
前記画像処理部5は、被検出物Kを検出するセンサ50の被検出物有信号をトリガー信号として、画像の取り込みを開始する。すなわち、コンベヤ41を移送される被検出物Kをセンサ50が検出することにより、被検出物の隙間43を通過するタイミングを検出し、ラインセンサが駆動する。録画した画像は、デジタルカメラ対応画像処理ボードを経由してコンピュータ54に入力し処理を行う。取り込んだ画像をコンピュータ54のモニター55に表示し、被検査物の領域を選択し、その領域の濃度ヒストグラムから2値化のしきい値を求め、2値化された画像の画素と基準となる画素数を比較し、異物有無の判断を自動で行う。
【0028】
画像を取り込む検出エリアは100mm、コンベヤ41,42の搬送速度は最高160mm/sに設定する。
【0029】
前記照明部2は、蛍光灯以外にもハロゲンランプ、LED、レーザーなどを用いることができ、その出力や照射法を任意に変更できる。尚、本実施形態で前記CCDラインセンサと、蛍光灯、ハロゲンランプ、LED、レーザーとを組み合わせて実験を行った結果、他に比べて、蛍光灯は、透過影像が明瞭であること、操作が簡便であること、熱の影響が少ないこと、輝度が均一であることなどの優れた点があり、照明部2に蛍光灯を採用した。
【0030】
そして、被写体たる被検出物Kの種類により、前記透過照明手段21とカメラ部3の位置を調整し、さらに、透過照明手段21の出力やカメラ部3の絞りを調整し、また、カメラ部3の焦点距離などを調整しすることにより、透過照明により得られた被検出物Kの2次元画像である透過影像の濃度ヒストグラムが単峰性となるように設定する。
【0031】
画像処理部5は、ラインセンサの出力信号をデジタル信号に変換するA/Dコンバータ(アナログデジタル変換器)51と、そのデジタル信号を画像に変換する画像インターフェース52と、その画像などを記憶するメモリー53とを備え、さらに、記憶した画像(画像データ)を処理するコンピュータ54と、処理結果を表示するモニター55とを備える。
【0032】
以上の条件から解像度20μmが得られた。尚、日本人成人の毛髪の直径は、数十〜100μmであるから、解像度が20μmであれば、被検査物の毛髪の混入を確認できる。
【0033】
次に、上記画像処理部5による画像処理について説明する。被検出物Kが搬入側コンベヤ41から搬出側コンベヤ42に受け渡される際、該被検出物Kを透過照明手段41により透過照明し、カメラ部5により被検出物Kの濃淡画像を取得する。尚、カメラ部5においては、ラインセンサはコンベヤ41,42の移動速度に対応してスキャニングを行い、画像信号を出力し、この画像信号により前記画像処理部5が濃淡画像を作成する。
【0034】
前記画像処理部5は、得られた濃淡画像の濃度ヒストグラムを算出し、以下のように2値化処理を行う。濃淡画像から異物のみを有効に検出するためには、2値化のためのしきい値を適正に決定する必要がある。
【0035】
画像fが濃度範囲[a,b]であり、2値化しきい値をT(但し、a<T<b)とすると、2値化処理は次の数1によって与えられる。
【0036】
【数1】
【0037】
fTは2値画像であり、1を対象領域(黒領域)の値とし、0を背景領域(白領域)とする。そこで、1の対象領域を異物として抽出できるしきい値を設定する。尚、しきい値の決定方法には、入力画像の信号濃度ヒストグラムをその都度解析して最適なしきい値を求める判別認識法,モードやキトラー法などがあるが、異物の検出には処理時間の面などから不向きである。
【0038】
本発明では、照明部2及びカメラ部5を調整することにより、透過影像が単峰性になるように設定し、この濃度ヒストグラムを図2に示す。図2の横軸は濃度f,縦軸は度数niである。最大度数nmaxの時の濃度をfmaxとし、次の数2で示す。
【0039】
【数2】
【0040】
しきい値を決定するためのオフセット値をdとする時、しきい値Tを次の数3で与える。
【0041】
【数3】
【0042】
実際に図3(A)の濃淡画像をしきい値Tにより2値化した画像が図3(B)であり、異物のみが抽出されたことがわかる。符合11が異物部分である。但し、図3(B)では理解を容易にするため、輪郭(エッジ部分)を図示しているが、実際の2値図面には、異物部分11のみが表れ、輪郭は表れない。また、図4は図3の被検出物Kの濃度ヒストグラムをモニター55に表示したものである。
【0043】
透過影像から異物を検出するために行った画像処理部5による処理手順としては、まず、ラインセンサの画像信号を4近傍画像の移動平均計算による平滑化を行い(平滑化処理)、これにより画像信号に混入するランダムな信号の雑音を抑制し、次に上述したしきい値による2値化を行い(2値化処理)、この後、異物部分をラベリングし(ラベリング処理)、これにより異物部分の面積と中心座標(いずれも画素数)を特徴量として算出する。そして、ラベリングされた異物部分の画素数が、予め設定した基準値を超えた場合、異物ありとして異物を検出し、NG信号を出力し、異物検出を報知(検出報知)する。
実験例
異物の種類、大きさ、混入状態は、多岐にわたるため、開発ニーズの高い毛髪や昆虫類や金属類を異物と想定し、米菓生地に混入させ、異物混入試料を作成した。
【0044】
食品生地は主にデンプンと米粉からなる米菓焼成前生地を想定し、横15mm、長さ60mm、厚さ2mmの大きさとした。尚、毛髪は円柱、鉄・ステンレスは球、塩化ビニールは立法体、昆虫類は複雑系と形状による分類を行った。
【0045】
米菓生地のような混練食品生地は、粉体と大小・形状様々な空乏層で構成されており、入射した光は、生地内で乱反射を繰り返し、あるいは、水分、デンプン、糖分に吸収された後、側面及び底面より出射する。したがって、透過影像は出射してきた光を画像化したもので、散乱成分を含んでいる。
【0046】
そこで、試験に用いる模擬試料は、光学的に透明な合成樹脂、例えばポリエステル樹脂に、散乱体としてTiO2粉末を混合して成形した。TiO2粉末をポリエステル樹脂に入れて懸濁体にする。TiO2粉末の濃度を変えることにより任意の散乱係数の食品生地模擬試料を作ることが可能である。
【0047】
光の吸収体には緑色の食用色素をエタノールに溶かし、その後、ポリエステル樹脂に混合し、これを模擬試料に混合して使用した。
【0048】
TiO2粒子はまずポリエステル樹脂の主剤に混合し、振とう器と超音波洗浄器により粒子を一気に分散させ、その後、硬化剤を混入し硬化させる。試料作成の際、樹脂内に気泡が発生しないように硬化させる。気泡が発生しなように作成するのは、試料の内部に気泡が混入すると内部で屈折率の違いにより散乱が生じるからである。硬化剤混入後、用意した標準異物を混入させる。混入位置は試料の表面と内部で区別した。
【0049】
試料のポリエステル樹脂中のTiO2粒子の濃度は体積分率でfv=1.342×10−4のものを用意した。TiO2粒子は完全な球体ではないため、Mieの散乱理論により等価散乱係数はμs=0.800mm−1と推定される。
【0050】
試料表面を研磨及び琢磨し、鏡面に仕上げる。平面を作る精研磨から行い、最終的には粒度が0.05μmの微細酸化物と合成樹脂を使った琢磨を行う。このようにして試料表面の傷などによる光の散乱を取り除いた。
【0051】
【表1】
【0052】
上記表1に示すように、模擬試料M1は、直径0.1mmで長さ5mmの毛髪を内部に混入し、模擬試料M2は、直径0.2の鉄の球を内部に混合し、模擬試料M3は、大きさが約3mmの昆虫を表面に取り付け、模擬試料M4は、塩化ビニル樹脂の立方体で縦横高さがそれぞれ1mmのものを内部に混合した。
【0053】
上記異物検出装置1を用い、照明の出力を18W、コンベヤの速度、すなわち模擬試料M1,M2,M3,M4の移動速度を16m/minに一定にした状態で試験を行い、異物の位置を変えるため、模擬試料M1,M2,M3,M4を前後、表裏、コンベヤ41,42の移送方向に対する角度をそれぞれ変え、以下の手順により、各100回透過影像を取り込み、以下の手順を繰り返して検査を行った。
【0054】
1)画像ボードを介してコンピュータ54のモニター55上に2次元の濃淡画像を再現する。2)得られた256階調の濃淡画像ヒストグラムから濃度ピーク値を求める。尚、256階調は0〜255で、0側が暗く、255側が明るい。3)求めた度数ピーク値より、50小さい値に2値化の基準値を設定する。4)2値画像から、特徴抽出を行い、対象領域の面積値を求める。
【0055】
この実験において、従来検出が困難とされていた毛髪や微小な金属球、木片、虫、生地の異常なども、遮光性異物として2次元で再現することができ、生地の厚薄,色の濃淡も確認できることがわかった。
【0056】
このように本実施形態では、請求項1に対応して、透過照明された被写体たる被検出物Kを撮影手段たるカメラ部3により撮影して画像を取得し、この画像の単峰性濃度ヒストグラムの最大度数nmaxの濃度値fmaxから定数dを減じた濃度値をしきい値Tとして前記画像を2値化処理する方法であるから、2次元の画像の単峰性濃度ヒストグラムの最大度数nmaxの濃度値fmaxから予め設定した定数dを減じた濃度値をしきい値Tとして2次元の画像を2値化処理するから、画像処理時間の短縮が可能で、濃淡画像である2次元の画像を2値化処理した2値画像から、被検出物の特徴抽出や画像計測などを行うことができる。
【0057】
また、このように本実施形態では、請求項2に対応して、前記画像の濃度ヒストグラムが単峰性になるように照明と撮影手段たるカメラ部3を調整する方法であるから、濃度ヒストグラムが単峰性になるように設定し、2次元の画像の単峰性濃度ヒストグラムの最大度数nmaxの濃度値fmaxから予め設定した定数dを減じた濃度値をしきい値Tにして2値化処理することができる。
【0058】
このように本実施形態では、請求項3に対応して、搬出側コンベヤ41の搬出端41Dと搬入側コンベヤ42の搬入端42Hとの間に隙間43を設け、搬出側コンベヤ41から搬入側コンベヤ42に受け渡される被写体たる被検出物Kを透過照明する透過照明手段21と、この透過照明手段21とコンベヤ41,42を挟む位置に設けられ透過照明された被検出物Kの画像をスキャンニングして画像信号を得るラインセンサとを備え、このラインセンサのスキャニングをコンベヤ41,42による被検出物Kの移動量に対応して行い、スキャニングにより得られた画像信号から被検出物の画像を取得し、この画像の単峰性濃度ヒストグラムの最大度数nmaxの濃度値fmaxから定数dを減じた濃度値をしきい値Tとして画像を2値化処理し、この2値化処理して得られた2値画像により被検出物Kの異物を検出する処理手段たる画像処理部5を備えるから、被検出物Kがコンベヤ41,42間の隙間43を通過する間に、ラインセンサにより該被検出物の2次元の画像を取得し、2次元の画像の単峰性濃度ヒストグラムの最大度数nmaxの濃度値fmaxから予め設定した定数dを減じた濃度値をしきい値Tとして2次元の画像を2値化処理し、得られた2値画像により被写体を検出することができる。
【0059】
また、このように本実施形態では、請求項4に対応して、2値化処理して得られた2値画像から特徴抽出される画素数が設定基準値を超えるか否かを比較するから、2値画像から特徴抽出した画素数が設定基準値を超える場合、異物と判断する。
【0060】
さらに、このように本実施形態では、請求項5に対応して、透過照明手段21とラインセンサとが画像の濃度ヒストグラムが単峰性になるように調整されているから、処理時間の短縮が可能で、効率よく画像処理を行うことができる。
【0061】
図5は本発明の第2実施形態を示し、上記第1実施形態と同一部分に同一符号を付し、その詳細な説明を省略して詳述すると、この例では、搬送部4には、前記搬入側コンベヤ41の搬入側に追加搬入側コンベヤ46を並べて設け、追加搬入側コンベヤ46の搬出端46Dと搬入側コンベヤ41の搬入端41Hとの間に上下に貫通する隙間43´を設けている。この隙間43´に対応して、前記透過照明手段21とカメラ部3とを上下逆に設け、隙間43´を通過する被検出物Kを透過照明手段21によりコンベヤ42,46の下方から透過照明し、その透過影像をコンベヤ46,42の上方のカメラ部5により撮像し、その画像信号を前記画像処理部5に出力している。尚、図中6は搬出側コンベヤ42の搬出端42D側に設けられた排出部であり、コンベヤ42上の被検出物Kを外部に搬出する。この場合、隙間43´,43の2箇所を追加して検査された被検出物Kのうち、異物を検出したものを排出部6により外部に排出し、異常のないものは搬出端46Hから搬出する。
【0062】
したがって、この例では、被検出物Kが隙間43´を通過する際に、該被検出物Kを透過照明手段41により透過照明し、カメラ部5により被検出物Kの濃淡画像を取得し、これを第1実施形態で説明したと同様に画像処理して異物を検出することができ、一層確実な異物の検出が可能となる。すなわち、被検出物Kの内部において異物が照明部2側にあるよりもカメラ部3側にあるほうが鮮明に検出できることが実験により判っており、被検出物Kの表裏両面の透過影像を得ることにより、信頼性の高い検査が可能となる。
【0063】
このように本実施形態では、搬出側から搬入側に複数のコンベヤ46,41,42を並べて設けると共に、隣合うコンベヤ46,41,42の間に隙間43´,43を設け、被写体たる被検出物Kを透過照明する透過照明手段21,21と、この透過照明手段21,21とコンベヤ46,41,42を挟む位置に設けられ透過照明された被検出物Kをスキャンニングして画像信号を得るラインセンサとを備え、このラインセンサのスキャニングをコンベヤ46,41,42による被検出物Kの移動量に対応して行い、スキャニングにより得られた画像信号から被検出の画像を取得し、この画像の単峰性濃度ヒストグラムの最大度数nmaxの濃度値fmaxから予め設定した定数dを減じた濃度値をしきい値Tとして画像を2値化処理し、この2値化処理して得られた2値画像により被検出物Kの異物を検出する処理手段たる画像処理部5を備え、被検出物Kの上下から透過照明し、下上の透過影像を取得して画像処理するから、このようにコンベヤ46,41,42を移送される被検出物Kの表裏両面の透過影像を取得し、この濃淡画像である透過影像を画像処理して被検出物Kの異物を検出することにより、異物が被検出物Kの表裏一側に偏って混入する場合でも高い精度で検出することができる。
【0064】
図6及び図7は本発明の第3実施形態を示し、上記各実施形態と同一部分に同一符号を付し、その詳細な説明を省略して詳述すると、この例では、被検出物及び被写体として布を積層に畳んだ布体61を示し、布体61の一例として滅菌ガーゼを示しており、布体61の内部に汚れやごみなどの異物があると、図7に示す2値化画像のように異物部分62を検出することができ、目視により確認が難しい内部の欠陥についても、透過影像を画像処理してその内部の欠陥を検出することができる。
【0065】
図8は本発明の第4実施形態を示し、上記各実施形態と同一部分に同一符号を付し、その詳細な説明を省略して詳述すると、この例では、植物の葉を被検出物及び被写体としており、本発明の方法及び装置を用いることにより、図8に示すように葉の2値画像が得られ、光の透過率の低い葉脈部分を画像化することができる。
【0066】
尚、本発明は上記実施例に限定されるものではなく本発明の要旨の範囲内において種々の変形実施が可能である。例えば、被検出物は実施形態に示した以外でも、透過照明により濃淡画像が得られるものであれば各種のものに適用可能であり、例えば食品ではかまぼこやはんぺんなど水産練物の検査に適用可能であり、あるいは窒化アルミ板の検査にも用いることができる。また、しきい値を決定するためのオフセット値dは、検出物の種類により実験などに基いて決定することができる。
【0067】
【発明の効果】
請求項1の画像処理方法は、透過照明された被写体を撮影手段により撮影して画像を取得し、この画像の単峰性濃度ヒストグラムの最大度数の濃度値から定数を減じた濃度値をしきい値として前記画像を2値化処理する方法であり、透過照明した被写体の画像処理を簡単に行うことができる画像処理方法を提供することができる。
【0068】
また、請求項2の画像処理方法は、前記画像の濃度ヒストグラムが単峰性になるように照明と撮影手段を調整する方法であり、透過照明した被写体の画像処理を簡単に行うことができる画像処理方法を提供することができる。
【0069】
請求項3の異物検出装置は、画像の単峰性濃度ヒストグラムの最大度数の濃度値から定数を減じた濃度値をしきい値として前記画像を2値化処理し、この2値化処理して得られた2値画像により前記被写体の異物を検出する処理手段を備える装置であり、画像処理法を導入し、精度の高い検出を行うことができる異物検出方法と異物検出装置を提供することができる。
【0070】
また、請求項4の異物検出装置は、前記2値化処理して得られた2値画像から特徴抽出される画素数が設定基準値を超えるか否かを比較する装置であり、画像処理法を導入し、精度の高い検出を行うことができる異物検出方法と異物検出装置を提供することができる。
【0071】
さらに、請求項5の異物検出装置は、前記透過照明手段と前記ラインセンサとが前記画像の濃度ヒストグラムが単峰性になるように調整されている装置であり、画像処理法を導入し、精度の高い検出を行うことができる異物検出方法と異物検出装置を提供することができる。
【図面の簡単な説明】
【図1】本発明の第1実施形態を示す全体説明図である。
【図2】同上、濃度ヒストグラムを示すグラフの図である。
【図3】同上、被検出物の画像の図を示し、図3(A)は濃淡画像、図3(B)は2値画像である。
【図4】同上、図3(A)の濃淡画像の濃度ヒストグラムを示すグラフの図である。
【図5】本発明の第2実施形態を示す全体説明図である。
【図6】本発明の第3実施形態を示す被検出物の斜視図である。
【図7】同上、被検出物の2値画像の図である。
【図8】本発明の第4実施形態を示す被検出物の2値画像の図である。
【符号の説明】
1 異物検出装置
2 照明部
3 カメラ部(撮影手段)
4 搬送部
5 画像処理部(処理手段)
21 透過照明手段
41 搬入側コンベヤ
41D 搬出端
42 搬出側コンベヤ
42H 搬入端
43,43´ 隙間
46 搬入側コンベヤ
46D 搬出端
43´ 隙間
61 布体(被検出物)
71 葉(被検出物)
K 被検出物[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing method for performing image processing on a subject, a foreign matter detection method for detecting a foreign matter mixed into the subject by transmitting illumination of the subject, and a foreign matter detection device.
[0002]
[Prior art]
In the inspection of products, appearance inspection such as scratches and dirt and contamination inspection are performed.For example, when the inspection object is a food, it is required as an absolute condition that foreign substances other than its components do not enter. It is also required from the standpoint of food hygiene that the contamination of foreign materials be completely removed.
[0003]
In the food manufacturing process, nondestructive total inspection is required, and most of them rely on visual inspection.However, visual inspection may cause oversight and increase the number of man-hours. There is.
[0004]
Therefore, an automatic detector has been developed for automation. As the automatic inspection device, a metal detector, an X-ray detection system, and an image processing system are used, focusing on the physical properties of foreign matter.
[0005]
However, metal detectors have a limit in detecting non-magnetic metals, and X-ray detection systems use the difference in the amount of transmitted X-rays. However, there are still problems in cost, operability, processing speed, etc.
[0006]
On the other hand, as an image processing system, the present invention is applied to a defect inspection device that performs a defect inspection of an object using a line sensor camera, and an image input device for enhancing the contrast between the defect in the object and its background. There is an image input apparatus which enhances the contrast between the image and the background signal to reduce the risk of overlooking a defect (for example, Patent Document 1).
[0007]
However, this image input device detects defects such as irregularities on the surface of an object with a smooth surface such as a glossy film, so it detects internal defects on the object with irregularities on the surface. I can't.
[0008]
Therefore, as a method for detecting an object to be detected, such as rice cracker dough, the object is uniformly omnidirectional from all directions so that the peripheral outer transmitted light output and the internal inner transmitted light output of the object containing no foreign matter have the same value. There is a method for detecting foreign matter in an object using light transmittance, which determines the presence or absence of a foreign matter by determining the presence or absence of a change in transmitted light output from the normal value by determining the transmitted light output equivalent to the normal value. A light-receiving element (photodiode or CCD linear image sensor) is provided below the floor of the inspection passage, and the object to be detected passes through the inspection passage where the light diffused by the light emitted from the upper light source is blocked. The change in the output signal of the light receiving element that receives the transmitted light from the object to be illuminated so that the transmitted light output in the outer periphery of the object to be detected and the transmitted light output in the inward direction of the object become the same value. By electrically treating , For detecting the presence or absence of the foreign matter mixed in food (for example, Patent Document 2) it is intended.
[0009]
[Patent Document 1]
JP 2001-33396 A (paragraphs 0015 and 0017)
[Patent Document 2]
JP-A-11-183118
[0010]
[Problems to be solved by the invention]
In the apparatus disclosed in Patent Document 2, a light receiving element is disposed below the floor of an inspection passage, and light radiated from an upper light source and diffused irradiates an object to be detected passing through the inspection passage. By processing the change in the signal, it is possible to detect a foreign substance mixed in the food. If the image obtained by such transmitted illumination is efficiently processed, it is expected that the detection efficiency will be further improved.
[0011]
Therefore, an object of the present invention is to provide an image processing method that can easily perform image processing on a subject that has been transmitted and illuminated. It is an object of the present invention to provide a foreign matter detection device using image processing that can perform highly accurate detection by introducing a method.
[0012]
[Means for Solving the Problems]
According to the image processing method of the first aspect, an image is obtained by photographing a subject that has been transmitted and illuminated by photographing means, and a density value obtained by subtracting a constant from the density value of the maximum frequency of the unimodal density histogram of the image is thresholded. In this method, the image is binarized as a value.
[0013]
According to the configuration of the first aspect, the two-dimensional image is binarized using the density value obtained by subtracting a preset constant from the maximum frequency density value of the unimodal density histogram of the two-dimensional image as a threshold value. The image processing time can be reduced, and the feature extraction and image measurement of a subject can be performed from a binary image obtained by binarizing a two-dimensional image that is a grayscale image.
[0014]
An image processing method according to a second aspect is a method of adjusting illumination and photographing means so that the density histogram of the image has a single peak.
[0015]
According to the configuration of the second aspect, the density histogram is set to have a single peak, and the density value obtained by subtracting a constant from the density value of the maximum frequency of the density histogram of the two-dimensional image is set as the threshold value. Value processing can be performed.
[0016]
The foreign matter detection device according to claim 3, wherein a clearance is provided between an unloading end of the unloading-side conveyor and an unloading end of the unloading-side conveyor, and transmission illumination means for transmitting and illuminating a subject delivered from the unloading-side conveyor to the unloading-side conveyor. And a line sensor provided at a position sandwiching the transmission illuminator and the conveyor to obtain an image signal by scanning the illuminated transmission illumination, and scanning the line sensor with an amount of movement of the object by the conveyor. An image of the subject is obtained from the image signal obtained by the scanning, and a density value obtained by subtracting a constant from the density value of the maximum frequency of the unimodal density histogram of the image is used as a threshold value. The apparatus includes a processing unit that performs a binarization process and detects a foreign object of the subject from a binary image obtained by the binarization process.
[0017]
According to this configuration, while the subject passes through the gap between the conveyors, a two-dimensional image of the subject is acquired by the line sensor, and the maximum frequency of the unimodal density histogram of the two-dimensional image is obtained. A two-dimensional image is binarized using a density value obtained by subtracting a preset constant from the density value as a threshold value, and a subject can be detected from the obtained binary image.
[0018]
A foreign matter detection device according to a fourth aspect is a device for comparing whether or not the number of pixels feature-extracted from a binary image obtained by the binarization processing exceeds a set reference value.
[0019]
According to this configuration, when the number of pixels extracted from the binary image exceeds the set reference value, the pixel is determined to be a foreign substance.
[0020]
Further, the foreign matter detection device according to claim 5 is a device in which the transmitted illumination means and the line sensor are adjusted so that the density histogram of the image has a single peak.
[0021]
According to the configuration of the fifth aspect, the density histogram is set to have a single peak, and the density value obtained by subtracting a constant from the density value of the maximum frequency of the density histogram of the two-dimensional image is set as a threshold value. By performing the binarization processing, the processing time can be reduced, and image processing can be performed efficiently.
[0022]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. 1 to 4 show a first embodiment of the present invention. FIG. 1 shows an example in which the method of the present invention is applied to foreign substance detection. A foreign substance detection device 1 includes an illumination unit 2 and a camera unit 3 as a photographing unit. , A transport unit 4 and an image processing unit 5 as a processing unit.
[0023]
The transport section 4 arranges the carry-in side conveyor 41 and the carry-out side conveyor 42 in the carrying direction, and a gap vertically penetrating between a carry-out end 41D of the carry-in side conveyor 41 and a carry-in end 42H of the carry-out side conveyor 42. 43 are provided.
[0024]
The illumination unit 2 includes a transmission illumination unit 21. As the transmission illumination unit 21, an 18 W type high-frequency DC fluorescent lamp is fixed above the gap 43 at a position 10 mm from the upper surfaces of the conveyors 41 and 42, and the output is output. Used after adjustment.
[0025]
The camera section 3 is constituted by a CCD line sensor camera, and includes a condenser lens 31 having a distance of 248 mm, a depression angle of 0 degree, and a focal length of 183 mm from the lower surfaces of the conveyors 41 and 42 above the gap 43. An XYZ stage and a swing mechanism are provided for positioning and fixing the camera unit 3. The specifications of the CCD line sensor camera are 5000 bits, a video frequency of 40 MHz, and a scan rate of 135 μsec.
[0026]
The two conveyors 41 and 42 are configured such that an endless belt 44 having a constant width moves to convey an object to be inspected, and a carry-out end 41D and a carry-in end 42H are parallel in a plane. For example, the width of the endless belt 44 is 200 mm, the length of the carry-in conveyor 41 is 300 mm, the length of the carry-out conveyor 42 is 500 mm, and an inspection object (subject) passing between the two conveyors 41, 42. The diameter of the shaft 45 of the conveyors 41 and 42 is 10 mm or less, for example, 8 mm, and the interval 43 is 20 mm or less, preferably 10 mm or less. .
[0027]
The image processing unit 5 starts capturing an image by using a detected object presence signal of the sensor 50 that detects the detected object K as a trigger signal. That is, when the sensor 50 detects the object K to be transferred on the conveyor 41, the timing at which the object K passes through the gap 43 between the objects is detected, and the line sensor is driven. The recorded image is input to the computer 54 via the digital camera-compatible image processing board for processing. The captured image is displayed on the monitor 55 of the computer 54, a region of the inspection object is selected, and a binarization threshold value is obtained from a density histogram of the region, which is used as a reference for the pixels of the binarized image. The number of pixels is compared, and the presence or absence of foreign matter is automatically determined.
[0028]
The detection area for capturing an image is set to 100 mm, and the conveyor speed of the conveyors 41 and 42 is set to a maximum of 160 mm / s.
[0029]
The illumination unit 2 can use a halogen lamp, an LED, a laser, or the like in addition to the fluorescent lamp, and the output and the irradiation method can be arbitrarily changed. In this embodiment, an experiment was conducted by combining the CCD line sensor with a fluorescent lamp, a halogen lamp, an LED, and a laser. As a result, the fluorescent lamp has a clearer transmission image, and the operation is easier. Because of its advantages such as simplicity, little influence of heat, and uniform brightness, a fluorescent lamp was used for the illumination unit 2.
[0030]
Then, the position of the transmission illumination means 21 and the camera unit 3 is adjusted according to the type of the object K to be detected, and the output of the transmission illumination means 21 and the aperture of the camera unit 3 are adjusted. Is adjusted so that the density histogram of the transmitted shadow image, which is a two-dimensional image of the detection target K obtained by the transmitted illumination, becomes unimodal.
[0031]
The image processing unit 5 includes an A / D converter (analog-to-digital converter) 51 that converts an output signal of the line sensor into a digital signal, an image interface 52 that converts the digital signal into an image, and a memory that stores the image and the like. 53, and a computer 54 for processing the stored image (image data) and a monitor 55 for displaying the processing result.
[0032]
Under the above conditions, a resolution of 20 μm was obtained. In addition, since the diameter of the hair of a Japanese adult is several tens to 100 μm, if the resolution is 20 μm, contamination of the hair of the inspection object can be confirmed.
[0033]
Next, image processing by the image processing unit 5 will be described. When the object K is transferred from the carry-in conveyor 41 to the carry-out conveyor 42, the object K is transmitted and illuminated by the transmission illuminating means 41, and the camera unit 5 acquires a grayscale image of the object K. In the camera section 5, the line sensor performs scanning corresponding to the moving speed of the conveyors 41 and 42, outputs an image signal, and the image processing section 5 generates a grayscale image based on the image signal.
[0034]
The image processing unit 5 calculates a density histogram of the obtained grayscale image and performs a binarization process as described below. In order to effectively detect only foreign matter from a grayscale image, it is necessary to appropriately determine a threshold value for binarization.
[0035]
If the image f is in the density range [a, b] and the binarization threshold is T (where a <T <b), the binarization processing is given by the following equation (1).
[0036]
(Equation 1)
[0037]
f T Is a binary image, 1 is the value of the target area (black area), and 0 is the background area (white area). Therefore, a threshold value for extracting one target region as a foreign substance is set. As a method of determining the threshold value, there are a discrimination recognition method, a mode, a Kitler method, and the like for analyzing a signal density histogram of an input image each time to obtain an optimal threshold value. Not suitable from the surface.
[0038]
In the present invention, the transmission image is set to have a single peak by adjusting the illumination unit 2 and the camera unit 5, and this density histogram is shown in FIG. The horizontal axis in FIG. 2 is the density f, and the vertical axis is the frequency ni. The density at the maximum frequency nmax is represented by fmax, and is represented by the following equation 2.
[0039]
(Equation 2)
[0040]
When the offset value for determining the threshold value is d, the threshold value T is given by the following equation (3).
[0041]
[Equation 3]
[0042]
FIG. 3B shows an image obtained by actually binarizing the grayscale image of FIG. 3A with the threshold value T, and shows that only foreign matter is extracted. Reference numeral 11 is a foreign matter portion. However, in FIG. 3B, the outline (edge portion) is illustrated for easy understanding, but only the foreign material portion 11 appears in the actual binary drawing, and the outline does not appear. FIG. 4 shows the density histogram of the detected object K shown in FIG.
[0043]
As a processing procedure performed by the image processing unit 5 to detect a foreign substance from a transmitted image, first, the image signal of the line sensor is smoothed by a moving average calculation of four neighboring images (smoothing processing), and the image The noise of the random signal mixed into the signal is suppressed, and then binarization is performed using the above-described threshold value (binarization processing), and thereafter, the foreign substance part is labeled (labeling processing). Is calculated as the feature amount. Then, when the number of pixels of the labeled foreign substance portion exceeds a preset reference value, the foreign substance is detected as a foreign substance, an NG signal is output, and the detection of the foreign substance is notified (detection notification).
Experimental example
Since the type, size, and mixing state of foreign matter vary widely, hair, insects, and metals with high development needs were assumed to be foreign matter, and mixed with rice confectionery dough to prepare a foreign matter mixed sample.
[0044]
The food dough was 15 mm in width, 60 mm in length, and 2 mm in thickness, assuming a rice confectionery dough mainly composed of starch and rice flour. The hairs were classified into cylinders, iron and stainless steel were balls, vinyl chloride was cubic, and insects were classified according to complex system and shape.
[0045]
Kneaded food dough, such as rice cracker dough, is composed of powder and depletion layers of various sizes and shapes, and the incident light is repeatedly reflected in the dough or absorbed by moisture, starch, and sugar. Thereafter, the light is emitted from the side surface and the bottom surface. Therefore, the transmitted image is an image of the emitted light, and contains a scattering component.
[0046]
Therefore, the simulated sample used for the test is an optically transparent synthetic resin, for example, a polyester resin, and TiO. 2 The powder was mixed and molded. TiO 2 The powder is suspended in a polyester resin. TiO 2 By changing the concentration of the powder, it is possible to produce a food dough simulation sample having an arbitrary scattering coefficient.
[0047]
For the light absorber, a green food dye was dissolved in ethanol, then mixed with a polyester resin, and mixed with a simulated sample for use.
[0048]
TiO 2 First, the particles are mixed with the main component of the polyester resin, and the particles are dispersed at a stretch by a shaker and an ultrasonic cleaner, and thereafter, a curing agent is mixed and cured. At the time of sample preparation, the resin is cured so as not to generate bubbles in the resin. The reason why bubbles are not generated is that when bubbles are mixed in the sample, scattering occurs due to a difference in the refractive index inside the sample. After mixing the curing agent, the prepared standard foreign matter is mixed. The mixing position was distinguished between the surface and the inside of the sample.
[0049]
TiO in polyester resin of sample 2 The concentration of the particles is fv = 1.342 × 10 in volume fraction. -4 I prepared something. TiO 2 Since the particles are not perfect spheres, the equivalent scattering coefficient is μs = 0.800 mm according to Mie's scattering theory. -1 It is estimated to be.
[0050]
Polish and polish the sample surface to a mirror finish. The polishing is performed from a fine polishing for forming a flat surface, and finally a polishing using a fine oxide having a particle size of 0.05 μm and a synthetic resin is performed. In this way, light scattering due to scratches on the sample surface was removed.
[0051]
[Table 1]
[0052]
As shown in Table 1 above, the simulated sample M1 mixed with hair having a diameter of 0.1 mm and a length of 5 mm, and the simulated sample M2 mixed with an iron sphere having a diameter of 0.2. For M3, an insect having a size of about 3 mm was attached to the surface, and for the simulated sample M4, a cube of vinyl chloride resin having a length and width of 1 mm was mixed inside.
[0053]
Using the above foreign matter detection device 1, a test is performed under the condition that the output of illumination is 18 W and the speed of the conveyor, that is, the moving speed of the simulated samples M1, M2, M3 and M4 is fixed at 16 m / min, and the position of the foreign matter is changed. Therefore, the simulation samples M1, M2, M3, and M4 were changed in front and back, front and back, and angles with respect to the transport direction of the conveyors 41 and 42, respectively, and the transmitted images were captured 100 times by the following procedure. went.
[0054]
1) A two-dimensional gray image is reproduced on the monitor 55 of the computer 54 via the image board. 2) A density peak value is obtained from the obtained 256-tone grayscale image histogram. The 256 gradations are 0 to 255, and the 0 side is dark and the 255 side is bright. 3) A reference value for binarization is set to a value smaller than the obtained frequency peak value by 50. 4) Feature extraction is performed from the binary image to determine the area value of the target region.
[0055]
In this experiment, hair, minute metal spheres, wood chips, insects, and abnormalities of the cloth, which were difficult to detect in the past, can be reproduced in two dimensions as light-shielding foreign matter. It turned out that we could confirm.
[0056]
As described above, according to the first embodiment, an image is obtained by photographing the object K, which is a subject that has been transmitted and illuminated, by the camera unit 3 serving as a photographing unit, and a monomodal density histogram of the image is obtained. Is a method of binarizing the image using a density value obtained by subtracting a constant d from the density value fmax of the maximum frequency nmax as the threshold value T, so that the maximum frequency nmax of the unimodal density histogram of the two-dimensional image is Since the two-dimensional image is binarized using the density value obtained by subtracting a preset constant d from the density value fmax as a threshold value T, the image processing time can be reduced, and the two-dimensional image which is a grayscale image can be reduced. From the binary image subjected to the binarization processing, feature extraction, image measurement, and the like of the detected object can be performed.
[0057]
Further, as described above, according to the present embodiment, the method of adjusting the illumination and the camera unit 3 serving as a photographing means so that the density histogram of the image has a single peak, so that the density histogram is Binarization processing is performed by setting a density value obtained by subtracting a preset constant d from a density value fmax of a maximum frequency nmax of a unimodal density histogram of a two-dimensional image as a threshold value T so as to be unimodal. can do.
[0058]
As described above, in the present embodiment, the gap 43 is provided between the discharge end 41D of the discharge-side conveyor 41 and the discharge end 42H of the transfer-side conveyor 42, and the discharge-side conveyor 41 moves from the discharge-side conveyor 41. A transmission illumination means 21 for transmitting and illuminating an object K, which is a subject, which is transferred to the object 42, and scanning an image of the transmission-illuminated object K provided at a position sandwiching the transmission illumination means 21 and the conveyors 41 and 42. And a line sensor that obtains an image signal by performing scanning in accordance with the amount of movement of the object K by the conveyors 41 and 42. An image of the object is obtained from the image signal obtained by the scanning. The image is binarized by obtaining a density value obtained by subtracting a constant d from the density value fmax of the maximum frequency nmax of the obtained unimodal density histogram of the image and using the threshold value T as a threshold value. Since the image processing unit 5 is provided as processing means for detecting foreign matter of the object K based on the binary image obtained by the binarization processing, the object K passes through the gap 43 between the conveyors 41 and 42. During this process, a two-dimensional image of the object is acquired by the line sensor, and a density value obtained by subtracting a preset constant d from the density value fmax of the maximum frequency nmax of the unimodal density histogram of the two-dimensional image is obtained. A two-dimensional image is binarized as a threshold value T, and a subject can be detected from the obtained binary image.
[0059]
According to the present embodiment, whether the number of pixels extracted from the binary image obtained by the binarization process exceeds the set reference value is compared. If the number of pixels extracted from the binary image exceeds the set reference value, it is determined that the pixel is a foreign substance.
[0060]
Furthermore, in the present embodiment, the transmission illumination means 21 and the line sensor are adjusted so that the density histogram of the image becomes monomodal, so that the processing time can be reduced. Image processing can be performed efficiently.
[0061]
FIG. 5 shows a second embodiment of the present invention. The same parts as those in the first embodiment are denoted by the same reference numerals, and detailed description thereof is omitted. An additional carry-in conveyor 46 is provided side by side on the carry-in side of the carry-in conveyor 41, and a gap 43 'penetrating vertically is provided between the carry-out end 46D of the additional carry-in conveyor 46 and the carry-in end 41H of the carry-in conveyor 41. I have. The transmission illumination means 21 and the camera unit 3 are provided upside down in correspondence with the gap 43 ', and the object K passing through the gap 43' is transmitted and illuminated from below the conveyors 42 and 46 by the transmission illumination means 21. Then, the transmitted image is captured by the camera unit 5 above the conveyors 46 and 42, and the image signal is output to the image processing unit 5. In the drawing, reference numeral 6 denotes a discharge unit provided on the discharge end 42D side of the discharge side conveyor 42, and discharges the detection object K on the conveyor 42 to the outside. In this case, of the detected objects K, which have been inspected by adding two gaps 43 ′ and 43, those that have detected foreign matter are discharged to the outside by the discharge unit 6, and those that are not abnormal are discharged from the discharge end 46 H. I do.
[0062]
Therefore, in this example, when the detection object K passes through the gap 43 ′, the detection object K is transmitted and illuminated by the transmission illuminating unit 41, and the camera unit 5 obtains a grayscale image of the detection object K. This can be image-processed in the same manner as described in the first embodiment to detect the foreign matter, and the foreign matter can be more reliably detected. That is, it is known from experiments that a foreign substance can be detected more clearly on the camera section 3 side than on the illumination section 2 side inside the detection object K, and it is possible to obtain a transmission image on both the front and back surfaces of the detection object K. Thereby, highly reliable inspection can be performed.
[0063]
As described above, in the present embodiment, the plurality of conveyors 46, 41, 42 are provided side by side from the carry-out side to the carry-in side, and the gaps 43 ', 43 are provided between the adjacent conveyors 46, 41, 42 to detect the subject as a subject. The transmission illumination means 21 and 21 for transmitting and illuminating the object K, and the object K which is provided at a position sandwiching the transmission illumination means 21 and 21 and the conveyors 46, 41 and 42 are scanned and the image signal is obtained. The scanning of the line sensor is performed in accordance with the amount of movement of the object K by the conveyors 46, 41, and 42, and an image to be detected is acquired from an image signal obtained by the scanning. The image is binarized using a density value obtained by subtracting a preset constant d from the density value fmax of the maximum frequency nmax of the unimodal density histogram of the image as a threshold value T. An image processing unit 5 is provided as processing means for detecting foreign matter in the object K based on a binary image obtained by the binarization processing. Thus, the transmission shadow images on both the front and back surfaces of the detection object K transferred on the conveyors 46, 41, and 42 are acquired, and the transmission shadow image, which is the grayscale image, is image-processed to obtain the detection object K. By detecting the foreign matter, it is possible to detect the foreign matter with high accuracy even when the foreign matter is mixed in one side of the front and back of the detection object K.
[0064]
6 and 7 show a third embodiment of the present invention, in which the same reference numerals are given to the same portions as those in the above embodiments, and the detailed description thereof is omitted. 7 shows a cloth body 61 in which cloth is folded as a subject, and sterile gauze is shown as an example of the cloth body 61. If foreign matter such as dirt or dust is present inside the cloth body 61, the binarization shown in FIG. The foreign matter portion 62 can be detected like an image, and even for an internal defect that is difficult to confirm visually, the transmitted shadow image can be image-processed to detect the internal defect.
[0065]
FIG. 8 shows a fourth embodiment of the present invention, in which the same parts as those in the above embodiments are denoted by the same reference numerals, and the detailed description thereof is omitted. By using the method and apparatus of the present invention, a binary image of a leaf is obtained as shown in FIG. 8, and a vein portion having a low light transmittance can be imaged.
[0066]
It should be noted that the present invention is not limited to the above embodiment, and various modifications can be made within the scope of the present invention. For example, the object to be detected can be applied to various types of objects other than those shown in the embodiment as long as a grayscale image can be obtained by transmitted illumination, and can be applied to, for example, inspection of fish paste such as kamaboko and hampan in food. Yes, or can be used to inspect aluminum nitride plates. Further, the offset value d for determining the threshold can be determined based on an experiment or the like depending on the type of the detected object.
[0067]
【The invention's effect】
According to the image processing method of the first aspect, an image is obtained by photographing a subject that has been transmitted and illuminated by photographing means, and a density value obtained by subtracting a constant from the density value of the maximum frequency of the unimodal density histogram of the image is thresholded. This is a method of binarizing the image as a value, and it is possible to provide an image processing method that can easily perform image processing on a subject that has been transmitted and illuminated.
[0068]
The image processing method according to claim 2 is a method of adjusting illumination and photographing means so that the density histogram of the image has a single peak, and is an image which can easily perform image processing of a subject subjected to transmission illumination. A processing method can be provided.
[0069]
According to a third aspect of the present invention, there is provided a foreign matter detection device, wherein the image is binarized using a density value obtained by subtracting a constant from the density value of the maximum frequency of the unimodal density histogram of the image as a threshold value. The present invention provides a foreign object detection method and a foreign object detection device that include a processing unit that detects a foreign object of the subject from the obtained binary image and that can perform highly accurate detection by introducing an image processing method. it can.
[0070]
Further, the foreign matter detection device according to claim 4 is a device for comparing whether or not the number of pixels extracted from the binary image obtained by the binarization process exceeds a set reference value. And a foreign matter detection method and a foreign matter detection device capable of performing highly accurate detection can be provided.
[0071]
Further, the foreign matter detection device according to claim 5, wherein the transmission illumination means and the line sensor are adjusted so that the density histogram of the image has a single peak, and an image processing method is introduced to improve the accuracy. Foreign matter detection method and foreign matter detection device capable of performing highly accurate detection can be provided.
[Brief description of the drawings]
FIG. 1 is an overall explanatory diagram showing a first embodiment of the present invention.
FIG. 2 is a graph showing a density histogram according to the first embodiment;
3A and 3B show images of an object to be detected, wherein FIG. 3A is a grayscale image and FIG. 3B is a binary image;
FIG. 4 is a graph showing a density histogram of the grayscale image of FIG.
FIG. 5 is an overall explanatory diagram showing a second embodiment of the present invention.
FIG. 6 is a perspective view of an object to be detected according to a third embodiment of the present invention.
FIG. 7 is a diagram showing a binary image of an object to be detected;
FIG. 8 is a diagram of a binary image of an object to be detected according to a fourth embodiment of the present invention.
[Explanation of symbols]
1 Foreign object detection device
2 Lighting section
3 camera part (photographing means)
4 Transport unit
5 Image processing unit (processing means)
21 Transmission illumination means
41 Loading conveyor
41D Loading end
42 Unloading side conveyor
42H Loading end
43, 43 'gap
46 Loading conveyor
46D Unloading end
43 'gap
61 Cloth (object to be detected)
71 leaves (detected object)
K object to be detected