JP3838079B2 - Image processing apparatus and image processing program - Google Patents

Image processing apparatus and image processing program Download PDF

Info

Publication number
JP3838079B2
JP3838079B2 JP2001366919A JP2001366919A JP3838079B2 JP 3838079 B2 JP3838079 B2 JP 3838079B2 JP 2001366919 A JP2001366919 A JP 2001366919A JP 2001366919 A JP2001366919 A JP 2001366919A JP 3838079 B2 JP3838079 B2 JP 3838079B2
Authority
JP
Japan
Prior art keywords
image
projection
processing
dot
recognition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2001366919A
Other languages
Japanese (ja)
Other versions
JP2003168119A (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.)
Omron Corp
Original Assignee
Omron 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 Omron Corp filed Critical Omron Corp
Priority to JP2001366919A priority Critical patent/JP3838079B2/en
Publication of JP2003168119A publication Critical patent/JP2003168119A/en
Application granted granted Critical
Publication of JP3838079B2 publication Critical patent/JP3838079B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
この発明は、画像処理により文字や記号などのパターンを認識する技術分野に属するもので、特に、ドット印字された複数のパターンが配列されたものを認識する場合に、処理対象の画像から各パターンを切り出すための技術に関連する。
【0002】
【従来の技術】
ペットボトル入り飲料や缶入り飲料などの製造工場では、出荷前の製品のボトルや缶の表面に、専用のインクジェットプリンタにより消費期限や製造番号などを印字している。さらに印字処理後の製品は、CCDカメラや画像処理装置を含む検査ラインに順に搬送され、ここで印刷状態が不良と判断されると、出荷の対象から除外される。
【0003】
一般的な文字列の認識処理においては、認識対象の文字列の画像を水平方向および垂直方向の各方向に向けて投影し、各投影軸毎に現われた投影像により個々の文字を含む画像領域を切り出した後、これら画像領域を認識対象領域として、その領域内の画像をあらかじめ登録された基準の画像と照合するなどして、各文字を認識する。ただし、上記の検査のようにドット文字列を認識対象とする場合には、1つの文字のパターンが離散した状態で投影されてしまうので、先に画像を膨張処理してドットを連結させてから、その膨張画像に対して前記投影処理や切り出し処理を行うようにしている(特開平8−138049号公報)。
【0004】
【発明が解決しようとする課題】
上記した検査ラインでは多数の製品が次々と搬送されるため、検査は完全に自動化されるのが望ましい。しかしながら自動化のために画像の膨張処理回数を固定すると、印字の際のずれや印刷条件の変更などによって、ドット間隔やドットの大きさが通常と異なる製品が混入した場合には、同じ膨張処理回数で対応できなくなる。このような原因で文字の切り出し処理に失敗すると、不良と判断する必要のない文字列に対してまで不良判定がなされてしまい、検査の精度が大幅に低下する、という問題が生じる。
【0005】
また適正な膨張回数を設定するためには、モデルの画像を用いて試験的な膨張処理を何度も繰り返すなど、手間のかかる設定作業が必要である。したがって製品の種類やプリンタの機種が変わるなどして、文字の大きさやドット間隔が変化すると、その都度、膨張回数の設定を変更しなければならなくなり、設定作業に手間がかかる、という問題が生じる。
【0006】
この発明は上記問題点に着目してなされたもので、認識対象のドットパターンに応じた最適な膨張処理を自動的に行うようにして、高精度の認識処理を効率良く行うことを目的とする。
【0007】
【課題を解決するための手段】
この発明は、複数のドットパターンが配列されて成る認識対象を撮像して得られた画像から各ドットパターンを切り出して認識する機能を有する画像処理装置、およびこの画像処理装置としてコンピュータを機能させるためのプログラムについてなされたものである。なお、ここでいう「ドットパターン」とは、複数のドットにより表された文字、記号などのパターンであって、主として、インクジェットプリンタなどにより所定の対象物上に印刷されたパターンを指す。ただしこの発明の認識対象はこれに限らず、たとえばスクリーン上に表示されたドットパターンを認識対象とすることもできる。
【0008】
この発明にかかる画像処理装置は、上記認識対象を撮像して得られた画像を入力する画像入力手段と、前記入力画像から各ドットパターンを切り出して認識する認識処理手段と、前記認識処理手段による認識処理結果を出力する出力手段とを具備する。
この発明にかかる第1の画像処理装置における認識処理手段は、認識対象の配列を構成するドットパターンの数が登録される記憶手段;前記入力画像に対し、画像を膨張するステップとこの膨張処理後の画像を前記ドットパターンの配列方向に向けて投影するステップとを繰り返す第1の処理/または、前記入力画像を前記ドットパターンの配列方法に向けて投影した後に、この投影処理により得られた投影像を膨張するステップを繰り返す第2の処理を、実行する投影像取得手段;前記第1または第2の処理の実行中に投影像の数が前記記憶手段に登録されたドットパターンの数より少なくなったとき、投影軸方向の大きさが所定値を上回る投影像を分割する投影像分割手段;の各手段を含み、前記投影像取得手段または投影像分割手段の処理により記憶手段に登録されたドットパターンの数に対応する数の投影像が得られたとき、これらの投影像に基づき画像上のドットパターンを切り出すように構成される。
【0009】
前記投影像取得手段が第1の処理を実行する場合、たとえば入力画像を2値化した後に、投影処理によって、ドットパターンの配列方向に沿うドットの分布状態を2次元のヒストグラムとして表す。この場合、ヒストグラム上で個々に独立する山の部分をそれぞれ投影像として抽出することができる。また多値画像を処理対象とする場合であれば、投影処理により、文字の高さ方向に沿って濃度を加算したヒストグラムを作成する。この場合には、ヒストグラムにおいて所定のしきい値以上となる部分を投影像として抽出することができる。
【0010】
なお、「記憶手段に登録されたドットパターンの数に対応する数」は、ドットパターンの登録数と同じ数とするのが好ましい。
第1の処理を実行する場合、最初の段階では、各ドットが離散しているため、投影処理により得られる投影像の数はドットパターンの登録数より多くなるが、画像の膨張処理を繰り返すことにより、1つのドットパターン中の各ドットが連結し、投影像の数も登録数に近づいていく。
【0013】
また投影像取得手段が第2の処理を実行する場合には、認識対象の画像を投影して投影像を得た後に、その投影像を膨張する処理を繰り返すことによって、最初は離散していた投影像がドットパターン毎に連結される。
よって、認識対象の配列を構成するドットパターンの数をあらかじめ記憶手段に登録しておけば、ドット間の間隔やドットの大きさに変動が生じた認識対象に対しても、第1または第2の処理によりドットパターンの登録数分の投影像を得ることができるから、これらの投影像に基づき各ドットパターンを精度良く切り出すことができる。
【0014】
また、第1の画像処理装置では、たとえば印刷のずれによりドットパターン間の間隔が通常よりも小さくなったために、膨張処理によって2つのドットパターンに対応する投影像が連結し、投影像の数が認識対象の配列を構成するドットパターンの数より小さくなった場合でも、投影像分割手段の処理によって連結された投影像を切り離すことができる。よって、第1または第2の処理の実行中に投影像の数がドットパターンの登録数より小さくなった場合でも、投影像分割手段の処理によって登録数分の投影像を得ることができるから、各ドットパターンを個別に精度良く切り出すことが可能となり、認識精度の低下を防ぐことができる。
【0015】
つぎに、この発明にかかる第2の画像処理装置における認識処理手段は、第1の画像処理装置におけるのと同様の記憶手段および投影像取得手段を具備するとともに、第1または第2の処理を所定回数以上実行した時点における投影像の数が前記記憶手段に登録されたドットパターンの数より多いとき、各投影像間の距離に基づき投影像の統合処理を実行する投影像統合手段を含み、投影像取得手段または投影像統合手段の処理により記憶手段に登録されたドットパターンの数に対応する数の投影像が得られたとき、これらの投影像に基づき画像上のドットパターンを切り出すようにしている。
【0016】
第2の画像処理装置によれば、1つのドットパターン内の一部のドットに大きなずれが生じるなどして、第1または第2の処理にかかる膨張処理を繰り返しても、投影像の数が本来のドットパターンの数を上回る場合には、統合処理によって投影像の数をドットパターンの登録数と同じ数にまで収束することができる。よって膨張処理回数をあらかじめ定めた基準回数以内に留めることができ、ドットパターンの切り出し処理にかかる効率を落とさずに精度の良い切り出し処理を行うことができる。
【0017】
つぎに、この発明にかかる第3の画像処理装置における認識処理手段も、前記第1、第2の装置と同様の記憶手段を具備する。また、この認識処理手段は、入力画像をドットパターンの配列方向に向けて投影した後に、この投影処理により得られた投影像を膨張するステップを、前記記憶手段に登録されたドットパターンの数に対応する数の投影像が得られるまで繰り返し、最終的に得られた投影像に基づき画像上のドットパターンを切り出すようにしている。
【0018】
上記第1〜3の画像処理装置において、画像入力手段は、外部の撮像手段などから認識対象の画像を取り込むためのもので、入力用のインターフェース、A/D変換回路などのほか、2値化回路を含むことができる。ただし、入力画像は、アナログ画像に限らず、ディジタル画像を取り込むこともできる。また2値化回路は必ずしも必要ではなく、濃淡画像データを処理対象とすることもできる。
また前記撮像手段は画像処理装置の外部に限らず、画像処理装置の装置本体に一体に組み込むこともできる。
【0019】
この発明にかかる画像処理用のプログラムは、画像を入力する機能を有するコンピュータを、複数のドットパターンが配列されて成る認識対象を撮像して得られた画像が入力されたとき、その画像から各ドットパターンを切り出して認識する認識処理手段、およびこの認識処理手段による認識処理結果を出力する出力手段として機能させるためのもので、認識対象の配列を構成するドットパターンの数の入力を受け付けて、その入力されたドットパターンの数を前記コンピュータのメモリに登録する登録処理手段として前記コンピュータを機能させるためのプログラムが含まれる。なお、登録処理手段によりドットパターンの数が登録されたメモリは、前記した記憶手段に相当するものである。
さらに、このプログラムは、前記認識処理手段を、第1または第2の画像処理装置の認識処理手段と同様の構成を具備する手段として構成する。
【0020】
なお、切り出し処理の後に実行される認識処理は、この装置の使用目的に応じて適宜設定することができる。たとえば前記したような検査ラインのように、文字列が正しく印字されているかどうかを判別する目的で使用する場合には、切り出された各ドットパターンをそれぞれ登録されたモデルパターンと照合し、各照合結果を統合して文字列の適否を判別する。また異なる文字列を認識対象として各文字列の認識処理を行う場合には、切り出された各ドットパターンをそれぞれ各種文字のモデルパターンと順に照合して、それぞれのドットパターンに相当する文字を特定する処理を行うことになる。
【0021】
【発明の実施の形態】
図1は、この発明にかかる画像処理装置1の適用例を示す。
この実施例の画像処理装置1は、工場において、製品5に印字されたドット文字列(文字のドットパターンのほか記号のドットパターンを含む場合もあるが、以下では、これらのパターンを「ドット文字」または単に「文字」という。)の印字状態を検査するためのもので、CCDカメラ2,モニタ3,外部装置4などの周辺機器とともに、搬送用のコンベヤ6の近傍位置に配備される。
【0022】
前記CCDカメラ2(以下、単に「カメラ2」という。)は、レンズを前記コンベヤ6に向けて配備され、前記コンベヤ6上を搬送される製品5を順に撮像し、画像処理装置1に出力する。モニタ3は、処理中の画像を表示するほか、適宜、検査結果などを表示するのに使用される。外部装置4は、コントローラ,キーボード,コンソールなど、データ入力に使用可能な機器であり、検査対象のドット文字列の文字列長や前記良否判定のための基準値などの設定データの入力に用いられる。
【0023】
図2は、前記画像処理装置1の電気構成を示す。
この画像処理装置1は、マイクロプロセッサ(MPU)から成る処理部11にROM12,RAM13,画像メモリ14などのメモリが接続されるほか、A/D変換器15,D/A変換器16,入出力部17などが組み込まれて成る。前記ROM12には、ドット文字列の認識処理や良否判定処理のためのプログラムのほか、各種ドットパターンのモデルデータを登録した辞書ファイルなどが格納される。一方、RAM13は、前記外部装置4から入力された設定データを記憶するなど、処理部11の作業エリアとして使用される。
【0024】
A/D変換器15は、前記カメラ2からの濃淡画像データを取り込んでこれをディジタル変換する。画像メモリ14は、A/D変換器15により変換されたディジタル量の濃淡画像を保存するほか、この濃淡画像を認識処理のために2値化処理して得られる2値画像を格納するエリアを具備する。D/A変換器16は、前記濃淡画像をアナログ量の表示用信号に変換してモニタ3に出力する。また入出力部17は、処理部11が前記外部装置4やモニタ3に対してデータの入出力を行う際に使用されるインターフェースである。
【0025】
図3は、前記画像処理装置1における検査の手順を示す。なお、以下の説明および処理手順を示す図面においては、各処理のステップを「ST」として示す。図3において、まず最初のST1で、画像メモリ14にカメラ2からの濃淡画像が入力されると、処理部11は、この濃淡画像を所定のしきい値で2値化処理して、認識処理用の2値画像(以下、この画像を「処理対象画像」と呼ぶ。)を生成する(ST2)。
【0026】
つぎのST3では、前記処理対象画像において、検査対象のドット文字列を構成する各文字を切り出す処理を行う。この切り出し処理では、詳細については後記するが、前記画像の膨張処理や投影処理を繰り返して、最終的に各文字毎に、その文字の位置および大きさに対応する矩形状の領域を認識対象領域として設定する。この文字切り出し処理が終了すると、処理部11は、つぎのST4で、切り出された各認識対象領域毎に、前記ROM12の辞書ファイルに格納されたモデルパターンとの照合処理を行って各文字の良否を判定する。
【0027】
この後、処理部11は、各文字毎の判定結果を統合して、ドット文字列に対する良否判定を行い、ST5でこの判定結果をモニタに表示するほか、図示しない上位装置などに出力する。
【0028】
つぎに文字の切り出し処理の原理について説明する。
図4は、文字の切り出し処理において行われる膨張処理の具体例を示す。図中の各矩形は1画素に対応するもので、このうちの黒画素がドットを構成する画素となる。図示例では、各黒画素につき、それぞれ周囲4近傍の画素(上下、左右の4画素)を黒画素とすることによって、文字を構成するドットの数を増やすようにしている。
【0029】
よってこの膨張処理を重ねることによって、ドット文字の各ドットが連結するので、ドットパターンではない通常の文字パターンと同様に、投影処理によって各文字を切り出すことが可能となる。
【0030】
図5は、投影処理によってドット文字列の各文字を切り出す例を示す。図示例のドット文字列は、水平方向(x軸方向)に沿って10個の文字が配列された構成をとるので、処理対象画像を文字の配列方向であるx軸に向けて投影すると、文字毎に切り分けられた10個の投影像A1〜A10を得ることができる。またここでは図示しないが、各投影像A1〜A10に対応する画像部分をそれぞれ個別にy軸方向に向けて投影することによって、各文字の高さに対応する投影像を得ることができる。さらにこれらの投影処理結果を統合すると、各文字毎に、その文字の幅および高さに応じた矩形状の領域R1〜R10を設定することができる。この矩形領域R1〜R10は前記した認識対象領域として、以後の認識処理のために用いられることになる。
【0031】
ところで、この実施例の検査対象であるドット文字列は、各製品を搬送しつつ高速の印字処理によって印刷されたものであるため、搬送用のコンベヤの速度やプリンタの状態などによってドットの間隔やドットの大きさにばらつきが起こる可能性が高い。このため検査対象によって、適切な文字の切り出しを行うのに必要な画像の膨張処理回数が変動する場合がある。
【0032】
図6は、前記最適な投影像を得るための膨張回数が処理対象のドット文字列の状態によって変動する例を示す。
図6(1)(2)において、下段は検査対象のドット文字列の2値画像であり、いずれのドット文字列も、3個の文字「A」「B」「C」を順に並べて成る。なお、図6(1)(2)ともに、左端の画像が元の処理対象画像であり、矢印方向に進むほど、膨張処理を重ねた画像に変化する。またこれらの画像の上方には、それぞれその画像を文字の配列方向に向けて投影したときに得られる投影像の分布状態を示す。
【0033】
上記図6(1)と図6(2)とでは、検査対象のドット文字列のドットの大きさが異なっており、ドットの小さな文字列を対象とする図6(1)では、膨張処理を2回行うことによって、各文字に対応する3個の投影像が得られる。これに対し、ドットの大きな文字列を対象とする図6(2)の例では、膨張処理を1回行うだけで各文字に対応する投影像を得ている。
【0034】
このようにドットの大きさや間隔が変わると、画像の膨張処理の回数を変更する必要が生じる。
一方、この実施例の検査対象であるドット文字列は、製造年月日,製品コードなど、桁数が一定の文字列であり、適度な膨張処理が行われた画像であれば、前記図5に示したように、検査対象の文字列の桁数と同じ数の投影像を得ることができる。そこでこの実施例の画像処理装置1では、あらかじめ検査対象のドット文字列を構成する文字数を外部装置4などから入力してRAM13に保存しておき、この登録文字数分の投影像が得られるまで画像の膨張処理と投影処理とを繰り返すことによって、文字の切り出し処理を適正かつ効率良く行うようにしている。
【0035】
図7は、前記ST3の文字切り出し処理の詳細な手順を示す。
まず最初のST301では、処理対象画像をx軸方向に向けて投影する。なお、ここでの処理対象画像は2値画像であるので、前記投影処理結果は、x軸方向に沿う黒画素数を示すヒストグラムに相当するものとなる。つぎのST302では、このヒストグラムにおいて、所定のしきい値以上の値が連続する部分(以下、この部分を「山」と呼ぶ。この山は前記した投影像に相当するものである。)を抽出し、この山の数を計数する。
【0036】
つぎにST303では、抽出された山の数を登録文字数と比較する。初期の画像の膨張処理が行われていない状態下では、山の数は登録文字数より大きくなるので、ST303が「NO」となってST304に進み、前記処理対象画像に1回目の膨張処理を施し、しかる後にST301に戻る。
【0037】
以下同様にして、ST301〜304のループを所定回数実行することによって、画像の膨張処理および投影処理が繰り返されることになる。この間、各文字におけるドットがしだいに連結するので、前記投影処理により得られる山の数はしだいに減少する。そして所定の時点で山の数が登録文字数に一致すると、ST303が「YES」となり、ST305に進む。
【0038】
ST305では、最新の投影処理によって得られた各山の位置および幅を、それぞれ文字の位置および文字幅として特定する。つぎに最新の膨張画像からこれらの山の幅に対応する画像部分を抽出して、それぞれy軸方向に向けて投影し、各文字の高さを特定する。さらにこれらx軸方向,y軸方向の各投影処理結果から各文字毎に対応する認識対象領域を設定する。
【0039】
なお、この後に行われる検査では、前記したように各認識対象領域内の画像を辞書ファイル内のモデルパターンと照合するが、この照合処理の対象とする画像は、元の処理対象画像または最新の膨張処理画像のいずれであってもよい。
【0040】
つぎに上記図7の例では、画像の膨張処理によってドットを連結させるようにしているが、この発明はこれに限らず、投影処理によって得られたヒストグラムを膨張させてもよい。
図8は、ヒストグラムの膨張処理によって文字を切り出す場合の手順を示す。なお、この図8では、前記図7の処理と区別するために、各処理をST306以降のステップにより示すが、図7および図8は、前記図3のST3にかかる処理として、それぞれ独立のプログラムにより実行されるものである。(以下に示す図9,10の手順についても同様である。)
【0041】
図8では、まずST306で処理対象画像をx軸方向に向けて投影した後、つぎのST307で、前記投影処理により得られたヒストグラムから山を抽出してその数を計数する。ここで山の数が登録文字数よりも大きい場合には、ST308が「NO」となってST309に進み、前記ヒストグラムの各山を所定幅ずつ膨張する処理を行う。この後は、ST307に戻って、膨張処理後の山を計数する。
【0042】
上記ST307〜309のループを繰り返した結果、所定の時点で山の数が登録文字数と一致すると、ST308からST310に進む。ST310では、最新の膨張処理によって得られた各山によって各文字の位置および文字幅を特定した後、前記処理対象画像からこれらの山に対応する画像部分を個別に抽出してそれぞれy軸方向に向けて投影し、各文字の高さを特定する。さらにx軸方向,y軸方向の各投影結果を組み合わせて、各文字毎に認識対象領域を設定する。
【0043】
上記図7や図8の処理によれば、ドットの間隔や大きさに変動が生じても、処理対象の各画像に対し、それぞれ最適な回数の膨張処理を自動的に行うことができるので、ドット文字列を構成する各文字を正確に切り出して高精度の認識処理を行うことができる。また印字条件の変更やプリンタの印字状態の変化(インクの量など)によって印字状態が変化しても、検査対象の文字列が同じであれば、何ら設定の変更を行うことなく、検査を続けることができる。
さらに検査対象のドット文字列が変更された場合には、その文字列の文字数を入力してRAM13への登録処理を行うだけで、そのドット文字列の文字を切り出すのに必要な設定を行うことができ、設定にかかる手間を大幅に削減することができる。
【0044】
つぎに、図9および図10では、前記図7と同様に処理対象画像の膨張処理を行うが、ドットのずれによって2つの文字に対する投影像が連結した場合や、1つの文字に対する投影像が分離した場合に、対応できるようにしている。
【0045】
まず図9の手順では、前記図7の手順と同様に、処理対象画像の投影処理を行った後、この投影処理によって得られたヒストグラム上の山を登録文字数と照合する(ST311〜315)。ここで山の数が登録文字数よりも大きい場合は、以下、ST311〜314のループを繰り返して、前記処理対象画像を所定回数だけ膨張させる。この処理によって山の数が登録文字数と同じ数になると、ST313およびST315がともに「NO」となってST317に進み、図7の手順と同様にして各文字の認識対象領域を設定する。
【0046】
一方、前記膨張処理の過程で2つの文字が結合し、山の数が登録文字数より小さくなった場合には、ST313が「NO」,ST315が「YES」となってST316に進む。このST316では、最新のヒストグラムで得られた各山の幅を所定の基準値と比較し、この基準値を越える幅を持つ山を2分割し、しかる後にST317の文字の切り出し処理を実行する。
【0047】
上記の手順によれば、印刷のずれによって一部の文字間隔が通常よりも小さくなって、その間隔を挟む文字に対応する山が連結した場合でも、前記ST316の処理によってこれらの山を切り分けることが可能となるから、各文字を精度良く切り出すことができる。
【0048】
つぎに図10の手順では、処理対象画像の投影処理を行い、さらにこの投影処理により得られたヒストグラムから山を抽出してその数を計数した後、この山の数が登録文字数に1を加えた値以下になるまで画像の膨張処理と投影処理とを繰り返す(ST318〜321)。
【0049】
上記の処理によって山の数が登録文字数に1を加えた数にまで収束すると、ST320が「YES」、ST322が「NO」となり、つぎのST323でこれまでに実行した膨張処理回数をチェックする。ここで膨張処理の回数が所定の規定回数以内であれば、ST323は「NO」となってST321に戻り、引き続きST318,319の処理により、膨張処理および投影処理を実行し、山の数を再チェックする。
なお前記規定回数は、あらかじめRAM13またはROM12に登録される。
【0050】
このようにして膨張処理回数が規定回数に達する前に山の数が登録文字数と同数になると、ST320およびST322がともに「YES」となってST325に進み、文字毎の認識対象領域を設定する。
一方、規定回数分の膨張処理を行っても山の数が登録文字数に達しなかった場合には、ST322が「NO」,ST323が「YES」となってST324に進む。このST324では、最新のヒストグラムにおいて各山の間の間隔を所定の基準値と比較し、この基準値以内で最も小さな間隔を挟む2つの山を1つに統合する。この処理により山の数は登録文字数と同数になるので、ST325に進み、各文字の認識対象領域を設定する。
【0051】
上記図10の手順によれば、所定の文字を構成するドットの一部がずれて、規定回数の膨張処理を行っても、なおその文字についての投影像を1つに収束できない場合には、膨張処理を打ち切って山の数を登録文字数に合わせることができるので、膨張処理にかかる時間を抑えることができる。よって検査時間を長引かせずに検査精度を維持することができ、検査効率の良い処理を行うことができる。
【0052】
なお、上記図10の例では、山の数が設定文字数より1つだけ大きい値になるまでは、規定回数に関係なく、膨張処理を継続するようにしているが、これに限らず、山の数に関わりなく、規定回数以内で膨張処理を終えるようにしてもよい。また膨張回数が規定回数に達したときの山の数が設定文字数を大幅に越えている場合には、山の統合処理を行わずに、検査対象の文字列を不良と判定してもよい。このようにすれば、ドットの大きなずれにより明らかに不良と見なされる文字列にかける検査時間を大幅に短縮することができる。
【0053】
さらに上記図9,10の手順では、処理対象画像を膨張処理しているが、図8のようにヒストグラムを膨張する手順にも、図9や図10と同様の設定を組み込むことができる。また図9,10の処理を一連に実行するようにすれば、文字間に結合が生じた場合、1つの文字が分離した場合の両方に対応することができ、より的確で効率の良い認識処理を行うことが可能となる。
【0054】
【発明の効果】
上記したように、この発明では、複数のドットパターンが配列されて成る認識対象を撮像して得られた画像から各ドットパターンを切り出す処理において、処理対象の画像またはこの画像から得られる投影像を、認識対象の配列におけるドットの大きさやドット間隔に応じた適正な回数だけ自動的に膨張させるようにしたから、文字の切り出し処理を的確かつ効率良く行うことができ、自動検査にかかる精度や効率を大幅に向上することができる。また対象物の種類や印字条件などが変わっても、新たな認識対象の配列を構成するドットパターンの数を登録するだけで認識処理に移行することができるので、設定にかかる手間を大幅に削減することができる。
【図面の簡単な説明】
【図1】この発明にかかる画像処理装置の設置例を示す斜視図である。
【図2】画像処理装置の電気構成を示すブロック図である。
【図3】検査の手順を示すフローチャートである。
【図4】画像の膨張処理の具体例を示す説明図である。
【図5】投影処理によって文字を切り出す原理を示す説明図である。
【図6】文字の切り出しに必要な膨張回数がドットの大きさによって変動する例を示す説明図である。
【図7】文字の切り出し処理の詳細な手順を示すフローチャートである。
【図8】文字の切り出し処理の他の手順を示すフローチャートである。
【図9】文字の切り出し処理の他の手順を示すフローチャートである。
【図10】文字の切り出し処理の他の手順を示すフローチャートである。
【符号の説明】
1 画像処理装置
2 カメラ
5 製品
11 処理部
12 ROM
13 RAM
14 画像メモリ
15 A/D変換器
17 入出力部
A1〜A10 投影像
[0001]
BACKGROUND OF THE INVENTION
The present invention belongs to the technical field of recognizing patterns such as characters and symbols by image processing. In particular, when recognizing an arrangement of a plurality of dot-printed patterns, each pattern is processed from an image to be processed. Related to the technology to cut out.
[0002]
[Prior art]
In manufacturing plants for beverages such as bottled beverages and beverages in cans, the expiration date, production number, and the like are printed on the surface of the bottles and cans of products before shipment by a dedicated inkjet printer. Further, the products after the printing process are sequentially conveyed to an inspection line including a CCD camera and an image processing apparatus. If the printing state is determined to be defective, the products are excluded from shipment.
[0003]
In a general character string recognition process, an image area including individual characters is projected by projecting an image of a character string to be recognized in each of the horizontal and vertical directions and appearing for each projection axis. After the image is cut out, each character is recognized by using these image areas as recognition target areas and collating the image in the area with a reference image registered in advance. However, when a dot character string is to be recognized as in the above-described inspection, a single character pattern is projected in a discrete state. The projection process and the clipping process are performed on the expanded image (Japanese Patent Laid-Open No. 8-138049).
[0004]
[Problems to be solved by the invention]
Since a large number of products are conveyed one after another in the above-described inspection line, it is desirable that the inspection is completely automated. However, if the number of expansion processing for images is fixed for automation, the same number of expansion processing is used when products with different dot spacing or dot size are mixed due to misalignment during printing or changes in printing conditions. It becomes impossible to correspond. If the character cut-out process fails due to such a reason, a defect determination is made even for a character string that does not need to be determined as defective, resulting in a problem that the accuracy of inspection is greatly reduced.
[0005]
Further, in order to set an appropriate number of expansions, a laborious setting operation such as repeating a test expansion process many times using a model image is necessary. Therefore, if the character size or dot spacing changes due to changes in the product type or printer model, the setting of the number of expansions must be changed each time, resulting in a problem that the setting work is troublesome. .
[0006]
The present invention has been made paying attention to the above-mentioned problems, and an object thereof is to perform highly accurate recognition processing efficiently by automatically performing optimal expansion processing according to the dot pattern to be recognized. .
[0007]
[Means for Solving the Problems]
  The present invention cuts out each dot pattern from an image obtained by imaging a recognition target in which a plurality of dot patterns are arranged.Image processing apparatus having a recognition function, and program for causing a computer to function as the image processing apparatusIt was made about. Here, the “dot pattern” is a pattern of characters, symbols, etc. represented by a plurality of dots, and is mainly printed on a predetermined object by an ink jet printer or the like.PatternPoint to. However, the recognition target of the present invention is not limited to this. For example, a dot pattern displayed on the screen can be set as the recognition target.
[0008]
  An image processing apparatus according to the present invention includes an image input unit that inputs an image obtained by imaging the recognition target, a recognition processing unit that cuts out and recognizes each dot pattern from the input image, and the recognition processing unit. Output means for outputting a recognition processing result.
  The recognition processing means in the first image processing apparatus according to the present invention is a storage means in which the number of dot patterns constituting the recognition target array is registered; a step of expanding the image with respect to the input image; and after the expansion processing The first process of repeating the step of projecting the image toward the dot pattern arrangement direction or the projection obtained by projecting the input image toward the dot pattern arrangement method, Projected image acquisition means for executing a second process for repeating the step of expanding the image; the number of projected images is smaller than the number of dot patterns registered in the storage means during the execution of the first or second process A projection image dividing unit that divides a projection image whose magnitude in the projection axis direction exceeds a predetermined value when the projection image acquiring unit or the projection image dividing unit includes: When the number of the projected image corresponding to the number of dot patterns that are registered in the storage means by the management is obtained, configured to cut the dot pattern on the image based on these projections.
[0009]
  When the projection image acquisition means executes the first process, for example, after binarizing the input image,By the projection process, the distribution state of dots along the arrangement direction of the dot pattern is represented as a two-dimensional histogram.In this case, the histogramIndividually independent mountain portions can be extracted as projected images.AlsoMulti-valued imageIf it is a processing target,Histogram with density added along the text heightcreate. In this case, the histogramA portion having a predetermined threshold value or more can be extracted as a projection image.
[0010]
  "Number corresponding to the number of dot patterns registered in the storage means"IsNumber of dot patterns registeredIs preferably the same number.
  When executing the first process, since each dot is discrete in the first stage, the number of projection images obtained by the projection process is larger than the number of registered dot patterns, but the image expansion process is repeated. Thus, each dot in one dot pattern is connected, and the number of projected images approaches the registered number.
[0013]
  In addition, when the projection image acquisition unit executes the second process, after the projection target image is projected to obtain the projection image, the process of expanding the projection image is repeated, so that it is initially discrete. The projected image is connected for each dot pattern.
  Therefore,The number of dot patterns that make up the recognition target arrayIf registered in the storage means in advance, projection images corresponding to the number of registered dot patterns are obtained by the first or second processing even for recognition objects in which the interval between dots or the size of the dots has changed. Therefore, each dot pattern can be accurately cut out based on these projection images.
[0014]
  In the first image processing apparatus, for example,The spacing between dot patterns is smaller than usual due to printing misalignment.Because it becameA projection image corresponding to two dot patterns is obtained by the expansion process.Connected, the number of projected images constitutes the recognition target arrayDot patternEven if it becomes smaller than the number, it is connected by the processing of the projection image dividing meansCut the projected imageCan be released. Therefore, even when the number of projected images becomes smaller than the registered number of dot patterns during the execution of the first or second process, the number of registered projection images can be obtained by the process of the projected image dividing unit.Each dot pattern can be cut out individually with high accuracy, and a reduction in recognition accuracy can be prevented.
[0015]
  Next, the recognition processing means in the second image processing apparatus according to the present invention comprises the same storage means and projection image acquisition means as in the first image processing apparatus, and performs the first or second processing. When the number of projection images at the time of execution a predetermined number of times or more is larger than the number of dot patterns registered in the storage means, including projection image integration means for executing projection image integration processing based on the distance between the projection images, When the number of projection images corresponding to the number of dot patterns registered in the storage unit is obtained by the processing of the projection image acquisition unit or the projection image integration unit, the dot pattern on the image is cut out based on these projection images. ing.
[0016]
  According to the second image processing apparatus, one dot patternLarge deviation occurs in some dotsEtc., for the first or second processingEven if the expansion process is repeated, the number of projected images exceeds the number of original dot patterns.in case of,It is possible to converge the number of projected images to the same number as the number of registered dot patterns by integration processing.it can. ThereforeThe number of expansion processes can be kept within a predetermined reference number, and a highly accurate cutout process can be performed without reducing the efficiency of the dot pattern cutout process.
[0017]
  Next, according to the present inventionThe recognition processing means in the third image processing apparatus also includes storage means similar to the first and second apparatuses. Further, the recognition processing means projects the step of expanding the projected image obtained by the projection processing after projecting the input image in the direction of arrangement of the dot patterns to the number of dot patterns registered in the storage means. The process is repeated until a corresponding number of projection images are obtained, and a dot pattern on the image is cut out based on the finally obtained projection image.
[0018]
  In the first to third image processing apparatuses,The image input means is for capturing an image to be recognized from an external imaging means or the like, and can include a binarization circuit in addition to an input interface and an A / D conversion circuit. However, the input image is not limited to an analog image, and a digital image can be captured. Further, the binarization circuit is not always necessary, and grayscale image data can be processed.
  The imaging means is not limited to the outside of the image processing apparatus, but can be integrated into the apparatus main body of the image processing apparatus.
[0019]
  An image processing program according to the present invention, when an image obtained by imaging a recognition target formed by arranging a plurality of dot patterns on a computer having a function of inputting an image is input from the image. In order to function as a recognition processing means for cutting out and recognizing a dot pattern, and an output means for outputting a recognition processing result by this recognition processing means, accepting an input of the number of dot patterns constituting the recognition target array, A program for causing the computer to function as registration processing means for registering the number of input dot patterns in the memory of the computer is included. The memory in which the number of dot patterns is registered by the registration processing unit corresponds to the storage unit described above.
  Further, this program configures the recognition processing unit as a unit having the same configuration as the recognition processing unit of the first or second image processing apparatus.
[0020]
Note that the recognition process executed after the cut-out process can be appropriately set according to the purpose of use of the apparatus. For example, when used for the purpose of determining whether a character string is printed correctly, such as the inspection line as described above, each cut dot pattern is checked against each registered model pattern, and each check pattern is checked. The result is integrated to determine the suitability of the character string. In addition, when performing recognition processing for each character string using different character strings as recognition targets, the extracted dot patterns are collated with model models of various characters in order to identify characters corresponding to the respective dot patterns. Processing will be performed.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 shows an application example of an image processing apparatus 1 according to the present invention.
The image processing apparatus 1 according to the present embodiment includes a dot character string printed on the product 5 in a factory (in some cases, a dot pattern of a symbol in addition to a dot pattern of a character. ”Or simply“ characters ”), and the peripheral device such as the CCD camera 2, the monitor 3, and the external device 4 is disposed in the vicinity of the conveying conveyor 6.
[0022]
The CCD camera 2 (hereinafter simply referred to as “camera 2”) is provided with a lens facing the conveyor 6, sequentially images the products 5 conveyed on the conveyor 6, and outputs them to the image processing apparatus 1. . The monitor 3 is used for displaying the image being processed and displaying the inspection result as appropriate. The external device 4 is a device that can be used for data input, such as a controller, a keyboard, and a console, and is used to input setting data such as a character string length of a dot character string to be inspected and a reference value for the quality determination. .
[0023]
FIG. 2 shows an electrical configuration of the image processing apparatus 1.
In the image processing apparatus 1, a memory such as a ROM 12, a RAM 13 and an image memory 14 is connected to a processing unit 11 composed of a microprocessor (MPU), an A / D converter 15, a D / A converter 16, and an input / output. The part 17 and the like are incorporated. The ROM 12 stores not only a program for dot character string recognition processing and pass / fail judgment processing, but also a dictionary file in which model data of various dot patterns are registered. On the other hand, the RAM 13 is used as a work area for the processing unit 11 such as storing setting data input from the external device 4.
[0024]
The A / D converter 15 takes in the grayscale image data from the camera 2 and digitally converts it. The image memory 14 stores the digital grayscale image converted by the A / D converter 15 and an area for storing a binary image obtained by binarizing the grayscale image for recognition processing. It has. The D / A converter 16 converts the grayscale image into an analog display signal and outputs it to the monitor 3. The input / output unit 17 is an interface used when the processing unit 11 inputs / outputs data to / from the external device 4 or the monitor 3.
[0025]
FIG. 3 shows an inspection procedure in the image processing apparatus 1. In the drawings showing the following description and processing procedure, each processing step is indicated as “ST”. In FIG. 3, when a grayscale image from the camera 2 is input to the image memory 14 in the first ST1, the processing unit 11 binarizes the grayscale image with a predetermined threshold value and performs recognition processing. A binary image (hereinafter, this image is referred to as a “processing target image”) is generated (ST2).
[0026]
In the next ST3, a process of cutting out each character constituting the dot character string to be inspected is performed in the processing target image. Although details will be described later in this clipping process, the image expansion process and the projection process are repeated, and finally a rectangular area corresponding to the position and size of each character is recognized for each character. Set as. When this character segmentation process is completed, the processing unit 11 performs a collation process with the model pattern stored in the dictionary file of the ROM 12 for each segmented recognition target area in ST4, and determines whether each character is acceptable. Determine.
[0027]
Thereafter, the processing unit 11 integrates the determination results for each character, performs pass / fail determination for the dot character string, and displays the determination result on a monitor in ST5 and outputs the determination result to a host device (not shown).
[0028]
Next, the principle of character cutout processing will be described.
FIG. 4 shows a specific example of expansion processing performed in character cutout processing. Each rectangle in the figure corresponds to one pixel, and among these, the black pixel is a pixel constituting a dot. In the illustrated example, for each black pixel, pixels in the vicinity of four surroundings (upper and lower, four pixels on the left and right) are black pixels, so that the number of dots constituting the character is increased.
[0029]
Therefore, by repeating this expansion process, each dot of the dot character is connected, so that each character can be cut out by the projection process in the same way as a normal character pattern that is not a dot pattern.
[0030]
FIG. 5 shows an example of cutting out each character of a dot character string by projection processing. The dot character string in the illustrated example has a configuration in which ten characters are arranged in the horizontal direction (x-axis direction). Therefore, when the processing target image is projected toward the x-axis that is the character arrangement direction, Ten projection images A1 to A10 cut out every time can be obtained. Although not shown here, a projection image corresponding to the height of each character can be obtained by individually projecting image portions corresponding to the projection images A1 to A10 in the y-axis direction. Furthermore, when these projection processing results are integrated, rectangular regions R1 to R10 corresponding to the width and height of the character can be set for each character. The rectangular areas R1 to R10 are used for the subsequent recognition process as the above-described recognition target areas.
[0031]
By the way, since the dot character string to be inspected in this embodiment is printed by a high-speed printing process while conveying each product, the dot interval or the dot character string depends on the speed of the conveyor for conveyance and the state of the printer. There is a high possibility that the dot size will vary. For this reason, the number of times of image expansion processing required for appropriately cutting out characters may vary depending on the inspection target.
[0032]
FIG. 6 shows an example in which the number of expansions for obtaining the optimum projection image varies depending on the state of the dot character string to be processed.
6 (1) and 6 (2), the lower row is a binary image of a dot character string to be inspected, and each dot character string includes three characters “A”, “B”, and “C” arranged in order. In both FIGS. 6A and 6B, the image at the left end is the original processing target image, and the image is changed to an image in which the expansion processing is overlapped as it proceeds in the arrow direction. Above these images, the distribution state of projected images obtained when the images are projected in the direction of character arrangement is shown.
[0033]
The dot size of the dot character string to be inspected is different between FIG. 6 (1) and FIG. 6 (2). In FIG. 6 (1) for the character string having a small dot, the expansion process is performed. By performing twice, three projected images corresponding to each character are obtained. On the other hand, in the example of FIG. 6 (2) for a character string having a large dot, a projection image corresponding to each character is obtained by performing the dilation process only once.
[0034]
When the dot size or interval changes in this way, it is necessary to change the number of times of image expansion processing.
On the other hand, the dot character string to be inspected in this embodiment is a character string having a fixed number of digits, such as the date of manufacture, product code, etc. As shown in the above, it is possible to obtain the same number of projection images as the number of digits of the character string to be inspected. Therefore, in the image processing apparatus 1 of this embodiment, the number of characters constituting the dot character string to be inspected is input from the external device 4 in advance and stored in the RAM 13, and the image is obtained until projection images corresponding to the number of registered characters are obtained. By repeating the expansion process and the projection process, the character cutout process is performed appropriately and efficiently.
[0035]
FIG. 7 shows the detailed procedure of the character cutout process in ST3.
First, in ST301, the processing target image is projected in the x-axis direction. Since the processing target image here is a binary image, the projection processing result corresponds to a histogram indicating the number of black pixels along the x-axis direction. In the next ST302, a portion in which a value equal to or greater than a predetermined threshold value continues in this histogram (hereinafter, this portion is referred to as a “mountain”. This mountain corresponds to the above-described projected image). And count the number of peaks.
[0036]
Next, in ST303, the number of extracted peaks is compared with the number of registered characters. If the initial image expansion process is not performed, the number of peaks is larger than the number of registered characters. Therefore, ST303 is “NO” and the process proceeds to ST304, and the first expansion process is performed on the processing target image. Then, the process returns to ST301.
[0037]
Similarly, the image expansion process and the projection process are repeated by executing the loop of ST301 to ST304 a predetermined number of times. During this time, since dots in each character are gradually connected, the number of peaks obtained by the projection processing is gradually reduced. If the number of peaks matches the number of registered characters at a predetermined time, ST303 becomes “YES”, and the process proceeds to ST305.
[0038]
In ST305, the position and width of each mountain obtained by the latest projection processing are specified as the character position and character width, respectively. Next, image portions corresponding to the widths of these peaks are extracted from the latest dilated image and projected in the y-axis direction to specify the height of each character. Further, a recognition target area corresponding to each character is set from the projection processing results in the x-axis direction and the y-axis direction.
[0039]
In the inspection performed thereafter, as described above, the image in each recognition target region is checked against the model pattern in the dictionary file. The image to be checked is the original processing target image or the latest image. Any of the expansion processing images may be used.
[0040]
Next, in the example of FIG. 7, the dots are connected by the image expansion process. However, the present invention is not limited to this, and the histogram obtained by the projection process may be expanded.
FIG. 8 shows a procedure for cutting out characters by histogram expansion processing. In FIG. 8, in order to distinguish from the processing of FIG. 7, each processing is shown by the steps after ST306. However, FIGS. 7 and 8 are independent programs as the processing related to ST3 of FIG. Is executed. (The same applies to the procedures shown in FIGS. 9 and 10 below.)
[0041]
In FIG. 8, first, in ST306, the processing target image is projected in the x-axis direction, and in the next ST307, peaks are extracted from the histogram obtained by the projection processing and the number is counted. If the number of peaks is greater than the number of registered characters, ST308 is “NO” and the process proceeds to ST309, where a process of expanding each peak of the histogram by a predetermined width is performed. Thereafter, the process returns to ST307, and the peaks after the expansion process are counted.
[0042]
As a result of repeating the loops of ST307 to 309, if the number of peaks matches the number of registered characters at a predetermined time, the process proceeds from ST308 to ST310. In ST310, after specifying the position and character width of each character by each mountain obtained by the latest dilation processing, the image portions corresponding to these mountains are individually extracted from the processing target image, respectively, in the y-axis direction. Project the image to identify the height of each character. Further, a recognition target area is set for each character by combining the projection results in the x-axis direction and the y-axis direction.
[0043]
According to the processing of FIG. 7 and FIG. 8 described above, even if the dot interval and size vary, the optimum number of expansion processes can be automatically performed for each image to be processed. Each character constituting the dot character string can be accurately cut out to perform highly accurate recognition processing. Even if the printing status changes due to changes in printing conditions or changes in the printing status of the printer (such as the amount of ink), if the character string to be inspected is the same, the inspection is continued without changing any settings. be able to.
Furthermore, when the dot character string to be inspected is changed, the number of characters in the character string is input and registration processing in the RAM 13 is performed, and settings necessary for cutting out the characters in the dot character string are performed. This can greatly reduce the time and effort required for setting.
[0044]
Next, in FIG. 9 and FIG. 10, the processing target image is expanded as in FIG. 7. However, when the projected images for two characters are connected due to the shift of dots, the projected images for one character are separated. If you do, you can respond.
[0045]
First, in the procedure of FIG. 9, similar to the procedure of FIG. 7, the processing target image is projected, and then the peaks on the histogram obtained by this projection processing are collated with the number of registered characters (ST311 to 315). If the number of peaks is larger than the number of registered characters, the loop of ST311 to ST314 is repeated to expand the processing target image a predetermined number of times. When the number of peaks becomes the same as the number of registered characters by this process, both ST313 and ST315 become “NO” and the process proceeds to ST317, and the recognition target area for each character is set in the same manner as in the procedure of FIG.
[0046]
On the other hand, if two characters are combined in the expansion process and the number of peaks is smaller than the number of registered characters, ST313 is “NO” and ST315 is “YES”, and the process proceeds to ST316. In ST316, the width of each peak obtained in the latest histogram is compared with a predetermined reference value, and a peak having a width exceeding the reference value is divided into two, and then the character cutout process in ST317 is executed.
[0047]
According to the above procedure, even when some character intervals become smaller than usual due to printing misalignment, and mountains corresponding to the characters sandwiching the spaces are connected, these mountains are separated by the process of ST316. Therefore, each character can be cut out with high accuracy.
[0048]
Next, in the procedure of FIG. 10, after performing the projection processing of the processing target image, and further extracting the peaks from the histogram obtained by the projection processing and counting the number, the number of the peaks adds 1 to the number of registered characters. The image expansion process and the projection process are repeated until the value becomes equal to or less than the predetermined value (ST318 to 321).
[0049]
When the number of peaks converges to the number obtained by adding 1 to the number of registered characters by the above processing, ST320 becomes “YES”, ST322 becomes “NO”, and the number of expansion processing executed so far is checked in the next ST323. Here, if the number of expansion processes is within the predetermined specified number, ST323 is “NO” and the process returns to ST321. Subsequently, the expansion process and the projection process are executed by the processes of ST318 and 319, and the number of peaks is re-executed. To check.
The specified number of times is registered in advance in the RAM 13 or the ROM 12.
[0050]
If the number of peaks reaches the number of registered characters before the number of expansion processes reaches the specified number in this way, both ST320 and ST322 become “YES” and the process proceeds to ST325, and a recognition target area for each character is set.
On the other hand, if the number of peaks does not reach the number of registered characters even after performing the specified number of expansions, ST322 becomes “NO” and ST323 becomes “YES”, and the process proceeds to ST324. In ST324, the interval between the peaks in the latest histogram is compared with a predetermined reference value, and the two peaks sandwiching the smallest interval within the reference value are integrated into one. As a result of this processing, the number of peaks becomes the same as the number of registered characters, so the process proceeds to ST325, and a recognition target area for each character is set.
[0051]
According to the procedure of FIG. 10 described above, when a part of dots constituting a predetermined character is shifted and the projection image for the character cannot be converged to one even after performing the specified number of expansion processes, Since the expansion process can be terminated and the number of peaks can be adjusted to the number of registered characters, the time required for the expansion process can be reduced. Therefore, inspection accuracy can be maintained without prolonging the inspection time, and processing with high inspection efficiency can be performed.
[0052]
In the example of FIG. 10 described above, the expansion process is continued regardless of the specified number of times until the number of peaks is one larger than the number of set characters. Regardless of the number, the expansion process may be completed within a specified number of times. If the number of peaks when the number of expansions reaches the specified number greatly exceeds the set number of characters, the character string to be inspected may be determined to be defective without performing the mountain integration process. In this way, it is possible to significantly reduce the inspection time applied to a character string that is clearly regarded as defective due to a large shift in dots.
[0053]
Further, in the procedure of FIGS. 9 and 10, the processing target image is expanded, but the same setting as in FIGS. 9 and 10 can be incorporated in the procedure of expanding the histogram as shown in FIG. Further, if the processes of FIGS. 9 and 10 are executed in series, it is possible to deal with both cases in which a combination of characters occurs and a single character is separated, and a more accurate and efficient recognition process. Can be performed.
[0054]
【The invention's effect】
As described above, according to the present invention, in the process of cutting out each dot pattern from an image obtained by imaging a recognition target in which a plurality of dot patterns are arranged, an image to be processed or a projection image obtained from the image is obtained. Since it automatically expands the appropriate number of times according to the dot size and dot interval in the recognition target array, the character segmentation process can be performed accurately and efficiently, and the accuracy and efficiency required for automatic inspection Can be greatly improved. In addition, even if the type of object or printing conditions changes, it is possible to shift to recognition processing simply by registering the number of dot patterns that make up the new recognition target array, greatly reducing the setting effort. can do.
[Brief description of the drawings]
FIG. 1 is a perspective view showing an installation example of an image processing apparatus according to the present invention.
FIG. 2 is a block diagram illustrating an electrical configuration of the image processing apparatus.
FIG. 3 is a flowchart showing an inspection procedure.
FIG. 4 is an explanatory diagram illustrating a specific example of image expansion processing;
FIG. 5 is an explanatory diagram showing the principle of cutting out characters by projection processing.
FIG. 6 is an explanatory diagram showing an example in which the number of expansions necessary for character cutout varies depending on the size of dots.
FIG. 7 is a flowchart showing a detailed procedure of character cut-out processing.
FIG. 8 is a flowchart showing another procedure for character cutout processing;
FIG. 9 is a flowchart showing another procedure for character cutout processing;
FIG. 10 is a flowchart showing another procedure for character cutout processing;
[Explanation of symbols]
1 Image processing device
2 Camera
5 products
11 Processing unit
12 ROM
13 RAM
14 Image memory
15 A / D converter
17 Input / output section
A1 to A10 projection image

Claims (5)

複数のドットパターンが配列されて成る認識対象を撮像して得られた画像を入力する画像入力手段と、前記入力画像から各ドットパターンを切り出して認識する認識処理手段と、前記認識処理手段による認識処理結果を出力する出力手段とを具備し、
前記認識処理手段は、
前記認識対象の配列を構成するドットパターンの数が登録される記憶手段;
前記入力画像に対し、画像を膨張するステップとこの膨張処理後の画像を前記ドットパターンの配列方向に向けて投影するステップとを繰り返す第1の処理/または、前記入力画像を前記ドットパターンの配列方法に向けて投影した後に、この投影処理により得られた投影像を膨張するステップを繰り返す第2の処理を、実行する投影像取得手段;
前記第1または第2の処理の実行中に投影像の数が前記記憶手段に登録されたドットパターンの数より少なくなったとき、投影軸方向の大きさが所定値を上回る投影像を分割する投影像分割手段;
の各手段を含み、前記投影像取得手段または投影像分割手段の処理により記憶手段に登録された数に対応する数の投影像が得られたとき、これらの投影像に基づき画像上のドットパターンを切り出すことを特徴とする画像処理装置。
Image input means for inputting an image obtained by imaging a recognition target in which a plurality of dot patterns are arranged, recognition processing means for recognizing each dot pattern cut out from the input image, and recognition by the recognition processing means Output means for outputting the processing result,
The recognition processing means includes
Storage means for registering the number of dot patterns constituting the array to be recognized ;
A first process for expanding the image and a step of projecting the image after the expansion process toward the arrangement direction of the dot pattern with respect to the input image / or the arrangement of the dot pattern A projection image acquisition means for executing a second process of repeating the step of expanding the projection image obtained by the projection process after projecting toward the method;
When the number of projection images becomes smaller than the number of dot patterns registered in the storage means during the execution of the first or second processing, the projection image whose size in the projection axis direction exceeds a predetermined value is divided. Projection image dividing means;
When the number of projection images corresponding to the number registered in the storage means is obtained by the processing of the projection image acquisition means or the projection image dividing means, the dot pattern on the image based on these projection images An image processing apparatus characterized by cutting out the image.
複数のドットパターンが配列されて成る認識対象を撮像して得られた画像を入力する画像入力手段と、前記入力画像から各ドットパターンを切り出して認識する認識処理手段と、前記認識処理手段による認識処理結果を出力する出力手段とを具備し、Image input means for inputting an image obtained by imaging a recognition target in which a plurality of dot patterns are arranged, recognition processing means for recognizing each dot pattern cut out from the input image, and recognition by the recognition processing means Output means for outputting the processing result,
前記認識処理手段は、The recognition processing means includes
前記認識対象の配列を構成するドットパターンの数が登録される記憶手段;Storage means for registering the number of dot patterns constituting the array to be recognized;
前記入力画像に対し、画像を膨張するステップとこの膨張処理後の画像を前記ドットパターンの配列方向に向けて投影するステップとを繰り返す第1の処理/または、前記入力画像を前記ドットパターンの配列方法に向けて投影した後に、この投影処理により得られた投影像を膨張するステップを繰り返す第2の処理を、実行する投影像取得手段;A first process for expanding the image and a step of projecting the image after the expansion process toward the arrangement direction of the dot pattern with respect to the input image / or the arrangement of the dot pattern A projection image acquisition means for executing a second process of repeating the step of expanding the projection image obtained by the projection process after projecting toward the method;
前記第1または第2の処理を所定回数以上実行した時点における投影像の数が前記記憶手段に登録されたドットパターンの数より多いとき、各投影像間の距離に基づき投影像の統合処理を実行する投影像統合手段;When the number of projection images at the time when the first or second processing is executed a predetermined number of times or more is larger than the number of dot patterns registered in the storage means, the projection image integration processing is performed based on the distance between the projection images. Projection image integration means to perform;
の各手段を含み、前記投影像取得手段または投影像統合手段の処理により前記記憶手段に登録されたドットパターンの数に対応する数の投影像が得られたとき、これらの投影像に基づき画像上のドットパターンを切り出すことを特徴とする画像処理装置。When the number of projection images corresponding to the number of dot patterns registered in the storage means is obtained by the processing of the projection image acquisition means or the projection image integration means, an image based on these projection images is obtained. An image processing apparatus that cuts out the upper dot pattern.
複数のドットパターンが配列されて成る認識対象を撮像して得られた画像を入力する画像入力手段と、前記入力画像から各ドットパターンを切り出して認識する認識処理手段と、前記認識処理手段による認識処理結果を出力する出力手段とを具備し、
前記認識処理手段は、
前記認識対象の配列を構成するドットパターンの数が登録される記憶手段を具備し、前記入力画像を前記ドットパターンの配列方向に向けて投影した後に、この投影処理により得られた投影像を膨張するステップを、前記記憶手段に登録されたドットパターンの数に対応する数の投影像が得られるまで繰り返し、最終的に得られた投影像に基づき画像上のドットパターンを切り出すことを特徴とする画像処理装置。
Image input means for inputting an image obtained by imaging a recognition target in which a plurality of dot patterns are arranged, recognition processing means for recognizing each dot pattern cut out from the input image, and recognition by the recognition processing means Output means for outputting the processing result,
The recognition processing means includes
A storage unit that registers the number of dot patterns constituting the recognition target array; after projecting the input image in the dot pattern array direction, the projection image obtained by the projection process is expanded; Repeating the step until the number of projected images corresponding to the number of dot patterns registered in the storage means is obtained, and cutting out the dot patterns on the image based on the finally obtained projected images. Image processing device.
画像を入力する機能を有するコンピュータを、複数のドットパターンが配列されて成る認識対象を撮像して得られた画像が入力されたときに、その画像から各ドットパターンを切り出して認識する認識処理手段、およびこの認識処理手段による認識処理結果を出力する出力手段として機能させるためのプログラムであって、Recognition processing means for recognizing a computer having a function of inputting an image by cutting out each dot pattern from the image when an image obtained by imaging a recognition target in which a plurality of dot patterns are arranged is input , And a program for functioning as output means for outputting a recognition processing result by the recognition processing means,
認識対象の配列を構成するドットパターンの数の入力を受け付けて、その入力されたドットパターンの数を前記コンピュータのメモリに登録する登録処理手段として前記コンピュータを機能させるためのプログラムが含まれており、A program for receiving the input of the number of dot patterns constituting the recognition target array and registering the number of input dot patterns in the memory of the computer is included. ,
前記認識処理手段は、The recognition processing means includes
前記入力画像に対し、画像を膨張するステップとこの膨張処理後の画像を前記ドットパターンの配列方向に向けて投影するステップとを繰り返す第1の処理/または、前記入力画像を前記ドットパターンの配列方法に向けて投影した後に、この投影処理により得られた投影像を膨張するステップを繰り返す第2の処理を、実行する投影像取得手段;A first process for expanding the image and a step of projecting the image after the expansion process toward the arrangement direction of the dot pattern with respect to the input image / or the arrangement of the dot pattern A projection image acquisition means for executing a second process of repeating the step of expanding the projection image obtained by the projection process after projecting toward the method;
前記第1または第2の処理の実行中に投影像の数が前記メモリに登録されたドットパターンの数より少なくなったとき、投影軸方向の大きさが所定値を上回る投影像を分割する投影像分割手段;の各手段を含み、前記投影像取得手段または投影像分割手段の処理により前記メモリに登録されたドットパターンの数に対応する数の投影像が得られたとき、これらの投影像に基づき画像上のドットパターンを切り出すように構成されていることを、特徴とする画像処理用のプログラム。Projection that divides a projection image whose size in the projection axis direction exceeds a predetermined value when the number of projection images becomes smaller than the number of dot patterns registered in the memory during execution of the first or second processing. And when the number of projection images corresponding to the number of dot patterns registered in the memory is obtained by the processing of the projection image acquisition unit or the projection image division unit. An image processing program characterized by being configured to cut out a dot pattern on an image based on the above.
画像を入力する機能を有するコンピュータを、複数のドットパターンが配列されて成る認識対象を撮像して得られた画像が入力されたとき、その画像から各ドットパターンを切り出して認識する認識処理手段、およびこの認識処理手段による認識処理結果を出力する出力手段として機能させるためのプログラムであって、A recognition processing means for recognizing by cutting out each dot pattern from the image when an image obtained by imaging a recognition object in which a plurality of dot patterns are arranged is input to a computer having a function of inputting an image; And a program for functioning as output means for outputting the recognition processing result by the recognition processing means,
認識対象の配列を構成するドットパターンの数の入力を受け付けて、その入力されたドットパターンの数を前記コンピュータのメモリに登録する登録処理手段として前記コンピュータを機能させるためのプログラムが含まれており、A program for receiving the input of the number of dot patterns constituting the recognition target array and registering the number of input dot patterns in the memory of the computer is included. ,
前記認識処理手段は、The recognition processing means includes
前記入力画像に対し、画像を膨張するステップとこの膨張処理後の画像を繰り返す第1の処理/または、前記入力画像を前記ドットパターンの配列方法に向けて投影した後に、この投影処理により得られた投影像を膨張するステップを繰り返す第2の処理を、実行する投影像取得手段;A first process for expanding the image and an image after the expansion process are repeated on the input image / or obtained by projecting the input image toward the dot pattern arrangement method, and the projection process. Projected image acquisition means for executing a second process of repeating the step of expanding the projected image;
前記第1または第2の処理を所定回数以上実行した時点における投影像の数が前記メモリに登録されたドットパターンの数より多いとき、各投影像間の距離に基づき投影像の統合処理を実行する投影像統合手段;の各手段を含み、前記投影像取得手段または投影像統合手段の処理により前記メモリに登録されたドットパターンの数に対応する数の投影像が得られたとき、これらの投影像に基づき画像上のドットパターンを切り出すように構成されていることを、特徴とする画像処理用のプログラム。When the number of projection images at the time when the first or second processing is executed a predetermined number of times or more is larger than the number of dot patterns registered in the memory, the projection image integration processing is executed based on the distance between the projection images. When the number of projection images corresponding to the number of dot patterns registered in the memory is obtained by the processing of the projection image acquisition unit or the projection image integration unit. An image processing program characterized by being configured to cut out a dot pattern on an image based on a projected image.
JP2001366919A 2001-11-30 2001-11-30 Image processing apparatus and image processing program Expired - Lifetime JP3838079B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001366919A JP3838079B2 (en) 2001-11-30 2001-11-30 Image processing apparatus and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001366919A JP3838079B2 (en) 2001-11-30 2001-11-30 Image processing apparatus and image processing program

Publications (2)

Publication Number Publication Date
JP2003168119A JP2003168119A (en) 2003-06-13
JP3838079B2 true JP3838079B2 (en) 2006-10-25

Family

ID=19176752

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001366919A Expired - Lifetime JP3838079B2 (en) 2001-11-30 2001-11-30 Image processing apparatus and image processing program

Country Status (1)

Country Link
JP (1) JP3838079B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9489587B2 (en) 2012-09-28 2016-11-08 Nihon Yamamura Glass Co., Ltd. Character reader and container inspection system using character reader
JP6122988B1 (en) 2016-03-18 2017-04-26 株式会社Pfu Image processing apparatus, image processing method, and program
JP6391745B1 (en) * 2017-03-24 2018-09-19 紀州技研工業株式会社 Printing character cutting method and printing inspection device
JP6704016B2 (en) * 2018-07-12 2020-06-03 スキャネット株式会社 Answer scoring system, program and method

Also Published As

Publication number Publication date
JP2003168119A (en) 2003-06-13

Similar Documents

Publication Publication Date Title
JP6286866B2 (en) Image processing apparatus and image processing method
US4998285A (en) Character recognition apparatus
EP0045803A1 (en) System and method for processing horizontal line characteristics in an image
JP3838079B2 (en) Image processing apparatus and image processing program
JP2000251082A (en) Document image inclination detecting device
CN111931778B (en) Method for recognizing print characters based on line and column segmentation
JPH04270485A (en) Printing character recognition device
US5369715A (en) Optical character recognition system
JP3838091B2 (en) Pattern recognition apparatus and program for model registration for pattern recognition
US20050186002A1 (en) Printing condition inspection method, a character string inspection method and an inspection apparatus using the methods
EP4148664A1 (en) Print inspection device, print inspection method, and program
JP4631384B2 (en) Printing state inspection method, character inspection method, and inspection apparatus using these methods
JP2006065581A (en) Recognition method and inspection method of character and graphic
JP3022459B2 (en) Form identification registration device
JPH10207978A (en) Character pattern collating method and device therefor
US11951756B2 (en) Printing apparatus and printing method
US20220169040A1 (en) Printing apparatus and printing method
JPH1069524A (en) Character segmentation method
JP2511131B2 (en) Character recognition device
JPH0713994A (en) Character recognizing device
JP2009175800A (en) Character recognition device, assembly device for fuel pump module with the device, and character recognition method
JPH07159341A (en) Inspection apparatus for printing pattern of ink-jet printer
JPH08305794A (en) Address line extracting device
JP2001092922A (en) Method and device for collating character
JPH04268987A (en) Character recognizing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040528

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060307

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060508

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: 20060711

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060724

R150 Certificate of patent or registration of utility model

Ref document number: 3838079

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20100811

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100811

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20110811

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110811

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120811

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20130811

Year of fee payment: 7

EXPY Cancellation because of completion of term