JP2007088910A - Motion vector detecting device and imaging apparatus - Google Patents

Motion vector detecting device and imaging apparatus Download PDF

Info

Publication number
JP2007088910A
JP2007088910A JP2005276260A JP2005276260A JP2007088910A JP 2007088910 A JP2007088910 A JP 2007088910A JP 2005276260 A JP2005276260 A JP 2005276260A JP 2005276260 A JP2005276260 A JP 2005276260A JP 2007088910 A JP2007088910 A JP 2007088910A
Authority
JP
Japan
Prior art keywords
block
data
unit
reference block
correlation calculation
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
JP2005276260A
Other languages
Japanese (ja)
Other versions
JP4547321B2 (en
Inventor
Yoshinobu Tanaka
義信 田中
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.)
Olympus Corp
Olympus Imaging Corp
Original Assignee
Olympus Corp
Olympus Imaging 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 Olympus Corp, Olympus Imaging Corp filed Critical Olympus Corp
Priority to JP2005276260A priority Critical patent/JP4547321B2/en
Publication of JP2007088910A publication Critical patent/JP2007088910A/en
Application granted granted Critical
Publication of JP4547321B2 publication Critical patent/JP4547321B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a motion vector detecting device that is small in circuit scale, and to provide an imaging apparatus that utilizes such a motion vector detecting device. <P>SOLUTION: A unit block of a criterion block, stored in a criterion block data storage SRAM 2a, is inputted to correlation operation sections 3a-3h in common, and a unit block of a reference block, resulting from horizontally shifting the reference block pixel by pixel in a unit block of a search area stored in a search area data storage SRAM 2b, is inputted to the correlation operation sections 3a-3h, respectively. Each time the unit block of the criterion block and the unit block of the reference block are inputted, the correlation operation sections 3a-3h perform correlation operations. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、動きベクトル検出装置及び撮像装置に関する。   The present invention relates to a motion vector detection device and an imaging device.

動きベクトルは動画像の手ぶれ補正や動画像の圧縮の分野において利用されている。この動きベクトルの検出方法としては、ブロックマッチング法を利用したものが広く知られている。ブロックマッチング法とは、2枚の画像(このうち一方を基準フレーム、他方を参照フレームと呼ぶ)の間の動き量を検出するための方法である。   Motion vectors are used in the fields of motion image stabilization and motion image compression. As a motion vector detection method, a method using a block matching method is widely known. The block matching method is a method for detecting the amount of motion between two images (one of which is called a standard frame and the other is called a reference frame).

以下、図面を参照してブロックマッチング法の簡単な原理を説明する。ブロックマッチング法では、基準フレームにおける特定の領域(基準ブロック)と、基準ブロックと同一のブロックサイズを有する参照フレーム内の参照ブロックとの間で相関演算(一般的に、差分絶対値和演算や差分二乗和演算が用いられる)を行い、基準ブロックと最も相関の高い参照ブロックの位置を検出することで動きベクトルを求めている。   Hereinafter, a simple principle of the block matching method will be described with reference to the drawings. In the block matching method, a correlation operation is performed between a specific area (a reference block) in a reference frame and a reference block in a reference frame having the same block size as the reference block (generally, an absolute difference sum calculation or a difference). The motion vector is obtained by detecting the position of the reference block having the highest correlation with the base block.

相関演算を行う場合には、図17(a)に示すような基準フレーム300a内の1つの基準ブロック301aに対して、図17(b)に示すような参照フレーム300b内に参照ブロック301bを設定する。そして、あるサーチエリア302b内で参照ブロック301bの位置を、水平及び垂直方向に1画素ずつずらしながら基準ブロックと参照ブロックとの間での相関演算を行う。   When performing the correlation calculation, a reference block 301b is set in the reference frame 300b as shown in FIG. 17B with respect to one reference block 301a in the reference frame 300a as shown in FIG. To do. Then, correlation calculation is performed between the reference block and the reference block while shifting the position of the reference block 301b by one pixel in the horizontal and vertical directions within a certain search area 302b.

図18は、従来の動きベクトル検出装置の構成を示す図である。ここで、図18は基準ブロック及び参照ブロックのブロックサイズが4画素×4ラインの場合の構成について示している。   FIG. 18 is a diagram illustrating a configuration of a conventional motion vector detection device. Here, FIG. 18 shows a configuration when the block sizes of the base block and the reference block are 4 pixels × 4 lines.

図18の動きベクトル検出装置は、メインメモリ401と、基準フレームレジスタ群402aと、参照フレームレジスタ群402bと、相関演算部403と、最小値検出部404と、タイミング回路405とから構成されている。   18 includes a main memory 401, a reference frame register group 402a, a reference frame register group 402b, a correlation calculation unit 403, a minimum value detection unit 404, and a timing circuit 405. .

メインメモリ401は、例えばSDRAMによって構成され、上記した基準フレームのデータ(基準フレームデータ)と参照フレームのデータ(参照フレームデータ)とを格納している。基準フレームレジスタ群402aは、基準ブロックのブロックサイズに対応した複数のレジスタ(図18の例ではレジスタがフリップフロップ(FF)から構成されているものとしている)で構成されており、メインメモリ401に格納されている基準フレームデータを基準ブロック単位で取得し保持する。参照フレームレジスタ群402bは、参照ブロックのブロックサイズに対応した複数のレジスタ(FF)とサーチエリアのエリアサイズに応じた量だけデータを遅延させる複数の遅延器とから構成されており、メインメモリ401から参照フレームデータをサーチエリア単位で取得し保持する。   The main memory 401 is composed of, for example, SDRAM, and stores the above-described reference frame data (reference frame data) and reference frame data (reference frame data). The reference frame register group 402a includes a plurality of registers corresponding to the block size of the reference block (in the example of FIG. 18, the registers are configured by flip-flops (FF)). The stored reference frame data is acquired and held in units of reference blocks. The reference frame register group 402b includes a plurality of registers (FF) corresponding to the block size of the reference block and a plurality of delay devices that delay data by an amount corresponding to the area size of the search area. Reference frame data is acquired and stored in units of search areas.

相関演算部403は、基準フレームレジスタ群402aから出力される基準ブロックのデータ及び参照フレームレジスタ群402bから出力される参照ブロックのデータを取得して基準ブロックと参照ブロックとの間での相関演算を行う。なお、図18における相関演算部403は、差分絶対値和を演算する回路を示しており、この場合、相関演算部403は、基準ブロックと参照ブロックの画素毎の差分絶対値を演算した後、それらの総和を求めて最小値検出部404に出力する。   The correlation calculation unit 403 acquires the data of the standard block output from the standard frame register group 402a and the data of the reference block output from the reference frame register group 402b, and performs correlation calculation between the standard block and the reference block. Do. Note that the correlation calculation unit 403 in FIG. 18 shows a circuit that calculates the sum of absolute differences. In this case, the correlation calculation unit 403 calculates the difference absolute value for each pixel of the base block and the reference block, The total sum thereof is obtained and output to the minimum value detection unit 404.

最小値検出部404は、相関演算部403における相関演算結果が最も小さくなるときの参照ブロックの位置に基づいて動きベクトルを求める。この最小値検出部404は、比較器404bと、フリップフロップ(FF)404cと、セレクタ(SEL)404dと、FF404eとから構成されている。比較器404bは相関演算部403における相関演算結果を前回の相関演算結果と比較する。FF404cは比較器404bの出力を前回の相関演算結果として保持する。SEL404dは比較器404bからの出力に応じて今回の参照ブロックの位置情報と前回の参照ブロックの位置情報の何れかを出力する。FF404eはSEL404dの出力を前回の参照ブロックの位置情報として保持する。   The minimum value detection unit 404 obtains a motion vector based on the position of the reference block when the correlation calculation result in the correlation calculation unit 403 is the smallest. The minimum value detection unit 404 includes a comparator 404b, a flip-flop (FF) 404c, a selector (SEL) 404d, and an FF 404e. The comparator 404b compares the correlation calculation result in the correlation calculation unit 403 with the previous correlation calculation result. The FF 404c holds the output of the comparator 404b as the previous correlation calculation result. In response to the output from the comparator 404b, the SEL 404d outputs either the current reference block position information or the previous reference block position information. The FF 404e holds the output of the SEL 404d as the position information of the previous reference block.

タイミング回路405は、参照ブロックを1画素移動させるタイミング毎に参照ブロックの位置情報を示す信号を最小値検出部404に出力する。   The timing circuit 405 outputs a signal indicating the position information of the reference block to the minimum value detection unit 404 every time the reference block is moved by one pixel.

このような構成においては、メインメモリ401内の基準フレームのデータは、基準ブロック単位で基準フレームレジスタ群402aによって読み出されてシリパラ変換され、基準ブロックの全画素のデータが一度に相関演算部403に出力される。また、メインメモリ401内の参照フレームのデータは、サーチエリア単位で参照フレームレジスタ群402bによって読み出されてシリパラ変換され、参照ブロックの全画素のデータが一度に相関演算部403に出力される。ここで、サーチエリア単位で読み出されたデータの中で今回の相関演算に用いられない参照ブロック外のデータは遅延器において保持される。   In such a configuration, the reference frame data in the main memory 401 is read and serially converted by the reference frame register group 402a in units of reference blocks, and the data of all the pixels in the reference block are correlated at one time. Is output. Also, the reference frame data in the main memory 401 is read out by the reference frame register group 402b in search area units and subjected to serial-parallel conversion, and the data of all the pixels in the reference block are output to the correlation calculation unit 403 at a time. Here, data outside the reference block that is not used for the current correlation calculation among the data read in units of search areas is held in the delay unit.

相関演算部403は、基準フレームレジスタ群402aから出力された基準ブロックの全画素のデータ及び参照フレームレジスタ群402bから出力された参照ブロックの全画素のデータを取得して、各画素の差分絶対値を演算した後、それらの総和を求めて最小値検出部404に出力する。   The correlation calculation unit 403 acquires the data of all pixels of the reference block output from the reference frame register group 402a and the data of all pixels of the reference block output from the reference frame register group 402b, and calculates the absolute difference value of each pixel. Are calculated, and the sum of them is obtained and output to the minimum value detection unit 404.

最小値検出部404内部の比較器404bは、相関演算部403における相関演算結果をFF404cに保持されている前回の相関演算結果と比較して、何れか小さいほうをSEL404dに出力する。SEL404dは、比較器404bの出力に応じて今回タイミング回路405から入力された参照ブロックの位置情報とFF404eに保持されている前回の参照ブロックの位置情報の何れかを出力する。これにより、相関演算が終了したときに、最終的に最小値検出部404から出力される参照ブロックの位置情報が動きベクトルとなる。
このような動きベクトル検出回路は、例えば特許文献1において提案されている。
特開平10−255047号公報
The comparator 404b in the minimum value detection unit 404 compares the correlation calculation result in the correlation calculation unit 403 with the previous correlation calculation result held in the FF 404c, and outputs the smaller one to the SEL 404d. The SEL 404d outputs either the reference block position information input from the current timing circuit 405 or the previous reference block position information held in the FF 404e according to the output of the comparator 404b. Thereby, when the correlation calculation is completed, the position information of the reference block that is finally output from the minimum value detection unit 404 becomes a motion vector.
Such a motion vector detection circuit is proposed in Patent Document 1, for example.
Japanese Patent Laid-Open No. 10-255047

ここで、ブロックマッチング法は、正確な動きベクトルを検出できるものの、回路規模が大きくなりやすいという問題がある。例えば、上記特許文献1において提案されているような動きベクトル検出装置は、基準ブロック及び参照ブロックのブロックサイズの増加に伴って、基準フレームレジスタ群と参照フレームレジスタ群を構成するレジスタの数を増加させる必要があるため、回路規模が大きくなりやすい。   Here, although the block matching method can detect an accurate motion vector, there is a problem that the circuit scale tends to be large. For example, the motion vector detection apparatus as proposed in Patent Document 1 increases the number of registers constituting the base frame register group and the reference frame register group as the block sizes of the base block and the reference block increase. Therefore, the circuit scale tends to be large.

本発明は、上記の事情に鑑みてなされたもので、回路規模の小さい動きベクトル検出装置及びこのような動きベクトル検出装置を利用した撮像装置を提供することを目的とする。   The present invention has been made in view of the above circumstances, and an object thereof is to provide a motion vector detection device with a small circuit scale and an imaging device using such a motion vector detection device.

上記の目的を達成するために、本発明の第1の態様による動きベクトル検出装置は、基準フレームを複数の基準ブロックに分割し、参照フレームに前記基準フレームに対応するサーチエリアを設定し、前記基準ブロックと前記サーチエリア内の参照ブロックとの間で相関演算を行うことで動きベクトルを検出する動きベクトル検出装置において、前記基準ブロックのデータを格納する基準ブロックデータ格納部と、前記サーチエリアのデータを格納するサーチエリアデータ格納部と、前記基準ブロックのデータと前記サーチエリアのデータ内の参照ブロックのデータとを用いて複数の異なる相関演算を行う複数の相関演算部とを具備し、前記複数の相関演算部に共通に前記基準ブロックのデータを所定ライン分ずつに分割した基準ブロックの単位ブロックのデータを入力すると共に、前記複数の相関演算部のそれぞれに前記サーチエリアのデータを前記所定ライン分ずつに分割したサーチエリアのデータの単位ブロックにおいて前記参照ブロックを水平方向に1画素ずつずらして得られる複数の参照ブロックの単位ブロックのデータのそれぞれを入力することを特徴とする。   In order to achieve the above object, a motion vector detection device according to the first aspect of the present invention divides a reference frame into a plurality of reference blocks, sets a search area corresponding to the reference frame in a reference frame, and In a motion vector detection device that detects a motion vector by performing a correlation operation between a reference block and a reference block in the search area, a reference block data storage unit that stores data of the reference block, A search area data storage unit for storing data, and a plurality of correlation calculation units for performing a plurality of different correlation calculations using the data of the reference block and the data of reference blocks in the data of the search area, A reference block obtained by dividing the reference block data by a predetermined number of lines in common to a plurality of correlation calculation units. The reference block data is input in the horizontal direction in a unit block of search area data obtained by dividing the search area data into the predetermined lines for each of the plurality of correlation calculation units. Each of the data of unit blocks of a plurality of reference blocks obtained by shifting is input.

この第1の態様においては、複数の相関演算部に基準ブロックの単位ブロックを共通に入力し、サーチエリアのデータの単位ブロックにおいて参照ブロックを水平方向に1画素ずつずらして得られる複数の参照ブロックの単位ブロックをそれぞれ入力することにより、複数の相関演算部への入力の大部分を共通化することができる。これにより、回路規模を小さくすることができる。   In this first aspect, a plurality of reference blocks are obtained by commonly inputting unit blocks of the base block to a plurality of correlation calculation units and shifting the reference blocks by one pixel in the horizontal direction in the unit blocks of data in the search area. By inputting each unit block, most of the inputs to the plurality of correlation calculation units can be made common. Thereby, the circuit scale can be reduced.

また、上記の目的を達成するために、本発明の第2の態様による撮像装置は、被写体を複数回撮像して基準フレームのデータと参照フレームのデータを得る撮像部と、前記撮像部で得られた基準フレームのデータと前記参照フレームのデータとから前記相関演算を行って前記動きベクトルを検出する第1の態様に記載の動きベクトル検出装置と、前記動きベクトル検出装置で検出された動きベクトルに基づいて手ぶれ補正処理と動画像圧縮処理の少なくとも何れか一方を行う画像処理部とを具備することを特徴とする。   In order to achieve the above object, an imaging apparatus according to a second aspect of the present invention includes an imaging unit that captures a subject a plurality of times to obtain reference frame data and reference frame data, and the imaging unit The motion vector detection device according to the first aspect, wherein the motion vector is detected by performing the correlation calculation from the reference frame data and the reference frame data, and the motion vector detected by the motion vector detection device And an image processing unit that performs at least one of a camera shake correction process and a moving image compression process.

この第2の態様によれば、第1の態様の動きベクトル検出装置を撮像装置における手ぶれ補正処理と動画像圧縮処理とに利用することができる。   According to the second aspect, the motion vector detection device of the first aspect can be used for the camera shake correction process and the moving image compression process in the imaging apparatus.

本発明によれば、回路規模の小さい動きベクトル検出装置及びこのような動きベクトル検出装置を利用した撮像装置を提供することができる。   According to the present invention, it is possible to provide a motion vector detection device having a small circuit scale and an imaging device using such a motion vector detection device.

以下、図面を参照して本発明の実施形態を説明する。
図1は、本発明の一実施形態に係る動きベクトル検出装置の構成について示す図である。ここで、図1の構成は、基準ブロックのブロックサイズが図2(a)に示すような16画素×16ライン、サーチエリアのエリアサイズが図2(b)に示すような23画素×23ラインの場合の例である。ここで、参照ブロックのブロックサイズは、基準ブロックのブロックサイズと同一である。したがって、サーチエリアの中央位置を参照ブロックの基準位置とすると、参照ブロックは、サーチエリア内を水平方向に−4画素〜+3画素、垂直方向に−4画素〜+3画素の範囲を移動する。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a diagram showing a configuration of a motion vector detection device according to an embodiment of the present invention. Here, in the configuration of FIG. 1, the block size of the reference block is 16 pixels × 16 lines as shown in FIG. 2A, and the area size of the search area is 23 pixels × 23 lines as shown in FIG. 2B. This is an example. Here, the block size of the reference block is the same as the block size of the base block. Therefore, if the center position of the search area is the reference position of the reference block, the reference block moves within the search area in a range of −4 pixels to +3 pixels in the horizontal direction and −4 pixels to +3 pixels in the vertical direction.

図1の動きベクトル検出装置は、メインメモリ1と、基準ブロックデータ格納SRAM2aと、サーチエリアデータ格納SRAM2bと、相関演算部3a〜3hと、最小値検出部4と、タイミング回路5と、統計処理部6とから構成されている。   1 includes a main memory 1, a reference block data storage SRAM 2a, a search area data storage SRAM 2b, correlation calculation units 3a to 3h, a minimum value detection unit 4, a timing circuit 5, and statistical processing. Part 6.

メインメモリ1は、例えばSDRAMによって構成され、基準フレームのデータ(基準フレームデータ)と参照フレームのデータ(参照フレームデータ)とを格納している。ここで、基準フレームは複数の基準ブロックに分割されている。また、参照フレームにはそれぞれの基準ブロックに対応した複数のサーチエリアが設定されている。   The main memory 1 is composed of, for example, SDRAM, and stores reference frame data (reference frame data) and reference frame data (reference frame data). Here, the reference frame is divided into a plurality of reference blocks. Also, a plurality of search areas corresponding to the respective reference blocks are set in the reference frame.

基準ブロックデータ格納SRAM2aは、少なくとも1個の基準ブロックのデータ(基準ブロックデータ)を格納できるだけの容量を有したSRAMであり、メインメモリ1に格納されている基準フレームデータから基準ブロックデータを、基準ブロックの単位ブロック毎に取得する。ここで、基準ブロックの単位ブロックとは、基準ブロックデータを所定ラインずつに分割した単位ブロックデータのことを言うものとする。なお、以後の例では所定ラインを1ラインとして説明を続ける。この場合、基準ブロックデータは16個の基準ブロックの単位ブロックに分割され、またそれぞれの基準ブロックの単位ブロックは16画素のデータで構成される。   The reference block data storage SRAM 2a is an SRAM having a capacity sufficient to store at least one reference block data (reference block data). The reference block data stored in the main memory 1 is used as a reference block data. Get for each unit block of the block. Here, the unit block of the reference block means unit block data obtained by dividing the reference block data into predetermined lines. In the following examples, the description will be continued assuming that the predetermined line is one line. In this case, the reference block data is divided into unit blocks of 16 reference blocks, and the unit block of each reference block is composed of 16 pixel data.

図3(a)は基準ブロックデータ格納SRAM2aの構成を示す図である。なお、図3(a)の例は、1画素のデータ量を8bitとした場合である。図3(a)に示すように、基準ブロックデータ格納SRAM2aは、基準ブロックの単位ブロックを16個格納できるように、16Word×128bitの容量を有して構成される。また、図3(b)は基準ブロックデータ格納SRAM2aの各アドレスに格納されるデータについて示している。図3(b)に示すように、基準ブロックデータ格納SRAM2aの各アドレスには1個の基準ブロックの単位ブロックが格納される。つまり、基準ブロックの単位ブロックのデータを上記のように設定した場合、基準ブロックデータ格納SRAM2aの1つのアドレスには図2(a)に示す基準ブロックのうち、同じ垂直位置のデータ(16画素)が格納される。   FIG. 3A shows a configuration of the reference block data storage SRAM 2a. The example in FIG. 3A is a case where the data amount of one pixel is 8 bits. As shown in FIG. 3A, the reference block data storage SRAM 2a is configured to have a capacity of 16 Word × 128 bits so that 16 unit blocks of the reference block can be stored. FIG. 3B shows data stored at each address of the reference block data storage SRAM 2a. As shown in FIG. 3B, a unit block of one reference block is stored in each address of the reference block data storage SRAM 2a. That is, when the unit block data of the reference block is set as described above, one address of the reference block data storage SRAM 2a has the same vertical position data (16 pixels) in the reference block shown in FIG. Is stored.

サーチエリアデータ格納SRAM2bは、メインメモリ1に格納されている参照フレームデータからサーチエリアのデータ(サーチエリアデータ)を、サーチエリアの単位ブロック毎に取得する。ここで、サーチエリアの単位ブロックとは、サーチエリアデータを上記所定ラインずつに分割した単位ブロックデータのことを言うものとする。上記した例の場合、サーチエリアデータは23個のサーチエリアの単位ブロックに分割され、またそれぞれのサーチエリアの単位ブロックは23画素のデータで構成される。   The search area data storage SRAM 2b acquires search area data (search area data) from the reference frame data stored in the main memory 1 for each unit block of the search area. Here, the unit block of the search area means unit block data obtained by dividing the search area data into the predetermined lines. In the case of the above-described example, the search area data is divided into 23 search area unit blocks, and each search area unit block is composed of 23 pixel data.

図4(a)はサーチエリアデータ格納SRAM2bの構成を示す図である。図4(a)に示すように、サーチエリアデータ格納SRAM2bは、サーチエリアの単位ブロックを23個格納できるように、23Word×184bitの容量を有して構成されている。また、図4(b)はサーチエリアデータ格納SRAM2bの各アドレスに格納されるデータについて示している。サーチエリアの単位ブロックを上記のように設定した場合、サーチエリアデータ格納SRAM2bの1つのアドレスには図2(b)に示すサーチエリアのうち、同じ垂直位置のデータ(23画素)が格納される。   FIG. 4A is a diagram showing a configuration of the search area data storage SRAM 2b. As shown in FIG. 4A, the search area data storage SRAM 2b is configured to have a capacity of 23 Word × 184 bits so that 23 unit blocks of the search area can be stored. FIG. 4B shows data stored at each address of the search area data storage SRAM 2b. When the unit block of the search area is set as described above, the same vertical position data (23 pixels) in the search area shown in FIG. 2B is stored in one address of the search area data storage SRAM 2b. .

図5は、基準ブロックデータ格納SRAM2a及びサーチエリアデータ格納SRAM2bと相関演算部3a〜3hとの接続について説明するための図である。基準ブロックデータ格納SRAM2aには、基準ブロックの単位ブロックのデータを画素毎に出力するための16個の出力端子a0〜a15が設けられており、これら出力端子a0〜a15は相関演算部3a〜3hの入力端子a0〜a15に共通に接続されている。   FIG. 5 is a diagram for explaining the connection between the reference block data storage SRAM 2a and the search area data storage SRAM 2b and the correlation calculation units 3a to 3h. The reference block data storage SRAM 2a is provided with 16 output terminals a0 to a15 for outputting the data of the unit block of the reference block for each pixel, and these output terminals a0 to a15 are provided with the correlation calculation units 3a to 3h. Are commonly connected to the input terminals a0 to a15.

このような構成により、1クロック毎に、基準ブロックデータ格納SRAM2aからは1個の基準ブロックの単位ブロックのデータが出力され、この基準ブロックの単位ブロックのデータが相関演算部3a〜3hに共通に入力される。   With such a configuration, the unit block data of one reference block is output from the reference block data storage SRAM 2a every clock, and the unit block data of this reference block is shared by the correlation calculation units 3a to 3h. Entered.

また、サーチエリアデータ格納SRAM2bには、サーチエリアの単位ブロックのデータを画素毎に出力するための23個の出力端子b0〜b22が設けられており、これら出力端子b0〜b22のうち、出力端子b0〜b15は相関演算部3aの入力端子b0〜b15に接続され、出力端子b1〜b16は相関演算部3bの入力端子b1〜b16に接続され、出力端子b2〜b17は相関演算部3cの入力端子b2〜b17に接続され、出力端子b3〜b18は相関演算部3dの入力端子b3〜b18に接続され、出力端子b4〜b19は相関演算部3eの入力端子b4〜b19に接続され、出力端子b5〜b20は相関演算部3fの入力端子b5〜b20に接続され、出力端子b6〜b21は相関演算部3gの入力端子b6〜b21に接続され、出力端子b7〜b22は相関演算部3hの入力端子b7〜b22に接続されている。   Further, the search area data storage SRAM 2b is provided with 23 output terminals b0 to b22 for outputting the data of the unit block of the search area for each pixel, and among these output terminals b0 to b22, the output terminal b0 to b15 are connected to the input terminals b0 to b15 of the correlation calculation unit 3a, the output terminals b1 to b16 are connected to the input terminals b1 to b16 of the correlation calculation unit 3b, and the output terminals b2 to b17 are input to the correlation calculation unit 3c. The terminals b2 to b17 are connected, the output terminals b3 to b18 are connected to the input terminals b3 to b18 of the correlation calculator 3d, the output terminals b4 to b19 are connected to the input terminals b4 to b19 of the correlation calculator 3e, and the output terminals b5 to b20 are connected to the input terminals b5 to b20 of the correlation calculation unit 3f, and the output terminals b6 to b21 are connected to the input terminals b6 to b21 of the correlation calculation unit 3g. Is, output terminal b7~b22 is connected to the input terminal b7~b22 correlation calculation section 3h.

このような構成により、1クロック毎に、サーチエリアデータ格納SRAM2bからは1個のサーチエリアの単位ブロックのデータが出力され、そして、このサーチエリアの単位ブロックのうち、0〜15画素目のデータが相関演算部3aに入力され、1〜16画素目のデータが相関演算部3bに入力され、2〜17画素目のデータが相関演算部3cに入力され、3〜18画素目のデータが相関演算部3dに入力され、4〜19画素目のデータが相関演算部3eに入力され、5〜20画素目のデータが相関演算部3fに入力され、6〜21画素目のデータが相関演算部3gに入力され、7〜22画素目のデータが相関演算部3hに入力される。   With this configuration, the search area data storage SRAM 2b outputs the data of one search area unit block for each clock, and the 0th to 15th pixel data in the search area unit block. Is input to the correlation calculation unit 3a, the data of the 1st to 16th pixels is input to the correlation calculation unit 3b, the data of the 2nd to 17th pixels is input to the correlation calculation unit 3c, and the data of the 3rd to 18th pixels is correlated. The 4th to 19th pixel data is input to the correlation calculation unit 3e, the 5th to 20th pixel data is input to the correlation calculation unit 3f, and the 6th to 21st pixel data is input to the correlation calculation unit 3d. 3g, and the data of the 7th to 22nd pixels are input to the correlation calculation unit 3h.

即ち、これら各相関演算部に入力されるサーチエリアの単位ブロックのデータはそれぞれ、サーチエリアの単位ブロックにおいて、参照ブロックを水平方向に−4〜+3の範囲でずらしたときに得られるデータに相当する。以後、上記のようにして各相関演算部に入力される16画素のデータを参照ブロックの単位ブロックと称する。   That is, the unit block data of the search area input to each correlation calculation unit corresponds to the data obtained when the reference block is shifted in the range of -4 to +3 in the horizontal direction in the unit block of the search area. To do. Hereinafter, the 16-pixel data input to each correlation calculation unit as described above is referred to as a unit block of the reference block.

相関演算部3a〜3hは、基準ブロックデータ格納SRAM2aから出力される基準ブロックの単位ブロック及びサーチエリアデータ格納SRAM2bから出力される参照ブロックの単位ブロックを取得して、基準ブロックの単位ブロックと参照ブロックの単位ブロックとの間での相関演算を行い、この単位ブロック毎の相関演算結果の総和を求めることで基準ブロックデータと参照ブロックデータとの間での相関演算を行う。   The correlation calculation units 3a to 3h acquire the unit block of the reference block output from the reference block data storage SRAM 2a and the unit block of the reference block output from the search area data storage SRAM 2b, and obtain the unit block of the reference block and the reference block The correlation calculation is performed between the base block data and the reference block data by calculating the correlation between the unit block and obtaining the sum of the correlation calculation results for each unit block.

図6は、相関演算部の構成について示す図である。なお、図6は相関演算部3aのみの構成について示しているが、その他の相関演算部も、水平方向に1画素ずつずれた参照ブロックの単位ブロックのデータが入力される点が異なるだけで、その構成は相関演算部3aと同様である。また、図6は、相関演算に差分絶対値和演算を用いる場合の構成について示しているが、相関演算に差分二乗和演算を用いても良い。   FIG. 6 is a diagram illustrating the configuration of the correlation calculation unit. Although FIG. 6 shows only the configuration of the correlation calculation unit 3a, the other correlation calculation units also differ in that the data of the unit block of the reference block shifted by one pixel in the horizontal direction is input. The configuration is the same as that of the correlation calculation unit 3a. FIG. 6 shows the configuration in the case where the difference absolute value sum calculation is used for the correlation calculation, but the difference square sum calculation may be used for the correlation calculation.

図6に示すように、相関演算部3aは、差分絶対値和演算部31と、加算器32と、フリップフロップ(FF)33とから構成されている。   As shown in FIG. 6, the correlation calculation unit 3 a includes a difference absolute value sum calculation unit 31, an adder 32, and a flip-flop (FF) 33.

差分絶対値和演算部31は、基準ブロックデータ格納SRAM2a及びサーチエリアデータ格納SRAM2bから入力される単位ブロックの画素数と同数(ここでは16個)の差分絶対値演算部と、これら差分絶対値演算部の出力を加算する加算器とから構成されており、基準ブロックの単位ブロックと参照ブロックの単位ブロックとの間での差分絶対値を画素毎に演算した後、これらの総和を求める。例えば、相関演算部3aに1ライン目の基準ブロックの単位ブロックと1ライン目の参照ブロックの単位ブロックとが入力された場合には、
|A(0,0)-B(0,0)|+|A(0,1)-B(0,1)|+ … +|A(0,15)-B(0,15)| (式1)
の演算が行われる。なお、相関演算に差分二乗和演算を用いる場合には、上記演算に代えて画素毎の差分を二乗してそれらの総和を求める演算を行えば良い。
The difference absolute value sum calculation unit 31 includes the same number (16 in this case) of difference absolute value calculation units as the number of pixels of the unit block input from the reference block data storage SRAM 2a and the search area data storage SRAM 2b, and these difference absolute value calculations. An adder that adds the outputs of the units is calculated, and after calculating the absolute value of the difference between the unit block of the base block and the unit block of the reference block for each pixel, the sum of these is obtained. For example, when the unit block of the base block of the first line and the unit block of the reference block of the first line are input to the correlation calculation unit 3a,
| A (0,0) -B (0,0) | + | A (0,1) -B (0,1) | +… + | A (0,15) -B (0,15) | Formula 1)
Is calculated. In addition, when using the difference square sum calculation for the correlation calculation, it is only necessary to perform a calculation for calculating the sum of these by squaring the difference for each pixel instead of the above calculation.

加算器32は、差分絶対値和演算部31で得られた差分絶対値和の演算結果を前回の差分絶対値和の演算結果に加算する。FF33は加算器32の演算結果を前回の差分絶対値和の演算結果として保持する。   The adder 32 adds the difference absolute value sum calculation result obtained by the difference absolute value sum calculation unit 31 to the previous difference absolute value sum calculation result. The FF 33 holds the calculation result of the adder 32 as the previous calculation result of the sum of absolute differences.

このような構成により、相関演算部3aは、1クロック毎に基準ブロックの単位ブロックと参照ブロックの単位ブロックとの間の相関演算を1回行って、この相関演算結果を加算していき、16クロックで基準ブロックと参照ブロックとの間での相関演算を終了する。   With such a configuration, the correlation calculation unit 3a performs the correlation calculation between the unit block of the base block and the unit block of the reference block once every clock, and adds the correlation calculation results. The correlation calculation between the standard block and the reference block is finished with the clock.

最小値検出部4は、サーチエリア内における相関演算の結果が最も小さくなるときの参照ブロックの位置を動きベクトルとして出力する。この最小値検出部4は、比較器4aと、比較器4bと、フリップフロップ(FF)4cと、セレクタ(SEL)4dと、FF4eとから構成されている。   The minimum value detection unit 4 outputs the position of the reference block when the correlation calculation result in the search area is the smallest as a motion vector. The minimum value detecting unit 4 includes a comparator 4a, a comparator 4b, a flip-flop (FF) 4c, a selector (SEL) 4d, and an FF 4e.

比較器4aは相関演算部3a〜3hにおける相関演算結果を比較して最も小さいものを出力する。比較器4bは比較器4aから出力された相関演算結果と前回の相関演算結果とを比較して何れか小さいほうを出力する。FF4cは比較器4aから出力された相関演算結果を前回の相関演算結果として保持する。SEL4dは比較器4bからの出力に応じて今回の参照ブロックの位置情報と前回の参照ブロックの位置情報の何れかを統計処理部6に出力する。FF4eはSEL4dによって選択された参照ブロックの位置情報を前回の参照ブロックの位置情報として保持する。   The comparator 4a compares the correlation calculation results in the correlation calculation units 3a to 3h and outputs the smallest one. The comparator 4b compares the correlation calculation result output from the comparator 4a with the previous correlation calculation result and outputs the smaller one. The FF 4c holds the correlation calculation result output from the comparator 4a as the previous correlation calculation result. The SEL 4d outputs either the current reference block position information or the previous reference block position information to the statistical processing unit 6 in accordance with the output from the comparator 4b. The FF 4e holds the position information of the reference block selected by the SEL 4d as the position information of the previous reference block.

タイミング回路5は、1クロック毎にそのときの参照ブロックの位置情報を示す信号を最小値検出部4に出力する。統計処理部6は、1つの基準フレーム中に複数の基準ブロックが設定されている場合に、これら基準ブロック毎に求められた複数の動きベクトルに対して統計処理を施すことにより、画面全体の動きベクトルを求める(図7参照)。   The timing circuit 5 outputs a signal indicating the position information of the reference block at that time to the minimum value detection unit 4 every clock. When a plurality of reference blocks are set in one reference frame, the statistical processing unit 6 performs a statistical process on a plurality of motion vectors obtained for each of the reference blocks, thereby moving the entire screen. A vector is obtained (see FIG. 7).

以下、図1の動きベクトル検出装置におけるブロックマッチング(特にブロックマッチングにおける相関演算動作)について更に詳しく説明する。図8は動きベクトル検出装置のブロックマッチングに係るタイミングチャートである。また、図9は図8のタイミングチャートに従ったブロックマッチングの概略を示した図である。ここで、図9の例は、サーチエリア内の左上端(参照ブロックの水平方向位置−4、垂直方向位置−4)から相関演算を行っていく場合について示している。   In the following, block matching (particularly, correlation operation in block matching) in the motion vector detection device of FIG. 1 will be described in more detail. FIG. 8 is a timing chart relating to block matching of the motion vector detection device. FIG. 9 is a diagram showing an outline of block matching according to the timing chart of FIG. Here, the example of FIG. 9 shows a case where the correlation calculation is performed from the upper left end (horizontal position −4, vertical position −4 of the reference block) in the search area.

図8に示す例においては、16クロックで、基準ブロックと、ある垂直位置において水平方向に隣接する全ての参照ブロックとの間の相関演算結果を同時に取得することができるようになっている。   In the example shown in FIG. 8, the correlation calculation results between the reference block and all reference blocks adjacent in the horizontal direction at a certain vertical position can be simultaneously acquired in 16 clocks.

例えば、最初の1〜16クロック目にかけては、垂直方向が−4、水平方向が−4〜+3の位置での相関演算結果を取得することができる。即ち、1クロック毎に、基準ブロックデータ格納SRAM2aからは、基準ブロックの単位ブロック(16画素)が先頭アドレスから順次読み出され、この読み出された基準ブロックの単位ブロックが相関演算部3a〜3hに共通に入力される。これに対応して、サーチエリアデータ格納SRAM2bからは、サーチエリアの単位ブロック(23画素)が先頭アドレスから順次読み出され、この読み出されたサーチエリアの単位ブロックにおいて参照ブロックを1画素ずつずらして得られる8個の参照ブロックの単位ブロックが相関演算部3a〜3hにそれぞれ入力される。   For example, from the first to the 16th clock, it is possible to obtain correlation calculation results at positions where the vertical direction is −4 and the horizontal direction is −4 to +3. That is, for each clock, from the reference block data storage SRAM 2a, unit blocks (16 pixels) of the reference block are sequentially read from the head address, and the unit blocks of the read reference block are correlated operation units 3a to 3h. Are input in common. Correspondingly, from the search area data storage SRAM 2b, the unit block (23 pixels) of the search area is sequentially read from the head address, and the reference block is shifted pixel by pixel in the read unit block of the search area. The unit blocks of the eight reference blocks obtained in this way are input to the correlation calculation units 3a to 3h, respectively.

相関演算部3a〜3hに基準ブロックの単位ブロック及び参照ブロックの単位ブロックが入力されるとそれぞれの相関演算部で相関演算が行われる。これにより、1クロック毎に、相関演算部3aにおいて水平方向−4、相関演算部3bにおいて水平方向−3、相関演算部3cにおいて水平方向−2、相関演算部3dにおいて水平方向−1、相関演算部3eにおいて水平方向0、相関演算部3fにおいて水平方向+1、相関演算部3gにおいて水平方向+2、相関演算部3hにおいて水平方向+3(垂直方向は全て−4)の基準ブロックの単位ブロックと参照ブロックの単位ブロックとの間での相関演算結果が得られ、16クロックで垂直方向−4、水平方向−4〜+3(図9のブロックライン1)における基準ブロックと参照ブロックとの間での相関演算結果が8個同時に得られる。   When the unit block of the base block and the unit block of the reference block are input to the correlation calculation units 3a to 3h, the correlation calculation is performed in each correlation calculation unit. Thus, for each clock, the correlation calculation unit 3a has horizontal direction -4, the correlation calculation unit 3b has horizontal direction -3, the correlation calculation unit 3c has horizontal direction -2, the correlation calculation unit 3d has horizontal direction -1, and the correlation calculation Unit block and reference block of horizontal block 0 in unit 3e, horizontal direction +1 in correlation calculation unit 3f, horizontal direction +2 in correlation calculation unit 3g, and horizontal direction +3 in correlation calculation unit 3h (all vertical directions are -4) The correlation calculation result is obtained between the reference block and the reference block in the vertical direction −4 and the horizontal direction −4 to +3 (block line 1 in FIG. 9) in 16 clocks. Eight results can be obtained simultaneously.

以後も同様にして、16クロックを1サイクルとして相関演算が行われる。この際、1クロック毎に、基準ブロックデータ格納SRAM2aからは、基準ブロックの単位ブロック(16画素)が常に先頭アドレスから順次読み出される。一方、サーチエリアデータ格納SRAM2bからは、16クロック毎に読み出し開始アドレスを垂直方向に1つずつずらしながらサーチエリアの単位ブロック(23画素)が順次読み出される。   In the same manner, correlation calculation is performed with 16 clocks as one cycle. At this time, the unit block (16 pixels) of the reference block is always sequentially read from the head address from the reference block data storage SRAM 2a every clock. On the other hand, from the search area data storage SRAM 2b, the unit blocks (23 pixels) of the search area are sequentially read while the read start address is shifted one by one in the vertical direction every 16 clocks.

このような処理がサーチエリアの全ての範囲に対して行われる。これにより、ブロックライン1〜ブロックライン8(参照ブロックの垂直方向−4〜+3)までで8×8=64個の相関演算結果が得られることになる。   Such processing is performed for the entire range of the search area. As a result, 8 × 8 = 64 correlation calculation results are obtained from block line 1 to block line 8 (vertical direction −4 to +3 of the reference block).

なお、1つの基準ブロックに対する処理が終了した場合には、順次、次の基準ブロックに対して図8、図9の処理を繰り返していくことにより撮影データ全体に対して相関演算を行うことができる。   When the processing for one reference block is completed, the correlation calculation can be performed on the entire photographed data by sequentially repeating the processing of FIGS. 8 and 9 for the next reference block. .

次に、本一実施形態の変形例について説明する。ここで、以下に説明する変形例においては、基準ブロックのブロックサイズが32画素×32ライン、サーチエリアのエリアサイズが63画素×63ラインとして説明を続ける。この場合、参照ブロックは、サーチエリア内を水平方向に−16画素〜+15画素、垂直方向に−16画素〜+15画素の範囲を移動する。   Next, a modification of the present embodiment will be described. Here, in the modification described below, the description will be continued assuming that the block size of the reference block is 32 pixels × 32 lines and the area size of the search area is 63 pixels × 63 lines. In this case, the reference block moves within the search area in a range from −16 pixels to +15 pixels in the horizontal direction and from −16 pixels to +15 pixels in the vertical direction.

ここで説明する変形例は、基本的な構成は図1で示したものと同様であるが、基準ブロックデータ格納SRAM2a及びサーチエリアデータ格納SRAM2bの内部の構成が図3、図4と異なっている。   In the modification described here, the basic configuration is the same as that shown in FIG. 1, but the internal configurations of the reference block data storage SRAM 2a and the search area data storage SRAM 2b are different from those shown in FIGS. .

図10(a)は変形例における基準ブロックデータ格納SRAM2aの構成を示す図である。図10(a)に示すように、基準ブロックデータ格納SRAM2aは、32画素×1ラインで構成される基準ブロックの単位ブロックを32個格納できるように構成されている。ここで、図3(a)と異なっている点は、1つの単位ブロックを複数に分割して(ここでは例として16画素毎に2つの単位ブロックに分割する)、これら分割した単位ブロック(基準ブロックの分割単位ブロック)を基準ブロックデータ格納SRAM2a内の別々のエリアに格納するようにしている点である。このため、基準ブロックデータ格納SRAM2aは、64Word×128bitの容量を有して構成される。このような基準ブロックデータ格納SRAM2aは、メインメモリ1に格納されている基準フレームデータから、基準ブロックデータを基準ブロックの単位ブロックを2分割した分割単位ブロック(16画素)毎に取得する。また、基準ブロックデータ格納SRAM2aに格納されたデータは16画素の分割単位ブロック毎に読み出される。これにより、相関演算部3a〜3hには16画素の分割単位ブロックのデータが共通に入力される。   FIG. 10A is a diagram showing a configuration of the reference block data storage SRAM 2a in the modification. As shown in FIG. 10A, the reference block data storage SRAM 2a is configured to store 32 unit blocks of the reference block composed of 32 pixels × 1 line. Here, the difference from FIG. 3A is that one unit block is divided into a plurality of parts (here, as an example, divided into two unit blocks every 16 pixels), and these divided unit blocks (reference The block division unit block) is stored in separate areas in the reference block data storage SRAM 2a. For this reason, the reference block data storage SRAM 2a is configured to have a capacity of 64 Word × 128 bits. Such reference block data storage SRAM 2a acquires the reference block data from the reference frame data stored in the main memory 1 for each divided unit block (16 pixels) obtained by dividing the unit block of the reference block into two. The data stored in the reference block data storage SRAM 2a is read for each division unit block of 16 pixels. Thereby, the data of the division unit block of 16 pixels is commonly input to the correlation calculation units 3a to 3h.

図10(b)は基準ブロックデータ格納SRAM2aの各アドレスに格納されるデータについて示している。図10(b)に示すように、基準ブロックデータ格納SRAM2aの各アドレスには1個の基準ブロックの単位ブロックを2分割したデータ(16画素)がそれぞれ基準ブロックデータ格納SRAM2aの左側のエリアと右側のエリアとに分けて格納される。   FIG. 10B shows data stored at each address of the reference block data storage SRAM 2a. As shown in FIG. 10B, at each address of the reference block data storage SRAM 2a, data obtained by dividing a unit block of one reference block into two (16 pixels) is the left area and right side of the reference block data storage SRAM 2a, respectively. It is stored separately for each area.

図11(a)は変形例におけるサーチエリアデータ格納SRAM2bの構成を示す図である。図11(a)に示すように、サーチエリアデータ格納SRAM2bは、63画素×1ラインで構成されるサーチエリアの単位ブロックを63個格納できるように構成されている。   FIG. 11A is a diagram showing the configuration of the search area data storage SRAM 2b in the modification. As shown in FIG. 11A, the search area data storage SRAM 2b is configured to store 63 unit blocks of the search area composed of 63 pixels × 1 line.

ここで、変形例において、サーチエリアデータ格納SRAM2bは、192Word×64bitの容量を有する2つのSRAM(SRAM_A21a、SRAM_B21b)と、128Word×64bitの容量を有する1つのSRAM(SRAM_C21c)と、これら3つのSRAMからデータを選択的に出力させるセレクタ(SEL)22とから構成されている。   Here, in the modification, the search area data storage SRAM 2b includes two SRAMs (SRAM_A21a, SRAM_B21b) having a capacity of 192 Word × 64 bits, one SRAM (SRAM_C21c) having a capacity of 128 Word × 64 bits, and these three SRAMs. And a selector (SEL) 22 for selectively outputting data.

サーチエリアデータ格納SRAM2bの3つのSRAMはそれぞれ、メインメモリ1に格納されている参照フレームデータからサーチエリアデータを8画素単位で取得する。ここで、図11(b)に示すように、SRAM_A21a、SRAM_B21b、SRAM_C21cの3つで24画素のデータを取得することができるが、相関演算部3a〜3hにはそれぞれ、基準ブロックの分割単位ブロック(16画素)に対応する16画素のデータを入力できれば良い。したがって、SEL22は、サーチエリアデータ格納SRAM2bの各SRAMから8画素単位で24画素分出力されるデータのうちの23画素(この23画素のデータをサーチエリアの分割単位ブロックと称する)のみを選択して出力する。ここで出力された23画素のデータのうち、0〜15画素目のデータが相関演算部3aに入力され、1〜16画素目のデータが相関演算部3bに入力され、2〜17画素目のデータが相関演算部3cに入力され、3〜18画素目のデータが相関演算部3dに入力され、4〜19画素目のデータが相関演算部3eに入力され、5〜20画素目のデータが相関演算部3fに入力され、6〜21画素目のデータが相関演算部3gに入力され、7〜22画素目のデータが相関演算部3hに入力される。   Each of the three SRAMs of the search area data storage SRAM 2b acquires search area data from the reference frame data stored in the main memory 1 in units of 8 pixels. Here, as shown in FIG. 11B, data of 24 pixels can be acquired by three of SRAM_A 21a, SRAM_B 21b, and SRAM_C 21c. However, the correlation calculation units 3a to 3h each have a division unit block of the reference block. It is only necessary to input 16-pixel data corresponding to (16 pixels). Therefore, the SEL 22 selects only 23 pixels (the data of 23 pixels is referred to as a division unit block of the search area) out of the data output by 24 pixels in units of 8 pixels from each SRAM of the search area data storage SRAM 2b. Output. Of the 23 pixel data output here, the 0th to 15th pixel data is input to the correlation calculation unit 3a, the 1st to 16th pixel data is input to the correlation calculation unit 3b, and the 2nd to 17th pixel data is input. The data is input to the correlation calculation unit 3c, the 3rd to 18th pixel data is input to the correlation calculation unit 3d, the 4th to 19th pixel data is input to the correlation calculation unit 3e, and the 5th to 20th pixel data is The data of the 6th to 21st pixels is input to the correlation calculating unit 3g, and the data of the 7th to 22nd pixels is input to the correlation calculating unit 3h.

なお、図11(c)には、SRAM_A21a、SRAM_B21b、SRAM_C21cの各アドレスに格納されるデータを示している。図11(c)に示すように、SRAM_A21a、SRAM_B21b、SRAM_C21cの各アドレスには、8画素単位のデータが格納される。ここで、サーチエリアの同じ垂直位置のデータは、SRAM_A21a、SRAM_B21b、SRAM_C21cに分割されて格納される。   FIG. 11C shows data stored in each address of SRAM_A 21a, SRAM_B 21b, and SRAM_C 21c. As shown in FIG. 11C, data in units of 8 pixels is stored in each address of the SRAM_A 21a, SRAM_B 21b, and SRAM_C 21c. Here, data at the same vertical position in the search area is divided and stored in SRAM_A 21a, SRAM_B 21b, and SRAM_C 21c.

以下、図12を参照して変形例におけるブロックマッチングについて説明する。
図12において、最初の1〜64クロック目にかけては、垂直方向が−16、水平方向が−16〜−9の位置での相関演算結果が取得される。
Hereinafter, block matching in the modification will be described with reference to FIG.
In FIG. 12, the correlation calculation results at the positions of −16 in the vertical direction and −16 to −9 in the horizontal direction are acquired from the first to the 64th clock.

まず1クロック〜32クロック目にかけては、1クロック毎に基準ブロックデータ格納SRAM2aから、基準ブロックの左側の分割単位ブロック(16画素)が先頭アドレスから順次読み出され、この読み出された基準ブロックの分割単位ブロックが相関演算部3a〜3hに共通に入力される。例えば1クロック目の場合には、基準ブロックデータ格納SRAM2aのADD=0のデータ、即ち、A(0,0)〜A(0,15)の16画素が読み出される。また、これに対応して、サーチエリアデータ格納SRAM2bのSRAM_A21a、SRAM_B21b、SRAM_C21cから、それぞれ8画素ずつのデータが読み出され、これら読み出された24画素のデータのうち先頭の画素から23画素目までのデータがSEL22において選択される。例えば、1クロック目の場合には、SRAM_A21a、SRAM_B21b、SRAM21cのADD=0のデータ、即ち、B(0,0)〜B(0,7)、B(0,8)〜B(0,15)、B(0,9)〜B(0,23)がそれぞれ読み出され、これら24画素のデータのうち、B(0,0)〜B(0,22)までの23画素のデータのみがSEL22によって選択される。   First, from the first clock to the 32nd clock, the division unit block (16 pixels) on the left side of the reference block is sequentially read from the reference block data storage SRAM 2a every clock and the read reference block is read. The division unit block is commonly input to the correlation calculation units 3a to 3h. For example, in the case of the first clock, ADD = 0 data in the reference block data storage SRAM 2a, that is, 16 pixels A (0,0) to A (0,15) are read. Correspondingly, data of 8 pixels is read from each of the SRAM_A 21a, SRAM_B 21b, and SRAM_C 21c of the search area data storage SRAM 2b, and the 23rd pixel from the first pixel among the read 24 pixel data. The data up to are selected in SEL22. For example, in the case of the first clock, ADD = 0 data of SRAM_A 21a, SRAM_B 21b, and SRAM 21c, that is, B (0,0) to B (0,7), B (0,8) to B (0,15 ), B (0,9) to B (0,23) are read out. Of these 24 pixel data, only 23 pixel data from B (0,0) to B (0,22) are stored. Selected by SEL22.

SEL22によって選択されたサーチエリアの分割単位ブロック(23画素)は、参照ブロックを水平方向に1画素ずつずらして得られる8個の参照ブロックの分割単位ブロック(16画素)ずつ、相関演算部3a〜3hにそれぞれ入力される。以後の相関演算は図9と同様にして行われる。   The search unit division unit block (23 pixels) selected by the SEL 22 is divided into eight reference block division unit blocks (16 pixels) obtained by shifting the reference block by one pixel in the horizontal direction. Each is input to 3h. Subsequent correlation calculations are performed in the same manner as in FIG.

これにより、1クロック毎に、相関演算部3aにおいて水平方向−16、相関演算部3bにおいて水平方向−15、相関演算部3cにおいて水平方向−14、相関演算部3dにおいて水平方向−13、相関演算部3eにおいて水平方向−12、相関演算部3fにおいて水平方向−11、相関演算部3gにおいて水平方向−10、相関演算部3hにおいて水平方向−9(垂直方向は全て−16)の基準ブロックの左側の分割単位ブロックと参照ブロックの左側の分割単位ブロック(図12のブロックライン1−1の左側)との間での相関演算結果が得られる。   Thus, for each clock, the correlation calculation unit 3a has a horizontal direction of -16, the correlation calculation unit 3b has a horizontal direction of -15, the correlation calculation unit 3c has a horizontal direction of -14, the correlation calculation unit 3d has a horizontal direction of -13, and the correlation calculation. The left side of the reference block in the horizontal direction -12 in the unit 3e, in the horizontal direction -11 in the correlation calculation unit 3f, in the horizontal direction -10 in the correlation calculation unit 3g, and in the horizontal direction -9 in the correlation calculation unit 3h (all the vertical directions are -16) A correlation calculation result is obtained between the division unit block and the division unit block on the left side of the reference block (the left side of the block line 1-1 in FIG. 12).

次の33クロック〜64クロック目にかけては、基準ブロックデータ格納SRAM2aから、基準ブロックの右側の分割単位ブロックが先頭アドレスから順次読み出され、この読み出された基準ブロックの分割単位ブロックが相関演算部3a〜3hに共通に入力される。例えば33クロック目の場合には、基準ブロックデータ格納SRAM2aのADD=32のデータ、即ち、A(0,16)〜A(0,31)の16画素が読み出される。また、これに対応して、サーチエリアデータ格納SRAM2bのSRAM_A31a、SRAM_B31b、SRAM_C31cから8画素ずつデータが読み出され(例えば、33クロック目の場合にはSRAM_C31aからB(0,16)〜B(0,23)、SRAM_A31aからB(0,24)〜B(0,31)、SRAM_B31bからB(0,32)〜B(0,39)が読み出される)、これら24画素のデータのうち先頭から23画素目までのデータがSEL22において選択され、これら選択されたサーチエリアの分割単位ブロックにおいて参照ブロックを水平方向に1画素ずつずらして得られる8個の参照ブロックの分割単位ブロック(16画素)が相関演算部3a〜3hにそれぞれ入力される。以後の相関演算は図9と同様にして行われる。   From the 33rd clock to the 64th clock, the division unit block on the right side of the reference block is sequentially read from the start address from the reference block data storage SRAM 2a, and the division unit block of the read reference block is the correlation calculation unit. 3a to 3h are input in common. For example, at the 33rd clock, ADD = 32 data in the reference block data storage SRAM 2a, that is, 16 pixels A (0,16) to A (0,31) are read. Correspondingly, data is read out from the SRAM_A 31a, SRAM_B 31b, SRAM_C 31c of the search area data storage SRAM 2b by 8 pixels (for example, in the case of the 33rd clock, B (0, 16) to B (0 , 23), B (0,24) to B (0,31) from SRAM_A 31a, and B (0,32) to B (0,39) are read from SRAM_B 31b). The data up to the pixel is selected in SEL22, and the division unit blocks (16 pixels) of eight reference blocks obtained by shifting the reference block by one pixel in the horizontal direction in the division unit blocks of these selected search areas are correlated. Each is input to the arithmetic units 3a to 3h. Subsequent correlation calculations are performed in the same manner as in FIG.

これにより、1クロック毎に、相関演算部3aにおいて水平方向−16、相関演算部3bにおいて水平方向−15、相関演算部3cにおいて水平方向−14、相関演算部3dにおいて水平方向−13、相関演算部3eにおいて水平方向−12、相関演算部3fにおいて水平方向−11、相関演算部3gにおいて水平方向−10、相関演算部3hにおいて水平方向−9(垂直方向は全て−16)の基準ブロックの右側の分割単位ブロックと参照ブロックの右側の分割単位ブロック(図12のブロックライン1−1の右側)との間での相関演算結果が得られ、ブロックライン1−1における基準ブロックの単位ブロックと参照ブロックの単位ブロックとの間での相関演算が終了し8個の相関演算結果が同時に得られる。   Thus, for each clock, the correlation calculation unit 3a has a horizontal direction of -16, the correlation calculation unit 3b has a horizontal direction of -15, the correlation calculation unit 3c has a horizontal direction of -14, the correlation calculation unit 3d has a horizontal direction of -13, and the correlation calculation. The right side of the reference block in the horizontal direction -12 in the unit 3e, the horizontal direction -11 in the correlation calculation unit 3f, the horizontal direction -10 in the correlation calculation unit 3g, and the horizontal direction -9 in the correlation calculation unit 3h (all the vertical directions are -16) The correlation calculation result between the division unit block of the reference block and the division unit block on the right side of the reference block (the right side of the block line 1-1 in FIG. 12) is obtained. The correlation calculation with the unit block of the block is completed, and eight correlation calculation results are obtained simultaneously.

以後の処理においては、64クロック毎に基準ブロックデータ格納SRAM2aからは、基準ブロックの分割単位ブロック(16画素)が左側の先頭アドレスから順次読み出される。一方、サーチエリアデータ格納SRAM2bからは、64クロック毎に読み出し位置を水平方向に8画素ずつずらしながらサーチエリアの分割単位ブロック(23画素)が順次読み出される。   In the subsequent processing, the division unit block (16 pixels) of the reference block is sequentially read from the left top address from the reference block data storage SRAM 2a every 64 clocks. On the other hand, from the search area data storage SRAM 2b, the division unit block (23 pixels) of the search area is sequentially read while shifting the read position by 8 pixels in the horizontal direction every 64 clocks.

このような処理が4回(256クロック分)行われることにより、垂直方向−16、水平方向−16〜+15(図12のブロックライン1−1〜ブロックライン1−4)における基準ブロックと参照ブロックとの間での相関演算結果が8×4=32個得られる。   By performing such processing four times (for 256 clocks), the reference block and the reference block in the vertical direction -16 and the horizontal direction -16 to +15 (block line 1-1 to block line 1-4 in FIG. 12). As a result, 8 × 4 = 32 correlation calculation results are obtained.

以後も同様にして、256クロックを1サイクルとして相関演算が行われる。この際、基準ブロックデータ格納SRAM2aからは、基準ブロックの分割単位ブロック(16画素)が常に左側の先頭アドレスから順次読み出される。一方、サーチエリアデータ格納SRAM2bからは、256クロック毎に読み出し開始アドレスを垂直方向に1つずつずらしながらサーチエリアの分割単位ブロック(23画素)が順次読み出される。   In the same manner, the correlation calculation is performed with 256 clocks as one cycle. At this time, the division block (16 pixels) of the reference block is always sequentially read from the left head address from the reference block data storage SRAM 2a. On the other hand, from the search area data storage SRAM 2b, division unit blocks (23 pixels) of the search area are sequentially read while shifting the read start address one by one in the vertical direction every 256 clocks.

このような処理がサーチエリアの全ての範囲に対して行われる。これにより、ブロックライン1〜ブロックライン32(参照ブロックの垂直方向位置−16〜+15)までで32×32=1024個の相関演算結果が得られることになる。   Such processing is performed for the entire range of the search area. As a result, 32 × 32 = 1024 correlation calculation results are obtained from block line 1 to block line 32 (vertical position of reference block −16 to +15).

なお、1つの基準ブロックに対する処理が終了した場合には、順次、次の基準ブロックに対して図12の処理を繰り返していくことにより撮影データ全体に対して相関演算を行い、画面全体の動きベクトルを求めることができる。   When the processing for one reference block is completed, correlation processing is performed on the entire captured data by sequentially repeating the processing of FIG. 12 for the next reference block, and the motion vector of the entire screen is determined. Can be requested.

次に、本一実施形態に係る動きベクトル検出装置を適用した撮像装置の一例としてのデジタルカメラについて図13を参照して説明する。図13に示すデジタルカメラは、CCD101と、プリプロセス部102と、画像バス103と、メインメモリ104と、動き検出装置105と、CPUバス106と、CPU107と、画像処理部108と、ビデオエンコーダ109と、TFT表示部110とから構成されている。   Next, a digital camera as an example of an imaging apparatus to which the motion vector detection apparatus according to the present embodiment is applied will be described with reference to FIG. The digital camera shown in FIG. 13 includes a CCD 101, a preprocessing unit 102, an image bus 103, a main memory 104, a motion detection device 105, a CPU bus 106, a CPU 107, an image processing unit 108, and a video encoder 109. And a TFT display unit 110.

CCD101は、CCD方式の撮像素子であり、図示しない被写体を撮像して撮像信号を得る。プリプロセス部102は、CCD101で得られた撮像信号を処理して撮像データを取得する。画像バス103は、プリプロセス部102で得られた撮像データ等の各種データを図1のデジタルカメラの各部に転送する転送路である。メインメモリ104は、例えばSDRAM等から構成され、プリプロセス部102において得られ、画像バス103を介して転送された撮像データを格納する。動き検出装置105は、図1に示すようにして構成され、メインメモリ104に格納されている2枚の撮像データ(基準フレームデータ及び参照フレームデータ)から上述したようにして動きベクトルを検出する。CPUバス106は、動き検出装置105において検出された動きベクトル等の各種データをCPU107に転送する転送路である。CPU107は当該デジタルカメラの全体の動作制御を行う。画像処理部108はメインメモリ104に格納された撮像データを読み出して種々の画像処理を行う。ビデオエンコーダ109は画像処理部で処理された撮像データを表示に適する信号に変換する。TFT表示部110はビデオエンコーダ109において変換された信号に基づいて画像表示を行う。   The CCD 101 is a CCD image sensor, and captures an image signal by imaging a subject (not shown). The preprocessing unit 102 acquires image data by processing the image signal obtained by the CCD 101. The image bus 103 is a transfer path for transferring various data such as imaging data obtained by the preprocessing unit 102 to each unit of the digital camera in FIG. The main memory 104 is composed of, for example, an SDRAM or the like, and stores image data obtained by the preprocessing unit 102 and transferred via the image bus 103. The motion detection device 105 is configured as shown in FIG. 1, and detects a motion vector as described above from two pieces of imaging data (base frame data and reference frame data) stored in the main memory 104. The CPU bus 106 is a transfer path for transferring various data such as motion vectors detected by the motion detection device 105 to the CPU 107. The CPU 107 controls the entire operation of the digital camera. The image processing unit 108 reads out the imaging data stored in the main memory 104 and performs various image processing. The video encoder 109 converts the imaging data processed by the image processing unit into a signal suitable for display. The TFT display unit 110 displays an image based on the signal converted by the video encoder 109.

以下、図13のような構成を有するデジタルカメラにおいて、動き検出装置105を手ぶれ補正に用いる場合の動作について図14及び図15を参照して説明する。   Hereinafter, in the digital camera having the configuration as shown in FIG. 13, an operation when the motion detection device 105 is used for camera shake correction will be described with reference to FIGS. 14 and 15.

まず、CCD101は、所定タイミング毎に被写体を撮像し、これによって得られた撮像信号をプリプロセス部102に出力する。プリプロセス部102は、CCD101から入力された撮像信号に対してA/D変換や、シェーディング補正、欠陥画素補正等の前処理を行って撮像データを生成し、生成した撮像データを、画像バス103を介してメインメモリ104に書き込む(図14(a))。   First, the CCD 101 captures an image of a subject at every predetermined timing, and outputs an image signal obtained thereby to the preprocessing unit 102. The preprocessing unit 102 performs preprocessing such as A / D conversion, shading correction, and defective pixel correction on the imaging signal input from the CCD 101 to generate imaging data, and the generated imaging data is output to the image bus 103. Is written into the main memory 104 (FIG. 14A).

動き検出装置105は、メインメモリ104から2フレーム分の撮影データを読み出して、これら2フレーム分の撮影データに基づいて上記説明したような手法で動きベクトルを検出し、この動きベクトルを、CPUバス106を介してCPU107に転送する(図14(b))。   The motion detection device 105 reads out shooting data for two frames from the main memory 104, detects a motion vector by the method described above based on the shooting data for these two frames, and uses this motion vector as a CPU bus. It transfers to CPU107 via 106 (FIG.14 (b)).

CPU107は、CPUバス106を介して転送された動きベクトルから、2フレームの撮影データの間に発生した手ぶれ量を判定し、この手ぶれを補正するのに必要な撮影データの切り出し位置を決定して画像処理部108に通知する(図15(a))。なお、CPU107において切り出し位置を決定する際には、手ぶれによる画像の移動とユーザが意図的にデジタルカメラを移動させたことによる画像の移動とを切り分けてから決定するようにする。   The CPU 107 determines the amount of camera shake generated between the two frames of shooting data from the motion vector transferred via the CPU bus 106, and determines the shooting data clipping position necessary to correct this camera shake. The image processing unit 108 is notified (FIG. 15A). Note that when the CPU 107 determines the cutout position, it is determined after separating the movement of the image due to camera shake and the movement of the image due to the user intentionally moving the digital camera.

ここで、手ぶれの補正について簡単に説明する。動画の手ぶれ補正においては電子手ぶれ補正が用いられる。電子手ぶれ補正は、図16のように、CCD101において実際の表示用の撮影データよりも広画角の撮影データ200を取得しておき、画像処理部108において、撮影データ200の中から当該デジタルカメラの画像201aと画像201bとの間の動き量(手ぶれ量)に基づいて、この画像の動きを補正するような切り出し位置の撮影データを表示用の撮影データとしてメインメモリ104から読み出すことで行う。   Here, the camera shake correction will be briefly described. Electronic camera shake correction is used for moving camera shake correction. As shown in FIG. 16, the electronic image stabilization is performed by acquiring image data 200 having a wider angle of view than the actual display image data in the CCD 101, and in the digital camera from the image data 200 in the image processing unit 108. On the basis of the amount of movement (the amount of camera shake) between the image 201a and the image 201b, shooting data at a clipping position that corrects the movement of the image is read out from the main memory 104 as shooting data for display.

画像処理部108は、CPU107から通知された切り出し位置に基づいてメインメモリ104から表示用の撮影データを取得し、この取得した撮影データに対し、表示に必要な種々の画像処理を行う。そして、画像処理部108は、処理した撮像データをメインメモリ104に書き戻す(図15(b))。   The image processing unit 108 acquires shooting data for display from the main memory 104 based on the cut-out position notified from the CPU 107, and performs various image processes necessary for display on the acquired shooting data. Then, the image processing unit 108 writes the processed imaging data back to the main memory 104 (FIG. 15B).

その後、ビデオエンコーダ109は、メインメモリ104から手ぶれ補正後の撮影データを読み出してNTSC信号等の映像信号に変換し、この変換した信号に基づいてTFT表示部110に動画表示を行う。このような動作により、手ぶれ補正がなされた動画がTFT表示部110に表示される(図15(c))。   Thereafter, the video encoder 109 reads out the camera-shake-corrected shooting data from the main memory 104 and converts it into a video signal such as an NTSC signal, and displays a moving image on the TFT display unit 110 based on the converted signal. By such an operation, a moving image that has undergone camera shake correction is displayed on the TFT display unit 110 (FIG. 15C).

ここで、図14及び図15は動画表示の際の手ぶれ補正について説明しているが、動画記録の際の手ぶれ補正も同様にして行われる。また、動画記録の際には、撮像データの圧縮にMEPGが用いられる。MPEG圧縮は、離散コサイン変換(DCT)を用いた圧縮と、動きベクトルを利用した動き補償予測を用いた圧縮とを併用して動画像の圧縮を行う手法であるが、この動きベクトルの検出に、本発明の一実施形態及び変形例で説明した動きベクトル検出装置を用いることができる。   Here, FIGS. 14 and 15 describe camera shake correction at the time of moving image display, but camera shake correction at the time of moving image recording is performed in the same manner. Also, when recording a moving image, MPEG is used for compressing the image data. MPEG compression is a technique for compressing a moving image using both compression using discrete cosine transform (DCT) and compression using motion compensation prediction using a motion vector. The motion vector detection device described in the embodiment and modification of the present invention can be used.

以上説明したように、本一実施形態によれば、基準ブロック及びサーチエリアをそれぞれ複数の単位ブロックに分割し、これら分割した基準ブロックの単位ブロック及びサーチエリアの単位ブロックのうち、基準ブロックの単位ブロックは相関演算部3a〜3hに共通に入力し、サーチエリアの単位ブロックは水平方向に隣接する複数の参照ブロックの単位ブロックを相関演算部3a〜3hに入力するようにして、水平方向の隣接する参照ブロックに係る相関演算結果を同時に得ることができるようにしている。即ち、相関演算部3a〜3hに入力するデータをほぼ共通化(基準ブロックデータは完全に共通化、参照ブロックデータは大部分を共通化)できるようにしているため、小さい回路規模で高速に相関演算を行うことが可能である。   As described above, according to the present embodiment, the reference block and the search area are each divided into a plurality of unit blocks, and the unit of the reference block among the divided unit block of the reference block and the unit block of the search area is divided. The blocks are input in common to the correlation calculation units 3a to 3h, and the unit blocks in the search area are input to the correlation calculation units 3a to 3h so that the unit blocks of a plurality of reference blocks adjacent in the horizontal direction are input to the correlation calculation units 3a to 3h. The correlation calculation results related to the reference block to be obtained can be obtained simultaneously. That is, since the data input to the correlation calculation units 3a to 3h can be made almost common (the standard block data is made completely common and most of the reference block data is made common), the correlation is made fast with a small circuit scale. It is possible to perform calculations.

また、上記した変形例のように、1つの単位ブロックの格納エリアを分割するようにすることで、ブロックサイズが大きくなっても、回路規模をそれほど増大させる必要がない。   Further, by dividing the storage area of one unit block as in the above-described modification, it is not necessary to increase the circuit scale so much even if the block size increases.

なお、上記した実施形態及び変形例においては、1つの単位ブロックを設定する際の所定ラインを1ラインとしているが、これを他の任意のライン数としても良い。例えば、上記した実施形態及び変形例において、所定ラインを2ラインとした場合には基準ブロックデータ格納SRAM2a、サーチエリアデータ格納SRAM2bの1つのアドレスにそれぞれ2ライン分のデータが格納され、2ライン分のデータを単位として相関演算が行われる。   In the above-described embodiments and modifications, the predetermined line when setting one unit block is one line, but this may be any other number of lines. For example, in the above-described embodiment and modification, when the predetermined line is two lines, two lines of data are stored in one address of the reference block data storage SRAM 2a and the search area data storage SRAM 2b, respectively. Correlation calculation is performed in units of data.

更に、基準ブロックのブロックサイズやサーチエリアのエリアサイズも上記した例に限られるものではない。また、これらのサイズを変更した場合には、それに応じて相関演算部の数を増減させることが好ましい。   Further, the block size of the reference block and the area size of the search area are not limited to the above example. In addition, when these sizes are changed, it is preferable to increase or decrease the number of correlation calculation units accordingly.

また、上記した実施形態及び変形例においては、データの読み出しを水平方向に行っているが、垂直方向に行っても良い。この場合には単位ブロックを垂直方向に対して設定する。   In the above-described embodiment and modification, data is read in the horizontal direction, but may be read in the vertical direction. In this case, the unit block is set in the vertical direction.

また、上記した実施形態及び変形例においては、基準ブロックデータ及びサーチエリアデータをSRAMに格納しているが、これらはフリップフロップ(FF)等でも代用できる。ただし、回路規模の観点等からはSRAMを用いることが好ましい。   In the above-described embodiments and modifications, the reference block data and the search area data are stored in the SRAM. However, these can be substituted by a flip-flop (FF) or the like. However, it is preferable to use SRAM from the viewpoint of circuit scale.

以上実施形態に基づいて本発明を説明したが、本発明は上記した実施形態に限定されるものではなく、本発明の要旨の範囲内で種々の変形や応用が可能なことは勿論である。   Although the present invention has been described based on the above embodiments, the present invention is not limited to the above-described embodiments, and various modifications and applications are naturally possible within the scope of the gist of the present invention.

さらに、上記した実施形態には種々の段階の発明が含まれており、開示される複数の構成要件の適当な組合せにより種々の発明が抽出され得る。例えば、実施形態に示される全構成要件からいくつかの構成要件が削除されても、発明が解決しようとする課題の欄で述べた課題が解決でき、発明の効果の欄で述べられている効果が得られる場合には、この構成要件が削除された構成も発明として抽出され得る。   Further, the above-described embodiments include various stages of the invention, and various inventions can be extracted by appropriately combining a plurality of disclosed constituent elements. For example, even if some constituent requirements are deleted from all the constituent requirements shown in the embodiment, the problem described in the column of the problem to be solved by the invention can be solved, and the effect described in the column of the effect of the invention Can be extracted as an invention.

本発明の一実施形態に係る動きベクトル検出装置の構成について示す図である。It is a figure shown about the structure of the motion vector detection apparatus which concerns on one Embodiment of this invention. 図2(a)は基準ブロックについて示す図であり、図2(b)はサーチエリアについて示す図である。FIG. 2A is a diagram showing the reference block, and FIG. 2B is a diagram showing the search area. 図3(a)は基準ブロックデータ格納SRAMの構成を示す図であり、図3(b)は基準ブロックデータ格納SRAMの各アドレスに格納されるデータについて示した図である。FIG. 3A is a diagram showing a configuration of the reference block data storage SRAM, and FIG. 3B is a diagram showing data stored at each address of the reference block data storage SRAM. 図4(a)はサーチエリアデータ格納SRAMの構成を示す図であり、図4(b)はサーチエリアデータ格納SRAMの各アドレスに格納されるデータについて示した図である。FIG. 4A is a diagram showing a configuration of the search area data storage SRAM, and FIG. 4B is a diagram showing data stored at each address of the search area data storage SRAM. 基準ブロックデータ格納SRAM及びサーチエリアデータ格納SRAMと各相関演算部との接続について説明するための図である。It is a figure for demonstrating the connection with reference | standard block data storage SRAM and search area data storage SRAM, and each correlation calculating part. 相関演算部の構成について示す図である。It is a figure shown about the structure of a correlation calculating part. 統計処理部について説明するための図である。It is a figure for demonstrating a statistics process part. 動きベクトル検出装置のブロックマッチングに係るタイミングチャートである。It is a timing chart which concerns on block matching of a motion vector detection apparatus. 図8のタイミングチャートに従ったブロックマッチングの概略を示した図である。It is the figure which showed the outline of the block matching according to the timing chart of FIG. 図10(a)は変形例の基準ブロックデータ格納SRAMの構成を示す図であり、図10(b)は変形例の基準ブロックデータ格納SRAMの各アドレスに格納されるデータについて示した図である。FIG. 10A is a diagram illustrating a configuration of a reference block data storage SRAM according to a modification, and FIG. 10B is a diagram illustrating data stored at each address of the reference block data storage SRAM according to the modification. . 図11(a)は変形例のサーチエリアデータ格納SRAMの構成を示す図であり、図11(b)は変形例のサーチエリアデータ格納SRAMからのデータの読み出しについて説明するための図であり、図11(c)は変形例のサーチエリアデータ格納SRAMの各アドレスに格納されるデータについて示した図である。FIG. 11A is a diagram showing a configuration of a modified search area data storage SRAM, and FIG. 11B is a diagram for explaining reading of data from the modified search area data storage SRAM. FIG. 11C is a diagram showing data stored at each address of the search area data storage SRAM of the modification. 変形例のブロックマッチングの概略を示した図である。It is the figure which showed the outline of the block matching of a modification. 本発明の一実施形態に係る動きベクトル検出装置を適用した撮像装置の一例としてのデジタルカメラの構成について示す図である。It is a figure shown about the structure of the digital camera as an example of the imaging device to which the motion vector detection apparatus which concerns on one Embodiment of this invention is applied. 図13のデジタルカメラにおける手ぶれ補正の処理の流れについて説明するための第1図である。FIG. 14 is a first diagram for explaining a flow of camera shake correction processing in the digital camera of FIG. 13. 図13のデジタルカメラにおける手ぶれ補正の処理の流れについて説明するための第2図である。FIG. 14 is a second diagram for explaining the flow of camera shake correction processing in the digital camera of FIG. 13. 電子手ぶれ補正について説明するための図である。It is a figure for demonstrating electronic camera shake correction. ブロックマッチングの概念について説明するための図である。It is a figure for demonstrating the concept of block matching. 従来の動きベクトル検出装置の構成例について示す図である。It is a figure shown about the structural example of the conventional motion vector detection apparatus.

符号の説明Explanation of symbols

1…メインメモリ、2a…基準ブロックデータ格納SRAM、2b…サーチエリアデータ格納SRAM、3a〜3h…相関演算部、4…最小値検出部、5…タイミング回路、6…統計処理部、101…CCD、102…プリプロセス部、103…画像バス、104…メインメモリ、105…動き検出装置、106…CPUバス、107…CPU、108…画像処理部、109…ビデオエンコーダ、110…TFT表示部   DESCRIPTION OF SYMBOLS 1 ... Main memory, 2a ... Reference block data storage SRAM, 2b ... Search area data storage SRAM, 3a-3h ... Correlation calculating part, 4 ... Minimum value detection part, 5 ... Timing circuit, 6 ... Statistical processing part, 101 ... CCD DESCRIPTION OF SYMBOLS 102 ... Pre-processing part 103 ... Image bus 104 ... Main memory 105 ... Motion detection apparatus 106 ... CPU bus | bath 107 ... CPU 108 ... Image processing part 109 ... Video encoder 110 ... TFT display part

Claims (7)

基準フレームを複数の基準ブロックに分割し、参照フレームに前記基準フレームに対応するサーチエリアを設定し、前記基準ブロックと前記サーチエリア内の参照ブロックとの間で相関演算を行うことで動きベクトルを検出する動きベクトル検出装置において、
前記基準ブロックのデータを格納する基準ブロックデータ格納部と、
前記サーチエリアのデータを格納するサーチエリアデータ格納部と、
前記基準ブロックのデータと前記サーチエリアのデータ内の参照ブロックのデータとを用いて複数の異なる相関演算を行う複数の相関演算部と、
を具備し、
前記複数の相関演算部に共通に前記基準ブロックのデータを所定ライン分ずつに分割した基準ブロックの単位ブロックのデータを入力すると共に、前記複数の相関演算部のそれぞれに前記サーチエリアのデータを前記所定ライン分ずつに分割したサーチエリアのデータの単位ブロックにおいて前記参照ブロックを水平方向に1画素ずつずらして得られる複数の参照ブロックの単位ブロックのデータのそれぞれを入力することを特徴とする動きベクトル検出装置。
A reference frame is divided into a plurality of reference blocks, a search area corresponding to the reference frame is set in a reference frame, and a motion vector is calculated by performing a correlation operation between the reference block and the reference block in the search area. In the motion vector detection device to detect,
A reference block data storage for storing data of the reference block;
A search area data storage unit for storing data of the search area;
A plurality of correlation calculation units that perform a plurality of different correlation calculations using the data of the standard block and the data of the reference block in the data of the search area;
Comprising
The reference block unit block data obtained by dividing the reference block data into predetermined lines for each of the plurality of correlation calculation units is input, and the search area data is input to each of the plurality of correlation calculation units. A motion vector comprising: a plurality of reference block unit block data obtained by shifting the reference block by one pixel in a horizontal direction in a search area data unit block divided into predetermined lines. Detection device.
前記複数の相関演算部に前記基準ブロックの単位ブロックのデータを垂直方向に1単位ブロック分ずつずらしながら順次入力すると共に、前記複数の相関演算部に前記参照ブロックの単位ブロックのデータを垂直方向に1単位ブロック分ずつずらしながら入力し、
前記複数の相関演算部はそれぞれ、前記基準ブロックの単位ブロックのデータ及び前記参照ブロックの単位ブロックのデータが入力される毎に前記基準ブロックの単位ブロックのデータと前記参照ブロックの単位ブロックのデータとの間での相関演算を行い、前記基準ブロックと前記参照ブロックの全ての単位ブロックに対する相関演算が終了した時点で、前記基準ブロックと前記参照ブロックとの間の相関演算結果を同時に得ることを特徴とする請求項1に記載の動きベクトル検出装置。
The unit block data of the reference block is sequentially input to the plurality of correlation calculation units while being shifted by one unit block in the vertical direction, and the unit block data of the reference block is vertically input to the plurality of correlation calculation units. Enter while shifting by one unit block,
Each of the plurality of correlation calculation units receives the unit block data of the reference block and the unit block data of the reference block each time the unit block data and the reference block unit block data are input. The correlation calculation between the base block and the reference block is obtained at the same time when the correlation calculation for all the unit blocks of the base block and the reference block is completed. The motion vector detection device according to claim 1.
前記複数の相関演算部はそれぞれ、前記サーチエリアにおける前記参照ブロックの垂直方向の位置を1ラインずつずらす毎に前記基準ブロックと前記参照ブロックとの間の相関演算を行うことにより、前記基準ブロックと前記サーチエリアとの間の相関演算結果を得ることを特徴とする請求項2に記載の動きベクトル検出装置。   Each of the plurality of correlation calculation units performs a correlation calculation between the reference block and the reference block each time the vertical position of the reference block in the search area is shifted by one line, thereby The motion vector detection apparatus according to claim 2, wherein a correlation calculation result with the search area is obtained. 前記基準ブロックデータ格納部は、前記基準ブロックの単位ブロックのデータが分割して格納される複数のエリアに分割されており、
前記サーチエリアデータ格納部は、前記サーチエリアの単位ブロックのデータが分割して格納される複数のエリアに分割されていることを特徴とする請求項2に記載の動きベクトル検出装置。
The reference block data storage unit is divided into a plurality of areas in which data of unit blocks of the reference block is divided and stored,
3. The motion vector detection device according to claim 2, wherein the search area data storage unit is divided into a plurality of areas in which unit block data of the search area is divided and stored.
前記複数の相関演算部はそれぞれ、少なくとも差分絶対値和演算と差分二乗和演算の何れかにより前記相関演算を行い、
前記相関演算部における相関演算結果の最小値を検出し、前記最小値が検出されたときの前記参照ブロックの位置を、前記動きベクトルとして出力する最小値検出部を含むことを特徴とする請求項1乃至4の何れか1つに記載の動きベクトル検出装置。
Each of the plurality of correlation calculation units performs the correlation calculation by at least one of a difference absolute value sum calculation and a difference square sum calculation,
A minimum value detection unit that detects a minimum value of a correlation calculation result in the correlation calculation unit and outputs a position of the reference block when the minimum value is detected as the motion vector. 5. The motion vector detection device according to any one of 1 to 4.
前記基準ブロックデータ格納部及び前記サーチエリアデータ格納部はそれぞれSRAMで構成されることを特徴とする請求項1乃至5の何れか1つに記載の動きベクトル検出装置。   6. The motion vector detection device according to claim 1, wherein each of the reference block data storage unit and the search area data storage unit includes an SRAM. 被写体を複数回撮像して基準フレームのデータと参照フレームのデータを得る撮像部と、
前記撮像部で得られた基準フレームのデータと前記参照フレームのデータとから前記相関演算を行って前記動きベクトルを検出する請求項1乃至6の何れか1つに記載の動きベクトル検出装置と、
前記動きベクトル検出装置で検出された動きベクトルに基づいて手ぶれ補正処理と動画像圧縮処理の少なくとも何れか一方を行う画像処理部と、
を具備することを特徴とする撮像装置。
An imaging unit that captures a subject multiple times to obtain data of a reference frame and data of a reference frame;
The motion vector detection device according to any one of claims 1 to 6, wherein the motion vector is detected by performing the correlation calculation from the data of the reference frame obtained by the imaging unit and the data of the reference frame.
An image processing unit that performs at least one of a camera shake correction process and a moving image compression process based on a motion vector detected by the motion vector detection device;
An imaging apparatus comprising:
JP2005276260A 2005-09-22 2005-09-22 Motion vector detection device and imaging device Expired - Fee Related JP4547321B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005276260A JP4547321B2 (en) 2005-09-22 2005-09-22 Motion vector detection device and imaging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005276260A JP4547321B2 (en) 2005-09-22 2005-09-22 Motion vector detection device and imaging device

Publications (2)

Publication Number Publication Date
JP2007088910A true JP2007088910A (en) 2007-04-05
JP4547321B2 JP4547321B2 (en) 2010-09-22

Family

ID=37975439

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005276260A Expired - Fee Related JP4547321B2 (en) 2005-09-22 2005-09-22 Motion vector detection device and imaging device

Country Status (1)

Country Link
JP (1) JP4547321B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340618A (en) * 2010-07-19 2012-02-01 佳能企业股份有限公司 Method for determining offset between images
US9286535B2 (en) 2013-12-09 2016-03-15 Olympus Corporation Image processing device, image processing method, and imaging device
US9483713B2 (en) 2013-12-09 2016-11-01 Olympus Corporation Image processing device, image processing method, and imaging device
US11288787B2 (en) 2017-04-05 2022-03-29 Olympus Corporation Correlation value calculation device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05268593A (en) * 1992-03-23 1993-10-15 Nippon Telegr & Teleph Corp <Ntt> Difference absolute sum/difference square sum parallel arithmetic operation device
JPH07162853A (en) * 1993-12-07 1995-06-23 Hitachi Ltd Image pickup device
JPH07203457A (en) * 1993-12-27 1995-08-04 Oki Electric Ind Co Ltd Motion vector detector
JP2004214733A (en) * 2002-12-26 2004-07-29 Matsushita Electric Ind Co Ltd Motion vector detection apparatus, motion vector detecting method, program, and recording medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05268593A (en) * 1992-03-23 1993-10-15 Nippon Telegr & Teleph Corp <Ntt> Difference absolute sum/difference square sum parallel arithmetic operation device
JPH07162853A (en) * 1993-12-07 1995-06-23 Hitachi Ltd Image pickup device
JPH07203457A (en) * 1993-12-27 1995-08-04 Oki Electric Ind Co Ltd Motion vector detector
JP2004214733A (en) * 2002-12-26 2004-07-29 Matsushita Electric Ind Co Ltd Motion vector detection apparatus, motion vector detecting method, program, and recording medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340618A (en) * 2010-07-19 2012-02-01 佳能企业股份有限公司 Method for determining offset between images
US9286535B2 (en) 2013-12-09 2016-03-15 Olympus Corporation Image processing device, image processing method, and imaging device
US9483713B2 (en) 2013-12-09 2016-11-01 Olympus Corporation Image processing device, image processing method, and imaging device
US11288787B2 (en) 2017-04-05 2022-03-29 Olympus Corporation Correlation value calculation device

Also Published As

Publication number Publication date
JP4547321B2 (en) 2010-09-22

Similar Documents

Publication Publication Date Title
JP4340915B2 (en) Captured image signal distortion correction method, captured image signal distortion correction apparatus, imaging method, and imaging apparatus
US7692688B2 (en) Method for correcting distortion of captured image, device for correcting distortion of captured image, and imaging device
EP2063646A2 (en) Method and apparatus for predictive coding
US20100053343A1 (en) Apparatus for correcting motion caused by hand shake
WO2011129249A1 (en) Image processing device, image capture device, program, and image processing method
JP2005044098A (en) Image processor and image processing method
US8861846B2 (en) Image processing apparatus, image processing method, and program for performing superimposition on raw image or full color image
KR980010827A (en) Local area image tracking device
JP2009105533A (en) Image processing device, imaging device, image processing method, and picked-up image processing method
JP3123130B2 (en) Motion vector detection device
JP4547321B2 (en) Motion vector detection device and imaging device
JP4597103B2 (en) Motion vector search method and apparatus
JP5044922B2 (en) Imaging apparatus and program
JP2007079708A (en) Image processor and processing method
JP2007267232A (en) Electronic camera shake correction method and apparatus thereof, and imaging apparatus
KR101091054B1 (en) Device for motion search in dynamic image encoding
CN108875733B (en) Infrared small target rapid extraction system
JP4432786B2 (en) Camera device 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
JP4888306B2 (en) Image processing apparatus and image processing method
JP2007028208A (en) Image processing apparatus and imaging apparatus
JP6467940B2 (en) Image processing apparatus, image processing method, and program
JP2009065323A (en) Image processing device, image processing method, imaging apparatus, and imaging method
JP4696056B2 (en) Camera shake vector calculation method and apparatus thereof, camera shake vector calculation program, electronic camera shake correction method and apparatus, electronic camera shake correction program, and imaging apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080520

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100302

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100413

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100603

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

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

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

Free format text: PAYMENT UNTIL: 20130709

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4547321

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313115

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees