JPH0954828A - Similarity calculation device and method, and position detection device using the same - Google Patents

Similarity calculation device and method, and position detection device using the same

Info

Publication number
JPH0954828A
JPH0954828A JP8120278A JP12027896A JPH0954828A JP H0954828 A JPH0954828 A JP H0954828A JP 8120278 A JP8120278 A JP 8120278A JP 12027896 A JP12027896 A JP 12027896A JP H0954828 A JPH0954828 A JP H0954828A
Authority
JP
Japan
Prior art keywords
density gradient
gradient direction
representative
similarity
model
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.)
Granted
Application number
JP8120278A
Other languages
Japanese (ja)
Other versions
JP3598651B2 (en
Inventor
Naomichi Mine
直道 嶺
Yoshihiko Hisamori
芳彦 久森
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
Omron Tateisi Electronics Co
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, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP12027896A priority Critical patent/JP3598651B2/en
Publication of JPH0954828A publication Critical patent/JPH0954828A/en
Priority to US08/856,598 priority patent/US6154566A/en
Application granted granted Critical
Publication of JP3598651B2 publication Critical patent/JP3598651B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Character Discrimination (AREA)
  • Image Analysis (AREA)

Abstract

(57)【要約】 【課題】 モデル画像と背景の一部分が変化した入力画
像の類似度算出でも、精度よく、結果を出し得る類似度
算出装置を提供する。 【解決手段】 画像メモリ3に記憶の入力画像の各画素
の濃度勾配方向と、予めメモリ9に記憶のモデルの対応
する各画素の濃度勾配方向の差を減算部20で求め、方
向差評価部21で評価し、モデルより得られる重みで評
価値を重み付けて、積和演算部22で加算し、除算部2
3で加算値を重み和算出部19で算出された重み和で、
除算して類似度Rを算出する。
(57) Abstract: Provided is a similarity calculation device capable of accurately producing a result even when calculating a similarity between a model image and an input image in which a part of the background has changed. A difference between a density gradient direction of each pixel of an input image stored in an image memory 3 and a density gradient direction of each corresponding pixel of a model previously stored in a memory 9 is obtained by a subtraction unit 20, and a direction difference evaluation unit is obtained. 21. The evaluation value is weighted by the weight obtained from the model, the product-sum calculation unit 22 adds the weighted values, and the division unit 2
In 3 the added value is the weighted sum calculated by the weighted sum calculation unit 19,
The division is performed to calculate the similarity R.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、入力画像とモデルと
類似度を算出する類似度算出装置及び方法並びにそれを
用いた位置検出装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a similarity calculating apparatus and method for calculating the similarity between an input image and a model, and a position detecting apparatus using the same.

【0002】[0002]

【従来の技術】従来、照明変動に対して影響の少ない濃
淡画像同士の類似度を算出する方法として、正規化相互
相関が知られている(画像解析ハンドブック、高木幹雄
・下田陽久監修、東京大学出版会)。この正規化相互相
関を用いた従来の画像処理装置の構成を図23に示す。
この画像処理装置は、目的物を撮像するカメラ1と、撮
影した画像をデジタル信号に変換するA/Dコンバータ
2と、デジタル化された画像を記憶する画像メモリ3
と、表示のためデジタル画像をアナログ信号に変換する
D/Aコンバータ4と、CRTディスプレイ5と、アド
レス/データバス6と、タイミング制御部7と、入力画
像の取込み、表示、類似度算出等の種々の処理、制御を
実行するCPU8と、類似度算出のための画像データを
記憶するメモリ9と、類似度算出部10と、しきい値判
定部11とを備えている。
2. Description of the Related Art Conventionally, a normalized cross-correlation has been known as a method for calculating the similarity between grayscale images that have little effect on illumination variations (Image Analysis Handbook, supervised by Mikio Takagi and Yohisa Shimoda, University of Tokyo. Publishing Association). FIG. 23 shows the configuration of a conventional image processing apparatus using this normalized cross correlation.
This image processing apparatus includes a camera 1 for capturing an object, an A / D converter 2 for converting a captured image into a digital signal, and an image memory 3 for storing a digitized image.
A D / A converter 4 for converting a digital image into an analog signal for display, a CRT display 5, an address / data bus 6, a timing controller 7, an input image capture, display, similarity calculation, etc. A CPU 8 that executes various processes and controls, a memory 9 that stores image data for similarity calculation, a similarity calculation unit 10, and a threshold determination unit 11 are provided.

【0003】上記の類似度算出部10は、図24に示す
ように、共分散算出部12と、標準偏差算出部13と、
積算部14と、除算部15とを備えている。この画像処
理装置において、カメラ1から出力されたアナログ映像
信号はA/Dコンバータ2で、タイミング制御部7から
のタイミング信号に同期して、A/D変換された後、濃
淡画像として画像メモリ3に記憶される。画像メモリ3
に記憶された入力画像は、D/Aコンバータ4を通じて
アナログ信号に変換された後、CRTディスプレイ5に
表示される。一方、類似度算出部10において、画像メ
モリ3に記憶された入力画像と、予めメモリ9に記憶さ
れているモデル画像との類似度が算出され、メモリ9に
記憶される。メモリ9に記憶された類似度と予め設定さ
れているしきい値との比較がしきい値判定部11で行わ
れ、OK/NGの判定がされる。その結果は、メモリ9
に記憶される。各モジュール間のデータの受け渡しは、
アドレス/データバス6を通じて行われる。また、各モ
ジュールの起動コマンド発行は、CPU8により行われ
る。
As shown in FIG. 24, the similarity calculating section 10 includes a covariance calculating section 12, a standard deviation calculating section 13, and
The integrating unit 14 and the dividing unit 15 are provided. In this image processing apparatus, the analog video signal output from the camera 1 is A / D converted by the A / D converter 2 in synchronization with the timing signal from the timing control unit 7, and then the image memory 3 as a grayscale image. Memorized in. Image memory 3
The input image stored in is converted into an analog signal through the D / A converter 4, and then displayed on the CRT display 5. On the other hand, the similarity calculation unit 10 calculates the similarity between the input image stored in the image memory 3 and the model image stored in the memory 9 in advance, and stores it in the memory 9. The threshold determination unit 11 compares the similarity stored in the memory 9 with a preset threshold value, and determines OK / NG. The result is memory 9
Is stored. Passing data between modules is
This is done through the address / data bus 6. Further, the CPU 8 issues a start command for each module.

【0004】類似度算出部10では、モデル画像および
入力画像の大きさを(mx、my)とし、入力画像の濃
度値をI(x、y)、モデル画像の濃度をM(x、y)
とすると、類似度(CC)は、以下の式により算出され
る。
In the similarity calculator 10, the sizes of the model image and the input image are set to (mx, my), the density value of the input image is I (x, y), and the density of the model image is M (x, y).
Then, the similarity (CC) is calculated by the following formula.

【0005】[0005]

【数1】 [Equation 1]

【0006】画像メモリ3に記憶されている入力画像の
濃度値I(x、y)およびメモリ9に記憶されているモ
デル画像の濃度値M(x、y)が、アドレス/データバ
ス6を通じて類似度算出部10に取り込まれる。共分散
算出部12において、I(x、y)とM(x、y)の共
分散
The density value I (x, y) of the input image stored in the image memory 3 and the density value M (x, y) of the model image stored in the memory 9 are similar through the address / data bus 6. It is taken into the degree calculation unit 10. In the covariance calculation unit 12, the covariance of I (x, y) and M (x, y)

【0007】[0007]

【数2】 [Equation 2]

【0008】が算出される。また、標準偏差算出部13
において、I(x、y)の標準偏差
Is calculated. Also, the standard deviation calculating unit 13
At, the standard deviation of I (x, y)

【0009】[0009]

【数3】 (Equation 3)

【0010】が算出される。積算部14において、I
(x、y)の標準偏差とM(x、y)の標準偏差の積
Is calculated. In the integration unit 14, I
Product of standard deviation of (x, y) and standard deviation of M (x, y)

【0011】[0011]

【数4】 (Equation 4)

【0012】が算出される。除算部15において、正規
化相互相関値(CC)が算出され、モデル画像と入力画
像の類似度としてメモリ9に記憶される。
Is calculated. The division unit 15 calculates the normalized cross-correlation value (CC) and stores it in the memory 9 as the similarity between the model image and the input image.

【0013】[0013]

【発明が解決しようとする課題】上記した従来の正規化
相互相関を求める手法は、濃度諧調の移動や伸縮の下で
不変なマッチング方法である。しかし、シェーディング
や背景変化等、モデル画像と入力画像との間に、線形変
換関係が成り立たない場合においては、モデル画像と入
力画像の共分散に対する各標準偏差の積の比が大きくな
ることにより、類似度が小さくなり、安定したパターン
認識ができないといった問題点がある。例えば、図25
のように、モデル画像の背景の一部分が変化したような
入力画像とモデル画像の類似度の計算を行うと、類似度
は約0.61となり、モデル画像同士の相関値1.0と
比べた場合、かなり低下し、安定した認識が行えない。
The above-mentioned conventional method for obtaining the normalized cross-correlation is a matching method that is invariable under the movement or expansion / contraction of the density gradation. However, when a linear conversion relationship does not hold between the model image and the input image such as shading or background change, the ratio of the product of each standard deviation to the covariance of the model image and the input image becomes large, There is a problem that the degree of similarity becomes small and stable pattern recognition cannot be performed. For example, in FIG.
As described above, when the similarity between the input image and the model image in which a part of the background of the model image is changed is calculated, the similarity becomes about 0.61, which is compared with the correlation value of 1.0 between the model images. In that case, it is considerably lowered and stable recognition cannot be performed.

【0014】この発明は上記問題点に着目してなされた
ものであって、モデル画像の背景の一部分が変化したよ
うな入力画像とモデル画像の類似度算出でも、精度良く
結果を出し得る装置および方法を提供することを目的と
している。
The present invention has been made in view of the above-mentioned problems, and an apparatus and a device capable of accurately producing a result even when the similarity between an input image and a model image in which a part of the background of the model image is changed is calculated. It is intended to provide a way.

【0015】[0015]

【課題を解決するための手段及び作用】この出願の特許
請求範囲の請求項1に係る類似度算出装置は、入力画像
の各画素における濃度勾配方向Iθ(x、y)を求める
濃度勾配方向算出手段と、この入力画像の濃度勾配方向
Iθ(x、y)と、所定のモデルの対応する画素の濃度
勾配方向Mθ(x、y)との間で、濃度勾配方向の差を
評価する値f{Iθ(x、y)−Mθ(x、y)}を求
める濃度勾配方向評価値算出手段と、この評価値に、前
記所定のモデルより得られる重みMW (x、y)で重み
付けする重み付け手段と、重み付けした評価値を加算す
ることよって類似度
A similarity calculation device according to claim 1 of the present application obtains a density gradient direction Iθ (x, y) in each pixel of an input image. A value f for evaluating the difference in the density gradient direction between the means and the density gradient direction Iθ (x, y) of the input image and the density gradient direction Mθ (x, y) of the corresponding pixel of the predetermined model. Concentration gradient direction evaluation value calculating means for obtaining {Iθ (x, y) -Mθ (x, y)}, and weighting for weighting the evaluation value with a weight M W (x, y) obtained from the predetermined model. Method and weighted evaluation value

【0016】[0016]

【数5】 (Equation 5)

【0017】を算出する手段とを備えている。また、請
求項2に係る類似度算出装置は、入力画像の各画素にお
ける濃度勾配方向Iθ(x、y)を求める濃度勾配方向
算出手段と、この入力画像の濃度勾配方向Iθ(x、
y)と、所定のモデルの対応する画素の濃度勾配方向M
θ(x、y)との間で、濃度勾配方向の差を評価する値
f{Iθ(x、y)−Mθ(x、y)}を求める濃度勾
配方向評価値算出手段と、この評価値に、前記所定のモ
デルより得られる重みMW (x、y)で重み付けする重
み付け手段と、重み付けした評価値を加算する加算手段
と、この重み付けされた加算値を重み合計で除算するこ
とにより類似度R
And means for calculating Further, the similarity calculating device according to claim 2 is a density gradient direction calculating means for obtaining a density gradient direction Iθ (x, y) in each pixel of the input image, and a density gradient direction Iθ (x,
y) and the density gradient direction M of the corresponding pixel of the predetermined model
A density gradient direction evaluation value calculating means for obtaining a value f {Iθ (x, y) -Mθ (x, y)} for evaluating the difference in the density gradient direction from θ (x, y), and this evaluation value. A weighting means for weighting with a weight M W (x, y) obtained from the predetermined model, an adding means for adding weighted evaluation values, and a division of the weighted addition value by a total weight. Degree R

【0018】[0018]

【数6】 (Equation 6)

【0019】を算出する手段とを備えている。また、請
求項3に係る類似度算出装置は、請求項1、又は請求項
2に記載のものにおいて、重み付け手段の重みとして、
モデル画像の濃度勾配強度を使用している。また、請求
項4に係る類似度算出装置は、請求項1、請求項2、又
は請求項3記載のものにおいて、評価した値は濃度勾配
方向の差の余弦としている。
And means for calculating Further, the similarity calculation apparatus according to claim 3 is the similarity calculation apparatus according to claim 1 or 2, wherein the weight of the weighting means is
The density gradient strength of the model image is used. The similarity calculation apparatus according to claim 4 is the one according to claim 1, claim 2, or claim 3, wherein the evaluated value is the cosine of the difference in the density gradient direction.

【0020】また、請求項5に係る類似度算出装置は、
請求項1、請求項2、又は請求項3記載のものにおいて
評価した値は、濃度勾配方向の差が0°を含む所定の範
囲内の値であれば1とし、それ以外の所定の範囲内であ
れば−1とし、それ以外の所定の範囲内の値であれば0
としている。また、請求項6に係る類似度算出装置は、
請求項1、又は請求項2記載のものにおいて、重み付け
手段によって重み付けされた重み値が、所定値以上の画
素に対してのみ類似度算出を行うようにしている。
The similarity calculation device according to claim 5 is
The value evaluated in claim 1, claim 2, or claim 3 is 1 if the difference in the concentration gradient direction is within a predetermined range including 0 °, and within a predetermined range other than that. If it is -1, if it is a value within a predetermined range other than that, it is 0
And The similarity calculation device according to claim 6 is
According to the first or second aspect of the present invention, the similarity calculation is performed only on pixels whose weight value weighted by the weighting means is a predetermined value or more.

【0021】また、請求項7に係る類似度算出装置は、
入力画像の各領域における濃度勾配方向Iθ(x、y)
を求める濃度勾配方向算出手段と、この入力画像の濃度
勾配方向Iθ(x、y)と、所定のモデルの対応する領
域の濃度勾配方向Mθ(x、y)との間で、濃度勾配方
向の差を評価する値f{Iθ(x、y)−Mθ(x、
y)}を求める濃度勾配方向評価値算出手段と、この評
価値に、前記所定のモデルより得られる重みMW (x、
y)で重み付けする重み付け手段と、重み付けした評価
値を加算する加算手段と、この重み付けされた加算値を
重み合計で除算することにより類似度R
Further, the similarity calculation device according to claim 7 is
Density gradient direction Iθ (x, y) in each region of the input image
Between the density gradient direction Iθ (x, y) of this input image and the density gradient direction Mθ (x, y) of the corresponding region of the predetermined model. Value f {Iθ (x, y) −Mθ (x,
y)} for the density gradient direction evaluation value calculation means, and a weight M W (x,
y), a weighting means for weighting, an adding means for adding weighted evaluation values, and a similarity R by dividing the weighted addition value by the total weight.

【0022】[0022]

【数7】 (Equation 7)

【0023】を算出する手段とを備えている。また、請
求項8に係る類似度算出方法は、入力画像の各画素につ
いて濃度勾配方向Iθ(x、y)を求め、所定のモデル
の対応する画素間でモデルの濃度勾配方向Mθ(x、
y)の差を評価した値を、所定のモデルより得られる重
みMW (x、y)で重み付けし、加算し、重み合計で除
算することによって、2つの濃淡画像の類似度
And means for calculating In the similarity calculation method according to claim 8, the density gradient direction Iθ (x, y) is obtained for each pixel of the input image, and the model density gradient direction Mθ (x, y) is calculated between corresponding pixels of a predetermined model.
The value obtained by evaluating the difference in y) is weighted with a weight M W (x, y) obtained from a predetermined model, added, and divided by the total weight to calculate the similarity between two grayscale images.

【0024】[0024]

【数8】 (Equation 8)

【0025】を算出する。また、請求項9に係る類似度
算出方法は、モデルより得られる重みとして、モデル画
像の濃度勾配強度とし、2つの濃淡画像の類似度を算出
する。また、請求項10に係る類似度算出方法は、請求
項8に記載の方法において、評価した値として、濃度勾
配方向の差の余弦とし、2つの濃淡画像の類似度を算出
する。
Calculate In the similarity calculation method according to the ninth aspect, the weight obtained from the model is the density gradient strength of the model image, and the similarity between the two grayscale images is calculated. The similarity calculation method according to claim 10 is the method according to claim 8, wherein the evaluated value is the cosine of the difference in the density gradient direction, and the similarity between the two grayscale images is calculated.

【0026】また、請求項11に係る類似度算出方法
は、請求項8に記載の方法において、評価した値とし
て、濃度勾配方向の差が0°を含む所定の範囲内の値で
あれば1とし、それ以外の所定の範囲内の値であれば−
1とし、それ以外の所定の範囲内の値であれば0とし、
2つの濃淡画像の類似度を算出する。また、請求項12
に係る位置検出装置は、モデル画像を記憶するモデル画
像記憶手段と、入力画像を記憶する入力画像記憶手段
と、モデル画像を入力画像内で位置移動させる走査手段
と、この走査過程でモデル画像と、その位置の入力画像
との類似度を算出する請求項1、請求項2記載の類似度
算出装置と、算出された類似度の最も高い入力画像の位
置を、入力画像中におけるモデルの位置とする位置決定
手段とを備えている。
The similarity calculation method according to an eleventh aspect is the method according to the eighth aspect, in which the evaluated value is 1 if the difference in the density gradient direction is a value within a predetermined range including 0 °. And if the value is within the other predetermined range, −
1 and 0 if it is a value within a predetermined range other than that,
The degree of similarity between the two grayscale images is calculated. Claim 12
A position detecting device according to the above, a model image storage means for storing a model image, an input image storage means for storing an input image, a scanning means for moving the model image within the input image, and a model image in the scanning process. The similarity calculation device according to claim 1 or 2 for calculating the similarity between the position and the input image, and the position of the input image having the highest calculated similarity as the position of the model in the input image. And a position determining means for performing the position determination.

【0027】また、請求項13に係る類似度算出装置
は、請求項1、請求項2又は請求項7に係るものにおい
て、複数のモデル画像の各画素における濃度勾配方向を
記憶する濃度勾配方向記憶手段と、前記複数モデル画像
の各画素における濃度勾配強度を記憶する濃度勾配強度
記憶手段と、前記濃度勾配方向から代表濃度勾配方向を
算出する代表濃度勾配方向算出手段と、前記濃度勾配方
向と前記濃度勾配強度から代表濃度勾配強度を算出する
代表濃度勾配強度算出手段を備えている。
A similarity calculating apparatus according to a thirteenth aspect is the one according to the first aspect, the second aspect, or the seventh aspect, in which the density gradient direction storage for storing the density gradient direction in each pixel of a plurality of model images is stored. Means, density gradient strength storage means for storing density gradient strength in each pixel of the plurality of model images, representative density gradient direction calculation means for calculating a representative density gradient direction from the density gradient direction, the density gradient direction, and A representative concentration gradient strength calculating means for calculating the representative concentration gradient strength from the concentration gradient strength is provided.

【0028】また、請求項14に係る類似度算出方法
は、請求項9、請求項10又は請求項11に記載の方法
において、複数のモデル画像の各画素における濃度勾配
方向を記憶し、前記複数モデル画像の各画素における濃
度勾配強度を記憶し、前記濃度勾配方向から代表濃度勾
配方向を算出し、前記濃度勾配方向と前記濃度勾配強度
から代表濃度勾配強度を算出するようにしている。
Further, a similarity calculation method according to a fourteenth aspect is the method according to the ninth, tenth, or eleventh aspect, wherein the density gradient direction in each pixel of a plurality of model images is stored and the plurality of model images are stored. The density gradient strength in each pixel of the model image is stored, the representative density gradient direction is calculated from the density gradient direction, and the representative density gradient strength is calculated from the density gradient direction and the density gradient strength.

【0029】また、請求項15に係る類似度算出装置
は、請求項13に記載のものにおいて、代表濃度勾配方
向として、複数画像の濃度勾配方向の平均を求めるもの
である。また、請求項16に係る類似度検出装置は、請
求項13に記載のものにおいて、代表濃度勾配強度とし
て、複数画像の濃度勾配強度の相加手段を求めるもので
ある。
A similarity calculating apparatus according to a fifteenth aspect of the present invention is the apparatus according to the thirteenth aspect, which obtains an average of a plurality of images in the density gradient direction as the representative density gradient direction. A similarity detection apparatus according to a sixteenth aspect of the present invention is the apparatus according to the thirteenth aspect, which obtains, as the representative density gradient strength, means for adding density gradient strengths of a plurality of images.

【0030】また、請求項17に係る類似度算出装置
は、請求項13に記載のものにおいて、代表濃度勾配強
度として、複数画像の濃度勾配方向と濃度勾配強度およ
び複数画像の濃度勾配方向の平均から求めた代表濃度勾
配方向から濃度勾配強度の代表濃度勾配方向成分の相加
平均を求めるものである。また、請求項18に係る類似
度検出装置は、複数画像の濃度勾配方向から、濃度勾配
方向の正弦の平均と余弦の平均を成分とするベクトルの
長さを求め、その値と請求項17の代表濃度勾配強度と
の積を新たな代表濃度勾配強度として求めるものであ
る。
The similarity calculation apparatus according to a seventeenth aspect is the one according to the thirteenth aspect, wherein the representative density gradient strength is the average of the density gradient directions of the plurality of images and the density gradient strength of the plurality of images. The arithmetic mean of the representative concentration gradient direction components of the concentration gradient strength is obtained from the representative concentration gradient direction obtained from. Further, the similarity detection device according to claim 18 obtains the length of a vector whose components are the average of sine and the average of cosine in the density gradient direction from the density gradient directions of a plurality of images, and the calculated value and the The product of the representative concentration gradient strength is obtained as a new representative concentration gradient strength.

【0031】また、請求項19に係る類似度算出装置
は、予め複数の画像の各画素における濃度勾配方向を求
める濃度勾配方向算出手段と、前記複数画像の各画素に
おける濃度勾配強度を算出する濃度勾配強度算出手段
と、前記濃度勾配方向から代表濃度勾配方向を算出する
代表濃度勾配方向算出手段と、前記濃度勾配強度から代
表濃度勾配強度を算出する代表濃度勾配強度算出手段
と、を用いてモデルデータを作成し記憶しておく記憶部
と、入力画像の濃度勾配方向と、濃度勾配強度とを前記
モデルデータの対応する各画素の代表濃度勾配方向と代
表濃度勾配強度との間で、代表濃度勾配方向および代表
濃度勾配強度の差を評価する値を求める代表濃度勾配評
価値算出手段と、この評価値を加算することによって類
似度を算出する手段とを備えたている。
A similarity calculating apparatus according to a nineteenth aspect of the present invention is a density gradient direction calculating means for obtaining a density gradient direction in each pixel of a plurality of images in advance, and a density for calculating a density gradient intensity in each pixel of the plurality of images. A model using a gradient strength calculating means, a representative concentration gradient direction calculating means for calculating a representative concentration gradient direction from the concentration gradient direction, and a representative concentration gradient strength calculating means for calculating a representative concentration gradient strength from the concentration gradient strength A storage unit for creating and storing data, a density gradient direction of an input image, and a density gradient strength are represented between a representative density gradient direction and a representative density gradient strength of each corresponding pixel of the model data. A representative concentration gradient evaluation value calculation means for obtaining a value for evaluating the difference between the gradient direction and the representative concentration gradient strength, and a means for calculating the similarity by adding the evaluation values are provided. And it was painting.

【0032】また、請求項20に係る類似度算出装置
は、予め複数の画像の各画素における濃度勾配方向を求
める濃度勾配方向算出手段と、前記複数画像の各画素に
おける濃度勾配強度を算出する濃度勾配強度算出手段
と、この濃度勾配方向から代表濃度勾配方向を算出する
代表濃度勾配方向算出手段と、前記濃度勾配強度から代
表濃度勾配強度を算出する代表濃度勾配強度算出手段
と、を用いてモデルデータを作成し記憶しておく記憶部
と、入力画像の濃度勾配方向と、濃度勾配強度とを前記
モデルデータの対応する各画素の代表濃度勾配方向と代
表濃度勾配強度との間で、代表濃度勾配方向および代表
濃度勾配強度の差を評価する値を求める代表濃度勾配評
価値算出手段と、この評価値を加算する加算手段と、こ
れを画素数で除算することによって類似度を算出する除
算手段とを備えている。
The similarity calculating apparatus according to a twentieth aspect of the invention is a density gradient direction calculating means for obtaining a density gradient direction in each pixel of a plurality of images in advance, and a density calculating a density gradient intensity in each pixel of the plurality of images. Model using gradient strength calculation means, representative concentration gradient direction calculation means for calculating a representative concentration gradient direction from this concentration gradient direction, and representative concentration gradient strength calculation means for calculating a representative concentration gradient strength from the concentration gradient strength A storage unit for creating and storing data, a density gradient direction of an input image, and a density gradient strength are represented between a representative density gradient direction and a representative density gradient strength of each corresponding pixel of the model data. Representative density gradient evaluation value calculation means for obtaining a value for evaluating the difference between the gradient direction and the representative density gradient strength, addition means for adding the evaluation values, and division by the number of pixels And a dividing means for calculating a degree of similarity by.

【0033】また、請求項21、請求項22、請求項2
3、請求項24に係る類似度算出装置は、いずれも請求
項19あるいは請求項20のものにおいて、それぞれ請
求項15、請求項16、請求項17、請求項18と同様
の特徴を有するものである。
Further, claim 21, claim 22, claim 2
The similarity calculation device according to claim 3 or claim 24 has the same characteristics as claim 15, claim 16, claim 17, or claim 18 in claim 19 or claim 20, respectively. is there.

【0034】請求項1ないし請求項6に係る類似度算出
装置では、濃度勾配方向の差を評価した値を加算するこ
とにより、2つの濃淡画像の類似度を算出する。濃度勾
配方向は、背景部と対象部とからなるコントラストが変
化した場合においても、値が同じであるという特徴があ
る。また、濃度勾配方向はマスク演算を用いて算出され
るため、連続的に背景部分が変化する場合においても、
局所的に見れば、背景部分は同じ濃度である。このた
め、濃度勾配方向が変化しにくいという特徴がある。ま
た、複雑背景上に対象が描かれている場合においても、
背景変化の不連続な部分で濃度勾配方向がおかしくなる
が、局所的に濃度勾配方向を算出しているため、画像全
体には伝播しないという特徴がある。よって、シェーデ
ィングのように背景部の濃淡値が連続的に変化するよう
なパターンや、複雑背景のように背景部に不連続な部分
はあるものの、その割合が少ないパターンにおいて、マ
ークや文字の認識が可能になる。
In the similarity calculating device according to the first to sixth aspects, the similarity between the two grayscale images is calculated by adding the values evaluated for the difference in the density gradient direction. The density gradient direction is characterized in that the values are the same even when the contrast of the background portion and the target portion changes. In addition, since the density gradient direction is calculated using a mask calculation, even when the background portion changes continuously,
When viewed locally, the background portion has the same density. Therefore, there is a feature that the direction of the concentration gradient is hard to change. Also, even when the target is drawn on a complicated background,
The density gradient direction becomes strange in the discontinuous portion of the background change, but since the density gradient direction is calculated locally, it does not propagate to the entire image. Therefore, it is possible to recognize marks and characters in a pattern such as shading in which the gray value of the background part changes continuously, or in a pattern such as a complex background that has a discontinuous part in the background part but has a small proportion. Will be possible.

【0035】請求項1、請求項2、請求項7、請求項8
に係る類似度算出装置では、画素数あるいは重み合計値
で除算するので、画素数や重み合計値が変化した場合に
おいても、類似度の意味が変化せず、しきい値決めが簡
単になる。請求項3、請求項9に係る類似度算出装置及
び方法では、濃度勾配強度で重み付けをした相関値とし
ているので、複雑背景のように背景が画像によって異な
るようなパターンにおいても、マークや文字の認識が可
能になる。
Claim 1, Claim 2, Claim 7, and Claim 8
In the similarity calculation device according to the first aspect, since the division is performed by the number of pixels or the total weight value, the meaning of the similarity does not change even when the number of pixels or the total weight value changes, and the threshold value determination becomes easy. In the similarity calculation device and method according to claims 3 and 9, since the correlation value weighted by the density gradient intensity is used, even in a pattern such as a complicated background in which the background differs depending on the image, the mark or the character It becomes possible to recognize.

【0036】請求項5、請求項11に係る類似度算出装
置及び方法では、濃度勾配方向の差を評価した値を1、
0、−1の3値としているので、演算量が削減されると
いう効果があげられる。請求項5、請求項11の類似度
算出装置及び方法では、濃度勾配方向の差を評価した値
の最大値を1とし、最少値を−1とし、請求項2、請求
項8の類似度算出装置及び方法では、画素数あるいは重
み合計値で除算するので、画素数や重み合計値が変化し
た場合においても、類似度最大値が1となり、最少値が
−1となり、モデル画像と同じ入力画像との類似度は1
となる。よって、1つのしきい値で複数のモデルの認識
が行えるため、しきい値設定が簡単になる。
In the similarity calculating apparatus and method according to the fifth and eleventh aspects, the value obtained by evaluating the difference in the density gradient direction is 1,
Since the three values of 0 and -1 are used, there is an effect that the amount of calculation is reduced. In the similarity calculation device and method according to claims 5 and 11, the maximum value of the differences evaluated in the density gradient direction is set to 1, and the minimum value is set to -1, and the similarity calculation of claims 2 and 8 is performed. Since the apparatus and the method divide by the number of pixels or the total weight value, even when the number of pixels or the total weight value changes, the maximum similarity value becomes 1 and the minimum value becomes -1, and the same input image as the model image. Is 1
Becomes Therefore, since a plurality of models can be recognized with one threshold value, the threshold value setting becomes easy.

【0037】請求項4、請求項10の類似度算出装置及
び方法では、濃度勾配方向の差を評価した値を濃度勾配
方向の差の余弦としているので、モデル画像と白黒反転
した入力画像との類似度は−1となる。請求項15、請
求項16、請求項17、請求項18、請求項19、請求
項20、請求項21、請求項22、請求項23および請
求項24の類似度検出装置では、代表濃度勾配方向と代
表濃度勾配強度を算出して類似度を求めるものであるか
ら、無地の上にマークや文字等が明瞭に描かれたワーク
を用意できない場合でも記載が可能となる。
In the similarity calculating apparatus and method according to the fourth and tenth aspects, since the value obtained by evaluating the difference in the density gradient direction is used as the cosine of the difference in the density gradient direction, the model image and the black-and-white inverted input image are compared. The degree of similarity is -1. In the similarity detection devices of claim 15, claim 16, claim 17, claim 18, claim 19, claim 20, claim 21, claim 22, claim 23, and claim 24, the representative concentration gradient direction Since the representative density gradient strength is calculated to obtain the degree of similarity, it is possible to describe even when it is not possible to prepare a work in which marks, characters, etc. are clearly drawn on a plain surface.

【0038】[0038]

【発明の実施の形態】以下、実施の形態により、この発
明をさらに詳細に説明する。図1は、この発明の実施の
形態1の画像処理装置の構成を示すブロック図である。
この実施の形態装置は、図23に示した従来の画像処理
装置と同様のカメラ1、A/Dコンバータ2、画像メモ
リ3、D/Aコンバータ4、CRTディスプレイ5、ア
ドレス/データバス6、タイミング制御部7、CPU
8、メモリ9、及びしきい値判定部11を備える他、類
似度算出部10に代えて、濃度勾配方向算出部16、濃
度勾配強度算出部17および類似度算出部18を備えて
いる。
BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in more detail with reference to embodiments. 1 is a block diagram showing a configuration of an image processing apparatus according to a first embodiment of the present invention.
The device of this embodiment is the same as the conventional image processing device shown in FIG. 23: camera 1, A / D converter 2, image memory 3, D / A converter 4, CRT display 5, address / data bus 6, timing. Control unit 7, CPU
8, a memory 9, and a threshold value determination unit 11 are provided, and instead of the similarity degree calculation unit 10, a concentration gradient direction calculation unit 16, a concentration gradient strength calculation unit 17, and a similarity degree calculation unit 18 are provided.

【0039】上記類似度算出部18は、図2に示すよう
に、重み和算出部19と、減算部20と、方向差評価部
21と、積和演算部22と、除算部23とを備えてい
る。この実施の形態画像処理装置では、カメラ1から出
力されたアナログ映像信号はA/Dコンバータ2で、タ
イミング制御部7からのタイミング信号に同期してA/
D変換された後、画像メモリ3に記憶される。画像メモ
リに取り込まれた画像〔図4の(a)〕は、D/Aコン
バータ4を通じてアナログ信号に変換された後、CRT
ディスプレイ5に表示される。一方、画像メモリ3に取
り込まれた画像は、濃度勾配方向算出部16において入
力濃度勾配方向〔図4の(b)〕に変換され、メモリ9
に記憶される。類似度算出部18において、予め濃度勾
配強度算出部17および濃度勾配方向算出部16におい
て算出され、メモリ9に記憶されているモデル濃度勾配
強度〔図3の(b)〕と、モデル濃度勾配方向〔図3の
(c)および入力濃度勾配方向〔図4(b)〕を用いて
類似度が算出される。算出された類似度は、メモリ9に
記憶される。メモリ9に記憶されている類似度と予め設
定されているしきい値との比較がしきい値判定部11で
行われ、OK/NGの判定がされる。その結果は、メモ
リ9に記憶される。各モジュール間のデータの受け渡し
は、アドレス/データバス6を通じて行われる。また、
各モジュールの起動コマンド発行は、CPU8により行
われる。
As shown in FIG. 2, the similarity calculating section 18 includes a weight sum calculating section 19, a subtracting section 20, a direction difference evaluating section 21, a product sum calculating section 22, and a dividing section 23. ing. In the image processing apparatus according to this embodiment, the analog video signal output from the camera 1 is A / D converter 2 and is synchronized with the timing signal from the timing control unit 7 to perform A / D conversion.
After D conversion, it is stored in the image memory 3. The image captured in the image memory [(a) in FIG. 4] is converted into an analog signal through the D / A converter 4, and then the CRT is displayed.
It is displayed on the display 5. On the other hand, the image captured in the image memory 3 is converted into the input density gradient direction [(b) in FIG. 4] by the density gradient direction calculation unit 16 and the memory 9
Is stored. In the similarity calculation unit 18, the model concentration gradient strength [(b) in FIG. 3] calculated in advance by the concentration gradient strength calculation unit 17 and the concentration gradient direction calculation unit 16 and stored in the memory 9 and the model concentration gradient direction. The degree of similarity is calculated using [(c) of FIG. 3 and the input concentration gradient direction [FIG. 4 (b)]. The calculated similarity is stored in the memory 9. The threshold determination unit 11 compares the similarity stored in the memory 9 with a preset threshold to determine OK / NG. The result is stored in the memory 9. Data is passed between the modules via the address / data bus 6. Also,
The CPU 8 issues a start command for each module.

【0040】類似度算出部では、モデル濃度勾配方向と
モデル濃度勾配強度および入力濃度勾配方向の大きさを
(mx、my)とし、モデル濃度勾配方向をMθ(x、
y)、モデル濃度勾配強度をMW (x、y)、入力濃度
勾配方向をIθ(x、y)とすると類似度(R)は、以
下の式により算出される。
In the similarity calculating section, the size of the model concentration gradient direction, the model concentration gradient strength, and the input concentration gradient direction are set as (mx, my), and the model concentration gradient direction is Mθ (x,
y), the model concentration gradient strength is M W (x, y), and the input concentration gradient direction is Iθ (x, y), the similarity (R) is calculated by the following formula.

【0041】[0041]

【数9】 [Equation 9]

【0042】ここで、入力濃度勾配方向Iθ(x、y)
とモデル濃度勾配方向Mθ(x、y)の差値の評価値を
濃度勾配方向の差の余弦とすれば、(請求項6) f(ω)=cosω 一例として、また、評価した値として、濃度勾配方向の
差が0°を含む±45°までの範囲内であれば1とし、
±(45°〜135°)の場合は0とし、±(135°
〜180°)の場合は−1とし、(請求項7)
Here, the input concentration gradient direction Iθ (x, y)
And the model concentration gradient direction Mθ (x, y), the evaluation value of the difference value is the cosine of the difference in the concentration gradient direction. (Claim 6) f (ω) = cosω As an example and as an evaluated value, If the difference in the concentration gradient direction is within a range of ± 45 ° including 0 °, it is set to 1,
± (45 ° to 135 °) is 0, ± (135 °
˜180 °), it is set to −1 (claim 7).

【0043】[0043]

【数10】 (Equation 10)

【0044】となる。画像メモリ3に記憶されている入
力濃度勾配方向をIθ(x、y)およびメモリ9に記憶
されているモデル濃度勾配強度をMW (x、y)とモデ
ル濃度勾配方向Mθ(x、y)が、アドレス/データバ
ス6を通じて、類似度算出部18に取り込まれる。重み
和算出部19において、モデル濃度勾配強度の合計値
Is as follows. The input density gradient direction stored in the image memory 3 is Iθ (x, y), and the model density gradient strength stored in the memory 9 is M W (x, y) and the model density gradient direction Mθ (x, y). Are taken into the similarity calculation unit 18 via the address / data bus 6. In the weight sum calculation unit 19, the total value of the model concentration gradient strength

【0045】[0045]

【数11】 [Equation 11]

【0046】が算出される。また、減算部20において
各画素の入力濃度勾配方向Iθ(x、y)とモデル濃度
勾配方向Mθ(x、y)の差
Is calculated. Further, in the subtraction unit 20, the difference between the input density gradient direction Iθ (x, y) and the model density gradient direction Mθ (x, y) of each pixel.

【0047】[0047]

【数12】 (Equation 12)

【0048】が算出される。方向差評価部21におい
て、
Is calculated. In the direction difference evaluation unit 21,

【0049】[0049]

【数13】 (Equation 13)

【0050】が算出され、積和演算部22において、Is calculated, and in the product-sum calculation unit 22,

【0051】[0051]

【数14】 [Equation 14]

【0052】が算出され、除算部23において、本実施
形態に係る類似度が算出される。モデルは予め以下の手
順で作成され、メモリ9に記憶されている。モデル画像
をカメラ1より、A/Dコンバータ2を通じて画像メモ
リ3に取り込む〔図3の(a)〕。モデル画像は、濃度
勾配方向算出部16においてモデル濃度勾配方向〔図3
の(c)〕に変換され、濃度勾配強度算出部17におい
てモデル濃度勾配強度〔図3の(b)〕に変換される。
モデル濃度勾配方向とモデル濃度勾配強度は、メモリ9
に記憶される。濃度勾配強度算出部17においては、以
下の式(Sobelオペレータ)により、濃度勾配強度
が算出される。
Is calculated, and the division unit 23 calculates the degree of similarity according to the present embodiment. The model is created in advance by the following procedure and stored in the memory 9. A model image is taken from the camera 1 into the image memory 3 through the A / D converter 2 [(a) in FIG. 3]. The model image is processed by the density gradient direction calculation unit 16 in the model density gradient direction [FIG.
(C)], and is converted into model concentration gradient strength [(b) in FIG. 3] in the concentration gradient strength calculation unit 17.
The model concentration gradient direction and the model concentration gradient strength are stored in the memory 9
Is stored. In the concentration gradient strength calculation unit 17, the concentration gradient strength is calculated by the following formula (Sobel operator).

【0053】[0053]

【数15】 (Equation 15)

【0054】濃度勾配強度算出方法としては、グラジェ
ント等のオペレータでも良い。濃度勾配方向算出部16
においては、以下の式(Sobelオペレータ)によ
り、濃度勾配方向〔0°、360°〕が算出される。 Mθ(x、y)=atan2(Dx、Dy) ここで、atan2とは、Dx座標、Dy座標で表され
るDx−Dy座標の逆正接関数をさす(図5)。濃度勾
配方向算出方法としては、Prewittオペレータ等
の他のオペレータでも良い。
An operator such as a gradient may be used as the method of calculating the concentration gradient strength. Concentration gradient direction calculation unit 16
In, the concentration gradient direction [0 °, 360 °] is calculated by the following formula (Sobel operator). Mθ (x, y) = atan2 (Dx, Dy) Here, atan2 refers to an arctangent function of Dx-Dy coordinates represented by Dx coordinates and Dy coordinates (FIG. 5). As the density gradient direction calculation method, another operator such as a Prewitt operator may be used.

【0055】正規化相互相関が苦手とする図25のパタ
ーンについて、本発明に係る手法を適用する。ただし、
濃度勾配強度および濃度勾配方向の算出には、3×3の
マスク演算を行っているため、図6の(a)および
(b)のように、モデル画像、入力画像ともに1画素の
余白があるものとする。モデル濃度勾配方向および入力
濃度勾配方向を上記手法を用いて算出すると、図6の
(c)および(d)のようになる。また、モデル濃度勾
配強度を上記手法を用いて算出すると、図6の(e)の
ようになる。ここで、モデル濃度勾配方向についている
NDというラベルは、Dx、Dyともに0であったた
め、方向が不定となる画素を示している。この画素の方
向差評価は、f(ω)=0とする。入力濃度勾配方向と
モデル濃度勾配方向の差を図6の(f)に示す。f
(ω)=cosω、及び上記数値例を用いて、方向差の
評価を行うと、図7の(g)や(h)のようになり、方
向が不定の部分(ND)を除き、背景の濃度値の不連続
な部分では値が小さくなる。しかし、それ以外では、背
景と文字部のコントラストに影響されることなく、評価
値が1に近くなっていることがわかる。請求項6に係る
f(ω)を用いた場合の類似度は、約0.92、請求項
7に係るf(ω)を用いた場合の類似度は、約0.94
となり、正規化相互相関を用いた類似度(約0.61)
と比べても、評価値の低下が無いことがわかり、本発明
に係る類似度算出法が背景変化に強いことがわかる。
The method according to the present invention is applied to the pattern of FIG. 25, which is poor in the normalized cross-correlation. However,
Since the 3 × 3 mask calculation is performed for the calculation of the density gradient strength and the density gradient direction, as shown in FIGS. 6A and 6B, there is a blank space of 1 pixel in both the model image and the input image. I shall. When the model concentration gradient direction and the input concentration gradient direction are calculated using the above method, the results are as shown in (c) and (d) of FIG. 6. Further, when the model concentration gradient strength is calculated using the above method, it becomes as shown in (e) of FIG. Here, since the label ND in the model density gradient direction is 0 for both Dx and Dy, it indicates a pixel whose direction is undefined. The evaluation of the direction difference of this pixel is f (ω) = 0. The difference between the input concentration gradient direction and the model concentration gradient direction is shown in (f) of FIG. f
When the direction difference is evaluated using (ω) = cosω and the above numerical example, the results are as shown in (g) and (h) of FIG. 7, and the background (excluding the part where the direction is undefined) (ND) is excluded. The value becomes small in the discontinuous portion of the density value. However, in other cases, it can be seen that the evaluation value is close to 1 without being affected by the contrast between the background and the character portion. The similarity when using f (ω) according to claim 6 is about 0.92, and the similarity when using f (ω) according to claim 7 is about 0.94.
And the similarity using normalized cross-correlation (about 0.61)
It can be seen that the evaluation value does not decrease even when compared with, and that the similarity calculation method according to the present invention is strong against background changes.

【0056】この他、背景部にシェーディングがあるパ
ターン(図8)においても、正規化相互相関による類似
度は、約0.91であるのに対し、本発明に係る類似度
算出法においては、請求項6に係るf(ω)を用いた場
合、約0.98、請求項7に係るf(ω)を用いた場
合、1.0となり、本手法がシェーディングに対して
も、有効であることが示された。
In addition, in the pattern having shading in the background portion (FIG. 8), the similarity due to the normalized cross-correlation is about 0.91, whereas in the similarity calculation method according to the present invention, When f (ω) according to claim 6 is used, it is about 0.98, and when f (ω) according to claim 7 is used, it is 1.0, and this method is also effective for shading. Was shown.

【0057】図9は、この発明の実施形態2の位置検出
装置を示すブロック図である。この実施形態位置検出装
置は、図1に示す画像処理装置の同一番号の構成部を備
える他、さらに類似度算出部18、しきい値判定部11
に代えて、照合位置検出部24、重み和算出部25、類
似度算出部26、および位置検出部27を備えている。
FIG. 9 is a block diagram showing a position detecting device according to the second embodiment of the present invention. The position detecting apparatus according to this embodiment includes the same-numbered components of the image processing apparatus shown in FIG. 1, and further includes a similarity calculating section 18 and a threshold determining section 11.
Instead of the above, the collation position detection unit 24, the weighted sum calculation unit 25, the similarity calculation unit 26, and the position detection unit 27 are provided.

【0058】類似度算出部26は、図10に示すよう
に、減算部20と、方向差評価部21と、積和演算部2
2と、除算部23とを備えている。なお、除算部23に
は、重み和算出部25で算出された重み和がアドレス/
データバス6を介して、加えられるようになっている。
As shown in FIG. 10, the similarity calculation section 26 includes a subtraction section 20, a direction difference evaluation section 21, and a sum of products calculation section 2.
2 and a division unit 23. It should be noted that the weighting sum calculated by the weighting sum calculation unit 25 is stored in the division unit 23 at the address /
It is designed to be added via the data bus 6.

【0059】この実施形態位置検出装置では、カメラ1
から出力されたアナログ映像信号は、A/Dコンバータ
2で、タイミング制御部7からのタイミング信号に同期
してA/D変換された後、画像メモリ3に記憶される。
画像メモリ3に取り込まれた画像〔図12(a)〕は、
D/Aコンバータ4を通じてアナログ信号に変換された
後、CRTディスプレイ5に表示される。一方、画像メ
モリ3に取り込まれた画像は、濃度勾配方向算出部16
において、入力濃度勾配方向〔図12の(b)〕に変換
され、メモリ9に記憶される。照合位置算出部24にお
いて、モデルと入力画像との照合位置(i、j)(モデ
ルの左上隅座標基準)が計算される。類似度算出部26
において、予め濃度勾配強度算出部17および濃度勾配
方向算出部16において算出され、メモリ9に記憶され
ているモデル濃度勾配強度〔図11の(b)〕と、モデ
ル濃度勾配方向〔図11の(c)〕および重み和算出部
25において算出され、メモリ9に記憶されているモデ
ル濃度勾配強度の合計値を用いて類似度〔R(i、
j)〕が算出される。算出された類似度と、その照合位
置はメモリ9に記憶される。順次、照合位置算出部24
において(i、j)の値を変化させ、すべての可能な照
合位置での類似度を算出する。なお、照合位置算出部2
4において、探索終了のメッセージが返ってきた場合に
は、処理を位置検出部27にうつす。メモリ9に記憶さ
れている類似度の最大値と、予め設定されているしきい
値との比較が位置検出部27で行われ、OK/NGの判
定がされる。その結果は、メモリ9に記憶される。ま
た、OKの場合には、最大値の位置、即ちモデルと入力
画像との照合位置(imax、jmax)がメモリ9に
記憶される。各モジュール間のデータの受渡しは、アド
レス/データバス6を通じて行われる。また、各モジュ
ールの起動コマンド発行は、CPU8により行われる。
In the position detecting apparatus of this embodiment, the camera 1
The analog video signal output from the A / D converter 2 is A / D converted in synchronization with the timing signal from the timing control unit 7, and then stored in the image memory 3.
The image [FIG. 12 (a)] captured in the image memory 3 is
After being converted into an analog signal through the D / A converter 4, it is displayed on the CRT display 5. On the other hand, the image captured in the image memory 3 is processed by the density gradient direction calculation unit 16
, The input density gradient direction [(b) in FIG. 12] is converted and stored in the memory 9. The matching position calculation unit 24 calculates the matching position (i, j) between the model and the input image (the upper left corner coordinate reference of the model). Similarity calculation unit 26
11, the model concentration gradient strength [(b) of FIG. 11] calculated in advance by the concentration gradient strength calculation unit 17 and the concentration gradient direction calculation unit 16 and stored in the memory 9 and the model concentration gradient direction [(of FIG. 11). c)] and the sum of the model concentration gradient intensities calculated by the weight sum calculation unit 25 and stored in the memory 9, the similarity [R (i,
j)] is calculated. The calculated similarity and its matching position are stored in the memory 9. The collation position calculation unit 24 sequentially
At (i, j), the value is changed to calculate the similarity at all possible matching positions. The matching position calculation unit 2
When the message indicating the end of search is returned in 4, the processing is transferred to the position detecting unit 27. The maximum value of the similarity stored in the memory 9 is compared with a preset threshold value by the position detection unit 27, and the OK / NG determination is made. The result is stored in the memory 9. In the case of OK, the position of the maximum value, that is, the collation position (imax, jmax) between the model and the input image is stored in the memory 9. Data transfer between the modules is performed through the address / data bus 6. Further, the CPU 8 issues a start command for each module.

【0060】図14に照合位置算出部の処理の流れを示
す。予め定められた探索範囲(図13)を(sx、s
y)−(ex、ey)とする。初期値として(i、j)
=(sx−1、sy)が設定されているものとする。モ
デルが探索範囲に収まるように探索範囲の左上から右下
に向かいモデルを走査し、モデルと入力画像との照合位
置を求める。右下隅まで、照合が済むと位置検出部は探
索終了の判定を返す。
FIG. 14 shows the flow of processing by the collation position calculation unit. The predetermined search range (FIG. 13) is set to (sx, s
y)-(ex, ey). As an initial value (i, j)
= (Sx-1, sy) is set. The model is scanned from the upper left to the lower right of the search range so that the model fits in the search range, and the matching position between the model and the input image is obtained. When the matching is completed up to the lower right corner, the position detection unit returns a search end determination.

【0061】類似度算出部においては、照合位置(i、
j)での類似度R(i、j)が、以下の式により、算出
される。
In the similarity calculating section, the collation position (i,
The similarity R (i, j) in j) is calculated by the following formula.

【0062】[0062]

【数16】 (Equation 16)

【0063】なお、算出手順については、実施形態1と
同様である。また、本実施形態においても、実施形態1
と同様に背景変化やシェーディングに対して、安定に認
識できるという効果があげられる。図15は、この発明
の実施形態3の刻印文字読み取り装置の構成を示すブロ
ック図である。この実施例刻印文字読み取り装置は、基
本構成は、図9の位置検出装置とほぼ同じであり、図9
の位置検出装置と同一番号の構成部を有する他、さらに
位置検出部27に代えて、文字読み取り部28を備えて
いる。
The calculation procedure is the same as in the first embodiment. Also in the present embodiment, the first embodiment
Similar to the above, the effect that the background change and shading can be recognized stably can be obtained. FIG. 15 is a block diagram showing the configuration of the stamp character reading device according to the third embodiment of the present invention. The stamped character reading device of this embodiment is basically the same in structure as the position detecting device of FIG.
In addition to the components having the same numbers as those of the position detecting device, the position detecting unit 27 is replaced by a character reading unit 28.

【0064】この実施形態刻印文字読み取り装置では、
カメラ1から出力されたアナログ映像信号は、A/Dコ
ンバータ2で、タイミング制御7からのタイミング信号
に同期してA/D変換された後、画像メモリ3に記憶さ
れる。画像メモリ3に取り込まれた画像〔図17の
(a)〕は、D/Aコンバータ4を通じてアナログ信号
に変換された後、CRTディスプレイ5に表示される。
一方、画像メモリ3に取り込まれた画像は、濃度勾配方
向算出部16において入力濃度勾配方向〔図17の
(b)〕に変換され、メモリ9に記憶される。照合位置
算出部24において、モデルと入力画像との照合位置
(i、j)(モデルの左上隅座標基準)が計算される。
In this embodiment, the marking character reading device,
The analog video signal output from the camera 1 is A / D converted by the A / D converter 2 in synchronization with the timing signal from the timing control 7, and then stored in the image memory 3. The image [(a) in FIG. 17] captured in the image memory 3 is converted into an analog signal by the D / A converter 4 and then displayed on the CRT display 5.
On the other hand, the image captured in the image memory 3 is converted into the input density gradient direction [(b) of FIG. 17] by the density gradient direction calculation unit 16 and stored in the memory 9. The matching position calculation unit 24 calculates the matching position (i, j) between the model and the input image (the upper left corner coordinate reference of the model).

【0065】各文字〔図16の(a)〕毎に、モデル濃
度勾配強度〔図16の(b)〕と、モデル濃度勾配方向
〔図16の(c)〕が濃度勾配強度算出部17におよび
濃度勾配方向算出部16において、予め算出され、メモ
リ9に記憶されている。また、各文字毎に、モデル濃度
勾配強度の合計値が重み和算出部25において算出さ
れ、メモリ9に記憶されている。類似度算出部26にお
いて、モデル濃度勾配強度〔図16の(b)〕とモデル
濃度勾配方向〔図16の(c)〕およびモデル濃度勾配
強度の合計値を用いて、類似度〔R(i、j.mode
l)〕が算出される。算出された類似度〔R(i、j.
model)〕と、その照合位置(i、j)およびモデ
ル名(model)は、メモリ9に記憶される。順次
(i、j)の値を変化させ、すべての可能な照合位置で
の類似度を算出する。これを読み取りを行うすべての文
字について行う。
For each character [(a) in FIG. 16], the model density gradient strength [(b) in FIG. 16] and the model density gradient direction [(c) in FIG. 16] are sent to the density gradient strength calculation unit 17. Also, it is calculated in advance by the concentration gradient direction calculation unit 16 and stored in the memory 9. In addition, the total value of the model concentration gradient strength is calculated by the weight sum calculation unit 25 for each character and stored in the memory 9. The similarity calculation unit 26 uses the total value of the model concentration gradient strength [(b) of FIG. 16], the model concentration gradient direction [(c) of FIG. 16] and the model concentration gradient strength to calculate the similarity [R (i , J. Mode
l)] is calculated. The calculated similarity [R (i, j.
model)], its matching position (i, j) and model name (model) are stored in the memory 9. The values of (i, j) are sequentially changed, and the similarities at all possible matching positions are calculated. Do this for every character you read.

【0066】メモリ9に記憶されている類似度を用い、
文字読み取り部28において文字の読み取りが行われ
る。ある照合位置(i、j)でのすべてモデルに対する
類似度の内、最大を示すモデルをmodel−maxと
する。その類似度R(i、j、model−max)
が、予め設定され、メモリ9に記憶されているしきい値
以上の場合、(i、j)の位置にモデル(model−
max)に対応する文字があるとの判定を行い、メモリ
9に文字と位置を記憶する。これをすべての可能な
(i、j)について行う。
Using the similarity stored in the memory 9,
The character reading unit 28 reads characters. Among the similarities to all models at a certain matching position (i, j), the model showing the maximum is model-max. The similarity R (i, j, model-max)
Is greater than or equal to the threshold value set in advance and stored in the memory 9, the model (model-
It is determined that there is a character corresponding to (max), and the character and position are stored in the memory 9. Do this for all possible (i, j).

【0067】各モジュール(構成部)間のデータの受け
渡しは、アドレス/データバス6を通じて行われる。ま
た、各モジュールの起動コマンド発行は、CPU8によ
り行われる。照合位置算出部の処理は、実施形態2と同
様である。類似度算出部においては、あるモデル(mo
del)の照合位置(i、j)での類似度(i、j.m
odel)が以下の式により、算出される。
Data is transferred between the modules (components) through the address / data bus 6. Further, the CPU 8 issues a start command for each module. The process of the matching position calculation unit is similar to that of the second embodiment. In the similarity calculation unit, a model (mo
del) at the matching position (i, j) (i, j.m)
odel) is calculated by the following formula.

【0068】[0068]

【数17】 [Equation 17]

【0069】なお、算出手順については、実施形態1と
同様である。刻印文字〔図18の(a)〕の場合には、
濃度勾配方向を見た場合、照明の方向により、同じ位置
でも方向が180°ずれる可能性がある〔図19の
(f)、(g)〕。これは、照明の当り方によって、影
の位置が異なるため〔図18の(b)、(c)〕、画像
の見え方が変化するためである〔図18の(d)、
(e)〕。これに対応するため、類似度の式の関数f
(ω)をf(ω)=cos(2ω)とすれば、方向が1
80°ずれた場合にも、f(ω)=1となり、方向が同
じであるように取り扱うことができる。即ち、f(θ)
=f(θ+180)である。
The calculation procedure is the same as in the first embodiment. In the case of engraved characters [(a) in FIG. 18],
When the density gradient direction is viewed, there is a possibility that the direction may be shifted by 180 ° even at the same position depending on the direction of illumination [(f) and (g) in FIG. 19]. This is because the position of the shadow varies depending on how the light hits [(b), (c) of FIG. 18], and the appearance of the image changes [(d) of FIG. 18,
(E)]. To deal with this, the function f of the similarity equation is
If (ω) is f (ω) = cos (2ω), the direction is 1
Even when they are deviated by 80 °, f (ω) = 1 and the directions can be handled as the same. That is, f (θ)
= F (θ + 180).

【0070】例えば、図20の(a)のモデル画像を用
いて、照明の方向が異なる画像〔図21の(d)〕との
類似度を求める場合、モデル濃度勾配方向〔図21の
(c)〕と、入力濃度勾配方向〔図21の(e)〕の角
度差は、照明の方向により180°となる〔図22の
(f)〕。よって、類似度の式のf(ω)をf(ω)=
cos(2ω)とすることにより、f(ω)の値が1.
0となる〔図22の(h)〕。従って、類似度を計算す
ると、1.0となり、類似度の低下はない。一方、従来
の手法を用いてモデル画像〔図20の(a)〕と、入力
画像〔図21の(d)〕の類似度を求めると、−0.8
4となり、絶対値を取ったとしても0.84となり、本
発明に係る手法の優位性が示された。
For example, when the degree of similarity with an image having a different illumination direction [(d) of FIG. 21] is obtained using the model image of FIG. 20 (a), the model density gradient direction [(c of FIG. 21)] is obtained. )] And the input density gradient direction [(e) of FIG. 21] have an angle difference of 180 ° depending on the direction of illumination [(f) of FIG. 22]. Therefore, f (ω) in the expression of similarity is f (ω) =
By setting cos (2ω), the value of f (ω) becomes 1.
It becomes 0 [(h) in FIG. 22]. Therefore, when the similarity is calculated, it becomes 1.0, and there is no decrease in the similarity. On the other hand, when the similarity between the model image [(a) in FIG. 20] and the input image [(d) in FIG. 21] is calculated using the conventional method, it is −0.8.
4, the absolute value was 0.84, indicating the superiority of the method according to the present invention.

【0071】上記図1〜図25で示した実施形態の類似
度検出装置等の各装置では、無地の上にマークや文字等
の対象が明瞭に描かれたワークを撮像し、各画素位置で
の濃度勾配方向と濃度勾配強度をモデルとして登録して
いる。しかし、今ここで例として図26のように透明シ
ート上に印刷されたマークが、背景パターン上の様々な
位置に重なり得るようなワークを考える。これらのワー
クを撮像したものが図27の画像0〜4である。画像0
は無地の上にマークが重なっている。各画像の濃度勾配
方向と濃度勾配強度は例えば図28、図29のようにな
る。図28、図29の濃度勾配方向において黒く塗りつ
ぶされた箇所は方向が不定であることを意味する。
In each device such as the similarity detection device of the embodiment shown in FIGS. 1 to 25, a work in which an object such as a mark or a character is clearly drawn on a plain image is picked up and imaged at each pixel position. The concentration gradient direction and concentration gradient intensity of are registered as models. However, here, as an example, let us consider a work in which marks printed on a transparent sheet can overlap various positions on a background pattern as shown in FIG. Images of these works are images 0 to 4 in FIG. Image 0
The mark is overlaid on the plain fabric. The density gradient direction and density gradient strength of each image are as shown in FIGS. 28 and 29, for example. In the density gradient direction of FIGS. 28 and 29, the blackened portions mean that the direction is undefined.

【0072】類似度算出の式を、The equation for calculating the similarity is

【0073】[0073]

【数18】 (Equation 18)

【0074】とする。ここでモデル濃度勾配方向とモデ
ル濃度勾配強度および入力濃度勾配方向の大きさをmx
×myとし、モデル濃度勾配方向をMθ(x、y)、モ
デル濃度勾配強度をMw(x、y)、入力濃度勾配方向
をIθ(x、y)とした。方向差を評価する関数fを
It is assumed that Here, the size in the model concentration gradient direction, the model concentration gradient strength, and the input concentration gradient direction is mx
Xmy, the model concentration gradient direction was Mθ (x, y), the model concentration gradient strength was M w (x, y), and the input concentration gradient direction was Iθ (x, y). The function f that evaluates the direction difference is

【0075】[0075]

【数19】 [Equation 19]

【0076】とする。画像0のように無地の上にマーク
が重なったワークからモデルを作ると、入力が画像1の
ようにマークが背景パターン上に重なるようなワークで
も、相関値Rは約0.93である。これはモデル画像同
士の相関値1.0と比べた場合にかなり近く、安定した
認識が行える。
It is assumed that When a model is created from a work in which marks are overlapped on a plain surface as in image 0, the correlation value R is about 0.93 even in the case of a work in which marks are overlapped on the background pattern as in image 1. This is quite close to the correlation value of 1.0 between model images, and stable recognition can be performed.

【0077】ところが、無地の上に対象が描かれたワー
クを用意できない場合に、背景パターン上に対象が描か
れたワークから作成したモデルを用いて照合を行おうと
すると、類似度が従来のモデルに比べて小さな値とな
り、認識の精度が悪くなるという問題点がある。例えば
画像4からモデルを作ると、画像1との類似度は0.7
4と小さくなり、安定した認識が行えない。
However, when it is not possible to prepare a work in which the target is drawn on a solid color, if a model created from the work in which the target is drawn on the background pattern is used to perform matching, the similarity will be the same as that of the conventional model. However, there is a problem in that the recognition accuracy becomes poorer than that of the above. For example, if a model is created from image 4, the similarity with image 1 is 0.7.
It becomes as small as 4 and stable recognition cannot be performed.

【0078】以上のような問題点があるために、無地の
上に対象が描かれたワークを用意できない場合は、十分
な性能が得られないことがわかる。以下では、複数のワ
ークを撮像した画像から1つのモデルを作成する手段を
有することにより、無地の上に対象が描かれたワークを
用意できなくても、十分な性能の得られる実施形態類似
度算出装置について説明する。
Due to the above-mentioned problems, it is understood that sufficient performance cannot be obtained when a work on which an object is drawn cannot be prepared. In the following, by having a means for creating one model from images obtained by capturing a plurality of workpieces, an embodiment similarity degree with which sufficient performance can be obtained even if a workpiece on which an object is drawn cannot be prepared. The calculation device will be described.

【0079】図30は、この発明の実施形態4の類似度
算出装置のブロック図である。また、実施形態5の位置
検出装置のブロック図を図31に示す。図30は図1の
類似度算出装置に、図31は図9の位置検出装置に、代
表濃度勾配方向算出部29と代表濃度勾配強度算出部3
0を追加したものである。以下に代表濃度勾配方向算出
部29と代表濃度勾配強度算出部30が、代表濃度勾配
方向と代表濃度勾配強度の算出に必要な情報を得るまで
の過程を説明する。
FIG. 30 is a block diagram of a similarity calculation device according to the fourth embodiment of the present invention. Further, FIG. 31 shows a block diagram of the position detection device of the fifth embodiment. 30 shows the similarity calculation device of FIG. 1, FIG. 31 shows the position detection device of FIG. 9, and the representative concentration gradient direction calculation unit 29 and the representative concentration gradient strength calculation unit 3 are shown.
0 is added. The process until the representative concentration gradient direction calculating unit 29 and the representative concentration gradient strength calculating unit 30 obtain information necessary for calculating the representative concentration gradient direction and the representative concentration gradient strength will be described below.

【0080】様々な背景パターンに対象が描かれたワー
クの画像が、カメラ1において撮像される。出力された
アナログ映像信号はA/Dコンバータ2で、タイミング
制御部7からのタイミング信号に同期してA/D変換さ
れた後、画像メモリ3に記憶される。前記手順によっ
て、大きさmx×myのモデル画像がN枚、画像メモリ
3に記憶される。画像メモリ3に記憶されている画像i
(1≦i≦N)の位置(x、y)(0≦x≦(mx−
1)、0≦y≦(my−1))における濃度勾配方向M
θ(i、x、y)は濃度勾配方向算出部16において、
濃度勾配強度Mw(i、x、y)は濃度勾配強度算出部
17において算出される。濃度勾配方向Mθ(i、x、
y)と濃度勾配強度Mw(i、x、y)はメモリ9に記
憶される。位置(x、y)の代表濃度勾配方向Mθ
p(x、y)は、Mθ(i、x、y)に基づいて、代表
濃度勾配方向算出部29において算出される。また、位
置(x、y)の代表濃度勾配強度Mwp(x、y)は、M
θ(i、x、y)とMw(i、x、y)に基づいて、代
表濃度勾配強度算出部30において算出される。
Images of a work in which objects are drawn on various background patterns are picked up by the camera 1. The output analog video signal is A / D converted by the A / D converter 2 in synchronization with the timing signal from the timing control section 7, and then stored in the image memory 3. By the above procedure, N model images of size mx × my are stored in the image memory 3. Image i stored in the image memory 3
Position (x, y) of (1 ≦ i ≦ N) (0 ≦ x ≦ (mx−
1), the concentration gradient direction M in 0 ≦ y ≦ (my-1))
θ (i, x, y) is calculated by the concentration gradient direction calculation unit 16 as follows.
The concentration gradient strength M w (i, x, y) is calculated by the concentration gradient strength calculator 17. Concentration gradient direction Mθ (i, x,
y) and the concentration gradient strength M w (i, x, y) are stored in the memory 9. Representative concentration gradient direction Mθ at position (x, y)
p (x, y) is calculated by the representative concentration gradient direction calculation unit 29 based on Mθ (i, x, y). The representative concentration gradient strength M wp (x, y) at the position (x, y) is M
It is calculated in the representative concentration gradient strength calculation unit 30 based on θ (i, x, y) and M w (i, x, y).

【0081】図32は代表濃度勾配方向と代表濃度勾配
強度の算出を、モデル画像中のすべての位置(x、y)
(0≦x≦(my−1)、0≦y≦(my−1))にお
いて行うことを示すフロー図である。先ず、変数x、y
を0とし(ST11)、次に、各位置における代表濃度
勾配方向や代表濃度勾配強度を求める処理(フロー図3
3〜36)を行い(ST12)、変数xを1インクリメ
ントするとともに(ST13)、この変数がmxに達す
るまで、ST12、ST13の処理を繰り返す。x=m
xとなると、ST14の判定がNOとなり、今度はyを
1インクリメントとし、xを0とし(ST16)、ST
12に戻り、再びST12、ST13の処理をx=mx
となるまで繰り返す。x=mxとなると、再度変数yを
1インクリメントする。そして、y=my−1となるま
で、上記ST11〜ST16の処理を繰り返す。
FIG. 32 shows the calculation of the representative density gradient direction and the representative density gradient strength at all positions (x, y) in the model image.
It is a flowchart which shows what is performed in (0 <= x <(my-1), 0 <= y <(my-1). First, variables x and y
Is set to 0 (ST11), and then the processing for obtaining the representative concentration gradient direction and the representative concentration gradient strength at each position (Flow chart 3
3 to 36) (ST12), the variable x is incremented by 1 (ST13), and the processes of ST12 and ST13 are repeated until this variable reaches mx. x = m
When it becomes x, the determination in ST14 becomes NO, this time y is incremented by 1, x is set to 0 (ST16), and ST is set.
Returning to step 12, the processing of ST12 and ST13 is performed again with x = mx
Repeat until When x = mx, the variable y is incremented by 1 again. Then, the processes of ST11 to ST16 are repeated until y = my-1.

【0082】請求項16に係る代表濃度勾配方向算出部
29のフロー図を図33に示す。ここでは、先ず、変数
αを0、変数βを0、変数iを1とし、初期設定し(S
T21)、次にMθ(i、x、y)≠方向不定か?を判
定する(ST22)。不定でなければ、α=α+cos
Mθ(i、x、y)、β=β+sinMθ(i、x、
y)の演算を行う(ST23)。次に、変数iを1イン
クリメントし(ST24)、変数iがNを越えるまで
(ST25)、ST22〜ST24の処理を繰り返す。
ST25の判定がYESとなると、α=α/N、β=β
/Nの演算を行う(ST26)。ステップST26にお
いて、αの値は濃度勾配方向Mθ(i、x、y)の余弦
の平均、βの値は濃度勾配方向Mθ(i、x、y)の正
弦の平均となる。すなわち、
FIG. 33 shows a flow chart of the representative concentration gradient direction calculation unit 29 according to claim 16. Here, first, the variable α is set to 0, the variable β is set to 0, the variable i is set to 1, and initialization is performed (S
T21), then Mθ (i, x, y) ≠ direction indeterminate? Is determined (ST22). If not indefinite, α = α + cos
Mθ (i, x, y), β = β + sinMθ (i, x,
y) is calculated (ST23). Next, the variable i is incremented by 1 (ST24), and the processes of ST22 to ST24 are repeated until the variable i exceeds N (ST25).
If the determination in ST25 is YES, α = α / N, β = β
/ N is calculated (ST26). In step ST26, the value of α is the average of the cosine of the concentration gradient direction Mθ (i, x, y), and the value of β is the average of the sine of the concentration gradient direction Mθ (i, x, y). That is,

【0083】[0083]

【数20】 (Equation 20)

【0084】濃度勾配方向Mθ(i、x、y)の値が不
定の時には、ST22においてその判定が行われ、ST
23をスキップし、ST23での加算は行われない。
(α2+β2)の平方根は濃度勾配方向Mθ(i、x、
y)間のばらつきが大きいほど、その値は小さくなるの
で、注目画素(x、y)における濃度勾配方向Mθ
(i、x、y)の安定性の指標となる。α、βの値に基
づいて、代表濃度勾配方向Mθ p(x、y)は、
The value of the concentration gradient direction Mθ (i, x, y) is
When it is fixed, the determination is made in ST22, and ST
23 is skipped and the addition in ST23 is not performed.
2+ Β2) Is the square root of the concentration gradient direction Mθ (i, x,
The larger the variation between y), the smaller the value.
Then, the density gradient direction Mθ in the target pixel (x, y)
It is an index of the stability of (i, x, y). Based on the values of α and β
Then, the representative concentration gradient direction Mθ p(X, y) is

【0085】[0085]

【数21】 (Equation 21)

【0086】となる。ここでδはあらかじめ設定された
しきい値である。atan2(X、Y)とは、X座標、
Y座標で表わされるX−Y座標の逆正接関数をさす(図
5)。請求項17に係る代表濃度勾配強度算出部30の
フロー図を図34に示す。ここでは、代表濃度勾配強度
を算出するのに、先ず、変数M1を0とし、変数iを1
とし(ST31)、M1=M1+MW(i、x、y)の演
算を行い(ST32)、さらに変数iを1インクリメン
トし(ST33)、変数iがNになるまでST32、S
T33の処理を繰り返す。そして、ST34でi=Nと
なると、代表濃度勾配強度MWP1(x、y):(M
WP1(x、y)=M1÷N)を算出する。代表濃度勾配強
度Mwp1(x、y)は、濃度勾配強度Mw(i、x、y)
の相加平均、
[0086] Here, δ is a preset threshold value. atan2 (X, Y) is the X coordinate,
The arctangent function of the XY coordinate represented by the Y coordinate is shown (FIG. 5). FIG. 34 shows a flow chart of the representative concentration gradient strength calculating unit 30 according to claim 17. Here, in order to calculate the representative concentration gradient strength, first, the variable M 1 is set to 0 and the variable i is set to 1
(ST31), M 1 = M 1 + M W (i, x, y) is calculated (ST32), the variable i is further incremented by 1 (ST33), and ST32, S until the variable i becomes N.
The process of T33 is repeated. Then, when i = N in ST34, the representative concentration gradient strength M WP1 (x, y): (M
Calculate WP1 (x, y) = M 1 ÷ N). The representative concentration gradient strength M wp1 (x, y) is the concentration gradient strength M w (i, x, y)
The arithmetic mean of,

【0087】[0087]

【数22】 (Equation 22)

【0088】となる。請求項18に係る代表濃度勾配強
度算出部30のフロー図を図35に示す。ステップST
46においてNOと判定された時、M2の値は、大きさ
が1、向きが代表濃度勾配方向Mθp(x、y)のベク
トルと、大きさが濃度勾配強度Mw(i、x、y)、向
きが濃度勾配方向Mθ(i、x、y)のベクトルとの内
積和、
Is as follows. A flow chart of the representative concentration gradient strength calculating unit 30 according to claim 18 is shown in FIG. Step ST
When NO is determined in 46, the value of M 2 is a vector whose magnitude is 1, the direction is the representative concentration gradient direction Mθ p (x, y), and the magnitude is the concentration gradient strength M w (i, x, y), the sum of inner products with a vector whose direction is the concentration gradient direction Mθ (i, x, y),

【0089】[0089]

【数23】 (Equation 23)

【0090】となる。濃度勾配方向Mθ(i、x、y)
の値が不定の時には、ステップST42においてその判
定が行われ、ステップST43、ST44の処理は行わ
れないでスキップされ、ST45に移る。代表濃度勾配
強度Mwp2(x、y)は、M2とNとの商、
## EQU10 ## Concentration gradient direction Mθ (i, x, y)
When the value of is indefinite, the determination is made in step ST42, the processes of steps ST43 and ST44 are skipped without being performed, and the process proceeds to ST45. The representative concentration gradient strength M wp2 (x, y) is the quotient of M 2 and N,

【0091】[0091]

【数24】 (Equation 24)

【0092】となる(ST47)。代表濃度勾配強度M
wp2(x、y)には、濃度勾配方向Mθ(i、x、y)
が代表濃度勾配方向Mθp(x、y)から離れるほど、
濃度勾配強度Mw(i、x、y)の寄与が小さくなると
いう性質がある。請求項19に係る代表濃度勾配強度算
出部30のフロー図を図36に示す。ステップST58
において、αの値は濃度勾配方向Mθ(i、x、y)の
余弦の平均、βの値は濃度勾配方向Mθ(i、x、y)
の正弦の平均となる。すなわち、
(ST47) Representative concentration gradient strength M
wp2 (x, y) is the concentration gradient direction Mθ (i, x, y)
Is farther from the representative concentration gradient direction Mθ p (x, y),
There is a property that the contribution of the concentration gradient strength M w (i, x, y) becomes small. FIG. 36 shows a flowchart of the representative concentration gradient strength calculating unit 30 according to claim 19. Step ST58
In, the value of α is the average of the cosine of the concentration gradient direction Mθ (i, x, y), and the value of β is the concentration gradient direction Mθ (i, x, y).
It is the average of the sine of. That is,

【0093】[0093]

【数25】 (Equation 25)

【0094】となる。またM3の値は、大きさが1、向
きが代表濃度勾配方向Mθp(x、y)のベクトルと、
大きさが濃度勾配強度Mw(i、x、y)、向きが濃度
勾配強度Mθ(i、x、y)のベクトルとの内積和の平
均、
It becomes The value of M 3 is a vector whose magnitude is 1 and whose direction is the representative concentration gradient direction Mθ p (x, y),
The magnitude is the concentration gradient strength M w (i, x, y) and the direction is the concentration gradient strength Mθ (i, x, y), and the average of the sum of inner products with the vector,

【0095】[0095]

【数26】 (Equation 26)

【0096】となる。濃度勾配方向Mθ(i、x、y)
の値が不定の時には、ステップST52においてその判
定が行われ、ST53、ST54、ST55の処理は行
われない。代表濃度勾配強度Mwp3(x、y)は、M
3と、濃度勾配方向Mθ(i、x、y)の安定性の指標
となる(α2+β2)のルートの積になる。
## EQU10 ## Concentration gradient direction Mθ (i, x, y)
When the value of is indefinite, the determination is made in step ST52, and the processes of ST53, ST54, and ST55 are not performed. The representative concentration gradient strength M wp3 (x, y) is M
3, the root of the product of the density gradient direction Mθ (i, x, y) becomes the index of stability of (α 2 + β 2).

【0097】[0097]

【数27】 [Equation 27]

【0098】となる。代表濃度勾配強度Mwp3(x、
y)には、濃度勾配方向Mθ(i、x、y)がばらつい
ているほど、その値が小さくなるという性質がある。以
下に前記の代表濃度勾配方向と代表濃度勾配強度を図2
7の画像1〜4から算出し、画像1との類似度を示す。
なお代表濃度勾配方向Mθp(x、y)と、代表濃度勾
配強度をMwp3(x、y)の算出の際のしきい値δは、
0とした。
It becomes Representative concentration gradient strength M wp3 (x,
y) has a property that the value decreases as the concentration gradient direction Mθ (i, x, y) varies. The representative concentration gradient direction and the representative concentration gradient strength are shown in FIG.
7 is calculated from images 1 to 4 and the degree of similarity to image 1 is shown.
The threshold δ for calculating the representative concentration gradient direction Mθ p (x, y) and the representative concentration gradient strength M wp3 (x, y) is
It was set to 0.

【0099】画像1〜4から代表濃度勾配方向Mθ
p(x、y)、代表濃度勾配強度をMwp1(x、y)を求
めると図37、図38のようになる。このモデルと画像
1との類似度を算出すると約0.89になる。画像1〜
4から代表濃度勾配方向Mθp(x、y)、代表濃度勾
配強度をMwp2(x、y)を求めると図39のようにな
る。このモデルと画像1との類似度を算出すると約0.
89になる。
From images 1 to 4, representative density gradient direction Mθ
37 and 38 show p (x, y) and M wp1 (x, y) for the representative concentration gradient strength. The similarity between this model and image 1 is calculated to be about 0.89. Image 1
FIG. 39 shows the representative concentration gradient direction Mθ p (x, y) and the representative concentration gradient strength M wp2 (x, y) obtained from FIG. When the similarity between this model and image 1 is calculated, it is about 0.
It becomes 89.

【0100】画像1〜4から代表濃度勾配方向Mθ
p(x、y)、代表濃度勾配強度をMwp3(x、y)を求
めると図40のようになる。このモデルと画像1との類
似度を算出すると約0.97になる。いずれの場合も、
画像0と画像1との類似度(約0.93)に近いため、
安定した認識が可能となる。
From images 1 to 4, representative density gradient direction Mθ
p (x, y), comprising a representative concentration gradient intensity as M wp3 (x, y) Figure 40 when seeking. The similarity between this model and image 1 is calculated to be about 0.97. In either case,
Since the similarity between image 0 and image 1 (approximately 0.93) is close,
Stable recognition is possible.

【0101】以上のように、本発明に係るモデル作成手
法によって、無地の上にマークや文字が描かれたワーク
を用意できない場合でも、モデルを作ることができる。
As described above, with the model creating method according to the present invention, a model can be created even when a work having marks or characters drawn on a plain surface cannot be prepared.

【0102】[0102]

【発明の効果】請求項1、請求項2、請求項7及び請求
項8に係る発明によれば、濃度勾配方向の差を評価した
値を加算することにより、2つの画像の類似度を算出す
るものであり、濃度勾配方向は、背景部と対象部とから
なるコントラストが変化した場合においても値が同じで
ある。マスク演算を用いて算出されるため、連続的に背
景部分が変化する場合においても、局所的に見れば、背
景部分は同じ濃度であり、濃度勾配方向が変化しにく
い。複雑背景上に対象が描かれている場合においても、
背景変化の不連続な部分で濃度勾配方向がおかしくなる
が、局所的に濃度勾配方向を算出しているため、画像全
体には伝播しない。等の特徴があるので、シェーディン
グのように背景部の濃淡値が連続的に変化するようなパ
ターンや、複雑背景のように背景部に不連続な部分はあ
るものの、その割合が少ないパターンにおいて、マーク
や文字の認識が可能になるという効果がある。
According to the inventions of claim 1, claim 2, claim 7 and claim 8, the similarity between two images is calculated by adding the values evaluated for the difference in the density gradient direction. The density gradient direction has the same value even when the contrast of the background portion and the target portion changes. Since the calculation is performed using the mask calculation, even when the background portion changes continuously, the background portion has the same density locally, and the density gradient direction hardly changes. Even when the target is drawn on a complicated background,
The density gradient direction becomes strange at the discontinuous portion of the background change, but since the density gradient direction is calculated locally, it does not propagate to the entire image. Since there are features such as shading, in a pattern where the gray value of the background part changes continuously, such as shading, or in the background part where there is a discontinuous part such as a complicated background, in a pattern with a small proportion, This has the effect of enabling recognition of marks and characters.

【0103】また、請求項2、請求項7及び請求項8に
係る発明によれば、画素数あるいは重み合計値で除算す
るので、画素数や重み合計値が変化した場合において
も、類似度の意味が変化せず、しきい値決めが簡単にな
るという効果がある。また、請求項3、請求項9に係る
発明によれば、濃度勾配強度で重み付けをした相関値と
しているので、複雑背景のように背景が画像によって異
なるようなパターンにおいても、マークや文字の認識が
可能になるという効果がある。
Further, according to the inventions of claim 2, claim 7, and claim 8, since the division is performed by the number of pixels or the total weight value, even if the number of pixels or the total weight value changes, the similarity can be calculated. There is an effect that the meaning does not change and the threshold value is easily determined. Further, according to the inventions according to claims 3 and 9, since the correlation value weighted by the density gradient strength is used, even in a pattern such as a complicated background in which the background differs depending on the image, recognition of the mark or the character is performed. There is an effect that it becomes possible.

【0104】請求項2、請求項7、請求項8に係る発明
によれば、1つのしきい値で複数のモデルの認識が行え
るため、しきい値設定が簡単になるという効果がある。
また、請求項4、請求項10に係る発明によれば、濃度
勾配方向の差を評価した値を濃度勾配方向の差の余弦と
するものであるから、モデル画像と白黒反転した入力画
像との類似度は−1となるという効果がある。
According to the inventions of claim 2, claim 7, and claim 8, a plurality of models can be recognized with one threshold value, so that there is an effect that threshold value setting becomes simple.
Further, according to the inventions of claims 4 and 10, the value obtained by evaluating the difference in the density gradient direction is used as the cosine of the difference in the density gradient direction. The similarity is -1.

【0105】また、請求項12に係る発明によれば、モ
デルの入力画像中での位置を精度良く検出できる。ま
た、請求項13ないし請求項24に係る発明によれば、
無地の上にマークや文字等が明瞭に描かれたワークを用
意できない場合でも、精度良く認識ができる。
According to the twelfth aspect of the invention, the position of the model in the input image can be accurately detected. Further, according to the inventions of claims 13 to 24,
Even if it is not possible to prepare a work in which marks, letters, etc. are clearly drawn on a plain surface, it is possible to accurately recognize the work.

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

【図1】この発明の一実施形態画像処理装置の構成を示
すブロック図である。
FIG. 1 is a block diagram showing a configuration of an image processing apparatus according to an embodiment of the present invention.

【図2】同実施形態画像処理装置の類似度算出部の構成
を示すブロック図である。
FIG. 2 is a block diagram showing a configuration of a similarity calculation unit of the image processing apparatus according to the embodiment.

【図3】同実施形態画像処理装置におけるモデル画像を
説明する図である。
FIG. 3 is a diagram illustrating a model image in the image processing apparatus of the same embodiment.

【図4】同実施形態画像処理装置における入力画像を説
明する図である。
FIG. 4 is a diagram illustrating an input image in the image processing apparatus of the same embodiment.

【図5】同実施形態画像処理装置のモデル画像の濃度勾
配方向算出を説明する図である。
FIG. 5 is a diagram for explaining calculation of a density gradient direction of a model image of the image processing apparatus of the same embodiment.

【図6】同実施形態画像処理装置の類似度算出の一例を
説明する図である。
FIG. 6 is a diagram illustrating an example of similarity calculation of the image processing apparatus according to the embodiment.

【図7】図6とともに、同実施形態画像処理装置の類似
度算出の一例を説明する図である。
FIG. 7 is a diagram illustrating an example of similarity calculation of the image processing apparatus of the embodiment, together with FIG. 6.

【図8】同実施形態画像処理装置の類似度算出の一例を
説明する図である。
FIG. 8 is a diagram illustrating an example of similarity calculation of the image processing apparatus according to the embodiment.

【図9】この発明の他の実施形態位置検出装置の構成を
示すブロック図である。
FIG. 9 is a block diagram showing a configuration of a position detection device according to another embodiment of the present invention.

【図10】同実施形態位置検出装置の類似度算出部の構
成を示すブロック図である。
FIG. 10 is a block diagram showing a configuration of a similarity calculation unit of the position detection device of the embodiment.

【図11】同実施形態位置検出装置におけるモデル画像
を説明する図である。
FIG. 11 is a diagram illustrating a model image in the position detection device of the embodiment.

【図12】同実施形態位置検出装置における入力画像を
説明する図である。
FIG. 12 is a diagram illustrating an input image in the position detection device of the same embodiment.

【図13】同実施形態位置検出装置における位置探索を
説明する図である。
FIG. 13 is a diagram illustrating position search in the position detection device of the embodiment.

【図14】同実施形態位置検出装置における位置探索処
理を説明するフロー図である。
FIG. 14 is a flowchart illustrating a position search process in the position detection device of the embodiment.

【図15】この発明の他の実施形態刻印文字読み取り装
置の構成を示すブロック図である。
FIG. 15 is a block diagram showing a configuration of a stamp character reading device according to another embodiment of the present invention.

【図16】同実施形態刻印文字読み取り装置におけるモ
デル画像を説明する図である。
FIG. 16 is a diagram illustrating a model image in the marking character reading device according to the embodiment.

【図17】同実施形態刻印文字読み取り装置における入
力画像を説明する図である。
FIG. 17 is a diagram illustrating an input image in the marking character reading device according to the embodiment.

【図18】同実施形態刻印文字読み取り装置における照
明方向の相違による読み取り画像の相違を説明する図で
ある。
FIG. 18 is a diagram illustrating a difference in a read image due to a difference in illumination direction in the stamped character reading device according to the embodiment.

【図19】図18とともに、同実施形態刻印文字読み取
り装置における照明方向の相違による読み取り画像の相
違を説明する図である。
FIG. 19 is a view for explaining the difference in the read image due to the difference in the illumination direction in the stamped character reading device according to the same with FIG. 18.

【図20】同実施形態刻印文字読み取り装置における刻
印文字照合の一例を示す図である。
FIG. 20 is a diagram showing an example of a stamp character collation in the stamp character reading apparatus according to the embodiment.

【図21】図20ともに、同実施形態刻印文字読み取り
装置における刻印文字照合の一例を示す図である。
FIG. 21 is a diagram showing an example of stamped character collation in the stamped character reading device according to the same embodiment as FIG. 20.

【図22】図20、図21ともに、同実施形態刻印文字
読み取り装置における刻印文字照合の一例を示す図であ
る。
FIG. 22 and FIG. 21 are views showing an example of a stamp character collation in the stamp character reading apparatus according to the embodiment.

【図23】従来の画像処理装置の構成を示すブロック図
である。
FIG. 23 is a block diagram showing a configuration of a conventional image processing device.

【図24】同従来の画像処理装置の類似度算出部の構成
を示すブロック図である。
FIG. 24 is a block diagram showing a configuration of a similarity calculation unit of the conventional image processing apparatus.

【図25】同従来の画像処理装置のモデル画像と入力画
像の一例を示す図である。
FIG. 25 is a diagram showing an example of a model image and an input image of the conventional image processing apparatus.

【図26】透明シートに覆われたワークを背景パターン
を有するものに設置する場合を示す図である。
FIG. 26 is a diagram showing a case where a work covered with a transparent sheet is installed on a work having a background pattern.

【図27】図26に示すワークを撮像した画像の例を示
す図である。
FIG. 27 is a diagram showing an example of an image obtained by capturing an image of the work shown in FIG. 26.

【図28】図27に示す画像0の場合の濃度勾配方向と
濃度勾配強度を示す図である。
28 is a diagram showing a density gradient direction and a density gradient strength in the case of the image 0 shown in FIG.

【図29】図27に示す画像1、画像2、画像3及び画
像4の場合の濃度勾配方向と濃度勾配強度を示す図であ
る。
29 is a diagram showing the density gradient direction and density gradient strength in the case of Image 1, Image 2, Image 3, and Image 4 shown in FIG.

【図30】この発明の他の実施形態類似度算出装置の構
成を示すブロック図である。
FIG. 30 is a block diagram showing the configuration of a similarity calculation device according to another embodiment of the present invention.

【図31】この発明のさらに他の実施形態位置検出装置
の構成を示すブロック図である。
FIG. 31 is a block diagram showing the configuration of a position detecting device according to still another embodiment of the present invention.

【図32】図30、図31に示す実施形態装置におい
て、モデル中の全画素を用いて代表濃度勾配方向と代表
濃度勾配強度の算出を行う場合のフロー図である。
32 is a flow chart in the case where the representative density gradient direction and the representative density gradient strength are calculated using all pixels in the model in the apparatus of the embodiment shown in FIGS. 30 and 31. FIG.

【図33】図30、図31に示す装置で、代表濃度勾配
方向の算出方法を示すフロー図である。
FIG. 33 is a flowchart showing a method of calculating the representative concentration gradient direction in the apparatus shown in FIGS. 30 and 31.

【図34】図30、図31に示す装置で、代表濃度勾配
強度の算出方法を示すフロー図である。
FIG. 34 is a flowchart showing a method of calculating the representative concentration gradient strength in the apparatus shown in FIGS. 30 and 31.

【図35】図30、図31に示す装置で、代表濃度勾配
強度の別の算出方法を示すフロー図である。
FIG. 35 is a flowchart showing another method of calculating the representative concentration gradient strength in the apparatus shown in FIGS. 30 and 31.

【図36】図30、図31に示す装置で、代表濃度勾配
強度のさらに他の算出方法を示すフロー図である。
FIG. 36 is a flowchart showing still another calculation method of the representative concentration gradient strength in the apparatus shown in FIGS. 30 and 31.

【図37】図32、図33に示す算出フロー図によって
得られた画像1〜画像4からの代表濃度勾配方向を示す
図である。
FIG. 37 is a diagram showing representative density gradient directions from images 1 to 4 obtained by the calculation flowcharts shown in FIGS. 32 and 33.

【図38】図32、図34に示す算出フロー図によって
得られた画像1〜画像4からの代表濃度勾配強度を示す
図である。
38 is a diagram showing representative concentration gradient intensities from images 1 to 4 obtained by the calculation flowcharts shown in FIGS. 32 and 34. FIG.

【図39】図32、図35に示す算出フロー図によって
得られた画像1〜画像4からの代表濃度勾配強度を示す
図である。
FIG. 39 is a diagram showing representative density gradient intensities from images 1 to 4 obtained by the calculation flow charts shown in FIGS. 32 and 35.

【図40】図32、図36に示す算出フロー図によって
得られた画像1〜画像4からの代表濃度勾配強度を示す
図である。
40 is a diagram showing representative density gradient intensities from images 1 to 4 obtained by the calculation flowcharts shown in FIGS. 32 and 36. FIG.

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

3 画像メモリ 9 メモリ 19 重み和算出部 20 減算部 21 方向差評価部 22 積和演算部 23 除算部 3 image memory 9 memory 19 weighted sum calculation unit 20 subtraction unit 21 direction difference evaluation unit 22 product sum operation unit 23 division unit

Claims (24)

【特許請求の範囲】[Claims] 【請求項1】入力画像の各画素における濃度勾配方向I
θ(x、y)を求める濃度勾配方向算出手段と、この入
力画像の濃度勾配方向Iθ(x、y)と、所定のモデル
の対応する画素の濃度勾配方向Mθ(x、y)との間
で、濃度勾配方向の差を評価する値f{Iθ(x、y)
−Mθ(x、y)}を求める濃度勾配方向評価値算出手
段と、この評価値に、前記所定のモデルより得られる重
みMW (x、y)で重み付けする重み付け手段と、重み
付けした評価値を加算することよって類似度を算出する
手段とを備えた類似度算出装置。
1. A density gradient direction I at each pixel of an input image.
Between the density gradient direction calculating means for obtaining θ (x, y), the density gradient direction Iθ (x, y) of the input image, and the density gradient direction Mθ (x, y) of the corresponding pixel of the predetermined model. Is a value f {Iθ (x, y) for evaluating the difference in the concentration gradient direction.
Concentration gradient direction evaluation value calculating means for obtaining −Mθ (x, y)}, weighting means for weighting this evaluation value with the weight M W (x, y) obtained from the predetermined model, and weighted evaluation value And a means for calculating the degree of similarity by adding.
【請求項2】入力画像の各画素における濃度勾配方向I
θ(x、y)を求める濃度勾配方向算出手段と、この入
力画像の濃度勾配方向Iθ(x、y)と、所定のモデル
の対応する画素の濃度勾配方向Mθ(x、y)との間
で、濃度勾配方向の差を評価する値f{Iθ(x、y)
−Mθ(x、y)}を求める濃度勾配方向評価値算出手
段と、この評価値に、前記所定のモデルより得られる重
みMW (x、y)で重み付けする重み付け手段と、重み
付けした評価値を加算する加算手段と、この重み付けさ
れた加算値を重み合計で除算することにより類似度Rを
算出する手段とを備えた類似度算出装置。
2. A density gradient direction I in each pixel of an input image
Between the density gradient direction calculating means for obtaining θ (x, y), the density gradient direction Iθ (x, y) of the input image, and the density gradient direction Mθ (x, y) of the corresponding pixel of the predetermined model. Is a value f {Iθ (x, y) for evaluating the difference in the concentration gradient direction.
Concentration gradient direction evaluation value calculating means for obtaining −Mθ (x, y)}, weighting means for weighting this evaluation value with the weight M W (x, y) obtained from the predetermined model, and weighted evaluation value And a means for calculating the degree of similarity R by dividing the weighted addition value by the total weight.
【請求項3】前記重み付け手段は、重みとして、モデル
画像の濃度勾配強度とする請求項1又は請求項2記載の
類似度算出装置。
3. The similarity calculation apparatus according to claim 1, wherein the weighting means uses the density gradient strength of the model image as the weight.
【請求項4】前記差値の評価した値は、濃度勾配方向の
差の余弦である請求項1、請求項2あるいは請求項3記
載の類似度算出装置。
4. The similarity calculation device according to claim 1, wherein the evaluated value of the difference value is the cosine of the difference in the density gradient direction.
【請求項5】前記差値を評価した値は、濃度勾配方向の
差が0°を含む所定の範囲内の値であれば1とし、それ
以外の所定の範囲内の値であれば−1とし、それぞれ以
外の所定の範囲内の値であれば0とする請求項1、請求
項2又は請求項3記載の類似度算出装置。
5. The evaluated value of the difference value is 1 if the difference in the density gradient direction is a value within a predetermined range including 0 °, and is -1 if the value is within another predetermined range. The similarity calculation device according to claim 1, claim 2 or claim 3, wherein a value within a predetermined range other than each is set to 0.
【請求項6】前記重み付け手段によって重み付けされた
重み値が所定値以上の画素に対してのみ類似度算出を行
うようにした請求項1又は請求項2記載の類似度算出装
置。
6. The similarity calculation apparatus according to claim 1 or 2, wherein the similarity calculation is performed only on pixels whose weight value weighted by the weighting means is a predetermined value or more.
【請求項7】入力画像の各領域における濃度勾配方向I
θ(x、y)を求める濃度勾配方向算出手段と、この入
力画像の濃度勾配方向Iθ(x、y)と、所定のモデル
の対応する領域の濃度勾配方向Mθ(x、y)との間
で、濃度勾配方向の差を評価する値f{Iθ(x、y)
−Mθ(x、y)}を求める濃度勾配方向評価値算出手
段と、この評価値に、前記所定のモデルより得られる重
みMW (x、y)で重み付けする重み付け手段と、重み
付けした評価値を加算する加算手段と、この重み付けさ
れた加算値を重み合計で除算することにより類似度を算
出する手段とを備えた類似度算出装置。
7. A density gradient direction I in each region of an input image
Between the density gradient direction calculation means for obtaining θ (x, y), the density gradient direction Iθ (x, y) of this input image, and the density gradient direction Mθ (x, y) of the corresponding region of the predetermined model. Is a value f {Iθ (x, y) for evaluating the difference in the concentration gradient direction.
Concentration gradient direction evaluation value calculating means for obtaining −Mθ (x, y)}, weighting means for weighting this evaluation value with the weight M W (x, y) obtained from the predetermined model, and weighted evaluation value And a means for calculating the degree of similarity by dividing the weighted addition value by the total weight.
【請求項8】入力画像の各画素について濃度勾配方向I
θ(x、y)を求め、所定のモデルの対応する画素間で
モデルの濃度勾配方向Mθ(x、y)の差を評価した値
を、所定のモデルより得られる重みMW (x、y)で重
み付けし、加算し、重み合計で除算することによって、
2つの濃淡画像の類似度を算出することを特徴とする類
似度算出方法。
8. A density gradient direction I for each pixel of an input image
theta (x, y) obtains the corresponding model between pixel density gradient direction Mθ of predetermined model (x, y) values obtained by evaluating the difference between the weight M W (x obtained from a predetermined model, y ) By weighting, adding and dividing by the total weight,
A similarity calculation method comprising calculating the similarity between two grayscale images.
【請求項9】前記モデルより得られる重みとして、モデ
ル画像の濃度勾配強度とし、2つの濃淡画像の類似度を
算出することを特徴とする請求項8記載の類似度算出方
法。
9. The similarity calculation method according to claim 8, wherein the weight obtained from the model is the density gradient strength of the model image, and the similarity between the two grayscale images is calculated.
【請求項10】前記評価した値として、濃度勾配方向の
差の余弦とし、2つの濃淡画像の類似度を算出すること
を特徴とする請求項8記載の類似度算出方法。
10. The similarity calculation method according to claim 8, wherein the evaluated value is the cosine of the difference in the density gradient direction, and the similarity between the two grayscale images is calculated.
【請求項11】前記評価した値として、濃度勾配方向の
差が0°を含む所定の範囲内の値であれば1とし、それ
以外の所定の範囲内の値であれば−1とし、それ以外の
所定の範囲内の値であれば0とし、2つの濃淡画像の類
似度を算出することを特徴とする請求項8記載の類似度
算出方法。
11. The evaluated value is set to 1 if the difference in the concentration gradient direction is within a predetermined range including 0 °, and is set to -1 if the value is within a predetermined range other than that. 9. The similarity calculation method according to claim 8, wherein a value within a predetermined range other than is set to 0 and the similarity between two grayscale images is calculated.
【請求項12】モデル画像を記憶するモデル画像記憶手
段と、入力画像を記憶する入力画像記憶手段と、モデル
画像を入力画像内で位置移動させる走査手段と、この走
査過程でモデル画像と、その位置の入力画像との類似度
を算出する請求項1、又は請求項2記載の類似度算出装
置と、算出された類似度の最も高い入力画像の位置を、
入力画像中におけるモデルの位置とする位置決定手段と
を備えた位置検出装置。
12. A model image storage means for storing a model image, an input image storage means for storing an input image, a scanning means for moving the model image within the input image, a model image in this scanning process, and its The similarity calculation device according to claim 1 or 2, which calculates the similarity of the position to the input image, and the position of the input image having the highest calculated similarity,
A position detecting device comprising a position determining means for determining the position of the model in the input image.
【請求項13】複数のモデル画像の各画素における濃度
勾配方向を記憶する濃度勾配方向記憶手段と、前記複数
モデル画像の各画素における濃度勾配強度を記憶する濃
度勾配強度記憶手段と、前記濃度勾配方向から代表濃度
勾配方向を算出する代表濃度勾配方向算出手段と、前記
濃度勾配方向と前記濃度勾配強度から代表濃度勾配強度
を算出する代表濃度勾配強度算出手段を備えた請求項
1、請求項2又は請求項7記載の類似度算出装置。
13. A density gradient direction storage means for storing a density gradient direction in each pixel of a plurality of model images, a density gradient strength storage means for storing a density gradient strength in each pixel of the plurality of model images, and the density gradient. The representative concentration gradient direction calculating means for calculating the representative concentration gradient direction from the direction, and the representative concentration gradient strength calculating means for calculating the representative concentration gradient strength from the concentration gradient direction and the concentration gradient strength. Alternatively, the similarity calculation device according to claim 7.
【請求項14】複数のモデル画像の各画素における濃度
勾配方向を記憶し、前記複数モデル画像の各画素におけ
る濃度勾配強度を記憶し、前記濃度勾配方向から代表濃
度勾配方向を算出し、前記濃度勾配方向と前記濃度勾配
強度から代表濃度勾配強度を算出するようにした請求項
9、請求項10又は請求項11記載の類似度算出方法。
14. A density gradient direction in each pixel of a plurality of model images is stored, a density gradient strength in each pixel of the plurality of model images is stored, a representative density gradient direction is calculated from the density gradient direction, and the density is calculated. The similarity calculation method according to claim 9, 10, or 11, wherein the representative concentration gradient strength is calculated from the gradient direction and the concentration gradient strength.
【請求項15】代表濃度勾配方向として、複数画像の濃
度勾配方向の平均を求めるものである請求項13記載の
類似度算出装置。
15. The similarity calculation apparatus according to claim 13, wherein an average of the plurality of images in the density gradient direction is obtained as the representative density gradient direction.
【請求項16】代表濃度勾配強度として、複数画像の濃
度勾配強度の相加平均を求めるものである請求項13記
載の類似度算出装置。
16. The similarity calculation apparatus according to claim 13, wherein an arithmetic mean of density gradient intensities of a plurality of images is obtained as the representative density gradient intensity.
【請求項17】代表濃度勾配強度として、複数画像の濃
度勾配方向と濃度勾配強度および複数画像の濃度勾配方
向の平均から求めた代表濃度勾配方向から、濃度勾配強
度の代表濃度勾配方向成分の相加平均を求めるものであ
る請求項13記載の類似度算出装置。
17. The representative density gradient strength is calculated from a density gradient direction of a plurality of images, a density gradient strength obtained from an average of the density gradient directions of a plurality of images, and a phase of a component of the representative density gradient direction of the density gradient strength. 14. The similarity calculation device according to claim 13, wherein the arithmetic mean is calculated.
【請求項18】複数画像の濃度勾配方向から、濃度勾配
方向の正弦の平均と余弦の平均を成分とするベクトルの
長さを求め、その値と前記代表濃度勾配強度との積を新
たな代表濃度勾配強度として求める請求項17記載の類
似度算出装置。
18. The length of a vector whose components are the average of sine and the average of cosine in the density gradient direction is calculated from the density gradient directions of a plurality of images, and the product of the value and the representative density gradient strength is newly represented. 18. The similarity calculation device according to claim 17, which is obtained as a density gradient strength.
【請求項19】予め複数の画像の各画素における濃度勾
配方向を求める濃度勾配方向算出手段と、前記複数の画
像の各画素における濃度勾配強度を算出する濃度勾配強
度算出手段と、前記濃度勾配方向から代表濃度勾配方向
を算出する代表濃度勾配方向算出手段と、前記濃度勾配
強度から代表濃度勾配強度を算出する代表濃度勾配強度
算出手段と、を用いてモデルデータを作成し記憶してお
く記憶部と、入力画像の濃度勾配方向と、濃度勾配強度
とを前記モデルデータの対応する各画素の代表濃度勾配
方向と代表濃度勾配強度との間で、代表濃度勾配方向お
よび代表濃度勾配強度の差を評価する値を求める代表濃
度勾配評価値算出手段と、この評価値を加算することに
よって類似度を算出する手段とを備えた類似度算出装
置。
19. A density gradient direction calculation means for obtaining a density gradient direction in each pixel of a plurality of images in advance, a density gradient strength calculation means for calculating a density gradient strength in each pixel of the plurality of images, and the density gradient direction. A storage unit for creating and storing model data using a representative concentration gradient direction calculating means for calculating a representative concentration gradient direction from the above and a representative concentration gradient strength calculating means for calculating a representative concentration gradient strength from the concentration gradient strength. , The density gradient direction of the input image, and the density gradient strength between the representative density gradient direction of each corresponding pixel of the model data and the representative density gradient strength A similarity calculation apparatus comprising: a representative density gradient evaluation value calculation means for obtaining a value to be evaluated; and a means for calculating similarity by adding the evaluation values.
【請求項20】予め複数の画像の各画素における濃度勾
配方向を求める濃度勾配方向算出手段と、前記複数画像
の各画素における濃度勾配強度を算出する濃度勾配強度
算出手段と、この濃度勾配方向から代表濃度勾配方向を
算出する代表濃度勾配方向算出手段と、前記濃度勾配強
度から代表濃度勾配強度を算出する代表濃度勾配強度算
出手段と、を用いてモデルデータを作成し記憶しておく
記憶部と、入力画像の濃度勾配方向と濃度勾配強度と
を、前記モデルデータの対応する各画素の代表濃度勾配
方向と代表濃度勾配強度との間で、代表濃度勾配方向お
よび代表濃度勾配強度の差を評価する値を求める代表濃
度勾配評価値算出手段と、この評価値を加算する加算手
段と、これを画素数で除算することによって類似度を算
出する除算手段とを備えた類似度算出装置。
20. A density gradient direction calculating means for obtaining a density gradient direction in each pixel of a plurality of images in advance, a density gradient strength calculating means for calculating a density gradient strength in each pixel of the plurality of images, and from this density gradient direction A storage unit that creates and stores model data using a representative concentration gradient direction calculation unit that calculates a representative concentration gradient direction and a representative concentration gradient strength calculation unit that calculates a representative concentration gradient strength from the concentration gradient intensity. , The density gradient direction and the density gradient strength of the input image, the difference between the representative density gradient direction and the representative density gradient strength between the representative density gradient direction and the representative density gradient strength of each corresponding pixel of the model data is evaluated. A representative density gradient evaluation value calculation means for obtaining a value, an addition means for adding the evaluation values, and a division means for calculating the similarity by dividing the evaluation value by the number of pixels. For example was the similarity calculation device.
【請求項21】代表濃度勾配方向として、複数画像の濃
度勾配方向の平均を求めるものである請求項19又は請
求項20記載の類似度算出装置。
21. The similarity calculation device according to claim 19, wherein an average of the density gradient directions of a plurality of images is obtained as the representative density gradient direction.
【請求項22】代表濃度勾配強度として、複数画像の濃
度勾配強度の相加平均を求めるものである請求項19又
は請求項20記載の類似度算出装置。
22. The similarity calculation device according to claim 19 or 20, wherein an arithmetic mean of density gradient intensities of a plurality of images is obtained as the representative density gradient intensity.
【請求項23】代表濃度勾配強度として、複数画像の濃
度勾配方向と濃度勾配強度および複数画像の濃度勾配方
向の平均から求めた代表濃度勾配方向から、濃度勾配強
度の代表濃度勾配方向成分の相加平均を求めるものであ
る請求項19又は請求項20記載の類似度算出装置。
23. As the representative density gradient strength, the phase of the representative density gradient direction component of the density gradient strength is calculated from the density gradient direction and the density gradient strength of a plurality of images and the representative density gradient direction obtained from the average of the density gradient directions of the plurality of images. 21. The similarity calculation device according to claim 19 or 20, which calculates an arithmetic mean.
【請求項24】複数画像の濃度勾配方向から、濃度勾配
方向の正弦の平均と余弦の平均を成分とするベクトルの
長さを求め、その値と前記代表濃度勾配強度との積を新
たな代表濃度勾配強度として求める請求項19又は請求
項20記載の類似度算出装置。
24. A length of a vector having an average of sine and an average of cosine in the density gradient direction is obtained from the density gradient directions of a plurality of images, and a product of the value and the representative density gradient strength is newly represented. 21. The similarity calculation device according to claim 19 or 20, which is obtained as the density gradient strength.
JP12027896A 1995-06-08 1996-05-15 Apparatus and method for calculating similarity and position detecting apparatus using the same Expired - Lifetime JP3598651B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP12027896A JP3598651B2 (en) 1995-06-08 1996-05-15 Apparatus and method for calculating similarity and position detecting apparatus using the same
US08/856,598 US6154566A (en) 1996-05-15 1997-05-15 Method and apparatus for determining image similarity and position

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP14169495 1995-06-08
JP7-141694 1995-06-08
JP12027896A JP3598651B2 (en) 1995-06-08 1996-05-15 Apparatus and method for calculating similarity and position detecting apparatus using the same

Publications (2)

Publication Number Publication Date
JPH0954828A true JPH0954828A (en) 1997-02-25
JP3598651B2 JP3598651B2 (en) 2004-12-08

Family

ID=26457888

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12027896A Expired - Lifetime JP3598651B2 (en) 1995-06-08 1996-05-15 Apparatus and method for calculating similarity and position detecting apparatus using the same

Country Status (1)

Country Link
JP (1) JP3598651B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000003311A3 (en) * 1998-07-08 2001-12-20 Siemens Ag Method and device for determining a similarity of measure between a first structure and at least one predetermined second structure
US7239740B1 (en) * 1998-04-07 2007-07-03 Omron Corporation Image processing apparatus and method, medium storing program for image processing, and inspection apparatus
US8422759B2 (en) 2010-03-12 2013-04-16 Omron Corporation Image processing method and image processing device
JP2019070974A (en) * 2017-10-10 2019-05-09 株式会社アクセル Image processing apparatus, image processing method, and image processing program

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7016539B1 (en) 1998-07-13 2006-03-21 Cognex Corporation Method for fast, robust, multi-dimensional pattern recognition
US7190834B2 (en) 2003-07-22 2007-03-13 Cognex Technology And Investment Corporation Methods for finding and characterizing a deformed pattern in an image
US8081820B2 (en) 2003-07-22 2011-12-20 Cognex Technology And Investment Corporation Method for partitioning a pattern into optimized sub-patterns
US8437502B1 (en) 2004-09-25 2013-05-07 Cognex Technology And Investment Corporation General pose refinement and tracking tool
US8103085B1 (en) 2007-09-25 2012-01-24 Cognex Corporation System and method for detecting flaws in objects using machine vision
US9679224B2 (en) 2013-06-28 2017-06-13 Cognex Corporation Semi-supervised method for training multiple pattern recognition and registration tool models

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7239740B1 (en) * 1998-04-07 2007-07-03 Omron Corporation Image processing apparatus and method, medium storing program for image processing, and inspection apparatus
WO2000003311A3 (en) * 1998-07-08 2001-12-20 Siemens Ag Method and device for determining a similarity of measure between a first structure and at least one predetermined second structure
US6868181B1 (en) 1998-07-08 2005-03-15 Siemens Aktiengesellschaft Method and device for determining a similarity of measure between a first structure and at least one predetermined second structure
US8422759B2 (en) 2010-03-12 2013-04-16 Omron Corporation Image processing method and image processing device
JP2019070974A (en) * 2017-10-10 2019-05-09 株式会社アクセル Image processing apparatus, image processing method, and image processing program

Also Published As

Publication number Publication date
JP3598651B2 (en) 2004-12-08

Similar Documents

Publication Publication Date Title
US8340433B2 (en) Image processing apparatus, electronic medium, and image processing method
JPH0954828A (en) Similarity calculation device and method, and position detection device using the same
JP2008158774A (en) Image processing method, image processing apparatus, program, and storage medium
CN112633118A (en) Text information extraction method, equipment and storage medium
JP2014215735A (en) Nail image synthesizing device, nail image synthesizing method, and nail image synthesizing program
JP2008288684A (en) Person detection device and program
JP2018195282A (en) System and method for modifying a model
JP2003178303A (en) Object recognition device
JP2005071344A (en) Image processing method, image processing apparatus, and recording medium recording image processing program
JP5020920B2 (en) Pedestrian detection device and program
KR100292810B1 (en) A Real time face tracking technique using face&#39;s color model and ellipsoid approximation model
JP2003141567A (en) Three-dimensional city model generation device and three-dimensional city model generation method
JPH10124676A (en) Shape tracking method and apparatus
JPH08272973A (en) Image processing for facial feature extraction
JPH0630417A (en) Device for recognizing vehicle and method for recognizing mobile object
JPH10111946A (en) Image tracking device
JP2009025856A (en) Form identification program and form identification device
JP4543675B2 (en) How to recognize characters and figures
JPH1055446A (en) Object recognition device
JP6761786B2 (en) Ceiling map creation method, ceiling map creation device and ceiling map creation program
JP3572832B2 (en) Pattern reader
JP2004158043A (en) Image processing device
JP2005173128A (en) Contour shape extraction device
CN110008918B (en) Method for identifying posture of motorcycle simulator driver
JP3344538B2 (en) Character generator

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040223

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040309

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040510

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040906

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080924

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20080924

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090924

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090924

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100924

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100924

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110924

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110924

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120924

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130924

Year of fee payment: 9

EXPY Cancellation because of completion of term