JP2020095673A - Image processing device, control method therefor, and image capturing device - Google Patents
Image processing device, control method therefor, and image capturing device Download PDFInfo
- Publication number
- JP2020095673A JP2020095673A JP2019119017A JP2019119017A JP2020095673A JP 2020095673 A JP2020095673 A JP 2020095673A JP 2019119017 A JP2019119017 A JP 2019119017A JP 2019119017 A JP2019119017 A JP 2019119017A JP 2020095673 A JP2020095673 A JP 2020095673A
- Authority
- JP
- Japan
- Prior art keywords
- image processing
- background
- motion
- cluster
- motion vector
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012545 processing Methods 0.000 title claims abstract description 116
- 238000000034 method Methods 0.000 title claims abstract description 67
- 239000013598 vector Substances 0.000 claims abstract description 270
- 238000001514 detection method Methods 0.000 claims description 90
- 238000004364 calculation method Methods 0.000 claims description 16
- 238000003384 imaging method Methods 0.000 claims description 13
- 230000008859 change Effects 0.000 claims description 9
- 230000003287 optical effect Effects 0.000 claims description 6
- 230000007423 decrease Effects 0.000 claims 1
- 230000008569 process Effects 0.000 description 33
- 238000010586 diagram Methods 0.000 description 11
- 230000006870 function Effects 0.000 description 7
- 238000006243 chemical reaction Methods 0.000 description 6
- 230000006835 compression Effects 0.000 description 3
- 238000007906 compression Methods 0.000 description 3
- 230000006837 decompression Effects 0.000 description 3
- 238000011156 evaluation Methods 0.000 description 3
- 238000009825 accumulation Methods 0.000 description 2
- 206010034719 Personality change Diseases 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000004091 panning Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Landscapes
- Studio Devices (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、画像処理装置およびその制御方法、ならびに撮像装置に関し、特に動体検出技術に関する。 The present invention relates to an image processing apparatus, a control method therefor, and an image pickup apparatus, and more particularly to a moving body detection technique.
動画のフレーム画像間の動きベクトルに基づいて、被写体の大局的な移動方向と逆方向に移動する被写体を検出する技術が知られている(特許文献1)。また、画面全体の動きと局所的な動きとの差異が大きい領域を主被写体の領域と判定する技術が知られている(特許文献2)。 There is known a technique of detecting a subject moving in a direction opposite to the general movement direction of the subject based on a motion vector between frame images of a moving image (Patent Document 1). In addition, a technique is known in which an area in which the difference between the entire screen movement and the local movement is large is determined as the area of the main subject (Patent Document 2).
特許文献1に記載の手法は、多数の移動体と逆方向に移動する移動体を、多数の移動体の移動方向を表す動きベクトルに対して角度差が所定値以上である動きベクトルに基づいて検出している。そのため、例えば移動体をパンニングしながら撮影する場合の様に、背景と被写体(移動体)とが同じ方向に異なる速さで移動するシーンを撮影した場合、特許文献1に記載の手法は背景と被写体とを分離することができない。 The method described in Patent Document 1 is based on a motion vector in which a moving body that moves in the opposite direction of a large number of moving bodies has an angle difference of a predetermined value or more with respect to a motion vector that represents the moving direction of the plurality of moving bodies. It is detecting. Therefore, for example, when shooting a scene in which a background and a subject (moving body) move in the same direction at different speeds, such as when shooting a moving body while panning, the method described in Patent Document 1 The subject cannot be separated.
一方、特許文献2では、画像全体の動きと、局所的な動きとの差異に差に基づいて主被写体を判定するため、背景と主被写体とが同じ方向に異なる速さで移動している場合でも主被写体を判別できる。しかしながら、ユーザが意図している主被写体は、画面全体の動きと差異の大きな動きを有する大きな被写体とはかぎらない。 On the other hand, in Patent Document 2, since the main subject is determined based on the difference between the movement of the entire image and the local movement, when the background and the main subject are moving in the same direction at different speeds. But the main subject can be identified. However, the main subject intended by the user is not limited to a large subject having a large difference from the movement of the entire screen.
本発明はこのような従来技術の課題に鑑みてなされたものであり、背景と同じ方向に移動する移動体を検出可能な画像処理装置およびその制御方法、ならびに撮像装置を提供することを目的の1つとする。 The present invention has been made in view of the problems of the related art described above, and an object of the present invention is to provide an image processing device capable of detecting a moving object that moves in the same direction as the background, a control method thereof, and an imaging device. One
上述の目的は、複数の画像間の複数の動きベクトルを検出する動きベクトル検出手段と、動きベクトルに基づいて、背景の動きを表す背景ベクトルを算出する算出手段と、複数の動きベクトルのそれぞれと背景ベクトルとのユークリッド距離の大きさに基づいて、複数の動きベクトルから動体の動きベクトルを検出する動体検出手段と、を有することを特徴とする画像処理装置によって達成される。 The above-described object is to provide a motion vector detecting means for detecting a plurality of motion vectors between a plurality of images, a calculating means for calculating a background vector representing a motion of a background based on the motion vector, and a plurality of motion vectors respectively. And a moving object detection unit that detects a motion vector of a moving object from a plurality of motion vectors based on the size of the Euclidean distance from the background vector.
本発明によれば、背景と同じ方向に移動する移動体を検出可能な画像処理装置およびその制御方法、ならびに撮像装置を提供することができる。 According to the present invention, it is possible to provide an image processing device capable of detecting a moving object that moves in the same direction as the background, a control method thereof, and an imaging device.
以下、添付図面を参照して、本発明をその例示的な実施形態に基づいて詳細に説明する。なお、説明する実施形態は単なる例示であり、本発明の範囲を限定するものではない。例えば、以下では本発明をデジタルカメラに適用した実施形態を説明する。しかし、デジタルカメラは本発明を適用可能な画像処理装置の一例にすぎない。本発明は任意の電子機器において実施可能である。このような電子機器には、デジタルカメラやデジタルビデオカメラといった撮像装置はもちろん、パーソナルコンピュータ、タブレット端末、携帯電話機、ゲーム機、ドライブレコーダ、ロボット、ドローンなどが含まれるが、これらに限定されない。なお、本発明には撮影機能は必須でなく、動画のように時系列で撮影された画像を取得可能な電子機器で実施可能である。 Hereinafter, the present invention will be described in detail based on exemplary embodiments thereof with reference to the accompanying drawings. The embodiments to be described are merely examples and do not limit the scope of the present invention. For example, an embodiment in which the present invention is applied to a digital camera will be described below. However, the digital camera is only an example of the image processing apparatus to which the present invention can be applied. The present invention can be implemented in any electronic device. Such electronic devices include, but are not limited to, personal computers, tablet terminals, mobile phones, game consoles, drive recorders, robots, drones, as well as imaging devices such as digital cameras and digital video cameras. Note that the image capturing function is not essential to the present invention, and can be implemented by an electronic device that can acquire images captured in time series such as a moving image.
(撮像装置の構成)
図1は第1実施形態に係るデジタルカメラ100の機能構成例を示すブロック図である。デジタルカメラ100は動画および静止画の撮影ならびに記録が可能である。デジタルカメラ100内の各機能ブロックは、バス160を介して互いに通信可能に接続されている。デジタルカメラ100の動作は、主制御部151が有する1つ以上のプログラマブルプロセッサが例えばROM155に記憶されているプログラムをRAM154に読み込んで実行し、各機能ブロックを制御することにより実現される。
(Structure of imaging device)
FIG. 1 is a block diagram showing a functional configuration example of the
撮影レンズ101(レンズユニット)は、固定1群レンズ102、ズームレンズ111、絞り103、固定3群レンズ121、フォーカスレンズ131、ズームモータ(ZM)112、絞りモータ(AM)104、およびフォーカスモータ(FM)132を有する。固定1群レンズ102、ズームレンズ111、絞り103、固定3群レンズ121、フォーカスレンズ131は撮影光学系を構成する。なお、便宜上レンズ102、111、121、131を1枚のレンズとして図示しているが、それぞれ複数のレンズで構成されてもよい。また、撮影レンズ101は撮像装置100から取り外し可能な交換レンズとして構成されてもよい。
The taking lens 101 (lens unit) includes a fixed
絞り制御部105は、主制御部151の命令にしたがって絞りモータ104の動作を制御し、絞り103の開口径を変更する。
ズーム制御部113は、主制御部151の命令にしたがってズームモータ112の動作を制御し、撮影レンズ101の焦点距離(画角)を変更する。
The
The
フォーカス制御部133は、例えば撮像素子141から得られる1対の焦点検出用信号の位相差に基づいて撮影レンズ101のデフォーカス量およびデフォーカス方向を算出する。そしてフォーカス制御部133は、デフォーカス量およびデフォーカス方向をフォーカスモータ132の駆動量および駆動方向に変換する。この駆動量および駆動方向に基づいてフォーカス制御部133はフォーカスモータ132の動作を制御し、フォーカスレンズ131を駆動することにより、撮影レンズ101の焦点状態を制御する。
The
このように、フォーカス制御部133は位相差検出方式の自動焦点検出(AF)を実施するが、フォーカス制御部133は撮像素子141から得られる画像信号のコントラスト評価値に基づくコントラスト検出方式のAFを実行してもよい。また、撮像素子141とは別個に設けたAFセンサから得られる焦点検出用信号を用いて位相差検出方式のAFを実行してもよい。なお、フォーカス制御部133におけるAF動作において、後述する画像処理部152が検出する主被写体の領域に焦点検出領域を設定することができる。
In this way, the
撮影レンズ101によって撮像素子141の結像面に形成される被写体像は、撮像素子141に配置された複数の画素のそれぞれが有する光電変換素子により電気信号(画像信号)に変換される。本実施形態では、撮像素子141に、水平方向にm、垂直方向にn(n,mは複数)の画素が行列状に配置されており、各画素には2つの光電変換素子(光電変換領域)が設けられている。撮像素子141からの信号読み出しは、主制御部151からの指示に従ってセンサ制御部143が制御する。
A subject image formed on the imaging surface of the
個々の画素が有する2つの光電変換領域を領域Aおよび領域Bと呼び、個々の画素の領域Aから読み出した画像信号群からなる画像をA画像、個々の画素の領域Bから読み出した画像信号群からなる画像をB画像と呼ぶ。また、A画像とB画像を画素単位で加算した画像をA+B画像と呼ぶ。A画像とB画像は視差画像対を形成する。表示や記録にはA+B画像を用いる。また、位相差検出方式のAFに用いる焦点検出用信号の生成や、距離マップの生成にはA画像とB画像を用いる。 The two photoelectric conversion areas of each pixel are called an area A and an area B, an image consisting of an image signal group read from the area A of each pixel is an A image, and an image signal group read from the area B of each pixel An image composed of is called a B image. An image obtained by adding the A image and the B image in pixel units is called an A+B image. The A image and the B image form a parallax image pair. A+B images are used for display and recording. Further, the A image and the B image are used for generating a focus detection signal used for AF of the phase difference detection method and for generating a distance map.
撮像素子141から読み出された画像信号は信号処理部142に供給される。信号処理部142は、画像信号にノイズ低減処理、A/D変換処理、自動利得制御処理などの信号処理を適用し、画像データとしてセンサ制御部143に出力する。センサ制御部143は信号処理部142から受信した画像データをRAM(ランダム・アクセス・メモリ)154に蓄積する。
The image signal read from the
RAM154に保存された画像データを記録する場合、主制御部151は画像データに例えば所定のヘッダを追加するなどして、記録形式に応じたデータファイルを生成する。この際、主制御部151は必要に応じて圧縮解凍部153で画像データを符号化し、符号化データをデータファイルに格納する。主制御部151は、生成したデータファイルを例えばメモリカードのような記録媒体157に記録する。
When recording the image data stored in the
また、RAM154に保存された画像データを表示する場合、主制御部151は表示部150での表示サイズに適合するように画像データを画像処理部152でスケーリングした後、RAM154のうちビデオメモリとして用いる領域(VRAM領域)に書き込む。表示部150は、RAM154のVRAM領域から表示用の画像データを読み出し、例えばLCDや有機ELディスプレイなどの表示装置に表示する。表示部150では、画像処理部152が検出した主被写体(動体)の検出結果(主被写体領域を示す枠など)も表示する。
When displaying the image data stored in the
デジタルカメラ100は、動画撮影時(撮影スタンバイ状態や動画記録中)に、撮影された動画を表示部150に即時表示することにより、表示部150を電子ビューファインダー(EVF)として機能させる。表示部150をEVFとして機能させる際に表示する動画およびそのフレーム画像を、ライブビュー画像もしくはスルー画像と呼ぶ。また、デジタルカメラ100は、静止画撮影を行った場合、撮影結果をユーザが確認できるように、直前に撮影した静止画を一定時間表示部150に表示する。これらの表示動作についても、主制御部151の制御によって実現される。
The
圧縮解凍部153は画像データを符号化したり復号したりする。例えば静止画や動画を記録する場合、予め定められた符号化方式によって画像データや音声データを符号化する。また、記録媒体157に記録された静止画データファイルや動画データファイルを再生する際、圧縮解凍部153は符号化データを復号してRAM154に格納する。
The compression/
RAM154はプログラムを実行するためのシステムメモリ、ビデオメモリ、バッファメモリなどとして用いられる。
ROM155は主制御部151のプロセッサが実行可能なプログラム、各種の設定値、デジタルカメラ100の固有情報、GUIデータなどを記憶する。ROM155は電気的に書き換え可能であってよい。
The
The
操作部156は、ユーザがデジタルカメラ100に指示を入力するためのスイッチ、ボタン、キー、タッチパネルなどの入力デバイス群の総称である。操作部156を通じた入力はバス160を通じて主制御部151が検知し、主制御部151は入力に応じた動作を実現するために各部を制御する。
The
主制御部151は例えばCPUやMPUなどのプログラマブルプロセッサを1つ以上有し、例えばROM155に記憶されたプログラムをRAM154に読み込んで実行することにより各部を制御し、デジタルカメラ100の機能を実現する。主制御部151はまた、被写体輝度の情報に基づいて露出条件(シャッタースピードもしくは蓄積時間、絞り値、感度)を自動的に決定するAE処理を実行する。被写体輝度の情報は例えば画像処理部152から取得することができる。主制御部151は、例えば人物の顔など、特定被写体の領域の輝度情報に基づいて露出条件を決定することもできる。
The
主制御部151は、動画撮影時には絞り103は固定とし、電子シャッタスピード(蓄積時間)とゲインの大きさで露出を制御する。主制御部151は決定した蓄積時間とゲインの大きさをセンサ制御部143に通知する。センサ制御部143は通知された露出条件に従った撮影が行われるように撮像素子141の動作を制御する。
The
距離マップ生成部161(距離検出手段)は、例えばRAM154に保存された画像データを用いて距離マップを生成する。距離マップは例えば画素の輝度値が被写体距離を表し、デプスマップ距離画像、奥行き画像などと呼ばれることもある。距離マップは公知の方法で生成することができる。例えば、距離マップ生成部161は、視差画像(上述したA画像およびB画像)の像ズレ量から各画素位置におけるデフォーカス量(フォーカスレンズの合焦位置からのズレ量およびズレの方向)を求めることができる。デフォーカス量は現在の被写体距離を基準としたピントのズレ量を表すので、デフォーカス量を距離情報と見なすことができる。もちろん、デフォーカス量に基づいてフォーカスレンズの合焦位置を求め、合焦位置に対応する被写体距離を求めてもよい。また、通常の撮像光学系においては像ズレ量とデフォーカス量は1対1に対応するため、像ズレ量の分布を距離マップとして、奥行きに応じた処理などを行うこともできる。なお、撮像装置100をステレオカメラのような多眼カメラとして視差画像を取得してもよいし、記憶媒体や外部装置から視差画像を取得してもよい。
The distance map generation unit 161 (distance detection means) generates a distance map using, for example, the image data stored in the
また、距離マップは視差画像を用いずに生成することもできる。コントラスト評価値が極大となるフォーカスレンズ位置を画素ごとに求めることで、画素ごとに被写体距離を取得することができる。また、合焦距離を変えて同一シーンを複数回撮影して得られる画像データと光学系の点像分布関数(PSF)とから、ぼけ量と距離との相関関係に基づいて画素ごとの距離情報を求めることもできる。距離マップ生成部161は、画像全体に対して距離マップを生成してもよいし、画像のうち、動体検出に必要な部分領域に対してだけ距離マップを生成してもよい。距離マップ生成部161は、生成した距離マップをRAM154に保存する。距離マップは画像処理部152から参照される。なお、距離マップ生成部161は、被写体距離を画素ごとに求める代わりに小領域(画素ブロック)ごとに求めて距離マップを生成してもよい。
In addition, the distance map can be generated without using the parallax image. By obtaining the focus lens position where the contrast evaluation value becomes maximum for each pixel, the subject distance can be obtained for each pixel. Also, from the image data obtained by shooting the same scene multiple times while changing the focusing distance and the point spread function (PSF) of the optical system, the distance information for each pixel based on the correlation between the blur amount and the distance. You can also ask. The distance
さらに、距離マップ生成部161は、距離マップに領域ごとに信頼度を算出し、距離マップとともに保存することができる。信頼度の算出方法には特に制限はない。例えば、視差画像を用いて距離マップを生成する際、視差画像間の像ズレ量を求めるために、相対的なシフト量を変えながら例えばSADなどの相関量(類似度)を演算し、相関が最大(相関量が最小)になるシフト量を像ズレ量として検出する。算出した相関量の平均値と最大値との差が大きい程、検出した像ズレ量(デフォーカス量)の信頼度は高いと考えられる。したがって、各画素位置で算出した相関量の平均値と最大値との差を、その画素位置信頼度として用いることができる。なお、距離マップ生成部161は、被写体距離やその信頼度を、画素ごとに求める代わりに小領域(画素ブロック)ごとに求めて距離マップを生成してもよい。
Further, the distance
動き検出部162は、例えばジャイロや加速度センサ、電子コンパスなどの姿勢センサにより構成され、デジタルカメラ100の位置や姿勢の変化を計測する。本実施形態では一例として、撮影レンズ101の光軸をロール軸とし、ロール軸に直交し、撮像素子の長手方向に平行な軸をピッチ軸、ロール軸とピッチ軸に直交する軸をヨー軸としたときのヨー軸およびピッチ軸周りの角速度を姿勢変化として検出する。動き検出部162は、検出した動きをRAM154に保存する。動き検出部162が検出した動きの情報は、画像処理部152から参照される。
The
画像処理部152は、RAM154に蓄積された画像データに対して予め定められた画像処理を適用する。画像処理部152が適用する画像処理には、ホワイトバランス調整処理、色補間(デモザイク)処理、ガンマ補正処理といった所謂現像処理のほか、信号形式変換処理、スケーリング処理などがあるが、これらに限定されない。さらに、画像処理部152は後述する動体検出処理を実行し、動体を主被写体として選択する。動体検出処理において画像処理部152は、距離マップ生成部161が生成した距離マップと動き検出部162が検出した動きを、動体情報に基づく主被写体の判別処理に用いることができる。
The
判別した主被写体の領域に関する情報を、他の画像処理(例えばホワイトバランス調整処理や被写体の輝度情報の生成処理など)に利用してもよい。なお、フォーカス制御部133がコントラスト検出方式のAFを行う場合、コントラスト評価値を画像処理部152が生成してフォーカス制御部133に供給することができる。画像処理部152は、処理した画像データや、主被写体の領域に関する情報などをRAM154に保存する。
The information regarding the determined area of the main subject may be used for other image processing (for example, white balance adjustment processing or subject luminance information generation processing). When the
(動体検出処理)
図2は、本実施形態における動体検出処理を説明するために、画像処理部152を動体検出処理に特化した機能ブロックによって表現した模式図である。図2に示す機能ブロックのそれぞれは、別個のハードウェア回路として実現されてもよいし、画像処理部152が有するプログラマブルプロセッサがメモリにプログラムを読み込んで実行することによって実現されてもよい。
(Motion detection process)
FIG. 2 is a schematic diagram in which the
図3は、画像処理部152が実施する動体検出処理のフローチャートである。
S201において画像入力部501は、撮影時刻が異なる2フレームの入力画像をRAM154から取得する。現フレームはセンサ制御部143から取得し、前フレーム(過去フレーム)はRAM154から取得してもよい。画像入力部501は、取得した入力画像を動きベクトル検出部502および顕著度算出部507に供給する。
FIG. 3 is a flowchart of the moving body detection process performed by the
In step S201, the
S202において動きベクトル検出部502は、画像入力部501から供給された2フレームの入力画像について、画像間の複数の動きベクトルを検出する。動きベクトルの検出は、任意の公知の手法を用いて実現することができるが、本実施形態では一例としてテンプレートマッチングを用いて動きベクトルを検出するものとする。
In S202, the motion
すなわち、動きベクトル検出部502は、2フレームの画像のうち、先に撮影された1フレームの画像(フレームt-1とする)を水平および垂直方向にそれぞれ複数分割して複数の部分画像を生成する。そして、動きベクトル検出部502は、各部分画像をテンプレート、後に撮影された1フレームの画像(フレームtとする)を参照画像としたテンプレートマッチングを実施し、部分画像と類似度が最も高い領域を参照画像内で探索する。そして、動きベクトル検出部502は、部分画像の中心点の座標を始点とし、探索により見つかった、部分画像と類似度が最も高い領域の中心点の座標を終点とするベクトルを、部分画像についての動きベクトルとする。このようにして、動きベクトル検出部502は、フレームt-1の部分画像ごとに動きベクトルを検出する。
That is, the motion
図4(a)はフレームt-1、図4(b)はフレームtの例を示す図であり、図4(b)にはテンプレートマッチングによって検出された動きベクトルのいくつかが矢印で示されている。フレームt-1上の点
S203においてクラスタリング部503は、S202において検出された動きベクトル群viをクラスタリングする。クラスタリングにはK-Means法や、Affinity Propagationなど、公知の任意のクラスタリング手法を用いることができる。図4(c)には、クラスタ数を自動決定可能なクラスタリング手法であるAffinity Propagationを用いたクラスタリング結果の例を示している。K-Means法のようなクラスタ数を自動決定出来ないクラスタリング手法を用いる場合には何らかの方法でクラスタ数を決定してからクラスタリングを実行する。
In S203, the
S204において、背景クラスタ選択部504は、S203におけるクラスタリングによって得られたクラスタ(図4(c))のうち、背景領域のベクトルから成る背景クラスタを選択する。背景クラスタの選択方法については後述する。背景クラスタ選択部504は、背景クラスタが存在しない場合や選択できない場合には、背景クラスタの選択結果を、背景クラスタ無しとする。背景クラスタ選択部504は、背景クラスタの選択結果を背景ベクトル算出部505に供給する。
In step S204, the background
S205において背景ベクトル算出部505は、背景クラスタが存在するか否かを判定し、背景クラスタが存在すると判定されればS206へ処理を進め、判定されなければ動体検出結果なしとして動体検出処理を終了する。背景ベクトル算出部505は、背景クラスタの選択結果が背景クラスタ無しだった場合は背景クラスタが存在しないと判定することができる。
In step S205, the background
S206において背景ベクトル算出部505は、背景クラスタ選択部504が選択した背景クラスタに属する動きベクトルから、背景の動きを表す背景ベクトルbを算出する。ここでは、一例として、背景クラスタに属する動きベクトルの平均ベクトルを背景ベクトルbとして算出するものとするが、これに限定されない。
In S206, the background
S207において動体選択部506は、動きベクトル検出部502が検出した全ての動きベクトルについて、S206で得られた背景ベクトルとのユークリッド距離を算出する。そして、動体選択部506は、算出したユークリッド距離が最大となる動きベクトルを選択する。具体的には、動きベクトルviと、背景ベクトルbとのユークリッド距離をdisti、選択される動きベクトルのインデックスをmとすると、以下の式(2)および(3)に従って動体選択部506は動きベクトルのインデックスmを決定する。
検出した動体検出位置は、撮像装置の動作を制御するために用いることができる。例えば、動体検出位置を含むように焦点検出領域の設定することで、動体検出位置に合焦するようにレンズユニットの焦点検出を制御することができる。また、動体検出位置が適正露出になる様に自動露出制御を行うことができる。 The detected moving body detection position can be used to control the operation of the imaging device. For example, by setting the focus detection area so as to include the moving body detection position, it is possible to control the focus detection of the lens unit so as to focus on the moving body detection position. Further, automatic exposure control can be performed so that the moving object detection position has a proper exposure.
(背景クラスタの選択処理例1)
ここで、S204で背景クラスタ選択部504が行う背景クラスタ選択処理の一例について図5のフローチャートを用いて説明する。この例において背景クラスタ選択部504は、クラスタを構成する動きベクトルの画像中における存在範囲が最大であるクラスタを背景クラスタとして選択する。これは、クラスタを構成する動きベクトルの検出位置の分布範囲が最も広いクラスタを背景クラスタとして選択すると言うこともできる。
(Background cluster selection processing example 1)
Here, an example of the background cluster selection processing performed by the background
S301において背景クラスタ選択部504は、クラスタリング部503が生成したクラスタのそれぞれについて、クラスタを構成する動きベクトルの、始点座標または終点座標の分散を算出する。背景クラスタ選択部504は、例えば座標のx座標についての分散と、y座標についての分散とを算出し、両者を加算することにより、座標の分散値を算出する。本実施形態において背景クラスタ選択部504は以下の式(4)に示すようにx座標の分散とy座標の分散を単純に加算してクラスタkの分散varkを算出するが、x座標の分散とy座標の分散を画像の縦横比に応じた重みで加算してもよい。
S302において背景クラスタ選択部504は、S301で算出した分散varkの最大値varKと、対応するクラスタKを選択し、例えば内部メモリに記憶する。
In S302, the background
S303において背景クラスタ選択部504は、S302で記憶した最大分散値varKが所定の閾値以上か否か判定し、閾値以上と判定されればS304へ、判定されなければS305へ処理を進める。
In S303, the background
S304において背景クラスタ選択部504は、S302で記憶した、最大分散値varKに対応するクラスタKを背景クラスタとして選択し、背景クラスタ選択処理を終了する。ここでは最大分散値varKに対応するクラスタKを背景クラスタとして選択した。
In S304, the background
S305において背景クラスタ選択部504は、背景クラスタなしと判定して背景クラスタ選択処理を終了する。
In step S305, the background
(背景クラスタの選択処理例2)
S204で背景クラスタ選択部504が行う背景クラスタ選択処理の別の例について図6のフローチャートを用いて説明する。この例において背景クラスタ選択部504は、デジタルカメラ100の動きに基づいて背景クラスタを選択する。デジタルカメラの動きを考慮することで、安定した背景クラスタの選択が実現できる。
(Background cluster selection processing example 2)
Another example of the background cluster selection processing performed by the background
S401において動き入力部508は、動き検出部162からデジタルカメラ100の動き情報(ここではヨー軸およびピッチ軸周りの角速度)を取得し、背景クラスタ選択部504に供給する。
In step S<b>401, the
S402において背景クラスタ選択部504は、動き入力部508から受け取った動き情報から背景の動き方向を推定する。本実施形態において背景クラスタ選択部504は、ヨー軸周りの角速度をyaw、ピッチ軸周りの角速度をpitchとした場合、背景の動き方向を
S403において背景クラスタ選択部504は、各クラスタのクラスタ中心ベクトルと、式(5)のgとがなす角度をそれぞれ算出する。ここで、クラスタ中心ベクトルとは、各クラスタを構成する動きベクトルviの代表ベクトルであり、例えば平均ベクトルであってよい。
In S403, the background
S404において背景クラスタ選択部504は、S403で算出した角度の最小値θKと、対応するクラスタKを選択し、例えば内部メモリに記憶する。
In S404, the background
S405において背景クラスタ選択部504は、S404で選択したθKが所定の閾値未満か否かを判定し、閾値未満と判定されればS406へ、判定されなければS407へ、処理を進める。
In step S405, the background
S406において背景クラスタ選択部504は、S404で選択したクラスタKを背景クラスタとして選択し、背景クラスタ選択処理を終了する。
In S406, the background
S407において背景クラスタ選択部504は、背景クラスタなしと判定して背景クラスタ選択処理を終了する。
In step S407, the background
(動体検出処理の別例1)
次に、S207における動体検出処理の別の例について説明する。本例において動体選択部506は、画像内の視覚的に目立った領域(顕著領域)に限定して動体検出処理を適用することで、より被写体らしい領域を選択することが可能となる。
(Another example 1 of moving object detection processing)
Next, another example of the moving body detection process in S207 will be described. In the present example, the moving
顕著度算出部507は、画像入力部501から供給されるフレームtについて、動きベクトル検出部502が検出した動きベクトルのそれぞれの終点座標eiにおける顕著度を算出する。顕著度算出部507は、例えばLaurent Itti, Christof Koch, and Ernst Niebur, ”A Model of Saliency-Based Visual Attention for Rapid Scene Analysis”, IEEE Transactions on Pattern Analysis and Machine Intelligence archive Volume 20 Issue 11, November 1998 Pages 1254-1259に記載の顕著度(saliency)など、公知の任意の顕著度算出方法を用いて顕著度を算出することができる。顕著度算出部507は、算出した顕著度を、動きベクトルに対応付けてRAM154に格納する。
The
S207において動体選択部506は、背景ベクトルbとのユークリッド距離を算出する動きベクトルを、所定の閾値以上の顕著度を持つ動きベクトルに限定する。これにより、動体検出を顕著領域に限定して適用することができる。
In S207, the moving
(動体検出処理の別例2)
次に、S207における動体検出処理のさらに別の例について説明する。本例において動体選択部506は、デジタルカメラ100に近い領域から優先的に動体検出を適用する。これにより、動体が複数存在する場合、手前にいる動体を優先して主被写体として検出することができる。
(Another example 2 of moving object detection processing)
Next, still another example of the moving body detection process in S207 will be described. In this example, the moving
距離マップ入力部509は、距離マップ生成部161がフレームtに対して生成した距離マップを取得し、動体選択部506に供給する。
The distance
S207において動体選択部506は、背景ベクトルbとのユークリッド距離を算出する動きベクトルを、その終点座標eiに対応する被写体距離が閾値未満である動きベクトルに限定する。これにより、動体検出をデジタルカメラ100に近い領域に限定して適用することができる。
In S207, the moving
あるいは、動体選択部506は、背景ベクトルbとのユークリッド距離が閾値以上である動きベクトルの中から、終点座標eiに対応する被写体距離が最小であるeiを動体検出位置としてもよい。
Alternatively, the moving
後者の例を図7を用いて説明する。図7(a)および(b)は、動体として人物と犬が含まれるフレーム画像を模式的に示している。いずれのフレーム画像についても、人物と犬に関する動きベクトルは背景ベクトルbとのユークリッド距離が閾値以上であり、動体の動きベクトルであると推測できるものとする。ユークリッド距離が閾値以上である動きベクトルの中から、終点座標eiに対応する被写体距離が最小であるeiを動体検出位置とする場合、図7(a)では人物の動きベクトル、図7(b)では犬の動きベクトルの終点が動体検出位置として選択される。 The latter example will be described with reference to FIG. 7A and 7B schematically show frame images in which a person and a dog are included as moving bodies. In any of the frame images, the motion vector relating to the person and the dog has the Euclidean distance from the background vector b equal to or greater than the threshold value, and it can be estimated that the motion vector is the motion vector of the moving body. When the moving object detection position is e i having the smallest subject distance corresponding to the end point coordinates e i among the motion vectors having the Euclidean distance equal to or greater than the threshold value, the motion vector of the person in FIG. In b), the end point of the motion vector of the dog is selected as the moving body detection position.
(背景ベクトル算出の別例)
上述の構成では、動きベクトルをクラスタリングして背景クラスタを選択し、背景クラスタを構成する動きベクトルから背景ベクトルbを算出した。しかし、デジタルカメラ100の動きと撮影レンズ101の焦点距離(画角)を用いて、クラスタリングを行わずに背景ベクトルを算出してもよい。これにより、動きベクトルのクラスタリングに係る演算負荷を除去することができる。また、背景領域に色変化が少なく動きベクトルを検出することが難しいシーンでこの手法が有用である。
(Another example of background vector calculation)
In the above configuration, the motion vector is clustered to select the background cluster, and the background vector b is calculated from the motion vector forming the background cluster. However, the background vector may be calculated without clustering using the movement of the
背景ベクトル算出部505は、フレームtを撮影した際の撮影レンズ101(撮影光学系)の焦点距離f[mm]をズーム制御部113を通じて取得する。また、動き入力部508は、動き検出部162からデジタルカメラ100の動き情報(ここではヨー軸およびピッチ軸周りの角速度)を取得し、背景ベクトル算出部505に供給する。
The background
背景ベクトル算出部505は以下の式(6)に従って背景ベクトルbを算出することができる。
背景ベクトル算出部505は、算出した背景ベクトルbを動体選択部506に供給する。動体選択部506の処理は上述した通りでよい。
The background
以上説明したように本実施形態によれば、個々の動きベクトルと背景ベクトルとのユークリッド距離に基づいて動体の動きベクトルを選択することにより、背景と同じ方向に移動する移動体であっても検出することができる。 As described above, according to the present embodiment, even if a moving object that moves in the same direction as the background is detected by selecting the motion vector of the moving object based on the Euclidean distance between each motion vector and the background vector. can do.
(第2実施形態)
次に、本発明の第2実施形態について説明する。本実施形態は動き情報を用いて主被写体を判別する際に、ユーザが意図している主被写体を確率よく判別する画像処理装置およびその制御方法に関する。以下では、第1実施形態と類似又は同様の構成や動作に関しては同じ参照数字を用い、重複する説明を省略する。
(Second embodiment)
Next, a second embodiment of the present invention will be described. The present embodiment relates to an image processing apparatus and a control method thereof that determine a main subject intended by a user with high probability when determining a main subject using motion information. In the following, the same reference numerals are used for the configurations and operations similar or similar to those of the first embodiment, and the duplicate description will be omitted.
図8は、本実施形態における動体検出処理を説明するために、画像処理部152を動体検出処理に特化した機能ブロックによって表現した模式図である。図8に示す機能ブロックのそれぞれは、別個のハードウェア回路として実現されてもよいし、画像処理部152が有するプログラマブルプロセッサがメモリにプログラムを読み込んで実行することによって実現されてもよい。
FIG. 8 is a schematic diagram in which the
画像入力部501は、撮影時刻が異なる2フレームの入力画像をRAM154から取得する。現フレームはセンサ制御部143から取得し、前フレーム(過去フレーム)はRAM154から取得してもよい。
The
動きベクトル検出部502は、画像入力部501が取得した入力画像間で複数の動きベクトルを検出する。動きベクトルの検出は、任意の公知の手法を用いて実現することができるが、本実施形態では一例としてテンプレートマッチングを用いて動きベクトルを検出するものとする。
The motion
クラスタリング部503は、動きベクトル検出部502で検出された複数の動きベクトルを、少なくとも以下の3つのクラスタに分類する。
・背景クラスタ:画像全体の動きベクトル(例えば撮像装置100の動きに基づくベクトル)
・主被写体クラスタ:前フレーム以前の主被写体に関する動きベクトル
・主被写体候補クラスタ:背景クラスタに属する動きベクトルとの距離が大きいベクトル(実空間で動きの大きいベクトル)
The
Background cluster: motion vector of the entire image (for example, a vector based on the motion of the image capturing apparatus 100)
-Main subject cluster: Motion vector related to main subject before previous frame-Main subject candidate cluster: Vector with large distance to motion vector belonging to background cluster (vector with large movement in real space)
これら少なくとも3つのクラスタに分類することで、動きに基づく主被写体判別処理において、現在の主被写体の動き情報を考慮した判別を実現できる。そのため、ユーザの意図する主被写体を正しく判別する確率を高めることができる。例えば、現在の主被写体が実空間で静止していれば、動きのある別の被写体を新たな主被写体として判別することが可能である。あるいは、現在の主被写体が実空間で動いていれば、別の動体が存在していても、主被写体の判別結果を変更しないようにすることも可能である。 By classifying these into at least three clusters, it is possible to realize the determination in consideration of the current movement information of the main subject in the main subject determination process based on the movement. Therefore, it is possible to increase the probability of correctly distinguishing the main subject intended by the user. For example, if the current main subject is still in the real space, another moving subject can be determined as a new main subject. Alternatively, if the current main subject is moving in the real space, it is possible not to change the determination result of the main subject even if another moving body exists.
主被写体判別部802では、クラスタリング部503によるクラスタリングの結果に基づいて、現フレーム内の主被写体領域を判別する。主被写体判別部802で判別された主被写体領域の情報は、例えば自動露出制御や自動焦点検出といった各種の処理に用いることができる。また、被写体追尾部801は、主被写体判別部802で判別された主被写体領域をテンプレートとしたマッチング処理により、次フレーム以降の入力画像中の主被写体領域を探索する被写体追尾処理を実行する。被写体追尾部801による被写体追尾結果(画像内の主被写体領域に関する情報)は、クラスタリング部503にも供給される。
The main
なお、動き情報に基づく主被写体判別処理には、画像入力部501が取得する入力画像以外に、撮像装置100で取得できる他の情報を用いてもよい。例えば、動き検出部162が検出した動きの情報を動き入力部508を通じてクラスタリング部503に入力し、背景クラスタの推定に用いることができる。また、距離マップ生成部161で得られる距離マップを距離マップ入力部509を通じて主被写体判別部802に入力し、主被写体判別処理に利用することができる。
In addition to the input image acquired by the
(主被写体判別処理)
図9は、画像処理部152が実施する主被写体判別処理のフローチャートである。
S901において画像入力部501は、撮影時刻が異なる2フレームの入力画像を取得する。
(動きベクトル検出)
S902において、動きベクトル検出部502は、画像入力部501が取得した2フレームの入力画像間で複数の動きベクトルを検出する。動きベクトル検出部502は、2フレームの画像のうち、先に撮影された1フレームの画像(フレームt-1とする)を水平および垂直方向にそれぞれ複数分割して複数の部分画像を生成する。そして、動きベクトル検出部502は、各部分画像をテンプレート、後に撮影された1フレームの画像(フレームtとする)を参照画像としたテンプレートマッチングを実施し、部分画像と類似度が最も高い領域を参照画像内で探索する。そして、動きベクトル検出部502は、部分画像の中心点の座標を始点とし、探索により見つかった、部分画像と類似度が最も高い領域の中心点の座標を終点とするベクトルを、部分画像についての動きベクトルとする。このようにして、動きベクトル検出部502は、第1実施形態と同様にしてフレームt-1の部分画像ごとに動きベクトルを検出する。そして、動きベクトル検出部502は、検出した動きベクトルviと、動きベクトルviの終点eiとを関連づけてRAM154に保存する。
(Main subject discrimination process)
FIG. 9 is a flowchart of the main subject determination process performed by the
In step S<b>901, the
(Motion vector detection)
In step S902, the motion
(クラスタリング)
S903からS906までは、クラスタリング部503よる、動きベクトルのクラスタリング処理に関する。
S903においてクラスタリング部503は、S902において検出された動きベクトル群viをクラスタリングする。クラスタリングは第1実施形態と同様にK-Means法や、Affinity Propagationなど、公知の任意のクラスタリング手法を用いることができる。
(Clustering)
S903 to S906 relate to motion vector clustering processing by the
In S903, the
現フレームの画像と、現フレームと前フレームとの間で検出された動きベクトルとを模式的に図10(a)に示す。そして、この動きベクトルを、クラスタ数を自動決定可能なクラスタリング手法であるAffinity Propagationを用いたクラスタリング結果の例を図10(c)に示す。K-Means法のようなクラスタ数を自動決定出来ないクラスタリング手法を用いる場合には何らかの方法でクラスタ数を決定してからクラスタリングを実行する。 The image of the current frame and the motion vector detected between the current frame and the previous frame are schematically shown in FIG. Then, FIG. 10C shows an example of a clustering result obtained by using Affinity Propagation, which is a clustering method capable of automatically determining the number of clusters, for this motion vector. When using a clustering method that cannot automatically determine the number of clusters such as the K-Means method, the number of clusters is determined by some method and then clustering is performed.
(背景クラスタの選択)
S904において、クラスタリング部503は、S903におけるクラスタリングによって得られたクラスタ(図10(c))のうち、背景領域のベクトルから成る背景クラスタを選択する(図10(d))。背景クラスタの選択は、第1実施形態で図5や図6を用いて説明した方法で行うことができる。
(Select background cluster)
In step S904, the
(主被写体クラスタの選択)
図9に戻り、S905においてクラスタリング部503は、S903で得られたクラスタのうち、主被写体領域のベクトルから構成される主被写体クラスタを選択する。主被写体領域は前フレーム以前で、主被写体判別部802によって判別されている。そして、被写体追尾部801は、例えば直近に判別された主被写体領域をテンプレートとしたテンプレートマッチングにより、画像入力部501が取得する現フレームの画像内で主被写体領域を探索する。
(Selection of main subject cluster)
Returning to FIG. 9, in step S<b>905, the
被写体追尾部801は具体的には現フレームの画像の部分領域と主被写体領域(テンプレート)との類似度を、部分領域の位置を変えながら順次算出することにより、テンプレートと最も類似度が高い領域を現フレームの画像内で探索する。類似度は例えば相関量であってよい。そして、被写体追尾部801は、最も類似度が高い部分領域の類似度が予め定められた閾値を超える場合に、その部分領域がテンプレートと同じ画像(すなわち、現フレームの画像における主被写体領域)であると判定する。
Specifically, the
図10(b)に、被写体追尾部801によって主被写体領域と判定された領域501を示す。クラスタリング部503は、被写体追尾部801から主被写体領域の情報を取得し、主被写体領域内に終点eiが含まれる動きベクトルを主被写体クラスタに割り当てる(図10(d))。なお、被写体追尾部801による被写体追尾結果が得られない場合、クラスタリング部503は例えばユーザが指定した画像領域を主被写体領域として用いてもよい。
FIG. 10B shows an
(主被写体候補クラスタの選択)
S906において、クラスタリング部503は、S903で得られたクラスタのうち、新たな主被写体領域の候補を示す動きベクトルから構成される主被写体候補クラスタを選択する。まずクラスタリング部503は、S905で選択した背景クラスタに属する動きベクトルから、背景の動きを表す背景ベクトルbを算出する。ここでは、第1実施形態の背景クラスタ選択部504がS206で行う処理と同様に、背景クラスタに属する動きベクトルの平均ベクトルを背景ベクトルbとして算出するものとする(図10(d))が、これに限定されない。
(Select main subject candidate cluster)
In step S906, the
そして、クラスタリング部503は、動きベクトル検出部502が検出した全ての動きベクトルについて、背景ベクトルbとのユークリッド距離を算出する。そして、クラスタリング部503は、算出したユークリッド距離が最大となる動きベクトルを選択する。この処理は、第1実施形態の動体選択部506がS207で行う処理と同様である。具体的には、クラスタリング部503は式(2)および(3)に従って動きベクトルのインデックスmを決定する。なお、ユークリッド距離が最大となる動きベクトルが複数検出されている場合、インデックスmも複数決定される。なお、distm(すなわち、背景ベクトルbと動きベクトルviとの最大のユークリッド距離)が所定の閾値未満である場合、クラスタリング部503は主被写体候補クラスタに割り当てる動きベクトルが存在しないと判定する。一方、distmが閾値以上であれば、クラスタリング部503は、動きベクトルvmを主被写体候補クラスタに割り当てる(図10(d))。
Then, the
(主被写体判別)
S907において主被写体判別部802は、背景、主被写体、および主被写体候補の3つのクラスタに属する動きベクトルに基づいて、主被写体を判別する。図11は、S907における主被写体判別処理の詳細に関するフローチャートである。
(Main subject discrimination)
In step S907, the main
S1101で主被写体判別部802は、主被写体クラスタに属する動きベクトルの代表ベクトル(例えば平均ベクトル)と、背景クラスタに属する動きベクトルの代表ベクトル(例えば背景ベクトルb)とのユークリッド距離を算出する。そして、主被写体判別部802は、算出したユークリッド距離が所定の閾値未満であるか否かを判定し、閾値未満(距離が小さい)と判定されればS1102へ、閾値未満と判定されなければS1104へ処理を進める。ここで、距離が閾値未満であることは、実空間での主被写体の動きが小さい状態を示す。なお、主被写体判別部802は、主被写体クラスタに属する動きベクトルが存在しない場合にはS1102へ、背景クラスタに属する動きベクトルが存在しない場合にはS1104へ、処理を進める。
In step S1101, the main
S1102で主被写体判別部802は、主被写体候補クラスタに所定の条件を満たす動きベクトルが存在するか否か判定し、存在すると判定されればS1103へ、判定されなければS1104へ処理を進める。なお、本実施形態では主被写体候補クラスタを構成する動きベクトルは1種類であるため、主被写体判別部802は、主被写体候補クラスタに属する動きベクトルが所定の条件を満たすか否かを判定してもよい。
In step S1102, the main
S1103で主被写体判別部802は、主被写体候補クラスタに属する動きベクトル(ここでは動きベクトルvm)を検出した現フレーム画像内の部分領域を、新たな主被写体領域と判別する。すなわち、主被写体判別部802は、主被写体を変更することを決定する。なお、主被写体候補クラスタに属する動きベクトルを検出した現フレーム画像内の部分領域が複数存在する場合、主被写体判別部802は、他の1つ以上の部分領域と隣接する部分領域群を主被写体領域と判別してもよい。
In step S1103, the main
ここで、S1102における所定の条件は、ユーザの意図する主被写体が、現在の主被写体よりも、主被写体候補クラスタに属する動きベクトルに対応する別の被写体である可能性が高いか否かを判定するための条件である。そして、所定の条件が満たされると判定される場合、主被写体判別部802は、ユーザの意図する主被写体が主被写体候補クラスタに属する動きベクトルに対応する別の被写体であると推定し、主被写体を変更する。そして、主被写体判別部802は、新たな主被写体領域の情報を被写体追尾部801に通知する。通知に応じて被写体追尾部801は、追尾処理に用いるテンプレートを、新たな主被写体領域に基づくテンプレートに更新する。
Here, the predetermined condition in S1102 determines whether or not the main subject intended by the user is more likely to be another subject corresponding to the motion vector belonging to the main subject candidate cluster than the current main subject. It is a condition for doing. Then, when it is determined that the predetermined condition is satisfied, the main
例えば、被写体を画面の中央に配置するためにデジタルカメラ100をフレーミングしている場合、その被写体はユーザが意図した主被写体である可能性が高い。主被写体候補クラスタに属する動きベクトルが画像中心に近づく方向の動きベクトルであることを所定の条件とすることで、別の被写体に対してこのようなカメラ操作が行われている場合に、主被写体領域を変更することができる。その結果、ユーザが意図した主被写体を確率よく判別することができる。
For example, when the
また、デジタルカメラ100に近づいている被写体は主被写体である可能性が高い。そのため、主被写体候補クラスタに属する動きベクトルが、デジタルカメラ100に近づく方向の動きベクトルであることを所定の条件とすることで、別の被写体がデジタルカメラ100に近づいている場合に、主被写体領域を変更することができる。この場合も、ユーザが意図した主被写体を確率よく判別することができる。
Also, the subject approaching the
なお、動きベクトルがカメラに近づく方向の動きベクトルであるか否かは、距離マップ入力部509が取得する距離マップを用いて判定することができる。デジタルカメラ100に近づく方向の動きベクトルは、別の被写体の距離が小さくなる方向の動きベクトルである。主被写体候補クラスタに属する動きベクトルの始点より終点の距離が小さい動きベクトルは、デジタルカメラ100に近づく方向の動きベクトルであると判定できる。
Whether or not the motion vector is a motion vector in the direction of approaching the camera can be determined using the distance map acquired by the distance
なお、ここで説明した所定の条件は単なる例示であり、主被写体候補クラスタに属する動きベクトルに対応する被写体が、ユーザの意図する主被写体である可能性が高いと判定するための他の任意の条件を定めることができる。また、所定の条件は複数存在してもよい。この場合、複数の条件の1つでも満たすと判定されれば主被写体領域を変更するようにしたり、複数の条件を全て満たすと判定されれば主被写体領域を変更するようにしたりすることができる。 The predetermined condition described here is merely an example, and any other arbitrary condition for determining that the subject corresponding to the motion vector belonging to the main subject candidate cluster is highly likely to be the main subject intended by the user. Conditions can be set. Moreover, a plurality of predetermined conditions may exist. In this case, the main subject area can be changed if it is determined that even one of the plurality of conditions is satisfied, or the main subject area can be changed if it is determined that all of the plurality of conditions are satisfied. ..
S1104で主被写体判別部802は、主被写体領域を維持する(変更しない)ことを決定する。例えば、主被写体クラスタに属する動きベクトルの代表ベクトルと、背景クラスタに属する動きベクトルの代表ベクトルとのユークリッド距離が閾値以上の場合には、主被写体が有意に移動していると考えられる。この場合には現在の主被写体を変更しない。また、移動している被写体が検出されない場合には、上述したdistmが閾値未満となり、主被写体候補クラスタに割り当てられる動きベクトルが存在しないため、現在の主被写体領域が維持される。
In step S1104, the main
以上説明したように、本実施形態では、フレーム間で検出した動きベクトルに基づいて主被写体を判別する際、現在の主被写体と別の被写体の動きベクトルを考慮するようにした。そして、別の被写体の動きベクトルから、例えばユーザが意図する主被写体が、現在の主被写体ではなく別の被写体であると想定される場合には、主被写体を変更するようにした。そのため、ユーザの意図にあった主被写体を判別できる可能性を高めることができる。 As described above, in the present embodiment, when determining the main subject based on the motion vector detected between the frames, the motion vector of the subject different from the current main subject is taken into consideration. Then, if it is assumed that the main subject intended by the user is not the current main subject but another subject from the motion vector of the different subject, the main subject is changed. Therefore, it is possible to increase the possibility that the main subject that is intended by the user can be identified.
なお、本実施形態では、主被写体候補クラスタを、背景ベクトルbとのユークリッド距離が最大の動きベクトルのみから構成されるクラスタとした。しかし、他の方法で主被写体候補クラスタを規定してもよい。例えば、主被写体候補クラスタを、背景ベクトルbとのユークリッド距離が最大の動きベクトルを含む、背景ベクトルbとのユークリッド距離が最大の動きベクトルと大きさおよび方向の差が閾値未満である動きベクトルから構成されるクラスタとしてもよい。 In the present embodiment, the main subject candidate cluster is a cluster composed only of motion vectors having the maximum Euclidean distance from the background vector b. However, the main subject candidate cluster may be defined by other methods. For example, a main subject candidate cluster is selected from a motion vector having a maximum Euclidean distance with the background vector b and a motion vector having a maximum Euclidean distance with the background vector b and a difference in size and direction less than a threshold value. It may be configured as a cluster.
また、S1101では、主被写体クラスタに属する動きベクトルの代表ベクトルと、背景クラスタに属する動きベクトルの代表ベクトルとのユークリッド距離が閾値未満の場合には処理をS1102に進めていた。しかし、ユークリッド距離が閾値未満の場合でも、距離マップに基づいて主被写体が近付いていると判定される場合には処理をS1102に進めずにS1104に進めてもよい。 In S1101, if the Euclidean distance between the representative vector of the motion vectors belonging to the main subject cluster and the representative vector of the motion vectors belonging to the background cluster is less than the threshold value, the process proceeds to S1102. However, even if the Euclidean distance is less than the threshold value, if it is determined that the main subject is approaching based on the distance map, the process may proceed to S1104 instead of S1102.
(その他の実施形態)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program. It can also be realized by the processing. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
また、上述の実施形態は本発明の理解を助けることを目的とした具体例に過ぎず、いかなる意味においても本発明を上述の実施形態に限定する意図はない。特許請求の範囲に規定される範囲に含まれる全ての実施形態は本発明に包含される。 Further, the above-described embodiments are merely specific examples for the purpose of helping understanding of the present invention, and are not intended to limit the present invention to the above-described embodiments in any sense. All embodiments that fall within the scope defined by the claims are included in the present invention.
100…撮像装置、101…レンズユニット、141…撮像素子、142…撮像信号処理部、143…撮像制御部、151…主制御部、152…画像処理部、154…RAM、155…ROM、161…距離マップ生成部、162…動き検出部
Claims (26)
前記動きベクトルに基づいて、背景の動きを表す背景ベクトルを算出する算出手段と、
前記複数の動きベクトルのそれぞれと前記背景ベクトルとのユークリッド距離の大きさに基づいて、前記複数の動きベクトルから動体の動きベクトルを検出する動体検出手段と、を有することを特徴とする画像処理装置。 Motion vector detection means for detecting a plurality of motion vectors between a plurality of images,
Calculating means for calculating a background vector representing the motion of the background based on the motion vector;
An image processing apparatus, comprising: a moving body detection unit that detects a motion vector of a moving body from the plurality of motion vectors based on the size of the Euclidean distance between each of the plurality of motion vectors and the background vector. ..
前記クラスタリング手段が生成したクラスタから、背景クラスタを選択する選択手段と、をさらに有し、
前記算出手段は、前記背景クラスタを構成する動きベクトルから前記背景ベクトルを算出することを特徴とする請求項1に記載の画像処理装置。 Clustering means for generating a cluster by clustering the plurality of motion vectors,
Further comprising a selection unit for selecting a background cluster from the clusters generated by the clustering unit,
The image processing apparatus according to claim 1, wherein the calculation unit calculates the background vector from a motion vector forming the background cluster.
前記算出手段は、前記動き検出手段が検出した前記画像処理装置の動きから背景の動き方向を推定し、
前記選択手段は、前記背景の動き方向を用いて、前記クラスタリング手段が生成したクラスタから前記背景クラスタを選択する、
ことを特徴とする請求項2に記載の画像処理装置。 Further comprising a motion detecting means for detecting a motion of the image processing device,
The calculation means estimates the movement direction of the background from the movement of the image processing device detected by the movement detection means,
The selecting means selects the background cluster from the clusters generated by the clustering means using the movement direction of the background,
The image processing device according to claim 2, wherein
前記複数の画像を撮影した撮影光学系の焦点距離および撮像素子の情報を取得する取得手段とをさらに有し、
前記算出手段は、前記画像処理装置の動きと、前記焦点距離と、前記撮像素子の情報と、前記複数の画像の撮影間隔とから、前記背景ベクトルを算出することを特徴とする請求項1に記載の画像処理装置。 Motion detecting means for detecting the motion of the image processing device;
Further comprising an acquisition unit that acquires information about the focal length of the imaging optical system that has captured the plurality of images and the image sensor,
The calculation unit calculates the background vector from the movement of the image processing device, the focal length, the information of the image sensor, and the shooting intervals of the plurality of images. The image processing device described.
前記動体検出手段は、前記複数の動きベクトルのうち、終点座標における画像の顕著度が閾値以上である動きベクトルから前記動体の動きベクトルを検出することを特徴とする請求項1から7のいずれか1項に記載の画像処理装置。 Further comprising a saliency calculating means for calculating the saliency of the image at the coordinates of the end point of the motion vector,
8. The moving body detection means detects the motion vector of the moving body from among the plurality of motion vectors, a motion vector in which the saliency of the image at the end point coordinates is equal to or more than a threshold value. The image processing device according to item 1.
前記動体検出手段は、前記複数の動きベクトルのうち、終点座標の画素位置における被写体距離が閾値未満である動きベクトルから前記動体の動きベクトルを検出する、
ことを特徴とする請求項1から7のいずれか1項に記載の画像処理装置。 A distance detecting means for detecting a subject distance at a pixel position,
The moving body detecting means detects a motion vector of the moving body from a motion vector whose subject distance at a pixel position of an end point coordinate is less than a threshold value among the plurality of motion vectors.
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記動体検出手段は、前記複数の動きベクトルのうち、前記ユークリッド距離が閾値以上である動きベクトルであり、かつ終点座標の画素位置における被写体距離が最小である動きベクトルを前記動体の動きベクトルとして検出する、
ことを特徴とする請求項1から7のいずれか1項に記載の画像処理装置。 A distance detecting means for detecting a subject distance at a pixel position,
The moving body detection means detects, as the motion vector of the moving body, a motion vector having the minimum Euclidean distance of a threshold value or more and a minimum object distance at the pixel position of the end point coordinate among the plurality of motion vectors. To do
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記複数の画像を撮影する撮像素子と、
前記画像処理装置が検出した動体の動きベクトルに基づいて焦点検出および/または露出制御を行う制御手段と、
を有することを特徴とする撮像装置。 The image processing apparatus according to claim 1,
An image sensor for capturing the plurality of images,
Control means for performing focus detection and/or exposure control based on the motion vector of the moving body detected by the image processing device;
An image pickup apparatus comprising:
前記複数の動きベクトルに基づいて、背景の動きを表す背景ベクトルを算出することと、
前記複数の動きベクトルのそれぞれと前記背景ベクトルとのユークリッド距離の大きさに基づいて、前記複数の動きベクトルから動体の動きベクトルを検出することと、を有することを特徴とする画像処理装置の制御方法。 Detecting multiple motion vectors between multiple images;
Calculating a background vector representing the motion of the background based on the plurality of motion vectors;
Detecting the motion vector of the moving object from the plurality of motion vectors based on the magnitude of the Euclidean distance between each of the plurality of motion vectors and the background vector. Method.
前記複数の動きベクトルに基づいて、主被写体の領域を判別する判別手段と、を有し、
前記判別手段は、
前記複数の動きベクトルのうち、現在の主被写体とは別の被写体に関する動きベクトルを検出し、
前記別の被写体に関する動きベクトルが予め定められた条件を満たす場合には、前記別の被写体を新たな主被写体として判別する、
ことを特徴とする画像処理装置。 Vector detection means for detecting a plurality of motion vectors between a plurality of images,
A discriminating means for discriminating an area of the main subject based on the plurality of motion vectors,
The discrimination means is
Of the plurality of motion vectors, a motion vector for a subject other than the current main subject is detected,
When the motion vector relating to the different subject satisfies a predetermined condition, the different subject is determined as a new main subject,
An image processing device characterized by the above.
前記複数の動きベクトルのうち、背景に関する動きベクトルを代表する背景ベクトルを算出し、
前記複数の動きベクトルのうち、前記背景ベクトルとの距離が閾値以上である動きベクトルを、前記別の被写体に関する動きベクトルとして検出する、
ことを特徴とする請求項14から16のいずれか1項に記載の画像処理装置。 The discrimination means is
Of the plurality of motion vectors, a background vector representing a motion vector related to the background is calculated,
Of the plurality of motion vectors, a motion vector whose distance from the background vector is equal to or greater than a threshold value is detected as a motion vector related to the different subject,
The image processing apparatus according to any one of claims 14 to 16, characterized in that.
前記判別手段は、
前記クラスタリング手段が生成したクラスタのうち、クラスタを構成する動きベクトルの検出位置の分布範囲が最も広いクラスタを背景クラスタとして選択し、
前記背景クラスタを構成する動きベクトルから前記背景ベクトルを算出する、
ことを特徴とする請求項17から19のいずれか1項に記載の画像処理装置。 Further comprising clustering means for clustering the plurality of motion vectors to generate a cluster,
The discrimination means is
Among the clusters generated by the clustering unit, a cluster having the widest distribution range of the detection positions of the motion vectors forming the cluster is selected as the background cluster,
Calculating the background vector from the motion vector forming the background cluster,
20. The image processing apparatus according to claim 17, wherein the image processing apparatus is an image processing apparatus.
前記判別手段は、
前記クラスタリング手段が生成したクラスタのうち、クラスタを構成する動きベクトルの始点または終点の座標の分散が最大であるクラスタを背景クラスタとして選択し、
前記背景クラスタを構成する動きベクトルから前記背景ベクトルを算出する、
ことを特徴とする請求項17から19のいずれか1項に記載の画像処理装置。 Further comprising clustering means for clustering the plurality of motion vectors to generate a cluster,
The discrimination means is
Of the clusters generated by the clustering unit, a cluster having the largest variance of the coordinates of the start point or the end point of the motion vector forming the cluster is selected as the background cluster,
Calculating the background vector from the motion vector forming the background cluster,
20. The image processing apparatus according to claim 17, wherein the image processing apparatus is an image processing apparatus.
前記画像処理装置の動きを検出する動き検出手段と、をさらに有し、
前記判別手段は、
前記動き検出手段が検出した前記画像処理装置の動きから背景の動き方向を推定し、
前記背景の動き方向を用いて、前記クラスタリング手段が生成したクラスタから背景クラスタを選択し、
前記背景クラスタを構成する動きベクトルから前記背景ベクトルを算出する、
ことを特徴とする請求項17から19のいずれか1項に記載の画像処理装置。 Clustering means for generating a cluster by clustering the plurality of motion vectors,
Further comprising a motion detecting means for detecting a motion of the image processing device,
The discrimination means is
Estimating the motion direction of the background from the motion of the image processing device detected by the motion detection means,
Using the background motion direction, select a background cluster from the clusters generated by the clustering means,
Calculating the background vector from the motion vector forming the background cluster,
20. The image processing apparatus according to claim 17, wherein the image processing apparatus is an image processing apparatus.
前記複数の画像を撮影する撮像素子と、
前記画像処理装置が検出した動体の動きベクトルに基づいて焦点検出および/または露出制御を行う制御手段と、
を有することを特徴とする撮像装置。 An image processing apparatus according to any one of claims 14 to 23,
An image sensor for capturing the plurality of images,
Control means for performing focus detection and/or exposure control based on the motion vector of the moving body detected by the image processing device;
An image pickup apparatus comprising:
前記複数の動きベクトルのうち、現在の主被写体とは別の被写体に関する動きベクトルを検出することと、
前記別の被写体に関する動きベクトルが予め定められた条件を満たす場合には、前記別の被写体を新たな主被写体として判別することと、
を有する画像処理装置の制御方法。 Detecting multiple motion vectors between multiple images;
Of the plurality of motion vectors, detecting a motion vector relating to a subject other than the current main subject,
When the motion vector relating to the different subject satisfies a predetermined condition, the different subject is discriminated as a new main subject, and
A method for controlling an image processing apparatus having the following.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/519,742 US11070729B2 (en) | 2018-07-27 | 2019-07-23 | Image processing apparatus capable of detecting moving objects, control method thereof, and image capture apparatus |
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018141635 | 2018-07-27 | ||
JP2018141635 | 2018-07-27 | ||
JP2018228321 | 2018-12-05 | ||
JP2018228321 | 2018-12-05 |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2020095673A true JP2020095673A (en) | 2020-06-18 |
JP2020095673A5 JP2020095673A5 (en) | 2022-07-04 |
JP7324066B2 JP7324066B2 (en) | 2023-08-09 |
Family
ID=71084987
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019119017A Active JP7324066B2 (en) | 2018-07-27 | 2019-06-26 | IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND IMAGING APPARATUS |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7324066B2 (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010258710A (en) * | 2009-04-23 | 2010-11-11 | Canon Inc | Motion vector detection apparatus, method for controlling the same, and image capturing apparatus |
JP2012160780A (en) * | 2011-01-28 | 2012-08-23 | Nikon Corp | Imaging device, image processing device, and image processing program |
JP2015161730A (en) * | 2014-02-26 | 2015-09-07 | キヤノン株式会社 | Image blur correction device, control method thereof, optical device, and imaging apparatus |
-
2019
- 2019-06-26 JP JP2019119017A patent/JP7324066B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010258710A (en) * | 2009-04-23 | 2010-11-11 | Canon Inc | Motion vector detection apparatus, method for controlling the same, and image capturing apparatus |
JP2012160780A (en) * | 2011-01-28 | 2012-08-23 | Nikon Corp | Imaging device, image processing device, and image processing program |
JP2015161730A (en) * | 2014-02-26 | 2015-09-07 | キヤノン株式会社 | Image blur correction device, control method thereof, optical device, and imaging apparatus |
Also Published As
Publication number | Publication date |
---|---|
JP7324066B2 (en) | 2023-08-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11070729B2 (en) | Image processing apparatus capable of detecting moving objects, control method thereof, and image capture apparatus | |
JP7223079B2 (en) | IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND IMAGING APPARATUS | |
JP2008141437A (en) | Imaging apparatus, image processor, image processing method for them, and program to make computer execute its method | |
US8400532B2 (en) | Digital image capturing device providing photographing composition and method thereof | |
JP2010114752A (en) | Device and method of imaging and program | |
JP2010114597A (en) | Motion vector detection apparatus, motion vector processing method and program | |
US10880457B2 (en) | Image processing apparatus, image capturing apparatus, image processing method, and storage medium | |
US20230148125A1 (en) | Image processing apparatus and method, and image capturing apparatus | |
JP2023033355A (en) | Image processing device and control method therefor | |
JP4716266B2 (en) | Image processing apparatus, imaging apparatus, and program thereof | |
US20190098215A1 (en) | Image blur correction device and control method | |
US20220277585A1 (en) | Image processing device and control method thereof, imaging apparatus, and recording medium | |
JP7324066B2 (en) | IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND IMAGING APPARATUS | |
JP2013179614A (en) | Imaging apparatus | |
JP7122916B2 (en) | IMAGING DEVICE AND CONTROL METHOD THEREOF, PROGRAM AND STORAGE MEDIUM | |
JP6063680B2 (en) | Image generation apparatus, image generation method, imaging apparatus, and imaging method | |
US10565712B2 (en) | Image processing apparatus and method for controlling the same | |
KR101272631B1 (en) | Apparatus for detecting a moving object and detecting method thereof | |
JP2010027000A (en) | Image detection device and image detection method | |
JP6525693B2 (en) | Image processing apparatus and image processing method | |
JP2021040178A (en) | Image processing apparatus, imaging apparatus, control method, and program | |
JP2022099120A (en) | Subject tracking device and control method for the same | |
JP2023106907A (en) | Image processing apparatus and method for controlling the same, imaging apparatus, and program | |
JP2022140058A (en) | Image processing apparatus and image processing method | |
JP2021190922A (en) | Imaging apparatus, control method therefor and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20210103 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210113 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220624 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20220624 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20230517 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20230526 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230614 |
|
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: 20230630 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230728 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 7324066 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |