JP2004302581A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
JP2004302581A
JP2004302581A JP2003091814A JP2003091814A JP2004302581A JP 2004302581 A JP2004302581 A JP 2004302581A JP 2003091814 A JP2003091814 A JP 2003091814A JP 2003091814 A JP2003091814 A JP 2003091814A JP 2004302581 A JP2004302581 A JP 2004302581A
Authority
JP
Japan
Prior art keywords
image
density gradient
pixel
gradient direction
correlation value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003091814A
Other languages
Japanese (ja)
Inventor
Atsuyuki Hirono
淳之 広野
Satoshi Furukawa
聡 古川
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works Ltd
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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP2003091814A priority Critical patent/JP2004302581A/en
Publication of JP2004302581A publication Critical patent/JP2004302581A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To enable accurate pattern matching by using a density gradient direction image even if a flat portion having no density gradient exists in an input gray-scale image. <P>SOLUTION: A noted pixel of which the density gradient intensity ¾G¾ becomes zero is stored as a singular pixel, in a process of generating the direction image from the gray-scale image by a generating means for the density gradient direction image 3. A determining means 5 eliminates a singular pixel from the object of a correlative value calculation in a process of calculating the correlative value between the direction image and a template. For example, pixels of the flat portion having no density gradient such as the cheek and the forehead of a human body H are eliminated as the singular pixels from the object of the correlative value calculation. Therefore, the accurate pattern matching can be executed by using the density gradient direction image, without outputting an error-prone value such as zero and stopping a process as a conventional example even if the flat portion having no density gradient exists in the gray-scale image. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、テンプレートマッチングを利用して入力濃淡画像中における対象物の存否を判定する画像処理方法並びに画像処理装置に関するものである。
【0002】
【従来の技術】
従来より、テンプレートマッチングを利用して入力濃淡画像中における対象物の存否を判定する画像処理方法並びに画像処理装置が様々な分野で利用されている(特許文献1参照)。一般的なテンプレートマッチングにおいては、テンプレートと入力濃淡画像の各画素毎の濃度値I(i,j)、T(i,j)から、下記の式1で示す残差Rや式2で示す相互相関係数C(これらを総称して「相関値」と呼ぶ)を求め、該相関値から両画像の一致度を判定している。
【0003】
【数1】

Figure 2004302581
【0004】
ところで、近年では上述のようなテンプレートマッチングを利用して個人認証を行う方法や装置がセキュリティ分野で用いられている。例えば、入室が許可された人物の顔の濃淡画像(以下、単に「顔画像」と呼ぶ)を予めテンプレートTPとして登録しておき、図20に示すように入室を希望する希望者の顔画像Vを入力し、テンプレートTPと顔画像Vとのパターンマッチングを行って相関値を演算し、その相関値に基づいて当該希望者が入出が許可されている人物と一致するか否かを判定するものである。
【0005】
しかしながら、上述のように濃淡画像で直接テンプレートマッチングを行った場合、例えばテンプレートTPを作成したときの明るさと実際に認証を行うときの明るさとが異なってしまうと、同一人物の顔画像V’であっても濃度値が大きく変化してしまう(図21参照)。すなわち、上述の残差Rを相関値とする場合であれば濃度値I(i,j)が変化することで残差Rの値が全く異なってしまうし、相互相関係数Cを相関値とする場合でも同様である。
【0006】
このように濃淡画像をそのまま用いてテンプレートマッチングを行ってしまうと、テンプレートを作成するための画像を撮像したときと、入力画像を撮像したときとで、局所的なスポット光の照射や照明状況の不均一な変化が顔画像の濃度値に加わって正確なパターンマッチングが行い難くなってしまう。
【0007】
そこで、予め判定対象となる対象物(例えば、入室が許可された人物の顔)を含む濃度勾配方向画像を得て該濃度勾配方向画像から前記対象物の特徴を抽出して作成したテンプレートを保持しておき、判定用の入力濃淡画像を得て該入力濃淡画像から濃度勾配方向画像を作成し、該濃度勾配方向画像と前記テンプレートとの相関値演算を行う画像処理方法及び画像処理装置が提案されている。ここで濃度勾配方向画像は、図22に示すように画像中の注目画素に対して差分フィルタを適用して求めた濃度値の差分が最も大きくなる方向(図22に矢印で示す方向)で与えられるものであり、図22(a)(b)のように明るさが変化して濃度値が変動したとしてもほぼ一定の値となる。濃淡画像から濃度勾配方向画像を求める最も一般的な方法は濃淡に関する微分の方向を求める方法である。すなわち、画素(i,j)における2次元直交座標系のxおよびy方向の微分をdx(i,j)、dy(i,j)とすると、これらは下記の(式2)、(式3)で表される。
【0008】
dx(i,j)=d(i+1,j)−d(i,j) …(式2)
dy(i,j)=d(i,j+1)−d(i,j) …(式3)
このとき、微分の強度(濃度勾配強度)|G(i,j)|および微分の方向(濃度勾配方向)θはそれぞれ下記の(式4)、(式5)で表される。
【0009】
|G(i,j)|={dx(i,j)+dy(i,j)}1/2 …(式4)
θ=tan−1(dy/dx) …(式5)
濃度勾配方向画像は上記濃度勾配方向θを画素値に持つ画像であるから、かかる濃度勾配方向画像を用いてテンプレートマッチングを行えば、テンプレート作成時と実際の判定時とで明るさの変化があってもその影響を受け難くなり、より正確な判定が可能となる。
【0010】
【特許文献1】
特開平8−249466号公報(第3−7頁、第1図)
【0011】
【発明が解決しようとする課題】
ところが、上述の濃度勾配方向画像を利用したテンプレートマッチングにも以下のような問題がある。
【0012】
すなわち、上述のように濃淡画像から濃度勾配方向画像を求める際には一般に濃淡に関する微分を行っているが、例えば人の顔の頬や額のように凹凸の変化が乏しい部位の濃淡画像では(式2)、(式3)で得られる微分値dx、dyが共にゼロとなることがあり、(式5)で定義される濃度勾配方向θの値が数学的に求められなくなる。しかしながら、デジタル画像の画像処理は通常、コンピュータやDSP(デジタル・シグナル・プロセッサ)等のハードウェアに搭載された専用のソフトウェア(プログラム)によって実行されるものであり、かかる画像処理用のプログラムを記述するためのプログラミング言語(例えば、C言語など)には予め多種多様な関数が用意されていて逆正接(tan−1)を求める関数も含まれているが、プログラミング言語の仕様として逆正接の引数が何れもゼロのときに計算不能として処理を中断するものもあれば、特定の値(例えば、「0」)を出力するものもある。
【0013】
ところが、上述のように逆正接の関数において引数が何れもゼロである場合に特定の値を出力する仕様の場合、濃度勾配方向θが本来採り得る値(0度〜359度)と混同されてしまい、パターンマッチングにおける相関値演算において正しい結果が得られなくなる虞がある。例えば、上記特定の値として「0」を出力する場合、0度方向への濃度勾配があるのか、微分値dx,dyが何れもゼロで濃度勾配がなく平坦であるのかの区別ができず、そのままテンプレートマッチングを行うと0度方向の濃度勾配がある部分と、濃度勾配のない部分とが一致すると判断されてしまうことになり、正確なテンプレートマッチングが行えず、異なった形状がテンプレートと一致すると誤判定されてしまう場合がある。また、上述のような場合に計算不能となって処理を中断してしまうと、特に人物の認証には実質的に使用できないことになる。
【0014】
本発明は上記事情に鑑みて為されたものであり、その目的は、入力濃淡画像中に濃度勾配のない平坦な部分が存在しても濃度勾配方向画像を用いて正確なパターンマッチングが行える画像処理方法並びに画像処理装置を提供することにある。
【0015】
【課題を解決するための手段】
請求項1の発明は、上記目的を達成するために、予め判定対象となる対象物を含む濃度勾配方向画像を得て該濃度勾配方向画像から前記対象物の特徴を抽出して作成したテンプレートを保持しておき、判定用の入力濃淡画像を得て該入力濃淡画像から濃度勾配方向画像を作成し、該濃度勾配方向画像と前記テンプレートとの相関値演算を行い、この演算結果から入力濃淡画像中における前記対象物の存否を判定する画像処理方法において、入力濃淡画像から濃度勾配方向画像を作成する過程で、入力濃淡画像中の任意の注目画素とその周囲の1乃至複数の画素に微分フィルタを適用して直交座標系のx方向及びy方向における微分値をそれぞれ求め、前記x方向及びy方向の微分値が何れも略ゼロとなる注目画素を特異画素として記憶しておき、前記濃度勾配方向画像と前記テンプレートとの相関値演算の過程で前記特異画素を相関値演算の対象から除外することを特徴とする。
【0016】
請求項2の発明は、請求項1の発明において、前記濃度勾配方向画像と前記テンプレートとの相関値演算において、両者の差分を求めるとともに該差分のうちで絶対値が小さい方の差分を用いて各画素毎の相関値を演算することを特徴とする。
【0017】
請求項3の発明は、請求項1又は2の発明において、前記濃度勾配方向画像と前記テンプレートとの相関値演算において、前記濃度勾配方向画像の各画素の相関値に対して該相関値に応じた重み付けを行うことを特徴とする。
【0018】
請求項4の発明は、請求項1又は2の発明において、前記濃度勾配方向画像と前記テンプレートとの相関値演算において、前記テンプレートを構成する各画素の位置に応じた重み付けを行うことを特徴とする。
【0019】
請求項5の発明は、請求項1又は2の発明において、前記濃度勾配方向画像と前記テンプレートとの相関値演算において、前記濃度勾配方向画像の各画素の濃度勾配強度に応じた重み付けを行うことを特徴とする。
【0020】
請求項6の発明は、上記目的を達成するために、予め判定対象となる対象物を含む濃度勾配方向画像を得て該濃度勾配方向画像から前記対象物の特徴を抽出して作成したテンプレートを保持する保持手段と、判定用の入力濃淡画像を得て該入力濃淡画像から濃度勾配方向画像を作成する濃度勾配方向画像作成手段と、該濃度勾配方向画像と前記テンプレートとの相関値演算を行い、この演算結果から入力濃淡画像中における前記対象物の存否を判定する判定手段とを備えた画像処理装置において、前記濃度勾配方向画像作成手段は、入力濃淡画像中の任意の注目画素とその周囲の1乃至複数の画素に微分フィルタを適用して直交座標系のx方向及びy方向における微分値をそれぞれ求め、前記x方向及びy方向の微分値が何れも略ゼロとなる注目画素を特異画素として記憶しておき、前記判定手段は、前記特異画素を相関値演算の対象から除外して前記濃度勾配方向画像と前記テンプレートとの相関値演算を行うことを特徴とする。
【0021】
【発明の実施の形態】
(実施形態1)
図1は本発明方法を実施するための画像処理装置を示しており、対象物(例えば、人物H)を含めた画像を撮像する撮像手段1と、撮像手段1で撮像されたアナログの画像信号をデジタル信号に変換するA/D変換手段2と、デジタル信号に変換されたデジタル濃淡画像(以下、入力濃淡画像と呼ぶ)から濃度勾配方向画像を作成する濃度勾配方向画像作成手段3と、予め判定対象となる対象物(例えば、入室が許可されている人物)を含む濃度勾配方向画像を得て該濃度勾配方向画像から前記対象物の特徴を抽出して作成したテンプレートを保持する保持手段4と、濃度勾配方向画像とテンプレートとの相関値演算を行い、この演算結果から入力濃淡画像中における対象物の存否、言い換えれば、撮像された人物Hの顔がテンプレートとして予め登録された入室が許可されている人物の顔に一致するか否かを判定する判定手段5とを備えている。なお、少なくとも濃度勾配方向画像作成手段3、保持手段4並びに判定手段5は、例えば汎用のコンピュータに各手段における処理を実行させるためのソフトウェア(プログラム)を搭載して構成される。
【0022】
本実施形態における濃度勾配方向画像作成手段3は、図2のフローチャートに示す手順で入力濃淡画像から濃度勾配方向画像を作成する。この濃度勾配方向画像の作成に当たっては、図3に示すマスクサイズ3×3のソーベルフィルタを入力濃淡画像に含まれる全ての画素に対して適用して局所空間微分を行い、各画素におけるx方向の微分値dx及びy方向の微分値dyを次式より求める。
【0023】
dx=(c+2f+i)−(a+2d+g)
dy=(g+2h+i)−(a+2b+c)
ただし、a〜iは図4に示すように注目画素とその8近傍の画素の画素値(濃度値)を表す。
【0024】
上述のようにして求めた微分値dx,dyが何れもゼロでなければ、従来技術で説明した(式4)及び(式5)を用いて濃度勾配強度|G|並びに濃度勾配方向θを求める。また、微分値dx,dyが何れもゼロであった場合(濃度勾配強度|G|がゼロとなる場合)、当該注目画素(図4における中心画素)を特異画素とし、入力濃淡画像における特異画素の位置(座標)を記憶する。そして、入力濃淡画像に含まれる全ての画素に対して上述の処理を繰り返せば、入力濃淡画像の各画素の画素値を濃度勾配方向θの値に置き換えた濃度勾配方向画像が得られる。
【0025】
例えば、正四角錐を頂点からみた画像の濃淡画像は図5(a)のように頂点とその近傍の濃度値が大きく、周囲にいくほど濃度値が小さくなるような画像となるが、これを濃度勾配方向画像に変換した画像は図5(b)のように表される。但し、同図に示す濃度勾配方向画像では、図5(c)に示すように濃度勾配方向θが0度のときに最も濃度値が小さく且つ359度のときに最も濃度値が大きくなるようなスケールを用いて各濃度勾配方向θを濃度値に置き換えてある。また、図6(a)に示すような人物Hを含む濃淡画像から得られる濃度勾配方向画像は同図(b)のように表される。そして、同図(c)に示すような人物Hの顔画像をテンプレートTPに設定して保持手段4に保持させておけばよい。ここで、従来技術で説明したように濃度勾配方向は画像の明るさによらずにほぼ一定の値となるから、濃度勾配方向画像を用いてテンプレートマッチングを行えば、テンプレート作成時と実際の判定時とで明るさの変化があってもその影響を受け難くなり、より正確な判定が可能となる。
【0026】
なお、画素の局所空間微分を求める微分フィルタは上述のソーベルフィルタ以外にも種々のものがあり、それらを用いても濃度勾配方向画像を作成することは可能である。例えば、図7に示すように注目画素の8近傍の画素のうちで左右両隣の画素の画素値の差分をdx、上下両隣の画素の画素値の差分をdyとする微分フィルタや、図8に示すように注目画素とその水平方向に隣接する画素との画素値の差分をdx、注目画素とその垂直方向に隣接する画素との画素値の差分をdyとする微分フィルタなどがある。また、本実施形態では直交座標系のx軸を水平方向、y軸を垂直方向としているが、図9や図10に示すように水平方向及び垂直方向に対してそれぞれ所定の角度(例えば45度)だけ傾けてx軸及びy軸を設定してもよく、その場合の微分フィルタは注目画素に対して対角の位置にある画素値の差分、若しくは注目画素とその斜め45度の方向に隣接する画素との画素値の差分をdx,dyとするものである(図9及び図10参照)。
【0027】
そして、判定手段5は図11のフローチャートに示す手順で、上述のようにして作成された濃度勾配方向画像(以下、「入力画像」と呼ぶ)とテンプレートとの相関値演算を行い、対象である人物の顔の一致度を判定する。
【0028】
まず、入力画像の初期位置(例えば、左上隅の位置)にテンプレートをおき、テンプレートの各画素と、これに重なる入力画像(以下、「部分画像」と呼ぶ)の各画素との間で画素値(濃度勾配方向θ)の差分を求めるとともに差分のうちで絶対値が小さい方の差分Aを各画素毎の相関値とする(図12参照)。すなわち、A=(テンプレートの濃度勾配方向)−(入力画像の濃度勾配方向)と定義したとき、A<0ならばA=A+360[度]又はA=−A[度]、A≧0ならばA=A[度]とする処理を行い、その次に、A>180ならばA=360−A[度]、0≦A≦180ならばA=A[度]とする処理を行う。
【0029】
ここで、いま相関値演算の対象となっている部分画像の画素の中に濃度勾配方向画像の作成過程で特異画素であるとして記憶した座標と一致する画素が存在した場合、当該特異画素とこれに対応するテンプレートの画素との間の相関値Aは求めない。また、テンプレートの画素の中に特異画素が存在する場合も同様に相関値Aは求めない。そして、特異画素を除いた全ての画素について相関値Aを求めたら、これらの相関値Aの総和を、テンプレートに含まれる有効な画素数(総画素数から特異画素の個数を差し引いた値)で除算したものを新たに相関値Bと定義する。すなわち、相関値Bを求める相関値演算においては、濃度勾配のない平坦な部分の画素(特異画素)の画素値が演算の対象から除外されることになる。但し、この相関値Bを180で除算した値を1から減算することで正規化しても構わない。
【0030】
上述のようにして求めた相関値Bは一致度が高くなるにつれて値が小さくなり(最小値は0度)、一致度が低くなるにしたがって値が大きくなる(最大値は180度)。したがって、相関値Bが所定のしきい値(例えば、0度から5度の任意の値)以下であれば、部分画像がテンプレートに一致したと判断し、対象の人物Hが予め登録されている人物と一致した旨の判定結果を出力して処理を終了する。また、相関値Bが所定のしきい値よりも大きいために部分画像がテンプレートに一致しなかった場合、その部分画像の端が入力画像における水平方向の端に一致しているか否か、すなわち、垂直方向における同一位置において水平方向の全ての画素についての上記判定処理が完了しているか否かを判断し、一致していなければ、テンプレートを入力画像に対して水平方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う。また、部分画像の端が入力画像における水平方向の端に一致している場合、その部分画像の端が入力画像における垂直方向の端に一致しているか否か、すなわち、水平方向における同一位置において垂直方向の全ての画素についての上記判定処理が完了しているか否かを判断し、一致していなければ、テンプレートを入力画像に対して垂直方向に1画素分だけずらして新たな部分画像との間で上記判定処理を行う。そして、部分画像の端が入力画像における垂直方向の端に一致している場合、入力画像中にテンプレートに一致する画像が存在しなかった、すなわち、対象の人物Hが予め登録されている人物と一致しなかった旨の判定結果を出力して処理を終了する。
【0031】
但し、上述のように入力画像に対してテンプレートを操作しながら逐次一致度の判定を行い、テンプレートに一致する部分画像が存在すると判断された場合にその時点で判定を終了する代わりに、図13のフローチャートに示すように入力画像に対してテンプレートを操作して全ての相関値Bを求めた後にそれら全ての相関値Bのうちで最も一致度が高い相関値をしきい値と比較して一致度を判定するようにすれば、判定精度をさらに高めることができる。
【0032】
上述のように本実施形態では、入力濃淡画像から濃度勾配方向画像を作成する過程で、微分値dx,dyが何れもゼロとなる注目画素を特異画素として記憶しておき、濃度勾配方向画像とテンプレートとの相関値演算の過程で特異画素を相関値演算の対象から除外しているので、例えば、人物Hの頬や額のように濃度勾配のない平坦な部分の画素が特異画素として相関値演算の対象から除外され、入力濃淡画像中に濃度勾配のない平坦な部分が存在しても、従来例のように0などの誤ってしまう値が出力されたり処理が停止するようなことがなく、濃度勾配方向画像を用いて正確なパターンマッチングが行えるようになる。
【0033】
また本実施形態では、入力画像とテンプレートの濃度勾配方向θの差分のうちで絶対値の小さい方の値を両者の相関値として用いているので、単純に両者の差分を求める場合に比較して正確な相関値を求めることができる。すなわち、入力画像とテンプレートの濃度勾配方向θの差分は負になる場合もあれば、劣角又は優角の2通りの値をとる場合があり、差分をそのまま相関値に用いると両者の濃度勾配方向θのずれ量としては同一であるべき相関値が異なった値と判断されてしまうことがあるが、上述のように入力画像とテンプレートの濃度勾配方向θの差分のうちで絶対値の小さい方の値を両者の相関値とすることにより、差分が負になってもあるいは優角又は劣角の何れの場合でもずれ量として同一の値が相関値となるから正確な相関値を求めることができる。
【0034】
(実施形態2)
本実施形態は請求項3の発明に対応するもので、判定手段5にて相関値Aに応じた重み付けを行って相関値Aを相関値A’に変換し、変換後の相関値A’から新たな相関値Bを求めて入力画像の部分画像とテンプレートの一致/不一致を判定する。
【0035】
例えば、図14に示すように相関値Aが10度未満であれば一律に相関値A’を0度とし、相関値Aが90度以上であれば一律に相関値A’を180度とし、相関値Aが10度〜90度の範囲ではA’=2.25×A−22.5の一次関数により相関値Aを相関値A’に変換するような重み付けや、図15に示すように10度〜90度の範囲では相関値Aの値をそのまま相関値A’とするような重み付けを行う。つまり、部分画像とテンプレートの濃度勾配方向の差分が10度未満であれば何らかのノイズによる誤差が生じていると考えられるから、10度未満の相関値Aを0度に変換してテンプレートの濃度勾配方向と一致していると判断し、上記差分が90度以上であればテンプレートの画像とは全く異なると考えられるから、90度以上の相関値Aを180度に変換してテンプレートの濃度勾配方向と一致していないと判断する。そして、10度以上90度未満の範囲では相関値Aの値をそのまま使用するか、あるいは上記一次関数により相関値Aを相関値A’に変換して上記差分による相関値A’の変化を際だたせることによって、実施形態1に比較して判定処理における判定精度が向上できるものである。
【0036】
あるいは、図16に示すように相関値Aが0度〜10度の範囲内において、ノイズによる誤差を考慮しテンプレートの濃度勾配方向と一致していると判断して一律に0度に変換するのではなく、相関値Aの値を5分の1に減じた値を相関値A’とするようにしても構わない。
【0037】
(実施形態3)
本実施形態は請求項4の発明に対応するもので、判定手段5にてテンプレートを構成する各画素の位置に応じた重み付けを行って相関値Aを相関値A’に変換し、変換後の相関値A’から新たな相関値Bを求めて入力画像の部分画像とテンプレートの一致/不一致を判定する。
【0038】
つまり、テンプレートを構成する画素の中で特に形状が他に比べて特徴的な部分の画素はパターンマッチングにおいて重要な部分であるから、形状があまり特徴的でない部分の画素に比較して重みを大きくすることにより、相関値A’から求まる新たな相関値Bに基づく一致/不一致の判定精度が、実施形態1に比較して向上できることになる。例えば、図17に示すような顔画像のテンプレートTPがあった場合に、目の部分TP1,TP2や口の部分TP3が個人の特徴を表していることから、これらの部分TP1〜TP3に含まれる画素の相関値Aに「2」を乗じて相関値A’に変換し、上記部分TP1〜TP3を除く部分に含まれる画素の相関値Aには「1」を乗じて相関値A’に変換すればよい。
【0039】
上述のように判定手段5にてテンプレートを構成する各画素の位置に応じた重み付けを行って相関値Aを相関値A’に変換し、変換後の相関値A’から新たな相関値Bを求めて入力画像の部分画像とテンプレートの一致/不一致を判定することによって判定精度の向上が図れるものである。
【0040】
(実施形態4)
本実施形態は請求項5の発明に対応するもので、判定手段5にて濃度勾配方向画像の各画素の濃度勾配強度|G|に応じた重み付けを行って相関値Aを相関値A’に変換し、変換後の相関値A’から新たな相関値Bを求めて入力画像の部分画像とテンプレートの一致/不一致を判定する。
【0041】
例えば、濃度勾配強度|G|が相対的に大きい画素はエッジ等の特徴的な部分であると考えられるから重みを大きくし、反対に濃度勾配強度|G|が相対的に小さい画素は平坦部等の特徴的でない部分であると考えられるから重みを小さくする。具体的には、図18に示すようにテンプレートを構成する画素のうちで濃度勾配強度|G|が10未満の画素に対する相関値Aには重み係数「0」を乗じる、つまり、その画素を相関値演算から除外し、濃度勾配強度|G|が10以上の画素に対する相関値Aには重み係数「1」を乗じるようにすればよい。あるいは、濃度勾配強度|G|が10未満の画素の相関値Aに対する重み係数を10分の1にしても構わない。さらに、図19に示すように濃度勾配強度|G|が10未満の画素の相関値Aに対する重み係数を「0」、濃度勾配強度|G|が10以上60未満の画素の相関値Aに対する重み係数を「1」、濃度勾配強度|G|が60以上の画素の相関値Aに対する重み係数を「2」としても構わない。
【0042】
上述のように判定手段5にて濃度勾配方向画像の各画素の濃度勾配強度|G|に応じた重み付けを行って相関値Aを相関値A’に変換し、変換後の相関値A’から新たな相関値Bを求めて入力画像の部分画像とテンプレートの一致/不一致を判定することによって判定精度の向上が図れるものである。なお、濃度勾配強度に応じた重み付けは、入力画像の濃度勾配強度とテンプレートの濃度勾配強度の両方、あるいは何れか一方の濃度勾配強度を用いて決定すればよい。
【0043】
【発明の効果】
請求項1の発明は、予め判定対象となる対象物を含む濃度勾配方向画像を得て該濃度勾配方向画像から前記対象物の特徴を抽出して作成したテンプレートを保持しておき、判定用の入力濃淡画像を得て該入力濃淡画像から濃度勾配方向画像を作成し、該濃度勾配方向画像と前記テンプレートとの相関値演算を行い、この演算結果から入力濃淡画像中における前記対象物の存否を判定する画像処理方法において、入力濃淡画像から濃度勾配方向画像を作成する過程で、入力濃淡画像中の任意の注目画素とその周囲の1乃至複数の画素に微分フィルタを適用して直交座標系のx方向及びy方向における微分値をそれぞれ求め、前記x方向及びy方向の微分値が何れも略ゼロとなる注目画素を特異画素として記憶しておき、前記濃度勾配方向画像と前記テンプレートとの相関値演算の過程で前記特異画素を相関値演算の対象から除外することを特徴とし、x方向及びy方向の微分値が何れも略ゼロとなる平坦な部分の画素を特異画素として相関値演算の対象から除外しているため、入力濃淡画像中に濃度勾配のない平坦な部分が存在しても濃度勾配方向画像を用いて正確なパターンマッチングが行える画像処理方法が提供可能となる。
【0044】
請求項2の発明は、請求項1の発明において、前記濃度勾配方向画像と前記テンプレートとの相関値演算において、両者の差分を求めるとともに該差分のうちで絶対値が小さい方の差分を用いて各画素毎の相関値を演算することを特徴とし、単純に差分を求める場合に比較して正確な相関値を求めることができる。
【0045】
請求項3の発明は、請求項1又は2の発明において、前記濃度勾配方向画像と前記テンプレートとの相関値演算において、前記濃度勾配方向画像の各画素の相関値に対して該相関値に応じた重み付けを行うことを特徴とし、入力濃淡画像とテンプレートとの一致度が高い画素については一致度がさらに高くなるような相関値とし、入力濃淡画像とテンプレートとの一致度が低い画素については一致度がさらに低くなるような相関値とすることで対象物の存否判定の精度を向上することができる。
【0046】
請求項4の発明は、請求項1又は2の発明において、前記濃度勾配方向画像と前記テンプレートとの相関値演算において、前記テンプレートを構成する各画素の位置に応じた重み付けを行うことを特徴とし、例えば、テンプレートの中で特に他と比べて特徴的な形状を有する部分を構成する画素位置の重みを相対的に増加させることで対象物の存否判定の精度を向上することができる。
【0047】
請求項5の発明は、請求項1又は2の発明において、前記濃度勾配方向画像と前記テンプレートとの相関値演算において、前記濃度勾配方向画像の各画素の濃度勾配強度に応じた重み付けを行うことを特徴とし、例えば、濃度勾配強度が相対的に大きい画素はエッジ等の特徴的な部分であると考えられるから重みを大きくし、反対に濃度勾配強度が相対的に小さい画素は平坦部等の特徴的でない部分であると考えられるから重みを小さくすることによって対象物の存否判定の精度を向上することができる。
【0048】
請求項6の発明は、予め判定対象となる対象物を含む濃度勾配方向画像を得て該濃度勾配方向画像から前記対象物の特徴を抽出して作成したテンプレートを保持する保持手段と、判定用の入力濃淡画像を得て該入力濃淡画像から濃度勾配方向画像を作成する濃度勾配方向画像作成手段と、該濃度勾配方向画像と前記テンプレートとの相関値演算を行い、この演算結果から入力濃淡画像中における前記対象物の存否を判定する判定手段とを備えた画像処理装置において、前記濃度勾配方向画像作成手段は、入力濃淡画像中の任意の注目画素とその周囲の1乃至複数の画素に微分フィルタを適用して直交座標系のx方向及びy方向における微分値をそれぞれ求め、前記x方向及びy方向の微分値が何れも略ゼロとなる注目画素を特異画素として記憶しておき、前記判定手段は、前記特異画素を相関値演算の対象から除外して前記濃度勾配方向画像と前記テンプレートとの相関値演算を行うことを特徴とし、判定手段がx方向及びy方向の微分値が何れも略ゼロとなる平坦な部分の画素を特異画素として相関値演算の対象から除外しているため、入力濃淡画像中に濃度勾配のない平坦な部分が存在しても濃度勾配方向画像を用いて正確なパターンマッチングが行える画像処理装置が提供可能となる。
【図面の簡単な説明】
【図1】実施形態1の画像処理装置を示すブロック図である。
【図2】同上のソーベルフィルタを用いて濃度勾配方向画像の作成方法を説明するためのフローチャートである。
【図3】同上のソーベルフィルタを用いて濃度勾配方向画像の作成方法を説明する説明図である。
【図4】同上のソーベルフィルタを用いて濃度勾配方向画像の作成方法を説明する説明図である。
【図5】(a)は濃淡画像、(b)は濃度勾配方向画像、(c)は濃度勾配方向画像を濃度値で表す場合のスケールを示す図である。
【図6】濃度勾配方向画像を用いたパターンマッチングの説明図である。
【図7】同上の他の微分フィルタを示す図である。
【図8】同上のさらに他の微分フィルタを示す図である。
【図9】同上の濃度勾配方向画像の作成方法を説明する説明図である。
【図10】同上の濃度勾配方向画像の作成方法を説明する説明図である。
【図11】同上の相関値演算処理を説明するためのフローチャートである。
【図12】同上の相関値演算処理を説明するための説明図である。
【図13】同上の他の相関値演算処理を説明するためのフローチャートである。
【図14】実施形態2における相関値の重み付けを説明するための説明図である。
【図15】同上における相関値の重み付けの他の例を説明するための説明図である。
【図16】同上における相関値の重み付けのさらに他の例を説明するための説明図である。
【図17】実施形態3におけるテンプレートを示す図である。
【図18】実施形態4における相関値の重み付けを説明するための説明図である。
【図19】同上における相関値の重み付けの他の例を説明するための説明図である。
【図20】従来のパターンマッチングを説明するための説明図である。
【図21】従来のパターンマッチングを説明するための説明図である。
【図22】濃度勾配方向画像を説明するための説明図である。
【符号の説明】
1 撮像手段
2 A/D変換手段
3 濃度勾配方向画像作成手段
4 保持手段
5 判定手段[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing method and an image processing apparatus for determining the presence or absence of an object in an input grayscale image using template matching.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, an image processing method and an image processing apparatus for determining the presence or absence of an object in an input grayscale image using template matching have been used in various fields (see Patent Document 1). In general template matching, a residual R represented by the following equation 1 and a mutual error represented by the following equation 2 are obtained from the density values I (i, j) and T (i, j) of each pixel of the template and the input grayscale image. The correlation coefficient C (collectively referred to as “correlation value”) is obtained, and the degree of coincidence between the two images is determined from the correlation value.
[0003]
(Equation 1)
Figure 2004302581
[0004]
By the way, in recent years, methods and apparatuses for performing personal authentication using the above-described template matching have been used in the security field. For example, a gray-scale image (hereinafter simply referred to as a “face image”) of the face of a person who is permitted to enter the room is registered in advance as a template TP, and the face image V of the applicant who desires to enter the room is registered as shown in FIG. And calculates a correlation value by performing pattern matching between the template TP and the face image V, and determines whether or not the applicant matches a person who is permitted to enter and exit based on the correlation value. It is.
[0005]
However, when the template matching is directly performed on the grayscale image as described above, for example, if the brightness at the time of creating the template TP and the brightness at the time of actual authentication are different, the face image V ′ of the same person is used. Even if there is, the density value greatly changes (see FIG. 21). That is, if the above-described residual R is used as a correlation value, the density value I (i, j) changes, so that the value of the residual R is completely different. The same applies to the case where
[0006]
If the template matching is performed using the grayscale image as it is in this way, the local spotlight irradiation and the lighting condition may differ between when the image for creating the template is captured and when the input image is captured. The non-uniform change adds to the density value of the face image, making it difficult to perform accurate pattern matching.
[0007]
Therefore, a template created by obtaining a density gradient direction image including an object to be determined in advance (for example, the face of a person permitted to enter a room) and extracting the features of the object from the density gradient direction image is stored. In addition, an image processing method and an image processing apparatus that obtain an input grayscale image for determination, create a density gradient direction image from the input grayscale image, and calculate a correlation value between the density gradient direction image and the template are proposed. Have been. Here, the density gradient direction image is given in a direction (direction indicated by an arrow in FIG. 22) in which the difference between the density values obtained by applying the difference filter to the target pixel in the image is the largest as shown in FIG. The density value is substantially constant even when the brightness changes and the density value changes as shown in FIGS. The most general method of obtaining a density gradient direction image from a grayscale image is a method of obtaining the direction of differentiation regarding grayscale. That is, assuming that the derivatives of the pixel (i, j) in the x and y directions of the two-dimensional orthogonal coordinate system are dx (i, j) and dy (i, j), these are expressed by the following (Equation 2) and (Equation 3). ).
[0008]
dx (i, j) = d (i + 1, j) -d (i, j) (Equation 2)
dy (i, j) = d (i, j + 1) -d (i, j) (formula 3)
At this time, the differential intensity (density gradient intensity) | G (i, j) | and the differential direction (density gradient direction) θ are expressed by the following (Equation 4) and (Equation 5), respectively.
[0009]
| G (i, j) | = {dx 2 (I, j) + dy 2 (I, j)} 1/2 … (Equation 4)
θ = tan -1 (Dy / dx) (Equation 5)
Since the density gradient direction image is an image having the above-mentioned density gradient direction θ as a pixel value, if template matching is performed using such a density gradient direction image, there is a change in brightness between the time of template creation and the time of actual determination. However, the influence is less likely to occur, and more accurate judgment can be made.
[0010]
[Patent Document 1]
JP-A-8-249466 (page 3-7, FIG. 1)
[0011]
[Problems to be solved by the invention]
However, template matching using the above-described density gradient direction image also has the following problems.
[0012]
That is, when the density gradient direction image is obtained from the grayscale image as described above, differentiation regarding the grayscale is generally performed. For example, in a grayscale image of a portion where unevenness is poorly changed such as a cheek or a forehead of a human face, ( In some cases, the differential values dx and dy obtained by Expressions (2) and (3) become zero, and the value of the concentration gradient direction θ defined by (Expression 5) cannot be mathematically obtained. However, image processing of a digital image is usually executed by dedicated software (program) mounted on hardware such as a computer or a DSP (digital signal processor), and a program for such image processing is described. A variety of functions are prepared in advance in a programming language (for example, C language or the like) for performing the inverse tangent (tan). -1 ) Is included, but there are some programming language specifications in which the calculation is not possible when all arc tangent arguments are zero and the processing is interrupted, or a specific value (for example, “0”) is set. Some output.
[0013]
However, as described above, in the arc tangent function, in the case of a specification that outputs a specific value when all the arguments are zero, the density gradient direction θ is confused with a value that can be originally taken (0 to 359 degrees). As a result, a correct result may not be obtained in the correlation value calculation in the pattern matching. For example, when "0" is output as the specific value, it is not possible to distinguish whether there is a density gradient in the 0 degree direction or whether the differential values dx and dy are both zero and have no density gradient and are flat. If template matching is performed as it is, a part having a density gradient in the 0 degree direction and a part having no density gradient will be determined to match, and accurate template matching cannot be performed, and if a different shape matches the template. An erroneous determination may be made. Further, in the case described above, if the calculation becomes impossible and the process is interrupted, it cannot be practically used especially for the authentication of a person.
[0014]
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an image in which accurate pattern matching can be performed using a density gradient direction image even when a flat portion having no density gradient exists in an input grayscale image. An object of the present invention is to provide a processing method and an image processing device.
[0015]
[Means for Solving the Problems]
In order to achieve the above object, a first aspect of the present invention provides a template created by obtaining a density gradient direction image including an object to be determined in advance and extracting features of the object from the density gradient direction image. An input grayscale image for determination is obtained, a density gradient direction image is created from the input grayscale image, a correlation value between the density gradient direction image and the template is calculated, and an input grayscale image is calculated from the calculation result. In the image processing method for determining the presence or absence of an object in an image, in a process of creating a density gradient direction image from an input grayscale image, a differential filter is applied to an arbitrary pixel of interest in the input grayscale image and one or more pixels around the pixel of interest. Is applied to obtain the differential values in the x direction and the y direction of the rectangular coordinate system, and the pixel of interest in which the differential values in the x direction and the y direction are both substantially zero is stored as a singular pixel. , Characterized in that it excludes the specific pixel in the course of calculating correlation values between the density gradient direction image and the template from the target of the correlation value calculation.
[0016]
According to a second aspect of the present invention, in the first aspect of the present invention, in calculating a correlation value between the density gradient direction image and the template, a difference between the two is obtained and a difference having a smaller absolute value among the differences is used. It is characterized by calculating a correlation value for each pixel.
[0017]
According to a third aspect of the present invention, in the first or second aspect of the present invention, in calculating the correlation value between the density gradient direction image and the template, the correlation value of each pixel of the density gradient direction image is determined according to the correlation value. Weighting is performed.
[0018]
According to a fourth aspect of the present invention, in the first or second aspect of the invention, in the calculation of the correlation value between the density gradient direction image and the template, weighting is performed according to the position of each pixel constituting the template. I do.
[0019]
According to a fifth aspect of the present invention, in the first or second aspect of the invention, in the calculation of the correlation value between the density gradient direction image and the template, weighting is performed according to the density gradient intensity of each pixel of the density gradient direction image. It is characterized by.
[0020]
According to a sixth aspect of the present invention, in order to achieve the above object, a template created by previously obtaining a density gradient direction image including a target object to be determined and extracting features of the target object from the density gradient direction image is provided. Holding means for holding, a density gradient direction image generating means for obtaining an input density image for determination and generating a density gradient direction image from the input density image, and calculating a correlation value between the density gradient direction image and the template A determination means for determining the presence or absence of the object in the input grayscale image from the calculation result, wherein the density gradient direction image creating means includes: A differential filter is applied to one or a plurality of pixels to obtain differential values in the x direction and the y direction of the rectangular coordinate system, and the differential values in the x direction and the y direction become substantially zero. Stores the eye pixel as a specific pixel, the determination means is characterized in that by excluding the specific pixel from the object of correlation value calculating a correlation value calculation between the density gradient direction image and the template.
[0021]
BEST MODE FOR CARRYING OUT THE INVENTION
(Embodiment 1)
FIG. 1 shows an image processing apparatus for carrying out the method of the present invention. The image processing device 1 captures an image including an object (for example, a person H), and an analog image signal captured by the image capturing device 1. A / D conversion means 2 for converting an image into a digital signal, density gradient direction image generating means 3 for generating a density gradient direction image from a digital grayscale image (hereinafter referred to as an input grayscale image) converted to a digital signal, Holding means 4 for obtaining a density gradient direction image including an object to be determined (for example, a person who is permitted to enter the room) and holding a template created by extracting features of the object from the density gradient direction image And a correlation value calculation between the density gradient direction image and the template. Based on the calculation result, the presence or absence of the target in the input grayscale image, in other words, the face of the captured person H is used as the template. And a determination unit 5 whether entry registered in advance is equal to the face of the person is allowed. Note that at least the density gradient direction image creating means 3, the holding means 4, and the determining means 5 are configured by, for example, installing a software (program) for causing a general-purpose computer to execute processing in each means.
[0022]
The density gradient direction image creating means 3 in the present embodiment creates a density gradient direction image from an input grayscale image according to the procedure shown in the flowchart of FIG. In creating the density gradient direction image, a Sobel filter having a mask size of 3 × 3 shown in FIG. 3 is applied to all pixels included in the input grayscale image to perform local spatial differentiation, and the x direction in each pixel is obtained. The differential value dx and the differential value dy in the y direction are obtained by the following equations.
[0023]
dx = (c + 2f + i)-(a + 2d + g)
dy = (g + 2h + i)-(a + 2b + c)
Here, a to i represent the pixel values (density values) of the target pixel and its eight neighboring pixels as shown in FIG.
[0024]
If the differential values dx and dy obtained as described above are not zero, the density gradient strength | G | and the density gradient direction θ are obtained using (Equation 4) and (Equation 5) described in the related art. . When the differential values dx and dy are both zero (when the density gradient intensity | G | is zero), the pixel of interest (the center pixel in FIG. 4) is defined as a unique pixel, and the unique pixel in the input grayscale image is determined. Is stored (coordinates). Then, if the above-described processing is repeated for all the pixels included in the input grayscale image, a density gradient direction image in which the pixel values of each pixel of the input grayscale image are replaced with the value of the density gradient direction θ is obtained.
[0025]
For example, as shown in FIG. 5A, a gray-scale image of an image obtained by viewing a regular square pyramid from the vertex is an image in which the density value at the vertex and the vicinity thereof is large and the density value becomes smaller toward the periphery. The image converted into the gradient direction image is represented as shown in FIG. However, in the density gradient direction image shown in FIG. 5, as shown in FIG. 5C, the density value is the smallest when the density gradient direction θ is 0 degree, and becomes the largest when the density gradient direction θ is 359 degrees. Each density gradient direction θ is replaced with a density value using a scale. A density gradient direction image obtained from a grayscale image including a person H as shown in FIG. 6A is represented as shown in FIG. Then, a face image of the person H as shown in FIG. 9C may be set in the template TP and held in the holding unit 4. Here, as described in the related art, the density gradient direction has a substantially constant value irrespective of the brightness of the image. Therefore, if template matching is performed using the density gradient direction image, it is possible to determine whether the template is created or not. Even if the brightness changes from time to time, it is less likely to be affected by the change, and more accurate determination can be made.
[0026]
Note that there are various types of differential filters other than the above-described Sobel filter for obtaining the local spatial derivative of a pixel, and it is possible to create a density gradient direction image using these filters. For example, as shown in FIG. 7, a differential filter in which the difference between the pixel values of the right and left neighboring pixels among the eight neighboring pixels of the target pixel is dx and the difference between the pixel values of the upper and lower neighboring pixels is dy, and FIG. As shown, there is a differential filter or the like in which the difference between the pixel value of a target pixel and a pixel adjacent in the horizontal direction is dx, and the difference between the pixel value of the target pixel and a pixel adjacent in the vertical direction is dy. In the present embodiment, the x-axis of the rectangular coordinate system is the horizontal direction, and the y-axis is the vertical direction. However, as shown in FIGS. ), The x-axis and the y-axis may be set. In this case, the differential filter is configured to calculate the difference between pixel values at diagonal positions with respect to the pixel of interest or the pixel of interest adjacent to the pixel of interest at an angle of 45 degrees. The difference between the pixel value and the pixel to be changed is dx and dy (see FIGS. 9 and 10).
[0027]
Then, the determination means 5 calculates the correlation value between the density gradient direction image (hereinafter, referred to as “input image”) created as described above and the template in the procedure shown in the flowchart of FIG. The degree of coincidence of the person's face is determined.
[0028]
First, a template is placed at an initial position of an input image (for example, a position at an upper left corner), and a pixel value is set between each pixel of the template and each pixel of an input image (hereinafter, referred to as a “partial image”) overlapping the template. The difference in the (density gradient direction θ) is obtained, and the difference A having the smaller absolute value among the differences is set as the correlation value for each pixel (see FIG. 12). That is, when A = (density gradient direction of template) − (density gradient direction of input image), A = A + 360 [degrees] or A = −A [degrees] if A <0, and A = −A [degrees] if A ≧ 0 The processing for setting A = A [degree] is performed, and then the processing for setting A = 360-A [degree] when A> 180 and the processing for setting A = A [degree] when 0 ≦ A ≦ 180 is performed.
[0029]
Here, if there is a pixel that coincides with the coordinates stored as a unique pixel in the process of creating the density gradient direction image, among the pixels of the partial image that is now being subjected to the correlation value calculation, Is not calculated. Similarly, the correlation value A is not obtained even when a unique pixel exists in the template pixels. Then, when the correlation values A are obtained for all the pixels except for the singular pixels, the sum of the correlation values A is calculated by the number of effective pixels (the value obtained by subtracting the number of singular pixels from the total number of pixels) included in the template. The result of the division is newly defined as a correlation value B. That is, in the correlation value calculation for obtaining the correlation value B, the pixel value of a pixel (singular pixel) in a flat portion without a density gradient is excluded from the calculation target. However, the correlation value B may be normalized by subtracting a value obtained by dividing 180 by 1 from 1.
[0030]
The correlation value B obtained as described above decreases as the degree of coincidence increases (the minimum value is 0 degree), and increases as the degree of coincidence decreases (the maximum value is 180 degrees). Therefore, if the correlation value B is equal to or less than a predetermined threshold value (for example, an arbitrary value of 0 to 5 degrees), it is determined that the partial image matches the template, and the target person H is registered in advance. The result of the determination that the image matches the person is output, and the process ends. When the partial image does not match the template because the correlation value B is larger than the predetermined threshold, whether the edge of the partial image matches the horizontal edge in the input image, that is, It is determined whether or not the above-described determination processing has been completed for all pixels in the horizontal direction at the same position in the vertical direction. If they do not match, the template is shifted by one pixel in the horizontal direction with respect to the input image. The above determination process is performed with a new partial image. Further, when the end of the partial image coincides with the horizontal end of the input image, whether the end of the partial image coincides with the vertical end of the input image, that is, at the same position in the horizontal direction It is determined whether or not the above determination processing has been completed for all pixels in the vertical direction. If they do not match, the template is shifted by one pixel in the vertical direction with respect to the input image and a new partial image is obtained. The above determination process is performed between the two. When the edge of the partial image coincides with the edge in the vertical direction of the input image, there is no image matching the template in the input image, that is, the target person H corresponds to the person registered in advance. A determination result indicating that they do not match is output, and the process ends.
[0031]
However, as described above, the degree of coincidence is sequentially determined while operating the template on the input image, and when it is determined that there is a partial image that matches the template, instead of ending the determination at that point, FIG. As shown in the flowchart of FIG. 7, the template is operated on the input image to obtain all the correlation values B, and then the correlation value having the highest degree of coincidence among all the correlation values B is compared with the threshold value to obtain a match. If the degree is determined, the determination accuracy can be further improved.
[0032]
As described above, in the present embodiment, in the process of creating the density gradient direction image from the input grayscale image, the pixel of interest in which both the differential values dx and dy are zero is stored as the unique pixel, and the density gradient direction image is stored. In the process of calculating the correlation value with the template, the singular pixels are excluded from the target of the correlation value calculation. Even if there is a flat part without a density gradient in the input grayscale image that is excluded from the calculation target, an erroneous value such as 0 is not output or the processing is not stopped unlike the conventional example. , Accurate pattern matching can be performed using the density gradient direction image.
[0033]
In the present embodiment, the smaller value of the absolute value among the differences in the density gradient direction θ between the input image and the template is used as the correlation value between the two. An accurate correlation value can be obtained. In other words, the difference between the density gradient direction θ between the input image and the template may be negative, or it may take two values, that is, an inferior angle or an excellent angle. As the shift amount in the direction θ, the correlation value that should be the same may be determined to be a different value, but as described above, the smaller absolute value of the difference between the density gradient direction θ of the input image and the template is used. Is used as the correlation value between the two, even if the difference becomes negative or the angle of refraction or the angle of refraction is the same, the same value will be the correlation value as the shift amount, so that an accurate correlation value can be obtained. it can.
[0034]
(Embodiment 2)
This embodiment corresponds to the third aspect of the present invention, in which the determination unit 5 converts the correlation value A into a correlation value A ′ by performing weighting according to the correlation value A, and calculates the correlation value A ′ from the converted correlation value A ′. A new correlation value B is obtained to determine whether the partial image of the input image matches the template.
[0035]
For example, as shown in FIG. 14, if the correlation value A is less than 10 degrees, the correlation value A 'is uniformly set to 0 degrees, and if the correlation value A is 90 degrees or more, the correlation value A' is uniformly set to 180 degrees. When the correlation value A is in the range of 10 degrees to 90 degrees, weighting such that the correlation value A is converted to a correlation value A ′ by a linear function of A ′ = 2.25 × A−22.5, or as shown in FIG. In the range of 10 degrees to 90 degrees, weighting is performed so that the value of the correlation value A is directly used as the correlation value A '. That is, if the difference between the partial image and the template in the density gradient direction is less than 10 degrees, it is considered that an error due to some noise has occurred. Therefore, the correlation value A of less than 10 degrees is converted to 0 degree and the density gradient of the template is If the difference is 90 degrees or more, the image is considered to be completely different from the image of the template. Therefore, the correlation value A of 90 degrees or more is converted into 180 degrees and the density gradient direction of the template is converted. It is determined that they do not match. In the range of 10 degrees or more and less than 90 degrees, the value of the correlation value A is used as it is, or the correlation value A is converted into the correlation value A 'by the linear function, and the change of the correlation value A' due to the difference is highlighted. By doing so, the determination accuracy in the determination processing can be improved compared to the first embodiment.
[0036]
Alternatively, as shown in FIG. 16, when the correlation value A is within the range of 0 to 10 degrees, it is determined that the correlation value A coincides with the density gradient direction of the template in consideration of an error due to noise, and is uniformly converted to 0 degree. Instead, a value obtained by reducing the value of the correlation value A to one-fifth may be used as the correlation value A ′.
[0037]
(Embodiment 3)
This embodiment corresponds to the fourth aspect of the present invention, in which the determining unit 5 converts the correlation value A into a correlation value A ′ by performing weighting according to the position of each pixel constituting the template, A new correlation value B is obtained from the correlation value A 'to determine whether the partial image of the input image matches the template.
[0038]
In other words, among the pixels constituting the template, the pixels of the part whose shape is particularly characteristic compared to the others are important parts in the pattern matching, so that the weight is larger than the pixel of the part whose shape is not very characteristic. By doing so, the accuracy of the match / mismatch determination based on the new correlation value B obtained from the correlation value A ′ can be improved compared to the first embodiment. For example, when there is a face image template TP as shown in FIG. 17, since the eye portions TP1 and TP2 and the mouth portion TP3 represent individual characteristics, they are included in these portions TP1 to TP3. The correlation value A of the pixel is converted to a correlation value A ′ by multiplying the correlation value A by “2”, and the correlation value A of the pixel included in the portion excluding the portions TP1 to TP3 is converted to the correlation value A ′ by multiplication by “1”. do it.
[0039]
As described above, the determining unit 5 converts the correlation value A into a correlation value A ′ by performing weighting according to the position of each pixel constituting the template, and converts a new correlation value B from the converted correlation value A ′. By determining whether the partial image of the input image and the template match / mismatch, the determination accuracy can be improved.
[0040]
(Embodiment 4)
This embodiment corresponds to the fifth aspect of the present invention, in which the determination means 5 performs weighting in accordance with the density gradient intensity | G | of each pixel of the density gradient direction image to convert the correlation value A into a correlation value A '. After the conversion, a new correlation value B is obtained from the converted correlation value A ′ to determine the match / mismatch between the partial image of the input image and the template.
[0041]
For example, a pixel having a relatively large density gradient intensity | G | is considered to be a characteristic portion such as an edge, so that the weight is increased. Conversely, a pixel having a relatively small density gradient intensity | G | Is considered to be a non-characteristic part such as, and the weight is reduced. Specifically, as shown in FIG. 18, among the pixels constituting the template, a correlation value A for a pixel having a density gradient intensity | G | of less than 10 is multiplied by a weighting factor “0”, that is, the pixel is correlated. The correlation value A for a pixel having a density gradient strength | G | of 10 or more may be multiplied by a weighting factor “1”, excluding the value calculation. Alternatively, the weight coefficient for the correlation value A of a pixel having a density gradient intensity | G | less than 10 may be set to 1/10. Further, as shown in FIG. 19, the weighting coefficient for the correlation value A of the pixel whose density gradient intensity | G | is less than 10 is “0”, and the weight for the correlation value A of the pixel whose density gradient intensity | G | The coefficient may be “1”, and the weight coefficient for the correlation value A of the pixel whose density gradient intensity | G | is 60 or more may be “2”.
[0042]
As described above, the determining unit 5 converts the correlation value A into a correlation value A ′ by performing weighting according to the density gradient intensity | G | of each pixel of the density gradient direction image, and calculates the correlation value A ′ from the converted correlation value A ′. By determining a new correlation value B and determining whether or not the partial image of the input image matches the template, the determination accuracy can be improved. The weighting according to the density gradient intensity may be determined using both the density gradient intensity of the input image and the template or the density gradient intensity of the template.
[0043]
【The invention's effect】
The invention according to claim 1 obtains a density gradient direction image including a target object to be determined in advance and holds a template created by extracting features of the target object from the density gradient direction image, and stores the template for determination. An input grayscale image is obtained, a density gradient direction image is created from the input grayscale image, a correlation value calculation between the density gradient direction image and the template is performed, and the presence or absence of the target in the input grayscale image is determined from the calculation result. In the image processing method for determining, in a process of creating a density gradient direction image from an input grayscale image, a differential filter is applied to an arbitrary pixel of interest in the input grayscale image and one or more pixels around the pixel of interest to form a rectangular coordinate system. The differential values in the x direction and the y direction are obtained, and the pixel of interest in which the differential values in the x direction and the y direction are both substantially zero is stored as a unique pixel. In the process of calculating the correlation value with the template, the singular pixel is excluded from the target of the correlation value calculation, and the pixel in the flat portion where the differential values in the x direction and the y direction are substantially zero is defined as the singular pixel. It is possible to provide an image processing method that can perform accurate pattern matching using a density gradient direction image even if a flat portion without a density gradient exists in an input grayscale image because it is excluded from the target of the correlation value calculation. Become.
[0044]
According to a second aspect of the present invention, in the first aspect of the present invention, in calculating a correlation value between the density gradient direction image and the template, a difference between the two is obtained and a difference having a smaller absolute value among the differences is used. It is characterized in that a correlation value is calculated for each pixel, and an accurate correlation value can be obtained as compared with a case where a difference is simply obtained.
[0045]
According to a third aspect of the present invention, in the first or second aspect of the present invention, in calculating the correlation value between the density gradient direction image and the template, the correlation value of each pixel of the density gradient direction image is determined according to the correlation value. It is characterized by performing weighting in such a manner that a pixel having a high degree of matching between the input grayscale image and the template has a correlation value that further increases the degree of matching, and a pixel having a low degree of matching between the input grayscale image and the template is matched. By setting the correlation value such that the degree is further reduced, it is possible to improve the accuracy of determining the presence or absence of the target object.
[0046]
According to a fourth aspect of the present invention, in the first or second aspect of the invention, in the calculation of the correlation value between the density gradient direction image and the template, weighting is performed according to the position of each pixel constituting the template. For example, it is possible to improve the accuracy of the presence / absence determination of the target object by relatively increasing the weight of the pixel position constituting a portion having a characteristic shape as compared with the others in the template.
[0047]
According to a fifth aspect of the present invention, in the first or second aspect of the invention, in the calculation of the correlation value between the density gradient direction image and the template, weighting is performed according to the density gradient intensity of each pixel of the density gradient direction image. For example, a pixel having a relatively high density gradient intensity is considered to be a characteristic portion such as an edge, so that the weight is increased. Conversely, a pixel having a relatively low density gradient intensity is a flat portion or the like. Since it is considered to be a non-characteristic part, the accuracy of the determination of the presence or absence of the object can be improved by reducing the weight.
[0048]
The invention according to claim 6, wherein a holding means for obtaining a density gradient direction image including an object to be determined in advance, and holding a template created by extracting features of the object from the density gradient direction image, A density gradient direction image generating means for obtaining an input grayscale image of the above, and generating a density gradient direction image from the input grayscale image; calculating a correlation value between the density gradient direction image and the template; A density gradient direction image creating means, wherein the density gradient direction image creating means differentiates the pixel of interest into an arbitrary pixel of interest and one or more pixels around the pixel of interest. A differential value in the x direction and the y direction of the rectangular coordinate system is obtained by applying a filter, and a pixel of interest in which the differential values in the x direction and the y direction are substantially zero is recorded as a singular pixel. In addition, the determination unit performs a correlation value calculation between the density gradient direction image and the template by excluding the singular pixel from a target of the correlation value calculation. Since the pixels in the flat part where the differential values of both are almost zero are excluded from the correlation value calculation as unique pixels, even if there is a flat part without the density gradient in the input grayscale image, the density gradient An image processing apparatus capable of performing accurate pattern matching using the directional image can be provided.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating an image processing apparatus according to a first embodiment.
FIG. 2 is a flowchart for explaining a method of creating a density gradient direction image using the Sobel filter according to the first embodiment.
FIG. 3 is an explanatory diagram for explaining a method of creating a density gradient direction image using the Sobel filter according to the first embodiment.
FIG. 4 is an explanatory diagram illustrating a method for creating a density gradient direction image using the Sobel filter;
5A is a diagram showing a gray scale image, FIG. 5B is a diagram showing a density gradient direction image, and FIG. 5C is a diagram showing a scale when the density gradient direction image is represented by a density value.
FIG. 6 is an explanatory diagram of pattern matching using a density gradient direction image.
FIG. 7 is a diagram showing another differential filter according to the embodiment.
FIG. 8 is a diagram showing still another differential filter according to the first embodiment;
FIG. 9 is an explanatory diagram illustrating a method of creating a density gradient direction image according to the embodiment.
FIG. 10 is an explanatory diagram illustrating a method for creating a density gradient direction image according to the embodiment.
FIG. 11 is a flowchart illustrating a correlation value calculation process according to the embodiment.
FIG. 12 is an explanatory diagram for explaining a correlation value calculation process according to the embodiment.
FIG. 13 is a flowchart for explaining another correlation value calculation process of the above.
FIG. 14 is an explanatory diagram illustrating weighting of a correlation value according to the second embodiment.
FIG. 15 is an explanatory diagram for explaining another example of the correlation value weighting in the above.
FIG. 16 is an explanatory diagram for explaining still another example of the correlation value weighting in the above.
FIG. 17 illustrates a template according to the third embodiment.
FIG. 18 is an explanatory diagram for explaining weighting of a correlation value in the fourth embodiment.
FIG. 19 is an explanatory diagram for explaining another example of the correlation value weighting in the above.
FIG. 20 is an explanatory diagram for explaining conventional pattern matching.
FIG. 21 is an explanatory diagram for explaining conventional pattern matching.
FIG. 22 is an explanatory diagram for explaining a density gradient direction image.
[Explanation of symbols]
1 imaging means
2 A / D conversion means
3 means for creating density gradient direction images
4 holding means
5 Judgment means

Claims (6)

予め判定対象となる対象物を含む濃度勾配方向画像を得て該濃度勾配方向画像から前記対象物の特徴を抽出して作成したテンプレートを保持しておき、判定用の入力濃淡画像を得て該入力濃淡画像から濃度勾配方向画像を作成し、該濃度勾配方向画像と前記テンプレートとの相関値演算を行い、この演算結果から入力濃淡画像中における前記対象物の存否を判定する画像処理方法において、入力濃淡画像から濃度勾配方向画像を作成する過程で、入力濃淡画像中の任意の注目画素とその周囲の1乃至複数の画素に微分フィルタを適用して直交座標系のx方向及びy方向における微分値をそれぞれ求め、前記x方向及びy方向の微分値が何れも略ゼロとなる注目画素を特異画素として記憶しておき、前記濃度勾配方向画像と前記テンプレートとの相関値演算の過程で前記特異画素を相関値演算の対象から除外することを特徴とする画像処理方法。A density gradient direction image including an object to be determined is obtained in advance, a template created by extracting features of the object from the density gradient direction image is held, and an input density image for determination is obtained. An image processing method for creating a density gradient direction image from an input grayscale image, performing a correlation value calculation between the density gradient direction image and the template, and determining the presence or absence of the target in the input grayscale image from the calculation result. In the process of creating a density gradient direction image from an input grayscale image, a differential filter is applied to an arbitrary pixel of interest in the input grayscale image and one or more pixels around the pixel of interest to differentiate in the x and y directions of the rectangular coordinate system. The target pixel in which the differential values in the x and y directions are substantially zero is stored as a unique pixel, and the density gradient direction image and the template Image processing method characterized by excluding the specific pixel in the course of calculating correlation values from the target of the correlation value calculation. 前記濃度勾配方向画像と前記テンプレートとの相関値演算において、両者の差分を求めるとともに該差分のうちで絶対値が小さい方の差分を用いて各画素毎の相関値を演算することを特徴とする請求項1記載の画像処理方法。In the correlation value calculation between the density gradient direction image and the template, a difference between the two is obtained, and a correlation value for each pixel is calculated using a difference having a smaller absolute value among the differences. The image processing method according to claim 1. 前記濃度勾配方向画像と前記テンプレートとの相関値演算において、前記濃度勾配方向画像の各画素の相関値に対して該相関値に応じた重み付けを行うことを特徴とする請求項1又は2記載の画像処理方法。3. The method according to claim 1, wherein in calculating a correlation value between the density gradient direction image and the template, a correlation value of each pixel of the density gradient direction image is weighted in accordance with the correlation value. Image processing method. 前記濃度勾配方向画像と前記テンプレートとの相関値演算において、前記テンプレートを構成する各画素の位置に応じた重み付けを行うことを特徴とする請求項1又は2記載の画像処理方法。3. The image processing method according to claim 1, wherein in calculating a correlation value between the density gradient direction image and the template, weighting is performed in accordance with a position of each pixel forming the template. 4. 前記濃度勾配方向画像と前記テンプレートとの相関値演算において、前記濃度勾配方向画像の各画素の濃度勾配強度に応じた重み付けを行うことを特徴とする請求項1又は2記載の画像処理方法。3. The image processing method according to claim 1, wherein in calculating a correlation value between the density gradient direction image and the template, weighting is performed in accordance with a density gradient intensity of each pixel of the density gradient direction image. 4. 予め判定対象となる対象物を含む濃度勾配方向画像を得て該濃度勾配方向画像から前記対象物の特徴を抽出して作成したテンプレートを保持する保持手段と、判定用の入力濃淡画像を得て該入力濃淡画像から濃度勾配方向画像を作成する濃度勾配方向画像作成手段と、該濃度勾配方向画像と前記テンプレートとの相関値演算を行い、この演算結果から入力濃淡画像中における前記対象物の存否を判定する判定手段とを備えた画像処理装置において、前記濃度勾配方向画像作成手段は、入力濃淡画像中の任意の注目画素とその周囲の1乃至複数の画素に微分フィルタを適用して直交座標系のx方向及びy方向における微分値をそれぞれ求め、前記x方向及びy方向の微分値が何れも略ゼロとなる注目画素を特異画素として記憶しておき、前記判定手段は、前記特異画素を相関値演算の対象から除外して前記濃度勾配方向画像と前記テンプレートとの相関値演算を行うことを特徴とする画像処理装置。Holding means for obtaining a density gradient direction image including a target object to be determined in advance and extracting a feature of the target object from the density gradient direction image to hold a template; and obtaining an input grayscale image for determination. A density gradient direction image generating means for generating a density gradient direction image from the input grayscale image; calculating a correlation value between the density gradient direction image and the template; and determining whether the object exists in the input grayscale image based on the calculation result The density gradient direction image creating means applies a differential filter to an arbitrary pixel of interest in the input grayscale image and one or more pixels around the pixel of interest to obtain a rectangular coordinate image. The differential values in the x direction and the y direction of the system are obtained, and the pixel of interest in which the differential values in the x direction and the y direction are both substantially zero is stored as a singular pixel. Means, image processing apparatus characterized by the exclusion of the specific pixel from the object of correlation value calculating a correlation value calculation between the density gradient direction image and the template.
JP2003091814A 2003-03-28 2003-03-28 Image processing method and device Pending JP2004302581A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003091814A JP2004302581A (en) 2003-03-28 2003-03-28 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003091814A JP2004302581A (en) 2003-03-28 2003-03-28 Image processing method and device

Publications (1)

Publication Number Publication Date
JP2004302581A true JP2004302581A (en) 2004-10-28

Family

ID=33405089

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003091814A Pending JP2004302581A (en) 2003-03-28 2003-03-28 Image processing method and device

Country Status (1)

Country Link
JP (1) JP2004302581A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006154964A (en) * 2004-11-25 2006-06-15 Matsushita Electric Works Ltd Interphone system
JP2006221461A (en) * 2005-02-10 2006-08-24 Toyo Noki Kk Speed sensor and speed sensor program
JP2008204307A (en) * 2007-02-22 2008-09-04 Meidensha Corp Image-collating device
JP2008217627A (en) * 2007-03-07 2008-09-18 National Institute Of Advanced Industrial & Technology Image feature extracting device and image feature extracting method
JP2008293073A (en) * 2007-05-22 2008-12-04 Juki Corp Matching processing method for image
JP2009261007A (en) * 2009-08-03 2009-11-05 Panasonic Electric Works Co Ltd Intercom system
WO2010122721A1 (en) * 2009-04-22 2010-10-28 日本電気株式会社 Matching device, matching method, and matching program
JP2011164991A (en) * 2010-02-10 2011-08-25 Toyota Motor Corp Image processing apparatus
CN104933700A (en) * 2015-05-08 2015-09-23 小米科技有限责任公司 Method and apparatus for image content recognition

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006154964A (en) * 2004-11-25 2006-06-15 Matsushita Electric Works Ltd Interphone system
JP2006221461A (en) * 2005-02-10 2006-08-24 Toyo Noki Kk Speed sensor and speed sensor program
JP4699773B2 (en) * 2005-02-10 2011-06-15 東洋農機株式会社 Speed sensor, speed sensor program, and mobile body equipped with these
JP2008204307A (en) * 2007-02-22 2008-09-04 Meidensha Corp Image-collating device
JP2008217627A (en) * 2007-03-07 2008-09-18 National Institute Of Advanced Industrial & Technology Image feature extracting device and image feature extracting method
JP2008293073A (en) * 2007-05-22 2008-12-04 Juki Corp Matching processing method for image
WO2010122721A1 (en) * 2009-04-22 2010-10-28 日本電気株式会社 Matching device, matching method, and matching program
US8958609B2 (en) 2009-04-22 2015-02-17 Nec Corporation Method and device for computing degree of similarly between data sets
JP2009261007A (en) * 2009-08-03 2009-11-05 Panasonic Electric Works Co Ltd Intercom system
JP2011164991A (en) * 2010-02-10 2011-08-25 Toyota Motor Corp Image processing apparatus
CN104933700A (en) * 2015-05-08 2015-09-23 小米科技有限责任公司 Method and apparatus for image content recognition
CN104933700B (en) * 2015-05-08 2019-02-22 小米科技有限责任公司 A kind of method and apparatus carrying out picture material identification

Similar Documents

Publication Publication Date Title
JP6416582B2 (en) Method and apparatus for metal artifact removal in medical images
JP4154374B2 (en) Pattern matching device and scanning electron microscope using the same
US8842906B2 (en) Body measurement
JP5524692B2 (en) Information processing apparatus and method, and program
CN104156940B (en) Image processing method and apparatus
JP6473401B2 (en) Skin gloss evaluation apparatus, gloss evaluation method, and gloss evaluation program
CN105488791B (en) The localization method and device of image border in natural background
EP3067856B1 (en) Image processing apparatus and image processing method
US20150186753A1 (en) Image Processing Apparatus, Image Processing Method, and Image Processing Program
JP2018038789A (en) Diagnosis support device, method for processing image on diagnosis support device and program
WO2017096814A1 (en) Image processing method and apparatus
TWI628601B (en) Facial image-processing method and system thereof
JP2004302581A (en) Image processing method and device
JP5752770B2 (en) Image processing method and apparatus
JP6425396B2 (en) Image processing apparatus, image processing method and program
JP4801697B2 (en) Image forming method, image forming apparatus, and computer program
JP4449576B2 (en) Image processing method and image processing apparatus
JP6006675B2 (en) Marker detection apparatus, marker detection method, and program
JP2005152255A (en) Human body posture measuring apparatus
JP2005326323A (en) Image quality inspection device
KR100825960B1 (en) Method of assigning a landmark on a cephalometric radiograph
JP2007243987A (en) Image processing method, image processing system, and image processing program
JP4165350B2 (en) Image processing method and image processing apparatus
JP2023003764A (en) Image processing apparatus, image processing method, and program
JP6006676B2 (en) Marker embedding device, marker detecting device, marker embedding method, marker detecting method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050915

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071122

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071204

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080204

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080304

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080403

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080507

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20080515

A912 Removal of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20080606