JP2004134912A - Data processing apparatus and method, recording medium, and program - Google Patents

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

Info

Publication number
JP2004134912A
JP2004134912A JP2002295592A JP2002295592A JP2004134912A JP 2004134912 A JP2004134912 A JP 2004134912A JP 2002295592 A JP2002295592 A JP 2002295592A JP 2002295592 A JP2002295592 A JP 2002295592A JP 2004134912 A JP2004134912 A JP 2004134912A
Authority
JP
Japan
Prior art keywords
data
class code
processing
setting
calculating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2002295592A
Other languages
Japanese (ja)
Other versions
JP4144316B2 (en
Inventor
Tetsujiro Kondo
近藤 哲二郎
Yasushi Tatsuhira
立平 靖
Junichi Ishibashi
石橋 淳一
Seiji Wada
和田 成司
Yasuhiro Shudo
周藤 泰広
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 JP2002295592A priority Critical patent/JP4144316B2/en
Publication of JP2004134912A publication Critical patent/JP2004134912A/en
Application granted granted Critical
Publication of JP4144316B2 publication Critical patent/JP4144316B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technology capable of matching images only with a very small computation complexity and detecting a motion vector or the like with high accuracy. <P>SOLUTION: In the case that pixel values P1 to P9 of 9 pixels included in a class code tap is in a state shown in the figure, the pixel values P6 and P8 closest to a threshold value Th are excluded from the class code tap, and the remaining pixel values P1, P2, P3, P4, P5, P7, P9 are respectively compared with the threshold value Th and quantized into 0 or 1 resulting in that a 7-bit class code 1010011 is produced. The technology above is applicable to encoders for applying compression encoding to moving picture signals. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、データ処理装置および方法、記録媒体、並びにプログラムに関し、例えば、連続する画像上の画素同士をマッチングさせ、マッチングの結果に基づいて動きベクトルを検出する場合に用いて好適なデータ処理装置および方法、記録媒体、並びにプログラムに関する。
【0002】
【従来の技術】
例えば、MPEG2(Moving Picture Experts Group)方式等の画像信号を圧縮符号化する処理においては、隣接するフレーム間の相関関係に基づく符号化処理、いわゆる動き補償フレーム間予測が用いられている。動き補償フレーム間予測では、隣接するフレーム間(一方を現フレーム、他方を参照フレームと記述する)における各画素単位または所定サイズの画素ブロック単位の動きベクトルを検出する処理が必要となる。
【0003】
動きベクトルを検出する方法としては、従来、ブロックマッチングアルゴリズムと称される方法が用いられている(例えば、特許文献1参照)。
【0004】
図1は、ブロックマッチングアルゴリズムに従って動きベクトルを検出する動きベクトル検出装置の構成例を示している。この動きベクトル検出装置1は、入力される画像信号を1フレーム分だけ保持して後段に出力するフレームメモリ2,3、およびフレームメモリ2,3から入力される2フレームの画像信号に基づき、フレームメモリ2から入力される画像信号の画像内の動きベクトルを検出する検出部4から構成される。
【0005】
フレームメモリ2は、入力された画像信号を1フレーム分だけ保持し、次のフレームの画像信号が入力されたとき、保持していた画像信号をフレームメモリ3および検出部4に出力する。フレームメモリ3は、フレームメモリ2から入力された画像信号を1フレーム分だけ保持し、次のフレームの画像信号が入力されたとき、保持していた画像信号を検出部4に出力する。
【0006】
したがって、検出部4には、前後する2フレームの画像信号が入力されることになる。以下、フレームメモリ2から検出部4に入力された1フレーム分の画像信号の画像を、対象フレームFcと記述する。また、フレームメモリ3から検出部4に入力された、対象フレームFcよりも1フレーム前の画像信号の画像を、参照フレームFrと記述する。
【0007】
検出部4は、ブロックマッチングアルゴリズムに従い、対象フレームFc内の動きベクトルを算出する。ブロックマッチングアルゴリズムについて、図2に示す対象フレームFcと参照フレームFrの対応図および図3に示すフローチャートを参照して説明する。
【0008】
ブロックマッチングアルゴリズムでは、対象フレームFc内の全ての画素が、順次、注目画素に設定され、注目画素を中心とする所定サイズ(L×L画素)の基準ブロックと、参照フレームFrのサーチエリアSR内で移動される参照ブロック(基準ブロックと同じサイズ)との対応する画素対の画素値の差分絶対値和が次式(1)に従って演算される。
ΣΣ=|Fc(i,j)−Frn(i,j)|       ・・・(1)
【0009】
ただし、Fc(i,j)は基準ブロックの画素の画素値であり、Frn(i,j)は識別番号nの参照ブロックの画素の画素値であり、Σは、iを1からLまで1ずつインクリメントしたときの総和演算、Σは、jを1からLまで1ずつインクリメントしたときの総和演算を意味するものとする。
【0010】
そして、基準ブロックと参照ブロックとの対応する画素対の画素値の差分絶対値和が最小となるときの参照ブロックの中心座標と注目画素の座標との差分ベクトルが動きベクトルとして算出される。
【0011】
具体的には、対象フレームFcの注目画素に対して、以下の処理が実行される。ステップS1において、検出部4は、参照フレームFcに、対象フレームFcの注目画素の座標(x,y)と同じ座標を中心として、基準ブロックよりも大きなサイズのサーチエリアSRを設定する。
【0012】
ステップS2において、検出部4は、差分絶対値和の最小値を格納する変数minを、その最大値に初期化する。例えば、1画素の画素値が8ビット、基準ブロックのサイズが4×4画素である場合、変数minが、4096(=2×16)に初期化される。
【0013】
ステップS3において、検出部4は、サーチエリアSR内で移動させる参照ブロックの識別番号nを1に初期化する。ステップS4において、検出部4は、差分絶対値和の演算結果を格納する変数sumを0に初期化する。
【0014】
ステップS5において、検出部4は、対象フレームFcの基準ブロックと、参照フレームFrに設定したサーチエリアSR内の識別番号nの参照ブロックとの同じ場所に位置する画素対の画素の差分絶対値和を演算して、変数sumに代入する。ステップS6において、検出部4は、ステップS5の演算結果である変数sumと変数minを比較し、変数sumが変数minよりも小さいか否かを判定する。変数sumが変数minよりも小さいと判定された場合、処理はステップS7に進む。
【0015】
ステップS7において、検出部4は、変数minを、変数sumで置換する。また、検出部4は、いまの参照ブロックの識別番号nを、動きベクトル番号として記憶する。
【0016】
ステップS8において、検出部4は、参照ブロックの識別番号nが最大値であるか否か、すなわち、サーチエリアSRの全域に参照ブロックを移動し終えたか否かを判定する。参照ブロックの識別番号nが最大値ではないと判定された場合、処理はステップS9に進む。ステップS9において、検出部4は、参照ブロックの識別番号nを1だけインクリメントし、ステップS4の処理に戻って、それ以降の処理を繰り返す。
【0017】
なお、ステップS6において、変数sumが変数minよりも小さくないと判定された場合、処理はステップS7の処理はスキップされる。
【0018】
その後、ステップS8において、参照ブロックの識別番号nが最大値ではないと判定された場合、すなわち、サーチエリアSRの全域に参照ブロックを移動し終えた場合、処理はステップS10に進む。
【0019】
ステップS10において、検出部4は、動きベクトル番号として記憶している識別番号nに対応する参照ブロックの中心座標と、対象フレームFcの注目画素の座標(x,y)との差分ベクトルを、対象フレームFcの注目画素の動きベクトルとして算出する。以上で、ブロックマッチングアルゴリズムの説明を終了する。
【0020】
【特許文献1】
特許第3277417号公報
【0021】
【発明が解決しようとする課題】
上述したブロックマッチングアルゴリズムは、ステップS5における画素対の画素の差分絶対値和の演算量が非常に膨大となっており、画像圧縮処理の大半の時間がこの演算に費やされてしまうという課題があった。
【0022】
本発明はこのような状況に鑑みてなされたものであり、僅かな演算量のみで画像間のマッチングを行うことができ、しかも動きベクトル等を精度良く検出できるようにすることを目的とする。
【0023】
【課題を解決するための手段】
本発明のデータ処理装置は、入力されたデータに基づいて、注目データを含む所定のサイズのブロックを設定する設定手段と、設定手段によって設定されたブロックに含まれる複数のデータに基づいて閾値を算出する算出手段と、設定手段によって設定されたブロックに含まれる複数のデータのなかから、算出手段によって算出された閾値に基づいて除外データを決定する決定手段と、設定手段によって設定されたブロックに含まれる複数のデータのうち、決定手段によって決定された除外データ以外のデータを、それぞれ、算出手段によって算出された閾値に基づいて0または1に符号化し、注目データに対するクラスコードを生成する生成手段とを含むことを特徴とする。
【0024】
前記算出手段は、設定手段によって設定されたブロックに含まれる複数のデータの最小値に、ブロックに含まれる複数のデータのダイナミックレンジの1/2を加算して、閾値を算出するようにすることができる。
【0025】
前記決定手段は、設定手段によって設定されたブロックに含まれる複数のデータのうち、算出手段によって算出された閾値に近い値を有する所定の数のデータを除外データに決定するようにすることができる。
【0026】
前記決定手段は、設定手段によって設定されたブロックに含まれる複数のデータのうち、算出手段によって算出された閾値を中心とする所定の範囲に属する値を有するデータを除外データに決定するようにすることができる。
【0027】
前記生成手段は、設定手段によって設定されたブロックに含まれる複数のデータのうち、決定手段によって決定された除外データ以外のデータを、それぞれ、算出手段によって算出された閾値に基づいて0または1に符号化し、決定手段によって除外データに決定されたデータを、それぞれ、0および1に符号化して、注目データに対する複数のクラスコードを生成するようにすることができる。
【0028】
前記データは、画像を構成する画素の画素値とすることができる。
【0029】
本発明のデータ処理方法は、入力されたデータに基づいて、注目データを含む所定のサイズのブロックを設定する設定ステップと、設定ステップの処理で設定されたブロックに含まれる複数のデータに基づいて閾値を算出する算出ステップと、設定ステップの処理で設定されたブロックに含まれる複数のデータのなかから、算出ステップの処理で算出された閾値に基づいて除外データを決定する決定ステップと、設定ステップの処理で設定されたブロックに含まれる複数のデータのうち、決定ステップの処理で決定された除外データ以外のデータを、それぞれ、算出ステップの処理で算出された閾値に基づいて0または1に符号化し、注目データに対するクラスコードを生成する生成ステップとを含むことを特徴とする。
【0030】
本発明の記録媒体のプログラムは、入力されたデータに基づいて、注目データを含む所定のサイズのブロックを設定する設定ステップと、設定ステップの処理で設定されたブロックに含まれる複数のデータに基づいて閾値を算出する算出ステップと、設定ステップの処理で設定されたブロックに含まれる複数のデータのなかから、算出ステップの処理で算出された閾値に基づいて除外データを決定する決定ステップと、設定ステップの処理で設定されたブロックに含まれる複数のデータのうち、決定ステップの処理で決定された除外データ以外のデータを、それぞれ、算出ステップの処理で算出された閾値に基づいて0または1に符号化し、注目データに対するクラスコードを生成する生成ステップとを含むことを特徴とする。
【0031】
本発明のプログラムは、入力されたデータに基づいて、注目データを含む所定のサイズのブロックを設定する設定ステップと、設定ステップの処理で設定されたブロックに含まれる複数のデータに基づいて閾値を算出する算出ステップと、設定ステップの処理で設定されたブロックに含まれる複数のデータのなかから、算出ステップの処理で算出された閾値に基づいて除外データを決定する決定ステップと、設定ステップの処理で設定されたブロックに含まれる複数のデータのうち、決定ステップの処理で決定された除外データ以外のデータを、それぞれ、算出ステップの処理で算出された閾値に基づいて0または1に符号化し、注目データに対するクラスコードを生成する生成ステップとを含む処理をコンピュータに実行させることを特徴とする。
【0032】
本発明のデータ処理装置および方法、並びにプログラムにおいては、注目データを含む所定のサイズのブロックが設定され、設定されたブロックに含まれる複数のデータに基づいて閾値が算出され、設定されたブロックに含まれる複数のデータのなかから、算出された閾値に基づいて除外データが決定される。さらに、設定されたブロックに含まれる複数のデータのうち、決定された除外データ以外のデータが、それぞれ、算出された閾値に基づいて0または1に符号化されて注目データに対するクラスコードが生成される。
【0033】
【発明の実施の形態】
本発明を適用した動きベクトル検出装置の構成例について、図4を参照して説明する。この動きベクトル検出装置11は、フレームメモリ12,13、クラスコード生成部14、MEメモリ15、および動きベクトル演算部16から構成される。
【0034】
フレームメモリ12は、入力された画像信号を1フレーム分だけ保持し、次のフレームの画像信号が入力されたとき、保持していた画像信号をフレームメモリ13およびクラスコード生成部14に出力する。フレームメモリ13は、入力された画像信号を1フレーム分だけ保持し、次のフレームの画像信号がフレームメモリ12から入力されたとき、保持していた画像信号をクラスコード生成部14に出力する。
【0035】
従って、フレームメモリ13からクラスコード生成部14に入力される画像信号は、フレームメモリ12からクラスコード生成部14に入力される画像信号の1フレーム前のものとなる。以下、フレームメモリ12からクラスコード生成部14に入力される1フレーム分の画像信号の画像を、対象フレームFcと記述する。また、フレームメモリ13からクラスコード生成部14に入力される、対象フレームFcの1フレーム前の画像信号の画像を、参照フレームFrと記述する。
【0036】
クラスコード生成部14は、対象フレームFcの各画素に対して空間的な特徴を示すクラスコードを生成して、動きベクトル演算部16に出力する。具体的には、対象フレームFcの全ての画素を、順次、注目画素に設定し、注目画素を中心とする所定サイズのクラスコード用タップを決定して、クラスコード用タップに含まれる複数の画素の画素値を、1ビットADRC(Adaptive Dynamic Range Coding:適応的量子化)により、それぞれ0また1に量子化して、所定のビット数のクラスコードを生成する。なお、クラスコードを生成する処理については、図6以降を参照して詳述する。
【0037】
また、クラスコード生成部14は、参照フレームFrの各画素に対して空間的な特徴を示すクラスコードを生成して、MEメモリ15に出力する。ただし、参照フレームFrは、1回前のタイミングにおいて対象フレームFcであったものであるので、そのクラスコードは既に1回前に生成されている。よって、1回前のタイミングにおいて対象フレームFcの各画素に対して生成されたクラスコードを保持するようにして、今回の参照フレームFrの各画素に対するクラスコードとして流用するようにしてもよい。
【0038】
MEメモリ15は、クラスコード生成部14から入力される参照フレームFrの各画素に対するクラスコードを、クラスコードに各画素の座標を対応付けて記憶する。
【0039】
図5は、MEメモリ15の構造を示している。MEメモリ15は、特徴量アドレス0乃至aと、フラグアドレス0乃至bによって示されるa×b個のセルにより構成される。以下、例えば、特徴量アドレス1、フラグアドレス2のセルをセル(1,2)と記述する。
【0040】
特徴量アドレスは、クラスコード生成部14によって生成されるクラスコードに対応する。例えば、クラスコードが7ビットである場合、特徴量アドレスの最大値a=2となり、クラスコードが9ビットである場合、特徴量アドレスの最大値a=2となる。
【0041】
特徴量アドレス0のフラグアドレス1以降のセルには、クラスコード生成部14によってクラスコード0が生成された参照フレームFrの画素の座標がラスタ順に格納される。特徴量アドレス0のフラグアドレス0のセルには、クラスコード0の画素の座標が格納されている、特徴量アドレス0のフラグアドレス1以降のセルの数が格納される。例えば、参照フレームFrの画素のうち、3画素に対してクラスコード0が生成された場合、セル(0,1)、セル(0,2)、セル(0,3)に、3画素それぞれの座標が格納され、セル(0,0)に、3が格納される。
【0042】
特徴量アドレス1のフラグアドレス1以降のセルには、クラスコード生成部14によってクラスコード1が生成された参照フレームFrの画素の座標がラスタ順に格納される。特徴量アドレス1のフラグアドレス0のセルには、クラスコード1の画素の座標が格納されている、特徴量アドレス0のフラグアドレス1以降のセルの数が格納される。例えば、参照フレームFrの画素のうち、10画素に対してクラスコード1が生成された場合、セル(1,1)、・・・、セル(1,10)に、10画素それぞれの座標が格納され、セル(1,0)には、10が格納される。特徴量アドレス2以降のセルについても同様である。
【0043】
図4に戻る。動きベクトル演算部16は、対象フレームFcの各画素について、同じクラスコードを有する参照フレームFrの画素の座標を、MEメモリ15から検索し、検索された画素のうち、注目画素の座標に最も距離が近い座標の画素を、注目画素に対応する画素に決定して、注目画素の動きベクトルを算出する。
【0044】
なお、MEメモリ15の構造、および動きベクトル演算部16の処理の詳細については、本出願人が特願2002−222044号として既に提案済である。
【0045】
次に、本発明の主眼であるクラスコード生成部4による第1のクラスコード生成処理について、図6のフローチャートを参照して説明する。この処理は、対象フレームFcの各画素が、順次、注目画素に設定されて、注目画素に対して実行される。
【0046】
ステップS11において、クラスコード生成部14は、注目画素を中心とする所定サイズのクラスコード用タップを設定し、クラスコード用タップに含まれる複数の画素の画素値を取得する。以下においては、図7に示すように、クラスコード用タップのサイズを3×3画素とし、左上の画素を先頭に右下の画素までの画素値をそれぞれP1乃至P9として説明を継続する。
【0047】
ステップS12において、クラスコード生成部14は、画素値P1乃至P9の最大値PMAXと最小値PMINを判定する。ステップS13において、クラスコード生成部14は、画素値P1乃至P9のダイナミックレンジDR(=|最大値PMAX−最小値PMIN|)を算出する。ステップS14において、クラスコード生成部14は、次式(2)のように、画素値P1乃至P9の最小値PMINに、ダイナミックレンジDR/2を加算して閾値Thを決定する。
Th=PMIN+DR/2                  ・・・(2)
【0048】
ステップS15において、クラスコード生成部14は、画素値P1乃至P9のうち、閾値Thに最も近い所定の個数(例えば、2個)の画素値を除外する。ステップS16において、クラスコード生成部14は、画素値P1乃至P9のうちの残った7画素を、それぞれ閾値Thと比較し、閾値Thよりも大きい場合には1に量子化し、閾値Thよりも小さい場合には0に量子化して、番号順に並べた7ビットを注目画素のクラスコードとして生成する。
【0049】
例えば、クラスコード用タップに含まれる9画素の画素値P1乃至P9が図8に示すような状態である場合、閾値Thに最も近い画素値P6と画素値P8が除外され、7ビットのクラスコード1010011が生成される。
【0050】
また例えば、クラスコード用タップに含まれる9画素の画素値P1乃至P9が図9に示すような状態である場合、閾値Thに最も近い画素値P5と画素値P6が除外され、7ビットのクラスコード1010101が生成される。
【0051】
なお、閾値Thに近い所定の個数の画素値を除外する代わりに、閾値Thに近い所定の個数の画素値を、それぞれ、0に量子化した場合の9ビットのクラスコードと、1に量子化した場合の9ビットのクラスコードと生成するようにしてもよい。
【0052】
すなわち、例えば、クラスコード用タップに含まれる9画素の画素値P1乃至P9が図10に示すような状態である場合、閾値Thに最も近い2個の画素値P6と画素値P8を、それぞれ、0に量子化した場合と、1に量子化した場合の4種類の9ビットのクラスコード101000101、101000111、101001101、101001111を、注目画素に対応するクラスコードとして生成するようにしてもよい。
【0053】
また、閾値Thに近い所定の個数の画素値に対して、上述したような処理を施すことの代わりに、閾値Thを中心とする所定の範囲(±Δ)に含まれる全ての画素値に対して、上述したような処理を施すようにしてもよい。
【0054】
例えば、クラスコード用タップに含まれる9画素の画素値P1乃至P9が図11に示すような状態である場合、閾値Thを中心とする所定の範囲(±Δ)に含まれる画素値P6と画素値P8を、それぞれ、0に量子化した場合と、1に量子化した場合の4種類の9ビットのクラスコード101000111、101001111、111000111、111001111を生成するようにしてもよい。
【0055】
あるいは、閾値Thを中心とする所定の範囲(±Δ)に含まれる画素値P6と画素値P8を除外して、7ビットのクラスコードを生成するようにしてもよい。
【0056】
このように、クラスコード用タップに含まれる全画素のうち、閾値Thの近傍の画素値に対して、量子化の対象から除外するか、あるいは、0に量子化した場合のクラスコードと、1に量子化した場合のクラスコードを生成するようにしたことにより、閾値Thの近傍の画素値がノイズなどに影響されて変動したとしても、クラスコード内にビットの反転が発生することを抑止することができる。したがって、クラスコードのロバスト性を向上させることができる。
【0057】
なお、クラスコード用タップを構成する画素の数、およびクラスコードのビット数は、上述した例に限るものではなく、任意である。以上で、第1のクラスコード生成処理の説明を終了する。
【0058】
次に、上述した第1のクラスコード生成処理に代えることができる、第2のクラスコード生成処理について、図12のフローチャートを参照して説明する。この処理は、対象フレームFcの各画素が、順次、注目画素に設定されて、注目画素に対して実行される。
【0059】
ステップS21において、クラスコード生成部14は、注目画素を中心とする所定サイズのクラスコード用ブロックを設定し、クラスコード用ブロックに含まれる複数の画素の画素値を取得する。以下においては、図13に示すように、クラスコード用ブロックのサイズを3×3画素とし、左上の画素を先頭に右下の画素までの画素値をそれぞれP1乃至P9として説明を継続する。
【0060】
ステップS22において、クラスコード生成部14は、クラスコード用ブロックに含まれる画素値P1乃至P9のうち、所定の個数(以下、例えば7個とする)の画素値を用いた複数のクラスコード用タップ候補を生成する。ここで生成されるクラスコード用タップ候補のパターンは、予め設定されている。図14は、生成される複数のクラスコード用タップ候補の3例を示している。なお、図14のクラスコード用タップ候補上の矢印は、画素値を量子化して並べ、7ビットのクラスコードを生成するときの並び順を示している。
【0061】
ステップS23において、クラスコード生成部14は、いずれのクラスコード用タップ候補が最もクラスコード用タップに適しているかを判断するために、各クラスコード用タップ候補に対して評価値を演算する。
【0062】
各クラスコード用タップ候補の評価値を演算する処理について、図15のフローチャートを参照して説明する。ステップS31において、クラスコード生成部14は、クラスコード用タップ候補に含まれる7画素の画素値のうちの最大値PMAXと最小値PMINを検出する。ステップS32において、クラスコード生成部14は、クラスコード用タップ候補に含まれる7画素の画素値のダイナミックレンジDR(=|最大値PMAX−最小値PMIN|)を算出する。
【0063】
ステップS33において、クラスコード生成部14は、式(2)を用いて閾値Thを決定する。
【0064】
ステップS34において、クラスコード生成部14は、当該クラスコード用タップ候補の評価値として、クラスコード用タップ候補に含まれる7画素の画素値と閾値Thとの差の総和を演算する。
【0065】
例えば、図16に示すような画素値を有するクラスコード用タップ候補1(図14A)の評価値は、次式(3)のように演算される。
評価値=|Th1−P3|+|Th1−P4|+|Th1−P5|+|Th1−P6|+|Th1−P7|+|Th1−P8|+|Th1−P9|                ・・・(3)
ただし、Th1は、クラスコード用タップ候補1に含まれる7画素の画素値に基づいて算出された閾値である。
【0066】
また、例えば、図17に示すような画素値を有するクラスコード用タップ候補2(図14B)の評価値は、次式(4)のように演算される。
評価値=|Th2−P3|+|Th2−P4|+|Th2−P5|+|Th2−P6|+|Th2−P7|+|Th2−P8|+|Th2−P9|                ・・・(4)
ただし、Th2は、クラスコード用タップ候補2に含まれる7画素の画素値に基づいて算出された閾値である。
【0067】
以上で、各クラスコード用タップ候補の評価値を演算する処理の説明を終了する。処理は図12のステップS24に戻る。
【0068】
ステップS24において、クラスコード生成部14は、複数のクラスコード用タップ候補のうち、ステップS23の処理で演算した評価値が最も大きいもの(すなわち、閾値Thを中心とする各画素値の分散が大きいもの)を、クラスコード用タップに決定する。
【0069】
ステップS25において、クラスコード生成部14は、ステップS24で決定されたクラスコード用タップに含まれる7画素の画素値を、それぞれ、1ビットADRCにより、0または1に量子化して、7ビットのクラスコードを生成する。
【0070】
例えば、ステップS24の処理で、図16に示された画素値を有する7画素からなるクラスコード用タップ候補1がクラスコード用タップに決定された場合、7ビットのクラスコード1001100が生成される。また、例えば、ステップS24の処理で、図17に示された画素値を有する7画素からなるクラスコード用タップ候補2が、クラスコード用タップに決定された場合、7ビットのクラスコード1001100が生成される。
【0071】
このように、複数のクラスコード用タップ候補のうち、評価値が最も大きいもの(すなわち、閾値Thを中心とする各画素値の分散が大きいもの)を、クラスコード用タップに決定し、クラスコードを生成するようにしたことにより、クラスコード内にビットの反転が発生することを抑止することができる。したがって、クラスコードのロバスト性を向上させることができる。
【0072】
なお、クラスコード用ブロックを構成する画素の数、およびクラスコード用タップ候補を構成する画素の数は、任意であって、上述した例の他、例えば、クラスコード用ブロックを5×5画素で構成し、クラスコード用タップ候補を9画素で構成するようにしてもよい。以上で、第2のクラスコード生成処理の説明を終了する。
【0073】
以上説明したように、本実施の形態によれば、クラスコード生成部14は、対象フレームFcおよび参照フレームFrの各画素に対し、1ビットADRCという容易な演算により、高いロバスト性を有するクラスコードを生成することができる。よって、対象フレームFcの画素と参照フレームFrの画素とを、高い精度でマッチングさせることができる。したがって、動きベクトルを精度良く検出することが可能となる。
【0074】
また、本発明は、画像を構成する画素の画素値の他、例えば、音声データなどの任意のデータに対してクラスコードを生成する場合に適用することが可能である。
【0075】
ところで、上述した一連の処理は、ハードウェアにより実行させることもできるが、ソフトウェアにより実行させることもできる。一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば、図18に示すように構成される汎用のパーソナルコンピュータなどに、記録媒体からインストールされる。
【0076】
このパーソナルコンピュータは、CPU(Central Processing Unit)31を内蔵している。CPU31にはバス34を介して、入出力インタフェース35が接続されている。バス34には、ROM(Read Only Memory)32およびRAM(Random Access Memory)33が接続されている。
【0077】
入出力インタフェース35には、ユーザが操作コマンドを入力するキーボード、マウスなどの入力デバイスよりなる入力部36、処理結果の映像を表示するCRT(Cathode Ray Tube)またはLCD(Liquid Crystal Display)等よりなる出力部37、プログラムや各種データを格納するハードディスクドライブなどよりなる記憶部38、およびモデム、LAN(Local Area Network)アダプタなどよりなり、インタネットに代表されるネットワークを介した通信処理を実行する通信部39が接続されている。また、磁気ディスク41、光ディスク42、光磁気ディスク43、および半導体メモリ44などの記録媒体に対してデータを読み書きするドライブ40が接続されている。
【0078】
CPU31に上述した一連の処理を実行させるプログラムは、磁気ディスク41(フレキシブルディスクを含む)、光ディスク42(CD−ROM(Compact Disc−ReadOnly Memory)、DVD(Digital Versatile Disc)を含む)、光磁気ディスク43(MD(Mini Disc)を含む)、もしくは半導体メモリ44に格納された状態でパーソナルコンピュータに供給され、ドライブ40によって読み出されて記憶部38に内蔵されるハードディスクドライブにインストールされている。記憶部38にインストールされているプログラムは、入力部36に入力されるユーザからのコマンドに対応するCPU31の指令によって、記憶部38からRAM33にロードされて実行される。
【0079】
なお、本明細書において、記録媒体に記録されるプログラムを記述するステップは、記載された順序に従って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。
【0080】
【発明の効果】
以上のように、本発明によれば、僅かな演算量のみで画像間のマッチングを行うことができる。また、本発明によれば、動きベクトル等を精度良く検出することが可能となる。
【図面の簡単な説明】
【図1】従来の動きベクトル検出装置の構成例を示すブロック図である。
【図2】対象フレームFcと参照フレームFrの対応関係を示す図である。
【図3】ブロックマッチングアルゴリズムを説明するフローチャートである。
【図4】本発明の一実施の形態である動きベクトル検出装置の構成例を示すブロック図である。
【図5】図4のMEメモリの構造を示す図である。
【図6】図4のクラスコード生成部による第1のクラスコード生成処理を説明するフローチャートである。
【図7】クラスコード用タップの一例を示す図である。
【図8】第1のクラスコード生成処理を説明するための図である。
【図9】第1のクラスコード生成処理を説明するための図である。
【図10】第1のクラスコード生成処理の変形例を説明するための図である。
【図11】第1のクラスコード生成処理の変形例を説明するための図である。
【図12】図4のクラスコード生成部による第2のクラスコード生成処理を説明するフローチャートである。
【図13】クラスコード用ブロックの一例を示す図である。
【図14】クラスコード用タップ候補の例を示す図である。
【図15】図12のステップS23における評価値演算処理を説明するフローチャートである。
【図16】第2のクラスコード生成処理を説明するための図である。
【図17】第2のクラスコード生成処理を説明するための図である。
【図18】汎用のパーソナルコンピュータの構成例を示すブロック図である。
【符号の説明】
11 動きベクトル検出装置, 12,13 フレームメモリ, 14 クラスコード生成部, 15 MEメモリ, 16 動きベクトル演算部, 31 CPU, 41 磁気ディスク, 42 光ディスク, 43 光磁気ディスク,
44 半導体メモリ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a data processing device and method, a recording medium, and a program, for example, a data processing device suitable for use when matching pixels on continuous images and detecting a motion vector based on a result of the matching. And a method, a recording medium, and a program.
[0002]
[Prior art]
For example, in a process of compressing and encoding an image signal according to the MPEG2 (Moving Picture Experts Group) method or the like, an encoding process based on a correlation between adjacent frames, that is, a so-called motion compensated inter-frame prediction is used. In motion-compensated inter-frame prediction, a process of detecting a motion vector for each pixel or for a pixel block of a predetermined size between adjacent frames (one is described as a current frame and the other is described as a reference frame) is required.
[0003]
Conventionally, a method called a block matching algorithm has been used as a method for detecting a motion vector (for example, see Patent Document 1).
[0004]
FIG. 1 shows a configuration example of a motion vector detection device that detects a motion vector according to a block matching algorithm. The motion vector detecting device 1 is configured to hold a frame of an input image signal for one frame and output the frame signal to a subsequent stage, and a frame signal based on two frame image signals input from the frame memories 2 and 3. It comprises a detection unit 4 for detecting a motion vector in an image of an image signal input from the memory 2.
[0005]
The frame memory 2 holds the input image signal for one frame, and outputs the held image signal to the frame memory 3 and the detection unit 4 when the image signal of the next frame is input. The frame memory 3 holds the image signal input from the frame memory 2 for one frame, and outputs the held image signal to the detection unit 4 when the image signal of the next frame is input.
[0006]
Therefore, the image signals of two frames before and after are input to the detection unit 4. Hereinafter, an image of one frame of the image signal input from the frame memory 2 to the detection unit 4 is referred to as a target frame Fc. Further, the image of the image signal one frame before the target frame Fc input from the frame memory 3 to the detection unit 4 is described as a reference frame Fr.
[0007]
The detection unit 4 calculates a motion vector in the target frame Fc according to a block matching algorithm. The block matching algorithm will be described with reference to the correspondence diagram between the target frame Fc and the reference frame Fr shown in FIG. 2 and the flowchart shown in FIG.
[0008]
In the block matching algorithm, all pixels in the target frame Fc are sequentially set as a target pixel, and a reference block of a predetermined size (L × L pixels) centering on the target pixel and a search block SR in the reference frame Fr Is calculated in accordance with the following equation (1).
Σ i Σ j = | Fc (i, j) -Frn (i, j) | (1)
[0009]
Here, Fc (i, j) is the pixel value of the pixel of the reference block, Frn (i, j) is the pixel value of the pixel of the reference block with the identification number n, and Σ i is i from 1 to L The sum operation when incremented by one, Σ j means the sum operation when j is incremented by one from 1 to L.
[0010]
Then, a difference vector between the center coordinates of the reference block and the coordinates of the pixel of interest when the sum of absolute differences of the pixel values of the corresponding pixel pairs of the reference block and the reference block is minimized is calculated as a motion vector.
[0011]
Specifically, the following processing is performed on the target pixel of the target frame Fc. In step S1, the detection unit 4 sets a search area SR in the reference frame Fc, which is larger in size than the reference block, around the same coordinates as the coordinates (x, y) of the target pixel of the target frame Fc.
[0012]
In step S2, the detection unit 4 initializes a variable min that stores the minimum value of the sum of absolute differences to the maximum value. For example, if one pixel value is 8-bit pixel, the size of the reference block is 4 × 4 pixels, variable min is initialized to 4096 (= 2 8 × 16) .
[0013]
In step S3, the detection unit 4 initializes the identification number n of the reference block to be moved in the search area SR to 1. In step S4, the detection unit 4 initializes a variable sum that stores the calculation result of the sum of absolute difference to 0.
[0014]
In step S5, the detection unit 4 determines the sum of absolute differences of pixels of a pixel pair located at the same position as the reference block of the target frame Fc and the reference block of the identification number n in the search area SR set in the reference frame Fr. Is calculated and assigned to the variable sum. In step S6, the detection unit 4 compares the variable sum, which is the operation result of step S5, with the variable min, and determines whether the variable sum is smaller than the variable min. If it is determined that the variable sum is smaller than the variable min, the process proceeds to step S7.
[0015]
In step S7, the detection unit 4 replaces the variable min with the variable sum. Further, the detecting unit 4 stores the identification number n of the current reference block as a motion vector number.
[0016]
In step S8, the detection unit 4 determines whether or not the identification number n of the reference block is the maximum value, that is, whether or not the reference block has been moved to the entire search area SR. If it is determined that the identification number n of the reference block is not the maximum value, the process proceeds to step S9. In step S9, the detection unit 4 increments the identification number n of the reference block by 1, returns to the process in step S4, and repeats the subsequent processes.
[0017]
If it is determined in step S6 that the variable sum is not smaller than the variable min, the process skips step S7.
[0018]
Thereafter, if it is determined in step S8 that the identification number n of the reference block is not the maximum value, that is, if the reference block has been moved to the entire search area SR, the process proceeds to step S10.
[0019]
In step S10, the detection unit 4 determines a difference vector between the center coordinates of the reference block corresponding to the identification number n stored as the motion vector number and the coordinates (x, y) of the target pixel of the target frame Fc. It is calculated as the motion vector of the target pixel of the frame Fc. This is the end of the description of the block matching algorithm.
[0020]
[Patent Document 1]
Japanese Patent No. 3277417
[Problems to be solved by the invention]
The block matching algorithm described above has a problem that the amount of calculation of the sum of absolute differences of the pixels in the pixel pair in step S5 is extremely large, and most of the time of the image compression processing is spent on this calculation. there were.
[0022]
The present invention has been made in view of such a situation, and an object of the present invention is to enable matching between images with only a small amount of calculation, and to accurately detect a motion vector and the like.
[0023]
[Means for Solving the Problems]
The data processing device according to the present invention includes: a setting unit that sets a block of a predetermined size including target data based on input data; and a threshold based on a plurality of data included in the block set by the setting unit. Calculating means for calculating, among a plurality of data included in the block set by the setting means, determining means for determining exclusion data based on the threshold value calculated by the calculating means, and a block set by the setting means Generating means for encoding data other than the exclusion data determined by the determining means among the plurality of included data to 0 or 1 based on the threshold value calculated by the calculating means, and generating a class code for the data of interest And characterized in that:
[0024]
The calculating means calculates a threshold by adding a half of a dynamic range of a plurality of data included in the block to a minimum value of a plurality of data included in the block set by the setting means. Can be.
[0025]
The determination unit may determine a predetermined number of data having a value close to the threshold value calculated by the calculation unit as the exclusion data among the plurality of data included in the block set by the setting unit. .
[0026]
The deciding means decides, as exclusion data, data having a value belonging to a predetermined range centered on the threshold value calculated by the calculating means, among a plurality of data included in the block set by the setting means. be able to.
[0027]
The generating unit sets data other than the exclusion data determined by the determining unit to 0 or 1 based on the threshold calculated by the calculating unit, among the plurality of data included in the block set by the setting unit. The data that has been coded and determined as the exclusion data by the determination unit can be coded into 0 and 1, respectively, to generate a plurality of class codes for the data of interest.
[0028]
The data may be a pixel value of a pixel forming an image.
[0029]
A data processing method according to the present invention includes a setting step of setting a block of a predetermined size including target data based on input data, and a plurality of data included in the block set in the processing of the setting step. A calculating step of calculating a threshold, a determining step of determining exclusion data based on the threshold calculated in the processing of the calculating step from a plurality of data included in the block set in the processing of the setting step, and a setting step The data other than the exclusion data determined in the processing of the determining step among the plurality of data included in the block set in the processing of the above is respectively assigned 0 or 1 based on the threshold value calculated in the processing of the calculating step. Generating a class code for the data of interest.
[0030]
The recording medium program according to the present invention includes a setting step of setting a block of a predetermined size including target data based on input data, and a plurality of data included in the block set in the processing of the setting step. A calculating step of calculating a threshold by using a setting step of determining exclusion data based on the threshold value calculated in the processing of the calculating step from among a plurality of data included in the block set in the processing of the setting step; Of the plurality of data included in the block set in the processing of the step, the data other than the exclusion data determined in the processing of the determining step are respectively set to 0 or 1 based on the threshold value calculated in the processing of the calculating step. Encoding and generating a class code for the data of interest.
[0031]
The program according to the present invention includes: a setting step of setting a block of a predetermined size including target data based on input data; and a threshold value based on a plurality of data included in the block set in the processing of the setting step. A calculating step of calculating, a determining step of determining exclusion data based on a threshold calculated in the processing of the calculating step from among a plurality of data included in the block set in the processing of the setting step, and a processing of the setting step Among the plurality of data included in the block set in the above, the data other than the exclusion data determined in the processing of the determination step, respectively, is encoded to 0 or 1 based on the threshold calculated in the processing of the calculation step, Generating a class code for the data of interest. To.
[0032]
In the data processing device and method and the program according to the present invention, a block of a predetermined size including data of interest is set, and a threshold is calculated based on a plurality of data included in the set block. Excluded data is determined from a plurality of included data based on the calculated threshold. Further, among the plurality of data included in the set block, data other than the determined exclusion data are respectively coded to 0 or 1 based on the calculated threshold, and a class code for the data of interest is generated. You.
[0033]
BEST MODE FOR CARRYING OUT THE INVENTION
An example of the configuration of a motion vector detection device to which the present invention is applied will be described with reference to FIG. The motion vector detecting device 11 includes frame memories 12 and 13, a class code generator 14, an ME memory 15, and a motion vector calculator 16.
[0034]
The frame memory 12 holds the input image signal for one frame, and outputs the held image signal to the frame memory 13 and the class code generation unit 14 when the image signal of the next frame is input. The frame memory 13 holds the input image signal for one frame, and outputs the held image signal to the class code generation unit 14 when the image signal of the next frame is input from the frame memory 12.
[0035]
Accordingly, the image signal input from the frame memory 13 to the class code generator 14 is one frame before the image signal input from the frame memory 12 to the class code generator 14. Hereinafter, the image of one frame of the image signal input from the frame memory 12 to the class code generation unit 14 is referred to as a target frame Fc. The image of the image signal one frame before the target frame Fc, which is input from the frame memory 13 to the class code generation unit 14, is described as a reference frame Fr.
[0036]
The class code generator 14 generates a class code indicating a spatial feature for each pixel of the target frame Fc, and outputs the generated class code to the motion vector calculator 16. Specifically, all the pixels of the target frame Fc are sequentially set as a target pixel, a class code tap of a predetermined size around the target pixel is determined, and a plurality of pixels included in the class code tap are determined. Is quantized to 0 or 1 by 1-bit ADRC (Adaptive Dynamic Range Coding) to generate a class code having a predetermined number of bits. The process of generating the class code will be described in detail with reference to FIG.
[0037]
Further, the class code generation unit 14 generates a class code indicating a spatial feature for each pixel of the reference frame Fr, and outputs the generated class code to the ME memory 15. However, since the reference frame Fr is the target frame Fc at the previous timing, its class code has already been generated one time before. Therefore, the class code generated for each pixel of the target frame Fc at the previous timing may be held, and may be used as the class code for each pixel of the current reference frame Fr.
[0038]
The ME memory 15 stores the class code for each pixel of the reference frame Fr input from the class code generation unit 14 in association with the class code and the coordinates of each pixel.
[0039]
FIG. 5 shows the structure of the ME memory 15. The ME memory 15 is composed of a × b cells indicated by feature amount addresses 0 to a and flag addresses 0 to b. Hereinafter, for example, the cell of the feature address 1 and the flag address 2 is described as a cell (1, 2).
[0040]
The feature address corresponds to the class code generated by the class code generation unit 14. For example, if the class code is 7 bits, when the maximum value a = 2 7 next feature quantity addresses, class code is 9 bits, the maximum value a = 2 9 feature quantity address.
[0041]
In the cells after the flag address 1 of the feature amount address 0, the coordinates of the pixels of the reference frame Fr in which the class code 0 has been generated by the class code generation unit 14 are stored in raster order. In the cell of the flag address 0 of the feature address 0, the number of cells after the flag address 1 of the feature address 0 in which the coordinates of the pixel of the class code 0 are stored. For example, when the class code 0 is generated for three pixels among the pixels of the reference frame Fr, the cells (0, 1), (0, 2), and (0, 3) are assigned to each of the three pixels. The coordinates are stored, and 3 is stored in cell (0, 0).
[0042]
In the cells after the flag address 1 of the feature amount address 1, the coordinates of the pixels of the reference frame Fr in which the class code 1 is generated by the class code generation unit 14 are stored in the raster order. The cell of flag address 0 of feature amount address 1 stores the number of cells after flag address 1 of feature amount address 0 in which the coordinates of the pixel of class code 1 are stored. For example, when the class code 1 is generated for 10 pixels among the pixels of the reference frame Fr, the coordinates of each of the 10 pixels are stored in cells (1, 1),..., Cell (1, 10). Then, 10 is stored in the cell (1, 0). The same applies to cells subsequent to the feature address 2.
[0043]
Referring back to FIG. The motion vector calculation unit 16 searches the ME memory 15 for the coordinates of the pixel of the reference frame Fr having the same class code for each pixel of the target frame Fc, and finds the closest distance to the coordinates of the target pixel among the searched pixels. Is determined as a pixel corresponding to the target pixel, and a motion vector of the target pixel is calculated.
[0044]
The structure of the ME memory 15 and the details of the processing of the motion vector calculation unit 16 have already been proposed by the present applicant as Japanese Patent Application No. 2002-222044.
[0045]
Next, the first class code generation processing by the class code generation unit 4 which is the main feature of the present invention will be described with reference to the flowchart in FIG. This process is executed for each pixel of interest, with each pixel of the target frame Fc being sequentially set as the pixel of interest.
[0046]
In step S11, the class code generation unit 14 sets a class code tap of a predetermined size centering on the target pixel, and acquires pixel values of a plurality of pixels included in the class code tap. In the following, as shown in FIG. 7, the description will be continued with the size of the class code tap set to 3 × 3 pixels and the pixel values from the upper left pixel to the lower right pixel being P1 to P9, respectively.
[0047]
In step S12, the class code generation unit 14 determines the maximum value P MAX and the minimum value P MIN of the pixel values P1 to P9. In step S13, the class code generation unit 14 calculates a dynamic range DR (= | maximum value P MAX -minimum value P MIN |) of the pixel values P1 to P9. In step S14, the class code generation unit 14 determines the threshold Th by adding the dynamic range DR / 2 to the minimum value P MIN of the pixel values P1 to P9 as in the following equation (2).
Th = P MIN + DR / 2 (2)
[0048]
In step S15, the class code generation unit 14 excludes a predetermined number (for example, two) of pixel values closest to the threshold Th from the pixel values P1 to P9. In step S16, the class code generation unit 14 compares each of the remaining seven pixels among the pixel values P1 to P9 with a threshold Th, and quantizes the remaining seven pixels to 1 when the pixel value is larger than the threshold Th, and less than the threshold Th. In this case, it is quantized to 0, and 7 bits arranged in numerical order are generated as the class code of the pixel of interest.
[0049]
For example, when the pixel values P1 to P9 of the nine pixels included in the class code tap are in the state shown in FIG. 8, the pixel values P6 and P8 closest to the threshold Th are excluded, and the 7-bit class code 1010011 is generated.
[0050]
Further, for example, when the pixel values P1 to P9 of the nine pixels included in the class code tap are in the state shown in FIG. 9, the pixel values P5 and P6 closest to the threshold Th are excluded, and the 7-bit class Code 1010101 is generated.
[0051]
Note that instead of excluding a predetermined number of pixel values close to the threshold Th, a predetermined number of pixel values close to the threshold Th are quantized to 0 and a 9-bit class code, respectively. In this case, a 9-bit class code may be generated.
[0052]
That is, for example, when the pixel values P1 to P9 of the nine pixels included in the class code tap are in the state shown in FIG. 10, the two pixel values P6 and P8 closest to the threshold Th are respectively Four types of 9-bit class codes 101000101, 101000111, 101001101, and 101001111 when quantized to 0 and when quantized to 1 may be generated as class codes corresponding to the pixel of interest.
[0053]
Also, instead of performing the above-described processing on a predetermined number of pixel values close to the threshold Th, all pixel values included in a predetermined range (± Δ) centered on the threshold Th are calculated. Then, the above-described processing may be performed.
[0054]
For example, if the pixel values P1 to P9 of the nine pixels included in the class code tap are in the state shown in FIG. 11, the pixel value P6 and the pixel value P6 included in a predetermined range (± Δ) centered on the threshold value Th Four types of 9-bit class codes 101000111, 101001111, 111000111, and 111001111 may be generated when the value P8 is quantized to 0 and when it is quantized to 1, respectively.
[0055]
Alternatively, a 7-bit class code may be generated by excluding the pixel values P6 and P8 included in a predetermined range (± Δ) centered on the threshold Th.
[0056]
As described above, of all the pixels included in the class code tap, pixel values near the threshold value Th are excluded from the quantization target, or the class code when quantized to 0 and 1 By generating a class code when quantization is performed, even if a pixel value near the threshold value Th fluctuates due to noise or the like, the occurrence of bit inversion in the class code is suppressed. be able to. Therefore, the robustness of the class code can be improved.
[0057]
The number of pixels constituting the class code tap and the number of bits of the class code are not limited to the examples described above, but are arbitrary. This is the end of the description of the first class code generation process.
[0058]
Next, a second class code generation process that can be substituted for the above-described first class code generation process will be described with reference to the flowchart in FIG. This process is executed for each pixel of interest, with each pixel of the target frame Fc being sequentially set as the pixel of interest.
[0059]
In step S21, the class code generation unit 14 sets a class code block of a predetermined size centering on the target pixel, and acquires pixel values of a plurality of pixels included in the class code block. In the following, as shown in FIG. 13, the description will be continued on the assumption that the size of the class code block is 3 × 3 pixels, and the pixel values from the upper left pixel to the lower right pixel are P1 to P9, respectively.
[0060]
In step S22, the class code generation unit 14 generates a plurality of class code taps using a predetermined number (hereinafter, for example, seven) of pixel values among the pixel values P1 to P9 included in the class code block. Generate candidates. The pattern of the class code tap candidate generated here is set in advance. FIG. 14 shows three examples of a plurality of class code tap candidates to be generated. The arrows on the class code tap candidates in FIG. 14 indicate the order in which pixel values are quantized and arranged to generate a 7-bit class code.
[0061]
In step S23, the class code generation unit 14 calculates an evaluation value for each class code tap candidate in order to determine which class code tap candidate is most suitable for the class code tap.
[0062]
The process of calculating the evaluation value of each class code tap candidate will be described with reference to the flowchart in FIG. In step S31, the class code generation unit 14 detects the maximum value P MAX and the minimum value P MIN among the seven pixel values included in the class code tap candidate. In step S32, the class code generation unit 14 calculates a dynamic range DR (= | maximum value P MAX -minimum value P MIN |) of the pixel values of the seven pixels included in the class code tap candidate.
[0063]
In step S33, the class code generation unit 14 determines the threshold Th using Expression (2).
[0064]
In step S34, the class code generation unit 14 calculates the sum of the differences between the pixel values of the seven pixels included in the class code tap candidates and the threshold value Th as the evaluation values of the class code tap candidates.
[0065]
For example, the evaluation value of the class code tap candidate 1 (FIG. 14A) having a pixel value as shown in FIG. 16 is calculated as in the following equation (3).
Evaluation value = | Th1-P3 | + | Th1-P4 | + | Th1-P5 | + | Th1-P6 | + | Th1-P7 | + | Th1-P8 | + | Th1-P9 | (3)
However, Th1 is a threshold calculated based on the pixel values of seven pixels included in the class code tap candidate 1.
[0066]
Further, for example, the evaluation value of the class code tap candidate 2 (FIG. 14B) having a pixel value as shown in FIG. 17 is calculated as in the following equation (4).
Evaluation value = | Th2-P3 | + | Th2-P4 | + | Th2-P5 | + | Th2-P6 | + | Th2-P7 | + | Th2-P8 | + | Th2-P9 | (4)
Note that Th2 is a threshold calculated based on the pixel values of seven pixels included in the class code tap candidate 2.
[0067]
This concludes the description of the process of calculating the evaluation value of each class code tap candidate. The process returns to step S24 in FIG.
[0068]
In step S24, the class code generation unit 14 has the largest evaluation value calculated in the processing in step S23 among the plurality of class code tap candidates (that is, the variance of each pixel value around the threshold Th is large). ) Are determined as class code taps.
[0069]
In step S25, the class code generation unit 14 quantizes the pixel values of the seven pixels included in the class code tap determined in step S24 to 0 or 1 by 1-bit ADRC, and generates a 7-bit class. Generate code.
[0070]
For example, when the class code tap candidate 1 including seven pixels having the pixel values shown in FIG. 16 is determined as the class code tap in the process of step S24, a 7-bit class code 1001100 is generated. For example, when the class code tap candidate 2 including seven pixels having the pixel values shown in FIG. 17 is determined as the class code tap in the process of step S24, a 7-bit class code 1001100 is generated. Is done.
[0071]
As described above, among the plurality of class code tap candidates, the one having the largest evaluation value (that is, the one having a large variance of each pixel value around the threshold value Th) is determined as the class code tap, and the class code tap is determined. Is generated, the occurrence of bit inversion in the class code can be suppressed. Therefore, the robustness of the class code can be improved.
[0072]
The number of pixels constituting the class code block and the number of pixels constituting the class code tap candidate are arbitrary. In addition to the above-described example, for example, the class code block is composed of 5 × 5 pixels. Alternatively, the class code tap candidate may be configured with nine pixels. This is the end of the description of the second class code generation processing.
[0073]
As described above, according to the present embodiment, the class code generation unit 14 provides a class code having high robustness to each pixel of the target frame Fc and the reference frame Fr by an easy operation of 1-bit ADRC. Can be generated. Therefore, the pixels of the target frame Fc and the pixels of the reference frame Fr can be matched with high accuracy. Therefore, it is possible to accurately detect a motion vector.
[0074]
Further, the present invention can be applied to a case where a class code is generated for arbitrary data such as audio data, for example, in addition to the pixel values of the pixels constituting the image.
[0075]
Incidentally, 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 built into dedicated hardware or installing various programs. It is installed from a recording medium into a possible general-purpose personal computer configured as shown in FIG. 18, for example.
[0076]
This personal computer includes a CPU (Central Processing Unit) 31. An input / output interface 35 is connected to the CPU 31 via a bus 34. The bus 34 is connected to a ROM (Read Only Memory) 32 and a RAM (Random Access Memory) 33.
[0077]
The input / output interface 35 includes an input unit 36 including an input device such as a keyboard and a mouse for inputting operation commands by a user, a CRT (Cathode Ray Tube) or an LCD (Liquid Crystal Display) for displaying an image of a processing result. An output unit 37, a storage unit 38 such as a hard disk drive that stores programs and various data, and a communication unit that includes a modem, a LAN (Local Area Network) adapter, and executes communication processing via a network represented by the Internet. 39 are connected. A drive 40 for reading and writing data from and to a recording medium such as a magnetic disk 41, an optical disk 42, a magneto-optical disk 43, and a semiconductor memory 44 is connected.
[0078]
Programs that cause the CPU 31 to execute the above-described series of processes include a magnetic disk 41 (including a flexible disk), an optical disk 42 (including a CD-ROM (Compact Disc-Read Only Memory), a DVD (including a Digital Versatile Disc)), and a magneto-optical disk. 43 (including an MD (Mini Disc)) or stored in a semiconductor memory 44 and supplied to a personal computer, read by a drive 40 and installed in a hard disk drive built in the storage unit 38. The program installed in the storage unit 38 is loaded from the storage unit 38 to the RAM 33 and executed according to a command from the CPU 31 corresponding to a command from the user input to the input unit 36.
[0079]
In this specification, the steps of describing a program recorded on a recording medium include, in addition to processing performed in chronological order according to the described order, not only chronological processing but also parallel or individual processing. This includes the processing to be executed.
[0080]
【The invention's effect】
As described above, according to the present invention, matching between images can be performed with only a small amount of calculation. Further, according to the present invention, it is possible to accurately detect a motion vector and the like.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration example of a conventional motion vector detection device.
FIG. 2 is a diagram showing a correspondence relationship between a target frame Fc and a reference frame Fr.
FIG. 3 is a flowchart illustrating a block matching algorithm.
FIG. 4 is a block diagram illustrating a configuration example of a motion vector detection device according to an embodiment of the present invention.
FIG. 5 is a diagram showing a structure of the ME memory of FIG. 4;
FIG. 6 is a flowchart illustrating a first class code generation process by a class code generation unit in FIG. 4;
FIG. 7 is a diagram illustrating an example of a class code tap;
FIG. 8 is a diagram for explaining a first class code generation process.
FIG. 9 is a diagram illustrating a first class code generation process.
FIG. 10 is a diagram for describing a modification of the first class code generation process.
FIG. 11 is a diagram for describing a modification of the first class code generation process.
12 is a flowchart illustrating a second class code generation process performed by the class code generation unit in FIG.
FIG. 13 is a diagram illustrating an example of a class code block.
FIG. 14 is a diagram illustrating an example of class code tap candidates.
FIG. 15 is a flowchart illustrating an evaluation value calculation process in step S23 of FIG.
FIG. 16 is a diagram illustrating a second class code generation process.
FIG. 17 is a diagram illustrating a second class code generation process.
FIG. 18 is a block diagram illustrating a configuration example of a general-purpose personal computer.
[Explanation of symbols]
11 motion vector detecting device, 12, 13 frame memory, 14 class code generation unit, 15 ME memory, 16 motion vector calculation unit, 31 CPU, 41 magnetic disk, 42 optical disk, 43 magneto-optical disk,
44 Semiconductor Memory

Claims (9)

特徴量を示すクラスコードを生成し、生成した前記クラスコードに基づき、データを処理するデータ処理装置において、
入力されたデータに基づいて、注目データを含む所定のサイズのブロックを設定する設定手段と、
前記設定手段によって設定された前記ブロックに含まれる複数の前記データに基づいて閾値を算出する算出手段と、
前記設定手段によって設定された前記ブロックに含まれる複数の前記データのなかから、前記算出手段によって算出された前記閾値に基づいて除外データを決定する決定手段と、
前記設定手段によって設定された前記ブロックに含まれる複数の前記データのうち、前記決定手段によって決定された前記除外データ以外のデータを、それぞれ、前記算出手段によって算出された前記閾値に基づいて0または1に符号化し、前記注目データに対する前記クラスコードを生成する生成手段と
を含むことを特徴とするデータ処理装置。
In a data processing device that generates a class code indicating a feature amount and processes data based on the generated class code,
Setting means for setting a block of a predetermined size including the data of interest based on the input data;
Calculation means for calculating a threshold based on a plurality of the data included in the block set by the setting means,
From among the plurality of data included in the block set by the setting unit, a determination unit that determines exclusion data based on the threshold value calculated by the calculation unit,
Of the plurality of data included in the block set by the setting unit, data other than the exclusion data determined by the determining unit, based on the threshold calculated by the calculating unit, 0 or And a generating means for generating the class code for the target data.
前記算出手段は、前記設定手段によって設定された前記ブロックに含まれる複数の前記データの最小値に、前記ブロックに含まれる複数の前記データのダイナミックレンジの1/2を加算して、前記閾値を算出する
ことを特徴とする請求項1に記載のデータ処理装置。
The calculation means adds 1 / of the dynamic range of the data included in the block to the minimum value of the data included in the block set by the setting means, and sets the threshold value. The data processing device according to claim 1, wherein the calculation is performed.
前記決定手段は、前記設定手段によって設定された前記ブロックに含まれる複数の前記データのうち、前記算出手段によって算出された前記閾値に近い値を有する所定の数の前記データを前記除外データに決定する
ことを特徴とする請求項1に記載のデータ処理装置。
The determining means determines a predetermined number of data having a value close to the threshold calculated by the calculating means as the exclusion data among the plurality of data included in the block set by the setting means. The data processing apparatus according to claim 1, wherein the data processing is performed.
前記決定手段は、前記設定手段によって設定された前記ブロックに含まれる複数の前記データのうち、前記算出手段によって算出された前記閾値を中心とする所定の範囲に属する値を有する前記データを前記除外データに決定する
ことを特徴とする請求項1に記載のデータ処理装置。
The determining unit excludes the data having a value belonging to a predetermined range centered on the threshold calculated by the calculating unit, among the plurality of data included in the block set by the setting unit. The data processing device according to claim 1, wherein the data is determined as data.
前記生成手段は、前記設定手段によって設定された前記ブロックに含まれる複数の前記データのうち、前記決定手段によって決定された前記除外データ以外のデータを、それぞれ、前記算出手段によって算出された前記閾値に基づいて0または1に符号化し、前記決定手段によって前記除外データに決定されたデータを、それぞれ、0および1に符号化して、前記注目データに対する複数の前記クラスコードを生成する
ことを特徴とする請求項1に記載のデータ処理装置。
The generating means, among the plurality of data included in the block set by the setting means, data other than the exclusion data determined by the determining means, each of the threshold values calculated by the calculating means And encoding the data determined as the exclusion data by the determination means into 0 and 1, respectively, to generate a plurality of the class codes for the data of interest. The data processing device according to claim 1.
前記データは、画像を構成する画素の画素値である
ことを特徴とする請求項1に記載のデータ処理装置。
The data processing device according to claim 1, wherein the data is a pixel value of a pixel forming an image.
特徴量を示すクラスコードを生成し、生成した前記クラスコードに基づき、データを処理するデータ処理装置のデータ処理方法において、
入力されたデータに基づいて、注目データを含む所定のサイズのブロックを設定する設定ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記データに基づいて閾値を算出する算出ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記データのなかから、前記算出ステップの処理で算出された前記閾値に基づいて除外データを決定する決定ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記データのうち、前記決定ステップの処理で決定された前記除外データ以外のデータを、それぞれ、前記算出ステップの処理で算出された前記閾値に基づいて0または1に符号化し、前記注目データに対する前記クラスコードを生成する生成ステップと
を含むことを特徴とするデータ処理方法。
In the data processing method of a data processing device that processes data based on the generated class code that generates a class code indicating a feature amount,
A setting step of setting a block of a predetermined size including the data of interest based on the input data;
A calculating step of calculating a threshold based on a plurality of the data included in the block set in the processing of the setting step,
From among the plurality of data included in the block set in the processing of the setting step, a determining step of determining exclusion data based on the threshold calculated in the processing of the calculating step,
Among the plurality of data included in the block set in the processing of the setting step, data other than the exclusion data determined in the processing of the determining step, respectively, the data calculated in the processing of the calculating step Generating a class code for the data of interest by encoding to 0 or 1 based on a threshold value.
特徴量を示すクラスコードを生成し、生成した前記クラスコードに基づき、データを処理するためのプログラムであって、
入力されたデータに基づいて、注目データを含む所定のサイズのブロックを設定する設定ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記データに基づいて閾値を算出する算出ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記データのなかから、前記算出ステップの処理で算出された前記閾値に基づいて除外データを決定する決定ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記データのうち、前記決定ステップの処理で決定された前記除外データ以外のデータを、それぞれ、前記算出ステップの処理で算出された前記閾値に基づいて0または1に符号化し、前記注目データに対する前記クラスコードを生成する生成ステップと
を含むことを特徴とするコンピュータが読み取り可能なプログラムが記録されている記録媒体。
A program for generating a class code indicating a feature amount and processing data based on the generated class code,
A setting step of setting a block of a predetermined size including the data of interest based on the input data;
A calculating step of calculating a threshold based on a plurality of the data included in the block set in the processing of the setting step,
From among the plurality of data included in the block set in the processing of the setting step, a determining step of determining exclusion data based on the threshold calculated in the processing of the calculating step,
Among the plurality of data included in the block set in the processing of the setting step, data other than the exclusion data determined in the processing of the determining step, respectively, the data calculated in the processing of the calculating step Generating a class code for the data of interest by encoding the data into 0 or 1 based on a threshold value.
特徴量を示すクラスコードを生成し、生成した前記クラスコードに基づき、データを処理するコンピュータに、
入力されたデータに基づいて、注目データを含む所定のサイズのブロックを設定する設定ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記データに基づいて閾値を算出する算出ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記データのなかから、前記算出ステップの処理で算出された前記閾値に基づいて除外データを決定する決定ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記データのうち、前記決定ステップの処理で決定された前記除外データ以外のデータを、それぞれ、前記算出ステップの処理で算出された前記閾値に基づいて0または1に符号化し、前記注目データに対する前記クラスコードを生成する生成ステップと
を含む処理を実行させることを特徴とするプログラム。
Generate a class code indicating the feature amount, based on the generated class code, a computer that processes data,
A setting step of setting a block of a predetermined size including the data of interest based on the input data;
A calculating step of calculating a threshold based on a plurality of the data included in the block set in the processing of the setting step,
From among the plurality of data included in the block set in the processing of the setting step, a determining step of determining exclusion data based on the threshold calculated in the processing of the calculating step,
Among the plurality of data included in the block set in the processing of the setting step, data other than the exclusion data determined in the processing of the determining step, respectively, the data calculated in the processing of the calculating step A code that is coded to 0 or 1 based on a threshold value and generates the class code for the data of interest.
JP2002295592A 2002-10-09 2002-10-09 Image data processing apparatus and method, recording medium, and program Expired - Fee Related JP4144316B2 (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
JP2004134912A true JP2004134912A (en) 2004-04-30
JP4144316B2 JP4144316B2 (en) 2008-09-03

Family

ID=32285785

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JP4144316B2 (en)

Also Published As

Publication number Publication date
JP4144316B2 (en) 2008-09-03

Similar Documents

Publication Publication Date Title
JP5045320B2 (en) Image processing apparatus, image processing method, and computer program
JP4004653B2 (en) Motion vector detection method and apparatus, and recording medium
TWI565306B (en) Video decoding apparatus, video coding apparatus, video decoding method, video coding method, and storage medium
US8064522B2 (en) Motion-vector detecting device, motion-vector detecting method, and computer program
KR101217627B1 (en) Method and apparatus for estimating motion vector based on block
US20080002774A1 (en) Motion vector search method and motion vector search apparatus
US20110249747A1 (en) Motion vector decision apparatus, motion vector decision method and computer readable storage medium
JP2011503991A (en) Method and device for motion estimation and compensation
US20070036217A1 (en) Motion picture encoding method and device
US20070092005A1 (en) Method and apparatus for encoding, method and apparatus for decoding, program, and storage medium
JP4129788B2 (en) Image data processing apparatus and method, recording medium, and program
JP3175914B2 (en) Image encoding method and image encoding device
JP4082664B2 (en) Video search device
JP4144316B2 (en) Image data processing apparatus and method, recording medium, and program
JP4622265B2 (en) Motion vector detection device, motion vector detection method, and program
JP2005252360A (en) Motion vector detecting apparatus, motion vector detection method and computer program
JP4239557B2 (en) Image processing apparatus and method, recording medium, and program
JP4329331B2 (en) Image processing apparatus and method, recording medium, and program
JPH0262178A (en) Motion detection system for picture processor
US7627140B2 (en) Flatted hexagon search method for fast block motion estimation
JP2006217486A (en) Motion compensation type ip conversion processor and processing method
JP4207763B2 (en) Motion vector detection apparatus, motion vector detection method, and computer program
JP2006115421A (en) Motion vector detecting method and device
KR101787004B1 (en) Apparatus and method for sampled pixel based motion estimation
KR101798191B1 (en) Apparatus and method for sampled pixel based motion estimation

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050822

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080222

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080403

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080428

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080502

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

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

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

Free format text: PAYMENT UNTIL: 20110627

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120627

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130627

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees