JP2802183B2 - Inspection apparatus using pattern matching and pattern matching method - Google Patents

Inspection apparatus using pattern matching and pattern matching method

Info

Publication number
JP2802183B2
JP2802183B2 JP3127808A JP12780891A JP2802183B2 JP 2802183 B2 JP2802183 B2 JP 2802183B2 JP 3127808 A JP3127808 A JP 3127808A JP 12780891 A JP12780891 A JP 12780891A JP 2802183 B2 JP2802183 B2 JP 2802183B2
Authority
JP
Japan
Prior art keywords
matrix
pattern
shift
comparison
input
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
JP3127808A
Other languages
Japanese (ja)
Other versions
JPH04353990A (en
Inventor
仁 後藤
勝 布目
Original Assignee
日立エンジニアリング株式会社
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 日立エンジニアリング株式会社 filed Critical 日立エンジニアリング株式会社
Priority to JP3127808A priority Critical patent/JP2802183B2/en
Publication of JPH04353990A publication Critical patent/JPH04353990A/en
Application granted granted Critical
Publication of JP2802183B2 publication Critical patent/JP2802183B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Character Discrimination (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、画像処理装置における
パターン照合方法に係り、特に、捺印文字やインクジェ
ット文字の品質検査に好適なパターンマッチング装置に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pattern matching method in an image processing apparatus, and more particularly to a pattern matching apparatus suitable for quality inspection of stamped characters and ink jet characters.

【0002】[0002]

【従来の技術】従来のパターンマッチング装置は、特開
平1−229384号公報に記載されているように、予
め登録されている文字の文字情報であるn行m列のマス
タパターンと、実際に入力された文字の文字情報である
n行m列の入力パターンとを比較することにより、差情
報を抽出し、差情報の数に基づいて、文字の照合を行っ
ていた。
2. Description of the Related Art As disclosed in Japanese Patent Application Laid-Open No. 1-229384, a conventional pattern matching apparatus includes an n-row m-column master pattern which is character information of a character registered in advance, and an actual input pattern. The difference information is extracted by comparing it with the input pattern of n rows and m columns, which is the character information of the extracted character, and the characters are collated based on the number of difference information.

【0003】このようなパターンマッチング装置を用い
て捺印文字やインクジェット文字の品質検査を行う際
に、大きな障害となるのは、本来意図した文字と異なる
文字が印字された場合はもちろんのこと、本来意図した
文字と同一の文字が印字された場合でも、インク,スタ
ンプおよび印字される側の状態によって、文字幅が太く
なったり細くなったりすると、その文字の文字情報であ
る入力パターンと、予め登録してある本来の文字の文字
情報であるマスタパターンとを比較した結果得られる差
情報の数が大きくなることである。このような差情報
は、文字の輪郭部分に発生するという特徴がある。
A major obstacle to quality inspection of stamped characters and ink-jet characters using such a pattern matching apparatus is not only when a character different from the originally intended character is printed, but also when a character different from the originally intended character is printed. Even if the same character as the intended character is printed, if the character width becomes thicker or thinner depending on the ink, stamp, and the state of the side to be printed, the input pattern that is the character information of the character is registered in advance. This means that the number of difference information obtained as a result of comparison with the master pattern which is the character information of the original character is increased. Such difference information is characterized in that it occurs in a contour portion of a character.

【0004】そこで、従来は、マスタパターンと入力パ
ターンとの比較で発生しやすい文字の輪郭部分の差情報
を無視するようにしている。
Therefore, conventionally, the difference information of the contour portion of the character which is likely to be generated in the comparison between the master pattern and the input pattern is ignored.

【0005】具体的には、マスタパターンは、背景要
素,文字要素,不確定要素の3つの要素から構成するよ
うにしており、不確定要素とは、文字の輪郭部分の領域
を示している。そして、不確定要素における差情報の数
を、実際より少なくなるよう補正するようにしている。
More specifically, the master pattern is composed of three elements, a background element, a character element, and an uncertain element, and the uncertain element indicates an area of a character outline. Then, the number of pieces of difference information in the uncertain element is corrected so as to be smaller than the actual value.

【0006】[0006]

【発明が解決しようとする課題】上記従来技術は、予め
登録したマスタパターンのうち、文字の輪郭部分の領域
を不確定要素とするため、本来の文字情報であるべき文
字要素の情報量を減じており、最終的に該当する文字で
あるか否かを判定する差情報の数が、文字要素の情報量
の大小に左右されるという問題があった。
In the above-mentioned prior art, since the area of the outline of a character in the master pattern registered in advance is set as an uncertain element, the information amount of the character element which should be the original character information is reduced. As a result, there is a problem that the number of pieces of difference information for determining whether or not the character is the corresponding character finally depends on the information amount of the character element.

【0007】また、従来技術では、実際に印字された文
字が太くなる場合と細くなる場合に対応するためには、
文字の変動幅を予測し、変動に見合った不確定要素を確
保する必要があり、不確定要素が大きくなるという問題
があった。
In the prior art, in order to cope with a case where characters actually printed become thicker and thinner,
It is necessary to predict the fluctuation range of the character and secure an uncertain element corresponding to the fluctuation, and there is a problem that the uncertain element increases.

【0008】本発明の目的は、マスタパターンのうち、
本来の文字情報であるべき文字要素の情報量を減ずるこ
となく、実際に印字された文字の変動の方向に左右され
ず、マスタパターンと入力パターンとを比較した結果得
られる差情報のうちから、文字の輪郭部分の差情報のみ
を除去することにある。
It is an object of the present invention to provide a master pattern
Without reducing the information amount of the character element which should be the original character information, regardless of the direction of the fluctuation of the character actually printed, from among the difference information obtained as a result of comparing the master pattern and the input pattern, It is to remove only the difference information of the outline part of the character.

【0009】[0009]

【課題を解決するための手段】上記目的を達成するため
に、本発明は、マスタパターンには不確定要素を含まな
いようにし、文字の輪郭部分(不確定要素)に発生する
差情報を除去するフィルタリング処理を行うようにして
いる。
In order to achieve the above object, according to the present invention, a master pattern does not include an uncertain element, and difference information generated in a contour portion (uncertain element) of a character is removed. Filter processing to be performed.

【0010】具体的には、予め登録されている文字の文
字情報であるマスタパターンと、実際に入力された文字
の文字情報である入力パターンとを記憶しているメモリ
と、上記メモリに記憶されているマスタパターンおよび
入力パターンをn行m列の行列にサンプリングするサン
プリング回路と、上記サンプリング回路によりサンプリ
ングされたマスタパターン行列および入力パターン行列
の差情報を抽出する比較回路と、上記比較回路により抽
出された差情報のうちから、文字の輪郭部分に発生する
差情報のみを除去するフィルタと、上記フィルタにより
除去された部分を除く残りの差情報の数を計測し、計測
結果を出力するカウンタとを備えるようにしている。
More specifically, a memory storing a master pattern, which is character information of characters registered in advance, and an input pattern, which is character information of characters actually input, is stored in the memory. A sampling circuit that samples the master pattern and the input pattern into a matrix of n rows and m columns; a comparison circuit that extracts difference information between the master pattern matrix and the input pattern matrix sampled by the sampling circuit; A filter that removes only difference information occurring in the outline portion of the character from the difference information, and a counter that measures the number of remaining difference information excluding the portion removed by the filter and outputs a measurement result. Is provided.

【0011】上記フィルタは、上記比較回路により抽出
された差情報を上下左右にシフトする行列シフタと、上
記行列シフタにより上下左右にシフトされた4つの差情
報の各々と、上記比較回路により抽出された差情報との
間で、AND処理を行う行列AND回路と、上記行列A
ND回路によりAND処理された結果の各々の間で、O
R処理を行う行列OR回路とを備えるようにしている。
The filter is a matrix shifter for shifting the difference information extracted by the comparison circuit up, down, left and right, each of the four difference information shifted up, down, left and right by the matrix shifter, and extracted by the comparison circuit. A matrix AND circuit for performing an AND process between the difference information and the matrix A
Between each of the results of the AND processing by the ND circuit, O
And a matrix OR circuit for performing R processing.

【0012】なお、上記行列シフタのシフト量は、任意
に変更可能であるようにすることができる。
The shift amount of the matrix shifter can be arbitrarily changed.

【0013】[0013]

【作用】比較回路により抽出された、n行m列のマスタ
パターン行列およびn行m列の入力パターン行列の差情
報を、比較パターン行列と呼ぶ。
The difference information between the master pattern matrix of n rows and m columns and the input pattern matrix of n rows and m columns extracted by the comparison circuit is called a comparison pattern matrix.

【0014】フィルタにおいては、具体的には、行列シ
フタは、この比較パターン行列を左上にシフトした左上
シフト行列,右上にシフトした右上シフト行列,左下に
シフトした左下シフト行列,右下にシフトした右下シフ
ト行列を生成する。
In the filter, specifically, the matrix shifter shifts the comparison pattern matrix to the upper left, shifted to the upper left, shifted to the upper right, shifted to the upper right, shifted to the lower left, shifted to the lower left, shifted to the lower right. Generate a lower right shift matrix.

【0015】次に、行列OR回路は、行列AND回路
が、左上シフト行列と比較パターン行列との間でAND
処理を行った結果と、行列AND回路が、右上シフト行
列と比較パターン行列との間でAND処理を行った結果
との間で、OR処理を行うことにより、中間行列を生成
する。
Next, in the matrix OR circuit, the matrix AND circuit performs an AND operation between the upper left shift matrix and the comparison pattern matrix.
An intermediate matrix is generated by performing an OR process between the result of the process and the result of the AND process performed between the upper right shift matrix and the comparison pattern matrix by the matrix AND circuit.

【0016】続いて、行列OR回路は、行列AND回路
が、左下シフト行列と中間行列との間でAND処理を行
った結果と、行列AND回路が、右下シフト行列と中間
行列との間でAND処理を行った結果との間で、OR処
理を行うことにより、結果パターン行列を生成する。
Subsequently, the matrix OR circuit determines whether the matrix AND circuit performs an AND operation between the lower left shift matrix and the intermediate matrix, and the matrix AND circuit determines whether the lower right shift matrix and the intermediate matrix have the same. The result pattern matrix is generated by performing an OR process on the result of the AND process.

【0017】比較パターン行列においては、入力パター
ンが本来の文字と異なる文字の文字情報である場合に
は、異なる部分に、差情報が多数発生するが、入力パタ
ーンが本来の文字と同一の文字の文字情報である場合で
も、印字状態等の外部要因の変動により、文字の輪郭部
分に、差情報が発生する。
In the comparison pattern matrix, when the input pattern is character information of a character different from the original character, a lot of difference information is generated in different portions, but the input pattern is the same character as the original character. Even in the case of character information, difference information is generated in a contour portion of the character due to a change in an external factor such as a printing state.

【0018】本発明は、異なる文字情報を比較した場合
の差情報と、同一の文字情報を比較した場合の差情報と
に着目したものであり、フィルタにより、文字の輪郭部
分に発生する差情報を除去することで、印字状態等の外
部要因の変動による誤動作を防止している。
The present invention focuses on difference information when different character information is compared and difference information when the same character information is compared. Difference information generated in a contour portion of a character by a filter is provided. Is removed, thereby preventing a malfunction due to a change in an external factor such as a printing state.

【0019】つまり、行列シフタによるシフト量の範囲
内の変動は、行列AND回路のAND処理および行列O
R回路のOR処理により吸収されるので、入力パターン
が本来の文字と同一の文字の文字情報である場合には、
変動があっても、差情報の数を最小とすることができ、
入力パターンが本来の文字と異なる文字の文字情報であ
る場合には、マスタパターンと似通っていても、差情報
の数を最大にすることができる。
That is, the variation within the range of the shift amount by the matrix shifter is caused by the AND processing of the matrix AND circuit and the matrix O
Since it is absorbed by the OR processing of the R circuit, if the input pattern is character information of the same character as the original character,
Even if there is a fluctuation, the number of difference information can be minimized,
When the input pattern is character information of a character different from the original character, the number of difference information can be maximized even if the input pattern is similar to the master pattern.

【0020】また、サンプリング回路によるサンプリン
グ時に生じる雑音情報についても、結果的に除去可能と
なる。
Further, noise information generated at the time of sampling by the sampling circuit can be removed as a result.

【0021】なお、吸収する変動幅は、行列シフタのシ
フト量を変化させることにより調節することができる。
The fluctuation range to be absorbed can be adjusted by changing the shift amount of the matrix shifter.

【0022】[0022]

【実施例】以下、本発明の一実施例について図面を参照
して説明する。
An embodiment of the present invention will be described below with reference to the drawings.

【0023】図1は、本発明の一実施例のパターンマッ
チング装置の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a pattern matching apparatus according to one embodiment of the present invention.

【0024】図中、1はメモリ、2はサンプリング回
路、3は比較回路、4はフィルタ、5はカウンタであ
る。
In the figure, 1 is a memory, 2 is a sampling circuit, 3 is a comparison circuit, 4 is a filter, and 5 is a counter.

【0025】メモリ1は、図2に示すように、予め登録
された文字の文字情報であるマスタパターンを記憶する
マスタパターンメモリ1aと、実際に入力された文字の
文字情報である入力パターンを記憶する入力パターンメ
モリ1bとを有している。
As shown in FIG. 2, the memory 1 stores a master pattern memory 1a for storing a master pattern which is character information of characters registered in advance, and stores an input pattern which is character information for characters actually input. And an input pattern memory 1b.

【0026】図3は、サンプリング回路2が行うサンプ
リング処理の説明図である。
FIG. 3 is an explanatory diagram of the sampling process performed by the sampling circuit 2.

【0027】図3に示すように、サンプリング回路2
は、マスタパターンメモリ1aに記憶されているマスタ
パターンをマスタパターン行列6aに変換し、入力パタ
ーンメモリ1bに記憶されている入力パターンを入力パ
ターン行列6bに変換する。サンプリング回路2によっ
て生成されるマスタパターン行列6aおよび入力パター
ン行列6bは、n行m列の行列である。
As shown in FIG. 3, the sampling circuit 2
Converts the master pattern stored in the master pattern memory 1a into a master pattern matrix 6a, and converts the input pattern stored in the input pattern memory 1b into an input pattern matrix 6b. The master pattern matrix 6a and the input pattern matrix 6b generated by the sampling circuit 2 are n rows and m columns.

【0028】図4は、比較回路3が行う比較処理の説明
図である。
FIG. 4 is an explanatory diagram of the comparison processing performed by the comparison circuit 3.

【0029】図4に示すように、比較回路3は、サンプ
リング回路2によって生成されたn行m列のマスタパタ
ーン行列6aと入力パターン行列6bとの差情報を抽出
し、n行m列の比較パターン行列6cを生成する。
As shown in FIG. 4, the comparison circuit 3 extracts difference information between the master pattern matrix 6a of n rows and m columns generated by the sampling circuit 2 and the input pattern matrix 6b, and compares n rows and m columns. A pattern matrix 6c is generated.

【0030】比較パターン行列6cを構成する差情報に
は、不確定要素差情報7および不一致要素差情報8があ
る。不確定要素差情報7は、入力パターンの入力時やサ
ンプリング回路2によるサンプリング時に生じる雑音な
どの、文字の輪郭部分に発生する差情報である。また、
不一致要素差情報8は、入力パターンとマスタパターン
とが本質的に異なる部分に発生する差情報である。
The difference information forming the comparison pattern matrix 6c includes uncertain element difference information 7 and mismatch element difference information 8. The uncertain element difference information 7 is difference information that occurs in the outline portion of the character, such as noise generated when an input pattern is input or when the sampling circuit 2 performs sampling. Also,
The mismatch element difference information 8 is difference information generated in a part where the input pattern and the master pattern are essentially different.

【0031】図4(a)においては、マスタパターンが
「3」であるのに、入力パターンが「8」である場合を
示しているので、不確定要素差情報7に加えて、不一致
要素差情報8も発生している。
FIG. 4A shows a case where the master pattern is “3” and the input pattern is “8”. Therefore, in addition to the uncertain element difference information 7, Information 8 has also been generated.

【0032】一方、図4(b)においては、マスタパタ
ーンおよび入力パターンが共に「3」である場合を示し
ているので、不確定要素差情報7のみが発生している。
On the other hand, FIG. 4B shows a case where both the master pattern and the input pattern are "3", so that only the uncertain element difference information 7 is generated.

【0033】図5は、フィルタ4の内部構成を示すブロ
ック図である。
FIG. 5 is a block diagram showing the internal configuration of the filter 4.

【0034】図中、4aは行列シフタ、4bは行列AN
D回路、4cは行列OR回路である。
In the figure, 4a is a matrix shifter, 4b is a matrix AN
D circuits and 4c are matrix OR circuits.

【0035】図6は、フィルタ4が行うフィルタリング
処理の説明図である。
FIG. 6 is an explanatory diagram of the filtering process performed by the filter 4.

【0036】図6に示すように、フィルタ4は、比較回
路3によって生成されたn行m列の比較パターン行列6
cに対し、不確定要素差情報7を除去し、不一致要素差
情報8のみから構成されるn行m列の結果パターン行列
6dを生成する。なお、カウンタ5は、フィルタ4によ
って生成されたn行m列の結果パターン行列6dのう
ち、不一致要素差情報8の数を計測し、計測結果を出力
する。
As shown in FIG. 6, the filter 4 includes a comparison pattern matrix 6 of n rows and m columns generated by the comparison circuit 3.
For c, the uncertainty element difference information 7 is removed, and a result pattern matrix 6d of n rows and m columns composed of only the unmatched element difference information 8 is generated. The counter 5 measures the number of pieces of mismatch element difference information 8 in the result pattern matrix 6d of n rows and m columns generated by the filter 4, and outputs the measurement result.

【0037】以下、フィルタ4が行うフィルタリング処
理について、詳細に説明する。
Hereinafter, the filtering process performed by the filter 4 will be described in detail.

【0038】行列シフタ4aは、比較回路3によって生
成されたn行m列の比較パターン行列6cを左上にシフ
トした左上シフト行列6e,右上にシフトした右上シフ
ト行列6f,左下にシフトした左下シフト行列6g,右
下にシフトした右下シフト行列6hの各行列を生成す
る。この様子を図7に示す。
The matrix shifter 4a includes an upper left shift matrix 6e obtained by shifting the comparison pattern matrix 6c of n rows and m columns generated by the comparison circuit 3 to the upper left, an upper right shift matrix 6f shifted to the upper right, and a lower left shift matrix shifted to the lower left. 6g, a lower right shift matrix 6h shifted to the lower right is generated. This is shown in FIG.

【0039】次に、行列AND回路4bは、左上シフト
行列6eと比較パターン行列6cとの間でAND処理を
行い、右上シフト行列6fと比較パターン行列6cとの
間でAND処理を行う。行列OR回路4cは、2つのA
ND処理の結果をOR処理し、n行m列の中間行列6i
を生成する。
Next, the matrix AND circuit 4b performs an AND process between the upper left shift matrix 6e and the comparison pattern matrix 6c, and performs an AND process between the upper right shift matrix 6f and the comparison pattern matrix 6c. The matrix OR circuit 4c has two A
The result of the ND processing is OR-processed, and an intermediate matrix 6i of n rows and m columns
Generate

【0040】続いて、行列AND回路4bは、左下シフ
ト行列6gと中間行列6iとの間でAND処理を行い、
右下シフト行列6hと中間行列6iとの間でAND処理
を行う。行列OR回路4cは、2つのAND処理の結果
をOR処理し、n行m列の結果パターン行列6dを生成
する。この様子を図8に示す。
Subsequently, the matrix AND circuit 4b performs an AND process between the lower left shift matrix 6g and the intermediate matrix 6i,
An AND process is performed between the lower right shift matrix 6h and the intermediate matrix 6i. The matrix OR circuit 4c performs an OR process on the results of the two AND processes, and generates a result pattern matrix 6d of n rows and m columns. This is shown in FIG.

【0041】マスタパターン行列6aと入力パターン行
列6bとの差情報である比較パターン行列6c中の不確
定要素差情報7は、文字の輪郭部分に発生するため、2
方向に連結した線状となり、不一致要素差情報8は4方
向に連結した塊状となる。
Since the uncertain element difference information 7 in the comparison pattern matrix 6c, which is the difference information between the master pattern matrix 6a and the input pattern matrix 6b, occurs in the outline portion of the character,
Thus, the unmatched element difference information 8 is a block connected in four directions.

【0042】そこで、このように、マスタパターン行列
6aと入力パターン行列6bとの差情報である比較パタ
ーン行列6cと、これを左上,左下,右上,右下にシフ
トしたシフト行列6e〜6hとの間でAND処理を行う
ことにより、線状の差情報(すなわち、不確定要素差情
報7)は、除去され、塊状の差情報要素(すなわち、不
一致要素差情報8)は、本来の大きさを変えることな
く、結果パターン行列6d中に残る。
Thus, as described above, the comparison pattern matrix 6c, which is the difference information between the master pattern matrix 6a and the input pattern matrix 6b, and the shift matrices 6e to 6h obtained by shifting the comparison pattern matrix to the upper left, lower left, upper right, and lower right. By performing an AND process between them, the linear difference information (that is, the uncertain element difference information 7) is removed, and the massive difference information element (that is, the mismatch element difference information 8) has its original size. It remains in the result pattern matrix 6d without being changed.

【0043】つまり、例えば、入力パターンが印字され
た文字の文字情報である場合に、実際に印字された文字
が太くなったり細くなったりすることにより発生する差
情報である不確定要素差情報7は、このようなフィルタ
リング処理を行うことにより、比較パターン行列6cの
うちから除去されるが、実際に印字された文字が登録さ
れた文字と異なることにより発生する差情報である不一
致要素差情報8は、比較パターン行列6cから除去され
ない。
That is, for example, when the input pattern is character information of a printed character, uncertain element difference information 7 which is difference information generated when the actually printed character becomes thicker or thinner. Is removed from the comparison pattern matrix 6c by performing such a filtering process, but the mismatched element difference information 8 which is difference information generated when a character actually printed differs from a registered character. Are not removed from the comparison pattern matrix 6c.

【0044】なお、行列シフタ4aのシフト量を調節す
ることにより、除去する不確定要素差情報7を調節する
ことが可能である。
The uncertain element difference information 7 to be removed can be adjusted by adjusting the shift amount of the matrix shifter 4a.

【0045】つまり、例えば、実際に印字された文字が
太くなったり細くなったりした場合に、シフト量の範囲
内の太さの変動は、不確定要素差情報7として除去され
るので、シフト量を調節することにより、シフト量の範
囲を超える太さの変動を、不一致要素差情報8に含ませ
ることができる。
That is, for example, when a character actually printed becomes thicker or thinner, a change in the thickness within the range of the shift amount is removed as the uncertain element difference information 7. Is adjusted, the variation of the thickness exceeding the range of the shift amount can be included in the mismatch element difference information 8.

【0046】次に、カウンタ5の計測処理について説明
する。
Next, the measurement processing of the counter 5 will be described.

【0047】カウンタ5は、不確定要素差情報7が除去
された結果パターン行列6dから、残った不一致情報差
情報8の数を計測し、結果を得る。そして、マスタパタ
ーンの面積に対する一致部分の割合を求め、求めた割合
と所定の値とを比較することにより、誤りであるか否か
を出力する。
The counter 5 counts the number of remaining mismatch information difference information 8 from the result pattern matrix 6d from which the uncertain element difference information 7 has been removed, and obtains the result. Then, the ratio of the matching portion to the area of the master pattern is calculated, and the calculated ratio is compared with a predetermined value to output whether or not there is an error.

【0048】以上説明したように、本実施例によれば、
マスタパターンに不確定要素を含まないようにし、マス
タパターン行列6aと入力パターン行列6bとを比較し
た結果得られる比較パターン行列6cのうちから、不確
定要素差情報7のみを除去し、不一致要素差情報8のみ
を残した結果パターン行列6dを抽出するので、同一の
文字情報を比較した場合に、その太さの変動や印字状態
の変化に対する影響を受けにくく、異なる文字情報を比
較した場合には、厳密に検出することができるという効
果がある。
As described above, according to the present embodiment,
Uncertain elements are not included in the master pattern, and only the uncertain element difference information 7 is removed from the comparison pattern matrix 6c obtained as a result of comparing the master pattern matrix 6a with the input pattern matrix 6b. Since the pattern matrix 6d is extracted as a result of leaving only the information 8, when the same character information is compared, it is hardly affected by a change in the thickness or a change in the printing state. Has the effect that it can be detected strictly.

【0049】具体的には、従来は、マスタパターンに不
確定要素を含んでいるので、1つのマスタパターンが有
する情報量は、例えば、16行16列の場合、 16(行)×16(列)×3(ビット)=768(ビッ
ト) となり、英数字36文字に対応するためには、 36×768(ビット)=27648(ビット) が必要となる。上記式における3ビットは、背景要素,
文字要素,不確定要素のいずれであるかを示すためのフ
ラグ情報である。
Specifically, conventionally, since an uncertain element is included in a master pattern, the information amount of one master pattern is, for example, 16 (rows) × 16 (columns) in the case of 16 rows and 16 columns. ) × 3 (bits) = 768 (bits), and 36 × 768 (bits) = 27648 (bits) are required to correspond to 36 alphanumeric characters. The three bits in the above equation are the background element,
This is flag information for indicating whether the element is a character element or an uncertain element.

【0050】ところが、本実施例では、マスタパターン
に不確定要素を含まないので、背景要素,文字要素,不
確定要素のいずれであるかを示すためのフラグ情報が不
要となり、1つのマスタパターンが有する情報量は、 16(行)×16(列)=256(ビット) で済む。
However, in this embodiment, since the master pattern does not include an uncertain element, flag information for indicating whether the element is a background element, a character element, or an uncertain element is unnecessary, and one master pattern is used. The information amount to be provided is 16 (rows) × 16 (columns) = 256 (bits).

【0051】また、従来は、16行16列の場合、サン
プリングした結果の全要素数は256要素であり、背景
要素を50%とすると、不確定要素は64要素となり、
文字要素の半分が不確定要素となってしまうが、本実施
例では、マスタパターンに不確定要素を含まないので、
従来技術と比較して、2倍の検出感度を実現できる。
Conventionally, in the case of 16 rows and 16 columns, the total number of elements as a result of sampling is 256 elements, and if the background element is 50%, the uncertainty element is 64 elements,
Although half of the character elements become uncertain elements, in this embodiment, since the master pattern does not include uncertain elements,
As compared with the prior art, twice the detection sensitivity can be realized.

【0052】さらに、従来は、16行16列の同一の文
字情報を比較した場合に、同一であることが許容できる
変動幅は、サンプリング時の雑音に相当する半画素分の
変動幅である±3.1%の範囲であるが、本実施例で
は、行列シフタのシフト量を1画素分とすると、2画素
分の変動幅である±12.5%の範囲であり、従来技術
と比較して、4倍の効果がある。
Further, conventionally, when the same character information in 16 rows and 16 columns is compared, the fluctuation width that can be permitted to be the same is a fluctuation width of half a pixel corresponding to noise at the time of sampling ±. In this embodiment, if the shift amount of the matrix shifter is one pixel, the shift range of the two pixels is ± 12.5%, which is a range of ± 12.5%. There is a 4 times effect.

【0053】さて、次に、本実施例を適用した検査装置
の例について説明する。
Next, an example of an inspection apparatus to which the present embodiment is applied will be described.

【0054】図9は、本実施例を適用した検査装置の構
成例を示すブロック図である。
FIG. 9 is a block diagram showing a configuration example of an inspection apparatus to which the present embodiment is applied.

【0055】図9に示すように、本検査装置は、ベルト
コンベアで高速に移動する被検査体12にインクジェッ
トプリンタ9により印字された日付や製品番号を、IT
Vカメラ(工業用カメラ)10で撮像し、撮像したデー
タを、本実施例のパターンマッチング装置11により、
印字された日付や製品番号が正しく印字されているか否
かを検査する。
As shown in FIG. 9, the present inspection apparatus uses the date and product number printed by the inkjet printer 9 on the inspection object 12 moving at a high speed on a belt
An image is captured by a V camera (industrial camera) 10 and the captured data is processed by the pattern matching device 11 of the present embodiment.
Check that the date and product number printed are correct.

【0056】すなわち、パターンマッチング装置11に
おいて、マスタパターンメモリ1aに、本来印字される
べき日付や製品番号を登録しておき、ITVカメラ10
で撮像したデータとの間でパターンマッチングを行う。
そして、カウンタ5の計測結果が、誤った日付や製品番
号が印字されたことを示す場合には、例えば、ブザー
(図示せず。)を鳴らすことにより、検査者に通知す
る。また、誤った日付や製品番号が印字された被検査体
12をベルトコンベアから取り除く装置を設けるように
してもよい。
That is, in the pattern matching device 11, the date and product number to be originally printed are registered in the master pattern memory 1a.
Pattern matching is performed with the data captured in step (1).
When the measurement result of the counter 5 indicates that an incorrect date or product number is printed, the buzzer (not shown) is sounded, for example, to notify the inspector. Further, a device for removing the inspection object 12 on which the incorrect date or product number is printed from the belt conveyor may be provided.

【0057】このほかにも、本実施例は、キートップに
刻印された文字を検査する検査装置やバーコードを検査
する検査装置にも適用することができる。
In addition, the present embodiment can be applied to an inspection device for inspecting characters engraved on a key top and an inspection device for inspecting a bar code.

【0058】なお、本明細書においては、文字,記号,
図形等の、パターンマッチングを行う対象物となるデー
タを代表して、「文字」と記している。
In this specification, characters, symbols,
“Character” is described as data representing a target object for pattern matching, such as a figure.

【0059】[0059]

【発明の効果】以上説明したように、本発明によれば、
マスタパターンに不確定要素を含まないようにし、マス
タパターンと入力パターンとを比較した結果得られる差
情報から、文字の輪郭部分に発生する差情報のみを除去
することができるので、入力パターンの変動の方向に左
右されず、本質的に異なる差情報のみを抽出した、感度
の良いパターンマッチング装置を実現することが可能と
なる。
As described above, according to the present invention,
Since the master pattern does not include uncertain elements, only the difference information generated in the outline of the character can be removed from the difference information obtained as a result of comparing the master pattern with the input pattern, so that the variation of the input pattern can be reduced. , It is possible to realize a highly sensitive pattern matching apparatus that extracts only the difference information that is essentially different regardless of the direction.

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

【図1】本実施例のパターンマッチング装置の構成を示
すブロック図。
FIG. 1 is a block diagram illustrating a configuration of a pattern matching apparatus according to an embodiment.

【図2】本実施例に係るメモリの構成を示す説明図。FIG. 2 is an explanatory diagram illustrating a configuration of a memory according to the embodiment;

【図3】本実施例に係るサンプリング回路が行うサンプ
リング処理の説明図。
FIG. 3 is an explanatory diagram of a sampling process performed by the sampling circuit according to the embodiment.

【図4】本実施例に係る比較回路が行う比較処理の説明
図。
FIG. 4 is an explanatory diagram of a comparison process performed by the comparison circuit according to the embodiment.

【図5】本実施例に係るフィルタの内部構成を示すブロ
ック図。
FIG. 5 is a block diagram illustrating an internal configuration of a filter according to the embodiment.

【図6】本実施例に係るフィルタが行うフィルタリング
処理の説明図。
FIG. 6 is an explanatory diagram of a filtering process performed by the filter according to the embodiment.

【図7】本実施例に係る行列シフタが行うシフト処理の
説明図。
FIG. 7 is an explanatory diagram of a shift process performed by the matrix shifter according to the embodiment.

【図8】本実施例に係る行列AND回路および行列OR
回路が行うAND処理およびOR処理の説明図。
FIG. 8 illustrates a matrix AND circuit and a matrix OR according to the present embodiment.
FIG. 4 is an explanatory diagram of an AND process and an OR process performed by a circuit.

【図9】本実施例のパターンマッチング装置を適用した
検査装置の構成を示す説明図。
FIG. 9 is an explanatory diagram showing a configuration of an inspection device to which the pattern matching device of the present embodiment is applied.

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

1…メモリ、1a…マスタパターンメモリ、1b…入力
パターンメモリ、2…サンプリング回路、3…比較回
路、4…フィルタ、4a…行列シフタ、4b…行列AN
D回路、4c…行列OR回路、5…カウンタ、6a…マ
スタパターン行列、6b…入力パターン行列、6c…比
較パターン行列、6d…結果パターン行列、6e…左上
シフト行列、6f…右上シフト行列、6g…左下シフト
行列、6h…右下シフト行列、6i…中間行列、7…不
確定要素差情報、8…不一致要素差情報、9…インクジ
ェットプリンタ、10…ITVカメラ、11…パターン
マッチング装置、12…被検査体。
DESCRIPTION OF SYMBOLS 1 ... memory, 1a ... master pattern memory, 1b ... input pattern memory, 2 ... sampling circuit, 3 ... comparison circuit, 4 ... filter, 4a ... matrix shifter, 4b ... matrix AN
D circuit, 4c matrix OR circuit, 5 counter, 6a master pattern matrix, 6b input pattern matrix, 6c comparison pattern matrix, 6d result pattern matrix, 6e upper left shift matrix, 6f upper right shift matrix, 6g ... Lower left shift matrix, 6h Lower right shift matrix, 6i Intermediate matrix, 7 Uncertain element difference information, 8 Unmatched element difference information, 9 Inkjet printer, 10 ITV camera, 11 Pattern matching device, 12 Inspected body.

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭61−65377(JP,A) 特開 昭61−35303(JP,A) 特開 昭59−2330(JP,A) 特開 昭58−30645(JP,A) 特公 平1−60767(JP,B2) (58)調査した分野(Int.Cl.6,DB名) G06K 9/62 特許ファイル(PATOLIS)──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-61-65377 (JP, A) JP-A-61-35303 (JP, A) JP-A-59-2330 (JP, A) JP-A-58-58 30645 (JP, A) JP 1-60767 (JP, B2) (58) Fields investigated (Int. Cl. 6 , DB name) G06K 9/62 Patent file (PATOLIS)

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】予め登録されている文字の情報であるマス
タパターンと、実際に入力された文字の情報である入力
パターンとを格納するための記憶手段と、 前記メモリに格納されているマスタパターンおよび入力
パターンをn行m列の行列にサンプリングすることによ
り、前記マスタパターン行列および入力パターン行列を
生成するサンプリング手段と、 前記マスタパターン行列と入力パターン行列とを比較
し、両者の差のパターン行列である比較パターン行列を
得る比較手段と、 前記比較パターン行列を、左斜め上、右斜め上、左斜め
下、右斜め下方向に、予め定めた量だけそれぞれシフト
させた4つのシフト行列を生成するシフト手段と、 前記4つのシフト行列のうちの2つのシフト行列を、そ
れぞれ、前記比較パターン行列とAND処理し、このA
ND処理により得られた処理結果同士をOR処理して中
間行列を得て、当該中間行列を、前記4つのシフト行列
のうちの残りの2つのシフト行列とそれぞれAND処理
し、このAND処理により得られた処理結果同士をOR
処理することにより、前記比較パターン行列から不確定
要素を除去した不一致パターン行列を得るフィルタ手段
と、 前記不一致パターン行列に含まれる情報の数をカウント
するカウンタ手段とを有する ことを特徴とするパターン
マッチング装置。
1. A cell which is information of a character registered in advance.
Input that is the information of the character pattern and the characters actually input
Storage means for storing a pattern and a master pattern and an input stored in the memory
By sampling the pattern into an n-by-m matrix
The master pattern matrix and the input pattern matrix
The sampling means to be generated, and the master pattern matrix and the input pattern matrix are compared.
And the comparison pattern matrix, which is the pattern matrix of the difference between the two, is
Obtaining comparison means, and comparing the comparison pattern matrix with an upper left diagonal, an upper right diagonal,
Shift down and down diagonally right by a predetermined amount
Shifting means for generating the shifted four shift matrices, and two shift matrices among the four shift matrices.
Each of them is AND-processed with the comparison pattern matrix.
Processing results obtained by ND processing are ORed with each other.
Obtain an intermatrix, and replace the intermediate matrix with the four shift matrices
And the AND operation with the remaining two shift matrices
Then, the processing results obtained by the AND processing are ORed with each other.
Uncertainty from the comparison pattern matrix by processing
Filter means for obtaining a mismatched pattern matrix with elements removed
And count the number of information included in the mismatch pattern matrix
And a counter means for performing the pattern matching.
【請求項2】請求項1に記載のパターンマッチング装置
において、前記フィルタ手段は、前記中間行列を得るた
めに前記比較パターン行列とそれぞれAND処理する前
記2つのシフト行列として、前記シフト手段が左斜め上
方向にシフトさせたシフト行列と、右斜め上方向にシフ
トさせたシフト行列とを用いることを特徴とするパター
ンマッチング装置。
2. A pattern matching apparatus according to claim 1, wherein said filter means obtains said intermediate matrix.
Before AND processing with the comparison pattern matrix
As the two shift matrices, the shift means is an upper left diagonal.
And the shift matrix shifted to the upper right.
A pattern matching device using the shifted shift matrix .
【請求項3】予め登録されている文字の情報であるマス
タパターンと、実際に入力された文字の情報である入力
パターンとを格納するための記憶手段と、 検査対象文字を入力し、前記パターンマッチング装置の
メモリに、前記入力パターンとして格納する入力手段
と、 前記メモリに格納されているマスタパターンおよび入力
パターンをn行m列の行列にサンプリングすることによ
り、前記マスタパターン行列および入力パターン行列を
生成するサンプリング手段と、 前記マスタパターン行列と入力パターン行列とを比較
し、両者の差のパターン行列である比較パターン行列を
得る比較手段と、 前記比較パターン行列を、左斜め上、右斜め上、左斜め
下、右斜め下方向に、予め定めた量だけそれぞれシフト
させた4つのシフト行列を生成するシフト手段と、 前記4つのシフト行列のうちの2つのシフト行列を、そ
れぞれ、前記比較パターン行列とAND処理し、このA
ND処理により得られた処理結果同士をOR処理して中
間行列を得て、当該中間行列を、前記4つのシフト行列
のうちの残りの2つのシフト行列とそれぞれAND処理
し、このAND処理により得られた処理結果同士をOR
処理することにより、前記比較パターン行列から不確定
要素を除去した不一致パターン行列を得るフィルタ手段
と、 前記不一致パターン行列に含まれる情報の数をカウント
するカウンタ手段とを有する ことを特徴とする検査装
置。
3. A cell which is information of a character registered in advance.
Input that is the information of the character pattern and the characters actually input
Storage means for storing a pattern and a character to be inspected,
Input means for storing the input pattern in a memory
And the master pattern and input stored in the memory
By sampling the pattern into an n-by-m matrix
The master pattern matrix and the input pattern matrix
The sampling means to be generated, and the master pattern matrix and the input pattern matrix are compared.
And the comparison pattern matrix, which is the pattern matrix of the difference between the two, is
Obtaining comparison means, and comparing the comparison pattern matrix with an upper left diagonal, an upper right diagonal,
Shift down and down diagonally right by a predetermined amount
Shifting means for generating the shifted four shift matrices, and two shift matrices among the four shift matrices.
Each of them is AND-processed with the comparison pattern matrix.
Processing results obtained by ND processing are ORed with each other.
Obtain an intermatrix, and replace the intermediate matrix with the four shift matrices
And the AND operation with the remaining two shift matrices
Then, the processing results obtained by the AND processing are ORed with each other.
Uncertainty from the comparison pattern matrix by processing
Filter means for obtaining a mismatched pattern matrix with elements removed
And count the number of information included in the mismatch pattern matrix
An inspection apparatus comprising:
【請求項4】実際に入力された文字の情報である入力パ
ターンをn行m列の行列にサンプリングする第1のステ
ップと、 予め登録されているマスタパターン行列と前記入力パタ
ーン行列とを比較し、両者の差のパターン行列である比
較パターン行列を得る第2のステップと、 前記比較パ
ターン行列を、左斜め上、右斜め上、左斜め下、右斜め
下方向に、予め定めた量だけそれぞれシフトさせること
により、4つのシフト行列を生成する第3のステップ
と、 前記4つのシフト行列のうちの2つのシフト行列を、そ
れぞれ、前記比較パターン行列とAND処理し、このA
ND処理により得られた処理結果同士をOR処理して中
間行列を得て、当該中間行列を、前記4つのシフト行列
のうちの残りの 2つのシフト行列とそれぞれAND処理
し、このAND処理により得られた処理結果同士をOR
処理し、不一致パターン行列を得る第4のステップと、 前記不一致パターン行列に含まれる情報の数をカウント
する第5のステップとを有することを特徴とするパター
ンマッチング方法
4. An input pattern which is information of characters actually input.
The first step is to sample the turns into a matrix of n rows and m columns.
And-up, the input pattern registered in advance in which the master pattern matrix
Pattern matrix, and the
A second step of obtaining a comparison pattern matrix;
Turn matrix, diagonally up left, diagonally up right, diagonally down left, diagonally right
To shift downward by a predetermined amount
, A third step of generating four shift matrices
And two shift matrices of the four shift matrices
Each of them is AND-processed with the comparison pattern matrix.
Processing results obtained by ND processing are ORed with each other.
Obtain an intermatrix, and replace the intermediate matrix with the four shift matrices
And the AND operation with the remaining two shift matrices
Then, the processing results obtained by the AND processing are ORed with each other.
A fourth step of processing to obtain a mismatched pattern matrix, and counting the number of information included in the mismatched pattern matrix
And a fifth step of performing
Matching method .
【請求項5】請求項4に記載のパターンマッチング装置
において、前記第3のステップでは、前記中間行列を得
るために前記比較パターン行列とそれぞれAND処理す
る前記2つのシフト行列として、前記第3のステップで
左斜め上方向にシフトさせたシフト行列と、右斜め上方
向にシフトさせたシフト行列とを用いることを特徴とす
るパターンマッチング方法
5. The pattern matching device according to claim 4,
In the third step, the intermediate matrix is obtained.
In order to perform AND processing with the comparison pattern matrix,
In the third step, the two shift matrices
Shift matrix shifted to the upper left and diagonally to the upper right
Characterized by using a shift matrix shifted in
Pattern matching method .
JP3127808A 1991-05-30 1991-05-30 Inspection apparatus using pattern matching and pattern matching method Expired - Lifetime JP2802183B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3127808A JP2802183B2 (en) 1991-05-30 1991-05-30 Inspection apparatus using pattern matching and pattern matching method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3127808A JP2802183B2 (en) 1991-05-30 1991-05-30 Inspection apparatus using pattern matching and pattern matching method

Publications (2)

Publication Number Publication Date
JPH04353990A JPH04353990A (en) 1992-12-08
JP2802183B2 true JP2802183B2 (en) 1998-09-24

Family

ID=14969188

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3127808A Expired - Lifetime JP2802183B2 (en) 1991-05-30 1991-05-30 Inspection apparatus using pattern matching and pattern matching method

Country Status (1)

Country Link
JP (1) JP2802183B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009043184A (en) * 2007-08-10 2009-02-26 Omron Corp Image processing method and image processing apparatus

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4776259B2 (en) * 2005-03-30 2011-09-21 株式会社東芝 Pattern evaluation method, pattern alignment method, and program

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5830645A (en) * 1981-08-17 1983-02-23 Hitachi Ltd Pattern inspecting system
JPS592330A (en) * 1982-06-28 1984-01-07 Fujitsu Ltd Pattern matching method and device therefor
JPS6135303A (en) * 1984-07-27 1986-02-19 Hitachi Ltd Pattern defect inspecting instrument
JPS6165377A (en) * 1984-09-07 1986-04-03 Hitachi Ltd pattern inspection equipment
JPS6175978A (en) * 1984-09-21 1986-04-18 Fujitsu Ltd Recognizer
JPS61147385A (en) * 1984-12-20 1986-07-05 Fujitsu Ltd Recognizing device
JPH07109612B2 (en) * 1985-06-28 1995-11-22 キヤノン株式会社 Image processing method
JPS6460767A (en) * 1987-08-31 1989-03-07 Honda Motor Co Ltd Method for controlling air-fuel ratio of internal combustion engine mounted on vehicle

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009043184A (en) * 2007-08-10 2009-02-26 Omron Corp Image processing method and image processing apparatus

Also Published As

Publication number Publication date
JPH04353990A (en) 1992-12-08

Similar Documents

Publication Publication Date Title
DE69029427T2 (en) Object orientation detection method using a feedforward neural network
DE69421255T2 (en) Document copy defense
KR20060051443A (en) Fault detection device and fault detection method
DE19641414A1 (en) Fault identification and classification method for semiconductor wafer
CN102279191B (en) Detection method and apparatus for defects in periodic texture images
Fu et al. Robust GAN-face detection based on dual-channel CNN network
US6665424B1 (en) Automatic inspection of print quality using an elastic model
US4156231A (en) Automated pattern inspection system
DE3718620A1 (en) METHOD AND DEVICE FOR DETERMINING THE TURNING ANGLE OF AN OBJECT PATTERN
JP2802183B2 (en) Inspection apparatus using pattern matching and pattern matching method
KR970049824A (en) Image processing method
EP0434871B1 (en) Character recognition method
JPH07181143A (en) Print character inspection device
CN116245848A (en) A product defect detection method and related equipment
DE3015637C2 (en) Image processing system
JP4074146B2 (en) Print stain inspection method and apparatus
JPH09147056A (en) Mark appearance inspection method and its equipment
JPH11238135A (en) Image recognition method and image recognition device
Handley Bit vector architecture for computational mathematical morphology
JP3016935B2 (en) Printed material density inspection method and apparatus
DE68928001T2 (en) Character recognition process
JPH0679862A (en) Method for inspecting quality of printing paper surface and apparatus therefor
JPS62140185A (en) Method and apparatus for deciding validity/invalidity of work
JP2748207B2 (en) How to read barcodes on voting tickets
JPS5951029B2 (en) Pattern defect inspection method

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

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

Free format text: PAYMENT UNTIL: 20080710

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20090710

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20090710

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20100710

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20100710

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20110710

Year of fee payment: 13

EXPY Cancellation because of completion of term