JPH0765164A - Method for generating template - Google Patents

Method for generating template

Info

Publication number
JPH0765164A
JPH0765164A JP5210805A JP21080593A JPH0765164A JP H0765164 A JPH0765164 A JP H0765164A JP 5210805 A JP5210805 A JP 5210805A JP 21080593 A JP21080593 A JP 21080593A JP H0765164 A JPH0765164 A JP H0765164A
Authority
JP
Japan
Prior art keywords
value
template
reference value
template data
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5210805A
Other languages
Japanese (ja)
Inventor
Yoshiharu Morinaka
芳治 森中
Kenji Suzuki
健司 鈴木
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.)
JFE Steel Corp
Original Assignee
Kawasaki Steel 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 Kawasaki Steel Corp filed Critical Kawasaki Steel Corp
Priority to JP5210805A priority Critical patent/JPH0765164A/en
Publication of JPH0765164A publication Critical patent/JPH0765164A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To generate the template which can exert larger and larger negative influence on a matching rate as a pixel value is larger and larger by generating values at respective points on the template with specific functions. CONSTITUTION:A mean template generating means 12 calculates the mean value of plural template data to generate mean template data. A histogram generating means 14 generates a density histogram of the mean template data. A function generating means 18 generates a function which gives values corresponding to respective sections. Then a template generating means 20 generates the respective points on the template in a section from the minimum value of the mean template data to a specific reference value by a function which gives negative values for a decrease from the reference value to the maximum value side and in a section from the reference value to the maximum value with a function which gives positive values for an increase from the reference value to the maximum value side.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、テンプレートを用いて
画像中から認識対象パターンに類似したパターンを抽出
するパターンマッチング処理において、処理対象とする
画像と同一条件で入力された画像認識対象に類似した任
意サイズのパターンを、任意の数切り出すことにより、
前記認識対象パターンを抽出することのできるテンプレ
ートの生成方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention, in a pattern matching process for extracting a pattern similar to a recognition target pattern from an image using a template, is similar to an image recognition target input under the same condition as the image to be processed. By cutting out an arbitrary number of patterns of the specified size,
The present invention relates to a template generation method capable of extracting the recognition target pattern.

【0002】[0002]

【従来の技術】従来、例えば、長尾真、「ディジタル画
像処理」、近代科学社、p.306〜312で述べている
正規化相互相関によるマッチングでは、検出すべき画像
パターンを、そのままテンプレートとして用いて、下記
の計算式(1)により、マッチングの度合(マッチング
率)を求めている。
2. Description of the Related Art Conventionally, for example, in the matching by normalized cross-correlation described in Makoto Nagao, "Digital Image Processing", Modern Science, p.306-312, the image pattern to be detected is used as it is as a template. Then, the degree of matching (matching rate) is calculated by the following calculation formula (1).

【0003】[0003]

【数1】 [Equation 1]

【0004】ここで、g はテンプレート、f はマッチン
グ対象画像、(u 、v )はテンプレート上の座標、(i
、j )はマッチング対象画像上の座標、Xt 、Yt は
各々u方向、v 方向のテンプレートのサイズである。
Here, g is a template, f is an image to be matched, (u, v) are coordinates on the template, and (i
, J) are coordinates on the matching target image, and Xt and Yt are template sizes in the u direction and v direction, respectively.

【0005】上記(1)式の分子 f(i +u 、j +v )
g(u 、v )のu 、v に関する和は、画像処理におい
て、エッジ抽出、ノイズ除去等の目的で頻繁に利用され
る重畳演算であり、多大の計算量を要するものの、これ
を高速に実行する装置も、例えば特開平3−13196
5「ニューラルネットワーク用二次元収縮アレイ及びそ
の方法」を始めとして、多数作られている。
The numerator f (i + u, j + v) of the above formula (1)
The sum of g (u, v) with respect to u and v is a convolution operation that is frequently used in image processing for the purpose of edge extraction, noise removal, etc., and requires a large amount of calculation, but it is executed at high speed. For example, Japanese Patent Laid-Open No. 3-13196
A large number of them have been created, including "5. Two-dimensional contraction array for neural network and its method".

【0006】又、特開平4−283881では、画像の
各画素を輝度値によって順位付けを行い、各順位画像毎
にランレングス符号化を行いテンプレートとし、これと
閾値によって区分された画像との相互相関値を求めて、
マッチング度を求めている。
Further, in Japanese Patent Laid-Open No. 4-283881, each pixel of an image is ranked according to a brightness value, run-length coding is performed for each ranked image, and a template is created. Calculate the correlation value,
Seeking a degree of matching.

【0007】[0007]

【発明が解決しようとする課題】しかしながら、上に述
べた「ディジタル画像処理」に示されている上記(1)
式の分母において、後半の g(u 、v )2 のu 、v に関
する和は定数であるが、前半の f(i +u 、j +v )2
のu 、v に関する和は、各(i 、j )において重畳と同
量の計算を要するため、この実行には多大の計算時間、
又は装置を要するという問題があった。
However, the above (1) shown in the above-mentioned "digital image processing" is used.
In the denominator of the equation, the sum of g (u, v) 2 in the latter half with respect to u and v is a constant, but f (i + u, j + v) 2 in the first half
The sum of u and v of requires the same amount of calculation as convolution for each (i, j), so this execution requires a large amount of calculation time,
Or, there is a problem that a device is required.

【0008】又、特開平4−283881では、画像の
各画素を輝度値によって順位付けを行い、各順位画像毎
にランレングス符号化を行いテンプレートとする場合に
は、輝度順位の相違によってテンプレート中の画素値の
大きさに拘らず、テンプレート中の画素値とマッチング
対象画素の画素値の相違が同じような負の影響を与える
ことができ、正しくマッチング率に反映されるが、その
処理は単純な積和演算ではなく複雑な手続きを要すると
いう問題がある。
Further, in Japanese Patent Laid-Open No. 4-283881, when pixels of an image are ranked by luminance value and run length coding is performed for each ranked image to form a template, the template is classified by the difference in luminance rank. However, the difference between the pixel value in the template and the pixel value of the matching target pixel can have the same negative influence regardless of the size of the pixel value of, and it is correctly reflected in the matching rate. There is a problem that a complicated procedure is required instead of a simple multiply-add operation.

【0009】本発明は、前記従来の問題点を解決するべ
くなされたもので、認識対象パターンにおいて、小さな
画素値をとるべき位置に大きな画素値があった場合に
は、画素値が大きい程マッチング率に大きな負の影響を
及ぼすことのできるテンプレートを生成することができ
る、テンプレートの生成方法を提供することを目的とす
る。
The present invention has been made to solve the above-mentioned conventional problems. In the recognition target pattern, when there is a large pixel value at a position where a small pixel value should be taken, matching is performed as the pixel value becomes larger. An object of the present invention is to provide a template generation method capable of generating a template that can have a large negative influence on the rate.

【0010】[0010]

【課題を解決するための手段】本発明は、入力画像から
目的とする認識対象パターンと類似したパターンを抽出
するパターンマッチングにおけるテンプレートの生成方
法において、入力画像中に含まれるいくつかの認識対象
パターンの各々に対し、これを一つだけ含む任意のサイ
ズのある複数個のマスクを、該マスクに対する認識対象
パターンの位置が該複数個のマスクの各々において全て
同じとなるように設定し、前記画像中の各々のマスクに
より囲まれる部分をテンプレートデータとして該複数個
切り出し、各テンプレートデータ各々において同様に定
義した各座標における値の相加平均又は相乗平均を算出
し、それを各座標における値とする平均テンプレートデ
ータを生成し、前記平均テンプレートデータ中の全画素
の濃度値のヒストグラムを生成し、前記ヒストグラムよ
り最大値及び最小値を算出し、前記平均テンプレートデ
ータあるいは前記画像全面を2値化する際に抽出すべき
パターンと背景を明確に分離する適切な閾値、あるいは
前記平均テンプレートデータ又は前記画像全面の相加平
均あるいは相乗平均を算出し、これを基準値とし、前記
平均テンプレートデータの各々の座標上の値が、前記最
小値から前記基準値までの区間については、前記基準値
から前記最小値側に行くに従いより小さくなるように負
の値を与え、又、前記基準値と等しい場合には0に、更
に、前記基準値から前記最大値までの区間については、
前記基準値から前記最大値側に行くに従いより大きくな
るように正の値を与える関数により、テンプレート上の
各点の値を生成することにより前記目的を達成したもの
である。
SUMMARY OF THE INVENTION The present invention relates to a template generation method in pattern matching for extracting a pattern similar to a target recognition target pattern from an input image, and a plurality of recognition target patterns included in the input image. A plurality of masks having an arbitrary size including only one of them are set so that the positions of the recognition target patterns with respect to the masks are all the same in each of the plurality of masks. The plurality of parts enclosed by each mask in the inside are cut out as template data, and the arithmetic mean or geometric mean of the values at each coordinate similarly defined in each template data is calculated, and is taken as the value at each coordinate. Average template data is generated, and a histogram of the density values of all pixels in the average template data is generated. A suitable threshold value that clearly separates the average template data or the pattern to be extracted when binarizing the entire surface of the image or the background by calculating the maximum value and the minimum value from the histogram, or the average value. The arithmetic mean or geometric mean of the template data or the entire surface of the image is calculated, and this is used as a reference value, and the value on each coordinate of the average template data is as described above for the section from the minimum value to the reference value. A negative value is given so that it becomes smaller as it goes from the reference value to the minimum value side, and when it is equal to the reference value, it is 0, and further, for the section from the reference value to the maximum value,
The object is achieved by generating the value of each point on the template by a function that gives a positive value so that the value becomes larger from the reference value toward the maximum value side.

【0011】本発明は又、前記区間を、それぞれ0以上
100以下の任意の数v 、w を設定し、前記ヒストグラ
ムの高濃度値側をv %、低濃度値側をw %それぞれ除去
した後の濃度値の最大値を上限値、最小値を下限値と
し、前記下限値から前記基準値までの区間と、前記基準
値から前記上限値までの区間とすることにより、同様に
前記目的を達成したものである。
According to the present invention, after the sections are set to arbitrary numbers v and w of 0 or more and 100 or less respectively, the high density side and the low density side of the histogram are removed by v% and w%, respectively. The maximum value of the concentration value of the upper limit value, the minimum value as the lower limit value, the interval from the lower limit value to the reference value, and the interval from the reference value to the upper limit value, to achieve the same object It was done.

【0012】[0012]

【作用】前記従来例は、前記「ディジタル画像処理」p.
306〜312に示されているように、マッチング率の
数値がテンプレートとマッチング対象画像の間の幾何学
的な距離を正しく反映するという性質を持つ。これは、
重畳だけではテンプレート中の各画素の値が異なるため
に、マッチング対象画像中の対象画素の値がテンプレー
トと異なっていた時に、マッチング率に及ぼす影響がま
ちまちになるのを、分母の項が補正する効果を持ってい
るためである。
The above-mentioned conventional example is described in "Digital Image Processing" p.
As indicated by 306 to 312, the numerical value of the matching rate has the property of correctly reflecting the geometric distance between the template and the matching target image. this is,
Since the value of each pixel in the template is different only by superimposing, when the value of the target pixel in the matching target image is different from the template, the effect on the matching rate will be mixed, and the term of the denominator corrects it. This is because it has an effect.

【0013】この補正項が無い重畳だけでは、テンプレ
ートとマッチング対象画像の類似度を反映した値が得ら
れないのは次のような事情による。つまり、テンプレー
ト中、値の大きな画素については、マッチング対象画像
における対応画素の値が大きい時、即ち類似している
時、マッチング率が大きくなり、対応画素の値が小さい
時、即ち類似していない時、マッチング率は小さくな
る。これに対し、テンプレート中、値の小さな画素につ
いては、マッチング画像中の対応画素の値が小さいこと
が類似であるにも拘らず、これと逆の影響をマッチング
率に対して及ぼすためである。
The reason why the value reflecting the similarity between the template and the matching target image cannot be obtained only by superimposing without the correction term is as follows. That is, for a pixel having a large value in the template, when the value of the corresponding pixel in the matching target image is large, that is, similar, the matching rate is large, and when the value of the corresponding pixel is small, that is, not similar. Sometimes the matching rate becomes smaller. On the other hand, with respect to the pixel having a small value in the template, it is similar to the fact that the value of the corresponding pixel in the matching image is small, but this has an adverse effect on the matching rate.

【0014】又、絶対値が小さいために、影響の度合も
小さく、テンブレート中の各画素において、マッチング
率に及ぼす影響の度合がまちまちとなる。
Further, since the absolute value is small, the degree of influence is small, and the degree of influence on the matching rate varies for each pixel in the template.

【0015】そこで、本発明は、テンプレートにおい
て、検出すべき画像パターンをそのまま使うのではな
く、これと対応をとりながら、ある一定値、例えば、平
均値より小さい画素に対しては、テンプレートにおいて
負の値を与えることにより、検出すべき画像パターンに
おいて小さな値をとるべき画素において、マッチング対
象画像が大きな値をとる時には、マッチング率が小さく
なるようにした。
Therefore, according to the present invention, the image pattern to be detected is not used as it is in the template, but in correspondence with this, for a pixel having a certain fixed value, for example, an average value, a negative value is obtained in the template. By giving the value of, the matching rate becomes small when the matching target image has a large value in the pixel which should have a small value in the image pattern to be detected.

【0016】又、テンプレート中の画素の絶対値と、検
出すべき画像パターン中の各画素と、上記一定値の差の
絶対値の間に単調増加の関係を持たせて、マッチング率
への影響の度合を調整することとした。
In addition, the absolute value of the pixel in the template, each pixel in the image pattern to be detected, and the absolute value of the difference between the constant values are given a monotonically increasing relationship to affect the matching rate. It was decided to adjust the degree of.

【0017】更に、この調整において、検出すべき画像
パターン中の全ての濃度を対象とするのではなく、上限
値、下限値を設けることにより、明るさ、あるいは暗さ
が飽和して、誤差によるばらつきしか現れていない濃度
範囲については、このばらつきを排除できるようにし
た。これによって、重畳によって正規化相互相関と同様
に、検出対象パターンとマッチング対象画像の類似度を
反映するマッチング率を得ることを可能にした。
Further, in this adjustment, not all the densities in the image pattern to be detected are set, but the upper limit value and the lower limit value are set, so that the brightness or the darkness is saturated and an error occurs. This variation can be eliminated in the concentration range where only variation appears. This makes it possible to obtain a matching rate that reflects the degree of similarity between the detection target pattern and the matching target image, as in the case of normalized cross-correlation.

【0018】本発明によれば、画像中から検出パターン
に類似したパターンをテンプレートデータとして任意の
数切り出し、各テンプレートデータの同一座標上の画素
値の平均を算出した平均テンプレートデータを求める。
According to the present invention, any number of patterns similar to the detected pattern are cut out from the image as template data, and the average of the pixel values on the same coordinates of each template data is calculated to obtain the average template data.

【0019】ここで、平均テンプレートデータあるいは
画像全面を2値化する際に検出パターンと背景を明確に
分離する適切な閾値、あるいは平均テンプレートデータ
又は画像全面の平均値を算出した値を基準値として求め
る。
Here, an appropriate threshold value that clearly separates the detection pattern and the background when binarizing the average template data or the entire image, or a value obtained by calculating the average value of the average template data or the entire image is used as a reference value. Ask.

【0020】この基準値と平均テンプレートデータか
ら、平均テンプレートデータの各々の座標上の値が、平
均テンプレートデータの最小値から基準値の区間につい
ては、基準値から最小値側に行くに従いより小さくなる
ように負の値を与える関数により、そして基準値と等し
い場合には0に、更に基準値から平均テンプレートデー
タの最大値の区間については、基準値から最大値側に行
くに従いより大きくなるように正の値を与える関数によ
り、テンプレート上の各点の値を生成することにより、
認識対象パターンにおいて小さな画素値をとるべき位置
に大きな画素値があった場合には、画素値が大きい程マ
ッチング率に大きな負の影響を及ぼすことのできるテン
プレートの生成を行うことができる。
From the reference value and the average template data, the value on each coordinate of the average template data becomes smaller in the section from the minimum value of the average template data to the reference value as going from the reference value to the minimum value side. As described above, depending on the function that gives a negative value, and when it is equal to the reference value, it is set to 0, and for the section of the maximum value of the average template data from the reference value, it becomes larger as going from the reference value to the maximum value side. By generating the value of each point on the template by the function that gives a positive value,
When there is a large pixel value at a position where a small pixel value should be taken in the recognition target pattern, it is possible to generate a template that can have a large negative influence on the matching rate as the pixel value increases.

【0021】[0021]

【実施例】以下図面を参照して、本発明の実施例を詳細
に説明する。
Embodiments of the present invention will now be described in detail with reference to the drawings.

【0022】図1は、本発明における、テンプレートの
重みの自動生成方法の基本処理の流れを示すブロック線
図である。
FIG. 1 is a block diagram showing the flow of the basic processing of the automatic template weight generation method according to the present invention.

【0023】図1において、10はマスクによるテンプ
レートデータ切出手段、12は平均テンプレートデータ
生成手段、14は平均テンプレートデータのヒストグラ
ム生成手段、16は基準値設定手段、18は関数生成手
段、20はテンプレート生成手段である。
In FIG. 1, 10 is a template data cutting means by a mask, 12 is an average template data generating means, 14 is an average template data histogram generating means, 16 is a reference value setting means, 18 is a function generating means, and 20 is a function. It is a template generation means.

【0024】マスクによるテンプレートデータ切り出し
手段(10)において、図2に示すように、目的とする
パターン部分を囲む任意の大きさのマスクとしてn ×p
(n、p は任意の正の整数)を設定し、次に画像中から
前記目的パターンを前記サイズのマスクにより切り出
し、テンプレートデータとする。ここでは前記サイズと
してn ×n で行っている。ここでは、前記テンプレート
データとしてm 個切り出せたものとする。又、図2に示
すように、各テンプレートデータの左上を(1,1)、
右下を(n ,n )となるような座標を設定する。
In the template data cutting means (10) using a mask, as shown in FIG. 2, n × p is used as a mask of an arbitrary size surrounding a target pattern portion.
(N and p are arbitrary positive integers) are set, and then the target pattern is cut out from the image with a mask having the size described above to obtain template data. Here, the size is n × n. Here, it is assumed that m pieces of the template data can be cut out. In addition, as shown in FIG. 2, the upper left of each template data is (1, 1),
Set coordinates such that the lower right corner is (n, n).

【0025】平均テンプレートデータ生成手段(12)
においては、前記m 個のテンプレートデータから同一座
標上の各値から図3に示すように、次の(2)式から相
加平均を、あるいは図4に示すように、次の(3)式か
ら相乗平均、等の平均値を算出し、平均テンプレートデ
ータを生成する。
Average template data generating means (12)
In the above, from the m template data, as shown in FIG. 3, from each value on the same coordinate, the arithmetic mean is obtained from the following equation (2), or as shown in FIG. Then, an average value such as a geometric mean is calculated to generate average template data.

【0026】[0026]

【数2】 [Equation 2]

【0027】 √(N1jk・N2jk・・・・Nnjk) …(3)[0027] m √ (N1 jk · N2 jk ···· Nn jk) ... (3)

【0028】次に平均テンプレートデータのヒストグラ
ム生成手段(14)においては、図5に示すように、前
記平均テンプレートデータの濃度値ヒストグラムを生成
する。
Next, the average template data histogram generating means (14) generates a density value histogram of the average template data as shown in FIG.

【0029】又、基準値設定手段(16)においては、
基準値を設定する。前記基準値としては、例えば、前記
平均テンプレートデータあるいは前記画像全面を2値化
する際に判別分析法、p −タイル法、モード法により求
めた閾値、あるいは前記平均テンプレートデータ又は前
記画像全面の相加、相乗平均値を用いる。又、オプショ
ンとして、前記濃度値ヒストグラムから高濃度値側及び
低濃度値側をそれぞれv 、w %(v 、w ≧0)を設定
し、各々除去する。前記ヒストグラムの高濃度値側v
%、低濃度値側をw %除去した後の濃度値の最大値を上
限値、最小値を下限値とする。
In the reference value setting means (16),
Set the reference value. The reference value is, for example, a threshold value obtained by a discriminant analysis method, a p-tile method, a mode method when binarizing the average template data or the entire surface of the image, or the average template data or the phase of the entire surface of the image. In addition, the geometric mean value is used. As an option, v and w% (v, w ≧ 0) are set on the high density value side and the low density value side, respectively, from the density value histogram, and they are removed. High density side v of the histogram
%, The maximum density value after removing w% on the low density value side is the upper limit value, and the minimum value is the lower limit value.

【0030】これより、例えば前記下限値(Vd )と前
記基準値(Vs )の区間及び、前記基準値と前記上限値
(Vu )の区間を以下のようにp 分割(図5においては
6分割)し、関数生成手段(18)において、それぞれ
の区間に対応した値を与える関数を考える。
From this, for example, the interval between the lower limit value (V d ) and the reference value (V s ) and the interval between the reference value and the upper limit value (V u ) are divided into p sections (in FIG. 5). Is divided into 6), and the function generating means (18) considers a function that gives a value corresponding to each section.

【0031】前記基準値よりも低濃度値側の幅をHd
高濃度値側の幅をHu とすると、 Hd =(Vs −Vd )/p …(4) Hu =(Vu −Vs )/p …(5) となり、前記平均テンプレートデータの値をVj とする
とテンプレートの値Wjは i )Vj <Vd の時、 Wj =−120 …(6) ii)Vd ≦Vj <Vs の時、Pi を Pi =Vd +Hd ×i …(7) (但し、i =0,1,・・・,p )とした時に、Pi <Vj <Pi+1 で あれば、 Wj −120+i ×20 …(8) iii)Vj =Vs の時、 Wj =0 …(9) iv)Vs <Vj ≦Vu の時、Qj を Qj =Vs +Hu ×i …(10) (但し、i =0,1,・・・,p )とした時に、Qj <Vj ≦Qj+1 で あれば、 Wj =i ×20 …(11) v )Vj >Vu の時、 Wj =120 …(12) となり、テンプレートが生成できる。
The width on the low density side of the reference value is H d ,
If the width on the high density side is H u , then H d = (V s −V d ) / p (4) Hu = (V u −V s ) / p (5), and the average template data If the value of V j is V j , the template value W j is i) when V j <V d , Wj = −120 (6) ii) when V d ≦ V j <V s , P i is P i = V d + H d × i (7) (where i = 0, 1, ..., P), if P i <V j <P i + 1 , then W j −120 + i × 20. (8) iii) When V j = V s , W j = 0 (9) iv) When V s <V j ≤V u , Q j is Q j = V s + H u × i (10) (However, i = 0,1, ···, p ) when the <if Vj ≦ Qj + 1, W j = i × 20 ... (11) v) V j> Qj time of V u, W j = 120 (12) and the template can be generated.

【0032】以上のようなテンプレートの生成は、テン
プレート生成手段(20)において行われ、図6に示す
ようなテンプレートが生成される。
The template generation as described above is performed by the template generation means (20), and the template as shown in FIG. 6 is generated.

【0033】[0033]

【発明の効果】以上説明した通り、本発明によれば、認
識対象パターンにおいて小さな画素値をとるべき位置に
大きな画素値があった場合には、画素値が大きい程マッ
チング率に大きな負の影響を及ぼすことのできるテンプ
レートの生成が行えるという効果を有する。
As described above, according to the present invention, when there is a large pixel value at a position where a small pixel value should be taken in the pattern to be recognized, the larger the pixel value, the greater the negative influence on the matching rate. This has the effect of generating a template that can be used.

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

【図1】本実施例におけるテンプレートの生成手順を示
すブロック線図
FIG. 1 is a block diagram showing a template generation procedure in the present embodiment.

【図2】本実施例におけるテンプレートデータの切り出
しを示す説明図
FIG. 2 is an explanatory diagram showing cutout of template data according to the present embodiment.

【図3】本実施例における相加平均による平均テンプレ
ートデータの生成を示す説明図
FIG. 3 is an explanatory diagram showing generation of average template data by arithmetic averaging in the present embodiment.

【図4】本実施例における相乗平均による平均テンプレ
ートデータの生成を示す説明図
FIG. 4 is an explanatory diagram showing generation of average template data by geometric mean in the present embodiment.

【図5】本実施例における平均テンプレートデータの濃
度値ヒストグラムを示す線図
FIG. 5 is a diagram showing a density value histogram of average template data in the present embodiment.

【図6】本実施例におけるテンプレートの生成例を示す
線図
FIG. 6 is a diagram showing an example of template generation in this embodiment.

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

10…マスクによるテンプレートデータ切出手段 12…平均テンプレートデータ生成手段 14…平均テンプレートデータのヒストグラム生成手段 16…基準値設定手段 18…関数生成手段 20…テンプレート生成手段 10 ... Template data cutting means by mask 12 ... Average template data generating means 14 ... Average template data histogram generating means 16 ... Reference value setting means 18 ... Function generating means 20 ... Template generating means

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】入力画像から目的とする認識対象パターン
と類似したパターンを抽出するパターンマッチングにお
けるテンプレートの生成方法において、 入力画像中に含まれるいくつかの認識対象パターンの各
々に対し、これを一つだけ含む任意のサイズのある複数
個のマスクを、該マスクに対する認識対象パターンの位
置が該複数個のマスクの各々において全て同じとなるよ
うに設定し、前記画像中の各々のマスクにより囲まれる
部分をテンプレートデータとして該複数個切り出し、 各テンプレートデータ各々において同様に定義した各座
標における値の相加平均又は相乗平均を算出し、それを
各座標における値とする平均テンプレートデータを生成
し、 前記平均テンプレートデータ中の全画素の濃度値のヒス
トグラムを生成し、 前記ヒストグラムより最大値及び最小値を算出し、 前記平均テンプレートデータあるいは前記画像全面を2
値化する際に、抽出すべきパターンと背景を明確に分離
する適切な閾値、あるいは前記平均テンプレートデータ
又は前記画像全面の相加平均あるいは相乗平均を算出
し、これを基準値とし、 前記平均テンプレートデータの各々の座標上の値が、前
記最小値から前記基準値までの区間については、前記基
準値から前記最小値側に行くに従いより小さくなるよう
に負の値を与え、 又、前記基準値と等しい場合には0に、 更に、前記基準値から前記最大値までの区間について
は、前記基準値から前記最大値側に行くに従いより大き
くなるように正の値を与える関数により、テンプレート
上の各点の値を生成することを特徴とするテンプレート
の生成方法。
1. A method for generating a template in pattern matching for extracting a pattern similar to a target recognition target pattern from an input image, wherein the template is generated for each of several recognition target patterns included in the input image. A plurality of masks having an arbitrary size including only one are set so that the positions of the recognition target pattern with respect to the masks are all the same in each of the plurality of masks, and the masks are surrounded by each mask in the image. Cut out a plurality of parts as template data, calculate the arithmetic mean or geometric mean of the values at each coordinate defined similarly in each template data, and generate the average template data having the value at each coordinate, Generate a histogram of the density values of all pixels in the average template data, The maximum and minimum values are calculated from the program, and the average template data or the entire surface of the image is calculated as 2
When binarizing, an appropriate threshold value that clearly separates the pattern to be extracted from the background, or the average template data or the arithmetic mean or geometric mean of the entire surface of the image is calculated, and this is used as a reference value, and the average template Regarding the section from the minimum value to the reference value, the value on each coordinate of the data is given a negative value so as to become smaller as going from the reference value to the minimum value side, and the reference value Is equal to 0, and for the section from the reference value to the maximum value, a function that gives a positive value that becomes larger as going from the reference value to the maximum value side A method of generating a template, which is characterized by generating a value at each point.
【請求項2】請求項1において、前記区間を、それぞれ
0以上100以下の任意の数v 、wを設定し、前記ヒス
トグラムの高濃度値側をv %、低濃度値側をw %それぞ
れ除去した後の濃度値の最大値を上限値、最小値を下限
値とし、前記下限値から前記基準値までの区間と、前記
基準値から前記上限値までの区間とすることを特徴とす
るテンプレートの生成方法。
2. The method according to claim 1, wherein an arbitrary number v, w of 0 or more and 100 or less is set for each of the sections, and v% is removed on the high density side and w% is removed on the low density side of the histogram. The maximum value of the density value after the upper limit value, the minimum value as the lower limit value, the section from the lower limit value to the reference value, and the section from the reference value to the upper limit value of the template characterized by Generation method.
JP5210805A 1993-08-26 1993-08-26 Method for generating template Pending JPH0765164A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5210805A JPH0765164A (en) 1993-08-26 1993-08-26 Method for generating template

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5210805A JPH0765164A (en) 1993-08-26 1993-08-26 Method for generating template

Publications (1)

Publication Number Publication Date
JPH0765164A true JPH0765164A (en) 1995-03-10

Family

ID=16595431

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5210805A Pending JPH0765164A (en) 1993-08-26 1993-08-26 Method for generating template

Country Status (1)

Country Link
JP (1) JPH0765164A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019514123A (en) * 2016-04-08 2019-05-30 オービタル インサイト インコーポレイテッド Remote determination of the quantity stored in containers in geographical areas
CN112966746A (en) * 2020-11-20 2021-06-15 扬州大学 Stable variable gray template generation method suitable for tire defect detection
CN113160145A (en) * 2021-03-29 2021-07-23 深圳中科飞测科技股份有限公司 Detection method, detection device, detection equipment and computer readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019514123A (en) * 2016-04-08 2019-05-30 オービタル インサイト インコーポレイテッド Remote determination of the quantity stored in containers in geographical areas
CN112966746A (en) * 2020-11-20 2021-06-15 扬州大学 Stable variable gray template generation method suitable for tire defect detection
CN113160145A (en) * 2021-03-29 2021-07-23 深圳中科飞测科技股份有限公司 Detection method, detection device, detection equipment and computer readable storage medium
CN113160145B (en) * 2021-03-29 2024-04-02 深圳中科飞测科技股份有限公司 Detection method, detection device, detection apparatus, and computer-readable storage medium

Similar Documents

Publication Publication Date Title
CN100435165C (en) Image processing apparatus and method
JP6000455B2 (en) Form recognition method and form recognition apparatus
US7860280B2 (en) Facial feature detection method and device
US9947077B2 (en) Video object tracking in traffic monitoring
US5717785A (en) Method and apparatus for locating patterns in an optical image
JPH0877362A (en) Image processor
US6067379A (en) Method and apparatus for locating patterns in an optical image
JPH0552987B2 (en)
CN112991159B (en) Face illumination quality evaluation method, system, server and computer readable medium
CN111160372B (en) Large target identification method based on high-speed convolutional neural network
JP2003162718A (en) Image processing method and its program
JPH05282456A (en) Pattern recognition device
JPH0765164A (en) Method for generating template
Lefevre et al. A local approach for fast line detection
JPH11339017A (en) License plate recognizing device
CN113554695A (en) Intelligent part hole site identification and positioning method
JPH05342412A (en) Extracting system for gradient vector and feature extracting system for character recognition
JP3462960B2 (en) Image processing method
Zamperoni Some adaptive rank order filters for image enhancement
JP3447751B2 (en) Pattern recognition method
JPS62138986A (en) Character recognizing device
JP3449836B2 (en) Image clipping method and apparatus
JP2007328652A (en) Image processing device and image processing program
JP2671556B2 (en) Cleft line detection method and device
JPH05165964A (en) Image processor and image processing method