JP3670244B2 - Pattern inspection device and different kind mixing inspection device - Google Patents

Pattern inspection device and different kind mixing inspection device Download PDF

Info

Publication number
JP3670244B2
JP3670244B2 JP2002060802A JP2002060802A JP3670244B2 JP 3670244 B2 JP3670244 B2 JP 3670244B2 JP 2002060802 A JP2002060802 A JP 2002060802A JP 2002060802 A JP2002060802 A JP 2002060802A JP 3670244 B2 JP3670244 B2 JP 3670244B2
Authority
JP
Japan
Prior art keywords
pattern
area
value
density value
character pattern
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2002060802A
Other languages
Japanese (ja)
Other versions
JP2002312789A (en
Inventor
秀明 村上
真彦 宇野
尚道 山田
辰則 火原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2002060802A priority Critical patent/JP3670244B2/en
Publication of JP2002312789A publication Critical patent/JP2002312789A/en
Application granted granted Critical
Publication of JP3670244B2 publication Critical patent/JP3670244B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
この発明は、画像データより1つ1つ切り出された文字、記号、商標等の文字をはじめとして、認識対象となる各種形状パターンの認識を行うパターン認識装置を応用したパターン検査装置および異品種混入検査装置に関するものである。
【0002】
【従来の技術】
図11は例えば「電子情報通信学会論文誌 D」、Vol.J71-D NO.6(1988年)の第1037〜1047頁に掲載された「情景画像からの文字パターン検出と認識」(大谷 淳、塩 昭夫)に示された、従来のパターン認識装置における文字パターンの濃淡画像の2値化法の原理を示す説明図である。この説明図は濃淡画像を複数の小領域に分割して、分割された小領域毎に最適なしきい値を設けて2値化処理を行い、それによって得られた2値化画像から各文字パターンを切り出して、それら各文字パターンの認識を行う例を示したものである。この図11において、141は文字パターンの濃淡画像の原画であり、142はこの原画141を複数に分割した小領域である。
【0003】
次に動作について説明する。
ここで、文字パターンと文字パターンの背景部分との濃度コントラストは高く局所的に2値的であり、文字パターンに対応する箇所をパターンとして切り出せば文字認識処理で読むことが可能である。従って、一般的なパターン認識装置では、テレビカメラなどの画像撮像装置を用いて撮像された文字パターンの濃淡画像を所定のしきい値で2値化して2値化画像に変換し、その2値化画像より各文字パターンを切り出して、それら各文字パターンの認識を行っている。しかしながら、このような方式では、画像撮像の際の照明の照度変化などの影響によって、2値化画像に欠落が発生したり、背景部分の一部が文字パターンと癒着して検出されてしまうことがあり、良好な2値化画像を得るためには照明を厳しく調整する必要が生じてくる。
【0004】
そのため、この方式ではまず、図11(a)に示すように、撮像された文字パターンの濃淡画像の原画141を複数(図示の例では3×3=9個)の小領域142に分割し、分割された小領域142のそれぞれに対して、図11(b)に示すような2値化のための最適なしきい値θ11〜θ33を設定する。このようにして得られた各小領域142のしきい値θ11〜θ33は小領域142の境界で不連続であるために、これをそのまま用いて各小領域142毎に2値化処理を行った場合には、図11(c)に示すように小領域142の境界部分において画像に不連続が生じる。そこで図14(d)に示すように、各小領域142毎に得られたしきい値θ11〜θ33をそれぞれの小領域142の中心の画像に与えて線形補間を行い、得られた画素毎のしきい値を用いて2値化処理を得ている。この方式は、このようにして得られた2値化画像より各文字パターンを切り出して、それら各文字パターンの認識を行うものである。
【0005】
【発明が解決しようとする課題】
従来のパターン認識装置のほとんどは、固定的な所定のしきい値で文字パターンの濃淡画像全体を2値化処理しているので、照明の照度が変化してしまうと2値化画像に多大な影響を及ぼして、文字パターンの欠落や癒着が発生してしまい、そのために照度の変化に著しく弱い欠点がある。また図11に示した濃淡画像の原画141を複数の小領域142に分割して、分割された小領域142毎の2値化処理から2値化画像を得る方式は、固定的な所定のしきい値で画像全体を2値化処理する方式と比べて、局所的に濃淡むらが発生した低品質画像に有効であるが、小領域142の分割方法によっては雑音領域も抽出してしまうなどの欠点があるため、文字パターンの正確な切り出しができるとは限らない。そのため、非常に優れた認識処理機能を有していても、認識処理自体、認識対象とする文字パターンの正確な切り出しを前提としているため、文字パターン認識が良好に機能しなくなり、撮像環境が必ずしも良いとは限らず、常に良好な画像が得られるとは限らないFA(ファクトリー・オートメーション:Factory Automation)の分野で用いられるパターン認識装置などでは、文字パターンを誤認識することが多くなってしまう。このため、従来のパターン認識装置を適用しても、印字された文字パターンなどの検査対象パターンの品質検査を容易に行なうことができないという課題があった。
【0006】
この発明は上記のような課題を解決するためになされたものであり、照明の照度変化に強く、局所的に濃淡むらがあるような低品質な画像についても常に正確な認識が安定して行え、かつ回路構成も比較的簡単なパターン認識装置を文字パターンの印字品質の検査に適用した文字パターン検査装置を得ることを目的とする。
【0007】
また、この発明は、上記パターン認識装置を生産ライン上を流れる部品などの異品種の混入検査に適用した異品種混入検査装置を得ることを目的とする。
【0008】
【課題を解決するための手段】
請求項1記載の発明に係るパターン検査装置は、画像撮像装置によって撮像された濃淡画像からパターンとその背景との濃度差を用いて検査対象パターンを1つ1つ切り出すパターン切り出し手段と、前記パターン切り出し手段によって切り出された前記各検査対象パターンの領域内の正規化された特徴量データを、前記濃淡画像から直接抽出するパターン特徴量抽出手段と、ニューラルネットワークによって形成され、前記パターン特徴量抽出手段の抽出した特徴量データを用いて、前記パターン切り出し手段によって切り出された検査対象パターンの認識を行い、前記ニューラルネットワークの出力値が所定のしきい値以下でない場合に、切り出された前記認識対象パターンが不良である判定するパターン認識手段とを備え、前記パターン切り出し手段が、パターン行と平行方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差を用いてパターン行領域を切り出す機能と、それによって切り出された前記パターン行領域内で、前記パターン行と垂直方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差に、当該走査線上の平均濃度値と切り出された前記パターン行領域の背景の平均濃度値との濃度差を加算し、得られた計算値に基づいてパターン領域の切り出しを行うことによって認識対象パターンを1つ1つ切り出す機能を有し、前記パターン特徴量抽出手段が、切り出されたパターン領域内で縦方向および横方向の走査を実行し、それぞれの方向毎の各走査線上の最大濃度値と最小濃度値との濃度差の分布から求めた縦方向および横方向の濃度差分布の累積関数に基づいて、メッシュ領域の分割を行う機能と、分割された前記各メッシュ領域の特徴量データを濃淡画像から直接計算し、得られた全ての前記メッシュ領域についての計算値を前記パターン認識手段への出力とする機能とを有するようにしたものである。
【0009】
請求項2記載の発明に係る異品種混入検査装置は、画像撮像装置によって撮像された濃淡画像からパターンとその背景との濃度差を用いて、製品の品種を示す識別パターンを1つ1つ切り出すパターン切り出し手段と、前記パターン切り出し手段によって切り出された前記各識別パターンの領域内の正規化された特徴量データを、前記濃淡画像から直接抽出するパターン特徴量抽出手段と、ニューラルネットワークによって形成され、前記パターン特徴量抽出手段の抽出した特徴量データを用いて、前記パターン切り出し手段によって切り出された識別パターンの認識を行い、前記ニューラルネットワークの出力値が最小になった前記識別パターンを強制的に出力して、異品種の混入を検査するパターン認識手段とを備え、前記パターン切り出し手段が、パターン行と平行方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差を用いてパターン行領域を切り出す機能と、それによって切り出された前記パターン行領域内で、前記パターン行と垂直方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差に、当該走査線上の平均濃度値と切り出された前記パターン行領域の背景の平均濃度値との濃度差を加算し、得られた計算値に基づいてパターン領域の切り出しを行うことによって認識対象パターンを1つ1つ切り出す機能を有し、前記パターン特徴量抽出手段が、切り出されたパターン領域内で縦方向および横方向の走査を実行し、それぞれの方向毎の各走査線上の最大濃度値と最小濃度値との濃度差の分布から求めた縦方向および横方向の濃度差分布の累積関数に基づいて、メッシュ領域の分割を行う機能と、分割された前記各メッシュ領域の特徴量データを濃淡画像から直接計算し、得られた全ての前記メッシュ領域についての計算値を前記パターン認識手段への出力とする機能とを有するようにしたものである。
【0010】
【発明の実施の形態】
以下、この発明の実施の一形態を説明する。
実施の形態1.
図1はこの発明の実施の形態1によるパターン認識装置の構成を示すブロック図である。図において、11は文字、記号、商標などの認識対象としてのパターンが表記されている被写体を撮像して、当該認識対象の濃淡画像の画像データを生成する画像撮像装置であり、例えばCCD(電荷結合デバイス)によるテレビカメラなどが用いられる。12はこの画像撮像装置11によって撮像された濃淡画像の画像処理を行って、その濃淡画像より認識対象パターンを1つ1つ切り出し、それら各認識対象パターンの認識処理を行うパターン認識装置であり、例えばニューラルネットワークを用いた電子計算機などが用いられる。
【0011】
また、このパターン認識装置12内において、13は画像撮像装置11よりこのパターン認識装置12に入力された濃淡画像の画像データを記憶する画像データ記憶手段である。14はこの画像データ記憶手段13に記憶されている画像データを読み出し、その濃淡画像からパターンと当該パターンの背景との濃度差を用いて直接、認識対象パターンの領域としての文字パターン領域を1つ1つ切り出すパターン切り出し手段である。15はこのパターン切り出し手段14によって切り出された各文字パターン領域内の正規化された特徴量データを、前記濃淡画像より直接抽出するパターン特徴量抽出手段である。
【0012】
16はこのパターン特徴量抽出手段15によって抽出された特徴量データを用いて、パターン切り出し手段14によって切り出された文字パターン領域の認識処理を実行するパターン認識手段であり、例えば学習機能を備えたニューラルネットワークによって構成されている。17はこのパターン認識手段16を構成するニューラルネットワークの学習手段であるパターン学習手段であり、18はその学習データベースであるパターン学習データベースである。ちなみに、このパターン認識手段16を構成しているニューラルネットワークはパターン学習手段17において、パターン学習データベース18に記憶されている基準パターンデータを学習済みである。
【0013】
次に動作について説明する。
ここで、図2はこの実施の形態1におけるパターン認識装置12の処理の流れを示すフローチャートである。また、図3〜図8はパターン切り出し手段14による文字パターン領域の切り出し方法を説明するための動作説明図であり、図9はパターン特徴量抽出手段15による特徴量データの抽出方法を説明するための動作説明図である。
【0014】
まずステップST1において、画像撮像装置11によって撮像されて画像データ記憶手段13に記憶された濃淡画像の画像データがパターン切り出し手段14に入力される。図3は入力された濃淡画像の画像データから、認識対象となる文字パターン領域を切り出すパターン切り出しの原理を説明するための動作説明図であり、ここでは、文字パターン「A」の画像データから文字パターン領域を切り出す場合について示している。なお、図中の31、32はパターン濃度画像を走査する走査線であり、33は切り出される文字パターン領域である。また、図3(a)は文字パターン背景上を通る走査線31上の濃度値の様子を示したものであり、図3(b)は文字パターン上を通る走査線32上の濃度値の様子を示したものである。
【0015】
ここで、上記走査線31と走査線32の濃度値の様子を見てみると、文字パターン背景上の走査線31と比べて文字パターン上の走査線32の方がその変動が激しいことがわかる。従って、図3(c)に示すように、走査線32上の濃度値幅(走査線上の最大濃度値と最小濃度値との濃度差)が大きいところが文字パターン領域であると考えられる。そのため、次に図2のステップST2において、パターン切り出し手段14はまず、パターン行と平行方向の走査を実行して各走査線上の最大濃度値と最小濃度値の濃度値幅の計算値cal1を求め、図3(d)に示すような各走査線上の濃度値幅の分布を調べ、それに基づいて文字パターン行領域の切り出しを実施する。続いて、先ほど切り出された文字パターン行領域内において、前記パターン行と垂直方向の走査を実行して、各走査線上の最大濃度値と最小濃度値との濃度差に、当該走査線上の平均濃度値と先に切り出した文字パターン行領域の背景の平均濃度値との濃度差を加えることによって計算値cal2を算出し、その計算値cal2を参照して、画像データ記憶手段13から読み出した濃淡画像から直接、図3(e)に示す認識対象の文字パターン領域33を1つ1つ切り出す。
【0016】
このように、文字パターン領域33の切り出しに際して、パターン行と平行方向に繰り返し走査し、各走査線上の最大濃度値と最小濃度値との濃度差を用いて文字パターン行領域を切り出すようにしているため、文字パターン行領域とその背景とのわずかな違いも検出して文字パターン行領域を切り出すことができる上、続いて、その切り出された文字パターン行領域内でパターン行と垂直方向に走査した走査線上の最大濃度値と最小濃度値との濃度差に、前記走査線上の平均濃度値と先に切り出された文字パターン行領域の背景の平均濃度値との濃度差を加算した計算値を用いて、1つ1つパターンを切り出すようにしているため、例えば「1」のように、パターン行と垂直方向に走査しても濃度差が検出されにくいパターンであっても、前記計算値を見れば、パターンの濃度が薄くてもその文字パターン領域33を特定することができるようになり、照明の照度変化よってパターンの濃度が薄くなるような場合であってもその影響を受けにくくなり、局所的に濃淡むらが発生しているような低品質画像からでも、正確な認識対象パターンの切り出しを行うことができる。
【0017】
なお、この文字パターン領域を切り出す際に参照した計算値cal1およびcal2のしきい値は、それぞれ計算値cal1、cal2の出現頻度分布を求め、図4に示すように、その出現頻度分布をクラス1とクラス2の2クラスに分割したときの、次の式(1)で示すクラス間分散値を最大にする値に設定しており、このようにして自動的に最適な文字パターン領域33を切り出している。
【0018】

Figure 0003670244
【0019】
ただし、μは全体の平均値、ω0 は出現頻度分布をしきい値αで左右に分割した場合の左側の面積、ω1 は同じく右側の面積、μ0 は左側の平均値、μ1 は右側の平均値をそれぞれ表している。
【0020】
このように、パターン切り出し手段14は、文字パターン行領域あるいは文字パターン領域を切り出す時のしきい値を、パターン行と平行方向に走査する各走査線上の最大濃度値と最小濃度値との濃度差の出現頻度分布、あるいはパターン行と垂直方向に走査する各走査線上の最大濃度値と最小濃度値との濃度差に、当該走査線上の平均濃度値と切り出された文字パターン行領域の背景の平均濃度値との濃度差を加算して得られた値の出現頻度分布を2つのクラスに分割したときの、クラス間分散値を最大にする値に設定しているので、パターンと背景を最適に分離することができ、そのため、照明の照度変化に強く、局所的に濃淡むらが発生した低品質画像からも、文字パターン行領域あるいは文字パターン領域と思われる領域を自動的に切り出すことができる。
【0021】
ここで、前述のようにして文字パターン行領域を切り出した場合、切り出された文字パターン行領域の中には雑音などの影響によって、本来文字パターン行領域が存在しない箇所でも、文字パターン行領域として切り出されてしまうことがある。そこで、まず切り出された複数の文字パターン行領域の高さに基づいてその平均値を求めた場合、当該平均値に含まれる標準誤差εを次に示す式(2)のように定義する。
【0022】
【数1】
Figure 0003670244
【0023】
ただし、σは切り出した文字パターン行領域の高さの標準偏差を表し、nはその文字パターン行領域の数を表す。
【0024】
そして、その標準誤差εを文字パターン行領域の最小の高さとして、この値よりも高さの大きい文字パターン行領域のみを真の文字パターン行領域とみなしてその切り出しを行うことにする。その様子は図5(a)に示され、その時の背景の平均濃度値の算出範囲を図5(b)に示す。なお、図5(a)において、51は雑音、52は非文字パターン行領域、53は真の文字パターン行領域をそれぞれ表しており、図5(b)において、54は背景の平均濃度値の算出範囲を表している。
【0025】
図5(a)に示すように、雑音51に対応した文字パターン行領域はその高さH1 が標準誤差εよりも小さいので、それは非文字パターン行領域52とみなされてその切り出しは行われない。一方、文字パターンに対応した文字パターン行領域はその高さH2 が標準誤差εよりも大きいので、それは真の文字パターン行領域53とみなされてその文字パターン行領域の切り出しが行われる。ちなみに、このとき切り出した文字パターン行領域の上下座標、およびその領域内と背景の平均濃度値を記憶しておく。また、図5(b)に示すように、文字パターン行領域の背景の平均濃度値は、例えば、文字パターン行領域の上下両端からそれぞれ当該文字パターン行領域の高さHの1/4までの間に設定された算出範囲54から算出した平均濃度値を用いる。
【0026】
このように、パターン切り出し手段14は、切り出す各文字パターン行領域の高さHを、切り出された複数の文字パターン行領域の高さに基づいて算出した標準誤差εと比較て、その高さHが標準誤差εよりも小さい、雑音である可能性のが高い文字パターン行領域については、それを切り出さずに排除するようにしているため、雑音を多少含んだ撮像画像からでも正確に文字パターン行領域の切り出しを行うことが可能となる。
【0027】
また、前述のようにして文字パターン行領域から認識対象の文字パターン領域を切り出した場合、切り出された文字パターン領域の中には、本来1個であるべき文字パターン領域が誤って2個の文字パターン領域に分離して切り出されてしまうことがある。このような誤切り出しを防止するために、まず切り出された複数の文字パターン領域の幅の平均値である平均パターン領域幅Wave と、隣接する文字パターン領域の間隔の平均値である平均パターン領域間隔Dave を求める。次いでそれら平均パターン領域幅Wave および平均パターン領域間隔Dave に含まれる標準誤差εw およびεd についても、次に示す式(3)および式(4)によってそれぞれ求めておく。
【0028】
【数2】
Figure 0003670244
【0029】
ただし、σw 、σd は切り出した複数の文字パターン領域の幅および隣接する文字パターン領域間隔の標準偏差を表し、nは前記文字パターン領域の数、mは前記文字パターン領域間隔の数を表わす。
【0030】
次に前記式(3)および式(4)を参照して、文字パターン領域の最小間隔幅Dsmall 、文字パターン領域の最小幅Wsmall および最大幅Wlarge を、次に示す式(5)〜式(7)を用いて求める。ただし、この式(5)中のαは定数であり、例えば3などの値をとる。
【0031】
Dsmall =Dave −α×εd ・・・・ (5)
Wsmall =εw ・・・・ (6)
Wlarge =Wave +Dsmall +Wsmall ・・・・ (7)
【0032】
続いて、隣接している2つの文字パターン領域において、それら2つの文字パターン領域を接合させた場合の文字パターン領域のパターン領域幅Wと、2つの文字パターン領域の間のパターン領域間隔Dとが、次に示す条件式(8)と条件式(9)を同時に満たしている場合には、それら2つの文字パターン領域は1つの文字パターン領域であるものとみなして接合させる。
【0033】
W≦ Wlarge ・・・・・ (8)
D≦ Dsmall ・・・・・ (9)
【0034】
すなわち、パターン切り出し手段14は、図6(a)の中央に示した隣接している2つの文字パターン領域のように、それら2つの文字パターン領域を接合させた場合のパターン領域幅Wが、式(7)より求めた文字パターン領域の最大幅Wlarge よりも小さく、かつ、それら2つの文字パターン領域のパターン領域間隔Dが、式(5)より求めた文字パターン領域の最小間隔幅Dsmall よりも小さければ、図6(b)の中央部に示すように、それらを結合して1つの文字パターン領域として切り出す。
【0035】
このように、パターン切り出し手段14は、隣接して切り出された2つの文字パターン領域のパターン領域間隔Dが、複数の文字パターン領域間隔より算出された平均パターン領域間隔幅Dave からその標準誤差εd のα倍を減算した計算値である最小間隔幅Dsmall より小さく、かつ、隣接した2つの文字パターン領域を接合させた場合のパターン領域幅Wが、前記最小間隔幅Dsmall に文字パターン領域を含む文字パターン行領域内の平均パターン領域幅Wave とその標準誤差εw を加算して得られた計算値である最大幅Wlarge より小さい場合には、当該隣接した2つの文字パターン領域を接合するようにしているので、雑音などにより誤って1つの文字パターン領域が分離して切り出されてしまっても、その文字パターン領域が自動的に修正されて結合されるため、正確に1つの文字パターン領域として切り出すことができる。
【0036】
次に、前記のような処理を終えて切り出された文字パターン領域の幅Wcharを調べておく。これは雑音などの影響によって、本来文字パターン領域でないにもかかわらず、文字パターン領域として切り出される場合があるからである。そこで、以下に示す条件式(10)を満たす文字パターン領域のみを真の文字パターン領域と見なして切り出しを行うことにより、文字パターン領域の誤切り出しを防止する。
【0037】
Wsmall ≦Wchar ・・・・・ (10)
【0038】
なお、その様子は図7(a)に示され、その時の背景の平均濃度値の算出範囲を図7(b)に示す。図7(a)において、71は雑音、72は非文字パターン領域、73は真の文字パターン領域をそれぞれ表しており、また、図7(b)において、74は背景の平均濃度値の算出範囲を表している。図7(a)に示すように、雑音71に対応した文字パターン領域の幅W1は文字パターン領域の最小幅Wsmall である標準誤差εw よりも小さいので、それを非文字パターン行領域72とみなしてその切り出しは行わない。一方、文字パターンに対応した文字パターン行領域の幅W2、W3は文字パターン領域の最小幅Wsmall よりも大きいので、それを真の文字パターン行領域73とみなしてその文字パターン行領域を切り出す。
【0039】
ちなみに、このとき切り出した文字パターン領域の左右座標、およびその領域内と背景の平均濃度値を記憶しておく。また、図7(b)に示すように、文字パターン領域の背景の平均濃度値は、例えば、文字パターン領域の左右端から文字パターン領域の幅Wの1/4までの間に設定された算出範囲74から算出した平均濃度値を用いる。
【0040】
このように、パターン切り出し手段14は、各文字パターン行領域から切り出された複数の文字パターン領域の幅から算出された標準誤差εw と、当該文字パターン領域の幅Wcharとの比較を行って、その幅Wcharが前記標準誤差εw よりも小さい、雑音である可能性のが高い文字パターン領域については、それを切り出さずに排除するようにしているため、雑音を多少含んだ撮像画像からでも正確に文字パターン領域の切り出しを行うことが可能となる。
【0041】
次に、各文字パターン領域毎に、各文字パターン領域内の平均濃度値Ave_Charとその背景領域の平均濃度値Ave_Backを求める。そして両平均濃度値Ave_CharとAve_Backとを比べることで、文字パターン濃度を以下に示す条件式(11)を用いて判定する。
【0042】
Ave_Char≧ Ave_Back (11)
【0043】
すなわち、上記条件式(11)を満たしている場合にはその文字パターンの濃度は「白」と判定され、また上記条件式(11)を満たしていない場合にはその文字パターンの濃度は「黒」と判定される。
【0044】
このように、パターン切り出し手段14は、切り出された各文字パターン領域内の平均濃度値Ave_Charとその背景領域の平均濃度値Ave_Backとを比較することによって、各文字パターンの濃度を自動的に識別しているので、あらかじめ認識対象とする文字パターンの濃度を設定することなしに、正確に文字パターンの切り出しを行ってその認識処理を行うことができる。
【0045】
次に、パターン切り出し手段14は切り出した文字パターン領域の高さの調整を行う。例えば、小文字によるアルファベットの「a」と「b」のような、高さの異なる文字パターンが同一文字パターン行領域内に存在する場合には、前述の切り出し方法ではまだ不十分である。そこで、文字パターン領域の高さの調整処理が必要となる。この文字パターン領域の高さの調整処理は、まず切り出された各文字パターン領域内で、横方向(パターン行と平行方向)に走査した場合の走査線上の最大濃度値と最小濃度値との濃度差に、当該走査線上の平均濃度値と文字パターン領域の背景の平均濃度値との濃度差を加算した計算値を求める。この計算値は文字パターン部分では高い値を示すが、その背景部分では小さい値を示すようになる。従って、切り出した文字パターン領域の上下端の走査線からそれぞれ順番に前記計算値を求めてゆき、その計算値が最初に所定のしきい値を上回る位置を文字パターン領域の上下端位置とする。
【0046】
図8にその様子を示す。なお、図中の81が文字パターン領域の上端位置、82が文字パターン領域の下端位置を示し、83が高さ調整前の切り出し枠、84が高さ調整後の切り出し枠を示している。すなわち、図8(a)に示すように、高さ調整前の切り出し枠83の上端側から前記計算値が所定のしきい値を最初に上回る位置を求めてそれを当該文字パターン領域の上端位置81とし、高さ調整前の切り出し枠83の下端側から前記計算値が所定のしきい値を最初に上回る位置を求めてそれを当該文字パターン領域の下端位置82とする。そして、この文字パターン領域の上端位置81と下端位置82にて規定される、図8(b)に示した高さ調整後の切り出し枠84に従って、当該文字パターン領域の切り出しを行う。なお、このときその文字パターン領域の上下左右の座標およびその領域内と背景の平均濃度値を記憶しておく。
【0047】
このように、パターン切り出し手段14は、切り出された各文字パターン領域内で横方向に繰り返し走査して、各走査線上の最大濃度値と最小濃度値との濃度差に、その走査線上の平均濃度値と文字パターン領域の背景の平均濃度値との濃度差を加算した計算値を求めることで、文字パターン領域とその背景とを明確に区別できるようにしているため、前記計算値を参照して各文字パターン領域の高さの調整を行うことが可能となり、同一文字パターン行領域内での高さの異なる文字パターン領域の切り出しも正確に行うことが可能となる。
【0048】
次に、処理は図2のステップST3に進み、パターン特徴量抽出手段15は前述のようにしてパターン切り出し手段14が切り出した文字パターン領域内から、文字パターンのパターン特徴量を示す特徴量データを抽出する。図9はこの特徴量データの抽出方法を示した動作説明図であり、図において、91は切り出された認識対象となる文字パターン領域であり、92(i、j)はこの文字パターン領域91を複数(m×n個)に分割したメッシュ領域である。なお、この図9では文字パターン領域91を128個(m=8、n=16個)の領域に分割した場合について示しており、従って、メッシュ領域92(i、j)のカッコ内のiおよびjはそれぞれ、i=0,1,・・・・,7、j=0,1,・・・・,15である。
【0049】
パターン特徴量抽出手段15はまず、パターン切り出し手段14が前述のようにして切り出した文字パターン領域91内で、縦方向(パターン行と垂直方向)および横方向(パターン行と平行方向)毎に走査を行って、それぞれの方向毎の走査線上の最大濃度値と最小濃度値の濃度差から求めた濃度差分布を調べる。図9(a)はその様子を示したものであり、以後、横方向をX軸方向、縦方向をY軸方向という。ここで、図中のhは当該文字パターン領域91の高さを示し、wはその幅を示している。また、H(x)はX軸方向の走査線上の濃度差分布を表し、V(y)はY軸方向の走査線上の濃度差分布を表している。なお、そのときのx、yはそれぞれ、0≦x≦(w−1)、0≦y≦(h−1)で規定される文字パターン領域区間内にある。
【0050】
次にパターン特徴量抽出手段15は、パターン切り出し手段14によって切り出された文字パターン領域91をm×n個のメッシュ領域92(i、j)に分割する。図9(b)はその様子を示したものであり、この文字パターン領域91の分割に際しては、まず、0≦x≦(w−1)、0≦y≦(h−1)で規定される文字パターン領域区間内における走査線上の濃度差分布の累積関数Cx (X)およびCy (Y)を、次に示す式(12)および式(13)を用いて求める。
【0051】
【数3】
Figure 0003670244
【0052】
そして、文字パターン領域91をm×n個のメッシュ領域92(i、j)に分割するために、以下に示す式(14)および式(15)を用いて、メッシュ間隔δx (i)とδy (j)とを求める。
【0053】
δx (i)=Xi+1 −Xi ・・・・・ (14)
δy (j)=Yj+1 −Yj ・・・・・ (15)
【0054】
ただし、上記式(14)および式(15)におけるXi およびYj は、それぞれ次に示す式(16)あるいは式(17)の条件を満たすものである。
【0055】
Xi =min{X|Cx (X)≧i×Cx (w−1)/n}・・・・・ (16)
Yj =min{Y|Cy (Y)≧j×Cy (h−1)/m}・・・・・ (17)
【0056】
すなわち、X軸上の第i番目のメッシュ分割点iは、上記式(14)によって得られたメッシュ間隔δx (i)内での走査線上の濃度差分布H(x)の和が一定になるところに定められる。Y軸に対しても同様に、Y軸上の第j番目のメッシュ分割点jは、式(15)で得られたメッシュ間隔δy (j)内での走査線上の濃度差分布V(y)の和が一定になるところに定められる。以上の操作を行うことによって、文字パターン領域91をm×n個のメッシュ領域92(i、j)に分割する。
【0057】
ここで、各走査線においては濃度差が高い部分ほど文字パターン部分であると考えられる。そこで、前述のようにメッシュ間隔δx (i)およびδy (j)内での走査線上の濃度差分布H(x)あるいはV(y)の和がそれぞれ一定となるように、文字パターン領域91をメッシュ領域92(i、j)に分割した場合には、文字パターン部分では走査線上の濃度差は当然高い値を示すため、メッシュ間隔δx (i)およびδy (j)は細かなものとなる。従って、文字パターン領域91は文字パターン部分ではより多くのメッシュ領域92(i、j)に分割されることになるため、詳細に文字パターンの特徴量データを抽出することが可能となる。その上、文字パターンをメッシュ化しているので、位置ずれによる影響を抑えることができ、また、同一の字種では文字パターンの各部分がほぼ同じメッシュ位置に配置されるようになるため、文字パターンのフォントや印字太さに違いがある場合においても、それらの違いを吸収することが可能になる。
【0058】
このように、パターン特徴量抽出手段15は、切り出された各パターン領域91を複数のメッシュ領域92(i、j)に分割し、濃淡画像よりそれら全てのメッシュ領域92(i、j)の特徴量データを直接計算しているので、画像データを取り込む際に生じた雑音による位置ずれによる誤差を考慮する必要性がなくなり、パターン認識手段16へ入力される特徴量データのデータ量も減少して、認識に要する時間を短縮することができる。また、切り出されたパターン領域91内でのX軸方向およびY軸方向毎の走査線上の最大濃度値と最小濃度値の濃度差から求めた濃度差分布の累積関数Cx (X)およびCy (Y)に基づいてメッシュ分割を行っているので、文字パターン領域の切り出しに際して多少の位置ずれがあっても、その影響を受けずに文字パターンを認識することが可能となり、さらに、X軸方向およびY軸方向毎の走査線上の最大濃度値と最小濃度値との濃度差による濃度差分布の累積関数Cx (X)およびCy (Y)上で、メッシュ間隔内の和が一定となるように分割幅を変動させてメッシュ分割を行っているので、パターンの位置ずれの影響を抑えることが可能となり、パターン認識などに適用した場合には、フォントや印字太さなどの多少の違いを吸収して、少ない登録数で多品種の認識対象のパターンを認識することが可能となる。
【0059】
次にパターン特徴量抽出手段15は、前述のようにして分割した各メッシュ領域92(i、j)毎にその平均濃度値を求め、続いてそれら平均濃度値の最大値である最大濃度値と、最小値である最小濃度値も求めておく。そして、文字パターンの濃度が、文字パターン領域内の平均濃度値の方が背景領域のそれよりも高い「白」の場合には、各メッシュ領域92(i、j)毎に、その平均濃度値から前述の最小濃度値を減算して得られた各メッシュ領域92(i、j)の差引平均濃度値を、前記最大濃度値から最小濃度値を減算した値で除算した、0から1までの実数による計算値を、当該メッシュ領域92(i、j)の正規化された特徴量データとして抽出する。
【0060】
同様にして、文字パターンの濃度が、文字パターン領域内の平均濃度値の方が背景領域のそれよりも低い「黒」の場合には、各メッシュ領域92(i、j)毎に、前述の最大濃度値からその平均濃度値を減算して得られた各メッシュ領域92(i、j)の差引平均濃度値を、前記最大濃度値から最小濃度値を減算した値で除算した計算値(0から1までの実数)を、当該メッシュ領域92(i、j)の正規化された特徴量データとして抽出する。この演算処理を全てのメッシュ領域92(i、j)について実行することにより、文字パターン領域91の1つ1つをm×n個の実数データに変換する。図9(c)はその様子を示したものであり、ここでは、その正規化された0から1までの実数データの値を濃度の変化によって表現している。
【0061】
このように、前述の方法によって各メッシュ領域92(i、j)の特徴量データを抽出した場合には、それぞれメッシュ領域92(i、j)毎に正規化しているため、抽出される特徴量データが以下の照明変化に対して不変となる。すなわち、その1つは、直流的な雑音の重畳などによって濃度が全体的にαだけシフトした場合である。そのときには濃度fは濃度f+αとなるが、それに対応して平均値、最小濃度値、最大濃度値もαだけシフトするため、以前と比べて変わることはない。よって、これらの比である特徴量データも不変である。また、もう1つは、コントラストが変化して各部の濃度がその濃度に応じてk倍された場合である。そのときには濃度fは濃度kfとなるが、それに対応して平均値−最小濃度値、最大濃度値−平均値もk倍される。しかしながら、両者の比をとることによって、分子、分母のk倍が打ち消され、結果的に特徴量データは不変になる。なお、以上の2つの場合において、特徴量データの不変性を示したが、実際の照明変化はこれら2つの場合の組み合わせで近似することができ、従って、特徴量データが実際の照明変化によって影響を受けることはほとんどない。
【0062】
このように、パターン特徴量抽出手段15は分割された各メッシュ領域の平均濃度値を算出し、それら各平均濃度値の最小濃度値と最大濃度値を求めた後に、パターンの濃度が「白」である場合には、その最小濃度値を各メッシュ領域の平均濃度値から減算した差引濃度値を前記最大濃度値と最小濃度値の濃度差で除算した計算値を、またパターンの濃度が「黒」である場合には、前記最大濃度値から各メッシュ領域の平均濃度値を減算した差引濃度値を前記最大濃度値と最小濃度値の濃度差で除算した計算値を、各メッシュ領域の特徴量データとして抽出しているため、抽出される特徴量データは、照明の照度変化による影響を受けにくい、ロバスト(robust:頑強)性に優れたものとなる。
【0063】
次に処理はステップST4に進み、パターン認識手段16はパターン特徴量抽出手段15によって抽出されたm×n個の実数データによる特徴量データを入力として文字パターンの認識処理を実行する。なお、このパターン認識手段16はニューラルネットワークで構成されており、そのニューラルネットワークとしては、例えばコホーネンによる学習ベクトル量子化法に基づく自己組織化ネットワークが用いられる。また、パターン学習手段17によって認識処理の基準データとなる文字パターンの学習はすでに済んでおり、その学習済のデータはパターン学習データベース18に記憶されている。このニューラルネットワークに入力される文字パターンの種類が英数字である場合、当該パターン認識手段16の出力値は、例えば“A”である可能性が0.9、“B”である可能性が3.2などのようになる。ニューラルネットワークの出力値は、その文字パターンに対してどれだけ近いかという量を定量化したもので、出力値の小さいものほどその文字パターンに近いことを示している。
【0064】
以下、上記パターン認識装置を適用したこの発明によるパターン検査装置について説明する。図10はこの発明のパターン検査装置によって良否判定される文字パターンの不良の一例を示す説明図である。図において、131は文字パターンの欠けであり、132は文字パターンについた傷である。
【0065】
次に動作について説明する。
ここで、文字パターンの印字品質の検査とは、図10(a)に符号131を付して示すような文字パターンの欠けや、図10(b)に符号132を付して示すような傷を検出して不良品とするものである。これは、実施の形態1の場合と同様に、パターン特徴量抽出手段15によって抽出された特徴量データを用いて、パターン切り出し手段14の切り出した文字パターンの認識をパターン認識手段16で行う。そして、そのときパターン認識手段16を構成しているニューラルネットワークの出力値が所定のしきい値以下でないときに、その文字パターンは不良であると判定することによって容易に実現できる。
【0066】
以上のように、この実施の形態1によれば、パターン認識手段をニューラルネットワークで構成し、そのニューラルネットワークの出力値が所定のしきい値以下であるか否かで、切り出されたその認識対象パターンが良/不良を判定しているので、文字パターンの欠けや傷などの印字品質の検査を容易に行うことができる効果がある。
【0067】
実施の形態2.
上記実施の形態1では、上記この発明によるパターン認識を文字パターンの印字品質の検査に適用した場合について説明したが、生産ラインにおける異品種の混入検査にも適応可能である。生産ライン上を流れる部品などに異品種が混入したことを検出するためは、文字パターンなどの識別対象パターンそのものの良品/不良品の判別をする必要はなく、部品等の型名さえ認識できればよい。従って、そのような場合には、実施の形態1と同様にパターン認識手段16において、パターン特徴量抽出手段15の抽出した特徴量データを用いてパターン切り出し手段14によって切り出された識別パターンの認識を行い、そのときにパターン認識手段16を構成しているニューラルネットワークの出力値が最小になった識別パターンを強制的に出力して、それに基づいて異品種の混入を検査するようにする。
【0068】
以上のように、この実施の形態2によれば、パターン認識手段をニューラルネットワークによって形成し、そのニューラルネットワークの出力値が最小になった識別パターンを強制的に出力することによって、異品種の混入を検査しているので、生産ライン上を流れる部品などに異品種が混入したことを容易に検出することが可能になる効果がある。
【0069】
【発明の効果】
以上のように、請求項1記載の発明によれば、パターン切り出し手段が、パターン行と平行方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差を用いてパターン行領域を切り出す機能と、それによって切り出された前記パターン行領域内で、前記パターン行と垂直方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差に、当該走査線上の平均濃度値と切り出された前記パターン行領域の背景の平均濃度値との濃度差を加算し、得られた計算値に基づいてパターン領域の切り出しを行うことによって認識対象パターンを1つ1つ切り出す機能を有し、パターン特徴量抽出手段が、切り出されたパターン領域内で縦方向および横方向の走査を実行し、それぞれの方向毎の各走査線上の最大濃度値と最小濃度値との濃度差の分布から求めた縦方向および横方向の濃度差分布の累積関数に基づいて、メッシュ領域の分割を行う機能と、分割された前記各メッシュ領域の特徴量データを濃淡画像から直接計算し、得られた全ての前記メッシュ領域についての計算値をパターン認識手段への出力とする機能とを有し、パターン認識手段をニューラルネットワークによって形成し、パターン特徴量抽出手段の抽出した特徴量データを用いて、パターン切り出し手段の切り出した検査対象パターンの認識を行って、ニューラルネットワークの出力値が所定のしきい値以下でなければ、その切り出された検査対象パターンが不良であると判定するように構成したので、印字された文字パターンなどの検査対象パターンの品質検査を容易に行うことができるパターン検査装置が得られる効果がある。
【0070】
請求項2記載の発明によれば、パターン切り出し手段が、パターン行と平行方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差を用いてパターン行領域を切り出す機能と、それによって切り出された前記パターン行領域内で、前記パターン行と垂直方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差に、当該走査線上の平均濃度値と切り出された前記パターン行領域の背景の平均濃度値との濃度差を加算し、得られた計算値に基づいてパターン領域の切り出しを行うことによって認識対象パターンを1つ1つ切り出す機能を有し、パターン特徴量抽出手段が、切り出されたパターン領域内で縦方向および横方向の走査を実行し、それぞれの方向毎の各走査線上の最大濃度値と最小濃度値との濃度差の分布から求めた縦方向および横方向の濃度差分布の累積関数に基づいて、メッシュ領域の分割を行う機能と、分割された前記各メッシュ領域の特徴量データを濃淡画像から直接計算し、得られた全ての前記メッシュ領域についての計算値をパターン認識手段への出力とする機能とを有し、パターン認識手段をニューラルネットワークによって形成し、パターン特徴量抽出手段の抽出した特徴量データを用いて、パターン切り出し手段の切り出した識別パターンの認識を行って、ニューラルネットワークの出力値が最小になった識別パターンを強制的に出力するように構成したので、部品等の型名を簡易的に認識することができ、生産ライン上における異品種の混入を容易に検出できる異品種混入検査装置が得られる効果がある。
【図面の簡単な説明】
【図1】 パターン認識装置の構成を示すブロック図である。
【図2】 パターン認識装置における処理の流れを示すフローチャートである。
【図3】 パターン認識装置におけるパターン切り出しの原理を示す動作説明図である。
【図4】 パターン認識装置におけるパターン切り出しのためのしきい値算出の原理を示す動作説明図である。
【図5】 パターン認識装置における文字パターン行領域の切り出しの様子を示す動作説明図である。
【図6】 パターン認識装置における文字パターン領域の接合の様子を示す動作説明図である。
【図7】 パターン認識装置における文字パターン領域の切り出しの様子を示す動作説明図である。
【図8】 パターン認識装置における文字パターン領域の高さ調節の様子を示す動作説明図である。
【図9】 パターン認識装置における特徴量データの抽出方法を示す動作説明図である。
【図10】 パターン認識装置を適応したこの発明の実施の形態1によるパターン検査装置で良否判定される文字パターンの不良の一例を示す説明図である。
【図11】 従来のパターン認識装置における文字パターンの濃淡画像の2値化原理を示す説明図である。
【符号の説明】
11 画像撮像装置、14 パターン切り出し手段、15 パターン特徴量抽出手段、16 パターン認識手段。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a pattern inspection apparatus to which a pattern recognition apparatus for recognizing various shape patterns to be recognized, including characters such as characters, symbols, trademarks, and the like cut out one by one from image data, and mixed with different varieties. The present invention relates to an inspection device.
[0002]
[Prior art]
FIG. 11 shows, for example, “Character Pattern Detection and Recognition from Scene Images” published on pages 1037-1047 of “Journal of the Institute of Electronics, Information and Communication Engineers D”, Vol. J71-D NO.6 (1988). (Akio Shio) is an explanatory diagram showing the principle of the binarization method of the grayscale image of the character pattern in the conventional pattern recognition apparatus. In this explanatory diagram, a grayscale image is divided into a plurality of small areas, binarization processing is performed by setting an optimum threshold value for each of the divided small areas, and each character pattern is obtained from the binarized image obtained thereby. Is shown, and each of these character patterns is recognized. In FIG. 11, reference numeral 141 is an original image of a character pattern grayscale image, and 142 is a small area obtained by dividing the original image 141 into a plurality of portions.
[0003]
Next, the operation will be described.
Here, the density contrast between the character pattern and the background portion of the character pattern is high and locally binary, and can be read by character recognition processing if a portion corresponding to the character pattern is cut out as a pattern. Therefore, in a general pattern recognition device, a grayscale image of a character pattern captured using an image capturing device such as a television camera is binarized with a predetermined threshold value and converted into a binarized image, and the binary Each character pattern is cut out from the digitized image, and each character pattern is recognized. However, in such a system, the binarized image may be missing due to the influence of illumination illumination change at the time of image capture, or a part of the background part may be detected by adhesion to the character pattern. In order to obtain a good binarized image, it is necessary to strictly adjust the illumination.
[0004]
Therefore, in this method, first, as shown in FIG. 11A, the original image 141 of the gray image of the captured character pattern is divided into a plurality of (in the example shown, 3 × 3 = 9) small regions 142, For each of the divided small regions 142, optimum threshold values θ11 to θ33 for binarization as shown in FIG. 11B are set. Since the threshold values θ11 to θ33 of the small regions 142 thus obtained are discontinuous at the boundaries of the small regions 142, binarization processing is performed for each small region 142 using the thresholds θ11 to θ33 as they are. In this case, discontinuity occurs in the image at the boundary portion of the small region 142 as shown in FIG. Therefore, as shown in FIG. 14 (d), threshold values θ11 to θ33 obtained for each small region 142 are given to the image at the center of each small region 142, and linear interpolation is performed. Binarization processing is obtained using a threshold value. In this method, each character pattern is cut out from the binarized image thus obtained, and each character pattern is recognized.
[0005]
[Problems to be solved by the invention]
Most of the conventional pattern recognition apparatuses binarize the entire character pattern grayscale image with a fixed predetermined threshold value. Therefore, if the illumination illuminance changes, the binarized image has a large amount. This has the effect of causing loss of character patterns and adhesion, which makes it extremely vulnerable to changes in illuminance. Further, a method of dividing the original image 141 of the grayscale image shown in FIG. 11 into a plurality of small areas 142 and obtaining a binary image from the binarization processing for each of the divided small areas 142 is a fixed predetermined process. Compared to the method of binarizing the entire image with a threshold value, it is effective for a low-quality image in which shading unevenness occurs locally. However, depending on the division method of the small region 142, a noise region may also be extracted. Due to the drawbacks, it is not always possible to accurately cut out character patterns. Therefore, even if it has a very good recognition processing function, the recognition process itself is premised on the accurate extraction of the character pattern to be recognized, so character pattern recognition will not function well, and the imaging environment will not necessarily be A pattern recognition apparatus used in the field of FA (Factory Automation), which is not always good and does not always provide a good image, often causes erroneous recognition of character patterns. For this reason, even if the conventional pattern recognition apparatus is applied, there has been a problem that quality inspection of inspection target patterns such as printed character patterns cannot be easily performed.
[0006]
The present invention has been made to solve the above-described problems, and accurate recognition can always be stably performed even for a low-quality image that is resistant to changes in illumination illuminance and has locally uneven brightness. An object of the present invention is to obtain a character pattern inspection apparatus in which a pattern recognition apparatus having a relatively simple circuit configuration is applied to the inspection of the print quality of a character pattern.
[0007]
It is another object of the present invention to obtain a different product mixture inspection apparatus in which the pattern recognition device is applied to a mixed product inspection of parts such as parts flowing on a production line.
[0008]
[Means for Solving the Problems]
The pattern inspection apparatus according to the invention of claim 1 comprises: Pattern cutout means for cutting out each inspection target pattern from the grayscale image picked up by the image pickup apparatus using the density difference between the pattern and its background, and the areas of the respective inspection target patterns cut out by the pattern cutout means Pattern feature extraction means for directly extracting the normalized feature quantity data from the grayscale image and the feature extraction data formed by the neural network and extracted by the pattern feature quantity extraction means. Recognizing the inspection target pattern cut out by the means, and when the output value of the neural network is not less than or equal to a predetermined threshold, pattern recognition means for determining that the cut out recognition target pattern is defective, The pattern cutting means scans in the direction parallel to the pattern row. And a function of cutting out the pattern row region using the density difference between the maximum density value and the minimum density value on each scanning line, and scanning in the direction perpendicular to the pattern row within the pattern row region cut out by the function To the density difference between the maximum density value and the minimum density value on each scanning line, and add the density difference between the average density value on the scanning line and the average density value of the background of the extracted pattern row area. And a function of cutting out each recognition target pattern by cutting out the pattern area based on the obtained calculated value, and the pattern feature amount extraction unit is configured to perform vertical and horizontal in the cut out pattern area. A direction scan is performed, and a measurement is performed based on a cumulative function of the density difference distribution in the vertical and horizontal directions obtained from the density difference distribution between the maximum density value and the minimum density value on each scan line in each direction. A function for dividing the mesh area, and feature data of each divided mesh area is directly calculated from a grayscale image, and the calculated values for all the obtained mesh areas are output to the pattern recognition means With function It is what I did.
[0009]
The different kind mixing inspection apparatus according to the invention of claim 2 A pattern cutout unit that cuts out identification patterns indicating product types one by one from the grayscale image picked up by the image pickup device using the density difference between the pattern and the background thereof, and each of the cut out pieces by the pattern cutout unit Pattern feature quantity extraction means for directly extracting normalized feature quantity data in the area of the identification pattern from the grayscale image and a neural network, and using the feature quantity data extracted by the pattern feature quantity extraction means Pattern recognition means for recognizing the identification pattern cut out by the pattern cutout means, forcibly outputting the identification pattern with the minimum output value of the neural network, and inspecting mixing of different varieties. The pattern cutout means executes scanning in a direction parallel to the pattern row. The function of cutting out the pattern row area using the density difference between the maximum density value and the minimum density value on each scanning line, and scanning in the direction perpendicular to the pattern row is executed in the pattern row area cut out by the function. Thus, the density difference between the maximum density value and the minimum density value on each scanning line is added to the density difference between the average density value on the scanning line and the average density value of the background of the extracted pattern row area. The pattern feature amount extraction unit has a function of cutting out recognition target patterns one by one by cutting out pattern areas based on the calculated values, and the pattern feature amount extraction unit performs vertical and horizontal scanning within the cut out pattern areas. Based on the cumulative function of the density difference distribution in the vertical and horizontal directions obtained from the density difference distribution between the maximum density value and the minimum density value on each scanning line in each direction. A function of dividing the feature amount data of each divided mesh region directly from a grayscale image, and a function of outputting calculated values for all the obtained mesh regions to the pattern recognition unit; Have It is what I did.
[0010]
DETAILED DESCRIPTION OF THE INVENTION
An embodiment of the present invention will be described below.
Embodiment 1 FIG.
1 is a block diagram showing the configuration of a pattern recognition apparatus according to Embodiment 1 of the present invention. In the figure, reference numeral 11 denotes an image pickup device that picks up an image of a subject on which a pattern as a recognition target such as a character, a symbol, or a trademark is written, and generates image data of a grayscale image of the recognition target. TV camera or the like by a coupling device) is used. 12 is a pattern recognition device that performs image processing of the grayscale image captured by the image imaging device 11, cuts out recognition target patterns one by one from the grayscale image, and performs recognition processing of each recognition target pattern; For example, an electronic computer using a neural network is used.
[0011]
In the pattern recognition device 12, reference numeral 13 denotes image data storage means for storing image data of a grayscale image input from the image pickup device 11 to the pattern recognition device 12. 14 reads out the image data stored in the image data storage means 13 and directly uses the density difference between the pattern and the background of the pattern from the grayscale image as one character pattern area as a recognition target pattern area. This is pattern cutting means for cutting out one pattern. Reference numeral 15 denotes a pattern feature quantity extraction means for directly extracting the normalized feature quantity data in each character pattern area cut out by the pattern cutout means 14 from the grayscale image.
[0012]
Reference numeral 16 denotes pattern recognition means for executing recognition processing of the character pattern area cut out by the pattern cutout means 14 using the feature quantity data extracted by the pattern feature quantity extraction means 15, for example, a neural network having a learning function. Configured by the network. Reference numeral 17 denotes a pattern learning means which is a learning means of a neural network constituting the pattern recognition means 16, and 18 denotes a pattern learning database which is the learning database. Incidentally, the neural network constituting the pattern recognition means 16 has already learned the reference pattern data stored in the pattern learning database 18 in the pattern learning means 17.
[0013]
Next, the operation will be described.
Here, FIG. 2 is a flowchart showing a processing flow of the pattern recognition apparatus 12 according to the first embodiment. 3 to 8 are operation explanatory views for explaining a character pattern region cutting method by the pattern cutout means 14, and FIG. 9 is for explaining a feature amount data extraction method by the pattern feature amount extraction means 15. FIG.
[0014]
First, in step ST <b> 1, grayscale image data captured by the image capturing device 11 and stored in the image data storage unit 13 is input to the pattern cutout unit 14. FIG. 3 is an operation explanatory diagram for explaining the principle of pattern cutout that cuts out a character pattern region to be recognized from input grayscale image data. Here, characters are extracted from image data of the character pattern “A”. It shows a case where a pattern area is cut out. In the figure, reference numerals 31 and 32 denote scanning lines for scanning the pattern density image, and reference numeral 33 denotes a character pattern region to be cut out. FIG. 3A shows the density value on the scanning line 31 passing over the character pattern background, and FIG. 3B shows the density value on the scanning line 32 passing over the character pattern. Is shown.
[0015]
Here, looking at the density values of the scanning lines 31 and 32, it can be seen that the variation of the scanning lines 32 on the character pattern is more intense than the scanning lines 31 on the background of the character pattern. . Therefore, as shown in FIG. 3C, it is considered that the character pattern region has a large density value width on the scanning line 32 (density difference between the maximum density value and the minimum density value on the scan line). Therefore, in step ST2 of FIG. 2, the pattern cutout unit 14 first performs a scan in the direction parallel to the pattern row to obtain the calculated value cal1 of the density value width of the maximum density value and the minimum density value on each scanning line, The density value width distribution on each scanning line as shown in FIG. 3D is examined, and the character pattern row region is cut out based on the distribution. Subsequently, in the character pattern row area cut out earlier, scanning in the direction perpendicular to the pattern row is performed, and the average density on the scanning line is calculated by the density difference between the maximum density value and the minimum density value on each scanning line. The calculated value cal2 is calculated by adding the density difference between the value and the average density value of the background of the character pattern row area previously cut out, and the grayscale image read from the image data storage means 13 with reference to the calculated value cal2 The character pattern areas 33 to be recognized shown in FIG. 3 (e) are cut out one by one directly.
[0016]
As described above, when the character pattern region 33 is cut out, scanning is repeatedly performed in the direction parallel to the pattern row, and the character pattern row region is cut out using the density difference between the maximum density value and the minimum density value on each scanning line. Therefore, the character pattern line area can be cut out by detecting a slight difference between the character pattern line area and its background, and then scanned in the direction perpendicular to the pattern line in the cut out character pattern line area. A calculated value obtained by adding the density difference between the average density value on the scanning line and the average density value of the background of the character pattern line area previously cut out to the density difference between the maximum density value and the minimum density value on the scanning line is used. Since the pattern is cut out one by one, even if the pattern is difficult to detect a density difference even when scanned in a direction perpendicular to the pattern row, for example, “1”, By looking at the calculated values, it becomes possible to specify the character pattern region 33 even if the pattern density is low. Even if the pattern density becomes low due to the change in illumination illuminance, the influence is affected. An accurate recognition target pattern can be cut out even from a low-quality image that is less likely to be received and has uneven shading locally.
[0017]
Note that the threshold values of the calculated values cal1 and cal2 referred to when the character pattern area is cut out are obtained as the appearance frequency distributions of the calculated values cal1 and cal2, respectively. As shown in FIG. And class 2 are set to a value that maximizes the inter-class variance shown in the following formula (1), and the optimum character pattern area 33 is automatically cut out in this way. ing.
[0018]
Figure 0003670244
[0019]
Where μ is the overall average value, ω0 is the left area when the frequency distribution is divided into left and right by the threshold α, ω1 is also the right area, μ0 is the left average value, and μ1 is the right average value. Respectively.
[0020]
As described above, the pattern cutout unit 14 sets the threshold value for cutting out the character pattern row area or the character pattern region as the density difference between the maximum density value and the minimum density value on each scanning line scanned in the direction parallel to the pattern row. Frequency density distribution, or the density difference between the maximum density value and the minimum density value on each scanning line that scans in the direction perpendicular to the pattern line, and the average density value on the scanning line and the average of the extracted character pattern line area background Since the appearance frequency distribution of the value obtained by adding the density difference with the density value is divided into two classes, it is set to the value that maximizes the variance value between classes, so the pattern and background are optimized. Therefore, the character pattern line area or the area that seems to be a character pattern area is automatically detected from a low-quality image that is resistant to changes in illuminance of illumination and has locally uneven shading. Ri can be issued.
[0021]
Here, when the character pattern line area is cut out as described above, even if the character pattern line area does not originally exist in the cut out character pattern line area due to noise or the like, It may be cut out. Therefore, when the average value is first obtained based on the heights of the plurality of character pattern line regions that are cut out, the standard error ε included in the average value is defined as shown in the following equation (2).
[0022]
[Expression 1]
Figure 0003670244
[0023]
However, (sigma) represents the standard deviation of the height of the cut-out character pattern line area, and n represents the number of the character pattern line area.
[0024]
Then, assuming that the standard error ε is the minimum height of the character pattern line area, only the character pattern line area having a height higher than this value is regarded as a true character pattern line area, and the cutout is performed. The state is shown in FIG. 5A, and the calculation range of the average density value of the background at that time is shown in FIG. In FIG. 5A, 51 represents noise, 52 represents a non-character pattern line area, and 53 represents a true character pattern line area. In FIG. 5B, 54 represents the average density value of the background. Represents the calculation range.
[0025]
As shown in FIG. 5A, since the height H1 of the character pattern line area corresponding to the noise 51 is smaller than the standard error ε, it is regarded as a non-character pattern line area 52 and is not cut out. . On the other hand, since the height H2 of the character pattern line area corresponding to the character pattern is larger than the standard error ε, it is regarded as the true character pattern line area 53 and the character pattern line area is cut out. Incidentally, the upper and lower coordinates of the character pattern row area cut out at this time, and the average density value in the area and the background are stored. Further, as shown in FIG. 5B, the average density value of the background of the character pattern line area is, for example, from the upper and lower ends of the character pattern line area to ¼ of the height H of the character pattern line area. The average density value calculated from the calculation range 54 set in between is used.
[0026]
In this way, the pattern cutout means 14 compares the height H of each character pattern line area to be cut out with the standard error ε calculated based on the heights of the plurality of character pattern line areas cut out, and compares the height H The character pattern line area, which is less than the standard error ε and has a high possibility of noise, is excluded without being cut out. A region can be cut out.
[0027]
In addition, when the character pattern area to be recognized is cut out from the character pattern line area as described above, the character pattern area that should originally be one in the cut out character pattern area is erroneously two characters. The pattern area may be cut out separately. In order to prevent such erroneous cutout, first, an average pattern area width Wave that is an average value of the widths of a plurality of character pattern areas that are cut out, and an average pattern area interval that is an average value of intervals between adjacent character pattern areas Find Dave. Next, standard errors εw and εd included in the average pattern region width Wave and the average pattern region interval Dave are also obtained by the following equations (3) and (4), respectively.
[0028]
[Expression 2]
Figure 0003670244
[0029]
Here, σw and σd represent the widths of the plurality of character pattern regions cut out and the standard deviation of the adjacent character pattern region intervals, n represents the number of the character pattern regions, and m represents the number of the character pattern region intervals.
[0030]
Next, referring to the equations (3) and (4), the minimum interval width Dsmall of the character pattern region, the minimum width Wsmall and the maximum width Wlarge of the character pattern region are expressed by the following equations (5) to (7). ). However, α in the equation (5) is a constant and takes a value such as 3, for example.
[0031]
Dsmall = Dave−α × εd (5)
Wsmall = εw (6)
Wlarge = Wave + Dsmall + Wsmall (7)
[0032]
Subsequently, in the two adjacent character pattern areas, the pattern area width W of the character pattern area when the two character pattern areas are joined together and the pattern area interval D between the two character pattern areas are: If the following conditional expression (8) and conditional expression (9) are simultaneously satisfied, the two character pattern areas are regarded as one character pattern area and are joined.
[0033]
W ≦ Wlarge (8)
D ≦ Dsmall (9)
[0034]
That is, the pattern cutout means 14 has a pattern area width W when the two character pattern areas are joined as in the case of two adjacent character pattern areas shown in the center of FIG. The maximum width Wlarge of the character pattern area obtained from (7) is smaller, and the pattern area interval D between the two character pattern areas is smaller than the minimum interval width Dsmall of the character pattern area obtained from equation (5). For example, as shown in the center part of FIG. 6B, they are combined and cut out as one character pattern region.
[0035]
As described above, the pattern cutout unit 14 determines that the standard error εd of the pattern area interval D between two adjacent character pattern areas extracted from the average pattern area interval width Dave calculated from the plurality of character pattern area intervals. A character pattern that is smaller than the minimum interval width Dsmall, which is a calculated value obtained by subtracting α times, and a pattern region width W when two adjacent character pattern regions are joined includes a character pattern region in the minimum interval width Dsmall. When the average pattern area width Wave in the line area is smaller than the maximum width Wlarge which is a calculated value obtained by adding the standard error εw, the two adjacent character pattern areas are joined. Even if one character pattern area is accidentally separated and cut out due to noise, the character pattern area is automatically corrected. For coupling, it can be cut out exactly as one character pattern area.
[0036]
Next, the width Wchar of the character pattern area cut out after the above processing is checked. This is because, due to the influence of noise or the like, the character pattern region may be cut out even though it is not originally a character pattern region. Therefore, the character pattern region is prevented from being erroneously cut out by cutting out only the character pattern region that satisfies the following conditional expression (10) as the true character pattern region.
[0037]
Wsmall ≤ Wchar (10)
[0038]
The situation is shown in FIG. 7A, and the calculation range of the average density value of the background at that time is shown in FIG. 7B. In FIG. 7A, 71 represents noise, 72 represents a non-character pattern area, and 73 represents a true character pattern area. In FIG. 7B, 74 represents a calculation range of the average density value of the background. Represents. As shown in FIG. 7A, since the width W1 of the character pattern area corresponding to the noise 71 is smaller than the standard error εw which is the minimum width Wsmall of the character pattern area, it is regarded as the non-character pattern row area 72. The cutout is not performed. On the other hand, since the widths W2 and W3 of the character pattern line area corresponding to the character pattern are larger than the minimum width Wsmall of the character pattern area, it is regarded as the true character pattern line area 73 and the character pattern line area is cut out.
[0039]
Incidentally, the left and right coordinates of the character pattern area cut out at this time, and the average density values of the area and background are stored. Further, as shown in FIG. 7B, the average density value of the background of the character pattern region is calculated, for example, between the left and right ends of the character pattern region and ¼ of the width W of the character pattern region. The average density value calculated from the range 74 is used.
[0040]
Thus, the pattern cutout means 14 compares the standard error εw calculated from the widths of the plurality of character pattern regions cut out from each character pattern row region with the width Wchar of the character pattern region, and A character pattern region having a width Wchar smaller than the standard error εw and having a high possibility of being a noise is excluded without being cut out. The pattern area can be cut out.
[0041]
Next, for each character pattern area, an average density value Ave_Char in each character pattern area and an average density value Ave_Back of the background area are obtained. Then, by comparing both average density values Ave_Char and Ave_Back, the character pattern density is determined using the following conditional expression (11).
[0042]
Ave_Char ≧ Ave_Back (11)
[0043]
That is, when the conditional expression (11) is satisfied, the density of the character pattern is determined to be “white”, and when the conditional expression (11) is not satisfied, the density of the character pattern is “black”. Is determined.
[0044]
In this way, the pattern cutout means 14 automatically identifies the density of each character pattern by comparing the average density value Ave_Char in each cutout character pattern area with the average density value Ave_Back in the background area. Therefore, the character pattern can be accurately cut out and recognized without setting the density of the character pattern to be recognized in advance.
[0045]
Next, the pattern cutout means 14 adjusts the height of the cutout character pattern area. For example, when character patterns having different heights, such as lowercase alphabets “a” and “b”, exist in the same character pattern row area, the above-described clipping method is still insufficient. Therefore, it is necessary to adjust the height of the character pattern area. In this character pattern area height adjustment process, the density between the maximum density value and the minimum density value on the scanning line when scanning in the horizontal direction (in the direction parallel to the pattern row) is first performed in each cut out character pattern area. A calculated value is obtained by adding the density difference between the average density value on the scanning line and the average density value of the background of the character pattern area to the difference. This calculated value shows a high value in the character pattern portion, but shows a small value in the background portion. Therefore, the calculated values are obtained sequentially from the upper and lower scanning lines of the cut out character pattern area, and the positions where the calculated values first exceed a predetermined threshold are set as the upper and lower end positions of the character pattern area.
[0046]
This is shown in FIG. In the figure, 81 indicates the upper end position of the character pattern area, 82 indicates the lower end position of the character pattern area, 83 indicates a cutout frame before height adjustment, and 84 indicates a cutout frame after height adjustment. That is, as shown in FIG. 8A, a position where the calculated value first exceeds a predetermined threshold value is obtained from the upper end side of the cutout frame 83 before height adjustment, and is used as the upper end position of the character pattern area. 81, a position where the calculated value first exceeds a predetermined threshold value is determined from the lower end side of the cutout frame 83 before height adjustment, and is set as the lower end position 82 of the character pattern region. Then, the character pattern area is cut out according to the height-adjusted cut-out frame 84 shown in FIG. 8B defined by the upper end position 81 and the lower end position 82 of the character pattern area. At this time, the upper, lower, left and right coordinates of the character pattern area and the average density value of the area and the background are stored.
[0047]
In this manner, the pattern cutout unit 14 repeatedly scans in the horizontal direction within each cutout character pattern region, and the average density on the scanning line is determined by the density difference between the maximum density value and the minimum density value on each scanning line. The character pattern area and its background can be clearly distinguished by obtaining a calculated value obtained by adding the density difference between the value and the average density value of the background of the character pattern area. It is possible to adjust the height of each character pattern area, and it is also possible to accurately cut out character pattern areas having different heights within the same character pattern line area.
[0048]
Next, the process proceeds to step ST3 in FIG. 2, and the pattern feature quantity extraction unit 15 extracts feature quantity data indicating the pattern feature quantity of the character pattern from the character pattern area cut out by the pattern cutout unit 14 as described above. Extract. FIG. 9 is an operation explanatory diagram showing this feature data extraction method. In the figure, 91 is a character pattern region to be recognized, and 92 (i, j) is a character pattern region 91. This is a mesh region divided into a plurality (m × n). FIG. 9 shows a case where the character pattern area 91 is divided into 128 (m = 8, n = 16) areas. Accordingly, i and i in the parentheses of the mesh area 92 (i, j) are shown. j is i = 0, 1,..., 7 and j = 0, 1,.
[0049]
The pattern feature quantity extraction unit 15 first scans in the vertical direction (pattern row and vertical direction) and horizontal direction (direction parallel to the pattern row) within the character pattern area 91 cut out by the pattern cutout unit 14 as described above. The density difference distribution obtained from the density difference between the maximum density value and the minimum density value on the scanning line in each direction is examined. FIG. 9A shows this state, and hereinafter, the horizontal direction is referred to as the X-axis direction and the vertical direction is referred to as the Y-axis direction. Here, h in the figure indicates the height of the character pattern area 91, and w indicates the width thereof. H (x) represents the density difference distribution on the scanning line in the X-axis direction, and V (y) represents the density difference distribution on the scanning line in the Y-axis direction. Note that x and y at that time are in the character pattern area section defined by 0 ≦ x ≦ (w−1) and 0 ≦ y ≦ (h−1), respectively.
[0050]
Next, the pattern feature quantity extraction unit 15 divides the character pattern area 91 cut out by the pattern cutout unit 14 into m × n mesh areas 92 (i, j). FIG. 9B shows the situation. When the character pattern area 91 is divided, first, 0 ≦ x ≦ (w−1) and 0 ≦ y ≦ (h−1) are defined. Cumulative functions Cx (X) and Cy (Y) of the density difference distribution on the scanning line in the character pattern region section are obtained using the following equations (12) and (13).
[0051]
[Equation 3]
Figure 0003670244
[0052]
Then, in order to divide the character pattern area 91 into m × n mesh areas 92 (i, j), the mesh intervals δx (i) and δy are expressed by using the following equations (14) and (15). (J) is obtained.
[0053]
δx (i) = Xi + 1−Xi (14)
δy (j) = Yj + 1−Yj (15)
[0054]
However, Xi and Yj in the above formulas (14) and (15) satisfy the conditions of the following formulas (16) and (17), respectively.
[0055]
Xi = min {X | Cx (X) ≥i * Cx (w-1) / n} (16)
Yj = min {Y | Cy (Y) ≥j * Cy (h-1) / m} (17)
[0056]
That is, at the i-th mesh division point i on the X axis, the sum of the density difference distribution H (x) on the scanning line within the mesh interval δx (i) obtained by the above equation (14) becomes constant. However, it is decided. Similarly to the Y axis, the j-th mesh division point j on the Y axis is the density difference distribution V (y) on the scanning line within the mesh interval δy (j) obtained by Expression (15). It is determined where the sum of is constant. By performing the above operation, the character pattern area 91 is divided into m × n mesh areas 92 (i, j).
[0057]
Here, in each scanning line, a portion having a higher density difference is considered to be a character pattern portion. Therefore, as described above, the character pattern region 91 is set so that the sum of the density difference distributions H (x) or V (y) on the scanning lines within the mesh intervals δx (i) and δy (j) is constant. When divided into mesh areas 92 (i, j), the density difference on the scanning line naturally shows a high value in the character pattern portion, so the mesh intervals δx (i) and δy (j) are fine. Therefore, the character pattern area 91 is divided into a larger number of mesh areas 92 (i, j) in the character pattern portion, so that it is possible to extract character pattern feature amount data in detail. In addition, since the character pattern is meshed, the effect of displacement can be suppressed, and each part of the character pattern is placed at almost the same mesh position for the same character type. Even if there is a difference in the font or print thickness, it is possible to absorb these differences.
[0058]
As described above, the pattern feature amount extraction unit 15 divides each extracted pattern region 91 into a plurality of mesh regions 92 (i, j), and features of all the mesh regions 92 (i, j) from the grayscale image. Since the amount data is directly calculated, there is no need to take into account errors due to noise caused by the noise generated when capturing the image data, and the amount of feature data input to the pattern recognition means 16 is also reduced. The time required for recognition can be shortened. Also, cumulative functions Cx (X) and Cy (Y (Y) of density difference distribution obtained from the density difference between the maximum density value and the minimum density value on the scanning line for each of the X-axis direction and the Y-axis direction in the cut pattern area 91. ), The character pattern can be recognized without being affected by a slight positional shift when the character pattern area is cut out. The division width so that the sum within the mesh interval is constant on the cumulative functions Cx (X) and Cy (Y) of the density difference distribution due to the density difference between the maximum density value and the minimum density value on the scanning line for each axial direction. Since the mesh division is performed by changing the pattern, it is possible to suppress the effect of pattern misalignment. When applied to pattern recognition, it absorbs some differences such as font and print thickness. It is possible to recognize the recognition target pattern of many kinds with a small number of registrations.
[0059]
Next, the pattern feature quantity extraction means 15 obtains an average density value for each mesh area 92 (i, j) divided as described above, and then determines the maximum density value which is the maximum value of these average density values. The minimum density value, which is the minimum value, is also obtained. When the density of the character pattern is “white” in which the average density value in the character pattern area is higher than that in the background area, the average density value for each mesh area 92 (i, j) The subtracted average density value of each mesh region 92 (i, j) obtained by subtracting the above-mentioned minimum density value from is divided by the value obtained by subtracting the minimum density value from the maximum density value, and is 0 to 1. A calculated value by a real number is extracted as normalized feature amount data of the mesh region 92 (i, j).
[0060]
Similarly, when the density of the character pattern is “black” in which the average density value in the character pattern area is lower than that in the background area, for each mesh area 92 (i, j), A calculated value (0) obtained by dividing the subtracted average density value of each mesh region 92 (i, j) obtained by subtracting the average density value from the maximum density value by the value obtained by subtracting the minimum density value from the maximum density value. To a real number from 1 to 1) is extracted as normalized feature value data of the mesh region 92 (i, j). By executing this calculation process for all mesh regions 92 (i, j), each character pattern region 91 is converted into m × n real number data. FIG. 9C shows this state, and here, the normalized real number data values from 0 to 1 are expressed by changes in density.
[0061]
As described above, when the feature amount data of each mesh region 92 (i, j) is extracted by the above-described method, the feature amount data is extracted because each mesh region 92 (i, j) is normalized. Data is invariant to the following lighting changes: That is, one of them is a case where the density is entirely shifted by α due to DC noise superposition or the like. At that time, the density f becomes the density f + α, but the average value, the minimum density value, and the maximum density value are also shifted by α correspondingly, so that there is no change compared to the previous case. Therefore, the feature amount data that is the ratio of these is unchanged. The other is a case where the contrast changes and the density of each part is multiplied by k according to the density. At that time, the density f becomes the density kf, and the average value-minimum density value and the maximum density value-average value are also multiplied by k correspondingly. However, by taking the ratio of the two, k times the numerator and denominator are canceled out, and as a result, the feature data becomes invariant. In addition, in the above two cases, the invariance of the feature amount data is shown. However, the actual illumination change can be approximated by a combination of these two cases, and therefore the feature amount data is influenced by the actual illumination change. There is little to receive.
[0062]
As described above, the pattern feature quantity extraction unit 15 calculates the average density value of each divided mesh area, and after obtaining the minimum density value and the maximum density value of each of the average density values, the pattern density is “white”. In this case, the subtracted density value obtained by subtracting the minimum density value from the average density value of each mesh area is divided by the density difference between the maximum density value and the minimum density value, and the density of the pattern is “black”. ”, The calculated density value obtained by subtracting the average density value of each mesh area from the maximum density value and dividing by the density difference between the maximum density value and the minimum density value is used as the feature value of each mesh area. Since it is extracted as data, the extracted feature value data is not easily affected by a change in illumination illuminance and has excellent robustness.
[0063]
Next, the process proceeds to step ST4, where the pattern recognition unit 16 performs character pattern recognition processing with the feature amount data of m × n real number data extracted by the pattern feature amount extraction unit 15 as an input. The pattern recognition means 16 is constituted by a neural network. As the neural network, for example, a self-organizing network based on a learning vector quantization method by Kohonen is used. The pattern learning means 17 has already learned the character pattern serving as the reference data for the recognition process, and the learned data is stored in the pattern learning database 18. When the type of the character pattern input to this neural network is alphanumeric, the output value of the pattern recognition means 16 is, for example, 0.9 as a possibility of being “A” and 3 as a possibility of being “B”. .2 etc. The output value of the neural network is a quantification of how close to the character pattern, and the smaller the output value, the closer to the character pattern.
[0064]
Hereinafter, a pattern inspection apparatus according to the present invention to which the pattern recognition apparatus is applied will be described. FIG. 10 is an explanatory diagram showing an example of a defective character pattern that is determined to be good or bad by the pattern inspection apparatus of the present invention. In the figure, 131 is a missing character pattern, and 132 is a scratch on the character pattern.
[0065]
Next, the operation will be described.
Here, the inspection of the print quality of the character pattern means that the character pattern is missing as indicated by reference numeral 131 in FIG. 10 (a) or scratched as indicated by reference numeral 132 in FIG. 10 (b). Is detected as a defective product. As in the case of the first embodiment, the pattern recognition unit 16 recognizes the character pattern cut out by the pattern cutout unit 14 using the feature amount data extracted by the pattern feature amount extraction unit 15. Then, when the output value of the neural network constituting the pattern recognition means 16 is not less than a predetermined threshold value, it can be easily realized by determining that the character pattern is defective.
[0066]
As described above, according to the first embodiment, the pattern recognition means is configured by a neural network, and the recognition target cut out depending on whether or not the output value of the neural network is below a predetermined threshold value. Since the pattern is judged as good / bad, there is an effect that it is possible to easily inspect the print quality such as chipping or scratching of the character pattern.
[0067]
Embodiment 2. FIG.
In the first embodiment, the case where the pattern recognition according to the present invention is applied to the inspection of the print quality of the character pattern has been described. However, the present invention can also be applied to the mixed inspection of different kinds in the production line. In order to detect the mixing of different varieties in parts flowing on the production line, it is not necessary to discriminate between non-defective / defective products of the identification target pattern itself such as character patterns, and it is only necessary to be able to recognize the model name of the part. . Therefore, in such a case, as in the first embodiment, the pattern recognition unit 16 recognizes the identification pattern cut out by the pattern cutout unit 14 using the feature amount data extracted by the pattern feature amount extraction unit 15. At this time, the identification pattern in which the output value of the neural network constituting the pattern recognition means 16 is minimized is forcibly output, and based on this, the mixing of different types is inspected.
[0068]
As described above, according to the second embodiment, pattern recognition means is formed by a neural network, and an identification pattern having the minimum output value of the neural network is forcibly output, thereby mixing different types of products. Therefore, it is possible to easily detect that different varieties are mixed in parts flowing on the production line.
[0069]
【The invention's effect】
As described above, according to the invention of claim 1, The pattern cut-out means executes a scan in the direction parallel to the pattern row, cuts out the pattern row region using the density difference between the maximum density value and the minimum density value on each scan line, and the pattern cut out by the function In the row region, scanning in the direction perpendicular to the pattern row is performed, and the pattern row region cut out from the average density value on the scanning line is extracted to the density difference between the maximum density value and the minimum density value on each scanning line. A pattern feature amount extraction unit having a function of cutting out recognition target patterns one by one by adding a density difference with the average density value of the background and cutting out a pattern area based on the calculated value obtained. The vertical and horizontal scans are executed in the cut pattern area, and the vertical direction obtained from the distribution of the density difference between the maximum density value and the minimum density value on each scanning line in each direction is obtained. And a function of dividing the mesh area based on the cumulative function of the density difference distribution in the horizontal direction, and the feature amount data of each divided mesh area is directly calculated from the grayscale image, and all the obtained mesh areas And a function for outputting the calculated value for the pattern recognition means to The pattern recognition means is formed by a neural network, and the feature value data extracted by the pattern feature quantity extraction means is used to recognize the inspection target pattern cut out by the pattern cutout means, so that the output value of the neural network has a predetermined threshold value. If it is not less than the value, since the cut out inspection target pattern is determined to be defective, a pattern inspection apparatus that can easily inspect the quality of inspection target patterns such as printed character patterns is provided. There is an effect to be obtained.
[0070]
According to invention of Claim 2, The pattern cut-out means executes a scan in the direction parallel to the pattern row, cuts out the pattern row region using the density difference between the maximum density value and the minimum density value on each scan line, and the pattern cut out by the function In the row area, scanning in the direction perpendicular to the pattern row is performed, and the pattern row region cut out from the average density value on the scanning line is extracted into the density difference between the maximum density value and the minimum density value on each scanning line. A pattern feature amount extraction unit having a function of cutting out recognition target patterns one by one by adding a density difference with the average density value of the background and cutting out a pattern area based on the calculated value obtained. The vertical and horizontal scans are executed within the cut pattern area, and the vertical direction obtained from the distribution of the density difference between the maximum density value and the minimum density value on each scanning line in each direction is obtained. And a function of dividing the mesh area based on the cumulative function of the density difference distribution in the horizontal direction, and the feature amount data of each divided mesh area is directly calculated from the grayscale image, and all the obtained mesh areas And a function for outputting the calculated value for the pattern recognition means to The pattern recognition means is formed by a neural network, and the feature pattern data extracted by the pattern feature quantity extraction means is used to recognize the identification pattern cut out by the pattern cutout means, so that the output value of the neural network is minimized. Since it is configured to forcibly output patterns, it is possible to easily recognize the type names of parts, etc., and to obtain a different product mixing inspection device that can easily detect mixing of different products on the production line There is.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of a pattern recognition apparatus.
FIG. 2 is a flowchart showing a flow of processing in the pattern recognition apparatus.
FIG. 3 is an operation explanatory diagram showing the principle of pattern cutout in the pattern recognition apparatus.
FIG. 4 is an operation explanatory diagram showing the principle of threshold calculation for pattern cutout in the pattern recognition apparatus.
FIG. 5 is an operation explanatory diagram showing how a character pattern row area is cut out in the pattern recognition apparatus;
FIG. 6 is an operation explanatory diagram showing a state of joining character pattern areas in the pattern recognition apparatus.
FIG. 7 is an operation explanatory diagram showing how a character pattern area is cut out in the pattern recognition apparatus;
FIG. 8 is an operation explanatory diagram showing how the height of the character pattern area is adjusted in the pattern recognition apparatus.
FIG. 9 is an operation explanatory diagram illustrating a feature amount data extraction method in the pattern recognition apparatus.
FIG. 10 is an explanatory diagram showing an example of a defect in a character pattern that is determined as good or bad by the pattern inspection apparatus according to the first embodiment of the present invention to which the pattern recognition apparatus is applied.
FIG. 11 is an explanatory diagram showing a binarization principle of a character pattern grayscale image in a conventional pattern recognition apparatus.
[Explanation of symbols]
11 image pickup device, 14 pattern cutout means, 15 pattern feature quantity extraction means, 16 pattern recognition means.

Claims (2)

画像撮像装置によって撮像された濃淡画像からパターンとその背景との濃度差を用いて検査対象パターンを1つ1つ切り出すパターン切り出し手段と、
前記パターン切り出し手段によって切り出された前記各検査対象パターンの領域内の正規化された特徴量データを、前記濃淡画像から直接抽出するパターン特徴量抽出手段と、
ニューラルネットワークによって形成され、前記パターン特徴量抽出手段の抽出した特徴量データを用いて、前記パターン切り出し手段によって切り出された検査対象パターンの認識を行い、前記ニューラルネットワークの出力値が所定のしきい値以下でない場合に、切り出された前記認識対象パターンが不良である判定するパターン認識手段とを備え、
前記パターン切り出し手段が、パターン行と平行方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差を用いてパターン行領域を切り出す機能と、それによって切り出された前記パターン行領域内で、前記パターン行と垂直方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差に、当該走査線上の平均濃度値と切り出された前記パターン行領域の背景の平均濃度値との濃度差を加算し、得られた計算値に基づいてパターン領域の切り出しを行うことによって認識対象パターンを1つ1つ切り出す機能を有し、
前記パターン特徴量抽出手段が、切り出されたパターン領域内で縦方向および横方向の走査を実行し、それぞれの方向毎の各走査線上の最大濃度値と最小濃度値との濃度差の分布から求めた縦方向および横方向の濃度差分布の累積関数に基づいて、メッシュ領域の分割を行う機能と、分割された前記各メッシュ領域の特徴量データを濃淡画像から直接計算し、得られた全ての前記メッシュ領域についての計算値を前記パターン認識手段への出力とする機能とを有するパターン検査装置。
Pattern cutout means for cutting out patterns to be inspected one by one from the grayscale image picked up by the image pickup device using the density difference between the pattern and the background;
Pattern feature quantity extraction means for directly extracting the normalized feature quantity data in the region of each inspection target pattern cut out by the pattern cutout means from the grayscale image;
Using the feature amount data formed by the neural network and extracted by the pattern feature amount extraction unit, the inspection target pattern cut out by the pattern cutout unit is recognized, and the output value of the neural network is a predetermined threshold value If not below, e Bei and determining the pattern recognition means is cut out the recognition target pattern is defective,
The pattern cut-out means performs a scan in a direction parallel to the pattern row, and cuts out a pattern row region using the density difference between the maximum density value and the minimum density value on each scan line, and the cut out by the function In the pattern row area, scanning in the direction perpendicular to the pattern row is executed, and the average density value on the scanning line and the pattern row cut out are obtained by the difference between the maximum density value and the minimum density value on each scanning line. Adding a density difference from the average density value of the background of the area, and cutting out the pattern to be recognized one by one by cutting out the pattern area based on the obtained calculated value;
The pattern feature quantity extraction means performs vertical and horizontal scanning within the cut pattern area, and is obtained from the distribution of density differences between the maximum density value and the minimum density value on each scanning line in each direction. Based on the cumulative function of the vertical and horizontal density difference distributions, the function of dividing the mesh area and the feature amount data of each divided mesh area are directly calculated from the grayscale image, and all obtained A pattern inspection apparatus having a function of outputting a calculated value for the mesh region to the pattern recognition means .
画像撮像装置によって撮像された濃淡画像からパターンとその背景との濃度差を用いて、製品の品種を示す識別パターンを1つ1つ切り出すパターン切り出し手段と、
前記パターン切り出し手段によって切り出された前記各識別パターンの領域内の正規化された特徴量データを、前記濃淡画像から直接抽出するパターン特徴量抽出手段と、
ニューラルネットワークによって形成され、前記パターン特徴量抽出手段の抽出した特徴量データを用いて、前記パターン切り出し手段によって切り出された識別パターンの認識を行い、前記ニューラルネットワークの出力値が最小になった前記識別パターンを強制的に出力して、異品種の混入を検査するパターン認識手段とを備え、
前記パターン切り出し手段が、パターン行と平行方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差を用いてパターン行領域を切り出す機能と、それによって切り出された前記パターン行領域内で、前記パターン行と垂直方向の走査を実行して、その各走査線上の最大濃度値と最小濃度値の濃度差に、当該走査線上の平均濃度値と切り出された前記パターン行領域の背景の平均濃度値との濃度差を加算し、得られた計算値に基づいてパターン領域の切り出しを行うことによって認識対象パターンを1つ1つ切り出す機能を有し、
前記パターン特徴量抽出手段が、切り出されたパターン領域内で縦方向および横方向の走査を実行し、それぞれの方向毎の各走査線上の最大濃度値と最小濃度値との濃度差の分布から求めた縦方向および横方向の濃度差分布の累積関数に基づいて、メッシュ領域の分割を行う機能と、分割された前記各メッシュ領域の特徴量データを濃淡画像から直接計算し、得られた全ての前記メッシュ領域についての計算値を前記パターン認識手段への出力とする機能とを有する異品種混入検査装置。
Pattern cutout means for cutting out identification patterns indicating product types one by one from a grayscale image picked up by an image pickup device using a density difference between the pattern and its background;
Pattern feature amount extraction means for directly extracting the normalized feature amount data in the area of each identification pattern cut out by the pattern cutout portion from the grayscale image;
The identification pattern formed by the neural network and using the feature amount data extracted by the pattern feature amount extraction unit is used to recognize the identification pattern cut out by the pattern cutout unit, and the output value of the neural network is minimized. pattern forcibly outputs, Bei example and a pattern recognition means for detecting contamination of a different breed,
The pattern cut-out means performs a scan in a direction parallel to the pattern row, and cuts out a pattern row region using the density difference between the maximum density value and the minimum density value on each scan line, and the cut out by the function In the pattern row area, scanning in the direction perpendicular to the pattern row is executed, and the average density value on the scanning line and the pattern row cut out are obtained by the difference between the maximum density value and the minimum density value on each scanning line. Adding a density difference from the average density value of the background of the area, and cutting out the pattern to be recognized one by one by cutting out the pattern area based on the obtained calculated value;
The pattern feature quantity extraction means performs vertical and horizontal scanning within the cut pattern area, and is obtained from the distribution of density differences between the maximum density value and the minimum density value on each scanning line in each direction. Based on the cumulative function of the vertical and horizontal density difference distributions, the function of dividing the mesh area and the feature amount data of each divided mesh area are directly calculated from the grayscale image, and all obtained A different kind mixing inspection apparatus having a function of outputting a calculated value for the mesh area to the pattern recognition means .
JP2002060802A 2002-03-06 2002-03-06 Pattern inspection device and different kind mixing inspection device Expired - Fee Related JP3670244B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002060802A JP3670244B2 (en) 2002-03-06 2002-03-06 Pattern inspection device and different kind mixing inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002060802A JP3670244B2 (en) 2002-03-06 2002-03-06 Pattern inspection device and different kind mixing inspection device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP10410996A Division JP3307831B2 (en) 1996-03-29 1996-03-29 Pattern recognition device

Publications (2)

Publication Number Publication Date
JP2002312789A JP2002312789A (en) 2002-10-25
JP3670244B2 true JP3670244B2 (en) 2005-07-13

Family

ID=19192995

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002060802A Expired - Fee Related JP3670244B2 (en) 2002-03-06 2002-03-06 Pattern inspection device and different kind mixing inspection device

Country Status (1)

Country Link
JP (1) JP3670244B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6788929B1 (en) * 2020-07-15 2020-11-25 フジモールド工業株式会社 Image processing device and image processing method for determining the test object

Also Published As

Publication number Publication date
JP2002312789A (en) 2002-10-25

Similar Documents

Publication Publication Date Title
EP1254431B1 (en) Method and system for detecting defects on a printed circuit board
JP5334042B2 (en) Character string recognition method and character string recognition apparatus
JP4525787B2 (en) Image extraction apparatus and image extraction program
US7756295B2 (en) Change region detection device and change region detecting method
JP2002208007A (en) Automatic detection of scanned document
EP1014691A2 (en) An image processing system for reducing vertically disposed patterns on images produced by scanning
US9842281B2 (en) System for automated text and halftone segmentation
CN114972575A (en) Linear fitting algorithm based on contour edge
JP2000163579A (en) Appearance inspection method and device
JP3670244B2 (en) Pattern inspection device and different kind mixing inspection device
CN112669272A (en) AOI rapid detection method and rapid detection system
JP2006155126A (en) Vehicle number recognition device
JP3322569B2 (en) Component image edge detection method and component shape recognition device
Wu et al. A visual inspection system for surface mounted components based on color features
JP2004296592A (en) Defect classification equipment, defect classification method, and program
JP5190619B2 (en) Inspection method for inspection object and inspection apparatus therefor
JP2005250786A (en) Image recognition method
JP3307831B2 (en) Pattern recognition device
JP2001307017A (en) Character plate recognizing device
JP3307782B2 (en) Character mark recognition device
JP3753234B2 (en) Defect detection method
JPH08122267A (en) Mark recognizing device and mark recognizing method
KR100713335B1 (en) Method for recognizing of picture in wireless terminal
JPH09161056A (en) Inspecting method for inner surface of circular container
JP3330769B2 (en) Pattern recognition device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041122

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041130

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050125

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050315

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050413

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080422

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090422

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100422

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100422

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110422

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120422

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees