JP4218298B2 - Image processing apparatus and method, recording medium, and program - Google Patents

Image processing apparatus and method, recording medium, and program Download PDF

Info

Publication number
JP4218298B2
JP4218298B2 JP2002296678A JP2002296678A JP4218298B2 JP 4218298 B2 JP4218298 B2 JP 4218298B2 JP 2002296678 A JP2002296678 A JP 2002296678A JP 2002296678 A JP2002296678 A JP 2002296678A JP 4218298 B2 JP4218298 B2 JP 4218298B2
Authority
JP
Japan
Prior art keywords
pixel
feature amount
position information
address
area
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
JP2002296678A
Other languages
Japanese (ja)
Other versions
JP2004134993A (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.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2002296678A priority Critical patent/JP4218298B2/en
Publication of JP2004134993A publication Critical patent/JP2004134993A/en
Application granted granted Critical
Publication of JP4218298B2 publication Critical patent/JP4218298B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、画像処理装置および方法、記録媒体、並びにプログラムに関し、特に、画像の動きを検出する画像処理装置および方法、記録媒体、並びにプログラムに関する。
【0002】
【従来の技術】
画像の動きを示す動きベクトルを求め、この動きベクトルに基づいて効率よく動画像を処理する技術がある。
【0003】
上述の動きベクトルを求める手法としては、いくつか提案されているが、代表的な手法としてブロックマッチングアルゴリズムと呼ばれる手法がある。
【0004】
図1は、ブロックマッチングアルゴリズムを採用した従来の画像処理装置の構成を示すブロック図である。
【0005】
フレームメモリ11は、例えば、時刻t1において、画像(画像データ)が入力されると、1フレーム分の画像を格納し、記憶する。さらに、フレームメモリ11は、次のフレームのタイミングとなる時刻t2において、次のフレームの画像が入力されると、新たに入力された時刻t2の1フレーム分の画像を格納し、記憶するとともに、時刻t1の1フレーム分の画像をサーチエリア生成部12に出力する。
【0006】
ラインメモリ13は、時刻t2のタイミングで、入力されてきた1フレームの所定のラインの画像を格納し、時刻t2のタイミングで、ブロック生成部14に出力する。
【0007】
すなわち、フレームメモリ11が、上述の時刻t2のタイミングで入力される(今現在の)1フレーム分の画像の画素値を格納し、記憶するとき、フレームメモリ11は、時刻t1(1タイミング過去)の1フレーム分の画像の画素値をサーチエリア生成部12に出力する。ラインメモリ13は、時刻t2のタイミングで入力された(今現在の)1フレームのラインの画像の画素値をブロック生成部14に出力する。なお、以下において、ラインメモリ13に格納される画像のラインに対応するフレームをカレントフレームFc、フレームメモリ11から出力される画像を参照フレームFrと称する。
【0008】
サーチエリア生成部12は、フレームメモリ11から供給された参照フレームFrからサーチエリアSRを生成し、サーチエリアSRの画素の画素値をマッチング部15に供給する。
【0009】
ブロック生成部14は、ラインメモリ13から供給されたカレントフレームFcから基準ブロックBbを生成し、基準ブロックBbの画素の画素値をマッチング部15に供給する。
【0010】
図2に示すように、参照フレームFrのサーチエリアSRは、横にNS(画素数)、縦にMS(画素数)の画素からなり、カレントフレームFcの基準ブロックBbは、横にNB(画素数)、縦にMB(画素数)の画素からなる。通常、サーチエリアSRは、基準ブロックBbに比較して大きな領域(画素数が多い)からなる。
【0011】
この場合、サーチエリアSRの縦および横の画素数を同じ数のLとすることができる。
【0012】
マッチング部15は、サーチエリア生成部12から供給されたサーチエリアSRの画素の画素値と、ブロック生成部14から供給された基準ブロックBbの画素の画素値とを基に、サーチエリアSRの参照ブロックBrnを構成する各画素の画素値と、基準ブロックBbの各画素の画素値との差分絶対値和を算出して、参照ブロックBrnから基準ブロックBbへのベクトルと共に、差分絶対値和を誤差値として、誤差最小選択部16に供給する。
【0013】
誤差最小選択部16は、最小である誤差値に対応するベクトルを選択して、選択されたベクトルを動きベクトルとして出力する。
【0014】
ここで、ブロックマッチングアルゴリズムについて説明する。例えば、図3で示すように、カレントフレームFc内の注目画素P(i,j)に対応する動きベクトルを求める場合、まず、カレントフレームFc上に注目画素P(i,j)を中心としたL(画素数)×L(画素数)からなる基準ブロックBb(i,j)、参照フレームFr上に、注目画素P(i,j)の位置に対応するサーチエリアSR、そして、そのサーチエリアSR内に、L(画素数)×L(画素数)の画素からなる参照ブロックBrn(i,j)がそれぞれ設定される。
【0015】
次に、この基準ブロックBb(i,j)と、参照ブロックBrn(i,j)の各画素間の画素値の差分の絶対値の和を求める処理が、参照ブロックBrnをサーチエリアSR内の全域で水平方向、または、垂直方向に1画素分ずつラスタスキャン順に移動させながら、図3中のBr1からBrm(参照ブロックBrnが、サーチエリアSR内にm個設定できるものとする)まで繰り返される。
【0016】
このようにして求められた基準ブロックBb(i,j)と、参照ブロックBrn(i,j)の各画素間の差分絶対値和のうち、差分絶対値和が最小となる参照ブロックBrnを求めることにより、基準ブロックBb(i,j)に最も近い(類似している)参照ブロックBrn(i,j)を構成するL×L個の画素の中心となる参照画素Pn(i,j)が求められる。
【0017】
そして、このカレントフレームFc上の注目画素P(i,j)に対応する参照フレームFr上の画素P’(i,j)を始点とし、参照画素Pn(i,j)を終点とするベクトルが、注目画素P(i,j)の動きベクトル(Vx,Vy)として出力される。ここで、例えば、P(i,j)=(a,b)、および、Pn(i,j)=(c,d)である場合、(Vx,Vy)は、(Vx,Vy)=(c−a,d−b)となる。
【0018】
すなわち、注目画素P(i,j)に対応する参照フレーム上の参照画素P’(i,j)を始点とし、基準ブロックBb(i,j)に最も近い(類似している)参照ブロックBrn(i,j)を構成するL×L個の画素の中心となる参照画素Pn(i,j)を終点とするベクトルが動きベクトルとして求められる。
【0019】
次に、図4のフローチャートを参照して、図1の画像処理装置の動き検出処理について説明する。
【0020】
ステップS1において、サーチエリア生成部12は、カレントフレームFc上の注目画素P(i,j)の画素位置に応じて、サーチエリアSRを設定する。
【0021】
ステップS2において、誤差最小選択部16は、上述のように、基準ブロックBb(i,j)と参照ブロックBrn(i,j)の画素間の差分絶対値和の最小値を設定する変数minを、画素の階調数に基準ブロックBb(i,j)を構成する画素数を乗じた値に設定することにより初期化する。すなわち、例えば、1画素が8ビットのデータであった場合、1画素の階調数は、2の8乗となるため256階調(256色)となる。また、基準ブロックBb(i,j)がL画素×L画素=3画素×3画素から構成される場合、その画素数は、9個となる。結果として、変数minは、2304(=256(階調数)×9(画素数))に初期化される。
【0022】
ステップS3において、マッチング部15は、参照ブロックBrnをカウントするカウンタ変数nを1に初期化する。
【0023】
ステップS4において、誤差最小選択部16は、基準ブロックBbと参照ブロックBrnの画素間の差分絶対値和を代入するために用いる変数sumを0に初期化する。
【0024】
ステップS5において、マッチング部15は、基準ブロックBb(i,j)と参照ブロックBrn(i,j)の画素間の差分絶対値和(=sum)を求める。すなわち、基準ブロックBb(i,j)の各画素がP_Bb(i,j)、基準ブロックBrn(i,j)の各画素がP_Brn(i,j)としてそれぞれ示される場合、マッチング部15は、以下の式(1)で示される演算を実行して、基準ブロックBb(i,j)と参照ブロックBrn(i,j)の画素間の差分絶対値和を求める。
【0025】
【数1】

Figure 0004218298
【0026】
ステップS6において、誤差最小選択部16は、変数minが変数sumよりも大きいか否かを判定し、例えば、変数minが変数sumよりも大きいと判定する場合、ステップS7において、変数minを変数sumに更新し、その時点でのカウンタnの値を動きベクトル番号として登録する。すなわち、今求めた差分絶対値和を示す変数sumが、最小値を示す変数minよりも小さいと言うことは、これまで演算したどの参照ブロックよりも、今演算している参照ブロックBrn(i,j)が基準ブロックBb(i,j)により類似したものであるとみなすことができるので、動きベクトルを求める際の候補とするため、その時点でのカウンタnが動きベクトル番号として登録される。また、ステップS6において、変数minが変数sumよりも大きくないと判定された場合、ステップS7の処理がスキップされる。
【0027】
ステップS8において、マッチング部15は、カウンタ変数nがサーチエリアSRの参照ブロックBrnの総数mであるか否か、すなわち、今の参照ブロックBrnがBrn=Brmであるか否かを判定し、例えば、総数mではないと判定した場合、ステップS9において、カウンタ変数nを1インクリメントし、その処理は、ステップS4に戻る。
【0028】
ステップS8において、カウンタ変数nがサーチエリア内の参照ブロックBrnの総数mである、すなわち、今の参照ブロックBrnがBrn=Brmであると判定された場合、ステップS10において、誤差最小選択部16は、登録されている動きベクトル番号に基づいて動きベクトルを出力する。すなわち、ステップS4乃至S9が繰り返されることにより、差分絶対値和が最小となる参照ブロックBrnに対応するカウンタ変数nが動きベクトル番号として登録されることになるので、誤差最小選択部16は、この動きベクトル番号に対応する参照ブロックBrnのL×L個の画素のうち、その中心となる参照画素Pn(i,j)を求め、カレントフレームFc上の注目画素P(i,j)に対応する参照フレームFr上の画素P’(i,j)を始点とし、参照画素Pn(i,j)を終点とするベクトルを、注目画素P(i,j)の動きベクトル(Vx,Vy)として求めて出力する。
【0029】
図1に構成を示す画像処理装置において、1フレーム当たりの計算量は、1フレームの画素の数×差分絶対値和の計算量×基準ブロックBbに含まれる画素の数×サーチエリアSRに含まれる画素の数で求められる。
【0030】
差分絶対値和の計算量を1クロックで表し、基準ブロックBbに8×8の画素が含まれ、サーチエリアSRに20×20の画素が含まれるとしたとき、1画素についての動きベクトルを求める処理の計算量は、8×8×20×20×1クロック、すなわち25600クロックとなる。
【0031】
膨大な計算量が必要となるので、動画像をリアルタイムで処理することはできない。
【0032】
演算量を少なくするために、ブロックマッチングアルゴリズムの一種として、代表点ブロックマッチングアルゴリズムが用いられている。
【0033】
代表点ブロックマッチングアルゴリズムにおいては、図5に示すように、基準ブロックBbに代えて、代表点ブロックが用いられる。代表点ブロックに含まれる画素のうち、代表点ブロックの中央の画素、または代表点ブロックの所定の位置の画素など、1または複数の画素が代表点として選択される。
【0034】
代表点ブロックマッチングアルゴリズムにおいては、代表点と、サーチエリアSRの参照代表画素との差分絶対値和が算出され、最小の差分絶対値和が選択される。そして、カレントフレームFc上の代表点(i,j)に対応する参照フレームFr上の画素P’(i,j)を始点とし、最小の差分絶対値和に対応する参照代表画素(i,j)を終点とするベクトルが、代表点ブロックの動きベクトル(Vx,Vy)とされ出力される。
【0035】
代表点ブロックマッチングにおいて、計算量は、画素の数×差分絶対値和の計算量×代表点ブロックに含まれる画素の数×サーチエリアSRに含まれる画素の数/代表点ブロックに含まれる画素の数で求められる。
【0036】
差分絶対値和の計算量を1クロックで表し、代表点ブロックに8×8の画素が含まれ、サーチエリアSRに20×20の画素が含まれるとしたとき、1画素についての動きベクトルを求める処理の計算量は、8×8×20×20/(8×8)×1クロック、すなわち400クロックとなる。
【0037】
代表点ブロックマッチングにおいては、計算量が少なくなるが、動きベクトルが代表点ブロックに対して求められるので、動きベクトルの精度は劣化することになる。
【0038】
また、ブロックマッチング法により動きベクトルを検出する時に、定常成分および過渡成分の絶対値差分を累算した値の加重平均から得られる評価値に基づいて動きベクトルを検出することにより、演算量を低減させるようにするものがある(例えば、特許文献1参照)。
【0039】
さらに、参照ブロックおよび探索範囲内の画素値を符号化してコード値に基づいてマッチング演算を行い、演算結果に基づいて第1の動きベクトルを算出し、第1の動きベクトルに応じた動き補償を行った後に第1の動きベクトルに係る候補ブロックを1画素を単位としてずらすことで得られる新たな探索範囲について、画素値の差分に基づくブロックマッチングを行うことにより、第2の動きベクトルを算出して、第1の動きベクトルと第2の動きベクトルの和として最終的な動きベクトルを算出することで、演算を簡素化するものがある(例えば、特許文献2参照)。
【0040】
【特許文献1】
特開平07−087494号公報
【特許文献2】
特開2000−278691号公報
【0041】
【発明が解決しようとする課題】
以上のように、従来は、動きベクトルを検出するためには膨大な計算量を必要とし、迅速に動きベクトルを検出することができなかった。また、より正確な動きベクトルを求める場合、さらに計算量が増加するという問題点があった。
【0042】
本発明はこのような状況に鑑みてなされたものであり、より少ない計算量で、より迅速に、より正確な動きベクトルを検出できるようにすることを目的とする。
【0043】
【課題を解決するための手段】
本発明の画像処理装置は、第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出する第1の特徴量抽出手段と、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域所定の特徴量を有する第1の画素の位置を示す画素位置情報と、所定の特徴量を有する他の第1の画素の画素位置情報が記憶される、領域の次の領域を示す領域位置情報とを記憶させる記憶制御手段と、第1のフレームの第2の画素の特徴量を抽出する第2の特徴量抽出手段と、記憶されている、第1の画素の位置を示す画素位置情報から求まる第1の画素と第2の画素との距離に基づいて、第2の画素の特徴量と同じ特徴量の第1の画素の位置の中から、第2の画素の動きベクトルの算出に用いられる、動いた先が第2の画素である第1の画素の位置を選択する選択手段と、選択された第1の画素の位置、および第2の画素の位置から、第2の画素の動きベクトルを算出する算出手段とを含み、記憶制御手段は、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に空きが無くなった場合、次の領域を示す領域位置情報として、所定の特徴量とは異なる他の特徴量を有する第1の画素の画素位置情報および領域位置情報が記憶される、他の特徴量に対応する第2のアドレスで指定される領域のうち、画素位置情報および領域位置情報が記憶されていない領域を示す情報を記憶させるとともに、第1のアドレスで指定される領域の領域位置情報により示される、第2のアドレスで指定される領域に、所定の特徴量を有する次の第1の画素の画素位置情報と、領域位置情報とを記憶させることを特徴とする。
【0045】
選択手段は、記憶されている、第1の画素の位置を示す画素位置情報から求まる第1の画素と第2の画素との距離に基づいて、第2の画素の特徴量に近似する特徴量の第1の画素の位置の中から、第2の画素の動きベクトルの算出に用いられる、動いた先が第2の画素である第1の画素の位置を選択するようにすることができる。
【0046】
記憶制御手段は、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に空きが無くなった場合、最も多い数の空きの領域に対応する第2のアドレスを選択し、第2のアドレスで指定される領域に、画素位置情報および領域位置情報を記憶させるようにすることができる。
【0047】
第2のフレームの全ての第1の画素について、特徴量毎の第1の画素の数を算出する画素数算出手段をさらに設け、記憶制御手段は、特徴量毎の第1の画素の数を基に、第2のアドレスを予め選択するようにすることができる。
【0048】
本発明の画像処理方法は、第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出する第1の特徴量抽出ステップと、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に、所定の特徴量を有する第1の画素の位置を示す画素位置情報と、所定の特徴量を有する他の第1の画素の画素位置情報が記憶される、領域の次の領域を示す領域位置情報とを記憶させる記憶制御ステップと、第1のフレームの第2の画素の特徴量を抽出する第2の特徴量抽出ステップと、記憶されている、第1の画素の位置を示す画素位置情報から求まる第1の画素と第2の画素との距離に基づいて、第2の画素の特徴量と同じ特徴量の第1の画素の位置の中から、第2の画素の動きベクトルの算出に用いられる、動いた先が第2の画素である第1の画素の位置を選択する選択ステップと、選択された第1の画素の位置、および第2の画素の位置から、第2の画素の動きベクトルを算出する算出ステップとを含み、記憶制御ステップにおいては、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に空きが無くなった場合、次の領域を示す領域位置情報として、所定の特徴量とは異なる他の特徴量を有する第1の画素の画素位置情報および領域位置情報が記憶される、他の特徴量に対応する第2のアドレスで指定される領域のうち、画素位置情報および領域位置情報が記憶されていない領域を示す情報を記憶させるとともに、第1のアドレスで指定される領域の領域位置情報により示される、第2のアドレスで指定される領域に、所定の特徴量を有する次の第1の画素の画素位置情報と、領域位置情報とを記憶させることを特徴とする。
【0049】
本発明の記録媒体のプログラムは、第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出する第1の特徴量抽出ステップと、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に、所定の特徴量を有する第1の画素の位置を示す画素位置情報と、所定の特徴量を有する他の第1の画素の画素位置情報が記憶される、領域の次の領域を示す領域位置情報とを記憶させる記憶制御ステップと、第1のフレームの第2の画素の特徴量を抽出する第2の特徴量抽出ステップと、記憶されている、第1の画素の位置を示す画素位置情報から求まる第1の画素と第2の画素との距離に基づいて、第2の画素の特徴量と同じ特徴量の第1の画素の位置の中から、第2の画素の動きベクトルの算出に用いられる、動いた先が第2の画素である第1の画素の位置を選択する選択ステップと、選択された第1の画素の位置、および第2の画素の位置から、第2の画素の動きベクトルを算出する算出ステップとを含む処理をコンピュータに実行させ、記憶制御ステップにおいては、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に空きが無くなった場合、次の領域を示す領域位置情報として、所定の特徴量とは異なる他の特徴量を有する第1の画素の画素位置情報および領域位置情報が記憶される、他の特徴量に対応する第2のアドレスで指定される領域のうち、画素位置情報および領域位置情報が記憶されていない領域を示す情報を記憶させるとともに、第1のアドレスで指定される領域の領域位置情報により示される、第2のアドレスで指定される領域に、所定の特徴量を有する次の第1の画素の画素位置情報と、領域位置情報とを記憶させることを特徴とする。
【0050】
本発明のプログラムは、第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出する第1の特徴量抽出ステップと、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に、所定の特徴量を有する第1の画素の位置を示す画素位置情報と、所定の特徴量を有する他の第1の画素の画素位置情報が記憶される、領域の次の領域を示す領域位置情報とを記憶させる記憶制御ステップと、第1のフレームの第2の画素の特徴量を抽出する第2の特徴量抽出ステップと、記憶されている、第1の画素の位置を示す画素位置情報から求まる第1の画素と第2の画素との距離に基づいて、第2の画素の特徴量と同じ特徴量の第1の画素の位置の中から、第2の画素の動きベクトルの算出に用いられる、動いた先が第2の画素である第1の画素の位置を選択する選択ステップと、選択された第1の画素の位置、および第2の画素の位置から、第2の画素の動きベクトルを算出する算出ステップとを含む処理をコンピュータに実行させ、記憶制御ステップにおいては、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に空きが無くなった場合、次の領域を示す領域位置情報として、所定の特徴量とは異なる他の特徴量を有する第1の画素の画素位置情報および領域位置情報が記憶される、他の特徴量に対応する第2のアドレスで指定される領域のうち、画素位置情報および領域位置情報が記憶されていない領域を示す情報を記憶させるとともに、第1のアドレスで指定される領域の領域位置情報により示される、第2のアドレスで指定される領域に、所定の特徴量を有する次の第1の画素の画素位置情報と、領域位置情報とを記憶させることを特徴とする。
【0056】
本発明の画像処理装置および方法、記録媒体、並びにプログラムにおいては、第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量が抽出され、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に、所定の特徴量を有する第1の画素の位置を示す画素位置情報と、所定の特徴量を有する他の第1の画素の画素位置情報が記憶される、領域の次の領域を示す領域位置情報とが記憶される。さらに、第1のフレームの第2の画素の特徴量が抽出され、記憶されている、第1の画素の位置を示す画素位置情報から求まる第1の画素と第2の画素との距離に基づいて、第2の画素の特徴量と同じ特徴量の第1の画素の位置の中から、第2の画素の動きベクトルの算出に用いられる、動いた先が第2の画素である第1の画素の位置が選択され、選択された第1の画素の位置、および第2の画素の位置から、第2の画素の動きベクトルが算出される。そして、第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域に空きが無くなった場合、次の領域を示す領域位置情報として、所定の特徴量とは異なる他の特徴量を有する第1の画素の画素位置情報および領域位置情報が記憶される、他の特徴量に対応する第2のアドレスで指定される領域のうち、画素位置情報および領域位置情報が記憶されていない領域を示す情報が記憶されるとともに、第1のアドレスで指定される領域の領域位置情報により示される、第2のアドレスで指定される領域に、所定の特徴量を有する次の第1の画素の画素位置情報と、領域位置情報とが記憶される。
【0058】
【発明の実施の形態】
図6は、本発明に係る画像処理装置の一実施の形態の構成を示すブロック図である。画像処理装置に入力された画像は、特徴量抽出部101および特徴量抽出部103に供給される。
【0059】
特徴量抽出部101は、入力された画像の画素を、例えばラスタスキャン順に参照画素とし、参照画素に対応する特徴量を抽出する。特徴量とは、画素の特徴を表す量である。例えば、特徴量抽出部101は、参照画素を中心とした、3×3のブロックに含まれる画素の画素値を所定の順(例えば、ラスタスキャン順)に並べた値を特徴量とする。参照画素を中心とした、3×3のブロックに含まれる画素の画素値を所定の順に並べた値が特徴量であるとき、ブロックに含まれるいずれかの画素の画素値が変化した場合、特徴量は変化することになる。
【0060】
特徴量抽出部101は、参照画素の画面上の位置を示す画素位置情報と共に、抽出した特徴量を特徴量フレームメモリ102に供給する。
【0061】
特徴量フレームメモリ102は、特徴量抽出部101から供給された、参照画素の画面上の位置を示す画素位置情報、および特徴量を取得し、特徴量に対応するアドレスに画素位置情報を記憶する。
【0062】
図7は、特徴量フレームメモリ102が記憶する画素位置情報および画素位置情報の数の配置を説明する図である。
【0063】
図中においてDで示される四角は、それぞれ、1つの画素位置情報、または1つの画素位置情報の数を格納する格納領域Dを示す。
【0064】
図7において、格納領域Dの縦方向(列方向)の位置は、特徴量アドレスで特定され、1つの(1つの種類の)特徴量に対応する。すなわち、1つの特徴量アドレスは、1つの特徴量を示すと言える。特徴量アドレスが異なる場合、それぞれの特徴量アドレスは、異なる特徴量を示す。図7に示す特徴量フレームメモリ102の例においては、0乃至N−1の範囲のN個の特徴量アドレスが設定されている。言い換えれば、図7に示す特徴量フレームメモリ102は、N種類の特徴量に分類された画素の画素位置情報を記憶することができる。
【0065】
図7において、格納領域Dの横方向(行方向)の位置は、フラグアドレスで特定される。フラグアドレスが0である、図中の左側の列の格納領域Dには、特徴量アドレスで特定される特徴量を有する画素の数が格納される。同じ特徴量の画素の数は、その画素の位置を示す画素位置情報の数と等しいので、フラグアドレスが0である、図中の左側の列の格納領域Dには、同一の特徴量の画素の画素位置情報の数が格納されることになる。言い換えれば、所定の特徴量アドレスで特定される、フラグアドレス0の格納領域Dには、その特徴量アドレスで特定される格納領域Dに格納される画素位置情報の数が格納されることになる。
【0066】
以下、特徴量アドレスがaで、フラグアドレスがbである格納領域Dの位置をアドレス(a,b)と表す。
【0067】
フラグアドレスが1乃至Mである、図中の列の格納領域Dには、特徴量アドレスで特定される特徴量を有する画素の画素位置を示す画素位置情報の1つが格納される。例えば、特徴量アドレス2に対応する特徴量を有する最初の画素の画素位置を示す画素位置情報は、アドレス(2,1)の格納領域Dに格納される。そして、特徴量アドレス2に対応する特徴量を有する2番目の画素の画素位置を示す画素位置情報は、アドレス(2,2)の格納領域Dに格納される。
【0068】
このように、特徴量アドレス2に対応する特徴量が抽出されたとき、その特徴量が抽出された参照画素の画素位置を示す画素位置情報が、特徴量アドレス2で示される格納領域Dであって、フラグアドレス1乃至Mで指定されるものに、図中の左側から右側に順に格納される。
【0069】
同様に、0乃至N−1のいずれかの特徴量アドレスに対応する特徴量が抽出されたとき、その特徴量が抽出された参照画素の画素位置を示す画素位置情報が、0乃至N−1のいずれかの特徴量アドレスで示される格納領域Dであって、フラグアドレス1乃至Mで指定されるものに、図中の左側から右側に順に格納される。
【0070】
各格納領域Dには、例えば、1ワード(例えば、32ビット)の記憶領域を配置することができる。
【0071】
特徴量フレームメモリ102は、以上のように、特徴量によって分類される画素の画素位置情報を順に記憶する。
【0072】
特徴量フレームメモリ102は、カレントフレームFc(現在のフレーム)に対応する画素位置情報と、参照フレームFr(1つ前のフレーム)に対応する画素位置情報とをそれぞれに記憶し、それぞれ読み出すことができる。すなわち、特徴量フレームメモリ102は、カレントフレームFcに対応する図7に示す格納領域Dのページと、参照フレームFrに対応する図7に示す格納領域Dのページとを有し、ページを切り替えることにより、特徴量抽出部101から供給されたカレントフレームFcの画素位置情報を記憶するとともに、記憶されている参照フレームFrの画素位置情報を読み出して、参照画素位置検出部104に供給することができる。
【0073】
特徴量抽出部103は、入力された画像の画素を、例えばラスタスキャン順に注目画素とし、特徴量抽出部101と同様の処理で、注目画素に対応する特徴量を抽出する。例えば、特徴量抽出部101は、参照画素を中心とした、3×3のブロックに含まれる画素の画素値を所定の順に並べた値を特徴量とする。
【0074】
特徴量抽出部103は、注目画素の画面上の位置を示す画素位置情報と共に、抽出した特徴量を参照画素位置検出部104に供給する。
【0075】
なお、特徴量抽出部101または特徴量抽出部103が出力する特徴量を算出するためのブロックに含まれる画素の数は、任意の数とすることができ、3×3に限定されるものではない。特徴量を算出するためのブロックから、所定の数の画素を抽出して、抽出された画素から特徴量を求めるようにしてもよい。
【0076】
また、特徴量抽出部101または特徴量抽出部103が抽出する特徴量は、ブロックに含まれる画素の画素値を並べた値に限らず、注目画素または参照画素の画素値そのもの、画素値の和、画素値の平均値、画素値の上位の所定のビットを抽出した値の配列、和、若しくは平均値などでもよい。
【0077】
さらに、特徴量抽出部101または特徴量抽出部103は、ADRC(Adaptive Dynamic Range Coding)またはラプラシアンなど、画素値に所定の演算を適用して得られた結果を基に特徴量を算出するようにしてもよい。
【0078】
参照画素位置検出部104は、特徴量抽出部103から供給された注目画素の特徴量、および特徴量フレームメモリ102に記憶されている参照フレームFrの画素位置情報を基に、注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置を検出する。参照画素位置検出部104は、検出された注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置から、動いた先が注目画素である参照フレームFrの画素の位置を選択する。そして、参照画素位置検出部104は、注目画素の画素位置情報と参照フレームFrの選択された画素の画素位置とから、注目画素の位置に対応する位置の参照フレームFr上の画素を始点とし、注目画素の特徴量と同じ特徴量を有する参照フレームFrの選択された画素を終点とする動きベクトルを求めて、求めた動きベクトルを出力する。
【0079】
なお、フレームを単位として処理を実行すると説明したが、フィールドを単位として処理を実行するようにしてもよいことは、勿論である。また、処理の対象は、時間的に隣接するフレームまたはフィールドに限らず、時間的に離れたフレームまたはフィールドとすることができる。以下の実施の形態においても同様である。
【0080】
図8は、図6に構成を示す画像処理装置による、動きベクトルの検出の処理を説明するフローチャートである。
【0081】
ステップS101において、特徴量抽出部101および特徴量フレームメモリ102は、参照フレームFrの画素位置情報の格納の処理を実行することにより、画素位置情報を記憶する。画素位置情報の格納の処理の詳細は、図9のフローチャートを参照して、後述する。
【0082】
ステップS102において、特徴量抽出部103および参照画素位置検出部104は、注目画素に対応する画素の位置の検出の処理を実行して、注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置を検出する。注目画素に対応する画素の位置の検出の処理の詳細は、図10のフローチャートを参照して、後述する。
【0083】
ステップS103において、参照画素位置検出部104は、特徴量抽出部103から供給された注目画素の画素位置情報、およびステップS102の処理で検出された、参照フレームFrの画素の画素位置を基に、動きベクトルを求める。例えば、参照画素位置検出部104は、注目画素の位置に対応する位置の参照フレームFr上の画素を始点とし、注目画素の特徴量と同じ特徴量を有する参照フレームFrの画素を終点とする動きベクトルを求める。
【0084】
ステップS104において、参照画素位置検出部104は、ステップS103の処理で求めた動きベクトルを出力して、処理は終了する。
【0085】
図9は、ステップS101に対応する、画素位置情報の格納の処理を説明するフローチャートである。
【0086】
ステップS121において、特徴量フレームメモリ102は、特徴量フレームメモリ102に格納されているデータを初期化する。例えば、特徴量フレームメモリ102は、フラグアドレスが0である格納領域Dに0を設定し、フラグアドレスが1乃至Mである格納領域Dにヌル(null)を設定することにより、データを初期化する。
【0087】
ステップS122において、特徴量抽出部101は、カウンタ変数nを初期化する。カウンタ変数nは、処理の対象となる画素の数を数えるための変数である。例えば、特徴量フレームメモリ102は、ステップS122において、カウンタ変数nに1を設定する。
【0088】
ステップS123において、特徴量抽出部101は、参照フレームFrの画素のなかからまだ参照画素とされていない画素を選択して参照画素とする。特徴量抽出部101は、参照画素に対応するブロックの特徴量を算出することにより、参照画素の特徴量を抽出し、参照画素の位置を示す画素位置情報と共に、抽出した特徴量を特徴量フレームメモリ102に供給する。例えば、特徴量抽出部101は、参照画素を中心とした、3×3のブロックに含まれる画素の画素値をラスタスキャン順に並べた値である特徴量を算出する。
【0089】
ステップS124において、特徴量フレームメモリ102は、ステップS123の処理で算出された特徴量に対応する画素位置情報の数を読み出す。例えば、参照画素の特徴量に対応する特徴量アドレスがkであるとき、特徴量フレームメモリ102は、アドレス(k,0)の格納領域Dから、特徴量に対応する画素位置情報の数を読み出す。
【0090】
ステップS125において、特徴量フレームメモリ102は、ステップS124の処理で読み出した画素位置情報の数をインクリメントする。すなわち、特徴量フレームメモリ102は、ステップS124の処理で読み出した画素位置情報の数に1を加算する。
【0091】
ステップS126において、特徴量フレームメモリ102は、ステップS125の処理でインクリメントされた画素位置情報の数を記憶する。例えば、特徴量フレームメモリ102は、特徴量に対応する特徴量アドレスがkであるとき、アドレス(k,0)の格納領域Dに、インクリメントされた画素位置情報の数を書き込む。
【0092】
ステップS127において、特徴量フレームメモリ102は、特徴量に対応する特徴量アドレスと、画素位置情報の数に対応するフラグアドレスとから特定されるアドレスの格納領域Dに、参照画素の画素位置を示す画素位置情報を書き込む。例えば、特徴量フレームメモリ102は、参照画素の特徴量に対応する特徴量アドレスがkであり、画素位置情報の数がqであるとき、アドレス(k,q)の格納領域Dに、参照画素の画素位置を示す画素位置情報を書き込む。
【0093】
このようにすることで、同じ特徴量の画素を示す画素位置情報は、同じ特徴量アドレスの格納領域Dに、図7中の左側から右側に向かって順に格納されることになる。ここで、1つの格納領域Dは、1つの画素位置情報を格納する。
【0094】
ステップS128において、特徴量抽出部101は、カウンタ変数nをインクリメントする。すなわち、特徴量抽出部101は、カウンタ変数nに1を加算する。
【0095】
ステップS129において、特徴量抽出部101は、カウンタ変数nの値が、フレームの画素の数に等しいか否かを判定し、カウンタ変数nの値が、フレームの画素の数に等しくないと判定された場合、まだ、参照画素とされていない画素がある、すなわち特徴量が抽出されていない画素があるので、ステップS123に戻り、上述した処理を繰り返し、次の参照画素について特徴量を抽出して、画素位置情報を特徴量フレームメモリ102に格納する。
【0096】
ステップS129において、カウンタ変数nの値が、フレームの画素の数に等しいと判定された場合、フレームの全ての画素が参照画素とされ、フレームの全ての画素の特徴量が抽出されて、全ての画素に対応する画素位置情報が特徴量フレームメモリ102に格納されたので、処理は終了する。
【0097】
図10は、ステップS102の処理に対応する、注目画素に対応する画素位置の検出の処理を説明するフローチャートである。
【0098】
ステップS141において、参照画素位置検出部104は、カウンタ変数nを初期化する。カウンタ変数nは、処理の対象となる画素の数を数えるための変数である。例えば、特徴量フレームメモリ102は、ステップS141において、カウンタ変数nに1を設定する。
【0099】
ステップS142において、特徴量抽出部103は、特徴量抽出部101と同様の処理で、カレントフレームFcの画素のうち、まだ注目画素とされていない画素のなかから注目画素を選択する。特徴量抽出部103は、選択された注目画素に対応するブロックの特徴量を算出することにより、注目画素の特徴量を抽出し、注目画素の画面上の位置を示す画素位置情報と共に、抽出した特徴量を参照画素位置検出部104に供給する。例えば、特徴量抽出部103は、注目画素を中心とした、3×3のブロックに含まれる画素の画素値をラスタスキャン順に並べた値である特徴量を算出する。
【0100】
ステップS143において、参照画素位置検出部104は、特徴量フレームメモリ102から、ステップS142の処理で算出された特徴量に対応する画素位置情報を読み出す。すなわち、参照画素位置検出部104は、ステップS142の処理で特徴量抽出部103から供給された特徴量と同一の特徴量の画素の位置を示す画素位置情報を読み出す。
【0101】
より具体的には、特徴量抽出部103から供給された注目画素の特徴量に対応する特徴量アドレスがkであるとき、参照画素位置検出部104は、特徴量フレームメモリ102のアドレス(k,0)である格納領域Dから画素位置情報の数qを読み出す。そして、参照画素位置検出部104は、特徴量フレームメモリ102のアドレス(k,1)乃至(k,q)である格納領域Dから、q個の画素位置情報を読み出す。
【0102】
ステップS144において、参照画素位置検出部104は、注目画素の動きに対応した参照画素の位置として(動いた先が注目画素である参照画素の位置として)、ステップS143の処理で読み出した画素位置情報で示される画素の位置のうち、注目画素に最も近い画素の位置を選択する。すなわち、参照画素位置検出部104は、画素位置情報で示される参照画素(の位置)Pn(i,j)と注目画素P(の位置)(i,j)との距離を求め、距離が最小の参照画素の位置を選択する。
【0103】
なお、参照画素位置検出部104は、注目画素の動きに対応した参照画素の位置として、注目画素に最も近い画素の位置を選択すると説明したが、注目画素に最も近い画素の位置に限らず、注目画素の画素値に最も近い画素値を有する参照画素の位置、または注目画素を含む所定のブロックの画素の画素値に最も近い画素値の画素からなるブロックに対応する参照画素の位置など、他の基準を基に、動いた先が注目画素である参照画素の位置を選択するようにしてもよい。
【0104】
以下に説明する、画素の位置を選択する処理においても同様である。
【0105】
ステップS145において、参照画素位置検出部104は、選択された画素の位置と注目画素の位置との距離が、予め定めた閾値より短いか否かを判定し、選択された画素の位置と注目画素の位置との距離が、予め定めた閾値より短いと判定された場合、注目画素の動きに対応した正しい画素の位置が選択されたので、ステップS152に進む。
【0106】
ステップS145において、選択された画素の位置と注目画素の位置との距離が、予め定めた閾値以上であると判定された場合、注目画素の動きに対応した正しい画素の位置が選択されていないので、ステップS146に進み、参照画素位置検出部104は、注目画素に対応するブロックの特徴量の近傍の特徴量を選択する。ここで、近傍の特徴量とは、近似の特徴を有する画素を示す特徴量をいう。例えば、所定のブロックに含まれる各画素の画素値に近い画素値を有する画素からなるブロックから算出される特徴量は、元のブロックの特徴量の近傍の特徴量である。また、所定のブロックに含まれる画素の各画素値の変化(例えば、画素値の差分の並び)と同様に変化し、元の画素値に近い画素値を有する画素からなるブロックから算出される特徴量は、元のブロックの近傍の特徴量である。
【0107】
例えば、元のブロックに含まれる1つの画素の画素値の最下位ビットを反転させて得られたブロックから算出される特徴量は、元のブロックの特徴量の近傍の特徴量である。特徴量が3×3のブロックに含まれる画素の画素値を所定の順に並べた値が特徴量であるとき、ブロックに含まれる全ての画素値の最下位ビットを反転させたブロックの特徴量は、元のブロックの特徴量の近傍の特徴量である。
【0108】
ステップS147において、参照画素位置検出部104は、特徴量フレームメモリ102から、近傍の特徴量に対応する画素位置情報を読み出す。すなわち、参照画素位置検出部104は、ステップS146の処理で選択された近傍の特徴量と同一の特徴量の画素の位置を示す画素位置情報を読み出す。より具体的には、例えば、近傍の特徴量に対応する特徴量アドレスがk’であるとき、参照画素位置検出部104は、特徴量フレームメモリ102のアドレス(k’,0)である格納領域Dから画素位置情報の数q’を読み出す。そして、参照画素位置検出部104は、特徴量フレームメモリ102のアドレス(k’,1)乃至(k’,q’)である格納領域Dから、q’個の画素位置情報を読み出す。
【0109】
ステップS148において、参照画素位置検出部104は、動いた先が注目画素である画素の位置として、ステップS147の処理で読み出した画素位置情報で示される画素の位置のうち、注目画素に最も近い画素の位置を選択する。
【0110】
ステップS149において、参照画素位置検出部104は、選択された画素の位置と注目画素の位置との距離が、予め定めた閾値より短いか否かを判定し、選択された画素の位置と注目画素の位置との距離が、予め定めた閾値より短いと判定された場合、注目画素の動きに対応した正しい画素の位置が選択されたので、ステップS152に進む。
【0111】
ステップS149において、選択された画素の位置と注目画素の位置との距離が、予め定めた閾値以上であると判定された場合、注目画素の動きに対応した正しい画素の位置が選択されていないので、ステップS150に進み、参照画素位置検出部104は、所定の範囲の近傍の特徴量を全て選択したか否かを判定する。
【0112】
例えば、参照画素位置検出部104は、特徴量が3×3のブロックに含まれる画素の画素値を所定の順に並べた値が特徴量抽出部103から供給された特徴量であるとき、選択する近傍の特徴量の範囲には、ブロックに含まれる全ての画素値の最下位ビットを反転させたブロックの特徴量、ブロックに含まれる全ての画素値の下位2ビットを反転させたブロックの特徴量、およびブロックに含まれる全ての画素値の下位3ビットを反転させたブロックの特徴量を含めることができる。
【0113】
ステップS150において、所定の範囲の近傍の特徴量を全て選択していないと判定された場合、まだ選択すべき近傍の特徴量があるので、ステップS146に戻り、他の近傍の特徴量を選択して、ステップS147乃至ステップS149の処理を繰り返す。
【0114】
ステップS150において、所定の範囲の近傍の特徴量を全て選択したと判定された場合、近傍の特徴量にも注目画素の動きに対応した正しい画素がないので、ステップS151に進み、参照画素位置検出部104は、予め定めた値を画素位置に設定して、ステップS152に進む。ステップS151において、参照画素位置検出部104は、エラーコードを注目画素に対応して設定するようにしてもよい。
【0115】
ステップS152において、参照画素位置検出部104は、カウンタ変数nをインクリメントする。すなわち、特徴量抽出部101は、カウンタ変数nに1を加算する。
【0116】
ステップS153において、参照画素位置検出部104は、カウンタ変数nの値が、フレームの画素の数に等しいか否かを判定し、カウンタ変数nの値が、フレームの画素の数に等しくないと判定された場合、まだ、注目画素とされていない画素がある、すなわち対応する画素の位置が検出されていない画素があるので、ステップS142に戻り、上述した処理を繰り返し、次の注目画素に対応する画素の位置を検出する。
【0117】
ステップS153において、カウンタ変数nの値が、フレームの画素の数に等しいと判定された場合、まだ、フレームの全ての画素が注目画素とされ、フレームの全ての画素に対応する画素の位置が検出されたので、処理は終了する。
【0118】
以上のように、図6に構成を示す画像処理装置は、従来に比較して、より少ない演算量で、より迅速に、より正確な動きベクトルを検出することができる。
【0119】
しかしながら、特徴量フレームメモリ102において、フラグアドレスに対応したメモリ領域の大きさは、画素位置情報の最大数、すなわち1フレーム当たりの画素の数から決定される。すなわち、特徴量フレームメモリ102において、メモリ領域の全体の大きさは、画素位置情報の最大数×特徴量の数となる。
【0120】
従って、特徴量フレームメモリ102において、特徴量アドレスで特定される領域のうち、画素位置情報の最大数、すなわち画素の数にならない、特徴量アドレスで特定される領域Dには、空きが生じることになる。
【0121】
ここで、特徴量フレームメモリ102において、処理中にメモリアロケーションが静的に変化することはない。上述した特徴量アドレッシングでは、特徴量アドレス毎に画素位置情報が格納される。
【0122】
また、それぞれの特徴量アドレスに対応して特徴量フレームメモリ102に格納される画素位置情報の数は、処理の対象となる、入力される画像、フレームによって、変化する。これは、特徴量に対応する画素の数が、画像、またはフレームによって変化するためである。
【0123】
図11は、本発明に係る画像処理装置の他の実施の形態の構成を示すブロック図である。図6に示す場合と同様の部分には、同一の番号を付してあり、その説明は省略する。
【0124】
アドレス生成部201は、特徴量抽出部101から供給された特徴量および画素位置情報を基に、画素位置情報を書き込むべきアドレスを生成し、画素位置情報と共に、生成したアドレスを特徴量フレームメモリ202に供給する。アドレス生成部201は、各特徴量毎の画素位置情報の数を算出して、算出した画素位置情報の数を特徴量フレームメモリ202に供給する。また、アドレス生成部201は、特徴量フレームメモリ202に格納されているクラスタに格納すべき、次の特徴量アドレスおよび次のクラスタ番号を生成して、生成した次の特徴量アドレスおよび次のクラスタ番号を特徴量フレームメモリ202に供給する。
【0125】
詳細は後述するが、特徴量フレームメモリ202のクラスタは、1または2以上の所定の数の画素位置情報を格納する。次の特徴量アドレスは、その次の特徴量アドレスが格納されているクラスタに続いて同一の特徴量の画素位置情報が格納される、次のクラスタの特徴量アドレスを示す。次のクラスタ番号は、その次のクラスタ番号が格納されているクラスタに続いて同一の特徴量の画素位置情報が格納される、次のクラスタのクラスタアドレスを示す。
【0126】
特徴量フレームメモリ202は、クラスタを単位として、アドレス生成部201から供給されたアドレスを基に、特徴量に対応する画素位置情報を記憶する。
【0127】
図12は、特徴量フレームメモリ202が記憶するクラスタおよび画素位置情報の数の配置を説明する図である。
【0128】
図12において、クラスタの縦方向(列方向)の位置は、特徴量アドレスで特定され、原則として、1つの(1つの種類の)特徴量に対応する。すなわち、特徴量フレームメモリ202においても、1つの特徴量アドレスは、1つの特徴量を示すと言える。特徴量アドレスが異なる場合、それぞれの特徴量アドレスは、異なる特徴量を示す。図12に示す特徴量フレームメモリ202の例においては、0乃至N−1の範囲のN個の特徴量アドレスが設定されている。言い換えれば、図12に示す特徴量フレームメモリ202は、N種類の特徴量に分類された画素の画素位置情報を格納することができる。
【0129】
特徴量フレームメモリ202には、0乃至N−1の範囲のN個の特徴量アドレスに対応して、それぞれの特徴量アドレスに対応した同一の特徴量の画素の画素位置情報の数が格納される。図12中のL0には、特徴量アドレス0に対応する特徴量の画素の画素位置情報の数が格納される。L1には、特徴量アドレス1に対応する特徴量の画素の画素位置情報の数が格納される。同様に、L2乃至LN-1のそれぞれには、特徴量アドレス2乃至特徴量アドレスN−1のそれぞれに対応する特徴量の画素の画素位置情報の数が格納される。
【0130】
図12において、クラスタの横方向(行方向)の位置は、クラスタアドレスで特定される。
【0131】
以下、特徴量アドレスがaで、クラスタアドレスがbの位置をアドレス(a,b)と表す。
【0132】
原則として、クラスタアドレスが1乃至Rである、図中の列のクラスタは、1つまたは2以上の、特徴量アドレスで特定される特徴量を有する画素の画素位置を示す画素位置情報を格納する。ここでRは、特徴量フレームメモリ202の1行に配置できるクラスタの最大数、すなわちクラスタアドレスの最大値を示す。
【0133】
図13は、クラスタの構成の例を説明する図である。
【0134】
図13に示すクラスタは、Q個の画素位置情報を格納するとともに、次の特徴量アドレスおよび次のクラスタ番号を格納する。1つのクラスタに格納される、Q個の画素位置情報が示す位置の画素の特徴量は、同一である。
【0135】
クラスタに格納されている、次の特徴量アドレスおよび次のクラスタ番号は、Q個の画素位置情報で示される位置の画素の特徴量と同一の特徴量の画素の画素位置情報が格納される、次のクラスタを特定するための情報である。すなわち、クラスタに格納されている次の特徴量アドレスを特徴量アドレスとし、次のクラスタ番号をクラスタアドレスとして、アドレスが特定される次のクラスタは、次の特徴量アドレスおよび次のクラスタ番号を格納しているクラスタに格納されている画素位置情報で示される位置の画素の特徴量と同じ特徴量の画素の画素位置情報を格納する。例えば、アドレス(K,R)のクラスタに格納されている次の特徴量アドレスがSであり、次のクラスタ番号がRであるとき、次のクラスタのアドレスは、アドレス(S,R)である。アドレス(S,R)のクラスタには、アドレス(K,R)のクラスタに格納されている画素位置情報で示される位置の画素の特徴量と同じ特徴量の画素の画素位置情報が格納される。
【0136】
例えば、特徴量アドレスKに対応する特徴量を有する最初の画素の画素位置を示す画素位置情報は、アドレス(K,1)のクラスタに格納される。アドレス(K,1)のクラスタに順に、次の画素の画素位置情報が順に格納される。
【0137】
そして、アドレス(K,1)のクラスタがいっぱいになったとき、すなわち、これ以上画素位置情報をクラスタに格納することができなくなったとき、特徴量アドレスKに対応する特徴量を有する次の画素の画素位置を示す画素位置情報は、アドレス(K,2)のクラスタに格納される。アドレス(K,1)のクラスタには、アドレス(K,2)のクラスタを示す、次の特徴量アドレスおよび次のクラスタ番号が格納される。
【0138】
このように、アドレス(K,1)のクラスタ乃至アドレス(K,R)のクラスタに、特徴量アドレスKに対応する特徴量の画素の画素位置情報が順に格納することができる。アドレス(K,1)のクラスタ乃至アドレス(K,R)のクラスタに、特徴量アドレスKに対応する特徴量の画素の画素位置情報が順に格納されたとき、アドレス(K,1)のクラスタ乃至アドレス(K,R−1)のクラスタには、それぞれ、次のクラスタとして、アドレス(K,2)のクラスタ乃至アドレス(K,R)のクラスタを示す、次の特徴量アドレスおよび次のクラスタ番号が格納されることになる。
【0139】
そして、アドレス(K,1)のクラスタ乃至アドレス(K,R)のクラスタの全てがいっぱいになったとき、すなわち、特徴量アドレスKのクラスタにこれ以上画素位置情報を格納することができなくなったとき、さらに特徴量アドレスKに対応する特徴量を有する次の画素の画素位置を示す画素位置情報を特徴量フレームメモリ202に格納する場合、最も少ない数のクラスタが配置されている特徴量アドレスが探索される。最も少ない数のクラスタが配置されている特徴量アドレスがSであるとき、アドレス(S,R)のクラスタが、アドレス(K,R)のクラスタの次のクラスタとされる。
【0140】
特徴量アドレスKに対応する特徴量を有する次の画素の画素位置を示す画素位置情報は、アドレス(S,R)のクラスタに格納される。アドレス(K,R)のクラスタには、アドレス(S,R)のクラスタの位置を示す、次の特徴量アドレスおよび次のクラスタ番号が格納される。そして、特徴量アドレスKに対応する特徴量を有するさらに次の画素の画素位置を示す画素位置情報は、アドレス(S,R)のクラスタがいっぱいになるまで、アドレス(S,R)のクラスタに格納される。
【0141】
特徴量フレームメモリ202は、以上のように、特徴量に対応する特徴量アドレスのクラスタに特徴量が格納しきれなくなったとき、空き領域の最も大きい他の特徴量アドレスのクラスタに画素位置情報を順に記憶する。同じ特徴量の画素の画素位置を示す画素位置情報を格納しているクラスタの位置は、順に、クラスタに格納されている、次の特徴量アドレスおよび次のクラスタ番号で特定される。
【0142】
このようにすることで、特徴量フレームメモリ202の記憶領域を有効に使用することができるようになり、予め、最大の画素位置情報の数であるフレームの画素の数と同じ画素位置情報を1つの特徴量アドレスに確保する必要がなくなる。すなわち、図11に構成を示す画像処理装置においては、全体として、画素の数に近い、より少ない記憶領域で、1フレームの画素に対応する画素位置情報を記憶することができるようになる。
【0143】
なお、特徴量フレームメモリ202を、バーストRAM(バーストDRAM、バーストSRAM、またはパイプライン・バーストSRAMなど)で構成し、クラスタを、4ワード乃至8ワード(1ワードは32ビット)とすれば、1つのアドレス情報を基に複数のデータを連続して転送する、いわゆるバースト転送により、1クラスタを単位として、より迅速に、書き込みまたは読み出すことができるようになる。
【0144】
特徴量フレームメモリ202は、特徴量フレームメモリ102の場合と同様に、カレントフレームFc(現在のフレーム)に対応する画素位置情報と、参照フレームFr(1つ前のフレーム)に対応する画素位置情報とをそれぞれに記憶し、それぞれ読み出すことができる。
【0145】
図11に戻り、参照画素位置検出部203は、特徴量抽出部103から供給された注目画素の特徴量、およびクラスタを単位として特徴量フレームメモリ202に記憶されている参照フレームFrの画素位置情報を基に、注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置を検出する。そして、参照画素位置検出部203は、検出された注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置から、動いた先が注目画素である参照フレームFrの画素の位置を選択する。そして、参照画素位置検出部203は、特徴量抽出部103から供給された注目画素の画素位置情報と参照フレームFrの選択された画素の画素位置とから、注目画素の位置に対応する位置の参照フレームFr上の画素を始点とし、注目画素の特徴量と同じ特徴量を有する参照フレームFrの選択された画素を終点とする動きベクトルを求めて、求めた動きベクトルを出力する。
【0146】
図14は、アドレス生成部201の構成の例を示すブロック図である。
【0147】
メモリ状態記憶部221は、アドレスを生成する時点における、特徴量フレームメモリ202の画素位置情報の記憶の状態を示すデータを記憶する。例えば、メモリ状態記憶部221は、特徴量フレームメモリ202の、1つの特徴量アドレスごとに、画素位置情報の記憶の状態を示すデータを記憶する。より具体的に説明すれば、メモリ状態記憶部221は、特徴量フレームメモリ202の、1つの特徴量アドレスごとに、その特徴量アドレスに対応する特徴量の画素の位置を示す画素位置情報の数、その特徴量アドレスに対応する特徴量の画素の位置を示す画素位置情報を格納しているクラスタの数、その特徴量アドレスに対応する、次の画素位置情報を格納しようとするクラスタに格納されている画素位置情報の数、その特徴量アドレスに対応する、次の画素位置情報を格納しようとするクラスタが配置されている特徴量アドレス、その特徴量アドレスに対応する、次の画素位置情報を格納しようとするクラスタが配置されているクラスタアドレス、およびその特徴量アドレスに対応する特徴量の画素の画素位置情報を格納するクラスタの最大数(クラスタの最大数Rから、他の特徴量アドレスに対応する特徴量の画素の画素位置情報を格納するクラスタの数を引き算した数)などを記憶する。
【0148】
例えば、メモリ状態記憶部221は、特徴量アドレス0に対応して、特徴量アドレス0に対応する特徴量の画素の位置を示す画素位置情報の数をMレジスタに格納し、特徴量アドレス0に対応する特徴量の画素の位置を示す画素位置情報を格納しているクラスタの数をIレジスタに格納し、特徴量アドレス0に対応する、次の画素位置情報を格納しようとするクラスタに格納されている画素位置情報の数をQレジスタに格納する。メモリ状態記憶部221は、特徴量アドレス0に対応して、特徴量アドレス0に対応する、次の画素位置情報を格納しようとするクラスタが配置されている特徴量アドレスを記憶先特徴量レジスタに格納し、特徴量アドレス0に対応する、次の画素位置情報を格納しようとするクラスタが配置されているクラスタアドレスをクラスタ現在位置レジスタに格納し、特徴量アドレス0に対応する特徴量の画素の画素位置情報を格納するクラスタの最大数をIMAXレジスタに格納する。
【0149】
メモリ状態記憶部221は、特徴量アドレス1乃至特徴量アドレスN−1のそれぞれに対応して、特徴量アドレス1乃至特徴量アドレスN−1のそれぞれに対応する特徴量の画素の位置を示す画素位置情報の数をMレジスタに格納し、特徴量アドレス1乃至特徴量アドレスN−1のそれぞれに対応する特徴量の画素の位置を示す画素位置情報を格納しているクラスタの数をIレジスタに格納し、特徴量アドレス1乃至特徴量アドレスN−1のそれぞれに対応する、次の画素位置情報を格納しようとするクラスタに格納されている画素位置情報の数をQレジスタに格納する。メモリ状態記憶部221は、特徴量アドレス1乃至特徴量アドレスN−1のそれぞれに対応して、特徴量アドレス1乃至特徴量アドレスN−1のそれぞれに対応する、次の画素位置情報を格納しようとするクラスタが配置されている特徴量アドレスを記憶先特徴量レジスタに格納し、特徴量アドレス1乃至特徴量アドレスN−1のそれぞれに対応する、次の画素位置情報を格納しようとするクラスタが配置されているクラスタアドレスをクラスタ現在位置レジスタに格納し、特徴量アドレス1乃至特徴量アドレスN−1のそれぞれに対応する特徴量の画素の画素位置情報を格納するクラスタの最大数をIMAXレジスタに格納する。
【0150】
判断部222は、メモリ状態記憶部221に記憶されている、特徴量フレームメモリ202の画素位置情報の記憶の状態を示すデータを基に、各特徴量アドレスに対応する特徴量毎の画素位置情報の数を求めて、各特徴量アドレスに対応する特徴量毎の画素位置情報の数を出力する。例えば、判断部222は、Mレジスタに格納されている、各特徴量アドレスに対応する特徴量の画素の位置を示す画素位置情報の数を、画素位置情報の数として出力する。
【0151】
判断部222は、メモリ状態記憶部221に記憶されている、特徴量フレームメモリ202の画素位置情報の記憶の状態を示すデータを基に、クラスタに格納される、次の特徴量アドレスおよび次のクラスタ番号を求めて、次の特徴量アドレスおよび次のクラスタ番号を出力する。例えば、判断部222は、記憶先特徴量レジスタに格納されている、次の画素位置情報を格納しようとするクラスタが配置されている特徴量アドレスを、次の特徴量アドレスとして出力し、クラスタ現在位置レジスタに格納に格納されている、次の画素位置情報を格納しようとするクラスタが配置されているクラスタアドレスを、次のクラスタ番号として出力する。
【0152】
アドレス算出部223は、メモリ状態記憶部221に記憶されている、特徴量フレームメモリ202の画素位置情報の記憶の状態を示すデータを基に、画素位置情報を格納するクラスタを指定するアドレスを生成して、生成したアドレスを出力する。
【0153】
図15は、図11に構成を示す画像処理装置による、動きベクトルの検出の処理を説明するフローチャートである。
【0154】
ステップS201において、特徴量抽出部101、アドレス生成部201、および特徴量フレームメモリ202は、参照フレームFrの画素位置情報の格納の処理を実行することにより、参照フレームFrの画素位置情報を記憶する。画素位置情報の格納の処理の詳細は、図16のフローチャートを参照して、後述する。
【0155】
ステップS202において、特徴量抽出部103および参照画素位置検出部203は、注目画素に対応する画素の位置の検出の処理を実行して、注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置を検出する。注目画素に対応する画素の位置の検出の処理の詳細は、図19のフローチャートを参照して、後述する。
【0156】
ステップS203およびステップS204の処理は、図8のステップS103およびステップS104の処理とそれぞれ同様なので、その説明は省略する。
【0157】
図16は、ステップS201の処理に対応する、画素位置情報の格納の処理を説明するフローチャートである。
【0158】
ステップS221およびステップS222の処理は、図9のステップS121およびステップS122の処理とそれぞれ同様なので、その説明は省略する。
【0159】
ステップS223において、アドレス生成部201は、メモリ状態記憶部221に記憶されているデータを初期化する。例えば、アドレス生成部201は、メモリ状態記憶部221のMレジスタ、Iレジスタ、およびQレジスタに0を設定し、記憶先特徴量レジスタに、対応する特徴量アドレスを設定し、IMAXレジスタに、Rを設定し、クラスタ現在位置レジスタに、0を設定する。
【0160】
ステップS225において、アドレス生成部201は、画素位置情報を格納するクラスタおよびクラスタ上の位置を示すアドレスを生成する、アドレスの生成の処理を実行する。アドレスの生成の処理の詳細は、図17および図18のフローチャートを参照して後述する。
【0161】
ステップS226において、アドレス生成部201は、特徴量に対応する画素位置情報の数を特徴量フレームメモリ202に書き込む。
【0162】
ステップS227において、特徴量フレームメモリ202は、ステップS225の処理で生成され、アドレス生成部201から供給されたアドレスを基に、画素位置情報を所定のクラスタに書き込む。また、特徴量フレームメモリ202は、アドレス生成部201から次の特徴量アドレスおよび次のクラスタ番号が供給されたとき、アドレス生成部201から供給された、次の特徴量アドレスおよび次のクラスタ番号を所定のクラスタ(前回、画素位置情報が記憶されたクラスタ)に記憶させる。
【0163】
ステップS228およびステップS229の処理は、図9のステップS128およびステップS129の処理とそれぞれ同様なので、その説明は省略する。
【0164】
次に、ステップS225の処理に対応する、アドレス生成の処理を図17および図18のフローチャートを参照して説明する。
【0165】
ステップS251において、判断部222は、メモリ状態記憶部221から、ステップS224の処理で算出された特徴量に対応する、Mレジスタ、Iレジスタ、Qレジスタ、記憶先特徴量レジスタ、IMAXレジスタ、およびクラスタ現在位置レジスタの値を読み出す。すなわち、判断部222は、メモリ状態記憶部221から、特徴量に対応する特徴量アドレスの、Mレジスタ、Iレジスタ、Qレジスタ、記憶先特徴量レジスタ、IMAXレジスタ、およびクラスタ現在位置レジスタの値を読み出す。
【0166】
ステップS252において、判断部222は、Qレジスタの値が、クラスタに格納できる画素位置情報の最大数に等しいか否かを判定し、Qレジスタの値が、クラスタに格納できる画素位置情報の最大数に等しくないと判定された場合、現在の格納先のクラスタにまだ空きがあるので、ステップS253に進み、現在の画像位置情報の格納先であるクラスタの画像位置情報の格納位置を示すQレジスタの値をインクリメントする。判断部222は、インクリメントされた値をメモリ状態記憶部221の特徴量に対応する特徴量アドレスのQレジスタに格納する。
【0167】
ステップS254において、判断部222は、特徴量に対応する画像位置情報の数を示すMレジスタの値をインクリメントする。判断部222は、インクリメントされた値をメモリ状態記憶部221の特徴量に対応する特徴量アドレスのMレジスタに格納する。
【0168】
ステップS255において、判断部222は、記憶先特徴量レジスタの値が、特徴量に等しいか否かを判定し、記憶先特徴量レジスタの値が、特徴量に等しいと判定された場合、特徴量に対応する特徴量アドレスで特定されるクラスタに画素位置情報が格納されるので、ステップS256に進み、アドレス算出部223は、特徴量、Iレジスタの値、およびステップS253の処理でインクリメントされたQレジスタの値から、画素位置情報を格納するアドレスを算出して、処理は終了する。例えば、特徴量がKであり、Iレジスタが3であり、インクリメントされたQレジスタの値が4であるとき、画素位置情報を格納するクラスタのアドレスとして、アドレス(K,3)が算出され、さらに、アドレス(K,3)のクラスタの先頭から4番目の画素位置情報を格納する領域を指定するアドレスが算出される。
【0169】
ステップS255において、記憶先特徴量レジスタの値が、特徴量に等しくないと判定された場合、特徴量に対応する特徴量アドレス以外の特徴量アドレスで特定されるクラスタに画素位置情報が格納されるので、ステップS257に進み、アドレス算出部223は、記憶先特徴量レジスタの値、クラスタ現在位置レジスタの値、およびステップS253の処理でインクリメントされたQレジスタの値から、画素位置情報を格納するアドレスを算出して、処理は終了する。例えば、記憶先特徴量レジスタの値がSであり、クラスタ現在位置レジスタの値が2であり、インクリメントされたQレジスタの値が3であるとき、画素位置情報を格納するクラスタのアドレスとして、アドレス(S,2)が算出され、さらに、アドレス(S,2)のクラスタの先頭から3番目の画素位置情報を格納する領域を指定するアドレスが算出される。
【0170】
ステップS252において、Qレジスタの値が、クラスタに格納できる画素位置情報の最大数に等しいと判定された場合、現在の格納先のクラスタに空きがないので、ステップS258に進み、判断部222は、Iレジスタの値が、IMAXレジスタの値以上であるか否かを判定する。
【0171】
ステップS258において、Iレジスタの値が、IMAXレジスタの値以上でないと判定された場合、特徴量に対応する特徴量アドレスで特定される領域にさらにクラスタを配置することができるので、ステップS259に進み、判断部222は、画素位置情報を格納しているクラスタの数を示すIレジスタの値をインクリメントする。判断部222は、インクリメントされた値をメモリ状態記憶部221の特徴量に対応する特徴量アドレスのIレジスタに格納する。
【0172】
ステップS260において、アドレス生成部201は、特徴量フレームメモリ202に、現在のクラスタの次にクラスタを生成させる。すなわち、アドレス生成部201は、特徴量フレームメモリ202に、特徴量に対応する特徴量アドレスと、インクリメントされたIレジスタの値をクラスタアドレスとする位置に、クラスタを生成させる。例えば、特徴量に対応する特徴量アドレスがKであり、インクリメントされたIレジスタの値がRであるとき、アドレス生成部201は、特徴量フレームメモリ202に、アドレス(K,R)の位置のクラスタを生成させる。
【0173】
ステップS261において、判断部222は、Qレジスタの値を初期化する。判断部222は、メモリ状態記憶部221の、特徴量に対応する特徴量アドレスのQレジスタの値を初期化する。例えば、判断部222は、特徴量に対応する特徴量アドレスがKであるとき、特徴量アドレスKに対応するQレジスタの値を1に設定する。
【0174】
ステップS262において、判断部222は、Mレジスタの値をインクリメントする。判断部222は、インクリメントしたMレジスタの値を、特徴量に対応する特徴量アドレスのMレジスタに設定する。
【0175】
ステップS263において、アドレス算出部223は、ステップS260の処理で生成したクラスタの最初の特徴量の指定するアドレスを生成する。例えば、例えば、特徴量に対応する特徴量アドレスがKであり、インクリメントされたIレジスタの値がRであり、初期化されたQレジスタの値が1であるとき、画素位置情報を格納するクラスタのアドレスとして、アドレス(K,R)が算出され、さらに、アドレス(K,R)のクラスタの先頭の画素位置情報を格納する領域を指定するアドレスが算出される。
【0176】
ステップS264において、アドレス算出部223は、特徴量に対応する特徴量アドレスを次の特徴量アドレスとして出力する。
【0177】
ステップS265において、アドレス算出部223は、ステップS259の処理でインクリメントされたIレジスタの値を次のクラスタ番号として出力し、処理は終了する。
【0178】
ステップS258において、Iレジスタの値が、IMAXレジスタの値以上であると判定された場合、特徴量に対応する特徴量アドレスで特定される領域にさらにクラスタを配置することができないので、他の特徴量アドレスで特定される領域にクラスタを配置するために、ステップS266に進み、判断部222は、クラスタの数が最小の特徴量アドレスを探索する。例えば、判断部222は、メモリ状態記憶部221の各特徴量アドレスに対応するIMAXレジスタの値と、Iレジスタの値との差が最も大きい特徴量アドレスを求める。
【0179】
ステップS267において、判断部222は、ステップS266の処理で探索された、クラスタの数が最小の特徴量アドレスを、特徴量に対応する特徴量アドレスで示される記憶先特徴量レジスタに格納する。例えば、特徴量に対応する特徴量アドレスがKであり、クラスタの数が最小の特徴量アドレスがSであるとき、判断部222は、特徴量アドレスKの記憶先特徴量レジスタにSを格納する。
【0180】
ステップS268において、アドレス生成部201は、特徴量フレームメモリ202に、クラスタの数が最小の特徴量アドレスで特定される領域の後ろ側(クラスタアドレスの値が大きい側)にクラスタを生成させる。すなわち、アドレス生成部201は、特徴量フレームメモリ202に、クラスタの数が最小の特徴量アドレスと、クラスタアドレスの最大値をクラスタアドレスとする位置に、クラスタがまだ配置されていないとき、クラスタの数が最小の特徴量アドレスと、クラスタアドレスの最大値をクラスタアドレスとする位置に、クラスタを生成させる。例えば、クラスタの数が最小の特徴量アドレスがSであり、クラスタアドレスの最大値がRであるとき、アドレス(S,R)の位置にクラスタがまだ配置されていない場合、アドレス生成部201は、特徴量フレームメモリ202に、アドレス(S,R)の位置のクラスタを生成させる。
【0181】
アドレス生成部201は、特徴量フレームメモリ202に、クラスタの数が最小の特徴量アドレスと、クラスタアドレスの最大値をクラスタアドレスとする位置に、クラスタがすでに配置されているとき、そのクラスタの前(クラスタアドレスの値が小さい側)にクラスタを生成させる。例えば、クラスタの数が最小の特徴量アドレスがSであり、クラスタアドレスの最大値がRであるとき、アドレス(S,R)の位置にすでにクラスタが配置されている場合、アドレス生成部201は、特徴量フレームメモリ202に、アドレス(S,R−1)の位置のクラスタを生成させる。
【0182】
このように、アドレス生成部201は、特徴量フレームメモリ202に、クラスタの数が最小、すなわち空いている領域が最大である領域の、クラスタアドレスの後ろ側にクラスタを生成させる。
【0183】
ステップS269において、判断部222は、ステップS268の処理で生成したクラスタのクラスタアドレスを、メモリ状態記憶部221の、特徴量に対応する特徴量アドレスのクラスタ現在位置レジスタに格納する。
【0184】
ステップS270において、判断部222は、メモリ状態記憶部221の、ステップS266の処理で探索された、クラスタの数が最小である特徴量アドレスのIMAXレジスタの値をデクリメントする。すなわち、クラスタの数が最小である特徴量アドレスの領域にステップS268の処理でクラスタが生成されたので、クラスタの数が最小である特徴量アドレスに対応する特徴量の画素の画素位置情報を格納するクラスタの最大数を格納しているIMAXレジスタの値から1が引き算される。
【0185】
ステップS271において、判断部222は、Qレジスタの値を初期化する。判断部222は、メモリ状態記憶部221の、特徴量に対応する特徴量アドレスのQレジスタの値を初期化する。例えば、判断部222は、特徴量に対応する特徴量アドレスがKであるとき、特徴量アドレスKに対応するQレジスタの値を1に設定する。
【0186】
ステップS272において、判断部222は、特徴量の画素の位置を示す画素位置情報を格納しているクラスタの数を示すIレジスタの値をインクリメントする。判断部222は、インクリメントされた値をメモリ状態記憶部221の特徴量に対応する特徴量アドレスのIレジスタに格納する。
【0187】
ステップS273において、判断部222は、Mレジスタの値をインクリメントする。判断部222は、インクリメントしたMレジスタの値を、特徴量に対応する特徴量アドレスのMレジスタに設定する。
【0188】
ステップS274において、アドレス算出部223は、ステップS268の処理で生成したクラスタの最初の特徴量の指定するアドレスを生成する。例えば、例えば、記憶先特徴量レジスタの値がSであり、クラスタ現在位置レジスタの値がRであり、初期化されたQレジスタの値が1であるとき、画素位置情報を格納するクラスタのアドレスとして、アドレス(S,R)が算出され、さらに、アドレス(S,R)のクラスタの先頭の画素位置情報を格納する領域を指定するアドレスが算出される。
【0189】
ステップS275において、アドレス算出部223は、記憶先特徴量レジスタの値を次の特徴量アドレスとして出力する。
【0190】
ステップS265において、アドレス算出部223は、クラスタ現在位置レジスタの値を次のクラスタ番号として出力し、処理は終了する。
【0191】
次に、ステップS202の処理に対応する、注目画素に対応する画素位置の検出の処理について図19のフローチャートを参照して説明する。
【0192】
ステップS301およびステップS302の処理は、図10のステップS141およびステップS142の処理とそれぞれ同様なので、その説明は省略する。
【0193】
ステップS303において、参照画素位置検出部203は、特徴量に対応する画素位置情報の読み出しの処理を実行する。特徴量に対応する画素位置情報の読み出しの処理の詳細は、図20のフローチャートを参照して説明する。
【0194】
ステップS304乃至ステップS306の処理は、図10のステップS144乃至ステップS146の処理とそれぞれ同様なので、その説明は省略する。
【0195】
ステップS307において、参照画素位置検出部203は、近傍の特徴量に対応する画素位置情報の読み出しの処理を実行する。
【0196】
ステップS308乃至ステップS313の処理は、図10のステップS148乃至ステップS153の処理とそれぞれ同様なので、その説明は省略する。
【0197】
図20は、ステップ303の処理に対応する、特徴量に対応する画素位置情報の読み出しの処理を説明するフローチャートである。
【0198】
ステップS331において、参照画素位置検出部203は、特徴量フレームメモリ202から、特徴量に対応する画素位置情報の数を読み出す。例えば、特徴量に対応する特徴量アドレスがKであるとき、参照画素位置検出部203は、特徴量フレームメモリ202の、特徴量アドレスKである画素位置情報の数LKを読み出す。
【0199】
最初に実行する、ステップS332において、参照画素位置検出部203は、特徴量フレームメモリ202から、特徴量に対応する特徴量アドレスで指定され、クラスタアドレスが1のクラスタを読み出す。例えば、特徴量に対応する特徴量アドレスがKであるとき、参照画素位置検出部203は、特徴量フレームメモリ202から、アドレス(K,1)のクラスタを読み出す。
【0200】
ステップS333において、参照画素位置検出部203は、ステップS332の処理で読み出されたクラスタに格納されている画素位置情報を読み出す。クラスタには、1または2以上の画素位置情報が格納されている。
【0201】
ステップS334において、参照画素位置検出部203は、読み出された画素位置情報の総和を計算する。例えば、最初のステップS334の処理では、読み出された画素位置情報の総和に、ステップS332の処理で読み出された画素位置情報の数が設定され、処理が繰り返されることにより実行される2回目以降のステップS334の処理では、既に計算された画素位置情報の総和に、ステップS332の処理で読み出された画素位置情報の数が加算される。
【0202】
ステップS335において、参照画素位置検出部203は、ステップS334の処理で計算された、読み出された画素位置情報の総和が、ステップS331の処理で読み出された、特徴量に対応する画素位置の数未満であるか否かを判定し、読み出された画素位置情報の総和が、特徴量に対応する画素位置の数未満であると判定された場合、まだ読み出されていない画素位置情報があるので、ステップS336に進み、ステップS332の処理で読み出されたクラスタから、次の特徴量アドレスおよび次のクラスタ番号を読み出し、手続きは、ステップS332に進む。
【0203】
2回目以降のステップS332においては、参照画素位置検出部203は、ステップS336の処理で読み出された、次の特徴量アドレスおよび次のクラスタ番号で指定されるクラスタを読み出し、それ以降の処理を繰り返す。例えば、参照画素位置検出部203は、次の特徴量アドレスがSであり、次のクラスタ番号がRであるとき、アドレス(S,R)のクラスタを読み出す。
【0204】
ステップS335において、読み出された画素位置情報の総和が、特徴量に対応する画素位置の数未満でないと判定された場合、特徴量に対応する全ての画素位置情報が読み出されたので、処理は終了する。
【0205】
なお、ステップS307の処理は、近傍の特徴量に対応する、図20のフローチャートで説明した処理と同様なのでその説明は省略する。
【0206】
以上のように、図11に構成を示す画像処理装置においては、より少ない記憶領域で、動きベクトルを検出することができるようになる。すなわち、図11に構成を示す画像処理装置においては、参照フレームFrについての特徴量に対応する画素位置情報を特徴量フレームメモリ202に格納したとき、特徴量フレームメモリ202にできる、画素位置情報が格納されていない空きの領域をより少なくすることができる。
【0207】
このように、第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出し、第1の画素の特徴量に対応する第1のアドレスで指定される領域への、第1の画素の位置を示す画素位置情報の記憶を制御し、第1のフレームの第2の画素の特徴量を抽出し、記憶されている、第1の画素の位置を示す画素位置情報を基に、第2の画素の特徴量と同じ特徴量の第1の画素の位置の中から、動いた先が第2の画素である第1の画素の位置を選択するようにした場合には、動きベクトルを検出することができる。
【0208】
また、第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出し、第1の画素の特徴量に対応する第1のアドレスで指定される領域への、第1の画素の位置を示す画素位置情報の記憶を制御し、第1のフレームの第2の画素の特徴量を抽出し、記憶されている、第1の画素の位置を示す画素位置情報を基に、第2の画素の特徴量と同じ特徴量の第1の画素の位置の中から、動いた先が第2の画素である第1の画素の位置を選択し、第1の画素の特徴量に対応する第1のアドレスで指定される領域に空きが無くなった場合、第2のアドレスで指定される領域への、第1の画素の位置を示す画素位置情報の記憶を制御すると共に、第1の画素の位置を示す画素位置情報を第2のアドレスで指定される領域に記憶することを表す情報の記憶を制御するようにした場合には、より少ない計算量で、より迅速に、より正確な動きベクトルを検出できる。
【0209】
次に、本発明に係る画像処理装置のさらに他の構成について説明する。図21は、本発明に係る画像処理装置のさらに他の実施の形態の構成を示すブロック図である。図6に示す場合と同様の部分には、同一の番号を付してあり、その説明は省略する。
【0210】
特徴量記憶部401は、特徴量抽出部101から供給された、参照画素の位置を示す画素位置情報、および参照画素に対応する特徴量を取得し、特徴量に対応する画素位置情報の数を記憶すると共に、ポインタにより次の画素位置を示すことにより画素位置情報を記憶する。
【0211】
図22は、特徴量記憶部401の構成の例を示すブロック図である。
【0212】
記憶制御部421は、インデックスメモリ422およびフレームメモリ423へのデータの書き込みおよび読み出しを制御することにより、特徴量記憶部401への、特徴量に対応する画素位置情報の数の記憶、および画素位置を示すポインタの記憶を制御する。
【0213】
インデックスメモリ422は、特徴量に対応した特徴量アドレス毎に、特徴量に対応する特徴量個数、すなわち画素位置情報の数、ポインタで順に示される画素位置情報のうちの、先頭の画素位置、およびポインタで順に示される画素位置情報のうちの、最後の画素位置を格納する。
【0214】
この場合のポインタで示される画素位置の順序は、特徴量抽出部101が参照画素を選択する順序に対応し、例えば、ラスタスキャン順である。ただし、この順序は、本発明を限定するものではなく、ジグザクスキャンの方向など、任意の順とすることができる。
【0215】
フレームメモリ423は、領域Dを単位として、特徴量に対応した画素の画素位置の繋がりを示すポインタを格納する。フレームメモリ423の領域Dの位置を特定するための1つの方向は、画像の空間方向の一方、例えば、空間方向x(画像の横方向)に対応し、フレームメモリ423の領域Dの位置を特定するための他の方向は、画像の空間方向の他方、例えば、空間方向y(画像の縦方向)に対応する。フレームメモリ423において、領域Dの位置は、フレームメモリ423上の2次元のアドレスで特定され、同時に、画面上の画素の画素位置を示す。言い換えれば、フレームメモリ423の1つの領域Dは、参照フレームFrの1つの画素に対応する。従って、フレームメモリ423には、画面上(1フレーム)の画素の数と同じ数の領域Dが、画面上(フレーム)の画素に対応して配置される。
【0216】
フレームメモリ423の各領域Dは、ポインタであって、自分自身に対応する画素の特徴量と同じ特徴量の次の画素に対応する領域Dの位置を示す情報を格納する。画素の位置と領域Dの位置とが対応しているので、フレームメモリ423の領域Dは、同じ特徴量の次の画素の位置を示す情報を格納しているとも言える。
【0217】
例えば、インデックスメモリ422に、特徴量アドレスKに対応する特徴量の先頭の画素の画素位置として、図中の領域D1の位置を示す画素位置が格納されているとき、特徴量アドレスKに対応する特徴量の最初の画素の画素位置は、領域D1の位置に対応する画素位置であることがわかる。
【0218】
フレームメモリ423の領域D1には、特徴量アドレスKに対応する特徴量の、次の画素の位置である、領域D2の位置を示す情報(アドレス)が格納される。領域Dの位置が画素の画素位置に対応しているので、フレームメモリ423の領域D1から、次の領域D2の位置を示す情報を読み出すことにより、特徴量アドレスKに対応する特徴量の2番目の画素の画素位置は、領域D2の位置に対応する画素位置であることがわかる。
【0219】
同様に、フレームメモリ423の領域D2には、特徴量アドレスKに対応する特徴量の、さらに次の画素の位置である、領域D3の位置を示す情報(アドレス)が格納される。領域Dの位置が画素の画素位置に対応しているので、フレームメモリ423の領域D2から、次の領域D3の位置を示す情報を読み出すことにより、特徴量アドレスKに対応する特徴量の3番目の画素の画素位置は、領域D3の位置に対応する画素位置であることがわかる。
【0220】
このように、特徴量アドレスがKであるインデックスメモリ422に格納されている、先頭の画素位置から、フレームメモリ423に格納されているポインタを順に辿ることにより、特徴量アドレスKに対応した特徴量の画素の画素位置を得ることができる。
【0221】
以上のように、フレームメモリ423には、画像の画素の位置に対応して記憶領域が配置され、各記憶領域には、所定の特徴量の次の画素位置を示す情報(ポインタ)が格納される。すなわち、参照フレームFrの画素の位置を示す位置の、フレームメモリ423の領域Dに、同じ特徴量の次の画素であって、参照フレームFrの画素の位置が順次記憶される。
【0222】
そして、インデックスメモリ422の先頭画素位置には、参照フレームFrの、同じ特徴量の画素の位置のうちの、最初の画素の位置が記憶される。
【0223】
従って、特徴量記憶部401は、インデックスメモリ422に格納されている、各特徴量アドレスに対応して、先頭の画素位置から、最後の画素位置まで、特徴量個数に対応した数の、フレームメモリ423に格納されているポインタを順に辿ることにより、各特徴量アドレスに対応した特徴量の画素の画素位置を得ることができる。
【0224】
図21に戻り、参照画素位置検出部402は、特徴量抽出部103から供給された注目画素の特徴量、および特徴量記憶部401に記憶されている情報を基に、注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置を検出する。そして、参照画素位置検出部402は、検出された注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置から、動いた先が注目画素である参照フレームFrの画素の位置を選択する。そして、参照画素位置検出部402は、特徴量抽出部103から供給された注目画素の画素位置情報と参照フレームFrの選択された画素の画素位置とから、注目画素の位置に対応する位置の参照フレームFr上の画素を始点とし、注目画素の特徴量と同じ特徴量を有する参照フレームFrの選択された画素を終点とする動きベクトルを求めて、求めた動きベクトルを出力する。
【0225】
図23は、インデックスメモリ422に格納される、特徴量に対応した特徴量アドレス毎のデータの例を示す図である。特徴量個数は、特徴量の数、すなわち特徴量アドレスに対応する特徴量の画素の画素位置情報の数である(特徴量アドレスに対応する特徴量の画素の数でもあり、領域Dの数でもある)。
【0226】
先頭画素位置は、特徴量アドレスに対応する特徴量の先頭の画素の画素位置である。すなわち、先頭画素位置は、特徴量アドレスに対応する特徴量の先頭の画素に対応する、フレームメモリ423の領域Dのアドレスを示す。
【0227】
終了画素位置は、特徴量アドレスに対応する特徴量の最後の画素の画素位置である。すなわち、終了画素位置は、特徴量アドレスに対応する特徴量の最後の画素に対応する、フレームメモリ423の領域Dのアドレスを示す。
【0228】
先頭画素位置で示される位置(アドレス)の、フレームメモリ423の領域Dに格納されている、次の位置から、領域Dを順に辿った場合、最終画素位置で示される位置の領域Dに到達する。最終画素位置で示される位置の領域Dには、例えば、ヌル(null)が格納される。
【0229】
図21に構成を示す動きベクトル検出の処理は、図8のフローチャートに示す処理と同様なので、その説明は省略する。
【0230】
画像処理装置が図21に示す構成を有する場合の、ステップS101の処理に対応する、画素位置情報の格納の処理を図24のフローチャートを参照して説明する。
【0231】
ステップS401において、記憶制御部421は、インデックスメモリ422およびフレームメモリ423に格納されているデータを初期化する。例えば、記憶制御部421は、特徴量個数を0に設定し、先頭画素位置および終了画素位置にヌル(null)を設定する。また、例えば、記憶制御部421は、フレームメモリ423の全ての領域Dにヌルを設定する。
【0232】
ステップS402において、特徴量抽出部101は、カウンタ変数nを初期化する。カウンタ変数nは、処理の対象となる画素の数を数えるための変数である。例えば、特徴量フレームメモリ102は、カウンタ変数nに1を設定する。
【0233】
ステップS403において、特徴量抽出部101は、参照フレームFrの画素の中からまだ参照画素とされていない画素を順に選択して参照画素とする。特徴量抽出部101は、参照画素に対応するブロックの特徴量を算出することにより、参照画素の特徴量を抽出し、参照画素の位置を示す画素位置情報と共に、抽出した特徴量を特徴量規約部401に供給する。例えば、特徴量抽出部101は、参照画素を中心とした、3×3のブロックに含まれる画素の画素値を所定の順に並べた値である特徴量を算出する。
【0234】
ステップS404において、記憶制御部421は、特徴量に対応する特徴量個数をインデックスメモリ422から読み出す。例えば、記憶制御部421は、特徴量に対応する特徴量アドレスの特徴量個数をインデックスメモリ422から読み出す。
【0235】
ステップS405において、記憶制御部421は、その特徴量に対応する先頭の画素であるか否か、すなわち、ステップS404の処理で読み出した、特徴量に対応する特徴量個数が0であるか否かを判定し、先頭の画素であると判定された場合、先頭の画素の画素位置をインデックス422に記憶する必要があるので、ステップS406に進み、インデックス422の、特徴量に対応する特徴量アドレスの先頭画素位置および終了画素位置に、ステップS403の処理で取得された画素位置情報を書き込み、ステップS407に進む。
【0236】
ステップS405において、先頭の画素でないと判定された場合、画素の画素位置をインデックス422の先頭画素位置に記憶する必要がないので、ステップS406の処理はスキップされ、手続きは、ステップS407に進む。
【0237】
ステップS407において、記憶制御部421は、ステップS404の処理で読み出した特徴量個数をインクリメントする。すなわち、記憶制御部421は、特徴量個数に1を加算する。
【0238】
ステップS408において、記憶制御部421は、ステップS407の処理でインクリメントした特徴量個数を、インデックスメモリ422の、特徴量に対応した特徴量アドレスの特徴量個数に書き込む。
【0239】
ステップS409において、記憶制御部421は、特徴量に対応する特徴量アドレスの終了画素位置を読み出し、フレームメモリ423の、終了画素位置で示される領域Dに、画素位置情報を書き込む。この場合において、終了画素位置が先頭画素位置と同じであるとき(先頭の画素であるとき)、記憶制御部421は、書き込みの対象となる領域Dが無いので、画素位置情報を書き込まない。
【0240】
ステップS410において、記憶制御部421は、インデックスメモリ422の、特徴量に対応する特徴量アドレスの終了画素位置に、画素位置情報を書き込む。
【0241】
ステップS409およびステップS410の処理により、最終画素位置、および、同じ特徴量の1つ前の画素に対応する領域Dに、今回の画素位置情報が格納されることになる。
【0242】
ステップS411において、特徴量抽出部101は、カウンタ変数nをインクリメントする。すなわち、特徴量抽出部101は、カウンタ変数nの値に1を加算する。
【0243】
ステップS412において、特徴量抽出部101は、カウンタ変数nの値が、フレームの画素の数に等しいか否かを判定し、カウンタ変数nの値が、フレームの画素の数に等しくないと判定された場合、まだ、参照画素とされていない画素がある、すなわち特徴量が抽出されていない画素があるので、ステップS403に戻り、上述した処理を繰り返し、次の特徴量を抽出して、特徴量記憶部401に格納する。
【0244】
ステップS412において、カウンタ変数nの値が、フレームの画素の数に等しいと判定された場合、フレームの全ての画素が参照画素とされ、フレームの全ての画素の特徴量が抽出されて、特徴量記憶部401に格納されたので、処理は終了する。
【0245】
画像処理装置が図21に示す構成を有する場合の、ステップS102の処理に対応する処理は、図19のフローチャートを参照して処理と同様なので、その説明は省略する。
【0246】
画像処理装置が図21に示す構成を有する場合の、ステップS303の処理に対応する、特徴量に対応する画素位置情報の読み出しの処理を図25のフローチャートを参照して説明する。
【0247】
ステップS431において、特徴量記憶部401の記憶制御部421は、インデックスメモリ422から、特徴量に対応する、特徴量個数、先頭画素位置、および終了画素位置の値を読み出す。例えば、参照画素位置検出部402から、特徴量が供給され、特徴量に対応する画素位置情報が要求された場合、記憶制御部421は、インデックスメモリ422から、特徴量に対応する特徴量アドレスの、特徴量個数、先頭画素位置、および終了画素位置を読み出す。
【0248】
ステップS432において、記憶制御部421は、ステップS431の処理で取得した特徴量個数が1以上であるか否かを判定し、特徴量個数が1以上であると判定された場合、特徴量に対応した画素位置情報が存在するので、ステップS433に進み、ステップS431の処理で取得された先頭画素位置を画素位置情報および参照画素の画素位置情報に設定する。先頭画素の位置を示す画素位置情報は、参照画素位置検出部402に供給される。
【0249】
ステップS434において、記憶制御部421は、特徴量個数が1であるか否かを判定し、特徴量個数が1であると判定された場合、先頭画素以外に、その特徴量の画素は無いので、処理は終了する。
【0250】
ステップS434において、特徴量個数が1でないと判定された場合、その特徴量の画素が2以上あるので、ステップS435に進み、記憶制御部421は、フレームメモリ423の、参照画素の画素位置情報で示される領域Dから、次の領域Dの位置を示す情報、すなわち同じ特徴量の次の画素の画素位置を示す画素位置情報を読み出す。
【0251】
ステップS436において、記憶制御部421は、ステップS435の処理で読み出した、画素位置情報を、次の画素位置情報および参照画素の画素位置情報に設定する。次の画素位置情報は、参照画素位置検出部402に出力される。
【0252】
ステップS437において、記憶制御部421は、ステップS436の処理で設定した、参照画素の画素位置情報で示される画素位置が、ステップS431の処理で読み出された終了画素位置の値に等しいか否かを判定し、参照画素の画素位置情報で示される画素位置が、終了画素位置の値に等しくないと判定された場合、特徴量に対応する画素位置情報に、まだ読み出されていない画素位置情報があるので、ステップS435に戻り、画素位置情報の読み出しの処理を繰り返す。
【0253】
ステップS437において、参照画素の画素位置情報で示される画素位置が、終了画素位置の値に等しいと判定された場合、特徴量に対応する画素位置情報の全てが読み出されたので、処理は終了する。
【0254】
ステップS432において、特徴量個数が1以上でないと判定された場合、特徴量に対応する画素は無く、画素位置情報がないので、処理は終了する。
【0255】
このように、図21に構成を示す画像処理装置においては、画素位置情報を格納する領域にほとんど空きを生じさせることなく、画素位置情報を記憶することができ、記憶された画素位置情報を読み出すことができる。図21に構成を示す画像処理装置においては、より少ない記憶領域で、確実に画素位置情報を記憶することができる。
【0256】
すなわち、第1のフレームに対して時間的に前のフレームである第2のフレームの画素の特徴量を抽出し、第2のフレームの画素の位置を示す位置の第1の領域に、同じ特徴量の次の画素であって、第2のフレームの画素の位置を順次記憶させるように記憶を制御すると共に、画素の特徴量に対応するアドレスで指定される第2の領域に、同じ特徴量の画素の位置のうちの、最初の画素の位置の記憶を記憶させるように記憶を制御し、第1のフレームの画素の特徴量を抽出し、特徴量に対応するアドレスで指定される第2の領域に記憶されている、同じ特徴量の画素の位置のうち、最初の画素の位置、第1の領域に記憶されている同じ特徴量の次の画素の位置、および画素の位置を示す第1の領域の位置を基に、第1のフレームの画素の特徴量と同じ特徴量の第2のフレームの画素の位置の中から、動いた先が第1のフレームの画素である第2のフレームの画素の位置を選択するようにした場合には、より少ない計算量で、より迅速に、より正確な動きベクトルを検出できる。
【0257】
図26は、本発明に係る画像処理装置のさらに他の実施の形態の構成を示すブロック図である。
【0258】
図11に示す場合と同様の部分には同一の番号を付してあり、その説明は省略する。
【0259】
特徴量ヒストグラム生成部601は、特徴量抽出部101から供給される特徴量および画素位置情報を基に、特徴量毎の画素の数を求めて、各特徴量毎の画素の数を示す特徴量分布情報をアドレス生成部602に供給する。また、特徴量ヒストグラム生成部601は、特徴量抽出部101から供給される特徴量および画素位置情報を、そのまま、アドレス生成部602に供給する。
【0260】
アドレス生成部602は、特徴量ヒストグラム生成部601から供給された特徴量分布情報を基に、クラスタの次のクラスタを特定する、次の特徴量アドレスおよび次のクラスタ番号を生成し、画素位置情報と共に、生成した次の特徴量アドレスおよび次のクラスタ番号を特徴量フレームメモリ202に供給する。
【0261】
また、アドレス生成部602は、特徴量ヒストグラム生成部601から供給された特徴量分布情報に含まれる、特徴量毎の画素位置情報の数を特徴量フレームメモリ202に供給する。
【0262】
画素値フレームメモリ603は、入力された画像をフレーム単位で記憶し、記憶している画像のフレームを、1フレームに対応する期間遅延したタイミングで、特徴量抽出部103に供給する。図26に構成を示す画像処理装置においては、特徴量ヒストグラム生成部601の処理に要する期間が、1フレームに対応する期間なので、画素値フレームメモリ603は、1フレームに対応する期間遅延させた画像を特徴量抽出部103に供給する。従って、特徴量フレームメモリ202に記憶されて、参照画素位置検出部203に供給される画素位置情報に対応するフレームと、特徴量抽出部103から出力される特徴量に対応するフレームとの関係は、図11に構成を示す画像処理装置の場合と同等になる。すなわち、特徴量フレームメモリ202は、参照フレームFr(1つ前のフレーム)に対応する画素位置情報を参照画素位置検出部203に供給し、特徴量抽出部103は、カレントフレームFc(現在のフレーム)に対応する特徴量および画素位置情報を参照画素位置検出部203に供給する。図26に構成を示す画像処理装置におけるカレントフレームFcは、入力される画像の現在のフレームに対して、1つ過去のフレームとなる。
【0263】
図27は、図26に構成を示す画像処理装置による、動きベクトルの検出の処理を説明するフローチャートである。
【0264】
ステップS601において、特徴量抽出部101および特徴量ヒストグラム生成部601は、特徴量の分布を求める。すなわち、特徴量抽出部101は、入力された画像のフレームの各画素に対応して、特徴量を抽出し、抽出された特徴量と共に、対象とする画素の位置を示す画素位置情報を特徴量ヒストグラム生成部601に供給する。特徴量ヒストグラム生成部601は、特徴量抽出部101から供給される特徴量および画素位置情報を基に、特徴量毎の画素の数を算出して、特徴量毎の画素の数を示す特徴量分布情報をアドレス生成部602に供給する。
【0265】
ステップS602において、アドレス生成部602は、特徴量フレームメモリ202のクラスタに、次の特徴量アドレスおよび次のクラスタ番号を設定する、アドレス組み替えの処理を実行する。すなわち、アドレス組み替えの処理により、特徴量毎に、画素位置情報を格納するためのクラスタが確保されることになる。アドレス組み替えの処理の詳細は、図28および図29のフローチャートを参照して、後述する。
【0266】
ステップS603において、特徴量フレームメモリ202は、画素位置情報の格納の処理を実行することにより、参照フレームFrの画素位置情報を記憶する。画素位置情報は、ステップS602の処理で確保された、特徴量毎に確保されたクラスタに格納される。ステップS603における画素位置情報の格納の処理の詳細は、図30のフローチャートを参照して、後述する。
【0267】
ステップS604乃至ステップS606の処理は、図15のステップS202乃至ステップS204の処理とそれぞれ同様なので、その説明は省略する。
【0268】
図28および図29のフローチャートを参照して、各クラスタに1つの画素位置情報を格納する場合の、ステップS602の処理に対応する、アドレスの組み替えの処理の例を説明する。
【0269】
なお、以下の処理を実行する前に、予め、特徴量フレームメモリ202に、配置可能な全てのクラスタが生成され、生成されたクラスタは初期化される。
【0270】
ステップS621において、アドレス生成部602は、特徴量アドレス変数nを初期化する。特徴量アドレス変数nは、特徴量アドレスを特定するための変数であり、例えば、特徴量アドレスが0乃至N−1のいずれかの値であるとき、特徴量アドレス変数nには、0乃至N−1のいずれかの値が設定される。例えば、特徴量アドレスが0乃至N−1のいずれかの値であるとき、ステップS621の処理において、特徴量アドレス変数nに、0が設定される。
【0271】
ステップS622において、アドレス生成部602は、特徴量アドレス変数nの値で示される、特徴量アドレスに対応する特徴量の画素位置情報の数hnが、最大格納数Mを超えているか否かを判定する。特徴量アドレスに対応する特徴量の画素位置情報の数hnは、特徴量分布情報に含まれる、各特徴量毎の画素の数と同じである。最大格納数Mは、図12において、行方向(横方向)に並ぶ、1行のクラスタに格納することができる画素位置情報の数をいう。この場合、各クラスタに1つの画素位置情報が格納されるので、最大格納数Mは、1行のクラスタの数に等しい。
【0272】
ステップS622において、特徴量アドレスに対応する特徴量の画素位置情報の数hnが、最大格納数Mを超えていないと判定された場合、1行のクラスタに、特徴量に対応する全ての画素位置情報を格納することができるので、ステップS623に進み、アドレス生成部602は、確定済領域数snに、特徴量アドレスnに対応する特徴量の画素位置情報の数hnを設定する。確定済領域数snは、特徴量アドレスnのクラスタのうち、画素位置情報を格納することが定まったクラスタの数を示す。
【0273】
ステップS624において、アドレス生成部602は、特徴量の画素位置情報の数hn個の、特徴量アドレス変数nで示される特徴量アドレスのクラスタを確保するように、次の特徴量アドレスおよび次のクラスタ番号を設定し、ステップS625に進む。例えば、特徴量の画素位置情報の数hnがLであるとき、アドレス生成部602は、アドレス(n,1)乃至アドレス(n,L−1)のクラスタのそれぞれに、アドレス(n,2)乃至アドレス(n,L)のクラスタのそれぞれを示す、次の特徴量アドレスおよび次のクラスタ番号を設定する。より具体的には、アドレス生成部602は、アドレス(n,1)のクラスタに、アドレス(n,2)のクラスタを示す、次の特徴量アドレスおよび次のクラスタ番号を設定し、アドレス(n,2)のクラスタに、アドレス(n,3)のクラスタを示す、次の特徴量アドレスおよび次のクラスタ番号を設定するように、順に、次のクラスタを指すように、L−1個のクラスタに次の特徴量アドレスおよび次のクラスタ番号を設定する。
【0274】
ステップS622において、特徴量アドレスに対応する特徴量の画素位置情報の数hnが、最大格納数Mを超えていると判定された場合、1行のクラスタに、特徴量に対応する全ての画素位置情報を格納することができないので(すなわち、他の特徴量アドレスのクラスタを必要とするので)、ステップS623およびステップS624の処理はスキップされ、手続きは、ステップS625に進む。
【0275】
ステップS625において、アドレス生成部602は、特徴量アドレス変数nの値が、N−1以上であるか否かを判定し、特徴量アドレス変数nの値が、N−1以上でないと判定された場合、まだ全ての特徴量アドレスについてステップS622乃至ステップS624の処理が終了していないので、ステップS626に進み、特徴量アドレス変数nをインクリメントして、ステップS622に戻り、次の特徴量アドレスについて、処理を繰り返す。
【0276】
ステップS625において、特徴量アドレス変数nの値が、N−1以上であると判定された場合、全ての特徴量アドレスについてステップS622乃至ステップS624の処理が終了したので、ステップS627に進む。
【0277】
ステップS627において、アドレス生成部602は、特徴量アドレス変数nを初期化する。ステップS628において、アドレス生成部602は、特徴量アドレス変数nの値で示される、特徴量アドレスに対応する特徴量の画素位置情報の数hnが、最大格納数Mを超えているか否かを判定し、特徴量の画素位置情報の数hnが、最大格納数Mを超えていると判定された場合、2行以上のクラスタに、特徴量に対応する画素位置情報を格納しなければならないので(他の特徴量アドレスのクラスタを必要とするので)、ステップS629に進み、特徴量アドレス変数nの確定済領域数snに、最大格納数Mを設定する。
【0278】
ステップS630において、アドレス生成部602は、特徴量の画素位置情報の数hn個の、特徴量アドレス変数nで示される特徴量アドレスの全てのクラスタを確保するように、次の特徴量アドレスおよび次のクラスタ番号を設定する。例えば、アドレス生成部602は、アドレス(n,1)乃至アドレス(n,M−1)のクラスタのそれぞれに、アドレス(n,2)乃至アドレス(n,M)のクラスタのそれぞれを示す、次の特徴量アドレスおよび次のクラスタ番号を設定する。
【0279】
ステップS631において、アドレス生成部602は、空いているクラスタの数が最大の特徴量アドレスmを求める。例えば、アドレス生成部602は、1つの特徴量アドレスで特定されるM個のクラスタのうち、次の特徴量アドレスおよび次のクラスタ番号で指定されていないクラスタの数、すなわち画素位置情報の格納が決定していないクラスタの数が最大である特徴量アドレスmを、特徴量アドレス0乃至N−1のうちから求める。
【0280】
ステップS632において、アドレス生成部602は、画素位置情報をさらに格納するのに必要なクラスタの数が、特徴量アドレスmの空きクラスタの数を超えているか否かを判定する。例えば、画素位置情報をさらに格納するのに必要なクラスタの数は、画素位置情報を格納するのに必要なクラスタの数は、hn−snで示される。特徴量アドレスmの空いているクラスタの数は、M−smで示される。ここで、確定済領域数smは、特徴量アドレスmのクラスタのうち、画素位置情報を格納することが定まっているクラスタの数を示す。
【0281】
ステップS632において、画素位置情報をさらに格納するのに必要なクラスタの数が、特徴量アドレスmの空きクラスタの数を超えていないと判定された場合、特徴量アドレスmの空きクラスタに残りの画素位置情報の全てを格納することができるので、ステップS633に進み、アドレス生成部602は、特徴量アドレスmの空いているクラスタのうち、画素位置情報を格納するのに必要な数のクラスタを確保するように、次の特徴量アドレスおよび次のクラスタ番号を設定する。
【0282】
ステップS634において、アドレス生成部602は、特徴量アドレスnの確定済領域数snを更新する。すなわち、アドレス生成部602は、特徴量アドレスnの確定済領域数snに、特徴量アドレスnに対応する特徴量の画素位置情報の数hnを設定する。
【0283】
ステップS635において、アドレス生成部602は、特徴量アドレスmの確定済領域数smを更新する。すなわち、アドレス生成部602は、特徴量アドレスmの確定済領域数smに、ステップS633の処理で、画素位置情報を格納することが定まったクラスタの数を加算する。
【0284】
ステップS636において、アドレス生成部602は、特徴量アドレス変数nの値が、N−1以上であるか否かを判定し、特徴量アドレス変数nの値が、N−1以上でないと判定された場合、まだ全ての特徴量アドレスについてステップS628乃至ステップS635の処理、またはステップS638乃至ステップS640の処理が終了していないので、ステップS637に進み、特徴量アドレス変数nをインクリメントして、ステップS628に戻り、次の特徴量アドレスについて、処理を繰り返す。
【0285】
ステップS636において、特徴量アドレス変数nの値が、N−1以上であると判定された場合、全ての特徴量アドレスについてステップS628乃至ステップS635の処理、またはステップS638乃至ステップS640の処理が終了したので、処理は終了する。
【0286】
ステップS632において、画素位置情報をさらに格納するのに必要なクラスタの数が、特徴量アドレスmの空きクラスタの数を超えていると判定された場合、特徴量アドレスmの空きクラスタに残りの画素位置情報の全てを格納することができないので、ステップS638に進み、特徴量アドレスmの空きクラスタの全てを確保するように、次の特徴量アドレスおよび次のクラスタ番号を設定する。
【0287】
ステップS639において、アドレス生成部602は、特徴量アドレスnの確定済領域数snを更新する。すなわち、アドレス生成部602は、特徴量アドレスnの確定済領域数snに、ステップS638の処理で、画素位置情報を格納することが定まったクラスタの数を加算する。
【0288】
ステップS640において、アドレス生成部602は、特徴量アドレスmの確定済領域数smを更新し、ステップS631に戻り、さらに空いているクラスタを確保する処理を繰り返す。すなわち、アドレス生成部602は、特徴量アドレスmの確定済領域数smに、ステップS638の処理で、画素位置情報を格納することが定まったクラスタの数を加算する。特徴量アドレスmの確定済領域数smには、最大格納数Mが設定されることになる。
【0289】
このように、アドレス組み替えの処理により、各特徴量ごとに、画素位置情報を格納するのに必要な領域が確保される。すなわち、クラスタに格納された次の特徴量アドレスおよび次のクラスタ番号により、各特徴量毎の画素位置情報が格納されるクラスタが決定されることになる。
【0290】
次に、図30のフローチャートを参照して、ステップS603の処理に対応する、画素位置情報の格納の処理を説明する。
【0291】
ステップS661乃至ステップS666の処理は、図9のステップS121乃至ステップS126の処理とそれぞれ同様なので、その説明は省略する。
【0292】
ステップS667において、特徴量フレームメモリ202は、各クラスタに格納されている、次の特徴量アドレスおよび次のクラスタ番号を基に、画素位置情報をクラスタに書き込む。すなわち、特徴量フレームメモリ202は、特徴量アドレスKに対応する特徴量の最初の画素位置情報を書き込むとき、アドレス(K,1)のクラスタに画素位置情報を書き込む。特徴量フレームメモリ202は、特徴量アドレスKに対応する特徴量の2番目以降の画素位置情報を書き込むとき、1つ前に画素位置情報を書き込んだクラスタに格納されている、次の特徴量アドレスおよび次のクラスタ番号でアドレスが特定されるクラスタに、画素位置情報を書き込む。
【0293】
ステップS668およびステップS669の処理は、それぞれ、図9のステップS128およびステップS129の処理と同様なので、その説明は省略する。
【0294】
このように、図26に構成を示す画像処理装置においては、空いている領域に画素位置情報を書き込むようにしたので、特徴量フレームメモリ202に、余分な領域を設ける必要がなく、必要最低限の記憶領域で特徴量フレームメモリ202を構成することができる。また、画素位置情報が確実に記憶されることになる。
【0295】
図31は、本発明に係る画像処理装置のさらに他の実施の形態の構成を示すブロック図である。図6に示す場合と同様の部分には同一の番号を付してあり、その説明は省略する。
【0296】
図31に構成を示す画像処理装置に入力された画像は、フレームメモリ701、ラインメモリ703、特徴量抽出部101、および特徴量抽出部103に供給される。
【0297】
フレームメモリ701は、例えば、時刻t1において、画像(画像データ)が入力されると、1フレーム分の情報を格納し、記憶する。さらに、フレームメモリ701は、次のタイミングとなる時刻t2において、次のフレームの画像が入力されると、新たに入力された時刻t2の1フレーム分の画像を格納し、記憶するとともに、時刻t1の1フレーム分の画像をサーチエリア生成部702に出力する。すなわち、フレームメモリ701は、1フレームに対応する期間遅延させて、1フレームを単位として、画素値をサーチエリア生成部702に供給する。
【0298】
また、ラインメモリ703は、時刻t2のタイミングで、入力されてきた1フレームの所定のラインの画像を格納し、時刻t2のタイミング内で、ブロック生成部704に出力する。
【0299】
すなわち、フレームメモリ701が、上述の時刻t2のタイミングで入力される(今現在の)1フレーム分の画像情報を格納し、記憶するとき、フレームメモリ701は、時刻t1(1タイミング過去の)の1フレーム分の画像の画素値をサーチエリア生成部702に出力する。ラインメモリ703は、時刻t2のタイミングで入力された(今現在の)1フレームのラインの画像の画素値をブロック生成部704に出力する。すなわち、ブロック生成部704に現在のフレームの画素値が供給され、サーチエリア生成部702には、現在のフレームの1つ前(過去)のフレームの画素の画素値が供給される。
【0300】
サーチエリア生成部702は、フレームメモリ701から供給された参照フレームFrからサーチエリアSRを生成し、サーチエリアSRの画素の画素値をマッチング部705に供給する。
【0301】
ブロック生成部704は、ラインメモリ703から供給されたカレントフレームFcから基準ブロックBbを生成し、基準ブロックBbの画素の画素値をマッチング部705に供給する。
【0302】
サーチエリア生成部702により生成される、参照フレームFrのサーチエリアSRは、例えば、横にNS(画素数)、縦にMS(画素数)の画素からなる。ブロック生成部704により生成される、カレントフレームFcの基準ブロックBbは、横にNB(画素数)、縦にMB(画素数)の画素からなる。サーチエリアSRは、基準ブロックBbに比較して大きな領域(画素数が多い)からなる。
【0303】
この場合、サーチエリアSRの縦および横の画素数を同じ数のLとしてもよい。
【0304】
マッチング部705は、サーチエリア生成部702から供給されたサーチエリアSRの画素の画素値と、ブロック生成部704から供給された基準ブロックBbの画素の画素値とを基に、サーチエリアSRの参照ブロックBrnを構成する各画素の画素値と、基準ブロックBbの各画素の画素値との差分絶対値和を算出して、参照ブロックBrnから基準ブロックBbへのベクトルと共に、差分絶対値和を誤差値として、誤差最小選択部706に供給する。
【0305】
誤差最小選択部706は、最小である誤差値に対応するベクトルを選択して、選択されたベクトルを動きベクトルとして参照画素位置検出部707に供給する。
【0306】
参照画素位置検出部707は、特徴量抽出部103から供給された注目画素の特徴量、および特徴量フレームメモリ102に記憶されている参照フレームFrの画素位置情報を基に、注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置を検出する。参照画素位置検出部707は、検出された注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置の中から、誤差最小選択部706から供給された動きベクトルを基に、誤差最小選択部706から供給された動きベクトルに対応したサーチエリア内に位置する画素であって、動いた先が注目画素である参照フレームFrの画素の位置を選択する。そして、参照画素位置検出部707は、注目画素の画素位置情報と参照フレームFrの選択された画素の画素位置とから、注目画素の位置に対応する位置の参照フレームFr上の画素を始点とし、注目画素の特徴量と同じ特徴量を有する参照フレームFrの選択された画素を終点とする動きベクトルを求めて、求めた動きベクトルを出力する。
【0307】
図32は、サーチエリア生成部702で生成されるサーチエリアSR、ブロック生成部704で生成される基準ブロックBb、マッチング部705で生成される参照ブロックBrn、および参照画素位置検出部707で生成されるサーチエリアの関係を説明する図である。
【0308】
図32において、サーチエリア生成部702で生成されるサーチエリアSRは、サーチエリア1と表し、参照画素位置検出部707で生成されるサーチエリアは、サーチエリア2と表す。
【0309】
サーチエリア生成部702で生成されるサーチエリアSRは、例えば、基準ブロックBbの中心画素を中心として、基準ブロックBbに比較して、より広い領域(より多数の画素)からなる。参照ブロックBrnは、サーチエリアSRに含まれる画素からなり、基準ブロックBbと同じ形状(画素の配置)からなる。すなわち、参照ブロックBrnに含まれる画素の数は、基準ブロックBbに含まれる画素の数と同一である。
【0310】
最小誤差選択部706は、基準ブロックBbと、参照ブロックBrnの各画素間の差分絶対値和のうち、差分絶対値和が最小となる参照ブロックBrnを選択する。最小誤差選択部706が参照画素位置検出部707に供給する動きベクトルは、注目画素に対応する参照フレームFr上の画素を始点とし、参照ブロックBrnの所定の画素を終点とするベクトルである。例えば、最小誤差選択部706は、基準ブロックBbの中心画素である注目画素に対応する参照フレームFr上の画素を始点とし、参照ブロックBrnの中心画素を終点とするベクトルを動きベクトルとして参照画素位置検出部707に供給する。
【0311】
フレームメモリ701乃至誤差最小選択部706は、代表点ブロックマッチングにより、荒く動きベクトルを検出するようにしてもよい。また、フレームメモリ701乃至誤差最小選択部706は、サーチエリアSR内のベクトルを間引くなど、より荒く動きベクトルを検出するようにしてもよい。この場合、フレームメモリ701乃至誤差最小選択部706における処理がより高速になり、画像処理装置全体として、より高速に動きベクトルを求めることができる。
【0312】
参照画素位置検出部707は、例えば、最小誤差選択部706で選択された参照ブロックBrnをサーチエリア2として、サーチエリア2内に位置する画素であって、注目画素の特徴量と同じ特徴量を有する、参照フレームFrの画素の画素位置を検出する。すなわち、サーチエリア2は、誤差最小選択部706から供給された動きベクトルにより指定される領域である。参照画素位置検出部707は、注目画素の画素位置情報とサーチエリア2内の画素の画素位置とから、注目画素の位置に対応する位置の参照フレームFr上の画素を始点とし、注目画素の特徴量と同じ特徴量を有するサーチエリア2内の画素を終点とする動きベクトルを求めて、求めた動きベクトルを出力する。
【0313】
例えば、参照画素位置検出部707は、注目画素の特徴量と同じ特徴量を有し、サーチエリア2内に位置する画素A、画素B、および画素Cのうち、いずれかの画素を選択し、選択された画素の位置と注目画素の位置とから動きベクトルを求める。
【0314】
図33は、図31に構成を示す画像処理装置による動きベクトルの検出の処理を説明するフローチャートである。
【0315】
ステップS701において、特徴量抽出部101および特徴量フレームメモリ102は、参照フレームFrの画素位置情報の格納の処理を実行する。ステップS701の処理は、ステップS101の処理と同様なので、その説明は省略する。
【0316】
ステップS702において、フレームメモリ701乃至誤差最小選択部706は、ブロックマッチングの処理を実行することにより、動きベクトルを検出する。ブロックマッチングの処理の詳細は、図34のフローチャートを参照して後述する。
【0317】
ステップS703において、特徴量抽出部103および参照画素位置検出部707は、注目画素に対応する画素の位置の検出の処理を実行する。ステップS703の注目画素に対応する画素の位置の検出の処理の詳細は、図35のフローチャートを参照して後述する。
【0318】
ステップS704およびステップS705の処理は、図8のステップS103およびステップS104の処理とそれぞれ同様なので、その説明は省略する。
【0319】
図34は、ステップS702に対応する、ブロックマッチングの処理を説明するフローチャートである。
【0320】
ステップS721において、サーチエリア生成部702は、カレントフレームFc上の注目画素P(i,j)の画素位置に応じて、サーチエリアSRを設定する。
【0321】
ステップS722において、誤差最小選択部706は、上述のように、基準ブロックBb(i,j)と参照ブロックBrn(i,j)の画素間の差分絶対値和の最小値を設定する変数minを、画素の階調数に基準ブロックBb(i,j)を構成する画素数を乗じた値に設定することにより初期化する。すなわち、例えば、1画素が8ビットのデータであった場合、1画素の階調数は、2の8乗となるため256階調(256色)となる。また、基準ブロックBb(i,j)がL画素×L画素=3画素×3画素から構成される場合、その画素数は、9個となる。結果として、変数minは、2304(=256(階調数)×9(画素数))に初期化される。
【0322】
ステップS723において、マッチング部705は、参照ブロックBrnをカウントするカウンタ変数nを1に初期化する。
【0323】
ステップS724において、誤差最小選択部706は、基準ブロックBbと参照ブロックBrnの画素間の差分絶対値和を代入するために用いる変数sumを0に初期化する。
【0324】
ステップS725において、マッチング部705は、基準ブロックBb(i,j)と参照ブロックBrn(i,j)の画素間の差分絶対値和(=sum)を求める。すなわち、基準ブロックBb(i,j)の各画素がP_Bb(i,j)、基準ブロックBrn(i,j)の各画素がP_Brn(i,j)としてそれぞれ示される場合、マッチング部705は、上述した式(1)で示される演算を実行して、基準ブロックBb(i,j)と参照ブロックBrn(i,j)の画素間の差分絶対値和を求める。
【0325】
ステップS726において、誤差最小選択部706は、変数minが変数sumよりも大きいか否かを判定し、例えば、変数minが変数sumよりも大きいと判定する場合、ステップS727において、変数minを変数sumに更新し、その時点でのカウンタnの値を動きベクトル番号として登録する。すなわち、今求めた差分絶対値和を示す変数sumが、最小値を示す変数minよりも小さいと言うことは、これまで演算したどの参照ブロックよりも、今演算している参照ブロックBrn(i,j)が基準ブロックBb(i,j)により類似したものであるとみなすことができるので、動きベクトルを求める際の候補とするため、その時点でのカウンタnが動きベクトル番号として登録される。また、ステップS726において、変数minが変数sumよりも大きくないと判定された場合、ステップS727の処理がスキップされる。
【0326】
ステップS728において、マッチング部705は、カウンタ変数nがサーチエリアSRの参照ブロックBrnの総数mであるか否か、すなわち、今の参照ブロックBrnがBrn=Brmであるか否かを判定し、例えば、総数mではないと判定した場合、ステップS729において、カウンタ変数nを1インクリメントし、その処理は、ステップS724に戻る。
【0327】
ステップS728において、カウンタ変数nがサーチエリア内の参照ブロックBrnの総数mである、すなわち、今の参照ブロックBrnがBrn=Brmであると判定された場合、ステップS730において、誤差最小選択部706は、登録されている動きベクトル番号に基づいて動きベクトルを出力する。すなわち、ステップS724乃至S729が繰り返されることにより、差分絶対値和が最小となる参照ブロックBrnに対応するカウンタ変数nが動きベクトル番号として登録されることになるので、誤差最小選択部706は、この動きベクトル番号に対応する参照ブロックBrnのL×L個の画素のうち、その中心となる参照画素Pn(i,j)を求め、カレントフレームFc上の注目画素P(i,j)に対応する参照フレームFr上の画素P’(i,j)を始点とし、参照画素Pn(i,j)を終点とするベクトルを、注目画素P(i,j)の動きベクトル(Vx,Vy)として求めて参照画素位置検出部707に出力する。
【0328】
次に、ステップS703に対応する、注目画素に対応する画素の位置の検出の処理を図35のフローチャートを参照して、説明する。
【0329】
ステップS751乃至ステップS753の処理は、図10のステップS141乃至ステップS143の処理とそれぞれ同様なので、その説明は省略する。
【0330】
ステップS754において、参照画素位置検出部707は、誤差最小選択部706から供給された動きベクトルを基に、ステップS753の処理で読み出された画素位置情報が示す画素の位置のうち、サーチエリア2内の画素の位置を選択する。
【0331】
ステップS755において、参照画素位置検出部707は、ステップS754の処理で選択された画素の位置のうち、注目画素に最も近い画素の位置を選択する。
【0332】
ステップS756乃至ステップS758の処理は、図10のステップS145乃至ステップS147の処理と同様なので、その説明は省略する。
【0333】
ステップS759において、参照画素位置検出部707は、誤差最小選択部706から供給された動きベクトルを基に、ステップS758の処理で読み出された画素位置情報が示す、近傍の特徴量に対応する画素位置情報で示される画素の位置のうち、サーチエリア2内の画素の位置を選択する。
【0334】
ステップS760において、参照画素位置検出部707は、ステップS759の処理で選択された画素の位置のうち、注目画素に最も近い画素の位置を選択する。
【0335】
ステップS761乃至ステップS765の処理は、図10のステップS149乃至ステップS153の処理と同様なので、その説明は省略する。
【0336】
図31に構成を示す画像処理装置においては、予めフルサーチブロックマッチングまたは代表点ブロックマッチングによって、候補となる動きベクトルを求めてから、その動きベクトルを基準として、特徴量を利用して、より正確な動きベクトルを求めるので、より少ない演算量で、より正確な動きベクトルを求めることができる。
【0337】
フレームメモリ701乃至誤差最小選択部706においては、サーチエリアSR内のベクトルを間引くなど、処理の高速化の手法を採用するようにしてもよい。
【0338】
特徴量抽出部101乃至特徴量抽出部103および参照画素位置検出部707においては、誤差最小選択部706から供給された動きベクトルを基に、サーチエリア2を決定するので、より高速に、より正確な動きベクトルを求めることができる。
【0339】
なお、ブロックマッチングに代えて、勾配法により動きベクトルを検出して、検出された動きベクトルを基にサーチエリア2を決定するようにしてもよい。
【0340】
上述した一連の処理は、ハードウェアにより実行させることもできるが、ソフトウェアにより実行させることもできる。一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば汎用のパーソナルコンピュータなどに、記録媒体からインストールされる。
【0341】
図36は、上述した一連の処理をプログラムにより実行するパーソナルコンピュータの構成の例を示すブロック図である。CPU(Central Processing Unit)821は、ROM(Read Only Memory)822、または記憶部828に記憶されているプログラムに従って各種の処理を実行する。RAM(Random Access Memory)823には、CPU821が実行するプログラムやデータなどが適宜記憶される。これらのCPU821、ROM822、およびRAM823は、バス824により相互に接続されている。
【0342】
CPU821にはまた、バス824を介して入出力インタフェース825が接続されている。入出力インタフェース825には、キーボード、マウス、マイクロホンなどよりなる入力部826、ディスプレイ、スピーカなどよりなる出力部827が接続されている。CPU821は、入力部826から入力される指令に対応して各種の処理を実行する。そして、CPU821は、処理の結果得られた画像や音声等を出力部827に出力する。
【0343】
入出力インタフェース825に接続されている記憶部828は、例えばハードディスクなどで構成され、CPU821が実行するプログラムや各種のデータを記憶する。通信部829は、インターネット、その他のネットワークを介して外部の装置と通信する。この例の場合、通信部829は、入力画像を取得するか、または出力画像を出力する、外部とのインタフェースとして動作する。
【0344】
また、通信部829を介してプログラムを取得し、記憶部828に記憶してもよい。
【0345】
入出力インタフェース825に接続されているドライブ830は、磁気ディスク851、光ディスク852、光磁気ディスク853、或いは半導体メモリ854などが装着されたとき、それらを駆動し、そこに記録されているプログラムやデータなどを取得する。取得されたプログラムやデータは、必要に応じて記憶部828に転送され、記憶される。
【0346】
一連の処理をさせるプログラムが格納されている記録媒体は、図36に示すように、コンピュータとは別に、ユーザにプログラムを提供するために配布される、プログラムが記録されている磁気ディスク851(フレキシブルディスクを含む)、光ディスク852(CD-ROM(Compact Disc-Read Only Memory)、DVD(Digital Versatile Disc)を含む)、光磁気ディスク853(MD(Mini-Disc)(商標)を含む)、若しくは半導体メモリ854などよりなるパッケージメディアにより構成されるだけでなく、コンピュータに予め組み込まれた状態でユーザに提供される、プログラムが記録されているROM822や、記憶部828に含まれるハードディスクなどで構成される。
【0347】
なお、上述した一連の処理を実行させるプログラムは、必要に応じてルータ、モデムなどのインタフェースを介して、ローカルエリアネットワーク、インターネット、デジタル衛星放送といった、有線または無線の通信媒体を介してコンピュータにインストールされるようにしてもよい。
【0348】
また、本明細書において、記録媒体に格納されるプログラムを記述するステップは、記載された順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。
【0349】
【発明の効果】
以上のように、本発明によれば、動きベクトルを検出することができる。
【0350】
また、本発明によれば、より少ない計算量で、より迅速に、より正確な動きベクトルを検出できる。
【図面の簡単な説明】
【図1】ブロックマッチングアルゴリズムを採用した従来の画像処理装置の構成を示すブロック図である。
【図2】サーチエリアSRおよび基準ブロックBbを説明する図である。
【図3】ブロックマッチングアルゴリズムを説明する図である。
【図4】従来の動き検出の処理を説明するフローチャートである。
【図5】代表点ブロックマッチングにおける、サーチエリアSRおよび代表点ブロックを説明する図である。
【図6】本発明に係る画像処理装置の一実施の形態の構成を示すブロック図である。
【図7】特徴量フレームメモリ102が記憶する画素位置情報および画素位置情報の数の配置を説明する図である。
【図8】図6に構成を示す画像処理装置による、動きベクトルの検出の処理を説明するフローチャートである。
【図9】ステップS101に対応する、画素位置情報の格納の処理を説明するフローチャートである。
【図10】ステップS102の処理に対応する、注目画素に対応する画素位置の検出の処理を説明するフローチャートである。
【図11】本発明に係る画像処理装置の他の実施の形態の構成を示すブロック図である。
【図12】特徴量フレームメモリ202が記憶するクラスタおよび画素位置情報の数の配置を説明する図である。
【図13】クラスタの構成の例を説明する図である。
【図14】アドレス生成部201の構成の例を示すブロック図である。
【図15】図11に構成を示す画像処理装置による、動きベクトルの検出の処理を説明するフローチャートである。
【図16】ステップS201の処理に対応する、画素位置情報の格納の処理を説明するフローチャートである。
【図17】ステップS225の処理に対応する、アドレス生成の処理を説明するフローチャートである。
【図18】ステップS225の処理に対応する、アドレス生成の処理を説明するフローチャートである。
【図19】ステップS202の処理に対応する、注目画素に対応する画素位置の検出の処理を説明するフローチャートである。
【図20】ステップ303の処理に対応する、特徴量に対応する画素位置情報の読み出しの処理を説明するフローチャートである。
【図21】本発明に係る画像処理装置のさらに他の実施の形態の構成を示すブロック図である。
【図22】特徴量記憶部401の構成の例を示すブロック図である。
【図23】特徴量に対応した特徴量アドレス毎のインデックスメモリ422に格納されるデータの例を示す図である。
【図24】画像処理装置が図21に示す構成を有する場合の、画素位置情報の格納の処理を説明するフローチャートである。
【図25】画像処理装置が図21に示す構成を有する場合の、特徴量に対応する画素位置情報の読み出しの処理を説明するフローチャートである。
【図26】本発明に係る画像処理装置のさらに他の実施の形態の構成を示すブロック図である。
【図27】図26に構成を示す画像処理装置による、動きベクトルの検出の処理を説明するフローチャートである。
【図28】各クラスタに1つの画素位置情報を格納する場合の、アドレスの組み替えの処理を説明するフローチャートである。
【図29】各クラスタに1つの画素位置情報を格納する場合の、アドレスの組み替えの処理を説明するフローチャートである。
【図30】ステップS603の処理に対応する、画素位置情報の格納の処理を説明するフローチャートである。
【図31】本発明に係る画像処理装置のさらに他の実施の形態の構成を示すブロック図である。
【図32】サーチエリア生成部702で生成されるサーチエリアSR、ブロック生成部704で生成される基準ブロックBb、マッチング部705で生成される参照ブロックBrn、および参照画素位置検出部707で生成されるサーチエリアの関係を説明する図である。
【図33】図31に構成を示す画像処理装置による動きベクトルの検出の処理を説明するフローチャートである。
【図34】ステップS702に対応する、ブロックマッチングの処理を説明するフローチャートである。
【図35】ステップS703に対応する、注目画素に対応する画素の位置の検出の処理を説明するフローチャートである。
【図36】一連の処理をプログラムにより実行するパーソナルコンピュータの構成の例を示すブロック図である。
【符号の説明】
101 特徴量抽出部, 102 特徴量フレームメモリ, 103 特徴量抽出部, 104 参照画素位置検出部, 201 アドレス生成部, 202特徴量フレームメモリ, 203 参照画素位置検出部, 221 メモリ状態記憶部, 222 判断部, 223 アドレス算出部, 401 特徴量記憶部, 402 参照画素位置検出部, 421 記憶制御部, 422 インデックスメモリ, 423 フレームメモリ, 601 特徴量ヒストグラム生成部, 602 アドレス生成部, 603 画素値フレームメモリ, 701ラインメモリ, 702 サーチエリア生成部, 703 ラインメモリ, 704 ブロック生成部, 705 マッチング部, 706 誤差最小選択部, 707 参照画素位置検出部, 821 CPU, 822 ROM, 823 RAM, 828 記憶部, 851 磁気ディスク, 852 光ディスク, 853 光磁気ディスク, 854 半導体メモリ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus and method, a recording medium, and a program, and more particularly, to an image processing apparatus and method, a recording medium, and a program for detecting image motion.
[0002]
[Prior art]
There is a technique for obtaining a motion vector indicating the motion of an image and efficiently processing a moving image based on the motion vector.
[0003]
Several methods for obtaining the above-described motion vector have been proposed. As a typical method, there is a method called a block matching algorithm.
[0004]
FIG. 1 is a block diagram showing a configuration of a conventional image processing apparatus employing a block matching algorithm.
[0005]
For example, when an image (image data) is input at time t1, the frame memory 11 stores and stores an image for one frame. Further, when the next frame image is input at time t2, which is the timing of the next frame, the frame memory 11 stores and stores the newly input image for one frame at time t2. An image for one frame at time t1 is output to the search area generation unit 12.
[0006]
The line memory 13 stores an input image of a predetermined line of one frame input at the timing of time t2, and outputs it to the block generation unit 14 at the timing of time t2.
[0007]
That is, when the frame memory 11 stores and stores pixel values of an image of one frame (current) input at the timing of the above-described time t2, the frame memory 11 stores the time t1 (one timing past). Are output to the search area generation unit 12. The line memory 13 outputs the pixel value of the image of the line of one frame (currently) input at the timing of time t <b> 2 to the block generation unit 14. Hereinafter, a frame corresponding to a line of an image stored in the line memory 13 is referred to as a current frame Fc, and an image output from the frame memory 11 is referred to as a reference frame Fr.
[0008]
The search area generation unit 12 generates a search area SR from the reference frame Fr supplied from the frame memory 11 and supplies the pixel values of the pixels in the search area SR to the matching unit 15.
[0009]
The block generation unit 14 generates a reference block Bb from the current frame Fc supplied from the line memory 13 and supplies the pixel value of the pixel of the reference block Bb to the matching unit 15.
[0010]
As shown in FIG. 2, the search area SR of the reference frame Fr is composed of pixels of NS (number of pixels) horizontally and MS (number of pixels) vertically, and the reference block Bb of the current frame Fc is NB (pixels) horizontally. Number), and vertically composed of MB (number of pixels) pixels. Usually, the search area SR is composed of a larger area (a larger number of pixels) than the reference block Bb.
[0011]
In this case, the number of vertical and horizontal pixels in the search area SR can be set to the same number L.
[0012]
The matching unit 15 refers to the search area SR based on the pixel value of the pixel in the search area SR supplied from the search area generation unit 12 and the pixel value of the pixel in the reference block Bb supplied from the block generation unit 14. The sum of absolute differences between the pixel value of each pixel constituting the block Brn and the pixel value of each pixel of the base block Bb is calculated, and the sum of absolute differences is calculated together with the vector from the reference block Brn to the base block Bb. The value is supplied to the minimum error selection unit 16 as a value.
[0013]
The minimum error selection unit 16 selects a vector corresponding to the minimum error value and outputs the selected vector as a motion vector.
[0014]
Here, the block matching algorithm will be described. For example, as shown in FIG. 3, when obtaining a motion vector corresponding to the target pixel P (i, j) in the current frame Fc, first, the target pixel P (i, j) is centered on the current frame Fc. A reference block Bb (i, j) composed of L (number of pixels) × L (number of pixels), a search area SR corresponding to the position of the target pixel P (i, j) on the reference frame Fr, and the search area Reference blocks Brn (i, j) each consisting of L (number of pixels) × L (number of pixels) pixels are set in SR.
[0015]
Next, the process of obtaining the sum of the absolute values of the pixel value differences between the respective pixels of the base block Bb (i, j) and the reference block Brn (i, j) is performed by converting the reference block Brn into the search area SR. While moving in the raster scan order by one pixel in the horizontal direction or the vertical direction throughout the entire area, the process is repeated from Br1 to Brm (m is possible to set m reference blocks Brn in the search area SR) in FIG. .
[0016]
Of the sum of absolute differences between the pixels of the base block Bb (i, j) and the reference block Brn (i, j) obtained in this way, the reference block Brn having the smallest difference absolute value sum is obtained. Thus, the reference pixel Pn (i, j) serving as the center of the L × L pixels constituting the reference block Brn (i, j) closest to (similar to) the base block Bb (i, j) is Desired.
[0017]
A vector having a pixel P ′ (i, j) on the reference frame Fr corresponding to the target pixel P (i, j) on the current frame Fc as a start point and a reference pixel Pn (i, j) as an end point is obtained. , And output as a motion vector (Vx, Vy) of the pixel of interest P (i, j). Here, for example, when P (i, j) = (a, b) and Pn (i, j) = (c, d), (Vx, Vy) becomes (Vx, Vy) = ( c-a, db).
[0018]
That is, the reference block Brn closest to (similar to) the base block Bb (i, j) starting from the reference pixel P ′ (i, j) on the reference frame corresponding to the target pixel P (i, j). A vector whose end point is a reference pixel Pn (i, j) that is the center of L × L pixels that constitute (i, j) is obtained as a motion vector.
[0019]
Next, the motion detection process of the image processing apparatus of FIG. 1 will be described with reference to the flowchart of FIG.
[0020]
In step S1, the search area generator 12 sets a search area SR according to the pixel position of the pixel of interest P (i, j) on the current frame Fc.
[0021]
In step S2, the minimum error selection unit 16 sets the variable min for setting the minimum value of the sum of absolute differences between the pixels of the base block Bb (i, j) and the reference block Brn (i, j) as described above. Initialization is performed by setting a value obtained by multiplying the number of gradations of the pixel by the number of pixels constituting the reference block Bb (i, j). That is, for example, when one pixel is 8-bit data, the number of gradations of one pixel is 2 8, and thus 256 gradations (256 colors) are obtained. Further, when the reference block Bb (i, j) is composed of L pixels × L pixels = 3 pixels × 3 pixels, the number of pixels is nine. As a result, the variable min is initialized to 2304 (= 256 (number of gradations) × 9 (number of pixels)).
[0022]
In step S3, the matching unit 15 initializes a counter variable n for counting the reference block Brn to 1.
[0023]
In step S4, the minimum error selection unit 16 initializes a variable sum used for substituting the sum of absolute differences between the pixels of the base block Bb and the reference block Brn to 0.
[0024]
In step S5, the matching unit 15 obtains the sum of absolute differences (= sum) between the pixels of the base block Bb (i, j) and the reference block Brn (i, j). That is, when each pixel of the reference block Bb (i, j) is indicated as P_Bb (i, j) and each pixel of the reference block Brn (i, j) is indicated as P_Brn (i, j), the matching unit 15 The calculation represented by the following expression (1) is executed to obtain the sum of absolute differences between the pixels of the base block Bb (i, j) and the reference block Brn (i, j).
[0025]
[Expression 1]
Figure 0004218298
[0026]
In step S6, the minimum error selection unit 16 determines whether or not the variable min is larger than the variable sum. For example, when determining that the variable min is larger than the variable sum, in step S7, the variable min is changed to the variable sum. And the value of the counter n at that time is registered as a motion vector number. That is, the fact that the variable sum indicating the sum of absolute differences obtained is smaller than the variable min indicating the minimum value means that the reference block Brn (i, i, Since j) can be regarded as more similar to the reference block Bb (i, j), a counter n at that time is registered as a motion vector number in order to make it a candidate for obtaining a motion vector. If it is determined in step S6 that the variable min is not greater than the variable sum, the process in step S7 is skipped.
[0027]
In step S8, the matching unit 15 determines whether or not the counter variable n is the total number m of reference blocks Brn in the search area SR, that is, whether or not the current reference block Brn is Brn = Brm. If it is determined that the total number is not m, the counter variable n is incremented by 1 in step S9, and the process returns to step S4.
[0028]
If it is determined in step S8 that the counter variable n is the total number m of reference blocks Brn in the search area, that is, the current reference block Brn is Brn = Brm, in step S10, the minimum error selection unit 16 The motion vector is output based on the registered motion vector number. That is, by repeating steps S4 to S9, the counter variable n corresponding to the reference block Brn that minimizes the sum of absolute differences is registered as a motion vector number. Among the L × L pixels of the reference block Brn corresponding to the motion vector number, a reference pixel Pn (i, j) serving as the center is obtained and corresponds to the target pixel P (i, j) on the current frame Fc. A vector starting from the pixel P ′ (i, j) on the reference frame Fr and ending at the reference pixel Pn (i, j) is obtained as the motion vector (Vx, Vy) of the pixel of interest P (i, j). Output.
[0029]
In the image processing apparatus having the configuration shown in FIG. 1, the calculation amount per frame is included in the number of pixels in one frame × the calculation amount of the sum of absolute differences × the number of pixels included in the reference block Bb × the search area SR. It is obtained from the number of pixels.
[0030]
When the calculation amount of the sum of absolute differences is represented by one clock, and the reference block Bb includes 8 × 8 pixels and the search area SR includes 20 × 20 pixels, a motion vector for one pixel is obtained. The calculation amount of processing is 8 × 8 × 20 × 20 × 1 clock, that is, 25600 clocks.
[0031]
Since a huge amount of calculation is required, a moving image cannot be processed in real time.
[0032]
In order to reduce the amount of calculation, a representative point block matching algorithm is used as a kind of block matching algorithm.
[0033]
In the representative point block matching algorithm, a representative point block is used instead of the reference block Bb as shown in FIG. Among the pixels included in the representative point block, one or a plurality of pixels such as a central pixel of the representative point block or a pixel at a predetermined position of the representative point block are selected as representative points.
[0034]
In the representative point block matching algorithm, the sum of absolute differences between the representative point and the reference representative pixel in the search area SR is calculated, and the minimum sum of absolute differences is selected. Then, the reference representative pixel (i, j) corresponding to the minimum sum of absolute differences is set starting from the pixel P ′ (i, j) on the reference frame Fr corresponding to the representative point (i, j) on the current frame Fc. ) As an end point is output as the motion vector (Vx, Vy) of the representative point block.
[0035]
In the representative point block matching, the calculation amount is the number of pixels × the calculation amount of the sum of absolute differences × the number of pixels included in the representative point block × the number of pixels included in the search area SR / the number of pixels included in the representative point block. Calculated by number.
[0036]
When the amount of calculation of the sum of absolute differences is represented by one clock, and the representative point block includes 8 × 8 pixels and the search area SR includes 20 × 20 pixels, a motion vector for one pixel is obtained. The calculation amount of processing is 8 × 8 × 20 × 20 / (8 × 8) × 1 clock, that is, 400 clocks.
[0037]
In the representative point block matching, the amount of calculation is reduced, but since the motion vector is obtained for the representative point block, the accuracy of the motion vector is deteriorated.
[0038]
Also, when detecting a motion vector by the block matching method, the amount of computation is reduced by detecting the motion vector based on an evaluation value obtained from a weighted average of values obtained by accumulating absolute value differences between the steady component and the transient component. There is something to be made (for example, refer to Patent Document 1).
[0039]
Furthermore, the pixel values in the reference block and the search range are encoded, a matching operation is performed based on the code value, a first motion vector is calculated based on the operation result, and motion compensation according to the first motion vector is performed. The second motion vector is calculated by performing block matching based on the difference of the pixel values for a new search range obtained by shifting the candidate block related to the first motion vector by one pixel after being performed. In some cases, the calculation is simplified by calculating the final motion vector as the sum of the first motion vector and the second motion vector (see, for example, Patent Document 2).
[0040]
[Patent Document 1]
Japanese Patent Application Laid-Open No. 07-087494
[Patent Document 2]
JP 2000-278691 A
[0041]
[Problems to be solved by the invention]
As described above, conventionally, in order to detect a motion vector, a huge amount of calculation is required, and a motion vector cannot be detected quickly. Further, when obtaining a more accurate motion vector, there is a problem that the amount of calculation further increases.
[0042]
The present invention has been made in view of such a situation, and an object thereof is to detect a more accurate motion vector more quickly with a smaller amount of calculation.
[0043]
[Means for Solving the Problems]
Of the present invention The image processing apparatus includes: a first feature amount extraction unit that extracts a feature amount of a first pixel of a second frame that is a temporally previous frame with respect to the first frame; Predetermined Area specified by the first address corresponding to the feature quantity In , Has a predetermined feature Pixel position information indicating the position of the first pixel And region position information indicating a region next to the region in which pixel position information of other first pixels having a predetermined feature amount is stored. Storage control means, second feature quantity extraction means for extracting the feature quantity of the second pixel of the first frame, and stored pixel position information indicating the position of the first pixel Based on the distance between the first pixel and the second pixel obtained from From the position of the first pixel having the same feature quantity as the feature quantity of the second pixel, Used to calculate the motion vector of the second pixel, Selection means for selecting the position of the first pixel whose destination is the second pixel And a calculating means for calculating a motion vector of the second pixel from the position of the selected first pixel and the position of the second pixel. And the storage control means includes the first pixel. Predetermined If there is no more space in the area specified by the first address corresponding to the feature amount, As the position information indicating the next area, the pixel position information and the area position information of the first pixel having another feature quantity different from the predetermined feature quantity are stored. The second position corresponding to the other feature quantity is stored. Among the areas specified by the address, the pixel position information and the information indicating the area where the area position information is not stored are stored, and the second position indicated by the area position information of the area specified by the first address The pixel position information of the next first pixel having a predetermined feature amount and the area position information are stored in the area specified by the address. It is characterized by that.
[0045]
The selection means stores pixel position information indicating the position of the first pixel stored. Based on the distance between the first pixel and the second pixel obtained from From the position of the first pixel of the feature quantity that approximates the feature quantity of the second pixel, Used to calculate the motion vector of the second pixel, It is possible to select the position of the first pixel whose destination is the second pixel.
[0046]
The storage control means is for the first pixel. Predetermined When there is no space in the area specified by the first address corresponding to the feature amount, the largest number of free areas Corresponding to Select the second address, and the area specified by the second address To store pixel position information and area position information Can be.
[0047]
For all the first pixels of the second frame, the number of first pixels for each feature amount is calculated. Number of pixels A calculation unit may be further provided, and the storage control unit may select the second address in advance based on the number of first pixels for each feature amount.
[0048]
Of the present invention The image processing method is A first feature amount extraction step for extracting a feature amount of the first pixel of the second frame, which is a temporally previous frame with respect to the first frame, and a predetermined feature amount of the first pixel The pixel position information indicating the position of the first pixel having the predetermined feature amount and the pixel position information of the other first pixel having the predetermined feature amount are stored in the area specified by the first address. A storage control step for storing region position information indicating a region next to the region, a second feature amount extraction step for extracting a feature amount of the second pixel of the first frame, and Based on the distance between the first pixel and the second pixel obtained from the pixel position information indicating the position of the first pixel, the position of the first pixel having the same feature quantity as the feature quantity of the second pixel is selected. , Used to calculate the motion vector of the second pixel, the moved destination is the second A selection step of selecting a position of the first pixel that is a prime, and a calculation step of calculating a motion vector of the second pixel from the position of the selected first pixel and the position of the second pixel. In the storage control step, when there is no more space in the area specified by the first address corresponding to the predetermined feature quantity of the first pixel, the predetermined feature quantity is used as area position information indicating the next area. The pixel position information and the region position of the region specified by the second address corresponding to the other feature amount, in which the pixel position information and the region position information of the first pixel having different other feature amounts are stored. Information indicating an area in which no information is stored is stored, and the area specified by the second address indicated by the area position information of the area specified by the first address has a predetermined feature amount And pixel position information of the first pixel of and stores the area position information It is characterized by that.
[0049]
Of the present invention The program of the recording medium is A first feature amount extraction step for extracting a feature amount of the first pixel of the second frame, which is a temporally previous frame with respect to the first frame, and a predetermined feature amount of the first pixel The pixel position information indicating the position of the first pixel having the predetermined feature amount and the pixel position information of the other first pixel having the predetermined feature amount are stored in the area specified by the first address. A storage control step for storing region position information indicating a region next to the region, a second feature amount extraction step for extracting a feature amount of the second pixel of the first frame, and Based on the distance between the first pixel and the second pixel obtained from the pixel position information indicating the position of the first pixel, the position of the first pixel having the same feature quantity as the feature quantity of the second pixel is selected. , Used to calculate the motion vector of the second pixel, the moved destination is the second A selection step of selecting a position of the first pixel that is a prime, and a calculation step of calculating a motion vector of the second pixel from the position of the selected first pixel and the position of the second pixel. In the storage control step, when there is no more space in the area specified by the first address corresponding to the predetermined feature amount of the first pixel, as the area position information indicating the next area, In the region specified by the second address corresponding to the other feature amount, the pixel position information and the region position information of the first pixel having another feature amount different from the predetermined feature amount are stored. The pixel position information and the information indicating the area where the area position information is not stored are stored, and specified by the second address indicated by the area position information of the area specified by the first address The frequency, and stores the pixel position information of the first pixel of the next, and the area position information having the predetermined feature quantity It is characterized by that.
[0050]
Of the present invention The program A first feature amount extraction step for extracting a feature amount of the first pixel of the second frame, which is a temporally previous frame with respect to the first frame, and a predetermined feature amount of the first pixel The pixel position information indicating the position of the first pixel having the predetermined feature amount and the pixel position information of the other first pixel having the predetermined feature amount are stored in the area specified by the first address. A storage control step for storing region position information indicating a region next to the region, a second feature amount extraction step for extracting a feature amount of the second pixel of the first frame, and Based on the distance between the first pixel and the second pixel obtained from the pixel position information indicating the position of the first pixel, the position of the first pixel having the same feature quantity as the feature quantity of the second pixel is selected. , Used to calculate the motion vector of the second pixel, the moved destination is the second A selection step of selecting a position of the first pixel that is a prime, and a calculation step of calculating a motion vector of the second pixel from the position of the selected first pixel and the position of the second pixel. In the storage control step, when there is no more space in the area specified by the first address corresponding to the predetermined feature amount of the first pixel, as the area position information indicating the next area, In the region specified by the second address corresponding to the other feature amount, the pixel position information and the region position information of the first pixel having another feature amount different from the predetermined feature amount are stored. The pixel position information and the information indicating the area where the area position information is not stored are stored, and specified by the second address indicated by the area position information of the area specified by the first address The frequency, and stores the pixel position information of the first pixel of the next, and the area position information having the predetermined feature quantity It is characterized by that.
[0056]
Of the present invention In the image processing apparatus and method, the recording medium, and the program, the feature amount of the first pixel of the second frame, which is a frame temporally previous to the first frame, is extracted, and the first pixel Predetermined In the area specified by the first address corresponding to the feature amount, Has a predetermined feature Pixel position information indicating the position of the first pixel Region position information indicating a region next to the region, in which pixel position information of other first pixels having a predetermined feature amount is stored; Is memorized. Furthermore, pixel position information indicating the position of the first pixel, in which the feature amount of the second pixel of the first frame is extracted and stored Based on the distance between the first pixel and the second pixel obtained from From the position of the first pixel having the same feature quantity as the feature quantity of the second pixel, Used to calculate the motion vector of the second pixel, The position of the first pixel whose destination is the second pixel is selected The motion vector of the second pixel is calculated from the position of the selected first pixel and the position of the second pixel. . And the first pixel Predetermined If there is no more space in the area specified by the first address corresponding to the feature amount, As the position information indicating the next area, the pixel position information and the area position information of the first pixel having another feature quantity different from the predetermined feature quantity are stored. The second position corresponding to the other feature quantity is stored. Of the area specified by the address, the pixel position information and the information indicating the area where the area position information is not stored are stored, and the second is indicated by the area position information of the area specified by the first address. The pixel position information of the next first pixel having a predetermined feature amount and the area position information are stored in the area specified by the address of Is done.
[0058]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 6 is a block diagram showing a configuration of an embodiment of an image processing apparatus according to the present invention. The image input to the image processing apparatus is supplied to the feature quantity extraction unit 101 and the feature quantity extraction unit 103.
[0059]
The feature quantity extraction unit 101 uses the pixels of the input image as reference pixels in the raster scan order, for example, and extracts feature quantities corresponding to the reference pixels. The feature amount is an amount representing the feature of the pixel. For example, the feature amount extraction unit 101 sets a value obtained by arranging pixel values of pixels included in a 3 × 3 block centered on the reference pixel in a predetermined order (for example, raster scan order). When a value obtained by arranging pixel values of pixels included in a 3 × 3 block centering on a reference pixel in a predetermined order is a feature amount, if the pixel value of any pixel included in the block changes, The amount will change.
[0060]
The feature quantity extraction unit 101 supplies the extracted feature quantity to the feature quantity frame memory 102 together with pixel position information indicating the position of the reference pixel on the screen.
[0061]
The feature amount frame memory 102 acquires the pixel position information indicating the position of the reference pixel on the screen and the feature amount supplied from the feature amount extraction unit 101, and stores the pixel position information at an address corresponding to the feature amount. .
[0062]
FIG. 7 is a diagram for explaining the arrangement of the pixel position information and the number of pixel position information stored in the feature amount frame memory 102.
[0063]
Each square indicated by D in the figure indicates one storage area D for storing one pixel position information or the number of one pixel position information.
[0064]
In FIG. 7, the position in the vertical direction (column direction) of the storage area D is specified by a feature amount address, and corresponds to one (one type) feature amount. That is, it can be said that one feature amount address indicates one feature amount. When the feature amount addresses are different, each feature amount address indicates a different feature amount. In the example of the feature amount frame memory 102 shown in FIG. 7, N feature amount addresses in the range of 0 to N−1 are set. In other words, the feature amount frame memory 102 shown in FIG. 7 can store pixel position information of pixels classified into N types of feature amounts.
[0065]
In FIG. 7, the horizontal direction (row direction) position of the storage area D is specified by a flag address. In the storage area D in the left column in the figure where the flag address is 0, the number of pixels having the feature amount specified by the feature amount address is stored. Since the number of pixels having the same feature amount is equal to the number of pixel position information indicating the position of the pixel, the storage address D in the left column in the drawing in which the flag address is 0 is the same feature amount pixel. The number of pixel position information is stored. In other words, the number of pieces of pixel position information stored in the storage area D specified by the feature quantity address is stored in the storage area D specified by the predetermined feature quantity address. .
[0066]
Hereinafter, the position of the storage area D where the feature amount address is a and the flag address is b is represented as an address (a, b).
[0067]
In the storage area D of the column in the figure having flag addresses 1 to M, one piece of pixel position information indicating the pixel position of the pixel having the feature amount specified by the feature amount address is stored. For example, the pixel position information indicating the pixel position of the first pixel having the feature amount corresponding to the feature amount address 2 is stored in the storage area D of the address (2, 1). Then, the pixel position information indicating the pixel position of the second pixel having the feature amount corresponding to the feature amount address 2 is stored in the storage area D of the address (2, 2).
[0068]
As described above, when the feature amount corresponding to the feature amount address 2 is extracted, the pixel position information indicating the pixel position of the reference pixel from which the feature amount is extracted is the storage area D indicated by the feature amount address 2. Thus, the addresses specified by the flag addresses 1 to M are stored in order from the left side to the right side in the figure.
[0069]
Similarly, when a feature amount corresponding to any one of the feature amount addresses 0 to N−1 is extracted, pixel position information indicating the pixel position of the reference pixel from which the feature amount is extracted is 0 to N−1. Are stored in order from the left side to the right side in the drawing in the storage area D indicated by any one of the feature quantity addresses.
[0070]
In each storage area D, for example, a storage area of one word (for example, 32 bits) can be arranged.
[0071]
As described above, the feature amount frame memory 102 sequentially stores the pixel position information of the pixels classified by the feature amount.
[0072]
The feature amount frame memory 102 stores and reads out pixel position information corresponding to the current frame Fc (current frame) and pixel position information corresponding to the reference frame Fr (previous frame), respectively. it can. That is, the feature amount frame memory 102 has a page of the storage area D shown in FIG. 7 corresponding to the current frame Fc and a page of the storage area D shown in FIG. 7 corresponding to the reference frame Fr, and switches pages. Thus, the pixel position information of the current frame Fc supplied from the feature amount extraction unit 101 can be stored, and the stored pixel position information of the reference frame Fr can be read and supplied to the reference pixel position detection unit 104. .
[0073]
The feature amount extraction unit 103 sets the pixel of the input image as a target pixel in, for example, raster scan order, and extracts a feature amount corresponding to the target pixel by the same processing as the feature amount extraction unit 101. For example, the feature quantity extraction unit 101 sets a value obtained by arranging pixel values of pixels included in a 3 × 3 block centered on the reference pixel in a predetermined order.
[0074]
The feature quantity extraction unit 103 supplies the extracted feature quantity to the reference pixel position detection unit 104 together with pixel position information indicating the position of the target pixel on the screen.
[0075]
Note that the number of pixels included in the block for calculating the feature value output by the feature value extraction unit 101 or the feature value extraction unit 103 can be any number, and is not limited to 3 × 3. Absent. A predetermined number of pixels may be extracted from the block for calculating the feature amount, and the feature amount may be obtained from the extracted pixel.
[0076]
Further, the feature quantity extracted by the feature quantity extraction unit 101 or the feature quantity extraction unit 103 is not limited to the value in which the pixel values of the pixels included in the block are arranged, but the pixel value itself of the target pixel or the reference pixel or the sum of the pixel values Alternatively, an average value of pixel values, an array of values obtained by extracting predetermined bits higher than the pixel value, a sum, or an average value may be used.
[0077]
Further, the feature quantity extraction unit 101 or the feature quantity extraction unit 103 calculates a feature quantity based on a result obtained by applying a predetermined calculation to a pixel value such as ADRC (Adaptive Dynamic Range Coding) or Laplacian. May be.
[0078]
The reference pixel position detection unit 104 uses the feature amount of the target pixel supplied from the feature amount extraction unit 103 and the pixel position information of the reference frame Fr stored in the feature amount frame memory 102, so that the feature amount of the target pixel The pixel position of the pixel of the reference frame Fr having the same feature amount as is detected. The reference pixel position detection unit 104 selects the position of the reference frame Fr whose target is the target pixel from the pixel position of the pixel of the reference frame Fr having the same feature quantity as the detected feature quantity of the target pixel. To do. Then, the reference pixel position detection unit 104 starts from a pixel on the reference frame Fr at a position corresponding to the position of the target pixel from the pixel position information of the target pixel and the pixel position of the selected pixel of the reference frame Fr. A motion vector whose end point is a selected pixel of the reference frame Fr having the same feature amount as the feature amount of the target pixel is obtained, and the obtained motion vector is output.
[0079]
Although it has been described that the process is executed in units of frames, it is needless to say that the process may be executed in units of fields. Further, the processing target is not limited to temporally adjacent frames or fields, but can be frames or fields that are temporally separated. The same applies to the following embodiments.
[0080]
FIG. 8 is a flowchart for explaining motion vector detection processing by the image processing apparatus having the configuration shown in FIG.
[0081]
In step S101, the feature quantity extraction unit 101 and the feature quantity frame memory 102 store the pixel position information by executing a process of storing the pixel position information of the reference frame Fr. Details of the process of storing the pixel position information will be described later with reference to the flowchart of FIG.
[0082]
In step S102, the feature amount extraction unit 103 and the reference pixel position detection unit 104 perform a process of detecting the position of the pixel corresponding to the target pixel, and have the same feature amount as the feature amount of the target pixel. The pixel position of this pixel is detected. Details of the process of detecting the position of the pixel corresponding to the target pixel will be described later with reference to the flowchart of FIG.
[0083]
In step S103, the reference pixel position detection unit 104, based on the pixel position information of the target pixel supplied from the feature amount extraction unit 103 and the pixel position of the pixel of the reference frame Fr detected in the process of step S102. Find the motion vector. For example, the reference pixel position detection unit 104 starts the pixel on the reference frame Fr at the position corresponding to the position of the target pixel, and moves the pixel of the reference frame Fr having the same feature amount as the target pixel as the end point. Find a vector.
[0084]
In step S104, the reference pixel position detection unit 104 outputs the motion vector obtained in the process of step S103, and the process ends.
[0085]
FIG. 9 is a flowchart for explaining pixel position information storage processing corresponding to step S101.
[0086]
In step S <b> 121, the feature amount frame memory 102 initializes data stored in the feature amount frame memory 102. For example, the feature amount frame memory 102 initializes the data by setting 0 in the storage area D whose flag address is 0 and setting null in the storage area D whose flag address is 1 to M. To do.
[0087]
In step S122, the feature amount extraction unit 101 initializes the counter variable n. The counter variable n is a variable for counting the number of pixels to be processed. For example, the feature amount frame memory 102 sets 1 to the counter variable n in step S122.
[0088]
In step S123, the feature amount extraction unit 101 selects a pixel that has not yet been set as a reference pixel from the pixels of the reference frame Fr and sets it as a reference pixel. The feature amount extraction unit 101 extracts the feature amount of the reference pixel by calculating the feature amount of the block corresponding to the reference pixel, and extracts the feature amount together with the pixel position information indicating the position of the reference pixel. This is supplied to the memory 102. For example, the feature amount extraction unit 101 calculates a feature amount that is a value in which pixel values of pixels included in a 3 × 3 block centered on the reference pixel are arranged in raster scan order.
[0089]
In step S124, the feature amount frame memory 102 reads the number of pixel position information corresponding to the feature amount calculated in the process of step S123. For example, when the feature amount address corresponding to the feature amount of the reference pixel is k, the feature amount frame memory 102 reads the number of pixel position information corresponding to the feature amount from the storage area D of the address (k, 0). .
[0090]
In step S125, the feature amount frame memory 102 increments the number of pixel position information read in the process of step S124. That is, the feature amount frame memory 102 adds 1 to the number of pixel position information read out in the process of step S124.
[0091]
In step S126, the feature amount frame memory 102 stores the number of pixel position information incremented in the process of step S125. For example, when the feature amount address corresponding to the feature amount is k, the feature amount frame memory 102 writes the number of incremented pixel position information in the storage area D of the address (k, 0).
[0092]
In step S127, the feature amount frame memory 102 indicates the pixel position of the reference pixel in the storage area D of the address specified from the feature amount address corresponding to the feature amount and the flag address corresponding to the number of pixel position information. Write pixel location information. For example, when the feature amount address corresponding to the feature amount of the reference pixel is k and the number of pixel position information is q, the feature amount frame memory 102 stores the reference pixel in the storage area D of the address (k, q). The pixel position information indicating the pixel position is written.
[0093]
In this way, pixel position information indicating pixels having the same feature amount is stored in order from the left side to the right side in FIG. 7 in the storage region D having the same feature amount address. Here, one storage area D stores one pixel position information.
[0094]
In step S128, the feature amount extraction unit 101 increments the counter variable n. That is, the feature quantity extraction unit 101 adds 1 to the counter variable n.
[0095]
In step S129, the feature amount extraction unit 101 determines whether the value of the counter variable n is equal to the number of pixels in the frame, and determines that the value of the counter variable n is not equal to the number of pixels in the frame. In this case, there are still pixels that are not set as reference pixels, that is, there are pixels for which feature amounts have not been extracted. Therefore, the process returns to step S123 and the above-described processing is repeated to extract feature amounts for the next reference pixel The pixel position information is stored in the feature amount frame memory 102.
[0096]
In step S129, when it is determined that the value of the counter variable n is equal to the number of pixels in the frame, all the pixels in the frame are set as reference pixels, and feature values of all the pixels in the frame are extracted, and all the pixels are extracted. Since the pixel position information corresponding to the pixel is stored in the feature amount frame memory 102, the processing ends.
[0097]
FIG. 10 is a flowchart for describing the process of detecting the pixel position corresponding to the target pixel, corresponding to the process of step S102.
[0098]
In step S141, the reference pixel position detection unit 104 initializes the counter variable n. The counter variable n is a variable for counting the number of pixels to be processed. For example, the feature amount frame memory 102 sets 1 to the counter variable n in step S141.
[0099]
In step S142, the feature amount extraction unit 103 selects a target pixel from among the pixels of the current frame Fc that have not yet been set as the target pixel, by the same processing as the feature amount extraction unit 101. The feature amount extraction unit 103 extracts the feature amount of the target pixel by calculating the feature amount of the block corresponding to the selected target pixel, and extracts it together with the pixel position information indicating the position of the target pixel on the screen. The feature amount is supplied to the reference pixel position detection unit 104. For example, the feature amount extraction unit 103 calculates a feature amount that is a value in which pixel values of pixels included in a 3 × 3 block centered on the target pixel are arranged in raster scan order.
[0100]
In step S143, the reference pixel position detection unit 104 reads pixel position information corresponding to the feature amount calculated in the process of step S142 from the feature amount frame memory 102. That is, the reference pixel position detection unit 104 reads pixel position information indicating the position of the pixel having the same feature amount as the feature amount supplied from the feature amount extraction unit 103 in the process of step S142.
[0101]
More specifically, when the feature amount address corresponding to the feature amount of the target pixel supplied from the feature amount extraction unit 103 is k, the reference pixel position detection unit 104 determines the address (k, The number q of pixel position information is read from the storage area D that is 0). Then, the reference pixel position detection unit 104 reads q pieces of pixel position information from the storage area D that is the addresses (k, 1) to (k, q) of the feature amount frame memory 102.
[0102]
In step S144, the reference pixel position detecting unit 104 reads out the pixel position information read out in step S143 as the position of the reference pixel corresponding to the movement of the target pixel (as the position of the reference pixel whose destination is the target pixel). The pixel position closest to the target pixel is selected from the pixel positions indicated by. That is, the reference pixel position detection unit 104 obtains the distance between the reference pixel (position) Pn (i, j) and the target pixel P (position) (i, j) indicated by the pixel position information, and the distance is minimized. The position of the reference pixel is selected.
[0103]
The reference pixel position detection unit 104 has been described as selecting the position of the pixel closest to the target pixel as the position of the reference pixel corresponding to the movement of the target pixel. However, the reference pixel position detection unit 104 is not limited to the position of the pixel closest to the target pixel. The position of the reference pixel having the pixel value closest to the pixel value of the target pixel, or the position of the reference pixel corresponding to the block composed of pixels having the pixel value closest to the pixel value of the pixel of the predetermined block including the target pixel, etc. Based on this criterion, the position of the reference pixel whose destination is the target pixel may be selected.
[0104]
The same applies to the processing for selecting pixel positions, which will be described below.
[0105]
In step S145, the reference pixel position detection unit 104 determines whether the distance between the position of the selected pixel and the position of the target pixel is shorter than a predetermined threshold, and the position of the selected pixel and the target pixel are determined. If it is determined that the distance from the position of the pixel is shorter than a predetermined threshold value, the correct pixel position corresponding to the movement of the target pixel is selected, and the process proceeds to step S152.
[0106]
If it is determined in step S145 that the distance between the selected pixel position and the target pixel position is greater than or equal to a predetermined threshold, the correct pixel position corresponding to the movement of the target pixel is not selected. In step S146, the reference pixel position detection unit 104 selects a feature quantity in the vicinity of the feature quantity of the block corresponding to the target pixel. Here, the feature amount in the vicinity means a feature amount indicating a pixel having an approximate feature. For example, a feature value calculated from a block composed of pixels having pixel values close to the pixel value of each pixel included in a predetermined block is a feature value near the feature value of the original block. Also, a feature that is calculated in the same way as a change in pixel values of pixels included in a predetermined block (for example, an array of differences in pixel values) and is calculated from a block composed of pixels having pixel values close to the original pixel values. The quantity is a feature quantity in the vicinity of the original block.
[0107]
For example, the feature quantity calculated from the block obtained by inverting the least significant bit of the pixel value of one pixel included in the original block is a feature quantity in the vicinity of the feature quantity of the original block. When a value obtained by arranging pixel values of pixels included in a block having a feature amount of 3 × 3 in a predetermined order is the feature amount, the feature amount of the block obtained by inverting the least significant bit of all the pixel values included in the block is , The feature amount in the vicinity of the feature amount of the original block.
[0108]
In step S <b> 147, the reference pixel position detection unit 104 reads out pixel position information corresponding to a nearby feature quantity from the feature quantity frame memory 102. That is, the reference pixel position detection unit 104 reads out pixel position information indicating the position of the pixel having the same feature quantity as the neighboring feature quantity selected in step S146. More specifically, for example, when the feature quantity address corresponding to the neighboring feature quantity is k ′, the reference pixel position detection unit 104 stores the storage area that is the address (k ′, 0) of the feature quantity frame memory 102. The number q ′ of pixel position information is read from D. Then, the reference pixel position detection unit 104 reads q ′ pieces of pixel position information from the storage area D that is the addresses (k ′, 1) to (k ′, q ′) of the feature amount frame memory 102.
[0109]
In step S148, the reference pixel position detection unit 104 determines the pixel closest to the target pixel among the pixel positions indicated by the pixel position information read out in step S147 as the position of the pixel whose destination is the target pixel. Select the position.
[0110]
In step S149, the reference pixel position detection unit 104 determines whether the distance between the position of the selected pixel and the position of the target pixel is shorter than a predetermined threshold, and the position of the selected pixel and the target pixel are determined. If it is determined that the distance from the position of the pixel is shorter than a predetermined threshold value, the correct pixel position corresponding to the movement of the target pixel is selected, and the process proceeds to step S152.
[0111]
If it is determined in step S149 that the distance between the selected pixel position and the target pixel position is greater than or equal to a predetermined threshold, the correct pixel position corresponding to the movement of the target pixel is not selected. In step S150, the reference pixel position detection unit 104 determines whether or not all the feature amounts in the vicinity of the predetermined range have been selected.
[0112]
For example, the reference pixel position detection unit 104 selects when a value obtained by arranging pixel values of pixels included in a block having a feature amount of 3 × 3 in a predetermined order is the feature amount supplied from the feature amount extraction unit 103. In the range of neighboring feature values, the feature value of the block obtained by inverting the least significant bit of all pixel values included in the block, and the feature value of the block obtained by inverting the lower 2 bits of all pixel values included in the block , And the feature amount of the block obtained by inverting the lower 3 bits of all the pixel values included in the block.
[0113]
If it is determined in step S150 that not all the feature quantities in the vicinity of the predetermined range have been selected, there are still neighboring feature quantities to be selected. Therefore, the process returns to step S146, and other feature quantities in the vicinity are selected. Steps S147 to S149 are repeated.
[0114]
If it is determined in step S150 that all the feature values in the vicinity of the predetermined range have been selected, there is no correct pixel corresponding to the movement of the pixel of interest in the feature values in the vicinity, and the process proceeds to step S151 to detect the reference pixel position. The unit 104 sets a predetermined value as the pixel position, and proceeds to step S152. In step S151, the reference pixel position detection unit 104 may set an error code corresponding to the target pixel.
[0115]
In step S152, the reference pixel position detection unit 104 increments the counter variable n. That is, the feature quantity extraction unit 101 adds 1 to the counter variable n.
[0116]
In step S153, the reference pixel position detection unit 104 determines whether the value of the counter variable n is equal to the number of pixels in the frame, and determines that the value of the counter variable n is not equal to the number of pixels in the frame. If there is, there is still a pixel that is not the target pixel, that is, there is a pixel whose corresponding pixel position has not been detected, so the process returns to step S142 and the above-described processing is repeated to correspond to the next target pixel. The pixel position is detected.
[0117]
If it is determined in step S153 that the value of the counter variable n is equal to the number of pixels in the frame, all the pixels in the frame are still the target pixels, and the positions of the pixels corresponding to all the pixels in the frame are detected. As a result, the process ends.
[0118]
As described above, the image processing apparatus having the configuration shown in FIG. 6 can detect a more accurate motion vector more quickly and with a smaller amount of computation than in the past.
[0119]
However, in the feature amount frame memory 102, the size of the memory area corresponding to the flag address is determined from the maximum number of pixel position information, that is, the number of pixels per frame. That is, in the feature amount frame memory 102, the total size of the memory area is the maximum number of pixel position information times the number of feature amounts.
[0120]
Therefore, in the feature amount frame memory 102, among the regions specified by the feature amount address, a space is generated in the region D specified by the feature amount address that does not become the maximum number of pixel position information, that is, the number of pixels. become.
[0121]
Here, in the feature amount frame memory 102, the memory allocation does not change statically during processing. In the feature amount addressing described above, pixel position information is stored for each feature amount address.
[0122]
Also, the number of pixel position information stored in the feature amount frame memory 102 corresponding to each feature amount address varies depending on the input image and frame to be processed. This is because the number of pixels corresponding to the feature amount varies depending on the image or the frame.
[0123]
FIG. 11 is a block diagram showing the configuration of another embodiment of the image processing apparatus according to the present invention. The same parts as those shown in FIG. 6 are denoted by the same reference numerals, and the description thereof is omitted.
[0124]
The address generation unit 201 generates an address to which pixel position information is to be written based on the feature amount and pixel position information supplied from the feature amount extraction unit 101, and the generated address is stored in the feature amount frame memory 202 together with the pixel position information. To supply. The address generation unit 201 calculates the number of pixel position information for each feature amount, and supplies the calculated number of pixel position information to the feature amount frame memory 202. The address generation unit 201 generates the next feature amount address and the next cluster number to be stored in the cluster stored in the feature amount frame memory 202, and generates the next feature amount address and the next cluster. The number is supplied to the feature amount frame memory 202.
[0125]
Although details will be described later, the cluster of the feature amount frame memory 202 stores a predetermined number of pixel position information of one or two or more. The next feature quantity address indicates the feature quantity address of the next cluster in which the pixel position information of the same feature quantity is stored following the cluster in which the next feature quantity address is stored. The next cluster number indicates the cluster address of the next cluster in which pixel position information of the same feature amount is stored following the cluster in which the next cluster number is stored.
[0126]
The feature amount frame memory 202 stores pixel position information corresponding to the feature amount based on the address supplied from the address generation unit 201 in units of clusters.
[0127]
FIG. 12 is a diagram for explaining the arrangement of the number of clusters and pixel position information stored in the feature amount frame memory 202.
[0128]
In FIG. 12, the position of the cluster in the vertical direction (column direction) is specified by a feature amount address, and in principle corresponds to one (one type) feature amount. That is, in the feature amount frame memory 202, it can be said that one feature amount address indicates one feature amount. When the feature amount addresses are different, each feature amount address indicates a different feature amount. In the example of the feature amount frame memory 202 shown in FIG. 12, N feature amount addresses in the range of 0 to N−1 are set. In other words, the feature amount frame memory 202 shown in FIG. 12 can store pixel position information of pixels classified into N types of feature amounts.
[0129]
The feature amount frame memory 202 stores the number of pixel position information of pixels having the same feature amount corresponding to each feature amount address, corresponding to N feature amount addresses ranging from 0 to N-1. The L in FIG. 0 Stores the number of pixel position information of the pixel having the feature amount corresponding to the feature amount address 0. L 1 Stores the number of pixel position information of the pixel having the feature amount corresponding to the feature amount address 1. Similarly, L 2 Thru L N-1 In each of these, the number of pixel position information of the pixel having the feature amount corresponding to each of the feature amount address 2 to the feature amount address N-1 is stored.
[0130]
In FIG. 12, the position in the horizontal direction (row direction) of the cluster is specified by the cluster address.
[0131]
Hereinafter, the position where the feature amount address is a and the cluster address is b is represented as address (a, b).
[0132]
As a general rule, the cluster in the column having a cluster address of 1 to R stores pixel position information indicating the pixel position of one or more pixels having the feature quantity specified by the feature quantity address. . Here, R indicates the maximum number of clusters that can be arranged in one row of the feature amount frame memory 202, that is, the maximum value of the cluster address.
[0133]
FIG. 13 is a diagram illustrating an example of a cluster configuration.
[0134]
The cluster shown in FIG. 13 stores Q pixel position information, and also stores the next feature amount address and the next cluster number. The feature amount of the pixel at the position indicated by the Q pixel position information stored in one cluster is the same.
[0135]
The next feature amount address and the next cluster number stored in the cluster store pixel position information of pixels having the same feature amount as the feature amount of the pixel at the position indicated by the Q pixel position information. Information for specifying the next cluster. That is, the next feature address stored in the cluster is the feature address, the next cluster number is the cluster address, and the next cluster whose address is specified stores the next feature address and the next cluster number. The pixel position information of the pixel having the same feature amount as that of the pixel at the position indicated by the pixel position information stored in the cluster is stored. For example, when the next feature amount address stored in the cluster of the address (K, R) is S and the next cluster number is R, the address of the next cluster is the address (S, R). . In the cluster at the address (S, R), the pixel position information of the pixel having the same feature amount as the pixel at the position indicated by the pixel position information stored in the cluster at the address (K, R) is stored. .
[0136]
For example, pixel position information indicating the pixel position of the first pixel having the feature amount corresponding to the feature amount address K is stored in the cluster at the address (K, 1). The pixel position information of the next pixel is sequentially stored in the cluster at the address (K, 1).
[0137]
When the cluster at the address (K, 1) is full, that is, when the pixel position information can no longer be stored in the cluster, the next pixel having the feature amount corresponding to the feature amount address K The pixel position information indicating the pixel position is stored in the cluster at the address (K, 2). The cluster of the address (K, 1) stores the next feature amount address and the next cluster number indicating the cluster of the address (K, 2).
[0138]
As described above, the pixel position information of the pixel having the feature amount corresponding to the feature amount address K can be sequentially stored in the cluster of the address (K, 1) to the cluster of the address (K, R). When the pixel position information of the pixel having the feature amount corresponding to the feature amount address K is sequentially stored in the cluster of the address (K, 1) to the cluster of the address (K, R), the cluster of the address (K, 1) The cluster of the address (K, R-1) has the next feature value address and the next cluster number indicating the cluster of the address (K, 2) to the cluster of the address (K, R) as the next cluster, respectively. Will be stored.
[0139]
Then, when all of the clusters at the address (K, 1) to the cluster at the address (K, R) are full, that is, no more pixel position information can be stored in the cluster at the feature amount address K. When the pixel position information indicating the pixel position of the next pixel having the feature quantity corresponding to the feature quantity address K is further stored in the feature quantity frame memory 202, the feature quantity address in which the smallest number of clusters are arranged is Explored. When the feature amount address where the smallest number of clusters are arranged is S, the cluster of the address (S, R) is set as the next cluster of the cluster of the address (K, R).
[0140]
Pixel position information indicating the pixel position of the next pixel having the feature amount corresponding to the feature amount address K is stored in the cluster at the address (S, R). The cluster of the address (K, R) stores the next feature amount address and the next cluster number indicating the position of the cluster of the address (S, R). Then, the pixel position information indicating the pixel position of the next pixel having the feature amount corresponding to the feature amount address K is stored in the cluster of the address (S, R) until the cluster of the address (S, R) is full. Stored.
[0141]
As described above, the feature amount frame memory 202, when the feature amount cannot be stored in the cluster of feature amount addresses corresponding to the feature amount, stores the pixel position information in the cluster of the other feature amount address having the largest free space. Store in order. The position of the cluster storing the pixel position information indicating the pixel position of the pixel having the same feature amount is sequentially specified by the next feature amount address and the next cluster number stored in the cluster.
[0142]
By doing so, the storage area of the feature amount frame memory 202 can be used effectively, and the pixel position information equal to the number of pixels of the frame, which is the maximum number of pixel position information, is set to 1 in advance. There is no need to secure one feature address. That is, in the image processing apparatus having the configuration shown in FIG. 11, the pixel position information corresponding to the pixels of one frame can be stored in a smaller storage area close to the number of pixels as a whole.
[0143]
If the feature amount frame memory 202 is configured by burst RAM (burst DRAM, burst SRAM, or pipeline burst SRAM, etc.) and the cluster is 4 to 8 words (one word is 32 bits), 1 By so-called burst transfer, in which a plurality of data is continuously transferred based on one address information, writing or reading can be performed more quickly in units of one cluster.
[0144]
Similar to the case of the feature amount frame memory 102, the feature amount frame memory 202 includes pixel position information corresponding to the current frame Fc (current frame) and pixel position information corresponding to the reference frame Fr (previous frame). Can be stored and read out respectively.
[0145]
Returning to FIG. 11, the reference pixel position detection unit 203 includes the feature amount of the target pixel supplied from the feature amount extraction unit 103 and the pixel position information of the reference frame Fr stored in the feature amount frame memory 202 in units of clusters. Based on the above, the pixel position of the pixel of the reference frame Fr having the same feature quantity as the feature quantity of the target pixel is detected. Then, the reference pixel position detection unit 203 determines the position of the pixel of the reference frame Fr whose destination is the target pixel from the pixel position of the pixel of the reference frame Fr having the same feature quantity as the detected feature quantity of the target pixel. Select. Then, the reference pixel position detection unit 203 refers to a position corresponding to the position of the target pixel from the pixel position information of the target pixel supplied from the feature amount extraction unit 103 and the pixel position of the selected pixel of the reference frame Fr. A motion vector starting from a pixel on the frame Fr and ending at a selected pixel of the reference frame Fr having the same feature quantity as that of the target pixel is obtained, and the obtained motion vector is output.
[0146]
FIG. 14 is a block diagram illustrating an example of the configuration of the address generation unit 201.
[0147]
The memory state storage unit 221 stores data indicating the storage state of the pixel position information of the feature amount frame memory 202 at the time of generating the address. For example, the memory state storage unit 221 stores data indicating the storage state of the pixel position information for each feature amount address of the feature amount frame memory 202. More specifically, the memory state storage unit 221 includes, for each feature amount address in the feature amount frame memory 202, the number of pixel position information indicating the position of the pixel of the feature amount corresponding to the feature amount address. The number of clusters storing the pixel position information indicating the position of the pixel of the feature amount corresponding to the feature amount address, and the next pixel position information corresponding to the feature amount address are stored in the cluster to be stored. The pixel position information corresponding to the feature quantity address, the feature quantity address corresponding to the feature quantity address where the cluster to store the next pixel position information is arranged, and the next pixel position information corresponding to the feature quantity address. The cluster address where the cluster to be stored is located and the pixel location information of the pixel of the feature quantity corresponding to the feature quantity address Large numbers (the maximum number of clusters R, subtracting the number of number of clusters for storing pixel position information of the feature amount of pixels corresponding to other feature amount Address) stores a.
[0148]
For example, the memory state storage unit 221 stores, in the M register, the number of pixel position information indicating the position of the pixel of the feature amount corresponding to the feature amount address 0 in the M register corresponding to the feature amount address 0. The number of clusters storing the pixel position information indicating the position of the pixel of the corresponding feature quantity is stored in the I register, and stored in the cluster to store the next pixel position information corresponding to the feature quantity address 0. The number of pixel position information being stored is stored in the Q register. The memory state storage unit 221 stores, in the storage destination feature value register, the feature value address corresponding to the feature value address 0 and the cluster where the next pixel position information corresponding to the feature value address 0 is stored is arranged. The cluster address where the cluster to store the next pixel position information corresponding to the feature quantity address 0 is stored is stored in the cluster current position register, and the pixel of the feature quantity corresponding to the feature quantity address 0 is stored. The maximum number of clusters for storing pixel position information is stored in the IMAX register.
[0149]
The memory state storage unit 221 corresponds to each of the feature amount address 1 to the feature amount address N-1, and is a pixel that indicates the position of the pixel of the feature amount corresponding to each of the feature amount address 1 to the feature amount address N-1. The number of position information is stored in the M register, and the number of clusters storing pixel position information indicating the position of the pixel of the feature amount corresponding to each of the feature amount address 1 to the feature amount address N-1 is stored in the I register. The number of pixel position information stored in the cluster to store the next pixel position information corresponding to each of the feature amount address 1 to the feature amount address N-1 is stored in the Q register. The memory state storage unit 221 stores the next pixel position information corresponding to each of the feature amount address 1 to the feature amount address N-1 corresponding to each of the feature amount address 1 to the feature amount address N-1. Is stored in the storage destination feature value register, and a cluster to store the next pixel position information corresponding to each of the feature value address 1 to the feature value address N-1 is stored. The allocated cluster address is stored in the cluster current position register, and the maximum number of clusters storing the pixel position information of the feature amount pixels corresponding to each of the feature amount address 1 to the feature amount address N-1 is stored in the IMAX register. Store.
[0150]
Based on the data indicating the storage state of the pixel position information in the feature amount frame memory 202 stored in the memory state storage unit 221, the determination unit 222 stores the pixel position information for each feature amount corresponding to each feature amount address. The number of pixel position information for each feature quantity corresponding to each feature quantity address is output. For example, the determination unit 222 outputs, as the number of pixel position information, the number of pixel position information stored in the M register and indicating the position of the pixel having the feature amount corresponding to each feature amount address.
[0151]
Based on the data indicating the storage state of the pixel position information of the feature amount frame memory 202 stored in the memory state storage unit 221, the determination unit 222 stores the next feature amount address and the next feature amount stored in the cluster. The cluster number is obtained and the next feature address and the next cluster number are output. For example, the determination unit 222 outputs, as the next feature quantity address, the feature quantity address stored in the storage destination feature quantity register in which the cluster where the next pixel position information is to be stored is arranged, and the cluster current The cluster address stored in the position register and stored for storing the next pixel position information is output as the next cluster number.
[0152]
The address calculation unit 223 generates an address for designating a cluster for storing the pixel position information based on the data stored in the memory state storage unit 221 and indicating the storage state of the pixel position information in the feature amount frame memory 202. Then, the generated address is output.
[0153]
FIG. 15 is a flowchart for explaining motion vector detection processing by the image processing apparatus having the configuration shown in FIG.
[0154]
In step S201, the feature amount extraction unit 101, the address generation unit 201, and the feature amount frame memory 202 store the pixel position information of the reference frame Fr by executing the process of storing the pixel position information of the reference frame Fr. . Details of the processing for storing the pixel position information will be described later with reference to the flowchart of FIG.
[0155]
In step S202, the feature amount extraction unit 103 and the reference pixel position detection unit 203 execute processing for detecting the position of the pixel corresponding to the target pixel, and have the same feature amount as the feature amount of the target pixel. The pixel position of this pixel is detected. Details of the process of detecting the position of the pixel corresponding to the target pixel will be described later with reference to the flowchart of FIG.
[0156]
The processing in step S203 and step S204 is the same as the processing in step S103 and step S104 in FIG.
[0157]
FIG. 16 is a flowchart for describing pixel position information storage processing corresponding to step S201.
[0158]
The processes in steps S221 and S222 are the same as the processes in steps S121 and S122 in FIG.
[0159]
In step S223, the address generation unit 201 initializes the data stored in the memory state storage unit 221. For example, the address generation unit 201 sets 0 in the M register, I register, and Q register of the memory state storage unit 221, sets the corresponding feature amount address in the storage destination feature amount register, and sets RMAX in the IMAX register. And set 0 in the cluster current position register.
[0160]
In step S225, the address generation unit 201 executes an address generation process for generating a cluster storing pixel position information and an address indicating a position on the cluster. Details of the address generation processing will be described later with reference to the flowcharts of FIGS. 17 and 18.
[0161]
In step S <b> 226, the address generation unit 201 writes the number of pixel position information corresponding to the feature amount in the feature amount frame memory 202.
[0162]
In step S227, the feature amount frame memory 202 writes pixel position information in a predetermined cluster based on the address generated by the process of step S225 and supplied from the address generation unit 201. When the next feature amount address and the next cluster number are supplied from the address generation unit 201, the feature amount frame memory 202 displays the next feature amount address and the next cluster number supplied from the address generation unit 201. It is stored in a predetermined cluster (a cluster in which pixel position information was previously stored).
[0163]
The processing in step S228 and step S229 is the same as the processing in step S128 and step S129 in FIG.
[0164]
Next, address generation processing corresponding to the processing in step S225 will be described with reference to the flowcharts of FIGS.
[0165]
In step S251, the determination unit 222 receives from the memory state storage unit 221 an M register, an I register, a Q register, a storage destination feature value register, an IMAX register, and a cluster corresponding to the feature value calculated in the process of step S224. Reads the value of the current position register. That is, the determination unit 222 obtains the values of the M register, I register, Q register, storage destination feature value register, IMAX register, and cluster current position register of the feature value address corresponding to the feature value from the memory state storage unit 221. read out.
[0166]
In step S252, the determination unit 222 determines whether the value of the Q register is equal to the maximum number of pixel position information that can be stored in the cluster, and the value of the Q register is the maximum number of pixel position information that can be stored in the cluster. If it is determined that the current storage destination cluster is still empty, the process proceeds to step S253, where the Q register indicating the storage position of the image position information of the cluster that is the storage destination of the current image position information is stored. Increment the value. The determination unit 222 stores the incremented value in the Q register of the feature amount address corresponding to the feature amount of the memory state storage unit 221.
[0167]
In step S254, the determination unit 222 increments the value of the M register indicating the number of image position information corresponding to the feature amount. The determination unit 222 stores the incremented value in the M register of the feature amount address corresponding to the feature amount of the memory state storage unit 221.
[0168]
In step S255, the determination unit 222 determines whether or not the value of the storage destination feature value register is equal to the feature value, and if it is determined that the value of the storage destination feature value register is equal to the feature value, the feature value Since the pixel position information is stored in the cluster specified by the feature amount address corresponding to, the process proceeds to step S256, and the address calculation unit 223 determines the feature amount, the value of the I register, and the Q that has been incremented in the process of step S253 The address for storing the pixel position information is calculated from the value of the register, and the process ends. For example, when the feature quantity is K, the I register is 3, and the value of the incremented Q register is 4, an address (K, 3) is calculated as the cluster address for storing the pixel position information. Further, an address for designating an area for storing the fourth pixel position information from the head of the cluster of the address (K, 3) is calculated.
[0169]
If it is determined in step S255 that the value of the storage destination feature value register is not equal to the feature value, the pixel position information is stored in the cluster specified by the feature value address other than the feature value address corresponding to the feature value. Therefore, the process proceeds to step S257, and the address calculation unit 223 stores the pixel position information from the value of the storage destination feature value register, the value of the cluster current position register, and the value of the Q register incremented in the process of step S253. And the process ends. For example, when the value of the storage destination feature value register is S, the value of the cluster current position register is 2, and the value of the incremented Q register is 3, the address of the cluster that stores the pixel position information is the address (S, 2) is calculated, and further, an address for designating an area for storing the third pixel position information from the head of the cluster of the address (S, 2) is calculated.
[0170]
If it is determined in step S252 that the value of the Q register is equal to the maximum number of pixel position information that can be stored in the cluster, the current storage destination cluster is empty, and the process proceeds to step S258. It is determined whether or not the value of the I register is greater than or equal to the value of the IMAX register.
[0171]
If it is determined in step S258 that the value of the I register is not greater than or equal to the value of the IMAX register, a further cluster can be arranged in the area specified by the feature amount address corresponding to the feature amount, and the process proceeds to step S259. The determination unit 222 increments the value of the I register indicating the number of clusters storing the pixel position information. The determination unit 222 stores the incremented value in the I register of the feature amount address corresponding to the feature amount of the memory state storage unit 221.
[0172]
In step S260, the address generation unit 201 causes the feature amount frame memory 202 to generate a cluster next to the current cluster. That is, the address generation unit 201 causes the feature amount frame memory 202 to generate a cluster at a position where the feature amount address corresponding to the feature amount and the incremented I register value are used as the cluster address. For example, when the feature amount address corresponding to the feature amount is K and the value of the incremented I register is R, the address generation unit 201 stores the position of the address (K, R) in the feature amount frame memory 202. Create a cluster.
[0173]
In step S261, the determination unit 222 initializes the value of the Q register. The determination unit 222 initializes the value of the Q register of the feature amount address corresponding to the feature amount in the memory state storage unit 221. For example, when the feature amount address corresponding to the feature amount is K, the determination unit 222 sets the value of the Q register corresponding to the feature amount address K to 1.
[0174]
In step S262, the determination unit 222 increments the value of the M register. The determination unit 222 sets the incremented M register value in the M register of the feature amount address corresponding to the feature amount.
[0175]
In step S263, the address calculation unit 223 generates an address specified by the first feature amount of the cluster generated in the process of step S260. For example, for example, when the feature amount address corresponding to the feature amount is K, the incremented I register value is R, and the initialized Q register value is 1, a cluster that stores pixel position information The address (K, R) is calculated as the address of, and an address for designating an area for storing the top pixel position information of the cluster of the address (K, R) is calculated.
[0176]
In step S264, the address calculation unit 223 outputs the feature amount address corresponding to the feature amount as the next feature amount address.
[0177]
In step S265, the address calculation unit 223 outputs the value of the I register incremented in the process of step S259 as the next cluster number, and the process ends.
[0178]
If it is determined in step S258 that the value of the I register is greater than or equal to the value of the IMAX register, no further cluster can be placed in the area specified by the feature amount address corresponding to the feature amount. In order to arrange a cluster in the area specified by the quantity address, the process proceeds to step S266, and the determination unit 222 searches for a feature quantity address having the smallest number of clusters. For example, the determination unit 222 obtains a feature amount address having the largest difference between the value of the IMAX register corresponding to each feature amount address of the memory state storage unit 221 and the value of the I register.
[0179]
In step S267, the determination unit 222 stores the feature quantity address with the smallest number of clusters searched for in the process of step S266 in the storage destination feature quantity register indicated by the feature quantity address corresponding to the feature quantity. For example, when the feature amount address corresponding to the feature amount is K and the feature amount address with the smallest number of clusters is S, the determination unit 222 stores S in the storage destination feature amount register of the feature amount address K. .
[0180]
In step S268, the address generation unit 201 causes the feature amount frame memory 202 to generate a cluster behind the region specified by the feature amount address with the smallest number of clusters (the side with the larger cluster address value). That is, the address generation unit 201, when no cluster has been arranged in the feature frame memory 202 at a position where the cluster address is the feature address with the smallest number of clusters and the maximum value of the cluster address, A cluster is generated at a position where the smallest feature quantity address and the maximum cluster address are cluster addresses. For example, when the feature quantity address with the smallest number of clusters is S and the maximum value of the cluster address is R, if no cluster is yet arranged at the position of the address (S, R), the address generation unit 201 Then, the cluster at the position of the address (S, R) is generated in the feature amount frame memory 202.
[0181]
When the cluster is already arranged in the feature amount frame memory 202 at the position where the feature amount address with the minimum number of clusters and the maximum value of the cluster address is the cluster address, the address generation unit 201 Create a cluster on the side of the smaller cluster address. For example, when the feature quantity address with the smallest number of clusters is S and the maximum value of the cluster address is R, when the cluster is already arranged at the address (S, R), the address generation unit 201 Then, the cluster at the position of the address (S, R-1) is generated in the feature amount frame memory 202.
[0182]
As described above, the address generation unit 201 causes the feature amount frame memory 202 to generate a cluster behind the cluster address in the area where the number of clusters is the minimum, that is, the area where the vacant area is the maximum.
[0183]
In step S269, the determination unit 222 stores the cluster address of the cluster generated in the process of step S268 in the cluster current position register of the feature amount address corresponding to the feature amount in the memory state storage unit 221.
[0184]
In step S270, the determination unit 222 decrements the value of the IMAX register of the feature amount address with the smallest number of clusters searched for in the process of step S266 in the memory state storage unit 221. That is, since the cluster is generated in the process of step S268 in the area of the feature amount address with the smallest number of clusters, the pixel position information of the pixel with the feature amount corresponding to the feature amount address with the smallest number of clusters is stored. 1 is subtracted from the value of the IMAX register storing the maximum number of clusters to be executed.
[0185]
In step S271, the determination unit 222 initializes the value of the Q register. The determination unit 222 initializes the value of the Q register of the feature amount address corresponding to the feature amount in the memory state storage unit 221. For example, when the feature amount address corresponding to the feature amount is K, the determination unit 222 sets the value of the Q register corresponding to the feature amount address K to 1.
[0186]
In step S272, the determination unit 222 increments the value of the I register indicating the number of clusters storing pixel position information indicating the pixel position of the feature amount. The determination unit 222 stores the incremented value in the I register of the feature amount address corresponding to the feature amount of the memory state storage unit 221.
[0187]
In step S273, the determination unit 222 increments the value of the M register. The determination unit 222 sets the incremented value of the M register in the M register of the feature amount address corresponding to the feature amount.
[0188]
In step S274, the address calculation unit 223 generates an address specified by the first feature amount of the cluster generated in the process of step S268. For example, for example, when the value of the storage destination feature value register is S, the value of the cluster current position register is R, and the value of the initialized Q register is 1, the address of the cluster that stores the pixel position information Then, an address (S, R) is calculated, and further, an address for designating an area for storing the top pixel position information of the cluster of the address (S, R) is calculated.
[0189]
In step S275, the address calculation unit 223 outputs the value of the storage destination feature value register as the next feature value address.
[0190]
In step S265, the address calculation unit 223 outputs the value of the cluster current position register as the next cluster number, and the process ends.
[0191]
Next, a process for detecting a pixel position corresponding to the target pixel, corresponding to the process in step S202, will be described with reference to the flowchart in FIG.
[0192]
The processing in step S301 and step S302 is the same as the processing in step S141 and step S142 in FIG.
[0193]
In step S303, the reference pixel position detection unit 203 performs a process of reading pixel position information corresponding to the feature amount. Details of the process of reading pixel position information corresponding to the feature amount will be described with reference to the flowchart of FIG.
[0194]
The processing from step S304 to step S306 is the same as the processing from step S144 to step S146 in FIG.
[0195]
In step S <b> 307, the reference pixel position detection unit 203 performs a process of reading pixel position information corresponding to a nearby feature amount.
[0196]
The processing from step S308 to step S313 is the same as the processing from step S148 to step S153 in FIG.
[0197]
FIG. 20 is a flowchart for explaining the process of reading pixel position information corresponding to the feature amount, corresponding to the process of step 303.
[0198]
In step S <b> 331, the reference pixel position detection unit 203 reads the number of pixel position information corresponding to the feature amount from the feature amount frame memory 202. For example, when the feature amount address corresponding to the feature amount is K, the reference pixel position detection unit 203 counts the number L of pixel position information that is the feature amount address K in the feature amount frame memory 202. K Is read.
[0199]
In step S <b> 332 that is executed first, the reference pixel position detection unit 203 reads from the feature amount frame memory 202 a cluster that is designated by a feature amount address corresponding to the feature amount and has a cluster address of 1. For example, when the feature quantity address corresponding to the feature quantity is K, the reference pixel position detection unit 203 reads the cluster at the address (K, 1) from the feature quantity frame memory 202.
[0200]
In step S333, the reference pixel position detection unit 203 reads pixel position information stored in the cluster read in the process of step S332. One or more pixel position information is stored in the cluster.
[0201]
In step S334, the reference pixel position detection unit 203 calculates the sum of the read pixel position information. For example, in the first process of step S334, the number of pixel position information read in the process of step S332 is set to the sum of the read pixel position information, and the second process executed by repeating the process. In the subsequent process of step S334, the number of pixel position information read out in the process of step S332 is added to the sum of the already calculated pixel position information.
[0202]
In step S335, the reference pixel position detection unit 203 calculates the pixel position information corresponding to the feature amount read by the process of step S331, as the sum of the read pixel position information calculated by the process of step S334. If it is determined whether or not the sum of the read pixel position information is less than the number of pixel positions corresponding to the feature amount, pixel position information that has not been read yet is determined. Therefore, the process proceeds to step S336, the next feature amount address and the next cluster number are read from the cluster read in the process of step S332, and the procedure proceeds to step S332.
[0203]
In the second and subsequent steps S332, the reference pixel position detection unit 203 reads the cluster specified by the next feature amount address and the next cluster number read in the processing of step S336, and performs the subsequent processing. repeat. For example, when the next feature amount address is S and the next cluster number is R, the reference pixel position detection unit 203 reads the cluster at the address (S, R).
[0204]
If it is determined in step S335 that the sum of the read pixel position information is not less than the number of pixel positions corresponding to the feature amount, all the pixel position information corresponding to the feature amount has been read. Ends.
[0205]
Note that the processing in step S307 is the same as the processing described with reference to the flowchart of FIG.
[0206]
As described above, the image processing apparatus having the configuration shown in FIG. 11 can detect a motion vector with a smaller storage area. That is, in the image processing apparatus having the configuration shown in FIG. 11, when the pixel position information corresponding to the feature amount for the reference frame Fr is stored in the feature amount frame memory 202, the pixel position information that can be generated in the feature amount frame memory 202 is Free space that is not stored can be reduced.
[0207]
In this manner, the feature quantity of the first pixel of the second frame, which is a temporally previous frame with respect to the first frame, is extracted, and the first address corresponding to the feature quantity of the first pixel is extracted. Controls the storage of pixel position information indicating the position of the first pixel in the specified region, extracts the feature quantity of the second pixel of the first frame, and stores the stored first pixel Based on the pixel position information indicating the position, the position of the first pixel whose destination is the second pixel is selected from the positions of the first pixel having the same feature quantity as that of the second pixel. In such a case, a motion vector can be detected.
[0208]
In addition, the feature amount of the first pixel of the second frame, which is a temporally previous frame with respect to the first frame, is extracted and designated by the first address corresponding to the feature amount of the first pixel. Control the storage of pixel position information indicating the position of the first pixel in the region, extract the feature quantity of the second pixel of the first frame, and store the stored position of the first pixel Based on the pixel position information shown, the position of the first pixel whose destination is the second pixel is selected from the positions of the first pixel having the same feature quantity as the feature quantity of the second pixel, When there is no more space in the area specified by the first address corresponding to the feature quantity of the first pixel, the pixel position information indicating the position of the first pixel in the area specified by the second address An area for controlling the storage and specifying pixel position information indicating the position of the first pixel by the second address If you to control the storage of information indicating that the storage is a smaller amount of calculation, more quickly, it can be detected more accurate motion vector.
[0209]
Next, still another configuration of the image processing apparatus according to the present invention will be described. FIG. 21 is a block diagram showing the configuration of still another embodiment of the image processing apparatus according to the present invention. The same parts as those shown in FIG. 6 are denoted by the same reference numerals, and the description thereof is omitted.
[0210]
The feature amount storage unit 401 acquires the pixel position information indicating the position of the reference pixel and the feature amount corresponding to the reference pixel supplied from the feature amount extraction unit 101, and calculates the number of pixel position information corresponding to the feature amount. The pixel position information is stored by indicating the next pixel position with a pointer.
[0211]
FIG. 22 is a block diagram illustrating an example of the configuration of the feature amount storage unit 401.
[0212]
The storage control unit 421 controls the writing and reading of data to and from the index memory 422 and the frame memory 423, thereby storing the number of pixel position information corresponding to the feature amount in the feature amount storage unit 401, and the pixel position Controls the storage of the pointer indicating.
[0213]
The index memory 422 includes, for each feature amount address corresponding to the feature amount, the number of feature amounts corresponding to the feature amount, that is, the number of pixel position information, the top pixel position of the pixel position information sequentially indicated by the pointer, and Of the pixel position information sequentially indicated by the pointer, the last pixel position is stored.
[0214]
The order of the pixel positions indicated by the pointers in this case corresponds to the order in which the feature amount extraction unit 101 selects the reference pixels, and is, for example, the raster scan order. However, this order does not limit the present invention, and can be an arbitrary order such as a zigzag scan direction.
[0215]
The frame memory 423 stores a pointer indicating the connection between the pixel positions of the pixels corresponding to the feature amount, with the region D as a unit. One direction for specifying the position of the area D of the frame memory 423 corresponds to one of the spatial directions of the image, for example, the spatial direction x (the horizontal direction of the image), and specifies the position of the area D of the frame memory 423. The other direction to do corresponds to the other of the spatial direction of the image, for example, the spatial direction y (vertical direction of the image). In the frame memory 423, the position of the region D is specified by a two-dimensional address on the frame memory 423, and simultaneously indicates the pixel position of the pixel on the screen. In other words, one area D of the frame memory 423 corresponds to one pixel of the reference frame Fr. Accordingly, the same number of regions D as the number of pixels on the screen (one frame) are arranged in the frame memory 423 corresponding to the pixels on the screen (frame).
[0216]
Each area D of the frame memory 423 is a pointer, and stores information indicating the position of the area D corresponding to the next pixel having the same feature quantity as that of the pixel corresponding to itself. Since the position of the pixel corresponds to the position of the area D, it can be said that the area D of the frame memory 423 stores information indicating the position of the next pixel of the same feature amount.
[0217]
For example, the index memory 422 stores the region D in the figure as the pixel position of the first pixel of the feature amount corresponding to the feature amount address K. 1 Is stored, the pixel position of the first pixel of the feature amount corresponding to the feature amount address K is the region D. 1 It can be seen that the pixel position corresponds to the position of.
[0218]
Area D of frame memory 423 1 Includes a region D which is the position of the next pixel of the feature amount corresponding to the feature amount address K. 2 The information (address) indicating the position of is stored. Since the position of the area D corresponds to the pixel position of the pixel, the area D of the frame memory 423 1 To the next region D 2 Is read out, the pixel position of the second pixel of the feature amount corresponding to the feature amount address K is changed to the region D. 2 It can be seen that the pixel position corresponds to the position of.
[0219]
Similarly, the area D of the frame memory 423 2 Includes a region D which is the position of the next pixel of the feature amount corresponding to the feature amount address K. Three The information (address) indicating the position of is stored. Since the position of the area D corresponds to the pixel position of the pixel, the area D of the frame memory 423 2 To the next region D Three Is read out, the pixel position of the third pixel of the feature amount corresponding to the feature amount address K is changed to the region D. Three It can be seen that the pixel position corresponds to the position of.
[0220]
Thus, the feature quantity corresponding to the feature quantity address K is sequentially traced from the head pixel position stored in the index memory 422 having the feature quantity address K to the pointer stored in the frame memory 423. The pixel position of this pixel can be obtained.
[0221]
As described above, in the frame memory 423, storage areas are arranged corresponding to the positions of the pixels of the image, and information (pointers) indicating the next pixel position of a predetermined feature amount is stored in each storage area. The That is, the position of the pixel of the reference frame Fr that is the next pixel of the same feature amount is sequentially stored in the area D of the frame memory 423 at the position indicating the position of the pixel of the reference frame Fr.
[0222]
Then, the position of the first pixel among the positions of the pixels having the same feature amount in the reference frame Fr is stored in the head pixel position of the index memory 422.
[0223]
Therefore, the feature amount storage unit 401 stores the frame memory corresponding to the number of feature amounts from the first pixel position to the last pixel position corresponding to each feature amount address stored in the index memory 422. By following the pointers stored in 423 in order, the pixel position of the pixel having the feature amount corresponding to each feature amount address can be obtained.
[0224]
Returning to FIG. 21, the reference pixel position detection unit 402 determines the feature amount of the target pixel based on the feature amount of the target pixel supplied from the feature amount extraction unit 103 and the information stored in the feature amount storage unit 401. A pixel position of a pixel of the reference frame Fr having the same feature amount is detected. Then, the reference pixel position detection unit 402 determines the position of the pixel of the reference frame Fr whose destination is the target pixel from the pixel position of the pixel of the reference frame Fr having the same feature quantity as the detected feature quantity of the target pixel. Select. Then, the reference pixel position detection unit 402 refers to a position corresponding to the position of the target pixel from the pixel position information of the target pixel supplied from the feature amount extraction unit 103 and the pixel position of the selected pixel of the reference frame Fr. A motion vector starting from a pixel on the frame Fr and ending at a selected pixel of the reference frame Fr having the same feature quantity as that of the target pixel is obtained, and the obtained motion vector is output.
[0225]
FIG. 23 is a diagram illustrating an example of data stored in the index memory 422 for each feature amount address corresponding to the feature amount. The number of feature amounts is the number of feature amounts, that is, the number of pixel position information of the pixels of the feature amount corresponding to the feature amount address (the number of pixels of the feature amount corresponding to the feature amount address, and the number of regions D) is there).
[0226]
The head pixel position is the pixel position of the head pixel of the feature amount corresponding to the feature amount address. That is, the head pixel position indicates the address of the area D of the frame memory 423 corresponding to the head pixel of the feature amount corresponding to the feature amount address.
[0227]
The end pixel position is the pixel position of the last pixel of the feature amount corresponding to the feature amount address. That is, the end pixel position indicates the address of the region D of the frame memory 423 corresponding to the last pixel of the feature amount corresponding to the feature amount address.
[0228]
When the area D is sequentially traced from the next position stored in the area D of the frame memory 423 at the position (address) indicated by the first pixel position, the area D at the position indicated by the final pixel position is reached. . For example, null is stored in the region D at the position indicated by the final pixel position.
[0229]
The motion vector detection process shown in FIG. 21 is the same as the process shown in the flowchart of FIG.
[0230]
A process of storing pixel position information corresponding to the process of step S101 when the image processing apparatus has the configuration shown in FIG. 21 will be described with reference to the flowchart of FIG.
[0231]
In step S401, the storage control unit 421 initializes data stored in the index memory 422 and the frame memory 423. For example, the storage control unit 421 sets the number of feature amounts to 0, and sets null for the top pixel position and the end pixel position. Further, for example, the storage control unit 421 sets null for all the regions D of the frame memory 423.
[0232]
In step S402, the feature amount extraction unit 101 initializes a counter variable n. The counter variable n is a variable for counting the number of pixels to be processed. For example, the feature amount frame memory 102 sets 1 to the counter variable n.
[0233]
In step S403, the feature amount extraction unit 101 sequentially selects pixels that have not yet been set as reference pixels from the pixels of the reference frame Fr and sets them as reference pixels. The feature amount extraction unit 101 extracts the feature amount of the reference pixel by calculating the feature amount of the block corresponding to the reference pixel, and uses the extracted feature amount together with pixel position information indicating the position of the reference pixel as a feature amount rule. Supplied to the unit 401. For example, the feature amount extraction unit 101 calculates a feature amount that is a value obtained by arranging pixel values of pixels included in a 3 × 3 block centered on the reference pixel in a predetermined order.
[0234]
In step S <b> 404, the storage control unit 421 reads out the feature quantity number corresponding to the feature quantity from the index memory 422. For example, the storage control unit 421 reads the feature quantity number of the feature quantity address corresponding to the feature quantity from the index memory 422.
[0235]
In step S405, the storage control unit 421 determines whether or not it is the first pixel corresponding to the feature amount, that is, whether or not the number of feature amounts corresponding to the feature amount read out in step S404 is zero. If it is determined that the pixel is the first pixel, the pixel position of the first pixel needs to be stored in the index 422. Therefore, the process proceeds to step S406, and the feature amount address corresponding to the feature amount of the index 422 is stored. The pixel position information acquired in the process of step S403 is written in the start pixel position and the end pixel position, and the process proceeds to step S407.
[0236]
If it is determined in step S405 that the pixel is not the first pixel, it is not necessary to store the pixel position of the pixel in the first pixel position of the index 422. Therefore, the process of step S406 is skipped, and the procedure proceeds to step S407.
[0237]
In step S407, the storage control unit 421 increments the number of feature values read in the process of step S404. That is, the storage control unit 421 adds 1 to the feature quantity number.
[0238]
In step S <b> 408, the storage control unit 421 writes the feature quantity number incremented in the process of step S <b> 407 to the feature quantity number of the feature quantity address corresponding to the feature quantity in the index memory 422.
[0239]
In step S409, the storage control unit 421 reads the end pixel position of the feature amount address corresponding to the feature amount, and writes the pixel position information in the area D indicated by the end pixel position in the frame memory 423. In this case, when the end pixel position is the same as the top pixel position (when it is the top pixel), the storage control unit 421 does not write the pixel position information because there is no region D to be written.
[0240]
In step S410, the storage control unit 421 writes pixel position information at the end pixel position of the feature amount address corresponding to the feature amount in the index memory 422.
[0241]
Through the processing in step S409 and step S410, the current pixel position information is stored in the region D corresponding to the last pixel position and the previous pixel of the same feature amount.
[0242]
In step S411, the feature amount extraction unit 101 increments the counter variable n. That is, the feature quantity extraction unit 101 adds 1 to the value of the counter variable n.
[0243]
In step S412, the feature amount extraction unit 101 determines whether the value of the counter variable n is equal to the number of pixels in the frame, and determines that the value of the counter variable n is not equal to the number of pixels in the frame. If there is still a pixel that is not a reference pixel, that is, there is a pixel from which the feature amount has not been extracted, the process returns to step S403, the above-described processing is repeated, and the next feature amount is extracted to obtain the feature amount. Store in the storage unit 401.
[0244]
If it is determined in step S412 that the value of the counter variable n is equal to the number of pixels in the frame, all the pixels in the frame are used as reference pixels, and the feature values of all the pixels in the frame are extracted. Since the data is stored in the storage unit 401, the processing ends.
[0245]
When the image processing apparatus has the configuration shown in FIG. 21, the processing corresponding to the processing in step S102 is the same as the processing with reference to the flowchart in FIG.
[0246]
The pixel position information reading process corresponding to the feature amount corresponding to the process of step S303 when the image processing apparatus has the configuration shown in FIG. 21 will be described with reference to the flowchart of FIG.
[0247]
In step S <b> 431, the storage control unit 421 of the feature amount storage unit 401 reads the value of the number of feature amounts, the top pixel position, and the end pixel position corresponding to the feature amount from the index memory 422. For example, when a feature amount is supplied from the reference pixel position detection unit 402 and pixel position information corresponding to the feature amount is requested, the storage control unit 421 stores a feature amount address corresponding to the feature amount from the index memory 422. The number of feature amounts, the top pixel position, and the end pixel position are read out.
[0248]
In step S432, the storage control unit 421 determines whether or not the number of feature amounts acquired in the process of step S431 is 1 or more. If it is determined that the number of feature amounts is 1 or more, the storage control unit 421 corresponds to the feature amount. Since the obtained pixel position information exists, the process proceeds to step S433, and the head pixel position acquired in the process of step S431 is set as the pixel position information and the pixel position information of the reference pixel. Pixel position information indicating the position of the first pixel is supplied to the reference pixel position detection unit 402.
[0249]
In step S434, the storage control unit 421 determines whether or not the number of feature amounts is 1. If it is determined that the number of feature amounts is 1, there is no pixel of the feature amount other than the top pixel. The process ends.
[0250]
If it is determined in step S434 that the number of feature amounts is not 1, there are two or more pixels of the feature amount, and thus the process proceeds to step S435, and the storage control unit 421 uses the pixel position information of the reference pixel in the frame memory 423. From the area D shown, information indicating the position of the next area D, that is, pixel position information indicating the pixel position of the next pixel of the same feature amount is read.
[0251]
In step S436, the storage control unit 421 sets the pixel position information read out in the process of step S435 to the next pixel position information and the pixel position information of the reference pixel. The next pixel position information is output to the reference pixel position detection unit 402.
[0252]
In step S437, the storage control unit 421 determines whether the pixel position indicated by the pixel position information of the reference pixel set in the process of step S436 is equal to the value of the end pixel position read in the process of step S431. If the pixel position indicated by the pixel position information of the reference pixel is determined not to be equal to the value of the end pixel position, the pixel position information that has not yet been read out in the pixel position information corresponding to the feature amount Therefore, the process returns to step S435, and the pixel position information reading process is repeated.
[0253]
In step S437, when it is determined that the pixel position indicated by the pixel position information of the reference pixel is equal to the value of the end pixel position, all of the pixel position information corresponding to the feature amount has been read, and thus the process ends. To do.
[0254]
If it is determined in step S432 that the number of feature amounts is not 1 or more, there is no pixel corresponding to the feature amount, and there is no pixel position information, so the processing ends.
[0255]
As described above, in the image processing apparatus having the configuration shown in FIG. 21, the pixel position information can be stored and the stored pixel position information is read out with almost no vacancy in the area for storing the pixel position information. be able to. In the image processing apparatus having the configuration shown in FIG. 21, pixel position information can be reliably stored in a smaller storage area.
[0256]
That is, the feature amount of the pixel of the second frame, which is a temporally previous frame with respect to the first frame, is extracted, and the same feature is applied to the first region at the position indicating the position of the pixel of the second frame. The next feature pixel is controlled so that the positions of the pixels in the second frame are sequentially stored, and the same feature value is stored in the second region specified by the address corresponding to the feature value of the pixel. The memory is controlled so as to store the memory of the position of the first pixel among the positions of the pixels, the feature amount of the pixel of the first frame is extracted, and the second specified by the address corresponding to the feature amount The first pixel position, the next pixel position of the same feature quantity stored in the first area, and the pixel position stored in the first area are stored in the first area. Based on the position of one region, the characteristics of the pixels of the first frame If the position of the second frame pixel, which is the first frame pixel, is selected from the pixel position of the second frame having the same feature amount as With quantities, more accurate motion vectors can be detected more quickly.
[0257]
FIG. 26 is a block diagram showing a configuration of still another embodiment of the image processing apparatus according to the present invention.
[0258]
The same parts as those shown in FIG. 11 are denoted by the same reference numerals, and the description thereof is omitted.
[0259]
The feature amount histogram generation unit 601 obtains the number of pixels for each feature amount based on the feature amount and pixel position information supplied from the feature amount extraction unit 101, and indicates the number of pixels for each feature amount. Distribution information is supplied to the address generation unit 602. The feature amount histogram generation unit 601 supplies the feature amount and pixel position information supplied from the feature amount extraction unit 101 to the address generation unit 602 as they are.
[0260]
The address generation unit 602 generates the next feature amount address and the next cluster number for specifying the next cluster of the cluster based on the feature amount distribution information supplied from the feature amount histogram generation unit 601, and the pixel position information At the same time, the generated next feature quantity address and next cluster number are supplied to the feature quantity frame memory 202.
[0261]
The address generation unit 602 also supplies the feature amount frame memory 202 with the number of pixel position information for each feature amount included in the feature amount distribution information supplied from the feature amount histogram generation unit 601.
[0262]
The pixel value frame memory 603 stores the input image in units of frames, and supplies the stored image frames to the feature amount extraction unit 103 at a timing delayed for a period corresponding to one frame. In the image processing apparatus having the configuration shown in FIG. 26, since the period required for the processing of the feature amount histogram generation unit 601 is a period corresponding to one frame, the pixel value frame memory 603 delays the period corresponding to one frame. Is supplied to the feature amount extraction unit 103. Therefore, the relationship between the frame corresponding to the pixel position information stored in the feature amount frame memory 202 and supplied to the reference pixel position detection unit 203 and the frame corresponding to the feature amount output from the feature amount extraction unit 103 is This is equivalent to the image processing apparatus having the configuration shown in FIG. That is, the feature amount frame memory 202 supplies pixel position information corresponding to the reference frame Fr (the previous frame) to the reference pixel position detection unit 203, and the feature amount extraction unit 103 determines that the current frame Fc (current frame) ) And the pixel position information corresponding to the reference pixel position detection unit 203. The current frame Fc in the image processing apparatus having the configuration shown in FIG. 26 is one previous frame with respect to the current frame of the input image.
[0263]
FIG. 27 is a flowchart for explaining motion vector detection processing by the image processing apparatus having the configuration shown in FIG.
[0264]
In step S601, the feature amount extraction unit 101 and the feature amount histogram generation unit 601 obtain a feature amount distribution. That is, the feature amount extraction unit 101 extracts a feature amount corresponding to each pixel of the frame of the input image, and includes pixel position information indicating the position of the target pixel together with the extracted feature amount. This is supplied to the histogram generation unit 601. The feature amount histogram generation unit 601 calculates the number of pixels for each feature amount based on the feature amount and pixel position information supplied from the feature amount extraction unit 101, and indicates the number of pixels for each feature amount. Distribution information is supplied to the address generation unit 602.
[0265]
In step S <b> 602, the address generation unit 602 executes address reassignment processing for setting the next feature amount address and the next cluster number in the cluster of the feature amount frame memory 202. That is, a cluster for storing the pixel position information is secured for each feature amount by the address rearrangement process. Details of the address rearrangement process will be described later with reference to the flowcharts of FIGS.
[0266]
In step S603, the feature amount frame memory 202 stores the pixel position information of the reference frame Fr by executing a process of storing the pixel position information. The pixel position information is stored in a cluster secured for each feature amount secured by the processing in step S602. Details of the processing for storing the pixel position information in step S603 will be described later with reference to the flowchart of FIG.
[0267]
The processes in steps S604 to S606 are the same as the processes in steps S202 to S204 in FIG.
[0268]
With reference to the flowcharts of FIG. 28 and FIG. 29, an example of address rearrangement processing corresponding to the processing in step S602 when one pixel position information is stored in each cluster will be described.
[0269]
Before executing the following processing, all clusters that can be arranged are generated in the feature amount frame memory 202 in advance, and the generated clusters are initialized.
[0270]
In step S621, the address generation unit 602 initializes the feature amount address variable n. The feature quantity address variable n is a variable for specifying the feature quantity address. For example, when the feature quantity address is any value from 0 to N-1, the feature quantity address variable n is 0 to N. Any value of -1 is set. For example, when the feature amount address is any value from 0 to N−1, 0 is set to the feature amount address variable n in the process of step S621.
[0271]
In step S622, the address generation unit 602 determines whether or not the number hn of pixel position information of the feature amount corresponding to the feature amount address indicated by the value of the feature amount address variable n exceeds the maximum storage number M. To do. The number hn of pixel position information of the feature amount corresponding to the feature amount address is the same as the number of pixels for each feature amount included in the feature amount distribution information. The maximum storage number M refers to the number of pixel position information that can be stored in one row of clusters arranged in the row direction (lateral direction) in FIG. In this case, since one pixel position information is stored in each cluster, the maximum storage number M is equal to the number of clusters in one row.
[0272]
If it is determined in step S622 that the number hn of pixel position information of the feature amount corresponding to the feature amount address does not exceed the maximum storage number M, all pixel positions corresponding to the feature amount are included in the cluster of one row. Since the information can be stored, the process proceeds to step S623, and the address generation unit 602 sets the number hn of pixel position information of the feature amount corresponding to the feature amount address n as the determined region number sn. The determined area number sn indicates the number of clusters in which pixel position information is determined to be stored among the clusters of the feature amount address n.
[0273]
In step S624, the address generation unit 602 reserves the next feature quantity address and the next cluster so as to secure a cluster of feature quantity addresses indicated by the feature quantity address variable n for the number hn of pixel position information of the feature quantity. A number is set, and the process proceeds to step S625. For example, when the number hn of pixel position information of the feature amount is L, the address generation unit 602 assigns the address (n, 2) to each of the clusters of the address (n, 1) to the address (n, L−1). To the next feature amount address and the next cluster number indicating each of the clusters of address (n, L). More specifically, the address generation unit 602 sets the next feature amount address and the next cluster number indicating the cluster of the address (n, 2) to the cluster of the address (n, 1), and sets the address (n , 2), in order to set the next feature quantity address and the next cluster number indicating the cluster of the address (n, 3), the L-1 clusters are sequentially pointed to the next cluster. Next feature address and next cluster number are set in.
[0274]
In step S622, when it is determined that the number hn of pixel position information of the feature amount corresponding to the feature amount address exceeds the maximum storage number M, all pixel positions corresponding to the feature amount are included in one row of clusters. Since information cannot be stored (that is, a cluster of other feature amount addresses is required), the processing in steps S623 and S624 is skipped, and the procedure proceeds to step S625.
[0275]
In step S625, the address generation unit 602 determines whether the value of the feature quantity address variable n is N−1 or more, and determines that the value of the feature quantity address variable n is not N−1 or more. In this case, since the processing from step S622 to step S624 has not been completed for all the feature quantity addresses, the process proceeds to step S626, the feature quantity address variable n is incremented, and the process returns to step S622. Repeat the process.
[0276]
If it is determined in step S625 that the value of the feature amount address variable n is N−1 or more, the processing in steps S622 to S624 has been completed for all feature amount addresses, and the process proceeds to step S627.
[0277]
In step S627, the address generation unit 602 initializes the feature amount address variable n. In step S628, the address generation unit 602 determines whether or not the number hn of pixel position information of the feature amount corresponding to the feature amount address indicated by the value of the feature amount address variable n exceeds the maximum storage number M. If it is determined that the number hn of pixel position information of feature amounts exceeds the maximum storage number M, pixel position information corresponding to the feature amounts must be stored in a cluster of two or more rows ( Since a cluster of another feature amount address is required), the process proceeds to step S629, and the maximum storage number M is set as the determined area number sn of the feature amount address variable n.
[0278]
In step S630, the address generation unit 602 secures all the clusters of the feature amount address indicated by the feature amount address variable n by the number hn of the pixel position information of the feature amount, and the next feature amount address and the next feature amount. Set the cluster number. For example, the address generation unit 602 indicates each of the clusters of address (n, 2) to address (n, M) to each of the clusters of address (n, 1) to address (n, M−1). Set the feature address and next cluster number.
[0279]
In step S631, the address generation unit 602 obtains a feature amount address m having the largest number of free clusters. For example, the address generation unit 602 stores the number of clusters not designated by the next feature value address and the next cluster number among M clusters specified by one feature value address, that is, pixel position information is stored. The feature amount address m having the maximum number of undecided clusters is obtained from the feature amount addresses 0 to N-1.
[0280]
In step S632, the address generation unit 602 determines whether the number of clusters necessary for further storing the pixel position information exceeds the number of free clusters of the feature amount address m. For example, the number of clusters necessary for further storing the pixel position information is indicated by hn-sn. The number of vacant clusters at the feature quantity address m is indicated by M-sm. Here, the determined area number sm indicates the number of clusters in which pixel position information is determined to be stored among clusters of the feature amount address m.
[0281]
If it is determined in step S632 that the number of clusters necessary for further storing the pixel position information does not exceed the number of free clusters at the feature amount address m, the remaining pixels in the free cluster at the feature amount address m Since all of the position information can be stored, the process advances to step S633, and the address generation unit 602 secures the number of clusters necessary for storing the pixel position information among the vacant clusters having the feature amount address m. Next feature address and next cluster number are set.
[0282]
In step S634, the address generation unit 602 updates the determined area number sn of the feature amount address n. In other words, the address generation unit 602 sets the number hn of pixel position information of the feature amount corresponding to the feature amount address n as the determined area number sn of the feature amount address n.
[0283]
In step S635, the address generation unit 602 updates the number of defined areas sm of the feature amount address m. That is, the address generation unit 602 adds the number of clusters determined to store the pixel position information in the process of step S633 to the determined area number sm of the feature amount address m.
[0284]
In step S636, the address generation unit 602 determines whether the value of the feature quantity address variable n is N−1 or more, and determines that the value of the feature quantity address variable n is not N−1 or more. In this case, since the processing from step S628 to step S635 or the processing from step S638 to step S640 has not been completed for all the feature amount addresses, the process proceeds to step S637, the feature amount address variable n is incremented, and the process proceeds to step S628. Returning, the process is repeated for the next feature value address.
[0285]
When it is determined in step S636 that the value of the feature value address variable n is N−1 or more, the processing from step S628 to step S635 or the processing from step S638 to step S640 is completed for all feature value addresses. Thus, the process ends.
[0286]
If it is determined in step S632 that the number of clusters necessary for further storing the pixel position information exceeds the number of free clusters at the feature amount address m, the remaining pixels in the free cluster at the feature amount address m Since all of the position information cannot be stored, the process proceeds to step S638, and the next feature amount address and the next cluster number are set so as to secure all the empty clusters of the feature amount address m.
[0287]
In step S639, the address generation unit 602 updates the number of defined areas sn of the feature amount address n. In other words, the address generation unit 602 adds the number of clusters determined to store pixel position information in the process of step S638 to the number of defined areas sn of the feature amount address n.
[0288]
In step S640, the address generation unit 602 updates the determined area number sm of the feature amount address m, returns to step S631, and repeats the process of securing a free cluster. In other words, the address generation unit 602 adds the number of clusters determined to store pixel position information in the process of step S638 to the number of determined areas sm of the feature amount address m. The maximum storage number M is set to the determined area number sm of the feature amount address m.
[0289]
As described above, an area necessary for storing the pixel position information is secured for each feature amount by the address rearrangement process. That is, the cluster in which the pixel position information for each feature amount is stored is determined by the next feature amount address and the next cluster number stored in the cluster.
[0290]
Next, a process for storing pixel position information corresponding to the process in step S603 will be described with reference to the flowchart in FIG.
[0291]
The processes in steps S661 to S666 are the same as the processes in steps S121 to S126 in FIG.
[0292]
In step S667, the feature amount frame memory 202 writes pixel position information to the cluster based on the next feature amount address and the next cluster number stored in each cluster. That is, when the feature amount frame memory 202 writes the first pixel position information of the feature amount corresponding to the feature amount address K, the feature amount frame memory 202 writes the pixel position information to the cluster at the address (K, 1). When the feature amount frame memory 202 writes the second and subsequent pixel position information of the feature amount corresponding to the feature amount address K, the next feature amount address stored in the cluster in which the previous pixel position information was written. The pixel position information is written in the cluster whose address is specified by the next cluster number.
[0293]
Since the processing of step S668 and step S669 is the same as the processing of step S128 and step S129 of FIG. 9, respectively, description thereof is omitted.
[0294]
In this manner, in the image processing apparatus having the configuration shown in FIG. 26, since the pixel position information is written in the vacant area, it is not necessary to provide an extra area in the feature amount frame memory 202, and the minimum necessary amount. The feature amount frame memory 202 can be configured with the storage area. Further, the pixel position information is surely stored.
[0295]
FIG. 31 is a block diagram showing a configuration of still another embodiment of the image processing apparatus according to the present invention. The same parts as those shown in FIG. 6 are denoted by the same reference numerals, and the description thereof is omitted.
[0296]
An image input to the image processing apparatus having the configuration shown in FIG. 31 is supplied to the frame memory 701, the line memory 703, the feature amount extraction unit 101, and the feature amount extraction unit 103.
[0297]
For example, when an image (image data) is input at time t1, the frame memory 701 stores and stores information for one frame. Further, when the next frame image is input at time t2, which is the next timing, the frame memory 701 stores and stores the newly input image for one frame at time t2, and at the time t1. Are output to the search area generation unit 702. That is, the frame memory 701 supplies a pixel value to the search area generation unit 702 by delaying a period corresponding to one frame and using one frame as a unit.
[0298]
In addition, the line memory 703 stores an input image of a predetermined line of one frame input at the timing of time t2, and outputs the image to the block generation unit 704 within the timing of time t2.
[0299]
That is, when the frame memory 701 stores and stores the image information for one frame (current) input at the timing of the above-described time t2, the frame memory 701 stores the image information of the time t1 (one timing past). The pixel value of the image for one frame is output to the search area generation unit 702. The line memory 703 outputs the pixel value of the image of the line of one frame (currently) input at the time t2 to the block generation unit 704. That is, the pixel value of the current frame is supplied to the block generation unit 704, and the pixel value of the pixel of the previous frame (past) of the current frame is supplied to the search area generation unit 702.
[0300]
The search area generation unit 702 generates a search area SR from the reference frame Fr supplied from the frame memory 701, and supplies the pixel value of the pixel in the search area SR to the matching unit 705.
[0301]
The block generation unit 704 generates the reference block Bb from the current frame Fc supplied from the line memory 703, and supplies the pixel value of the pixel of the reference block Bb to the matching unit 705.
[0302]
The search area SR of the reference frame Fr generated by the search area generation unit 702 includes, for example, pixels of NS (number of pixels) horizontally and MS (number of pixels) vertically. The reference block Bb of the current frame Fc generated by the block generation unit 704 is composed of NB (number of pixels) horizontally and MB (number of pixels) vertically. The search area SR is made up of a larger area (a larger number of pixels) than the reference block Bb.
[0303]
In this case, the number of vertical and horizontal pixels in the search area SR may be the same number L.
[0304]
The matching unit 705 refers to the search area SR based on the pixel value of the pixel in the search area SR supplied from the search area generation unit 702 and the pixel value of the pixel in the reference block Bb supplied from the block generation unit 704. The sum of absolute differences between the pixel value of each pixel constituting the block Brn and the pixel value of each pixel of the base block Bb is calculated, and the sum of absolute differences is calculated together with the vector from the reference block Brn to the base block Bb. The value is supplied to the minimum error selection unit 706.
[0305]
The minimum error selection unit 706 selects a vector corresponding to the minimum error value, and supplies the selected vector to the reference pixel position detection unit 707 as a motion vector.
[0306]
The reference pixel position detection unit 707 is based on the feature amount of the target pixel supplied from the feature amount extraction unit 103 and the pixel position information of the reference frame Fr stored in the feature amount frame memory 102. The pixel position of the pixel of the reference frame Fr having the same feature amount as is detected. The reference pixel position detection unit 707 is based on the motion vector supplied from the minimum error selection unit 706 from the pixel positions of the pixels of the reference frame Fr having the same feature amount as the detected feature amount of the target pixel. A pixel located in the search area corresponding to the motion vector supplied from the minimum error selection unit 706, and the position of the pixel in the reference frame Fr whose movement destination is the target pixel is selected. Then, the reference pixel position detection unit 707 starts from a pixel on the reference frame Fr at a position corresponding to the position of the target pixel from the pixel position information of the target pixel and the pixel position of the selected pixel of the reference frame Fr. A motion vector whose end point is a selected pixel of the reference frame Fr having the same feature amount as the feature amount of the target pixel is obtained, and the obtained motion vector is output.
[0307]
32 is generated by the search area SR generated by the search area generation unit 702, the reference block Bb generated by the block generation unit 704, the reference block Brn generated by the matching unit 705, and the reference pixel position detection unit 707. It is a figure explaining the relationship of a search area.
[0308]
In FIG. 32, the search area SR generated by the search area generation unit 702 is expressed as search area 1, and the search area generated by the reference pixel position detection unit 707 is expressed as search area 2.
[0309]
The search area SR generated by the search area generation unit 702 includes, for example, a wider area (a larger number of pixels) around the center pixel of the reference block Bb than the reference block Bb. The reference block Brn is composed of pixels included in the search area SR and has the same shape (pixel arrangement) as that of the base block Bb. That is, the number of pixels included in the reference block Brn is the same as the number of pixels included in the standard block Bb.
[0310]
The minimum error selection unit 706 selects a reference block Brn having the smallest difference absolute value sum among the sum of absolute difference values between the pixels of the base block Bb and the reference block Brn. The motion vector supplied to the reference pixel position detection unit 707 by the minimum error selection unit 706 is a vector having a pixel on the reference frame Fr corresponding to the target pixel as a start point and a predetermined pixel in the reference block Brn as an end point. For example, the minimum error selection unit 706 uses the pixel on the reference frame Fr corresponding to the target pixel, which is the central pixel of the base block Bb, as the start point, and the vector having the central pixel in the reference block Brn as the end point as the motion vector, This is supplied to the detection unit 707.
[0311]
The frame memory 701 to the minimum error selection unit 706 may detect a motion vector roughly by representative point block matching. Further, the frame memory 701 to the minimum error selection unit 706 may detect a motion vector more roughly, for example, by thinning out the vector in the search area SR. In this case, the processing in the frame memory 701 through the minimum error selection unit 706 becomes faster, and the motion vector can be obtained at higher speed as the entire image processing apparatus.
[0312]
For example, the reference pixel position detection unit 707 uses the reference block Brn selected by the minimum error selection unit 706 as the search area 2 and is a pixel located in the search area 2 and has the same feature quantity as the feature quantity of the target pixel. The pixel position of the pixel of the reference frame Fr is detected. That is, the search area 2 is an area specified by the motion vector supplied from the minimum error selection unit 706. The reference pixel position detection unit 707 starts from the pixel on the reference frame Fr at the position corresponding to the position of the target pixel from the pixel position information of the target pixel and the pixel position of the pixel in the search area 2, and the characteristics of the target pixel. A motion vector whose end point is a pixel in the search area 2 having the same feature amount as the amount is obtained, and the obtained motion vector is output.
[0313]
For example, the reference pixel position detection unit 707 selects one of the pixel A, the pixel B, and the pixel C that has the same feature quantity as the feature quantity of the target pixel, and is located in the search area 2. A motion vector is obtained from the position of the selected pixel and the position of the target pixel.
[0314]
FIG. 33 is a flowchart for explaining a motion vector detection process by the image processing apparatus having the configuration shown in FIG.
[0315]
In step S701, the feature quantity extraction unit 101 and the feature quantity frame memory 102 execute a process of storing pixel position information of the reference frame Fr. Since the process of step S701 is the same as the process of step S101, the description thereof is omitted.
[0316]
In step S <b> 702, the frame memory 701 to the minimum error selection unit 706 detects a motion vector by executing a block matching process. Details of the block matching process will be described later with reference to the flowchart of FIG.
[0317]
In step S <b> 703, the feature amount extraction unit 103 and the reference pixel position detection unit 707 execute processing for detecting the position of the pixel corresponding to the target pixel. Details of the process of detecting the position of the pixel corresponding to the target pixel in step S703 will be described later with reference to the flowchart of FIG.
[0318]
Since the processing of step S704 and step S705 is the same as the processing of step S103 and step S104 in FIG.
[0319]
FIG. 34 is a flowchart for describing block matching processing corresponding to step S702.
[0320]
In step S721, the search area generation unit 702 sets the search area SR according to the pixel position of the pixel of interest P (i, j) on the current frame Fc.
[0321]
In step S722, as described above, the minimum error selection unit 706 sets the variable min for setting the minimum value of the sum of absolute differences between the pixels of the base block Bb (i, j) and the reference block Brn (i, j). Initialization is performed by setting a value obtained by multiplying the number of gradations of the pixel by the number of pixels constituting the reference block Bb (i, j). That is, for example, when one pixel is 8-bit data, the number of gradations of one pixel is 2 8, and thus 256 gradations (256 colors) are obtained. Further, when the reference block Bb (i, j) is composed of L pixels × L pixels = 3 pixels × 3 pixels, the number of pixels is nine. As a result, the variable min is initialized to 2304 (= 256 (number of gradations) × 9 (number of pixels)).
[0322]
In step S723, the matching unit 705 initializes a counter variable n that counts the reference block Brn to 1.
[0323]
In step S724, the minimum error selection unit 706 initializes a variable sum used for substituting the sum of absolute differences between the pixels of the base block Bb and the reference block Brn to 0.
[0324]
In step S725, the matching unit 705 calculates the sum of absolute differences (= sum) between the pixels of the base block Bb (i, j) and the reference block Brn (i, j). That is, when each pixel of the reference block Bb (i, j) is indicated as P_Bb (i, j) and each pixel of the reference block Brn (i, j) is indicated as P_Brn (i, j), the matching unit 705 The calculation represented by the above-described equation (1) is executed to obtain the sum of absolute differences between the pixels of the base block Bb (i, j) and the reference block Brn (i, j).
[0325]
In step S726, the minimum error selection unit 706 determines whether or not the variable min is larger than the variable sum. For example, if it is determined that the variable min is larger than the variable sum, in step S727, the variable min is changed to the variable sum. And the value of the counter n at that time is registered as a motion vector number. That is, the fact that the variable sum indicating the sum of absolute differences obtained is smaller than the variable min indicating the minimum value means that the reference block Brn (i, i, Since j) can be regarded as more similar to the reference block Bb (i, j), a counter n at that time is registered as a motion vector number in order to make it a candidate for obtaining a motion vector. If it is determined in step S726 that the variable min is not greater than the variable sum, the process of step S727 is skipped.
[0326]
In step S728, the matching unit 705 determines whether or not the counter variable n is the total number m of reference blocks Brn in the search area SR, that is, whether or not the current reference block Brn is Brn = Brm. If it is determined that the total number is not m, the counter variable n is incremented by 1 in step S729, and the process returns to step S724.
[0327]
If it is determined in step S728 that the counter variable n is the total number m of the reference blocks Brn in the search area, that is, the current reference block Brn is Brn = Brm, in step S730, the minimum error selection unit 706 The motion vector is output based on the registered motion vector number. That is, by repeating steps S724 to S729, the counter variable n corresponding to the reference block Brn that minimizes the sum of absolute differences is registered as a motion vector number. Among the L × L pixels of the reference block Brn corresponding to the motion vector number, a reference pixel Pn (i, j) serving as the center is obtained and corresponds to the target pixel P (i, j) on the current frame Fc. A vector starting from the pixel P ′ (i, j) on the reference frame Fr and ending at the reference pixel Pn (i, j) is obtained as the motion vector (Vx, Vy) of the pixel of interest P (i, j). To the reference pixel position detection unit 707.
[0328]
Next, the process of detecting the position of the pixel corresponding to the target pixel corresponding to step S703 will be described with reference to the flowchart of FIG.
[0329]
The processing in steps S751 to S753 is the same as the processing in steps S141 to S143 in FIG.
[0330]
In step S754, the reference pixel position detection unit 707, based on the motion vector supplied from the minimum error selection unit 706, out of the pixel positions indicated by the pixel position information read out in step S753, the search area 2 The position of the pixel in is selected.
[0331]
In step S755, the reference pixel position detection unit 707 selects the position of the pixel closest to the target pixel among the positions of the pixels selected in the process of step S754.
[0332]
The processing from step S756 to step S758 is the same as the processing from step S145 to step S147 in FIG.
[0333]
In step S759, the reference pixel position detection unit 707, based on the motion vector supplied from the minimum error selection unit 706, corresponds to the neighboring feature amount indicated by the pixel position information read out in step S758. Among the pixel positions indicated by the position information, the position of the pixel in the search area 2 is selected.
[0334]
In step S760, the reference pixel position detection unit 707 selects the position of the pixel closest to the target pixel among the positions of the pixels selected in the process of step S759.
[0335]
The processing from step S761 to step S765 is the same as the processing from step S149 to step S153 in FIG.
[0336]
In the image processing apparatus having the configuration shown in FIG. 31, a candidate motion vector is obtained in advance by full search block matching or representative point block matching, and the feature amount is used as a reference for more accurate. Therefore, a more accurate motion vector can be obtained with a smaller amount of calculation.
[0337]
In the frame memory 701 to the minimum error selection unit 706, a technique for speeding up the processing such as thinning out the vectors in the search area SR may be adopted.
[0338]
In the feature amount extraction unit 101 to the feature amount extraction unit 103 and the reference pixel position detection unit 707, the search area 2 is determined based on the motion vector supplied from the minimum error selection unit 706, so that it is faster and more accurate. A simple motion vector can be obtained.
[0339]
Instead of block matching, a motion vector may be detected by a gradient method, and the search area 2 may be determined based on the detected motion vector.
[0340]
The series of processes described above can be executed by hardware, but can also be executed by software. When a series of processing is executed by software, a program constituting the software may execute various functions by installing a computer incorporated in dedicated hardware or various programs. For example, it is installed from a recording medium in a general-purpose personal computer or the like.
[0341]
FIG. 36 is a block diagram showing an example of the configuration of a personal computer that executes the above-described series of processing by a program. A CPU (Central Processing Unit) 821 executes various processes according to a program stored in a ROM (Read Only Memory) 822 or a storage unit 828. A RAM (Random Access Memory) 823 appropriately stores programs executed by the CPU 821, data, and the like. The CPU 821, ROM 822, and RAM 823 are connected to each other via a bus 824.
[0342]
An input / output interface 825 is also connected to the CPU 821 via the bus 824. The input / output interface 825 is connected to an input unit 826 including a keyboard, a mouse, and a microphone, and an output unit 827 including a display and a speaker. The CPU 821 executes various processes in response to commands input from the input unit 826. Then, the CPU 821 outputs an image, sound, or the like obtained as a result of the processing to the output unit 827.
[0343]
The storage unit 828 connected to the input / output interface 825 includes, for example, a hard disk and stores programs executed by the CPU 821 and various data. The communication unit 829 communicates with an external device via the Internet or other networks. In the case of this example, the communication unit 829 operates as an interface with the outside that acquires an input image or outputs an output image.
[0344]
Further, a program may be acquired via the communication unit 829 and stored in the storage unit 828.
[0345]
The drive 830 connected to the input / output interface 825 drives the magnetic disk 851, the optical disk 852, the magneto-optical disk 853, the semiconductor memory 854, and the like when they are loaded, and programs and data recorded there. Get etc. The acquired program and data are transferred to and stored in the storage unit 828 as necessary.
[0346]
As shown in FIG. 36, a recording medium storing a program for performing a series of processing is distributed to provide a program to a user separately from a computer. Disc), optical disc 852 (including CD-ROM (compact disc-read only memory), DVD (digital versatile disc)), magneto-optical disc 853 (including MD (mini-disc) (trademark)), or semiconductor In addition to a package medium composed of the memory 854 and the like, it is also composed of a ROM 822 in which a program is recorded and a hard disk included in the storage unit 828, which is provided to the user in a state of being preinstalled in a computer. .
[0347]
The program for executing the series of processes described above is installed in a computer via a wired or wireless communication medium such as a local area network, the Internet, or digital satellite broadcasting via an interface such as a router or a modem as necessary. You may be made to do.
[0348]
Further, in the present specification, the step of describing the program stored in the recording medium is not limited to the processing performed in chronological order according to the described order, but is not necessarily performed in chronological order. It also includes processes that are executed individually.
[0349]
【The invention's effect】
As above The present invention According to this, a motion vector can be detected.
[0350]
Also, The present invention Accordingly, a more accurate motion vector can be detected more quickly with a smaller amount of calculation.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a conventional image processing apparatus employing a block matching algorithm.
FIG. 2 is a diagram illustrating a search area SR and a reference block Bb.
FIG. 3 is a diagram illustrating a block matching algorithm.
FIG. 4 is a flowchart illustrating a conventional motion detection process.
FIG. 5 is a diagram for explaining a search area SR and a representative point block in representative point block matching;
FIG. 6 is a block diagram showing a configuration of an embodiment of an image processing apparatus according to the present invention.
FIG. 7 is a diagram for explaining the arrangement of pixel position information and the number of pixel position information stored in a feature amount frame memory;
FIG. 8 is a flowchart for explaining motion vector detection processing by the image processing apparatus having the configuration shown in FIG. 6;
FIG. 9 is a flowchart illustrating pixel position information storage processing corresponding to step S101.
FIG. 10 is a flowchart illustrating processing for detecting a pixel position corresponding to a target pixel, corresponding to the processing in step S102.
FIG. 11 is a block diagram showing a configuration of another embodiment of an image processing apparatus according to the present invention.
FIG. 12 is a diagram for explaining the arrangement of the number of clusters and pixel position information stored in a feature amount frame memory 202;
FIG. 13 is a diagram illustrating an example of a cluster configuration.
14 is a block diagram illustrating an exemplary configuration of an address generation unit 201. FIG.
15 is a flowchart for describing motion vector detection processing by the image processing apparatus having the configuration shown in FIG. 11;
FIG. 16 is a flowchart for describing pixel position information storage processing corresponding to step S201;
FIG. 17 is a flowchart for describing address generation processing corresponding to the processing in step S225;
FIG. 18 is a flowchart for describing address generation processing corresponding to the processing in step S225;
FIG. 19 is a flowchart illustrating processing for detecting a pixel position corresponding to a target pixel, corresponding to the processing in step S202.
FIG. 20 is a flowchart illustrating a process of reading pixel position information corresponding to a feature amount corresponding to the process of step 303;
FIG. 21 is a block diagram showing a configuration of still another embodiment of the image processing apparatus according to the present invention.
22 is a block diagram illustrating an example of a configuration of a feature amount storage unit 401. FIG.
FIG. 23 is a diagram illustrating an example of data stored in an index memory 422 for each feature amount address corresponding to a feature amount.
24 is a flowchart illustrating pixel position information storage processing when the image processing apparatus has the configuration shown in FIG.
25 is a flowchart illustrating a process of reading pixel position information corresponding to a feature amount when the image processing apparatus has the configuration illustrated in FIG.
FIG. 26 is a block diagram showing a configuration of still another embodiment of the image processing apparatus according to the present invention.
27 is a flowchart for describing motion vector detection processing by the image processing apparatus having the configuration shown in FIG. 26;
FIG. 28 is a flowchart for describing address reassignment processing when one pixel position information is stored in each cluster;
FIG. 29 is a flowchart for explaining address recombination processing when one pixel position information is stored in each cluster;
FIG. 30 is a flowchart for describing pixel position information storage processing corresponding to the processing in step S603;
FIG. 31 is a block diagram showing a configuration of still another embodiment of the image processing apparatus according to the present invention.
32 shows a search area SR generated by the search area generation unit 702, a reference block Bb generated by the block generation unit 704, a reference block Brn generated by the matching unit 705, and a reference pixel position detection unit 707. FIG. It is a figure explaining the relationship of a search area.
FIG. 33 is a flowchart for describing motion vector detection processing by the image processing apparatus having the configuration shown in FIG. 31;
FIG. 34 is a flowchart for describing block matching processing corresponding to step S702.
FIG. 35 is a flowchart for describing processing for detecting a position of a pixel corresponding to a target pixel, corresponding to step S703.
FIG. 36 is a block diagram illustrating an example of a configuration of a personal computer that executes a series of processes by a program.
[Explanation of symbols]
101 feature amount extraction unit, 102 feature amount frame memory, 103 feature amount extraction unit, 104 reference pixel position detection unit, 201 address generation unit, 202 feature amount frame memory, 203 reference pixel position detection unit, 221 memory state storage unit, 222 Judgment unit, 223 address calculation unit, 401 feature amount storage unit, 402 reference pixel position detection unit, 421 storage control unit, 422 index memory, 423 frame memory, 601 feature amount histogram generation unit, 602 address generation unit, 603 pixel value frame Memory, 701 line memory, 702 search area generation unit, 703 line memory, 704 block generation unit, 705 matching unit, 706 minimum error selection unit, 707 reference pixel position detection unit, 821 CPU, 822 ROM, 823 RAM, 828 Memory, 851 magnetic disk, 852 optical disk, 853 magneto-optical disk, 854 semiconductor memory

Claims (7)

第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出する第1の特徴量抽出手段と、
前記第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域前記所定の特徴量を有する前記第1の画素の位置を示す画素位置情報と、前記所定の特徴量を有する他の第1の画素の前記画素位置情報が記憶される、前記領域の次の領域を示す領域位置情報とを記憶させる記憶制御手段と、
前記第1のフレームの第2の画素の特徴量を抽出する第2の特徴量抽出手段と、
記憶されている、前記第1の画素の位置を示す前記画素位置情報から求まる前記第1の画素と前記第2の画素との距離に基づいて、前記第2の画素の特徴量と同じ特徴量の前記第1の画素の位置の中から、前記第2の画素の動きベクトルの算出に用いられる、動いた先が前記第2の画素である前記第1の画素の位置を選択する選択手段と、
選択された前記第1の画素の位置、および前記第2の画素の位置から、前記第2の画素の前記動きベクトルを算出する算出手段と
を含み、
前記記憶制御手段は、前記第1の画素の前記所定の特徴量に対応する前記第1のアドレスで指定される前記領域に空きが無くなった場合、前記次の領域を示す前記領域位置情報として、前記所定の特徴量とは異なる他の特徴量を有する前記第1の画素の前記画素位置情報および前記領域位置情報が記憶される、前記他の特徴量に対応する第2のアドレスで指定される領域のうち、前記画素位置情報および前記領域位置情報が記憶されていない領域を示す情報を記憶させるとともに、前記第1のアドレスで指定される前記領域の前記領域位置情報により示される、前記第2のアドレスで指定される領域に、前記所定の特徴量を有する次の第1の画素の前記画素位置情報と、前記領域位置情報とを記憶させる
ことを特徴とする画像処理装置。
First feature amount extraction means for extracting a feature amount of a first pixel of a second frame that is temporally previous to the first frame;
In the area specified by the first address corresponding to a predetermined feature quantity of the first pixel, said first pixel position information indicating a position of a pixel having the predetermined feature value, said predetermined feature quantity Storage control means for storing the pixel position information of the other first pixel having, and storing area position information indicating a next area of the area ;
Second feature amount extraction means for extracting a feature amount of a second pixel of the first frame;
Based on the stored distance between the first pixel and the second pixel, which is obtained from the pixel position information indicating the position of the first pixel , the same feature quantity as the feature quantity of the second pixel from among the position of the first pixel of a selection means for the used to calculate the motion vector of the second pixel, the moved earlier to choose the position of the first pixel is the second pixel ,
Calculating means for calculating the motion vector of the second pixel from the position of the selected first pixel and the position of the second pixel ;
The storage control means, when the area specified by the first address corresponding to the predetermined feature amount of the first pixel has run out, as the area position information indicating the next area, The pixel position information and the region position information of the first pixel having another feature quantity different from the predetermined feature quantity are specified by a second address corresponding to the other feature quantity. Among the regions, the pixel position information and information indicating a region where the region position information is not stored are stored, and the second position indicated by the region position information of the region specified by the first address. An image processing apparatus , wherein the pixel position information of the next first pixel having the predetermined feature amount and the area position information are stored in an area specified by an address .
前記選択手段は、記憶されている、前記第1の画素の位置を示す前記画素位置情報から求まる前記第1の画素と前記第2の画素との距離に基づいて、前記第2の画素の特徴量に近似する特徴量の前記第1の画素の位置の中から、前記第2の画素の前記動きベクトルの算出に用いられる、動いた先が前記第2の画素である前記第1の画素の位置を選択する
ことを特徴とする請求項1に記載の画像処理装置。
The selection unit is characterized by the characteristics of the second pixel based on a distance between the first pixel and the second pixel which is obtained from the stored pixel position information indicating the position of the first pixel. Among the positions of the first pixels of the feature amount approximate to the amount , the moved pixel used for calculation of the motion vector of the second pixel is the second pixel whose moving destination is the second pixel. The image processing apparatus according to claim 1, wherein a position is selected.
前記記憶制御手段は、前記第1の画素の前記所定の特徴量に対応する前記第1のアドレスで指定される前記領域に空きが無くなった場合、最も多い数の空きの領域に対応する前記第2のアドレスを選択し、前記第2のアドレスで指定される領域に、前記画素位置情報および前記領域位置情報を記憶させる
ことを特徴とする請求項1に記載の画像処理装置。
Said storage control unit, when there is no vacancy in the area specified by the first address corresponding to the predetermined feature value of the first pixel, the corresponding region of the largest number of free first 2. The image processing apparatus according to claim 1, wherein an address of 2 is selected, and the pixel position information and the area position information are stored in an area specified by the second address.
前記第2のフレームの全ての前記第1の画素について、特徴量毎の前記第1の画素の数を算出する画素数算出手段をさらに含み、
前記記憶制御手段は、特徴量毎の前記第1の画素の数を基に、前記第2のアドレスを予め選択する
ことを特徴とする請求項1に記載の画像処理装置。
A pixel number calculating means for calculating the number of the first pixels for each feature amount for all the first pixels of the second frame;
The image processing apparatus according to claim 1, wherein the storage control unit preselects the second address based on the number of the first pixels for each feature amount.
第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出する第1の特徴量抽出ステップと、
前記第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域前記所定の特徴量を有する前記第1の画素の位置を示す画素位置情報と、前記所定の特徴量を有する他の第1の画素の前記画素位置情報が記憶される、前記領域の次の領域を示す領域位置情報とを記憶させる記憶制御ステップと、
前記第1のフレームの第2の画素の特徴量を抽出する第2の特徴量抽出ステップと、
記憶されている、前記第1の画素の位置を示す前記画素位置情報から求まる前記第1の画素と前記第2の画素との距離に基づいて、前記第2の画素の特徴量と同じ特徴量の前記第1の画素の位置の中から、前記第2の画素の動きベクトルの算出に用いられる、動いた先が前記第2の画素である前記第1の画素の位置を選択する選択ステップと、
選択された前記第1の画素の位置、および前記第2の画素の位置から、前記第2の画素の前記動きベクトルを算出する算出ステップと
を含み、
前記記憶制御ステップにおいては、前記第1の画素の前記所定の特徴量に対応する前記第1のアドレスで指定される前記領域に空きが無くなった場合、前記次の領域を示す前記領域位置情報として、前記所定の特徴量とは異なる他の特徴量を有する前記第1の画素の前記画素位置情報および前記領域位置情報が記憶される、前記他の特徴量に対応する第2のアドレスで指定される領域のうち、前記画素位置情報および前記領域位置情報が記憶されていない領域を示す情報を記憶させるとともに、前記第1のアドレスで指定される前記領域の前記領域位置情報により示される、前記第2のアドレスで指定される領域に、前記所定の特徴量を有する次の第1の画素の前記画素位置情報と、前記領域位置情報とを記憶させる
ことを特徴とする画像処理方法。
A first feature amount extraction step of extracting a feature amount of a first pixel of a second frame which is a temporally previous frame with respect to the first frame;
In the area specified by the first address corresponding to a predetermined feature quantity of the first pixel, said first pixel position information indicating a position of a pixel having the predetermined feature value, said predetermined feature quantity A storage control step of storing the pixel position information of the other first pixel having a region position information indicating a region next to the region ;
A second feature amount extracting step of extracting a feature amount of a second pixel of the first frame;
The same feature quantity as the feature quantity of the second pixel, based on the distance between the first pixel and the second pixel that is obtained from the stored pixel position information indicating the position of the first pixel. A selection step of selecting a position of the first pixel that is used to calculate a motion vector of the second pixel from among the positions of the first pixel and that is moved to the second pixel ; ,
Calculating the motion vector of the second pixel from the position of the selected first pixel and the position of the second pixel ,
In the storage control step, when the area designated by the first address corresponding to the predetermined feature amount of the first pixel is full, the area position information indicating the next area is used. The pixel position information and the region position information of the first pixel having another feature quantity different from the predetermined feature quantity are stored and designated by a second address corresponding to the other feature quantity. The pixel position information and information indicating an area in which the area position information is not stored are stored, and are indicated by the area position information of the area specified by the first address. in the area specified by the second address, and the pixel position information of the first pixel of the next having the predetermined feature amounts, image processing, characterized in that to store said area position information Method.
第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出する第1の特徴量抽出ステップと、
前記第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域前記所定の特徴量を有する前記第1の画素の位置を示す画素位置情報と、前記所定の特徴量を有する他の第1の画素の前記画素位置情報が記憶される、前記領域の次の領域を示す領域位置情報とを記憶させる記憶制御ステップと、
前記第1のフレームの第2の画素の特徴量を抽出する第2の特徴量抽出ステップと、
記憶されている、前記第1の画素の位置を示す前記画素位置情報から求まる前記第1の画素と前記第2の画素との距離に基づいて、前記第2の画素の特徴量と同じ特徴量の前記第1の画素の位置の中から、前記第2の画素の動きベクトルの算出に用いられる、動いた先が前記第2の画素である前記第1の画素の位置を選択する選択ステップと、
選択された前記第1の画素の位置、および前記第2の画素の位置から、前記第2の画素の前記動きベクトルを算出する算出ステップと
を含む処理をコンピュータに実行させ、
前記記憶制御ステップにおいては、前記第1の画素の前記所定の特徴量に対応する前記第1のアドレスで指定される前記領域に空きが無くなった場合、前記次の領域を示す前記領域位置情報として、前記所定の特徴量とは異なる他の特徴量を有する前記第1の画素の前記画素位置情報および前記領域位置情報が記憶される、前記他の特徴量に対応する第2のアドレスで指定される領域のうち、前記画素位置情報および前記領域位置情報が記憶されていない領域を示す情報を記憶させるとともに、前記第1のアドレスで指定される前記領域の前記領域位置情報により示される、前記第2のアドレスで指定される領域に、前記所定の特徴量を有する次の第1の画素の前記画素位置情報と、前記領域位置情報とを記憶させる
ことを特徴とするコンピュータが読み取り可能なプログラムが記録されている記録媒体。
A first feature amount extraction step of extracting a feature amount of a first pixel of a second frame which is a temporally previous frame with respect to the first frame;
In the area specified by the first address corresponding to a predetermined feature quantity of the first pixel, said first pixel position information indicating a position of a pixel having the predetermined feature value, said predetermined feature quantity A storage control step of storing the pixel position information of the other first pixel having a region position information indicating a region next to the region ;
A second feature amount extracting step of extracting a feature amount of a second pixel of the first frame;
The same feature quantity as the feature quantity of the second pixel, based on the distance between the first pixel and the second pixel that is obtained from the stored pixel position information indicating the position of the first pixel. A selection step of selecting a position of the first pixel that is used to calculate a motion vector of the second pixel from among the positions of the first pixel and that is moved to the second pixel ; ,
A calculation step of calculating the motion vector of the second pixel from the position of the selected first pixel and the position of the second pixel;
Causes the computer to execute processing including
In the storage control step, when the area designated by the first address corresponding to the predetermined feature amount of the first pixel is full, the area position information indicating the next area is used. The pixel position information and the region position information of the first pixel having another feature quantity different from the predetermined feature quantity are stored and designated by a second address corresponding to the other feature quantity. The pixel position information and information indicating an area in which the area position information is not stored are stored, and are indicated by the area position information of the area specified by the first address. in the area specified by the second address, and the pixel position information of the first pixel of the next having the predetermined feature amounts, characterized in that to store said area position information competent Over a recording medium in which data is readable program recorded.
第1のフレームに対して時間的に前のフレームである第2のフレームの第1の画素の特徴量を抽出する第1の特徴量抽出ステップと、
前記第1の画素の所定の特徴量に対応する第1のアドレスで指定される領域前記所定の特徴量を有する前記第1の画素の位置を示す画素位置情報と、前記所定の特徴量を有する他の第1の画素の前記画素位置情報が記憶される、前記領域の次の領域を示す領域位置情報とを記憶させる記憶制御ステップと、
前記第1のフレームの第2の画素の特徴量を抽出する第2の特徴量抽出ステップと、
記憶されている、前記第1の画素の位置を示す前記画素位置情報から求まる前記第1の画素と前記第2の画素との距離に基づいて、前記第2の画素の特徴量と同じ特徴量の前記第1の画素の位置の中から、前記第2の画素の動きベクトルの算出に用いられる、動いた先が前記第2の画素である前記第1の画素の位置を選択する選択ステップと、
選択された前記第1の画素の位置、および前記第2の画素の位置から、前記第2の画素の前記動きベクトルを算出する算出ステップと
を含む処理をコンピュータに実行させ、
前記記憶制御ステップにおいては、前記第1の画素の前記所定の特徴量に対応する前記第1のアドレスで指定される前記領域に空きが無くなった場合、前記次の領域を示す前記領域位置情報として、前記所定の特徴量とは異なる他の特徴量を有する前記第1の画素の前記画素位置情報および前記領域位置情報が記憶される、前記他の特徴量に対応する第2のアドレスで指定される領域のうち、前記画素位置情報および前記領域位置情報が記憶されていない領域を示す情報を記憶させるとともに、前記第1のアドレスで指定される前記領域の前記領域位置情報により示される、前記第2のアドレスで指定される領域に、前記所定の特徴量を有する次の第1の画素の前記画素位置情報と、前記領域位置情報とを記憶させる
ことを特徴とするプログラム。
A first feature amount extraction step of extracting a feature amount of a first pixel of a second frame which is a temporally previous frame with respect to the first frame;
In the area specified by the first address corresponding to a predetermined feature quantity of the first pixel, said first pixel position information indicating a position of a pixel having the predetermined feature value, said predetermined feature quantity A storage control step of storing the pixel position information of the other first pixel having a region position information indicating a region next to the region ;
A second feature amount extracting step of extracting a feature amount of a second pixel of the first frame;
The same feature quantity as the feature quantity of the second pixel, based on the distance between the first pixel and the second pixel that is obtained from the stored pixel position information indicating the position of the first pixel. A selection step of selecting a position of the first pixel that is used to calculate a motion vector of the second pixel from among the positions of the first pixel and that is moved to the second pixel ; ,
A calculation step of calculating the motion vector of the second pixel from the position of the selected first pixel and the position of the second pixel;
Causes the computer to execute processing including
In the storage control step, when there is no space in the area designated by the first address corresponding to the predetermined feature amount of the first pixel, the area position information indicating the next area is used. The pixel position information and the region position information of the first pixel having another feature quantity different from the predetermined feature quantity are stored and designated by a second address corresponding to the other feature quantity. The pixel position information and information indicating an area in which the area position information is not stored are stored, and are indicated by the area position information of the area specified by the first address. in the area specified by the second address, characterized and the next first the pixel position information of pixels having the predetermined feature quantity, that is stored and the area position information programming Beam.
JP2002296678A 2002-10-09 2002-10-09 Image processing apparatus and method, recording medium, and program Expired - Fee Related JP4218298B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002296678A JP4218298B2 (en) 2002-10-09 2002-10-09 Image processing apparatus and method, recording medium, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002296678A JP4218298B2 (en) 2002-10-09 2002-10-09 Image processing apparatus and method, recording medium, and program

Publications (2)

Publication Number Publication Date
JP2004134993A JP2004134993A (en) 2004-04-30
JP4218298B2 true JP4218298B2 (en) 2009-02-04

Family

ID=32286588

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002296678A Expired - Fee Related JP4218298B2 (en) 2002-10-09 2002-10-09 Image processing apparatus and method, recording medium, and program

Country Status (1)

Country Link
JP (1) JP4218298B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6656035B2 (en) 2016-03-23 2020-03-04 キヤノン株式会社 Image processing apparatus, imaging apparatus, and control method for image processing apparatus
JP6647246B2 (en) 2017-06-28 2020-02-14 キヤノン株式会社 Image processing apparatus, imaging apparatus, control method for image processing apparatus, and program

Also Published As

Publication number Publication date
JP2004134993A (en) 2004-04-30

Similar Documents

Publication Publication Date Title
US8970580B2 (en) Method, apparatus and computer-readable medium rendering three-dimensional (3D) graphics
CN100562920C (en) High resolution enabling apparatus and method
JPH10105723A (en) Memory constitution for texture mapping
KR20020067514A (en) Image matching
JP6380051B2 (en) Finite element arithmetic program, finite element arithmetic device, and finite element arithmetic method
US11189096B2 (en) Apparatus, system and method for data generation
JP2918513B2 (en) Object-oriented image expression method and device using irregular mesh
US20080117212A1 (en) Method, medium and system rendering 3-dimensional graphics using a multi-pipeline
JP4218298B2 (en) Image processing apparatus and method, recording medium, and program
US20110110606A1 (en) System and method for rotating images
JP4022917B2 (en) Motion vector detection apparatus and method, recording medium, and program
KR20100068603A (en) Apparatus and method for generating mipmap
CN112509025A (en) Method for calculating rock space structure distance map based on three-dimensional Euclidean distance
KR101106080B1 (en) Data storing controlling apparatus, data storing controlling method and a computer readable recording medium recorded thereon a data storing controlling program
KR102537317B1 (en) Multilevel selective rendering method and apparatus for increasing rendering performance
CN105427235A (en) Image browsing method and system
US20110206294A1 (en) Image Processing Apparatus, Image Processing Method, and Program
JP2004078863A (en) Image processor and image processing method
CN112308795A (en) Image color fault repairing method, system, electronic device and storage medium
JP4300787B2 (en) Image processing apparatus and method, recording medium, and program
JP4175073B2 (en) Image processing apparatus and method, recording medium, and program
CN116883575B (en) Building group rendering method, device, computer equipment and storage medium
JP4687108B2 (en) Data storage device, data storage control device, data storage control method, and data storage control program
US11892387B2 (en) Information processing apparatus and method and system for particle simulation
CN116543267B (en) Image set processing method, image segmentation device, image set processing apparatus, image segmentation device, and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050817

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080729

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080926

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

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

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

Free format text: PAYMENT UNTIL: 20111121

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111121

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111121

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20121121

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121121

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20131121

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees