JP4193460B2 - Image processing apparatus and method, recording medium, and program - Google Patents
Image processing apparatus and method, recording medium, and program Download PDFInfo
- Publication number
- JP4193460B2 JP4193460B2 JP2002296675A JP2002296675A JP4193460B2 JP 4193460 B2 JP4193460 B2 JP 4193460B2 JP 2002296675 A JP2002296675 A JP 2002296675A JP 2002296675 A JP2002296675 A JP 2002296675A JP 4193460 B2 JP4193460 B2 JP 4193460B2
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- frame
- bit length
- motion vector
- dynamic range
- 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
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、画像処理装置および方法、記録媒体、並びにプログラムに関し、特に、より正確に動きベクトルを検出できるようにした画像処理装置および方法、記録媒体、並びにプログラムに関する。
【0002】
【従来の技術】
画像の動きを示す動きベクトルを求め、この動きベクトルに基づいて効率よく動画像を圧縮する技術がある。
【0003】
この動画像圧縮技術における上述の動きベクトルを求める手法としては、いくつか提案されているが、代表的な手法としてブロックマッチングアルゴリズムと呼ばれる手法がある。
【0004】
図1は、ブロックマッチングアルゴリズムを採用した従来の画像処理装置の動き検出部1の構成を示している。
【0005】
動き検出部1のフレームメモリ11は、例えば、時刻t1において、入力端子Tinから画像信号が入力されると、1フレーム分の情報を格納する。さらに、フレームメモリ11は、次のタイミングとなる時刻t2において、入力端子Tinから次のフレームの画像信号が入力されると、時刻t1において、格納した1フレーム分の画像情報をフレームメモリ12に出力した後、新たに入力された1フレーム分の画像情報を格納する。
【0006】
また、フレームメモリ12は、時刻t2のタイミングで、フレームメモリ11から入力されてくる時刻t1のタイミングで入力端子Tinから入力されてきた1フレーム分の画像情報を格納する。
【0007】
すなわち、フレームメモリ11が、上述の時刻t2のタイミングで入力される(今現在の)1フレーム分の画像情報を格納するとき、フレームメモリ12は、時刻t1のタイミングで入力された(1タイミング過去の)1フレーム分の画像情報を格納していることになる。尚、以下において、フレームメモリ11に格納される画像情報をカレントフレームFc、フレームメモリ12に格納される画像情報を参照フレームFrと称するものとする。
【0008】
動きベクトル検出部13は、フレームメモリ11,12に格納されているカレントフレームFcと参照フレームFrをそれぞれから読出し、このカレントフレームFcと参照フレームFrに基づいて、ブロックマッチングアルゴリズムにより動きベクトルを検出し、出力端子Toutから出力する。
【0009】
ここで、ブロックマッチングアルゴリズムについて説明する。例えば、図2で示すように、カレントフレームFc内の注目画素P(i,j)に対応する動きベクトルを求める場合、まず、カレントフレームFc上に注目画素P(i,j)を中心としたL(画素数)×L(画素数)からなる基準ブロックBb(i,j)、参照フレームFr上に、注目画素P(i,j)の位置に対応するサーチエリアSR、そして、そのサーチエリアSR内に、L(画素数)×L(画素数)の画素からなる参照ブロックBrn(i,j)がそれぞれ設定される。
【0010】
次に、この基準ブロックBb(i,j)と、参照ブロックBrn(i,j)の各画素間の差分の絶対値の和を求める処理が、参照ブロックBrn(i,j)をサーチエリアSR内の全域で水平方向、または、垂直方向に1画素分ずつ移動させながら、図2中のBr1(i,j)からBrm(i,j)(参照ブロックBrn(i,j)が、サーチエリアSR内にm個設定できるものとする)まで繰り返される。
【0011】
このようにして求められた基準ブロックBb(i,j)と、参照ブロックBrn(i,j)の各画素間の差分絶対値和のうち、差分絶対値和が最小となる参照ブロックBrn(i,j)を求めることにより、基準ブロックBb(i,j)に最も近い(類似している)参照ブロックBrn(i,j)を構成するL×L個の画素の中心となる参照画素Pn(i,j)が求められる。
【0012】
そして、このカレントフレーム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)となる。
【0013】
すなわち、注目画素P(i,j)に対応する参照フレームFr上の参照画素P’(i,j)を始点とし、基準ブロックBb(i,j)に最も近い(類似している)参照ブロックBrn(i,j)を構成するL×L個の画素の中心となる参照画素Pn(i,j)を終点とするベクトルが動きベクトルとして求められる。
【0014】
次に、図3のフローチャートを参照して、図1の動き検出部1の動き検出処理について説明する。
【0015】
ステップS1において、動きベクトル検出部13は、フレームメモリ11に格納されているカレントフレームFc上の注目画素P(i,j)の画素位置に応じて、サーチエリアSRを設定する。
【0016】
ステップS2において、動きベクトル検出部13は、上述のように、基準ブロック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(画素数))に初期化される。
【0017】
ステップS3において、動きベクトル検出部13は、参照ブロックBrn(i,j)をカウントするカウンタ変数nを1に初期化する。
【0018】
ステップS4において、動きベクトル検出部13は、基準ブロックBb(i,j)と参照ブロックBrn(i,j)の画素間の差分絶対値和を代入するために用いる変数Sumを0に初期化する。
【0019】
ステップS5において、動きベクトル検出部13は、基準ブロックBb(i,j)と参照ブロックBrn(i,j)の画素間の差分絶対値和(=Sum)を求める。すなわち、基準ブロックBb(i,j)の各画素がP_Bb(i,j)、基準ブロックBrn(i,j)の各画素がP_Brn(i,j)としてそれぞれ示される場合、動きベクトル検出部13は、以下の式(1)で示される演算を実行して、基準ブロックBb(i,j)と参照ブロックBrn(i,j)の画素間の差分絶対値和を求める。
【0020】
【数1】
【0021】
ステップS6において、動きベクトル検出部13は、変数Minが変数Sumよりも大きいか否かを判定し、例えば、変数Minが変数Sumよりも大きいと判定する場合、ステップS7において、変数Minを変数Sumに更新し、その時点でのカウンタnの値を動きベクトル番号として登録する。すなわち、今求めた差分絶対値和を示す変数Sumが、最小値を示す変数Minよりも小さいと言うことは、これまで演算したどの参照ブロックよりも、今演算している参照ブロックBrn(i,j)が基準ブロックBb(i,j)により類似したものであるとみなすことができるので、動きベクトルを求める際の候補とするため、その時点でのカウンタnが動きベクトル番号として登録される。また、ステップS6において、変数Minが変数Sumよりも大きくないと判定された場合、ステップS7の処理がスキップされる。
【0022】
ステップS8において、動きベクトル検出部13は、カウンタ変数nがサーチエリアSRの参照ブロックBrn(i,j)の総数mであるか否か、すなわち、今の参照ブロックBrn(i,j)がBrn(i,j)=Brm(i,j)であるか否かを判定し、例えば、総数mではないと判定した場合、ステップS9において、カウンタ変数nを1インクリメントし、その処理は、ステップS4に戻る。
【0023】
ステップS8において、カウンタ変数nがサーチエリア内の参照ブロックBrn(i,j)の総数mである、すなわち、今の参照ブロックBrn(i,j)がBrn(i,j)=Brm(i,j)であると判定された場合、ステップS10において、動きベクトル検出部13は、登録されている動きベクトル番号に基づいて動きベクトルを出力する。すなわち、ステップS4乃至S9が繰り返されることにより、差分絶対値和が最小となる参照ブロックBrn(i,j)に対応するカウンタ変数nが動きベクトル番号として登録されることになるので、動きベクトル検出部13は、この動きベクトル番号に対応する参照ブロックBrn(i,j)のL×L個の画素のうち、その中心となる参照画素Pn(i,j)を求め、カレントフレームFc上の注目画素P(i,j)に対応する参照フレームFr上の画素P’(i,j)を始点とし、参照画素Pn(i,j)を終点とするベクトルを、注目画素P(i,j)の動きベクトル(Vx,Vy)として求めて出力する。
【0024】
また、ブロックマッチング法により動きベクトルを検出する時に、定常成分および過渡成分の絶対値差分を累算した値の加重平均から得られる評価値に基づいて動きベクトルを検出することにより、演算量を低減させるようにするものがある(例えば、特許文献1参照)。
【0025】
さらに、参照ブロックおよび探索範囲内の画素値を符号化してコード値に基づいてマッチング演算を行い、演算結果に基づいて第1の動きベクトルを算出し、第1の動きベクトルに応じた動き補償を行った後に第1の動きベクトルに係る候補ブロックを1画素を単位としてずらすことで得られる新たな探索範囲について、画素値の差分に基づくブロックマッチングを行うことにより、第2の動きベクトルを算出して、第1の動きベクトルと第2の動きベクトルの和として最終的な動きベクトルを算出することで、演算を簡素化するものがある(例えば、特許文献2参照)。
【0026】
【特許文献1】
特開平07−087494号公報
【特許文献2】
特開2000−278691号公報
【0027】
【発明が解決しようとする課題】
しかしながら、上述したブロックマッチングアルゴリズムは、式(1)の演算量が非常に膨大なものとなるため、MPEG(Moving Picture Experts Group)等の画像圧縮処理においては、大半の時間がこの処理に費やされてしまうという課題があった。
【0028】
また、カレントフレームFc、または、参照フレームFrの動きベクトルの始点、または、終点付近でノイズが含まれた場合、ブロックマッチングでは基準ブロックに類似する参照ブロックを検出することができず、正確な動きベクトルを検出することができないという課題があった。
【0029】
本発明はこのような状況に鑑みてなされたものであり、正確に動きベクトルを生成することができるようにするものである。
【0030】
【課題を解決するための手段】
本発明の画像処理装置は、入力された画像における第1のフレームの各画素のうちの、注目画素に対応する4m(m≧1)個の周辺画素の画素値をクラスタップとして抽出するクラスタップ抽出手段と、クラスタップのダイナミックレンジを検出するダイナミックレンジ検出手段と、ダイナミックレンジに基づいて、ダイナミックレンジが大きいときにはビット長を小さくし、ダイナミックレンジが小さいときにはビット長を大きくするように、クラスタップのビット長を決定するビット長決定手段と、ビット長決定手段により決定されたビット長で表現されたクラスタップの画素値レベルから、特徴量としての量子化コードを生成する量子化コード生成手段と、第1のフレームの全ての画素を注目画素として、量子化コード生成手段により生成された特徴量と、特徴量に対応する第1のフレームの各画素位置の情報を記憶する記憶手段と、第1のフレームとは異なる第2のフレーム中の注目画素について、量子化コード生成手段により生成された特徴量に対応する、第1のフレームの画素位置の情報を、記憶手段より読み出す読出し手段と、読出し手段により読み出された第1のフレームの画素位置の情報のうち、第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出する動きベクトル検出手段とを備えることを特徴とする。
【0031】
前記ビット長決定手段には、ダイナミックレンジが大きいときにはビット長を小さくし、ダイナミックレンジが小さいときにはビット長を大きくするように、ダイナミックレンジと対応付けられたビット長の情報を記憶したテーブルを設けるようにさせることができ、ダイナミックレンジに基づいてビット長の情報をテーブルから読み出して、クラスタップのビット長を決定させるようにすることができる。
【0033】
動きベクトル検出手段により検出された前記動きベクトルの大きさを所定の動きベクトルの大きさと比較する動きベクトル比較手段をさらに設けるようにさせることができ、動きベクトル比較手段の比較結果が、所定の動きベクトルの大きさよりも、動きベクトル生成手段により生成された動きベクトルの大きさの方が大きい場合、読出し手段には、第2のフレーム中の注目画素の量子化コードに類似する量子化コードに対応する第1のフレームの画素位置の情報を、記憶手段より読み出させ、動きベクトル検出手段には、読出し手段により読み出された、第2のフレーム中の注目画素の量子化コードに類似する量子化コードに対応する第1のフレームの画素位置の情報のうち、第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出させることができる。
【0034】
本発明の画像処理方法は、入力された画像における第1のフレームの各画素のうちの、注目画素に対応する4m(m≧1)個の周辺画素の画素値をクラスタップとして抽出するクラスタップ抽出ステップと、クラスタップのダイナミックレンジを検出するダイナミックレンジ検出ステップと、ダイナミックレンジに基づいて、ダイナミックレンジが大きいときにはビット長を小さくし、ダイナミックレンジが小さいときにはビット長を大きくするように、クラスタップのビット長を決定するビット長決定ステップと、ビット長決定ステップの処理で決定されたビット長で表現されたクラスタップの画素値レベルから、特徴量としての量子化コードを生成する量子化コード生成ステップと、第1のフレームの全ての画素を注目画素として、量子化コード生成ステップの処理で生成された特徴量と、特徴量に対応する第1のフレームの各画素位置の情報を記憶する記憶ステップと、第1のフレームとは異なる第2のフレーム中の注目画素について、量子化コード生成ステップの処理で生成された特徴量に対応する、第1のフレームの画素位置の情報を読み出す読出しステップと、読出しステップの処理で読み出された第1のフレームの画素位置の情報のうち、第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出する動きベクトル検出ステップとを含むことを特徴とする。
【0035】
本発明の記録媒体のプログラムは、入力された画像における第1のフレームの各画素のうちの、注目画素に対応する4m(m≧1)個の周辺画素の画素値をクラスタップとして抽出するクラスタップ抽出ステップと、クラスタップのダイナミックレンジを検出するダイナミックレンジ検出ステップと、ダイナミックレンジに基づいて、ダイナミックレンジが大きいときにはビット長を小さくし、ダイナミックレンジが小さいときにはビット長を大きくするように、クラスタップのビット長を決定するビット長決定ステップと、ビット長決定ステップの処理で決定されたビット長で表現されたクラスタップの画素値レベルから、特徴量としての量子化コードを生成する量子化コード生成ステップと、第1のフレームの全ての画素を注目画素として、量子化コード生成ステップの処理で生成された特徴量と、特徴量に対応する第1のフレームの各画素位置の情報を記憶する記憶ステップと、第1のフレームとは異なる第2のフレーム中の注目画素について、量子化コード生成ステップの処理で生成された特徴量に対応する、第1のフレームの画素位置の情報を読み出す読出しステップと、読出しステップの処理で読み出された第1のフレームの画素位置の情報のうち、第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出する動きベクトル検出ステップとを含むことを特徴とする。
【0036】
本発明のプログラムは、入力された画像における第1のフレームの各画素のうちの、注目画素に対応する4m(m≧1)個の周辺画素の画素値をクラスタップとして抽出するクラスタップ抽出ステップと、クラスタップのダイナミックレンジを検出するダイナミックレンジ検出ステップと、ダイナミックレンジに基づいて、ダイナミックレンジが大きいときにはビット長を小さくし、ダイナミックレンジが小さいときにはビット長を大きくするように、クラスタップのビット長を決定するビット長決定ステップと、ビット長決定ステップの処理で決定されたビット長で表現されたクラスタップの画素値レベルから、特徴量としての量子化コードを生成する量子化コード生成ステップと、第1のフレームの全ての画素を注目画素として、量子化コード生成ステップの処理で生成された特徴量と、特徴量に対応する第1のフレームの各画素位置の情報を記憶する記憶ステップと、第1のフレームとは異なる第2のフレーム中の注目画素について、量子化コード生成ステップの処理で生成された特徴量に対応する、第1のフレームの画素位置の情報を読み出す読出しステップと、読出しステップの処理で読み出された第1のフレームの画素位置の情報のうち、第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出する動きベクトル検出ステップとを含む処理をコンピュータに実行させることを特徴とする。
【0037】
本発明の画像処理装置および方法、並びにプログラムにおいては、入力された画像における第1のフレームの各画素のうちの、注目画素に対応する4m(m≧1)個の周辺画素の画素値がクラスタップとして抽出され、クラスタップのダイナミックレンジが検出され、ダイナミックレンジに基づいて、ダイナミックレンジが大きいときにはビット長を小さくし、ダイナミックレンジが小さいときにはビット長を大きくするように、クラスタップのビット長が決定され、決定されたビット長で表現されたクラスタップの画素値レベルから、特徴量としての量子化コードが生成され、第1のフレームの全ての画素を注目画素として生成された特徴量と、特徴量に対応する第1のフレームの各画素位置の情報が記憶され、第1のフレームとは異なる第2のフレーム中の注目画素について生成された特徴量に対応する、第1のフレームの画素位置の情報が読み出され、読み出された第1のフレームの画素位置の情報のうち、第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、第2のフレーム中の注目画素の画素位置を終点とする動きベクトルが検出される。
【0038】
【発明の実施の形態】
図4は、本発明を適用した画像処理装置の動き検出部21の構成を示すブロック図である。
【0039】
動き検出部21は、フレームメモリ31、特徴量抽出部32、バッファメモリ33、データベース制御部34、および、動きベクトル検出部35で構成されている。
【0040】
フレームメモリ31は、入力端子Tinから入力された画像信号の1画面(1フレーム)の情報を格納し、特徴量抽出部32に供給する。特徴量抽出部32は、フレームメモリから供給された画面情報、すなわちカレントフレームFcの情報を基に、注目画素の特徴量を抽出する。
【0041】
特徴量抽出部32は、注目画素に対応したクラスタップを抽出し(注目画素に対応した付近の画素の画素値を抽出し)、そのクラスタップの情報から量子化コードを生成し、この量子化コードを特徴量として出力する。特徴量抽出部32は、次の画面情報が入力されると、先に供給された画面情報から抽出した特徴量と対応する画素位置の情報(例えば、座標情報)を、バッファメモリ33および動きベクトル検出部35に供給する。尚、特徴量抽出部32については、詳細を後述する。
【0042】
バッファメモリ33は、供給された特徴量を、参照フレームFrの特徴量情報として格納する。
【0043】
データベース制御部34は、バッファメモリ33に格納されている参照フレームFrの特徴量情報に基づいて、特徴量をアドレスとして画素の位置情報をデータベース21に格納することにより、参照フレーム情報を生成する。データベース制御部34は、内部に、処理済の画素数をカウントするためのカウンタを有している。
【0044】
次に、図5を参照して、データベース21に格納される参照フレーム情報の構成について説明する。
【0045】
データベース21は、特徴量アドレス0乃至aと、フラグアドレス0乃至bによって示されるa×b個のセルにより構成されている。データベース制御部34は、画素の特徴量を特徴量アドレスに対応付けて、特徴量毎にその特徴量を持つ画素位置の情報を、データベース21の、特徴量アドレスに対応するフラグアドレス1乃至bに順次格納する。そして、フラグアドレス0には、現在、その特徴量アドレスに格納されている画素位置の情報の数が、順次、インクリメントされて格納される。具体的には、特徴量アドレス1に、1つの画素位置の情報がセル(1,1)に格納されている場合、セル(1,0)には、格納されている画素位置の情報の数として、1が格納される。そして、次の注目画素の特徴量が、特徴量アドレス1に対応するものであった場合、セル(1,0)に格納されている値は、インクリメントされて2となり、注目画素の位置情報が、セル(1,2)に格納される。
【0046】
再び、図4に戻り、動き検出部21の構成について説明する。動きベクトル検出部35は、特徴量抽出部32から供給されたカレントフレームFcの特徴量情報と、データベース制御部34のデータベース41に記憶されている情報とのマッチング処理を実行して、動きベクトルを検出する。動きベクトル検出部35は、具体的には、カレントフレームFcの注目画素の特徴量に対応する、データベース41の特徴量アドレスに記載されている、複数の候補それぞれの画素位置と注目画素の距離を演算し、算出された距離が最小である画素位置の情報に基づいて、差分座標を注目画素の動きベクトル(Vx,Vy)として検出する。
【0047】
動きベクトル検出部35は、検出した動きベクトルMの値が想定される動きベクトルの最大値M_Maxより小さいときは(規定範囲内にあるとき)、正しい動きベクトルとして判定し、端子Tout から出力する。また、動きベクトル検出部35は、検出した動きベクトルMの値が想定される動きベクトルの最大値M_Maxより大きいときは(規定範囲外にあるとき(等しい場合も含む))、対応していない位置の動きベクトルと判定し、カレントフレーム内の画素とデータベース41で近い特徴量のアドレスを生成して、近傍の特徴量のアドレスに属する画素位置の情報に基づいて再度マッチング処理を行う。なお、動きベクトル検出部35は、たとえば近傍の特徴量の選択においてビット反転を行うが、このとき注目画素のパターンに応じてビット反転の形態を変更する。
【0048】
次に、図6のフローチャートを参照して、参照フレーム情報生成処理について説明する。
【0049】
ステップS31において、データベース制御部34は、データベース41に登録されている参照フレーム情報を初期化する。すなわち、データベース制御部34は、全ての特徴量アドレスに対応するフラグアドレス0のセルに0を書き込み、フラグアドレス1乃至bに格納されている画素位置の情報を削除する。
【0050】
ステップS32において、データベース制御部34は、フレームメモリ31内の画素をカウントするカウンタのカウンタ変数nを0に初期化する。
【0051】
ステップS33において、特徴量抽出部32は、注目画素に対応するクラスタップから特徴量を算出し、算出された特徴量を、動きベクトル検出部35およびバッファメモリ33に供給する。尚、特徴量算出処理については、後述する。
【0052】
ステップS34において、データベース制御部34は、バッファメモリ33に保存されている参照フレームFrの情報から、カウンタ変数nに対応する画素に対応する注目画素の特徴量を読み出し、データベース41内の対応する特徴量アドレスの、フラグアドレス0に記載されている値Kを読み込む。
【0053】
ステップS35において、データベース制御部34は、ステップS35において読み出した値Kを、1だけインクリメントして(K=K+1として)、データベース41の対応する特徴量アドレスの、フラグアドレス0に書き込む。
【0054】
ステップS36において、データベース制御部34は、バッファメモリ33に保存されている参照フレームFrの情報から、注目画素の位置情報を読み出し、データベース41の対応する特徴量アドレスのフラグアドレスK+1に、注目画素の位置情報を書き込む。
【0055】
ステップS37において、データベース制御部34は、カウンタ変数nをインクリメントして、n=n+1とする。
【0056】
ステップS38において、データベース制御部34は、カウンタ変数n=1フレームの画素数であるか否かを判定する。ステップS38において、カウンタ変数n=1フレームの画素数ではないと判定された場合、処理は、ステップS33に戻り、それ以降の処理が繰り返される。ステップS38において、カウンタ変数n=1フレームの画素数であると判定された場合、処理は、終了される。
【0057】
次に、図7,図8のフローチャートを参照して、図4の動き検出部21による動きベクトル検出処理について説明する。
【0058】
ステップS51において、動きベクトル検出部35は、1フレームの画素数をカウントするカウント変数sを0に初期化する。
【0059】
ステップS52において、動きベクトル検出部35は、特徴量抽出部32により抽出されたカレントフレームFc内の注目画素Pnの特徴量を取得する。
【0060】
ステップS53において、動きベクトル検出部35は、取得した特徴量を特徴量アドレスに対応する、データベース41上のセル(特徴量アドレス,0)に記録されている値を読み込み、同じ特徴量に分類される画素数(候補数:画素位置の情報の数)を変数tsに代入する。また、動きベクトル検出部35は、候補数カウンタを示すカウンタ変数tを1に、距離の最小値を示す変数Minを∞に、距離を示すカウンタ変数Lを0にそれぞれ初期化する。
【0061】
ステップS54において、動きベクトル検出部35は、カレントフレームFc内の注目画素Pnとデータベース制御部35から読み込んだデータベース41上の(特徴量アドレス,t)に記録されている画素位置の情報との距離を演算して、変数Lに代入する。
【0062】
ステップS55において、動きベクトル検出部35は、ステップS54の処理で求められた距離Lが最小値を示す変数Minよりも小さいか否かを判定し、例えば、変数Min>距離Lであると判定した場合、ステップS56において、変数Minを距離Lに更新し、そのときの変数tを動きベクトル番号として登録する。また、変数Min≦距離Lであると判定された場合、ステップS56の処理はスキップされる。
【0063】
ステップS57において、動きベクトル検出部35は、候補カウンタ変数tが候補数の変数ts以上であるか否かを判定し、候補カウンタ変数tが候補数の変数ts以上ではないと判定した場合、すなわち、候補となる未処理の画素が存在する場合、ステップS58において、変数tを1インクリメントして、その処理は、ステップS54に戻る。
【0064】
すなわち、候補カウンタ変数tが候補数の変数ts以上ではないということは、データベース41上に記録されている、注目画素の特徴量と同一の特徴量に分類された画素位置の情報のうち、ステップS54乃至S56の処理がなされていない画素位置の情報が存在することになるので、候補となる全ての画素位置の情報について、ステップS54乃至S57の処理が施されるまで、その処理が繰り返される。
【0065】
ステップS57において、変数tが変数ts以上であると判定された場合、すなわち、注目画素の特徴量と同一の特徴量を有する全ての画素の画素位置と注目画素との距離が比較されたと判定された場合、ステップS59において、動きベクトル検出部35は、ステップS56の処理で登録した動きベクトル番号に対応する画素位置を始点とし、注目画素位置を終点とする動きベクトルMを求める。
【0066】
ステップS60において、動きベクトル検出部35は、求められた動きベクトルMの絶対値と、動きベクトルMの想定される最大値M_Maxとを比較し、動きベクトルMの絶対値が最大値M_Maxよりも小さいか否かを判定し、例えば、動きベクトルMの絶対値が最大値M_Maxよりも小さいと判定した場合、その処理は、ステップS61に進む。
【0067】
ステップS61において、動きベクトル検出部35は、ステップS59の処理で求められた動きベクトルMを出力端子Toutから出力し、ステップS62において、変数sを1インクリメントする。
【0068】
ステップS63において、動きベクトル検出部35は、変数sがフレーム内の画素数と一致するか否かを判定し、例えば、変数sがフレーム内の画素数と一致しないと判定した場合、すなわち、まだ、処理すべき画素が存在すると判定する場合、その処理は、ステップS52に戻り、例えば、変数sがフレーム内の画素数と一致すると判定した場合、すなわち、全ての画素について処理がなされたと判定された場合、その処理は終了する。
【0069】
ステップS60において、動きベクトルMの絶対値が最大値M_Maxよりも小さくないと判定された場合、すなわち、注目画素と同じ特徴量と有する参照フレームの画素のうち、注目画素と最も近い位置に存在する画素との距離が想定していた距離M_Maxよりも離れていた場合、その処理は、ステップS64(図8)に進む。
【0070】
ステップS64(図8)において、動きベクトル検出部35は、反転ビット数を示す変数uを1に初期化する。
【0071】
ステップS65において、動きベクトル検出部35は、注目画素の特徴量を示す量子化コードのうちuビットを反転させる。すなわち、最初の処理では注目画素の特徴量を示す量子化コードを構成する複数ビットのうちのいずれか1ビットが反転される。
【0072】
ステップS66において、動きベクトル検出部35は、uビットだけ反転した特徴量を特徴量アドレスに対応する、データベース41上の(特徴量アドレス,0)に記録されている値を読み込み、同じ特徴量に分類される画素数(候補数:画素位置の情報の数)を変数tsに代入する。また、動きベクトル検出部35は、候補数カウンタを示すカウンタ変数tを1に、距離の最小値を意味する変数Minを∞に、距離を示すカウンタ変数Lを0にそれぞれ初期化する。
【0073】
ステップS67において、動きベクトル検出部35は、カレントフレームFc内の注目画素Pnと、データベース制御部35から読み込んだデータベース41上の(特徴量アドレス,t)に記録されている画素位置との距離を演算して、変数Lに代入する。
【0074】
ステップS68において、動きベクトル検出部35は、ステップS67の処理で求められた距離Lが距離の最小値の変数Minよりも小さいか否かを判定し、例えば、変数Min>距離Lであると判定した場合、ステップS69において、最小値の変数Minを距離Lに更新し、そのときの変数tを動きベクトル番号として登録する。また、変数Min≦距離Lであると判定された場合、ステップS69の処理はスキップされる。
【0075】
ステップS70において、動きベクトル検出部35は、候補カウンタ変数tが候補数の変数ts以上であるか否かを判定し、候補カウンタ変数tが候補数の変数ts以上ではないと判定した場合、すなわち、候補となる未処理の画素が存在するとみなし、ステップS71において、変数tを1インクリメントして、その処理は、ステップS67に戻る。
【0076】
すなわち、候補カウンタ変数tが候補数の変数ts以上ではないということは、データベース41上に記録されている、注目画素の特徴量がuビット反転された特徴量と同一の特徴量に分類された画素位置の情報のうち、ステップS67乃至S69の処理がなされていない画素が存在することになるので、候補となる全ての画素について、ステップS67乃至S69の処理が施されるまで、その処理が繰り返される。
【0077】
ステップS70において、変数tが変数ts以上であると判定された場合、すなわち、注目画素の特徴量のうちuビット反転された特徴量と同一の特徴量を有する全ての画素の画素位置と注目画素との距離が比較されたと判定された場合、ステップS72において、注目画素の特徴量のうち反転させていないビットの組み合わせがあるか否かを判定し、まだ、反転させていないビットが、または、反転させていないビットの組み合わせがあると判定した場合、その処理は、ステップS65に戻る。
【0078】
ステップS72において、反転させていないビットが存在しないと判定された場合、ステップS73において、動きベクトル検出部35は、ステップS69の処理で登録した動きベクトル番号に対応する画素位置を始点とし、注目画素位置を終点とする動きベクトルMを求める。
【0079】
ステップS74において、動きベクトル検出部35は、求められた動きベクトルMの大きさの絶対値と、動きベクトルMの大きさとして想定される最大値M_Maxとを比較し、動きベクトルMの絶対値が最大値M_Maxよりも小さいか否かを判定し、例えば、動きベクトルMの絶対値が最大値M_Maxよりも小さいと判定した場合、その処理は、ステップS61に戻る。
【0080】
ステップS74において、動きベクトルMの絶対値が最大値M_Maxよりも小さくないと判定された場合、すなわち、注目画素の特徴量のうちuビット反転された特徴量と同じ特徴量を有する参照フレームの画素のうち、注目画素と最も近い位置に存在する画素との距離が想定していた距離よりも離れていた場合、ステップS75において、変数uを1インクリメントして、その処理は、ステップS65に戻る。
【0081】
すなわち、ステップS51乃至S63の処理により、注目画素Pnの特徴量と同一の特徴量として分類されている画素と、注目画素との距離を順次演算し、最小となる画素を求め、その求められた画素位置の情報と注目画素Pnの画素位置の情報から動きベクトルを生成して、出力する。
【0082】
ただし、ステップS60において、生成された動きベクトルMの絶対値が、最大値M_Maxよりも大きい場合、正しく求められた動きベクトルではないと判定され、ステップS64乃至S75の処理により、注目画素Pnの特徴量に類似した近傍の特徴量に属する(分類される)画素と、注目画素Pnとの距離を順次求めて、その距離が最小となる画素を求め、動きベクトルを求める。
【0083】
すなわち、動き物体のある部分の特徴量が隣接フレームで少量変化することがありうる。
【0084】
特徴量空間の各要素間は直交の関係にあるため、ある特徴量は図8のd−a1のように要素の個数を軸とした特徴量空間で定義される。すなわち、d−a1で示す座標に特徴量を抽出した画素の空間座標をリンクさせる。
【0085】
ある特徴量に対して近傍の特徴量(ある特徴量に対して類似する特徴量)は、図8中d−a2で示すように、各特徴量空間内の軸x,y,zの値に対してある範囲の振れ幅を許容する領域として定義される。特徴量抽出部32から出力される特徴量は、量子化コードであり、例えば、4ビットの量子化コードとして「000」が出力される場合、最も近傍の特徴量は、ハミング距離が1となる「001」、「010」、および「100」となる。結果として、図8において、注目画素の特徴量が「000」である場合、図中d−a2で定義される範囲に含まれる特徴量(類似する特徴量)は、「001」、「010」、および「100」となる。
【0086】
そこで、ステップS65乃至S72の処理においては、上述したようにいずれかuビットのデータを反転させた(0ならば1に、1ならば0に反転させた)ときに求められる特徴量に属する画素と注目画素との距離を求めて最小となる画素と注目画素の画素位置の情報から動きベクトルMを生成し、大きさが最大値M_Max以下となる動きベクトルMが生成されるまで、反転させるビット数uを大きくしながらその処理を繰り返す。すなわち、注目画素の特徴量を示す量子化コードとのハミング距離を徐々に大きくしながら、注目画素との距離が最小となる画素を求める処理を繰り返す。
【0087】
この場合、演算内容はアドレス参照と差分演算と分岐のみなので、演算量が大幅に増大することはない。
【0088】
画素値としては、たとえば1画素=8ビットとした場合、コンピュータグラフィックス(CG)のような画像はフルビット(8ビット)情報でマッチング処理を行えるが、自然画像の場合は、フレーム毎にバラツキを含むので、複数ビットのうち所定ビットを除いて、マッチング処理を行うことが望ましい。具体的には、下位数ビットをマスクして使用してもよいし、ビット数を少なくして再量子化しても良い。つまり、非線形/線形な量子化におけるビット数を削減する(量子化ビット数を少なくする)ことが望ましい。
【0089】
次に、特徴量抽出部32について詳細を説明する。
【0090】
図10は、特徴量抽出部32の構成例を示したブロック図である。
【0091】
クラスタップ抽出部51は、入力された画像情報のうち、特徴量の抽出に必要な注目画素に対応する周辺画素(クラスタップ)の情報(画素値)を抽出しDRレンジ演算部52、および、ADRCコード生成部53に出力する。また、クラスタップ抽出部51は、クラスタップのパターンを記憶したタップテーブル51aを有しており、DR判定部54より入力される指示情報に基づいて(指示回数に応じて)、抽出するクラスタップのパターンを切り替える。
【0092】
すなわち、タップテーブル51aは、クラスタップのパターンとして、図11で示すように注目画素(図中黒丸で表示されている画素)を中心とした3画素×3画素からなるブロックの最外周位置に配置される8画素(図中斜線で塗りつぶされている画素)のパターンや、図12で示すように、注目画素(図中黒丸で表示されている画素)を中心とした5画素×5画素からなるブロックの最外周位置に配置される16画素(図中斜線で塗りつぶされている画素)のパターンや、図13で示すように、注目画素(図中黒丸で表示されている画素)を中心とした7画素×7画素からなるブロックの最外周位置に配置される24画素(図中斜線で塗りつぶされている画素)パターンや、さらに、図示しないが、注目画素(図中黒丸で表示されている画素)を中心としたn画素×n画素からなるブロックの最外周位置に配置される4(n−1)画素(図中斜線で塗りつぶされている画素)パターンを記憶している。
【0093】
また、クラスタップのパターンは、図14で示すように、注目画素の上下左右の1画素からなる4画素であってもよいし、図15で示すように、注目画素の上下左右の2画素からなる8画素であってもよいし、図16で示すように、注目画素の上下左右の3画素からなる12画素であってもよいし、さらには、図示しないが、注目画素の上下左右のm画素からなる4m画素であってもよい。さらに、クラスタップは、図示した以外の構成でもよく、例えば、注目画素との位置関係が非対称となる配置のものであってもよい。
【0094】
クラスタップ抽出部51は、DR(ダイナミックレンジ)判定部54からの指示情報に基づいて、クラスタップの配置が注目画素の位置に対してその範囲が広がっていくような配置となるように、ランク分けされたクラスタップのパターンを順次タップテーブル51aから読み出して変更させていく。この際、クラスタップ抽出部51は、内蔵するランクを示すカウンタを制御して対応するランクのクラスタップを抽出する。
【0095】
すなわち、図11乃至図13で示すように変化していくクラスタップのパターン(注目画素を中心としたn画素×n画素からなるブロックの最外周位置に配置される4(n−1)画素のパターン)が、順次ランクと共にタップテーブル51aに記憶されていた場合、クラスタップ抽出部51は、DR判定部54から指示情報が無い状態では、図11で示すランク1のパターンでクラスタップの情報を読出し、その後のタイミングで、最初に指示情報を受信した場合、図12で示すランク2のパターンに変化させて、クラスタップの情報を読み出し、さらに、2回目の指示情報を受信した場合、図13で示すランク3のパターンに変更してクラスタップの情報を読み出し、さらに、n回目の指示情報を受信した場合、注目画素を中心としたn画素×n画素からなるブロックの最外周位置に配置される4(n−1)画素のランクnのパターンでクラスタップの情報を抽出する。このようにクラスタップのパターンのランクnは、指示情報を受信した回数に基づいて変化する。尚、このクラスタップ抽出部51が用いるパターンの変化(変更)は、図11乃至図13で示すようなパターンの変化のように同一形状で規則的に変化するもの(クラスタップの配置の形状が正方形で相似に変化するようなもの)である必要は無く、配置の形状などは変化するものであってもよい。また、パターンの変化は、図14乃至図16で示すようなパターンであってもよく、この場合、ランクsは、図14,図15,図16の順に設定されることになる。
【0096】
DR(ダイナミックレンジ)演算部52は、クラスタップ抽出部51より入力されるクラスタップの情報(画素値)からダイナミックレンジを求め、ダイナミックレンジをDR判定部54とADRC(Adaptive Dynamic Range Coding)コード生成部53に出力すると共に、ダイナミックレンジとダイナミックレンジを求める際に得られる最小値の情報をADRCコード生成部53に出力する。すなわち、クラスタップのパターンが、例えば、図14で示すものであった場合、各クラスタップC1乃至C4の情報(画素値レベル)が、(C1,C2,C3,C4)=(60,90,51,100)であるとき、その関係は、図17で示すようになる。このような場合、ダイナミックレンジは、画素値レベルの最小値と最大値の差として定義され、その値は、以下の式(2)で定義される。
DR=Max−Min+1・・・(2)
【0097】
ここで、Maxは、クラスタップの情報である画素値レベルの最大値であり、Minは、クラスタップの画素値レベルの最小値を示す。ここで、1を加算するのは、クラスを定義するためである(例えば、0,1で示されるクラスを設定する場合、両者の差分は1であるが、クラスとしては2クラスとなるため、差分に1を加算する)。従って、図17の場合、クラスタップC3の画素値レベル100が最大値であり、クラスタップC1の画素値レベル51が最小値となるので、DRは、50(=100−51+1)となる。
【0098】
このように、DR演算部52は、DRを演算するにあたり、クラスタップの画素値レベルのうちの最小値と最大値を検出することになるので、その最小値(または最大値:最小値は、最大値とDRから求めることができる)をADRCコード生成部53に出力する。
【0099】
ADRCコード生成部53は、DR演算部52より入力されたDRの値と最小値Minからクラスタップの各画素値レベルをADRCコードからなる量子化コードを生成して出力する。より詳細には、ADRCコードは、クラスタップの各画素値レベルを以下の式(3)に代入することにより求められる。
Q=Round((L−Min+0.5)×(2^n)/DR)・・・(3)
【0100】
ここで、Roundは切り捨てを、Lは画素値レベルを、nは割り当てビット数を、(2^n)は2のn乗を、それぞれ示している。
【0101】
従って、例えば、割り当てビット数nが1であった場合、各クラスタップの画素値レベルは、以下の式(4)で示される閾値th以上であれば1であり、閾値thより小さければ0とされる。
th=DR/2−0.5+Min・・・(4)
【0102】
結果として、割り当てビット数nが1である場合、図17で示すようなクラスタップが得られた場合、閾値thは、75.5(=50/2−0.5+51)となるので、ADRCコードは、ADRC(C1,C2,C3,C4)=0101となる。
【0103】
ここで、図10の特徴量抽出部32の構成の説明に戻る。
【0104】
DR判定部54は、DR演算部52より入力されるDRの値が所定の閾値DR_th以上であるか否かを判定し、所定の閾値DR_thの場合、クラスタップ抽出部51に対してクラスタップのパターンを変更するように指示すると共に、ADRCコード生成部53に対して、今入力されたDRを用いたADRCコードの生成処理を実行しないように指示する。
【0105】
すなわち、ADRCコードは、クラスタップによっては、異なるDRであっても同じADRCコードが生成されることがある。この場合、DRが小さいほど誤差の影響を受けやすくなり、ADRCコードがフレーム毎に変化する恐れが生じやすくなる。
【0106】
より詳細には、例えば、図18で示すように、図14で示すクラスタップにより画素値レベル(C1,C2,C3,C4)=(74,80,65.5,85.5)となる場合を考える。尚、図18において、画素値レベル(C1,C2,C3,C4)=(74,80,65.5,85.5)は、バツ印により示されている。または、図中の黒丸は、図17で示した場合の例をそのまま示しており、ダイナミックレンジは、DR1(=50)で示されている。
【0107】
このとき、図18中で、バツ印で示されるクラスタップのダイナミックレンジであるDR2は、20となり、最小値は65.5となるので、閾値は、75.5となり、生成されるADRCコードは、0101となり、図17で示した場合と同一のADRCコードが生成されることになる。
【0108】
ところで、各画素値レベルには、一定のレベルの誤差が生じる事が知られている。例えば、図18では、各データに発生する誤差の範囲が、図中の縦棒で示されている。ここで、バツ印のクラスタップC1のデータは、誤差範囲に閾値が含まれているため、誤差の程度によっては、閾値thよりも大きくなることがあり、クラスタップのコードが反転してしまう可能性がある。
【0109】
動きベクトルの始点、または、終点となる画素に対応するクラスタップにこのような現象が生じると、結果として、本来動きベクトルの始点、または、終点として設定されるADRCコードが変化してしまうため、正確な動きベクトルの生成ができなくなる可能性が生じてしまう。さらに、DRが小さいと、クラスタップの各画素値レベルは、分散の程度が小さいことになるので、このように、閾値付近に存在する画素が多く含まれている可能性があり、それぞれの誤差範囲が閾値を跨ぐことにより複数ビットのコードが反転してしまう可能性がある。
【0110】
以上のことから、DRが大きい程、ADRCコードの誤差は小さく、DRが小さい程、ADRCコードの誤差が大きくなる。
【0111】
そこで、ダイナミックレンジDRがダイナミックレンジの閾値DR_thよりも小さい場合、クラスタップのパターンを変化させて、例えば、図11のランク1のパターンから図12のランク2のパターンへと変化させ、クラスタップの個数とクラスタップを抽出する範囲を注目画素に対して広くすることによりDRが大きくなるようにパターンを変更させる。さらに、パターンを変更させた後でも、DRがDR_thよりも小さい場合には、さらに、高いランクのパターンに変更させ、DRがDR_thを超える値になるまでパターンを変更させる指示情報をクラスタップ抽出部51に送信する。
【0112】
次に、図19のフローチャートを参照して、特徴量算出処理について説明する。
【0113】
ステップS91において、クラスタップ抽出部51は、クラスタップのパターンのランクを示すカウンタ変数sを1に初期化する。
【0114】
ステップS92において、クラスタップ抽出部51は、フレームメモリ31に記憶されている1フレーム分の画像を読出し、その中の注目画素に対応するランクsのパターンの情報をタップテーブル51aから読出し、対応するクラスタップを抽出し、DR演算部52、および、ADRCコード生成部53に出力する。すなわち、最初の処理では、ランクs=1のパターン(例えば、上述の図11、または、図14のクラスタップのパターン)のクラスタップが抽出され、DR演算部52に出力される。
【0115】
ステップS93において、DR演算部52は、クラスタップ抽出部51より入力されたクラスタップのダイナミックレンジを求め、ADRCコード生成部53、および、DR判定部54に出力すると共に、その際、検出される最小値をADRCコード生成部53に出力する。すなわち、図17で示すような、クラスタップの画素値レベルが入力されると、上述のように、DRとして50が出力され、最小値Minとして51が出力される。
【0116】
ステップS94において、DR判定部54は、DR演算部52より入力されたDRが所定の閾値DR_thよりも大きいか否かを判定し、例えば、DR演算部52より入力されたDRが所定の閾値DR_thよりも大きくない、すなわち、クラスタップの各画素値レベルが分散していないと判定した場合、ステップS96において、クラスタップ抽出部51に対して、クラスタップのパターンを変更させる指示を出力し、ADRCコード生成部53に対して、DR算出部52より入力されたDR、および、最小値Minを用いたADRCコードを生成しないように指示する。
【0117】
ステップS97において、クラスタップ抽出部51は、ランクを示すカウンタ変数sを1インクリメントし、その処理は、ステップS92に進む。すなわち、今の場合、ランクを示すカウンタ変数sは2となり、例えば、上述の図12、または、図15のパターンのように、注目画素から空間的に広がりをもつパターンに変更させてクラスタップを抽出する。
【0118】
このように、DRが所定の閾値DR_thを超えるまで、ステップS92乃至S97の処理が繰り返される。
【0119】
ステップS94において、DR演算部52より入力されたDRが所定の閾値DR_thよりも大きいと判定された場合、ステップS95において、ADRCコード生成部53は、DR演算部52より入力されたDR、および、最小値Minを用いて、クラスタップ抽出部51より入力されたクラスタップの各画素値レベルからADRCコードを生成して出力する。
【0120】
以上のように、クラスタップとして検出される画素値レベルに含まれる誤差を考慮し、所定の大きさ以上のダイナミックレンジが確保されるまでクラスタップを抽出する範囲が広げられることにより、ADRCコードを生成する際に生じるノイズなどの誤差を抑制し、より正確な動きベクトルの検出を可能にすることができる。
【0121】
以上においては、注目画素に対するクラスタップのパターンを変化させることにより、DRを大きくして、結果的に正しい動きベクトルの検出が可能となる例について説明してきたが、クラスタップのパターンを変更させること無く、画像を縮小させるようにしてもよい。
【0122】
図20は、DRが所定の閾値DR_thより小さい場合、画像を縮小させることにより、同一のクラスタップのパターンでもDRを大きくさせるようにした特徴量抽出部32の構成を示している。
【0123】
尚、図20中、図10における場合と対応する部分については、同一の符号を付してあり、以下では、その説明は、適宜省略する。
【0124】
図20において、図10の特徴量抽出部32と異なるのは、画像縮小部71が新たに設けられ、クラスタップ抽出部51およびDR判定部54に代えて、クラスタップ抽出部72およびDR判定部73が設けられた点である。
【0125】
画像縮小部71は、DR判定部73からの指示に基づいて入力された画像を縮小してクラスタップ抽出部72に出力する。尚、画像縮小部71は、縮小率を示すカウンタを備えており、デフォルトの状態では(DR判定部73から特に指示を受けていない状態では)、縮小率1、すなわち、入力された画像を縮小することなくそのままクラスタップ抽出部72に出力する。
【0126】
クラスタップ抽出部72は、クラスタップ51と同一の機能を有するものであるが、クラスタップ抽出部51とは異なりタップテーブル51aを有していないので、所定の固定されたクラスタップのパターンで画像縮小部71より入力された画像の注目画素に対応するクラスタップを抽出し、DR演算部52、および、ADRCコード生成部53に出力する。
【0127】
DR判定部73は、基本的には、DR判定部54と同一の機能を有するものであるが、DRが所定の閾値DR_thよりも小さいと判定した場合、画像縮小部71に対して画像を縮小するように指示を送信する。
【0128】
次に、図21のフローチャートを参照して、図20の特徴量算出処理について説明する。尚、図21のフローチャートにおけるステップS113乃至S116の処理については、図19のフローチャートにおけるステップS92乃至S95の処理と、同様の処理であるので、その説明は省略する。
【0129】
ステップS111において、画像縮小部71は、縮小率を示すカウンタ変数tを1に初期化する。
【0130】
ステップS112において、画像縮小部71は、フレームメモリ31に記憶されている画像情報を読出し、1/(t^2)倍(ここで、t^2は、tの2乗を示す)に画像を縮小して(水平方向、および、垂直方向にそれぞれ、t行毎、または、t列毎に間引きして、1/t倍に縮小して)、クラスタップ抽出部72に出力する。すなわち、最初の処理では、縮小率が1(=1/(1^2))であるので、画像は縮小されること無くフレームメモリ31に記憶されている画像そのものがクラスタップ抽出部72に出力される。
【0131】
ステップS115において、DR判定部73は、DRが所定の閾値DR_thよりも大きいと判定すると、ステップS117において、画像縮小部71に対して、画像を縮小するようにする指示情報を送信する。
【0132】
ステップS118において、画像縮小部71は、DR判定部73からの指示に基づいて縮小率を示すカウンタ変数tを1インクリメントし、その処理は、ステップS112に戻る。従って、例えば、t=2とき、ステップS112においては、画像が水平方向、および垂直方向に1/2に縮小されて(1/(2^2)に縮小されて)以降の処理が繰り返される。
【0133】
すなわち、例えば、図22で示すように、2L(画素数)×2M(画素数)からなる画像の注目画素(図中黒丸で表示されている画素)を中心としたを3画素×3画素からなるブロックの最外周位置に配置される8画素(図中斜線で塗りつぶされている画素)のパターンからなるクラスタップを抽出する場合、DRが所定の閾値DR_thよりも大きいと判定されると、図23で示すように、画像が、水平方向、および、垂直方向に対して1/2倍となるL×Mからなる画像に縮小されて(水平方向および垂直方向に、それぞれ1行、および、1列ずつ間引きされて)、注目画素を中心とした3画素×3画素からなるブロックの最外周位置に配置される8画素(図23中格子状の線で塗りつぶされている画素)のパターンからなるクラスタップを抽出する。このように処理することにより、図23で示す縮小された画像のクラスタップは、図22で示すように縮小前の画像の注目画素の水平方向、および、垂直方向に対して2画素分の距離に存在していた画素(図22中格子状の線で塗りつぶされている画素)がクラスタップとして選択されることになる。
【0134】
このように、画像を縮小して、同一のパターンからなるクラスタップを抽出することにより、実質的に、元の画像の注目画素の位置から空間的に広がるように、クラスタップのパターンが変更されるのと同様の処理がなされることになるので、図10を参照して説明した特徴量抽出部32と同様の効果を得ることができる。
【0135】
また、以上においては、クラスタップを空間的に広がるようにパターンを切り替えてDRを所定の閾値DR_th以上となるようにさせる例について説明してきたが、例えば、DRが小さい場合、クラスタップとして抽出される各画素の画素値レベルを表すビット長を変化させることによりADRCコードを正確に表現できるようにしてもよい。
【0136】
図24は、クラスタップとして抽出する画素値レベルを表すビット長を変化させるようにして、正確なADRCコードを生成するようにした特徴量抽出部32の構成例を示すブロック図である。
【0137】
尚、図24中、図10または図20における場合と対応する部分については、同一の符号を付してあり、以下では、その説明は、適宜省略する。図24において、図10の特徴量抽出部32と異なるのは、DR判定部54、および、ADRCコード生成部53に代えて、使用ビット長決定部81、および、ADRCコード生成部82が設けられている点である。
【0138】
使用ビット長決定部81は、ADRCコードを生成する際に、DRに対応した使用ビット長の情報が予め記憶されたテーブル81aを有しており、DR演算部より入力されるDRに基づいて、このテーブルからクラスタップのデータ(各画素の画素値)の使用ビット長を決定し、決定した使用ビット長の情報をADRCコード生成部82に出力する。
【0139】
ADRCコード生成部82は、基本的に図10のADRCコード生成部53と同様の機能を有するものであるが、使用ビット長決定部81より入力される使用ビット長の情報に基づいてADRCコードを生成する。
【0140】
ここで、クラスタップの各画素値レベルを示すビット長を変化させることにより、ADRCコード(量子化コード)を正確に表現する方法について説明する。
【0141】
例えば、クラスタップ抽出部72により、クラスタップから抽出される各画素の画素値レベルを上位2ビットで表現させる場合、図25で示すように、クラスタップC1が、0乃至63の範囲に、クラスタップC2が、64乃至127の範囲に、クラスタップC3が、128乃至191の範囲に、クラスタップC4が、192乃至255の範囲に、それぞれ分布して、ダイナミックレンジDR_Lが大きければ、2ビットのADRCコードで表現するとき、各クラスタップの値は、それぞれ異なる値として表現できることになる。すなわち、画素値レベルが、0乃至63のとき00、64乃至127のとき01、128乃至191のとき10、192乃至255のとき11としてADRCコードの各コードを表すとするならば、クラスタップ(C1,C2,C3,C4)に対応するコードは、(00,10,01,11)となるので、各画素値に対応するコードに差をつけて表現することが可能である。
【0142】
ところが、図25と類似する傾向を持ったクラスタップC1乃至C2のようにダイナミックレンジDR_Sが小さくとなると、例えば、図26で示すようにクラスタップC1乃至C4が同一の範囲(128乃至191の範囲)に分布してしまうことになり、2ビットの表現では、全てが01で表現されてしまうことになるため、結果として、画素値レベルを2ビットで表現すると、各画素毎に差をつけて表現することができないことになる。
【0143】
従って、このような場合には、画素値レベルの表現方法を2ビットからそれ以上のビット数で表現すれば、各画素毎に異なる画素値レベルを表現することができるので、ADRCコードの各画素値レベルを示すコードにも差をつけることが可能になる。
【0144】
これらをまとめると、画素値レベルを表現するビット長は、実際の画素値レベルのダイナミックレンジDR/2の分解能が表現できるように選択すればよいことになる。従って、例えば、画素値レベルのダイナミックレンジを8ビットで表現できる場合、図27で示すように、必要分解能(=DR/2)が128であるとき、使用ビット長は1ビット以上であればよく、必要分解能が64であるとき、使用ビット長は2ビット以上であればよく、必要分解能が32であるとき、使用ビット長は3ビット以上であればよく、必要分解能が16であるとき、使用ビット長は4ビット以上であればよく、必要分解能が8であるとき、使用ビット長は5ビット以上であればよく、必要分解能が4であるとき、使用ビット長は6ビット以上であればよく、必要分解能が2であるとき、使用ビット長は7ビット以上であればよく、必要分解能が1であるとき、使用ビット長は8ビット以上であればよいことになる。
【0145】
換言すれば、図28で示すように、ダイナミックレンジDRに対して、DRが265であるとき、使用ビット長は1ビット以上であればよく、DRが128であるとき、使用ビット長は2ビット以上であればよく、DRが64であるとき、使用ビット長は3ビット以上であればよく、DRが32であるとき、使用ビット長は4ビット以上であればよく、DRが16であるとき、使用ビット長は5ビット以上であればよく、DRが8であるとき、使用ビット長は6ビット以上であればよく、DRが4であるとき、使用ビット長は7ビット以上であればよく、DRが2であるとき、使用ビット長は8ビット以上であればよいことになる。
【0146】
使用ビット長決定部81のテーブル81aには、図28で示すダイナミックレンジDRと、対応する使用ビット長の情報が記憶されている。
【0147】
次に、図29のフローチャートを参照して、ビット長を調整することにより、注目画素に対応する特徴量を抽出する処理(注目画素に対応するプラスタップに基づいてADRCコードを生成する処理)について説明する。尚、図29のフローチャートにおいて、ステップS131,S132の処理については、図21のフローチャートにおけるステップS113,S114の処理と同様であるので、その説明は省略する。
【0148】
ステップS133において、使用ビット長決定部81は、ステップS132の処理によりDR演算部52で演算されたDRに基づいて、テーブル81aを参照して使用ビット長を決定し、決定した使用ビット長の情報をADRCコード生成部82に出力する。
【0149】
ステップS134において、ADRCコード生成部82は、クラスタップ抽出部72より入力されたクラスタップの各画素値レベルを、使用ビット長決定部81より入力された使用ビット長により処理し、DR演算部52より入力されたDR、および、最小値Minを用いてADRCコードを生成して出力する。
【0150】
以上によれば、クラスタップとして抽出される画素値レベルを示すデータのビット長をDRに対応して変更させることにより、ダイナミックレンジが小さい場合には、画素値レベルを表現するビット長を長くして、各画素毎のコードに差をつけて表現することができ、結果として正確なADRCコードを生成することが可能になる。また、ダイナミックレンジが大きい場合、ビット長を長くしすぎないようにすることができるので、フレーム単位での画素値レベルの変化を吸収してノイズによる影響を抑制することが可能となる。
【0151】
また、動き検出部21は、図4で示すように、参照フレームFrの特徴量をバッファメモリ33に記憶させ、次のタイミングでデータベース41に記憶させて、動きベクトルを検出させるようにする例について説明してきたが、例えば、図30で示すように、カレントフレームFcを記憶するフレームメモリ31−1と、その次のタイミングで、カレントフレームFcを参照フレームFrに記憶させるフレームメモリ31−2を設けるようにして、カレントフレームFcと参照フレームFrのそれぞれの特徴量抽出部32−1,32−2を設けるようにしてもよい。尚、図30の動き検出部21の処理は、図4の動き検出部21と同様であるので、その説明は省略する。
【0152】
以上においては、特徴量を表現する量子化コードとしてADRCコードを生成する場合について説明してきたが、特徴量を表現する量子化コードは、ADRCコードに限るものではなく、例えば、注目画素に対応したクラスタップから求められるダイナミックレンジDR、最小値Min、ラプラシアン、ソーベルオペレータ、または、クラスタップの中心画素の画素値、もしくは、注目画素近傍N画素値の平均、または、和などであってもよい。
【0153】
以上によれば、注目画素に対応したクラスタップのDRの大きさに基づいて、適応的にDR、または、ビット長を変更することにより、適正な量子化コードを生成することが可能となるので、動きベクトルを正確に求めることが可能となる。
【0154】
上述した一連の処理は、ハードウェアにより実行させることもできるが、ソフトウェアにより実行させることもできる。一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行させることが可能な、例えば汎用のパーソナルコンピュータなどに記録媒体からインストールされる。
【0155】
図31は、動き検出部21をソフトウェアにより実現する場合のパーソナルコンピュータの一実施の形態の構成を示している。パーソナルコンピュータのCPU201は、パーソナルコンピュータの動作の全体を制御する。また、CPU201は、バス204および入出力インタフェース205を介してユーザからキーボードやマウスなどからなる入力部206から指令が入力されると、それに対応してROM(Read Only Memory)202に格納されているプログラムを実行する。あるいはまた、CPU201は、ドライブ210に接続された磁気ディスク211、光ディスク212、光磁気ディスク213、または半導体メモリ214から読み出され、記憶部208にインストールされたプログラムを、RAM(Random Access Memory)203にロードして実行し、出力部207が実行結果を出力する。さらに、CPU201は、通信部209を制御して、外部と通信し、データの授受を実行する。
【0156】
プログラムが記録されている記録媒体は、図31に示すように、コンピュータとは別に、ユーザにプログラムを提供するために配布される、プログラムが記録されている磁気ディスク211(フレキシブルディスクを含む)、光ディスク212(CDROM(Compact Disc-Read Only Memory),DVD(Digital Versatile Disc)を含む)、光磁気ディスク213(MD(Mini-Disc)を含む)、もしくは半導体メモリ214などよりなるパッケージメディアにより構成されるだけでなく、コンピュータに予め組み込まれた状態でユーザに提供される、プログラムが記録されているROM202や、記憶部208に含まれるハードディスクなどで構成される。
【0157】
尚、本明細書において、記録媒体に記録されるプログラムを記述するステップは、記載された順序に沿って時系列的に行われる処理は、もちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理を含むものである。
【0158】
【発明の効果】
本発明によれば、適正な量子化コードを生成することが可能となるので、動きベクトルを正確に求めることが可能となる。
【図面の簡単な説明】
【図1】従来の動き検出部の構成を示すブロック図である。
【図2】動きベクトルの検出方法を説明する図である。
【図3】図1の動き検出部による動き検出処理を説明するフローチャートである。
【図4】本発明を適用した動き検出部の一実施の形態の構成を説明するブロック図である。
【図5】図4のデータベースの構造を説明する図である。
【図6】図4の動き検出部による参照フレーム情報生成処理を説明するフローチャートである。
【図7】図4の動き検出部による動きベクトル検出処理を説明するフローチャートである。
【図8】図4の動き検出部による動きベクトル検出処理を説明するフローチャートである。
【図9】注目画素の特徴量の近傍の特徴量を説明する図である。
【図10】本発明を適用した特徴量抽出部の一実施の形態の構成を説明するブロック図である。
【図11】クラスタップを説明する図である。
【図12】クラスタップを説明する図である。
【図13】クラスタップを説明する図である。
【図14】クラスタップを説明する図である。
【図15】クラスタップを説明する図である。
【図16】クラスタップを説明する図である。
【図17】 ADRCコードを説明する図である。
【図18】 DRが小さいときに生じる誤差の例を説明する図である。
【図19】図10で示す特徴量抽出部による特徴量算出処理を説明するフローチャートである。
【図20】本発明を適用した特徴量抽出部の他の実施の形態の構成を説明するブロック図である。
【図21】図20で示す特徴量抽出部による特徴量算出処理を説明するフローチャートである。
【図22】画像を縮小してクラスタップを抽出する処理を説明する図である。
【図23】画像を縮小してクラスタップを抽出する処理を説明する図である。
【図24】本発明を適用した特徴量抽出部の他の実施の形態の構成を説明するブロック図である。
【図25】 DRに対応して使用ビット長を変更させる処理を説明する図である。
【図26】 DRに対応して使用ビット長を変更させる処理を説明する図である。
【図27】必要分解能と使用ビット長の関係を説明する図である。
【図28】ダイナミックレンジと使用ビット長の関係を説明する図である。
【図29】図24で示す特徴量抽出部による特徴量算出処理を説明するフローチャートである。
【図30】本発明を適用した動き検出部の他の実施の形態の構成を説明するブロック図である。
【図31】媒体を説明する図である。
【符号の説明】
31 フレームメモリ, 32 特徴量抽出部, 33 バッファメモリ, 34 データベース制御部, 35 動きベクトル検出部, 41 データベース, 51 クラスタップ抽出部, 51a タップテーブル, 52 DR算出部, 53 ADRCコード生成部, 54 DR判定部, 71 画像縮小部, 72 クラスタップ抽出部, 73 DR判定部, 81 使用ビット長決定部, 81a テーブル, 82 ADRCコード生成部[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 that can detect a motion vector more accurately.
[0002]
[Prior art]
There is a technique for obtaining a motion vector indicating the motion of an image and efficiently compressing the moving image based on the motion vector.
[0003]
Several methods for obtaining the above-described motion vector in this moving image compression technique have been proposed. As a representative method, there is a method called a block matching algorithm.
[0004]
FIG. 1 shows a configuration of a
[0005]
For example, when an image signal is input from the input terminal Tin at time t1, the
[0006]
Further, the
[0007]
That is, when the
[0008]
The motion
[0009]
Here, the block matching algorithm will be described. For example, as shown in FIG. 2, when obtaining a motion vector corresponding to a 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.
[0010]
Next, the process of calculating the sum of the absolute values of the differences between the pixels of the base block Bb (i, j) and the reference block Brn (i, j) causes the reference block Brn (i, j) to be searched. 2 are moved horizontally by one pixel at a time in the whole area or Br1 (i, j) to Brm (i, j) (reference block Brn (i, j) in FIG. It is repeated until m can be set in SR).
[0011]
Of the sum of absolute differences between the pixels of the base block Bb (i, j) and the reference block Brn (i, j) thus determined, the reference block Brn (i , J), the reference pixel Pn (the center of L × L pixels constituting the reference block Brn (i, j) closest to (similar to) the base block Bb (i, j) i, j) is determined.
[0012]
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).
[0013]
That is, the reference block closest to (similar to) the base block Bb (i, j) starting from the reference pixel P ′ (i, j) on the reference frame Fr corresponding to the target pixel P (i, j). A vector whose end point is the reference pixel Pn (i, j), which is the center of L × L pixels constituting Brn (i, j), is obtained as a motion vector.
[0014]
Next, the motion detection processing of the
[0015]
In step S <b> 1, the motion
[0016]
In step S2, the motion
[0017]
In step S3, the motion
[0018]
In step S4, the motion
[0019]
In step S5, the motion
[0020]
[Expression 1]
[0021]
In step S6, the motion
[0022]
In step S8, the motion
[0023]
In step S8, the counter variable n is the total number m of the reference blocks Brn (i, j) in the search area, that is, the current reference block Brn (i, j) is Brn (i, j) = Brm (i, j), in step S10, the motion
[0024]
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).
[0025]
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).
[0026]
[Patent Document 1]
Japanese Patent Application Laid-Open No. 07-087494
[Patent Document 2]
JP 2000-278691 A
[0027]
[Problems to be solved by the invention]
However, since the above-described block matching algorithm requires an enormous amount of calculation of equation (1), most of the time is spent on this processing in image compression processing such as MPEG (Moving Picture Experts Group). There was a problem of being done.
[0028]
In addition, when noise is included near the start point or end point of the motion vector of the current frame Fc or the reference frame Fr, the block matching cannot detect a reference block similar to the reference block, and an accurate motion There was a problem that the vector could not be detected.
[0029]
The present invention has been made in view of such circumstances, and makes it possible to accurately generate a motion vector.
[0030]
[Means for Solving the Problems]
The image processing apparatus of the present invention corresponds to a pixel of interest among the pixels of the first frame in the input image. 4m (m ≧ 1) Class tap the pixel values of surrounding pixels As Based on the dynamic range, the bit length is decreased when the dynamic range is large, and the bit length is increased when the dynamic range is small, based on the dynamic range. In addition, a bit length determining means for determining the bit length of the class tap, and a quantization for generating a quantization code as a feature amount from the pixel value level of the class tap represented by the bit length determined by the bit length determining means A code generation unit and a memory for storing the feature amount generated by the quantization code generation unit and information of each pixel position of the first frame corresponding to the feature amount, with all pixels of the first frame as the target pixel Means and a pixel of interest in a second frame different from the first frame, Reading means for reading out the pixel position information of the first frame corresponding to the feature quantity generated by the child code generation means from the storage means, and information on the pixel position of the first frame read by the reading means Motion vector detecting means for detecting a motion vector starting from the pixel position of the pixel having the smallest distance from the target pixel in the second frame and ending at the pixel position of the target pixel in the second frame It is characterized by providing.
[0031]
The bit length determining means includes When the dynamic range is large, the bit length is reduced. When the dynamic range is small, the bit length is increased. Compatible with dynamic range Attached A table storing bit length information can be provided, and the bit length information can be read from the table based on the dynamic range to determine the bit length of the class tap.
[0033]
Motion vector detection By means detection The motion vector comparison means for comparing the magnitude of the motion vector with the magnitude of the predetermined motion vector can be further provided, and the comparison result of the motion vector comparison means is greater than the magnitude of the predetermined motion vector. When the magnitude of the motion vector generated by the motion vector generating means is larger, the reading means has the first frame corresponding to the quantization code similar to the quantization code of the pixel of interest in the second frame. Read pixel location information from storage The motion vector detection means reads out the pixel position information of the first frame corresponding to the quantization code similar to the quantization code of the pixel of interest in the second frame read by the reading means, Detects a motion vector starting from the pixel position of the pixel with the smallest distance to the pixel of interest in the second frame and ending with the pixel position of the pixel of interest in the second frame Can be made.
[0034]
The image processing method of the present invention corresponds to a pixel of interest among the pixels of the first frame in the input image. 4m (m ≧ 1) Class tap the pixel values of surrounding pixels As Based on the dynamic range, the bit length is reduced when the dynamic range is small, and the bit length is increased when the dynamic range is small, based on the class tap extraction step to extract, the dynamic range detection step to detect the dynamic range of the class tap Next, a quantization code is generated as a feature quantity from the bit length determination step for determining the bit length of the class tap and the pixel value level of the class tap expressed by the bit length determined by the processing of the bit length determination step. Using the quantization code generation step and all the pixels of the first frame as the target pixel, the feature amount generated by the processing of the quantization code generation step, and information on each pixel position of the first frame corresponding to the feature amount And a second step different from the first frame. For the pixel of interest in the frame, a read step for reading out information on the pixel position of the first frame corresponding to the feature quantity generated in the process of the quantization code generation step, and the first read out by the process of the read step Motion vector starting from the pixel position of the pixel having the smallest distance from the pixel of interest in the second frame and ending in the pixel position of the pixel of interest in the second frame And a motion vector detecting step for detecting.
[0035]
The recording medium program of the present invention corresponds to the target pixel among the pixels of the first frame in the input image. 4m (m ≧ 1) Class tap the pixel values of surrounding pixels As Based on the dynamic range, the bit length is reduced when the dynamic range is small, and the bit length is increased when the dynamic range is small, based on the class tap extraction step to extract, the dynamic range detection step to detect the dynamic range of the class tap Next, a quantization code is generated as a feature quantity from the bit length determination step for determining the bit length of the class tap and the pixel value level of the class tap expressed by the bit length determined by the processing of the bit length determination step. Using the quantization code generation step and all the pixels of the first frame as the target pixel, the feature amount generated by the processing of the quantization code generation step, and information on each pixel position of the first frame corresponding to the feature amount And a second step different from the first frame. For the pixel of interest in the frame, a read step for reading out information on the pixel position of the first frame corresponding to the feature quantity generated in the process of the quantization code generation step, and the first read out by the process of the read step Motion vector starting from the pixel position of the pixel having the smallest distance from the pixel of interest in the second frame and ending in the pixel position of the pixel of interest in the second frame And a motion vector detecting step for detecting.
[0036]
The program of the present invention corresponds to a pixel of interest among the pixels of the first frame in the input image. 4m (m ≧ 1) Class tap the pixel values of surrounding pixels As Based on the dynamic range, the bit length is reduced when the dynamic range is small, and the bit length is increased when the dynamic range is small, based on the class tap extraction step to extract, the dynamic range detection step to detect the dynamic range of the class tap Next, a quantization code is generated as a feature quantity from the bit length determination step for determining the bit length of the class tap and the pixel value level of the class tap expressed by the bit length determined by the processing of the bit length determination step. Using the quantization code generation step and all the pixels of the first frame as the target pixel, the feature amount generated by the processing of the quantization code generation step, and information on each pixel position of the first frame corresponding to the feature amount And a second step different from the first frame. For the pixel of interest in the frame, a read step for reading out information on the pixel position of the first frame corresponding to the feature quantity generated in the process of the quantization code generation step, and the first read out by the process of the read step Motion vector starting from the pixel position of the pixel having the smallest distance from the pixel of interest in the second frame and ending in the pixel position of the pixel of interest in the second frame And a motion vector detecting step for detecting the motion vector.
[0037]
In the image processing apparatus and method, and the program according to the present invention, the pixel corresponding to the target pixel is selected from the pixels of the first frame in the input image. 4m (m ≧ 1) Pixel values of surrounding pixels are class tap As The class tap dynamic range is extracted, and the class tap bit length is determined based on the dynamic range so that the bit length is reduced when the dynamic range is large and the bit length is increased when the dynamic range is small. Quantization code as a feature value is generated from the pixel value level of the class tap expressed with the determined bit length, and the feature value generated using all the pixels of the first frame as the target pixel, and the feature value Is stored, and the pixel position of the first frame corresponding to the feature quantity generated for the target pixel in the second frame different from the first frame is stored. The information is read out, and the pixel position of the first frame is read out with the pixel of interest in the second frame. Away it is starting from the pixel position of the pixel having the minimum motion vector of the pixel position of the target pixel in the second frame and ending are detected.
[0038]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 4 is a block diagram showing a configuration of the
[0039]
The
[0040]
The
[0041]
The feature
[0042]
The
[0043]
Based on the feature amount information of the reference frame Fr stored in the
[0044]
Next, the configuration of reference frame information stored in the
[0045]
The
[0046]
Returning to FIG. 4 again, the configuration of the
[0047]
When the value of the detected motion vector M is smaller than the assumed motion vector maximum value M_Max (when it is within the specified range), the motion
[0048]
Next, reference frame information generation processing will be described with reference to the flowchart of FIG.
[0049]
In step S31, the database control unit 34 initializes reference frame information registered in the
[0050]
In
[0051]
In step S <b> 33, the feature
[0052]
In step S <b> 34, the database control unit 34 reads the feature amount of the target pixel corresponding to the pixel corresponding to the counter variable n from the information of the reference frame Fr stored in the
[0053]
In step S35, the database control unit 34 increments the value K read in step S35 by 1 (K = K + 1), and writes it to the
[0054]
In step S 36, the database control unit 34 reads the position information of the target pixel from the information of the reference frame Fr stored in the
[0055]
In step S37, the database control unit 34 increments the counter variable n so that n = n + 1.
[0056]
In step S38, the database control unit 34 determines whether or not the counter variable n is the number of pixels of one frame. If it is determined in step S38 that the counter variable n is not the number of pixels in one frame, the process returns to step S33, and the subsequent processes are repeated. If it is determined in step S38 that the counter variable n is the number of pixels in one frame, the process is terminated.
[0057]
Next, the motion vector detection process by the
[0058]
In step S51, the motion
[0059]
In step S52, the motion
[0060]
In step S53, the motion
[0061]
In step S54, the motion
[0062]
In step S55, the motion
[0063]
In step S57, the motion
[0064]
That is, the fact that the candidate counter variable t is not greater than or equal to the number of candidates for the variable ts means that, among the information on the pixel positions classified on the same feature quantity as the feature quantity of the target pixel recorded on the
[0065]
If it is determined in step S57 that the variable t is greater than or equal to the variable ts, that is, it is determined that the pixel positions of all pixels having the same feature quantity as the feature quantity of the target pixel have been compared with the distance of the target pixel. In step S59, the motion
[0066]
In step S60, the motion
[0067]
In step S61, the motion
[0068]
In step S63, the motion
[0069]
In step S60, when it is determined that the absolute value of the motion vector M is not smaller than the maximum value M_Max, that is, among the pixels of the reference frame having the same feature amount as the target pixel, the pixel exists at the closest position to the target pixel. If the distance from the pixel is larger than the assumed distance M_Max, the process proceeds to step S64 (FIG. 8).
[0070]
In step S64 (FIG. 8), the motion
[0071]
In step S65, the motion
[0072]
In step S66, the motion
[0073]
In step S67, the motion
[0074]
In step S68, the motion
[0075]
In step S70, the motion
[0076]
That is, the fact that the candidate counter variable t is not greater than or equal to the number of candidates for the variable ts means that the feature quantity of the pixel of interest recorded in the
[0077]
If it is determined in step S70 that the variable t is greater than or equal to the variable ts, that is, the pixel positions and the target pixels of all the pixels having the same feature quantity as the u-bit inverted feature quantity among the feature quantities of the target pixel. In step S72, it is determined whether or not there is a combination of non-inverted bits in the feature amount of the pixel of interest. If it is determined that there is a bit combination that has not been inverted, the processing returns to step S65.
[0078]
If it is determined in step S72 that there is no non-inverted bit, in step S73, the motion
[0079]
In step S74, the motion
[0080]
If it is determined in step S74 that the absolute value of the motion vector M is not smaller than the maximum value M_Max, that is, the reference frame pixel having the same feature quantity as the u-bit inverted feature quantity of the feature quantity of the target pixel. If the distance between the pixel of interest and the pixel closest to the target pixel is greater than the expected distance, the variable u is incremented by 1 in step S75, and the process returns to step S65.
[0081]
That is, by the processing of steps S51 to S63, the distance between the pixel classified as the same feature quantity as the feature quantity of the target pixel Pn and the target pixel is sequentially calculated, and the minimum pixel is obtained. A motion vector is generated from the pixel position information and the pixel position information of the target pixel Pn and output.
[0082]
However, when the absolute value of the generated motion vector M is larger than the maximum value M_Max in step S60, it is determined that the motion vector is not obtained correctly, and the process of steps S64 to S75 determines the characteristics of the target pixel Pn. The distance between a pixel belonging to (classified) a nearby feature quantity similar to the quantity and the target pixel Pn is sequentially obtained, the pixel having the minimum distance is obtained, and the motion vector is obtained.
[0083]
That is, the feature amount of a certain part of the moving object may change a little in adjacent frames.
[0084]
Since the elements in the feature amount space are orthogonal to each other, a certain feature amount is defined in the feature amount space with the number of elements as an axis, as indicated by d-a1 in FIG. That is, the spatial coordinates of the pixel from which the feature amount is extracted are linked to the coordinates indicated by d-a1.
[0085]
A feature amount in the vicinity of a certain feature amount (a feature amount similar to a certain feature amount) is represented by the values of axes x, y, and z in each feature amount space, as indicated by d-a2 in FIG. On the other hand, it is defined as an area that allows a certain range of fluctuation width. The feature quantity output from the feature
[0086]
Therefore, in the processing of steps S65 to S72, as described above, pixels belonging to the feature quantity obtained when any u-bit data is inverted (inverted to 1 if 0, inverted to 0 if 1). The bit to be inverted until the motion vector M is generated from the minimum pixel and the pixel position information of the target pixel by obtaining the distance between the target pixel and the target pixel, and the magnitude of the motion vector M is less than the maximum value M_Max The process is repeated while increasing the number u. That is, the process of obtaining a pixel having the minimum distance from the target pixel is repeated while gradually increasing the Hamming distance from the quantization code indicating the feature amount of the target pixel.
[0087]
In this case, since the calculation contents are only address reference, difference calculation, and branching, the calculation amount does not increase significantly.
[0088]
As a pixel value, for example, when 1 pixel = 8 bits, an image such as computer graphics (CG) can be matched with full-bit (8-bit) information, but in the case of a natural image, it varies from frame to frame. Therefore, it is desirable to perform the matching process by excluding predetermined bits from the plurality of bits. Specifically, the lower few bits may be masked and used, or the number of bits may be reduced and requantized. In other words, it is desirable to reduce the number of bits in nonlinear / linear quantization (reduce the number of quantization bits).
[0089]
Next, details of the feature
[0090]
FIG. 10 is a block diagram illustrating a configuration example of the feature
[0091]
The class
[0092]
In other words, the tap table 51a is arranged as a class tap pattern at the outermost peripheral position of a block of 3 pixels × 3 pixels centering on the pixel of interest (pixels displayed with black circles in the figure) as shown in FIG. Pattern consisting of 8 pixels (pixels filled with diagonal lines in the figure) and 5 pixels × 5 pixels centered on the pixel of interest (pixels displayed with black circles in the figure) as shown in FIG. A pattern of 16 pixels (pixels filled with diagonal lines in the figure) arranged at the outermost peripheral position of the block, or a pixel of interest (pixels displayed with black circles in the figure) as shown in FIG. A pattern of 24 pixels (pixels filled with diagonal lines in the figure) arranged at the outermost peripheral position of a block of 7 pixels × 7 pixels, and a pixel of interest (an image displayed with a black circle in the figure), although not shown. ) Stores 4 (n-1) pixel (pixel are filled in the drawing hatching) pattern disposed on the outermost peripheral position of the block of n pixels × n pixels centered on.
[0093]
Further, the class tap pattern may be four pixels including one pixel above, below, left, and right of the target pixel as shown in FIG. 14, or from two pixels above, below, left, and right of the target pixel as shown in FIG. As shown in FIG. 16, it may be 12 pixels consisting of 3 pixels above, below, left, and right of the target pixel. Further, although not shown, It may be a 4 m pixel consisting of pixels. Furthermore, the class tap may have a configuration other than that illustrated, for example, an arrangement in which the positional relationship with the target pixel is asymmetric.
[0094]
Based on the instruction information from the DR (dynamic range)
[0095]
That is, as shown in FIG. 11 to FIG. 13, the class tap pattern is changed (the 4 (n−1) pixels arranged at the outermost peripheral position of the block of n pixels × n pixels centered on the target pixel. Pattern) is stored in the tap table 51a together with the sequential rank, the class
[0096]
The DR (dynamic range)
DR = Max−Min + 1 (2)
[0097]
Here, Max is the maximum value of the pixel value level which is class tap information, and Min is the minimum value of the pixel value level of the class tap. Here, 1 is added in order to define a class (for example, when a class indicated by 0, 1 is set, the difference between the two is 1, but the class is 2 classes. 1 is added to the difference). Therefore, in the case of FIG. 17, the
[0098]
Thus, since the
[0099]
The ADRC
Q = Round ((L−Min + 0.5) × (2 ^ n) / DR) (3)
[0100]
Here, Round indicates truncation, L indicates the pixel value level, n indicates the number of assigned bits, and (2 ^ n) indicates 2 to the nth power.
[0101]
Therefore, for example, when the number of assigned bits n is 1, the pixel value level of each class tap is 1 if it is greater than or equal to the threshold th shown in the following equation (4), and 0 if it is smaller than the threshold th. Is done.
th = DR / 2−0.5 + Min (4)
[0102]
As a result, when the number of assigned bits n is 1, and when a class tap as shown in FIG. 17 is obtained, the threshold th is 75.5 (= 50 / 2−0.5 + 51), so the ADRC code Becomes ADRC (C1, C2, C3, C4) = 0101.
[0103]
Here, the description returns to the configuration of the feature
[0104]
The
[0105]
In other words, the same ADRC code may be generated even if the ADRC code is a different DR depending on the class tap. In this case, the smaller the DR, the more easily affected by the error, and the ADRC code is likely to change from frame to frame.
[0106]
More specifically, for example, as shown in FIG. 18, the pixel value level (C1, C2, C3, C4) = (74, 80, 65.5, 85.5) is obtained by the class tap shown in FIG. think of. In FIG. 18, pixel value levels (C1, C2, C3, C4) = (74, 80, 65.5, 85.5) are indicated by crosses. Alternatively, the black circles in the figure indicate the example shown in FIG. 17 as it is, and the dynamic range is indicated by DR1 (= 50).
[0107]
At this time, in FIG. 18, DR2, which is the dynamic range of the class tap indicated by a cross, is 20, and the minimum value is 65.5, so the threshold value is 75.5, and the generated ADRC code is , 0101, and the same ADRC code as that shown in FIG. 17 is generated.
[0108]
Incidentally, it is known that a certain level of error occurs in each pixel value level. For example, in FIG. 18, the range of errors occurring in each data is indicated by vertical bars in the figure. Here, since the data of the cross-tapped class tap C1 includes a threshold value in the error range, it may be larger than the threshold value th depending on the degree of error, and the code of the class tap may be inverted. There is sex.
[0109]
When such a phenomenon occurs in the class tap corresponding to the pixel that is the start point or end point of the motion vector, as a result, the ADRC code originally set as the start point or end point of the motion vector changes, There is a possibility that an accurate motion vector cannot be generated. In addition, if the DR is small, each pixel value level of the class tap has a small degree of dispersion.Therefore, there is a possibility that many pixels existing near the threshold are included, and each error is different. There is a possibility that the code of a plurality of bits is inverted when the range crosses the threshold.
[0110]
From the above, the larger the DR, the smaller the ADRC code error, and the smaller the DR, the larger the ADRC code error.
[0111]
Therefore, when the dynamic range DR is smaller than the dynamic range threshold DR_th, the class tap pattern is changed, for example, from the
[0112]
Next, the feature amount calculation process will be described with reference to the flowchart of FIG.
[0113]
In step S91, the class
[0114]
In step S92, the class
[0115]
In step S93, the
[0116]
In step S94, the
[0117]
In step S97, the class
[0118]
In this way, the processes of steps S92 to S97 are repeated until DR exceeds the predetermined threshold value DR_th.
[0119]
In step S94, when it is determined that the DR input from the
[0120]
As described above, considering the error included in the pixel value level detected as a class tap, the ADRC code is expanded by expanding the range for extracting the class tap until a dynamic range of a predetermined size or more is secured. Errors such as noise generated during generation can be suppressed, and more accurate motion vectors can be detected.
[0121]
In the above, an example has been described in which the DR is increased by changing the class tap pattern for the pixel of interest, and as a result, a correct motion vector can be detected, but the class tap pattern can be changed. Alternatively, the image may be reduced.
[0122]
FIG. 20 shows a configuration of the feature
[0123]
In FIG. 20, portions corresponding to those in FIG. 10 are denoted by the same reference numerals, and description thereof will be omitted below as appropriate.
[0124]
20 is different from the feature
[0125]
The
[0126]
The class
[0127]
The
[0128]
Next, the feature amount calculation processing of FIG. 20 will be described with reference to the flowchart of FIG. Note that the processing of steps S113 to S116 in the flowchart of FIG. 21 is the same as the processing of steps S92 to S95 in the flowchart of FIG.
[0129]
In step S111, the
[0130]
In step S112, the
[0131]
In step S115, if the
[0132]
In step S118, the
[0133]
That is, for example, as shown in FIG. 22, the pixel of interest (pixels indicated by black circles in the figure) of an image composed of 2L (number of pixels) × 2M (number of pixels) is centered on 3 pixels × 3 pixels. In the case of extracting a class tap consisting of a pattern of 8 pixels (pixels filled with diagonal lines in the figure) arranged at the outermost peripheral position of a block, if the DR is determined to be larger than a predetermined threshold DR_th, 23, the image is reduced to an image of L × M that is ½ times the horizontal and vertical directions (one row and one in the horizontal and vertical directions, respectively). It is composed of a pattern of 8 pixels (pixels filled with grid lines in FIG. 23) arranged at the outermost peripheral position of a block of 3 pixels × 3 pixels centered on the target pixel. Extract class taps. By processing in this way, the class tap of the reduced image shown in FIG. 23 is the distance of two pixels with respect to the horizontal direction and the vertical direction of the target pixel of the image before reduction as shown in FIG. The pixels existing in (a pixel filled with a grid line in FIG. 22) are selected as class taps.
[0134]
In this way, by reducing the image and extracting class taps having the same pattern, the class tap pattern is changed so that it substantially spreads spatially from the position of the pixel of interest in the original image. Therefore, the same effect as that of the feature
[0135]
Further, in the above, an example has been described in which the pattern is switched so that the class taps are spatially expanded so that the DR becomes equal to or greater than a predetermined threshold DR_th. For example, when the DR is small, the class tap is extracted as a class tap. The ADRC code may be accurately expressed by changing the bit length representing the pixel value level of each pixel.
[0136]
FIG. 24 is a block diagram illustrating a configuration example of the feature
[0137]
In FIG. 24, portions corresponding to those in FIG. 10 or FIG. 20 are denoted by the same reference numerals, and description thereof will be omitted below as appropriate. 24 differs from the feature
[0138]
The used bit
[0139]
The ADRC
[0140]
Here, a method of accurately expressing the ADRC code (quantization code) by changing the bit length indicating each pixel value level of the class tap will be described.
[0141]
For example, when the pixel value level of each pixel extracted from the class tap is expressed by the upper 2 bits by the class
[0142]
However, when the dynamic range DR_S becomes small like the class taps C1 to C2 having a tendency similar to that in FIG. 25, for example, as shown in FIG. 26, the class taps C1 to C4 are in the same range (
[0143]
Therefore, in such a case, if the pixel value level expression method is expressed by 2 bits or more, a different pixel value level can be expressed for each pixel. It is also possible to make a difference in the code indicating the value level.
[0144]
In summary, the bit length expressing the pixel value level may be selected so that the resolution of the dynamic range DR / 2 of the actual pixel value level can be expressed. Therefore, for example, when the dynamic range of the pixel value level can be expressed by 8 bits, as shown in FIG. 27, when the required resolution (= DR / 2) is 128, the used bit length may be 1 bit or more. When the required resolution is 64, the used bit length may be 2 bits or more. When the required resolution is 32, the used bit length may be 3 bits or more. When the required resolution is 16, The bit length may be 4 bits or more. When the required resolution is 8, the used bit length may be 5 bits or more. When the required resolution is 4, the used bit length may be 6 bits or more. When the required resolution is 2, the used bit length may be 7 bits or more, and when the required resolution is 1, the used bit length may be 8 bits or more.
[0145]
In other words, as shown in FIG. 28, when DR is 265 with respect to the dynamic range DR, the used bit length may be 1 bit or more, and when DR is 128, the used bit length is 2 bits. When the DR is 64, the used bit length may be 3 bits or more. When the DR is 32, the used bit length may be 4 bits or more. When the DR is 16. The used bit length may be 5 bits or more. When DR is 8, the used bit length may be 6 bits or more. When DR is 4, the used bit length may be 7 bits or more. When DR is 2, the used bit length may be 8 bits or more.
[0146]
The table 81a of the used bit
[0147]
Next, referring to the flowchart of FIG. 29, a process of extracting a feature amount corresponding to the target pixel by adjusting the bit length (a process of generating an ADRC code based on a plus tap corresponding to the target pixel). explain. In the flowchart of FIG. 29, the processing of steps S131 and S132 is the same as the processing of steps S113 and S114 in the flowchart of FIG.
[0148]
In step S133, the used bit
[0149]
In step S134, the ADRC
[0150]
According to the above, by changing the bit length of the data indicating the pixel value level extracted as the class tap corresponding to the DR, when the dynamic range is small, the bit length expressing the pixel value level is lengthened. Thus, the code for each pixel can be expressed with a difference, and as a result, an accurate ADRC code can be generated. In addition, when the dynamic range is large, the bit length can be prevented from becoming too long, so that it is possible to absorb the change in the pixel value level in units of frames and suppress the influence of noise.
[0151]
In addition, as shown in FIG. 4, the
[0152]
In the above, the case where an ADRC code is generated as a quantization code that expresses a feature amount has been described. However, the quantization code that expresses a feature amount is not limited to the ADRC code, and corresponds to, for example, a target pixel. The dynamic range DR obtained from the class tap, the minimum value Min, the Laplacian, the Sobel operator, the pixel value of the center pixel of the class tap, or the average or sum of the N pixel values near the target pixel may be used. .
[0153]
According to the above, an appropriate quantization code can be generated by adaptively changing the DR or the bit length based on the magnitude of the DR of the class tap corresponding to the target pixel. The motion vector can be accurately obtained.
[0154]
The series of processes described above can be executed by hardware, but can also be executed by software. When a series of processes 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.
[0155]
FIG. 31 shows a configuration of an embodiment of a personal computer when the
[0156]
As shown in FIG. 31, the recording medium on which the program is recorded is distributed to provide the program to the user separately from the computer, and the magnetic disk 211 (including the flexible disk) on which the program is recorded, An optical disk 212 (comprising a compact disc-read only memory (CDROM), a DVD (digital versatile disc)), a magneto-optical disk 213 (including an MD (mini-disc)), or a package medium composed of a
[0157]
In this specification, the step of describing the program recorded on the recording medium is not limited to the processing performed in time series in the order described, but of course, it is not necessarily performed in time series. Or the process performed separately is included.
[0158]
【The invention's effect】
According to the present invention, an appropriate quantization code can be generated, so that a motion vector can be accurately obtained.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of a conventional motion detection unit.
FIG. 2 is a diagram for explaining a motion vector detection method;
FIG. 3 is a flowchart for explaining motion detection processing by a motion detection unit in FIG. 1;
FIG. 4 is a block diagram illustrating a configuration of an embodiment of a motion detection unit to which the present invention is applied.
FIG. 5 is a diagram for explaining the structure of the database of FIG. 4;
6 is a flowchart for describing reference frame information generation processing by the motion detection unit in FIG. 4;
7 is a flowchart for explaining motion vector detection processing by the motion detection unit in FIG. 4;
FIG. 8 is a flowchart for explaining motion vector detection processing by the motion detection unit of FIG. 4;
FIG. 9 is a diagram illustrating a feature amount in the vicinity of a feature amount of a target pixel.
FIG. 10 is a block diagram illustrating a configuration of an embodiment of a feature amount extraction unit to which the present invention is applied.
FIG. 11 is a diagram illustrating class taps.
FIG. 12 is a diagram illustrating class taps.
FIG. 13 is a diagram illustrating class taps.
FIG. 14 is a diagram illustrating class taps.
FIG. 15 is a diagram illustrating class taps.
FIG. 16 is a diagram illustrating class taps.
FIG. 17 is a diagram illustrating an ADRC code.
FIG. 18 is a diagram illustrating an example of an error that occurs when DR is small.
FIG. 19 is a flowchart for describing feature amount calculation processing by a feature amount extraction unit illustrated in FIG. 10;
FIG. 20 is a block diagram illustrating a configuration of another embodiment of a feature amount extraction unit to which the present invention is applied.
FIG. 21 is a flowchart for describing feature amount calculation processing by a feature amount extraction unit illustrated in FIG. 20;
FIG. 22 is a diagram illustrating a process of extracting a class tap by reducing an image.
FIG. 23 is a diagram illustrating processing for reducing class taps by reducing an image.
FIG. 24 is a block diagram illustrating a configuration of another embodiment of a feature amount extraction unit to which the present invention is applied.
FIG. 25 is a diagram for describing processing for changing the used bit length in accordance with DR;
FIG. 26 is a diagram for describing processing for changing the used bit length in accordance with DR.
FIG. 27 is a diagram for explaining a relationship between required resolution and used bit length;
FIG. 28 is a diagram illustrating a relationship between a dynamic range and a used bit length.
FIG. 29 is a flowchart for describing feature amount calculation processing by a feature amount extraction unit illustrated in FIG. 24;
FIG. 30 is a block diagram illustrating a configuration of another embodiment of a motion detection unit to which the present invention is applied.
FIG. 31 is a diagram illustrating a medium.
[Explanation of symbols]
31 frame memory, 32 feature extraction unit, 33 buffer memory, 34 database control unit, 35 motion vector detection unit, 41 database, 51 class tap extraction unit, 51a tap table, 52 DR calculation unit, 53 ADRC code generation unit, 54 DR determination unit, 71 image reduction unit, 72 class tap extraction unit, 73 DR determination unit, 81 used bit length determination unit, 81a table, 82 ADRC code generation unit
Claims (6)
前記クラスタップのダイナミックレンジを検出するダイナミックレンジ検出手段と、
前記ダイナミックレンジに基づいて、前記ダイナミックレンジが大きいときにはビット長を小さくし、前記ダイナミックレンジが小さいときにはビット長を大きくするように、前記クラスタップのビット長を決定するビット長決定手段と、
前記ビット長決定手段により決定された前記ビット長で表現された前記クラスタップの画素値レベルから、特徴量としての量子化コードを生成する量子化コード生成手段と、
前記第1のフレームの全ての画素を前記注目画素として、前記量子化コード生成手段により生成された前記特徴量と、前記特徴量に対応する前記第1のフレームの各画素位置の情報を記憶する記憶手段と、
前記第1のフレームとは異なる第2のフレーム中の注目画素について、前記量子化コード生成手段により生成された特徴量に対応する、前記第1のフレームの画素位置の情報を、前記記憶手段より読み出す読出し手段と、
前記読出し手段により読み出された前記第1のフレームの画素位置の情報のうち、前記第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、前記第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出する動きベクトル検出手段と
を備えることを特徴とする画像処理装置。Class tap extraction means for extracting pixel values of 4m (m ≧ 1) peripheral pixels corresponding to the target pixel among the pixels of the first frame in the input image as class taps;
Dynamic range detecting means for detecting the dynamic range of the class tap;
Based on the dynamic range, a bit length determining means for determining the bit length of the class tap so as to reduce the bit length when the dynamic range is large and to increase the bit length when the dynamic range is small;
Quantization code generation means for generating a quantization code as a feature quantity from the pixel value level of the class tap expressed by the bit length determined by the bit length determination means;
Using all the pixels of the first frame as the target pixel, the feature amount generated by the quantization code generation unit and information on each pixel position of the first frame corresponding to the feature amount are stored. Storage means;
For the pixel of interest in a second frame different from the first frame, information on the pixel position of the first frame corresponding to the feature quantity generated by the quantization code generation unit is stored in the storage unit. Reading means for reading; and
Of the information on the pixel position of the first frame read by the reading means, the pixel position of the pixel having the smallest distance from the target pixel in the second frame is used as the starting point, and the second frame An image processing apparatus comprising: a motion vector detecting unit that detects a motion vector whose end point is the pixel position of a target pixel in the center.
ことを特徴とする請求項1に記載の画像処理装置。The bit length determining means includes a table storing bit length information associated with the dynamic range so that the bit length is reduced when the dynamic range is large and the bit length is increased when the dynamic range is small. The image processing apparatus according to claim 1, wherein bit length information is read from the table based on the dynamic range and the bit length of the class tap is determined.
前記動きベクトル比較手段の比較結果が、前記所定の動きベクトルの大きさよりも、前記動きベクトル検出手段により検出された前記動きベクトルの大きさの方が大きい場合、前記読出し手段は、前記第2のフレーム中の注目画素の量子化コードに類似する量子化コードに対応する前記第1のフレームの画素位置の情報を、前記記憶手段より読み出し、
前記動きベクトル検出手段は、前記読出し手段により読み出された、前記第2のフレーム中の注目画素の量子化コードに類似する量子化コードに対応する前記第1のフレームの画素位置の情報のうち、前記第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、前記第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出する
ことを特徴とする請求項1に記載の画像処理装置。Motion vector comparison means for comparing the magnitude of the motion vector detected by the motion vector detection means with the magnitude of a predetermined motion vector;
When the comparison result of the motion vector comparison means is greater in magnitude of the motion vector detected by the motion vector detection means than the magnitude of the predetermined motion vector, the reading means Read the pixel position information of the first frame corresponding to the quantization code similar to the quantization code of the pixel of interest in the frame from the storage means,
The motion vector detection means includes the pixel position information of the first frame corresponding to the quantization code similar to the quantization code of the pixel of interest in the second frame read by the reading means. Detecting a motion vector starting from the pixel position of the pixel having the smallest distance from the target pixel in the second frame and ending at the pixel position of the target pixel in the second frame. The image processing apparatus according to claim 1.
前記クラスタップのダイナミックレンジを検出するダイナミックレンジ検出ステップと、
前記ダイナミックレンジに基づいて、前記ダイナミックレンジが大きいときにはビット長を小さくし、前記ダイナミックレンジが小さいときにはビット長を大きくするように、前記クラスタップのビット長を決定するビット長決定ステップと、
前記ビット長決定ステップの処理で決定された前記ビット長で表現された前記クラスタップの画素値レベルから、特徴量としての量子化コードを生成する量子化コード生成ステップと、
前記第1のフレームの全ての画素を前記注目画素として、前記量子化コード生成ステップの処理で生成された前記特徴量と、前記特徴量に対応する前記第1のフレームの各画素位置の情報を記憶する記憶ステップと、
前記第1のフレームとは異なる第2のフレーム中の注目画素について、前記量子化コード生成ステップの処理で生成された特徴量に対応する、前記第1のフレームの画素位置の情報を読み出す読出しステップと、
前記読出しステップの処理で読み出された前記第1のフレームの画素位置の情報のうち、前記第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、前記第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出する動きベクトル検出ステップと
を含むことを特徴とする画像処理方法。A class tap extraction step of extracting pixel values of 4m (m ≧ 1) peripheral pixels corresponding to the target pixel among the pixels of the first frame in the input image as class taps;
A dynamic range detecting step for detecting a dynamic range of the class tap;
Based on the dynamic range, a bit length determination step of determining the bit length of the class tap so as to reduce the bit length when the dynamic range is large and to increase the bit length when the dynamic range is small;
A quantization code generation step for generating a quantization code as a feature quantity from the pixel value level of the class tap expressed by the bit length determined in the processing of the bit length determination step;
Using all the pixels of the first frame as the target pixel, the feature amount generated by the process of the quantization code generation step, and information on each pixel position of the first frame corresponding to the feature amount A storage step for storing;
A step of reading out information on a pixel position of the first frame corresponding to a feature amount generated by the process of the quantization code generation step for a target pixel in a second frame different from the first frame When,
Of the information on the pixel position of the first frame read in the process of the reading step, the pixel position of the pixel having the smallest distance from the target pixel in the second frame is used as the starting point, and And a motion vector detecting step of detecting a motion vector whose end point is the pixel position of the target pixel in the frame.
前記クラスタップのダイナミックレンジを検出するダイナミックレンジ検出ステップと、
前記ダイナミックレンジに基づいて、前記ダイナミックレンジが大きいときにはビット長を小さくし、前記ダイナミックレンジが小さいときにはビット長を大きくするように、前記クラスタップのビット長を決定するビット長決定ステップと、
前記ビット長決定ステップの処理で決定された前記ビット長で表現された前記クラスタップの画素値レベルから、特徴量としての量子化コードを生成する量子化コード生成ステップと、
前記第1のフレームの全ての画素を前記注目画素として、前記量子化コード生成ステップの処理で生成された前記特徴量と、前記特徴量に対応する前記第1のフレームの各画素位置の情報を記憶する記憶ステップと、
前記第1のフレームとは異なる第2のフレーム中の注目画素について、前記量子化コード生成ステップの処理で生成された特徴量に対応する、前記第1のフレームの画素位置の情報を読み出す読出しステップと、
前記読出しステップの処理で読み出された前記第1のフレームの画素位置の情報のうち、前記第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、前記第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出する動きベクトル検出ステップと
を含むことを特徴とするコンピュータが読み取り可能なプログラムが記録されている記録媒体。A class tap extraction step of extracting pixel values of 4m (m ≧ 1) peripheral pixels corresponding to the target pixel among the pixels of the first frame in the input image as class taps;
A dynamic range detecting step for detecting a dynamic range of the class tap;
Based on the dynamic range, a bit length determination step of determining the bit length of the class tap so as to reduce the bit length when the dynamic range is large and to increase the bit length when the dynamic range is small;
A quantization code generation step for generating a quantization code as a feature quantity from the pixel value level of the class tap expressed by the bit length determined in the processing of the bit length determination step;
Using all the pixels of the first frame as the target pixel, the feature amount generated by the process of the quantization code generation step, and information on each pixel position of the first frame corresponding to the feature amount A storage step for storing;
A step of reading out information on a pixel position of the first frame corresponding to a feature amount generated by the process of the quantization code generation step for a target pixel in a second frame different from the first frame When,
Of the information on the pixel position of the first frame read in the process of the reading step, the pixel position of the pixel having the smallest distance from the target pixel in the second frame is set as the starting point, and the second And a motion vector detecting step for detecting a motion vector whose end point is the pixel position of the pixel of interest in the frame. A recording medium on which a computer-readable program is recorded.
前記クラスタップのダイナミックレンジを検出するダイナミックレンジ検出ステップと、
前記ダイナミックレンジに基づいて、前記ダイナミックレンジが大きいときにはビット長を小さくし、前記ダイナミックレンジが小さいときにはビット長を大きくするように、前記クラスタップのビット長を決定するビット長決定ステップと、
前記ビット長決定ステップの処理で決定された前記ビット長で表現された前記クラスタップの画素値レベルから、特徴量としての量子化コードを生成する量子化コード生成ステップと、
前記第1のフレームの全ての画素を前記注目画素として、前記量子化コード生成ステップの処理で生成された前記特徴量と、前記特徴量に対応する前記第1のフレームの各画素位置の情報を記憶する記憶ステップと、
前記第1のフレームとは異なる第2のフレーム中の注目画素について、前記量子化コード生成ステップの処理で生成された特徴量に対応する、前記第1のフレームの画素位置の情報を読み出す読出しステップと、
前記読出しステップの処理で読み出された前記第1のフレームの画素位置の情報のうち、前記第2のフレーム中の注目画素との距離が最小となる画素の画素位置を始点とし、前記第2のフレーム中の注目画素の画素位置を終点とする動きベクトルを検出する動きベクトル検出ステップと
を含む処理をコンピュータに実行させることを特徴とするプログラム。A class tap extraction step of extracting pixel values of 4m (m ≧ 1) peripheral pixels corresponding to the target pixel among the pixels of the first frame in the input image as class taps;
A dynamic range detecting step for detecting a dynamic range of the class tap;
Based on the dynamic range, a bit length determination step of determining the bit length of the class tap so as to reduce the bit length when the dynamic range is large and to increase the bit length when the dynamic range is small;
A quantization code generation step for generating a quantization code as a feature quantity from the pixel value level of the class tap expressed by the bit length determined in the processing of the bit length determination step;
Using all the pixels of the first frame as the target pixel, the feature amount generated by the process of the quantization code generation step, and information on each pixel position of the first frame corresponding to the feature amount A storage step for storing;
A step of reading out information on a pixel position of the first frame corresponding to a feature amount generated by the process of the quantization code generation step for a target pixel in a second frame different from the first frame When,
Of the information on the pixel position of the first frame read in the process of the reading step, the pixel position of the pixel having the smallest distance from the target pixel in the second frame is set as the starting point, and the second And a motion vector detecting step of detecting a motion vector whose end point is the pixel position of the pixel of interest in the frame.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002296675A JP4193460B2 (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 |
---|---|---|---|
JP2002296675A JP4193460B2 (en) | 2002-10-09 | 2002-10-09 | Image processing apparatus and method, recording medium, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004134990A JP2004134990A (en) | 2004-04-30 |
JP4193460B2 true JP4193460B2 (en) | 2008-12-10 |
Family
ID=32286585
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002296675A Expired - Fee Related JP4193460B2 (en) | 2002-10-09 | 2002-10-09 | Image processing apparatus and method, recording medium, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4193460B2 (en) |
-
2002
- 2002-10-09 JP JP2002296675A patent/JP4193460B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2004134990A (en) | 2004-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11250591B2 (en) | Target detection method, system, and non-volatile storage medium | |
JP4265237B2 (en) | Image processing apparatus and method, learning apparatus and method, recording medium, and program | |
KR101152576B1 (en) | Selecting encoding types and predictive modes for encoding video data | |
US5047842A (en) | Color image display with a limited palette size | |
US20190222862A1 (en) | Encoding apparatus and method, and decoding apparatus and method | |
US9053387B2 (en) | Image processing circuit and image detection device | |
CN109977952B (en) | Candidate target detection method based on local maximum | |
US8391626B2 (en) | Learning of coefficients for motion deblurring by pixel classification and constraint condition weight computation | |
CN105828081B (en) | encoding method and encoding device | |
KR20010007300A (en) | Data processing apparatus, data processing method, learning apparatus, learning method, and medium | |
US5838833A (en) | Fractal image compression method and device and fractal image restoration method and device | |
US6404924B1 (en) | Image processing apparatus and method | |
JP4224876B2 (en) | Storage device, writing method and reading method | |
CN110428473B (en) | Color image graying method of confrontation generation network based on auxiliary variable | |
JP2001076161A (en) | Method and device for image processing and storage medium | |
JP4193460B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4175073B2 (en) | Image processing apparatus and method, recording medium, and program | |
CN104969258A (en) | Interpolation method and corresponding device | |
CN102081789A (en) | Image processing apparatus and image processing method | |
US10713753B2 (en) | Data processing systems | |
JP4239556B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP2863072B2 (en) | Image gradation conversion method and image processing device | |
US6993077B2 (en) | Experimental design for motion estimation | |
JP4264531B2 (en) | Image processing apparatus and method, recording medium, and program | |
CN111862084A (en) | Image quality evaluation method and device based on complex network 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: 20080325 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080521 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080612 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080811 |
|
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: 20080902 |
|
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: 20080915 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111003 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121003 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131003 Year of fee payment: 5 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |