JP4283005B2 - Object tracking method, program, and recording medium - Google Patents

Object tracking method, program, and recording medium Download PDF

Info

Publication number
JP4283005B2
JP4283005B2 JP2003029791A JP2003029791A JP4283005B2 JP 4283005 B2 JP4283005 B2 JP 4283005B2 JP 2003029791 A JP2003029791 A JP 2003029791A JP 2003029791 A JP2003029791 A JP 2003029791A JP 4283005 B2 JP4283005 B2 JP 4283005B2
Authority
JP
Japan
Prior art keywords
template
correlation value
image
motion
correlation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003029791A
Other languages
Japanese (ja)
Other versions
JP2004240762A (en
Inventor
忠孝 吉川
泰之 道本
康丞 細井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co 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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2003029791A priority Critical patent/JP4283005B2/en
Publication of JP2004240762A publication Critical patent/JP2004240762A/en
Application granted granted Critical
Publication of JP4283005B2 publication Critical patent/JP4283005B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、撮像装置からの入力画像を処理することによって移動物体を検出して追跡する物体追跡方法に関し、より詳細には、追跡対象物体が入力画像に含まれる背景に強い影響を受ける場合や、追跡対象物体の動きが無い場合であっても、追跡対象物体を精度良く追跡できるようにした物体追跡方法に関する。
【0002】
【従来の技術】
従来の物体追跡方法としては、追跡対象物体の画像の特徴を用いて追跡するテンプレートマッチングを用いた方法、または追跡対象物体の動きの特徴を用いて追跡するオプティカルフローを用いた方法が広く知られている。
【0003】
図15に、テンプレートマッチングを用いた従来の物体追跡方法における処理の流れを示す。入力画像から追跡したい物体を含む領域をテンプレートとして切り出し、そのテンプレート画像を記憶する(S1501)。入力画像におけるテンプレートの切り出し位置をテンプレートの基準位置として記憶する(S1502)。撮像時刻の異なる複数の入力画像とテンプレートとに基づいて、入力画像におけるテンプレートのマッチング位置を求める(S1503)。マッチング位置と基準位置とに基づいて、基準位置に対するマッチング位置の移動量を算出する(S1504)。算出した移動量が予め定めた条件以上であれば基準位置をマッチング位置に更新し、且つテンプレートを撮像時刻の異なる入力画像のマッチング位置に基づき更新するが、移動量が予め定めた条件未満であれば基準位置ないしはテンプレートを更新しない(S1505)。(特許文献1参照)
【0004】
図16に、オプティカルフローを用いた従来の物体追跡方法における処理の流れを示す。撮像装置から逐次入力される入力画像を複数のブロックに分割し、ブロック毎に動きがあるか否かを検出する(S1601)。検出したブロックの重心位置を算出することで移動物体を追跡する(S1602)。(特許文献2参照)
【0005】
【特許文献1】
特開2000-113158号公報
【特許文献2】
特開2000-322582号公報
【0006】
【発明が解決しようとする課題】
しかしながら、テンプレートマッチングを用いた従来の物体追跡方法においては、入力画像から切り出したテンプレートの画像パターンのみを用いて物体追跡を行っているため、たとえば白線のエッジ等による背景の強い特長がテンプレートの背景部に含まれる場合、テンプレートの背景部と相関が高い位置にテンプレートが誤ってマッチングしてしまい、物体追跡に失敗する場合があった。
【0007】
また、オプティカルフローを用いた従来の物体追跡方法においては、入力画像から動きを検出して物体追跡を行っているため、追跡対象物体に動きが無くオプティカルフローが発生しない場合は追跡できないという問題があった。
【0008】
本発明は、これら従来の技術の問題を解決するためになされたもので、その目的は、追跡対象物体を含むテンプレートの画像パターンに背景の強い特徴が含まれている場合や、追跡対象物体に動きが無い場合であっても、追跡対象物体を含むテンプレートの画像と動きの両方のパターンから相関を求めて追跡を行うことによって、追跡対象物体を精度良く追跡することができる物体追跡方法を提供し、併せて、この方法をコンピュータにより実現するためのプログラム、および当該プログラムを記録した記録媒体を提供することにある。
【0009】
【課題を解決するための手段】
上記目的を達成するために、本発明の物体追跡方法は、撮像時刻の異なる複数の入力画像からオプティカルフローを演算するオプティカルフロー演算ステップと、追跡対象物体を含むテンプレートの画像パターンと前記入力画像との相関を求める画像相関演算ステップと、前記テンプレートの動きパターンと前記オプティカルフローとの動き相関を求める動き相関演算ステップと、前記画像相関演算ステップで得られた画像相関値と前記動き相関演算ステップで得られた動き相関値とを用いて前記テンプレートの最適マッチング位置を探索する最適マッチング位置探索ステップと、前記最適マッチング位置によって前記テンプレートを更新するテンプレート更新ステップと、前記オプティカルフローから動体領域を検出し、前記動体領域を含む画像パターンと動きパターンとをテンプレートとして記憶するテンプレート登録ステップとを有する。
【0010】
この構成により、追跡対象物体を含むテンプレートの画像パターンに背景の強い特徴が含まれている場合や、追跡対象物体に動きが無い場合であっても、追跡対象物体を含むテンプレートの画像と動きの両方のパターンから相関を求めて追跡を行うことによって、追跡対象物体を精度良く追跡することができる。
【0011】
また、本発明の物体追跡方法において、前記最適マッチング位置探索ステップは、前記画像相関値と前記動き相関値を一定の比率で加算して正規化した値をテンプレートの相関値とし、前記テンプレートの相関値がピークとなる位置を最適マッチング位置として探索することが望ましい。
【0012】
この構成によれば、強い特長がテンプレートの背景部に含まれる場合には、前記動き相関値の比率を高く設定してテンプレートの相関値を求めることにより、追跡対象物体に動きが無く追跡が困難な場合には、前記画像相関値の比率を高く設定してテンプレートの相関値を求めることにより、追跡対象物体を精度良く追跡することができる。
【0013】
また、前記最適マッチング位置探索ステップは、前記テンプレートの特徴を用いて比率を決定し、前記画像相関値と前記動き相関値とを前記比率で加算して正規化した値をテンプレートの相関値とし、前記テンプレートの相関値が最適となる位置を最適マッチング位置として探索することが望ましい。
【0014】
この構成によれば、追跡対象物体の入力画像上の座標によってテンプレートの背景の影響が変化する場合や追跡対象物体の動きが時々刻々と変化する場合に、テンプレートの特徴に応じて、適応的に決定した比率で前記画像相関値と前記動き相関値を足し合わせて正規化した値をテンプレートの相関値として最適マッチング位置を探索することにより、強い特長がテンプレートの背景部に含まれる場合やオプティカルフローが発生しない場合であっても物体を精度良く追跡することができる。
【0015】
前記比率は、前記テンプレートの動きパターンのフローが発生している割合に応じて決定されることが望ましい。
【0016】
この構成によれば、テンプレートの動きパターンのフローが発生している割合を用いて前記適応的な比率を決定し、適応的に決定した比率で前記画像相関値と前記動き相関値を足し合わせて正規化した値をテンプレートの相関値として最適マッチング位置を探索することにより、強い特長がテンプレートの背景部に含まれる場合やオプティカルフローが発生しない場合であっても物体を精度良く追跡することができる。
【0017】
また、本発明のプログラムは、本発明の物体追跡方法における各工程をコンピュータに実行させるべくプログラム化したものである。
【0018】
このプログラムをコンピュータに実行させることにより、本発明の物体追跡方法をコンピュータを用いて容易に実施することができる。
【0019】
本発明の記憶媒体は、本発明の物体追跡方法における各工程をコンピュータに実行させるためのプログラムをコンピュータに読み取り可能に記録してなる。
【0020】
この記憶媒体に記録されているプログラムをコンピュータに実行させることにより、本発明の物体追跡方法をコンピュータを用いて容易に実施することができる。
【0021】
【発明の実施の形態】
以下、本発明の実施の形態について、図面を用いて説明する。
【0022】
[第1の実施の形態]
図1は本発明の第1の実施の形態の物体追跡方法における処理の流れを示すフロー図である。この物体追跡方法は、撮像時刻の異なる複数の入力画像からオプティカルフローを演算するオプティカルフロー演算ステップS101と、テンプレートの画像パターンと入力画像との相関を求める画像相関演算ステップS102と、テンプレートの動きパターンとオプティカルフロー演算ステップS101で得られたオプティカルフロートの動き相関を求める動き相関演算ステップS103と、画像相関演算ステップS102で得られた画像相関値と動き相関演算ステップS103で得られた動き相関値とに基づいて最適マッチング位置を探索する最適マッチング位置探索ステップS104と、最適マッチング位置探索ステップS104により得られた最適マッチング位置でテンプレートを更新するテンプレート更新ステップS105と、オプティカルフロー演算ステップS101で得られたオプティカルフローから動体領域を検出し、新規テンプレートを登録するテンプレート登録ステップS106とを有し、これら一連のステップS101〜S106の処理を繰り返し行うことにより物体追跡を行う。なお、テンプレートとは追跡対象物体を含む画像パターンと動きパターンを組にしたものである。入力画像からテンプレートを得る方法については後述する。
【0023】
次に、各ステップS101〜S106における処理内容について詳細に説明する。
【0024】
まず、図2および図3を参照して、オプティカルフロー演算ステップS101における処理の流れを説明する。オプティカルフローを演算する方法としては、たとえばブロックマッチング法や勾配法が知られている。本実施の形態ではブロックマッチング法を用いた方法を説明する。
【0025】
オプティカルフロー演算ステップS101は、図2に示す一連のステップS201〜S204からなる。
ステップS201では、入力画像を(M×N)個の画素から構成されるブロック単位に分割する。
ステップS202では、入力画像のブロックを1つ選択する。
ステップS203では、図3に示すように入力画像内のブロックと前フレーム画像の探索範囲内のブロックとの相関値を演算し、ステップS202で選択したブロックのオプティカルフローを求める。オプティカルフローはブロックマッチング法によって入力画像内の(M×N)個の画素から構成されるブロック301に対し、前フレーム画像の(K×L)個の画素から構成される探索範囲302内から、(M×N)個の画素から構成される最も相関の高いブロック303を探索して求める。そして、ブロック303からブロック301への変移304としてオプティカルフローが求められる。
【0026】
最も相関の高いブロック303は、たとえば入力画像内のブロックと前フレーム画像のブロックにおける同位置の画素の差分絶対値和D(a,b)が最も小さい位置を調べることによって求められる。差分絶対値和D(a,b)は下記の式1で表され、この値が0に近づくほど相関が高いことを意味する。
【0027】
【数1】

Figure 0004283005
【0028】
a : 入力画像内のブロックとnフレーム前の画像内のブロックのx成分の変位
b : 入力画像内のブロックとnフレーム前の画像内のブロックのy成分の変位
D(a,b) : 変位(a,b)における差分絶対値和
ft : 入力画像
ft-n : nフレーム前の画像
x :ブロックのx座標
y :ブロックのy座標
【0029】
これらステップS202、S203の一連の処理を入力画像の各ブロックに対して繰り返し行い、入力画像のオプティカルフローを各ブロック単位で演算する(ステップS204)。
【0030】
次に、図4および図5を参照して、画像相関演算ステップS102における処理の流れを説明する。
【0031】
画像相関演算ステップS102は、図4に示す一連のステップS401〜S408からなる。
ステップS401では、テンプレートが1つ以上登録されているか否か判定する。テンプレートが全く登録されていない場合は、図4の一連の処理を終了する。
テンプレートが1つ以上登録されている場合は、ステップS402においてテンプレートを1つ選択する。
ステップS403では、ステップS402で選択したテンプレートについて入力画像内に探索範囲を設定する。
ステップS404では、ステップS403で設定した探索範囲内で画像相関値R1を求める座標を設定する。
ステップS405では、ステップS404で設定した座標で入力画像の部分画像とテンプレートの画像パターンの画像相関値を演算する。画像相関値には、たとえば下記の式2で表される正規化相関値R1(a,b)を用いる。R1(a,b)は、0〜1の実数値を取り、1に近づくほど画像相関が高いことを意味する。正規化相関値R1(a,b)は、照明の変動による輝度変化の影響を受けにくく、安定なマッチングが可能である点から好ましい。
【0032】
【数2】
Figure 0004283005
【0033】
H : テンプレートのサイズ(横) , V : テンプレートのサイズ(縦)
a : テンプレートの座標と画像相関を求める座標のx成分の変移
b : テンプレートの座標と画像相関を求める座標のy成分の変移
1 : 正規化相関値
T : テンプレート
f : 探索範囲内に設定した画像相関を求める入力画像の部分画像
【0034】
ステップS406では、ステップS405で得られた画像相関値をステップS404で設定した座標と対応付けて記憶する。
【0035】
ステップS404〜S406の一連の処理を、入力画像内に設定した探索範囲内の全ての座標に対して行う(ステップS407)。たとえば図5の場合、ステップS402でテンプレート501を選択し、ステップS403でテンプレート501の入力画像上の座標502に基づいて探索範囲503を設定し、ステップS404で画像相関値を求める座標504を設定し、ステップS405でテンプレート501と入力画像上の座標504の部分画像との画像相関値を求め、ステップS406で座標504と画像相関値を対応付けて記憶し、ステップS407で探索範囲503内の全ての座標で画像相関値R1を演算したか否かを判定する。
【0036】
そして、ステップS402〜S407の一連の処理を、登録されているテンプレート全てに対して行う(ステップS408)。
【0037】
次に、図6および図7を参照して、動き相関演算ステップS103における処理の流れを説明する。
【0038】
動き相関演算ステップS103は、図6に示す一連のステップS601〜S608からなる。
ステップS601では、テンプレートが1つ以上登録されているか否か判定を行う。テンプレートが全く登録されていない場合は、図6の一連の処理を終了する。
テンプレートが1つ以上登録されている場合は、ステップS602においてテンプレートを1つ選択する。
ステップS603では、ステップS602で選択したテンプレートについて入力画像内に探索範囲を設定する。ステップS602で設定する探索範囲は、ステップS402(図4)で選択したテンプレートと同一のテンプレートを選択している場合は同一の探索範囲が設定される。
ステップS604では、ステップS403で設定した探索範囲内で動き相関値R2を求める座標を設定する。
ステップS605では、ステップS404で設定した座標で入力画像のオプティカルフローとテンプレートの動きパターンとの動き相関値を演算する。動き相関値は、たとえば下記の式3で示すように、入力画像のオプティカルフローとテンプレートの動きパターンとの一致率R2(a,b)で求められる。R2(a,b)は、0〜1の実数値を取り、1に近づくほど動き相関が高いことを意味する。
【0039】
【数3】
Figure 0004283005
【0040】
ステップS606では、ステップS605で得られた動き相関値R2をステップS605で設定した座標と対応付けて記憶する。
【0041】
ステップS604〜S606の一連の処理を、入力画像内に設定した探索範囲内の全ての座標に対して行う(ステップS607)。たとえば図7の場合、ステップS602でテンプレート701を選択し、ステップS603でテンプレート701の画像上の領域702に基づいて探索範囲703を設定し、ステップS604で動き相関値を求める座標704を設定し、ステップS605で動き相関値R2を求め、ステップS606で座標704と動き相関値R2を対応付けて記憶し、ステップS607で探索範囲703内の全ての座標で動き相関値R2を演算したか否か判定する。図示の例では、動き相関値R2が領域705で最大となる。
【0042】
そして、ステップS602〜S607の一連の処理を、登録されているテンプレート全てに対して行う(ステップS608)。
【0043】
次に、図8を参照して最適マッチング位置探索ステップS104における処理の流れを説明する。
【0044】
最適マッチング位置探索ステップS104は、図8に示す一連のステップS801〜S810からなる。
ステップS801では、テンプレートが1つ以上登録されているか否か判定する。テンプレートが全く登録されていない場合は、図8の一連の処理を終了する。
テンプレートが1つ以上登録されている場合は、ステップS802においてテンプレートを1つ選択する。
ステップS803では、ステップS802で選択したテンプレートの最大相関値Rmaxと最適マッチング位置を初期化する。
ステップS804では、ステップS802で選択したテンプレートについて入力画像内に探索範囲を設定する。ステップS802で設定する探索範囲は、ステップS402(図4)およびステップS602(図6)で選択したテンプレートと同一のテンプレートを選択している場合は同一の探索範囲が設定される。
ステップS805では、ステップS803で設定した探索範囲内で相関値Rを求める座標を設定する。
ステップS806において、画像相関演算ステップS102(図1)で得られた画像相関値R1と動き相関演算ステップS103(図1)で得られた動き相関値R2からテンプレートの相関値Rを演算する。
【0045】
テンプレートの相関値Rは、下記の式4で示すように、あらかじめ設定しておいた一定の係数α,βを用いて画像相関値R1と動き相関値R2の算術和を求め、それを正規化することにより求められる。たとえば、画像相関値R1を前記式2で求め、動き相関値R2を前記式3で求めた場合、それぞれ0〜1の実数値を取り、1に近づくほど画像相関または動き相関が高いので、式4の相関値Rは、0〜1の実数値をとり、1に近づくほどテンプレートの相関が高いことを意味する。なお、(α,β)=(1,1)と設定することによって、たとえば、画像相関値R1を式2で求め、動き相関値R2を式3で求めた場合、画像相関値R1と動き相関値R2の算術和の範囲を0〜1の実数値に正規化したものと等価になる。
【0046】
【数4】
Figure 0004283005
【0047】
R(a,b):テンプレートの相関値
1(a,b):テンプレートの画像相関値
2(a,b):テンプレートの動き相関値
α、β:定数
(a,b):テンプレートの座標と画像相関を求める座標の(x,y)成分の変位
【0048】
ステップS807では、ステップS806で得られたテンプレートの相関値Rが最大相関値Rmaxより大きいか否か判定する。
テンプレートの相関値Rが最大相関値Rmaxより大きい場合は、ステップS808で最大相関値Rmaxを相関値Rで更新し、最適マッチング位置をステップS805で設定した座標で更新する。
これらステップS805〜S808の一連の処理を、入力画像内に設定した探索範囲内の全ての座標に対して行う(ステップS809)。
そして、ステップS802〜S809の一連の処理を、登録されているテンプレート全てに対して行う(ステップS810)。
【0049】
次に、図9および図10を参照してテンプレート更新ステップS105における処理の流れを説明する。
【0050】
テンプレート更新ステップS105は、図9に示す一連のステップS901〜S904からなる。
ステップS901では、テンプレートを1つ選択する。
ステップS902では、テンプレートと入力画像内の最適マッチング位置との最大相関値Rmaxがしきい値を超えているか判定を行う。
ステップS903では、最大相関値Rmaxがしきい値を超えたテンプレートを入力画像内の最適マッチング位置の領域によって更新する。テンプレートを更新することによって、追跡対象物体の形状ないしは大きさの変化に追従することができる。また、最大相関値Rmaxがしきい値を超えない場合は、登録されているテンプレートを削除する。
【0051】
ここで、テンプレートを更新する方法について説明する。たとえば、図10に示すように、人物1001に対して最適マッチング位置がテンプレート枠1002であったとし、ブロック1003のような淡色のブロックをオプティカルフローが発生していないブロック、ブロック1004のような濃色のブロックをオプティカルフローが発生したブロックとする。
【0052】
このとき、水平線H1を基準として、垂直線V1から垂直線V2の範囲のブロックについてオプティカルフローが発生した個数をカウントし、該当する全ブロックに対してオプティカルフローが発生していないブロックの割合がしきい値より大きければテンプレートの枠を収縮する。逆にオプティカルフローの発生しているブロックがしきい値より大きければ、テンプレート枠を拡大する方向の該当範囲の全ブロックについてオプティカルフローの発生している割合を求め、しきい値より大きければテンプレート枠を拡大し、小さい場合はテンプレート枠を維持する。この処理を、水平線H2を基準とした垂直線V1から垂直線V2の範囲、垂直線V1を基準とした水平線H1から水平線H2の範囲、垂直線V2を基準とした水平線H1から水平線H2の範囲のそれぞれについて同様の処理を行い、テンプレート枠を補正しテンプレートを更新する。
【0053】
その結果、図10に示すように、最適マッチング位置のテンプレート枠1002がテンプレート枠1005に更新される。そして、入力画像内の更新したテンプレート枠1005に含まれる部分画像を用いてテンプレートの画像パターンを更新する。
【0054】
ステップS902およびS903の一連の処理を、登録されている全てのテンプレートに対して行い、テンプレートを更新する(ステップS904)。
【0055】
次に、図11および図12を参照してテンプレート登録ステップS106における処理の流れを説明する。
【0056】
テンプレート登録ステップS106は、図11に示すステップS1001〜S1007からなる。
ステップ1101では、オプティカルフローをラベリング処理して動体領域を検出する。ラベリング処理は一般的な画像処理の手法として広く知られている。
ステップS1102では、動体領域が1つ以上存在するか否か判定する。動体領域が全く存在しない場合は、図11の一連の処理を終了する。
動体領域が1つ以上存在する場合は、ステップS1103で動体領域を1つ選択する。
ステップS1104では、ステップS1103で選択した動体領域が追跡対象物体の特徴を持つか判定を行う。たとえば、追跡対象物体の特徴としては、大きさ、縦横比などがある。
動体領域が追跡対象物体の特徴を持つ場合は、ステップS1105で選択した動体領域が既にテンプレートとして登録されているか否か判定する。
選択した動体領域がテンプレートに登録されていない場合は、ステップS1106で新規のテンプレートとして登録する。
【0057】
たとえば、図12に示すように、人物1201が人物1202の位置へ移動している場合、オプティカルフローは各ブロックでフロー1203のように求められる。このとき、図12の各ブロックで得られたフロー1203をラベリング処理によりグループ化し、動体領域1204を求める。次に、動体領域1204が追跡対象物体の特徴を持つか否か判定を行い、追尾対象物体の特徴を持ち、テンプレートとして未登録である場合は、テンプレートの画像パターン1205を新規登録すると共に動体領域に対応する動きパターン1206を登録する。
【0058】
ステップS1103〜S1106の一連の処理を、ステップS1101で検出した全ての動体領域について行う(ステップS1107)。
【0059】
以上のように、本発明の第1の実施の形態の物体追跡方法では、撮像時刻の異なる複数の入力画像からオプティカルフローを演算し、追跡対象物体を含む入力画像とテンプレートの画像パターンとの画像相関を求め、オプティカルフローとテンプレートの動きパターンとの動き相関を求め、画像相関値と動き相関値から最適マッチング位置を探索する。
【0060】
したがって、追跡対象物体を含むテンプレートの画像パターンに背景の強い特徴が含まれている場合や、追跡対象物体に動きが無い場合であっても、追跡対象物体を含むテンプレートの画像と動きの両方のパターンから相関を求めて追跡を行うことによって、追跡対象物体を精度良く追跡することができる。
【0061】
また、画像相関値と動き相関値を一定の比率で足し合わせて正規化した値をテンプレートの相関値として最適マッチング位置を探索するようにしたので、強い特長がテンプレートの背景部に含まれる場合は、動き相関値の比率を高く設定してテンプレートの相関値を求めることによって、物体に動きが無く追跡が困難な場合は、画像相関値の比率を高く設定してテンプレートの相関値を求めることによって、物体を精度良く追跡することができる。
【0062】
[第2の実施の形態]
図13は本発明の第2の実施の形態の物体追跡方法における処理の流れを示すフロー図である。図13中のステップS1301、S1303、およびS1304における処理内容は、それぞれ図1中のステップS101、S105、およびS106のそれと同じである。そこで、ここではステップS1301、S1303、およびS1304については詳細な説明を省き、画像相関演算・動き相関演算および最適マッチング位置探索ステップS1302における処理内容について、図14を参照して詳細に説明する。
【0063】
画像相関演算・動き相関演算および最適マッチング位置探索ステップS1302は、図14に示す一連のステップS1401〜S1416からなる。
【0064】
ステップS1401では、テンプレートが1つ以上登録されているか判定を行う。
テンプレートが全く登録されていない場合は、図14の一連の処理を終了する。
テンプレートが1つ以上登録されている場合は、ステップS1402においてテンプレートを1つ選択する。
ステップS1403では、ステップS1402で選択したテンプレートの動きパターンのフローが発生している割合を求める。割合を求めるには、テンプレートのオプティカルフローが発生している画素数をカウントし、テンプレートの全画素数に対する割合を求めればよい。
ステップS1404では、ステップS1403で得られた割合がしきい値を超えているか否か判定する。
ステップS1403で得られた割合がしきい値を超えている場合は、係数(αt,βt)に(α1,β1)を代入する(ステップS1405)。
ステップS1403で得られた割合がしきい値を超えていない場合は、係数(αt,βt)に(α2,β2)を代入する(ステップS1406)。
ステップS1404〜ステップS1406の一連の処理を数式で示すと、下記の式5のように示される。
【0065】
【数5】
Figure 0004283005
【0066】
(αt,βt) : 時刻tにおける係数(α,β)
Fr:テンプレートのオプティカルフローが発生している割合
TH:しきい値
【0067】
なお、係数(αt,βt)の決定方法は、ステップS1404〜S1406のようにテンプレートのオプティカルフローが発生している割合をしきい値処理して設定する方法に限定されず、たとえば、下記の式6に示すような連続関数 f で決定してもよい。
【0068】
【数6】
Figure 0004283005
【0069】
(αt,βt) : 時刻tにおける係数(α,β)
Fr:テンプレートのオプティカルフローが発生している割合
【0070】
ステップS1407では、ステップS1402で選択したテンプレートの最大相関値Rmaxと最適マッチング位置を初期化する。
ステップS1408では、ステップS1402で選択したテンプレートについて入力画像内に探索範囲を設定する。
ステップS1409では、ステップS1408で設定した探索範囲内で相関値Rを求める座標を設定する。
ステップS1410では、ステップS1408で設定した座標で入力画像の部分画像とテンプレートの画像パターンの画像相関値R1を演算する。画像相関値R1には、たとえば式2で表される正規化相関値を用いる。
ステップS1411では、ステップS1408で設定した座標で入力画像のオプティカルフローとテンプレートの動きパターンとの動き相関値R2を演算する。画像相関値R2は、たとえば、式3で示すように入力画像のオプティカルフローとテンプレートの動きパターンとの一致率で求められる。
ステップS1412では、ステップS1410で得られた画像相関値R1とステップS1411で得られた動き相関値R2からテンプレートの相関値Rを演算する。テンプレートの相関値Rは、下記の式7で示すように、ステップS1406〜S1408で設定した係数αt,βtの比率で、画像相関値R1と動き相関値R2との算術和を正規化した値で求められる。たとえば、画像相関値R1を式2で求め、動き相関値R2を式3で求めた場合、それぞれ0〜1の実数値を取り、1に近づくほど画像相関または動き相関が高いので、式7の相関値Rは、0〜1の実数値を取り、1に近づくほどテンプレートの相関が高いことを意味する。
【0071】
【数7】
Figure 0004283005
【0072】
R(a,b):テンプレートの相関値
1(a,b):テンプレートの画像相関値
2(a,b):テンプレートの動き相関値
αt、βt:時刻tにおける定数
(a,b):テンプレートの座標と画像相関を求める座標の(x,y)成分の変位
【0073】
ステップS1413では、ステップS1412で得られたテンプレートの相関値Rが最大相関値Rmaxより大きいか否か判定する。
テンプレートの相関値Rが最大相関値Rmaxより大きい場合は、ステップS1414で最大相関値Rmaxを相関値Rで更新し、最適マッチング位置をステップS1409で設定した座標で更新する。
ステップS1409〜S1414の一連の処理を、入力画像内に設定した探索範囲内の全ての座標に対して行う(ステップS1415)。
そして、ステップS1402〜1415の一連の処理を、登録されているテンプレート全てに対して行う(ステップS1416)。
【0074】
以上のように、本発明の第2の実施の形態の物体追跡方法では、画像相関演算・動き相関演算および最適マッチング位置探索ステップ1302において、テンプレートの動きパターンのフローが発生している割合に応じて、適応的に係数 (αt,βt) を設定する。そして、適応的に設定した係数 (αt,βt) の比率で画像相関値R1と動き相関値R2との算術和を求め、正規化した値をテンプレートの相関値Rとし、テンプレートの相関値Rが最適となる位置を最適マッチング位置として探索する。
【0075】
したがって、追跡対象物体の入力画像上の座標によってテンプレートの背景の影響が変化する場合や追跡対象物体の動きが時々刻々と変化する場合に、テンプレートの特徴に応じて、適応的に決定した比率で画像相関値R1と動き相関値R2とを足し合わせて正規化した値Rをテンプレートの相関値として最適マッチング位置を探索することによって、強い特長がテンプレートの背景部に含まれる場合やオプティカルフローが発生しない場合であっても物体を精度良く追跡することができる。
【0076】
なお、本発明はこの実施の形態に限定されるのではなく、本発明の範囲内で種々の改良および変形が可能である。
【0077】
また、以上説明した各実施の形態における一連のステップをプログラム化すれば、本発明の物体追跡方法をコンピュータを用いて容易に実施することができる。
【0078】
また、上記プログラムをコンピュータ読み取り可能な記録媒体に記録すれば、その記録媒体に記録されたプログラムを任意のコンピュータにインストールし実行させることにより、本発明の物体追跡方法をコンピュータを用いて容易に実施することができる。
【0079】
【発明の効果】
以上のように本発明によれば、追跡対象物体を含むテンプレートの画像パターンに背景の強い特徴が含まれている場合や、追跡対象物体に動きが無い場合であっても、追跡対象物体を含むテンプレートの画像と動きの両方のパターンから相関を求めて追跡を行うことによって、追跡対象物体を精度良く追跡することができる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態における物体追跡方法の全体の流れを示すフローチャートである。
【図2】図1中のオプティカルフロー演算ステップの内容を示すフローチャートである。
【図3】オプティカルフローを求める方法についての説明図である
【図4】図1中の画像相関演算ステップの内容を示すフローチャートである。
【図5】画像相関演算を行う方法についての説明図である。
【図6】図1中の動き相関演算ステップの内容を示すフローチャートである。
【図7】動き相関演算を行う方法についての説明図である。
【図8】図1中の最適マッチング位置検索ステップの内容を示すフローチャートである。
【図9】図1中のテンプレート更新ステップの内容を示すフローチャートである。
【図10】テンプレートを更新する方法についての説明図である。
【図11】図1中のテンプレート登録ステップの内容を示すフローチャートである。
【図12】テンプレートを登録する方法についての説明図である。
【図13】本発明の第2の実施の形態における物体追跡方法の全体の流れを示すフローチャートである。
【図14】図13中の画像相関演算・動き相関演算および最適マッチング位置検索ステップの内容を示すフローチャートである。
【図15】テンプレートマッチングを用いた従来の物体追跡方法を示すフローチャートである。
【図16】オプティカルフローを用いた従来の物体追跡方法を示すフローチャートである。
【符号の説明】
301:入力画像内のブロック
302:探索範囲
303:最も相関の高いブロック
304:変移(オプティカルフロー)
501:テンプレート
502:入力画像上の座標
503:探索範囲
504:画像相関値を求める座標
701:テンプレート
702:画像上の領域
703:探索範囲
704:動き相関値を求める座標
705:動き相関値が最大となる領域
1001:人物(追跡対象物体)
1002:更新前のテンプレート枠
1003:オプティカルフローが発生してないブロック
1004:オプティカルフローが発生したブロック
1005:更新後のテンプレート枠
1201:人物(移動前の追跡対象物体)
1202:人物(移動後の追跡対象物体)
1203:オプティカルフロー
1204:動体領域
1205:テンプレートの画像パターン
1206:動きパターン[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an object tracking method for detecting and tracking a moving object by processing an input image from an imaging apparatus, and more specifically, when a tracking target object is strongly influenced by a background included in the input image, The present invention relates to an object tracking method capable of accurately tracking a tracking target object even when there is no movement of the tracking target object.
[0002]
[Prior art]
As a conventional object tracking method, a method using template matching for tracking using the characteristics of the image of the tracking target object or a method using an optical flow for tracking using the motion characteristics of the tracking target object are widely known. ing.
[0003]
FIG. 15 shows a flow of processing in a conventional object tracking method using template matching. A region including an object to be tracked is cut out as a template from the input image, and the template image is stored (S1501). The template cut-out position in the input image is stored as the template reference position (S1502). Based on a plurality of input images and templates having different imaging times, a template matching position in the input image is obtained (S1503). Based on the matching position and the reference position, the amount of movement of the matching position with respect to the reference position is calculated (S1504). If the calculated amount of movement is greater than or equal to a predetermined condition, the reference position is updated to the matching position, and the template is updated based on the matching position of the input image with a different imaging time, but the amount of movement is less than the predetermined condition. In this case, the reference position or template is not updated (S1505). (See Patent Document 1)
[0004]
FIG. 16 shows a process flow in a conventional object tracking method using an optical flow. The input image sequentially input from the imaging device is divided into a plurality of blocks, and it is detected whether or not there is movement for each block (S1601). The moving object is tracked by calculating the position of the center of gravity of the detected block (S1602). (See Patent Document 2)
[0005]
[Patent Document 1]
JP 2000-113158 A
[Patent Document 2]
JP 2000-322582 A
[0006]
[Problems to be solved by the invention]
However, in the conventional object tracking method using template matching, object tracking is performed using only the image pattern of the template cut out from the input image. In some cases, the template is erroneously matched at a position highly correlated with the background portion of the template, and object tracking may fail.
[0007]
In addition, in the conventional object tracking method using optical flow, since the object tracking is performed by detecting the motion from the input image, there is a problem that the tracking target object cannot be tracked when there is no motion and no optical flow occurs. there were.
[0008]
The present invention has been made in order to solve the problems of these conventional techniques, and the purpose of the present invention is when the background image feature is included in the image pattern of the template including the tracking target object, or in the tracking target object. Providing an object tracking method that can accurately track a target object even if there is no motion, by obtaining a correlation from both the template image containing the target object and the pattern of the motion. In addition, another object is to provide a program for realizing this method by a computer and a recording medium on which the program is recorded.
[0009]
[Means for Solving the Problems]
In order to achieve the above object, an object tracking method of the present invention includes an optical flow calculation step for calculating an optical flow from a plurality of input images having different imaging times, a template image pattern including a tracking target object, and the input image. An image correlation calculation step for obtaining a correlation between the image, a motion correlation calculation step for obtaining a motion correlation between the motion pattern of the template and the optical flow, an image correlation value obtained in the image correlation calculation step, and the motion correlation calculation step. An optimal matching position searching step for searching for an optimal matching position of the template using the obtained motion correlation value, a template updating step for updating the template with the optimal matching position, and a moving object region from the optical flow are detected. Including the moving object region And a template registering step of storing the image pattern and the motion pattern as a template.
[0010]
With this configuration, even if the template image pattern including the tracking target object includes a strong background feature or the tracking target object has no motion, the template image including the tracking target object The tracking target object can be accurately tracked by obtaining a correlation from both patterns and performing tracking.
[0011]
Further, in the object tracking method of the present invention, the optimum matching position search step adds a normalized value obtained by adding the image correlation value and the motion correlation value at a certain ratio, and uses the template correlation value as a correlation value of the template. It is desirable to search the position where the value is a peak as the optimum matching position.
[0012]
According to this configuration, when a strong feature is included in the background portion of the template, the tracking target object has no movement and is difficult to track by determining the template correlation value by setting the ratio of the motion correlation value high. In such a case, the tracking target object can be accurately tracked by setting the ratio of the image correlation values high and obtaining the correlation value of the template.
[0013]
The optimum matching position search step determines a ratio using the feature of the template, adds the image correlation value and the motion correlation value by the ratio and normalizes the value as a template correlation value, It is desirable to search for a position where the correlation value of the template is optimal as an optimal matching position.
[0014]
According to this configuration, when the influence of the background of the template changes according to the coordinates on the input image of the tracking target object or when the movement of the tracking target object changes from moment to moment, adaptively according to the characteristics of the template. By searching for the optimal matching position using the normalized value obtained by adding the image correlation value and the motion correlation value at the determined ratio as the correlation value of the template, a strong feature is included in the background portion of the template or an optical flow Even when no occurrence occurs, the object can be accurately tracked.
[0015]
It is preferable that the ratio is determined according to a ratio at which a flow of the movement pattern of the template is generated.
[0016]
According to this configuration, the adaptive ratio is determined using the rate at which the flow of the template motion pattern is generated, and the image correlation value and the motion correlation value are added together at the adaptively determined ratio. By searching for the optimal matching position using the normalized value as the correlation value of the template, the object can be accurately tracked even when strong features are included in the template background or when no optical flow occurs. .
[0017]
The program of the present invention is a program that causes a computer to execute each step in the object tracking method of the present invention.
[0018]
By causing the computer to execute this program, the object tracking method of the present invention can be easily implemented using the computer.
[0019]
The storage medium of the present invention is recorded with a computer-readable program for causing the computer to execute each step in the object tracking method of the present invention.
[0020]
By causing a computer to execute the program recorded in the storage medium, the object tracking method of the present invention can be easily implemented using the computer.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0022]
[First Embodiment]
FIG. 1 is a flowchart showing the flow of processing in the object tracking method of the first embodiment of the present invention. This object tracking method includes an optical flow calculation step S101 for calculating an optical flow from a plurality of input images having different imaging times, an image correlation calculation step S102 for obtaining a correlation between the template image pattern and the input image, and a template motion pattern. And a motion correlation calculation step S103 for obtaining a motion correlation of the optical float obtained in the optical flow calculation step S101, an image correlation value obtained in the image correlation calculation step S102, and a motion correlation value obtained in the motion correlation calculation step S103. An optimum matching position searching step S104 for searching for an optimum matching position based on the template, a template updating step S105 for updating the template at the optimum matching position obtained by the optimum matching position searching step S104, and It has a template registration step S106 for detecting a moving object region from the optical flow obtained in the optical flow calculation step S101 and registering a new template, and performs object tracking by repeating the series of steps S101 to S106. . A template is a set of an image pattern including a tracking target object and a motion pattern. A method for obtaining a template from an input image will be described later.
[0023]
Next, the processing contents in steps S101 to S106 will be described in detail.
[0024]
First, the flow of processing in the optical flow calculation step S101 will be described with reference to FIGS. As a method for calculating the optical flow, for example, a block matching method and a gradient method are known. In this embodiment, a method using a block matching method will be described.
[0025]
The optical flow calculation step S101 includes a series of steps S201 to S204 shown in FIG.
In step S201, the input image is divided into blocks each composed of (M × N) pixels.
In step S202, one block of the input image is selected.
In step S203, as shown in FIG. 3, the correlation value between the block in the input image and the block in the search range of the previous frame image is calculated, and the optical flow of the block selected in step S202 is obtained. The optical flow is generated from the search range 302 composed of (K × L) pixels of the previous frame image with respect to the block 301 composed of (M × N) pixels in the input image by the block matching method. The block 303 having the highest correlation composed of (M × N) pixels is searched for and obtained. Then, an optical flow is obtained as the transition 304 from the block 303 to the block 301.
[0026]
The block 303 having the highest correlation is obtained, for example, by examining the position where the sum of absolute differences D (a, b) of the pixels at the same position in the block in the input image and the block in the previous frame image is the smallest. The difference absolute value sum D (a, b) is expressed by the following Equation 1, and the closer this value is to 0, the higher the correlation is.
[0027]
[Expression 1]
Figure 0004283005
[0028]
a: Displacement of the x component of the block in the input image and the block in the image n frames before
b: Displacement of the y component of the block in the input image and the block in the image n frames before
D (a, b): Sum of absolute differences at displacement (a, b)
ft: Input image
ft-n: Image n frames before
x: x coordinate of the block
y: y coordinate of the block
[0029]
The series of processes in steps S202 and S203 are repeated for each block of the input image, and the optical flow of the input image is calculated for each block (step S204).
[0030]
Next, the flow of processing in the image correlation calculation step S102 will be described with reference to FIGS.
[0031]
The image correlation calculation step S102 includes a series of steps S401 to S408 shown in FIG.
In step S401, it is determined whether one or more templates are registered. If no template is registered, the series of processes in FIG. 4 is terminated.
If one or more templates are registered, one template is selected in step S402.
In step S403, a search range is set in the input image for the template selected in step S402.
In step S404, the image correlation value R within the search range set in step S403. 1 Set the coordinates to find.
In step S405, the image correlation value between the partial image of the input image and the image pattern of the template is calculated using the coordinates set in step S404. The image correlation value includes, for example, a normalized correlation value R expressed by the following equation 2 1 (a, b) is used. R 1 (a, b) takes a real value from 0 to 1, and means that the closer to 1, the higher the image correlation. Normalized correlation value R 1 (a, b) is preferable in that it is not easily affected by a change in luminance due to a change in illumination and stable matching is possible.
[0032]
[Expression 2]
Figure 0004283005
[0033]
H: Template size (horizontal), V: Template size (vertical)
a: Transition of the x component of the template coordinates and the coordinates for image correlation
b: Transition of the y component of the coordinates to obtain the correlation between the template coordinates and the image
R 1 : Normalized correlation value
T: Template
f: Partial image of the input image for which image correlation is set within the search range
[0034]
In step S406, the image correlation value obtained in step S405 is stored in association with the coordinates set in step S404.
[0035]
A series of processing of steps S404 to S406 is performed for all coordinates within the search range set in the input image (step S407). For example, in the case of FIG. 5, the template 501 is selected in step S402, the search range 503 is set based on the coordinates 502 on the input image of the template 501 in step S403, and the coordinates 504 for obtaining the image correlation value are set in step S404. In step S405, an image correlation value between the template 501 and the partial image of the coordinate 504 on the input image is obtained. In step S406, the coordinate 504 and the image correlation value are stored in association with each other. In step S407, all of the search ranges 503 are stored. Image correlation value R in coordinates 1 It is determined whether or not is calculated.
[0036]
Then, the series of processes in steps S402 to S407 is performed on all registered templates (step S408).
[0037]
Next, with reference to FIG. 6 and FIG. 7, the flow of processing in the motion correlation calculation step S103 will be described.
[0038]
The motion correlation calculation step S103 includes a series of steps S601 to S608 shown in FIG.
In step S601, it is determined whether one or more templates are registered. If no template is registered, the series of processes in FIG. 6 is terminated.
If one or more templates are registered, one template is selected in step S602.
In step S603, a search range is set in the input image for the template selected in step S602. The search range set in step S602 is set to the same search range when the same template as the template selected in step S402 (FIG. 4) is selected.
In step S604, the motion correlation value R within the search range set in step S403. 2 Set the coordinates to find.
In step S605, a motion correlation value between the optical flow of the input image and the motion pattern of the template is calculated using the coordinates set in step S404. For example, as shown in Equation 3 below, the motion correlation value is a match rate R between the optical flow of the input image and the motion pattern of the template. 2 It is calculated by (a, b). R 2 (A, b) takes a real value from 0 to 1, and means that the closer to 1, the higher the motion correlation.
[0039]
[Equation 3]
Figure 0004283005
[0040]
In step S606, the motion correlation value R obtained in step S605. 2 Are stored in association with the coordinates set in step S605.
[0041]
A series of processing of steps S604 to S606 is performed for all coordinates within the search range set in the input image (step S607). For example, in the case of FIG. 7, the template 701 is selected in step S602, the search range 703 is set based on the area 702 on the image of the template 701 in step S603, and the coordinates 704 for obtaining the motion correlation value are set in step S604. In step S605, the motion correlation value R 2 In step S606, the coordinates 704 and the motion correlation value R are obtained. 2 Are stored in association with each other, and in step S607, the motion correlation value R at all coordinates in the search range 703 is stored. 2 It is determined whether or not is calculated. In the illustrated example, the motion correlation value R 2 Becomes the maximum in the region 705.
[0042]
Then, a series of processes in steps S602 to S607 is performed on all registered templates (step S608).
[0043]
Next, the flow of processing in the optimum matching position search step S104 will be described with reference to FIG.
[0044]
The optimum matching position search step S104 includes a series of steps S801 to S810 shown in FIG.
In step S801, it is determined whether one or more templates are registered. If no template is registered, the series of processes in FIG. 8 is terminated.
If one or more templates are registered, one template is selected in step S802.
In step S803, the maximum correlation value Rmax and the optimum matching position of the template selected in step S802 are initialized.
In step S804, a search range is set in the input image for the template selected in step S802. The search range set in step S802 is set to the same search range when the same template as the template selected in step S402 (FIG. 4) and step S602 (FIG. 6) is selected.
In step S805, coordinates for obtaining the correlation value R are set within the search range set in step S803.
In step S806, the image correlation value R obtained in the image correlation calculation step S102 (FIG. 1). 1 And the motion correlation value R obtained in the motion correlation calculation step S103 (FIG. 1). 2 The correlation value R of the template is calculated from the above.
[0045]
The correlation value R of the template is calculated by using the predetermined correlation coefficients α and β as shown in the following formula 4. 1 And motion correlation value R 2 Is obtained by calculating the arithmetic sum of and normalizing it. For example, the image correlation value R 1 Is obtained by Equation 2 above, and the motion correlation value R 2 Is obtained by the above equation 3, each takes a real value from 0 to 1, and the closer the value is to 1, the higher the image correlation or motion correlation is. Therefore, the correlation value R in equation 4 takes a real value from 0 to 1, The closer to, the higher the template correlation. By setting (α, β) = (1,1), for example, the image correlation value R 1 Is obtained by Equation 2, and the motion correlation value R 2 Is obtained by Equation 3, the image correlation value R 1 And motion correlation value R 2 This is equivalent to normalizing the range of the arithmetic sum to 0-1 real numbers.
[0046]
[Expression 4]
Figure 0004283005
[0047]
R (a, b): Template correlation value
R 1 (a, b): Template image correlation value
R 2 (a, b): Template motion correlation value
α, β: Constant
(a, b): Displacement of the (x, y) component of the coordinates for obtaining the image correlation with the template coordinates
[0048]
In step S807, it is determined whether or not the template correlation value R obtained in step S806 is greater than the maximum correlation value Rmax.
If the correlation value R of the template is larger than the maximum correlation value Rmax, the maximum correlation value Rmax is updated with the correlation value R in step S808, and the optimum matching position is updated with the coordinates set in step S805.
The series of processes in steps S805 to S808 are performed on all coordinates within the search range set in the input image (step S809).
Then, a series of processes in steps S802 to S809 are performed on all registered templates (step S810).
[0049]
Next, the flow of processing in the template update step S105 will be described with reference to FIGS.
[0050]
The template update step S105 includes a series of steps S901 to S904 shown in FIG.
In step S901, one template is selected.
In step S902, it is determined whether the maximum correlation value Rmax between the template and the optimum matching position in the input image exceeds a threshold value.
In step S903, the template whose maximum correlation value Rmax exceeds the threshold value is updated with the region of the optimum matching position in the input image. By updating the template, it is possible to follow changes in the shape or size of the tracking target object. If the maximum correlation value Rmax does not exceed the threshold value, the registered template is deleted.
[0051]
Here, a method for updating the template will be described. For example, as shown in FIG. 10, assuming that the optimal matching position for the person 1001 is the template frame 1002, a light block such as the block 1003 is a dark block such as the block 1004 in which no optical flow is generated. Let the color block be the block where the optical flow occurred.
[0052]
At this time, the number of occurrences of optical flow is counted for the blocks in the range from the vertical line V1 to the vertical line V2 with the horizontal line H1 as a reference, and the ratio of blocks in which no optical flow has occurred to all the corresponding blocks is calculated. If it is larger than the threshold, the template frame is shrunk. Conversely, if the block where the optical flow occurs is larger than the threshold value, the ratio of occurrence of the optical flow is obtained for all the blocks in the corresponding range in the direction of enlarging the template frame. If it is small, keep the template frame. This processing is performed in the range from the vertical line V1 to the vertical line V2 with the horizontal line H2 as a reference, the range from the horizontal line H1 to the horizontal line H2 based on the vertical line V1, and the range from the horizontal line H1 to the horizontal line H2 based on the vertical line V2. The same processing is performed for each, and the template frame is corrected and the template is updated.
[0053]
As a result, the template frame 1002 at the optimum matching position is updated to the template frame 1005 as shown in FIG. Then, the template image pattern is updated using the partial image included in the updated template frame 1005 in the input image.
[0054]
The series of processes in steps S902 and S903 is performed on all registered templates, and the templates are updated (step S904).
[0055]
Next, the flow of processing in the template registration step S106 will be described with reference to FIGS.
[0056]
Template registration step S106 includes steps S1001 to S1007 shown in FIG.
In step 1101, a moving object region is detected by labeling the optical flow. The labeling process is widely known as a general image processing technique.
In step S1102, it is determined whether one or more moving object regions exist. If there is no moving object area, the series of processes in FIG. 11 is terminated.
If one or more moving object regions exist, one moving object region is selected in step S1103.
In step S1104, it is determined whether the moving object area selected in step S1103 has the characteristics of the tracking target object. For example, the characteristics of the tracking target object include size and aspect ratio.
If the moving object region has the characteristics of the tracking target object, it is determined whether or not the moving object region selected in step S1105 is already registered as a template.
If the selected moving object region is not registered in the template, it is registered as a new template in step S1106.
[0057]
For example, as shown in FIG. 12, when the person 1201 has moved to the position of the person 1202, the optical flow is obtained as a flow 1203 in each block. At this time, the flow 1203 obtained in each block in FIG. 12 is grouped by a labeling process to obtain a moving object region 1204. Next, it is determined whether or not the moving object area 1204 has the characteristics of the tracking target object. If the moving object area 1204 has the characteristics of the tracking target object and is not registered as a template, a template image pattern 1205 is newly registered and the moving object area The motion pattern 1206 corresponding to is registered.
[0058]
A series of processing of steps S1103 to S1106 is performed for all moving object regions detected in step S1101 (step S1107).
[0059]
As described above, in the object tracking method according to the first embodiment of the present invention, an optical flow is calculated from a plurality of input images having different imaging times, and an image of the input image including the tracking target object and the template image pattern is obtained. A correlation is obtained, a motion correlation between the optical flow and the motion pattern of the template is obtained, and an optimum matching position is searched from the image correlation value and the motion correlation value.
[0060]
Therefore, even if the template image pattern that includes the tracking target object includes a strong background feature or the tracking target object has no motion, both the template image including the tracking target object and the motion The tracking target object can be accurately tracked by obtaining the correlation from the pattern and performing tracking.
[0061]
In addition, since the optimum matching position is searched for using the correlation value of the template as a normalized value obtained by adding the image correlation value and the motion correlation value at a certain ratio, if the strong part is included in the background part of the template By determining the template correlation value by setting the ratio of the motion correlation value high, and when tracking is difficult because the object is not moving, the ratio of the image correlation value is set high to determine the correlation value of the template. The object can be tracked with high accuracy.
[0062]
[Second Embodiment]
FIG. 13 is a flowchart showing the flow of processing in the object tracking method according to the second embodiment of the present invention. The processing contents in steps S1301, S1303, and S1304 in FIG. 13 are the same as those in steps S101, S105, and S106 in FIG. 1, respectively. Therefore, detailed description of steps S1301, S1303, and S1304 is omitted here, and the processing contents in the image correlation calculation / motion correlation calculation and optimum matching position search step S1302 will be described in detail with reference to FIG.
[0063]
The image correlation calculation / motion correlation calculation and optimum matching position search step S1302 includes a series of steps S1401 to S1416 shown in FIG.
[0064]
In step S1401, it is determined whether one or more templates are registered.
If no template is registered, the series of processes in FIG. 14 is terminated.
If one or more templates are registered, one template is selected in step S1402.
In step S1403, the ratio of occurrence of the flow of the template movement pattern selected in step S1402 is obtained. In order to obtain the ratio, the number of pixels in which the optical flow of the template is generated is counted, and the ratio to the total number of pixels of the template may be obtained.
In step S1404, it is determined whether or not the ratio obtained in step S1403 exceeds a threshold value.
If the ratio obtained in step S1403 exceeds the threshold value, (α1, β1) is substituted for the coefficient (αt, βt) (step S1405).
If the ratio obtained in step S1403 does not exceed the threshold value, (α2, β2) is substituted for the coefficient (αt, βt) (step S1406).
A series of processing from step S1404 to step S1406 can be expressed by equation 5 as shown below.
[0065]
[Equation 5]
Figure 0004283005
[0066]
(αt, βt): Coefficient (α, β) at time t
Fr: Ratio of occurrence of template optical flow
TH: threshold
[0067]
The method for determining the coefficients (αt, βt) is not limited to the method of setting the ratio of occurrence of the optical flow of the template by threshold processing as in steps S1404 to S1406. It may be determined by a continuous function f as shown in FIG.
[0068]
[Formula 6]
Figure 0004283005
[0069]
(αt, βt): Coefficient (α, β) at time t
Fr: Ratio of occurrence of template optical flow
[0070]
In step S1407, the maximum correlation value Rmax and the optimum matching position of the template selected in step S1402 are initialized.
In step S1408, a search range is set in the input image for the template selected in step S1402.
In step S1409, coordinates for obtaining correlation value R are set within the search range set in step S1408.
In step S1410, the image correlation value R between the partial image of the input image and the image pattern of the template at the coordinates set in step S1408. 1 Is calculated. Image correlation value R 1 For example, a normalized correlation value represented by Formula 2 is used.
In step S1411, the motion correlation value R between the optical flow of the input image and the motion pattern of the template at the coordinates set in step S1408. 2 Is calculated. Image correlation value R 2 Is obtained, for example, by the coincidence rate between the optical flow of the input image and the motion pattern of the template, as shown in Expression 3.
In step S1412, the image correlation value R obtained in step S1410. 1 And the motion correlation value R obtained in step S1411. 2 The correlation value R of the template is calculated from the above. The correlation value R of the template is the ratio of the coefficients αt and βt set in steps S1406 to S1408, as shown in the following equation 7, and the image correlation value R 1 And motion correlation value R 2 Is obtained by normalizing the arithmetic sum. For example, the image correlation value R 1 Is obtained by Equation 2, and the motion correlation value R 2 Is obtained by Equation 3, each takes a real value of 0 to 1, and the closer to 1, the higher the image correlation or motion correlation, so the correlation value R of Equation 7 takes a real value of 0 to 1 and The closer it is, the higher the template correlation.
[0071]
[Expression 7]
Figure 0004283005
[0072]
R (a, b): Template correlation value
R 1 (a, b): Template image correlation value
R 2 (a, b): Template motion correlation value
αt, βt: Constants at time t
(a, b): Displacement of the (x, y) component of the coordinates for obtaining the image correlation with the template coordinates
[0073]
In step S1413, it is determined whether the template correlation value R obtained in step S1412 is greater than the maximum correlation value Rmax.
If the correlation value R of the template is larger than the maximum correlation value Rmax, the maximum correlation value Rmax is updated with the correlation value R in step S1414, and the optimum matching position is updated with the coordinates set in step S1409.
A series of processes in steps S1409 to S1414 is performed for all coordinates within the search range set in the input image (step S1415).
Then, the series of processing in steps S1402 to 1415 is performed on all registered templates (step S1416).
[0074]
As described above, in the object tracking method according to the second embodiment of the present invention, in the image correlation calculation / motion correlation calculation and optimum matching position search step 1302, the template motion pattern flow is generated according to the ratio. And adaptively set the coefficients (αt, βt). Then, the image correlation value R is expressed by the ratio of the coefficients (αt, βt) set adaptively. 1 And motion correlation value R 2 And the normalized value is used as the template correlation value R, and the position where the template correlation value R is optimal is searched for as the optimum matching position.
[0075]
Therefore, when the influence of the background of the template changes depending on the coordinates of the tracking target object on the input image or when the movement of the tracking target object changes from moment to moment, the ratio is determined adaptively according to the characteristics of the template. Image correlation value R 1 And motion correlation value R 2 By searching for the optimal matching position using the normalized value R as a template correlation value, the object is accurate even when strong features are included in the template background or when optical flow does not occur. It can be tracked well.
[0076]
The present invention is not limited to this embodiment, and various improvements and modifications can be made within the scope of the present invention.
[0077]
Moreover, if the series of steps in each embodiment described above is programmed, the object tracking method of the present invention can be easily implemented using a computer.
[0078]
If the program is recorded on a computer-readable recording medium, the object tracking method of the present invention can be easily implemented using a computer by installing the program recorded on the recording medium on an arbitrary computer and executing the program. can do.
[0079]
【The invention's effect】
As described above, according to the present invention, even if the template image pattern including the tracking target object includes a strong background feature or the tracking target object does not move, the tracking target object is included. The tracking target object can be accurately tracked by obtaining the correlation from the pattern of both the template image and the motion and performing tracking.
[Brief description of the drawings]
FIG. 1 is a flowchart showing an overall flow of an object tracking method according to a first embodiment of the present invention.
2 is a flowchart showing the contents of an optical flow calculation step in FIG. 1. FIG.
FIG. 3 is an explanatory diagram of a method for obtaining an optical flow.
FIG. 4 is a flowchart showing the contents of an image correlation calculation step in FIG.
FIG. 5 is an explanatory diagram of a method for performing image correlation calculation.
6 is a flowchart showing the contents of a motion correlation calculation step in FIG. 1. FIG.
FIG. 7 is an explanatory diagram of a method for performing motion correlation calculation.
FIG. 8 is a flowchart showing the contents of an optimum matching position search step in FIG.
FIG. 9 is a flowchart showing the contents of a template update step in FIG. 1;
FIG. 10 is an explanatory diagram of a method for updating a template.
FIG. 11 is a flowchart showing the contents of a template registration step in FIG. 1;
FIG. 12 is an explanatory diagram of a method for registering a template.
FIG. 13 is a flowchart showing an overall flow of an object tracking method according to a second embodiment of the present invention.
14 is a flowchart showing the contents of an image correlation calculation / motion correlation calculation and optimum matching position search step in FIG. 13;
FIG. 15 is a flowchart showing a conventional object tracking method using template matching.
FIG. 16 is a flowchart showing a conventional object tracking method using an optical flow.
[Explanation of symbols]
301: Block in input image
302: Search range
303: most correlated block
304: Transition (optical flow)
501: Template
502: Coordinate on input image
503: Search range
504: Coordinates for obtaining the image correlation value
701: Template
702: Image area
703: Search range
704: Coordinates for obtaining a motion correlation value
705: Region where the motion correlation value is maximum
1001: Person (object to be tracked)
1002: Template frame before update
1003: Block in which no optical flow has occurred
1004: Block where an optical flow has occurred
1005: Template frame after update
1201: Person (tracking target object before moving)
1202: Person (tracking target object after movement)
1203: Optical flow
1204: Moving object region
1205: Template image pattern
1206: Movement pattern

Claims (6)

撮像時刻の異なる複数の入力画像からオプティカルフローを演算するオプティカルフロー演算ステップと、
追跡対象物体を含むテンプレートの画像パターンと前記入力画像との相関を求める画像相関演算ステップと、
前記テンプレートの動きパターンと前記オプティカルフローとの動き相関を求める動き相関演算ステップと、
前記画像相関演算ステップで得られた画像相関値と前記動き相関演算ステップで得られた動き相関値とを用いて前記テンプレートの最適マッチング位置を探索する最適マッチング位置探索ステップと、
前記最適マッチング位置によって前記テンプレートを更新するテンプレート更新ステップと、
前記オプティカルフローから動体領域を検出し、前記動体領域を含む画像パターンと動きパターンとをテンプレートとして記憶するテンプレート登録ステップとを有することを特徴とする物体追跡方法。
An optical flow calculation step for calculating an optical flow from a plurality of input images having different imaging times;
An image correlation calculation step for obtaining a correlation between an image pattern of a template including a tracking target object and the input image;
A motion correlation calculation step for obtaining a motion correlation between the motion pattern of the template and the optical flow;
An optimum matching position search step for searching for an optimum matching position of the template using the image correlation value obtained in the image correlation calculation step and the motion correlation value obtained in the motion correlation calculation step;
A template update step of updating the template with the optimal matching position;
An object tracking method comprising: a template registration step of detecting a moving body region from the optical flow and storing an image pattern including the moving body region and a motion pattern as a template.
前記最適マッチング位置探索ステップは、
前記画像相関値と前記動き相関値を一定の比率で加算して正規化した値をテンプレートの相関値とし、前記テンプレートの相関値がピークとなる位置を最適マッチング位置として探索することを特徴とする請求項1記載の物体追跡方法。
The optimum matching position search step includes:
A value obtained by adding the image correlation value and the motion correlation value at a certain ratio and normalized is used as a template correlation value, and a position where the correlation value of the template reaches a peak is searched as an optimum matching position. The object tracking method according to claim 1.
前記最適マッチング位置探索ステップは、
前記テンプレートの特徴を用いて比率を決定し、前記画像相関値と前記動き相関値とを前記比率で加算して正規化した値をテンプレートの相関値とし、前記テンプレートの相関値が最適となる位置を最適マッチング位置として探索することを特徴とする請求項1記載の物体追跡方法。
The optimum matching position search step includes:
A position where the ratio is determined using the feature of the template, and the normalized value obtained by adding the image correlation value and the motion correlation value by the ratio is used as a template correlation value, and the position where the correlation value of the template is optimal The object tracking method according to claim 1, wherein the search is performed as an optimum matching position.
前記比率は、
前記テンプレートの動きパターンのフローが発生している割合に応じて決定されることを特徴とする請求項3記載の物体追跡方法。
The ratio is
The object tracking method according to claim 3, wherein the object tracking method is determined according to a rate at which a flow of the movement pattern of the template is generated.
請求項1ないし4のいずれかに記載の物体追跡方法における各ステップをコンピュータに実行させるためのプログラム。The program for making a computer perform each step in the object tracking method in any one of Claim 1 thru | or 4. 請求項1ないし4のいずれかに記載の物体追跡方法における各ステップをコンピュータに実行させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。A computer-readable recording medium recording a program for causing a computer to execute each step in the object tracking method according to claim 1.
JP2003029791A 2003-02-06 2003-02-06 Object tracking method, program, and recording medium Expired - Fee Related JP4283005B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003029791A JP4283005B2 (en) 2003-02-06 2003-02-06 Object tracking method, program, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003029791A JP4283005B2 (en) 2003-02-06 2003-02-06 Object tracking method, program, and recording medium

Publications (2)

Publication Number Publication Date
JP2004240762A JP2004240762A (en) 2004-08-26
JP4283005B2 true JP4283005B2 (en) 2009-06-24

Family

ID=32956871

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003029791A Expired - Fee Related JP4283005B2 (en) 2003-02-06 2003-02-06 Object tracking method, program, and recording medium

Country Status (1)

Country Link
JP (1) JP4283005B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3970877B2 (en) 2004-12-02 2007-09-05 独立行政法人産業技術総合研究所 Tracking device and tracking method
JP4215781B2 (en) 2006-06-16 2009-01-28 独立行政法人産業技術総合研究所 Abnormal operation detection device and abnormal operation detection method
CN102074016A (en) * 2009-11-24 2011-05-25 杭州海康威视软件有限公司 Device and method for automatically tracking motion target
CN102215377B (en) * 2010-04-07 2012-10-31 北京智安邦科技有限公司 Device and method for PTZ (planning, tilting and zooming) single-target automatic tracking
EP3179444B1 (en) * 2014-08-04 2021-02-17 Panasonic Corporation Moving body tracking method and moving body tracking device

Also Published As

Publication number Publication date
JP2004240762A (en) 2004-08-26

Similar Documents

Publication Publication Date Title
US11954813B2 (en) Three-dimensional scene constructing method, apparatus and system, and storage medium
US9311524B2 (en) Image processing apparatus and image processing method
JP7209115B2 (en) Detection, 3D reconstruction and tracking of multiple rigid objects moving in relatively close proximity
CN107146200B (en) Unmanned aerial vehicle remote sensing image splicing method based on image splicing quality evaluation
JP6782903B2 (en) Self-motion estimation system, control method and program of self-motion estimation system
CN111340922A (en) Positioning and mapping method and electronic equipment
CN110136174B (en) Target object tracking method and device
CN114494462A (en) Binocular camera ranging method based on Yolov5 and improved tracking algorithm
EP4317910A1 (en) Computer program, model generation method, estimation method and estimation device
CN107909643B (en) Mixed scene reconstruction method and device based on model segmentation
CN115205339A (en) Mobile robot target following method based on improved YOLOX
CN113793266A (en) Multi-view machine vision image splicing method, system and storage medium
JP4283005B2 (en) Object tracking method, program, and recording medium
JP5900017B2 (en) Depth estimation apparatus, reconstructed image generation apparatus, depth estimation method, reconstructed image generation method, and program
JP2001148012A (en) Method and device for searching corresponding point
EP4107699A1 (en) A method for generating a dataset, a method for generating a neural network, and a method for constructing a model of a scene
CN116147618B (en) Real-time state sensing method and system suitable for dynamic environment
CN115511970B (en) Visual positioning method for autonomous parking
JP4283532B2 (en) Image recognition apparatus and method
CN113724311B (en) Depth map acquisition method, device and storage medium
JPWO2020244717A5 (en)
JP7241492B2 (en) Image processing device, image processing method, program, and storage medium
CN113836980A (en) Face recognition method, electronic device and storage medium
JP2016062447A (en) Image processor, image processing method, and image processing program
JP2000331160A (en) Device and method for matching and recording medium stored with matching program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060203

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20060325

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20071114

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20071121

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20071128

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20071205

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20071212

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090213

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090318

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120327

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130327

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130327

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20140327

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees