JP5365327B2 - Subject tracking device and camera - Google Patents

Subject tracking device and camera Download PDF

Info

Publication number
JP5365327B2
JP5365327B2 JP2009103924A JP2009103924A JP5365327B2 JP 5365327 B2 JP5365327 B2 JP 5365327B2 JP 2009103924 A JP2009103924 A JP 2009103924A JP 2009103924 A JP2009103924 A JP 2009103924A JP 5365327 B2 JP5365327 B2 JP 5365327B2
Authority
JP
Japan
Prior art keywords
value
similarity
image
template
similarity value
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.)
Active
Application number
JP2009103924A
Other languages
Japanese (ja)
Other versions
JP2010257041A (en
Inventor
悠一 伊藤
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.)
Nikon Corp
Original Assignee
Nikon 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 Nikon Corp filed Critical Nikon Corp
Priority to JP2009103924A priority Critical patent/JP5365327B2/en
Publication of JP2010257041A publication Critical patent/JP2010257041A/en
Application granted granted Critical
Publication of JP5365327B2 publication Critical patent/JP5365327B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Closed-Circuit Television Systems (AREA)
  • Studio Devices (AREA)

Description

本発明は、被写体追尾装置、およびカメラに関する。   The present invention relates to a subject tracking device and a camera.

次のような自動追尾装置が知られている。この自動追尾装置は、探索画像中の類似度マップの分散値を算出し、分散の度合いに基づいてテンプレートを更新するか否かを判定する(例えば、特許文献1)。   The following automatic tracking devices are known. This automatic tracking device calculates the variance value of the similarity map in the search image, and determines whether or not to update the template based on the degree of variance (for example, Patent Document 1).

特開平9−265538号公報JP-A-9-265538

しかしながら、従来の自動追尾装置によれば、分散値が所定値以上である場合にはテンプレートの更新は行なわれず、被写体が変化した場合に被写体の追尾を継続できなくなる可能性があった。   However, according to the conventional automatic tracking device, the template is not updated when the variance value is a predetermined value or more, and there is a possibility that tracking of the subject cannot be continued when the subject changes.

請求項1に記載の被写体追尾装置は、テンプレート画像と、入力画像内に設定した探索枠内のターゲット画像との類似度値を算出する類似度算出手段と、入力画像内の類似度値の分散値または標準偏差値を算出する算出手段と、入力画像内においてテンプレート画像とターゲット画像の類似度が所定の条件を満たす類似度値を特定類似度値として特定する特定手段と、特定類似度値をフレームごとに蓄積し、蓄積した特定類似度値に基づいて、テンプレート画像とターゲット画像の類似度が所定フレーム連続して低下していることを判断し、かつ類似度値の分散値または標準偏差値が所定の閾値以下である場合に、テンプレート画像の更新が必要であると判定する判定手段と、判定手段がテンプレート画像の更新が必要であると判定したときに、テンプレート画像の更新を行なう更新手段とを備えることを特徴とする。
請求項2に記載の被写体追尾装置は、テンプレート画像と、入力画像内に設定した探索枠内のターゲット画像との類似度値を算出する類似度算出手段と、入力画像内の類似度値の分散値または標準偏差値を算出する算出手段と、入力画像内においてテンプレート画像とターゲット画像の類似度が所定の条件を満たす類似度値を特定類似度値として特定する特定手段と、特定類似度値をフレームごとに蓄積し、蓄積した特定類似度値に基づいて、現フレームの類似度が過去の複数フレームの類似度の平均値に対して一定の割合以上で低下していることを判断し、かつ類似度値の分散値または標準偏差値が所定の閾値以下である場合に、テンプレート画像の更新が必要であると判定する判定手段と、判定手段がテンプレート画像の更新が必要であると判定したときに、テンプレート画像の更新を行なう更新手段とを備えることを特徴とする。
本発明によるカメラは、被写体像を撮像して画像を取得する撮像手段と、上記いずれかの被写体追尾装置とを備えることを特徴とする。
The subject tracking device according to claim 1, a similarity calculation unit that calculates a similarity value between a template image and a target image within a search frame set in the input image, and a variance of similarity values in the input image A calculation means for calculating a value or a standard deviation value, a specification means for specifying a similarity value satisfying a predetermined condition for the similarity between the template image and the target image in the input image, and a specific similarity value Accumulated for each frame, based on the accumulated specific similarity value, it is judged that the similarity between the template image and the target image has decreased continuously for a predetermined frame, and the variance value or standard deviation value of the similarity value If There is less than a predetermined threshold value, a determination unit that it is necessary to update the template image, when the determination means determines that it is necessary to update the template image Characterized by comprising a updating means for updating the template images.
The subject tracking device according to claim 2, a similarity calculation unit that calculates a similarity value between a template image and a target image in a search frame set in the input image, and a variance of the similarity value in the input image A calculation means for calculating a value or a standard deviation value, a specification means for specifying a similarity value satisfying a predetermined condition for the similarity between the template image and the target image in the input image, and a specific similarity value It is accumulated for each frame, and based on the accumulated specific similarity value, it is determined that the similarity of the current frame is decreased at a certain rate or more with respect to the average value of the similarity of a plurality of past frames, and A determination unit that determines that the template image needs to be updated when the variance value or the standard deviation value of the similarity value is equal to or less than a predetermined threshold, and the determination unit needs to update the template image When it is determined that, characterized in that it comprises an update means for updating the template images.
A camera according to the present invention includes an imaging unit that captures an image of a subject and obtains the image, and any one of the subject tracking devices described above.

本発明によれば、被写体が変化した場合でも被写体追尾を継続することができる。   According to the present invention, subject tracking can be continued even when the subject changes.

カメラ100の一実施の形態の構成を示すブロック図である。1 is a block diagram illustrating a configuration of an embodiment of a camera 100. FIG. テンプレート画像の更新処理の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of the update process of a template image. 類似度マップにおける類似度値の分散値と最小類似度値の上昇度との関係を示す図である。It is a figure which shows the relationship between the variance value of a similarity value in a similarity map, and the raise degree of a minimum similarity value.

図1は、本実施の形態におけるカメラの一実施の形態の構成を示すブロック図である。カメラ100は、操作部材101と、レンズ102と、撮像素子103と、制御装置104と、メモリカードスロット105と、モニタ106とを備えている。操作部材101は、使用者によって操作される種々の入力部材、例えば電源ボタン、レリーズボタン、ズームボタン、十字キー、決定ボタン、再生ボタン、削除ボタンなどを含んでいる。   FIG. 1 is a block diagram illustrating a configuration of an embodiment of a camera according to the present embodiment. The camera 100 includes an operation member 101, a lens 102, an image sensor 103, a control device 104, a memory card slot 105, and a monitor 106. The operation member 101 includes various input members operated by the user, such as a power button, a release button, a zoom button, a cross key, an enter button, a play button, and a delete button.

レンズ102は、複数の光学レンズから構成されるが、図1では代表して1枚のレンズで表している。撮像素子103は、例えばCCDやCMOSなどのイメージセンサーであり、レンズ102により結像した被写体像を撮像する。そして、撮像によって得られた画像信号を制御装置104へ出力する。   The lens 102 is composed of a plurality of optical lenses, but is representatively represented by one lens in FIG. The image sensor 103 is an image sensor such as a CCD or a CMOS, for example, and captures a subject image formed by the lens 102. Then, an image signal obtained by imaging is output to the control device 104.

制御装置104は、撮像素子103から入力された画像信号に基づいて所定の画像形式、例えばJPEG形式の画像データ(以下、「本画像データ」と呼ぶ)を生成する。また、制御装置104は、生成した画像データに基づいて、表示用画像データ、例えばサムネイル画像データを生成する。制御装置104は、生成した本画像データとサムネイル画像データとを含み、さらにヘッダ情報を付加した画像ファイルを生成してメモリカードスロット105へ出力する。   The control device 104 generates image data in a predetermined image format, for example, JPEG format (hereinafter referred to as “main image data”) based on the image signal input from the image sensor 103. Further, the control device 104 generates display image data, for example, thumbnail image data, based on the generated image data. The control device 104 generates an image file that includes the generated main image data and thumbnail image data, and further includes header information, and outputs the image file to the memory card slot 105.

メモリカードスロット105は、記憶媒体としてのメモリカードを挿入するためのスロットであり、制御装置104から出力された画像ファイルをメモリカードに書き込んで記録する。また、メモリカードスロット105は、制御装置104からの指示に基づいて、メモリカード内に記憶されている画像ファイルを読み込む。   The memory card slot 105 is a slot for inserting a memory card as a storage medium, and the image file output from the control device 104 is written and recorded on the memory card. The memory card slot 105 reads an image file stored in the memory card based on an instruction from the control device 104.

モニタ106は、カメラ100の背面に搭載された液晶モニタ(背面モニタ)であり、当該モニタ106には、メモリカードに記憶されている画像やカメラ100を設定するための設定メニューなどが表示される。また、制御装置104は、使用者によってカメラ100のモードが撮影モードに設定されると、撮像素子103から時系列で取得した画像の表示用画像データをモニタ106に出力する。これによってモニタ106にはスルー画が表示される。   The monitor 106 is a liquid crystal monitor (rear monitor) mounted on the back surface of the camera 100, and the monitor 106 displays an image stored in a memory card, a setting menu for setting the camera 100, and the like. . Further, when the user sets the mode of the camera 100 to the shooting mode, the control device 104 outputs image data for display of images acquired from the image sensor 103 in time series to the monitor 106. As a result, a through image is displayed on the monitor 106.

制御装置104は、CPU、メモリ、およびその他の周辺回路により構成され、カメラ100を制御する。なお、制御装置104を構成するメモリには、SDRAMやフラッシュメモリが含まれる。SDRAMは、揮発性のメモリであって、CPUがプログラム実行時にプログラムを展開するためのワークメモリとして使用されたり、データを一時的に記録するためのバッファメモリとして使用される。また、フラッシュメモリは、不揮発性のメモリであって、制御装置104が実行するプログラムのデータや、プログラム実行時に読み込まれる種々のパラメータなどが記録されている。   The control device 104 includes a CPU, a memory, and other peripheral circuits, and controls the camera 100. Note that the memory constituting the control device 104 includes SDRAM and flash memory. The SDRAM is a volatile memory, and is used as a work memory for the CPU to develop a program when the program is executed or as a buffer memory for temporarily recording data. The flash memory is a non-volatile memory in which data of a program executed by the control device 104, various parameters read during program execution, and the like are recorded.

本実施の形態では、制御装置104は、撮像素子103から入力されるスルー画の各フレームに対して、あらかじめ用意したテンプレート画像を用いたテンプレートマッチング処理を行うことによって、フレーム内からテンプレート画像と類似する画像領域を特定する。そして、制御装置104は、特定した領域をフレーム間で追跡することによって、被写体追跡処理を行う。   In the present embodiment, the control device 104 performs a template matching process using a template image prepared in advance for each frame of a through image input from the image sensor 103, thereby resembling a template image from within the frame. The image area to be specified is specified. Then, the control device 104 performs subject tracking processing by tracking the specified region between frames.

具体的には、制御装置104は、あらかじめ用意されたテンプレート画像と、撮像素子103から時系列で入力される各フレームとのマッチング演算を行う。例えば、制御装置104は、撮像素子103からのスルー画の入力が開始されると、各フレーム(コマ)を対象として、フレーム内の所定の位置にテンプレート画像と同じ大きさの探索枠を設定し、設定した探索枠内のターゲット画像Bをテンプレートマッチングの対象とする。   Specifically, the control device 104 performs a matching operation between a template image prepared in advance and each frame input from the image sensor 103 in time series. For example, when input of a through image from the image sensor 103 is started, the control device 104 sets a search frame having the same size as the template image at a predetermined position in the frame for each frame (frame). The target image B within the set search frame is set as a template matching target.

すなわち、制御装置104は、探索枠をフレーム内で移動させながら、各探索枠位置におけるターゲット画像とテンプレート画像との類似度を算出する。そして、制御装置104は、フレーム内におけるテンプレート画像とターゲット画像との類似度が最も高い位置を被写体位置として特定する。   That is, the control device 104 calculates the similarity between the target image and the template image at each search frame position while moving the search frame within the frame. Then, the control device 104 specifies the position where the similarity between the template image and the target image in the frame is the highest as the subject position.

制御装置104は、撮像素子103から時系列で入力される各フレーム内における被写体位置を特定して、該被写体位置をフレーム間で追跡することにより、スルー画を対象とした被写体追尾を行う。   The control device 104 performs subject tracking for a through image by specifying a subject position in each frame input in time series from the image sensor 103 and tracking the subject position between frames.

なお、テンプレート画像とターゲット画像との類似度の算出方法は公知であるため詳細な説明は省略するが、一般的には、SAD(Sum of Absolute Difference)やSSD(Sum of Squared Difference)等の類似度算出方法が用いられる。   A method for calculating the degree of similarity between the template image and the target image is well known and will not be described in detail. However, in general, similarities such as SAD (Sum of Absolute Difference) or SSD (Sum of Squared Difference) are used. A degree calculation method is used.

例えば、類似度算出方法としてSAD(残差逐次検定法)を用いた場合には、制御装置104は、次式(1)に示す残差和により類似度値rを算出し、算出した類似度値rに基づいてテンプレートマッチングを行う。この次式(1)により算出される類似度値rは、その値が小さいほどテンプレート画像Aとターゲット画像Bとの類似度が高いことを示し、その値が大きいほどテンプレート画像Aとターゲット画像Bとの類似度が低いことを示す。

Figure 0005365327
For example, when SAD (residual sequential test) is used as the similarity calculation method, the control device 104 calculates the similarity value r by the residual sum shown in the following equation (1), and calculates the similarity Template matching is performed based on the value r. The similarity value r calculated by the following equation (1) indicates that the smaller the value is, the higher the similarity between the template image A and the target image B is, and the larger the value is, the higher the template image A and the target image B are. It shows that the degree of similarity is low.
Figure 0005365327

なお、式(1)において、Aはテンプレート画像を表し、Bはターゲット画像を表す。また、mはテンプレート画像A内における横方向の画素位置を表し、nはテンプレート画像A内における縦方向の画素位置を表す。例えば、テンプレート画像Aにおける左上端の画素はA11と表され、ターゲット画像Bにおける左上端の画素はB11と表される。 In Expression (1), A represents a template image, and B represents a target image. M represents the pixel position in the horizontal direction in the template image A, and n represents the pixel position in the vertical direction in the template image A. For example, the pixel of the upper left corner in the template image A is expressed as A 11, the pixel of the upper left corner of the target image B is expressed as B 11.

このように、テンプレート画像とターゲット画像との類似度を算出して被写体追尾を行う場合には、追尾対象の被写体の形状は時々刻々と変化するため、あらかじめ用意された初期テンプレート画像をそのまま用いて類似度値を算出していくと、徐々に類似度が低下して最終的に被写体追尾を継続できなくなる可能性がある。よって、本実施の形態では、このような問題点を解消するために、制御装置104は、テンプレート画像とターゲット画像との類似度値の変化を時系列で観察し、その変化に基づいてテンプレート画像の更新タイミングを判定する。そして、制御装置104は、テンプレート画像の更新タイミングで、現フレーム内で被写体位置として特定されたターゲット画像を取り込んで、これを新たなテンプレート画像とすることによりテンプレート画像の更新を行なう。   As described above, when subject tracking is performed by calculating the similarity between the template image and the target image, the shape of the subject to be tracked changes from moment to moment, so the initial template image prepared in advance is used as it is. As the similarity value is calculated, there is a possibility that the similarity gradually decreases and eventually the subject tracking cannot be continued. Therefore, in the present embodiment, in order to solve such a problem, the control device 104 observes a change in the similarity value between the template image and the target image in time series, and based on the change, the template image. The update timing is determined. Then, the control device 104 updates the template image by taking in the target image specified as the subject position in the current frame at the update timing of the template image and using it as a new template image.

図2は、本実施の形態におけるテンプレート画像の更新処理の流れを示すフローチャートである。図2に示す処理は、撮像素子103からスルー画の入力が開始されると起動するプログラムとして、制御装置104によって実行される。   FIG. 2 is a flowchart showing a flow of template image update processing in the present embodiment. The processing illustrated in FIG. 2 is executed by the control device 104 as a program that is activated when input of a through image from the image sensor 103 is started.

ステップS1において、制御装置104は、画像情報、すなわちスルー画の1フレームを読み込んでステップS2へ進む。ステップS2では、制御装置104は、上述したように、フレーム内で探索枠を移動させながら、各探索枠位置におけるターゲット画像とテンプレート画像との類似度を算出する。そして、制御装置104は、各探索位置における類似度値を2次元化して表した類似度マップを生成する。その後、ステップS3へ進む。   In step S1, the control device 104 reads image information, that is, one frame of the through image, and proceeds to step S2. In step S2, as described above, the control device 104 calculates the similarity between the target image and the template image at each search frame position while moving the search frame within the frame. Then, the control device 104 generates a similarity map in which the similarity value at each search position is two-dimensionally expressed. Then, it progresses to step S3.

ステップS3では、制御装置104は、ステップS3で生成した類似度マップ内から最小類似度値を検出する。ここで検出された最小類似度値が算出された探索位置が、テンプレート画像とターゲット画像との類似度が最も高い探索位置、すなわち被写体位置である。制御装置104は、ここで検出した最小類似度値をSDRAMに記録する。これによって、フレームごとに検出された最小類似度値を蓄積することができる。   In step S3, the control device 104 detects the minimum similarity value from the similarity map generated in step S3. The search position where the minimum similarity value detected here is calculated is the search position with the highest similarity between the template image and the target image, that is, the subject position. The control device 104 records the minimum similarity value detected here in the SDRAM. As a result, the minimum similarity value detected for each frame can be accumulated.

また、制御装置104は、ステップS3において、類似度マップにおける類似度値の分散値(以下、「類似度マップの分散値」と呼ぶ)を次式(2)により算出する。なお、次式(2)において、xは、類似度マップ内における各探索位置の類似度値を表し、xaveは、類似度マップ全体における類似度値の平均値を示す。

Figure 0005365327
In step S <b> 3, the control device 104 calculates a variance value of similarity values in the similarity map (hereinafter, referred to as “similarity map variance value”) by the following equation (2). In the following equation (2), x i represents the similarity value of each search position in the similarity map, and x ave represents the average value of the similarity values in the entire similarity map.
Figure 0005365327

その後、ステップS4へ進み、制御装置104は、SDRAMに蓄積されている最小類似度値を読み出して、現フレームにおける最小類似度値の過去フレームに対する上昇度(以下、「最小類似度値の上昇度」と呼ぶ)を算出する。例えば、本実施の形態では、制御装置104は、次式(3)により、過去n−1フレーム分の最小類似度値の平均値に対する現フレーム(n番目のフレーム)の最小類似度値の上昇率Rを算出し、これを最小類似度値の上昇度とする。なお、次式(3)において、iは過去フレームのそれぞれを識別するフレーム番号であり、1≦i≦n−1の範囲をとる。また、Pは、iフレーム目の最小類似度値であり、Pは、現フレーム(nフレーム目)の最小類似度値を表す。

Figure 0005365327
Thereafter, the process proceeds to step S4, where the control device 104 reads out the minimum similarity value stored in the SDRAM, and increases the minimum similarity value in the current frame with respect to the past frame (hereinafter referred to as “increase degree of minimum similarity value”). "). For example, in the present embodiment, the control device 104 increases the minimum similarity value of the current frame (nth frame) with respect to the average value of the minimum similarity values for the past n−1 frames by the following equation (3). The rate R n is calculated, and this is set as the increase degree of the minimum similarity value. In the following formula (3), i is a frame number for identifying each of the past frames, and takes a range of 1 ≦ i ≦ n−1. P i is the minimum similarity value of the i-th frame, and P n represents the minimum similarity value of the current frame (n-th frame).
Figure 0005365327

また、ステップS4では、制御装置104は、最小類似度値の上昇が連続して何フレーム続いているかを示す連続上昇フレーム数Nを算出する。具体的には、制御装置104は、前フレームで算出された最小類似度値と現フレームで算出された最小類似度値とを比較し、前フレームの最小類似度値よりも現フレームの最小類似度値の方が大きければ、連続上昇フレーム数Nに1を加算する。一方、前フレームの最小類似度値の方が現フレームの最小類似度値よりも大きければ、連続上昇フレーム数Nを0にリセットする。これによって、連続上昇フレーム数Nを算出することができる。 Further, in step S4, the control device 104 calculates the continuously increasing frame number N n indicating how many frames the increase in the minimum similarity value continues continuously. Specifically, the control device 104 compares the minimum similarity value calculated in the previous frame with the minimum similarity value calculated in the current frame, and the minimum similarity of the current frame is more than the minimum similarity value of the previous frame. If the degree value is larger, 1 is added to the continuously rising frame number N n . On the other hand, if the minimum similarity value of the previous frame is larger than the minimum similarity value of the current frame, the number of consecutively rising frames N n is reset to zero. As a result, the continuously rising frame number N n can be calculated.

その後、ステップS5へ進み、制御装置104は、ステップS4で算出した最小類似度値の上昇度が所定の閾値以上、例えば1.5以上であり、かつステップS4で算出した連続上昇フレーム数が所定数、例えば3以上であるか否かを判断する。ステップS5で否定判断した場合には、後述するステップS8へ進み、ステップS5で肯定判断した場合には、ステップS6へ進む。ステップS6では、制御装置104は、ステップS3で算出した類似度マップの分散値が所定の閾値以下、例えば過去フレームにおける類似度マップの分散値の平均値以下であるか否かを判断する。ステップS6で否定判断した場合には、後述するステップS8へ進み、ステップS6で肯定判断した場合には、ステップS7へ進む。   Thereafter, the process proceeds to step S5, and the control device 104 determines that the increase degree of the minimum similarity value calculated in step S4 is not less than a predetermined threshold, for example, not less than 1.5, and the number of continuously rising frames calculated in step S4 is predetermined. It is determined whether the number is 3 or more, for example. If a negative determination is made in step S5, the process proceeds to step S8 to be described later. If an affirmative determination is made in step S5, the process proceeds to step S6. In step S6, the control device 104 determines whether or not the variance value of the similarity map calculated in step S3 is equal to or less than a predetermined threshold, for example, equal to or less than the average value of the variance values of the similarity map in the past frame. If a negative determination is made in step S6, the process proceeds to step S8 described later. If an affirmative determination is made in step S6, the process proceeds to step S7.

ステップS7では、制御装置104は、上述したように、現フレーム内で被写体位置として特定されたターゲット画像を新たなテンプレート画像としてテンプレート画像の更新を行なう。すなわち、本実施の形態では、制御装置104は、最小類似度値の上昇度が閾値以上であり(現フレームの類似度が過去のフレームの類似度値に対して一定の割合以上で低下しており)、連続上昇フレーム数が所定数以上であり(類似度が所定フレーム連続して低下しており)、かつ類似度マップの分散値が閾値以下である(類似度マップの類似度値のばらつきが所定以下である)タイミングをテンプレート画像の更新タイミングと判定して、テンプレート画像の更新を行なう。以下、当該タイミングをテンプレート画像の更新タイミングと判定する理由について説明する。   In step S7, as described above, the control device 104 updates the template image using the target image specified as the subject position in the current frame as a new template image. In other words, in the present embodiment, the control device 104 determines that the increase degree of the minimum similarity value is equal to or greater than the threshold value (the similarity degree of the current frame decreases at a certain rate or more with respect to the similarity value of the past frame). The number of consecutively rising frames is equal to or greater than a predetermined number (similarity decreases continuously for a predetermined frame), and the variance value of the similarity map is equal to or less than a threshold value (variation in similarity value of the similarity map) Is determined to be the update timing of the template image, and the template image is updated. Hereinafter, the reason for determining the timing as the update timing of the template image will be described.

まず、類似度マップの分散値と最小類似度値の上昇度との関係について、図3を用いて説明する。図3は、テンプレート画像を更新せずにテンプレートマッチングを行なった場合の最小類似度値の時系列変化3aと類似度マップの分散値の時系列変化3bとを示している。まず、最小類似度値の時系列変化3aに着目すると、テンプレート画像の更新を行なわないでテンプレートマッチングを継続した場合には、被写体の変化に伴ってテンプレート画像とターゲット画像との最小類似度値は上昇していく、すなわち、類似度は徐々に低下していくことがわかる。例えば、図3においては、テンプレートマッチングの開始から時点Aに向けて徐々に最小類似度値が上昇している。   First, the relationship between the variance value of the similarity map and the increase degree of the minimum similarity value will be described with reference to FIG. FIG. 3 shows the time series change 3a of the minimum similarity value and the time series change 3b of the variance value of the similarity map when template matching is performed without updating the template image. First, paying attention to the time series change 3a of the minimum similarity value, when template matching is continued without updating the template image, the minimum similarity value between the template image and the target image is changed as the subject changes. It can be seen that it increases, that is, the similarity gradually decreases. For example, in FIG. 3, the minimum similarity value gradually increases from the start of template matching toward time point A.

そして、その後もテンプレートマッチングを継続した場合には、最小類似度値がさらに上昇し、ある時点でテンプレート画像とターゲット画像との相関がとれなくなった結果、他の擬似被写体位置でテンプレート画像とターゲット画像の類似度が最小となって、誤マッチングが発生する。例えば、図3においては、時点Bにおいて、本来の被写体位置とは異なる擬似被写体位置で最小類似度値が算出された結果、上昇を続けていた最小類似度値が再び小さくなっている。   If the template matching is continued thereafter, the minimum similarity value further increases, and as a result of the correlation between the template image and the target image being lost at a certain point in time, the template image and the target image at other pseudo subject positions The similarity is minimized, and erroneous matching occurs. For example, in FIG. 3, as a result of calculating the minimum similarity value at the pseudo subject position different from the original subject position at the time point B, the minimum similarity value that has continued to rise is reduced again.

次に、類似度マップの分散値の時系列変化3bに着目すると、時点Aから時点Bにかけて、類似度値の分散値が増加している。これは、類似度マップの類似度値のばらつきが大きくなっていることを示しており、現在のテンプレート画像を用いて検出されている被写体の信頼性が徐々に低下していることを示している。   Next, paying attention to the time series change 3b of the variance value of the similarity map, the variance value of the similarity value increases from time A to time B. This indicates that the variation in the similarity value of the similarity map is large, and that the reliability of the subject detected using the current template image is gradually decreasing. .

以上より、少なくとも誤マッチングが発生する時点Bより前の時点、すなわち、現在のテンプレート画像を用いて検出されている被写体の信頼性がある程度保たれている時点でテンプレート画像の更新をする必要があることがわかる。ここで、テンプレート画像の更新タイミングを時点Aより前のタイミングとして、頻繁にテンプレート画像を更新すれば、誤マッチングの発生までに余裕をもってテンプレート更新を行なうことができるが、この場合には、頻繁にテンプレート画像の更新が行なわれることになり、処理速度が低下することになる。   As described above, it is necessary to update the template image at least at a time point before time point B at which erroneous matching occurs, that is, at a time point when the reliability of the subject detected using the current template image is maintained to some extent. I understand that. Here, if the template image is updated frequently with the update timing of the template image as the timing before the time point A, the template can be updated with a margin until the occurrence of erroneous matching. In this case, however, the template image is frequently updated. The template image is updated, and the processing speed is reduced.

よって、本実施の形態では、誤マッチングを防止するとともに、処理速度の低下をできるだけ抑えることを目的として、時点Aから時点Bの間をテンプレート画像の更新タイミングとするために、図2のステップS5およびステップS6における条件で更新タイミングを判定することとした。   Therefore, in the present embodiment, in order to prevent erroneous matching and suppress the decrease in processing speed as much as possible, in order to set the time between time A and time B as the template image update timing, step S5 in FIG. The update timing is determined based on the conditions in step S6.

具体的には、ステップS5において、最小類似度値が一定以上の上昇度で連続して上昇している場合にテンプレート画像の更新を行うように判定条件を設定して、テンプレート画像の更新タイミングが時点A以降になるようにしている。また、ステップS6において、現在のテンプレート画像を用いて検出されている被写体の信頼性がある程度保たれている間にテンプレート画像の更新を行うように判定条件を設定して、テンプレート画像の更新タイミングを時点Bより前になるようにしている。   Specifically, in step S5, a determination condition is set so that the template image is updated when the minimum similarity value continuously increases at a certain degree of increase, and the template image update timing is set. After time A. In step S6, determination conditions are set so that the template image is updated while the reliability of the subject detected using the current template image is maintained to some extent, and the update timing of the template image is set. It is set to be before time B.

なお、本実施の形態では、ステップS5の条件を満たす場合であっても、ステップS6の条件を満たさない場合にはテンプレート画像を更新しないようにしている。これは、類似度マップの分散値が大きい場合には、現在のテンプレート画像を用いて検出されている被写体の信頼性が低くなっているため、このときのターゲット画像をテンプレート画像として更新した場合には、当初とは異なる被写体を追尾対象としてしまう可能性があるためである。   In the present embodiment, even if the condition of step S5 is satisfied, the template image is not updated if the condition of step S6 is not satisfied. This is because when the variance value of the similarity map is large, the reliability of the subject detected using the current template image is low, and therefore the target image at this time is updated as the template image. This is because there is a possibility that a subject different from the original may be a tracking target.

ステップS7でテンプレート画像を更新した後は、ステップS8へ進み、制御装置104は、スルー画の全フレームに対して処理が終了したか、すなわち撮像素子103からのスルー画の入力が終了したか否かを判断する。ステップS8で否定判断した場合には、ステップS1へ戻って、次に入力されるフレームを対象として、上記処理を繰り返す。これに対して、ステップS8で肯定判断した場合には、処理を終了する。   After updating the template image in step S7, the process proceeds to step S8, and the control device 104 determines whether the processing for all the frames of the through image has been completed, that is, whether the input of the through image from the image sensor 103 has been completed. Determine whether. If a negative determination is made in step S8, the process returns to step S1, and the above processing is repeated for the next input frame. On the other hand, when an affirmative determination is made in step S8, the process ends.

以上説明した本実施の形態によれば、以下のような作用効果を得ることができる。
(1)制御装置104は、テンプレート画像とターゲット画像との類似度値を算出し、算出結果に基づいて類似度マップを生成する。また、制御装置104は、最小類似度値の検出、類似度値の分散値の算出、最小類似度の上昇度の算出、および連続上昇フレーム数の算出を行う。そして、制御装置104は、類似度値の分散値、最小類似度の上昇度、連続上昇フレーム数、および類似度値の分散値に基づいて、テンプレート画像の更新が必要であるか否かを判断し、更新が必要であると判断した場合に、現フレームで最小類似度が算出されたターゲット画像を用いてテンプレート画像を更新するようにした。これによって、最適なテンプレート画像の更新タイミングを判定して、被写体が変化した場合でも被写体追尾を継続することができる。
According to the present embodiment described above, the following operational effects can be obtained.
(1) The control device 104 calculates a similarity value between the template image and the target image, and generates a similarity map based on the calculation result. In addition, the control device 104 detects the minimum similarity value, calculates the variance value of the similarity value, calculates the increase degree of the minimum similarity degree, and calculates the number of continuously rising frames. Then, the control device 104 determines whether or not the template image needs to be updated based on the variance value of the similarity value, the increase rate of the minimum similarity, the number of continuously rising frames, and the variance value of the similarity value. When it is determined that the update is necessary, the template image is updated using the target image for which the minimum similarity is calculated in the current frame. Accordingly, it is possible to determine the optimal update timing of the template image, and to continue subject tracking even when the subject changes.

(2)制御装置104は、最小類似度値の上昇度が所定の閾値以上であり、かつ連続上昇フレーム数が所定数以上であって、さらに類似度マップの分散値が所定の閾値以下である場合に、テンプレート画像の更新が必要であると判断するようにした。これによって、誤マッチングを防止するとともに、処理速度の低下をできるだけ抑えるように、テンプレート画像の更新を行なうことができる。 (2) In the control device 104, the degree of increase in the minimum similarity value is equal to or greater than a predetermined threshold, the number of continuously rising frames is equal to or greater than a predetermined number, and the variance value of the similarity map is equal to or smaller than the predetermined threshold. In this case, it was determined that the template image needs to be updated. This makes it possible to update the template image so as to prevent erroneous matching and suppress the decrease in processing speed as much as possible.

―変形例―
なお、上述した実施の形態のカメラは、以下のように変形することもできる。
(1)上述した実施の形態では、テンプレートマッチングに用いるテンプレート画像は1つの場合について説明したが、複数のテンプレート画像を用いてテンプレートマッチングを行う場合にも本発明は適用可能である。
-Modification-
The camera according to the above-described embodiment can be modified as follows.
(1) In the above-described embodiment, the case where one template image is used for template matching has been described. However, the present invention can also be applied to a case where template matching is performed using a plurality of template images.

(2)上述した実施の形態では、制御装置104は、最小類似度値の上昇度(上昇率R)と、連続上昇フレーム数Nとに基づいて、最小類似度値が一定以上の上昇度で連続して上昇している時点を特定する例について説明した。しかしながら、制御装置104は、最小類似度値の上昇度(上昇率R)と、連続上昇フレーム数Nとのいずれか一方に基づいて、最小類似度値が一定以上の上昇度で連続して上昇している時点を特定するようにしてもよい。 (2) In the above-described embodiment, the control device 104 increases the minimum similarity value by a certain amount or more based on the increase degree (increase rate R n ) of the minimum similarity value and the number of continuously rising frames N n. An example has been described in which the time points of continuous ascents are specified. However, the control device 104 continues the minimum similarity value continuously with a certain degree of increase based on one of the increase degree of the minimum similarity value (increase rate R n ) and the number of continuously rising frames N n. You may make it identify the time of rising.

(3)上述した実施の形態では、制御装置104は、類似度マップの分散値に基づいて、ターゲット画像内の被写体の追尾対象被写体としての信頼性が低下した時点を特定する例について説明した。しかしながら、制御装置104は、類似度マップの分散値の平方根である標準偏差値に基づいて、ターゲット画像内の被写体の追尾対象被写体としての信頼性が低下した時点を特定するようにしてもよい。 (3) In the above-described embodiment, the example has been described in which the control device 104 identifies the point in time when the reliability of the subject in the target image as the tracking target subject has decreased based on the variance value of the similarity map. However, the control device 104 may specify a point in time when the reliability of the subject in the target image as the tracking target subject decreases based on the standard deviation value that is the square root of the variance value of the similarity map.

(4)上述した実施の形態では、制御装置104は、各探索位置における類似度値を2次元化して表した類似度マップを生成する例について説明した。しかしながら、各探索位置における類似度値のうち、他の探索位置とは類似度値が大きく離れている探索位置はノイズの影響を受けていると考えられるため、類似度マップから除外してもよい。 (4) In the above-described embodiment, the description has been given of the example in which the control device 104 generates the similarity map in which the similarity value at each search position is two-dimensionally expressed. However, among the similarity values at each search position, search positions whose similarity values are far away from other search positions are considered to be affected by noise, and may be excluded from the similarity map. .

(5)上述した実施の形態では、図2のステップS6において、制御装置104は、現フレームにおける類似度マップの分散値が、過去フレームにおける類似度マップの分散値の平均値以下であるか否かを判定する例について説明した。しかしながら、分散値との比較に用いる閾値は、あらかじめ設定された固定値であってもよい。 (5) In the embodiment described above, in step S6 of FIG. 2, the control device 104 determines whether or not the variance value of the similarity map in the current frame is equal to or less than the average value of the variance values of the similarity map in the past frame. An example of determining whether has been described. However, the threshold value used for comparison with the variance value may be a fixed value set in advance.

(6)上述した実施の形態では、制御装置104は、スルー画を対象として被写体追尾を行う例について説明した。しかしながら、カメラ100が動画撮影機能を備えている場合には、制御装置104は、スルー画ではなく、撮影済みの動画のフレーム間で被写体追尾を行うようにしてもよい。 (6) In the above-described embodiment, the control device 104 has described an example in which subject tracking is performed on a through image. However, when the camera 100 has a moving image shooting function, the control device 104 may perform subject tracking between frames of a captured moving image instead of the through image.

(7)上述し実施の形態では、カメラ100が供える制御装置104がテンプレートマッチング処理を行って被写体追尾を行う例について説明した。しかしながら、テンプレートマッチング処理を実行するためのプログラムをパソコンなどその他の端末に記録して、それらの端末上で処理を実行することも可能である。この場合、カメラで撮影した動画像データを端末側に取り込んで、これを対象に処理を行うようにすれば、動画のフレーム間で被写体追尾を行うことが可能となる。また、本発明はカメラ付き携帯電話などに適用することも可能である。 (7) In the above-described embodiment, an example has been described in which the control device 104 provided by the camera 100 performs template matching processing to perform subject tracking. However, it is also possible to record a program for executing the template matching process in another terminal such as a personal computer and execute the process on those terminals. In this case, if moving image data captured by a camera is taken into the terminal side and processing is performed on the data, subject tracking can be performed between frames of the moving image. The present invention can also be applied to a camera-equipped mobile phone.

なお、本発明の特徴的な機能を損なわない限り、本発明は、上述した実施の形態における構成に何ら限定されない。また、上述の実施の形態と複数の変形例を組み合わせた構成としてもよい。   Note that the present invention is not limited to the configurations in the above-described embodiments as long as the characteristic functions of the present invention are not impaired. Moreover, it is good also as a structure which combined the above-mentioned embodiment and a some modification.

100 カメラ、101 操作部材、102 レンズ、103 撮像素子、104 制御装置、105 メモリカードスロット、106 モニタ 100 Camera, 101 Operation member, 102 Lens, 103 Image sensor, 104 Control device, 105 Memory card slot, 106 Monitor

Claims (3)

テンプレート画像と、入力画像内に設定した探索枠内のターゲット画像との類似度値を算出する類似度算出手段と、
前記入力画像内の前記類似度値の分散値または標準偏差値を算出する算出手段と、
前記入力画像内において前記テンプレート画像と前記ターゲット画像の類似度が所定の条件を満たす前記類似度値を特定類似度値として特定する特定手段と、
前記特定類似度値をフレームごとに蓄積し、蓄積した前記特定類似度値に基づいて、前記テンプレート画像と前記ターゲット画像の類似度が所定フレーム連続して低下していることを判断し、かつ前記類似度値の分散値または標準偏差値が所定の閾値以下である場合に、前記テンプレート画像の更新が必要であると判定する判定手段と、
前記判定手段が前記テンプレート画像の更新が必要であると判定したときに、前記テンプレート画像の更新を行なう更新手段とを備えることを特徴とする被写体追尾装置。
Similarity calculation means for calculating a similarity value between the template image and the target image in the search frame set in the input image;
Calculating means for calculating a variance value or a standard deviation value of the similarity value in the input image;
A specifying means for specifying, as a specific similarity value, the similarity value in which the similarity between the template image and the target image satisfies a predetermined condition in the input image;
The specific similarity value is accumulated for each frame, and based on the accumulated specific similarity value, it is determined that the similarity between the template image and the target image continuously decreases for a predetermined frame, and A determination unit that determines that the template image needs to be updated when the variance value or the standard deviation value of the similarity value is equal to or less than a predetermined threshold ;
Wherein when the determination means determines that it is necessary to update the template image, the object tracking apparatus characterized by comprising updating means for updating the template images.
テンプレート画像と、入力画像内に設定した探索枠内のターゲット画像との類似度値を算出する類似度算出手段と、
前記入力画像内の前記類似度値の分散値または標準偏差値を算出する算出手段と、
前記入力画像内において前記テンプレート画像と前記ターゲット画像の類似度が所定の条件を満たす前記類似度値を特定類似度値として特定する特定手段と、
前記特定類似度値をフレームごとに蓄積し、蓄積した前記特定類似度値に基づいて、現フレームの類似度が過去の複数フレームの類似度の平均値に対して一定の割合以上で低下していることを判断し、かつ前記類似度値の分散値または標準偏差値が所定の閾値以下である場合に、前記テンプレート画像の更新が必要であると判定する判定手段と、
前記判定手段が前記テンプレート画像の更新が必要であると判定したときに、前記テンプレート画像の更新を行なう更新手段とを備えることを特徴とする被写体追尾装置。
Similarity calculation means for calculating a similarity value between the template image and the target image in the search frame set in the input image;
Calculating means for calculating a variance value or a standard deviation value of the similarity value in the input image;
A specifying means for specifying, as a specific similarity value, the similarity value in which the similarity between the template image and the target image satisfies a predetermined condition in the input image;
The specific similarity value is accumulated for each frame, and based on the accumulated specific similarity value, the similarity of the current frame is decreased by a certain ratio or more with respect to the average value of the similarity of a plurality of past frames. Determining means for determining that the template image needs to be updated when the variance value or the standard deviation value of the similarity value is equal to or less than a predetermined threshold value ;
Wherein when the determination means determines that it is necessary to update the template image, the object tracking apparatus characterized by comprising updating means for updating the template images.
被写体像を撮像して画像を取得する撮像手段と、
請求項1または2に記載の被写体追尾装置とを備えることを特徴とするカメラ。
Imaging means for capturing a subject image and acquiring the image;
A camera comprising the subject tracking device according to claim 1.
JP2009103924A 2009-04-22 2009-04-22 Subject tracking device and camera Active JP5365327B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009103924A JP5365327B2 (en) 2009-04-22 2009-04-22 Subject tracking device and camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009103924A JP5365327B2 (en) 2009-04-22 2009-04-22 Subject tracking device and camera

Publications (2)

Publication Number Publication Date
JP2010257041A JP2010257041A (en) 2010-11-11
JP5365327B2 true JP5365327B2 (en) 2013-12-11

Family

ID=43317912

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009103924A Active JP5365327B2 (en) 2009-04-22 2009-04-22 Subject tracking device and camera

Country Status (1)

Country Link
JP (1) JP5365327B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5361703B2 (en) * 2009-12-25 2013-12-04 オリンパスイメージング株式会社 Motion detection apparatus and motion detection method
JP6992344B2 (en) * 2017-09-14 2022-01-13 日産自動車株式会社 Landmark selection method and landmark selection device
CN108989683A (en) * 2018-08-20 2018-12-11 崔跃 A kind of automatic shooting system for children

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09265538A (en) * 1996-03-29 1997-10-07 Matsushita Electric Works Ltd Automatic tracking device
JPH11120351A (en) * 1997-10-15 1999-04-30 Fujitsu Ltd Image matching device and storage medium to store image matching program
JP2002366959A (en) * 2001-06-08 2002-12-20 Mitsubishi Electric Corp Image processor and method for processing image
JP5018767B2 (en) * 2006-03-01 2012-09-05 株式会社ニコン Subject tracking program, subject tracking device, and camera
JP4969291B2 (en) * 2007-03-30 2012-07-04 セコム株式会社 Moving object tracking device

Also Published As

Publication number Publication date
JP2010257041A (en) 2010-11-11

Similar Documents

Publication Publication Date Title
JP4708479B2 (en) System and method for realizing motion-driven multi-shot image stabilization
JP4798259B2 (en) Subject tracking device and camera
JP6271990B2 (en) Image processing apparatus and image processing method
JP4678603B2 (en) Imaging apparatus and imaging method
JP4274233B2 (en) Imaging apparatus, image processing apparatus, image processing method therefor, and program causing computer to execute the method
JP5088118B2 (en) Focus adjustment device
JP5054063B2 (en) Electronic camera, image processing apparatus, and image processing method
JP5699432B2 (en) Image processing device
TWI386869B (en) Image recording method, image recording device, and recording medium
JP2009053815A (en) Subject tracking program and subject tracking device
CN101998048A (en) Digital image signal processing method, medium for recording the method, digital image signal pocessing apparatus
JP5115210B2 (en) Imaging device
US20180063413A1 (en) Image pickup apparatus having image sensor capable of outputting parallax image signal, control method therefor, and storage medium storing control program therefor
US7079179B2 (en) Image processing apparatus for performing image restoration
JP2011040993A (en) Subject homing program and camera
JP5365327B2 (en) Subject tracking device and camera
JP2010020602A (en) Image matching device and camera
JP4807582B2 (en) Image processing apparatus, imaging apparatus, and program thereof
JP6486453B2 (en) Image processing apparatus, image processing method, and program
JP5029647B2 (en) Subject tracking device and camera
JP2010157792A (en) Photographed object tracing device
JP5179859B2 (en) Imaging apparatus and imaging method
JP6063680B2 (en) Image generation apparatus, image generation method, imaging apparatus, and imaging method
JP2014216830A (en) Image tracking device, image tracking method and program
JP4770965B2 (en) Image matching device and camera

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120330

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130122

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130411

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130416

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130617

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130718

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130826

R150 Certificate of patent or registration of utility model

Ref document number: 5365327

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

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

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250