JP2009188480A - Subject tracing program, subject tracing device, and camera - Google Patents

Subject tracing program, subject tracing device, and camera Download PDF

Info

Publication number
JP2009188480A
JP2009188480A JP2008023529A JP2008023529A JP2009188480A JP 2009188480 A JP2009188480 A JP 2009188480A JP 2008023529 A JP2008023529 A JP 2008023529A JP 2008023529 A JP2008023529 A JP 2008023529A JP 2009188480 A JP2009188480 A JP 2009188480A
Authority
JP
Japan
Prior art keywords
subject
template
image
images
tracking
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
JP2008023529A
Other languages
Japanese (ja)
Inventor
Hiroyuki Abe
啓之 阿部
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 JP2008023529A priority Critical patent/JP2009188480A/en
Publication of JP2009188480A publication Critical patent/JP2009188480A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide a subject tracing program that can accurately detect the moving/still state of a subject, and to provide a subject tracing device and a camera. <P>SOLUTION: A template matching unit 104a performs template matching between respective frames of an input image and a plurality of template images to select a template image having the highest similarity to an image in the predetermined area of the input image as a selected template out of the plurality of template images, and extracts the predetermined area of the input image as a matching area. A subject tracing unit 104c traces the movement of the image in the extracted matching area between frames to trace the movement of the subject between images of a plurality of frames. A subject moving/still state decision unit 104c decides whether the subject is in the moving state or in the still state on the basis of how many times respective template images are selected. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、複数フレーム間で被写体を追跡するための被写体追跡プログラム、被写体追跡装置、およびカメラに関する。   The present invention relates to a subject tracking program, a subject tracking device, and a camera for tracking a subject between a plurality of frames.

次のようなデジタルカメラが知られている。このデジタルカメラは、現在画像信号と以前画像信号との差分に基づいて、両画像信号間での動き変化量を算出する。そして、算出した動き変化量に基づいて、シャッタースピードを決定する(例えば、特許文献1)。   The following digital cameras are known. This digital camera calculates a motion change amount between both image signals based on a difference between the current image signal and the previous image signal. Then, the shutter speed is determined based on the calculated motion change amount (for example, Patent Document 1).

特開平11−88763号公報JP-A-11-88763

しかしながら、従来のデジタルカメラでは、現在画像信号と以前画像信号との差分に基づいて動き変化量を算出するため、被写体が動いたのかカメラが動いたのかを判別することができず、被写体の動静状態を正確に検出することはできなかった。   However, in the conventional digital camera, since the amount of movement change is calculated based on the difference between the current image signal and the previous image signal, it cannot be determined whether the subject has moved or the camera has moved. The condition could not be detected accurately.

本発明による被写体追跡プログラムは、時系列で入力される複数の入力画像間で被写体の動きを追跡するための被写体追跡プログラムであって、コンピュータに、入力画像と、複数のテンプレート画像とのテンプレートマッチングを行って、複数のテンプレート画像の中から入力画像の所定領域内の画像との類似度が最も高いテンプレート画像を選択テンプレートとして選択し、入力画像の所定領域を合致領域として抽出するテンプレートマッチング手順と、テンプレートマッチング手順によって抽出された合致領域内の画像について、複数の入力画像間での動きを追跡することによって、複数の入力画像間で被写体の動きを追跡する被写体追跡手順と、テンプレートマッチング手順によって、各テンプレート画像が選択テンプレート画像として選択された回数に基づいて、被写体が動状態にあるか静状態にあるかを判定する動静状態判定手順とを実行させることを特徴とする。
複数のテンプレート画像は、追跡対象とする被写体を異なる時刻に撮影した複数の画像のそれぞれから被写体を含む範囲内を抽出した画像であることが好ましい。
動静状態判定手順による判定結果に基づいて、被写体追跡中における自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理の実行タイミングを決定する制御手順をさらに備えるようにしてもよい。
制御手順は、被写体追跡の開始時点に自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理を実行し、被写体追跡中は、所定時間間隔で動静状態判定手順による判定結果を監視し、動静状態判定手順によって被写体が動状態であると判定された場合には、自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理を実行し、動静状態判定手順によって被写体が静状態であると判定された場合には、自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理の実行を停止するようにしてもよい。
本発明による被写体追跡装置は、上記いずれかの被写体追跡プログラムを実行する実行手段を備えることを特徴とする、
本発明によるカメラは、画像を撮像する撮像手段と、上記いずれかの被写体追跡プログラムを実行する実行手段とを備え、実行手段は、撮像手段で撮像され、時系列で入力される複数の入力画像間で被写体の動きを追跡して、被写体の動静状態を判定することを特徴とする。
A subject tracking program according to the present invention is a subject tracking program for tracking the movement of a subject between a plurality of input images input in time series, and the computer performs template matching between an input image and a plurality of template images. A template matching procedure for selecting a template image having the highest similarity to an image in a predetermined area of the input image from among a plurality of template images as a selection template, and extracting the predetermined area of the input image as a matching area; In the matching region extracted by the template matching procedure, by tracking the movement between a plurality of input images by tracking the movement between the plurality of input images, the subject tracking procedure and the template matching procedure , Each template image and selected template image Based on the number of times the selected Te, subject which is characterized in that to execute the movements state determination procedure for determining whether there on whether static state is in dynamic state.
The plurality of template images are preferably images obtained by extracting a range including the subject from each of a plurality of images obtained by photographing the subject to be tracked at different times.
A control procedure for determining the execution timing of the automatic focus adjustment process, the automatic exposure adjustment process, and the automatic white balance adjustment process during subject tracking may be further provided based on the determination result of the moving and static state determination procedure.
The control procedure executes an automatic focus adjustment process, an automatic exposure adjustment process, and an automatic white balance adjustment process at the start of subject tracking, and during the subject tracking, monitors the determination result by the moving state determination procedure at predetermined time intervals, When it is determined that the subject is in the moving state by the moving / static state determining procedure, the automatic focus adjustment processing, the automatic exposure adjustment processing, and the automatic white balance adjustment processing are executed, and the subject is in the static state by the moving / static state determining procedure. When it is determined that the automatic focus adjustment process, the automatic exposure adjustment process, and the automatic white balance adjustment process are stopped, the execution may be stopped.
A subject tracking apparatus according to the present invention includes an execution unit that executes any one of the subject tracking programs.
The camera according to the present invention includes an imaging unit that captures an image and an execution unit that executes any one of the subject tracking programs. The execution unit captures a plurality of input images that are captured by the imaging unit and input in time series. It is characterized in that the movement of the subject is tracked between them to determine the state of movement of the subject.

本発明によれば、被写体の動静状態を正確に検出することができる。   According to the present invention, it is possible to accurately detect a moving state of a subject.

図1は、本実施の形態における被写体追跡装置としてカメラを使用した場合の一実施の形態の構成を示すブロック図である。カメラ100は、入力スイッチ101と、レンズ102と、撮像素子103と、制御装置104と、メモリカードスロット105と、モニタ106とを備えている。   FIG. 1 is a block diagram showing a configuration of an embodiment when a camera is used as the subject tracking device in the present embodiment. The camera 100 includes an input switch 101, a lens 102, an image sensor 103, a control device 104, a memory card slot 105, and a monitor 106.

入力スイッチ101は、使用者によって操作される種々の入力部材を含んでいる。例えば、この入力スイッチ101には、レリーズボタンやデジタルカメラ100を操作するための種々の操作ボタンが含まれる。   The input switch 101 includes various input members operated by the user. For example, the input switch 101 includes a release button and various operation buttons for operating the digital camera 100.

レンズ102は、複数の光学レンズ群から構成されるが、図1では代表して1枚のレンズで表している。撮像素子103は、例えばCCDやCMOSであり、レンズ102を通して入力される被写体像を撮像して、撮像した画像データを制御装置104へ出力する。なお、本実施の形態におけるカメラ100においては、撮像素子103は、使用者による入力スイッチ101に含まれるレリーズボタンが押下されることにより被写体像の撮像を行う。このとき、レリーズボタンが押下された時点の1フレームの画像を静止画像として撮像することもでき、また、レリーズボタンが押下されてから次にレリーズボタンが押下されるまでの間、被写体像を所定の時間間隔で連続して複数フレーム撮像することによって、動画像を撮影することもできる。   The lens 102 is composed of a plurality of optical lens groups, but is represented by a single lens in FIG. The image sensor 103 is, for example, a CCD or a CMOS, captures a subject image input through the lens 102, and outputs the captured image data to the control device 104. In the camera 100 according to the present embodiment, the image sensor 103 captures a subject image when a user presses a release button included in the input switch 101. At this time, an image of one frame at the time when the release button is pressed can be taken as a still image, and a subject image is predetermined after the release button is pressed until the next time the release button is pressed. It is also possible to capture a moving image by capturing a plurality of frames continuously at the time interval.

制御装置104は、CPU、メモリ、およびその他の周辺回路により構成され、撮像素子103から入力される画像データ(静止画像データまたは動画像データ)をモニタ106に出力して表示し、さらにメモリカードスロット105に挿入されているメモリカード内に記憶する。なお、制御装置104を構成するメモリには、SDRAMやフラッシュメモリが含まれる。SDRAMは、揮発性のメモリであって、CPUがプログラム実行時にプログラムを展開するためのワークメモリとして使用されたり、データを一時的に記録するためのバッファメモリとして使用される。また、フラッシュメモリは、不揮発性のメモリであって、制御装置104が実行するプログラムのデータや、プログラム実行時に読み込まれる種々のパラメータなどが記録されている。   The control device 104 includes a CPU, a memory, and other peripheral circuits. The control device 104 outputs and displays image data (still image data or moving image data) input from the image sensor 103 on the monitor 106, and further a memory card slot. The data is stored in the memory card inserted in 105. 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はまた、テンプレートマッチング部104aと、テンプレート更新部104bと、被写体追跡部104cと、被写体動静状態判定部104dとを機能的に有している。そして、これらの各部による処理によって、撮像素子103から動画像データが入力された場合に、動画像データを構成する各フレームの画像内に存在する被写体をフレーム間で追跡することができる。以下、撮像素子103から動画像データが入力された場合のフレーム間での被写体追跡処理について説明する。   The control device 104 also functionally includes a template matching unit 104a, a template update unit 104b, a subject tracking unit 104c, and a subject moving / static state determining unit 104d. Then, by the processing by each of these units, when moving image data is input from the image sensor 103, it is possible to track the subject existing in the image of each frame constituting the moving image data between frames. Hereinafter, a subject tracking process between frames when moving image data is input from the image sensor 103 will be described.

テンプレートマッチング部104aは、テンプレートマッチング処理の基準となる複数のテンプレート画像と、撮像素子103から時系列で入力される各フレームの画像データ(ターゲット画像)とのマッチング演算を行う。テンプレートマッチングの手法は公知であるため詳細な説明は省略するが、例えば相互相関法や残差逐次検定法などの手法を用いればよい。   The template matching unit 104a performs a matching operation between a plurality of template images serving as a reference for template matching processing and image data (target images) of each frame input in time series from the image sensor 103. Since the template matching method is known, detailed description thereof is omitted, but a method such as a cross-correlation method or a residual sequential test method may be used.

すなわち、テンプレートマッチング部104aは、ターゲット画像上にテンプレート画像とのマッチングを行うための矩形枠をターゲット領域として設定し、ターゲット領域の位置をターゲット画像内で所定量ずつ、例えば1画素ずつ移動させながらそれぞれの位置におけるターゲット領域内の画像とテンプレート画像との類似度を算出する。そして、テンプレートマッチング部104aは、ターゲット画像全体に対してテンプレートマッチング処理を実行した結果、ターゲット画像内でテンプレート画像との類似度が最も高い所定領域、すなわち矩形枠を抽出する。   That is, the template matching unit 104a sets a rectangular frame for matching with the template image as a target area on the target image, and moves the position of the target area by a predetermined amount within the target image, for example, by one pixel. The similarity between the image in the target area and the template image at each position is calculated. Then, as a result of executing the template matching process on the entire target image, the template matching unit 104a extracts a predetermined region having the highest similarity with the template image in the target image, that is, a rectangular frame.

テンプレート更新部104bは、テンプレートマッチング部104aによるテンプレートマッチング処理の結果に基づいて、テンプレート画像を更新する。   The template update unit 104b updates the template image based on the result of the template matching process performed by the template matching unit 104a.

被写体追跡部104cは、テンプレートマッチング部104aによって抽出された領域をフレーム間で追跡することによって、撮像素子103から入力される動画像データ内での追跡対象の被写体を追跡する。   The subject tracking unit 104c tracks the subject to be tracked in the moving image data input from the image sensor 103 by tracking the region extracted by the template matching unit 104a between frames.

被写体動静状態判定部104dは、テンプレートマッチング部104aによるテンプレートマッチング処理の結果に基づいて、追跡対象の被写体の動静状態、すなわち、被写体が激しく動いている状態(動状態)にあるか、静止している状態、または動きが少ない状態(静状態)にあるかを判定する。なお、制御装置104が備える各要素による処理の詳細については、後述する。   Based on the result of the template matching process by the template matching unit 104a, the subject moving / static state determining unit 104d determines whether the subject to be tracked is in a moving / static state, that is, the subject is moving violently (moving state) or is stationary. It is determined whether it is in a state where there is a small amount of movement (static state). Details of processing by each element included in the control device 104 will be described later.

本実施の形態では、テンプレート画像として、追跡対象とする被写体を異なる時刻に撮影した複数の画像のそれぞれから被写体を含む範囲内を抽出した画像を用いる。この追跡対象とする被写体を含む画像は使用者によってあらかじめ撮影されて準備されているものとする。具体的には撮像素子103から入力される動画像内に含まれる主要被写体の画像として、人物の顔の画像や特定の物体の画像などを異なる時間に撮影した画像が準備される。   In the present embodiment, as a template image, an image obtained by extracting the range including the subject from each of a plurality of images obtained by photographing the subject to be tracked at different times is used. It is assumed that the image including the subject to be tracked is previously prepared by the user. Specifically, as images of main subjects included in a moving image input from the image sensor 103, images obtained by capturing images of human faces, images of specific objects, and the like at different times are prepared.

例えば、図2に示すように、ターゲット画像2a内の電車の動きをフレーム間で追跡する場合には、使用者は被写体としての電車を異なる時刻に撮影した3枚の画像2b〜2dをテンプレート画像としてあらかじめ準備しておく。このとき、異なる時刻に撮影されたテンプレート画像2b〜2dのうち、最も古い時刻に撮影されたテンプレート画像2bを「OLD」、その次の古い時刻に撮影されたテンプレート画像2cを「CURRENT」、最新の時刻に撮影されたテンプレート画像2dを「NEW」と設定する。   For example, as shown in FIG. 2, when the movement of the train in the target image 2a is tracked between frames, the user takes three images 2b to 2d obtained by photographing the train as a subject at different times as template images. Prepare in advance. At this time, among the template images 2b to 2d photographed at different times, the template image 2b photographed at the oldest time is “OLD”, the template image 2c photographed at the next oldest time is “CURRENT”, and the latest The template image 2d photographed at the time is set to “NEW”.

なお、「OLD」、「CURRENT」、「NEW」は、後述するテンプレート更新部104bによるテンプレート更新処理において、更新を行う対象を明確にするために便宜的に付与した名称であり、各テンプレート画像の名称は必ずしもこれに限定されるものではない。また、テンプレート更新処理における「OLD」、「CURRENT」、「NEW」の各テンプレート画像の役割については、後述する。   Note that “OLD”, “CURRENT”, and “NEW” are names given for convenience in order to clarify the target to be updated in the template update process by the template update unit 104b described later. The name is not necessarily limited to this. The role of each of the “OLD”, “CURRENT”, and “NEW” template images in the template update process will be described later.

テンプレート画像として被写体を異なる時刻に撮影した複数枚の画像をあらかじめ用意することができない場合には、被写体を撮影した1枚の画像を用いて複数枚のテンプレート画像を擬似的に作成してもよい。例えば、被写体を撮影した1枚の画像を拡大・縮小することにより複数枚のテンプレート画像を擬似的に作成してもよく、被写体を撮影した1枚の画像の濃度を変更することにより複数枚のテンプレート画像を擬似的に作成してもよい。   If a plurality of images obtained by photographing a subject at different times cannot be prepared in advance as template images, a plurality of template images may be created in a pseudo manner using a single image obtained by photographing the subject. . For example, a plurality of template images may be created in a pseudo manner by enlarging / reducing one image obtained by photographing the subject, and a plurality of images can be obtained by changing the density of one image obtained by photographing the subject. A template image may be created in a pseudo manner.

被写体を撮影した1枚の画像を拡大・縮小することにより複数枚のテンプレート画像を擬似的に作成する場合には、被写体を撮影した1枚の画像そのものを「CURRENT」とし、「CURRENT」を所定の倍率で拡大または縮小した画像を「OLD」とし、「OLD」とは異なる倍率で「CURRENT」を拡大または縮小した画像を「NEW」とすればよい。   When a plurality of template images are created in a pseudo manner by enlarging / reducing a single image of a subject, the single image of the subject is itself “CURRENT”, and “CURRENT” is a predetermined value. An image enlarged or reduced at a magnification of “OLD” may be referred to as “OLD”, and an image obtained by enlarging or reducing “CURRENT” at a magnification different from “OLD” may be referred to as “NEW”.

また、被写体を撮影した1枚の画像の濃度を変更することにより複数枚のテンプレート画像を擬似的に作成する場合には、被写体を撮影した1枚の画像そのものを「CURRENT」とし、「CURRENT」を明るくした画像を「OLD」、「CURRENT」を暗くした画像を「NEW」とするなどすればよい。また、これ以外の方法により複数枚のテンプレート画像を擬似的に作成してもよい。   Further, when a plurality of template images are created in a pseudo manner by changing the density of one image obtained by photographing the subject, the single image obtained by photographing the subject is referred to as “CURRENT” and “CURRENT”. For example, “OLD” may be used for the image that brightens the image, and “NEW” may be used for the image that darkens the “CURRENT”. Further, a plurality of template images may be created in a pseudo manner by other methods.

テンプレートマッチング部104aは、撮像素子103から動画像データの入力が開始されると、各フレームの画像をターゲット画像2aとし、このターゲット画像2aと「OLD」、「CURRENT」、「NEW」の3枚のテンプレート画像のそれぞれとをマッチング処理してテンプレートマッチングを行う。例えば、ターゲット領域が図2に示すターゲット領域Aに示す位置にある場合には、そのときのターゲット領域A内の画像と、「OLD」2b、「CURRENT」2c、および「NEW」2dとをテンプレートマッチング処理する。   When the input of moving image data from the image sensor 103 is started, the template matching unit 104a sets the image of each frame as the target image 2a, and the target image 2a and three images of “OLD”, “CURRENT”, and “NEW”. Template matching is performed by matching each of the template images. For example, when the target area is at the position shown in the target area A shown in FIG. 2, the image in the target area A at that time, “OLD” 2b, “CURRENT” 2c, and “NEW” 2d are used as templates. Matching process.

そして、テンプレートマッチング部104aは、ターゲット画像2a全体に対してテンプレートマッチング処理を実行した結果、ターゲット画像2a内で「OLD」2bとの類似度が最も高いターゲット領域、「CURRENT」2cとの類似度が最も高いターゲット領域、および「NEW」2dとの類似度が最も高いターゲット領域をそれぞれ検出する。そして、これらの中でターゲット領域との類似度が最も高いテンプレート画像を選択テンプレート画像として選択し、そのときのターゲット領域を合致領域として抽出する。   Then, the template matching unit 104a executes the template matching process on the entire target image 2a, and as a result, the similarity with the target area “CURRENT” 2c having the highest similarity with “OLD” 2b in the target image 2a. The target area having the highest similarity and the target area having the highest similarity to “NEW” 2d are detected. Then, a template image having the highest similarity with the target area is selected as a selected template image, and the target area at that time is extracted as a matching area.

このとき、動画像データに含まれる追跡対象の被写体が動いている場合には、被写体の形状がフレーム間で変化することとなり、あらかじめ準備したテンプレート画像をそのまま使用した場合には、被写体形状の変化に伴って各テンプレート画像とターゲット領域内の画像との類似度が次第に低下していくことになる。このため、被写体追跡部104cによる被写体追跡の精度が次第に低下していく可能性が高い。   At this time, when the subject to be tracked included in the moving image data is moving, the shape of the subject changes between frames. When the template image prepared in advance is used as it is, the change of the subject shape is changed. Along with this, the similarity between each template image and the image in the target area gradually decreases. For this reason, there is a high possibility that the accuracy of subject tracking by the subject tracking unit 104c gradually decreases.

したがって、テンプレート更新部104bは、被写体の動きに応じてテンプレート画像を逐次更新することによって、被写体の形状が時々刻々変化する場合でもテンプレートマッチング部104aによるテンプレートマッチングの精度を向上させて、被写体追跡部104cが精度高く物体の追跡を行えるようにする。具体的にはテンプレート更新部104bは、次のようなテンプレート更新処理を実行する。   Therefore, the template update unit 104b sequentially updates the template image according to the movement of the subject, thereby improving the template matching accuracy by the template matching unit 104a even when the shape of the subject changes from time to time. 104c enables tracking of an object with high accuracy. Specifically, the template update unit 104b executes the following template update process.

すなわち、テンプレート更新部104bは、テンプレートマッチング部104aによるテンプレートマッチング処理の結果に基づいて、「OLD」、「CURRENT」、「NEW」の各テンプレート画像の内、少なくとも1枚を更新する。なお、「OLD」、「CURRENT」、「NEW」の各テンプレート画像は、処理開始時には上述したようにあらかじめ撮影された画像、または擬似的に作成された画像が設定されているが、テンプレート更新処理が実行されることによって、次の(A)〜(C)に示すテンプレート画像に置き換えられ、逐次更新されていくことになる。   That is, the template update unit 104b updates at least one of the “OLD”, “CURRENT”, and “NEW” template images based on the result of the template matching process by the template matching unit 104a. As for the template images “OLD”, “CURRENT”, and “NEW”, an image captured in advance as described above at the start of processing or an image created in a pseudo manner is set. Is executed, the template images shown in the following (A) to (C) are replaced and sequentially updated.

(A)「CURRENT」(現テンプレート画像)
「CURRENT」としては、直近のテンプレート更新時に選択された選択テンプレート画像が設定される。
(B)「OLD」(旧選択テンプレート画像)
「OLD」としては、直近のテンプレート更新時に(A)の「CURRENT」が設定されるまでの間「CURRENT」に設定されていたテンプレート画像が設定される。すなわち、一世代前の「CURRENT」が「OLD」として設定される。
(C)「NEW」(新テンプレート画像)
「NEW」としては、直近のテンプレート更新時に、ターゲット画像2a上で「CURRENT」に設定されたテンプレート画像と最も類似度が高いと判定されたターゲット領域内の画像、すなわち上述した合致領域内の画像が取り込まれて設定される。
(A) “CURRENT” (current template image)
As “CURRENT”, a selected template image selected at the latest template update is set.
(B) "OLD" (old selection template image)
As “OLD”, a template image set to “CURRENT” until “CURRENT” in (A) is set at the time of the latest template update is set. That is, “CURRENT” one generation before is set as “OLD”.
(C) “NEW” (new template image)
“NEW” is an image in the target area that is determined to have the highest similarity to the template image set to “CURRENT” on the target image 2a at the time of the most recent template update, that is, an image in the matching area described above. Is captured and set.

テンプレート更新部104bは、テンプレートマッチング部104aによるテンプレートマッチング処理の結果が、以下に説明する所定の条件を満たす場合にのみ、(A)〜(C)の条件に合致する画像を各テンプレート画像として更新する。具体的には次の(a)〜(c)に示すようにテンプレート画像の更新処理を行う。   The template update unit 104b updates an image that satisfies the conditions (A) to (C) as each template image only when the result of the template matching process by the template matching unit 104a satisfies a predetermined condition described below. To do. Specifically, template image update processing is performed as shown in the following (a) to (c).

(a)テンプレートマッチング部104aによるテンプレートマッチング処理の結果、ターゲット画像2a内で「CURRENT」との類似度が最も高いターゲット領域が上述した合致領域として抽出された場合の処理(選択テンプレート画像として「CURRENT」が選択された場合の処理)
この場合には、テンプレート更新部104bは、テンプレート画像の更新は行わずに、「OLD」、「CURRENT」、「NEW」の各テンプレート画像の設定を維持する。すなわち、前回のテンプレート更新時に最も類似度が高いと判定されたテンプレート画像が現在も最も類似度が高いと判定されていることから、被写体の動きが少なくテンプレート画像の更新の必要はないと判断して、テンプレート画像の更新は行わない。
(A) Processing when the target region having the highest similarity to “CURRENT” in the target image 2a is extracted as the matching region described above as a result of the template matching processing by the template matching unit 104a (“CURRENT” as the selected template image When "" is selected)
In this case, the template update unit 104b does not update the template image, and maintains the settings of the template images “OLD”, “CURRENT”, and “NEW”. In other words, since the template image determined to have the highest similarity at the time of the previous template update is determined to have the highest similarity, it is determined that there is little subject movement and there is no need to update the template image. Thus, the template image is not updated.

(b)テンプレートマッチング部104aによるテンプレートマッチング処理の結果、ターゲット画像2a内で「OLD」との類似度が最も高いターゲット領域が合致領域として抽出された場合の処理(選択テンプレート画像として「OLD」が選択された場合の処理)
この場合には、テンプレート更新部104bは、所定回数以上、例えば7回以上「OLD」が連続して選択され、かつその間の類似度の平均が所定の類似度以上、例えば、一致を表す類似度が1であり、不一致を示す類似度が0である場合には、類似度の平均が0.8以上であるか否かを判断する。そして、テンプレート更新部104bは、上記更新条件を満たさないと判断した場合には、今までのテンプレート画像の更新は行わずに、「OLD」、「CURRENT」、「NEW」の各テンプレート画像の設定を維持する。
(B) Processing when a target region having the highest similarity to “OLD” in the target image 2a is extracted as a matching region as a result of template matching processing by the template matching unit 104a (“OLD” is selected as the selected template image) Processing when selected)
In this case, the template update unit 104b selects “OLD” continuously for a predetermined number of times or more, for example, seven times or more, and the average of similarities between them is a predetermined degree of similarity or more, for example, a similarity indicating a match. Is 1 and the similarity indicating mismatch is 0, it is determined whether or not the average similarity is 0.8 or more. If the template update unit 104b determines that the update condition is not satisfied, the template update unit 104b sets the template images “OLD”, “CURRENT”, and “NEW” without updating the template image so far. To maintain.

これに対して、テンプレート更新部104bは、上記更新条件を満たすと判断した場合には、次のようにテンプレート画像を更新する。すなわち、今まで「OLD」として設定されていたテンプレート画像を「CURRENT」に設定し、今まで「CURRENT」として設定されていたテンプレート画像を「OLD」に設定する。これによって、最も類似度が高いと判定されたテンプレート画像を「CURRENT」に設定し、一世代前の「CURRENT」を「OLD」として設定することができる。同時にテンプレート更新部104bは、このときにターゲット画像2a上で更新前の「OLD」との類似度が最も高いと判定されたターゲット領域内の画像、すなわち合致領域内の画像を取り込んで新たに「NEW」に設定する。   In contrast, if the template update unit 104b determines that the update condition is satisfied, the template update unit 104b updates the template image as follows. That is, the template image that has been set as “OLD” until now is set to “CURRENT”, and the template image that has been set as “CURRENT” until now is set to “OLD”. As a result, the template image determined to have the highest similarity can be set to “CURRENT”, and “CURRENT” one generation before can be set to “OLD”. At the same time, the template updating unit 104b takes in an image in the target area that is determined to have the highest similarity to “OLD” before the update on the target image 2a, that is, an image in the matching area and newly adds “ Set to “NEW”.

(c)テンプレートマッチング部104aによるテンプレートマッチング処理の結果、ターゲット画像2a内で「NEW」との類似度が最も高いターゲット領域が合致領域として選択された場合の処理(選択テンプレート画像として「NEW」が選択された場合の処理)
この場合には、テンプレート更新部104bは、所定回数以上、例えば7回以上「NEW」が連続して選択され、かつその間の類似度の平均が所定の類似度以上、例えば0.8以上であるか否かを判断する。そして、テンプレート更新部104bは、上記更新条件を満たさないと判断した場合には、今までのテンプレート画像の更新は行わずに、「OLD」、「CURRENT」、「NEW」の各テンプレート画像の設定を維持する。
(C) Processing when the target region having the highest similarity to “NEW” in the target image 2a is selected as the matching region as a result of the template matching processing by the template matching unit 104a (“NEW” is selected as the selected template image) Processing when selected)
In this case, the template update unit 104b selects “NEW” continuously for a predetermined number of times or more, for example, 7 times or more, and the average of the similarities between them is a predetermined similarity or more, for example, 0.8 or more. Determine whether or not. If the template update unit 104b determines that the update condition is not satisfied, the template update unit 104b sets the template images “OLD”, “CURRENT”, and “NEW” without updating the template image so far. To maintain.

これに対して、テンプレート更新部104bは、上記更新条件を満たすと判断した場合には、次のようにテンプレート画像を更新する。すなわち、今まで「NEW」として設定されていたテンプレート画像を「CURRENT」に設定し、今まで「CURRENT」として設定されていたテンプレート画像を「OLD」に設定する。これによって、最も類似度が高いと判定されたテンプレート画像を「CURRENT」に設定し、一世代前の「CURRENT」を「OLD」として設定することができる。同時にテンプレート更新部104bは、このときにターゲット画像2a上で更新前の「NEW」との類似度が最も高いと判定されたターゲット領域内の画像、すなわち合致領域内の画像を取り込んで新たに「NEW」に設定する。   In contrast, if the template update unit 104b determines that the update condition is satisfied, the template update unit 104b updates the template image as follows. That is, the template image that has been set as “NEW” until now is set to “CURRENT”, and the template image that has been set as “CURRENT” until now is set to “OLD”. As a result, the template image determined to have the highest similarity can be set to “CURRENT”, and “CURRENT” one generation before can be set to “OLD”. At the same time, the template update unit 104b takes in the image in the target area that is determined to have the highest similarity to “NEW” before the update on the target image 2a, that is, the image in the matching area and newly adds “ Set to “NEW”.

このようにテンプレート画像を更新することによって、被写体の動きに応じた形状の変化に対応して、精度の高いテンプレートマッチング処理を行うことができる。また、「OLD」または「NEW」が所定回数以上連続して選択され、かつその間の類似度の平均が所定の類似度以上である場合にのみテンプレート画像の更新を行うようにしたので、フレームごとにテンプレート画像の更新を行う従来の手法と比較して、テンプレート画像の更新頻度を抑えて安定したテンプレートマッチング処理を行うことができる。   By updating the template image in this way, highly accurate template matching processing can be performed in response to a change in shape according to the movement of the subject. Also, the template image is updated only when “OLD” or “NEW” is continuously selected a predetermined number of times or more and the average similarity between them is equal to or higher than the predetermined similarity. Compared with the conventional method of updating the template image, the template matching update frequency can be suppressed and stable template matching processing can be performed.

例えば、600フレームの静止画で構成される動画像を従来の手法により各フレームごとにテンプレート画像を更新した場合には、600回のテンプレート画像の更新が発生するが、本実施の形態による手法を使用することにより、テンプレート画像の更新回数を30回程度まで減らすことが可能となり、処理の負荷を低減することができる。   For example, if a template image is updated for each frame of a moving image composed of 600 frames of still images using the conventional method, the template image is updated 600 times. By using it, the number of times of updating the template image can be reduced to about 30, and the processing load can be reduced.

被写体動静状態判定部104dは、テンプレートマッチング部104aによるテンプレートマッチング処理によって、「OLD」、「CURRENT」、「NEW」の各テンプレート画像がそれぞれ何回ずつ選択されたかをカウントする。例えば、被写体動静状態判定部104dは、テンプレートマッチング処理が開始される前に、各テンプレート画像の選択回数をカウントするためのカウンタを制御装置104が備えるSDRAM内に生成し、各カウンタのカウント値の初期値を0としておく。そして、被写体動静状態判定部104dは、テンプレートマッチング部104aによっていずれかのテンプレート画像が選択される度に、選択されたテンプレート画像用に生成したカウンタのカウンタ値に1を加算する。   The subject moving state determination unit 104d counts how many times each of the “OLD”, “CURRENT”, and “NEW” template images has been selected by the template matching processing by the template matching unit 104a. For example, the subject moving state determination unit 104d generates a counter for counting the number of times each template image is selected in the SDRAM included in the control device 104 before the template matching process is started, and sets the count value of each counter. The initial value is set to 0. Then, every time a template image is selected by the template matching unit 104a, the subject moving state determination unit 104d adds 1 to the counter value of the counter generated for the selected template image.

すなわち、被写体動静状態判定部104dは、テンプレートマッチング部104aによって、「OLD」が選択された場合には、「OLD」用のカウンタ(OLDカウンタ)のカウンタ値に1を加算する。被写体動静状態判定部104dは、テンプレートマッチング部104aによって、「CURRENT」が選択された場合には、「CURRENT」用のカウンタ(CURRENTカウンタ)のカウンタ値に1を加算する。被写体動静状態判定部104dは、テンプレートマッチング部104aによって、「NEW」が選択された場合には、「NEW」用のカウンタ(NEWカウンタ)のカウンタ値に1を加算する。   That is, the subject moving state determination unit 104d adds 1 to the counter value of the “OLD” counter (OLD counter) when “OLD” is selected by the template matching unit 104a. When the template matching unit 104a selects “CURRENT”, the subject moving state determination unit 104d adds 1 to the counter value of the “CURRENT” counter (CURRENT counter). The subject moving state determination unit 104d adds 1 to the counter value of the “NEW” counter (NEW counter) when “NEW” is selected by the template matching unit 104a.

そして、被写体動静状態判定部104dは、所定のタイミングで、上記カウント値に基づいて被写体の動静状態を判定する。ここでいう「所定のタイミング」については、後述する。被写体動静状態判定部104dは、具体的には、次式(1)により算出される動静係数を用いて、被写体の動静状態を判定する。
動静係数 = (OLDカウンタのカウント値+NEWカウンタのカウント値)/CURRENTカウンタのカウンタ値 ・・・(1)
The subject moving state determination unit 104d determines the moving state of the subject based on the count value at a predetermined timing. The “predetermined timing” here will be described later. Specifically, the subject moving state determination unit 104d determines the moving state of the subject using the moving coefficient calculated by the following equation (1).
Dynamic coefficient = (OLD counter count value + NEW counter count value) / CURRENT counter count value (1)

被写体の動状態にある場合には、テンプレート更新部104bによるテンプレートの更新頻度が多くなり、結果として「NEW」または「OLD」が選択される回数が増える。よって、被写体動静状態判定部104dは、動静係数の算出結果が所定値以上、例えば1以上である場合に、被写体の動静状態は動状態であると判定する。これに対して、被写体が静状態にある場合には、テンプレート更新部104bによるテンプレートの更新が発生せず、結果として「CURRENT」ばかりが選択されることになる。よって、被写体動静状態判定部104dは、動静係数の算出結果が所定値未満、例えば1未満である場合に、被写体の動静状態は静状態であると判定する。   When the subject is in a moving state, the template update frequency by the template update unit 104b increases, and as a result, the number of times “NEW” or “OLD” is selected increases. Thus, the subject moving state determination unit 104d determines that the moving state of the subject is the moving state when the calculation result of the moving coefficient is equal to or greater than a predetermined value, for example, 1 or more. On the other hand, when the subject is in a static state, the template updating unit 104b does not update the template, and as a result, only “CURRENT” is selected. Therefore, the subject moving state determination unit 104d determines that the moving state of the subject is the static state when the calculation result of the movement coefficient is less than a predetermined value, for example, less than 1.

例えば、図3に示すように、テンプレート更新部104bによって「OLD」が115回、「CURRENT」が108回、「NEW」が99回選択された場合には、式(1)により、動静係数=(115+99)/108=1.98となる。この算出結果は、1以上であるため被写体動静状態判定部104dは、被写体の動静状態は動状態であると判定する。これに対して、図4に示すように、テンプレート更新部104bによって「OLD」が16回、「CURRENT」が140回、「NEW」が46回選択された場合には、式(1)により、動静係数=(16+46)/140=0.443となる。この算出結果は、1未満であるため被写体動静状態判定部104dは、被写体の動静状態は静状態であると判定する。   For example, as shown in FIG. 3, when “OLD” is selected 115 times, “CURRENT” is selected 108 times, and “NEW” is 99 times selected by the template updating unit 104b, the dynamic coefficient = (115 + 99) /108=1.98. Since the calculation result is 1 or more, the subject moving state determination unit 104d determines that the moving state of the subject is a moving state. On the other hand, as shown in FIG. 4, when “OLD” is selected 16 times, “CURRENT” is selected 140 times, and “NEW” is 46 times selected by the template updating unit 104b, Dynamic coefficient = (16 + 46) /140=0.443. Since this calculation result is less than 1, the subject moving state determination unit 104d determines that the moving state of the subject is the still state.

制御装置104は、被写体動静状態判定部104dによる判定結果を撮影のために用いる。本実施の形態では、被写体動静状態判定部104dによる判定結果を、被写体追跡中におけるAF(Auto Focus/自動焦点調整)処理、AE(Automatic Exposure/自動露出調整)処理、AWB(Auto WhiteBalance/自動ホワイトバランス調整)処理の実行タイミングを決定するために用いる例について説明する。   The control device 104 uses the determination result by the subject moving state determination unit 104d for photographing. In the present embodiment, the determination result by the subject moving state determination unit 104d is used as AF (Auto Focus / automatic focus adjustment) processing, AE (Automatic Exposure / automatic exposure adjustment) processing, AWB (Auto White Balance / automatic white) during subject tracking. An example used to determine the execution timing of the (balance adjustment) process will be described.

制御装置104は、使用者によってカメラ100のモードが撮影を行うためのモード(撮影モード)に設定されると、所定時間間隔で撮像素子103から入力される画像を画像処理して表示用画像データを生成し、モニタ106へ出力する。これによって、モニタ106にはスルー画が表示される。その後、使用者によって入力スイッチ101に含まれるレリーズボタンが半押しされると、制御装置104は、AF処理、AE処理、およびAWB処理を実行して、焦点調整、露出調整、およびホワイトバランス調整を行う。   When the mode of the camera 100 is set to a mode for taking a picture (shooting mode) by the user, the control device 104 performs image processing on an image input from the image sensor 103 at a predetermined time interval and displays image data for display. Is output to the monitor 106. As a result, a through image is displayed on the monitor 106. After that, when the release button included in the input switch 101 is half-pressed by the user, the control device 104 performs AF processing, AE processing, and AWB processing, and performs focus adjustment, exposure adjustment, and white balance adjustment. Do.

テンプレートマッチング部104aは、撮像素子103から入力されたスルー画の各コマを対象として、上述したテンプレートマッチング処理を行って、画像内の被写体を特定する。テンプレート更新部104bは、上述したように、テンプレートマッチング部104aによるテンプレート画像の選択状況に応じて、テンプレート画像を更新する。そして、被写体追跡部104cは、スルー画の各コマ間で被写体を追跡する。   The template matching unit 104a specifies the subject in the image by performing the template matching process described above for each frame of the through image input from the image sensor 103. As described above, the template update unit 104b updates the template image according to the template image selection status by the template matching unit 104a. The subject tracking unit 104c tracks the subject between the frames of the through image.

被写体動静状態判定部104dは、被写体追跡部104cが被写体追跡を開始した後には、各フレームごとに被写体の動静状態を判定する。そして、制御装置104は、被写体追跡中に所定時間間隔で被写体動静状態判定部104dによる判定結果を監視する。   The subject moving state determination unit 104d determines the moving state of the subject for each frame after the subject tracking unit 104c starts tracking the subject. Then, the control device 104 monitors the determination result by the subject moving state determination unit 104d at predetermined time intervals during subject tracking.

制御装置104は、被写体動静状態判定部104dが被写体が動状態にあると判定した場合には、被写体の状態が変化したことにより、再度、AF処理、AE処理、およびAWB処理を実行する必要があると判定し、これらの処理を行う。これに対して、制御装置104は、被写体動静状態判定部104dが被写体が静状態にあると判定した場合には、被写体の状態はそれほど変化しておらず、前回のAF処理、AE処理、およびAWB処理の結果を用いることができるため、再度のAF処理、AE処理、およびAWB処理の実行は不要であると判定し、これらの処理を行わない(停止する)。   When the subject moving state determination unit 104d determines that the subject is in a moving state, the control device 104 needs to execute AF processing, AE processing, and AWB processing again because the subject state has changed. It is determined that there is, and these processes are performed. On the other hand, when the subject moving state determination unit 104d determines that the subject is in a static state, the control device 104 does not change the state of the subject so much, and the previous AF processing, AE processing, and Since the result of the AWB process can be used, it is determined that it is not necessary to perform the AF process, the AE process, and the AWB process again, and these processes are not performed (stopped).

このように、被写体の動静状態を判定し、その判定結果に基づいてAF処理、AE処理、およびAWB処理の実行タイミングを決定することにより、被写体が静状態にあるとき、すなわち被写体の動きが少ない場合には、前回のAF処理、AE処理、およびAWB処理の結果を用いて撮影を行うことができるため、再度のAF処理、AE処理、およびAWB処理の実行を省くことができ、撮影処理を高速化することができる。また、CPUの負荷を低減することにより節電効果も期待できる。これに対して、被写体が動状態にあるときには、その都度、AF処理、AE処理、およびAWB処理を実行することによって、被写体の変化に応じた焦点調整、露出調整、およびホワイトバランス調整を行うことができる。   In this way, by determining the moving state of the subject and determining the execution timing of the AF process, the AE process, and the AWB process based on the determination result, the subject is in a stationary state, that is, the subject moves less. In this case, since shooting can be performed using the results of the previous AF process, AE process, and AWB process, the execution of the AF process, AE process, and AWB process can be omitted, and the shooting process can be performed. The speed can be increased. In addition, a power saving effect can be expected by reducing the load on the CPU. On the other hand, when the subject is in a moving state, the focus adjustment, the exposure adjustment, and the white balance adjustment corresponding to the change of the subject are performed by executing the AF process, the AE process, and the AWB process each time. Can do.

図5は、本実施の形態におけるカメラ100の処理を示すフローチャートである。図5に示す処理は、使用者によってレリーズボタンが半押しされると起動するプログラムとして、制御装置104によって実行される。   FIG. 5 is a flowchart showing processing of the camera 100 in the present embodiment. The processing shown in FIG. 5 is executed by the control device 104 as a program that starts when the release button is half-pressed by the user.

ステップS1において、制御装置104は、上述したように、AF処理、AE処理、およびAWB処理を実行して、焦点調整、露出調整、およびホワイトバランス調整を行う。その後、ステップS10へ進み、テンプレートマッチング部104aは、上述したようにターゲット画像2a内でターゲット領域を移動させながら、ターゲット領域内の画像と、「OLD」、「CURRENT」、および「NEW」のそれぞれのテンプレート画像とをテンプレートマッチング処理した結果、最も類似度が高いテンプレート画像を選択テンプレートとして選択する。テンプレートマッチング部104aは、さらにターゲット画像2a内おける選択テンプレートと最も類似度が高いターゲット領域を合致領域として抽出する。その後、ステップS20へ進む。   In step S1, as described above, the control device 104 performs AF processing, AE processing, and AWB processing to perform focus adjustment, exposure adjustment, and white balance adjustment. After that, the process proceeds to step S10, and the template matching unit 104a moves the target area in the target image 2a as described above, and each of the image in the target area, “OLD”, “CURRENT”, and “NEW”. As a result of the template matching process with the template image, the template image with the highest similarity is selected as the selected template. The template matching unit 104a further extracts a target area having the highest similarity with the selected template in the target image 2a as a matching area. Then, it progresses to step S20.

ステップS20では、物体追跡部104bは、動画像の前フレームにおける合致領域と現フレームにおける合致領域とに基づいて被写体の追跡を行って、ステップS30へ進む。ステップS30では、テンプレート更新部104bは、テンプレートマッチング部104aによるテンプレートマッチング処理の結果、選択されたテンプレート画像が「OLD」、「CURRENT」、および「NEW」のいずれであるかを判断する。選択されたテンプレート画像が「CURRENT」であると判断した場合には、テンプレート画像の更新を行わず、後述するステップS55へ進む。   In step S20, the object tracking unit 104b tracks the subject based on the matching area in the previous frame of the moving image and the matching area in the current frame, and the process proceeds to step S30. In step S30, the template update unit 104b determines whether the selected template image is “OLD”, “CURRENT”, or “NEW” as a result of the template matching process by the template matching unit 104a. If it is determined that the selected template image is “CURRENT”, the template image is not updated, and the process proceeds to step S55 described later.

これに対して、選択されたテンプレート画像が「OLD」であると判断された場合には、ステップS40へ進む。ステップS40では、テンプレート更新部104bは、上述したように、所定回数以上、例えば7回以上「OLD」が連続して選択され、かつその間の類似度の平均が所定の類似度以上、例えば0.8以上であるという更新条件を満たすか否かを判断する。更新条件を満たさないと判断した場合には、テンプレート画像の更新を行わず、後述するステップS55へ進む。   On the other hand, if it is determined that the selected template image is “OLD”, the process proceeds to step S40. In step S40, as described above, the template updating unit 104b selects “OLD” continuously for a predetermined number of times or more, for example, 7 times or more, and the average of similarities therebetween is a predetermined similarity or more, for example, 0. 0. It is determined whether or not an update condition of 8 or more is satisfied. If it is determined that the update condition is not satisfied, the template image is not updated and the process proceeds to step S55 described later.

一方、更新条件を満たすと判断した場合には、ステップS41へ進み、テンプレート更新部104bは、今まで「OLD」として設定されていたテンプレート画像を「CURRENT」に設定し、今まで「CURRENT」として設定されていたテンプレート画像を「OLD」に設定し、合致領域内の画像を取り込んで新たに「NEW」に設定する。その後、ステップS55へ進む。   On the other hand, if it is determined that the update condition is satisfied, the process proceeds to step S41, and the template update unit 104b sets the template image that has been set as “OLD” until now to “CURRENT”, and as “CURRENT” until now. The set template image is set to “OLD”, the image in the matching area is taken in, and is newly set to “NEW”. Thereafter, the process proceeds to step S55.

また、選択されたテンプレート画像が「NEW」であると判断された場合には、ステップS50へ進む。ステップS50では、テンプレート更新部104bは、上述したように、所定回数以上、例えば7回以上「NEW」が連続して選択され、かつその間の類似度の平均が所定の類似度以上、例えば0.8以上であるという更新条件を満たすか否かを判断する。更新条件を満たさないと判断した場合には、テンプレート画像の更新を行わず、後述するステップS55へ進む。   If it is determined that the selected template image is “NEW”, the process proceeds to step S50. In step S50, as described above, the template update unit 104b selects “NEW” continuously for a predetermined number of times or more, for example, 7 times or more, and the average of similarities between them is a predetermined similarity or more, for example, 0. It is determined whether or not an update condition of 8 or more is satisfied. If it is determined that the update condition is not satisfied, the template image is not updated and the process proceeds to step S55 described later.

一方、更新条件を満たすと判断した場合には、ステップS51へ進み、テンプレート更新部104bは、今まで「NEW」として設定されていたテンプレート画像を「CURRENT」に設定し、今まで「CURRENT」として設定されていたテンプレート画像を「OLD」に設定し、合致領域内の画像を取り込んで新たに「NEW」に設定する。その後、ステップS55へ進む。   On the other hand, if it is determined that the update condition is satisfied, the process proceeds to step S51, where the template update unit 104b sets the template image that has been set as “NEW” to “CURRENT” and has now been set to “CURRENT”. The set template image is set to “OLD”, the image in the matching area is taken in, and is newly set to “NEW”. Thereafter, the process proceeds to step S55.

ステップS55では、被写体動静状態判定部104dは、上述したように、テンプレート更新部104bによる各テンプレート画像の選択回数に基づいて、式(1)を用いて動静係数を算出することによって、被写体の動静状態を判定する。その後、ステップS60へ進む。ステップS60では、制御装置104は、撮像素子103からの動画像データ(スルー画)の入力が終了したか否かを判断する。動画像データの入力が終了したと判断した場合には処理を終了する。   In step S55, the subject motion state determination unit 104d calculates the motion coefficient using Expression (1) based on the number of times each template image is selected by the template update unit 104b, as described above, thereby moving the subject motion state. Determine the state. Thereafter, the process proceeds to step S60. In step S <b> 60, the control device 104 determines whether or not input of moving image data (through image) from the image sensor 103 has ended. If it is determined that the input of moving image data has been completed, the process is terminated.

これに対して、動画像データの入力が終了していないと判断した場合にはステップS70へ進む。ステップS70では、制御装置104は、被写体動静状態判定部104dによって、被写体が動状態であると判定されたか否かを判断する。肯定判断した場合には、ステップS1へ戻り、再度、AF処理、AE処理、およびAWB処理を実行した後、ステップS10以降の処理を繰り返す。これに対して、ステップS70で否定判断した場合には、ステップS10へ戻る。すなわち、AF処理、AE処理、およびAWB処理を実行することなく、ステップS10以降の処理を繰り返す。   On the other hand, if it is determined that the input of moving image data has not ended, the process proceeds to step S70. In step S70, the control device 104 determines whether or not the subject moving state determination unit 104d determines that the subject is in a moving state. If an affirmative determination is made, the process returns to step S1, and after the AF process, the AE process, and the AWB process are executed again, the processes after step S10 are repeated. On the other hand, if a negative determination is made in step S70, the process returns to step S10. That is, the processes after step S10 are repeated without executing the AF process, the AE process, and the AWB process.

以上説明した本実施の形態によれば、以下のような作用効果を得ることができる。
(1)テンプレートマッチング部104aは、入力画像の各フレームと、複数のテンプレート画像とのテンプレートマッチングを行って、複数のテンプレート画像の中から入力画像の所定領域内の画像との類似度が最も高いテンプレート画像を選択テンプレートとして選択し、入力画像の所定領域を合致領域として抽出する。被写体追跡部104cは、テンプレートマッチング部104aによって抽出された合致領域内の画像について、フレーム間での動きを追跡することによって、複数フレームの画像間で被写体の動きを追跡する。被写体動静状態判定部104dは、テンプレートマッチング部104aによって、各テンプレート画像が選択された回数に基づいて、被写体が動状態にあるか静状態にあるかを判定する。これによって、被写体の動静状態を精度高く判定することができる。
According to the present embodiment described above, the following operational effects can be obtained.
(1) The template matching unit 104a performs template matching between each frame of the input image and a plurality of template images, and has the highest degree of similarity with an image in a predetermined region of the input image among the plurality of template images. A template image is selected as a selected template, and a predetermined area of the input image is extracted as a matching area. The subject tracking unit 104c tracks the movement of the subject between the images of a plurality of frames by tracking the movement between the frames in the matching region extracted by the template matching unit 104a. The subject moving state determination unit 104d determines whether the subject is in a moving state or a still state based on the number of times each template image is selected by the template matching unit 104a. This makes it possible to determine the moving state of the subject with high accuracy.

(2)複数のテンプレート画像としては、追跡対象とする被写体を異なる時刻に撮影した複数の画像のそれぞれから被写体を含む範囲内を抽出した画像を用いるようにした。これによって、被写体が動いた場合であっても、いずれかのテンプレート画像とマッチする可能性が高くなり、被写体追跡の精度を維持することができる。 (2) As the plurality of template images, images obtained by extracting the range including the subject from each of the plurality of images obtained by photographing the subject to be tracked at different times are used. As a result, even when the subject moves, the possibility of matching with any one of the template images increases, and the accuracy of subject tracking can be maintained.

(3)制御装置104は、被写体動静状態判定部104dによる判定結果に基づいて、被写体追跡中における自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理の実行タイミングを決定するようにした。これによって、被写体の動静状態に応じた最適なタイミングで自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理を実行することが可能になる。 (3) The control device 104 determines the execution timing of the automatic focus adjustment process, the automatic exposure adjustment process, and the automatic white balance adjustment process during subject tracking based on the determination result by the subject moving state determination unit 104d. . Accordingly, it is possible to execute the automatic focus adjustment process, the automatic exposure adjustment process, and the automatic white balance adjustment process at an optimal timing according to the moving state of the subject.

(4)制御装置104は、被写体追跡の開始時点(レリーズボタン半押し時)に自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理を実行し、被写体追跡中は、所定時間間隔で被写体動静状態判定部104dによる判定結果を監視するようにした。そして、制御装置104は、被写体が動状態であると判定された場合には、自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理を実行し、被写体が静状態であると判定された場合には、自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理の実行を停止するようにした。これによって、被写体の動きが少ない場合には、前回のAF処理、AE処理、およびAWB処理の結果を用いて撮影を行うことができるため、再度のAF処理、AE処理、およびAWB処理の実行を省くことができ、撮影処理を高速化することができる。また、CPUの負荷を低減することにより節電効果も期待できる。これに対して、被写体が動状態にあるときには、その都度、AF処理、AE処理、およびAWB処理を実行することによって、被写体の変化に応じた焦点調整、露出調整、およびホワイトバランス調整を行うことができる。 (4) The control device 104 performs automatic focus adjustment processing, automatic exposure adjustment processing, and automatic white balance adjustment processing at the start of subject tracking (when the release button is half-pressed). The determination result by the subject moving state determination unit 104d is monitored. When it is determined that the subject is in a moving state, the control device 104 performs an automatic focus adjustment process, an automatic exposure adjustment process, and an automatic white balance adjustment process, and determines that the subject is in a static state. In such a case, the execution of the automatic focus adjustment processing, automatic exposure adjustment processing, and automatic white balance adjustment processing is stopped. As a result, when the movement of the subject is small, it is possible to perform shooting using the results of the previous AF process, AE process, and AWB process, so that the AF process, AE process, and AWB process are executed again. This can save time and speed up the photographing process. In addition, a power saving effect can be expected by reducing the load on the CPU. On the other hand, when the subject is in a moving state, the focus adjustment, the exposure adjustment, and the white balance adjustment corresponding to the change of the subject are performed by executing the AF process, the AE process, and the AWB process each time. Can do.

―変形例―
なお、上述した実施の形態のカメラは、以下のように変形することもできる。
(1)上述した実施の形態では、制御装置104は、被写体動静状態判定部104dによる判定結果をスルー画表示中におけるAF処理、AE処理、およびAWB処理のタイミングを決定するために用いる例について説明した。しかしながら、被写体動静状態判定部104dによる判定結果を他の目的で使用するようにしてもよい。例えば、制御装置104は、上述した実施の形態と同様に、使用者によってレリーズボタンが半押しされたときに、AF処理、AE処理、およびAWB処理を実行する。そして、制御装置104は、使用者によってレリーズボタンが全押しされたときに、被写体動静状態判定部104dによる判定結果に基づいて、再度、AF処理、AE処理、およびAWB処理を実行する必要があるか否かを判定するようにしてもよい。
-Modification-
The camera according to the above-described embodiment can be modified as follows.
(1) In the embodiment described above, the control device 104 describes an example in which the determination result by the subject moving state determination unit 104d is used to determine the timing of AF processing, AE processing, and AWB processing during live view display. did. However, the determination result by the subject moving state determination unit 104d may be used for other purposes. For example, the control device 104 performs AF processing, AE processing, and AWB processing when the release button is half-pressed by the user, as in the above-described embodiment. Then, when the release button is fully pressed by the user, the control device 104 needs to execute the AF process, the AE process, and the AWB process again based on the determination result by the subject moving state determination unit 104d. It may be determined whether or not.

すなわち、制御装置104は、使用者によってレリーズボタンが全押しされた場合には、その時に入力されたフレームにおける被写体の動静状態に基づいて、AF処理、AE処理、およびAWB処理を実行するか否かを判定する。そして、被写体の状態が動状態であると判定した場合には、AF処理、AE処理、およびAWB処理を実行してから画像の取得を行ない、被写体の状態が静状態であると判定した場合には、AF処理、AE処理、およびAWB処理を実行せずに画像の取得を行なう。これによって、被写体が動いているときには、最新の被写体の状態に応じた焦点調整、露出調整、およびホワイトバランス調整を行うことができる。一方、被写体の動きが少ない場合には、画像取得時のAF処理、AE処理、およびAWB処理を省略して、レリーズタイムラグを短縮することができる。   That is, when the release button is fully pressed by the user, the control device 104 determines whether to execute the AF process, the AE process, and the AWB process based on the moving state of the subject in the frame input at that time. Determine whether. When it is determined that the subject is in a moving state, images are acquired after performing AF processing, AE processing, and AWB processing, and when it is determined that the subject is in a static state. Performs image acquisition without executing AF processing, AE processing, and AWB processing. Thus, when the subject is moving, focus adjustment, exposure adjustment, and white balance adjustment according to the latest subject state can be performed. On the other hand, when the movement of the subject is small, the release time lag can be shortened by omitting the AF processing, AE processing, and AWB processing at the time of image acquisition.

(2)上述した実施の形態では、被写体追跡装置としてカメラ100を使用する例について説明した。しかしながら、本発明は、撮影機能を備えた他の機器、例えばカメラ付き携帯電話やビデオカメラに適用することも可能である。 (2) In the above-described embodiment, the example in which the camera 100 is used as the subject tracking device has been described. However, the present invention can also be applied to other devices having a photographing function, such as a mobile phone with a camera and a video camera.

なお、本発明の特徴的な機能を損なわない限り、本発明は、上述した実施の形態における構成に何ら限定されない。また、上述の実施の形態と複数の変形例を組み合わせた構成としてもよい。   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.

カメラの一実施の形態の構成を示すブロック図である。It is a block diagram which shows the structure of one Embodiment of a camera. ターゲット画像およびテンプレート画像の具体例を示す図である。It is a figure which shows the specific example of a target image and a template image. 各テンプレート画像の選択回数の具体例を示す第1の図である。It is a 1st figure which shows the specific example of the frequency | count of selection of each template image. 各テンプレート画像の選択回数の具体例を示す第2の図である。It is a 2nd figure which shows the specific example of the frequency | count of selection of each template image. カメラ100の処理を示すフローチャート図である。FIG. 6 is a flowchart showing processing of the camera 100.

符号の説明Explanation of symbols

100 カメラ、101 入力スイッチ、102 レンズ、103 撮像素子、104 制御装置、104a テンプレートマッチング部、104b テンプレート更新部、104c 被写体追跡部、104d 被写体動静状態判定部、105 メモリカードスロット、106 モニタ DESCRIPTION OF SYMBOLS 100 Camera, 101 Input switch, 102 Lens, 103 Image sensor, 104 Control apparatus, 104a Template matching part, 104b Template update part, 104c Subject tracking part, 104d Subject moving state determination part, 105 Memory card slot, 106 Monitor

Claims (6)

時系列で入力される複数の入力画像間で被写体の動きを追跡するための被写体追跡プログラムであって、
コンピュータに、
前記入力画像と、複数のテンプレート画像とのテンプレートマッチングを行って、前記複数のテンプレート画像の中から前記入力画像の所定領域内の画像との類似度が最も高いテンプレート画像を選択テンプレートとして選択し、前記入力画像の前記所定領域を合致領域として抽出するテンプレートマッチング手順と、
前記テンプレートマッチング手順によって抽出された前記合致領域内の画像について、複数の前記入力画像間での動きを追跡することによって、複数の前記入力画像間で被写体の動きを追跡する被写体追跡手順と、
前記テンプレートマッチング手順によって、各テンプレート画像が前記選択テンプレート画像として選択された回数に基づいて、被写体が動状態にあるか静状態にあるかを判定する動静状態判定手順とを実行させるための被写体追跡プログラム。
A subject tracking program for tracking the movement of a subject between a plurality of input images input in time series,
On the computer,
Template matching between the input image and a plurality of template images is performed, and a template image having the highest similarity with an image in a predetermined area of the input image is selected as a selection template from the plurality of template images. A template matching procedure for extracting the predetermined area of the input image as a matching area;
A subject tracking procedure for tracking the motion of the subject between the plurality of input images by tracking the motion between the plurality of input images for the image in the matching region extracted by the template matching procedure;
Subject tracking for executing a moving / static state determination procedure for determining whether the subject is in a moving state or a static state based on the number of times each template image is selected as the selected template image by the template matching procedure. program.
請求項1に記載の被写体追跡プログラムにおいて、
前記複数のテンプレート画像は、追跡対象とする被写体を異なる時刻に撮影した複数の画像のそれぞれから被写体を含む範囲内を抽出した画像であることを特徴とする被写体追跡プログラム。
The subject tracking program according to claim 1,
The subject tracking program, wherein the plurality of template images are images obtained by extracting a range including a subject from a plurality of images obtained by photographing the subject to be tracked at different times.
請求項1または2に記載の被写体追跡プログラムにおいて、
前記動静状態判定手順による判定結果に基づいて、被写体追跡中における自動焦点調整処理、自動露出調整処理、および自動ホワイトバランス調整処理の実行タイミングを決定する制御手順をさらに備えることを特徴とする被写体追跡プログラム。
In the subject tracking program according to claim 1 or 2,
A subject tracking further comprising a control procedure for determining execution timing of an automatic focus adjustment process, an automatic exposure adjustment process, and an automatic white balance adjustment process during subject tracking based on a determination result obtained by the moving state determination procedure. program.
請求項3に記載の被写体追跡プログラムにおいて、
前記制御手順は、被写体追跡の開始時点に前記自動焦点調整処理、前記自動露出調整処理、および前記自動ホワイトバランス調整処理を実行し、被写体追跡中は、所定時間間隔で前記動静状態判定手順による判定結果を監視し、前記動静状態判定手順によって被写体が動状態であると判定された場合には、前記自動焦点調整処理、前記自動露出調整処理、および前記自動ホワイトバランス調整処理を実行し、前記動静状態判定手順によって被写体が静状態であると判定された場合には、前記自動焦点調整処理、前記自動露出調整処理、および前記自動ホワイトバランス調整処理の実行を停止することを特徴とする被写体追跡プログラム。
In the subject tracking program according to claim 3,
In the control procedure, the automatic focus adjustment process, the automatic exposure adjustment process, and the automatic white balance adjustment process are executed at the start of subject tracking. During the subject tracking, the determination by the moving state determination procedure is performed at predetermined time intervals. The result is monitored, and when the subject is determined to be in the moving state by the moving / static state determination procedure, the automatic focus adjustment processing, the automatic exposure adjustment processing, and the automatic white balance adjustment processing are executed, An object tracking program that stops execution of the automatic focus adjustment process, the automatic exposure adjustment process, and the automatic white balance adjustment process when it is determined by the state determination procedure that the object is still. .
請求項1〜4のいずれか一項に記載の被写体追跡プログラムを実行する実行手段を備えることを特徴とする被写体追跡装置。   An object tracking apparatus comprising execution means for executing the object tracking program according to claim 1. 画像を撮像する撮像手段と、
請求項1〜4のいずれか一項に記載の被写体追跡プログラムを実行する実行手段とを備え、
前記実行手段は、前記撮像手段で撮像され、時系列で入力される複数の入力画像間で被写体の動きを追跡して、被写体の動静状態を判定することを特徴とするカメラ。
An imaging means for capturing an image;
Execution means for executing the subject tracking program according to any one of claims 1 to 4,
The camera according to claim 1, wherein the execution means tracks the movement of the subject between a plurality of input images picked up by the imaging means and input in time series, and determines the moving state of the subject.
JP2008023529A 2008-02-04 2008-02-04 Subject tracing program, subject tracing device, and camera Pending JP2009188480A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008023529A JP2009188480A (en) 2008-02-04 2008-02-04 Subject tracing program, subject tracing device, and camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008023529A JP2009188480A (en) 2008-02-04 2008-02-04 Subject tracing program, subject tracing device, and camera

Publications (1)

Publication Number Publication Date
JP2009188480A true JP2009188480A (en) 2009-08-20

Family

ID=41071348

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008023529A Pending JP2009188480A (en) 2008-02-04 2008-02-04 Subject tracing program, subject tracing device, and camera

Country Status (1)

Country Link
JP (1) JP2009188480A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011130384A (en) * 2009-12-21 2011-06-30 Canon Inc Subject tracking apparatus and control method thereof
JP2013021726A (en) * 2012-10-18 2013-01-31 Canon Inc Subject tracking apparatus and control method thereof
JP2014203837A (en) * 2013-04-01 2014-10-27 株式会社ディスコ Key pattern detection method and alignment method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011130384A (en) * 2009-12-21 2011-06-30 Canon Inc Subject tracking apparatus and control method thereof
JP2013021726A (en) * 2012-10-18 2013-01-31 Canon Inc Subject tracking apparatus and control method thereof
JP2014203837A (en) * 2013-04-01 2014-10-27 株式会社ディスコ Key pattern detection method and alignment method

Similar Documents

Publication Publication Date Title
JP5018767B2 (en) Subject tracking program, subject tracking device, and camera
JP4961965B2 (en) Subject tracking program, subject tracking device, and camera
US8355048B2 (en) Subject tracking computer program product, subject tracking device and camera
JP5507014B2 (en) Moving object detection apparatus and method
EP2273450A2 (en) Target tracking apparatus, image tracking apparatus, methods of controlling operation of same, and digital camera
JP5699432B2 (en) Image processing device
JP6218378B2 (en) Image processing apparatus and image processing method
JP2011244046A (en) Imaging apparatus, image processing method, and program storage medium
JP2009141475A (en) Camera
JP2009111716A (en) Imaging apparatus, program and template generating method
JP2009213114A (en) Imaging device and program
JP5482148B2 (en) Autofocus adjustment circuit and imaging apparatus
JP2009188480A (en) Subject tracing program, subject tracing device, and camera
JP2011151482A (en) Imaging apparatus and method for controlling the same
JP2013190735A (en) Photographing instrument and control method for photographing instrument
JP6257186B2 (en) Imaging apparatus, imaging method, and program
JP2010062825A (en) Imaging device and method of controlling imaging
JP2011182341A (en) Imaging device and method of controlling imaging device
JP2010157792A (en) Photographed object tracing device
JP2009077321A (en) Image recording device and image recording processing method
US20220292692A1 (en) Image processing apparatus and method of processing image
JP2011071671A (en) Image recognition device and imaging apparatus
JP2008172368A (en) Imaging apparatus, control method thereof, program and storage medium
JP2018116723A (en) Image processing system
JP2015082801A (en) Image processing apparatus, imaging apparatus and image processing program