JP4239557B2 - Image processing apparatus and method, recording medium, and program - Google Patents
Image processing apparatus and method, recording medium, and program Download PDFInfo
- Publication number
- JP4239557B2 JP4239557B2 JP2002327271A JP2002327271A JP4239557B2 JP 4239557 B2 JP4239557 B2 JP 4239557B2 JP 2002327271 A JP2002327271 A JP 2002327271A JP 2002327271 A JP2002327271 A JP 2002327271A JP 4239557 B2 JP4239557 B2 JP 4239557B2
- Authority
- JP
- Japan
- Prior art keywords
- class code
- pixel
- block
- pixel values
- pixels
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、画像処理装置および方法、記録媒体、並びにプログラムに関し、例えば、時間的に連続する画像対の画素同士をマッチングさせ、マッチングの結果に基づいて画素単位の動きベクトルを検出する場合に用いて好適な画像処理装置および方法、記録媒体、並びにプログラムに関する。
【0002】
【従来の技術】
例えば、MPEG2(Moving Picture Experts Group)方式等の画像信号を圧縮符号化する処理においては、隣接する2フレーム間の相関関係に基づく符号化処理、いわゆる動き補償フレーム間予測が用いられている。動き補償フレーム間予測では、隣接する2フレーム(一方を対象フレーム、他方を参照フレームと記述する)の間における各画素単位または所定サイズの画素ブロック単位の動きベクトルを検出する処理が必要となる。
【0003】
動きベクトルを検出する方法としては、従来、ブロックマッチングアルゴリズムと称される方法が用いられている(例えば、特許文献1参照)。
【0004】
図1は、ブロックマッチングアルゴリズムに従って動きベクトルを検出する動きベクトル検出装置の構成例を示している。この動きベクトル検出装置1は、入力される画像信号を1フレーム分だけ保持して後段に出力するフレームメモリ2,3、およびフレームメモリ2,3からそれぞれ1フレームずつ入力される画像信号に基づき、フレームメモリ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内の動きベクトルを算出する。ブロックマッチングアルゴリズムについて、対象フレームFcと参照フレームFrの対応関係を示す図2および処理に順序を示す図3のフローチャートを参照して説明する。
【0008】
ブロックマッチングアルゴリズムでは、対象フレームFc内の全ての画素が、順次、注目画素に指定され、注目画素を中心とする所定サイズ(L×L画素)の基準ブロックと、参照フレームFrに設けられたサーチエリアSR内で移動される参照ブロック(基準ブロックと同じサイズ)との対応する画素対の画素値の差分絶対値和が次式(1)に従って演算される。
ΣiΣj=|Fc(i,j)−Frn(i,j)| ・・・(1)
【0009】
ただし、Fc(i,j)は基準ブロックの画素の画素値であり、Frn(i,j)は識別番号nの参照ブロックの画素の画素値である。また、Σiはiを1からLまで1ずつインクリメントしたときの総和演算を意味し、Σjはjを1からLまで1ずつインクリメントしたときの総和演算を意味するものとする。
【0010】
そして、基準ブロックと参照ブロックとの対応する画素対の画素値の差分絶対値和が最小となるときの参照ブロックの中心座標と注目画素の座標との差分ベクトルが動きベクトルとして算出される。
【0011】
具体的には、対象フレームFcの注目画素に対して、以下の処理が実行される。ステップS1において、検出部4は、参照フレームFcに、対象フレームFcの注目画素の座標と同じ座標を中心として、基準ブロックよりも大きなサイズのサーチエリアSRを設定する。
【0012】
ステップS2において、検出部4は、差分絶対値和の最小値を格納する変数minを、その最大値に初期化する。例えば、1画素の画素値が8ビット、基準ブロックのサイズが4×4画素である場合、変数minが、4096(=28×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の注目画素の座標との差分ベクトルを、対象フレームFcの注目画素の動きベクトルとして算出する。以上で、ブロックマッチングアルゴリズムの説明を終了する。
【0020】
【特許文献1】
特許第3277417号公報
【0021】
【発明が解決しようとする課題】
上述したブロックマッチングアルゴリズムは、ステップS5の処理における画素対の画素値の差分絶対値和の演算量が非常に膨大となっており、画像圧縮処理に要する時間の大半がこの演算に費やされてしまうという課題があった。
【0022】
本発明はこのような状況に鑑みてなされたものであり、僅かな演算量だけで画像間のマッチングを行うことができ、しかも動きベクトル等を精度良く検出できるようにすることを目的とする。
【0023】
【課題を解決するための手段】
本発明の画像処理装置は、入力された画像において注目する注目画素と、その近傍の画素とからなる所定のサイズのブロックを設定する設定手段と、設定手段によって設定されたブロックに含まれる複数の画素の画素値の最小値に、ブロックに含まれる複数の画素の画素値の最大値と、最小値との差で表されるダイナミックレンジの1/2を加算して、閾値を算出する算出手段と、サンプルとなる複数の画像について、所定のサイズのブロックを設定し、設定したブロックに対応するクラスコードを生成し、前フレームの画像についてのクラスコードと比較することで得られるクラスコードの中のビット反転の発生頻度の累計を所定の値に決定するビット数と、クラスコードとが対応付けられた対応テーブルを保持する保持手段と、保持手段によって保持された対応テーブルを参照して、生成されるクラスコードに対応するビット数を取得する取得手段と、設定手段によって設定されたブロックに含まれる複数の画素の画素値を、それぞれ、算出手段によって算出された閾値よりも大きい場合には1に符号化し、閾値よりも小さい場合には0に符号化して、注目画素に対するクラスコードを生成し、さらに、生成したクラスコードに対応するブロックに含まれる複数の画素の画素値のうち、算出手段によって算出された閾値に近い方から、取得手段によって取得されたビット数の画素の画素値を、それぞれ0および1の2通りに符号化する生成手段とを備える。
【0027】
本発明の画像処理方法は、入力された画像において注目する注目画素と、その近傍の画素とからなる所定のサイズのブロックを設定する設定ステップと、設定ステップの処理で設定されたブロックに含まれる複数画素の画素値の最小値に、ブロックに含まれる複数の画素の画素値の最大値と、最小値との差で表されるダイナミックレンジの1/2を加算して、閾値を算出する算出ステップと、サンプルとなる複数の画像について、所定のサイズのブロックを設定し、設定したブロックに対応するクラスコードを生成し、前フレームの画像についてのクラスコードと比較することで得られるクラスコードの中のビット反転の発生頻度の累計を所定の値に決定するビット数と、クラスコードとが対応付けられた対応テーブルを参照して、生成されるクラスコードに対応するビット数を取得する取得ステップと、設定ステップの処理で設定されたブロックに含まれる複数の画素の画素値を、それぞれ、算出ステップの処理で算出された閾値よりも大きい場合には1に符号化し、閾値よりも小さい場合には0に符号化して、注目画素に対するクラスコードを生成し、さらに、生成したクラスコードに対応するブロックに含まれる複数の画素の画素値のうち、算出ステップの処理で算出された閾値に近い方から、取得ステップの処理で取得されたビット数の画素の画素値を、それぞれ0および1の2通りに符号化する生成ステップとを含む。
【0028】
本発明の記録媒体のプログラムは、入力された画像において注目する注目画素と、その近傍の画素とからなる所定のサイズのブロックを設定する設定ステップと、設定ステップの処理で設定されたブロックに含まれる複数画素の画素値の最小値に、ブロックに含まれる複数の画素の画素値の最大値と、最小値との差で表されるダイナミックレンジの1/2を加算して、閾値を算出する算出ステップと、サンプルとなる複数の画像について、所定のサイズのブロックを設定し、設定したブロックに対応するクラスコードを生成し、前フレームの画像についてのクラスコードと比較することで得られるクラスコードの中のビット反転の発生頻度の累計を所定の値に決定するビット数と、クラスコードとが対応付けられた対応テーブルを参照して、生成されるクラスコードに対応するビット数を取得する取得ステップと、設定ステップの処理で設定されたブロックに含まれる複数の画素の画素値を、それぞれ、算出ステップの処理で算出された閾値よりも大きい場合には1に符号化し、閾値よりも小さい場合には0に符号化して、注目画素に対するクラスコードを生成し、さらに、生成したクラスコードに対応するブロックに含まれる複数の画素の画素値のうち、算出ステップの処理で算出された閾値に近い方から、取得ステップの処理で取得されたビット数の画素の画素値を、それぞれ0および1の2通りに符号化する生成ステップとを含む処理をコンピュータに実行させる。
【0029】
本発明のプログラムは、入力された画像において注目する注目画素と、その近傍の画素とからなる所定のサイズのブロックを設定する設定ステップと、設定ステップの処理で設定されたブロックに含まれる複数画素の画素値の最小値に、ブロックに含まれる複数の画素の画素値の最大値と、最小値との差で表されるダイナミックレンジの1/2を加算して、閾値を算出する算出ステップと、サンプルとなる複数の画像について、所定のサイズのブロックを設定し、設定したブロックに対応するクラスコードを生成し、前フレームの画像についてのクラスコードと比較することで得られるクラスコードの中のビット反転の発生頻度の累計を所定の値に決定するビット数と、クラスコードとが対応付けられた対応テーブルを参照して、生成されるクラスコードに対応するビット数を取得する取得ステップと、設定ステップの処理で設定されたブロックに含まれる複数の画素の画素値を、それぞれ、算出ステップの処理で算出された閾値よりも大きい場合には1に符号化し、閾値よりも小さい場合には0に符号化して、注目画素に対するクラスコードを生成し、さらに、生成したクラスコードに対応するブロックに含まれる複数の画素の画素値のうち、算出ステップの処理で算出された閾値に近い方から、取得ステップの処理で取得されたビット数の画素の画素値を、それぞれ0および1の2通りに符号化する生成ステップとを含む処理をコンピュータに実行させる。
【0030】
本発明の画像処理装置および方法、記録媒体、並びにプログラムにおいては、注目画素を含む所定のサイズのブロックに含まれる複数の画素の画素値が、算出された閾値よりも大きい場合には1に符号化され、閾値よりも小さい場合には0に符号化されて注目画素に対するクラスコードが生成され、さらに、生成されたクラスコードに対応するブロックに含まれる複数の画素の画素値のうち、算出された閾値に近い方から、取得されたビット数の画素の画素値が、それぞれ0および1の2通りに符号化される。
【0031】
【発明の実施の形態】
本発明を適用した動きベクトル検出装置の構成例について、図4を参照して説明する。この動きベクトル検出装置11は、フレームメモリ12,13、クラスコード生成部14、テーブルメモリ15、MEメモリ16、および動きベクトル演算部17から構成される。
【0032】
フレームメモリ12は、入力された画像信号を1フレームだけ保持し、次のフレームの画像信号が入力されたとき、保持していた画像信号をフレームメモリ13およびクラスコード生成部14に出力する。フレームメモリ13は、入力された画像信号を1フレームだけ保持し、次のフレームの画像信号がフレームメモリ12から入力されたとき、保持していた画像信号をクラスコード生成部14に出力する。
【0033】
したがって、クラスコード生成部14には、時間的に前後する2フレームの画像信号が入力されることになる。以下、フレームメモリ12からクラスコード生成部14に入力される1フレームの画像信号の画像を、対象フレームFcと記述する。また、フレームメモリ13から検出部4に入力される、対象フレームFcよりも1フレームだけ以前の画像信号の画像を、参照フレームFrと記述する。
【0034】
クラスコード生成部14は、対象フレームFcの全ての画素に対し、それぞれ、近傍の画素の画素値を用いた空間的な特徴を示すクラスコードを1種類だけ生成して、動きベクトル演算部17に出力する。具体的には、対象フレームFcの全ての画素を、順次、注目画素に設定し、注目画素を中心とする所定サイズのクラスコード用タップ(例えば、図5に示すような3×3画素)を決定して、クラスコード用タップに含まれる複数の画素(図5の場合、9画素)の画素値を、1ビットADRC(Adaptive Dynamic Range Coding)によってそれぞれ0また1に符号化して、所定のビット数(図5の場合、9ビット)のクラスコードを生成する。
【0035】
また、クラスコード生成部14は、参照フレームFrの全ての画素に対し、それぞれ、近傍の画素の画素値を用いた空間的な特徴を示すクラスコードを1種類だけ生成する。ただし、参照フレームFrは、1回前のタイミングにおいて対象フレームFcであったものであるので、参照フレームFrの各画素に対する1種類のクラスコードは、既に1回前のタイミングにおいて生成されている。よって、1回前のタイミングにおいて対象フレームFcの各画素に対して生成されたクラスコードを保持するようにして、今回のタイミングにおける参照フレームFrの各画素に対するクラスコードとして流用するようにしてもよい。
【0036】
さらに、クラスコード生成部14は、テーブルメモリ15に予め保持されている、第1または第2のテーブルに基づいて、生成した1種類のクラスコードを構成する複数のビットのうち、所定のビットをそれぞれ0にした場合と1にした場合の2通りを場合分けして、1種類以上のクラスコードを生成し、MEメモリ16に出力する。なお、参照フレームFrの画素に対してクラスコードを生成する処理については後述する。
【0037】
テーブルメモリ15には、クラスコードと、0と1の2通りに場合分けして符号化させるビット数との対応を示す第1のテーブルと、クラスコードとクラスコード用タップにおける各画素位置のビット反転の発生の頻度を示す第2のテーブルが記憶されている。なお、第1および第2のテーブルは、サンプルとなる複数の画像信号を用いて予め統計的に生成されて、テーブルメモリ15に予め記憶されているものとする。
【0038】
第1のテーブルを生成する処理について、図6乃至図8を参照して説明する。まず、サンプルとなる複数の画像信号の各画素に対して、クラスコード用タップが設定されて、ADRCによりクラスコードが生成される。次に、生成された全てのクラスコードがそれぞれ元となったクラスコード用タップ内の複数の画素値と比較されて、クラスコードの中でビット反転が生じているビットが判定され、そのビット数が計数される。そして、その計数結果に基づき、図6に示すような、横軸にビット数、縦軸に正規化されたビット反転の発生頻度を示すヒストグラムが生成される。
【0039】
なお、図6には、4種類のクラスコードに対する計数結果を示す折れ線a乃至dが示されているが、実際には、例えば、クラスコードが9ビットである場合、512(=29)種類のクラスコードに対する計数結果をそれぞれ示す512本の折れ線が得られることになる。さらに、各クラスコードについて、ビット反転の発生頻度の累計が所定の値となるようにビット数Kが決定されて、第1のテーブルに書き込まれる。なお、当該所定の値は、全てのクラスコードに対して共通の値が用いられる。
【0040】
例えば、当該所定の値が40%と定められた場合、折れ線dに対応するクラスコードに対しては、図7に示すように、ビット数K=1が決定される。また、例えば、当該所定の値が80%と定められた場合、折れ線dに対応するクラスコードに対しては、図8に示すように、ビット数K=3が決定される。
【0041】
図9は、図5のクラスコード用タップが用いられて生成された9ビットのクラスコードに対応する第1のテーブルの一例を示している。この例では、クラスコード100011111とビット数K=3が対応付けられていることを示している。また、クラスコード101001111とビット数K=2が対応付けられていることを示している。
【0042】
次に、第2のテーブルを生成する処理について、図10を参照して説明する。まず、複数のサンプルの画像信号の各画素に対して、クラスコード用タップが設定されて、ADRCによりクラスコードが生成される。次に、生成された全てのクラスコードがそれぞれ元となったクラスコード用タップ内の複数の画素値と比較されて、クラスコードの中でビット反転が生じているビットが判定され、ビット反転が生じているビットに対する画素のクラスコード用タップにおける位置が判定される。そして、その判定結果に基づき、図10に示すような、横軸にクラスコード用タップにおける画素の位置、縦軸に正規化されたビット反転の頻度を示すヒストグラムが生成されて、第2のテーブルが生成される。
【0043】
なお、図10には、3種類のクラスコードに対する判定結果が折れ線e乃至gを用いて示されているが、実際には、例えば、クラスコードが9ビットである場合、512(=29)種類のクラスコードに対する判定結果をそれぞれ示す512本の折れ線が得られることになる。
【0044】
図11は、図5のクラスコード用タップが用いられて生成された9ビットのクラスコードに対応する第2のテーブルの一例を示している。第2のテーブルには、9ビットの各クラスコードにそれぞれ対応して、9カ所の画素位置のビット反転の発生頻度が格納されることになる。
【0045】
例えば、クラスコード000000000については、注目画素の左上の画素値P1を符号化した際のビット反転の発生頻度が0であり、注目画素の真上の画素値P2を符号化した際のビット反転の発生頻度が0.05であり、注目画素の右上の画素値P3、真左の画素値P4、および注目画素の画素値P5を符号化した際のビット反転の発生頻度が0であり、注目画素の真右の画素値P6を符号化した際のビット反転の発生頻度が0.06であり、注目画素の左下の画素値P7、真下の画素値P8、および右下の画素値P9を符号化した際のビット反転の発生頻度が0であることを示している。
【0046】
また、例えば、クラスコード101000110については、注目画素の左上の画素値P1を符号化した際のビット反転の発生頻度が0.09であり、注目画素の真上の画素値P2を符号化した際のビット反転の発生頻度が0.55であり、注目画素の右上の画素値P3を符号化した際のビット反転の発生頻度が0.04であり、注目画素の真左の画素値P4を符号化した際のビット反転の発生頻度が0.3であり、注目画素の画素値P5を符号化した際のビット反転の発生頻度が0.1であり、注目画素の真右の画素値P6を符号化した際のビット反転の発生頻度が0.09であり、注目画素の左下の画素値P7を符号化した際のビット反転の発生頻度が0.15であり、注目画素の真下の画素値P8および右下の画素値P9を符号化した際のビット反転の発生頻度が0.08であることを示している。
【0047】
図4に戻る。MEメモリ16は、クラスコード生成部14から入力される参照フレームFrの各画素に対する1種類以上のクラスコードを、クラスコードに各画素の座標を対応付けて記憶する。
【0048】
図12は、MEメモリ16の構造を示している。MEメモリ16は、特徴量アドレス0乃至aと、フラグアドレス0乃至bによって示される(a+1)×(b+1)個のセルにより構成される。以下、例えば、特徴量アドレス1、フラグアドレス2のセルをセル(1,2)と記述する。
【0049】
特徴量アドレスは、クラスコード生成部14によって生成される参照フレームFrの各画素に対して生成されたクラスコードに対応する。例えば、クラスコードが9ビットである場合、特徴量アドレスの最大値a=29となる。
【0050】
特徴量アドレス0のフラグアドレス1以降のセルには、クラスコード生成部14によってクラスコード0が生成された参照フレームFrの画素の座標がラスタ順に格納される。特徴量アドレス0のフラグアドレス0のセル(0,0)には、クラスコード0の画素の座標が既に格納されている、特徴量アドレス0のフラグアドレス1以降のセル、すなわち、使用済のセルの数が格納される。例えば、参照フレームFrの画素のうち、3画素に対してそれぞれクラスコード0が生成された場合、セル(0,1)、セル(0,2)、セル(0,3)に3画素それぞれの座標が格納され、セル(0,0)に座標が格納されているセルの数である3が格納される。
【0051】
特徴量アドレス1のフラグアドレス1以降のセルには、クラスコード生成部14によってクラスコード1が生成された参照フレームFrの画素の座標がラスタ順に格納される。特徴量アドレス1のフラグアドレス0のセル(1,0)には、クラスコード1の画素の座標が格納されている、特徴量アドレス0のフラグアドレス1以降のセルの数が格納される。例えば、参照フレームFrの画素のうち、10画素に対して同一のクラスコード1が生成された場合、セル(1,1)、…、セル(1,10)に10画素それぞれの座標が格納され、セル(1,0)に、座標が格納されているセルの数である10が格納される。特徴量アドレス2以降のセルについても同様であるので、その説明は省略する。
【0052】
また、例えば、参照フレームFrのある画素に対して3種類のクラスコードが生成された場合、当該画素の座標が、3種類のクラスコードに対応する特徴量アドレスの3つのセルに格納されることになる。
【0053】
図4に戻る。動きベクトル演算部17は、対象フレームFcの各画素について、同じクラスコードが生成された参照フレームFrの画素の座標を、MEメモリ16から検索し、検索された画素のうち、注目画素の座標に最も距離が近い座標の画素を、対象フレームFcの注目画素に対応する参照フレームFrの画素に決定して、注目画素の動きベクトルを算出する。
【0055】
次に、クラスコード生成部14による第1のテーブルを用いたクラスコード生成処理について、図13のフローチャートを参照して説明する。この処理は、参照フレームFrの各画素が、順次、注目画素に指定され、注目画素に対して実行されるものである。
【0056】
ステップS11において、クラスコード生成部14は、注目画素を中心とする所定サイズのクラスコード用タップを設定し、クラスコード用タップに含まれる複数の画素の画素値を取得する。以下においては、図5に示されたように、クラスコード用タップのサイズを3×3画素とし、注目画素の左上、真上、右上、真左、注目画素自身、真右、左下、真下、右下の画素の画素値を、それぞれP1乃至P9として説明を継続する。
【0057】
ステップ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)
【0058】
ステップS15において、クラスコード生成部14は、画素値P1乃至P9を、それぞれ閾値Thと比較し、閾値Thよりも大きい場合には1に符号化し、閾値Thよりも小さい場合には0に符号化して画素の配置の順に並べ、9ビットのクラスコードを生成する。
【0059】
なお、ステップS11乃至S15の処理は、対象フレームFcの各画素に対してクラスコードを生成する処理として、現在の参照フレームFrが1回前のタイミングにおいて対象フレームFcであったときに実行されているので、その結果を流用してもよい。
【0060】
ステップS16において、クラスコード生成部14は、テーブルメモリ15に記憶されている第1のテーブルを参照して、ステップS15の処理で生成したクラスコードに対応するビット数Kを取得する。なお、ここで取得したビット数K=0である場合、以下に述べるステップS17の処理は省略される。
【0061】
ステップS17において、クラスコード生成部14は、画素値P1乃至P9のうち、閾値Thに最も近いK個の画素値については、それぞれ0に符号化する場合と1に符号化する場合の2通りに場合分けして、その他の画素値については、ステップS15の処理と同様に、閾値Thとの比較により、0または1に符号化して、注目画素に対する2K種類のクラスコードを生成する。なお、当該その他の画素値の符号化については、ステップ15の結果を流用するようにしてもよい。
【0062】
例えば、クラスコード用タップに含まれる9画素の画素値P1乃至P9が図14に示すような状態である場合、ステップS15の処理により9ビットのクラスコード100011111が生成される。そして、ステップS16の処理により、第1のテーブルから、9ビットのクラスコード100011111に対応するビット数K=3が取得される。さらに、ステップS17において、閾値Thに最も近い3個の画素値P3,P6,P8について、それぞれ0に符号化する場合と1に符号化する場合の2通りに場合分けされ、8(=23)種類の9ビットのクラスコード100010101,100010111,100011101,100011111,101010101,101010111,101011101,101011111が生成される。
【0063】
また例えば、クラスコード用タップに含まれる9画素の画素値P1乃至P9が図15に示すような状態である場合、ステップS15の処理により9ビットのクラスコード101001111が生成される。そして、ステップS16の処理により、第1のテーブルから、9ビットのクラスコード101001111に対応するビット数K=2が取得される。さらに、ステップS17において、閾値Thに最も近い2個の画素値P6,P8について、それぞれ0に符号化する場合と1に符号化する場合の2通りに場合分けされ、4(=22)種類の9ビットのクラスコード101000101,101000111,101001101,101001111が生成される。
【0064】
以上で、クラスコード生成部14による第1のテーブルを用いたクラスコード生成処理の説明を終了する。
【0065】
次に、クラスコード生成部14による第2のテーブルを用いたクラスコード生成処理について、図16を参照して説明する。この処理は、参照フレームFrの各画素が、順次、注目画素に指定され、注目画素に対して実行されるものである。
【0066】
ステップS21において、クラスコード生成部14は、注目画素を中心とする所定サイズのクラスコード用タップを設定し、クラスコード用タップに含まれる複数の画素の画素値を取得する。以下においては、図5に示されたように、クラスコード用タップのサイズを3×3画素とし、注目画素の左上、真上、右上、真左、注目画素自身、真右、左下、真下、右下の画素の画素値を、それぞれP1乃至P9として説明を継続する。
【0067】
ステップS22において、クラスコード生成部14は、画素値P1乃至P9の最大値PMAXと最小値PMINを判定する。ステップS23において、クラスコード生成部14は、画素値P1乃至P9のダイナミックレンジDR(=|最大値PMAX−最小値PMIN|)を算出する。ステップS24において、クラスコード生成部14は、式(2)のように、画素値P1乃至P9の最小値PMINに、ダイナミックレンジDR/2を加算して閾値Thを算出する。
【0068】
ステップS25において、クラスコード生成部14は、画素値P1乃至P9を、それぞれ閾値Thと比較し、閾値Thよりも大きい場合には1に符号化し、閾値Thよりも小さい場合には0に符号化して画素の配置の順に並べ、9ビットのクラスコードを生成する。
【0069】
なお、ステップS21乃至S25の処理は、対象フレームFcの各画素に対してクラスコードを生成する処理として、現在の参照フレームFrが1回前のタイミングにおいて対象フレームFcであったときに実行されているので、その結果を流用してもよい。
【0070】
ステップS26において、クラスコード生成部14は、テーブルメモリ15に記憶されている第2のテーブルを参照して、ステップS25の処理で生成したクラスコードのうち、0と1の2通りに場合分けするビットの画素位置を、以下の4種類の方法のうち、予め定められている方法を用いて決定する。
【0071】
第1の方法は、各クラスコードについて、ビット反転の発生頻度が高い方の上位の所定の数カ所(例えば、2カ所)の画素位置を、0と1の2通りに場合分けするビットの画素位置に決定する方法である。
【0072】
第2の方法は、各クラスコードについて、ビット反転の発生頻度の累計が所定の値になるまで、発生頻度が高い方から順に数カ所の画素位置を、0と1の2通りに場合分けするビットの画素位置に決定する方法である。
【0073】
第3の方法は、第2のテーブルの全てのクラスコードにそれぞれ対応する合計29×9カ所の発生頻度のうち、ビット反転の発生頻度が高い方の上位の所定の数カ所(例えば、100カ所)の画素位置を、0と1の2通りに場合分けするビットの画素位置に決定する方法である。
【0074】
第4の方法は、各クラスコードについて、ビット反転の発生頻度が所定の値(例えば、0.4)以上である画素位置を、0と1の2通りに場合分けするビットの画素位置に決定する方法である。
【0075】
ステップS26において、ステップS25の処理で生成したクラスコードのうち、0と1の2通りに場合分けするビットの画素位置が決定された後、処理はステップS27に進む。なお、ステップS26において、ステップS25の処理で生成したクラスコードのうち、いずれのビットも0と1の2通りに場合分けするビットに決定されなかった場合、以下に述べるステップS27の処理は省略される。
【0076】
ステップS27において、クラスコード生成部14は、画素値P1乃至P9のうち、ステップS26の処理で0と1の2通りに場合分けするビットの画素位置に決定された画素位置の画素値については、それぞれ0に符号化する場合と1に符号化する場合の2通りを設定し、その他の画素値については、ステップS25の処理と同様に、閾値Thとの比較により、0または1に符号化して、注目画素に対する1種類以上のクラスコードを生成する。なお、当該その他の画素値の符号化については、ステップ25の結果を流用するようにしてもよい。
【0077】
例えば、クラスコード用タップに含まれる9画素の画素値P1乃至P9が図17に示すような状態である場合、ステップS25の処理により9ビットのクラスコード101000110が生成される。そして、ステップS26の処理により、第2のテーブルに基づいて、注目画素の真上の画素が、0と1の2通りに場合分けするビットの画素位置に決定されたとすれば、ステップS27において、注目画素の真上の画素の画素値P2が、0に符号化する場合と1に符号化する場合の2通りの場合分けされて、2種類の9ビットのクラスコード101000110,111000110が生成される。
【0078】
以上で、クラスコード生成部14による第1のテーブルを用いたクラスコード生成処理の説明を終了する。
【0079】
このように、クラスコード用タップに含まれる全画素をADRCによって符号化し、クラスコードを生成した際、ビット反転が生じ易いと統計的に判断できるビットについては、0に符号化した場合と1に符号化した場合の2通りに場合分けして、参照フレームFrの各画素に対して1種類以上のクラスコードを生成するようにしたので、クラスコードのロバスト性を向上させることができる。
【0080】
なお、クラスコード用タップを構成する画素の数、すなわち、クラスコードのビット数は、上述した例に限るものではなく任意である。
【0081】
以上説明したように、本実施の形態によれば、クラスコード生成部14は、参照フレームFrの各画素に対し、1ビットADRCという容易な演算により、高いロバスト性を有するクラスコードを生成することができる。よって、対象フレームFcの画素と参照フレームFrの画素とを、高い精度でマッチングさせることができる。したがって、動きベクトルを精度良く検出することが可能となる。
【0082】
また、本発明は、画像を構成する画素の画素値の他、例えば、音声データなどの任意のデータに対してクラスコードを生成する場合に適用することが可能である。
【0083】
ところで、上述した一連の処理は、ハードウェアにより実行させることもできるが、ソフトウェアにより実行させることもできる。一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば、図18に示すように構成される汎用のパーソナルコンピュータなどに、記録媒体からインストールされる。
【0084】
このパーソナルコンピュータは、CPU(Central Processing Unit)31を内蔵している。CPU31にはバス34を介して、入出力インタフェース35が接続されている。バス34には、ROM(Read Only Memory)32およびRAM(Random Access Memory)33が接続されている。
【0085】
入出力インタフェース35には、ユーザが操作コマンドを入力するキーボード、マウスなどの入力デバイスよりなる入力部36、操作画面や処理結果を示す画面などを表示するCRT(Cathode Ray Tube)またはLCD(Liquid Crystal Display)等よりなる出力部37、プログラムや各種データを格納するハードディスクドライブなどよりなる記憶部38、およびモデム、LAN(Local Area Network)アダプタなどよりなりインタネットに代表されるネットワークを介した通信処理を実行する通信部39が接続されている。また、磁気ディスク41、光ディスク42、光磁気ディスク43、および半導体メモリ44などの記録媒体に対してデータを読み書きするドライブ40が接続されている。
【0086】
CPU31に上述した一連の処理を実行させるプログラムは、磁気ディスク41(フレキシブルディスクを含む)、光ディスク42(CD-ROM(Compact Disc-Read Only Memory)、DVD(Digital Versatile Disc)を含む)、光磁気ディスク43(MD(Mini Disc)を含む)、もしくは半導体メモリ44に格納された状態でパーソナルコンピュータに供給され、ドライブ40によって読み出されて記憶部38に内蔵されるハードディスクドライブにインストールされている。記憶部38にインストールされているプログラムは、入力部36に入力されるユーザからのコマンドに対応するCPU31の指令によって、記憶部38からRAM33にロードされて実行される。
【0087】
なお、本明細書において、記録媒体に記録されるプログラムを記述するステップは、記載された順序に従って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。
【0088】
【発明の効果】
以上のように、本発明によれば、僅かな演算量のみで画像間のマッチングを行うことができる。また、本発明によれば、動きベクトル等を精度良く検出することが可能となる。
【図面の簡単な説明】
【図1】従来の動きベクトル検出装置の構成例を示すブロック図である。
【図2】対象フレームFcと参照フレームFrの対応関係を示す図である。
【図3】ブロックマッチングアルゴリズムを説明するフローチャートである。
【図4】本発明の一実施の形態である動きベクトル検出装置の構成例を示すブロック図である。
【図5】3×3画素のクラスコード用タップを示す図である。
【図6】第1のテーブルを生成する処理を説明するための図である。
【図7】第1のテーブルを生成する処理を説明するための図である。
【図8】第1のテーブルを生成する処理を説明するための図である。
【図9】第1のテーブルの一例を示す図である。
【図10】第2のテーブルを生成する処理を説明するための図である。
【図11】第2のテーブルの一例を示す図である。
【図12】図4のMEメモリの構造を示す図である。
【図13】図4のクラスコード生成部による第1のテーブルを利用したクラスコード生成処理を説明するフローチャートである。
【図14】第1のテーブルを利用したクラスコード生成処理の一例を示す図である。
【図15】第1のテーブルを利用したクラスコード生成処理の一例を示す図である。
【図16】図4のクラスコード生成部による第2のテーブルを利用したクラスコード生成処理を説明するフローチャートである。
【図17】第2のテーブルを利用したクラスコード生成処理の一例を示す図である。
【図18】汎用のパーソナルコンピュータの構成例を示すブロック図である。
【符号の説明】
11 動きベクトル検出装置, 12,13 フレームメモリ, 14 クラスコード生成部, 15 テーブルメモリ, 16 MEメモリ, 17 動きベクトル演算部, 31 CPU, 41 磁気ディスク, 42 光ディスク,43 光磁気ディスク, 44 半導体メモリ[0001]
BACKGROUND OF THE INVENTION
The present invention image With regard to the processing apparatus and method, the recording medium, and the program, for example, suitable for use when matching pixels of temporally continuous image pairs and detecting a motion vector in units of pixels based on the matching result image The present invention relates to a processing apparatus and method, a recording medium, and a program.
[0002]
[Prior art]
For example, in a process of compressing and encoding an image signal such as an MPEG2 (Moving Picture Experts Group) system, an encoding process based on a correlation between two adjacent frames, so-called motion compensation interframe prediction, is used. In motion compensation inter-frame prediction, it is necessary to detect a motion vector for each pixel unit or for a pixel block unit of a predetermined size between two adjacent frames (one is described as a target frame and the other is referred to as a reference frame).
[0003]
Conventionally, a method called a block matching algorithm is used as a method for detecting a motion vector (see, for example, Patent Document 1).
[0004]
FIG. 1 shows a configuration example of a motion vector detection apparatus that detects a motion vector according to a block matching algorithm. The motion
[0005]
The
[0006]
Accordingly, the image signal of two frames before and after is input to the
[0007]
The
[0008]
In the block matching algorithm, all the pixels in the target frame Fc are sequentially designated as the target pixel, and a reference block having a predetermined size (L × L pixel) centered on the target pixel and a search provided in the reference frame Fr. The sum of absolute differences of the pixel values of the corresponding pixel pair with the reference block (same size as the base block) moved in the area SR is calculated according to 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 base block, and Frn (i, j) is the pixel value of the pixel of the reference block with the identification number n. Also, Σ i Means the sum operation when i is incremented by 1 from 1 to L, and Σ j Means a sum operation when j is incremented by 1 from 1 to L.
[0010]
Then, a difference vector between the center coordinates of the reference block and the coordinates of the target pixel when the sum of absolute differences of the pixel values of the corresponding pixel pairs of the base block and the reference block is minimized is calculated as a motion vector.
[0011]
Specifically, the following processing is executed for the target pixel of the target frame Fc. In step S <b> 1, the
[0012]
In step S2, the
[0013]
In step S3, the
[0014]
In step S5, the
[0015]
In step S7, the
[0016]
In step S8, the
[0017]
If it is determined in step S6 that the variable sum is not smaller than the variable min, the process of step S7 is skipped.
[0018]
Thereafter, when it is determined in step S8 that the reference block identification number n is not the maximum value, that is, when the reference block has been moved to the entire search area SR, the process proceeds to step S10.
[0019]
In step S10, the
[0020]
[Patent Document 1]
Japanese Patent No. 3277417
[0021]
[Problems to be solved by the invention]
In the block matching algorithm described above, the amount of calculation of the sum of absolute differences of the pixel values of the pixel pair in the processing of step S5 is very large, and most of the time required for the image compression processing is spent on this calculation. There was a problem of ending up.
[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 detect a motion vector or the like with high accuracy.
[0023]
[Means for Solving the Problems]
An image processing apparatus according to the present invention includes a setting unit that sets a block of a predetermined size including a target pixel of interest in an input image and pixels in the vicinity thereof, and a plurality of blocks included in the block set by the setting unit The pixel value of the
[0027]
Of the present invention image A processing method includes: a setting step for setting a block of a predetermined size including a target pixel of interest in an input image and neighboring pixels; and a plurality of pixels included in the block set by the processing of the setting step Value Add 1/2 of the dynamic range represented by the difference between the maximum value and the minimum value of the plurality of pixels included in the block to the minimum value, A calculating step for calculating a threshold; Bits in the class code obtained by setting a block of a predetermined size for multiple sample images, generating a class code corresponding to the set block, and comparing it with the class code for the image of the previous frame The number of bits that determine the cumulative frequency of inversions to a predetermined value, the class code, Referring to the correspondence table with which Generated An acquisition step for acquiring the number of bits corresponding to the class code; The pixel values of a plurality of pixels included in the block set in the setting step process are each encoded as 1 when the pixel value is larger than the threshold value calculated in the calculation step process, and when the pixel value is smaller than the threshold value, Encode to 0 to generate a class code for the pixel of interest, and from among the pixel values of a plurality of pixels included in the block corresponding to the generated class code, from the one closer to the threshold calculated in the calculation step processing And a generation step of encoding pixel values of pixels of the number of bits acquired in the processing of the acquisition step in two ways of 0 and 1, respectively. .
[0028]
The recording medium program of the present invention is included in a setting step for setting a block of a predetermined size including a target pixel of interest in an input image and pixels in the vicinity thereof, and a block set by the processing of the setting step Of pixel values of multiple pixels Add 1/2 of the dynamic range represented by the difference between the maximum value and the minimum value of the plurality of pixels included in the block to the minimum value, A calculating step for calculating a threshold; Bits in the class code obtained by setting a block of a predetermined size for a plurality of sample images, generating a class code corresponding to the set block, and comparing it with the class code for the image of the previous frame The number of bits that determine the cumulative frequency of inversions to a predetermined value, the class code, Referring to the correspondence table with which Generated An acquisition step for acquiring the number of bits corresponding to the class code; The pixel values of a plurality of pixels included in the block set in the setting step process are each encoded as 1 when the pixel value is larger than the threshold value calculated in the calculation step process, and when the pixel value is smaller than the threshold value, Encode to 0 to generate a class code for the pixel of interest, and from among the pixel values of a plurality of pixels included in the block corresponding to the generated class code, from the one closer to the threshold calculated in the calculation step processing , Causing a computer to execute processing including a generation step of encoding pixel values of pixels having the number of bits acquired in the processing of the acquisition step in two ways of 0 and 1, respectively. .
[0029]
The program of the present invention includes a setting step for setting a block of a predetermined size including a target pixel of interest in an input image and pixels in the vicinity thereof, and a plurality of pixels included in the block set by the processing of the setting step Of pixel values Add 1/2 of the dynamic range represented by the difference between the maximum value and the minimum value of the plurality of pixels included in the block to the minimum value, A calculating step for calculating a threshold; Bits in the class code obtained by setting a block of a predetermined size for a plurality of sample images, generating a class code corresponding to the set block, and comparing it with the class code for the image of the previous frame The number of bits that determine the cumulative frequency of inversions to a predetermined value, the class code, Referring to the correspondence table with which Generated An acquisition step for acquiring the number of bits corresponding to the class code; The pixel values of a plurality of pixels included in the block set in the setting step process are each encoded as 1 when the pixel value is larger than the threshold value calculated in the calculation step process, and when the pixel value is smaller than the threshold value, Encode to 0 to generate a class code for the pixel of interest, and from among the pixel values of a plurality of pixels included in the block corresponding to the generated class code, from the one closer to the threshold calculated in the calculation step processing , Causing the computer to execute a process including a generation step of encoding the pixel value of the pixel having the number of bits acquired in the process of the acquisition step in two ways of 0 and 1, respectively. .
[0030]
Image processing apparatus and method of the present invention, recoding media, And attention in the program Pixel If the pixel value of a plurality of pixels included in a block of a predetermined size including is larger than the calculated threshold, it is encoded as 1, and if it is smaller than the threshold, it is encoded as 0. Pixel Class code is generated for , further, Among the pixel values of the plurality of pixels included in the block corresponding to the generated class code, the pixel values of the pixels having the obtained number of bits from the one closer to the calculated threshold value are two types, 0 and 1, respectively. Encoded .
[0031]
DETAILED DESCRIPTION OF THE INVENTION
A configuration example of a motion vector detection apparatus to which the present invention is applied will be described with reference to FIG. The motion vector detection device 11 includes
[0032]
The
[0033]
Therefore, the class
[0034]
The class
[0035]
Further, the class
[0036]
Furthermore, the class
[0037]
The table memory 15 includes a first table indicating correspondence between the class code and the number of bits to be encoded in two cases of 0 and 1, and bits at each pixel position in the class code and the class code tap. A second table indicating the frequency of occurrence of inversion is stored. It is assumed that the first and second tables are statistically generated in advance using a plurality of sample image signals and stored in the table memory 15 in advance.
[0038]
Processing for generating the first table will be described with reference to FIGS. First, a class code tap is set for each pixel of a plurality of sample image signals, and a class code is generated by ADRC. Next, all generated class codes are compared with the pixel values in the original class code tap to determine the bit inversion in the class code, and the number of bits Are counted. Based on the counting result, a histogram is generated that indicates the number of bits on the horizontal axis and the normalized frequency of bit inversion on the vertical axis, as shown in FIG.
[0039]
FIG. 6 shows polygonal lines a to d indicating the counting results for four types of class codes. Actually, for example, when the class code is 9 bits, 512 (= 2) 9 ) 512 polygonal lines indicating the counting results for each type of class code are obtained. Further, for each class code, the number of bits K is determined so that the cumulative frequency of occurrence of bit inversions becomes a predetermined value, and is written in the first table. As the predetermined value, a common value is used for all class codes.
[0040]
For example, when the predetermined value is set to 40%, the number of bits K = 1 is determined for the class code corresponding to the broken line d as shown in FIG. For example, when the predetermined value is determined to be 80%, the number of bits K = 3 is determined for the class code corresponding to the polygonal line d as shown in FIG.
[0041]
FIG. 9 shows an example of a first table corresponding to a 9-bit class code generated by using the class code tap of FIG. In this example, the
[0042]
Next, the process of generating the second table will be described with reference to FIG. First, a class code tap is set for each pixel of a plurality of sample image signals, and a class code is generated by ADRC. Next, all the generated class codes are compared with a plurality of pixel values in the original class code tap to determine the bit inversion in the class code, and the bit inversion is performed. The position of the pixel class code tap relative to the occurring bit is determined. Based on the determination result, a histogram indicating the pixel position on the class code tap on the horizontal axis and the normalized bit inversion frequency on the vertical axis is generated as shown in FIG. Is generated.
[0043]
In FIG. 10, the determination results for the three types of class codes are shown using the polygonal lines e to g, but actually, for example, when the class code is 9 bits, 512 (= 2 9 ) 512 polygonal lines each indicating the determination result for each type of class code are obtained.
[0044]
FIG. 11 shows an example of the second table corresponding to the 9-bit class code generated by using the class code tap of FIG. The second table stores the frequency of occurrence of bit inversion at nine pixel positions corresponding to each class code of 9 bits.
[0045]
For example, for the
[0046]
For example, for the
[0047]
Returning to FIG. The
[0048]
FIG. 12 shows the structure of the
[0049]
The feature amount address corresponds to the class code generated for each pixel of the reference frame Fr generated by the class
[0050]
In the cells after the
[0051]
In the cells after the
[0052]
Also, for example, when three types of class codes are generated for a pixel in the reference frame Fr, the coordinates of the pixels are stored in three cells of feature amount addresses corresponding to the three types of class codes. become.
[0053]
Returning to FIG. The motion
[0055]
Next, class code generation processing using the first table by the class
[0056]
In step S11, the class
[0057]
In step S12, the class
Th = P MIN + DR / 2 (2)
[0058]
In step S15, the class
[0059]
Note that the processing in steps S11 to S15 is executed when the current reference frame Fr is the target frame Fc at the previous timing as processing for generating a class code for each pixel of the target frame Fc. Therefore, the result may be used.
[0060]
In step S16, the class
[0061]
In step S <b> 17, the class
[0062]
For example, when the pixel values P1 to P9 of the nine pixels included in the class code tap are in the state as shown in FIG. 14, a 9-
[0063]
Further, for example, when the pixel values P1 to P9 of the nine pixels included in the class code tap are in the state as shown in FIG. 15, a 9-
[0064]
Above, description of the class code generation process using the 1st table by the class
[0065]
Next, class code generation processing using the second table by the class
[0066]
In step S21, the class
[0067]
In step S22, the class
[0068]
In step S25, the class
[0069]
Note that the processing in steps S21 to S25 is executed when the current reference frame Fr is the target frame Fc at the previous timing as processing for generating a class code for each pixel of the target frame Fc. Therefore, the result may be used.
[0070]
In step S26, the class
[0071]
In the first method, for each class code, the pixel positions of the bits that divide the pixel positions of a predetermined number of higher places (for example, two places) with higher frequency of bit inversion into two ways of 0 and 1 It is a method to decide on.
[0072]
In the second method, for each class code, the pixel positions at several locations in order from the highest occurrence frequency are divided into two cases of 0 and 1 until the cumulative frequency of occurrence of bit inversion reaches a predetermined value. This is a method of determining the pixel position.
[0073]
The third method is a total of 2 corresponding to all the class codes in the second table. 9 Among the occurrence frequencies of × 9, the pixel positions of a predetermined number of higher places (for example, 100 places) with the higher bit inversion occurrence frequency are determined as the pixel positions of the bits divided into two cases of 0 and 1 It is a method to do.
[0074]
In the fourth method, for each class code, the pixel position where the occurrence frequency of bit inversion is a predetermined value (for example, 0.4) or more is determined as the pixel position of the bit divided into two cases of 0 and 1 It is a method to do.
[0075]
In step S26, after the pixel positions of the bits to be divided into two cases of 0 and 1 in the class code generated in the process of step S25 are determined, the process proceeds to step S27. In step S26, if none of the bits in the class code generated in the process of step S25 is determined to be divided into two cases of 0 and 1, the process of step S27 described below is omitted. The
[0076]
In step S27, the class
[0077]
For example, when the pixel values P1 to P9 of 9 pixels included in the class code tap are in the state as shown in FIG. 17, a 9-
[0078]
Above, description of the class code generation process using the 1st table by the class
[0079]
In this way, when all the pixels included in the class code tap are encoded by ADRC and the class code is generated, bits that can be statistically determined that bit inversion is likely to occur are encoded as 0 and 1 Since one or more types of class codes are generated for each pixel of the reference frame Fr according to the two cases of encoding, the robustness of the class codes can be improved.
[0080]
The number of pixels constituting the class code tap, that is, the number of bits of the class code is not limited to the above-described example, and is arbitrary.
[0081]
As described above, according to the present embodiment, the class
[0082]
Further, the present invention can be applied to a case where a class code is generated for arbitrary data such as audio data in addition to the pixel values of pixels constituting an image.
[0083]
By the way, the series of processes described above can be executed by hardware, but can also be executed by software. When a series of processing is executed by software, a program constituting the software may execute various functions by installing a computer incorporated in dedicated hardware or various programs. For example, it is installed from a recording medium in a general-purpose personal computer configured as shown in FIG.
[0084]
This personal computer includes a CPU (Central Processing Unit) 31. An input /
[0085]
The input /
[0086]
Programs for causing the
[0087]
In the present specification, the step of describing the program recorded in the recording medium is not limited to the processing performed in time series according to the described order, but is not necessarily performed in time series, either in parallel or individually. The process to be executed is also included.
[0088]
【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 detect motion vectors and the like with high accuracy.
[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 illustrating 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 illustrating a class code tap of 3 × 3 pixels.
FIG. 6 is a diagram for explaining processing for generating a first table;
FIG. 7 is a diagram for explaining processing for generating a first table;
FIG. 8 is a diagram for explaining processing for generating a first table;
FIG. 9 is a diagram illustrating an example of a first table.
FIG. 10 is a diagram for explaining processing for generating a second table;
FIG. 11 is a diagram illustrating an example of a second table.
12 is a diagram showing the structure of the ME memory of FIG. 4;
13 is a flowchart for explaining class code generation processing using the first table by the class code generation unit in FIG. 4; FIG.
FIG. 14 is a diagram illustrating an example of a class code generation process using a first table.
FIG. 15 is a diagram illustrating an example of a class code generation process using a first table.
16 is a flowchart for explaining class code generation processing using a second table by the class code generation unit in FIG. 4; FIG.
FIG. 17 is a diagram illustrating an example of a class code generation process using a second table.
FIG. 18 is a block diagram illustrating a configuration example of a general-purpose personal computer.
[Explanation of symbols]
11 motion vector detection device, 12, 13 frame memory, 14 class code generation unit, 15 table memory, 16 ME memory, 17 motion vector calculation unit, 31 CPU, 41 magnetic disk, 42 optical disk, 43 magneto-optical disk, 44 semiconductor memory
Claims (4)
入力された前記画像において注目する注目画素と、その近傍の画素とからなる所定のサイズのブロックを設定する設定手段と、
前記設定手段によって設定された前記ブロックに含まれる複数の前記画素の画素値の最小値に、前記ブロックに含まれる複数の前記画素の画素値の最大値と、前記最小値との差で表されるダイナミックレンジの1/2を加算して、閾値を算出する算出手段と、
サンプルとなる複数の画像について、前記所定のサイズのブロックを設定し、設定した前記ブロックに対応する前記クラスコードを生成し、前フレームの画像についての前記クラスコードと比較することで得られる前記クラスコードの中のビット反転の発生頻度の累計を所定の値に決定するビット数と、前記クラスコードとが対応付けられた対応テーブルを保持する保持手段と、
前記保持手段によって保持された前記対応テーブルを参照して、生成される前記クラスコードに対応する前記ビット数を取得する取得手段と、
前記設定手段によって設定された前記ブロックに含まれる複数の前記画素の画素値を、それぞれ、前記算出手段によって算出された前記閾値よりも大きい場合には1に符号化し、前記閾値よりも小さい場合には0に符号化して、前記注目画素に対する前記クラスコードを生成し、さらに、生成した前記クラスコードに対応する前記ブロックに含まれる複数の前記画素の画素値のうち、前記算出手段によって算出された前記閾値に近い方から、前記取得手段によって取得された前記ビット数の前記画素の画素値を、それぞれ0および1の2通りに符号化する生成手段と
を備える画像処理装置。In an image processing apparatus that generates a class code indicating a spatial feature amount of an image and processes pixel values of pixels constituting the image based on the generated class code.
Setting means for setting a block of a predetermined size including a target pixel of interest in the input image and pixels in the vicinity thereof;
The minimum value of the pixel values of the plurality of pixels included in the block set by the setting unit is represented by a difference between the maximum value of the pixel values of the plurality of pixels included in the block and the minimum value. Calculating means for calculating a threshold by adding 1/2 of the dynamic range
The class obtained by setting a block of the predetermined size for a plurality of sample images, generating the class code corresponding to the set block, and comparing the class code with the image of the previous frame Holding means for holding a correspondence table in which the number of bits for determining the cumulative frequency of occurrence of bit inversion in the code to a predetermined value and the class code are associated;
Obtaining means for obtaining the number of bits corresponding to the generated class code with reference to the correspondence table held by the holding means ;
When the pixel values of the plurality of pixels included in the block set by the setting unit are larger than the threshold value calculated by the calculation unit, the pixel value is encoded as 1, and when the pixel value is smaller than the threshold value, Is encoded into 0, the class code for the pixel of interest is generated, and the pixel value of the plurality of pixels included in the block corresponding to the generated class code is calculated by the calculation unit Generation means for encoding pixel values of the pixels of the number of bits acquired by the acquisition means from the one closer to the threshold value in two ways of 0 and 1, respectively;
An image processing apparatus comprising:
入力された前記画像において注目する注目画素と、その近傍の画素とからなる所定のサイズのブロックを設定する設定ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数画素の画素値の最小値に、前記ブロックに含まれる複数の前記画素の画素値の最大値と、前記最小値との差で表されるダイナミックレンジの1/2を加算して、閾値を算出する算出ステップと、
サンプルとなる複数の画像について、前記所定のサイズのブロックを設定し、設定した前記ブロックに対応する前記クラスコードを生成し、前フレームの画像についての前記クラスコードと比較することで得られる前記クラスコードの中のビット反転の発生頻度の累計を所定の値に決定するビット数と、前記クラスコードとが対応付けられた対応テーブルを参照して、生成される前記クラスコードに対応する前記ビット数を取得する取得ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記画素の画素値を、それぞれ、前記算出ステップの処理で算出された前記閾値よりも大きい場合には1に符号化し、前記閾値よりも小さい場合には0に符号化して、前記注目画素に対する前記クラスコードを生成し、さらに、生成した前記クラスコードに対応する前記ブロックに含まれる複数の前記画素の画素値のうち、前記算出ステップの処理で算出された前記閾値に近い方から、前記取得ステップの処理で取得された前記ビット数の前記画素の画素値を、それぞれ0および1の2通りに符号化する生成ステップと
を含む画像処理方法。In an image processing method of an image processing apparatus for generating a class code indicating a spatial feature amount of an image and processing a pixel value of a pixel constituting the image based on the generated class code,
A setting step for setting a block of a predetermined size including a target pixel of interest in the input image and pixels in the vicinity thereof;
The minimum value of the pixel values of the plurality of pixels included in the block set in the processing of the setting step is represented by the difference between the maximum value of the pixel values of the plurality of pixels included in the block and the minimum value. A calculation step of adding a half of the dynamic range to calculate a threshold;
The class obtained by setting a block of the predetermined size for a plurality of sample images, generating the class code corresponding to the set block, and comparing the class code with the image of the previous frame The number of bits corresponding to the generated class code with reference to a correspondence table in which the number of bits for determining the cumulative frequency of occurrence of bit inversion in the code to a predetermined value is associated with the class code An acquisition step to acquire ,
If the pixel values of the plurality of pixels included in the block set in the setting step process are larger than the threshold value calculated in the calculation step process, the pixel value is encoded as 1, If it is also smaller, it is encoded to 0 to generate the class code for the pixel of interest, and among the pixel values of the pixels included in the block corresponding to the generated class code, the calculating step A generation step of encoding pixel values of the pixels of the number of bits acquired in the processing of the acquisition step in two ways of 0 and 1, respectively, from the one closer to the threshold calculated in the processing of
An image processing method including :
入力された前記画像において注目する注目画素と、その近傍の画素とからなる所定のサイズのブロックを設定する設定ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数画素の画素値の最小値に、前記ブロックに含まれる複数の前記画素の画素値の最大値と、前記最小値との差で表されるダイナミックレンジの1/2を加算して、閾値を算出する算出ステップと、
サンプルとなる複数の画像について、前記所定のサイズのブロックを設定し、設定した前記ブロックに対応する前記クラスコードを生成し、前フレームの画像についての前記クラスコードと比較することで得られる前記クラスコードの中のビット反転の発生頻度の累計を所定の値に決定するビット数と、前記クラスコードとが対応付けられた対応テーブルを参照して、生成される前記クラスコードに対応する前記ビット数を取得する取得ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記画素の画素値を、それぞれ、前記算出ステップの処理で算出された前記閾値よりも大きい場合には1に符号化し、前記閾値よりも小さい場合には0に符号化して、前記注目画素に対する前記クラスコードを生成し、さらに、生成した前記クラスコードに対応する前記ブロックに含まれる複数の前記画素の画素値のうち、前記算出ステップの処理で算出された前記閾値に近い方から、前記取得ステップの処理で取得された前記ビット数の前記画素の画素値を、それぞれ0および1の2通りに符号化する生成ステップと
を含む処理をコンピュータに実行させるプログラムが記録されている記録媒体。To generate a class code indicating a spatial feature quantity of the image, based on the generated the class code, a program for executing processing of the pixel values of pixels constituting the image into the computer,
A setting step for setting a block of a predetermined size including a target pixel of interest in the input image and pixels in the vicinity thereof;
The minimum value of the pixel values of the plurality of pixels included in the block set in the processing of the setting step is represented by the difference between the maximum value of the pixel values of the plurality of pixels included in the block and the minimum value. A calculation step of adding a half of the dynamic range to calculate a threshold;
The class obtained by setting a block of the predetermined size for a plurality of sample images, generating the class code corresponding to the set block, and comparing the class code with the image of the previous frame The number of bits corresponding to the generated class code with reference to a correspondence table in which the number of bits for determining the cumulative frequency of occurrence of bit inversion in the code to a predetermined value is associated with the class code An acquisition step to acquire ,
If the pixel values of the plurality of pixels included in the block set in the setting step process are larger than the threshold value calculated in the calculation step process, the pixel value is encoded as 1, If it is also smaller, it is encoded to 0 to generate the class code for the pixel of interest, and among the pixel values of the pixels included in the block corresponding to the generated class code, the calculating step A generation step of encoding pixel values of the pixels of the number of bits acquired in the processing of the acquisition step in two ways of 0 and 1, respectively, from the one closer to the threshold calculated in the processing of
A recording medium on which is recorded a program that causes a computer to execute processing including the above .
入力された前記画像において注目する注目画素と、その近傍の画素とからなる所定のサイズのブロックを設定する設定ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数画素の画素値の最小値に、前記ブロックに含まれる複数の前記画素の画素値の最大値と、前記最小値との差で表されるダイナミックレンジの1/2を加算して、閾値を算出する算出ステップと、
サンプルとなる複数の画像について、前記所定のサイズのブロックを設定し、設定した前記ブロックに対応する前記クラスコードを生成し、前フレームの画像についての前記クラスコードと比較することで得られる前記クラスコードの中のビット反転の発生頻度の累計を所定の値に決定するビット数と、前記クラスコードとが対応付けられた対応テーブルを参照して、生成される前記クラスコードに対応する前記ビット数を取得する取得ステップと、
前記設定ステップの処理で設定された前記ブロックに含まれる複数の前記画素の画素値を、それぞれ、前記算出ステップの処理で算出された前記閾値よりも大きい場合には1に符号化し、前記閾値よりも小さい場合には0に符号化して、前記注目画素に対する前記クラスコードを生成し、さらに、生成した前記クラスコードに対応する前記ブロックに含まれる複数の前記画素の画素値のうち、前記算出ステップの処理で算出された前記閾値に近い方から、前記取得ステップの処理で取得された前記ビット数の前記画素の画素値を、それぞれ0および1の2通りに符号化する生成ステップと
を含む処理をコンピュータに実行させるプログラム。To generate a class code indicating a spatial feature quantity of the image, based on the generated the class code, a program for executing processing of the pixel values of pixels constituting the image into the computer,
A setting step for setting a block of a predetermined size including a target pixel of interest in the input image and pixels in the vicinity thereof;
The minimum value of the pixel values of the plurality of pixels included in the block set in the processing of the setting step is represented by the difference between the maximum value of the pixel values of the plurality of pixels included in the block and the minimum value. A calculation step of adding a half of the dynamic range to calculate a threshold;
The class obtained by setting a block of the predetermined size for a plurality of sample images, generating the class code corresponding to the set block, and comparing the class code with the image of the previous frame The number of bits corresponding to the generated class code with reference to a correspondence table in which the number of bits for determining the cumulative frequency of occurrence of bit inversion in the code to a predetermined value is associated with the class code An acquisition step to acquire ,
If the pixel values of the plurality of pixels included in the block set in the setting step process are larger than the threshold value calculated in the calculation step process, the pixel value is encoded as 1, If it is also smaller, it is encoded to 0 to generate the class code for the pixel of interest, and among the pixel values of the pixels included in the block corresponding to the generated class code, the calculating step A generation step of encoding pixel values of the pixels of the number of bits acquired in the processing of the acquisition step in two ways of 0 and 1, respectively, from the one closer to the threshold calculated in the processing of
A program that causes a computer to execute processing including
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002327271A JP4239557B2 (en) | 2002-11-11 | 2002-11-11 | Image processing apparatus and method, recording medium, and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002327271A JP4239557B2 (en) | 2002-11-11 | 2002-11-11 | Image processing apparatus and method, recording medium, and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2004165839A JP2004165839A (en) | 2004-06-10 |
| JP4239557B2 true JP4239557B2 (en) | 2009-03-18 |
Family
ID=32805963
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002327271A Expired - Fee Related JP4239557B2 (en) | 2002-11-11 | 2002-11-11 | Image processing apparatus and method, recording medium, and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4239557B2 (en) |
-
2002
- 2002-11-11 JP JP2002327271A patent/JP4239557B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2004165839A (en) | 2004-06-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8654847B2 (en) | Video decoding device, video decoding method, video decoding program, and video decoding integrated circuit | |
| JP4444252B2 (en) | Method and apparatus for wide area-local block motion estimation | |
| US8634471B2 (en) | Moving image encoding apparatus, control method thereof and computer-readable storage medium | |
| US20090022223A1 (en) | High quality, low memory bandwidth motion estimation processor | |
| JP2006014343A (en) | Encoding and deciding of image | |
| WO2004057460A2 (en) | Segment-based motion estimation | |
| US7471725B2 (en) | Segmented motion estimation with no search for small block sizes | |
| EP1587032A1 (en) | Image processing apparatus and method, recording medium, and program | |
| TW502535B (en) | Methods and apparatus for motion estimation in compressed domain | |
| US20110249747A1 (en) | Motion vector decision apparatus, motion vector decision method and computer readable storage medium | |
| CN100571400C (en) | Image encoding device and image encoding method | |
| CN101374235A (en) | Fast Block Motion Estimation Method and Device in Video Coding | |
| JP4239557B2 (en) | Image processing apparatus and method, recording medium, and program | |
| JP4129788B2 (en) | Image data processing apparatus and method, recording medium, and program | |
| JP4329331B2 (en) | Image processing apparatus and method, recording medium, and program | |
| JP3598526B2 (en) | Motion vector detection method and image data encoding method | |
| JP4144316B2 (en) | Image data processing apparatus and method, recording medium, and program | |
| JP2004229150A (en) | Motion vector searching method and device | |
| US20070092005A1 (en) | Method and apparatus for encoding, method and apparatus for decoding, program, and storage medium | |
| JP3861325B2 (en) | Motion vector detection apparatus and detection method | |
| KR100966494B1 (en) | Method and apparatus for image data reduction using adaptive representative value, and recording medium thereof | |
| JP4207763B2 (en) | Motion vector detection apparatus, motion vector detection method, and computer program | |
| JP4300787B2 (en) | Image processing apparatus and method, recording medium, and program | |
| JP4547881B2 (en) | Motion vector detection device and detection method, matching block table generation device and generation method, program for executing each method, and computer-readable medium storing the program | |
| HK40074021A (en) | Block vector encoding and decoding method, encoding device, decoding device, and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20051026 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080624 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080821 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080911 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081107 |
|
| 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: 20081202 |
|
| 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: 20081215 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120109 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120109 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130109 Year of fee payment: 4 |
|
| 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 |