【0001】
【発明の属する技術分野】
本発明は、画像の高能率符号化において、サブサンプリングにより解像度の異なる画像データを階層的に利用することで画像の動きベクトル検出に費やされる演算量を削減する技術に関し、画像予測符号化における画像圧縮エンコード処理に利用されるものである。そして、本発明は、ブロックマッチングの演算量を増やさずに動きベクトルの検出精度を上げることのできる装置を提供するものである。
【0002】
【従来技術】
従来技術による動きベクトルの階層探索を図3を用いて説明する。本説明では、便宜的に最上位階層も含めて3階層で説明するが、階層数は任意に設定できる。図3において画像メモリ301に参照画像データ、画像メモリ311に処理画像データが記憶され最上位階層画像と呼ぶ。
【0003】
画像メモリ301,311の画像データから2次元ローパスフィルタ302,312により、水平・垂直の低域周波数成分を抽出する。例えば、タップ係数[ 1/2, 1/2]の1次元水平ローパスフィルタと1次元垂直ローパスフィルタを従属接続することで、2次元ローパスフィルタは実現される。2次元ローパスフィルタ302,312により抽出された低域周波数成分の画像に対して、水平・垂直方向に画素を1つ置きに間引くサブサンプリング処理をサブサンプリング処理回路303,313によって施す。サブサンプリングにより面積比1/4に画像サイズを縮小した画像を画像メモリ304,314に記憶し、この記憶した画像を第2階層画像と呼ぶ。
【0004】
第2階層画像に対して、さらに2次元ローパスフィルタ305,315により水平・垂直の低域周波数成分を抽出し、サブサンプリング処理をサブサンプリング処理回路306,316によって施す。サブサンプリングにより更に面積比1/4に画像サイズを縮小した画像を画像メモリ307,317に記憶し、この記憶した画像を第1階層画像と呼ぶ。
【0005】
このようにして解像度の異なる画像を階層的に作成する。これら階層画像に対して、最も解像度の低い画像で動きベクトルの検出を行い、順次解像度の高い画像を遡りながら検出した動きベクトルの修正を繰り返していく。
【0006】
図3では、先ず、最も画素数の少ない参照画像データ307(画像メモリに記憶された画像データをその画像メモリの符号を用いて呼ぶことととする。以下も同様)の探索範囲321に対して、最も画素数の少ない処理画像データ317のマクロブロック331とのブロックマッチングによりベクトルを広範囲に探索する(ブロックマッチング回路308により実行する)。
【0007】
次に、1つ上の解像度の参照画像データ304で、ブロックマッチング回路308によるブロックマッチングで求めた動きベクトル値を補正することで決定された探索の中心位置とその近傍を含む探索範囲322に対して、処理画像データ314のマクロブロック332とのブロックマッチングにより、ブロックマッチング回路308で求めた動きベクトル値を修正する。(ブロックマッチング回路309により実行する。)
この過程を繰り返して、最終的には最上位階層の参照画像データ301の探索範囲323に対して、最上位階層の処理画像データ311のマクロブロック333とのブロックマッチングが行われ(ブロックマッチング回路310により実行され)、動きベクトル値が決定され出力される。
【0008】
この技術は、画素数の少ない第1階層でのみ広範囲な探索が行われ他の階層では近傍探索となるため、画素数の多い最上位階層画像のみで広範囲にブロックマッチングを実施するよりも少ない演算量でベクトル検出が実現される。(詳しくは、特開平11−289545号公報を参照。)
【0009】
【特許文献1】
特開平11−289545号公報
【0010】
【発明が解決しようとする課題】
画像の動きベクトル階層型探索では、階層数を増やすほど演算量が減り広域的な動きベクトル検出が可能となる。この際、各階層画像はローパスフィルタにより低域周波数成分が抽出され、画素をサブサンプリングすることにより縮小画像を生成する。この結果、階層数が増えるほど高域周波数成分が除去されること、また、折り返し成分により信号波形の区別がつき難くなることなどで正確なブロックマッチングができなという問題が発生していた。
【0011】
この問題を解決するために、上述の特開平11−289545号公報では、探索開始階層を最下位階層だけでなく中間階層からも探索を行い、探索開始階層の異なった動きベクトルを選択的に利用する方法を提案している。
【0012】
しかし、提案されている方法では演算量の大部分をブロックマッチング演算が占めていることから、複数の動きベクトル検出は演算量の増加を招くこととなり、さらなる演算量の削減が求められていた。
【0013】
本発明は、前記問題を解決するために、ブロックマッチングの演算量を増やさずに動きベクトルの検出精度を上げることのできる動きベクトル検出装置を提供することを目的としている。
【0014】
【課題を解決するための手段】
そこで、上記課題を解決するために本発明は、
時系列的に前後する処理画像データと参照画像データとを記憶する最上位画像メモリと、
それぞれの前記画像データから特定の周波数領域を抽出する第1のプリフィルタと、
前記第1のプリフィルタから出力された画像の画素を均等に間引く第1のサブサンプリング器と、
前記第1のサブサンプリング器から出力される画素数の削減された画像を記憶する第1の画像メモリと、
前記画素数の削減された画像から2次元周波数空間を複数の領域に分割しそれぞれの成分を出力する第2のプリフィルタと、
前記第2のプリフィルタから出力される周波数領域の異なる複数の画像の画素を均等に間引く第2のサブサンプリング器と、
前記第2のサブサンプリング器から出力される画素数の削減された複数の画像を記憶する第2の画像メモリと、
前記第2の画像メモリに記憶された周波数領域の異なる処理画像データ毎に、各処理画像データの画素数に比例するマクロブロックサイズに含まれる画素値の絶対値の総和を求めるヒストグラム演算器と、
前記ヒストグラム演算器から出力される各ヒストグラム値に所定の定数を掛ける掛け算器と、
複数の周波数領域の異なる処理画像データの同じ位置にあるマクロブロックの、前記掛け算器により前記所定の定数が掛けられたヒストグラム値の中から最大の値を求めて、その最大値となるヒストグラム値が得られた処理画像データの周波数領域を選択する機能を有し、前記選択された周波数領域から抽出された処理画像データのマクロブロックと、前記選択された周波数領域と同じ領域から抽出された前記第2の画像メモリに記憶されている参照画像データとの間で、ブロックマッチングにより動きベクトル値を計算する第2の動きベクトル検出器と、
前記第2の動きベクトル検出器から得られた動きベクトル値を補正して、前記第1の画像メモリに記憶された処理画像データのマクロブロックと、前記第1の画像メモリに記憶された参照画像データとから動きベクトル値を計算する第1のベクトル検出器と、
前記第1のベクトル検出器から得られた動きベクトル値を補正して、前記最上位画像メモリに記憶された処理画像データのマクロブロックと、前記最上位画像メモリに記憶された参照画像データとから動きベクトル値を計算する最上位ベクトル検出器と、
を備えたことを特徴とする動きベクトル検出装置、
を提供するものである。
【0015】
【発明の実施の形態】
従来の方法においては、サブサンプリング時のプリフィルタ特性を緩やかに減衰する特性に選ぶことで、高域成分を折り返させ高域情報がある程度保存されるようになっている。しかし、基本的には、画像データ中に含まれる周波数成分に係わりなく、単一のフィルタ出力のみでブロックマッチングを行う点に問題がある。
【0016】
そこで、ブロックマッチングを行うマクロブロック内に含まれる周波数成分に応じて適応的にプリフィルタの特性を選択してサブサンプリングを行えばこの問題は解決する。
【0017】
例えば、図11に示すフローチャートの処理を実現すればよい。まず、処理画像データと参照画像データの原画像を最上位階層画像として画像メモリに記憶する(ステップ01、以下S01とする。他も同様)。原画像から水平・垂直低域成分を抽出後、サブサンプリングによりサイズを縮小した画像を第2階層画像データとして画像メモリに記憶する(S02)。
【0018】
2次元周波数空間を複数の領域に分割するフィルタにより各周波数領域の成分を第2階層画像データから抽出し、それぞれの周波数成分を含む画像を第1階層画像データとして画像メモリに記憶する(S03)。
【0019】
第1階層画像データに保存されている異なる周波数成分を保持する複数の処理画像データのマクロブロックから特徴的な周波数成分を持つ帯域を選択する(S04)。
【0020】
特徴的な周波数成分とは、例えば後述する輝度のヒストグラムなどがある。第1階層画像データにおいて選択された周波数領域を含む処理画像データのマクロブロックと選択された周波数領域を含む参照画像データとの間でブロックマッチングにより動きベクトルを探索する(S05)。
【0021】
S05で検出された動きベクトルを中心とした探索領域で第2階層画像データを用いたブロックマッチングによりS05の動きベクトルを修正する(S06)。さらに、S06で検出された動きベクトルを中心としたサーチ領域で最上位階層画像データを用いたブロックマッチングによりS06の動きベクトルを修正する(S07)。S07で検出された動きベクトルを探索結果として出力する(S08)。
【0022】
本実施手段では、1回目のサブサンプリングでは低域成分を使用し、2回目のサブサンプリングでは適応選択された周波数領域を使用する3層構成を示した。これは、1回目のサブサンプリングに比べて2回目のサブサンプリングの方が画像の特徴を多く含む周波数成分に大きな影響を及ぼすためである。
【0023】
本発明の実施例の詳細を、図1のシステム構成図と図11の処理の手順を示したフローチャートを用いて説明する。
【0024】
図11のフローチャートのS01の処理に対応して、(水平画素数)720×(垂直画素数)480画素を有する参照画像データを図1の画像メモリ101に、処理画像データを画像メモリ121に記憶し最上位階層画像と呼ぶ。
【0025】
次に図11のS02に対応して以下の処理により第2階層の画像を得る。図1の画像メモリ101と画像メモリ121とに記憶されたそれぞれの画像に対して、2次元ローパスフィルタ102,122により水平・垂直低域周波数成分が抽出される。例えば、2次元ローパスフィルタはタップ係数[ 1/4, 1/2, 1/4]の1次元水平ローパスフィルタと1次元垂直ローパスフィルタを従属接続することで実現される。
【0026】
2次元ローパスフィルタ102,122の出力に、水平・垂直ともに1画素おきにサブサンプリング処理をサブサンプリング処理回路103、123によって施す。サブサンプリングの方法として、例えば図10の黒丸の画素を削除して白丸のみ残す方法を用いて、面積比1/4の画像サイズを作成する。このように、360×240画素にサイズ縮小された参照画像データと処理画像データとを作成し、それぞれを画像メモリ104,124に記憶する。この画像を第2階層画像と呼ぶ。
【0027】
図11のS03に対応して以下の処理により第1階層の画像を得る。前記第2階層の360×240画素の画像を図2に示す水平低域・垂直低域LL、水平低域・垂直高域LH、水平高域・垂直低域HL、水平高域・垂直高域HHの4つの領域にプリフィルタ105、125により分割する。例えば、タップ係数[ 1/4, 1/2, 1/4]の1次元水平ローパスフィルタと1次元垂直ローパスフィルタを従属接続することでLL領域が抽出され、前記1次元水平ローパスフィルタの出力からLL領域を引き算することでLH領域が抽出できる。
【0028】
また、タップ係数[ −1/4, 1/2, −1/4]の1次元水平ハイパスフィルタとタップ係数[ 1/4, 1/2, 1/4]の1次元垂直ローパスフィルタを従属接続することでHL領域が抽出され、前記1次元水平ハイパスフィルタの出力からHL領域を引き算することでHH領域が抽出できる。
【0029】
生成された4枚の360×240画素を有する画像データに水平・垂直とも1画素おきにサブサンプリング処理をサブサンプリング処理回路106,126によって施し、サイズ縮小した180×120画素を有する各4枚の画像データを得る。LL領域の各画像データは画像メモリ107,127に、LH領域の各画像データは画像メモリ108,128に、HL領域の各画像データは画像メモリ109,129に、HH領域の各画像データは画像メモリ110,130に記憶される。この画像を第1階層画像と呼ぶ。この結果、第1階層には、最上位階層の画像から面積比1/16にサイズ縮小された参照画像データと処理画像データがそれぞれ4枚記憶されている。
【0030】
図11のS04に対応して以下の方法で周波数帯域の選択を行う。本実施例では、720×480画素の最上位階層画像で16×16画素を単位とするマクロブロック(以下、MBと記す)で動きベクトルを検出する場合を考える。第1階層画像127〜130は、最上位階層画像121の面積比1/16にサイズ縮小されているので、MBも面積比1/16にサイズ縮小され4×4画素を単位としてブロックマッチングを行い、動きベクトルを検出する。第1階層画像には周波数領域の異なる4枚の画像127〜130が存在するので、画像中の同じ座標に位置するMBも4つ存在する。このMB内の座標( x, y)における輝度レベル(Yi:i = LL,LH,HL,HH)の絶対値の総和(MBi:i = LL,LH,HL,HH)
【0031】
【数1】
を計算し、それぞれのMBのヒストグラムMBLL,MBLH,MBHL,MBHHを求める(周波数領域選択器131内のヒストグラム演算器で求める)。この際、LL領域は直流成分を含むため単純に他の領域と比較すると不具合が生じる可能性がある。そこで、MBLLのみ
【0032】
【数2】
【0033】
【数3】
として直流成分を除去する方法を用いている。
【0034】
動きベクトル探索を行う周波数領域選択器131では、内蔵する掛け算器によりMBLL,MBLH,MBHL,MBHHにそれぞれ重み係数KLL,KLH,KHL,KHHを掛け、
【0035】
【数4】
により最大値をもつMBiをMcとして選択後、画像メモリ132に記憶する。本実施例では、Ki = 1とした。Mcが属する画像データと同じ周波数領域の参照画像データを画像メモリ107〜110から選択し画像メモリ111に記憶する。
【0036】
図11のS05の処理に対応して、図1の第1階層のMBであるMc(132)と参照画像データ111の探索範囲112との間でブロックマッチングにより動きベクトルを検出する。(ブロックマッチング回路140により実行する。)
以下で、ブロックマッチングについて説明する。また、説明で用いている図において同一のものを示すものには同一の番号が付けられている。図4で第1階層の選択された処理画像データ401のMc(402)において左上の点403を原点とするとき、Mc内の画素位置404を座標( x, y)で表現しその輝度値をYtとする。また、図5で第1階層の選択された参照画像データ501において左上の点503を原点とするとき、Mc(402)の位置を中心とする探索範囲502内の画素位置504を座標( h, v)で表現しその輝度値をYrとする。
【0037】
この条件の下で、ブロックマッチングはYtとYrとの差分の絶対値の総和(H)
【0038】
【数5】
を、例えば第1階層のサーチレンジで与えられる水平・垂直ともにMcの位置を中心に±4画素の範囲内で、座標( h, v)を1画素ずつ水平・垂直にずらしながら求める。この結果、Hを最小にする座標( h, v)と処理画像データのMcの座標から第1階層の動きベクトル値が求められる。
【0039】
この様子を図6で説明する。以下の説明では、原点を参照画像データ501の左上の点503とする。第1階層の参照画像データ501の内部にベクトル探索領域502が与えられる。処理画像データのMc(402)の左上の点602を座標(hm, vm)とする。このときHを最小にする領域603の左上の点604が座標(hp, vp)であったとするとベクトル(mx, my)は、
【0040】
【数6】
として求められる。
【0041】
図11のS06の処理に対応して以下のように第2階層で動きベクトルの修正を行う。第1階層で求めたベクトル値を水平・垂直方向共に2倍して得られる位置を、第2階層でのブロックマッチングを行う中心位置とし、例えば第2階層のサーチレンジとして水平・垂直ともに±2画素で与えられる図1の参照画像データ104の探索範囲113に対して、処理画像データ124のMB(133)との間でブロックマッチングによりベクトル値を修正する(ブロックマッチング回路141により実行する)。この様子を図7、8、9で説明する。
【0042】
図7のHN×VN画素の第N階層の参照画像データ701に対して、第N階層の処理画像データのMB(702)の左上座標が(aN, bN)であり、動きベクトル703が( mx, my)であったとする。このとき、上位階層である図8の第N+1階層の参照画像データ801の画像サイズは水平・垂直ともに2倍の2HN×2VN画素となるので、第N+1階層の処理画像データのMB(802)のサイズも水平・垂直ともに2倍となり、左上座標も2倍の(2aN, 2bN)、動きベクトル803も2倍の(2mx, 2my)となる。
【0043】
この結果、図9で動きベクトル803により与えられるMBと同じサイズの領域901を中心に第N+1階層での動きベクトル探索範囲902が決定され、第N+1階層の動きベクトルが検出される。
【0044】
さらに、図11のS07の処理に対応して以下のように最上位階層で動きベクトルの修正を行う。第2階層で求めたベクトル値を水平・垂直方向共に2倍して得られる位置を最上位階層でのブロックマッチングの中心位置として、例えば最上位階層画像のサーチレンジで与えられる水平・垂直ともに±2画素の範囲内において、図1の参照画像データ101の探索範囲114に対して、処理画像データ121のMB(134)との間でブロックマッチングによりベクトルが修正される。(ブロックマッチング回路142により実行する。)
最後に、図11のS08の処理として、最上位階層で修正された動きベクトルが最終的な値として出力される。
【0045】
以上、実施例を説明したが、本発明は階層数を限定するものではなく、また何階層目に本発明の特徴である周波数領域分割によるブロックマッチングを適用するかも限定されるものではない。さらに、周波数空間を分割する領域数や分割するフィルタの特性も限定するものではない。また、サブサンプリングの位相も限定されない。
【0046】
即ち、時系列的に前後する処理画像データと参照画像データとの間の相関を求める際に、サブサンプリングにより画素を一定間隔で間引かれた画像データを用いる階層的相関検出において、、画像データの2次元周波数空間を複数の領域に分割するフィルタを備え、前記フィルタをサブサンプリングのプリフィルタとして用いて周波数領域を選択した後、サブサンプリングした画像データから相関を求めることを特徴とする動きベクトル検出装置とすればよい。
【0047】
さらには、この動きベクトル検出装置において、プリフィルタで抽出する2次元周波数領域を選択する際に、相関を求めるマクロブロックに含まれる周波数領域毎の輝度値の絶対値の総和に特定の係数を掛けた値の中から最大値を示す周波数領域を選択するようにすればよい。
【0048】
なお、上記した動きベクトル検出装置の機能を動きベクトル検出用プログラム(例えば図11のフローチャートに基づくプログラム)によりコンピュータに実現させるようにしいもよい。この動きベクトル検出用プログラムは、記録媒体から読みとられてコンピュータに取り込まれてもよいし、通信ネットワークを介して伝送されてコンピュータに取り込まれてもよい。
【0049】
【発明の効果】
以上説明したように、本発明の動きベクトル検出装置は、ブロックマッチングの演算量を増加させることなく、従来技術では除去されていた高域周波数成分を適応的に利用して動きベクトルを検出できるため、検出精度が向上する。(本発明においては、従来技術に比べてフィルタ処理とサブサンプリング処理の演算量が増加するものの、フィルタ処理とサブサンプリング処理の演算量は、ブロックマッチング演算の演算量に比べて非常に小さいものである。よって、ブロックマッチング演算の演算量増加に比べて、フィルタ処理とサブサンプリング処理の演算量増加は、動きベクトル検出の全体的な演算量増加に対する影響が非常に少なく、ブロックマッチングの演算量を増加させないことの効果は非常に大きいものである。)
【図面の簡単な説明】
【図1】本発明の実施形態に係わる動きベクトル検出装置のシステム構成図である。
【図2】2次元画像周波数空間の領域分割を表す図である。
【図3】階層動きベクトル検出装置の従来例のシステム構成図である。
【図4】第1階層における処理画像データの様子を示す図である。
【図5】第1階層における参照画像データの様子を示す図である。
【図6】第1階層における動きベクトル検出の様子を示す図である。
【図7】第N階層における動きベクトルを示す図である。
【図8】第N+1階層における動きベクトルを示す図である。
【図9】第N+1階層における動きベクトル検出の探索範囲を示す図である。
【図10】画素をサブサンプリングする方法の例を示した図である。
【図11】本発明の実施形態における動作説明用のフローチャートである。
【符号の説明】
102,122 2次元ローパスフィルタ
103,123 サブサンプリング処理回路
104,124 画像メモリ
105,125 プリフィルタ
106,126 サブサンプリング処理回路
107〜110、127〜130 画像メモリ
131 周波数領域選択器
140〜142 ブロックマッチング回路[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a technique for reducing the amount of calculation used for detecting a motion vector of an image by hierarchically using image data having different resolutions by sub-sampling in high-efficiency encoding of an image. It is used for compression encoding processing. The present invention provides an apparatus that can increase the accuracy of detecting a motion vector without increasing the amount of calculation for block matching.
[0002]
[Prior art]
A hierarchical search for a motion vector according to the related art will be described with reference to FIG. In this description, three layers including the highest layer are described for convenience, but the number of layers can be set arbitrarily. In FIG. 3, the reference image data is stored in theimage memory 301, and the processed image data is stored in the image memory 311 and is referred to as the highest hierarchical image.
[0003]
Horizontal and vertical low frequency components are extracted from the image data in theimage memories 301 and 311 by the two-dimensional low-pass filters 302 and 312. For example, a two-dimensional low-pass filter is realized by cascading a one-dimensional horizontal low-pass filter and a one-dimensional vertical low-pass filter with tap coefficients [1/2, 1/2]. Thesub-sampling processing circuits 303 and 313 perform a sub-sampling process on the image of the low frequency components extracted by the two-dimensional low-pass filters 302 and 312 to thin out every other pixel in the horizontal and vertical directions. Images whose image size is reduced to an area ratio of 1/4 by subsampling are stored in the image memories 304 and 314, and the stored images are referred to as second-layer images.
[0004]
The horizontal and vertical low frequency components are further extracted from the second hierarchical image by the two-dimensional low-pass filters 305 and 315, and sub-sampling processing is performed by thesub-sampling processing circuits 306 and 316. Images whose image size is further reduced to 1/4 by subsampling are stored in theimage memories 307 and 317, and the stored images are referred to as first-layer images.
[0005]
In this way, images having different resolutions are created hierarchically. For these hierarchical images, a motion vector is detected with the image with the lowest resolution, and the correction of the detected motion vector is repeated while going back to the image with the higher resolution.
[0006]
In FIG. 3, first, asearch range 321 ofreference image data 307 having the smallest number of pixels (image data stored in an image memory is referred to using the code of the image memory; the same applies to the following description). The vector is searched over a wide range by block matching with the macroblock 331 of the processedimage data 317 having the least number of pixels (executed by the block matching circuit 308).
[0007]
Next, asearch range 322 including the center position of the search determined by correcting the motion vector value obtained by the block matching by theblock matching circuit 308 using the reference image data 304 having the next higher resolution and the vicinity thereof is determined. Then, the motion vector value obtained by the block matchingcircuit 308 is corrected by block matching of the processed image data 314 with themacroblock 332. (Executed by theblock matching circuit 309.)
By repeating this process, finally, the search range 323 of thereference image data 301 of the highest hierarchy is subjected to block matching with themacroblock 333 of the processed image data 311 of the highest hierarchy (block matching circuit 310). ), And the motion vector value is determined and output.
[0008]
In this technique, since a wide range search is performed only in the first layer having a small number of pixels and a neighborhood search is performed in other layers, the number of operations is smaller than that in a case where block matching is performed extensively only with the highest hierarchical image having a large number of pixels. Vector detection is realized by the quantity. (For details, refer to JP-A-11-289545.)
[0009]
[Patent Document 1]
JP-A-11-289545
[Problems to be solved by the invention]
In the motion vector hierarchical search of an image, as the number of hierarchies increases, the amount of calculation decreases, and wide area motion vector detection becomes possible. At this time, a low-pass frequency component is extracted from each hierarchical image by a low-pass filter, and pixels are sub-sampled to generate a reduced image. As a result, there has been a problem that as the number of layers increases, higher frequency components are removed, and it is difficult to distinguish signal waveforms due to aliasing components, so that accurate block matching cannot be performed.
[0011]
In order to solve this problem, Japanese Patent Application Laid-Open No. H11-289545 described above searches a search start layer not only from the lowest layer but also from an intermediate layer, and selectively uses motion vectors having different search start layers. Suggest a way to do it.
[0012]
However, in the proposed method, since most of the calculation amount is occupied by the block matching calculation, the detection of a plurality of motion vectors causes an increase in the calculation amount, and a further reduction in the calculation amount has been required.
[0013]
SUMMARY OF THE INVENTION It is an object of the present invention to provide a motion vector detecting device capable of improving the accuracy of detecting a motion vector without increasing the amount of calculation for block matching in order to solve the above problem.
[0014]
[Means for Solving the Problems]
Therefore, in order to solve the above problems, the present invention
A top-level image memory that stores processed image data and reference image data that are chronologically preceding and following,
A first pre-filter for extracting a specific frequency region from each of the image data;
A first sub-sampler for evenly thinning out pixels of an image output from the first pre-filter;
A first image memory for storing an image with a reduced number of pixels output from the first sub-sampler;
A second prefilter that divides a two-dimensional frequency space from the image with the reduced number of pixels into a plurality of regions and outputs respective components;
A second sub-sampler for evenly thinning out pixels of a plurality of images having different frequency domains output from the second pre-filter;
A second image memory for storing a plurality of images with a reduced number of pixels output from the second sub-sampler;
A histogram calculator for calculating a sum of absolute values of pixel values included in a macroblock size proportional to the number of pixels of each of the processed image data, for each of the different processed image data in the frequency domain stored in the second image memory;
A multiplier that multiplies each histogram value output from the histogram calculator by a predetermined constant,
For the macroblock located at the same position of different processed image data in a plurality of frequency domains, the maximum value is obtained from the histogram values multiplied by the predetermined constant by the multiplier, and the maximum histogram value is obtained. A function of selecting a frequency region of the obtained processed image data, a macroblock of the processed image data extracted from the selected frequency region, and the second extracted from the same region as the selected frequency region. A second motion vector detector that calculates a motion vector value by block matching with reference image data stored in the second image memory;
A motion vector value obtained from the second motion vector detector is corrected, and a macro block of the processed image data stored in the first image memory and a reference image stored in the first image memory are corrected. A first vector detector that calculates a motion vector value from the data and
The motion vector value obtained from the first vector detector is corrected, and the macroblock of the processed image data stored in the uppermost image memory and the reference image data stored in the uppermost image memory are corrected. A top-level vector detector for calculating a motion vector value;
A motion vector detection device, comprising:
Is provided.
[0015]
BEST MODE FOR CARRYING OUT THE INVENTION
In the conventional method, by selecting the pre-filter characteristic at the time of sub-sampling to a characteristic that attenuates slowly, the high-frequency component is turned back, and the high-frequency information is preserved to some extent. However, basically, there is a problem in that block matching is performed using only a single filter output regardless of the frequency components included in the image data.
[0016]
Thus, this problem can be solved by adaptively selecting the characteristics of the prefilter and performing subsampling according to the frequency components included in the macroblock to be subjected to block matching.
[0017]
For example, the processing of the flowchart shown in FIG. 11 may be realized. First, the original images of the processed image data and the reference image data are stored in the image memory as the highest hierarchical image (Step 01, hereinafter referred to as S01, and so on). After extracting the horizontal and vertical low-frequency components from the original image, the image reduced in size by sub-sampling is stored in the image memory as second-layer image data (S02).
[0018]
The components of each frequency region are extracted from the second layer image data by a filter that divides the two-dimensional frequency space into a plurality of regions, and the image including each frequency component is stored in the image memory as the first layer image data (S03). .
[0019]
A band having a characteristic frequency component is selected from a plurality of macroblocks of processed image data holding different frequency components stored in the first hierarchical image data (S04).
[0020]
The characteristic frequency component includes, for example, a luminance histogram described later. A motion vector is searched by block matching between the macroblock of the processed image data including the selected frequency domain in the first hierarchical image data and the reference image data including the selected frequency domain (S05).
[0021]
The motion vector of S05 is corrected by block matching using the second layer image data in the search area centered on the motion vector detected in S05 (S06). Further, the motion vector of S06 is corrected by block matching using the highest hierarchical image data in the search area centered on the motion vector detected in S06 (S07). The motion vector detected in S07 is output as a search result (S08).
[0022]
In the present embodiment, a three-layer configuration using a low-frequency component in the first sub-sampling and using an adaptively selected frequency domain in the second sub-sampling is shown. This is because the second sub-sampling has a greater effect on frequency components including many image features than the first sub-sampling.
[0023]
An embodiment of the present invention will be described in detail with reference to a system configuration diagram of FIG. 1 and a flowchart showing a procedure of processing of FIG.
[0024]
In correspondence with the processing of S01 in the flowchart of FIG. 11, reference image data having (the number of horizontal pixels) 720 × (the number of vertical pixels) 480 pixels is stored in the image memory 101 of FIG. 1, and the processed image data is stored in the image memory 121. Then, it is called the highest hierarchical image.
[0025]
Next, an image of the second hierarchy is obtained by the following processing corresponding to S02 in FIG. The horizontal and vertical low frequency components are extracted from the respective images stored in the image memory 101 and the image memory 121 in FIG. 1 by the two-dimensional low-pass filters 102 and 122. For example, a two-dimensional low-pass filter is realized by cascade-connecting a one-dimensional horizontal low-pass filter having a tap coefficient of [, 2 ,, 1 /] and a one-dimensional vertical low-pass filter.
[0026]
Thesub-sampling processing circuits 103 and 123 apply sub-sampling processing to the outputs of the two-dimensional low-pass filters 102 and 122 every other pixel both horizontally and vertically. As a sub-sampling method, for example, an image size having an area ratio of 1/4 is created by using a method of deleting black pixels in FIG. 10 and leaving only white circles. In this way, the reference image data and the processed image data reduced in size to 360 × 240 pixels are created and stored in the image memories 104 and 124, respectively. This image is called a second hierarchical image.
[0027]
The first layer image is obtained by the following processing corresponding to S03 in FIG. The image of 360 × 240 pixels of the second hierarchy is shown in FIG. 2 as horizontal low / vertical low LL, horizontal low / vertical high LH, horizontal high / vertical low HL, horizontal high / vertical high HH is divided into four regions byprefilters 105 and 125. For example, an LL region is extracted by cascade-connecting a one-dimensional horizontal low-pass filter and a one-dimensional vertical low-pass filter having tap coefficients [, 2 ,, 1 /], and an LL region is extracted from the output of the one-dimensional horizontal low-pass filter. The LH area can be extracted by subtracting the LL area.
[0028]
In addition, a one-dimensional horizontal high-pass filter having tap coefficients [−1 /, 2 ,, −1 /] and a one-dimensional vertical low-pass filter having tap coefficients [, 2 ,, 4] are cascaded. Then, the HL area is extracted, and the HH area can be extracted by subtracting the HL area from the output of the one-dimensional horizontal high-pass filter.
[0029]
Sub-sampling processing is performed by the sub-sampling processing circuits 106 and 126 on the generated four pieces of image data having 360 × 240 pixels every other pixel both horizontally and vertically, and each of the four pieces of image data having 180 × 120 pixels is reduced in size. Obtain image data. Each image data in the LL area is stored in theimage memories 107 and 127, each image data in the LH area is stored in theimage memories 108 and 128, each image data in the HL area is stored in theimage memories 109 and 129, and each image data in the HH area is stored in the image memory. It is stored in thememories 110 and 130. This image is called a first hierarchical image. As a result, in the first layer, four pieces of reference image data and four pieces of processed image data, each of which has been reduced in size to an area ratio of 1/16 from the image of the highest layer, are stored.
[0030]
A frequency band is selected by the following method corresponding to S04 in FIG. In the present embodiment, a case is considered in which a motion vector is detected in a macroblock (hereinafter, referred to as MB) in units of 16 × 16 pixels in the highest hierarchical image of 720 × 480 pixels. Since the first hierarchical images 127 to 130 are reduced in size to thearea ratio 1/16 of the top hierarchical image 121, the MBs are also reduced in size to thearea ratio 1/16, and block matching is performed in units of 4 × 4 pixels. , Detect the motion vector. Since the first hierarchical image includes four images 127 to 130 having different frequency domains, there are also four MBs located at the same coordinates in the image. Sum of absolute values of luminance levels (Yi: i = LL, LH, HL, HH) at coordinates (x, y) in this MB (MBi: i = LL, LH, HL, HH)
[0031]
(Equation 1)
Is calculated, and histograms MBLL, MBLH, MBHL, and MBHH of each MB are obtained (calculated by a histogram calculator in the frequency domain selector 131). At this time, since the LL region includes a DC component, there is a possibility that a problem may occur when compared with other regions simply. Therefore, only MBLL
(Equation 2)
[0033]
[Equation 3]
A method of removing a DC component is used.
[0034]
In thefrequency domain selector 131 for performing a motion vector search, MBLL, MBLH, MBHL, MBHH are respectively multiplied by weighting factors KLL, KLH, KHL, KHH by a built-in multiplier.
[0035]
(Equation 4)
After the MBi having the maximum value is selected as Mc, it is stored in theimage memory 132. In the present embodiment, Ki = 1. Reference image data in the same frequency region as the image data to which Mc belongs is selected from theimage memories 107 to 110 and stored in the image memory 111.
[0036]
In response to the processing in S05 in FIG. 11, a motion vector is detected by block matching between Mc (132), which is the first layer MB in FIG. 1, and the search range 112 of the reference image data 111. (Executed by theblock matching circuit 140.)
Hereinafter, block matching will be described. In the drawings used in the description, the same components are denoted by the same reference numerals. In FIG. 4, when the upperleft point 403 is the origin in the Mc (402) of the selected processed image data 401 of the first hierarchy, thepixel position 404 in the Mc is represented by the coordinates (x, y), and the luminance value is obtained. Let it be Yt. In FIG. 5, when the upperleft point 503 is selected as the origin in the selected reference image data 501 of the first hierarchy, thepixel position 504 in thesearch range 502 centered on the position of Mc (402) is set to the coordinates (h, v) and the luminance value is Yr.
[0037]
Under this condition, the block matching is the sum (H) of the absolute values of the differences between Yt and Yr.
[0038]
(Equation 5)
For example, the coordinates (h, v) are obtained by shifting the coordinates (h, v) horizontally and vertically by one pixel within a range of ± 4 pixels around the position of Mc both in the horizontal and vertical directions given by the search range of the first hierarchy. As a result, the motion vector value of the first layer is obtained from the coordinates (h, v) that minimize H and the coordinates of Mc of the processed image data.
[0039]
This will be described with reference to FIG. In the following description, the origin is defined as apoint 503 at the upper left of the reference image data 501. Avector search area 502 is provided inside the first-layer reference image data 501. Apoint 602 at the upper left of Mc (402) of the processed image data is defined as coordinates (hm, vm). At this time, if the upper left point 604 of the area 603 where H is minimized is the coordinates (hp, vp), the vector (mx, my) becomes
[0040]
(Equation 6)
Is required.
[0041]
The correction of the motion vector is performed in the second layer as follows in correspondence with the processing of S06 in FIG. A position obtained by doubling the vector value obtained in the first hierarchy in both the horizontal and vertical directions is defined as a center position for performing block matching in the second hierarchy, for example, ± 2 in both the horizontal and vertical directions as a search range in the second hierarchy. The vector value is corrected by block matching between the MB (133) of the processed image data 124 and the search range 113 of the reference image data 104 of FIG. 1 given by pixels (executed by the block matching circuit 141). This situation will be described with reference to FIGS.
[0042]
7, the upper left coordinates of the MB (702) of the processed image data of the Nth layer are (aN, bN), and themotion vector 703 is (mx) , My). At this time, the image size of the reference image data 801 of the (N + 1) -th layer in the upper layer of FIG. 8 is 2HN × 2VN pixels, which is twice as large in both the horizontal and vertical directions, so that the MB (802) of the processed image data of the (N + 1) -th layer The size is also doubled both horizontally and vertically, the upper left coordinate is also doubled (2aN, 2bN), and themotion vector 803 is also doubled (2mx, 2my).
[0043]
As a result, the motionvector search range 902 in the (N + 1) -th layer is determined centering on the area 901 having the same size as the MB given by themotion vector 803 in FIG. 9, and the (N + 1) -th layer motion vector is detected.
[0044]
Further, the motion vector is corrected in the highest hierarchy as follows in correspondence with the processing in S07 in FIG. A position obtained by doubling the vector value obtained in the second hierarchy in both the horizontal and vertical directions is used as the center position of the block matching in the highest hierarchy, for example, in both the horizontal and vertical directions given by the search range of the highest hierarchy image. In the range of two pixels, the vector is corrected by block matching between thesearch range 114 of the reference image data 101 in FIG. 1 and the MB (134) of the processed image data 121. (Executed by theblock matching circuit 142.)
Finally, as the processing of S08 in FIG. 11, the motion vector corrected in the highest hierarchy is output as the final value.
[0045]
Although the embodiment has been described above, the present invention does not limit the number of layers, and the number of layers to which the block matching based on frequency domain division, which is a feature of the present invention, is not limited. Further, the number of regions into which the frequency space is divided and the characteristics of the filter into which the frequency space is divided are not limited. Further, the phase of the sub-sampling is not limited.
[0046]
That is, when calculating the correlation between the processed image data and the reference image data which are successive in time series, in the hierarchical correlation detection using the image data in which the pixels are thinned out at regular intervals by sub-sampling, the image data A filter for dividing a two-dimensional frequency space into a plurality of regions, selecting a frequency region by using the filter as a pre-filter for sub-sampling, and obtaining a correlation from the sub-sampled image data. What is necessary is just to be a detection apparatus.
[0047]
Further, in the motion vector detecting device, when selecting a two-dimensional frequency region to be extracted by the pre-filter, a specific coefficient is multiplied by a sum of absolute values of luminance values for each frequency region included in a macroblock for which correlation is to be obtained. What is necessary is just to select the frequency region showing the maximum value from the values.
[0048]
Note that the functions of the motion vector detection device described above may be realized by a computer using a motion vector detection program (for example, a program based on the flowchart in FIG. 11). This program for detecting a motion vector may be read from a recording medium and taken into a computer, or may be transmitted via a communication network and taken into a computer.
[0049]
【The invention's effect】
As described above, the motion vector detecting device of the present invention can detect a motion vector by adaptively using a high-frequency component which has been removed in the related art without increasing the amount of calculation for block matching. The detection accuracy is improved. (In the present invention, although the calculation amount of the filtering process and the sub-sampling process increases as compared with the conventional technology, the calculation amount of the filtering process and the sub-sampling process is very small compared to the calculation amount of the block matching calculation. Therefore, compared to the increase in the amount of operation of the block matching operation, the increase in the amount of operation of the filtering process and the sub-sampling process has a very small effect on the increase in the overall amount of operation of the motion vector detection. The effect of not increasing is very large.)
[Brief description of the drawings]
FIG. 1 is a system configuration diagram of a motion vector detection device according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating area division in a two-dimensional image frequency space.
FIG. 3 is a system configuration diagram of a conventional example of a hierarchical motion vector detection device.
FIG. 4 is a diagram showing a state of processed image data in a first hierarchy.
FIG. 5 is a diagram illustrating a state of reference image data in a first hierarchy.
FIG. 6 is a diagram showing a state of motion vector detection in a first hierarchy.
FIG. 7 is a diagram illustrating a motion vector in an N-th layer.
FIG. 8 is a diagram showing a motion vector in the (N + 1) -th layer.
FIG. 9 is a diagram illustrating a search range of motion vector detection in the (N + 1) -th layer.
FIG. 10 is a diagram illustrating an example of a method of sub-sampling pixels.
FIG. 11 is a flowchart for explaining an operation in the embodiment of the present invention.
[Explanation of symbols]
102, 122 Two-dimensional low-pass filter 103, 123 Sub-sampling processing circuit 104, 124Image memory 105, 125 Pre-filter 106, 126 Sub-sampling processing circuit 107-110, 127-130Image memory 131 Frequency domain selector 140-142 Block matching circuit