JP2019192048A - Imaging apparatus - Google Patents

Imaging apparatus Download PDF

Info

Publication number
JP2019192048A
JP2019192048A JP2018085951A JP2018085951A JP2019192048A JP 2019192048 A JP2019192048 A JP 2019192048A JP 2018085951 A JP2018085951 A JP 2018085951A JP 2018085951 A JP2018085951 A JP 2018085951A JP 2019192048 A JP2019192048 A JP 2019192048A
Authority
JP
Japan
Prior art keywords
feature point
vector
image
value
unit
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.)
Pending
Application number
JP2018085951A
Other languages
Japanese (ja)
Inventor
俊宏 望月
Toshihiro Mochizuki
俊宏 望月
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2018085951A priority Critical patent/JP2019192048A/en
Publication of JP2019192048A publication Critical patent/JP2019192048A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)
  • Studio Devices (AREA)

Abstract

To provide an imaging apparatus capable of completing processing in a predetermined period such as one frame period, even when a template area to be processed is biased in a field angle in vector detection for performing feature point tracking.SOLUTION: The imaging apparatus reduces the search range of template matching, to increase the speed of vector detection processing and complete processing in the predetermined period such as one frame period, when a vector detection area is biased in the vector detection for performing the feature point tracking.SELECTED DRAWING: Figure 7

Description

本発明は、複数のフレーム画像間で特徴点を追跡し、動きベクトルを検出するハードウェアの構成に関する。   The present invention relates to a hardware configuration for tracking feature points between a plurality of frame images and detecting a motion vector.

デジタルスチルカメラやデジタルビデオカメラ等の撮像装置を用いて撮影された映像に対して手ぶれ補正を施すためには、フレーム画像間の動き量を検出して複数枚の画像に対して位置合わせを行う必要がある。フレーム画像間の動き量を検出する方法としては、ジャイロセンサのような外部機器の情報を用いたり、撮影されたフレーム画像から動き量を推定したりする方法等がある。   In order to perform camera shake correction on video shot using an imaging device such as a digital still camera or a digital video camera, the amount of motion between frame images is detected and alignment is performed on a plurality of images. There is a need. As a method for detecting the amount of motion between frame images, there are a method of using information of an external device such as a gyro sensor, a method of estimating the amount of motion from a captured frame image, and the like.

フレーム画像を用いた動き量推定の方法は従来から種々提案されているが、その代表的なものとしてテンプレートマッチングによる動きベクトル検出がある。テンプレートマッチングでは、まず映像中のある2枚のフレーム画像の一方を原画像、もう一方を参照画像とする。そして、原画像上に配置した所定の大きさの矩形領域をテンプレートブロックとし、参照画像の各位置においてテンプレートブロック内の画素値の分布との相関を求める。   Various methods for estimating the amount of motion using a frame image have been proposed in the past. A typical example is motion vector detection by template matching. In template matching, first, one of two frame images in a video is used as an original image and the other is used as a reference image. Then, a rectangular area having a predetermined size arranged on the original image is used as a template block, and a correlation with a distribution of pixel values in the template block is obtained at each position of the reference image.

このとき、参照画像中で最も相関が高くなる位置がテンプレートブロックの移動先であり、原画像上でのテンプレートブロックの位置を基準とした時の移動先への向きと移動量が動きベクトルとなる。動きベクトルの検出率を向上させるため、特徴点を抽出し、抽出した特徴点にテンプレートブロックを配置し、フレーム画像でテンプレートマッチングを行う技術がある。   At this time, the position where the correlation is highest in the reference image is the destination of the template block, and the direction and amount of movement to the destination when the position of the template block on the original image is used as a reference is the motion vector. . In order to improve the detection rate of motion vectors, there is a technique for extracting feature points, placing template blocks at the extracted feature points, and performing template matching with frame images.

ここで、画像全体で特徴点抽出を行うと、特徴点の分布は不均一になることが多い。不均一な特徴点に対して得られた動きベクトルを手ぶれ補正の用途で使用する場合、特徴の集中した領域が主となる手ぶれ補正となってしまう。そこで、特徴点を均一に分布させるため、画像をグリッド状に分割して、特徴の大きさを表す特徴値を画素ごとに計算し、各グリッド内で特徴値が最も大きい画素を特徴点として抽出する技術がある(例えば特許文献1)。   Here, if feature points are extracted from the entire image, the distribution of feature points is often non-uniform. When motion vectors obtained for non-uniform feature points are used for the purpose of camera shake correction, an area where features are concentrated is the main camera shake correction. Therefore, in order to distribute the feature points uniformly, the image is divided into grids, feature values representing the feature size are calculated for each pixel, and the pixel with the largest feature value in each grid is extracted as the feature point. There is a technique (for example, Patent Document 1).

さらに動きベクトルの検出率を向上させるため、特徴点を追跡する技術がある。特徴点追跡は、画像から抽出された特徴点の動きベクトルを、連続する複数のフレーム画像に渡って逐次検出することで実現できる(例えば特許文献2)。   Furthermore, there is a technique for tracking feature points in order to improve the detection rate of motion vectors. Feature point tracking can be realized by sequentially detecting motion vectors of feature points extracted from an image over a plurality of continuous frame images (for example, Patent Document 2).

図12は、特徴点追跡処理の概略を示す図である。図12(a)において特徴点抽出を行う特徴点グリッド1004内で特徴点1001を算出し、テンプレート領域1003内でテンプレートマッチングを実施してベクトル値1004を算出する。特徴点抽出グリッドの周囲には、特徴点抽出は実施されないが、テンプレートマッチングで使用される周辺グリッド1005が配置される。   FIG. 12 is a diagram showing an outline of the feature point tracking process. In FIG. 12A, a feature point 1001 is calculated in a feature point grid 1004 for performing feature point extraction, and template matching is performed in the template region 1003 to calculate a vector value 1004. Around the feature point extraction grid, feature point extraction is not performed, but a peripheral grid 1005 used for template matching is arranged.

次のフレームの処理では算出されたベクトル値1004を特徴点1001に加算した追跡先となる特徴点(以下、追跡先特徴点)1002を中心にテンプレートマッチングを実施する。以後、複数フレームに渡って、追跡先特徴点に対して、ベクトル値を加算して特徴点の追跡を実施する。   In the processing of the next frame, template matching is performed around a feature point (hereinafter referred to as a tracking destination feature point) 1002 as a tracking destination obtained by adding the calculated vector value 1004 to the feature point 1001. Thereafter, the feature points are tracked by adding the vector value to the tracking destination feature points over a plurality of frames.

ただし、特徴点追跡では、追跡している特徴点が画角外に消えてしまったり、何らかの物体に隠れて見えなくなってしまったりすることで、特徴点が消失し、追跡が失敗してしまうことがある。このような追跡の失敗により追跡対象の特徴点の数が減ってしまった際に、別の特徴点を追跡対象として設定する(補填する)ことが必要である。   However, in the feature point tracking, the feature point that is being tracked disappears outside the angle of view or disappears because it is hidden behind some object, so that the feature point disappears and the tracking fails. There is. When the number of feature points to be tracked decreases due to such a tracking failure, it is necessary to set (complement) another feature point as a tracked object.

特開2008−192060号公報JP 2008-192060 A 特開2007−334625号公報JP 2007-334625 A

特徴点追跡処理を含むテンプレートマッチングをハードウェア化する際に、図12(b)のように追跡先特徴点が画角の下端部に集中した場合は、追跡先特徴点を中心としたテンプレートマッチングの処理時間によって、所定の時間内に終了しないという課題が発生する。   When template matching including feature point tracking processing is implemented as hardware, if tracking destination feature points are concentrated at the lower end of the angle of view as shown in FIG. Due to this processing time, there arises a problem that it does not end within a predetermined time.

図13は、特徴点追跡処理の処理タイミングを示す図(処理時間がセンサの1フレーム出力期間に収まる例)である。図14は、特徴点追跡処理の処理タイミングを示す図(処理時間がセンサの1フレーム出力期間に収まらない例)である。   FIG. 13 is a diagram illustrating the processing timing of the feature point tracking processing (an example in which the processing time falls within one frame output period of the sensor). FIG. 14 is a diagram illustrating the processing timing of the feature point tracking processing (an example in which the processing time does not fit in one frame output period of the sensor).

図13(a)及び図14(a)は、センサ出力からテンプレートマッチング終了までの処理タイミングを、図13(b)及び図14(b)は、追跡先特徴点の画角内の分布を示す図である。図13(a)において、VD信号のパルス間がセンサ出力の1フレーム分の期間を示している。センサ出力された画像データに対して、テンプレートマッチング用画像が生成される。テンプレートマッチングの処理は、テンプレートマッチング用画像に対して行われる。テンプレートマッチングの丸1〜丸8の各期間が一つのテンプレートマッチングの処理を実行するために要する時間で、テンプレートのサイズによって増減する。防振処理の性能向上のためにはセンサ出力の1フレーム期間内など一定期間内にテンプレートマッチングの処理を完了して、次のフレームの防振処理にフィードバックする使用する必要がある。   FIGS. 13A and 14A show the processing timing from sensor output to the end of template matching, and FIGS. 13B and 14B show the distribution of the tracking destination feature points within the angle of view. FIG. In FIG. 13A, the interval between pulses of the VD signal indicates a period of one frame of sensor output. A template matching image is generated for the image data output from the sensor. The template matching process is performed on the template matching image. Each period of the template matching circles 1 to 8 is the time required to execute one template matching process, and increases or decreases depending on the size of the template. In order to improve the performance of the image stabilization process, it is necessary to complete the template matching process within a certain period such as one frame period of the sensor output and feed it back to the image stabilization process for the next frame.

図13(b)のように追跡先特徴点が、画角内に分散して分布する場合には、処理が終了する場合であっても、図14(b)のように追跡先特徴点が画角内の下側に集中することがある。このような場合、図13(b)のテンプレートマッチング処理が開始できる最初のテンプレート位置1101までの期間(1100)に対して、図14(b)のテンプレートマッチング処理が開始できるテンプレート位置1201までの期間(1200)が長くなる。この遅延により、テンプレートマッチングの丸1〜丸8の期間がセンサ出力の1V期間など一定期間内に完了しない場合が起こりうる。   When the tracking destination feature points are distributed and distributed within the angle of view as shown in FIG. 13B, the tracking destination feature points are shown in FIG. 14B even when the processing is finished. May concentrate on the lower side of the angle of view. In such a case, the period up to the template position 1201 in which the template matching process in FIG. 14B can be started with respect to the period up to the first template position 1101 in which the template matching process in FIG. 13B can be started (1100). (1200) becomes longer. Due to this delay, there may occur a case where the period of circle 1 to circle 8 of template matching is not completed within a certain period such as 1 V period of sensor output.

従来開示されている技術では、前記のような特徴点追跡を行うテンプレートマッチングにおいて画角内でテンプレートが偏り、テンプレートマッチングの処理が所定の期間内に終了しない課題に対する解決手段には言及されていない。   In the technique disclosed in the related art, in the template matching for performing the feature point tracking as described above, the template is biased within the angle of view, and the solution to the problem that the template matching process does not end within a predetermined period is not mentioned. .

本発明は、前記課題を鑑みて成されたものである。本発明の目的は、特徴点追跡を行うベクトル検出において特徴点の初期座標から追跡範囲を設定し、追跡範囲を超えた場合、破棄・補填処理をすることで1フレーム期間内など所定期間内に処理が完了する撮像装置を提供することである。   The present invention has been made in view of the above problems. An object of the present invention is to set a tracking range from the initial coordinates of feature points in vector detection for performing feature point tracking, and when exceeding the tracking range, discard / compensation processing is performed within a predetermined period such as one frame period. It is to provide an imaging device that completes processing.

画像を複数の領域に分割する領域分割手段、各領域内で所定数の特徴点を抽出する特徴点抽出手段、映像中の2枚のフレーム画像の一方を原画像、もう一方を参照画像とし、特徴点を中心とする参照画像の矩形領域内と原画像の矩形領域内の画素値で相関値演算処理を行い、動きベクトルを検出するベクトル検出手段、ベクトル検出手段で取得した前フレームのベクトル値と特徴点抽出手段で取得した前フレームの特徴点から続くフレームの追跡対象となる追跡先特徴点を算出する追跡先特徴点算出手段、前記追跡先特徴点算出手段により算出された特徴点を保持する特徴点保持手段を有し、ベクトル検出手段は、保持されている特徴点に応じて、用いる特徴点の探索範囲を削減することを特徴としている。   An area dividing means for dividing the image into a plurality of areas, a feature point extracting means for extracting a predetermined number of feature points in each area, one of the two frame images in the video as an original image, and the other as a reference image, Vector detection means for detecting a motion vector by performing correlation value calculation processing on the pixel values in the rectangular area of the reference image centered on the feature point and in the rectangular area of the original image, and the vector value of the previous frame obtained by the vector detection means The tracking destination feature point calculating means for calculating the tracking destination feature point to be tracked of the subsequent frame from the feature point of the previous frame acquired by the feature point extracting means, and the feature point calculated by the tracking destination feature point calculating means is retained. The feature point holding means is characterized in that the vector detecting means reduces the search range of the feature points to be used in accordance with the held feature points.

本発明によれば、特徴点追跡を行うベクトル検出においてベクトル検出領域が偏った場合に、テンプレートマッチングの探索範囲を削減することでベクトル検出処理を高速化し、1フレーム期間内など所定期間内に処理が完了することが可能となる。   According to the present invention, when the vector detection area is biased in vector detection for performing feature point tracking, the vector detection processing is speeded up by reducing the template matching search range, and processing is performed within a predetermined period such as one frame period. Can be completed.

本発明の実施形態に係る撮像装置であるデジタルカメラのブロック図である。1 is a block diagram of a digital camera that is an imaging apparatus according to an embodiment of the present invention. 本発明の実施形態に係る撮像装置が具備するベクトル検出回路のブロック図である。It is a block diagram of the vector detection circuit with which the imaging device concerning an embodiment of the present invention is provided. 本発明の実施形態に係る撮像装置が具備するベクトル検出回路が読み出すグリッド配置と特徴点、テンプレートマッチング領域の関係を示す図である。It is a figure which shows the relationship between the grid arrangement | positioning which the vector detection circuit with which the imaging device which concerns on embodiment of this invention comprises, a feature point, and a template matching area | region is read. 本発明の実施形態に係る撮像装置が具備するベクトル検出回路の処理フローを示す図である。It is a figure which shows the processing flow of the vector detection circuit with which the imaging device which concerns on embodiment of this invention comprises. 本発明の実施形態に係る撮像装置が具備する特徴点算出手段のブロック図である。It is a block diagram of the feature point calculation means with which the imaging device concerning an embodiment of the present invention is provided. 本発明の実施形態に係る撮像装置が具備する精度判定手段における画像解析で画素値と判定の関係を示すグラフである。It is a graph which shows the relationship between a pixel value and determination by the image analysis in the accuracy determination means with which the imaging device which concerns on embodiment of this invention comprises. 本発明の実施形態に係る撮像装置が具備するテンプレートマッチング処理手段203のブロック図である。It is a block diagram of the template matching process means 203 with which the imaging device which concerns on embodiment of this invention comprises. 本発明の実施形態に係る撮像装置が具備するテンプレートマッチング処理手段203の処理を示すフローチャートである。It is a flowchart which shows the process of the template matching process means 203 with which the imaging device which concerns on embodiment of this invention comprises. 本発明の実施形態に係る撮像装置が具備する領域区分手段801の処理について説明する図である。It is a figure explaining the process of the area | region division means 801 with which the imaging device which concerns on embodiment of this invention comprises. 本発明の実施形態に係る撮像装置が具備する第一のテンプレート追跡範囲削減804について説明する図である。It is a figure explaining the 1st template tracking range reduction 804 with which the imaging device concerning an embodiment of the present invention is provided. 本発明の実施形態に係る撮像装置が具備する第二のテンプレート追跡範囲削減805について説明する図である。It is a figure explaining the 2nd template tracking range reduction 805 with which the imaging device which concerns on embodiment of this invention comprises. 特徴点追跡処理の概略を示す図である。It is a figure which shows the outline of a feature point tracking process. 特徴点追跡処理の処理タイミングを示す図(処理時間がセンサの1フレーム出力期間に収まる例)である。It is a figure which shows the process timing of a feature point tracking process (example in which processing time is settled in 1 frame output period of a sensor). 特徴点追跡処理の処理タイミングを示す図(処理時間がセンサの1フレーム出力期間に収まらない例)である。It is a figure which shows the process timing of a feature point tracking process (an example in which the processing time does not fit in one frame output period of the sensor).

以下、添付図面を参照して、本発明を実施するための最良の形態を説明する。 図1は、本発明に係る撮像装置であるデジタルカメラのブロック図である。図1において、結像光学部101はレンズおよび絞りなどを備えており、撮影の際、結像光学部101はフォーカス調節および露出調節を行い、撮像素子102に光学像を結像する。撮像素子102は、光学像を電気信号(アナログ画像信号)に変換する光電変換機能を有し、CCDやCMOSセンサ等で構成される。A/D変換部103は撮像素子部102からのアナログ画像信号をデジタル画像信号に変換する。   The best mode for carrying out the present invention will be described below with reference to the accompanying drawings. FIG. 1 is a block diagram of a digital camera which is an imaging apparatus according to the present invention. In FIG. 1, the imaging optical unit 101 includes a lens, a diaphragm, and the like. During imaging, the imaging optical unit 101 performs focus adjustment and exposure adjustment, and forms an optical image on the image sensor 102. The image sensor 102 has a photoelectric conversion function for converting an optical image into an electrical signal (analog image signal), and is configured by a CCD, a CMOS sensor, or the like. The A / D conversion unit 103 converts the analog image signal from the image sensor unit 102 into a digital image signal.

CPU112は、撮像装置全体の制御を司るマイクロコンピュータ等で構成され、各機能ブロックに対して動作指示を行い、各種の制御処理を実行する。バス114はシステムバスであり、バス115は画像データバスである。DRAM(メモリ)107は、データを記憶するメモリで、所定枚数の静止画像や所定時間の動画像、音声等のデータやCPU112の動作用の定数、プログラム等を格納するのに十分な記憶容量を備える。メモリ制御部106は、CPU112或いはデータ転送部105からの指示に応じて、DRAM107へのデータ書き込み及びデータ読み出しを行う。   The CPU 112 is configured by a microcomputer or the like that controls the entire imaging apparatus, and issues operation instructions to each functional block to execute various control processes. The bus 114 is a system bus, and the bus 115 is an image data bus. A DRAM (memory) 107 is a memory for storing data, and has a sufficient storage capacity for storing a predetermined number of still images, a moving image for a predetermined time, audio data, constants for operating the CPU 112, programs, and the like. Prepare. The memory control unit 106 performs data writing to and data reading from the DRAM 107 in accordance with instructions from the CPU 112 or the data transfer unit 105.

不揮発性メモリ制御部108は、CPU112からの指示に応じて、ROM(不揮発性メモリ)109にデータの書き込み及び読み出しを行う。ROM109は、電気的に消去・記録可能なメモリであり、EEPROM等が用いられる。ROM109には、CPU112の動作用の定数、プログラム等が記憶される。   The nonvolatile memory control unit 108 writes and reads data to and from a ROM (nonvolatile memory) 109 in accordance with instructions from the CPU 112. The ROM 109 is an electrically erasable / recordable memory, and an EEPROM or the like is used. The ROM 109 stores constants for operating the CPU 112, programs, and the like.

CPU112は、バス114を介して画像処理部104、データ転送部105、メモリ制御部106、不揮発性メモリ制御部108、表示制御部110、操作部113、撮像素子102を制御する。マイクロコンピュータの実行は、ROM109に記録されたプログラムを実行することにより、本実施例の各処理を実現する。表示部111は、液晶モニタ等から成り、表示制御部110により制御され、各種画像データ等を表示部111に表示する。操作部113は、ユーザーにより操作されるスイッチやボタン等を含み、電源のON/OFF、シャッターのON/OFF等の操作に使用される。   The CPU 112 controls the image processing unit 104, the data transfer unit 105, the memory control unit 106, the nonvolatile memory control unit 108, the display control unit 110, the operation unit 113, and the image sensor 102 via the bus 114. The execution of the microcomputer realizes each process of the present embodiment by executing a program recorded in the ROM 109. The display unit 111 includes a liquid crystal monitor and the like, and is controlled by the display control unit 110 to display various image data and the like on the display unit 111. The operation unit 113 includes switches, buttons, and the like operated by the user, and is used for operations such as power ON / OFF and shutter ON / OFF.

画像処理部104は、各種画像処理部及びバッファメモリ等から構成されており、ベクトル検出回路を具備する。データ転送部105は、データ転送を行う複数のDMAC(Direct Memory Access Controller)で構成されている。   The image processing unit 104 includes various image processing units and a buffer memory, and includes a vector detection circuit. The data transfer unit 105 includes a plurality of direct memory access controllers (DMACs) that perform data transfer.

本発明に係る撮像装置に関わるCPU112は撮像素子部101を制御してA/D変換部103にアナログ信号を読み出す際の設定を読み出し順序設定としてROM109に記憶する。更にCPU112はROM109に記録されている読み出し順序設定を読み込み、設定に応じて画像処理部104の各主画像処理部を制御することができる。   The CPU 112 related to the image pickup apparatus according to the present invention controls the image pickup device unit 101 and stores a setting for reading an analog signal to the A / D conversion unit 103 in the ROM 109 as a read order setting. Further, the CPU 112 can read the reading order setting recorded in the ROM 109 and control each main image processing unit of the image processing unit 104 according to the setting.

図3は、本発明の実施形態に係る撮像装置が具備するベクトル検出回路が読み出すグリッド配置と特徴点、テンプレートマッチング領域の関係を示す図である。設定されたサイズの特徴点抽出グリッド0302(図3中の白色グリッド)と周辺グリッド0301(図3中の網点グリッド)が、水平、垂直方向に設定された個数分配置されており、特徴点0303が各特徴点抽出グリッド0302に一つ抽出される。周辺グリッド0301は、特徴点抽出グリッドの周囲に配置され、特徴点抽出は実施されないが、テンプレートマッチングで使用される領域である。抽出された特徴点0303を中心として、設定されたサイズの矩形状のサーチ領域0305及びテンプレート領域0304が設けられる。   FIG. 3 is a diagram showing the relationship between the grid layout read by the vector detection circuit included in the imaging apparatus according to the embodiment of the present invention, the feature points, and the template matching area. Feature point extraction grids 0302 (white grid in FIG. 3) and peripheral grids 0301 (halftone grids in FIG. 3) of the set size are arranged in the number set in the horizontal and vertical directions. 0303 is extracted in each feature point extraction grid 0302. A peripheral grid 0301 is arranged around the feature point extraction grid and is not subjected to feature point extraction, but is a region used for template matching. A rectangular search area 0305 and a template area 0304 having a set size are provided around the extracted feature point 0303.

図2は、本発明の実施形態に係る撮像装置が具備するベクトル検出回路のブロック図である。図4は、本発明の実施形態に係る撮像装置が具備するベクトル検出回路の処理フローを示す図である。   FIG. 2 is a block diagram of a vector detection circuit included in the imaging apparatus according to the embodiment of the present invention. FIG. 4 is a diagram illustrating a processing flow of the vector detection circuit included in the imaging apparatus according to the embodiment of the present invention.

以下、図4の処理フローをもとに、ベクトル検出回路の各ブロックの処理の概要を説明する。   Hereinafter, the outline of the processing of each block of the vector detection circuit will be described based on the processing flow of FIG.

・ステップS401の処理:
データ転送部105が具備するRDDMAC1(0221)は、バス115を介してDRAM107からベクトル検出対象となる現フレームの入力画像データ0241を読み出す。読み出すデータ量は、図3に示されるように設定された特徴点抽出グリッド0302及び周辺グリッド0301のサイズに従う。なお、入力画像データ0241は画像処理部104で、各種画像処理が実施されている。RDDMAC1(0221)によりグリッド単位で読み出された画像データ0241は、テンプレートマッチング用画像生成手段0201及び新規特徴点算出手段0202に出力される。また、RDDMAC1(0221)は、読み出したグリッドの左上座標位置を示すグリッド座標情報0252をRDDMAC2(0222)に出力する。
Step S401 processing:
RDDMAC 1 (0221) included in the data transfer unit 105 reads the input image data 0241 of the current frame as a vector detection target from the DRAM 107 via the bus 115. The amount of data to be read depends on the size of the feature point extraction grid 0302 and the peripheral grid 0301 set as shown in FIG. The input image data 0241 is subjected to various image processing by the image processing unit 104. The image data 0241 read in units of grids by the RDDMAC 1 (0221) is output to the template matching image generation unit 0201 and the new feature point calculation unit 0202. Further, RDDMAC1 (0221) outputs grid coordinate information 0252 indicating the upper left coordinate position of the read grid to RDDMAC2 (0222).

・ステップS402の処理:
テンプレートマッチング用画像生成手段0201は、ベクトル検出時のテンプレートマッチングに使用するテンプレートマッチング用画像を生成し、WRDMAC1(0231)に出力する。ベクトル検出画像生成手段0201は、バンドパスフィルタ回路であり、テンプレートマッチング処理に不要な画像信号の高周波成分と低周波成分をカットする。
Processing in step S402:
The template matching image generation unit 0201 generates a template matching image used for template matching at the time of vector detection, and outputs it to WRDMAC1 (0231). The vector detection image generation means 0201 is a bandpass filter circuit, and cuts the high frequency component and low frequency component of the image signal unnecessary for the template matching process.

・ステップS403の処理:
データ転送部105が具備するWRDMAC1(0231)は、バス115を介してDRAM107に対して入力されたテンプレートマッチング用画像データ1(0242)を書き出す処理を行う。また、DRAM107には前フレームで生成されたテンプレートマッチング用画像データ2(0243)が格納されている。
Processing in step S403:
The WRDMAC 1 (0231) included in the data transfer unit 105 performs processing for writing the template matching image data 1 (0242) input to the DRAM 107 via the bus 115. The DRAM 107 stores template matching image data 2 (0243) generated in the previous frame.

・ステップS404の処理:
前記ステップS402、ステップS403の処理と並列に、新規特徴点算出手段0302は、現フレームの新規特徴点を算出する。
Step S404:
In parallel with the processes in steps S402 and S403, the new feature point calculation unit 0302 calculates a new feature point of the current frame.

ここで、図5は、新規特徴点算出手段0302のブロック図である。特徴フィルタ部0501、特徴評価部0502、特徴点決定部0503からなる。特徴フィルタ部0501は、バンドパスフィルタ、水平微分フィルタ、垂直微分フィルタ、平滑化フィルタなど、複数のフィルタから構成される。本実施形態においては、バンドパスフィルタで、不要な画像信号の高周波成分と低周波成分をカットし、水平方向の微分フィルタ処理を施した信号と、垂直方向の微分フィルタ処理を施した信号、各々に対して、平滑化フィルタ処理が施したものを出力する。   Here, FIG. 5 is a block diagram of the new feature point calculation means 0302. A feature filter unit 0501, a feature evaluation unit 0502, and a feature point determination unit 0503 are included. The feature filter unit 0501 includes a plurality of filters such as a band pass filter, a horizontal differential filter, a vertical differential filter, and a smoothing filter. In the present embodiment, the band-pass filter cuts the high-frequency component and the low-frequency component of the unnecessary image signal, the signal subjected to the horizontal differential filter processing, and the signal subjected to the vertical differential filter processing, respectively In contrast, the result of smoothing filter processing is output.

特徴評価部0502は、特徴フィルタ部0501によりフィルタ処理されたグリッドに対し、画素ごとに2つのエッジの交点や曲率が極大である曲線状の点など画素の周辺の微分値が多方向に大きい点を特徴評価式により特徴値として算出する。   The feature evaluation unit 0502 has a large differential value around the pixel in many directions such as an intersection of two edges or a curved point having a maximum curvature for each pixel with respect to the grid filtered by the feature filter unit 0501. Is calculated as a feature value by a feature evaluation formula.

以下、本実施形態で使用するShi and Tomasiの手法で説明をする。水平微分フィルタと垂直微分フィルタを施した結果から、自己相関行列Hを作成する。自己相関行列Hの式を式1に示す。   Hereinafter, the Shi and Tomasi method used in the present embodiment will be described. An autocorrelation matrix H is created from the result of applying the horizontal differential filter and the vertical differential filter. Formula 1 of the autocorrelation matrix H is shown in Formula 1.

式1においてIxを水平微分フィルタを施した結果、Iyを垂直微分フィルタを施した結果を表しており、ガウシアンフィルタGを畳み込む。Shi and Tomasiの特徴評価式を式2に示す。   In Expression 1, the result of applying the horizontal differential filter to Ix and the result of applying the vertical differential filter to Iy represent the Gaussian filter G. Shi and Tomasi's characteristic evaluation formula is shown in Formula 2.

(式2)は、(式1)の自己相関行列Hの固有値λ1,λ2のうち小さい方の固有値を特徴値とすることを示す。   (Expression 2) indicates that the smaller eigenvalue of the eigenvalues λ1 and λ2 of the autocorrelation matrix H of (Expression 1) is used as the feature value.

特徴点決定部0503は、グリッド毎に、特徴評価部0502によって画素ごとに算出された特徴値の最も大きい値を持つ画素を特徴点と決定する。本実施形態においては、特徴点の座標は、グリッドの左上端を(0,0)とした相対座標(PX,PY)で表現するが、画像信号における絶対座標で表現してもよい。   The feature point determination unit 0503 determines, for each grid, a pixel having the largest feature value calculated for each pixel by the feature evaluation unit 0502 as a feature point. In the present embodiment, the coordinates of the feature points are expressed by relative coordinates (PX, PY) where the upper left corner of the grid is (0, 0), but may be expressed by absolute coordinates in the image signal.

なお、算出された新規特徴点は、新規特徴点算出手段0202が具備するメモリに格納される。メモリは、前フレームの特徴点と現フレームの特徴点を格納するための容量を有している。   Note that the calculated new feature point is stored in a memory included in the new feature point calculation unit 0202. The memory has a capacity for storing the feature points of the previous frame and the feature points of the current frame.

テンプレートマッチング処理手段0203にて、対応するグリッドのテンプレートマッチング処理が開始される際に、前フレームで算出された特徴点と現フレームで算出された特徴点が、特徴点座標情報0251として追跡先特徴点決定手段205に出力される。   When the template matching processing unit 0203 starts template matching processing for the corresponding grid, the feature points calculated in the previous frame and the feature points calculated in the current frame are tracked destination feature information 0251. It is output to the point determination means 205.

・ステップS405の処理:
RDDMAC2(0222)では、入力された追跡特徴点座標情報0257を基に、前フレームで算出された特徴点を中心とした矩形領域を、現フレームで生成されたテンプレートマッチング用画像データ1及び前フレームで生成されたテンプレートマッチング用画像データ2から読み出す。
Step S405 processing:
In RDDMAC2 (0222), based on the input tracking feature point coordinate information 0257, a rectangular area centered on the feature point calculated in the previous frame is converted into the template matching image data 1 generated in the current frame and the previous frame. Is read out from the template matching image data 2 generated in the above.

なお、テンプレートマッチング用画像データ1からサーチ領域0305を読み出し、前フレームで生成されたテンプレートマッチング用画像データ2から、テンプレート領域0304を読み出す。読み出した各画像データはサーチ領域画像データ0253、テンプレート領域画像データ0254として、テンプレートマッチング処理手段0203へ出力される。ただし、1番最初のテンプレートマッチング処理では、前フレームから特徴点座標を算出することができないため、全て現フレームで算出した特徴点座標を用いて処理を実施する。   Note that the search area 0305 is read from the template matching image data 1, and the template area 0304 is read from the template matching image data 2 generated in the previous frame. Each read image data is output as search area image data 0253 and template area image data 0254 to the template matching processing unit 0203. However, since the feature point coordinates cannot be calculated from the previous frame in the first template matching process, all the feature point coordinates calculated in the current frame are used.

・ステップS406の処理:
テンプレートマッチング処理手段0203では、入力されたサーチ領域画像データ0253、テンプレート領域画像データ0254、グリッド座標情報0252を用いて、相関値を算出し、その相関値よりベクトル値を算出する。算出されたベクトル値情報及び相関値情報0255を精度判定手段0204に出力する。
Step S406:
The template matching processing unit 0203 calculates a correlation value using the input search area image data 0253, template area image data 0254, and grid coordinate information 0252, and calculates a vector value from the correlation value. The calculated vector value information and correlation value information 0255 are output to the accuracy determining means 0204.

・ステップS407の処理:
精度判定手段204では、ステップS406において算出された相関値情報0255を用いて、相関値の最大値、最小値、平均値、極小値を求めて低コントラスト判定、画素値の最大値突出判定、繰り返しパターン判定を行う。
Step S407 processing:
In the accuracy determination unit 204, the correlation value information 0255 calculated in step S406 is used to obtain the maximum value, minimum value, average value, and minimum value of the correlation value, and low contrast determination, pixel value maximum value protrusion determination, and repetition. Perform pattern determination.

図6に画素値とそれぞれの判定の関係をグラフで示す。ただし本実施形態では相関値が小さいほど類似度が高いため同図の画素値の最大値は相関値では最小値、画素値の最小値は相関値では最大値、画素値の極大値は相関値では極小値を表す。   FIG. 6 is a graph showing the relationship between the pixel value and each determination. However, in this embodiment, the smaller the correlation value is, the higher the similarity is. Therefore, the maximum value of the pixel value in the figure is the minimum value in the correlation value, the minimum value of the pixel value is the maximum value in the correlation value, and the maximum value of the pixel value is the correlation value Represents the local minimum.

同図(a)は前記それぞれの判定が良好な結果となる。低コントラスト判定とは相関値算出領域内の相関値の最大値と最小値の差分があらかじめ設定されている閾値よりも小さい場合、相関値算出領域内は低コントラストであると判定される。   FIG. 6A shows a good result for each determination. In the low contrast determination, when the difference between the maximum value and the minimum value of the correlation values in the correlation value calculation area is smaller than a preset threshold value, the correlation value calculation area is determined to be low contrast.

同図(b)は低コントラスト判定で低コントラストの結果を示しており、(a)に比べて(b)では画素値の最大値と最小値の差は少ない。画素値の最大値突出判定とは、相関値算出領域内の相関値の最小値がどれだけ際立っているかを判定する。画素値の最大値と平均値の差分と、画素値の最大値と最小値の差分の除算が、あらかじめ設定されている閾値よりも小さい場合、相関値算出領域内は低ピークであると判定され、閾値よりも大きい場合、相関値算出領域内は高ピークであると判定される。   FIG. 5B shows the result of low contrast in the low contrast determination, and the difference between the maximum value and the minimum value of the pixel value is smaller in (b) than in (a). The maximum value protrusion determination of the pixel value determines how the minimum correlation value in the correlation value calculation region stands out. If the difference between the maximum and average pixel values and the difference between the maximum and minimum pixel values are smaller than a preset threshold value, the correlation value calculation area is determined to have a low peak. If the value is larger than the threshold value, it is determined that the correlation value calculation region has a high peak.

同図(c)は画素値の最大値突出判定で低ピークの結果を示しており、(a)に比べて(c)では画素値の最大値と平均値の差分と、画素値の最大値と最小値の差分の除算が小さい。繰り返しパターン判定とは、相関値算出領域内の画素値の最小値と極小値の差分があらかじめ設定されている閾値よりも小さい場合に繰り返しパターンであると判定される。同図(d)は繰り返しパターン判定で繰り返しパターンとなる結果を示しており、(a)に比べて(d)では画素値の最大値と極大値の差分が小さい。   FIG. 6C shows a result of a low peak in the maximum value protrusion determination of the pixel value. In FIG. 5C, the difference between the maximum value and the average value of the pixel value and the maximum value of the pixel value are compared in FIG. The difference between the minimum value and the minimum value is small. The repeated pattern determination is determined to be a repeated pattern when the difference between the minimum value and the minimum value of the pixel values in the correlation value calculation region is smaller than a preset threshold value. FIG. 4D shows the result of the repeated pattern determination, and the difference between the maximum pixel value and the maximum value is smaller in (d) than in (a).

・ステップS408の処理:
低コントラスト、低ピーク、繰り返しパターンの判定情報及びベクトル情報0256をSRAM(メモリ)0206に出力する。
Step S408 processing:
Low contrast, low peak, repetitive pattern determination information and vector information 0256 are output to SRAM (memory) 0206.

・ステップS409の処理:
追跡先特徴点決定手段205では、次フレームのテンプレートマッチング処理に用いるための追跡先特徴点を算出する。算出した追跡先特徴点は追跡先設定情報0257としてSRAM(メモリ)206と、RDDMAC2(0222)に出力される。
Processing in step S409:
The tracking destination feature point determination unit 205 calculates a tracking destination feature point to be used for template matching processing of the next frame. The calculated tracking destination feature points are output as tracking destination setting information 0257 to the SRAM (memory) 206 and RDDMAC 2 (0222).

以上が、本発明の実施形態におけるベクトル検出回路の処理フローである。   The above is the processing flow of the vector detection circuit in the embodiment of the present invention.

[第1の実施形態]
本発明の実施形態に係る撮像装置におけるテンプレートマッチング処理手段203の処理内容について図7から図11を参照して説明を行う。図7はテンプレートマッチング処理手段203のブロック図である。図8はテンプレートマッチング処理手段203の処理を示すフローチャートである。図9は領域区分手段801の処理について説明する図である。図10は第1のテンプレート領域削減手段804の処理について説明する図である。図11は第2のテンプレート領域削減手段805の処理について説明する図である。
[First Embodiment]
Processing contents of the template matching processing unit 203 in the imaging apparatus according to the embodiment of the present invention will be described with reference to FIGS. FIG. 7 is a block diagram of the template matching processing means 203. FIG. 8 is a flowchart showing the processing of the template matching processing means 203. FIG. 9 is a diagram for explaining the processing of the area sorting unit 801. FIG. 10 is a diagram for explaining the processing of the first template area reduction unit 804. FIG. 11 is a diagram for explaining the processing of the second template area reduction unit 805.

以下、図8のフローチャートをもとに、テンプレートマッチング処理手段203の概要を説明する。尚、本実施例では、CPU112はテンプレートマッチング処理手段203内の各処理ブロックに関して制御することができる。また、ベクトル情報保持部803はメモリ等で構成され、テンプレートマッチング処理実行部807により算出されたベクトル値情報及び相関値情報を、追跡先特徴点ごとに関連付け、予め4フレーム分保持している。CPU112は、ベクトル値保持部803に保持されている所望のベクトル値情報及び相関値情報を読み出すことができる。   The outline of the template matching processing means 203 will be described below with reference to the flowchart of FIG. In this embodiment, the CPU 112 can control each processing block in the template matching processing unit 203. Further, the vector information holding unit 803 includes a memory or the like, and associates the vector value information and the correlation value information calculated by the template matching process execution unit 807 for each tracking destination feature point, and holds for four frames in advance. The CPU 112 can read out desired vector value information and correlation value information held in the vector value holding unit 803.

□ステップS901の処理:
CPU112は現フレームのグリッド座標情報を領域区分手段801に入力し、該当するグリッドが属する指定領域を算出し、ステップS902に遷移する。
□ Step S901:
The CPU 112 inputs the grid coordinate information of the current frame to the area sorting unit 801, calculates the designated area to which the corresponding grid belongs, and proceeds to step S902.

ここで図9を用いて本発明の実施形態における指定領域の算出設定方法を具体的に説明する。図9(a)は、現フレームを水平5分割、垂直5分割の計25個のグリッドに区切った場合の画像読み出し順序を示す概念図である。図9(a)の場合、現フレームの画像読み出しは矢印のようにラスタスキャン方式で読み出される。図9(b)は、ラスタスキャン方式の場合、25個のグリッドに割り当てられる指定領域を示す概念図である。上端より垂直3グリッドは前半部として、第2の指定領域を割り当てる。下端より垂直2グリッドは後半部として、第1の指定領域を割り当てる。   Here, the method for calculating and setting the designated area in the embodiment of the present invention will be specifically described with reference to FIG. FIG. 9A is a conceptual diagram showing the image reading order when the current frame is divided into a total of 25 grids of 5 horizontal divisions and 5 vertical divisions. In the case of FIG. 9A, image reading of the current frame is performed by a raster scan method as indicated by an arrow. FIG. 9B is a conceptual diagram showing designated areas allocated to 25 grids in the case of the raster scan method. The second designated area is assigned as the first half of the three vertical grids from the upper end. The first designated area is assigned as the second half of the vertical 2 grid from the lower end.

尚、本実施例では、下端より垂直2グリッドは後半部として、第1の指定領域を割り当ているが特に限定せず、任意の領域に第1の指定領域、第2の指定領域を割り当てることができる。   In the present embodiment, the first designated area is assigned as the second half of the vertical two grids from the lower end, but there is no particular limitation, and the first designated area and the second designated area may be assigned to any area. it can.

□ステップS902の処理:
CPU112は、領域区分手段801により算出された指定領域が第一の指定領域か否かを判断する。第一の指定領域の場合、ステップS903に遷移し、第一の指定領域ではない場合、サーチ領域画像データを更新せず、テンプレートマッチング処理実行部807に出力してステップS911に遷移する。
□ Step S902 processing:
The CPU 112 determines whether or not the designated area calculated by the area sorting unit 801 is the first designated area. If it is the first designated area, the process proceeds to step S903. If it is not the first designated area, the search area image data is not updated and is output to the template matching process execution unit 807, and the process proceeds to step S911.

□ステップS903の処理:
CPU112は特徴点カウント手段802内に具備されているグリッド毎のカウンタ群から、現フレームのグリッド座標情報から該当するグリッドのカウンタを更新し、ステップS904に遷移する。
□ Step S903 processing:
The CPU 112 updates the counter of the corresponding grid from the grid coordinate information of the current frame from the counter group for each grid provided in the feature point counting means 802, and the process proceeds to step S904.

□ステップS904の処理:
CPU112は、ROM109内に設定されている閾値を読み出し、該当するグリッドのカウンタが閾値を超えるか否かを判断する。カウンタが閾値を超えない場合、CPU112は現状のサーチ領域画像データをテンプレートマッチング処理実行部807に出力し、ステップS911に遷移する。一方、カウンタが閾値を超える場合、ステップS905に遷移する。
□ Step S904 processing:
The CPU 112 reads the threshold value set in the ROM 109 and determines whether or not the counter of the corresponding grid exceeds the threshold value. If the counter does not exceed the threshold, the CPU 112 outputs the current search area image data to the template matching process execution unit 807, and the process proceeds to step S911. On the other hand, if the counter exceeds the threshold, the process proceeds to step S905.

尚、閾値は予めグリッド毎に設定されており、撮影条件などに応じてCPU112を介して適宜更新することができる。   Note that the threshold value is set in advance for each grid, and can be appropriately updated via the CPU 112 in accordance with shooting conditions and the like.

□ステップS905の処理:
CPU112は、グリッド内に存在する追跡先特徴点をベクトル値保持部803から読み出し、相関値の差分から、ベクトルの方向が水平、垂直に一定であるか否かを判断する。ベクトルの方向が一定であると判断した場合、ベクトルの方向を第一のテンプレート追跡範囲削減804に出力し、ステップS906に遷移する。一方、ベクトルの方向が一定ではないと判断した場合、ステップS907に遷移する。
□ Step S905 processing:
The CPU 112 reads the tracking destination feature points existing in the grid from the vector value holding unit 803, and determines whether the vector direction is constant horizontally and vertically from the difference between the correlation values. If it is determined that the vector direction is constant, the vector direction is output to the first template tracking range reduction 804, and the process proceeds to step S906. On the other hand, if it is determined that the vector direction is not constant, the process proceeds to step S907.

ここで図10を用いて本発明の実施形態におけるベクトルの方向が水平、垂直に一定であるか否かの判断方法を具体的に説明する。図10(a)は、ベクトル情報保持部803に保持されている4フレーム分の相関値を示す。ここで図10(a)において、x、yは相関値の水平、垂直座標を示している。また、dx、dyは各フレーム間の相関値の差分を示している。CPU112は(式3)を用いてベクトルの方向が一定であるか否かを判断する。   Here, a method for determining whether or not the direction of the vector in the embodiment of the present invention is constant horizontally and vertically will be described in detail with reference to FIG. FIG. 10A shows the correlation values for four frames held in the vector information holding unit 803. Here, in FIG. 10A, x and y indicate the horizontal and vertical coordinates of the correlation value. Further, dx and dy indicate differences in correlation values between the frames. The CPU 112 determines whether or not the vector direction is constant using (Equation 3).

dmin1 < dx < dmax1 (式3)
dmin1 < dy < dmax1
ここで式3において上限閾値dmin1、下限閾値dmax1を示し、CPU112は保持されている全てのフレーム間でdxまたはdyが(式3)の範囲内にある場合、ベクトルの方向が一定であると判断する。尚、閾値は予めグリッド毎に設定されており、撮影条件などに応じてCPU112を介して適宜更新することができる。
dmin1 <dx <dmax1 (Formula 3)
dmin1 <dy <dmax1
Here, the upper limit threshold value dmin1 and the lower limit threshold value dmax1 are shown in Expression 3, and the CPU 112 determines that the vector direction is constant when dx or dy is within the range of (Expression 3) between all the held frames. To do. Note that the threshold value is set in advance for each grid, and can be appropriately updated via the CPU 112 in accordance with shooting conditions and the like.

□ステップS906の処理:
第一のテンプレート追跡範囲削減804は、入力されたベクトルの方向を基に、テンプレート追跡範囲を削減し、ステップS907に遷移する。
□ Step S906 processing:
The first template tracking range reduction 804 reduces the template tracking range based on the input vector direction, and proceeds to step S907.

ここで図10(b)、(c)を用いて本発明の実施形態における第一のテンプレート追跡範囲削減804の処理を説明する。図10(b)は本実施例における第一のテンプレート追跡範囲削減804を実行前のテンプレート追跡範囲の概念図を示す。本実施例においてテンプレートマッチングで使用するテンプレート304は正方形であり、テンプレート追跡範囲305はテンプレート304に対して、水平方向に±mx、垂直方向に±my移動することでテンプレートを追跡する。図10(c)は、CPU112により水平方向に一定であると判断した場合の第一のテンプレート追跡範囲削減804実行後のテンプレート追跡範囲の概念図を示す。CPU112が水平方向に一定であると判断した場合、第一のテンプレート追跡範囲削減804は垂直方向の移動量を±myから±my/2に削減する。   Here, the processing of the first template tracking range reduction 804 in the embodiment of the present invention will be described with reference to FIGS. 10B and 10C. FIG. 10B shows a conceptual diagram of the template tracking range before executing the first template tracking range reduction 804 in this embodiment. The template 304 used for template matching in the present embodiment is a square, and the template tracking range 305 moves the template 304 by moving ± mx in the horizontal direction and ± my in the vertical direction. FIG. 10C shows a conceptual diagram of the template tracking range after the first template tracking range reduction 804 is executed when the CPU 112 determines that the horizontal direction is constant. When the CPU 112 determines that the horizontal direction is constant, the first template tracking range reduction 804 reduces the vertical movement amount from ± my to ± my / 2.

□ステップS907の処理:
CPU112は、グリッド内に存在する追跡先特徴点をベクトル値保持部803から読み出し、動きベクトル値情報の差分を算出し、速度が閾値未満であるか否かを判断する。速度が閾値未満であると判断した場合、ステップS908に遷移する。一方、速度が閾値以上であると判断した場合、ステップS909に遷移する。
□ Step S907 processing:
The CPU 112 reads the tracking destination feature points existing in the grid from the vector value holding unit 803, calculates the difference of the motion vector value information, and determines whether or not the speed is less than the threshold value. If it is determined that the speed is less than the threshold, the process proceeds to step S908. On the other hand, if it is determined that the speed is greater than or equal to the threshold, the process proceeds to step S909.

□ステップS908の処理:
第二のテンプレート追跡範囲削減805は、テンプレート追跡範囲を削減し、ステップS909に遷移する。
□ Step S908 processing:
The second template tracking range reduction 805 reduces the template tracking range, and the process proceeds to step S909.

□ステップS909の処理:
推定手段804は、更新されたテンプレート領域画像データサイズに応じて、相関値を算出する演算数から処理時間を推定する処理時間係数を算出し、ステップS910に遷移する。
□ Step S909 processing:
The estimation unit 804 calculates a processing time coefficient for estimating the processing time from the number of operations for calculating the correlation value according to the updated template region image data size, and the process proceeds to step S910.

□ステップS910の処理:
CPU112は、算出された処理時間係数を基に、追跡先特徴点を中心としたテンプレートマッチングの処理が所定の時間内に終了するか否かを判断する。所定の時間内に終了すると判断した場合、削減したテンプレート領域画像データをテンプレートマッチング処理実行部805に出力し、ステップS911に遷移する。一方、所定の時間内に終了しないと判断した場合、該当する追跡特徴点のテンプレートマッチング処理を終了する。
□ Step S910 processing:
Based on the calculated processing time coefficient, the CPU 112 determines whether or not the template matching process centered on the tracking destination feature point is completed within a predetermined time. If it is determined that the process is to be completed within a predetermined time, the reduced template area image data is output to the template matching process execution unit 805, and the process proceeds to step S911. On the other hand, if it is determined that the process does not end within a predetermined time, the template matching process for the corresponding tracking feature point is ended.

□ステップS911の処理:
テンプレートマッチング処理実行部805は、入力されたサーチ領域画像データ、テンプレート領域画像データを用いて、相関値を算出し、その相関値よりベクトル値を算出する。算出されたベクトル値情報及び相関値情報を精度判定手段0204に出力し、テンプレートマッチング処理を終了する。
□ Step S911 processing:
The template matching process execution unit 805 calculates a correlation value using the input search area image data and template area image data, and calculates a vector value from the correlation value. The calculated vector value information and correlation value information are output to the accuracy determining means 0204, and the template matching process is terminated.

ここで本実施例において、相関値の算出は差分絶対値和(Sum of Absolute Difference、以下SADと略す)を用いる。   In this embodiment, the correlation value is calculated using a sum of absolute difference (hereinafter abbreviated as SAD).

式4において、f(i,j)はテンプレート領域画像データ0254内の座標(i,j)における画素値を表しており、g(i,j)はサーチ領域画像データ0253において相関値算出の対象となる領域内の各画素値を表す。相関値算出対象領域は、テンプレート領域画像データ0254と同じ大きさである。そしてSADでは、両ブロック内の各画素値f(i,j)及びg(i,j)について差の絶対値を計算し、その総和を求めることで相関値S_SADを得ることが出来る。従って、相関値S_SADの値が小さいほど両ブロック間の輝度値の差分が小さい、つまりテンプレート領域画像データ0254と相関値算出領域内のテクスチャが類似していることを表している。   In Expression 4, f (i, j) represents a pixel value at the coordinates (i, j) in the template area image data 0254, and g (i, j) is an object of correlation value calculation in the search area image data 0253. Represents each pixel value in the region. The correlation value calculation target area is the same size as the template area image data 0254. In SAD, the absolute value of the difference is calculated for each pixel value f (i, j) and g (i, j) in both blocks, and the correlation value S_SAD can be obtained by obtaining the sum. Therefore, the smaller the correlation value S_SAD, the smaller the difference in luminance value between the two blocks, that is, the template area image data 0254 and the texture in the correlation value calculation area are similar.

本実施例では、第一のテンプレート追跡範囲削減804、第二のテンプレート追跡範囲削減805により、サーチ領域画像データ0253のサイズを削減することで、前述したSAD計算量を削減し、1フレームの期間内にテンプレートマッチング処理を完了することが出来る。   In the present embodiment, the size of the search area image data 0253 is reduced by the first template tracking range reduction 804 and the second template tracking range reduction 805, thereby reducing the SAD calculation amount described above and the period of one frame. Within the template matching process can be completed.

以上が、本発明の実施形態におけるテンプレートマッチングの処理フローである。本処理フレームは1フレーム分の処理を示しているが、毎フレームに対して同様の処理を施し、毎フレームでベクトル値を算出する。   The above is the processing flow of template matching in the embodiment of the present invention. Although this processing frame shows processing for one frame, the same processing is performed for each frame, and a vector value is calculated for each frame.

101 結像光学部
102 撮像素子
103 A/D変換部
112 CPU
101 Imaging Optical Unit 102 Image Sensor 103 A / D Converter 112 CPU

Claims (8)

画像を複数の領域に分割する領域分割手段、
各領域内で所定数の特徴点を抽出する特徴点抽出手段、
映像中の2枚のフレーム画像の一方を原画像、もう一方を参照画像とし、
特徴点を中心とする参照画像の矩形領域内と原画像の矩形領域内の画素値で
相関値演算処理を行い、動きベクトルを検出するベクトル検出手段、
ベクトル検出手段で取得した前フレームのベクトル値と
特徴点抽出手段で取得した前フレームの特徴点から
続くフレームの追跡対象となる追跡先特徴点を算出する追跡先特徴点算出手段、
前記追跡先特徴点算出手段により算出された特徴点を保持する特徴点保持手段を有し、
ベクトル検出手段は、保持されている特徴点に応じて、用いる特徴点の探索範囲を削減することを特徴とする撮像装置。
Area dividing means for dividing an image into a plurality of areas;
Feature point extraction means for extracting a predetermined number of feature points in each region;
One of the two frame images in the video is the original image, the other is the reference image,
A vector detection means for performing a correlation value calculation process on the pixel values in the rectangular area of the reference image centered on the feature point and in the rectangular area of the original image, and detecting a motion vector;
A tracking destination feature point calculating means for calculating a tracking destination feature point to be tracked of a subsequent frame from the vector value of the previous frame acquired by the vector detecting means and the feature point of the previous frame acquired by the feature point extracting means;
Comprising feature point holding means for holding the feature points calculated by the tracking destination feature point calculating means;
An image pickup apparatus characterized in that the vector detection means reduces a search range of feature points to be used in accordance with held feature points.
前記追跡先特徴点が、対応する前記取得したベクトル値と、他のベクトル値から少なくとも2つの領域区分のうちどの領域に属する特徴点であるか判別する領域区分手段を備え、
前記領域区分手段は、フレーム画像の順次入力される画素のうち、後半に相当する領域を第1の指定領域、フレーム画像の順次入力される画素のうち、前半に相当する領域を第2の指定領域とすることを特徴とする請求項1に記載の撮像装置。
A region segmentation means for determining which region of the at least two region segments the feature point belongs to, based on the acquired vector value and another vector value, the tracking destination feature point;
The region classifying means designates a region corresponding to the second half of the sequentially input pixels of the frame image as a first designated region, and a region corresponding to the first half of the pixels sequentially input of the frame image as a second designation. The imaging apparatus according to claim 1, wherein the imaging apparatus is a region.
前記ベクトル検出手段は、前記領域区分手段により第1の指定領域に属する特徴点と判別された場合、テンプレートマッチングに用いる特徴点の探索範囲を削減することを特徴とすることを特徴とする請求項2に記載の撮像装置。 The vector detection means reduces the search range of feature points used for template matching when the area classification means determines that the feature points belong to a first designated area. 2. The imaging device according to 2. 前記特徴点保持手段により保持された特徴点を比較することで、方向及び速度を算出する特徴点属性算出手段を有することを特徴とする請求項1乃至3のいずれか1項に記載の撮像装置。 The imaging apparatus according to claim 1, further comprising a feature point attribute calculating unit that calculates a direction and a speed by comparing the feature points held by the feature point holding unit. . 前記特徴点属性算出手段により算出された特徴点の方向が一定であるか否かを判断する方向判断手段を有することを特徴とする請求項4に記載の撮像装置。 The imaging apparatus according to claim 4, further comprising a direction determining unit that determines whether or not the direction of the feature point calculated by the feature point attribute calculating unit is constant. 前記方向手段により方向が水平方向に一定であると判断された場合、ベクトル検出時に垂直方向の探索範囲を制限することを特徴とする請求項4に記載の撮像装置。 The imaging apparatus according to claim 4, wherein when the direction is determined to be constant in the horizontal direction by the direction unit, the search range in the vertical direction is limited during vector detection. 前記方向手段により方向が垂直方向に一定であると判断された場合、ベクトル検出時に水平方向の探索範囲を制限することを特徴とする請求項4に記載の撮像装置。 The imaging apparatus according to claim 4, wherein when the direction is determined to be constant in the vertical direction by the direction unit, a search range in a horizontal direction is limited when detecting a vector. 速度の閾値を設定する閾値設定手段と、前記特徴点属性算出手段により算出された特徴点の速度が閾値以下であるか否かを判断する速度判断手段を有し、前記速度判断手段により速度が閾値以下であると判断された場合、ベクトル検出時に探索範囲を削除することを特徴とする請求項1乃至7のいずれか1項に記載の撮像装置。 A threshold setting means for setting a speed threshold; and a speed determining means for determining whether or not the speed of the feature point calculated by the feature point attribute calculating means is equal to or lower than the threshold. The speed is determined by the speed determining means. The imaging apparatus according to claim 1, wherein when it is determined that the threshold value is equal to or less than the threshold value, the search range is deleted when the vector is detected.
JP2018085951A 2018-04-27 2018-04-27 Imaging apparatus Pending JP2019192048A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018085951A JP2019192048A (en) 2018-04-27 2018-04-27 Imaging apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018085951A JP2019192048A (en) 2018-04-27 2018-04-27 Imaging apparatus

Publications (1)

Publication Number Publication Date
JP2019192048A true JP2019192048A (en) 2019-10-31

Family

ID=68390232

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018085951A Pending JP2019192048A (en) 2018-04-27 2018-04-27 Imaging apparatus

Country Status (1)

Country Link
JP (1) JP2019192048A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022091335A1 (en) * 2020-10-30 2022-05-05 日本電気株式会社 Object tracking device, object tracking method, and recording medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022091335A1 (en) * 2020-10-30 2022-05-05 日本電気株式会社 Object tracking device, object tracking method, and recording medium

Similar Documents

Publication Publication Date Title
JP7032871B2 (en) Image processing equipment and image processing methods, programs, storage media
JP2010117593A (en) Device for acquiring distance information, imaging apparatus, and program
JP2013206175A (en) Image determination device, image determination method and computer program for image determination
JP7117872B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM
JP7129201B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, AND PROGRAM
JP6395429B2 (en) Image processing apparatus, control method thereof, and storage medium
JP6576179B2 (en) Image processing apparatus, image processing method, and program
JP6579816B2 (en) Image processing apparatus, image processing method, and program
JP2019192048A (en) Imaging apparatus
JP2019020839A (en) Image processing apparatus, image processing method and program
JP7077115B2 (en) Image processing equipment, image processing methods, and programs
CN112150532A (en) Image processing method and device, electronic equipment and computer readable medium
JP2018072941A (en) Image processing device, image processing method, program, and storage medium
JP2019176261A (en) Image processor
JP6381212B2 (en) Imaging apparatus and control method thereof
JP7341712B2 (en) Image processing device, image processing method, imaging device, and program
JP7346021B2 (en) Image processing device, image processing method, imaging device, program and recording medium
JP5853369B2 (en) Image processing apparatus, image processing method, and program
JP2018072942A (en) Image processing apparatus, image processing method, program, and storage medium
JP2021107976A (en) Image processing device, image processing method, and program
JP2021108035A (en) Image processing device, image processing method, and program
JP6314281B1 (en) Image processing method and foreground region acquisition method
JP2017098900A (en) Image processing apparatus, image processing method, and program
JP2021044652A (en) Motion vector detection device and motion vector detection method
JP5869833B2 (en) Camera shake correction processing apparatus and camera shake correction processing method

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20191125