JP2007318578A - Image processor and image processing method - Google Patents

Image processor and image processing method Download PDF

Info

Publication number
JP2007318578A
JP2007318578A JP2006147608A JP2006147608A JP2007318578A JP 2007318578 A JP2007318578 A JP 2007318578A JP 2006147608 A JP2006147608 A JP 2006147608A JP 2006147608 A JP2006147608 A JP 2006147608A JP 2007318578 A JP2007318578 A JP 2007318578A
Authority
JP
Japan
Prior art keywords
sum
absolute value
difference absolute
vector
screen
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
JP2006147608A
Other languages
Japanese (ja)
Other versions
JP4904925B2 (en
Inventor
Toru Kurata
徹 倉田
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 JP2006147608A priority Critical patent/JP4904925B2/en
Publication of JP2007318578A publication Critical patent/JP2007318578A/en
Application granted granted Critical
Publication of JP4904925B2 publication Critical patent/JP4904925B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce error detection of motion vectors when detecting the motion vectors by using block matching. <P>SOLUTION: The block matching is performed on multiple target blocks set in a previous screen with reference blocks in a reference screen on a search scope basis, and a sum of absolute difference (SAD) of a pixel value of each pixel in the reference block and a pixel value of each pixel in the corresponding place in the target block is calculated for every pixels. A total SAD is calculated by adding the calculated SADs in the same position of the multiple reference blocks in the same search scope, and a total SAD table storing the total SADs for the multiple reference block positions in the single search scope is generated. The motion vector of the reference screen to the original screen is detected based on the total SAD table. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

この発明は、例えば、デジタルスチルカメラやビデオカメラなどの撮像装置において撮像されて得られた画像情報に含まれるいわゆる手ぶれ成分などからなる画像の1画面単位での動きベクトルを検出する画像処理装置および画像処理方法に関する。   The present invention provides, for example, an image processing device that detects a motion vector in one screen unit of an image composed of a so-called camera shake component included in image information obtained by imaging with an imaging device such as a digital still camera or a video camera. The present invention relates to an image processing method.

一般に、デジタルスチルカメラやビデオカメラなどの撮像装置を手で持って構えて撮影をした場合、撮影時の手ぶれによる撮像装置の振動が、撮像画像の画面単位での振動となって現われる。   In general, when taking an image by holding an image pickup apparatus such as a digital still camera or a video camera by hand, the vibration of the image pickup apparatus due to camera shake at the time of image pickup appears as a vibration for each screen of a picked-up image.

このような手ぶれによる撮像画像の振動を補正する方法として、昨今の市場においては、ジャイロセンサの低価格化、高性能化、小型化に伴い、ジャイロ(角速度)センサを用いた光学式の手ぶれ補正方式が主流を占めている。   As a method of correcting vibrations in captured images due to such camera shake, optical camera shake correction using a gyro (angular velocity) sensor has become available in recent markets as the price, performance, and size of gyro sensors have decreased. The method is dominant.

しかし、ここ数年においては、デジタルスチルカメラの急速な普及と、それと機を同じくした急速な高画素化の流れが、新たな問題を生み始めている。それは、低照度(露光時間が長い)ときの静止画においても、手ぶれ補正が強く求められているものの、解がジャイロセンサ等のセンサを用いたものしか存在せず、ジャイロセンサ自体の検出精度の甘さなどのジャイロセンサの弱点やその他の問題が露呈しつつある点である。   However, in the last few years, the rapid spread of digital still cameras and the rapid trend toward higher pixel counts, which are the same as those, have begun to create new problems. Even in still images at low illuminance (long exposure time), camera shake correction is strongly required, but there are only solutions using sensors such as gyro sensors, and the detection accuracy of the gyro sensor itself is high. The weak point of the gyro sensor such as sweetness and other problems are being exposed.

現在市場に出回っている民生機における、静止画用途の手ぶれ補正は、全て、遍くジャイロセンサもしくは加速度センサを使って手ぶれベクトルを計測し、それを機構系にフィードバックして、CCD(Charge Coupled Device)イメージャやCMOS(Complementary Metal Oxide Semiconductor)イメージャなどのイメージセンサに射影される像が、ぶれを起こさないように高速に制御する、というものである。   All of the image stabilization for still images in consumer electronics currently on the market is to measure the camera shake vector using a gyro sensor or accelerometer and feed it back to the mechanical system, CCD (Charge Coupled Device). An image projected on an image sensor such as an imager or a CMOS (Complementary Metal Oxide Semiconductor) imager is controlled at high speed so as not to cause blurring.

ここでいう機構系としては、レンズ、プリズム、イメージャ(もしくはイメージャと一体化したモジュール)が提案されており、それぞれ、レンズシフト、プリズムシフト、イメージャシフトと呼ばれている。   As the mechanism system here, a lens, a prism, and an imager (or a module integrated with the imager) have been proposed, which are called a lens shift, a prism shift, and an imager shift, respectively.

このような方法で手ぶれ補正がなされている以上、先に挙げたジャイロセンサ自体の精度誤差に加え、機構系へのフィードバック遅延、もしくはフィードバック遅延を回避するための予測誤差、そして、機構系の制御誤差も重畳され、とてもピクセル精度で補正をかけることは不可能である。   As camera shake correction is performed in this way, in addition to the accuracy error of the gyro sensor itself mentioned above, feedback delay to the mechanical system or prediction error to avoid feedback delay, and control of the mechanical system Errors are also superimposed and it is impossible to correct with very high pixel accuracy.

以上に挙げたように、現状のセンサを使用した手ぶれ補正には、原理的に、精度を追求できない、という大きな問題があるにも関わらず、市場で高評価を得ているのは、手ぶれを補正できないまでも低減できるからである。   As mentioned above, although there is a major problem that camera shake correction using current sensors cannot be pursued in principle in principle, camera shake is the reason why it is highly evaluated in the market. This is because it can be reduced even if it cannot be corrected.

しかしながら、今後益々の高画素化が予想される中、ピクセルサイズが小さくなるに従って、補正限界がピクセル精度と益々開いて行かざるを得ない、という事実に市場が気付くのも時間の問題である。   However, it is also a matter of time for the market to realize the fact that as the pixel size becomes smaller, the correction limit must be increased with the pixel accuracy as the pixel size becomes smaller.

一方、手ぶれによる撮像画像の振動を補正する方法の他の一つとして、撮像画像の画面単位の動きベクトルを検出し、この動きベクトルに基づいて、画像メモリに蓄えられている撮像画像データの読み出し位置をシフトして手ぶれ補正をするセンサレス手ぶれ補正方法が知られている。   On the other hand, as another method for correcting vibration of a captured image due to camera shake, a motion vector in a screen unit of the captured image is detected, and captured image data stored in the image memory is read based on the motion vector. A sensorless camera shake correction method that shifts the position and performs camera shake correction is known.

撮像画像の画面単位の動きベクトルを撮像画像情報自身から検出する方法としては、2画面分の撮像画像間の相関を求めるブロックマッチングが知られている。このブロックマッチングを用いるセンサレス手ぶれ補正方法は、原理的に、ロール軸方向の回転成分を含んだピクセル精度の手ぶれベクトル検出が実現可能であり、また、ジャイロセンサなどの機械的な部品が不要なので、撮像装置の小型、軽量化を実現することができるという点でも有利である。   As a method for detecting a motion vector of a captured image in screen units from captured image information itself, block matching for obtaining a correlation between captured images for two screens is known. In principle, this sensorless image stabilization method using block matching can realize pixel-accuracy image stabilization vector including rotation component in the roll axis direction, and no mechanical parts such as a gyro sensor are required. It is also advantageous in that the imaging device can be reduced in size and weight.

図51および図52は、ブロックマッチングの概要を図示したものである。また、図53には、その処理フローチャートの一般例を示す。   51 and 52 illustrate the outline of block matching. FIG. 53 shows a general example of the processing flowchart.

ブロックマッチングは、撮像装置部からの撮像画像について、注目画面である参照画面と、当該参照画面よりも前、例えば1画面分前の撮像画面である元画面との間の1画面分単位での動きベクトルを、所定の大きさの矩形領域のブロックについて、参照画面と元画面との相関を算出することにより算出する方法である。   Block matching is a unit of one screen between a reference screen that is a screen of interest and an original screen that is an imaging screen that is one screen before the reference screen, for example, for the captured image from the imaging device unit. This is a method of calculating a motion vector by calculating a correlation between a reference screen and an original screen for a block of a rectangular area having a predetermined size.

なお、ここで画面とは、1フレームまたは1フィールドの画像データからなる画像を意味しているが、この明細書では、説明の便宜上、画面は1フレームからなるものとして、画面をフレームと称することとする。したがって、参照画面は参照フレーム、元画面は元フレーム(ターゲットフレーム)と称する。   Here, the screen means an image composed of image data of one frame or one field. However, in this specification, for convenience of explanation, the screen is composed of one frame and the screen is referred to as a frame. And Therefore, the reference screen is referred to as a reference frame, and the original screen is referred to as an original frame (target frame).

例えば、参照フレームの画像データは、撮像装置部からの現フレームの画像データ、または現フレームの画像データがフレームメモリに格納されて1フレーム分遅延されたものとされる。元フレームの画像データは、参照フレームの画像データがさらにフレームメモリに格納されて1フレーム分遅延されたものとされる。   For example, the image data of the reference frame is the current frame image data from the imaging device unit or the current frame image data stored in the frame memory and delayed by one frame. The image data of the original frame is obtained by further storing the image data of the reference frame in the frame memory and delaying by one frame.

ブロックマッチングにおいては、図51に示すように、元フレーム101の任意の所定の位置において、水平方向の複数画素および垂直方向の複数ライン分からなる所定の大きさの矩形領域からなるターゲットブロック103が設定される。   In block matching, as shown in FIG. 51, a target block 103 having a rectangular area of a predetermined size composed of a plurality of pixels in the horizontal direction and a plurality of lines in the vertical direction is set at an arbitrary predetermined position of the original frame 101. Is done.

これに対して、参照フレーム102において、元フレームのターゲットブロック103の位置と同じ位置に、ターゲットブロックの射影イメージブロック104(図51の点線参照)を想定し、このターゲットブロックの射影イメージブロック104を中心としたサーチ範囲105(図51の一点鎖線参照)を設定すると共に、ターゲットブロック103と同じ大きさの参照ブロック106を考える。   On the other hand, in the reference frame 102, a projected image block 104 of the target block (see the dotted line in FIG. 51) is assumed at the same position as the target block 103 of the original frame, and the projected image block 104 of the target block is A search range 105 (see the one-dot chain line in FIG. 51) is set as the center, and a reference block 106 having the same size as the target block 103 is considered.

そして、この参照ブロック106の位置を参照フレーム102のサーチ範囲105内において移動させ、各位置において参照ブロック106に含まれる画像内容と、ターゲットブロック103の画像内容との相関を求め、最も相関が強いとして検出された参照ブロック106の位置を、元フレームのターゲットブロック103が、参照フレーム102において移動した位置として検出するようにする。そして、その検出した参照フレーム106の位置と、ターゲットブロックの位置との間の位置ずれ量を、方向成分を含む量としての動きベクトルとして検出するようにする。   Then, the position of the reference block 106 is moved within the search range 105 of the reference frame 102, and the correlation between the image content included in the reference block 106 and the image content of the target block 103 is obtained at each position, and the strongest correlation is obtained. Is detected as the position where the target block 103 of the original frame has moved in the reference frame 102. Then, the displacement amount between the detected position of the reference frame 106 and the position of the target block is detected as a motion vector as an amount including a direction component.

この場合、参照ブロック106は、サーチ範囲105を、例えば水平方向および垂直方向に、1画素または複数画素単位で移動させるようにする。したがって、サーチ範囲105内には、複数個の参照ブロックが設定されることになる。   In this case, the reference block 106 moves the search range 105 in units of one pixel or a plurality of pixels, for example, in the horizontal direction and the vertical direction. Therefore, a plurality of reference blocks are set in the search range 105.

ここで、ターゲットブロック103と、サーチ範囲105内を移動する各参照ブロック16との相関は、ターゲットブロック103内の各画素の輝度値と、参照ブロック106内の対応する各画素の輝度値との差分の絶対値の、ブロック内の全画素についての総和(この差分の絶対値の総和を差分絶対値和と呼ぶ。以下、この差分絶対値和をSAD(Sum of Absolute Difference)値と記載することとする)を求めることにより検出する。すなわち、SAD値が最小となる位置の参照ブロック106が最も相関が強い参照ブロックとして検出され、その検出された参照ブロック106のターゲットブロック103の位置に対する位置ずれ量が動きベクトルとして検出される。   Here, the correlation between the target block 103 and each reference block 16 that moves within the search range 105 is the luminance value of each pixel in the target block 103 and the luminance value of each corresponding pixel in the reference block 106. Sum of absolute values of differences for all pixels in the block (the sum of absolute values of the differences is referred to as difference absolute value sum. Hereinafter, this difference absolute value sum is referred to as SAD (Sum of Absolute Difference) value. )). That is, the reference block 106 at the position where the SAD value is minimum is detected as the reference block having the strongest correlation, and the amount of displacement of the detected reference block 106 with respect to the position of the target block 103 is detected as a motion vector.

ブロックマッチングでは、サーチ範囲105内に設定される複数個の参照ブロック106のそれぞれの、ターゲットブロック103の位置に対する位置ずれ量は、方向成分を含む量としての参照ベクトル107(図51参照)で表現される。各参照ブロック106の参照ベクトル107は、参照ブロック106の参照フレーム102上の位置に応じた値となるが、従来のブロックマッチングでは、SAD値が最小値となる参照ブロック106の参照ベクトルを、ターゲットブロック103に対する動きベクトルとして検出するものである。   In block matching, the amount of positional deviation of each of the plurality of reference blocks 106 set in the search range 105 with respect to the position of the target block 103 is expressed by a reference vector 107 (see FIG. 51) as an amount including a direction component. Is done. The reference vector 107 of each reference block 106 has a value corresponding to the position of the reference block 106 on the reference frame 102. In the conventional block matching, the reference vector of the reference block 106 having the minimum SAD value is used as the target. This is detected as a motion vector for the block 103.

そこで、ブロックマッチングでは、一般に、図52に示すように、サーチ範囲105内において設定される複数個の参照ブロック106のそれぞれとターゲットブロック103との間におけるSAD値(以下、説明の簡単のため参照ブロックについてのSAD値という)を、サーチ範囲105内におけるそれぞれの参照ブロック106の位置に応じた参照ベクトル107のそれぞれに対応させて、メモリに記憶しておき、そのメモリに記憶された全ての参照ブロック106についてのSAD値の中から、最小のSAD値の参照ブロック106を検出することで、ターゲットブロック103に対する動きベクトル110を検出するようにしている。   Therefore, in block matching, generally, as shown in FIG. 52, SAD values between each of a plurality of reference blocks 106 set in the search range 105 and the target block 103 (hereinafter referred to for the sake of simplicity). (Referred to as the SAD value for the block) is stored in the memory in correspondence with each reference vector 107 corresponding to the position of each reference block 106 in the search range 105, and all the references stored in the memory are stored. The motion vector 110 for the target block 103 is detected by detecting the reference block 106 having the smallest SAD value from the SAD values for the block 106.

サーチ範囲105内に設定された複数個の参照ブロック106の位置に応じた参照ベクトル107のそれぞれに対応させて、それぞれの参照ブロック106についてのSAD値を記憶したものを、差分絶対値和テーブル(以下SADテーブルという)と呼ぶ。図46のSADテーブル108が、これを示しており、このSADテーブル108において、それぞれの参照ブロック106についてのSAD値をSADテーブル要素109という。   A difference absolute value sum table (SAD value stored for each reference block 106 corresponding to each of the reference vectors 107 corresponding to the positions of the plurality of reference blocks 106 set in the search range 105 is stored. Hereinafter, this is referred to as an SAD table). This is shown in the SAD table 108 of FIG. 46. In this SAD table 108, the SAD value for each reference block 106 is referred to as an SAD table element 109.

なお、上述の説明において、ターゲットブロック103および参照ブロック106の位置とは、それらのブロックの任意の特定の位置、例えば中心位置を意味するものであり、参照ベクトル107は、参照フレーム102におけるターゲットブロック103の射影イメージブロック104の位置と、参照ブロック106の位置との間のずれ量(方向を含む)を示すものである。図51および図52の例では、ターゲットブロック103は、フレームの中心位置にあるとしている場合である。   In the above description, the positions of the target block 103 and the reference block 106 mean any specific position of these blocks, for example, the center position, and the reference vector 107 is the target block in the reference frame 102. A shift amount (including direction) between the position of the projected image block 104 of 103 and the position of the reference block 106 is shown. 51 and 52, the target block 103 is assumed to be at the center position of the frame.

そして、各参照ブロック106に対応する参照ベクトル107は、参照フレーム102上のターゲットブロック103に対応する位置に対する当該各参照ブロック106の位置ずれとなっているので、参照ブロック106の位置が特定されると、その位置に対応して参照ベクトルの値も特定される。したがって、SADテーブル108のメモリにおける参照ブロックのSADテーブル要素のアドレスが特定されると、対応する参照ベクトルは特定されることになる。   Then, since the reference vector 107 corresponding to each reference block 106 is misaligned with respect to the position corresponding to the target block 103 on the reference frame 102, the position of the reference block 106 is specified. Then, the value of the reference vector is also specified corresponding to the position. Therefore, when the address of the SAD table element of the reference block in the memory of the SAD table 108 is specified, the corresponding reference vector is specified.

以上説明した従来のブロックマッチングの処理を、図53のフローチャートを参照して説明すると、次のようになる。   The conventional block matching process described above will be described with reference to the flowchart of FIG.

先ず、サーチ範囲105内の1つの参照ブロックIiを指定するが、これは、当該参照ブロックIiに対応する参照ベクトルを指定することに等しい(ステップS1)。ここで、図52において、(vx,vy)は、ターゲットブロックのフレーム上の位置を基準位置(0,0)としたときに、指定された参照ベクトルにより示される位置を示し、vxは指定された参照ベクトルによる、基準位置からの水平方向のずれ量成分であり、また、vyは指定された参照ベクトルによる、基準位置からの垂直方向成分のずれ量成分である。   First, one reference block Ii in the search range 105 is designated, which is equivalent to designating a reference vector corresponding to the reference block Ii (step S1). Here, in FIG. 52, (vx, vy) indicates the position indicated by the specified reference vector when the position of the target block on the frame is the reference position (0, 0), and vx is specified. The reference vector is a deviation component in the horizontal direction from the reference position, and vy is a deviation component in the vertical direction component from the reference position due to the designated reference vector.

ここでは、ずれ量vx、vyは、画素を単位とした値とされ、例えばvx=+1は、基準位置(0,0)に対して、水平方向の右方向に1画素分ずれた位置を示し、また、vx=−1は、基準位置(0,0)に対して、水平方向の左方向に1画素分ずれた位置を示している。また、例えばvy=+1は、基準位置(0,0)に対して、垂直方向の下方向に1画素分ずれた位置を示し、また、vy=−1は、基準位置(0,0)に対して、垂直方向の上方向に1画素分ずれた位置を示している。   Here, the shift amounts vx and vy are values in units of pixels. For example, vx = + 1 indicates a position shifted by one pixel in the right direction in the horizontal direction with respect to the reference position (0, 0). In addition, vx = −1 indicates a position shifted by one pixel in the horizontal left direction with respect to the reference position (0, 0). For example, vy = + 1 indicates a position shifted by one pixel in the downward direction in the vertical direction with respect to the reference position (0, 0), and vy = −1 indicates the reference position (0, 0). On the other hand, a position shifted by one pixel upward in the vertical direction is shown.

以上のように、(vx、vy)は、参照ベクトルで示される基準位置に対する位置(以下、簡単のため、参照ベクトルで示される位置という)を示しており、参照ベクトルのそれぞれに対応している。つまり、vxおよびvyを整数としたとき、(vx、vy)は参照ベクトルのそれぞれを表すことになる。したがって、以下の説明においては、(vx、vy)の位置を示す参照ベクトルを、参照ベクトル(vx、vy)と記載することがある。   As described above, (vx, vy) indicates a position with respect to the reference position indicated by the reference vector (hereinafter referred to as a position indicated by the reference vector for simplicity), and corresponds to each of the reference vectors. . That is, when vx and vy are integers, (vx, vy) represents each of the reference vectors. Therefore, in the following description, a reference vector indicating the position of (vx, vy) may be described as a reference vector (vx, vy).

ここで、サーチ範囲の中心位置をターゲットブロックの位置、つまり前記基準位置(0,0)とし、サーチ範囲を、水平方向には±Rx、垂直方向には±Ryとしたとき、
−Rx≦vx≦+Rx、−Ry≦vy≦+Ry
とされるものである。
Here, when the center position of the search range is the target block position, that is, the reference position (0, 0), and the search range is ± Rx in the horizontal direction and ± Ry in the vertical direction,
-Rx≤vx≤ + Rx, -Ry≤vy≤ + Ry
It is supposed to be.

次に、ターゲットブロックIo内の1つの画素の座標(x,y)を指定する(ステップS2)。次に、ターゲットブロックIo内の指定された1つの座標(x,y)の画素値Io(x,y)と、参照ブロックIi内の対応する画素位置の画素値Ii(x+vx,y+vy)との差分の絶対値αを算出する(ステップS3)。すなわち、差分絶対値αは、
α=|Io(x,y)−Ii(x+vx,y+vy)| ・・・(式1)
として算出される。
Next, the coordinates (x, y) of one pixel in the target block Io are designated (step S2). Next, the pixel value Io (x, y) of one designated coordinate (x, y) in the target block Io and the pixel value Ii (x + vx, y + vy) of the corresponding pixel position in the reference block Ii The absolute value α of the difference is calculated (step S3). That is, the difference absolute value α is
α = | Io (x, y) −Ii (x + vx, y + vy) | (Formula 1)
Is calculated as

そして、算出した差分絶対値αを、当該参照ブロックIiの参照ベクトル(vx,vy)が指し示すアドレス(テーブル要素)の、それまでのSAD値に加算し、その加算であるSAD値を、当該アドレスに書き戻すようにする(ステップS4)。すなわち、参照ベクトル(vx,vy)に対応するSAD値を、SAD(vx,vy)と表すと、
SAD(vx,vy)=Σα=Σ|Io(x,y)−Ii(x+vx,y+vy)|
・・・(式2)
として算出し、当該参照ベクトル(vx,vy)が指し示すアドレスに書き込むようにする。
Then, the calculated absolute difference value α is added to the SAD value so far of the address (table element) indicated by the reference vector (vx, vy) of the reference block Ii, and the SAD value that is the addition is added to the address (Step S4). That is, when the SAD value corresponding to the reference vector (vx, vy) is expressed as SAD (vx, vy),
SAD (vx, vy) = Σα = Σ | Io (x, y) −Ii (x + vx, y + vy) |
... (Formula 2)
And written to the address indicated by the reference vector (vx, vy).

次に、ターゲットブロックIo内の全ての座標(x,y)の画素について、上記の演算を行なったか否かを判別し(ステップS5)、ターゲットブロックIo内の全ての座標(x,y)の画素については、未だ、演算は終了していないと判別したときには、ステップS2に戻り、ターゲットブロックIo内の次の座標(x,y)の画素位置を指定し、このステップS2以降の処理を繰り返す。   Next, it is determined whether or not the above calculation has been performed on the pixels of all coordinates (x, y) in the target block Io (step S5), and all the coordinates (x, y) in the target block Io are determined. For the pixel, when it is determined that the calculation has not been completed yet, the process returns to step S2, the pixel position of the next coordinate (x, y) in the target block Io is designated, and the processes after step S2 are repeated. .

また、ステップS5で、ターゲットブロックIo内の全ての座標(x,y)の画素について、上記の演算を行なったと判別したときには、当該参照ブロックについてのSAD値の算出が終了したと判別して、サーチ範囲内の全ての参照ブロック、すなわち、全ての参照ベクトル(vx,vy)についての上記の演算処理を完了したか否か判別する(ステップS6)。   In step S5, when it is determined that the above calculation has been performed for all the pixels of the coordinates (x, y) in the target block Io, it is determined that the calculation of the SAD value for the reference block has ended. It is determined whether or not the above arithmetic processing has been completed for all reference blocks in the search range, that is, all reference vectors (vx, vy) (step S6).

ステップS6で、未だ、上記の演算処理を完了していない参照ベクトル(vx,vy)があると判別すると、ステップS1に戻り、上記の演算処理を完了していない次の参照ベクトル(vx,vy)を設定して、このステップS1以降の処理を繰り返す。   If it is determined in step S6 that there is a reference vector (vx, vy) for which the above arithmetic processing has not yet been completed, the process returns to step S1, and the next reference vector (vx, vy) for which the above arithmetic processing has not been completed. ) Is set, and the processing after step S1 is repeated.

そして、ステップS6で、上記の演算処理を完了していない参照ベクトル(vx,vy)はサーチ範囲内になくなったと判別すると、SADテーブルが完成したとして、当該完成したSADテーブルにおいて、最小値となっているSAD値を検出する(ステップS7)。そして、当該最小値となっているSAD値のアドレスに対応する参照ベクトルを、ターゲットブロックIoに対する動きベクトルとして検出する(ステップS8)。ここで、SADの最小値をSAD(mx,my)と書き表すと、目的とする動きベクトルは、位置(mx,my)を示すベクトル(mx,my)として算出される。   If it is determined in step S6 that the reference vector (vx, vy) for which the above arithmetic processing has not been completed is no longer in the search range, the SAD table is completed, and the minimum value is obtained in the completed SAD table. The detected SAD value is detected (step S7). Then, a reference vector corresponding to the address of the SAD value that is the minimum value is detected as a motion vector for the target block Io (step S8). Here, when the minimum value of SAD is written as SAD (mx, my), the target motion vector is calculated as a vector (mx, my) indicating the position (mx, my).

以上で、1つのターゲットブロックに対するブロックマッチングによる動きベクトルの検出処理は、終了となる。   This completes the motion vector detection process by block matching for one target block.

実際的には、一つのターゲットブロックについての動きベクトルでは、元フレームに対する参照フレームについての精度の良い手ぶれベクトルを得ることが困難である。そのため、元フレームにおいては、ターゲットブロックは、元フレームの全範囲をカバーするように、複数個が設定され、一方、参照フレームにおいては、図54に示すように、その複数個のターゲットブロックの射影イメージ104、104、・・・について、それぞれサーチ範囲105、105、・・・を設定して、それぞれのサーチ範囲について、対応するターゲットブロックに対する動きベクトル110、110、・・・の検出を行うようにする。   Actually, it is difficult to obtain an accurate camera shake vector for the reference frame with respect to the original frame with the motion vector for one target block. Therefore, in the original frame, a plurality of target blocks are set so as to cover the entire range of the original frame, while in the reference frame, projections of the plurality of target blocks are provided as shown in FIG. The search ranges 105, 105,... Are set for the images 104, 104,..., And the motion vectors 110, 110,. To.

そして、検出された複数個の動きベクトル110、110、・・・から、元フレームに対する参照フレームについての手ぶれベクトル(グローバル動きベクトル)を検出するようにする。   Then, a camera shake vector (global motion vector) for a reference frame with respect to the original frame is detected from the detected plurality of motion vectors 110, 110,.

この複数個の動きベクトル110から、手ぶれベクトル(グローバル動きベクトル)を検出する手法としては、複数の動きベクトルの多数決によるもの、すなわち、複数個の動きベクトル110で、向きおよび大きさが同等である動きベクトルの数が最も多い動きベクトルをグローバル動きベクトルとする手法が主として提案されている。また、この多数決による手法と、時間軸方向の動きベクトルの変化量(周波数)による信頼性評価との併用方法が提案されている。   As a method of detecting a hand movement vector (global motion vector) from the plurality of motion vectors 110, a method based on majority decision of a plurality of motion vectors, that is, the plurality of motion vectors 110 have the same direction and size. A method of using a motion vector having the largest number of motion vectors as a global motion vector has been mainly proposed. In addition, a method using both the method based on the majority vote and the reliability evaluation based on the change amount (frequency) of the motion vector in the time axis direction has been proposed.

従来技術としてのセンサレス手ぶれ補正は、特許文献1(特開2003-78807号公報)に代表されるように、その殆どが動画をターゲットとしている。また、センサレス手ぶれ補正を静止画で実現する手法としては、特許文献2(特開平7−283999号公報)を始め、幾つか提案はされている。この特許文献2は、手ぶれの発生しない程度の短い露光時間で何枚かの静止画を連写撮影し、その静止画間の手ぶれベクトルを求め、その手ぶれベクトルに従って、前記連射撮影した複数枚の静止画を平行移動(およびロール軸方向に回転)させながら加算(もしくは平均化)して行くことで、最終的に手ぶれと低照度ノイズの無い高画質の静止画を得る、というアルゴリズムである。   Most sensorless camera shake correction as a conventional technique is targeted for moving images, as represented by Patent Document 1 (Japanese Patent Laid-Open No. 2003-78807). Further, as a technique for realizing sensorless camera shake correction with a still image, several proposals have been made including Patent Document 2 (Japanese Patent Laid-Open No. 7-283999). In this Patent Document 2, several still images are continuously shot with a short exposure time that does not cause camera shake, a camera shake vector between the still images is obtained, and a plurality of the consecutive shots are obtained according to the camera shake vector. The algorithm is such that the still image is added (or averaged) while being translated (and rotated in the roll axis direction), thereby finally obtaining a high-quality still image free from camera shake and low illuminance noise.

実現できるレベルの現実的な提案としては、特許文献3(特開2005−38396公報)を挙げることができる。この特許文献3に示されたものは、画像を縮小変換したサイズで動ベクトルを求める手段と、同一のSADテーブルを複数のブロックで共有する手段から構成される。画像の縮小変換と、SADテーブルの複数ブロックでの共有化は、SADテーブルサイズの削減を実現するための、非常に良い手法であり、MPEG(Moving Picture Experts Group)画像圧縮方式における動きベクトル検出やシーンチェンジ検出等、他分野でも使われている。   Patent Document 3 (Japanese Patent Laid-Open No. 2005-38396) can be cited as a realistic proposal that can be realized. The device disclosed in Patent Document 3 includes means for obtaining a motion vector with a reduced size of an image and means for sharing the same SAD table among a plurality of blocks. Image reduction conversion and sharing of the SAD table among a plurality of blocks is a very good technique for reducing the size of the SAD table. Motion vector detection in the MPEG (Moving Picture Experts Group) image compression method, It is also used in other fields such as scene change detection.

しかし、この特許文献3のアルゴリズムの問題点として、画像の縮小変換と、その際のメモリ(DRAM(Dynamic RAM(Random Access Memory)))アクセスに、時間とメモリ容量を消費することと、SADテーブルを複数ブロックで時分割アクセスする手法のため、メモリアクセスが非常に増加し、この処理にも時間を要してしまうという課題がある。動画の手ぶれ補正においては、リアルタイム性と同時にシステム遅延時間の短縮が求められるため、この処理時間の問題が課題となってしまうのである。   However, as problems of the algorithm of Patent Document 3, time and memory capacity are consumed for image reduction conversion and memory (DRAM (Random Access Memory)) access at that time, and the SAD table. As a result of the method of performing time-division access on a plurality of blocks, memory access increases greatly, and this processing also takes time. In motion blur correction of moving images, a reduction in system delay time is required simultaneously with real-time performance, and this problem of processing time becomes a problem.

また、元画像を縮小変換する際には、エイリアシング(折り返し歪み)や、低照度ノイズ除去のためのローパスフィルタを、縮小処理の前処理として実装するが必要である。しかし、縮小倍率に応じて、ローパスフィルタの特性が変化する上、特に、垂直方向のローパスフィルタの場合、多タップのデジタルフィルタとした場合に、多くのラインメモリと演算ロジックを必要としなければならず、回路規模増加の問題が生じる。   Further, when the original image is reduced and converted, it is necessary to implement aliasing (folding distortion) and a low-pass filter for removing low illuminance noise as pre-processing of the reduction process. However, the characteristics of the low-pass filter change according to the reduction ratio. In particular, in the case of a low-pass filter in the vertical direction, a multi-tap digital filter requires a lot of line memory and arithmetic logic. Therefore, the problem of circuit scale increase arises.

上記の先行技術文献は、次の通りである。
特開2003−78807号公報 特開平7−283999号公報 特開2005−38396号公報
The above prior art documents are as follows.
JP 2003-78807 A JP-A-7-283999 JP 2005-38396 A

動画の手ぶれ補正システムにおいては、精度よりも処理時間を重視した、大まかな手ぶれベクトルのリアルタイム検出が求められており、従来技術によるセンサレス手ぶれ補正手法でも、殆どの状況において満足のいく結果が得られる。   In video stabilization systems, real-time detection of rough camera shake vectors that emphasizes processing time rather than accuracy is required, and even the conventional sensorless image stabilization methods can provide satisfactory results in most situations. .

しかしながら、例えば、ユーザが動画撮影中に、他のカメラマンがフラッシュを焚くことにより、1フレームだけ突然明るさが変化(画面全体が明滅)するような場合、動きベクトルが誤検出されてしまうという問題が指摘されている。   However, for example, when the user suddenly changes the brightness by one frame (blinks the entire screen) when another cameraman flashes the flash while the user is shooting a movie, the motion vector is erroneously detected. Has been pointed out.

これを回避するために、従来は、フレーム内の各動きベクトル毎の最小SAD値を信頼性として用いたり、時間軸方向の動きベクトルの変化量から、手ぶれ周波数を算出し、次のフレームの動きベクトルを予測することで、著しく予測と異なるベクトルを排除する、という手法が採られている。   In order to avoid this, conventionally, the minimum SAD value for each motion vector in the frame is used as reliability, or the camera shake frequency is calculated from the amount of change in the motion vector in the time axis direction, and the motion of the next frame is calculated. A technique is adopted in which a vector is predicted to eliminate a vector that is significantly different from the prediction.

ところが、例えば、細かい波面のある水面を動画撮影する場合、フレーム内に設定された複数のターゲットブロックについて検出された各動きベクトルがバラバラになる上、複数フレームに渡って最小SAD値は、比較的小さい良好な値を示すため、上述した画面明滅の際のような手法が通用しない。また、ありふれた被写体として、木や草が風になびく情景もあるが、この場合も、誤った手ぶれベクトルを検出する場合が多い。   However, for example, when shooting a moving water surface with a fine wavefront, the motion vectors detected for a plurality of target blocks set in a frame vary, and the minimum SAD value over a plurality of frames is relatively low. In order to show a small good value, the method as in the screen blinking described above cannot be applied. In addition, as a common subject, there is a scene where trees and grass flutter in the wind. In this case as well, an erroneous camera shake vector is often detected.

このような問題が従来のセンサレス手ぶれ補正において生じる理由のうち、最も主要なものは、従来のセンサレス手ぶれ補正方式の殆どが、グローバル動きベクトルとしての手ぶれベクトルを検出する方法として、1フレームについて検出された複数個の動きベクトルについて多数決を取り、方向および大きさが最も多い動きベクトルをグローバル動きベクトルとして検出する多数決方式を採用していることに基づくものである。   Among the reasons why such a problem occurs in the conventional sensorless image stabilization, most of the conventional sensorless image stabilization methods are detected for one frame as a method for detecting a shake vector as a global motion vector. This is based on the fact that a majority vote is taken for a plurality of motion vectors and a majority motion vector having the largest direction and size is detected as a global motion vector.

そして、上述のような誤検出が行われた場合、実際の手ぶれと異なったベクトルに従って手ぶれ補正がなされてしまうため、結果の画像として、著しく不快な感覚をユーザに与えてしまう。現在、ジャイロセンサを用いた光学式の手ぶれ補正に、電子式手ぶれ補正が淘汰されつつある理由の1つには、この課題が解決されていないことが挙げられる。   When the above-described erroneous detection is performed, camera shake correction is performed according to a vector different from the actual camera shake, and thus the user feels a very uncomfortable feeling as a resultant image. One of the reasons why electronic camera shake correction using a gyro sensor is currently being considered is that this problem has not been solved.

しかし、前述の通り、デジタルカメラなどの撮像装置では、今後益々高密度画素化が進み、高性能化が求められると予想されるが、このような状況においては、静止画の撮影時の手ぶれ補正を、ジャイロ(角速度)センサを用いないセンサレスで実現する意義は非常に大きい。   However, as described above, in imaging devices such as digital cameras, it is expected that high-density pixels will continue to increase in the future and higher performance is required. In such situations, camera shake correction during still image shooting is expected. It is very significant to realize sensorless without using a gyro (angular velocity) sensor.

そこで、上述したように、ブロックマッチングを用いて、センサレスで、手ぶれ動きベクトルを検出し、その検出した動きベクトルを用いて手ぶれ補正を行なうことが有望であり、上述した課題の解決が重要である。   Therefore, as described above, it is promising to detect a shake motion vector sensorlessly using block matching, and to perform shake correction using the detected motion vector, and it is important to solve the above-described problems. .

この発明は、以上の点にかんがみ、上述した従来のセンサレス手ぶれ補正方式の問題点を解決することができる画像処理方法および装置を提供することを目的とする。   In view of the above points, an object of the present invention is to provide an image processing method and apparatus capable of solving the problems of the conventional sensorless camera shake correction method described above.

上記の課題を解決するために、請求項1の発明は、
画面単位で順次に入力される画像について、注目画面である参照画面と、当該参照画面よりも前の画面である元画面との間の1画面分単位での動きベクトルを算出する画像処理装置であって、
前記元画面中において、複数の所定の位置に、それぞれ複数の画素からなる所定の大きさのターゲットブロックを設定し、前記参照画面において、前記ターゲットブロックと同じ大きさの参照ブロックを、前記複数のターゲットブロックの位置に応じて設定された複数のサーチ範囲のそれぞれにおいて複数個設定し、前記サーチ範囲のそれぞれにおいて、前記設定した前記複数個の参照ブロックのそれぞれについて当該参照ブロック内の各画素の画素値と、前記ターゲットブロック内で対応する位置の各画素の画素値との差分の絶対値の総和である差分絶対値和を求める差分絶対値和算出手段と、
前記複数のサーチ範囲のそれぞれにおいて前記差分絶対値和算出手段で算出された前記差分絶対値和について、前記複数のサーチ範囲のそれぞれで対応する参照ブロック位置のものを合算して合算差分絶対値和を求め、一つのサーチ範囲内の複数参照ブロック位置分の前記合算差分絶対値和を記憶する合算差分絶対値和テーブルを生成する合算差分絶対値和テーブル生成手段と、
前記合算差分絶対値和テーブル生成手段で生成された前記合算差分絶対値和テーブルから、前記元画面に対する前記参照画面の動きベクトルを検出する動きベクトル検出手段と、
を備える画像処理装置を提供する。
In order to solve the above problems, the invention of claim 1
An image processing apparatus that calculates a motion vector in units of one screen between a reference screen that is an attention screen and an original screen that is a screen before the reference screen for images that are sequentially input in units of screens. There,
In the original screen, a target block having a predetermined size composed of a plurality of pixels is set at a plurality of predetermined positions, and a reference block having the same size as the target block is set on the reference screen. A plurality of search ranges set in accordance with the position of the target block are set, and in each of the search ranges, each pixel in the reference block is set for each of the set reference blocks. A difference absolute value sum calculating means for obtaining a difference absolute value sum that is a sum of absolute values of differences between a value and a pixel value of each pixel at a corresponding position in the target block;
For each of the plurality of search ranges, the difference absolute value sum calculated by the difference absolute value sum calculation means is added to the sum of the reference block positions corresponding to each of the plurality of search ranges to add up the difference absolute value sum. And a sum difference absolute value sum table generating means for generating a sum difference absolute value sum table for storing the sum of sum difference absolute value sums for a plurality of reference block positions within one search range;
A motion vector detecting means for detecting a motion vector of the reference screen relative to the original screen from the summed absolute difference sum table generated by the summed absolute difference sum table generating means;
An image processing apparatus is provided.

上述の構成の請求項1の発明による画像処理装置においては、参照画面のサーチ範囲内のそれぞれの参照ブロックと、元画面のターゲットブロックとの間の差分絶対値和(SAD値)を、差分絶対値和算出手段で求めるのは従来と同様である。   In the image processing apparatus according to the first aspect of the present invention, the difference absolute value sum (SAD value) between each reference block within the search range of the reference screen and the target block of the original screen is calculated as the difference absolute value. The value sum calculation means is the same as in the prior art.

この発明においては、元画面において設定された複数のターゲットブロックおよびサーチ範囲のそれぞれについてのSAD値を求めるが、複数のサーチ範囲のそれぞれで対応する参照ブロック位置のSAD値を合算し、合算差分絶対値和(合算SAD値という)を求める。これにより、一つのサーチ範囲内の複数参照ブロック位置分の合算SAD値が求められ、それらの合算SAD値を記憶する合算差分絶対値和テーブルが生成される。そして、この合算SADテーブルから、元画面に対する参照画面の動きベクトル(グローバル動きベクトル)が検出される。   In the present invention, the SAD values for each of the plurality of target blocks and search ranges set on the original screen are obtained, and the SAD values of the corresponding reference block positions in each of the plurality of search ranges are added together to obtain the sum difference absolute A sum of values (referred to as a combined SAD value) is obtained. As a result, a combined SAD value for a plurality of reference block positions within one search range is obtained, and a combined difference absolute value sum table for storing the combined SAD values is generated. Then, a motion vector (global motion vector) of the reference screen with respect to the original screen is detected from the total SAD table.

従来は、元画面に設定された複数個のターゲットブロックのそれぞれについて、動きベクトル(ターゲットブロック毎動きベクトル)を求め、その求められた複数個の動きベクトルについての多数決によりグローバル動きベクトルを算出するようにしていたが、これとは異なり、この発明における合算SAD値からなる合算SADテーブルは、フレーム全体をまとめてブロックマッチングした結果と等価になる。   Conventionally, a motion vector (motion vector for each target block) is obtained for each of a plurality of target blocks set on the original screen, and a global motion vector is calculated by majority vote for the obtained plurality of motion vectors. However, unlike this, the sum SAD table composed of the sum SAD values in the present invention is equivalent to the result of block matching the entire frame together.

このため、この合算SADテーブルから求められたグローバル動きベクトルを用いて手ぶれ補正をした場合には、フラッシュが焚かれたときのフレーム全体の明滅や水面の波面等の被写体に対しても、従来手法のような大きく間違った補正を回避することができると共に、そのような被写体でない場合にも、従来よりも高精度の補正が可能となる。つまり、ロバスト性と高精度を両立した手ぶれ補正を提供することが可能となる。   For this reason, when camera shake correction is performed using the global motion vector obtained from the combined SAD table, the conventional method is applied to subjects such as the blinking of the entire frame and the wavefront of the water surface when the flash is applied. Such a large and incorrect correction can be avoided, and even when the subject is not such, correction with higher accuracy than before can be performed. That is, it is possible to provide camera shake correction that achieves both robustness and high accuracy.

また、請求項2の発明は、請求項1に記載の画像処理装置において、
前記サーチ範囲内の複数参照ブロック位置についての前記差分絶対値和を記憶する差分絶対値和テーブルを、前記複数個のサーチ範囲に対応して複数生成する差分絶対値和テーブル生成手段と、
前記差分絶対値和テーブル生成手段で生成された前記複数の差分絶対値和テーブルのそれぞれにおける前記差分絶対値和の最小値と、前記合算差分絶対値和算出手段で算出された前記合算差分絶対値和の最小値とから、動被写体部分であると見なされる前記ターゲットブロックについての前記差分絶対値和テーブルを検出する手段を設け、
前記動きベクトル検出手段では、前記動被写体部分であると見なされる前記ターゲットブロックについての前記差分絶対値和テーブルの差分絶対値和を除いて、前記合算差分絶対値和を再算出して、合算差分絶対値和テーブルを再算出し、この再算出した前記合算差分絶対値和テーブルから、前記動きベクトルを検出する
ことを特徴とする画像処理装置を提供する。
According to a second aspect of the present invention, in the image processing apparatus according to the first aspect,
A difference absolute value sum table generating means for generating a plurality of difference absolute value sum tables for storing the difference absolute value sums for a plurality of reference block positions in the search range in correspondence with the plurality of search ranges;
The minimum value of the difference absolute value sum in each of the plurality of difference absolute value sum tables generated by the difference absolute value sum table generation means, and the sum difference absolute value calculated by the sum difference absolute value sum calculation means Means for detecting the difference absolute value sum table for the target block considered to be a moving subject part from the minimum value of the sum;
The motion vector detection means recalculates the sum of absolute differences, excluding the sum of absolute differences of the difference absolute value sum table for the target block considered to be the moving subject part, and adds the sum of differences There is provided an image processing apparatus characterized by recalculating an absolute value sum table and detecting the motion vector from the recalculated summed absolute difference sum table.

この請求項2の発明においては、合算SAD値の最小値と、複数個のターゲットブロックのそれぞれに対するSADテーブルのSAD値の最小値とから、手ぶれなどによる動きではなく、動く被写体の動き部分であるともなされるターゲットブロックのSADテーブルが検出され、そのSADテーブルについてのSAD値は除いて、再度、合算SAD値を算出する。そして、その再算出した合算差分絶対値和から、動きベクトル(グローバル動きベクトル)が検出される。   According to the second aspect of the present invention, it is a movement part of a moving subject, not a movement due to camera shake or the like, from the minimum value of the combined SAD value and the minimum value of the SAD table of each of the plurality of target blocks. The SAD table of the target block to be accompanied is detected, and the total SAD value is calculated again, excluding the SAD value for the SAD table. Then, a motion vector (global motion vector) is detected from the recalculated sum of absolute differences.

また、請求項3の発明は、
画面単位で順次に入力される画像について、注目画面である参照画面と、当該参照画面よりも前の画面である元画面との間の1画面分単位での動きベクトルを算出する画像処理装置であって、
前記元画面中において、複数の所定の位置に、それぞれ複数の画素からなる所定の大きさのターゲットブロックを設定し、前記参照画面において、前記ターゲットブロックと同じ大きさの参照ブロックを、前記複数のターゲットブロックの位置に応じて設定された複数のサーチ範囲のそれぞれにおいて複数個設定し、前記サーチ範囲のそれぞれにおいて、前記設定した前記複数個の参照ブロックのそれぞれについて当該参照ブロック内の各画素の画素値と、前記ターゲットブロック内で対応する位置の各画素の画素値との差分の絶対値の総和である差分絶対値和を求める差分絶対値和算出手段と、
前記参照ブロックのそれぞれの前記参照画面上の位置の、前記ターゲットブロックの画面上の位置との位置ずれ量を、方向成分も含む参照ベクトルとし、当該参照ベクトルを所定の縮小率で縮小した参照縮小ベクトルを得る参照縮小ベクトル取得手段と、
前記複数のサーチ範囲のそれぞれのターゲットブロックについて、前記参照縮小ベクトルに応じた大きさの前記参照ベクトルを前記位置ずれ量とする、前記所定の縮小率に応じて削減された数の複数個の前記参照ブロックのそれぞれについての差分絶対値和を記憶する縮小差分絶対値和テーブルを生成する縮小差分絶対値和テーブル生成手段と、
前記縮小差分絶対値和テーブル生成手段により生成された、複数の前記縮小差分絶対値和テーブルについて、前記複数のサーチ範囲のそれぞれで対応する参照ブロック位置の前記差分絶対値和を合算して合算差分絶対値和を求め、合算縮小差分絶対値和テーブルを生成する合算縮小差分絶対値和テーブル生成手段と、
前記合算縮小差分絶対値和テーブル生成手段で生成された前記合算縮小差分絶対値和テーブルから、前記元画面に対する前記参照画面の動きベクトルを算出する動きベクトル算出手段と、
を備え、
前記縮小差分絶対値和テーブル生成手段は、
前記参照縮小ベクトル取得手段で取得された前記参照縮小ベクトルの近傍値となる複数の前記参照ベクトルを検出する近傍参照ベクトル検出手段と、
前記差分絶対値和算出手段で算出された前記参照ブロックのそれぞれについての前記差分の絶対値の総和から、前記近傍参照ベクトル検出手段で検出された前記近傍の複数の前記参照ベクトルのそれぞれに対応する差分絶対値和のそれぞれを算出する分散差分絶対値和算出手段と、
前記分散差分絶対値和算出手段で算出した前記近傍の複数の前記参照ベクトルのそれぞれに対応する前記差分絶対値和を、それまでの前記近傍の複数の前記参照ベクトルのそれぞれに対応する前記差分絶対値和に加算する分散加算手段と、
を備えることを特徴とする画像処理装置を提供する。
The invention of claim 3
An image processing apparatus that calculates a motion vector in units of one screen between a reference screen that is an attention screen and an original screen that is a screen before the reference screen for images that are sequentially input in units of screens. There,
In the original screen, a target block having a predetermined size composed of a plurality of pixels is set at a plurality of predetermined positions, and a reference block having the same size as the target block is set on the reference screen. A plurality of search ranges set in accordance with the position of the target block are set, and in each of the search ranges, each pixel in the reference block is set for each of the set reference blocks. A difference absolute value sum calculating means for obtaining a difference absolute value sum that is a sum of absolute values of differences between a value and a pixel value of each pixel at a corresponding position in the target block;
A reference reduction including a reference vector including a directional component is used as a positional deviation amount of each reference block on the reference screen relative to the target block on the screen, and the reference vector is reduced at a predetermined reduction ratio. A reference reduced vector obtaining means for obtaining a vector;
For each target block in the plurality of search ranges, the reference vector having a size corresponding to the reference reduction vector is used as the positional shift amount, and a plurality of the plurality of the reductions corresponding to the predetermined reduction ratio are performed. A reduced difference absolute value sum table generating means for generating a reduced difference absolute value sum table for storing the difference absolute value sum for each of the reference blocks;
For the plurality of reduced difference absolute value sum tables generated by the reduced difference absolute value sum table generating means, the difference absolute value sums of the reference block positions corresponding to each of the plurality of search ranges are added together to add up the difference. A summed reduced difference absolute value sum table generating means for obtaining an absolute value sum and generating a summed reduced difference absolute value sum table;
A motion vector calculating unit that calculates a motion vector of the reference screen with respect to the original screen from the combined reduced difference absolute value sum table generated by the combined reduced difference absolute value sum table generating unit;
With
The reduced difference absolute value sum table generating means includes:
Neighborhood reference vector detection means for detecting a plurality of the reference vectors that are neighborhood values of the reference reduction vector acquired by the reference reduction vector acquisition means;
Corresponding to each of the plurality of neighboring reference vectors detected by the neighboring reference vector detecting means from the sum of the absolute values of the differences for each of the reference blocks calculated by the difference absolute value sum calculating means. A variance difference absolute value sum calculating means for calculating each of the difference absolute value sums;
The difference absolute value sum corresponding to each of the plurality of neighboring reference vectors calculated by the variance difference absolute value sum calculating means is used as the difference absolute value corresponding to each of the plurality of neighboring reference vectors so far. Distributed addition means for adding to the sum of values;
An image processing apparatus is provided.

この請求項3の発明においても、上述の請求項1と同様に、参照画面のサーチ範囲内のそれぞれの参照ブロックと、元画面のターゲットブロックとの間のSAD値を、SAD算出手段で求めるのは従来と同様である。   In the invention of claim 3, as in the case of claim 1 described above, the SAD calculation means obtains the SAD value between each reference block within the search range of the reference screen and the target block of the original screen. Is the same as before.

この発明においては、求めた参照ブロックのSAD値を、その参照ブロックの参照ベクトルに対応して記憶するのではなく、その参照ベクトルを縮小した参照縮小ベクトルに対応して記憶する縮小差分絶対値和テーブル生成手段を備える。   In this invention, the SAD value of the obtained reference block is not stored corresponding to the reference vector of the reference block, but is stored in correspondence with the reference reduced vector obtained by reducing the reference vector. Table generating means is provided.

この場合に、参照縮小ベクトルは、参照ブロックのそれぞれが対応する参照ベクトルとは一致していないので、縮小差分絶対値和テーブル生成手段は、先ず、参照縮小ベクトルの近傍の複数個の参照ベクトルを検出する。そして、それら近傍の複数の参照ベクトルのそれぞれに対応するSAD値を、SAD算出手段で算出したSAD値から算出する。   In this case, since the reference reduced vector does not match the reference vector corresponding to each of the reference blocks, the reduced difference absolute value sum table generation means first selects a plurality of reference vectors in the vicinity of the reference reduced vector. To detect. Then, the SAD value corresponding to each of the plurality of reference vectors in the vicinity thereof is calculated from the SAD value calculated by the SAD calculating means.

そして、算出した近傍の複数の参照ベクトルのそれぞれに対応するSAD値を、それまでの当該近傍の複数の参照ベクトルのそれぞれに対応するSAD値に加算する。   Then, the calculated SAD value corresponding to each of the plurality of reference vectors in the vicinity is added to the SAD value corresponding to each of the plurality of reference vectors in the vicinity so far.

こうして得られたSADテーブルは、参照縮小ベクトルのそれぞれの近傍の複数個の参照ベクトルのみについてのSAD値のテーブルとなっており、参照ベクトルの縮小率に応じて縮小されたものとなっている。   The SAD table thus obtained is a table of SAD values for only a plurality of reference vectors in the vicinity of each reference reduced vector, and is reduced according to the reduction rate of the reference vector.

つまり、換言すると、生成されたSAD値のテーブルは、参照ベクトルの縮小率に応じて縮小されたフレーム画像についてのSADテーブルに対応する。この場合において、ターゲットブロックおよび参照ブロックの大きさは縮小されていないので、生成されたSADテーブル(縮小差分絶対値和テーブル)のサイズは、小さくなる。   In other words, the generated SAD value table corresponds to the SAD table for the frame image reduced in accordance with the reduction ratio of the reference vector. In this case, since the sizes of the target block and the reference block are not reduced, the size of the generated SAD table (reduced difference absolute value sum table) is reduced.

請求項3の発明においては、このような縮小差分絶対値和テーブルが、複数個のターゲットブロックのそれぞれについて求められる。そして、求められた複数のターゲットブロックの縮小差分絶対値和テーブルにおいて、複数のサーチ範囲のそれぞれで対応する参照ブロック位置のSAD値が合算され、合算差分絶対値和が求められる。これにより、一つのサーチ範囲内の複数参照ブロック位置分の合算SAD値(合算縮小差分絶対値和テーブル)が得られる。そして、この合算縮小差分絶対値和テーブルから、元画面に対する参照画面の動きベクトル(グローバル動きベクトル)が検出される。   In the invention of claim 3, such a reduced difference absolute value sum table is obtained for each of a plurality of target blocks. Then, in the reduced difference absolute value sum table of the plurality of target blocks obtained, the SAD values at the corresponding reference block positions in each of the plurality of search ranges are added together to obtain the sum of absolute differences. Thereby, a combined SAD value (total reduced difference absolute value sum table) for a plurality of reference block positions within one search range is obtained. Then, a motion vector (global motion vector) of the reference screen with respect to the original screen is detected from the summed reduced difference absolute value sum table.

これにより、フレーム全体をまとめてブロックマッチングした結果と等価になる縮小合算SADテーブルから、動きベクトルが算出される。そして、この請求項3の発明においては、縮小SADテーブルおよび合算縮小SADテーブルは、上述したように、従来のブロックマッチングにおけるSADテーブルよりも容量の小さいものとなり、実現が現実的なものとなる。   As a result, a motion vector is calculated from the reduced sum SAD table that is equivalent to the result of block matching for the entire frame. In the invention of claim 3, the reduced SAD table and the combined reduced SAD table have a smaller capacity than the SAD table in the conventional block matching as described above, and the realization becomes realistic.

この発明においては、複数のサーチ範囲のそれぞれで対応する参照ブロック位置のSAD値を合算して、合算差分絶対値和(合算SAD値という)を求め、一つのサーチ範囲内の複数参照ブロック位置分の合算SAD値から、元画面に対する参照画面の動きベクトル(グローバル動きベクトル)を検出するようにした。この発明における合算SAD値は、フレーム全体をまとめてブロックマッチングした結果と等価になり、従来手法のような大きく間違った補正を回避することができると共に、そのような被写体でない場合にも、従来よりも高精度の補正が可能となる。つまり、ロバスト性と高精度を両立した手ぶれ補正を提供することが可能となる。   In the present invention, SAD values at corresponding reference block positions in each of a plurality of search ranges are added together to obtain a sum of absolute differences (referred to as a combined SAD value), and a plurality of reference block positions within one search range are obtained. The motion vector (global motion vector) of the reference screen relative to the original screen is detected from the total SAD value. The total SAD value in the present invention is equivalent to the result of block matching of the entire frame together, and can avoid a large and erroneous correction as in the conventional method. Can be corrected with high accuracy. That is, it is possible to provide camera shake correction that achieves both robustness and high accuracy.

以下、この発明による画像処理方法および画像処理装置の実施形態を、撮像装置および撮像方法に適用した場合を例にとって、図を参照しながら説明する。   Hereinafter, an embodiment of an image processing method and an image processing apparatus according to the present invention will be described with reference to the drawings, taking as an example the case of applying to an imaging apparatus and an imaging method.

[この発明による画像処理方法の実施形態の概要]
この発明による画像処理方法の実施形態においても、上述したブロックマッチングを用いて、2フレーム間の動きベクトルを検出するに当たって、前述したように、元フレームについて、複数個のターゲットフレームを設定して、その複数個のターゲットフレームのそれぞれについてブロックマッチングを施す。
[Outline of Embodiment of Image Processing Method According to the Present Invention]
Also in the embodiment of the image processing method according to the present invention, when detecting a motion vector between two frames using the block matching described above, as described above, a plurality of target frames are set for the original frame, Block matching is performed for each of the plurality of target frames.

以下に説明する実施形態においては、元フレームに、例えば16個のターゲットブロックTGi(i=1,2,・・・,16)を設定し、参照フレーム102には、図1に示すように、元フレームの16個のターゲットブロックに対応する16個の射影イメージ104i(i=1,2,・・・,16)を設定する。そして、それぞれの射影イメージに対するサーチ範囲105i(i=1,2,・・・,16)を設定し、それぞれのサーチ範囲105i(i=1,2,・・・,16)において、対応するターゲットブロックについてのSADテーブルTBLi(i=1,2,・・・,16)を作成する。   In the embodiment described below, for example, 16 target blocks TGi (i = 1, 2,..., 16) are set in the original frame, and in the reference frame 102, as shown in FIG. Sixteen projected images 104i (i = 1, 2,..., 16) corresponding to the 16 target blocks of the original frame are set. Then, a search range 105i (i = 1, 2,..., 16) is set for each projection image, and the corresponding target is set in each search range 105i (i = 1, 2,..., 16). A SAD table TBLi (i = 1, 2,..., 16) for the block is created.

そして、作成した16個のターゲットブロックについてのSADテーブルTBLiについて、図1に示すように、16個のSADテーブルTBLiを重ね合わせるように縦方向に並べたときに、SADテーブルTBLiのそれぞれを求めるサーチ範囲内で互いに対応する参照ブロック位置のSAD値を合算し、合算差分絶対値和(合算SAD値という)を求める。そして、その合算SAD値からなるSADテーブルとして、一つのサーチ範囲内の複数参照ブロック位置分についての合算SADテーブルSUM_TBLを生成する。   As shown in FIG. 1, when the 16 SAD tables TBLi are arranged in the vertical direction so as to overlap each other, the search for obtaining each of the SAD tables TBLi for the created 16 target blocks is performed. The SAD values at the reference block positions corresponding to each other within the range are added together to obtain a sum of absolute differences (referred to as a combined SAD value). Then, a sum SAD table SUM_TBL for a plurality of reference block positions within one search range is generated as a SAD table composed of the sum SAD values.

ここで、合算SADテーブルSUM_TBLの座標位置(x,y)の合算SAD値SUM_TBL(x,y)は、各SADテーブルTBLiの対応する座標位置(x,y)のSAD値をTBLi(x,y)とすると、
SUM_TBL(x,y)=TBL1(x,y)+TBL2(x,y)+・・・
+TBL16(x,y)
=ΣTBLi(x,y)
となる(図2の(式3)参照)。
Here, the total SAD value SUM_TBL (x, y) of the coordinate position (x, y) of the total SAD table SUM_TBL is the SAD value of the corresponding coordinate position (x, y) of each SAD table TBLi as TBLi (x, y). )
SUM_TBL (x, y) = TBL1 (x, y) + TBL2 (x, y) +.
+ TBL16 (x, y)
= ΣTBLi (x, y)
(See (Formula 3) in FIG. 2).

そして、この実施形態では、合算SADテーブルSUM_TBLから、元画面に対する参照画面の動きベクトル(グローバル動きベクトル;撮像装置における手ぶれベクトルとなる)を検出する。   In this embodiment, the motion vector of the reference screen with respect to the original screen (global motion vector; a camera shake vector in the imaging apparatus) is detected from the total SAD table SUM_TBL.

合算SADテーブルSUM_TBLからグローバル動きベクトルを算出する方法としては、合算SADテーブルSUM_TBLにおいて合算SAD値の最小値の位置を検出し、その検出した合算SAD値の最小値位置に対応する参照ベクトルを、グローバル動きベクトルとして検出する従来の方法を用いることができる。   As a method for calculating the global motion vector from the summed SAD table SUM_TBL, the position of the minimum value of the summed SAD value is detected in the summed SAD table SUM_TBL, and the detected reference vector corresponding to the position of the minimum value of the summed SAD value is determined globally. A conventional method of detecting as a motion vector can be used.

しかし、この最小値の合算SAD値を用いる方法では、1画素単位の精度の動きベクトルしか得られないので、この実施形態では、後述するように、合算SAD値の最小値位置の合算SAD値およびその近傍の複数個の合算SAD値を用いて、近似曲面補間を行うことで、グローバル動きベクトルを検出する。すなわち、合算SAD値の最小値位置の合算SAD値およびその近傍の複数個の合算SAD値を用いて、近似高次曲面を生成し、その近似高次曲面の極小値位置を検出することで、1画素単位以下の小数点精度で、グローバル動きベクトルを検出することができるようにしている。   However, since the method using the minimum total SAD value can only obtain a motion vector with an accuracy of one pixel unit, in this embodiment, as described later, the total SAD value at the minimum value position of the total SAD value and A global motion vector is detected by performing approximate curved surface interpolation using a plurality of summed SAD values in the vicinity. That is, by generating an approximate higher-order curved surface using the combined SAD value of the minimum value position of the combined SAD value and a plurality of combined SAD values in the vicinity thereof, and detecting the minimum value position of the approximate higher-order curved surface, A global motion vector can be detected with a decimal point precision of one pixel unit or less.

上述の説明においては、複数個のターゲットブロックのそれぞれについてのSADテーブルTBLiを求め、その求めた複数個のSADテーブルTBLiから、合算SADテーブルSUM_TBLを求めるように説明したが、必ずしも、それぞれのターゲットブロックについてのSADテーブルTBLiを求める必要はない。合算SADテーブルSUM_TBLが求められれば良く、各ターゲットブロックについてのSADテーブルTBLiにおける最小SAD値座標に対応する動きベクトルの算出は原理的には不要であるからである。   In the above description, the SAD table TBLi is obtained for each of the plurality of target blocks, and the total SAD table SUM_TBL is obtained from the obtained plurality of SAD tables TBLi. There is no need to obtain the SAD table TBLi for. This is because the sum SAD table SUM_TBL only needs to be obtained, and the calculation of the motion vector corresponding to the minimum SAD value coordinate in the SAD table TBLi for each target block is not necessary in principle.

例えば、ターゲットブロックと参照ブロックとの間のSAD値を求める処理を、複数個のターゲットブロックについて並行して同時に行い、それら同時に並行に行った複数のサーチ範囲において対応する参照ブロック位置、すなわち、同じ座標位置(x,y)のSAD値を合算するようにして、合算SADテーブルSUM_TBLを求めるようにすることもできる。   For example, the processing for obtaining the SAD value between the target block and the reference block is performed simultaneously in parallel for a plurality of target blocks, and the corresponding reference block positions in the plurality of search ranges performed simultaneously in parallel, that is, the same It is also possible to obtain the sum SAD table SUM_TBL by summing up the SAD values at the coordinate position (x, y).

しかしながら、この実施形態では、検出される手ぶれ動きベクトル(グローバル動きベクトル)の信頼性を高めるため、次の点を考慮して、必ず、各ターゲットブロックについてのSADテーブルTBLiを求めて、各ターゲットブロックについての動きベクトル(以下、ブロック毎動きベクトルという)BLK_Viを検出するようにしている。   However, in this embodiment, in order to increase the reliability of the detected camera shake motion vector (global motion vector), the SAD table TBLi is always obtained for each target block in consideration of the following points, and each target block Motion vector (hereinafter referred to as a block-by-block motion vector) BLK_Vi is detected.

すなわち、この実施形態では、手ぶれによる画面全体の動きベクトルではない動被写体による動きベクトル成分を、手ぶれによるグローバル動きベクトルの検出に際しては、できるだけ排除することにより、より精度の高いグローバル動きベクトルの検出ができるようにしている。   In other words, in this embodiment, a motion vector component due to a moving subject that is not a motion vector of the entire screen due to camera shake is eliminated as much as possible when detecting a global motion vector due to camera shake, thereby detecting a more accurate global motion vector. I can do it.

そのために、この実施形態では、合算SADテーブルから求めたグローバル動きベクトル(以下、合算動きベクトルという)SUM_Vと、各ターゲットブロックについてのSADテーブルTBLiから求められた動きベクトル(ブロック毎動きベクトル)BLK_Viとを比較して、両者が同一または近似しているターゲットブロックのSADテーブルTBLiのみを用いて、合算SADテーブルの再算出を行う。そして、この再算出した合算SADテーブル(再合算SADテーブル)RSUM_TBLを用いて、手ぶれベクトルとなるグローバル動きベクトルを検出するようにしている。   Therefore, in this embodiment, a global motion vector (hereinafter referred to as a combined motion vector) SUM_V obtained from the combined SAD table, and a motion vector (a motion vector for each block) BLK_Vi determined from the SAD table TBLi for each target block And the total SAD table is recalculated using only the SAD table TBLi of the target block that is the same or approximate. Then, a global motion vector serving as a shake vector is detected using the recalculated total SAD table (resumed SAD table) RSUM_TBL.

ただし、この場合において、1フレームについての複数個、この例では、16個のブロック毎動きベクトルは、当該フレームについての手ぶれベクトル(グローバル動きベクトル)を求めるために、信頼性があるものであるか否かの判定を行い、信頼性が高いと判定される場合にのみ、再合算SADテーブルRSUM_TBLの算出およびグローバル動きベクトルの算出を行うようにする。   However, in this case, whether a plurality of motion vectors for one frame, in this example, 16 block-by-block motion vectors are reliable in order to obtain a shake vector (global motion vector) for the frame. Only when it is determined that the reliability is high, the re-summation SAD table RSUM_TBL is calculated and the global motion vector is calculated.

このフレーム単位の信頼性の判定、つまり、フレーム内複数ブロック毎動きベクトルの信頼性の判定は、次のようにして行う。   The determination of the reliability of each frame, that is, the determination of the reliability of the motion vector for each of a plurality of blocks in the frame is performed as follows.

まず、元フレームに設定された複数個、この例では16個のターゲットブロックTGi(i=1,2,・・・,16)のそれぞれに対するSADテーブルTBLiを求め、その最小SAD値MINiの座標位置からブロック毎動きベクトルBLK_Vi(図3(A)参照)を求める。次に、前述した(式3)にしたがって、16個のSADテーブルTBLiから合算SADテーブルSUM_TBLを求め、その最小SAD値MINsの座標位置から合算動きベクトルSUM_V(図3(B)参照)を求める。   First, a SAD table TBLi is obtained for each of a plurality of target blocks TGi (i = 1, 2,..., 16) set in the original frame, and in this example, the coordinate position of the minimum SAD value MINi. From each block, a motion vector BLK_Vi for each block (see FIG. 3A) is obtained. Next, the total SAD table SUM_TBL is obtained from the 16 SAD tables TBLi according to (Equation 3) described above, and the total motion vector SUM_V (see FIG. 3B) is obtained from the coordinate position of the minimum SAD value MINs.

次に、この実施形態においては、合算動きベクトルSUM_V、すなわち、合算SADテーブルSUM_TBLの最小SAD値MINsの座標位置を基準に、16個のターゲットブロックのそれぞれの動きベクトルBLK_Vi(すなわち、合算SADテーブルSUM_TBLの最小SAD値MINsの座標位置)と、それぞれのSAD値とから、当該16個のターゲットブロックのそれぞれについて、図4に示すような条件の判定を行い、図4に示すようなラベル付けおよびスコアの算出を行う。   Next, in this embodiment, the motion vector BLK_Vi (that is, the summed SAD table SUM_TBL) of each of the 16 target blocks with reference to the coordinate position of the summed motion vector SUM_V, that is, the minimum SAD value MINs of the summed SAD table SUM_TBL. 4) and the respective SAD values, the conditions as shown in FIG. 4 are determined for each of the 16 target blocks, and the labeling and score as shown in FIG. Is calculated.

図5に、このラベル付けおよびスコア算出の処理の一例のフローチャートを示す。この図5の処理は、1枚の参照フレームについての処理であり、この図5の処理が1フレーム毎に繰り返されるものである。   FIG. 5 shows a flowchart of an example of the labeling and score calculation process. The process of FIG. 5 is a process for one reference frame, and the process of FIG. 5 is repeated for each frame.

まず、ラベル付けおよびスコアの算出を行う対象ターゲットブロックについて求められた動きベクトルBLK_Viと、合算動きベクトルSUM_Vとが等しいかどうかを第1の条件とする判定をする(ステップS11)。これは、対象ターゲットブロックのSADテーブルTBLiの最小SAD値MINiの座標位置と、合算SADテーブルSUM_TBLの最小SAD値MINsの座標位置が等しいか否かを条件判定することに等しい。   First, it is determined that the first condition is whether the motion vector BLK_Vi obtained for the target block for labeling and score calculation is equal to the combined motion vector SUM_V (step S11). This is equivalent to determining whether the coordinate position of the minimum SAD value MINi of the SAD table TBLi of the target block is equal to the coordinate position of the minimum SAD value MINs of the combined SAD table SUM_TBL.

対象ターゲットブロックについて、この第1の条件に合致すると判定されると、当該対象ターゲットブロックについは「TOP」というラベルが付与され、この例では最大のスコア値として「4」が割り当てられる(ステップS12)。   When it is determined that the target target block satisfies the first condition, the target target block is labeled “TOP”, and in this example, “4” is assigned as the maximum score value (step S12). ).

対象ターゲットブロックについて、第1の条件には合致しないと判定されると、第2の条件に合致するかどうかの判定をする(ステップS13)。この第2の条件は、対象ターゲットブロックについて求められた動きベクトルBLK_Viと、合算動きベクトルSUM_Vとが同一ではないが、SADテーブル上で最も隣接するものとなっているかどうかであり、具体的には、対象ターゲットブロックのSADテーブルTBLiの最小SAD値MINiの座標位置と、合算SADテーブルSUM_TBLの最小SAD値MINsの座標位置が、上下、左右、斜めの方向に1座標値だけ異なる隣接するものであるかどうかである。   When it is determined that the target target block does not meet the first condition, it is determined whether or not the second condition is met (step S13). The second condition is whether or not the motion vector BLK_Vi obtained for the target target block and the combined motion vector SUM_V are not the same, but are most adjacent on the SAD table. The coordinate position of the minimum SAD value MINi of the SAD table TBLi of the target block is adjacent to the coordinate position of the minimum SAD value MINs of the combined SAD table SUM_TBL by one coordinate value in the up, down, left, and right directions. Whether or not.

対象ターゲットブロックについて、この第2の条件に合致すると判定されると、当該対象ターゲットブロックについは「NEXT_TOP」というラベルが付与され、この例ではスコア値として「2」が割り当てられる(ステップS14)。   If it is determined that the second target condition is met for the target target block, a label “NEXT_TOP” is assigned to the target target block, and “2” is assigned as a score value in this example (step S14).

対象ターゲットブロックについて、第2の条件には合致しないと判定されると、第3の条件に合致するかどうかの判定をする(ステップS15)。この第3の条件は、対象ターゲットブロックのSADテーブルにおいて、動きベクトルBLK_Viとなる座標位置のSAD値(最小SAD値MINi)と、合算動きベクトルSUM_Vとなる合算SADテーブル上の座標位置(最小SAD値MINsの座標位置)に対応する座標位置のSAD値との差が、所定の閾値以下であるかどうかである。ここで、所定の閾値は、1画素あたりに換算したときの閾値とすることが望ましい。これは、この実施形態では、1画素精度の手ぶれ補正を想定しているためである。   When it is determined that the target target block does not meet the second condition, it is determined whether or not the third condition is met (step S15). The third condition is that, in the SAD table of the target block, the SAD value (minimum SAD value MINi) of the coordinate position serving as the motion vector BLK_Vi and the coordinate position (minimum SAD value) of the combined SAD table serving as the combined motion vector SUM_V. Whether the difference from the SAD value of the coordinate position corresponding to (MINs coordinate position) is equal to or less than a predetermined threshold value. Here, it is desirable that the predetermined threshold is a threshold when converted per pixel. This is because, in this embodiment, camera shake correction with one pixel accuracy is assumed.

対象ターゲットブロックについて、この第3の条件に合致すると判定されると、当該対象ターゲットブロックについは「NEAR_TOP」というラベルが付与され、この例ではスコア値として「1」が割り当てられる(ステップS16)。   If it is determined that the third target condition is met for the target target block, the target target block is assigned the label “NEAR_TOP”, and in this example, “1” is assigned as the score value (step S16).

対象ターゲットブロックについて、第3の条件には合致しないと判定されると、当該対象ターゲットブロックについは「OTHERS」というラベルが付与され、この例ではスコア値として「0」が割り当てられる(ステップS17)。   If it is determined that the third condition is not met for the target target block, the target target block is labeled “OTHERS”, and “0” is assigned as the score value in this example (step S17). .

ステップS12、ステップS14、ステップS16およびステップS17のラベル付けおよびスコアの割り当てが終了した後には、割り当てられたスコアを累積加算して、合計スコアsum_scoreを算出する(ステップS18)。   After the labeling and the score assignment in step S12, step S14, step S16, and step S17 are completed, the assigned scores are cumulatively added to calculate a total score sum_score (step S18).

次に、1フレーム内の16個のすべてのターゲットブロックについて上記の処理が終了したか否かを判別し(ステップS19)、終了していなければ、次のターゲットブロックのラベル付けおよびスコア算出を指示し(ステップS20)、その後、ステップS11に戻って、上述した処理を繰り返す。   Next, it is determined whether or not the above processing has been completed for all 16 target blocks in one frame (step S19). If not, instructions are given for labeling and score calculation of the next target block. Then (step S20), the process returns to step S11, and the above-described processing is repeated.

1フレーム内の16個のすべてのターゲットブロックについて上記の処理が終了したと判別したときには、この1フレーム内の16個のターゲットブロックについてラベル付けおよびスコア算出の処理ルーチンを終了する。このときにステップS18で算出されている合計スコアsum_scoreは、16個のターゲットブロックのすべてのスコアの合計となっている。   When it is determined that the above processing has been completed for all 16 target blocks in one frame, the labeling and score calculation processing routines for 16 target blocks in one frame are terminated. At this time, the total score sum_score calculated in step S18 is the sum of all the scores of the 16 target blocks.

なお、図5のフローチャートは一例であり、第1の条件、第2の条件および第3の条件の合致判定は、順序不動であり、いずれを先に行ってもよい。   Note that the flowchart of FIG. 5 is an example, and the match determination of the first condition, the second condition, and the third condition is not fixed, and any of them may be performed first.

以上のような1フレーム内の16個のターゲットブロックについてラベル付けおよびスコア算出の処理ルーチンが終了したら、算出した合計スコアsum_scoreと、信頼性についての閾値とを比較する。このとき、合計スコアsum_scoreが閾値よりも小さいときには、当該フレームで求められる動きベクトルは、グローバル動きベクトルの検出のためには信頼性が低いと判定することができる。   When the labeling and score calculation processing routines for 16 target blocks in one frame as described above are completed, the calculated total score sum_score is compared with a threshold value for reliability. At this time, when the total score sum_score is smaller than the threshold, it can be determined that the motion vector obtained in the frame is low in reliability for the detection of the global motion vector.

逆に、合計スコアsum_scoreが閾値以上であることは、当該フレームで求められた合算動きベクトルを用いるグローバル動きベクトルの検出は、一応の信頼性が得られることになる。したがって、合計スコアsum_scoreが閾値以上であると判定されたときには、スコアが高い第1の条件および第2の条件を満足するターゲットブロック(ラベル「TOP」およびラベル「NEXT_TOP」)のSADテーブルのSAD値のみを用いて再合算SADテーブルを生成して、その再合算SADテーブルに基づいてグローバル動きベクトルを算出するようにしても良い。   On the other hand, if the total score sum_score is equal to or greater than the threshold value, the detection of the global motion vector using the combined motion vector obtained in the frame can provide a certain level of reliability. Therefore, when it is determined that the total score sum_score is equal to or greater than the threshold value, the SAD value of the SAD table of the target block (label “TOP” and label “NEXT_TOP”) satisfying the first condition and the second condition having a high score It is also possible to generate a re-summation SAD table using only these and calculate a global motion vector based on the re-summation SAD table.

しかし、この実施形態では、より高い信頼性を得るために、さらに次のような処理を施すようにする。   However, in this embodiment, in order to obtain higher reliability, the following processing is further performed.

この実施形態で用いる合算SADテーブルは、ブロック毎のSADテーブルではなく、フレーム全体をまとめてブロックマッチングした結果とほぼ等価である。通常の被写体においては、従来技術で説明した多数決により勝ち残った動きベクトル、つまり多数決トップの動きベクトルと、合算SADテーブルから求められる合算動きベクトルは、等しいものとなる。しかし、フレーム全体が明滅する場合や水面の波面等の苦手被写体の場合、多数決の結果は、信頼性が低く、ランダムに近い動きベクトルとなるのに対し、合算動きベクトルは、比較的正解に近い結果を導き出す可能性が高い。   The total SAD table used in this embodiment is not the SAD table for each block, but is almost equivalent to the result of block matching for the entire frame. In a normal subject, the motion vector that has been won by the majority vote described in the prior art, that is, the motion vector at the top of the majority vote, and the sum motion vector obtained from the sum SAD table are equal. However, if the entire frame blinks or is a poor subject such as a wavefront of the water surface, the result of the majority decision is low in reliability and the motion vector is almost random, whereas the combined motion vector is relatively close to the correct answer There is a high probability of deriving results.

したがって、合算SADテーブルから求めた合算動きベクトルと、多数決により決定したグローバル動きベクトルという、両者の結果を比較することにより、少なくとも、現在のフレームの結果の信頼性を、定量的に判定することが可能となる。従来提案では、各ブロックの動きベクトルの信頼性を判定することに主眼が置かれていたが、この実施形態では、フレーム全体の信頼性を重視し、疑わしきは補正しない、という方針のもと、違和感の少ない、安定した手ぶれ補正システムを実現する点が特徴である。   Therefore, it is possible to quantitatively determine at least the reliability of the result of the current frame by comparing the result of both the sum motion vector obtained from the sum SAD table and the global motion vector determined by majority vote. It becomes possible. In the conventional proposal, the main focus was on determining the reliability of the motion vector of each block, but in this embodiment, based on the policy that the reliability of the entire frame is emphasized and suspicion is not corrected, It is characterized by realizing a stable image stabilization system with little discomfort.

この点を考慮して、この実施形態では、従来のブロックマッチングの場合と同様に、16個のターゲットブロックについて検出されたブロック毎動きブロックBLK_Viについて多数決を取り、多数決トップ(大きさおよび方向が同一または同等であるブロック毎動きベクトルの数が最大)の動きベクトルを検出する。   In consideration of this point, in this embodiment, as in the case of the conventional block matching, a majority vote is taken for each block motion block BLK_Vi detected for 16 target blocks, and the majority vote top (the same size and direction) is taken. Alternatively, the motion vectors having the maximum number of motion vectors per block that are equivalent) are detected.

そして、この検出した多数決トップの動きベクトルを基準として、図4における合算動きベクトルに基準とした場合と同様に、16個のターゲットブロックについて検出されたブロック毎動きブロックBLK_Viと、それぞれのSAD値とから、図4に示したようなラベル付けおよびスコア割り当てを行う。   Then, using the detected majority motion vector as a reference, the block-specific motion block BLK_Vi detected for the 16 target blocks, and the respective SAD values, as in the case of using the combined motion vector in FIG. Then, labeling and score assignment as shown in FIG. 4 are performed.

これは、図4において、合算動きベクトルSUM_Vに代えて、多数決トップの動きベクトルが用いられることに等しい。   This is equivalent to using the majority motion vector instead of the combined motion vector SUM_V in FIG.

すなわち、第1の条件は、ラベル付けおよびスコアの算出を行う対象ターゲットブロックについて求められた動きベクトルBLK_Viと、多数決トップの動きベクトルとが等しいかどうかである。つまり、対象ターゲットブロックのSADテーブルTBLiの最小SAD値MINiの座標位置と、多数決トップの動きベクトルとなる座標位置とが等しいか否かを条件判定するものである。   That is, the first condition is whether or not the motion vector BLK_Vi obtained for the target block for which labeling and score calculation are performed is equal to the motion vector of the majority vote top. That is, it is determined whether or not the coordinate position of the minimum SAD value MINi in the SAD table TBLi of the target block is equal to the coordinate position that becomes the motion vector of the majority vote top.

また、第2の条件は、対象ターゲットブロックについて求められた動きベクトルBLK_Viと、多数決トップの動きベクトルとが同一ではないが、SADテーブル上で最も隣接するものとなっているかどうかであり、具体的には、対象ターゲットブロックのSADテーブルTBLiの最小SAD値MINiの座標位置と、多数決トップの動きベクトルに対応する座標位置とが、上下、左右、斜めの方向に1座標値だけ異なる隣接するものであるかどうかである。   The second condition is whether the motion vector BLK_Vi obtained for the target target block and the motion vector of the majority vote top are not the same, but are the most adjacent on the SAD table. The coordinate position of the minimum SAD value MINi in the SAD table TBLi of the target target block is adjacent to the coordinate position corresponding to the motion vector of the majority vote, which differs by one coordinate value in the vertical, horizontal, and diagonal directions. Whether there is.

また、第3の条件は、対象ターゲットブロックのSADテーブルにおいて、動きベクトルBLK_Viとなる座標位置のSAD値(最小SAD値MINi)と、多数決トップの動きベクトルに対応するSADテーブル上の座標位置のSAD値との差が、所定の閾値以下であるかどうかである。   The third condition is that, in the SAD table of the target block, the SAD value (minimum SAD value MINi) of the coordinate position that becomes the motion vector BLK_Vi and the SAD of the coordinate position on the SAD table corresponding to the majority motion vector Whether the difference from the value is equal to or less than a predetermined threshold value.

以上のようにして、1フレームについての16個のターゲットブロックについての動きベクトルについて、その多数決トップの動きベクトルを基準にしたラベル付けおよびスコア割り当てを行う。そして、割り当てられたスコアの合計スコアmany_scoreを算出する。   As described above, labeling and score assignment are performed on the motion vectors for 16 target blocks for one frame based on the motion vector at the top of the majority vote. Then, a total score many_score of the assigned scores is calculated.

そして、この実施形態では、合算動きベクトルSUM_Vに対応する最小SAD値の座標位置と、多数決トップの動きベクトルに対応するSAD値の座標位置との差が所定以内、例えば前記差が1隣接画素以内であって、前記合計スコアsum_scoreが所定の閾値以上、かつ、前記合計スコアmany_scoreが所定の閾値以上、であるときに、当該フレームについて求められる動きベクトルは信頼性が高いと判定する。   In this embodiment, the difference between the coordinate position of the minimum SAD value corresponding to the combined motion vector SUM_V and the coordinate position of the SAD value corresponding to the majority motion vector is within a predetermined range, for example, the difference is within one adjacent pixel. When the total score sum_score is equal to or greater than a predetermined threshold and the total score many_score is equal to or greater than a predetermined threshold, it is determined that the motion vector obtained for the frame is highly reliable.

そして、このように信頼性が高いと判定されたときにのみ、この例では、合算動きベクトルを基準にしてラベル付けされたターゲットブロックのラベルのうち、「TOP」および「NEXT_Top」が付与されたターゲットブロックについてのSADテーブルのSAD値のみを用いて、再合算SADテーブルRSUM_TBLを生成する。   Then, only when it is determined that the reliability is high in this way, in this example, “TOP” and “NEXT_Top” are given among the labels of the target blocks labeled based on the combined motion vector. The re-summation SAD table RSUM_TBL is generated using only the SAD value of the SAD table for the target block.

そして、この再合算SADテーブルRSUM_TBLの最小SAD値およびその近傍座標位置のSAD値について、近似曲面補間を適用してグローバル動きベクトルを算出するものである。   Then, a global motion vector is calculated by applying approximate curved surface interpolation to the minimum SAD value of the re-summation SAD table RSUM_TBL and the SAD value of the neighboring coordinate position.

なお、従来から提案されている、時間軸方向の動きベクトルの周波数から、動きベクトル(グローバル動きベクトル)を予測する手法と、上述したこの発明の実施形態の手法とを組み合わせることにより、更なる信頼性並びに精度の向上を図るようにしても良い。   It should be noted that further reliability can be obtained by combining the conventionally proposed method of predicting a motion vector (global motion vector) from the frequency of the motion vector in the time axis direction and the method of the embodiment of the present invention described above. It is also possible to improve the performance and accuracy.

上述したように、この実施形態では、1フレーム内の複数個のターゲットブロックのそれぞれについて、SADテーブルを生成し、ブロック毎動きベクトルを検出するようにする。この場合に、この実施形態では、現在の500万画素オーバーの撮像素子を用いる撮像装置に適用しようとすると、1画面分の画素数に比例してSADテーブルの規模が増加するため、現実的な回路規模で実現するのが困難であるという問題がある。   As described above, in this embodiment, an SAD table is generated for each of a plurality of target blocks in one frame, and a motion vector for each block is detected. In this case, in this embodiment, since the scale of the SAD table increases in proportion to the number of pixels for one screen when it is applied to an imaging apparatus that uses the current imaging device with over 5 million pixels, it is realistic. There is a problem that it is difficult to realize on a circuit scale.

実現できるレベルの現実的な提案としては、前述した特許文献3(特開2005−38396公報)を挙げることができる。この特許文献3に示されたものは、画像を縮小変換したサイズで動ベクトルを求める手段と、同一のSADテーブルを複数のブロックで共有する手段から構成される。画像の縮小変換と、SADテーブルの複数ブロックでの共有化は、SADテーブルサイズの削減を実現するための、非常に良い手法であり、MPEG(Moving Picture Experts Group)画像圧縮方式における動きベクトル検出やシーンチェンジ検出等、他分野でも使われている。   As a realistic proposal of a level that can be realized, the above-mentioned Patent Document 3 (Japanese Patent Laid-Open No. 2005-38396) can be cited. The device disclosed in Patent Document 3 includes means for obtaining a motion vector with a reduced size of an image and means for sharing the same SAD table among a plurality of blocks. Image reduction conversion and sharing of the SAD table among a plurality of blocks is a very good technique for reducing the size of the SAD table. Motion vector detection in the MPEG (Moving Picture Experts Group) image compression method, It is also used in other fields such as scene change detection.

しかし、この特許文献3のアルゴリズムの問題点として、画像の縮小変換と、その際のメモリ(DRAM(Dynamic RAM(Random Access Memory)))アクセスに、時間とメモリ容量を消費することと、SADテーブルを複数ブロックで時分割アクセスする手法のため、メモリアクセスが非常に増加し、この処理にも時間を要してしまうという課題がある。動画の手ぶれ補正においては、リアルタイム性と同時にシステム遅延時間の短縮が求められるため、この処理時間の問題が課題となってしまうのである。   However, as problems of the algorithm of Patent Document 3, time and memory capacity are consumed for image reduction conversion and memory (DRAM (Random Access Memory)) access at that time, and the SAD table. As a result of the method of performing time-division access on a plurality of blocks, memory access increases greatly, and this processing also takes time. In motion blur correction of moving images, a reduction in system delay time is required simultaneously with real-time performance, and this problem of processing time becomes a problem.

多人数評価の結果、例えば3フレーム/秒(3fps)の静止画の場合における手ぶれ範囲は、全フレームを100%として±10%程度であることが判明している。既に高級機では世に出ている1200万画素を仮定し、現状で提案されている技術のまま、必要なSADテーブルサイズを見積もると、約80メガビットである。しかも、現実的な処理速度を満たそうとすると、このSADテーブル情報を格納するメモリは、内蔵SRAM(Static RAM(Random Access Memory))であることが求められる。半導体プロセスルールが進んだとは言え、このサイズは、ほぼ3桁程度、現実的なレベルからはかけ離れている。   As a result of multi-person evaluation, it has been found that, for example, the camera shake range in the case of a still image of 3 frames / second (3 fps) is about ± 10% when all frames are 100%. Assuming the 12 million pixels that are already in the market for high-end machines, the required SAD table size is estimated to be about 80 megabits with the currently proposed technology. Moreover, in order to satisfy a practical processing speed, the memory for storing the SAD table information is required to be a built-in SRAM (Static RAM (Random Access Memory)). Even though the semiconductor process rules have advanced, this size is about three orders of magnitude far from a realistic level.

また、元画像を縮小変換する際には、エイリアシング(折り返し歪み)や、低照度ノイズ除去のためのローパスフィルタを、縮小処理の前処理として実装するが必要である。しかし、縮小倍率に応じて、ローパスフィルタの特性が変化する上、特に、垂直方向のローパスフィルタの場合、多タップのデジタルフィルタとした場合に、多くのラインメモリと演算ロジックを必要としなければならず、回路規模増加の問題が生じる。   Further, when the original image is reduced and converted, it is necessary to implement aliasing (folding distortion) and a low-pass filter for removing low illuminance noise as pre-processing of the reduction process. However, the characteristics of the low-pass filter change according to the reduction ratio. In particular, in the case of a low-pass filter in the vertical direction, a multi-tap digital filter requires a lot of line memory and arithmetic logic. Therefore, the problem of circuit scale increase arises.

そこで、この実施形態では、以上の点にかんがみ、ブロックマッチングを用いて2フレーム間のグローバル動きベクトルを検出する場合において、SADテーブルサイズの大幅な削減が可能である画像処理方法および装置を用いる。   In view of the above, this embodiment uses an image processing method and apparatus that can greatly reduce the SAD table size when detecting a global motion vector between two frames using block matching.

また、特許文献3に記載された画像の縮小変換によるSADテーブルの削減手法に関して、画像の縮小変換に伴う処理時間の増大並びにメモリ容量の消費と、画像の縮小変換に伴うエイリアシング回避のための適切なローパスフィルタの実装に伴う回路増大という、2つの問題を提起した。この実施形態では、これらの問題点をも解決することができるようにしている。   In addition, regarding the SAD table reduction method by the image reduction conversion described in Patent Document 3, an increase in processing time associated with the image reduction conversion, consumption of memory capacity, and appropriate prevention of aliasing associated with the image reduction conversion Two problems were raised, the increase in circuit accompanying the implementation of a simple low-pass filter. In this embodiment, these problems can be solved.

すなわち、この実施形態では、ターゲットブロックと参照ブロック間において求められるSAD値を、参照ブロックの参照ベクトルに対応して記憶するのではなく、当該参照ベクトルを縮小し、その縮小した参照縮小ベクトルに対応する、当該参照縮小ベクトルの近傍の複数の参照ベクトルに分散加算して記憶するようにする。   That is, in this embodiment, the SAD value obtained between the target block and the reference block is not stored in correspondence with the reference vector of the reference block, but the reference vector is reduced and the reduced reference reduced vector is supported. In addition, a plurality of reference vectors in the vicinity of the reference reduced vector are distributed and added and stored.

これにより、従来のSADテーブルに比較して、SADテーブルのサイズを大幅に縮小すると共に、画像の縮小変換に伴う処理時間の増大並びにメモリ容量の消費と、画像の縮小変換に伴うエイリアシング回避のための適切なローパスフィルタの実装に伴う回路増大という、2つの問題を解決するようにしている、
図6〜図8は、この実施形態で用いる新規なブロックマッチング方法の概要を説明するための図である。図6は、従来のSADテーブルTBLoと、実施形態の画像処理方法において生成される縮小SADテーブルTBLsとの関係を示すものである。
As a result, the size of the SAD table is greatly reduced as compared with the conventional SAD table, the processing time associated with the image reduction conversion is increased, the memory capacity is consumed, and the aliasing associated with the image reduction conversion is avoided. In order to solve the two problems of circuit increase accompanying the implementation of the appropriate low-pass filter,
6 to 8 are diagrams for explaining an outline of a novel block matching method used in this embodiment. FIG. 6 shows the relationship between the conventional SAD table TBLo and the reduced SAD table TBLs generated by the image processing method of the embodiment.

この実施形態においても、図54に示したように、従来と同様に参照フレームにおいて、元フレームに設定された複数個、この例では16個のターゲットブロックの位置のそれぞれを中心として複数個のサーチ範囲が設定される。そして、この複数個のサーチ範囲のそれぞれにおいて、前述したような複数の参照ブロックが設定され、各参照ブロック内の画素とターゲットブロック内の対応する画素の輝度値の差分の絶対値の総和、つまり、SAD値が求められる。   Also in this embodiment, as shown in FIG. 54, in the reference frame as in the prior art, a plurality of searches centered on each of the positions of a plurality of original frames, in this example 16 target blocks, in the reference frame. A range is set. Then, in each of the plurality of search ranges, a plurality of reference blocks as described above are set, and the sum of absolute values of differences in luminance values of pixels in each reference block and corresponding pixels in the target block, that is, , The SAD value is determined.

従来は、求められたSAD値は、図6に示すように、対象となっている参照ブロックの参照ベクトルRVに対応するアドレスのテーブル要素tblとしてSADテーブルTBLoに書き込まれる。   Conventionally, as shown in FIG. 6, the obtained SAD value is written in the SAD table TBLo as a table element tbl having an address corresponding to the reference vector RV of the target reference block.

したがって、従来のブロックマッチングでは、ターゲットブロックと参照ブロックとのフレーム画像上における位置ずれ量を表わす参照ベクトルRVと、SADテーブルTBLoの各テーブル要素である参照ブロックのSAD値とは、1対1に対応している。すなわち、従来のSADテーブルTBLoでは、サーチ範囲で取り得る参照ベクトルRVと等しい数のSAD値のテーブル要素数を備えるものとなっている。   Therefore, in the conventional block matching, the reference vector RV representing the amount of positional deviation between the target block and the reference block on the frame image and the SAD value of the reference block which is each table element of the SAD table TBLo are in a one-to-one relationship. It corresponds. That is, the conventional SAD table TBLo has the same number of table elements of SAD values as the reference vector RV that can be taken in the search range.

これに対して、この実施形態におけるブロックマッチングでは、図6および図7(A)、(B)に示すように、対象となっている参照ブロックの参照ベクトルRVは、縮小率1/n(nは自然数)で縮小されて参照縮小ベクトルCVとされる。   On the other hand, in the block matching in this embodiment, as shown in FIG. 6 and FIGS. 7A and 7B, the reference vector RV of the target reference block has a reduction ratio of 1 / n (n Is reduced to a reference reduced vector CV.

ここで、以下の説明においては、説明の便宜上、水平方向縮小倍率と垂直方向の縮小倍率とを同じとしているが、水平方向縮小倍率と垂直方向の縮小倍率とは独立の異なる値でも良い。また、後で述べるが、水平方向縮小倍率と垂直方向の縮小倍率とを独立に任意の自然数分の1として設定できるようにしておく方が、柔軟性も高く好都合である。   Here, in the following description, the horizontal reduction magnification and the vertical reduction magnification are the same for convenience of explanation, but the horizontal reduction magnification and the vertical reduction magnification may be different values. As will be described later, it is more flexible and convenient that the horizontal reduction ratio and the vertical reduction ratio can be set independently as an arbitrary natural fraction.

この実施形態においても、前述の従来例で説明したのと同様に、サーチ範囲の中心とされるターゲットブロックの位置を基準位置(0,0)とし、参照ベクトルは、当該基準位置からの画素単位の水平方向および垂直方向のずれ量(vx,vy)(vx、vyは、整数)を指し示すものとされ、参照ベクトルRVのそれぞれは、参照ベクトル(vx,vy)で表される。   Also in this embodiment, as described in the above-described conventional example, the position of the target block that is the center of the search range is set as the reference position (0, 0), and the reference vector is a pixel unit from the reference position. Of the horizontal direction and the vertical direction (vx, vy) (vx, vy are integers), and each of the reference vectors RV is represented by a reference vector (vx, vy).

参照ベクトル(vx,vy)が、水平方向および垂直方向のそれぞれについて1/nに縮小された参照縮小ベクトル(vx/n,vy/n)で示される位置(vx/n,vy/n)は、整数ではなく、小数成分が発生することがある。このため、この実施形態では、縮小前の元の参照ベクトルRVに対応して求められたSAD値を、参照縮小ベクトルCVに最も近い1つの参照ベクトルに対応するテーブル要素として記憶してしまうと誤差が生じることになる。   The position (vx / n, vy / n) indicated by the reference reduced vector (vx / n, vy / n) obtained by reducing the reference vector (vx, vy) to 1 / n in each of the horizontal direction and the vertical direction is In some cases, a fractional component is generated instead of an integer. Therefore, in this embodiment, if the SAD value obtained corresponding to the original reference vector RV before reduction is stored as a table element corresponding to one reference vector closest to the reference reduction vector CV, an error occurs. Will occur.

そこで、この実施形態では、まず、参照縮小ベクトルCVで示される位置(vx/n,vy/n)の近傍の複数の参照ベクトルで示される複数の位置(テーブル要素)を検出する。そして、参照ベクトルRVの参照ブロックについて求められたSAD値は、その検出した近傍の複数の参照ベクトルに対応するSAD値に分散して加算するようにする。   Therefore, in this embodiment, first, a plurality of positions (table elements) indicated by a plurality of reference vectors in the vicinity of the position (vx / n, vy / n) indicated by the reference reduced vector CV are detected. Then, the SAD values obtained for the reference block of the reference vector RV are distributed and added to SAD values corresponding to the detected plurality of nearby reference vectors.

この場合に、この実施形態では、参照縮小ベクトルCVで示される位置の近傍の周囲の複数個の参照ベクトルで示される位置に対応するテーブル要素tblに書き込むべき成分として分散加算する値は、縮小前の元の参照ベクトルRVに対応して求められたSAD値から、参照縮小ベクトルとその近傍の参照ベクトルとのそれぞれが示す位置の関係を用いて、前記近傍の参照ベクトルのそれぞれに対応して分散加算するSAD値を算出し、算出したSAD値のそれぞれを、対応する参照ベクトルのテーブル要素成分として加算するようにする。   In this case, in this embodiment, the value to be distributed and added as a component to be written to the table element tbl corresponding to the position indicated by the plurality of reference vectors around the position indicated by the reference reduced vector CV is the value before reduction. From the SAD value obtained corresponding to the original reference vector RV of the reference, using the positional relationship indicated by each of the reference reduced vector and the reference vector in the vicinity thereof, variance corresponding to each of the reference vectors in the vicinity The SAD value to be added is calculated, and each of the calculated SAD values is added as a table element component of the corresponding reference vector.

ここで、分散するだけでなく加算するというのは、参照縮小ベクトルの近傍の複数の参照ベクトルは、異なる複数の参照縮小ベクトルについて重複して検出されることになるので、1つの参照ベクトルについて、重複したSAD値は加算するという意味である。   Here, not only dispersion but addition is performed because a plurality of reference vectors in the vicinity of the reference reduced vector are detected redundantly with respect to a plurality of different reference reduced vectors. It means that duplicate SAD values are added.

なお、参照縮小ベクトルCVが示す位置(vx/n,vy/n)が、参照ベクトルが示す位置に一致する場合、つまり、vx/nおよびvy/nの値が整数であるときには、周辺の複数の参照ベクトルを検出する必要はなく、当該位置(vx/n,vy/n)を示す参照ベクトルに対応して、縮小前の元の参照ベクトルRVに対応して求められたSAD値を記憶するようにするものである。   When the position (vx / n, vy / n) indicated by the reference reduced vector CV matches the position indicated by the reference vector, that is, when the values of vx / n and vy / n are integers, It is not necessary to detect the reference vector, and the SAD value obtained corresponding to the original reference vector RV before reduction is stored corresponding to the reference vector indicating the position (vx / n, vy / n). It is what you want to do.

次に、具体例を挙げて、以上の処理を説明する。例えば、ターゲットブロックの位置を基準(0,0)としたときに、図7(A)に示すように、(−3,−5)の位置を示す参照ブロックRVを、水平方向および垂直方向に、1/n=1/4倍に縮小すると、その参照縮小ベクトルCVで示される位置は、図7(B)に示すように、(−0.75,−1.25)となる。   Next, the above process will be described with a specific example. For example, when the position of the target block is set as the reference (0, 0), as shown in FIG. 7A, the reference block RV indicating the position (−3, −5) is set in the horizontal direction and the vertical direction. , 1 / n = 1/4 times, the position indicated by the reference reduced vector CV is (−0.75, −1.25) as shown in FIG.

したがって、参照縮小ベクトルCVで示される位置は小数成分が発生し、参照ベクトルで示される位置とは一致しない。   Accordingly, a decimal component is generated at the position indicated by the reference reduced vector CV and does not coincide with the position indicated by the reference vector.

そこで、この場合には、図8に示すように、当該参照縮小ベクトルCVが示す位置の近傍位置を示す複数個の近傍参照ベクトルが検出される。図8の例では、1つの参照縮小ベクトルCVに対して、4個の近傍参照ベクトルNV1,NV2,NV3,NV4が検出される。   Therefore, in this case, as shown in FIG. 8, a plurality of neighboring reference vectors indicating positions near the position indicated by the reference reduced vector CV are detected. In the example of FIG. 8, four neighboring reference vectors NV1, NV2, NV3, and NV4 are detected for one reference reduced vector CV.

そして、前述したように、この実施形態では、参照ベクトルRVの参照ブロックについて求められたSAD値は、これら4個の近傍参照ベクトルNV1,NV2,NV3,NV4に対応するSAD値として分散加算される。   As described above, in this embodiment, the SAD values obtained for the reference block of the reference vector RV are distributed and added as SAD values corresponding to these four neighboring reference vectors NV1, NV2, NV3, NV4. .

この場合に、この実施形態では、4個の近傍参照ベクトルNV1,NV2,NV3,NV4のそれぞれに分散加算するSAD値は、参照縮小ベクトルCVで示される位置P0(図8において×印として示す)と、4個の近傍参照ベクトルNV1,NV2,NV3,NV4のそれぞれで示される位置P1,P2,P3,P4(図8において○印として示す)との位置関係を用いて線形加重分散値として算出する。   In this case, in this embodiment, the SAD value to be distributed and added to each of the four neighboring reference vectors NV1, NV2, NV3, and NV4 is the position P0 indicated by the reference reduced vector CV (shown as x in FIG. 8). Is calculated as a linearly weighted variance using the positional relationship between the positions P1, P2, P3, and P4 (shown as circles in FIG. 8) indicated by four neighboring reference vectors NV1, NV2, NV3, and NV4. To do.

図8の例の場合には、参照縮小ベクトルCVで示される位置P0は、周辺近傍の4個の参照ベクトルNV1,NV2,NV3,NV4のそれぞれで示される位置P1,P2,P3,P4を、水平方向に1:3、垂直方向に3:1に内分する位置にある。   In the case of the example in FIG. 8, the position P0 indicated by the reference reduced vector CV is the positions P1, P2, P3, and P4 indicated by the four reference vectors NV1, NV2, NV3, and NV4 in the vicinity. It is a position that internally divides 1: 3 in the horizontal direction and 3: 1 in the vertical direction.

そこで、縮小前の元の参照ベクトルRVに対応して求められたSAD値をSαとしたとき、周辺近傍の4個の参照ベクトルNV1,NV2,NV3,NV4のそれぞれで示される位置P1,P2,P3,P4に対応するSADテーブル要素に分散加算する値SADp1,SADp2,SADp3,SADp4のそれぞれは、
SADp1=Sα×9/16
SADp2=Sα×3/16
SADp3=Sα×3/16
SADp4=Sα×1/16
となる。
Therefore, when the SAD value obtained corresponding to the original reference vector RV before reduction is Sα, positions P1, P2, indicated by four reference vectors NV1, NV2, NV3, NV4 in the vicinity of the periphery, respectively. Each of the values SADp1, SADp2, SADp3, SADp4 to be distributed and added to the SAD table elements corresponding to P3, P4 is
SADp1 = Sα × 9/16
SADp2 = Sα × 3/16
SADp3 = Sα × 3/16
SADp4 = Sα × 1/16
It becomes.

そして、この実施形態では、求められた値SADp1,SADp2,SADp3,SADp4のそれぞれを、近傍の4個の参照ベクトルNV1,NV2,NV3,NV4のそれぞれで示される位置P1,P2,P3,P4に対応するSADテーブル要素にそれぞれ加算する。   In this embodiment, the obtained values SADp1, SADp2, SADp3, and SADp4 are respectively transferred to positions P1, P2, P3, and P4 indicated by four neighboring reference vectors NV1, NV2, NV3, and NV4. Each is added to the corresponding SAD table element.

この実施形態では、以上の処理を、サーチ範囲内のすべての参照ブロックについて行なう。   In this embodiment, the above processing is performed for all reference blocks in the search range.

以上のことから、この実施形態では、参照ベクトルRVを1/nに縮小する場合には、全ての参照ベクトルに1対1に対応する従来サイズのSADテーブルTBLoに対して、水平方向に1/n、また、垂直方向に1/nに縮小した縮小SADテーブルTBLsを用意して、この縮小SADテーブルTBLsのテーブル要素として、参照縮小ベクトルCVの近傍の参照ベクトルに対応するSAD値を求めるようにすれば良い(図6参照)。   From the above, in this embodiment, when the reference vector RV is reduced to 1 / n, the SAD table TBLo of the conventional size corresponding to all the reference vectors on a one-to-one basis is 1 / in the horizontal direction. n, a reduced SAD table TBLs reduced to 1 / n in the vertical direction is prepared, and a SAD value corresponding to a reference vector in the vicinity of the reference reduced vector CV is obtained as a table element of the reduced SAD table TBLs. (See FIG. 6).

したがって、この実施形態の場合には、縮小SADテーブルTBLsのテーブル要素の数は、従来のSADテーブルTBLoのテーブル要素数の1/nとなり、テーブルサイズを大幅に小さくすることが可能である。 Therefore, in the case of this embodiment, the number of table elements of the reduced SAD table TBLs is 1 / n 2 of the number of table elements of the conventional SAD table TBLo, and the table size can be significantly reduced.

なお、上述の実施形態の説明においては、参照縮小ベクトルCVの近傍の4個の参照ベクトルを検出し、当該4個の近傍参照ベクトルに対応するSADテーブル要素に対して、対照の参照ブロック(参照ベクトルRV)について算出したSAD値を線形加重分散加算するようにしたが、参照縮小ベクトルCVの近傍の複数の参照ベクトルの選び方およびその近傍参照ベクトルに対応するSADテーブル要素に対する分散加算の方法は、上述の例に限られるものではない。   In the description of the above-described embodiment, four reference vectors in the vicinity of the reference reduced vector CV are detected, and the reference reference block (reference) is detected for the SAD table element corresponding to the four neighboring reference vectors. The SAD value calculated for the vector RV) is linearly weighted distributed and added. The method of selecting a plurality of reference vectors near the reference reduced vector CV and the method of distributed addition for the SAD table elements corresponding to the neighboring reference vectors are as follows: It is not limited to the above example.

例えば、参照縮小ベクトルCVの近傍の9個もしくは16個の参照ベクトルを検出し、当該9個もしくは16個の近傍参照ベクトルに対応するSADテーブル要素に対して、いわゆるキュービック(Cubic)補間による分散加算を行なうようにすれば、より精度は高くなる。しかし、リアルタイム性と演算回路の削減を重視すると、上述した近傍4個の参照ベクトルに対応するテーブル要素への線形加重分散加算が、より有効である。   For example, nine or sixteen reference vectors in the vicinity of the reference reduced vector CV are detected, and dispersion addition by so-called cubic interpolation is performed on the SAD table elements corresponding to the nine or sixteen neighboring reference vectors. If the operation is performed, the accuracy becomes higher. However, when emphasizing the real-time property and the reduction of arithmetic circuits, the above-described linear weighted dispersion addition to the table elements corresponding to the four reference vectors in the vicinity is more effective.

この実施形態においても、参照ブロックをサーチ範囲内で遍く移動させ、全ての参照ブロックのSAD値に対してSADテーブル(この実施形態では縮小SADテーブル)への代入を行う点は、従来手法と同じである。   Also in this embodiment, the reference block is moved uniformly within the search range, and the SAD values of all the reference blocks are substituted into the SAD table (in this embodiment, the reduced SAD table), which is the same as the conventional method. It is.

ただし、従来は、参照ベクトルとSADテーブル要素のアドレスが1対1に対応していたため、SADテーブルへは単なる代入で済んだが、この実施形態による手法では、参照ブロックについて算出したSAD値を分散加算させるため、縮小SADテーブルにおいて、参照ベクトル(縮小参照ベクトル)とテーブルアドレスは1対1ではない。したがって、この実施形態の手法の場合には、SAD値のテーブルアドレスへの単なる代入ではなく、加算して代入する、いわゆる代入加算である必要がある。また、そのため、SADテーブル(縮小SADテーブル)の各テーブル要素は、最初に初期化(0クリア)しておかなければならない。   However, conventionally, since the addresses of the reference vector and the SAD table element correspond to each other on a one-to-one basis, the assignment to the SAD table is simple. However, in the method according to this embodiment, the SAD value calculated for the reference block is distributed and added. Therefore, in the reduced SAD table, the reference vector (reduced reference vector) and the table address are not one to one. Therefore, in the case of the method of this embodiment, it is necessary not to simply assign the SAD value to the table address, but to perform so-called substitution addition in which addition is performed. For this reason, each table element of the SAD table (reduced SAD table) must first be initialized (cleared to 0).

ところで、従来のブロックマッチングでは、以上のようにして完成させたSADテーブルにおいて、SAD値が最小値となるテーブル要素を探索し、その最小値となるテーブル要素のテーブルアドレスを、参照ベクトルに変換すれば、動ベクトルの検出を完了した。   By the way, in the conventional block matching, in the SAD table completed as described above, the table element having the minimum SAD value is searched, and the table address of the table element having the minimum value is converted into a reference vector. In this case, the motion vector detection is completed.

これに対して、この実施形態による手法では、SADテーブルは、参照ベクトルを縮小した縮小参照ベクトルに対応した縮小SADテーブルであるため、当該縮小SADテーブルの最小値がそのまま正確な動きベクトルには対応していない。   On the other hand, in the method according to this embodiment, since the SAD table is a reduced SAD table corresponding to a reduced reference vector obtained by reducing the reference vector, the minimum value of the reduced SAD table directly corresponds to an accurate motion vector. Not done.

もっとも、ある程度の誤差を許す装置の場合には、縮小SADテーブルの最小値となるテーブル要素のテーブルアドレスを、参照ベクトルに変換したものを、さらに縮小率1/nの逆数倍、つまりn倍することで、動きベクトルを検出するようにすることもできる。   However, in the case of an apparatus that allows a certain amount of error, the table element address that is the minimum value of the reduced SAD table is converted to a reference vector, and the reciprocal multiple of the reduction ratio 1 / n, that is, n times. By doing so, it is possible to detect a motion vector.

しかし、より正確な動きベクトルを検出するようにする場合には、以下に説明するように、縮小SADテーブルのテーブル要素値に対して補間処理を施すことで、元のベクトル精度で、正確な動きベクトル(ブロック毎動きベクトル)を検出するようにする。   However, in order to detect a more accurate motion vector, as described below, an interpolation process is performed on the table element values of the reduced SAD table, so that an accurate motion can be achieved with the original vector accuracy. A vector (motion vector for each block) is detected.

なお、上述の説明において、縮小参照ベクトルを用いない従来の参照ベクトルを用いるブロックマッチング手法を用いて複数個のターゲットブロックについてのSADテーブルを求め、そして、求めた複数個のSADテーブルの対応する座標位置のSAD値を合算することで合算SADテーブルを求め、その合算SADテーブルについて、近似曲線補間を行うことによりグローバル動きベクトルを検出することを記述したが、以下に説明する補間処理は、この場合の近似曲線補間として用いることができるものでもある。   In the above description, SAD tables for a plurality of target blocks are obtained using a block matching method using a conventional reference vector that does not use a reduced reference vector, and the corresponding coordinates of the obtained plurality of SAD tables are obtained. The sum SAD value is added to obtain the sum SAD table, and the sum SAD table is described to detect the global motion vector by performing approximate curve interpolation. In this case, the interpolation processing described below is performed in this case. It can also be used as an approximate curve interpolation.

[より正確な動きベクトルを検出するための補間処理の第1の例]
より正確な動きベクトルを検出するための補間処理の第1の例は、縮小SADテーブルにおける複数個のSADテーブル要素値(SAD値)を、1つの2次曲面で近似する手法である。
[First example of interpolation processing for detecting a more accurate motion vector]
A first example of interpolation processing for detecting a more accurate motion vector is a method of approximating a plurality of SAD table element values (SAD values) in a reduced SAD table with one quadric surface.

すなわち、縮小SADテーブルにおいて、SAD値が最小値となるテーブル要素(整数精度最小値テーブル要素(整数精度テーブルアドレス))と、この整数精度最小値テーブル要素を中心とする複数の整数精度テーブル要素とを求め、それらのテーブル要素のSAD値を用いて、最小自乗法によりSAD値の2次曲面を決定し、この2次曲面の最小値となるSAD値を検出し、当該検出した最小値となるSAD値に対応する位置(参照フレーム上において、基準位置に対してずれた位置)を検出し、当該検出した位置を小数精度の最小値テーブルアドレス(縮小SADテーブルにおいてSAD値が最小値となるベクトル(最小値ベクトルという)に対応)とする。   That is, in the reduced SAD table, a table element having a minimum SAD value (integer precision minimum value table element (integer precision table address)), and a plurality of integer precision table elements centered on the integer precision minimum value table element, And using the SAD values of these table elements, the quadratic surface of the SAD value is determined by the least square method, the SAD value that is the minimum value of this quadric surface is detected, and the detected minimum value is obtained. A position corresponding to the SAD value (a position shifted from the reference position on the reference frame) is detected, and the detected position is a decimal precision minimum value table address (a vector in which the SAD value becomes the minimum value in the reduced SAD table). (Corresponding to the minimum value vector)).

この場合、一意の2次曲面を定めるためには、図9(A)または(B)に示すように、整数精度最小値テーブル要素tmと、当該テーブル要素tmをその両側から挟む位置の、当該テーブル要素tmの近傍の4個の整数精度テーブル要素t1,t2,t3,t4が最低限必要である。   In this case, in order to define a unique quadric surface, as shown in FIG. 9 (A) or (B), the integer precision minimum value table element tm and the position at which the table element tm is sandwiched from both sides At least four integer precision table elements t1, t2, t3, and t4 in the vicinity of the table element tm are necessary.

そして、図10に示すように、参照フレームのサーチ範囲内の縮小SADテーブルに対応する参照縮小ベクトルの範囲内において、ターゲットフレームの位置を基準位置(0,0)として、水平方向および垂直方向のずれ量(参照縮小ベクトルに対応)の軸vx/nおよび軸vy/nを考えると共に、これらの軸vx/nおよび軸vy/nに垂直な軸として、SAD値の軸を考え、これら3軸からなる座標空間を想定する。   Then, as shown in FIG. 10, in the range of the reference reduced vector corresponding to the reduced SAD table within the search range of the reference frame, the position of the target frame is set as the reference position (0, 0), and the horizontal and vertical directions are set. Considering the axis vx / n and the axis vy / n of the deviation amount (corresponding to the reference reduction vector), the axis of the SAD value is considered as an axis perpendicular to the axis vx / n and the axis vy / n, and these three axes Assume a coordinate space consisting of

そして、例えば、整数精度最小値テーブル要素tmのSAD値と、当該整数精度最小値テーブル要素tmを挟む2個のテーブル要素t1、t3のSAD値とから、図10の座標空間において2次曲線を生成する。また、整数精度最小値テーブル要素tmのSAD値と、当該最小値テーブル要素tmを挟む他の2個のテーブル要素t2、t4のSAD値とから、図10の座標空間において、他の2次曲線を生成する。そして、これら2個の2次曲線を含む2次曲面201を、最小自乗法により求め、その2次曲面201を、図10に示すように、座標空間において生成する。   Then, for example, a quadratic curve is obtained in the coordinate space of FIG. 10 from the SAD value of the integer precision minimum value table element tm and the SAD values of the two table elements t1 and t3 sandwiching the integer precision minimum value table element tm. Generate. Further, from the SAD value of the integer precision minimum value table element tm and the SAD values of the other two table elements t2 and t4 sandwiching the minimum value table element tm, another quadratic curve is obtained in the coordinate space of FIG. Is generated. Then, a quadric surface 201 including these two quadratic curves is obtained by the method of least squares, and the quadric surface 201 is generated in a coordinate space as shown in FIG.

そして、生成されたSAD値の2次曲面201の最小値202を検出し、その最小値を取るSAD値に対応する位置(vx/n,vy/n)(図10の位置203)を検出し、当該検出した位置(vx/n,vy/n)を、小数精度のテーブル要素(テーブルアドレス)として検出する。そして、検出した小数精度テーブル要素に対応するベクトル(最小値ベクトル)204を、図11に示すようにn倍して、元の大きさ精度の動きベクトル205を得る。   Then, the minimum value 202 of the generated quadratic surface 201 of the SAD value is detected, and the position (vx / n, vy / n) (position 203 in FIG. 10) corresponding to the SAD value taking the minimum value is detected. The detected position (vx / n, vy / n) is detected as a table element (table address) with decimal precision. Then, the vector (minimum value vector) 204 corresponding to the detected decimal precision table element is multiplied by n as shown in FIG. 11 to obtain a motion vector 205 with the original magnitude accuracy.

例えば、図12に示すように、参照ベクトルを1/4に縮小した場合における縮小SADテーブルTBLsの、小数精度テーブル要素の最小値アドレスから求められる最小値ベクトル204が、(−0.777,−1.492)の場合に、これらを4倍した(−3.108,−5.968)が、動きベクトル205となる。この動きベクトル205は、元画像のスケールにおける動きベクトルを再現したものとなっている。   For example, as shown in FIG. 12, the minimum value vector 204 obtained from the minimum value address of the decimal precision table element of the reduced SAD table TBLs when the reference vector is reduced to ¼ is (−0.777, − In the case of 1.492), the motion vector 205 is obtained by multiplying these by four (-3.108, -5.968). This motion vector 205 is a reproduction of a motion vector on the scale of the original image.

以上の説明は、整数精度最小値テーブル要素tmと、その近傍の4テーブル要素を用いた場合として説明したが、SAD値の2次曲面を最小自乗法により求めるためには、より多くの複数近傍テーブル要素を用いたほうがよい。そこで、一般には、整数精度最小値テーブル要素tmを中心として、その周囲の水平方向×垂直方向=m×m個(mは3以上の整数)の矩形領域のテーブル要素を用いるようにする。   In the above description, the integer precision minimum value table element tm and the four neighboring table elements are used. However, in order to obtain a quadratic surface of the SAD value by the least square method, a larger number of multiple neighbors are used. It is better to use table elements. Therefore, generally, the table elements of the rectangular area of the horizontal direction × vertical direction = m × m (m is an integer of 3 or more) around the integer precision minimum value table element tm are used.

しかし、この複数近傍テーブル要素の数は、多ければ良いというものではなく、広い範囲のテーブル要素を用いると、演算量の増加を招く上、画像パターンに依存するローカルミニマムの偽値を使用してしまう可能性も高まるので、適切な複数近傍テーブル要素の数からなる矩形領域のテーブル要素を用いるようにする。   However, the number of multiple neighboring table elements is not necessarily large, and using a wide range of table elements leads to an increase in the amount of calculation and using a false value of a local minimum that depends on the image pattern. Therefore, a rectangular area table element having an appropriate number of neighboring table elements is used.

適切な複数近傍テーブル要素の数からなる矩形領域のテーブル要素の例として、この実施形態では、整数精度最小値テーブル要素tmを中心として、その周囲の水平方向×垂直方向=3×3個の矩形領域のテーブル要素を用いるようにする例と、整数精度最小値テーブル要素tmを中心として、その周囲の水平方向×垂直方向=3×3個の矩形領域のテーブル要素を用いるようにする例とについて説明する。   As an example of a table element in a rectangular area composed of an appropriate number of neighboring table elements, in this embodiment, horizontal integer × vertical direction = 3 × 3 rectangles around the integer precision minimum value table element tm. An example of using a table element of an area and an example of using table elements of a horizontal area × vertical direction = 3 × 3 rectangular areas around the integer precision minimum value table element tm explain.

[3×3個の矩形領域のテーブル要素を用いる例]
図13に、整数精度最小値テーブル要素tmを中心として、その周囲の水平方向×垂直方向=3×3個の矩形領域(図13で塗りを付して示してある)のテーブル要素を用いるようにする例を示す。
[Example using 3 × 3 rectangular area table elements]
FIG. 13 uses the table elements of the horizontal direction × vertical direction = 3 × 3 rectangular areas (shown with a fill in FIG. 13) around the integer precision minimum value table element tm. Here is an example.

この図13の例の場合には、図13(A)に示すように、整数精度最小値テーブル要素tmと、その近傍の8個の近傍テーブル要素のSAD値を用いて、図13(B)に示すような2次曲面201を、最小自乗法により生成する。そして、生成されたSAD値の2次曲面201の最小値202を検出し、その最小値を取るSAD値に対応する位置(vx/n,vy/n)(図13(B)の位置203)を検出し、当該検出した位置203を、小数精度の最小値テーブル要素位置(小数精度最小値テーブルアドレス)として検出する。   In the case of the example of FIG. 13, as shown in FIG. 13A, using the SAD values of the integer precision minimum value table element tm and eight neighboring table elements, FIG. A quadric surface 201 as shown in FIG. 2 is generated by the method of least squares. Then, the minimum value 202 of the quadratic surface 201 of the generated SAD value is detected, and the position (vx / n, vy / n) corresponding to the SAD value taking the minimum value (position 203 in FIG. 13B). , And the detected position 203 is detected as a decimal value minimum value table element position (decimal accuracy minimum value table address).

そして、検出した小数精度テーブル要素位置203に対応するベクトル(最小値ベクトル)204を、前述した図11に示すようにn倍して、元の大きさ精度の動きベクトル205を得る。   Then, the vector (minimum value vector) 204 corresponding to the detected decimal precision table element position 203 is multiplied by n as shown in FIG. 11 to obtain the motion vector 205 with the original magnitude accuracy.

ここで、SAD値の2次曲面201の最小値202に対応する位置203の算出方法は、次のようになる。すなわち、図14に示すように、整数精度最小値テーブル要素tmの位置を原点(0,0)とする(x,y)座標を考える。この場合、周辺の8個のテーブル要素の位置は、3個のx軸方向の位置、すなわち、x=−1、x=0、x=1と、3個のY軸方向の位置、すなわち、y=−1、y=0、y=1との繰り合わせで表され、(−1,−1)、(0,−1)、(1,−1)、(−1,0)、(0,1)、(−1,1)、(0,1)、(1,1)の8位置となる。   Here, the calculation method of the position 203 corresponding to the minimum value 202 of the quadratic surface 201 of the SAD value is as follows. That is, as shown in FIG. 14, consider the (x, y) coordinates where the position of the integer precision minimum value table element tm is the origin (0, 0). In this case, the positions of the surrounding eight table elements are three positions in the x-axis direction, that is, x = -1, x = 0, x = 1, and three positions in the Y-axis direction, that is, y = -1, y = 0, y = 1, and (-1, -1), (0, -1), (1, -1), (-1, 0), ( 0, 1), (-1, 1), (0, 1), (1, 1).

そして、図14のテーブルにおける各テーブル要素のSAD値を、Sxyとする。したがって、例えば、整数精度最小値テーブル要素tm(位置(0,0))のSAD値はS00と表され、また、右下の位置(1,1)のテーブル要素値のSAD値はS11と表される。 And let the SAD value of each table element in the table of FIG. 14 be Sxy. Therefore, for example, the SAD value of the integer precision minimum value table element tm (position (0, 0)) is represented as S 00, and the SAD value of the table element value at the lower right position (1, 1) is S 11. It is expressed.

すると、整数精度最小値テーブル要素tmの位置を原点(0,0)とする(x,y)座標における小数精度の位置(dx、dy)は、図15に示す(式A)および(式B)により、求めることができる。   Then, the decimal precision position (dx, dy) in the (x, y) coordinates where the position of the integer precision minimum value table element tm is the origin (0, 0) is shown in (Expression A) and (Expression B) shown in FIG. ).

図15の(式A)および(式B)において、
x=−1のとき、Kx=−1
x=0のとき、Kx=0
x=0のとき、Kx=1
となる。また、
y=−1のとき、Ky=−1
y=0のとき、Ky=0
y=0のとき、Ky=1
となる。
In (Formula A) and (Formula B) of FIG.
When x = -1, Kx = -1
Kx = 0 when x = 0
When x = 0, Kx = 1
It becomes. Also,
When y = -1, Ky = -1
When y = 0, Ky = 0
When y = 0, Ky = 1
It becomes.

こうして求められた小数精度の位置(dx,dy)は、整数精度最小値テーブル要素tmの位置を原点(0,0)とする位置であるので、この小数精度の位置(dx,dy)と整数精度最小値テーブル要素tmの位置とから、求めるサーチ範囲の中心位置からの位置203を検出することができる。   Since the decimal precision position (dx, dy) thus obtained is a position having the position of the integer precision minimum value table element tm as the origin (0, 0), the decimal precision position (dx, dy) and the integer The position 203 from the center position of the search range to be obtained can be detected from the position of the minimum accuracy table element tm.

[4×4個の矩形領域のテーブル要素を用いる例]
図16に、整数精度最小値テーブル要素tmをほぼ中心として、その周囲の水平方向×垂直方向=4×4個の矩形領域のテーブル要素(図16で塗りを付して示してある)を用いるようにする例を示す。
[Example using table elements of 4 × 4 rectangular areas]
In FIG. 16, the table elements (shown with a fill in FIG. 16) of the rectangular area of the horizontal direction × vertical direction = 4 × 4 around the integer precision minimum value table element tm are used. An example is shown below.

この場合に、整数精度最小値テーブル要素tmと、その近傍の8テーブル要素(3×3)や、その近傍の24テーブル要素(5×5)のように、前記mの値が奇数である場合には、整数精度最小値テーブル要素tmは、常に、使用する矩形領域の複数のテーブル要素の中心になるため、使用するテーブル範囲は単純に決定する。   In this case, when the value of m is an odd number, such as the integer precision minimum value table element tm and its neighboring 8 table elements (3 × 3) and its neighboring 24 table elements (5 × 5) The integer precision minimum value table element tm is always the center of a plurality of table elements in the rectangular area to be used, and therefore the table range to be used is simply determined.

これに対して、近傍の15テーブル要素(4×4)のように、mが偶数である場合には、整数精度最小値テーブル要素tmは、使用する矩形領域の複数のテーブル要素の中心位置とはならないので、若干の工夫が必要となる。   On the other hand, when m is an even number, such as 15 neighboring table elements (4 × 4), the integer precision minimum value table element tm is the center position of a plurality of table elements in the rectangular area to be used. Since it is not possible, some ingenuity is necessary.

つまり、整数精度最小値テーブル要素tmから見て、水平方向に左右の隣接テーブル要素のSAD値を比較し、小さい値となった側の方向の、当該方向の隣接テーブル要素に隣接するテーブル要素を近傍テーブル要素の4列目として採用する。同様に、垂直方向に上下の隣接テーブル要素のSAD値を比較し、小さい値となった側の方向の、当該方向の隣接テーブル要素に隣接するテーブル要素を近傍テーブル要素の4行目として採用する。   That is, as seen from the integer precision minimum value table element tm, the SAD values of the left and right adjacent table elements are compared in the horizontal direction, and the table element adjacent to the adjacent table element in the direction in the direction of the smaller value is obtained. This is adopted as the fourth column of the neighborhood table element. Similarly, the SAD values of the upper and lower adjacent table elements are compared in the vertical direction, and the table element adjacent to the adjacent table element in that direction in the direction of the smaller value is adopted as the fourth row of the neighboring table element. .

図16の例では、整数精度最小値テーブル要素tmの水平方向に左右の隣接テーブル要素のSAD値は、「177」と「173」であるので、SAD値が小さい右隣の値「173」のテーブル要素のさらに右隣の列を第4列目として採用する。また、整数精度最小値テーブル要素tmの垂直方向に上下の隣接テーブル要素のSAD値は、「168」と「182」であるので、SAD値が小さい上隣の値「168」のテーブル要素のさらに上隣の行を第4行目として採用する。   In the example of FIG. 16, since the SAD values of the left and right adjacent table elements in the horizontal direction of the integer precision minimum value table element tm are “177” and “173”, the SAD value of the right adjacent value “173” is small. The column to the right of the table element is adopted as the fourth column. Further, since the SAD values of the upper and lower adjacent table elements in the vertical direction of the integer precision minimum value table element tm are “168” and “182”, the SAD value is smaller than the table element of the adjacent value “168”. The upper adjacent row is adopted as the fourth row.

そして、図16の例の場合には、整数精度最小値テーブル要素tmと、その近傍の15個の近傍テーブル要素のSAD値を用いて、2次曲面201を、最小自乗法により生成する。そして、生成されたSAD値の2次曲面201の最小値202を検出し、その最小値を取るSAD値に対応する位置(vx/n,vy/n)(図16の位置203)を検出し、当該検出した位置203を、小数精度の最小値テーブル要素位置(小数精度最小値テーブルアドレス)として検出する。   In the case of the example of FIG. 16, the quadric surface 201 is generated by the least square method using the integer precision minimum value table element tm and the SAD values of 15 neighboring table elements. Then, the minimum value 202 of the generated quadratic surface 201 of the SAD value is detected, and the position (vx / n, vy / n) (position 203 in FIG. 16) corresponding to the SAD value taking the minimum value is detected. The detected position 203 is detected as a decimal precision minimum value table element position (decimal precision minimum value table address).

そして、検出した小数精度テーブル要素位置203に対応するベクトル(最小値ベクトル)204を、前述した図11に示すようにn倍して、元の大きさ精度の動きベクトル205を得る。   Then, the vector (minimum value vector) 204 corresponding to the detected decimal precision table element position 203 is multiplied by n as shown in FIG. 11 to obtain the motion vector 205 with the original magnitude accuracy.

ここで、この例の場合におけるSAD値の2次曲面201の最小値202に対応する位置203の算出方法は、次のようになる。すなわち、図17に示すように、整数精度最小値テーブル要素tmの位置を原点(0,0)とする(x,y)座標を考える。   Here, the calculation method of the position 203 corresponding to the minimum value 202 of the quadratic surface 201 of the SAD value in the case of this example is as follows. That is, as shown in FIG. 17, consider the (x, y) coordinates where the position of the integer precision minimum value table element tm is the origin (0, 0).

この例の場合には、16テーブル要素からなる矩形領域中における整数精度最小値テーブル要素tmの位置に応じて、図17(A),(B),(C),(D)のような4通りのテーブル要素配置を考える必要がある。   In the case of this example, 4 as shown in FIGS. 17A, 17B, 17C, and 17D, depending on the position of the integer precision minimum value table element tm in a rectangular area consisting of 16 table elements. It is necessary to consider the arrangement of table elements on the street.

この場合、周辺の15個のテーブル要素の位置は、図17(A),(B),(C),(D)から分かるように、4個のx軸方向の位置、すなわち、x=−1、x=0、x=1、x=2またはx=−2と、4個のY軸方向の位置、すなわち、y=−1、y=0、y=1、y=2またはy=−2との繰り合わせで表される15位置となる。   In this case, the positions of the surrounding 15 table elements are four positions in the x-axis direction, that is, x = −, as can be seen from FIGS. 17 (A), (B), (C), and (D). 1, x = 0, x = 1, x = 2 or x = -2, and four positions in the Y-axis direction, that is, y = -1, y = 0, y = 1, y = 2 or y = 15 positions represented by the repetition of -2.

そして、図17のテーブルにおける各テーブル要素のSAD値を、Sxyとする。したがって、例えば、整数精度最小値テーブル要素tm(位置(0,0))のSAD値はS00と表され、また、位置(1,1)のテーブル要素値のSAD値はS11と表される。 Then, the SAD value of each table element in the table of FIG. Thus, for example, SAD value of the integer precision minimum value table element tm (position (0, 0)) is expressed as S 00, also, SAD value table element values of the position (1, 1) is expressed as S 11 The

すると、整数精度最小値テーブル要素tmおよびその周辺の16テーブル要素からなる矩形領域中の中心位置を原点(0,0)とする(x,y)座標における小数精度の位置(dx,dy)は、図18に示す(式C)および(式D)により、求めることができる。   Then, the position (dx, dy) of decimal precision in the (x, y) coordinates with the origin (0, 0) as the center position in the rectangular area composed of the integer precision minimum value table element tm and the surrounding 16 table elements is It can be obtained by (Equation C) and (Equation D) shown in FIG.

ここで、図18の(式C)および(式D)において、KxおよびKyは、図19に示すように、整数精度最小値テーブル要素tmおよびその周辺の16テーブル要素からなる矩形領域中の中心位置を原点(0,0)とする(Kx,Ky)座標を考えたときの、前記図17(A),(B),(C),(D)に示した4通りのテーブル要素配置に応じた値となる。   Here, in (Equation C) and (Equation D) in FIG. 18, Kx and Ky are the centers in the rectangular area consisting of the integer precision minimum value table element tm and the surrounding 16 table elements, as shown in FIG. When considering the (Kx, Ky) coordinates where the position is the origin (0, 0), the four table element arrangements shown in FIGS. 17A, 17B, 17C, and 17D are used. It becomes a corresponding value.

すなわち、前記図17(A)に対応する場合には、
x=−2のとき、Kx=−1.5
x=−1のとき、Kx=−0.5
x=0のとき、Kx=0.5
x=1のとき、Kx=1.5
となる。また、
y=−2のとき、Ky=−1.5
y=−1のとき、Ky=−0.5
y=0のとき、Ky=0.5
y=1のとき、Ky=1.5
となる。
That is, in the case corresponding to FIG.
When x = -2, Kx = -1.5
When x = −1, Kx = −0.5
When x = 0, Kx = 0.5
When x = 1, Kx = 1.5
It becomes. Also,
When y = -2, Ky = -1.5
When y = −1, Ky = −0.5
When y = 0, Ky = 0.5
When y = 1, Ky = 1.5
It becomes.

また、前記図17(B)に対応する場合には、
x=−2のとき、Kx=−1.5
x=−1のとき、Kx=−0.5
x=0のとき、Kx=0.5
x=1のとき、Kx=1.5
となる。また、
y=−1のとき、Ky=−1.5
y=0のとき、Ky=−0.5
y=1のとき、Ky=0.5
y=2のとき、Ky=1.5
となる。
In the case corresponding to FIG. 17B,
When x = -2, Kx = -1.5
When x = −1, Kx = −0.5
When x = 0, Kx = 0.5
When x = 1, Kx = 1.5
It becomes. Also,
When y = −1, Ky = −1.5
When y = 0, Ky = −0.5
When y = 1, Ky = 0.5
When y = 2, Ky = 1.5
It becomes.

また、前記図17(C)に対応する場合には、
x=−1のとき、Kx=−1.5
x=0のとき、Kx=−0.5
x=1のとき、Kx=0.5
x=2のとき、Kx=1.5
となる。また、
y=−2のとき、Ky=−1.5
y=−1のとき、Ky=−0.5
y=0のとき、Ky=0.5
y=1のとき、Ky=1.5
となる。
In the case corresponding to FIG. 17C,
When x = −1, Kx = −1.5
When x = 0, Kx = −0.5
When x = 1, Kx = 0.5
When x = 2, Kx = 1.5
It becomes. Also,
When y = -2, Ky = -1.5
When y = −1, Ky = −0.5
When y = 0, Ky = 0.5
When y = 1, Ky = 1.5
It becomes.

また、前記図17(D)に対応する場合には、
x=−1のとき、Kx=−1.5
x=0のとき、Kx=−0.5
x=1のとき、Kx=0.5
x=2のとき、Kx=1.5
となる。また、
y=−1のとき、Ky=−1.5
y=0のとき、Ky=−0.5
y=1のとき、Ky=0.5
y=2のとき、Ky=1.5
となる。
In the case corresponding to FIG. 17D,
When x = −1, Kx = −1.5
When x = 0, Kx = −0.5
When x = 1, Kx = 0.5
When x = 2, Kx = 1.5
It becomes. Also,
When y = −1, Ky = −1.5
When y = 0, Ky = −0.5
When y = 1, Ky = 0.5
When y = 2, Ky = 1.5
It becomes.

また、図18の(式C)および(式D)におけるΔxおよびΔyは、(Kx,Ky)座標に対する図17(A),(B),(C),(D)の各テーブル要素配置における(x,y)座標とのずれ量を表しており、図19から分かるように、
図17(A)に対応する場合には、Δx=−0.5、Δy=−0.5、
図17(B)に対応する場合には、Δx=−0.5、Δy=0.5、
図17(C)に対応する場合には、Δx=0.5、Δy=−0.5、
図17(D)に対応する場合には、Δx=0.5、Δy=0.5、
となる。
Further, Δx and Δy in (Expression C) and (Expression D) in FIG. 18 are the table element arrangements in FIGS. 17A, 17B, 17C, and 17D with respect to the (Kx, Ky) coordinates. This represents the amount of deviation from the (x, y) coordinates, and as can be seen from FIG.
In the case corresponding to FIG. 17A, Δx = −0.5, Δy = −0.5,
In the case corresponding to FIG. 17B, Δx = −0.5, Δy = 0.5,
In the case corresponding to FIG. 17C, Δx = 0.5, Δy = −0.5,
In the case corresponding to FIG. 17D, Δx = 0.5, Δy = 0.5,
It becomes.

こうして求められた小数精度の位置(dx,dy)は、整数精度最小値テーブル要素tmの位置を原点(0,0)とする位置であるので、この小数精度の位置(dx,dy)と整数精度最小値テーブル要素tmの位置とから、求めるサーチ範囲の中心位置からの位置203を検出することができる。   Since the decimal precision position (dx, dy) thus obtained is a position having the position of the integer precision minimum value table element tm as the origin (0, 0), the decimal precision position (dx, dy) and the integer The position 203 from the center position of the search range to be obtained can be detected from the position of the minimum accuracy table element tm.

[より正確な動きベクトルを検出するための補間処理の第2の例]
より正確な動きベクトルを検出するための補間処理の第2の例は、縮小SADテーブルにおける整数精度最小値テーブル要素を含む複数個の水平方向のテーブル要素のSAD値を用いて水平方向の3次曲線を生成すると共に、整数精度最小値テーブル要素を含む複数個の垂直方向のテーブル要素のSAD値を用いて垂直方向の3次曲線を生成し、それぞれの3次曲線の極小値となる位置(vx,vy)を検出して、検出した位置を小数精度の最小値アドレスとするものである。
[Second Example of Interpolation Process for Detecting More Accurate Motion Vector]
A second example of the interpolation process for detecting a more accurate motion vector is a horizontal third order using SAD values of a plurality of horizontal table elements including the integer precision minimum value table element in the reduced SAD table. A curve is generated, and a vertical cubic curve is generated by using the SAD values of a plurality of vertical table elements including the integer precision minimum value table element, and the position (where the minimum value of each cubic curve becomes a minimum value ( vx, vy) is detected, and the detected position is used as the minimum value address with decimal precision.

図20は、この第2の例を説明するための図である。前述の第1の例と同様にして、整数精度最小値テーブル要素tmと、この整数精度最小値テーブル要素を中心とする複数の整数精度テーブル要素、図20の例では、4×4=16個のテーブル要素を求める(図20(A)で塗りを付した部分参照)。   FIG. 20 is a diagram for explaining the second example. Similarly to the first example described above, the integer precision minimum value table element tm and a plurality of integer precision table elements centered on this integer precision minimum value table element, 4 × 4 = 16 in the example of FIG. The table elements are obtained (refer to the portion with a fill in FIG. 20A).

次に、第1の例と同様にして、図20(B)に示すように、参照フレームのサーチ範囲内の縮小SADテーブルに対応する参照縮小ベクトルの範囲内において、ターゲットフレームの位置を基準位置(0,0)として、水平方向および垂直方向のずれ量(参照縮小ベクトルに対応)の軸vx/nおよび軸vy/nを考えると共に、これらの軸vx/nおよび軸vy/nに垂直な軸として、SAD値の軸を考え、これら3軸からなる座標空間を想定する。   Next, as in the first example, as shown in FIG. 20B, the position of the target frame is set to the reference position within the reference reduced vector range corresponding to the reduced SAD table in the reference frame search range. Assuming (0,0) the axis vx / n and the axis vy / n of the horizontal and vertical shift amounts (corresponding to the reference reduction vector), the axis vx / n and the axis vy / n are perpendicular to each other. As an axis, an SAD value axis is considered, and a coordinate space including these three axes is assumed.

次に、整数精度最小値テーブル要素tmの周囲の16個のテーブル要素のうち、整数精度最小値テーブル要素tmを含む4個の水平方向のテーブル要素のSAD値を用いて、前記座標空間に水平方向の3次曲線206を生成する。この水平方向の3次曲線206の極小値に対応する水平方向の位置vx/nとして、小数精度最小値テーブル要素位置の水平方向位置を検出する。   Next, among the 16 table elements around the integer precision minimum value table element tm, the horizontal SAD values of the four horizontal table elements including the integer precision minimum value table element tm are used to A cubic curve 206 of directions is generated. The horizontal position of the decimal precision minimum value table element position is detected as the horizontal position vx / n corresponding to the minimum value of the horizontal cubic curve 206.

次に、整数精度最小値テーブル要素tmの周囲の16個のテーブル要素のうち、整数精度最小値テーブル要素tmを含む4個の垂直方向のテーブル要素のSAD値を用いて、前記座標空間に垂直方向の3次曲線207を生成する。この垂直方向の3次曲線207の極小値に対応する垂直方向の位置vy/nとして、小数精度最小値テーブル要素位置の垂直方向位置を検出する。   Next, among the 16 table elements around the integer precision minimum value table element tm, the SAD values of the four vertical table elements including the integer precision minimum value table element tm are used to A cubic curve 207 in the direction is generated. The vertical position of the decimal precision minimum value table element position is detected as the vertical position vy / n corresponding to the minimum value of the cubic curve 207 in the vertical direction.

以上により求めた小数精度最小値テーブル要素位置の水平方向の位置と、垂直方向の位置から、小数精度最小値テーブル要素位置(小数精度最小値テーブルアドレス)208を検出する。そして、当該検出した小数精度テーブル要素位置208に対応するベクトル(最小値ベクトル)209を、前述した図11に示すようにn倍して、元の大きさ精度の動きベクトルを得る。   The decimal precision minimum value table element position (decimal precision minimum value table address) 208 is detected from the horizontal position and the vertical position of the decimal precision minimum value table element position obtained as described above. Then, the vector (minimum value vector) 209 corresponding to the detected decimal precision table element position 208 is multiplied by n as shown in FIG. 11 to obtain an original magnitude precision motion vector.

すなわち、第2の例は、第1の例で説明した方法により、水平方向、垂直方向のそれぞれの4個のテーブル要素を確定し、図20(B)に示すように、水平方向、垂直方向のそれぞれで、3次曲線を一意に定める手法である。   That is, in the second example, four table elements in the horizontal direction and the vertical direction are determined by the method described in the first example, and as shown in FIG. 20B, the horizontal direction and the vertical direction are determined. This is a method for uniquely determining a cubic curve.

ここで、SAD値の3次曲線206および209の最小値202に対応する位置208の算出方法は、次のようになる。すなわち、水平方向または垂直方向のいずれかの方向における3次曲線において、最小値の近傍の4点のSAD値を、前記水平方向または垂直方向のいずれかの方向に沿った順番に、S、S、S、Sとしたとき、小数精度の最小値が、図21に示す3つの区間Ra,Rb,Rcのいずれにあるかにより、最小値を取る小数成分uを算出する式が異なる。 Here, the calculation method of the position 208 corresponding to the minimum value 202 of the cubic curves 206 and 209 of the SAD value is as follows. That is, in a cubic curve in either the horizontal direction or the vertical direction, four SAD values in the vicinity of the minimum value are set in the order along either the horizontal direction or the vertical direction, S 0 , When S 1 , S 2 , and S 3 are used, an equation for calculating the fractional component u that takes the minimum value depends on which of the three sections Ra, Rb, and Rc shown in FIG. Different.

ここで、区間RaはSAD値Sとなる位置とSAD値Sとなる位置との間の区間、RbはSAD値Sとなる位置とSAD値Sとなる位置との間の区間、RcはSAD値Sとなる位置とSAD値Sとなる位置との間の区間である。 Here, the section Ra is a section between the position where the SAD value S 0 is located and the position where the SAD value S 1 is located, and Rb is a section between the position where the SAD value S 1 is located and the position where the SAD value S 2 is located, Rc is the section between the position where the position and the SAD value S 3 as a SAD value S 2.

そして、小数精度の最小値が、図21に示す区間Raにあるときには、図22の(式E)により、整数精度の最小値の位置に対する最小値を取る位置までのずれの小数成分uが算出される。   When the minimum value of decimal precision is in the interval Ra shown in FIG. 21, the decimal component u of deviation up to the position where the minimum value is obtained with respect to the position of the minimum value of integer precision is calculated by (Equation E) in FIG. Is done.

また、同様に、小数精度の最小値が、図21に示す区間Rbにあるときには、図22の(式F)により、整数精度の最小値の位置に対する最小値を取る位置までのずれの小数成分uが算出される。   Similarly, when the minimum value of decimal precision is in the section Rb shown in FIG. 21, the decimal component of the deviation up to the position where the minimum value is obtained with respect to the position of the minimum value of integer precision is obtained by (Equation F) in FIG. u is calculated.

さらに、小数精度の最小値が、図21に示す区間Rcにあるときには、図22の(式G)により、整数精度の最小値の位置に対する最小値を取る位置までのずれの小数成分uが算出される。   Further, when the minimum value of decimal precision is in the section Rc shown in FIG. 21, the decimal component u of deviation up to the position where the minimum value is obtained with respect to the position of the minimum value of integer precision is calculated by (Equation G) of FIG. Is done.

そして、小数精度の最小値が、図21に示す3つの区間Ra,Rb,Rcのいずれにあるかの判別は、次のようにして行なう。   Then, determination as to which of the three sections Ra, Rb, and Rc shown in FIG. 21 has the minimum decimal precision value is performed as follows.

すなわち、図23は、その判別を説明するための図である。図23(A),(B),(C)に示すように、先ず、整数精度のSAD値の最小値Sminと、2番目に小さい整数精度のSAD値Sn2とを検出し、小数精度の最小値は、検出された整数精度のSAD値の最小値Sminの位置と、2番目に小さい整数精度のSAD値Sn2の位置との間の区間に存在するとして検出する。次に、整数精度のSAD値の最小値Sminと、2番目に小さい整数精度のSAD値Sn2とが、図21に示したSAD値S、S、S、Sのいずれの位置となっているかにより、検出した区間が区間Ra,Rb,Rcのいずれであるかの判別を行なう。 That is, FIG. 23 is a diagram for explaining the determination. As shown in FIGS. 23A, 23B, and 23C, first, the minimum value Smin of the integer precision SAD value and the second smallest integer precision SAD value Sn2 are detected, and the decimal precision minimum is detected. The value is detected as existing in a section between the position of the minimum value Smin of the detected integer precision SAD value and the position of the second smallest integer precision SAD value Sn2. Next, the minimum value Smin of the integer precision SAD value and the second smallest integer precision SAD value Sn2 are the positions of any of the SAD values S 0 , S 1 , S 2 , S 3 shown in FIG. Whether or not the detected section is the section Ra, Rb, or Rc is determined depending on whether or not it is.

なお、図23(D)に示すように、整数精度のSAD値の最小値SminがSAD値のまたは位置にあって、4個のテーブル要素値の端に位置する場合には、最小位置が推定できないとして、この実施形態では、エラーとして扱い、最小値位置の算出は行なわないようにする。もっとも、この図23(D)のような場合においても、最小値位置を算出するようにしてもよい。   As shown in FIG. 23D, when the minimum value Smin of the integer precision SAD value is at or at the position of the SAD value and is positioned at the end of the four table element values, the minimum position is estimated. In this embodiment, it is assumed that it cannot be performed, so that it is treated as an error and the minimum value position is not calculated. However, even in the case of FIG. 23D, the minimum value position may be calculated.

以上のようにして、この実施形態によれば、1/nにスケールダウンした小さいサイズの縮小SADテーブルを用いて、元の画像スケールにおける動きベクトルを検出することができる。この場合に、1/nにスケールダウンした小さいサイズの縮小SADテーブルを用いているにも関わらず、従来とほぼ同様のベクトル検出結果が得られることを図24に示す。 As described above, according to this embodiment, it is possible to detect a motion vector on the original image scale using a reduced SAD table having a small size scaled down to 1 / n 2 . In this case, FIG. 24 shows that a vector detection result almost the same as the conventional one can be obtained despite the use of a reduced SAD table with a small size scaled down to 1 / n 2 .

図24の横軸は、水平方向または垂直方向の一方についての1次元方向の縮小倍率nであり、また、縦軸は、検出される動きベクトルについての誤差(ベクトル誤差)を示している。図24のベクトル誤差の数値は画素数で表されている。   The horizontal axis in FIG. 24 is the reduction factor n in the one-dimensional direction in either the horizontal direction or the vertical direction, and the vertical axis indicates an error (vector error) about the detected motion vector. The numerical value of the vector error in FIG. 24 is represented by the number of pixels.

図24において、曲線301は、縮小倍率に対するベクトル誤差の平均値である。また、曲線302は、縮小倍率に対するベクトル誤差の分散σの3倍値(3σ(99.7%))を示している。曲線303は、曲線302の近似曲線を示している。   In FIG. 24, a curve 301 is an average value of vector errors with respect to the reduction magnification. A curve 302 indicates a triple value (3σ (99.7%)) of the vector error variance σ with respect to the reduction ratio. A curve 303 represents an approximate curve of the curve 302.

図24は、1次元方向の縮小倍率nに対するベクトル誤差を示しているが、SADテーブルは2次元のため、図24に示されるものの2乗の割合でテーブルサイズ(テーブル要素数)が削減されるのに対し、ベクトル誤差は、線形程度にしか増加しないことから、この実施形態による手法の有用性が分かる。   FIG. 24 shows the vector error with respect to the reduction ratio n in the one-dimensional direction. However, since the SAD table is two-dimensional, the table size (number of table elements) is reduced by the ratio of the square of what is shown in FIG. On the other hand, since the vector error increases only to a linear level, the usefulness of the method according to this embodiment can be understood.

また、n=64(縮小率1/64)倍の縮小倍率でも、ベクトル誤差は小さく、全く異なる動きベクトルを検出出力とするような破綻は見られないことから、実質、1/4096に、SADテーブルのサイズを削減可能であると言える。   Further, even at a reduction ratio of n = 64 (reduction ratio 1/64) times, the vector error is small, and no failure that causes a completely different motion vector to be detected and output is observed. It can be said that the size of the table can be reduced.

また、前述したように、動画の手ぶれ補正においては、リアルタイム性とシステム遅延の削減が強く求められるのに対し、精度については、破綻した全く異なる動きベクトルが検出される場合を除き、ある程度のベクトル検出誤差に対して寛容である。したがって、破綻しないままSADテーブルのサイズを大きく削減することができる、この実施形態は有用性が高いと言える。   In addition, as described above, in the image stabilization of a moving image, real-time characteristics and reduction of system delay are strongly demanded. On the other hand, in terms of accuracy, a certain amount of vector is used except when a completely different broken motion vector is detected. Tolerant of detection error. Therefore, it can be said that this embodiment can greatly reduce the size of the SAD table without failing, and is highly useful.

そして、この実施形態では、参照フレーム102を複数の領域に分割し、それぞれの分割領域において動きベクトル(ブロック毎動きベクトル)205を検出するようにする。これは、前述したように、フレーム内には動く被写体が含まれる可能性も高いため、例えば、図25のように参照フレーム102の1フレーム内において16個の動きベクトル205を検出し、過去のフレームにおけるそれらの動きベクトル205からの推移も加味しながら統計的に処理することで、1フレームについて1つのグローバル動きベクトル、即ち、フレームの手ぶれベクトルを確定するようにするためである。   In this embodiment, the reference frame 102 is divided into a plurality of regions, and a motion vector (motion vector for each block) 205 is detected in each divided region. As described above, since there is a high possibility that a moving subject is included in the frame as described above, for example, 16 motion vectors 205 are detected in one frame of the reference frame 102 as shown in FIG. This is because one global motion vector, that is, a camera shake vector of the frame is determined for one frame by statistically processing the transition from the motion vector 205 in the frame.

この場合、図25に示すように、検出したい16個の動きベクトル205の基準位置PO1〜PO16のそれぞれを中心とするサーチ範囲SR1,SR2,・・・,SR16を定め、各サーチ範囲において、ターゲットブロックの射影イメージブロックIB1,IB2,・・・,IB16を想定する。   In this case, as shown in FIG. 25, search ranges SR1, SR2,..., SR16 centering on the respective reference positions PO1 to PO16 of the 16 motion vectors 205 to be detected are defined, and in each search range, the target Assume block projected image blocks IB1, IB2,..., IB16.

そして、この射影イメージブロックIB1,IB2,・・・,IB16と同じ大きさの参照ブロックを設定し、各サーチ範囲SR1,SR2,・・・,SR16内を、設定した参照ブロックを移動させて、上述と同様にして、縮小SADテーブルを生成すると共に、各サーチ範囲SR1,SR2,・・・,SR16における動きベクトル205を検出するようにする。したがって、この実施形態では、SADテーブルTBLiは、縮小SADテーブルの構成である。   Then, a reference block having the same size as the projected image blocks IB1, IB2,..., IB16 is set, and the set reference block is moved within each search range SR1, SR2,. In the same manner as described above, a reduced SAD table is generated, and the motion vector 205 in each search range SR1, SR2,. Therefore, in this embodiment, the SAD table TBLi is a configuration of a reduced SAD table.

そして、この実施形態では、16個のサーチ範囲のターゲットブロックについて求めた16個の縮小SADテーブルを、図1に示したように、重ね合わせるように並べて、サーチ範囲内で互いに対応する参照ブロック位置、つまり、縮小SADテーブルで同じ座標位置のSAD値を合算し、合算SAD値を求める。そして、その合算SAD値からなるSADテーブルとして、一つのサーチ範囲内の複数参照ブロック位置分についての合算縮小SADテーブルを生成する。したがって、この実施形態では、合算SADテーブルSUM_TBLは、合算縮小SADテーブルの構成である。   In this embodiment, the 16 reduced SAD tables obtained for the target blocks in the 16 search ranges are arranged so as to overlap as shown in FIG. 1, and the reference block positions corresponding to each other in the search range are arranged. That is, the SAD values at the same coordinate position are added together in the reduced SAD table to obtain the combined SAD value. Then, a combined reduced SAD table for a plurality of reference block positions within one search range is generated as an SAD table including the combined SAD values. Therefore, in this embodiment, the total SAD table SUM_TBL has the configuration of the total reduction SAD table.

そして、この実施形態では、この縮小SADテーブルTBLi、この縮小SADテーブルTBLiについて上述のような近似補間処理をすることで求められるブロック毎動きベクトル205、および合算SADテーブルSUM_TBLを用いて、図2〜図5に示したような信頼性の判定処理および再合算SADテーブルRSUM_TBLの生成、さらに、生成した再合算SADテーブルRSUM_TBLの最小SAD値およびその近傍の複数個のSAD値を用いた曲線近似補間処理をすることにより、グローバル動きベクトルを算出する。   In this embodiment, the reduced SAD table TBLi, the block-by-block motion vector 205 obtained by performing the above-described approximate interpolation processing on the reduced SAD table TBLi, and the summed SAD table SUM_TBL are used. Reliability determination processing and re-summation SAD table RSUM_TBL generation as shown in FIG. 5, and curve approximation interpolation processing using the minimum SAD value of the re-summation SAD table RSUM_TBL and a plurality of SAD values in the vicinity thereof To calculate a global motion vector.

以上説明した実施形態の縮小SADテーブルを用いる画像処理方法は、従来手法として説明した特許文献3に記載された画像を縮小変換したサイズで動きベクトルを検出する手法に比べて、次に挙げる2つの点において、大きく異なるメリットを有するものである。   The image processing method using the reduced SAD table according to the embodiment described above has the following two methods compared to the method of detecting a motion vector with a size obtained by reducing and converting the image described in Patent Document 3 described as the conventional method. In that respect, it has greatly different merits.

まず、第一に、この実施形態による手法は、特許文献3に記載された従来手法と異なり、画像を縮小変換するプロセスを全く必要としない。この実施形態による手法においては、参照ブロックについて算出したSAD値を、SADテーブル(縮小SADテーブル)に代入加算する際に、同時に縮小倍率に相当するアドレス変換を行なうからである。   First, unlike the conventional method described in Patent Document 3, the method according to this embodiment does not require any process for reducing and converting an image. This is because, in the method according to this embodiment, when the SAD value calculated for the reference block is substituted and added to the SAD table (reduced SAD table), address conversion corresponding to the reduction magnification is simultaneously performed.

これにより、この実施形態による手法においては、特許文献3に記載された従来手法のような画像の縮小変換のためのロジックも、縮小した画像をメモリに格納する時間およびバンド幅の浪費も、縮小画像をメモリに貼る領域確保も必要ない、というメリットを有する。   Thereby, in the method according to this embodiment, the logic for reducing and converting the image as in the conventional method described in Patent Document 3, and the time and bandwidth wasted for storing the reduced image in the memory are reduced. There is an advantage that it is not necessary to secure an area for pasting an image on a memory.

特許文献3に記載された従来手法のもう1つ重要な問題点として、前述も使用にしたように、画像を縮小変換する際のエイリアシング(折り返し歪み)や、低照度ノイズ除去のためのローパスフィルタの存在の問題がある。すなわち、画像縮小する際には、適切なローパスフィルタを通してからリサンプリングを行なわなければならず、さもないと、不要なエイリアシングが発生し、その縮小画像を用いた動きベクトルの精度が著しく損なわれるからである。   As another important problem of the conventional method described in Patent Document 3, as described above, aliasing (folding distortion) when reducing and converting an image, and a low-pass filter for removing low illumination noise There is a problem of existence. That is, when the image is reduced, resampling must be performed after passing through an appropriate low-pass filter, otherwise unnecessary aliasing occurs and the accuracy of the motion vector using the reduced image is significantly impaired. It is.

縮小変換の際の理想的なローパスフィルタの特性としては、sinc関数に類似した関数であることが、理論的に証明されている。sinc関数自体は、sin(xπ)/(xπ)の形で表されるカットオフ周波数f/2の無限タップのFIR(Finite Impulse Response)フィルタであるが、縮小倍率1/nのときの理想的なカットオフ周波数f/(2n)のローパスフィルタとしては、sin(xπ/n)/(xπ/n)と表される。しかし、これもsinc関数の一形態として良い。   It is theoretically proved that the characteristic of an ideal low-pass filter at the time of reduction conversion is a function similar to a sinc function. The sinc function itself is an infinite tap FIR (Finite Impulse Response) filter having a cutoff frequency f / 2 expressed in the form of sin (xπ) / (xπ), which is ideal when the reduction ratio is 1 / n. A low-pass filter having a low cutoff frequency f / (2n) is expressed as sin (xπ / n) / (xπ / n). However, this may also be a form of the sinc function.

図26〜図28の上側には、それぞれ縮小倍率が1/2倍、1/4倍、1/8倍のときのsinc関数(ローパスフィルタの理想特性)の形状を示す。この図26〜図28から、縮小倍率が大きくなればなる程、関数がタップ軸方向に拡大して行くことが分かる。つまり、無限タップのsinc関数を主要な係数のみで近似する場合にも、FIRフィルタのタップ数を増加させなければならないと言える。   The upper side of FIGS. 26 to 28 shows the shape of the sinc function (ideal characteristics of the low-pass filter) when the reduction magnification is 1/2, 1/4, and 1/8. From FIG. 26 to FIG. 28, it can be seen that the larger the reduction ratio is, the larger the function is in the tap axis direction. That is, it can be said that the number of taps of the FIR filter must be increased even when the infinite tap sinc function is approximated only by the main coefficients.

また、一般的に、より低い帯域のカットオフ周波数を実現するフィルタは、フィルタ形状よりもタップ数が、その性能に対して支配的になって行くことが知られている。   In general, it is known that the number of taps in a filter that realizes a cut-off frequency in a lower band becomes dominant with respect to its performance rather than the filter shape.

したがって、特許文献3に記載の従来手法の縮小画像を用いる動きベクトル演算手法の場合、画像の縮小倍率が大きくなればなる程、そのSADテーブル削減効果が大きいにも関わらず、画像生成する際の前処理用フィルタとしてのローパスフィルタは、縮小倍率が大きくなればなる程、コストが増加してしまう、という矛盾を併せ持つのである。   Therefore, in the case of the motion vector calculation method using the reduced image of the conventional method described in Patent Document 3, the larger the image reduction magnification, the greater the SAD table reduction effect, but the image generation The low-pass filter as the preprocessing filter has a contradiction that the cost increases as the reduction ratio increases.

一般に、高次タップのFIRフィルタを実現する場合、演算ロジックのコストがタップ数の2乗に比例して増加するため、問題となるが、より大きい問題は、垂直フィルタ実現のためのラインメモリ数の増加である。近年のデジタルスチルカメラにおいては、画素数向上に伴うラインメモリのサイズ削減のため、いわゆる短冊処理を行なっているが、例え、1ライン当たりのサイズを削減したとしても、ラインメモリそのものの本数が増加することは、物理レイアウトエリアで換算されるトータルコストを著しく押し上げる。   In general, when implementing an FIR filter with a high-order tap, the cost of the arithmetic logic increases in proportion to the square of the number of taps, but this is a problem, but the larger problem is the number of line memories for realizing the vertical filter. Is an increase. In recent digital still cameras, so-called strip processing is performed in order to reduce the size of the line memory as the number of pixels increases. For example, even if the size per line is reduced, the number of line memories increases. Doing so significantly increases the total cost converted in the physical layout area.

以上、述べたように、特許文献3に記載の従来手法の画像縮小によるアプローチは、特に垂直ローパスフィルタの実現において、大きな壁が立ちはだかっていることが分かる。それに対し、この実施形態の手法は、全く異なる形で簡潔にこの問題を解決している。   As described above, it can be seen that the image reduction approach of the conventional method described in Patent Document 3 has a significant wall especially in realizing the vertical low-pass filter. In contrast, the method of this embodiment solves this problem in a completely different manner.

図26〜図28の下側に、この実施形態による手法におけるローパスフィルタのイメージを示す。この実施形態による手法においては、画像縮小処理を伴っていないが、縮小SADテーブルの生成演算過程におけるローパスフィルタのイメージを図示したものである。   The image of the low-pass filter in the method according to this embodiment is shown below FIGS. In the method according to this embodiment, the image of the low-pass filter in the generation calculation process of the reduced SAD table is illustrated without the image reduction process.

図26〜図28の下側に示されるように、このローパスフィルタの特性は、sinc関数の主要係数部分を線形で近似した、シンプルなフィルタ特性ではあるものの、縮小倍率に連動してタップ数が増加していることが分かる。これは、先に述べた、カットオフ周波数が低くなる程、ローパスフィルタの性能はタップ数が支配的になる、という事実に好適である。つまり、実施形態の線形加重分散加算を行なう処理のような、この実施形態におけるSAD値の分散加算を行なう処理そのものが、倍率連動の高性能ローパスフィルタを、シンプルな回路で実現していることと等価なのである。   As shown in the lower side of FIGS. 26 to 28, the characteristic of the low-pass filter is a simple filter characteristic obtained by linearly approximating the main coefficient portion of the sinc function, but the number of taps is linked to the reduction ratio. It can be seen that it has increased. This is suitable for the fact that the performance of the low-pass filter becomes dominant in the number of taps as the cut-off frequency becomes lower. That is, the processing itself for performing the dispersion addition of the SAD values in this embodiment, such as the processing for performing the linear weighted dispersion addition of the embodiment, realizes a high-performance low-pass filter linked with the magnification with a simple circuit. It is equivalent.

このローパスフィルタに絡んで、他にもメリットがある。特許文献3に記載の従来手法では、ローパスフィルタをかけた後、リサンプリングすることで画像を縮小するが、この時点で相当数の画像情報が失われる。つまり、ローパスフィルタの演算において、画像情報の輝度値の語長は大幅に丸められてメモリに格納され、殆どの画素情報の下位ビットは、縮小後の画像に影響を与えないのである。   There are other advantages associated with this low-pass filter. In the conventional method described in Patent Document 3, an image is reduced by applying a low-pass filter and then re-sampling, but a considerable amount of image information is lost at this point. That is, in the calculation of the low-pass filter, the word length of the luminance value of the image information is greatly rounded and stored in the memory, and the lower bits of most pixel information do not affect the reduced image.

一方、この実施形態による手法においては、全ての画素の輝度値の全ビット情報を、遍く平等に使用してSAD値を演算し、その分散加算値を求めて縮小SADテーブルに加算する。縮小SADテーブルの各テーブル要素値の語長さえ増やせば、最終的なSAD値の出力まで、一切の丸め誤差を含まない形で演算可能である。縮小SADテーブルの面積はフレームメモリに比較して小さいため、縮小SADテーブルの語長拡張は大きな問題にならない。その結果として、縮小SADテーブル並びに動きベクトル検出を、高精度に実現できるのである。   On the other hand, in the method according to this embodiment, the SAD value is calculated by using all bit information of the luminance values of all the pixels uniformly and equally, and the dispersion added value is obtained and added to the reduced SAD table. As long as the word length of each table element value of the reduced SAD table is increased, the calculation can be performed without including any rounding error until the final SAD value is output. Since the area of the reduced SAD table is smaller than that of the frame memory, the extension of the word length of the reduced SAD table is not a big problem. As a result, the reduced SAD table and motion vector detection can be realized with high accuracy.

[この発明による画像処理装置の実施形態]
次に、この発明による画像処理方法を用いた画像処理装置の実施形態として、撮像装置の場合を例にとって、図を参照しながら説明する。図29は、この発明の画像処理装置の実施形態としての撮像装置の一例のブロック図を示すものである。
[Embodiment of Image Processing Device According to the Invention]
Next, as an embodiment of an image processing apparatus using the image processing method according to the present invention, a case of an imaging apparatus will be described as an example with reference to the drawings. FIG. 29 shows a block diagram of an example of an imaging apparatus as an embodiment of the image processing apparatus of the present invention.

図29に示すように、この実施形態の撮像装置は、システムバス2にCPU(Central Processing Unit)1が接続されると共に、システムバス2に、撮像信号処理系10や、ユーザ操作入力部3、画像メモリ部4、記録再生装置部5などが接続されて構成されている。なお、この明細書においては、CPU1は、種々のソフトウエア処理を行なうプログラムを記憶するROM(Read Only Memory)やワークエリア用RAM(Random Access Memory)などを含むものとしている。   As shown in FIG. 29, in the imaging apparatus of this embodiment, a CPU (Central Processing Unit) 1 is connected to the system bus 2, and the imaging signal processing system 10, the user operation input unit 3, and the like are connected to the system bus 2. The image memory unit 4 and the recording / reproducing device unit 5 are connected to each other. In this specification, the CPU 1 includes a ROM (Read Only Memory) that stores programs for performing various software processes, a work area RAM (Random Access Memory), and the like.

ユーザ操作入力部3を通じた撮像記録開始操作を受けて、図29の撮像装置は、後述するような撮像画像データの記録処理を行なう。また、ユーザ操作入力部3を通じた撮像記録画像の再生開始操作を受けて、図29の撮像装置は、記録再生装置部5の記録媒体に記録された撮像画像データの再生処理を行なう。   In response to an imaging recording start operation through the user operation input unit 3, the imaging apparatus in FIG. 29 performs recording processing of captured image data as described later. In addition, upon receiving a reproduction start operation of the captured / recorded image via the user operation input unit 3, the imaging apparatus in FIG. 29 performs a reproduction process of the captured image data recorded on the recording medium of the recording / reproducing apparatus unit 5.

図29に示すように、撮像レンズ10Lを備えるカメラ光学系(図示は省略)を通じた被写体からの入射光は、撮像素子11に照射されて撮像される。この例では、撮像素子11は、CCD(Charge Coupled Device)イメージャで構成されている。なお、撮像素子11は、CMOS(Complementary Metal Oxide Semiconductor)イメージャで構成してもよい。   As shown in FIG. 29, incident light from a subject through a camera optical system (not shown) including an imaging lens 10 </ b> L is applied to the imaging element 11 and imaged. In this example, the imaging device 11 is configured by a CCD (Charge Coupled Device) imager. Note that the image sensor 11 may be a CMOS (Complementary Metal Oxide Semiconductor) imager.

この例の撮像装置においては、撮像記録開始操作がなされると、撮像素子11からは、タイミング信号発生部12からのタイミング信号によりサンプリングされることにより、赤(R)、緑(G)、青(B)の3原色から構成されるベイヤー配列のRAW信号であるアナログ撮像信号が出力される。出力されたアナログ撮像信号は、前処理部13に供給され、欠陥補正やγ補正等の前処理が施され、データ変換部14に供給される。   In the image pickup apparatus of this example, when an image recording start operation is performed, the image pickup device 11 samples the red (R), green (G), and blue by sampling with the timing signal from the timing signal generating unit 12. An analog image pickup signal that is a RAW signal in a Bayer array composed of the three primary colors (B) is output. The output analog imaging signal is supplied to the preprocessing unit 13, subjected to preprocessing such as defect correction and γ correction, and supplied to the data conversion unit 14.

データ変換部14は、これに入力されたアナログ撮像信号から、輝度信号成分Yと、色差信号成分Cb/Crとにより構成されるデジタル撮像信号(YCデータ)に変換し、そのデジタル撮像信号をシステムバスを介して、画像メモリ部4に供給する。   The data conversion unit 14 converts the analog imaging signal input thereto into a digital imaging signal (YC data) composed of a luminance signal component Y and a color difference signal component Cb / Cr, and converts the digital imaging signal into a system. The image data is supplied to the image memory unit 4 via the bus.

画像メモリ部4は、この図29の例においては、2個のフレームメモリ41,42からなり、データ変換部14からのデジタル撮像信号は、先ず、フレームメモリ41に格納される。そして、1フレーム経過すると、フレームメモリ41に記憶されているデジタル撮像信号が、フレームメモリ42に転送されると共に、フレームメモリ41には、データ変換部14からの新たなフレームのデジタル撮像信号が書き込まれる。したがって、フレームメモリ42には、フレームメモリ41に格納されているフレーム画像よりも1フレーム分前のフレーム画像が格納されている。   In the example of FIG. 29, the image memory unit 4 includes two frame memories 41 and 42, and the digital image pickup signal from the data conversion unit 14 is first stored in the frame memory 41. When one frame elapses, the digital imaging signal stored in the frame memory 41 is transferred to the frame memory 42, and the digital imaging signal of a new frame from the data conversion unit 14 is written in the frame memory 41. It is. Accordingly, the frame memory 42 stores a frame image one frame before the frame image stored in the frame memory 41.

そして、手ぶれベクトル検出部15は、システムバス2を介して、これら2個のフレームメモリ41およびフレームメモリ42をアクセスして、その格納データを読み出し、前述したような、1フレーム当たり16個のSADテーブル生成処理、ブロック毎動きベクトル検出処理、合算SADテーブル生成処理、再合算SADテーブル生成処理、グローバル動きベクトル検出処理などの処理を実行する。この場合、フレームメモリ42に格納されているフレーム画像は、元フレームの画像とされ、また、フレームメモリ41に格納されているフレーム画像は、参照フレームの画像とされる。なお、実際には、フレームメモリ41と42とは、ダブルバッファとしてローテーションされる。   Then, the hand movement vector detecting unit 15 accesses the two frame memories 41 and 42 via the system bus 2, reads out the stored data, and has 16 SADs per frame as described above. Processing such as table generation processing, block-by-block motion vector detection processing, total SAD table generation processing, re-total SAD table generation processing, and global motion vector detection processing is executed. In this case, the frame image stored in the frame memory 42 is an original frame image, and the frame image stored in the frame memory 41 is a reference frame image. Actually, the frame memories 41 and 42 are rotated as a double buffer.

手ぶれベクトル検出部15は、その検出結果である手ぶれベクトル(グローバル動きベクトル)を、その後段の解像度変換部16に制御信号として伝達する。   The camera shake vector detection unit 15 transmits a camera shake vector (global motion vector) as a detection result to the resolution conversion unit 16 at the subsequent stage as a control signal.

解像度変換部16は、手ぶれベクトル検出部15から受け取った手ぶれベクトルにしたがって、フレームメモリ42に格納されている遅延フレームの画像データを切り出しながら、必要な解像度および画像サイズに変換する処理をする。このフレームメモリ42からの動きベクトルにしたがった切り出しにより、変換後の画像は、手ぶれが除去された画像となる。   The resolution conversion unit 16 performs a process of converting the image data of the delay frame stored in the frame memory 42 to a necessary resolution and image size in accordance with the camera shake vector received from the camera shake vector detection unit 15. By cutting out according to the motion vector from the frame memory 42, the image after conversion becomes an image from which camera shake is removed.

この解像度変換部16からの手ぶれが除去された画像データは、NTSC(National Television System Committee)エンコーダ18によりNTSC方式の標準カラー映像信号に変換され、電子式ビューファインダーを構成するモニターディスプレイ6に供給され、撮影時の画像がその表示画面にモニター表示される。   The image data from which the camera shake is removed from the resolution converting unit 16 is converted into an NTSC standard color video signal by an NTSC (National Television System Committee) encoder 18 and supplied to a monitor display 6 constituting an electronic viewfinder. The image at the time of shooting is displayed on the monitor screen.

このモニター表示と並行して、解像度変換部16からの手ぶれが除去された画像データはコーデック部17で記録変調などのコーディング処理された後、記録再生装置部5に供給されて、DVD(Digital Versatile Disc)などの光ディスクやハードディスクなどの記録媒体に記録される。   In parallel with this monitor display, the image data from which the camera shake from the resolution conversion unit 16 has been removed is subjected to coding processing such as recording modulation by the codec unit 17 and then supplied to the recording / reproducing device unit 5 to be a DVD (Digital Versatile). Disc) and the like on a recording medium such as an optical disk or a hard disk.

この記録再生装置部5の記録媒体に記録された撮像画像データは、ユーザ操作入力部3を通じた再生開始操作に応じて読み出され、コーデック部17に供給されて、再生デコードされる。そして、再生デコードされた画像データはNTSCエンコーダ18を通じてモニターディスプレイ6に供給され、再生画像がその表示画面に表示される。なお、図29では、図示を省略したが、NTSCエンコーダ18からの出力映像信号は、映像出力端子を通じて外部に導出することが可能とされている。   The captured image data recorded on the recording medium of the recording / reproducing apparatus unit 5 is read in response to a reproduction start operation through the user operation input unit 3, supplied to the codec unit 17, and reproduced and decoded. The reproduced and decoded image data is supplied to the monitor display 6 through the NTSC encoder 18, and the reproduced image is displayed on the display screen. Although not shown in FIG. 29, the output video signal from the NTSC encoder 18 can be derived to the outside through a video output terminal.

上述した手ぶれベクトル検出部15は、ハードウエアにより構成することできるし、また、DSP(Digital Signal Processor)を用いて構成することもできる。さらには、CPU1によりソフトウエア処理とすることもできる。また、ハードウエアやDSP処理と、CPU1によるソフトウエア処理との組み合わせとすることもできる。   The above-described camera shake vector detection unit 15 can be configured by hardware, or can be configured by using a DSP (Digital Signal Processor). Furthermore, software processing can be performed by the CPU 1. Also, a combination of hardware or DSP processing and software processing by the CPU 1 can be used.

[手ぶれベクトル検出部15における処理動作]
この手ぶれベクトル検出部15における処理動作の流れの一例を、図30および図31のフローチャートを参照して、以下に説明する。
[Processing Operation in Camera Shake Vector Detection Unit 15]
An example of the flow of processing operations in the camera shake vector detection unit 15 will be described below with reference to the flowcharts of FIGS.

なお、この図30および図31は、一つの参照フレームについての処理であり、この図30および図31の処理ルーチンが各参照フレームにおいて実行されるものである。この場合に、ステップS31の処理は、最初の参照フレームについて設定したら、その後の参照フレームにおいては省略することができる。   30 and 31 show processing for one reference frame, and the processing routine of FIGS. 30 and 31 is executed in each reference frame. In this case, if the process of step S31 is set for the first reference frame, it can be omitted in the subsequent reference frames.

まず、前述の図25に示したように、16個のターゲットブロックについての16個のサーチ範囲について、それぞれのターゲットブロックの中心位置を、それぞれのサーチ範囲の中心としてサーチ範囲のオフセットをゼロに設定すると共に、それぞれのサーチ範囲を、この実施形態において想定される最大範囲に設定する(図30のステップS31)。   First, as shown in FIG. 25, for the 16 search ranges for 16 target blocks, the center position of each target block is set to the center of each search range, and the search range offset is set to zero. In addition, each search range is set to the maximum range assumed in this embodiment (step S31 in FIG. 30).

次に、16個のターゲットブロックについて、それぞれ設定されたサーチ範囲において前述した縮小SADテーブルおよびブロック毎動きベクトルの算出処理を実行する(ステップS32)。このステップS32の詳細処理ルーチンは後述する。   Next, the above-described reduction SAD table and block-by-block motion vector calculation processing is executed for each of the 16 target blocks in the set search range (step S32). The detailed processing routine of step S32 will be described later.

そして、16個のターゲットブロックについての縮小SADテーブルの生成が終了すると、16個の縮小SADテーブルにおいて、図2に示した(式3)により、サーチ範囲のそれぞれで対応する参照ブロック位置のSAD値を合算する処理を行い、縮小SADテーブルと同一サイズである一つのサーチ範囲内の複数参照ブロック位置分の合算縮小SADテーブルを生成する(ステップS33)。   When the generation of the reduced SAD table for the 16 target blocks is completed, the SAD value of the reference block position corresponding to each of the search ranges in the 16 reduced SAD tables according to (Equation 3) shown in FIG. Is added to generate a combined reduced SAD table for a plurality of reference block positions within one search range having the same size as the reduced SAD table (step S33).

次に、生成した合算縮小SADテーブルにおいて、最小SAD値を検出し、検出した最小SAD値とその近傍の複数SAD値を用いて、前述した近似曲面補間の処理を行って、合算動きベクトルを算出する(ステップS34)。   Next, in the generated combined reduced SAD table, the minimum SAD value is detected, and the above-described approximate curved surface interpolation processing is performed using the detected minimum SAD value and a plurality of SAD values in the vicinity thereof to calculate the combined motion vector. (Step S34).

次に、ステップS34で算出された合算動きベクトルを基準にして、16個の縮小SADテーブルのSAD値と、ブロック毎動きベクトルとから、図4に示した条件の判定を行い、16個のターゲットブロックのそれぞれについてのSADテーブルについての前述したようなラベル付けおよび当該参照フレームについての合計スコアsum_scoreの算出処理を行い、算出されたそれらのラベル付け結果および合計スコアsum_scoreを保持する(ステップS35)。   Next, the conditions shown in FIG. 4 are determined from the SAD values of the 16 reduced SAD tables and the motion vectors for each block with reference to the combined motion vector calculated in step S34, and the 16 targets are determined. The labeling as described above for the SAD table for each of the blocks and the calculation process of the total score sum_score for the reference frame are performed, and the calculated labeling result and the total score sum_score are held (step S35).

次に、ステップS32で算出された16個のブロック毎動きベクトルについて多数決を取り(ステップS36)、多数決トップのブロック毎動きベクトルを基準にして、16個の縮小SADテーブルのSAD値と、ブロック毎動きベクトルとから、前述したような図4に対応する条件の判定を行い、16個のターゲットブロックのそれぞれについてのSADテーブルについての前述したようなラベル付けおよび当該参照フレームについての合計スコアmany_scoreの算出処理を行い、算出されたそれらのラベル付け結果および合計スコアmany_scoreを保持する(ステップS37)。   Next, a majority vote is taken for the 16 motion vectors per block calculated in step S32 (step S36), and based on the motion vector per block at the top of the majority vote, the SAD values of the 16 reduced SAD tables and each block The condition corresponding to FIG. 4 as described above is determined from the motion vector, and the labeling as described above for the SAD table for each of the 16 target blocks and the calculation of the total score many_score for the reference frame are performed. Processing is performed, and the calculated labeling result and the total score many_score are held (step S37).

そして、ステップS34で算出した合算動きベクトルと、ステップS36での多数決処理の結果、検出される多数決トップの動きベクトルとを比較し、両動きベクトルが縮小SADテーブル上の座標位置として、1隣接以内(座標位置が上下左右斜め方向に1位置しか違わない)であるか否か判別する(ステップS38)。   Then, the combined motion vector calculated in step S34 is compared with the motion vector of the majority vote detected as a result of the majority process in step S36, and both motion vectors are within one neighbor as coordinate positions on the reduced SAD table. It is determined whether or not the coordinate position is different in only one position in the diagonal direction (step S38).

ステップS38で、合算動きベクトルと多数決トップの動きベクトルとの差異が1隣接以内ではないと判別したときには、当該参照フレームのグローバル動きベクトルは信頼性が無いと判断して、当該参照フレームのグローバル動きベクトルは、手ぶれベクトルとはしないように、例えばグローバル動きベクトルがゼロとする(ステップS39)。そして、この処理ルーチンを終了する。   If it is determined in step S38 that the difference between the combined motion vector and the motion vector of the majority vote is not within one neighbor, it is determined that the global motion vector of the reference frame is not reliable, and the global motion of the reference frame is determined. For example, the global motion vector is set to zero so that the vector is not a camera shake vector (step S39). Then, this processing routine ends.

なお、ステップS39では、ゼロではなく、当該フレームのグローバル動きベクトルをその前フレームの参照フレームで算出されたグローバル動きベクトルと同一値とするようにしてもよい。   In step S39, instead of zero, the global motion vector of the frame may be set to the same value as the global motion vector calculated in the reference frame of the previous frame.

また、ステップS38で、合算動きベクトルと多数決トップの動きベクトルとの差異が1隣接以内であると判別したときには、ステップS35で求められた合計スコアsum_scoreが予め定められた所定の閾値θth1以上であり、かつ、ステップS37で求められた合計スコアmany_scoreが予め定められた所定の閾値θth2以上であるか否か判別する(図31のステップS41)。   If it is determined in step S38 that the difference between the combined motion vector and the motion vector of the majority vote is within one neighbor, the total score sum_score obtained in step S35 is equal to or greater than a predetermined threshold value θth1. And it is discriminate | determined whether the total score many_score calculated | required by step S37 is more than predetermined threshold value (theta) th2 (step S41 of FIG. 31).

ステップS41で、合計スコアsum_scoreおよび合計スコアmany_scoreの一方または両者が、閾値θth1および閾値θth2以上である条件を満足しなかったときには、ステップS39に進んで、当該参照フレームのグローバル動きベクトルは信頼性が無いと判断して、当該参照フレームのグローバル動きベクトルは、手ぶれベクトルとはしないように、例えばグローバル動きベクトルがゼロとする。そして、この処理ルーチンを終了する。   In step S41, when one or both of the total score sum_score and the total score many_score does not satisfy the condition of the threshold θth1 and the threshold θth2 or more, the process proceeds to step S39, and the global motion vector of the reference frame has reliability. For example, the global motion vector is set to zero so that the global motion vector of the reference frame is not a camera shake vector. Then, this processing routine ends.

また、ステップS41で、合計スコアsum_scoreおよび合計スコアmany_scoreの両者が、閾値θth1および閾値θth2以上である条件を満足したときには、ステップS35でラベル付けされたターゲットブロックに対するSADテーブルのうち、「TOP」および「NEXT_TOP」のラベルが付与されたSADテーブルのSAD値のみを用いて、合算SAD値を再算出し、合算縮小SADテーブルを再算出する(ステップS42)。   In step S41, when both the total score sum_score and the total score many_score satisfy the condition that the threshold θth1 and the threshold θth2 are equal to or larger than “TOP” and “TOP” in the SAD table for the target block labeled in step S35. The total SAD value is recalculated using only the SAD value of the SAD table labeled “NEXT_TOP”, and the total reduced SAD table is recalculated (step S42).

そして、再作成により求めた再合算縮小SADテーブルにおける最小SAD値の座標位置およびその近傍座標位置の複数個のSAD値を用いて近似曲面補間処理を行う(ステップS43)。この例では、図13を用いて説明した3×3個の矩形領域のテーブル要素を用いる近似曲面補間処理を実行する。   Then, approximate surface interpolation processing is performed using the coordinate position of the minimum SAD value and the plurality of SAD values in the vicinity of the coordinate position in the recombination reduced SAD table obtained by re-creation (step S43). In this example, the approximate curved surface interpolation process using the table elements of 3 × 3 rectangular areas described with reference to FIG. 13 is executed.

そして、この近似曲面補間処理の結果として検出される動きベクトルを、グローバル動きベクトルとして確保し、手ぶれベクトルとして、解像度変換部16に渡すようにする(ステップS44)。以上で、1つの参照フレームについての手ぶれベクトル検出部15における処理動作は終了となる。   Then, the motion vector detected as a result of the approximate curved surface interpolation process is secured as a global motion vector, and is passed to the resolution conversion unit 16 as a camera shake vector (step S44). Thus, the processing operation in the camera shake vector detection unit 15 for one reference frame is completed.

なお、図30および図31のフローチャートにおいて、ステップS31〜ステップS34までの処理を手ぶれベクトル検出部15で行い、それ以降の処理をCPU1がソフトウエアにより処理するように構成してもよい。その場合には、算出された手ぶれベクトルは、CPU1から解像度変換部16に供給される。あるいは、CPU1が、算出された手ぶれベクトルにしたがって、画像メモリ部4のフレームメモリ42に格納されている遅延フレームの画像データを切り出し(読み出し)をして、解像度変換部16に供給するようにしてもよい。   In the flowcharts of FIGS. 30 and 31, the camera shake vector detection unit 15 may perform the processing from step S31 to step S34, and the subsequent processing may be performed by software. In this case, the calculated camera shake vector is supplied from the CPU 1 to the resolution conversion unit 16. Alternatively, the CPU 1 cuts out (reads out) the image data of the delay frame stored in the frame memory 42 of the image memory unit 4 according to the calculated camera shake vector, and supplies it to the resolution conversion unit 16. Also good.

また、前述もしたように、手ぶれベクトル(グローバル動きベクトル)の検出に際しては、上述のようにしてグローバル動きベクトルを確保する処理手法に、さらに、従来から提案されている時間軸方向の動きベクトルの周波数から、グローバル動きベクトルを予測する手法を組み合わせることにより、更なる信頼性並びに精度の向上を図るようにしても良い。ただし、動画の場合には、処理時間が極めて短いことが要求されるため、注意が必要である。   In addition, as described above, when detecting a camera shake vector (global motion vector), a processing method for securing a global motion vector as described above is further added to a conventionally proposed motion vector in the time axis direction. Further reliability and accuracy may be improved by combining methods for predicting global motion vectors from frequencies. However, in the case of moving images, it is necessary to be careful because processing time is required to be extremely short.

また、上述の例では、再合成縮小SADテーブルは、ステップS35でラベル付けをした各ブロックのうちの「TOP」および「NEXT_TOP」のラベルが付与されたブロックの縮小SADテーブルのSAD値のみを用いるようにしたが、ステップS37でラベル付けした各ブロックのうちの「TOP」および「NEXT_TOP」のラベルが付与されたブロックの縮小SADテーブルのSAD値のみを用いるようにしても良いし、さらには、ステップS35とステップS37の両方でラベル付けをした各ブロックのうちの「TOP」および「NEXT_TOP」のラベルが付与されたブロックの縮小SADテーブルのSAD値を用いて、再合算縮小SADテーブルを生成するようにしても良い。   In the above-described example, the recombination reduction SAD table uses only the SAD values of the reduction SAD table of the blocks assigned with the labels “TOP” and “NEXT_TOP” among the blocks labeled in step S35. However, only the SAD value of the reduced SAD table of the blocks labeled “TOP” and “NEXT_TOP” among the blocks labeled in step S37 may be used. Of the blocks labeled in both step S35 and step S37, a recombination reduced SAD table is generated using the SAD values of the reduced SAD table of the blocks labeled “TOP” and “NEXT_TOP”. You may do it.

また、上述の例においては、各ブロック毎動きベクトルに付与したラベルに対応するスコアの合計sum_scoreおよびmany_scoreを、動きベクトルを算出している対象の参照フレームについてのグローバル動きベクトルの評価判定の一つの材料としたが、この合計スコアの代わりに、ブロック毎動きベクトルに付与されたラベルが「TOP」および「NEXT_TOP」の数が所定の閾値以上であるか否かを評価判定の材料とし、ラベルが「TOP」および「NEXT_TOP」の数が所定の閾値以上であれば、高評価であると判定するようにしても良い。   In the above example, the sums sum_score and many_score of the scores corresponding to the labels given to the motion vectors for each block are used as one of the global motion vector evaluation determinations for the reference frame for which the motion vector is calculated. However, instead of this total score, whether the label given to the motion vector for each block is “TOP” or “NEXT_TOP” is greater than or equal to a predetermined threshold value is used as an evaluation judgment material. If the number of “TOP” and “NEXT_TOP” is equal to or greater than a predetermined threshold, it may be determined that the evaluation is high.

[ステップS32の処理ルーチン例]
次に、図30のステップS32における各ターゲットブロックについての縮小SADテーブル生成処理およびブロック毎動きベクトル算出の処理ルーチンの例を説明する。
[Example of processing routine of step S32]
Next, an example of a reduced SAD table generation process and a block-by-block motion vector calculation process routine for each target block in step S32 of FIG. 30 will be described.

<第1の例>
図32および図33は、ステップS32における各ターゲットブロックについての縮小SADテーブルおよびブロック毎動きベクトル算出処理ルーチンの第1の例を示すものである。
<First example>
32 and 33 show a first example of the reduced SAD table and the block-by-block motion vector calculation processing routine for each target block in step S32.

先ず、前述の図25に示したようなサーチ範囲SR内の1つの参照ブロック位置に対応する参照ベクトル(vx、vy)を指定する(ステップS101)。前述したように、(vx,vy)は、ターゲットブロックのフレーム上の位置(サーチ範囲の中心位置である)を基準位置(0,0)としたときに、指定された参照ベクトルにより示される位置を示し、vxは指定された参照ベクトルによる、基準位置からの水平方向のずれ量成分であり、また、vyは指定された参照ベクトルによる、基準位置からの垂直方向成分のずれ量成分である。そして、前述の従来例で述べたのと同様に、ずれ量vx、vyは、画素を単位とした値とされている。   First, a reference vector (vx, vy) corresponding to one reference block position in the search range SR as shown in FIG. 25 is specified (step S101). As described above, (vx, vy) is a position indicated by the designated reference vector when the position on the frame of the target block (which is the center position of the search range) is the reference position (0, 0). Vx is a horizontal deviation component from the reference position due to the designated reference vector, and vy is a vertical deviation component from the reference position due to the designated reference vector. Similarly to the above-described conventional example, the shift amounts vx and vy are values in units of pixels.

ここで、サーチ範囲の中心位置を前記基準位置(0,0)とし、サーチ範囲を、水平方向には±Rx、垂直方向には±Ryとしたとき、
−Rx≦vx≦+Rx、−Ry≦vy≦+Ry
とされるものである。
Here, when the center position of the search range is the reference position (0, 0) and the search range is ± Rx in the horizontal direction and ± Ry in the vertical direction,
-Rx≤vx≤ + Rx, -Ry≤vy≤ + Ry
It is supposed to be.

次に、ターゲットブロックIo内の1つの画素の座標(x,y)を指定する(ステップS102)。次に、ターゲットブロックIo内の指定された1つの座標(x,y)の画素値Io(x,y)と、参照ブロックIi内の対応する画素位置の画素値Ii(x+vx,y+vy)との差分絶対値αを、前述した(式1)に示したようにして算出する(ステップS103)。
そして、算出した差分絶対値αを、当該参照ブロックIiの参照ベクトル(vx,vy)が指し示すアドレス(テーブル要素)の、それまでのSAD値に加算し、その加算であるSAD値を、当該アドレスに書き戻すようにする(ステップS104)。すなわち、参照ベクトル(vx,vy)に対応するSAD値を、SAD(vx,vy)と表したとき、これを、前述した(式2)、すなわち、
SAD(vx,vy)=Σα=Σ|Io(x,y)−Ii(x+vx,y+vy)|
・・・(式2)
として算出し、当該参照ベクトル(vx,vy)が指し示すアドレスに書き込むようにする。
Next, the coordinates (x, y) of one pixel in the target block Io are designated (step S102). Next, the pixel value Io (x, y) of one designated coordinate (x, y) in the target block Io and the pixel value Ii (x + vx, y + vy) of the corresponding pixel position in the reference block Ii The absolute difference value α is calculated as shown in (Equation 1) described above (step S103).
Then, the calculated absolute difference value α is added to the SAD value so far of the address (table element) indicated by the reference vector (vx, vy) of the reference block Ii, and the SAD value that is the addition is added to the address (Step S104). That is, when the SAD value corresponding to the reference vector (vx, vy) is expressed as SAD (vx, vy), this is expressed by the above-described (Equation 2), that is,
SAD (vx, vy) = Σα = Σ | Io (x, y) −Ii (x + vx, y + vy) |
... (Formula 2)
And written to the address indicated by the reference vector (vx, vy).

次に、ターゲットブロックIo内の全ての座標(x,y)の画素について、上記のステップS102〜ステップS104の演算を行なったか否かを判別し(ステップS105)、ターゲットブロックIo内の全ての座標(x,y)の画素については、未だ、その演算は終了していないと判別したときには、ステップS102に戻り、ターゲットブロックIo内の次の座標(x,y)の画素位置を指定し、このステップS102以降の処理を繰り返す。   Next, it is determined whether or not the above-described operations of Step S102 to Step S104 have been performed on all the coordinates (x, y) in the target block Io (Step S105), and all the coordinates in the target block Io are determined. For the pixel of (x, y), when it is determined that the calculation has not been completed yet, the process returns to step S102, and the pixel position of the next coordinate (x, y) in the target block Io is designated. The processes after step S102 are repeated.

以上のステップS101〜ステップS105までの処理は、図53に示したフローチャートのステップS1〜ステップS5と全く同様である。   The processing from step S101 to step S105 is exactly the same as step S1 to step S5 in the flowchart shown in FIG.

この実施形態では、ステップS105で、ターゲットブロックIo内の全ての座標(x,y)の画素について、上記の演算を行なったと判別したときには、縮小倍率を1/nとして、参照ベクトル(vx,vy)を1/nに縮小した参照縮小ベクトル(vx/n,vy/n)を算出する(ステップS106)。   In this embodiment, when it is determined in step S105 that the above calculation has been performed for all the pixels of the coordinates (x, y) in the target block Io, the reduction ratio is set to 1 / n, and the reference vector (vx, vy) is set. ) Is reduced to 1 / n, and a reference reduced vector (vx / n, vy / n) is calculated (step S106).

次いで、参照縮小ベクトル(vx/n,vy/n)の近傍の複数の参照ベクトル、この例では、上述したように4個の近傍参照ベクトルを検知する(ステップS107)。そして、検知した4個の近傍参照ベクトルのそれぞれに対応するテーブル要素として分散加算すべき値を、前述したように、参照縮小ベクトルと近傍参照ベクトルとがそれぞれ示す位置の関係に基いて、ステップS104で求めたSAD値から、線形加重分散値として求める(ステップS108)。そして、求めた4個の線形加重分散値を、近傍参照ベクトルのそれぞれに対応するSADテーブル要素値に加算する(ステップS109)。   Next, a plurality of reference vectors in the vicinity of the reference reduced vector (vx / n, vy / n), in this example, four neighboring reference vectors are detected as described above (step S107). Then, as described above, the values to be distributed and added as the table elements corresponding to the detected four neighboring reference vectors, as described above, based on the positional relationship indicated by the reference reduced vector and the neighboring reference vector, step S104. Is obtained as a linear weighted variance value from the SAD value obtained in step S108. Then, the obtained four linear weighted variance values are added to the SAD table element value corresponding to each of the neighborhood reference vectors (step S109).

このステップS109が終了すると、注目中の参照ブロックについてのSAD値の算出が終了したと判別して、サーチ範囲内の全ての参照ブロック、すなわち、全ての参照ベクトル(vx,vy)についての上記のステップS101からステップS109までの演算処理を完了したか否か判別する(図33のステップS111)。   When step S109 is completed, it is determined that the calculation of the SAD value for the reference block of interest has been completed, and the above-described processing is performed for all reference blocks in the search range, that is, all reference vectors (vx, vy). It is determined whether or not the arithmetic processing from step S101 to step S109 has been completed (step S111 in FIG. 33).

ステップS111で、未だ、上記の演算処理を完了していない参照ベクトル(vx,vy)があると判別すると、ステップS101に戻り、上記の演算処理を完了していない次の参照ベクトル(vx,vy)を設定して、このステップS101以降の処理を繰り返す。   If it is determined in step S111 that there is a reference vector (vx, vy) for which the above arithmetic processing has not yet been completed, the process returns to step S101, and the next reference vector (vx, vy) for which the above arithmetic processing has not been completed. ) Is set, and the processes after step S101 are repeated.

そして、ステップS111で、上記の演算処理を完了していない参照ベクトル(vx,vy)はサーチ範囲内になくなったと判別すると、縮小SADテーブルが完成したとして、当該完成した縮小SADテーブルにおいて、最小値となっているSAD値を検出する(ステップS112)。   If it is determined in step S111 that the reference vector (vx, vy) for which the above arithmetic processing has not been completed is no longer in the search range, it is determined that the reduced SAD table is completed, and the minimum value is determined in the completed reduced SAD table. The SAD value is detected (step S112).

次に、当該最小値となっているテーブル要素アドレス(mx,my)のSAD値(最小値)と、その近傍の複数個、この例では、上述したように15個の近傍テーブル要素のSAD値を用いて2次曲面を生成し(ステップS113)、その2次曲面の最小値のSAD値が対応する小数精度の位置を示す最小値ベクトル(px,py)を算出する(ステップS114)。この最小値ベクトル(px,py)は、小数精度の最小テーブル要素アドレスに対応している。   Next, the SAD value (minimum value) of the table element address (mx, my) having the minimum value and a plurality of neighboring SAD values, in this example, the SAD values of 15 neighboring table elements as described above. Is used to generate a quadric surface (step S113), and a minimum value vector (px, py) indicating the position of decimal precision corresponding to the minimum SAD value of the quadric surface is calculated (step S114). The minimum value vector (px, py) corresponds to the minimum table element address with decimal precision.

そして、算出した小数精度の位置を示す最小値ベクトル(px,py)をn倍することにより、求めるべく動きベクトル(px×n,py×n)を算出する(ステップS115)。   Then, the motion vector (px × n, py × n) is calculated to be obtained by multiplying the calculated minimum value vector (px, py) indicating the position of decimal precision by n (step S115).

以上で、1つのターゲットブロックに対する、この実施形態におけるブロックマッチングによる動きベクトルの検出処理は、終了となる。図25に示したような、1フレームについて設定した複数個、この例では、16個のターゲットブロックについての縮小SADテーブルおよび動きベクトルを検出する場合、対象とするターゲットブロックを変える毎に、サーチ範囲および縮小倍率1/nを再設定して、上述の図32および図33に示した処理を、各分割領域について繰り返すものである。   This completes the motion vector detection processing by block matching in this embodiment for one target block. As shown in FIG. 25, when detecting a reduced SAD table and motion vectors for a plurality of target frames set in one frame, in this example, 16 target blocks, the search range is changed every time the target block is changed. Then, the reduction ratio 1 / n is reset, and the processes shown in FIGS. 32 and 33 are repeated for each divided region.

なお、小数精度の位置を示す最小値ベクトル(px,py)を算出する方法としては、前述した水平方向および垂直方向の3次曲線を用いる方法を用いても良いことは言うまでもない。   Needless to say, as a method of calculating the minimum value vector (px, py) indicating the position of decimal precision, the above-described method using the cubic curves in the horizontal direction and the vertical direction may be used.

なお、図32および図33のフローチャートにおいて、ステップS101〜ステップS111までの処理を手ぶれベクトル検出部15で行い、それ以降の処理をCPU1がソフトウエアにより処理するように構成してもよい。   In the flowcharts of FIGS. 32 and 33, the processing from step S101 to step S111 may be performed by the hand movement vector detection unit 15, and the subsequent processing may be performed by the CPU 1 by software.

<第2の例>
上述の第1の例においては、1つの参照ブロック(参照ベクトル)について、そのSAD値を求めた後、そのSAD値から、参照縮小ベクトルの近傍の複数参照ベクトルについての分散加算値を求め、分散加算処理を行なうようにした。
<Second example>
In the first example described above, after obtaining the SAD value for one reference block (reference vector), the variance addition value for a plurality of reference vectors in the vicinity of the reference reduced vector is obtained from the SAD value, and the variance is obtained. Addition processing was performed.

これに対して、この第2の例においては、参照ブロック内の各画素の、ターゲットブロックの画素との差分を検出したときに、その差分値から、参照縮小ベクトルの近傍の複数参照ベクトルについての分散加算値(SAD値ではなく差分値)を求め、求めた差分値を分散加算処理するようにする。この第2の例によれば、1つの参照ブロック内のすべての画素についての差分演算を終了したときには、縮小SADテーブルが生成されることになる。   On the other hand, in the second example, when a difference between each pixel in the reference block and a pixel in the target block is detected, the difference value is used to calculate a plurality of reference vectors in the vicinity of the reference reduced vector. A variance addition value (difference value, not SAD value) is obtained, and the obtained difference value is subjected to variance addition processing. According to the second example, when the difference calculation for all the pixels in one reference block is completed, a reduced SAD table is generated.

図34および図35は、この第2の例による動きベクトル検出処理のフローチャートを示すものである。   34 and 35 show a flowchart of the motion vector detection process according to the second example.

図34のステップS121〜ステップS123までの処理は、図32のステップS101〜ステップS103までの処理と全く同様であるので、ここでは、その詳細な説明は省略する。   The processing from step S121 to step S123 in FIG. 34 is exactly the same as the processing from step S101 to step S103 in FIG. 32, and therefore detailed description thereof is omitted here.

この第2の例においては、ステップS123で、座標(x,y)の画素についての参照ブロックとターゲットブロック間での差分値αが算出すると、次には、縮小倍率を1/nとして、参照ベクトル(vx,vy)を1/nに縮小した参照縮小ベクトル(vx/n,vy/n)を算出する(ステップS124)。   In this second example, when the difference value α between the reference block and the target block for the pixel at the coordinate (x, y) is calculated in step S123, the reference is made with a reduction ratio of 1 / n. A reference reduced vector (vx / n, vy / n) obtained by reducing the vector (vx, vy) to 1 / n is calculated (step S124).

次に、参照縮小ベクトル(vx/n,vy/n)の近傍の複数の参照ベクトル、この例では、上述したように4個の近傍参照ベクトルを検知する(ステップS125)。そして、検知した4個の近傍参照ベクトルのそれぞれに対応するテーブル要素として分散加算すべき差分値を、前述したように、ステップS123で求めた差分値αから、参照縮小ベクトルと近傍参照ベクトルとがそれぞれ示す位置の関係に基いて、線形加重分散値(差分値)として求める(ステップS126)。   Next, a plurality of reference vectors in the vicinity of the reference reduced vector (vx / n, vy / n), in this example, four neighboring reference vectors are detected as described above (step S125). Then, the difference value to be distributed and added as a table element corresponding to each of the detected four neighboring reference vectors is converted into the reference reduced vector and the neighboring reference vector from the difference value α obtained in step S123 as described above. Based on the positional relationship shown, a linear weighted variance value (difference value) is obtained (step S126).

そして、求めた4個の線形加重分散値を、近傍参照ベクトルのそれぞれに対応するテーブル要素値に加算する(ステップS127)。   Then, the obtained four linear weighted variance values are added to the table element values corresponding to the neighborhood reference vectors (step S127).

このステップS127が終了したら、ターゲットブロックIo内の全ての座標(x,y)の画素について、上記のステップS122〜ステップS127の演算を行なったか否かを判別し(ステップS128)、ターゲットブロックIo内の全ての座標(x,y)の画素については、未だ、その演算は終了していないと判別したときには、ステップS122に戻り、ターゲットブロックIo内の次の座標(x,y)の画素位置を指定し、このステップS122以降の処理を繰り返す。   When step S127 is completed, it is determined whether or not the calculations of steps S122 to S127 have been performed for all the coordinates (x, y) in the target block Io (step S128). When it is determined that the calculation has not been completed for all the pixels of the coordinates (x, y), the process returns to step S122, and the pixel position of the next coordinates (x, y) in the target block Io is determined. The process after step S122 is repeated.

ステップS128で、ターゲットブロックIo内の全ての座標(x,y)の画素について、上記の演算を行なったと判別したときには、注目中の参照ブロックについてのSAD値の算出が終了したと判別して、サーチ範囲内の全ての参照ブロック、すなわち、全ての参照ベクトル(vx,vy)についての上記のステップS121からステップS128までの演算処理を完了したか否か判別する(図35のステップS131)。   When it is determined in step S128 that the above calculation has been performed for all the pixels of the coordinates (x, y) in the target block Io, it is determined that the calculation of the SAD value for the reference block being noticed is completed, It is determined whether or not the arithmetic processing from step S121 to step S128 has been completed for all reference blocks in the search range, that is, all reference vectors (vx, vy) (step S131 in FIG. 35).

ステップS131で、未だ、上記の演算処理を完了していない参照ベクトル(vx,vy)があると判別すると、ステップS121に戻り、上記の演算処理を完了していない次の参照ベクトル(vx,vy)を設定して、このステップS121以降の処理を繰り返す。   If it is determined in step S131 that there is a reference vector (vx, vy) for which the above arithmetic processing has not yet been completed, the process returns to step S121, and the next reference vector (vx, vy) for which the above arithmetic processing has not been completed. ) Is set, and the processes after step S121 are repeated.

そして、ステップS121で、上記の演算処理を完了していない参照ベクトル(vx,vy)はサーチ範囲内になくなったと判別すると、縮小SADテーブルが完成したとして、当該完成した縮小SADテーブルにおいて、最小値となっているSAD値を検出する(ステップS132)。   If it is determined in step S121 that the reference vector (vx, vy) for which the above arithmetic processing has not been completed is no longer in the search range, it is determined that the reduced SAD table has been completed. In the completed reduced SAD table, the minimum value The SAD value is detected (step S132).

次に、当該最小値となっているテーブル要素アドレス(mx,my)のSAD値(最小値)と、その近傍の複数個、この例では、上述したように15個の近傍テーブル要素のSAD値を用いて2次曲面を生成し(ステップS133)、その2次曲面の最小値のSAD値が対応する小数精度の位置を示す最小値ベクトル(px,py)を算出する(ステップS134)。この最小値ベクトル(px,py)は、小数精度の最小テーブル要素アドレスに対応している。   Next, the SAD value (minimum value) of the table element address (mx, my) having the minimum value and a plurality of neighboring SAD values, in this example, the SAD values of 15 neighboring table elements as described above. Is used to generate a quadric surface (step S133), and a minimum value vector (px, py) indicating the position of decimal precision corresponding to the minimum SAD value of the quadric surface is calculated (step S134). The minimum value vector (px, py) corresponds to the minimum table element address with decimal precision.

そして、算出した小数精度の位置を示す最小値ベクトル(px,py)をn倍することにより、求めるべく動きベクトル(px×n,py×n)を算出する(ステップS135)。   Then, the motion vector (px × n, py × n) is calculated to be obtained by multiplying the calculated minimum value vector (px, py) indicating the decimal precision position by n (step S135).

以上で、1つのターゲットブロックに対する、この第2の例におけるブロックマッチングによる動きベクトルの検出処理は、終了となる。図25に示したような、1フレームについて設定した複数個、この例では、16個のターゲットブロックについての縮小SADテーブルおよび動きベクトルを検出する場合、対象とするターゲットブロックを変える毎に、サーチ範囲および縮小倍率1/nを再設定して、上述の図34および図35に示した処理を、各分割領域について繰り返すものである。   This completes the motion vector detection process by block matching in the second example for one target block. As shown in FIG. 25, when detecting a reduced SAD table and motion vectors for a plurality of target frames set in one frame, in this example, 16 target blocks, the search range is changed every time the target block is changed. Then, the reduction ratio 1 / n is reset, and the processing shown in FIGS. 34 and 35 is repeated for each divided region.

なお、この第2の例においても、小数精度の位置を示す最小値ベクトル(px,py)を算出する方法としては、前述した水平方向および垂直方向の3次曲線を用いる方法を用いても良いことは言うまでもない。   In the second example as well, as a method of calculating the minimum value vector (px, py) indicating the position of decimal precision, the method using the above-described cubic curves in the horizontal direction and the vertical direction may be used. Needless to say.

なお、図34および図35のフローチャートにおいて、ステップS121〜ステップS131までの処理を手ぶれベクトル検出部15で行い、それ以降の処理をCPU1がソフトウエアにより処理するように構成してもよい。   In the flowcharts of FIGS. 34 and 35, the processing from step S121 to step S131 may be performed by the camera shake vector detection unit 15, and the subsequent processing may be performed by the CPU 1 by software.

<第3の例>
図24に示したように、この実施形態による動きベクトルの検出手法を用いた場合には、参照ベクトルの縮小倍率が1/64の場合でも、全く異なる動きベクトルを出力するような破綻は見られないことから、実質的に1/4096に、SADテーブルを削減可能である。
<Third example>
As shown in FIG. 24, when the motion vector detection method according to this embodiment is used, even when the reduction ratio of the reference vector is 1/64, there is a failure to output a completely different motion vector. Therefore, it is possible to reduce the SAD table to substantially 1/404096.

つまり、1/4096に削減した縮小SADテーブルを用意しておき、縮小倍率1/64で1回目の動きベクトルを検出する。次に、1回目で検出したその動きベクトルを中心にしてサーチ範囲を狭め、2回目の検出を、1回目よりも小さい例えば縮小倍率1/8で行なうようにすればよい。すなわち、1回目と2回目とで縮小倍率を変えて、1回目のベクトル誤差範囲内に収まるように、2回目の縮小倍率を設定すれば、かなりの高精度で、動きベクトル検出が可能である。   That is, a reduced SAD table reduced to 1/4096 is prepared, and the first motion vector is detected at a reduction ratio of 1/64. Next, the search range may be narrowed around the motion vector detected at the first time, and the second detection may be performed at a reduction magnification of 1/8, for example, which is smaller than the first time. That is, if the reduction ratio is changed between the first and second times and the second reduction ratio is set so as to be within the first vector error range, the motion vector can be detected with considerably high accuracy. .

この第3の例の場合における動きベクトル検出処理を、図36〜図39のフローチャートを参照しながら説明する。   The motion vector detection process in the case of the third example will be described with reference to the flowcharts of FIGS.

この図36〜図39に示す第3の例は、基本的な動き検出処理として上述した第1の例を用いている。したがって、図36のステップS141〜ステップS149の処理ステップおよび図37のステップS151〜ステップS155までの処理ステップは、図32のステップS101〜ステップS109の処理ステップおよび図33のステップS111〜ステップS115までの処理ステップと全く同様である。   The third example shown in FIGS. 36 to 39 uses the first example described above as the basic motion detection process. Therefore, the processing steps from step S141 to step S149 in FIG. 36 and the processing steps from step S151 to step S155 in FIG. 37 are the processing steps from step S101 to step S109 in FIG. 32 and from step S111 to step S115 in FIG. It is exactly the same as the processing step.

この第3の例においては、図37のステップS155で動きベクトルを算出したら、そこで処理を終了するのではなく、当該ステップS155で算出した動きベクトルは、1回目の動きベクトルとして、次のステップS156において、この1回目で算出した動きベクトルに基づき、同じ参照フレーム内で、サーチ範囲を絞り、また、参照ベクトルの縮小倍率を、1回目の縮小倍率1/naよりも小さい縮小倍率1/nb(ここで、na>nbである)に変更する。   In the third example, when the motion vector is calculated in step S155 of FIG. 37, the process is not ended there, but the motion vector calculated in step S155 is used as the first motion vector, and the next step S156 is performed. , The search range is narrowed down within the same reference frame based on the motion vector calculated in the first time, and the reduction ratio of the reference vector is reduced to a reduction ratio 1 / nb (less than the first reduction ratio 1 / na). Here, na> nb).

すなわち、図40に示すように、1回目の処理で設定されたサーチ範囲SR_1において、ターゲットブロックTBについての動きベクトルBLK_Viが算出されると、その算出された動きベクトルBLK_Viから、参照フレームと元フレームとの間で、相関のあるブロック範囲がおおよそ検出できる。そこで、2回目の処理のサーチ範囲SR_2としては、図40の下側に示すように、その相関のあるブロック範囲を中心とした、絞ったサーチ範囲を設定することができる。この場合、図40に示すように、1回目のサーチ範囲SR_1の中心位置POi_1と、2回目のサーチ範囲SR_2の中心位置POi_2との間の位置ずれ(サーチ範囲オフセット)が、1回目で検出された動きベクトルBLK_Viに相当している。   That is, as shown in FIG. 40, when the motion vector BLK_Vi for the target block TB is calculated in the search range SR_1 set in the first process, the reference frame and the original frame are calculated from the calculated motion vector BLK_Vi. A correlated block range can be roughly detected. Therefore, as the search range SR_2 for the second processing, as shown in the lower side of FIG. 40, a narrowed search range centered on the correlated block range can be set. In this case, as shown in FIG. 40, a position shift (search range offset) between the center position POi_1 of the first search range SR_1 and the center position POi_2 of the second search range SR_2 is detected at the first time. Corresponds to the motion vector BLK_Vi.

そして、この実施形態では、さらに、1回目よりも参照ベクトルに対する縮小倍率を小さくすることで、より誤差の少ない状態で、2回目の動きベクトルの算出が可能になると期待できる。   Further, in this embodiment, it can be expected that the second motion vector can be calculated with a smaller error by reducing the reduction ratio with respect to the reference vector than the first time.

こうして、ステップS156で、絞ったサーチ範囲を設定し、新たな縮小倍率を設定したら、1回目と全く同様にして、2回目の動きベクトルの検出処理を、ステップS157〜ステップS158、図38のステップS161〜ステップS168、さらに、図39のステップS171〜ステップS174により実行する。これらのステップの処理は、図32のステップS101〜ステップS109の処理ステップおよび図33のステップS111〜ステップS115までの処理ステップと全く同様である。   In this way, when the narrowed search range is set in step S156 and a new reduction ratio is set, the second motion vector detection process is performed in the same manner as in the first time, in steps S157 to S158 and the steps in FIG. The process is executed in steps S161 to S168 and steps S171 to S174 in FIG. The processing in these steps is exactly the same as the processing steps in steps S101 to S109 in FIG. 32 and the processing steps in steps S111 to S115 in FIG.

こうして、最終的に、ステップS174において、2回目の動きベクトルとして、目的とするブロック毎動きベクトルが得られる。   Thus, finally, in step S174, the target motion vector for each block is obtained as the second motion vector.

以上の例は、ブロック毎動きベクトルの検出方法として、前述した第1の例を用い、それを2段階、繰り返した場合であるが、サーチ範囲をさらに絞り、かつ、必要に応じて縮小倍率を変更しながら、2段階以上、繰り返すようにしても、勿論良い。   The above example is a case where the above-described first example is used as the motion vector detection method for each block and is repeated in two stages. The search range is further narrowed down, and the reduction ratio is set as necessary. Of course, it is possible to repeat two or more stages while changing.

また、ブロック毎動きベクトルの検出方法としては、前述した第1の例の代わりに、前述した第2の例を用いることができることは言うまでもない。また、小数精度の位置を示す最小値ベクトル(px,py)を算出する方法としては、前述した水平方向および垂直方向の3次曲線を用いる方法を用いても良いことは前述の例と同様である。   Further, it goes without saying that the second example described above can be used instead of the first example described above as a method for detecting the motion vector for each block. Further, as a method for calculating the minimum value vector (px, py) indicating the position of decimal precision, the method using the above-described horizontal and vertical cubic curves may be used as in the above example. is there.

なお、図36〜図39のフローチャートにおいて、ステップS141〜ステップS168までの処理を手ぶれベクトル検出部15で行い、それ以降の処理をCPU1がソフトウエアにより処理するように構成してもよい。   36 to 39, the processing from step S141 to step S168 may be performed by the camera shake vector detection unit 15, and the subsequent processing may be performed by the CPU 1 by software.

[画像処理装置の第2の実施形態]
上述した画像処理装置の第1の実施形態としての撮像装置における手ぶれベクトル検出部15においては、図29に示したように、画像メモリ部4は、2枚の画像、つまり元フレームの画像と、参照フレームの画像とが、両方共、フレームメモリに格納されていることを前提にしていた。このため、動きベクトルの検出タイミングは、1フレーム分遅延されることとなる。
[Second Embodiment of Image Processing Apparatus]
In the camera shake vector detection unit 15 in the imaging apparatus as the first embodiment of the image processing apparatus described above, as shown in FIG. 29, the image memory unit 4 includes two images, that is, an image of the original frame, It was assumed that both of the reference frame images were stored in the frame memory. For this reason, the motion vector detection timing is delayed by one frame.

これに対して、この第2の実施形態では、撮像素子11からの垂れ流し画像データを参照フレームとする構成として、ラスタスキャンのストリームデータに対して、リアルタイムでSAD値を演算することができるようにしている。   On the other hand, in the second embodiment, the sagging image data from the image sensor 11 is used as a reference frame so that the SAD value can be calculated in real time for the raster scan stream data. ing.

図41に、この第2の実施形態の場合における撮像装置の構成例のブロック図を示す。この図41から分かるように、撮像信号処理系10の構成ブロックおよびその他の構成ブロックは、図29に示した第1の実施形態と全く同様であるが、この第2の実施形態においては、画像メモリ部4は1個のフレームメモリ43からなる。なお、実際的には、書き込みと読み出しとが同時にできないフレームメモリを用いる場合、フレームメモリ43は、周知のように、2枚のフレームメモリを、書き込みと、読み出しで1フレーム毎に交互に切り替えて用いるものである。   FIG. 41 shows a block diagram of a configuration example of the imaging apparatus in the case of the second embodiment. As can be seen from FIG. 41, the constituent blocks of the imaging signal processing system 10 and other constituent blocks are the same as those in the first embodiment shown in FIG. 29. In this second embodiment, however, the image The memory unit 4 is composed of one frame memory 43. In practice, when a frame memory that cannot be written and read simultaneously is used, the frame memory 43 switches two frame memories alternately for writing and reading every frame as is well known. It is what is used.

この第2の実施形態では、元フレームがフレームメモリ43に格納されており、参照フレームは、データ変換部14からストリームで入力されて来るものとされる。手ぶれベクトル検出部15は、第1の実施形態では、2個のフレームメモリ41,42に格納された2枚の画像データを用いて、参照ブロックについてのSAD値を求める処理をするようにした。これに対して、この第2の実施形態では、図41に示すように、データ変換部14からのストリーム画像データを参照フレームの画像データとすると共に、フレームメモリ43に格納されている画像データを元フレームの画像データとして、参照ブロックについてのSAD値を求めるようにする。   In the second embodiment, the original frame is stored in the frame memory 43, and the reference frame is input from the data converter 14 as a stream. In the first embodiment, the camera shake vector detection unit 15 uses the two pieces of image data stored in the two frame memories 41 and 42 to perform processing for obtaining the SAD value for the reference block. On the other hand, in the second embodiment, as shown in FIG. 41, the stream image data from the data conversion unit 14 is used as the image data of the reference frame, and the image data stored in the frame memory 43 is changed. The SAD value for the reference block is obtained as the image data of the original frame.

そして、解像度変換部16は、フレームメモリ43からの画像データの切り出しを、手ぶれベクトル検出部15で検出された動きベクトルに基づいて行なうことで、手ぶれの無い画像データを出力するようにしている。その他の構成および動作は、第1の実施形態と同様である。   Then, the resolution conversion unit 16 outputs image data free from camera shake by cutting out image data from the frame memory 43 based on the motion vector detected by the camera shake vector detection unit 15. Other configurations and operations are the same as those in the first embodiment.

上述したように、この第2の実施形態では、データ変換部14からのストリーム画像データを参照フレームの画像データとする。このため、ある入力画素に対して、この画素を要素とする参照ブロックが、参照フレーム上に同時に複数存在することになる。図42は、そのことを説明するための図である。   As described above, in the second embodiment, the stream image data from the data converter 14 is used as the image data of the reference frame. For this reason, for a certain input pixel, a plurality of reference blocks having this pixel as an element simultaneously exist on the reference frame. FIG. 42 is a diagram for explaining this.

すなわち、参照フレーム102上のサーチ範囲105における入力画素Dinは、例えば、参照ベクトル1071が対応する参照ブロック1061の左側に位置する画素であると共に、参照ベクトル1072が対応する参照ブロック1062の右上に位置する画素となっていることが、この図42から分かる。   That is, the input pixel Din in the search range 105 on the reference frame 102 is, for example, a pixel located on the left side of the reference block 1061 to which the reference vector 1071 corresponds, and is located on the upper right side of the reference block 1062 to which the reference vector 1072 corresponds. It can be seen from FIG.

したがって、入力画素Dinが参照ブロック1061に属するとした場合には、ターゲットブロック103の画素D1を読み出して、その差分を算出する必要がある。また、入力画素Dinが参照ブロック1062に属するとした場合には、ターゲットブロック103の画素D2を読み出して、その差分を算出する必要がある。   Therefore, if the input pixel Din belongs to the reference block 1061, it is necessary to read out the pixel D1 of the target block 103 and calculate the difference. If the input pixel Din belongs to the reference block 1062, it is necessary to read out the pixel D2 of the target block 103 and calculate the difference.

図42および後述の図43では簡単のため、2つの参照ブロックのみを図示しているが、実際上は、入力画素Dinを、その参照ブロック内の画素とする参照ブロックは多数となる。   For simplicity, only two reference blocks are shown in FIG. 42 and FIG. 43 to be described later. In practice, however, there are a large number of reference blocks in which the input pixel Din is a pixel in the reference block.

この第2の実施形態の場合のSAD演算は、入力画素Dinの輝度値Yと、各々の参照ブロック内の入力画素Dinの位置に対応した、ターゲットブロック内の画素の輝度値Yとの差分絶対値を算出し、その算出した差分絶対値を、それぞれの参照ブロックに対応した参照ベクトルに従って、SADテーブルに加算してゆくようにして行なう。   The SAD calculation in the case of the second embodiment is the absolute difference between the luminance value Y of the input pixel Din and the luminance value Y of the pixel in the target block corresponding to the position of the input pixel Din in each reference block. A value is calculated, and the calculated absolute difference value is added to the SAD table according to the reference vector corresponding to each reference block.

例えば、入力画素Dinが参照ブロック1061に属するとした場合における、ターゲットブロック103の画素D1と入力画素Dinとの差分絶対値は、図43に示すように、SADテーブル108の参照ベクトル1071が対応するSADテーブル要素1092のSAD値に加算して書き込むようにする。また、入力画素Dinが参照ブロック1062に属するとした場合における、ターゲットブロック103の画素D2と入力画素Dinとの差分絶対値は、図43に示すように、SADテーブル108の参照ベクトル1072が対応するSADテーブル要素1092のSAD値に加算して書き込むようにする。   For example, when the input pixel Din belongs to the reference block 1061, the absolute difference value between the pixel D1 of the target block 103 and the input pixel Din corresponds to the reference vector 1071 of the SAD table 108 as shown in FIG. It is added to the SAD value of the SAD table element 1092 and written. Further, when the input pixel Din belongs to the reference block 1062, the absolute difference value between the pixel D2 of the target block 103 and the input pixel Din corresponds to the reference vector 1072 of the SAD table 108 as shown in FIG. It is added to the SAD value of the SAD table element 1092 and written.

したがって、サーチ範囲内の全ての領域の入力画素が入力されて処理が終了したときには、SADテーブルが完成することになる。   Accordingly, when the input pixels of all the regions within the search range are input and the processing is completed, the SAD table is completed.

図43の説明は、従来手法に、リアルタイムSAD算出処理を適用した場合である。この第2の実施形態においては、図43において、SADテーブル108の参照ベクトル1071または1072が対応するSADテーブル要素1091または1092のSAD値として、算出した差分絶対値のそれぞれを、加算して書き込むのではなく、前述した第1の実施形態のように、参照ベクトル1071,1072を縮小倍率1/nで縮小した参照縮小ベクトルを算出し、その参照縮小ベクトルの近傍の複数の参照ベクトルに、前記算出した差分絶対値から、それぞれを分散加算するための分散加算値を求め、求めた分散加算値を、前記近傍の複数の参照ベクトルに対応するSAD値に加算するようにするものである。   The description of FIG. 43 is a case where real-time SAD calculation processing is applied to the conventional method. In the second embodiment, in FIG. 43, each calculated absolute difference value is added and written as the SAD value of the SAD table element 1091 or 1092 to which the reference vector 1071 or 1072 of the SAD table 108 corresponds. Instead, as in the first embodiment described above, a reference reduced vector obtained by reducing the reference vectors 1071 and 1072 with the reduction ratio 1 / n is calculated, and the calculation is performed on a plurality of reference vectors in the vicinity of the reference reduced vector. From the absolute difference values thus obtained, variance addition values for variance addition are obtained, and the obtained variance addition values are added to SAD values corresponding to the plurality of neighboring reference vectors.

SADテーブル(縮小SADテーブル)が完成した後の正確な動きベクトルを検出するための処理は、この第2の実施形態においても、前述した第1の実施形態で述べた手法と全く同様にして、2次曲面や、水平方向および垂直方向の3次曲線を用いた手法を用いることができる。   The process for detecting an accurate motion vector after the SAD table (reduced SAD table) is completed is the same as that described in the first embodiment in the second embodiment. A technique using a quadric surface or a cubic curve in the horizontal direction and the vertical direction can be used.

この第2の実施形態の場合の手ぶれベクトル検出部15における、前記図30のステップS32における各ターゲットブロックについての縮小SADテーブル生成処理およびブロック毎動きベクトル検出処理の動作のフローチャートを図44および図45に示す。   FIG. 44 and FIG. 45 are flowcharts of operations of the reduced SAD table generation process and the block-by-block motion vector detection process for each target block in step S32 of FIG. 30 in the camera shake vector detection unit 15 in the case of the second embodiment. Shown in

先ず、手ぶれベクトル検出部15では、入力画像のフレーム(参照フレーム)の任意の位置(x,y)の画素データDin(x,y)を受け取る(ステップS181)。次に、当該画素の位置(x,y)を含む複数の参照ブロックの一つに対応する参照ベクトル(vx,vy)を設定する(ステップS182)。   First, the hand movement vector detection unit 15 receives pixel data Din (x, y) at an arbitrary position (x, y) in the frame (reference frame) of the input image (step S181). Next, a reference vector (vx, vy) corresponding to one of a plurality of reference blocks including the position (x, y) of the pixel is set (step S182).

次に、設定された参照ベクトル(vx,vy)の参照ブロックIiの当該画素値Ii(x,y)と、これに対応するターゲットブロックIo内の画素値Io(x−vx,y−vy)との差分の絶対値αを算出する(ステップS183)。すなわち、差分絶対値αは、
α=|Io(x−vx,y−vy)−Ii(x,y)| ・・・(式4)
として算出される。
Next, the pixel value Ii (x, y) of the reference block Ii of the set reference vector (vx, vy) and the corresponding pixel value Io (x-vx, y-vy) in the target block Io Is calculated (step S183). That is, the difference absolute value α is
α = | Io (x−vx, y−vy) −Ii (x, y) | (Expression 4)
Is calculated as

次に、縮小倍率を1/nとして、参照ベクトル(vx,vy)を1/nに縮小した参照縮小ベクトル(vx/n,vy/n)を算出する(ステップS184)。   Next, a reference reduction vector (vx / n, vy / n) is calculated by reducing the reference vector (vx, vy) to 1 / n with a reduction ratio of 1 / n (step S184).

次いで、参照縮小ベクトル(vx/n,vy/n)の近傍の複数の参照ベクトル、この例では、上述したように4個の近傍参照ベクトルを検知する(ステップS185)。そして、検知した4個の近傍参照ベクトルのそれぞれに対応するテーブル要素として分散加算すべき値(差分絶対値)を、前述したように、参照縮小ベクトルと近傍参照ベクトルとがそれぞれ示す位置の関係に基いて、ステップS183で求めた差分絶対値αから、線形加重分散値として求める(ステップS186)。そして、求めた4個の線形加重分散値を、近傍参照ベクトルのそれぞれに対応するSADテーブル要素値に加算する(ステップS187)。   Next, a plurality of reference vectors in the vicinity of the reference reduced vector (vx / n, vy / n), in this example, four neighboring reference vectors are detected as described above (step S185). Then, the values (difference absolute values) to be distributed and added as table elements corresponding to each of the detected four neighboring reference vectors are in the positional relationship indicated by the reference reduced vector and the neighboring reference vector as described above. Based on the difference absolute value α obtained in step S183, a linear weighted variance value is obtained (step S186). Then, the obtained four linear weighted variance values are added to the SAD table element values corresponding to each of the neighborhood reference vectors (step S187).

次に、入力画素Din(x,y)を含む参照ブロックの全てについての上記ステップS182〜ステップS187の演算を行なったか否か判別し(ステップS188)、当該入力画素Din(x,y)を含む他の参照ブロックがあると判別したときには、ステップS182に戻り、当該入力画素Dinを含む他の参照ブロック(vx,vy)を設定し、このステップS182〜ステップS187の処理を繰り返す。   Next, it is determined whether or not the calculations in steps S182 to S187 have been performed for all the reference blocks including the input pixel Din (x, y) (step S188), and the input pixel Din (x, y) is included. When it is determined that there is another reference block, the process returns to step S182, another reference block (vx, vy) including the input pixel Din is set, and the processing from step S182 to step S187 is repeated.

また、ステップS188で、入力画素Din(x,y)を含む参照ブロックの全てについての上記ステップS182〜ステップS187の演算を行なったと判別したときには、サーチ範囲内の全ての入力画素Dinについて、上記の演算ステップの処理を終了したか否か判別し(図45のステップS191)、終了していないと判別したときには、ステップS181に戻り、サーチ範囲内の次の入力画素Dinを取り込み、このステップS181以降の処理を繰り返す。   When it is determined in step S188 that the calculations in steps S182 to S187 have been performed for all the reference blocks including the input pixel Din (x, y), the above-described processing is performed for all the input pixels Din in the search range. It is determined whether or not the processing of the calculation step has been completed (step S191 in FIG. 45). If it is determined that the processing has not ended, the process returns to step S181, and the next input pixel Din within the search range is fetched. Repeat the process.

そして、ステップS191で、サーチ範囲内の全ての入力画素Dinについて、上記の演算ステップの処理を終了したと判別すると、縮小SADテーブルが完成したとして、当該完成した縮小SADテーブルにおいて、最小値となっているSAD値を検出する(ステップS192)。   If it is determined in step S191 that the processing of the above-described calculation step has been completed for all input pixels Din within the search range, the reduced SAD table is completed, and the minimum value is obtained in the completed reduced SAD table. The detected SAD value is detected (step S192).

次に、当該最小値となっているテーブル要素アドレス(mx,my)のSAD値(最小値)と、その近傍の複数個、この例では、上述したように15個の近傍テーブル要素のSAD値を用いて2次曲面を生成し(ステップS193)、その2次曲面の最小値のSAD値が対応する小数精度の位置を示す最小値ベクトル(px,py)を算出する(ステップS194)。この最小値ベクトル(px,py)は、小数精度の最小テーブル要素アドレスに対応している。   Next, the SAD value (minimum value) of the table element address (mx, my) having the minimum value and a plurality of neighboring SAD values, in this example, the SAD values of 15 neighboring table elements as described above. Is used to generate a quadric surface (step S193), and a minimum value vector (px, py) indicating the position of decimal precision corresponding to the minimum SAD value of the quadric surface is calculated (step S194). The minimum value vector (px, py) corresponds to the minimum table element address with decimal precision.

そして、算出した小数精度の位置を示す最小値ベクトル(px,py)をn倍することにより、求める動きベクトル(px×n,py×n)を算出する(ステップS195)。   Then, the motion vector (px × n, py × n) to be obtained is calculated by multiplying the calculated minimum value vector (px, py) indicating the decimal position by n (step S195).

なお、この例においても、小数精度の位置を示す最小値ベクトル(px,py)を算出する方法としては、前述した水平方向および垂直方向の3次曲線を用いる方法を用いても良いことは前述の例と同様である。   In this example as well, as described above, the method using the above-described cubic curve in the horizontal direction and the vertical direction may be used as a method for calculating the minimum value vector (px, py) indicating the position with decimal precision. This is the same as the example.

また、前述の第1の実施形態の第3の例と同様にして、この第2の実施形態においても、サーチ範囲を絞りながら、かつ、必要に応じて縮小倍率を変更しながら、2段階以上、縮小SADテーブルを用いた動きベクトル検出処理を繰り返すようにしても、勿論良い。   In the same manner as the third example of the first embodiment described above, the second embodiment also has two or more steps while narrowing the search range and changing the reduction ratio as necessary. Of course, the motion vector detection process using the reduced SAD table may be repeated.

この第2の実施形態のメリットは、フレームメモリを、第1の実施形態に比べて1枚分削減できることと、フレームメモリに入力画像を格納する時間を短縮できることである。メモリ削減の効果は言うまでもないが、処理時間の短縮も、近年、重要視されて来ている。特に動画を扱う場合、そのままシステム遅延の短縮に繋がるため、システム遅延が原因で生じる、実際の被写体とパネル表示画像の間に生じる違和感をなるべく無くすことは、ユーザへの訴求効果が高い。   The merit of the second embodiment is that the frame memory can be reduced by one frame compared to the first embodiment, and the time for storing the input image in the frame memory can be shortened. Needless to say, the effect of reducing the memory has been increasing in recent years. In particular, when handling moving images, the system delay is reduced as it is, and eliminating the uncomfortable feeling that occurs between the actual subject and the panel display image due to the system delay is as effective as appealing to the user.

[第3の実施形態]
以上の第1および第2の実施形態は、動画の手ぶれ補正システムを想定したものであり、その前提でここまでの議論を進めて来たが、この発明によるブロックマッチング手法は、静止画の手ぶれ補正システムにも容易に展開可能である。第3の実施形態は、この静止画の手ぶれ補正システムに、この発明を適用した場合である。なお、この第3の実施形態は、静止画用に限定されるわけではなく、本質的には動画にも適用可能である。動画の場合には、リアルタイム性のため加算枚数(フレーム数)に上限はあるが、フレーム毎に本手法を用いることにより、ノイズ・リダクション効果の高い動画を生成するシステムへの応用も、全く同じ手段で実現できる。
[Third Embodiment]
In the first and second embodiments described above, an image stabilization system for moving images is assumed, and the discussion up to this point has proceeded. However, the block matching method according to the present invention is based on still image stabilization. It can be easily deployed in a correction system. The third embodiment is a case where the present invention is applied to the still image stabilization system. Note that the third embodiment is not limited to still images, and is essentially applicable to moving images. In the case of moving images, there is an upper limit on the number of frames to be added (the number of frames) due to real-time characteristics, but the application to a system that generates a moving image with a high noise reduction effect by using this method for each frame is exactly the same. It can be realized by means.

この第3の実施形態においては、第2の実施形態と同様に、入力画像フレームを参照フレームとして、この入力画像フレームと、フレームメモリ内の入力画像フレームを1フレーム遅延させた画像フレームとの間で動きベクトル検出を行なう。そして、この第3の実施形態における静止画についての手ぶれ補正は、連続的に撮影した複数枚の画像、例えば3fpsの画像を、手ぶれ補正を行いながら重ね合わせることにより行なう。   In the third embodiment, as in the second embodiment, the input image frame is used as a reference frame, and the input image frame and an image frame obtained by delaying the input image frame in the frame memory by one frame are used. To detect motion vectors. The camera shake correction for the still image in the third embodiment is performed by superimposing a plurality of images taken continuously, for example, 3 fps images while performing camera shake correction.

このように、第3の実施形態においては、撮影した静止画の手ぶれ補正を、連写した複数の画像について手ぶれ補正をかけながら重ね合わせて行くため、ピクセル精度(1画素精度)に近い精度が求められる。つまり、第3の実施形態においては、手ぶれ動きベクトルとしてのフレーム間の水平方向および垂直方向の平行移動成分と同時に、フレーム間の回転成分も検出する必要が生じる。   As described above, in the third embodiment, camera shake correction of a captured still image is performed while performing camera shake correction on a plurality of continuously shot images, so that accuracy close to pixel accuracy (one pixel accuracy) is achieved. Desired. That is, in the third embodiment, it is necessary to detect the rotation component between frames simultaneously with the horizontal and vertical translation components between the frames as the hand movement motion vector.

図46は、この第3の実施形態の場合の撮像装置の構成例を示すブロック図である。この図46の例は、図41に示した第2の実施形態において、手ぶれベクトル検出部15と、解像度変換部16との間に回転・平行移動加算部19を設けると共に、画像メモリ部4に、フレームメモリ43の他に、もう1つのフレームメモリ44を設け、このフレームメモリ44を、動きベクトルの回転成分の検出用およびフレーム画像の重ね合わせ用として用いるようにする。その他は、図41の構成と同様である。   FIG. 46 is a block diagram illustrating a configuration example of the imaging apparatus in the case of the third embodiment. In the example of FIG. 46, in the second embodiment shown in FIG. 41, a rotation / translation addition unit 19 is provided between the camera shake vector detection unit 15 and the resolution conversion unit 16, and the image memory unit 4 is also provided. In addition to the frame memory 43, another frame memory 44 is provided, and this frame memory 44 is used for detecting the rotation component of the motion vector and for superimposing the frame images. Others are the same as the structure of FIG.

手ぶれベクトル検出部15は、前述の第2の実施形態で説明した動画の場合と同様にして、データ変換部14からの入力画素データを、参照フレームの画素データとすると共に、フレームメモリ43の格納データを元フレームのデータとして、縮小SADテーブル生成処理、ブロック毎動きベクトルの検出処理、合算SADテーブル生成処理およびグローバル動きベクトル(手ぶれベクトル)検出処理を行なう。そして、この第3の実施形態においては、手ぶれベクトル検出部15では、グローバル動きベクトル(手ぶれの平行移動成分)に加えて、参照フレームの元フレームに対する回転角度を検出する。   As in the case of the moving image described in the second embodiment, the camera shake vector detection unit 15 sets the input pixel data from the data conversion unit 14 as the pixel data of the reference frame and stores it in the frame memory 43. Using the data as original frame data, a reduced SAD table generation process, a block-by-block motion vector detection process, a combined SAD table generation process, and a global motion vector (camera shake vector) detection process are performed. In the third embodiment, the hand movement vector detection unit 15 detects the rotation angle of the reference frame with respect to the original frame in addition to the global motion vector (the hand movement parallel translation component).

なお、この例の場合、手ぶれベクトル検出部15では、常に1フレーム前の画像との相対手ぶれベクトルを求めることになるので、1枚目の基準画像(図47の画像フレーム120参照)との相対手ぶれを算出するために、1枚目からそれまでの手ぶれ成分を積分しておくものである。   In the case of this example, the camera shake vector detection unit 15 always obtains a relative camera shake vector with respect to the image one frame before, so that it is relative to the first reference image (see the image frame 120 in FIG. 47). In order to calculate camera shake, the camera shake components from the first sheet to that are integrated.

そして、回転・平行移動加算部19は、この検出された手ぶれの平行移動成分と回転角度に従って、1フレーム遅延の後、フレームメモリ43に格納されている画像フレームを、切り出しと同時に回転させながら、フレームメモリ44の画像に加算もしくは平均化して行く。この過程を繰り返すことにより、フレームメモリ44には、手ぶれの無い、より高S/Nで、より高解像度の静止画像の画像フレーム120が生成される(図47参照)。   Then, the rotation / translation adder 19 rotates the image frame stored in the frame memory 43 at the same time as the cutout after one frame delay according to the detected translational component and the rotation angle of the camera shake. The image is added or averaged to the frame memory 44 image. By repeating this process, an image frame 120 of a still image having a higher S / N and a higher resolution without camera shake is generated in the frame memory 44 (see FIG. 47).

そして、解像度変換部16は、フレームメモリ44のフレーム画像から、CPU1からの制御指示に応じた所定の解像度および所定の画像サイズを切り出して、前述したように、記録撮像画像データとしてコーデック部17に供給すると共に、モニター画像データとしてNTSCエンコーダ18に供給する。   Then, the resolution conversion unit 16 cuts out a predetermined resolution and a predetermined image size according to the control instruction from the CPU 1 from the frame image in the frame memory 44, and as described above, the resolution conversion unit 16 stores the captured image data as the recorded captured image data in the codec unit 17. At the same time, it is supplied to the NTSC encoder 18 as monitor image data.

この第3の実施形態においても、手ぶれベクトル検出部15においては、サーチ範囲を絞りながら、かつ、必要に応じて縮小倍率を変更しながら、2段階以上、縮小SADテーブルおよび合算SADテーブルを用いた動きベクトル検出処理を繰り返すようにすることができる。この第3の実施形態の、静止画についての手ぶれベクトル検出および手ぶれ補正処理においては、リアルタイム性の制約が少なく、画素数が多く、高精度の動きベクトルの検出が必要であるので、複数段階の階層的な動きベクトル検出処理が非常に有効である。   Also in the third embodiment, the hand movement vector detecting unit 15 uses the reduced SAD table and the combined SAD table in two or more stages while narrowing the search range and changing the reduction ratio as necessary. The motion vector detection process can be repeated. In the camera shake vector detection and camera shake correction processing for the still image according to the third embodiment, there are few real-time restrictions, the number of pixels is large, and high-precision motion vectors need to be detected. Hierarchical motion vector detection processing is very effective.

そのような複数段階の階層的な動きベクトル検出処理を行う場合において、後の回の動きベクトル検出におけるサーチ範囲は、前の回で算出されたグローバル動きベクトル分をサーチ範囲オフセットとして設定し、より狭いサーチ範囲を設定するものである。   When performing such multi-step hierarchical motion vector detection processing, the search range in the subsequent motion vector detection is set as the search range offset for the global motion vector calculated in the previous round, A narrow search range is set.

[第4の実施形態]
上述の第3の実施形態の例では、第2の実施形態における動きベクトルの検出方法を用いるようにしたが、第1の実施形態における動きベクトルの検出方法を用いるようにしても良い。
[Fourth Embodiment]
In the example of the third embodiment described above, the motion vector detection method in the second embodiment is used. However, the motion vector detection method in the first embodiment may be used.

図48は、第3の実施形態と同様の静止画の手ぶれ補正システムにおいて、第1の実施形態における動きベクトルの検出方法を用いる場合の画像処理装置の第4の実施形態の構成例を示すものである。   FIG. 48 shows a configuration example of the fourth embodiment of the image processing apparatus when the motion vector detection method according to the first embodiment is used in the still image stabilization system similar to the third embodiment. It is.

この第4の実施形態においては、図29に示した第1の実施形態において、手ぶれベクトル検出部15と、解像度変換部16との間に回転・平行移動加算部19を設けると共に、画像メモリ部4には、第1の実施形態の図29に示したフレームメモリ41およびフレームメモリ42に加えて、フレームメモリ44を設ける。そして、動きベクトルおよびグローバル動きベクトルを用いて、複数枚のフレームを回転および平行移動させて重ね合わせる基準となる1枚目のフレームの画像データは、図48において破線で示すように、フレームメモリ44にも書き込むようにする。   In the fourth embodiment, in the first embodiment shown in FIG. 29, a rotation / translation addition unit 19 is provided between the camera shake vector detection unit 15 and the resolution conversion unit 16, and an image memory unit. 4, a frame memory 44 is provided in addition to the frame memory 41 and the frame memory 42 shown in FIG. 29 of the first embodiment. Then, using the motion vector and the global motion vector, the image data of the first frame, which is a reference for rotating and translating a plurality of frames and superimposing them, is shown in FIG. Also write to.

そして、2枚目以降の画像フレームについては、フレームメモリ42に格納された後、フレームメモリ41に格納されている画像データを用いて、常に1フレーム前の画像との相対的な手ぶれベクトルの検出が、手ぶれベクトル検出部15で実行される。このとき、1枚目の基準画像との相対手ぶれを算出するために、それまでの手ぶれベクトルを積分しておくようにする。また、手ぶれベクトル検出部15では、2枚目以降の画像フレームの、1枚目の基準画像フレームに対する相対的な回転角度が検出される。   For the second and subsequent image frames, after being stored in the frame memory 42, the image data stored in the frame memory 41 is always used to detect the camera shake vector relative to the image one frame before. Is executed by the hand movement vector detection unit 15. At this time, in order to calculate the relative camera shake with the first reference image, the camera shake vector up to that point is integrated. In addition, the camera shake vector detection unit 15 detects a rotation angle of the second and subsequent image frames relative to the first reference image frame.

手ぶれベクトル検出部15は、検出した1枚目の画像フレームに対する2枚目以降の画像フレームのそれぞれについての相対的な手ぶれベクトルと回転角度の情報をCPU1に供給する。   The camera shake vector detection unit 15 supplies the CPU 1 with information on a relative camera shake vector and a rotation angle for each of the second and subsequent image frames with respect to the detected first image frame.

そして、フレームメモリ42に格納されている2枚目以降の画像は、算出された1枚目のフレームの基準画像との相対手ぶれ成分を相殺するように、CPU1の制御により、フレームメモリ42から読み出されて、回転・平行移動加算部19に供給される。そして、回転・平行移動加算部19では、CPU1からの制御信号により、1枚目の基準画像フレームに対する相対回転角度に応じて2枚目以降の画像フレームのそれぞれが回転させられて、フレームメモリ44から読み出された画像フレームに対して加算もしくは平均化される。その加算もしくは平均結果の画像フレームは、フレームメモリ44に書き戻される。   The second and subsequent images stored in the frame memory 42 are read from the frame memory 42 under the control of the CPU 1 so as to cancel the relative camera shake component with the calculated reference image of the first frame. And is supplied to the rotation / translation adder 19. Then, the rotation / translation addition unit 19 rotates each of the second and subsequent image frames in accordance with the relative rotation angle with respect to the first reference image frame by the control signal from the CPU 1, and the frame memory 44. Are added or averaged to the image frames read out from. The added or averaged image frame is written back to the frame memory 44.

そして、フレームメモリ44の画像フレームのデータは、CPU1の制御指示に応じた所定の解像度および所定の画像サイズで切り出されて解像度変換部16に供給される。そして、解像度変換部16は、前述したように、記録撮像画像データとしてコーデック部17に供給すると共に、モニター画像データとしてNTSCエンコーダ18に供給する。   The image frame data in the frame memory 44 is cut out at a predetermined resolution and a predetermined image size according to the control instruction of the CPU 1 and supplied to the resolution conversion unit 16. Then, as described above, the resolution conversion unit 16 supplies the captured image data to the codec unit 17 and the monitor image data to the NTSC encoder 18.

[第5の実施形態]
上述の第3の実施形態および第4の実施形態では、入力画像に対し、常に1フレーム前の画像との比較によって、手ぶれベクトルと回転角度を求める方式であったが、実際には、図47に示したように、1枚目を基準として、以降のフレームを足し合わせるため、動きベクトル検出も1枚目を基準にする方が誤差は小さくなる。第5の実施形態は、この点を考慮したものである。
[Fifth Embodiment]
In the third embodiment and the fourth embodiment described above, the camera shake vector and the rotation angle are always obtained by comparing the input image with the image one frame before, but actually, FIG. As shown in FIG. 6, since the subsequent frames are added with the first frame as a reference, the error is smaller when the motion vector detection is also based on the first frame. The fifth embodiment considers this point.

図49に、この第5の実施形態による撮像装置の構成例のブロック図を示す。この図49の構成例は、第3の実施形態の場合に適用した例である。   FIG. 49 is a block diagram showing a configuration example of the imaging apparatus according to the fifth embodiment. The configuration example of FIG. 49 is an example applied to the case of the third embodiment.

すなわち、この図49の例においては、画像メモリ部4には、図46の第3の実施形態におけるフレームメモリ43およびフレームメモリ44に加えて、フレームメモリ45を設ける。そして、データ変換部14からの画像データは、フレームメモリ43とフレームメモリ45とに書き込むようにする。   That is, in the example of FIG. 49, the image memory unit 4 is provided with a frame memory 45 in addition to the frame memory 43 and the frame memory 44 in the third embodiment of FIG. The image data from the data converter 14 is written in the frame memory 43 and the frame memory 45.

そして、この第4の実施形態においては、フレームメモリ45を、ターゲットとなる1枚目のフレーム(元フレームおよび基準画像のフレーム)格納用として用いて、常に、この画像に対する入力画像の参照ベクトルを算出するシステムの構成を示す。この構成においても、フレームメモリ44に加算画像結果が格納される。   In the fourth embodiment, the frame memory 45 is used for storing the first target frame (original frame and reference image frame), and the reference vector of the input image for this image is always used. The structure of the system to calculate is shown. Also in this configuration, the addition image result is stored in the frame memory 44.

この例においても、基準となる1枚目のフレームの画像データは、図49において破線で示すように、フレームメモリ44にも書き込むようにする。   Also in this example, the image data of the first frame serving as a reference is written in the frame memory 44 as indicated by a broken line in FIG.

そして、2枚目以降の画像フレームは、フレームメモリ43に書き込むと共に、手ぶれベクトル検出部15に供給する。手ぶれベクトル検出部15では、データ変換部14からの2枚目以降の画像フレームのそれぞれと、フレームメモリ45から読み出された1枚目の画像データとの間の相対的な手ぶれベクトルの検出を行うと共に、回転角度の検出を行う。   The second and subsequent image frames are written to the frame memory 43 and supplied to the camera shake vector detection unit 15. The camera shake vector detection unit 15 detects a relative camera shake vector between each of the second and subsequent image frames from the data conversion unit 14 and the first image data read from the frame memory 45. And the rotation angle is detected.

手ぶれベクトル検出部15は、検出した1枚目の画像フレームに対する2枚目以降の画像フレームのそれぞれについての相対的な手ぶれベクトルと回転角度の情報をCPU1に供給する。   The camera shake vector detection unit 15 supplies the CPU 1 with information on a relative camera shake vector and a rotation angle for each of the second and subsequent image frames with respect to the detected first image frame.

そして、フレームメモリ43に格納されている2枚目以降の画像は、算出された1枚目のフレームの基準画像との相対手ぶれ成分を相殺するように、CPU1の制御により、フレームメモリ42から読み出されて、回転・平行移動加算部19に供給される。そして、回転・平行移動加算部19では、CPU1からの制御信号により、1枚目の基準画像フレームに対する相対回転角度に応じて2枚目以降の画像フレームのそれぞれが回転させられて、フレームメモリ44から読み出された画像フレームに対して加算もしくは平均化される。その加算もしくは平均結果の画像フレームは、フレームメモリ44に書き戻される。   The second and subsequent images stored in the frame memory 43 are read from the frame memory 42 under the control of the CPU 1 so as to cancel the relative camera shake component with the calculated reference image of the first frame. And is supplied to the rotation / translation adder 19. Then, the rotation / translation addition unit 19 rotates each of the second and subsequent image frames in accordance with the relative rotation angle with respect to the first reference image frame by the control signal from the CPU 1, and the frame memory 44. Are added or averaged to the image frames read out from. The added or averaged image frame is written back to the frame memory 44.

そして、フレームメモリ44の画像フレームのデータは、CPU1の制御指示に応じた所定の解像度および所定の画像サイズで切り出されて解像度変換部16に供給される。そして、解像度変換部16は、前述したように、記録撮像画像データとしてコーデック部17に供給すると共に、モニター画像データとしてNTSCエンコーダ18に供給する。   The image frame data in the frame memory 44 is cut out at a predetermined resolution and a predetermined image size according to the control instruction of the CPU 1 and supplied to the resolution conversion unit 16. Then, as described above, the resolution conversion unit 16 supplies the captured image data to the codec unit 17 and the monitor image data to the NTSC encoder 18.

第4の実施形態に対しても、上述した第5の実施形態の考え方を適用して、常に、1枚目の基準画像フレームに対する相対的な手ぶれベクトルおよび回転角度を、2枚目以降のフレームについて検出するようにする場合には、図48において、フレームメモリ42を1枚目の画像専用に固定するか、1枚目の画像の代表点を、ローカルメモリ(SRAM)に保存しておき、それを用いてブロックマッチングを行って、SAD値を用いるようにすればよい。   Also in the fourth embodiment, by applying the concept of the fifth embodiment described above, the relative camera shake vector and the rotation angle with respect to the first reference image frame are always set to the second and subsequent frames. 48, the frame memory 42 is fixed exclusively for the first image in FIG. 48, or the representative point of the first image is stored in the local memory (SRAM). What is necessary is just to perform a block matching using it and to use a SAD value.

なお、上述の第4の実施形態および第5の実施形態において、入力画像の1フレーム目を基準画像として、無限加算もしくは無限平均加算も可能なシステムを示したが、もしメモリ容量がふんだんに存在するか、記録再生装置部5への一時的な退避が許されるならば、予め加算対象の画像を全て保存しておき、それらをトーナメント式に加算、もしくは平均加算して行く方法を採用しても良い。   In the fourth and fifth embodiments described above, a system that can perform infinite addition or infinite average addition using the first frame of the input image as a reference image has been shown. However, there is plenty of memory capacity. Alternatively, if temporary evacuation to the recording / reproducing apparatus unit 5 is permitted, all the images to be added may be stored in advance and added to the tournament type or average added. good.

[第6の実施形態]
以上説明した第1〜第5の実施形態によるセンサレス手ブレ補正と、現存技術である光学手ぶれ補正とを組み合わせることによって、より高い効果が得られる。
[Sixth Embodiment]
A higher effect can be obtained by combining the sensorless camera shake correction according to the first to fifth embodiments described above and the optical camera shake correction which is the existing technology.

冒頭で説明したように、ジャイロセンサを用いる光学手ぶれ補正は、大まかな補正を得意としており、また、回転補正が難しいのに対し、ブロックマッチングを使用したセンサレス手ブレ補正は、回転補正も含めた精度は高いが、サーチ範囲が広くなると、SADテーブルのコストが急上昇するか、この実施形態の手法を用いたとしても、複数段階の動き検出処理による場合には処理時間を要するからである。   As explained at the beginning, optical camera shake correction using a gyro sensor is good at rough correction, and rotation correction is difficult, whereas sensorless camera shake correction using block matching includes rotation correction. This is because although the accuracy is high, if the search range is widened, the cost of the SAD table increases rapidly, or even if the method of this embodiment is used, processing time is required in the case of a multi-stage motion detection process.

したがって、光学手ぶれ補正で大まかに補正して、センサレベル手ぶれ補正のための動きベクトル検出用のサーチ範囲を狭め、そのサーチ範囲において、動きベクトルを検出して、センサレス手ブレ補正をかけることにより、低コスト、高精度、高速の手ぶれ補正システムが実現できる。   Therefore, by roughly correcting with optical image stabilization, narrowing the search range for motion vector detection for sensor level image stabilization, detecting the motion vector in the search range, and applying sensorless image stabilization, A low-cost, high-precision, high-speed image stabilization system can be realized.

ところで、近年、手ぶれだけでなく動被写体ぶれも防ぐための手法として、手ぶれも動被写体ぶれも発生しにくい、1/60秒程度の短い露光時間で高感度に撮影する、高感度撮影が市場の耳目を集めている。   By the way, in recent years, as a technique for preventing not only camera shake but also moving subject shake, high sensitivity shooting is now in the market. I collect ears.

この場合に問題となるのが、S/Nを抑えながら、どこまでのISO感度に対応できるか、である。通常、感度を向上させると、同時にノイズも目立ってしまうため、デジタルカメラ各社は、様々な手法を用いてノイズ・リダクションを行い、一定水準のS/Nを維持できる、最高ISO感度の数値の大きさを、性能として謳っている。   The problem in this case is how much ISO sensitivity can be accommodated while suppressing S / N. Normally, when sensitivity is improved, noise becomes conspicuous at the same time, so digital camera companies can reduce noise using various methods and maintain a certain level of S / N. Say it as performance.

この発明で主題の一つとしている静止画の手ぶれ補正も、目的の一つはノイズ・リダクションであり、複数枚の加算を行う際に、動被写体部分を検出し、加算を行わないか、その部分だけ別途サーチし、追跡加算を行うことで、動被写体ぶれにも対応した、見かけ上の高感度なノイズ・リダクションを実現することは可能である。   One of the purposes of still image stabilization, which is one of the subjects of the present invention, is noise reduction, and when adding a plurality of images, a moving subject portion is detected and the addition is not performed. It is possible to realize apparent high-sensitivity noise reduction corresponding to moving subject blurring by separately searching only the part and performing tracking addition.

ランダムノイズを対象とした場合、N枚(Nは2以上の整数)を加算すれば、統計的に、そのノイズ成分はNの平方根の比率に削減される。つまり、ISO3200相当の実力値を持つデジタルカメラにおいて、動被写体に対応した16枚加算を行えば、そのセットのISO感度を、4倍のISO12800として謳うことができる。   When random noise is targeted, if N sheets (N is an integer of 2 or more) are added, the noise component is statistically reduced to the ratio of the square root of N. That is, in a digital camera having an ability value equivalent to ISO 3200, if 16 frames corresponding to a moving subject are added, the ISO sensitivity of the set can be obtained as ISO 12800 which is 4 times.

[実施形態の効果]
以上説明したように、上述の第1および第2の実施形態においては、動きベクトルの信頼性を判定する新たな尺度として、合算SADを提案し、これを用いた動画の手ぶれ補正アルゴリズムを示した。これにより、フレーム全体の明滅や水面の波面などの苦手被写体に対して、従来手法のような大きく間違った補正を回避することができる上、苦手被写体でない場合にも、従来よりも高精度な補正が可能で、ロバスト性と高精度を両立した、動画の手ぶれ補正システムを実現することができる。
[Effect of the embodiment]
As described above, in the above-described first and second embodiments, a combined SAD is proposed as a new measure for determining the reliability of a motion vector, and a video stabilization algorithm using this is shown. . This makes it possible to avoid large and incorrect corrections for conventional subjects, such as blinking of the entire frame and wavefront of the water surface, as well as correction that is more accurate than before even when subjects are not good at it. Therefore, it is possible to realize an image stabilization system for moving images that achieves both robustness and high accuracy.

また、上述の第3〜第5の実施形態のブロックマッチング手法を用いたセンサレス手ぶれ補正手法は、これまで提案されている、センサレス静止画手ぶれ補正技術に対しては、コスト、精度、処理時間、ロバスト性の、いずれにおいても優位に立つ。   In addition, the sensorless camera shake correction method using the block matching method of the third to fifth embodiments described above is cost, accuracy, processing time, and the like for the sensorless still image camera shake correction technology that has been proposed so far. Robustness is superior in both cases.

現在市場に出回っている静止画の手ぶれ補正の全ては、ジャイロセンサとレンズシフト等の光学補正を組み合わせて用いたシステムであるが、誤差が大きく、満足のいく画質ではなかった。これに対して、この発明による手法により、センサや機構部分を無くした、低コストかつ高精度の手ぶれ補正が実現する。   All of the still image stabilization currently on the market is a system that uses a combination of gyro sensor and optical correction such as lens shift, but the error is large and the image quality is not satisfactory. On the other hand, the method according to the present invention realizes low-cost and high-precision camera shake correction that eliminates a sensor and a mechanism portion.

[その他の変形例]
上述の実施形態の説明では、参照ベクトルに対する縮小倍率は水平方向と垂直方向とで同一としたが、水平方向と、垂直方向とで、縮小倍率を異ならせるようにしても良いことは前述した通りである。
[Other variations]
In the description of the above-described embodiment, the reduction ratio with respect to the reference vector is the same in the horizontal direction and the vertical direction. However, as described above, the reduction ratio may be different in the horizontal direction and the vertical direction. It is.

また、上述の実施形態では、参照ブロックおよびターゲットブロック内の全ての画素についてSAD値を求めるようにしたが、例えばk個(kは自然数)おきの画素のみを用いてSAD値を求めるようにしても良い。   In the above-described embodiment, the SAD value is obtained for all the pixels in the reference block and the target block. For example, the SAD value is obtained by using only every k pixels (k is a natural number). Also good.

また、リアルタイム処理の動きベクトル検出システムでは、演算コストと処理時間削減を目的として、ターゲットブロック内の代表点のみを参照ブロック内でサーチする、SAD演算がしばしば行われている。   In a motion vector detection system for real-time processing, SAD calculation is often performed in which only representative points in a target block are searched in a reference block for the purpose of reducing calculation cost and processing time.

すなわち、図50に示すように、ターゲットブロック103を、例えば横×縦=n×m個(n、mは1以上の整数)からなる複数画素毎に分割し、その分割単位である複数画素のうちの1点の画素を代表点TPとする。そして、SAD演算においては、ターゲットブロック103については、このようにして定めた複数個の代表点TPのみを使用する。   That is, as shown in FIG. 50, the target block 103 is divided into a plurality of pixels, for example, horizontal × vertical = n × m (n and m are integers of 1 or more), and a plurality of pixels which are the division units are divided. One of the pixels is set as a representative point TP. In the SAD calculation, for the target block 103, only a plurality of representative points TP determined in this way are used.

一方、参照ブロック106では全画素をSAD値演算の対象とするもので、ターゲットブロック103の一つの代表点TPに対しては、一つの参照ブロック106において、代表点TPが設定される分割単位であるn×m個からなる複数画素の領域ARに含まれる全画素を使用する。   On the other hand, in the reference block 106, all the pixels are subjected to SAD value calculation. For one representative point TP in the target block 103, in one reference block 106, the division point in which the representative point TP is set is used. All pixels included in a certain pixel area AR composed of n × m pixels are used.

そして、ターゲットブロック103と、一つの参照ブロック106との間においては、ターゲットブロック102の各代表点TPの画素値と、参照ブロック106の、各代表点TPに対応するそれぞれの領域ARに含まれるn×m個からなる複数の画素のそれぞれの画素値との差分の合計が求められ、そして、求められた代表点TPについての差分の合計が、ターゲットブロック103のすべての代表点TPについて合計されることになる。これが、SADテーブルの一つの要素値となる。   Between the target block 103 and one reference block 106, the pixel value of each representative point TP of the target block 102 and each area AR corresponding to each representative point TP of the reference block 106 are included. The sum of the differences from the respective pixel values of the plurality of n × m pixels is obtained, and the sum of the differences for the obtained representative points TP is summed for all the representative points TP of the target block 103. Will be. This is one element value of the SAD table.

そして、ターゲットブロック103についてのサーチ範囲のすべての参照ブロックについて、上記と同様の代表点TPを用いた差分演算が行われて、SADテーブルが生成されることになる。ただし、この例の場合には、サーチ範囲に設定する複数個の参照ブロックは、前述した分割単位であるn×m個からなる複数画素毎、あるいは当該複数画素の整数倍毎にずれたものとされる。   Then, the difference calculation using the representative point TP similar to the above is performed for all the reference blocks in the search range for the target block 103, and the SAD table is generated. However, in the case of this example, the plurality of reference blocks set in the search range are shifted by each of a plurality of pixels composed of n × m, which is the division unit, or by an integer multiple of the plurality of pixels. Is done.

上述のようにターゲットブロックについて代表点を用いるようにする場合には、SAD値を算出する際のターゲットブロックについてのメモリアクセスは、参照ブロックの領域ARの複数画素毎に対して、一つの代表点TPの1回でよくなり、メモリアクセス数を大幅に少なくすることができる。   When the representative point is used for the target block as described above, the memory access for the target block when calculating the SAD value is one representative point for each of the plurality of pixels in the area AR of the reference block. One TP is sufficient, and the number of memory accesses can be greatly reduced.

また、代表点TPのみを用いる場合には、ターゲットブロックのデータとしては、ブロック内の全画素のうちの代表点TPの画素データのみを記憶すればよいので、元フレーム(ターゲットフレーム)のターゲットブロックのデータを記憶するフレームメモリの容量を削減することができる。   When only the representative point TP is used, only the pixel data of the representative point TP among all the pixels in the block needs to be stored as the target block data. Therefore, the target block of the original frame (target frame) is stored. The capacity of the frame memory for storing the data can be reduced.

また、フレームメモリとは別に、小規模な代表点メモリ(SRAM)をローカルで持ち、当該ローカルメモリに元フレーム(ターゲットフレーム)のターゲットブロックのデータを保持するようにすることにより、画像メモリ4(DRAM)の帯域削減を図っても良い。   In addition to the frame memory, a small representative point memory (SRAM) is locally provided, and the data of the target block of the original frame (target frame) is held in the local memory, whereby the image memory 4 ( DRAM) may be reduced.

ターゲットブロックについて代表点を用いる場合の処理に関する以上の説明は、図51〜図53を用いて説明した手法におけるものについてであるが、図41〜図45を用いて説明した第2の実施の形態における手法の場合にも適用できることは言うまでもない。   The above description regarding the processing in the case where the representative point is used for the target block is for the method described with reference to FIGS. 51 to 53, but the second embodiment described with reference to FIGS. 41 to 45. Needless to say, this method can also be applied to the above method.

この第2の実施形態における手法において、ターゲットブロックについて代表点TPのみを用いる場合には、入力される参照フレームの画素(入力画素)ごとに、サーチ範囲の全範囲において、当該入力画素を含む領域AR(当該画素の位置は領域ARにおいて同じではない)を備えるすべての参照ブロックを検出し、その検出したすべての参照ブロックのそれぞれにおける領域ARに対応するターゲットブロックの代表点を判定する。   In the method according to the second embodiment, when only the representative point TP is used for the target block, an area including the input pixel in the entire search range for each pixel (input pixel) of the input reference frame All reference blocks having AR (the positions of the pixels are not the same in the area AR) are detected, and the representative points of the target block corresponding to the area AR in each of the detected reference blocks are determined.

そして、その判定結果として得られる複数個の代表点の画素値を、元フレーム(ターゲットフレーム)の画像データを記憶するメモリからそれぞれ読み出して、その代表点の画素値と当該入力画素との差分をそれぞれ演算し、その演算結果を、SADテーブルにおいて、対応する参照ブロック(参照ベクトル)の座標位置に累積するようにする。   Then, the pixel values of a plurality of representative points obtained as a result of the determination are respectively read from the memory storing the image data of the original frame (target frame), and the difference between the pixel value of the representative point and the input pixel is calculated. Each calculation is performed, and the calculation result is accumulated in the coordinate position of the corresponding reference block (reference vector) in the SAD table.

この場合には、メモリアクセスは、ターゲットブロックの代表点のみを読み出すだけであるので、メモリアクセス数を大幅に削減することができるものである。   In this case, since the memory access only reads out the representative point of the target block, the number of memory accesses can be greatly reduced.

なお、代表点を用いる処理は、上述した縮小SADテーブルを用いる場合にも適用できることは言うまでもない。   Needless to say, the processing using the representative points can also be applied to the case where the above-described reduced SAD table is used.

なお、上述の実施形態では、画素の差分値およびSAD値は、画素の輝度値Yのみを用いて演算するものとしたが、動ベクトル検出のために、輝度値Yだけでなく、色差成分Cb/Crを用いてもよい。また、データ変換部14で輝度値Yおよび色差成分Cb/Crに変換される前のRAWデータを対象として、動きベクトル検出処理を行ってもよい。   In the above-described embodiment, the pixel difference value and the SAD value are calculated using only the pixel luminance value Y. However, not only the luminance value Y but also the color difference component Cb is used for motion vector detection. / Cr may be used. Further, the motion vector detection process may be performed on the RAW data before being converted into the luminance value Y and the color difference component Cb / Cr by the data conversion unit 14.

また、前述もしたが、手ぶれベクトル検出部15は、ハードウエア処理による構成とする場合に限定されるものではなく、ソフトウエアで実現しても良い。   As described above, the camera shake vector detection unit 15 is not limited to a configuration using hardware processing, and may be realized by software.

この発明による画像処理方法の実施形態の概要を説明するための図である。It is a figure for demonstrating the outline | summary of embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態の概要を説明するために用いる図である。It is a figure used in order to demonstrate the outline | summary of embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態の概要を説明するための図である。It is a figure for demonstrating the outline | summary of embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態の概要を説明するために用いる図である。It is a figure used in order to demonstrate the outline | summary of embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態の概要を説明するために用いるフローチャートを示す図である。It is a figure which shows the flowchart used in order to demonstrate the outline | summary of embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理の例を説明するための図である。It is a figure for demonstrating the example of the process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態において、ブロック毎動きベクトルを検出するための処理例の処理性能を説明するための図である。It is a figure for demonstrating the processing performance of the example of a process for detecting a motion vector for every block in embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態の概要を説明するための図である。It is a figure for demonstrating the outline | summary of embodiment of the image processing method by this invention. この発明による画像処理方法の実施形態の特徴を、従来の手法と比較して説明するために用いる図である。It is a figure used in order to demonstrate the characteristic of embodiment of the image processing method by this invention compared with the conventional method. この発明による画像処理方法の実施形態の特徴を、従来の手法と比較して説明するために用いる図である。It is a figure used in order to demonstrate the characteristic of embodiment of the image processing method by this invention compared with the conventional method. この発明による画像処理方法の実施形態の特徴を、従来の手法と比較して説明するために用いる図である。It is a figure used in order to demonstrate the characteristic of embodiment of the image processing method by this invention compared with the conventional method. この発明による画像処理装置の第1の実施形態の構成例を示すブロック図である。1 is a block diagram illustrating a configuration example of a first embodiment of an image processing device according to the present invention. この発明による画像処理装置の第1の実施形態の手ぶれベクトル検出処理例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the example of the hand movement vector detection process of 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態の手ぶれベクトル検出処理例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the example of the hand movement vector detection process of 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態におけるブロック毎動きベクトル検出処理の第1の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the 1st example of the motion vector detection process for every block in 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態におけるブロック毎動きベクトル検出処理の第1の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the 1st example of the motion vector detection process for every block in 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態におけるブロック毎動きベクトル検出処理の第2の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the 2nd example of the motion vector detection process for every block in 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態におけるブロック毎動きベクトル検出処理の第2の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the 2nd example of the motion vector detection process for every block in 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態におけるブロック毎動きベクトル検出処理の第3の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the 3rd example of the motion vector detection process for every block in 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態におけるブロック毎動きベクトル検出処理の第3の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the 3rd example of the motion vector detection process for every block in 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態におけるブロック毎動きベクトル検出処理の第3の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the 3rd example of the motion vector detection process for every block in 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態におけるブロック毎動きベクトル検出処理の第3の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the 3rd example of the motion vector detection process for every block in 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第1の実施形態におけるブロック毎動きベクトル検出処理の第3の例を説明するために用いる図である。It is a figure used in order to demonstrate the 3rd example of the motion vector detection processing for every block in 1st Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第2の実施形態の構成例を示すブロック図である。It is a block diagram which shows the structural example of 2nd Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第2の実施形態におけるブロック毎動きベクトル検出処理を説明するための図である。It is a figure for demonstrating the motion vector detection process for every block in 2nd Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第2の実施形態におけるブロック毎動きベクトル検出処理を説明するための図である。It is a figure for demonstrating the motion vector detection process for every block in 2nd Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第2の実施形態におけるブロック毎動きベクトル検出処理の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the example of the motion vector detection process for every block in 2nd Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第2の実施形態におけるブロック毎動きベクトル検出処理の例を説明するためのフローチャートの一部を示す図である。It is a figure which shows a part of flowchart for demonstrating the example of the motion vector detection process for every block in 2nd Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第3の実施形態の構成例を示すブロック図である。It is a block diagram which shows the structural example of 3rd Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第3の実施形態における手ぶれ補正処理を説明するための図である。It is a figure for demonstrating the camera-shake correction process in 3rd Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第4の実施形態の構成例を示すブロック図である。It is a block diagram which shows the structural example of 4th Embodiment of the image processing apparatus by this invention. この発明による画像処理装置の第5の実施形態の構成例を示すブロック図である。It is a block diagram which shows the structural example of 5th Embodiment of the image processing apparatus by this invention. この発明による画像処理方法の他の例を説明するために用いる図である。It is a figure used in order to explain other examples of the image processing method by this invention. ブロックマッチングにより動きベクトルを検出する処理を説明するための図である。It is a figure for demonstrating the process which detects a motion vector by block matching. ブロックマッチングにより動きベクトルを検出する処理を説明するための図である。It is a figure for demonstrating the process which detects a motion vector by block matching. ブロックマッチングにより動きベクトルを検出する処理を説明するための図である。It is a figure for demonstrating the process which detects a motion vector by block matching. ブロックマッチングにより動きベクトルを検出する処理を説明するための図である。It is a figure for demonstrating the process which detects a motion vector by block matching.

符号の説明Explanation of symbols

101…元フレーム、102…参照フレーム、103…ターゲットブロック、105…サーチ範囲、106…参照ブロック、107…参照ベクトル、15…手ぶれ動きベクトル検出部、41〜45…フレームメモリ、TBLi…SADテーブル、SUM_TBL…合算SADテーブル、TBLs…縮小SADテーブル、TBLo…従来のSADテーブル、RV…参照ベクトル、CV…参照縮小ベクトル、NV1〜NV4…近傍参照ベクトル、BLK_Vi…ブロック毎動きベクトル、SUM_V…合算動きベクトル   DESCRIPTION OF SYMBOLS 101 ... Original frame, 102 ... Reference frame, 103 ... Target block, 105 ... Search range, 106 ... Reference block, 107 ... Reference vector, 15 ... Shake motion vector detection part, 41-45 ... Frame memory, TBLi ... SAD table, SUM_TBL: Total SAD table, TBLs: Reduced SAD table, TBLo ... Conventional SAD table, RV ... Reference vector, CV ... Reference reduced vector, NV1 to NV4 ... Neighborhood reference vector, BLK_Vi ... Block-by-block motion vector, SUM_V ... Total motion vector

Claims (22)

画面単位で順次に入力される画像について、注目画面である参照画面と、当該参照画面よりも前の画面である元画面との間の1画面分単位での動きベクトルを算出する画像処理装置であって、
前記元画面中において、複数の所定の位置に、それぞれ複数の画素からなる所定の大きさのターゲットブロックを設定し、前記参照画面において、前記ターゲットブロックと同じ大きさの参照ブロックを、前記複数のターゲットブロックの位置に応じて設定された複数のサーチ範囲のそれぞれにおいて複数個設定し、前記サーチ範囲のそれぞれにおいて、前記設定した前記複数個の参照ブロックのそれぞれについて当該参照ブロック内の各画素の画素値と、前記ターゲットブロック内で対応する位置の各画素の画素値との差分の絶対値の総和である差分絶対値和を求める差分絶対値和算出手段と、
前記複数のサーチ範囲のそれぞれにおいて前記差分絶対値和算出手段で算出された前記差分絶対値和について、前記複数のサーチ範囲のそれぞれで対応する参照ブロック位置のものを合算して合算差分絶対値和を求め、一つのサーチ範囲内の複数参照ブロック位置分の前記合算差分絶対値和を記憶する合算差分絶対値和テーブルを生成する合算差分絶対値和テーブル生成手段と、
前記合算差分絶対値和テーブル生成手段で生成された前記合算差分絶対値和テーブルから、前記元画面に対する前記参照画面の動きベクトルを検出する動きベクトル検出手段と、
を備える画像処理装置。
An image processing apparatus that calculates a motion vector in units of one screen between a reference screen that is an attention screen and an original screen that is a screen before the reference screen for images that are sequentially input in units of screens. There,
In the original screen, a target block having a predetermined size composed of a plurality of pixels is set at a plurality of predetermined positions, and a reference block having the same size as the target block is set on the reference screen. A plurality of search ranges set in accordance with the position of the target block are set, and in each of the search ranges, each pixel in the reference block is set for each of the set reference blocks. A difference absolute value sum calculating means for obtaining a difference absolute value sum that is a sum of absolute values of differences between a value and a pixel value of each pixel at a corresponding position in the target block;
For each of the plurality of search ranges, the difference absolute value sum calculated by the difference absolute value sum calculation means is added to the sum of the reference block positions corresponding to each of the plurality of search ranges to add up the difference absolute value sum. And a sum difference absolute value sum table generating means for generating a sum difference absolute value sum table for storing the sum of sum difference absolute value sums for a plurality of reference block positions within one search range;
A motion vector detecting means for detecting a motion vector of the reference screen relative to the original screen from the summed absolute difference sum table generated by the summed absolute difference sum table generating means;
An image processing apparatus comprising:
請求項1に記載の画像処理装置において、
前記サーチ範囲内の複数参照ブロック位置についての前記差分絶対値和を記憶する差分絶対値和テーブルを、前記複数個のサーチ範囲に対応して複数生成する差分絶対値和テーブル生成手段と、
前記差分絶対値和テーブル生成手段で生成された前記複数の差分絶対値和テーブルのそれぞれにおける前記差分絶対値和の最小値と、前記合算差分絶対値和算出手段で算出された前記合算差分絶対値和の最小値とから、動被写体部分であると見なされる前記ターゲットブロックについての前記差分絶対値和テーブルを検出する手段を設け、
前記動きベクトル検出手段では、前記動被写体部分であると見なされる前記ターゲットブロックについての前記差分絶対値和テーブルの差分絶対値和を除いて、前記合算差分絶対値和を再算出して、合算差分絶対値和テーブルを再算出し、この再算出した前記合算差分絶対値和テーブルから、前記動きベクトルを検出する
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
A difference absolute value sum table generating means for generating a plurality of difference absolute value sum tables for storing the difference absolute value sums for a plurality of reference block positions in the search range in correspondence with the plurality of search ranges;
The minimum value of the difference absolute value sum in each of the plurality of difference absolute value sum tables generated by the difference absolute value sum table generation means, and the sum difference absolute value calculated by the sum difference absolute value sum calculation means Means for detecting the difference absolute value sum table for the target block considered to be a moving subject part from the minimum value of the sum;
The motion vector detection means recalculates the sum of absolute differences, excluding the sum of absolute differences of the difference absolute value sum table for the target block considered to be the moving subject part, and adds the sum of differences An image processing apparatus, wherein an absolute value sum table is recalculated, and the motion vector is detected from the recalculated summed difference absolute value sum table.
画面単位で順次に入力される画像について、注目画面である参照画面と、当該参照画面よりも前の画面である元画面との間の1画面分単位での動きベクトルを算出する画像処理装置であって、
前記元画面中において、複数の所定の位置に、それぞれ複数の画素からなる所定の大きさのターゲットブロックを設定し、前記参照画面において、前記ターゲットブロックと同じ大きさの参照ブロックを、前記複数のターゲットブロックの位置に応じて設定された複数のサーチ範囲のそれぞれにおいて複数個設定し、前記サーチ範囲のそれぞれにおいて、前記設定した前記複数個の参照ブロックのそれぞれについて当該参照ブロック内の各画素の画素値と、前記ターゲットブロック内で対応する位置の各画素の画素値との差分の絶対値の総和である差分絶対値和を求める差分絶対値和算出手段と、
前記参照ブロックのそれぞれの前記参照画面上の位置の、前記ターゲットブロックの画面上の位置との位置ずれ量を、方向成分も含む参照ベクトルとし、当該参照ベクトルを所定の縮小率で縮小した参照縮小ベクトルを得る参照縮小ベクトル取得手段と、
前記複数のサーチ範囲のそれぞれのターゲットブロックについて、前記参照縮小ベクトルに応じた大きさの前記参照ベクトルを前記位置ずれ量とする、前記所定の縮小率に応じて削減された数の複数個の前記参照ブロックのそれぞれについての差分絶対値和を記憶する縮小差分絶対値和テーブルを生成する縮小差分絶対値和テーブル生成手段と、
前記縮小差分絶対値和テーブル生成手段により生成された、複数の前記縮小差分絶対値和テーブルについて、前記複数のサーチ範囲のそれぞれで対応する参照ブロック位置の前記差分絶対値和を合算して合算差分絶対値和を求め、合算縮小差分絶対値和テーブルを生成する合算縮小差分絶対値和テーブル生成手段と、
前記合算縮小差分絶対値和テーブル生成手段で生成された前記合算縮小差分絶対値和テーブルから、前記元画面に対する前記参照画面の動きベクトルを算出する動きベクトル算出手段と、
を備え、
前記縮小差分絶対値和テーブル生成手段は、
前記参照縮小ベクトル取得手段で取得された前記参照縮小ベクトルの近傍値となる複数の前記参照ベクトルを検出する近傍参照ベクトル検出手段と、
前記差分絶対値和算出手段で算出された前記参照ブロックのそれぞれについての前記差分の絶対値の総和から、前記近傍参照ベクトル検出手段で検出された前記近傍の複数の前記参照ベクトルのそれぞれに対応する差分絶対値和のそれぞれを算出する分散差分絶対値和算出手段と、
前記分散差分絶対値和算出手段で算出した前記近傍の複数の前記参照ベクトルのそれぞれに対応する前記差分絶対値和を、それまでの前記近傍の複数の前記参照ベクトルのそれぞれに対応する前記差分絶対値和に加算する分散加算手段と、
を備えることを特徴とする画像処理装置。
An image processing apparatus that calculates a motion vector in units of one screen between a reference screen that is an attention screen and an original screen that is a screen before the reference screen for images that are sequentially input in units of screens. There,
In the original screen, a target block having a predetermined size composed of a plurality of pixels is set at a plurality of predetermined positions, and a reference block having the same size as the target block is set on the reference screen. A plurality of search ranges set in accordance with the position of the target block are set, and in each of the search ranges, each pixel in the reference block is set for each of the set reference blocks. A difference absolute value sum calculating means for obtaining a difference absolute value sum that is a sum of absolute values of differences between a value and a pixel value of each pixel at a corresponding position in the target block;
A reference reduction including a reference vector including a directional component is used as a positional deviation amount of each reference block on the reference screen relative to the target block on the screen, and the reference vector is reduced at a predetermined reduction ratio. A reference reduced vector obtaining means for obtaining a vector;
For each target block in the plurality of search ranges, the reference vector having a size corresponding to the reference reduction vector is used as the positional shift amount, and a plurality of the plurality of the reductions corresponding to the predetermined reduction ratio are performed. A reduced difference absolute value sum table generating means for generating a reduced difference absolute value sum table for storing the difference absolute value sum for each of the reference blocks;
For the plurality of reduced difference absolute value sum tables generated by the reduced difference absolute value sum table generating means, the difference absolute value sums of the reference block positions corresponding to each of the plurality of search ranges are added together to add up the difference. A summed reduced difference absolute value sum table generating means for obtaining an absolute value sum and generating a summed reduced difference absolute value sum table;
A motion vector calculating unit that calculates a motion vector of the reference screen with respect to the original screen from the combined reduced difference absolute value sum table generated by the combined reduced difference absolute value sum table generating unit;
With
The reduced difference absolute value sum table generating means includes:
Neighborhood reference vector detection means for detecting a plurality of the reference vectors that are neighborhood values of the reference reduction vector acquired by the reference reduction vector acquisition means;
Corresponding to each of the plurality of neighboring reference vectors detected by the neighboring reference vector detecting means from the sum of the absolute values of the differences for each of the reference blocks calculated by the difference absolute value sum calculating means. A variance difference absolute value sum calculating means for calculating each of the difference absolute value sums;
The difference absolute value sum corresponding to each of the plurality of neighboring reference vectors calculated by the variance difference absolute value sum calculating means is used as the difference absolute value corresponding to each of the plurality of neighboring reference vectors so far. Distributed addition means for adding to the sum of values;
An image processing apparatus comprising:
画面単位で順次に入力される画像について、注目画面である参照画面と、当該参照画面よりも前の画面である元画面との間の1画面分単位での動きベクトルを算出する画像処理装置であって、
前記元画面中において、複数の所定の位置に、それぞれ複数の画素からなる所定の大きさのターゲットブロックを設定し、前記参照画面において、前記ターゲットブロックと同じ大きさの参照ブロックを、前記複数のターゲットブロックの位置に応じて設定された複数のサーチ範囲のそれぞれにおいて複数個設定し、前記サーチ範囲のそれぞれにおいて、前記設定した前記複数個の参照ブロックのそれぞれについて当該参照ブロック内の各画素の画素値と、前記ターゲットブロック内で対応する位置の各画素の画素値との差分を求める差分算出手段と、
前記参照ブロックのそれぞれの前記参照画面上の位置の、前記ターゲットブロックの画面上の位置との位置ずれ量を、方向成分も含む参照ベクトルとし、当該参照ベクトルを所定の縮小率で縮小した参照縮小ベクトルを得る参照縮小ベクトル取得手段と、
前記複数のサーチ範囲のそれぞれのターゲットブロックについて、前記参照縮小ベクトルに応じた大きさの前記参照ベクトルを前記位置ずれ量とする、前記所定の縮小率に応じて削減された数の複数個の前記参照ブロックのそれぞれについての縮小差分絶対値和を記憶する縮小差分絶対値和テーブルを生成する縮小差分絶対値和テーブル生成手段と、
前記縮小差分絶対値和テーブル生成手段により生成された、複数の前記縮小差分絶対値和テーブルについて、前記複数のサーチ範囲のそれぞれで対応する参照ブロック位置の前記差分絶対値和を合算して合算差分絶対値和を求め、合算縮小差分絶対値和テーブルを生成する合算縮小差分絶対値和テーブル生成手段と、
前記合算縮小差分絶対値和テーブル生成手段で生成された前記合算縮小差分絶対値和テーブルから、前記元画面に対する前記参照画面の動きベクトルを算出する動きベクトル算出手段と、
を備え、
前記縮小差分絶対値和テーブル生成手段は、
前記参照縮小ベクトル取得手段で取得された前記参照縮小ベクトルの近傍値となる複数の前記参照ベクトルを検出する近傍参照ベクトル検出手段と、
前記差分算出手段で算出された前記参照ブロックのそれぞれについての前記差分値から、前記近傍参照ベクトル検出手段で検出された前記近傍の複数の前記参照ベクトルのそれぞれに対応する差分値のそれぞれを算出する分散加算値算出手段と、
前記分散加算値算出手段で算出された前記近傍の複数の前記参照ベクトルのそれぞれに対応する前記差分値を、それまでの前記近傍の複数の前記参照ベクトルに対応する前記差分絶対値和に加算する加算手段と、
を備えることを特徴とする画像処理装置。
An image processing apparatus that calculates a motion vector in units of one screen between a reference screen that is an attention screen and an original screen that is a screen before the reference screen for images that are sequentially input in units of screens. There,
In the original screen, a target block having a predetermined size composed of a plurality of pixels is set at a plurality of predetermined positions, and a reference block having the same size as the target block is set on the reference screen. A plurality of search ranges set in accordance with the position of the target block are set, and in each of the search ranges, each pixel in the reference block is set for each of the set reference blocks. Difference calculating means for obtaining a difference between the value and the pixel value of each pixel at the corresponding position in the target block;
A reference reduction including a reference vector including a directional component is used as a positional deviation amount of each reference block on the reference screen relative to the target block on the screen, and the reference vector is reduced at a predetermined reduction ratio. A reference reduced vector obtaining means for obtaining a vector;
For each target block in the plurality of search ranges, the reference vector having a size corresponding to the reference reduction vector is used as the positional shift amount, and a plurality of the plurality of the reductions corresponding to the predetermined reduction ratio are performed. A reduced difference absolute value sum table generating means for generating a reduced difference absolute value sum table for storing the reduced difference absolute value sum for each of the reference blocks;
For the plurality of reduced difference absolute value sum tables generated by the reduced difference absolute value sum table generating means, the difference absolute value sums of the reference block positions corresponding to each of the plurality of search ranges are added together to add up the difference. A summed reduced difference absolute value sum table generating means for obtaining an absolute value sum and generating a summed reduced difference absolute value sum table;
A motion vector calculating unit that calculates a motion vector of the reference screen with respect to the original screen from the combined reduced difference absolute value sum table generated by the combined reduced difference absolute value sum table generating unit;
With
The reduced difference absolute value sum table generating means includes:
Neighborhood reference vector detection means for detecting a plurality of the reference vectors that are neighborhood values of the reference reduction vector acquired by the reference reduction vector acquisition means;
Each difference value corresponding to each of the plurality of neighboring reference vectors detected by the neighboring reference vector detecting means is calculated from the difference value for each of the reference blocks calculated by the difference calculating means. Distributed addition value calculating means;
The difference value corresponding to each of the plurality of neighboring reference vectors calculated by the variance addition value calculating means is added to the sum of absolute differences corresponding to the plurality of neighboring reference vectors so far. Adding means;
An image processing apparatus comprising:
請求項3または請求項4に記載の画像処理装置において、
前記複数のサーチ範囲のそれぞれのターゲットブロックについての前記縮小差分絶対値和テーブルのそれぞれの前記差分絶対値和の最小値と、前記合算縮小差分絶対値和テーブル生成手段で生成された前記合算縮小差分絶対値和テーブルの前記合算差分絶対値和の最小値とから、動被写体部分であると見なされる前記ターゲットブロックについての前記縮小差分絶対値和テーブルを検出する手段を設け、
前記動きベクトル検出手段では、前記動被写体部分であると見なされる前記ターゲットブロックについての前記縮小差分絶対値和テーブルの前記差分絶対値和を除いて、前記合算差分絶対値和を再算出して合算縮小差分絶対値和テーブルを再算出し、この再算出した前記合算縮小差分絶対値和テーブルから、前記動きベクトルを検出する
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 3 or 4,
The minimum value of the difference absolute value sum of the reduced difference absolute value sum table for each target block of the plurality of search ranges, and the combined reduced difference generated by the combined reduced difference absolute value sum table generating means Means for detecting the reduced difference absolute value sum table for the target block considered to be a moving subject part from the minimum value of the sum of absolute differences sum of the absolute value sum table;
The motion vector detection means recalculates the sum of the sum of absolute differences, excluding the sum of the sum of absolute differences of the reduced difference absolute value sum table for the target block considered to be the moving subject part, and sums up the sum An image processing apparatus characterized by recalculating a reduced difference absolute value sum table and detecting the motion vector from the recalculated summed reduced difference absolute value sum table.
請求項3または請求項4に記載の画像処理装置において、
前記動きベクトル算出手段で算出された前記動きベクトルに基づいて、前記参照画面に対する前記サーチ範囲を、より狭くすると共に、前記所定の縮小率を小さくして、再度、前記請求項3または前記請求項4の各手段を用いて前記動きベクトル算出処理を繰り返す手段を備える
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 3 or 4,
Based on the motion vector calculated by the motion vector calculation means, the search range with respect to the reference screen is made narrower and the predetermined reduction rate is made smaller, and again, the claim 3 or the claim. An image processing apparatus comprising: means for repeating the motion vector calculation process using each of the four means.
請求項3に記載の画像処理装置において、
前記分散差分絶対値和算出手段では、それぞれの前記参照縮小ベクトルと前記近傍の複数の前記参照ベクトルとの隔たりに応じて、前記近傍の複数の前記参照ベクトルに対応する前記差分の絶対値の総和のそれぞれを算出する
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 3.
In the variance difference absolute value sum calculation means, the sum of the absolute values of the differences corresponding to the plurality of neighboring reference vectors according to the distance between each reference reduced vector and the plurality of neighboring reference vectors. An image processing apparatus characterized by calculating each of the above.
請求項4に記載の画像処理装置において、
前記分散加算値算出手段では、それぞれの前記参照縮小ベクトルと前記近傍の複数の前記参照ベクトルとの隔たりに応じて、前記近傍の複数の前記参照ベクトルに対応する前記差分値のそれぞれを算出する
ことを特徴とする画像処理方法。
The image processing apparatus according to claim 4.
The variance addition value calculating means calculates each of the difference values corresponding to the plurality of neighboring reference vectors according to a distance between each of the reference reduced vectors and the plurality of neighboring reference vectors. An image processing method characterized by the above.
請求項3または請求項4に記載の画像処理装置において、
前記所定の縮小率は、前記撮像画面の水平方向の縮小率と、垂直方向の縮小率とを独立に設定可能とした
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 3 or 4,
The image processing apparatus characterized in that the predetermined reduction ratio can be set independently of a horizontal reduction ratio and a vertical reduction ratio of the imaging screen.
請求項1または請求項2に記載の画像処理装置において、
前記動きベクトル算出手段は、
前記合算差分絶対値和テーブルにおける前記合算差分絶対値和の最小値と、当該最小値近傍の前記合算差分絶対値和とから、近似高次曲面を生成する手段と、
前記近似高次曲面の極小値位置を検出する極小値位置検出手段と、
前記極小値位置検出工程で検出された前記極小値位置に対応する前記ターゲットブロックに対応する位置からの位置ずれに相当するベクトルを算出し、この算出したベクトルから前記動きベクトルを算出する手段と、
を備えることを特徴とする画像処理装置。
The image processing apparatus according to claim 1 or 2,
The motion vector calculation means includes
Means for generating an approximate higher-order curved surface from the minimum value of the total sum of absolute differences in the total sum of absolute differences sum table and the sum of the sum of absolute differences near the minimum value;
Minimum value position detecting means for detecting a minimum value position of the approximate higher-order curved surface;
Means for calculating a vector corresponding to a positional deviation from a position corresponding to the target block corresponding to the minimum value position detected in the minimum value position detecting step, and calculating the motion vector from the calculated vector;
An image processing apparatus comprising:
請求項3〜請求項5のいずれかに記載の画像処理装置において、
前記動きベクトル算出手段は、
前記合算縮小差分絶対値和テーブルにおける前記合算差分絶対値和の最小値と、当該最小値近傍の前記合算差分絶対値和とから、近似高次曲面を生成する手段と、
前記近似高次曲面の極小値位置を検出する極小値位置検出手段と、
前記極小値位置検出工程で検出された前記極小値位置に対応する前記ターゲットブロックに対応する位置からの位置ずれに相当するベクトルを算出し、この算出したベクトルから前記動きベクトルを算出する手段と、
を備えることを特徴とする画像処理装置。
In the image processing apparatus according to any one of claims 3 to 5,
The motion vector calculation means includes
Means for generating an approximate higher-order curved surface from the minimum value of the total sum of absolute differences in the total reduced difference absolute value sum table and the sum of the sum of absolute differences near the minimum value;
Minimum value position detecting means for detecting a minimum value position of the approximate higher-order curved surface;
Means for calculating a vector corresponding to a positional deviation from a position corresponding to the target block corresponding to the minimum value position detected in the minimum value position detecting step, and calculating the motion vector from the calculated vector;
An image processing apparatus comprising:
請求項10または請求項11に記載の画像処理装置において、
前記近似高次曲面は、前記最小値と、当該最小値近傍の前記合算差分絶対値和とを用いて、最小自乗法により求められる2次曲面である
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 10 or 11,
The approximate high-order curved surface is a quadratic curved surface obtained by a least square method using the minimum value and the sum of absolute differences in the vicinity of the minimum value.
請求項12に記載の画像処理装置において、
前記最小値近傍の前記合算差分絶対値和は、前記最小値を中心とする、前記最小値の周辺の8個の合算差分絶対値和である
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 12.
The total sum of absolute differences near the minimum value is an eight total sum of absolute differences around the minimum value centered on the minimum value.
請求項12に記載の画像処理装置において、
前記最小値近傍の前記合算差分絶対値和は、前記最小値の周辺の15個の合算差分絶対値和である
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 12.
The total sum of absolute differences near the minimum value is 15 total sums of absolute differences around the minimum value.
画面単位で順次に入力される画像について、注目画面である参照画面と、当該参照画面よりも前の画面である元画面との間の1画面分単位での動きベクトルを算出する画像処理方法であって、
前記元画面中において、複数の所定の位置に、それぞれ複数の画素からなる所定の大きさのターゲットブロックを設定し、前記参照画面において、前記ターゲットブロックと同じ大きさの参照ブロックを、前記複数のターゲットブロックの位置に応じて設定された複数のサーチ範囲のそれぞれにおいて複数個設定し、前記サーチ範囲のそれぞれにおいて、前記設定した前記複数個の参照ブロックのそれぞれについて当該参照ブロック内の各画素の画素値と、前記ターゲットブロック内で対応する位置の各画素の画素値との差分の絶対値の総和である差分絶対値和を求める差分絶対値和算出工程と、
前記複数のサーチ範囲のそれぞれにおいて前記差分絶対値和算出工程で算出された前記差分絶対値和について、前記複数のサーチ範囲のそれぞれで対応する参照ブロック位置のものを合算して合算差分絶対値和を求め、一つのサーチ範囲内の複数参照ブロック位置分の前記合算差分絶対値和を記憶する合算差分絶対値和テーブルを生成する合算差分絶対値和テーブル生成工程と、
前記合算差分絶対値和テーブル生成手段で生成された前記合算差分絶対値和テーブルから、前記元画面に対する前記参照画面の動きベクトルを検出する動きベクトル検出工程と、
を備える画像処理方法。
An image processing method for calculating a motion vector in units of one screen between a reference screen that is a screen of interest and an original screen that is a screen before the reference screen for images that are sequentially input in screen units. There,
In the original screen, a target block having a predetermined size composed of a plurality of pixels is set at a plurality of predetermined positions, and a reference block having the same size as the target block is set on the reference screen. A plurality of search ranges set in accordance with the position of the target block are set, and in each of the search ranges, each pixel in the reference block is set for each of the set reference blocks. A difference absolute value sum calculation step for obtaining a difference absolute value sum that is a sum of absolute values of differences between a value and a pixel value of each pixel at a corresponding position in the target block;
For each of the plurality of search ranges, the difference absolute value sum calculated in the difference absolute value sum calculation step is summed up at the reference block position corresponding to each of the plurality of search ranges, and is summed difference absolute value sum And a sum difference absolute value sum table generation step for generating a sum difference absolute value sum table for storing the sum of sum difference absolute value sums for a plurality of reference block positions within one search range;
A motion vector detecting step of detecting a motion vector of the reference screen relative to the original screen from the summed absolute difference sum table generated by the summed absolute difference sum table generating means;
An image processing method comprising:
請求項15に記載の画像処理方法において、
前記サーチ範囲内の複数参照ブロック位置についての前記差分絶対値和を記憶する差分絶対値和テーブルを、前記複数個のサーチ範囲に対応して複数生成する差分絶対値和テーブル生成工程と、
前記差分絶対値和テーブル生成工程で生成された前記複数の差分絶対値和テーブルのそれぞれにおける前記差分絶対値和の最小値と、前記合算差分絶対値和算出工程で算出された前記合算差分絶対値和の最小値とから、動被写体部分であると見なされる前記ターゲットブロックについての前記差分絶対値和テーブルを検出する工程を設け、
前記動きベクトル検出工程では、前記動被写体部分であると見なされる前記ターゲットブロックについての前記差分絶対値和テーブルの差分絶対値和を除いて、前記合算差分絶対値和を再算出して、合算差分絶対値和テーブルを再算出し、この再算出した前記合算差分絶対値和テーブルから、前記動きベクトルを検出する
ことを特徴とする画像処理方法。
The image processing method according to claim 15, wherein
A difference absolute value sum table generating step of generating a plurality of difference absolute value sum tables for storing the difference absolute value sums for a plurality of reference block positions in the search range corresponding to the plurality of search ranges;
The minimum value of the difference absolute value sum in each of the plurality of difference absolute value sum tables generated in the difference absolute value sum table generation step, and the sum difference absolute value calculated in the sum difference absolute value sum calculation step Providing a step of detecting the difference absolute value sum table for the target block considered to be a moving subject part from the minimum value of the sum;
In the motion vector detection step, the difference absolute value sum of the difference absolute value sum table for the target block that is considered to be the moving subject part is excluded, and the sum difference absolute value sum is recalculated, and a sum difference is obtained. An image processing method, wherein an absolute value sum table is recalculated, and the motion vector is detected from the recalculated summed difference absolute value sum table.
画面単位で順次に入力される画像について、注目画面である参照画面と、当該参照画面よりも前の画面である元画面との間の1画面分単位での動きベクトルを算出する画像処理方法であって、
前記元画面中において、複数の所定の位置に、それぞれ複数の画素からなる所定の大きさのターゲットブロックを設定し、前記参照画面において、前記ターゲットブロックと同じ大きさの参照ブロックを、前記複数のターゲットブロックの位置に応じて設定された複数のサーチ範囲のそれぞれにおいて複数個設定し、前記サーチ範囲のそれぞれにおいて、前記設定した前記複数個の参照ブロックのそれぞれについて当該参照ブロック内の各画素の画素値と、前記ターゲットブロック内で対応する位置の各画素の画素値との差分の絶対値の総和である差分絶対値和を求める差分絶対値和算出工程と、
前記参照ブロックのそれぞれの前記参照画面上の位置の、前記ターゲットブロックの画面上の位置との位置ずれ量を、方向成分も含む参照ベクトルとし、当該参照ベクトルを所定の縮小率で縮小した参照縮小ベクトルを得る参照縮小ベクトル取得工程と、
前記複数のサーチ範囲のそれぞれのターゲットブロックについて、前記参照縮小ベクトルに応じた大きさの前記参照ベクトルを前記位置ずれ量とする、前記所定の縮小率に応じて削減された数の複数個の前記参照ブロックのそれぞれについての差分絶対値和を記憶する縮小差分絶対値和テーブルを生成する縮小差分絶対値和テーブル生成工程と、
前記縮小差分絶対値和テーブル生成工程で生成された、複数の前記縮小差分絶対値和テーブルについて、前記複数のサーチ範囲のそれぞれで対応する参照ブロック位置の前記差分絶対値和を合算して合算差分絶対値和を求め、合算縮小差分絶対値和テーブルを生成する合算縮小差分絶対値和テーブル生成工程と、
前記合算縮小差分絶対値和テーブル生成工程で生成された前記合算縮小差分絶対値和テーブルから、前記元画面に対する前記参照画面の動きベクトルを算出する動きベクトル算出工程と、
を備え、
前記縮小差分絶対値和テーブル生成工程は、
前記参照縮小ベクトル取得工程で取得された前記参照縮小ベクトルの近傍値となる複数の前記参照ベクトルを検出する近傍参照ベクトル検出工程と、
前記差分絶対値和算出工程で算出された前記参照ブロックのそれぞれについての前記差分の絶対値の総和から、前記近傍参照ベクトル検出工程で検出された前記近傍の複数の前記参照ベクトルのそれぞれに対応する差分絶対値和のそれぞれを算出する分散差分絶対値和算出工程と、
前記分散差分絶対値和算出工程で算出した前記近傍の複数の前記参照ベクトルのそれぞれに対応する前記差分絶対値和を、それまでの前記近傍の複数の前記参照ベクトルのそれぞれに対応する前記差分絶対値和に加算する分散加算工程と、
を備えることを特徴とする画像処理方法。
An image processing method for calculating a motion vector in units of one screen between a reference screen that is a screen of interest and an original screen that is a screen before the reference screen for images that are sequentially input in screen units. There,
In the original screen, a target block having a predetermined size composed of a plurality of pixels is set at a plurality of predetermined positions, and a reference block having the same size as the target block is set on the reference screen. A plurality of search ranges set in accordance with the position of the target block are set, and in each of the search ranges, each pixel in the reference block is set for each of the set reference blocks. A difference absolute value sum calculation step for obtaining a difference absolute value sum that is a sum of absolute values of differences between a value and a pixel value of each pixel at a corresponding position in the target block;
A reference reduction including a reference vector including a directional component is used as a positional deviation amount of each reference block on the reference screen relative to the target block on the screen, and the reference vector is reduced at a predetermined reduction ratio. A reference reduced vector obtaining step for obtaining a vector;
For each target block in the plurality of search ranges, the reference vector having a size corresponding to the reference reduction vector is used as the positional shift amount, and a plurality of the plurality of the reductions corresponding to the predetermined reduction ratio are performed. A reduced difference absolute value sum table generating step for generating a reduced difference absolute value sum table for storing the difference absolute value sum for each of the reference blocks;
For the plurality of reduced difference absolute value sum tables generated in the reduced difference absolute value sum table generating step, the difference absolute value sums of the reference block positions corresponding to each of the plurality of search ranges are added together to add up the difference. Obtaining an absolute value sum and generating a combined reduced difference absolute value sum table, and a combined reduced difference absolute value sum table generating step;
A motion vector calculating step of calculating a motion vector of the reference screen relative to the original screen from the combined reduced difference absolute value sum table generated in the combined reduced difference absolute value sum table generating step;
With
The reduced difference absolute value sum table generating step includes:
A neighborhood reference vector detection step of detecting a plurality of the reference vectors that are neighborhood values of the reference reduction vector acquired in the reference reduction vector acquisition step;
Corresponding to each of the plurality of neighboring reference vectors detected in the neighborhood reference vector detection step from the sum of absolute values of the differences for each of the reference blocks calculated in the difference absolute value sum calculation step. A variance difference absolute value sum calculation step of calculating each of the difference absolute value sums;
The difference absolute value sum corresponding to each of the plurality of neighboring reference vectors calculated in the variance difference absolute value sum calculating step is used as the difference absolute value corresponding to each of the plurality of neighboring reference vectors so far. A variance addition step of adding to the sum of values;
An image processing method comprising:
画面単位で順次に入力される画像について、注目画面である参照画面と、当該参照画面よりも前の画面である元画面との間の1画面分単位での動きベクトルを算出する画像処理方法であって、
前記元画面中において、複数の所定の位置に、それぞれ複数の画素からなる所定の大きさのターゲットブロックを設定し、前記参照画面において、前記ターゲットブロックと同じ大きさの参照ブロックを、前記複数のターゲットブロックの位置に応じて設定された複数のサーチ範囲のそれぞれにおいて複数個設定し、前記サーチ範囲のそれぞれにおいて、前記設定した前記複数個の参照ブロックのそれぞれについて当該参照ブロック内の各画素の画素値と、前記ターゲットブロック内で対応する位置の各画素の画素値との差分を求める差分算出工程と、
前記参照ブロックのそれぞれの前記参照画面上の位置の、前記ターゲットブロックの画面上の位置との位置ずれ量を、方向成分も含む参照ベクトルとし、当該参照ベクトルを所定の縮小率で縮小した参照縮小ベクトルを得る参照縮小ベクトル取得工程と、
前記複数のサーチ範囲のそれぞれのターゲットブロックについて、前記参照縮小ベクトルに応じた大きさの前記参照ベクトルを前記位置ずれ量とする、前記所定の縮小率に応じて削減された数の複数個の前記参照ブロックのそれぞれについての差分絶対値和を記憶する縮小差分絶対値和テーブルを生成する縮小差分絶対値和テーブル生成工程と、
前記縮小差分絶対値和テーブル生成工程で生成された、複数の前記縮小差分絶対値和テーブルについて、前記複数のサーチ範囲のそれぞれで対応する参照ブロック位置の前記差分絶対値和を合算して合算差分絶対値和を求め、合算縮小差分絶対値和テーブルを生成する合算縮小差分絶対値和テーブル生成工程と、
前記合算縮小差分絶対値和テーブル生成工程で生成された前記合算縮小差分絶対値和テーブルから、前記元画面に対する前記参照画面の動きベクトルを算出する動きベクトル算出工程と、
を備え、
前記縮小差分絶対値和テーブル生成工程は、
前記参照縮小ベクトル取得手段で取得された前記参照縮小ベクトルの近傍値となる複数の前記参照ベクトルを検出する近傍参照ベクトル検出工程と、
前記差分算出手段で算出された前記参照ブロックのそれぞれについての前記差分値から、前記近傍参照ベクトル検出手段で検出された前記近傍の複数の前記参照ベクトルのそれぞれに対応する差分値のそれぞれを算出する分散加算値算出工程と、
前記分散加算値算出工程で算出された前記近傍の複数の前記参照ベクトルのそれぞれに対応する前記差分値を、それまでの前記近傍の複数の前記参照ベクトルに対応する前記差分絶対値和に加算する加算工程と、
を備えることを特徴とする画像処理方法。
An image processing method for calculating a motion vector in units of one screen between a reference screen that is a screen of interest and an original screen that is a screen before the reference screen for images that are sequentially input in screen units. There,
In the original screen, a target block having a predetermined size composed of a plurality of pixels is set at a plurality of predetermined positions, and a reference block having the same size as the target block is set on the reference screen. A plurality of search ranges set in accordance with the position of the target block are set, and in each of the search ranges, each pixel in the reference block is set for each of the set reference blocks. A difference calculating step for obtaining a difference between the value and a pixel value of each pixel at a corresponding position in the target block;
A reference reduction including a reference vector including a directional component is used as a positional deviation amount of each reference block on the reference screen relative to the target block on the screen, and the reference vector is reduced at a predetermined reduction ratio. A reference reduced vector obtaining step for obtaining a vector;
For each target block in the plurality of search ranges, the reference vector having a size corresponding to the reference reduction vector is used as the positional shift amount, and a plurality of the plurality of the reductions corresponding to the predetermined reduction ratio are performed. A reduced difference absolute value sum table generating step for generating a reduced difference absolute value sum table for storing the difference absolute value sum for each of the reference blocks;
For the plurality of reduced difference absolute value sum tables generated in the reduced difference absolute value sum table generating step, the difference absolute value sums of the reference block positions corresponding to each of the plurality of search ranges are added together to add up the difference. Obtaining an absolute value sum and generating a combined reduced difference absolute value sum table, and a combined reduced difference absolute value sum table generating step;
A motion vector calculating step of calculating a motion vector of the reference screen relative to the original screen from the combined reduced difference absolute value sum table generated in the combined reduced difference absolute value sum table generating step;
With
The reduced difference absolute value sum table generating step includes:
A neighborhood reference vector detection step of detecting a plurality of the reference vectors that are neighborhood values of the reference reduced vector acquired by the reference reduced vector acquisition means;
Each difference value corresponding to each of the plurality of neighboring reference vectors detected by the neighboring reference vector detecting means is calculated from the difference value for each of the reference blocks calculated by the difference calculating means. Dispersion added value calculation step;
The difference value corresponding to each of the plurality of neighboring reference vectors calculated in the variance addition value calculating step is added to the sum of absolute differences corresponding to the plurality of neighboring reference vectors so far. Adding step;
An image processing method comprising:
請求項17または請求項18に記載の画像処理装置において、
前記複数のサーチ範囲のそれぞれのターゲットブロックについての前記縮小差分絶対値和テーブルのそれぞれの前記差分絶対値和の最小値と、前記合算縮小差分絶対値和テーブル生成手段で生成された前記合算縮小差分絶対値和テーブルの前記合算差分絶対値和の最小値とから、動被写体部分であると見なされる前記ターゲットブロックについての前記縮小差分絶対値和テーブルを検出する工程を設け、
前記動きベクトル検出工程では、前記動被写体部分であると見なされる前記ターゲットブロックについての前記縮小差分絶対値和テーブルの前記差分絶対値和を除いて、前記合算差分絶対値和を再算出して合算縮小差分絶対値和テーブルを再算出し、この再算出した前記合算縮小差分絶対値和テーブルから、前記動きベクトルを検出する
ことを特徴とする画像処理方法。
The image processing apparatus according to claim 17 or 18,
The minimum value of the difference absolute value sum of the reduced difference absolute value sum table for each target block of the plurality of search ranges, and the combined reduced difference generated by the combined reduced difference absolute value sum table generating means Providing a step of detecting the reduced difference absolute value sum table for the target block that is considered to be a moving subject part from the minimum value of the sum of absolute differences of the absolute value sum table;
In the motion vector detection step, excluding the difference absolute value sum of the reduced difference absolute value sum table for the target block that is regarded as the moving subject portion, the sum of absolute differences is recalculated and summed. An image processing method, wherein a reduced difference absolute value sum table is recalculated, and the motion vector is detected from the recalculated summed reduced difference absolute value sum table.
請求項15または請求項16に記載の画像処理方法において、
前記動きベクトル算出工程は、
前記合算差分絶対値和テーブルにおける前記合算差分絶対値和の最小値と、当該最小値近傍の前記合算差分絶対値和とから、近似高次曲面を生成する工程と、
前記近似高次曲面の極小値位置を検出する極小値位置検出工程と、
前記極小値位置検出工程で検出された前記極小値位置に対応する前記ターゲットブロックに対応する位置からの位置ずれに相当するベクトルを算出し、この算出したベクトルから前記動きベクトルを算出する工程と、
を備えることを特徴とする画像処理方法。
The image processing method according to claim 15 or 16,
The motion vector calculation step includes:
Generating an approximate higher-order curved surface from the minimum value of the total sum of absolute differences in the total sum of absolute differences and the sum of absolute differences near the minimum value;
A minimum value position detecting step for detecting a minimum value position of the approximate higher-order curved surface;
Calculating a vector corresponding to a positional deviation from a position corresponding to the target block corresponding to the minimum value position detected in the minimum value position detecting step, and calculating the motion vector from the calculated vector;
An image processing method comprising:
請求項17〜請求項19のいずれかに記載の画像処理方法において、
前記動きベクトル算出工程は、
前記合算縮小差分絶対値和テーブルにおける前記合算差分絶対値和の最小値と、当該最小値近傍の前記合算差分絶対値和とから、近似高次曲面を生成する工程と、
前記近似高次曲面の極小値位置を検出する極小値位置検出工程と、
前記極小値位置検出工程で検出された前記極小値位置に対応する前記ターゲットブロックに対応する位置からの位置ずれに相当するベクトルを算出し、この算出したベクトルから前記動きベクトルを算出する工程と、
を備えることを特徴とする画像処理方法。
In the image processing method in any one of Claims 17-19,
The motion vector calculation step includes:
Generating an approximate higher-order curved surface from the minimum value of the total sum of absolute differences in the total reduced difference absolute value sum table and the sum of the sum of absolute differences near the minimum value;
A minimum value position detecting step for detecting a minimum value position of the approximate higher-order curved surface;
Calculating a vector corresponding to a positional deviation from a position corresponding to the target block corresponding to the minimum value position detected in the minimum value position detecting step, and calculating the motion vector from the calculated vector;
An image processing method comprising:
請求項20または請求項21に記載の画像処理方法において、
前記近似高次曲面は、前記最小値と、当該最小値近傍の前記合算差分絶対値和とを用いて、最小自乗法により求められる2次曲面である
ことを特徴とする画像処理方法。
The image processing method according to claim 20 or 21,
The approximate high-order curved surface is a quadratic curved surface obtained by a least square method using the minimum value and the sum of absolute sums of differences near the minimum value.
JP2006147608A 2006-05-29 2006-05-29 Image processing apparatus and image processing method Expired - Fee Related JP4904925B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006147608A JP4904925B2 (en) 2006-05-29 2006-05-29 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006147608A JP4904925B2 (en) 2006-05-29 2006-05-29 Image processing apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2007318578A true JP2007318578A (en) 2007-12-06
JP4904925B2 JP4904925B2 (en) 2012-03-28

Family

ID=38852020

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006147608A Expired - Fee Related JP4904925B2 (en) 2006-05-29 2006-05-29 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP4904925B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009278578A (en) * 2008-05-19 2009-11-26 Sony Corp Image processing apparatus and method
JP2011520339A (en) * 2008-04-22 2011-07-14 コア ロジック,インコーポレイテッド Image stabilization apparatus and method for moving image
JP2015216510A (en) * 2014-05-12 2015-12-03 キヤノン株式会社 Imaging device, control method of the same, and information processing system
US9332272B2 (en) 2013-03-18 2016-05-03 Fujitsu Limited Encoding apparatus, encoding method, and computer product
JP2016143941A (en) * 2015-01-30 2016-08-08 株式会社朋栄 Global motion estimation processing method by local block matching, and image processing apparatus
CN117911405A (en) * 2024-03-19 2024-04-19 济南科汛智能科技有限公司 X-ray image processing method for dental pulp and dental body detection

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05336432A (en) * 1992-05-30 1993-12-17 Sony Corp Camera shake detecting device for image
JP3303312B2 (en) * 1991-10-11 2002-07-22 ソニー株式会社 Image vibration correction apparatus and image vibration correction method
JP2004241880A (en) * 2003-02-04 2004-08-26 Sony Corp Apparatus and method for image processing, recording medium, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3303312B2 (en) * 1991-10-11 2002-07-22 ソニー株式会社 Image vibration correction apparatus and image vibration correction method
JPH05336432A (en) * 1992-05-30 1993-12-17 Sony Corp Camera shake detecting device for image
JP2004241880A (en) * 2003-02-04 2004-08-26 Sony Corp Apparatus and method for image processing, recording medium, and program

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011520339A (en) * 2008-04-22 2011-07-14 コア ロジック,インコーポレイテッド Image stabilization apparatus and method for moving image
JP2009278578A (en) * 2008-05-19 2009-11-26 Sony Corp Image processing apparatus and method
JP4506875B2 (en) * 2008-05-19 2010-07-21 ソニー株式会社 Image processing apparatus and image processing method
US8885715B2 (en) 2008-05-19 2014-11-11 Sony Corporation Image processing apparatus and image processing method
US9332272B2 (en) 2013-03-18 2016-05-03 Fujitsu Limited Encoding apparatus, encoding method, and computer product
JP2015216510A (en) * 2014-05-12 2015-12-03 キヤノン株式会社 Imaging device, control method of the same, and information processing system
JP2016143941A (en) * 2015-01-30 2016-08-08 株式会社朋栄 Global motion estimation processing method by local block matching, and image processing apparatus
CN117911405A (en) * 2024-03-19 2024-04-19 济南科汛智能科技有限公司 X-ray image processing method for dental pulp and dental body detection
CN117911405B (en) * 2024-03-19 2024-05-24 济南科汛智能科技有限公司 X-ray image processing method for dental pulp and dental body detection

Also Published As

Publication number Publication date
JP4904925B2 (en) 2012-03-28

Similar Documents

Publication Publication Date Title
JP4178480B2 (en) Image processing apparatus, image processing method, imaging apparatus, and imaging method
JP4178481B2 (en) Image processing apparatus, image processing method, imaging apparatus, and imaging method
JP4304528B2 (en) Image processing apparatus and image processing method
JP4655957B2 (en) Captured image distortion correction method, captured image distortion correction apparatus, imaging method, and imaging apparatus
JP4340915B2 (en) Captured image signal distortion correction method, captured image signal distortion correction apparatus, imaging method, and imaging apparatus
JP2007215114A (en) Method of correcting distortion of taken image and device of correcting distortion of taken image, and imaging apparatus
JP4754939B2 (en) Image processing device
WO2011129249A1 (en) Image processing device, image capture device, program, and image processing method
JP2009071689A (en) Image processing apparatus, image processing method, and imaging apparatus
JP4904925B2 (en) Image processing apparatus and image processing method
JP2009105533A (en) Image processing device, imaging device, image processing method, and picked-up image processing method
JP2007323458A (en) Image processor and image processing method
JP4670630B2 (en) Image processing apparatus, image processing method, imaging apparatus, and imaging method
CN100559843C (en) Image processing apparatus and image processing method
JP2009116763A (en) Image processing apparatus, and memory access method for image data
JP4998134B2 (en) Image processing apparatus and image processing method
JP5780747B2 (en) Image processing apparatus, image processing method, and program
JP5669556B2 (en) Image processing apparatus, image processing method, and program
JP2009140046A (en) Image processing apparatus and memory access method for image data

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20081217

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20090807

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20091005

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101126

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110111

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

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

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

Free format text: PAYMENT UNTIL: 20150120

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20150120

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees