JP7324066B2 - IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND IMAGING APPARATUS - Google Patents
IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND IMAGING APPARATUS Download PDFInfo
- Publication number
- JP7324066B2 JP7324066B2 JP2019119017A JP2019119017A JP7324066B2 JP 7324066 B2 JP7324066 B2 JP 7324066B2 JP 2019119017 A JP2019119017 A JP 2019119017A JP 2019119017 A JP2019119017 A JP 2019119017A JP 7324066 B2 JP7324066 B2 JP 7324066B2
- Authority
- JP
- Japan
- Prior art keywords
- motion
- background
- vector
- image processing
- motion vectors
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Image Analysis (AREA)
- Studio Devices (AREA)
Description
本発明は、画像処理装置およびその制御方法、ならびに撮像装置に関し、特に動体検出技術に関する。 The present invention relates to an image processing device, its control method, and an imaging device, and more particularly to a moving object detection technique.
動画のフレーム画像間の動きベクトルに基づいて、被写体の大局的な移動方向と逆方向に移動する被写体を検出する技術が知られている(特許文献1)。また、画面全体の動きと局所的な動きとの差異が大きい領域を主被写体の領域と判定する技術が知られている(特許文献2)。 A technique for detecting a subject moving in a direction opposite to the general moving direction of the subject based on a motion vector between frame images of a moving image is known (Patent Document 1). Also, there is known a technique of determining an area where there is a large difference between the movement of the entire screen and the local movement as the area of the main subject (Patent Document 2).
特許文献1に記載の手法は、多数の移動体と逆方向に移動する移動体を、多数の移動体の移動方向を表す動きベクトルに対して角度差が所定値以上である動きベクトルに基づいて検出している。そのため、例えば移動体をパンニングしながら撮影する場合の様に、背景と被写体(移動体)とが同じ方向に異なる速さで移動するシーンを撮影した場合、特許文献1に記載の手法は背景と被写体とを分離することができない。 The technique described in Japanese Patent Laid-Open No. 2002-200002 detects a moving object moving in the opposite direction to a large number of moving objects based on a motion vector whose angular difference is equal to or greater than a predetermined value with respect to the motion vector representing the moving direction of the large number of moving objects. Detecting. Therefore, when shooting a scene in which the background and the subject (moving object) move in the same direction at different speeds, such as when shooting a moving object while panning, the method described in Patent Document 1 can be used to It cannot be separated from the subject.
一方、特許文献2では、画像全体の動きと、局所的な動きとの差異に差に基づいて主被写体を判定するため、背景と主被写体とが同じ方向に異なる速さで移動している場合でも主被写体を判別できる。しかしながら、ユーザが意図している主被写体は、画面全体の動きと差異の大きな動きを有する大きな被写体とはかぎらない。 On the other hand, in Patent Document 2, since the main subject is determined based on the difference between the motion of the entire image and the difference between the local motion, the background and the main subject are moving in the same direction at different speeds. However, the main subject can be identified. However, the main subject intended by the user is not necessarily a large subject that has a large difference in motion from the motion of the entire screen.
本発明はこのような従来技術の課題に鑑みてなされたものであり、背景と同じ方向に移動する移動体を検出可能な画像処理装置およびその制御方法、ならびに撮像装置を提供することを目的の1つとする。 SUMMARY OF THE INVENTION The present invention has been made in view of such problems in the prior art, and an object of the present invention is to provide an image processing apparatus capable of detecting a moving object moving in the same direction as the background, a control method thereof, and an imaging apparatus. Let it be one.
上述の目的は、複数の画像間の複数の動きベクトルを検出する動きベクトル検出手段と、動きベクトルに基づいて、背景の動きを表す背景ベクトルを算出する算出手段と、複数の動きベクトルのそれぞれと背景ベクトルとのユークリッド距離の大きさに基づいて、複数の動きベクトルから動体の動きベクトルを検出する動体検出手段と、複数の動きベクトルをクラスタリングしてクラスタを生成するクラスタリング手段と、クラスタリング手段が生成したクラスタから、背景クラスタを選択する選択手段と、画像処理装置の動きを検出する動き検出手段と、を有し、算出手段は、背景クラスタを構成する動きベクトルから背景ベクトルを算出し、選択手段は、動き検出手段が検出した画像処理装置の動きから背景の動き方向を推定し、背景の動き方向を用いて、クラスタリング手段が生成したクラスタから背景クラスタを選択する、ことを特徴とする画像処理装置によって達成される。 The above objects are provided by motion vector detection means for detecting a plurality of motion vectors between a plurality of images, calculation means for calculating a background vector representing the motion of the background based on the motion vectors, and each of the plurality of motion vectors. A moving object detecting means for detecting a motion vector of a moving object from a plurality of motion vectors based on the magnitude of the Euclidean distance to a background vector; a clustering means for clustering the plurality of motion vectors to generate clusters; and a clustering means. selecting means for selecting a background cluster from the obtained clusters; motion detecting means for detecting motion of the image processing apparatus ; estimates the motion direction of the background from the motion of the image processing device detected by the motion detection means, and selects the background cluster from the clusters generated by the clustering means using the motion direction of the background. achieved by the device.
本発明によれば、背景と同じ方向に移動する移動体を検出可能な画像処理装置およびその制御方法、ならびに撮像装置を提供することができる。 ADVANTAGE OF THE INVENTION According to this invention, the image processing apparatus which can detect the moving body which moves in the same direction as a background, its control method, and an imaging device can be provided.
以下、添付図面を参照して、本発明をその例示的な実施形態に基づいて詳細に説明する。なお、説明する実施形態は単なる例示であり、本発明の範囲を限定するものではない。例えば、以下では本発明をデジタルカメラに適用した実施形態を説明する。しかし、デジタルカメラは本発明を適用可能な画像処理装置の一例にすぎない。本発明は任意の電子機器において実施可能である。このような電子機器には、デジタルカメラやデジタルビデオカメラといった撮像装置はもちろん、パーソナルコンピュータ、タブレット端末、携帯電話機、ゲーム機、ドライブレコーダ、ロボット、ドローンなどが含まれるが、これらに限定されない。なお、本発明には撮影機能は必須でなく、動画のように時系列で撮影された画像を取得可能な電子機器で実施可能である。 The invention will now be described in detail on the basis of its exemplary embodiments with reference to the accompanying drawings. It should be noted that the described embodiments 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, a digital camera is only one example of an image processing device 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, imaging devices such as digital cameras and digital video cameras, as well as personal computers, tablet terminals, mobile phones, game machines, drive recorders, robots, and drones. Note that the present invention does not require a photographing function, and can be implemented by an electronic device capable of acquiring images photographed in chronological order, such as moving images.
(撮像装置の構成)
図1は第1実施形態に係るデジタルカメラ100の機能構成例を示すブロック図である。デジタルカメラ100は動画および静止画の撮影ならびに記録が可能である。デジタルカメラ100内の各機能ブロックは、バス160を介して互いに通信可能に接続されている。デジタルカメラ100の動作は、主制御部151が有する1つ以上のプログラマブルプロセッサが例えばROM155に記憶されているプログラムをRAM154に読み込んで実行し、各機能ブロックを制御することにより実現される。
(Configuration of imaging device)
FIG. 1 is a block diagram showing an example functional configuration of a
撮影レンズ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 manner, the
撮影レンズ101によって撮像素子141の結像面に形成される被写体像は、撮像素子141に配置された複数の画素のそれぞれが有する光電変換素子により電気信号(画像信号)に変換される。本実施形態では、撮像素子141に、水平方向にm、垂直方向にn(n,mは複数)の画素が行列状に配置されており、各画素には2つの光電変換素子(光電変換領域)が設けられている。撮像素子141からの信号読み出しは、主制御部151からの指示に従ってセンサ制御部143が制御する。
A subject image formed on the imaging plane of the
個々の画素が有する2つの光電変換領域を領域Aおよび領域Bと呼び、個々の画素の領域Aから読み出した画像信号群からなる画像をA画像、個々の画素の領域Bから読み出した画像信号群からなる画像をB画像と呼ぶ。また、A画像とB画像を画素単位で加算した画像をA+B画像と呼ぶ。A画像とB画像は視差画像対を形成する。表示や記録にはA+B画像を用いる。また、位相差検出方式のAFに用いる焦点検出用信号の生成や、距離マップの生成にはA画像とB画像を用いる。 The two photoelectric conversion regions of each pixel are called region A and region B. An image composed of a group of image signals read out from region A of each pixel is called A image, and a group of image signals read out from region B of each pixel. is called a B-image. An image obtained by adding the A image and the B image pixel by pixel is called an A+B image. The A and B images form a parallax image pair. A+B images are used for display and recording. Further, the A image and the B image are used to generate a focus detection signal used in phase difference detection AF and to generate a distance map.
撮像素子141から読み出された画像信号は信号処理部142に供給される。信号処理部142は、画像信号にノイズ低減処理、A/D変換処理、自動利得制御処理などの信号処理を適用し、画像データとしてセンサ制御部143に出力する。センサ制御部143は信号処理部142から受信した画像データをRAM(ランダム・アクセス・メモリ)154に蓄積する。
An image signal read out 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に格納する。
A 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 generator 161 (distance detector) generates a distance map using image data stored in the
また、距離マップは視差画像を用いずに生成することもできる。コントラスト評価値が極大となるフォーカスレンズ位置を画素ごとに求めることで、画素ごとに被写体距離を取得することができる。また、合焦距離を変えて同一シーンを複数回撮影して得られる画像データと光学系の点像分布関数(PSF)とから、ぼけ量と距離との相関関係に基づいて画素ごとの距離情報を求めることもできる。距離マップ生成部161は、画像全体に対して距離マップを生成してもよいし、画像のうち、動体検出に必要な部分領域に対してだけ距離マップを生成してもよい。距離マップ生成部161は、生成した距離マップをRAM154に保存する。距離マップは画像処理部152から参照される。なお、距離マップ生成部161は、被写体距離を画素ごとに求める代わりに小領域(画素ブロック)ごとに求めて距離マップを生成してもよい。
Also, the distance map can be generated without using parallax images. By finding the focus lens position that maximizes the contrast evaluation value for each pixel, the subject distance can be obtained for each pixel. In addition, from the image data obtained by shooting the same scene multiple times with different focal distances and the point spread function (PSF) of the optical system, distance information for each pixel is calculated based on the correlation between the amount of blur and the distance. can also be asked for. The
さらに、距離マップ生成部161は、距離マップに領域ごとに信頼度を算出し、距離マップとともに保存することができる。信頼度の算出方法には特に制限はない。例えば、視差画像を用いて距離マップを生成する際、視差画像間の像ズレ量を求めるために、相対的なシフト量を変えながら例えばSADなどの相関量(類似度)を演算し、相関が最大(相関量が最小)になるシフト量を像ズレ量として検出する。算出した相関量の平均値と最大値との差が大きい程、検出した像ズレ量(デフォーカス量)の信頼度は高いと考えられる。したがって、各画素位置で算出した相関量の平均値と最大値との差を、その画素位置信頼度として用いることができる。なお、距離マップ生成部161は、被写体距離やその信頼度を、画素ごとに求める代わりに小領域(画素ブロック)ごとに求めて距離マップを生成してもよい。
Furthermore, the distance
動き検出部162は、例えばジャイロや加速度センサ、電子コンパスなどの姿勢センサにより構成され、デジタルカメラ100の位置や姿勢の変化を計測する。本実施形態では一例として、撮影レンズ101の光軸をロール軸とし、ロール軸に直交し、撮像素子の長手方向に平行な軸をピッチ軸、ロール軸とピッチ軸に直交する軸をヨー軸としたときのヨー軸およびピッチ軸周りの角速度を姿勢変化として検出する。動き検出部162は、検出した動きをRAM154に保存する。動き検出部162が検出した動きの情報は、画像処理部152から参照される。
The
画像処理部152は、RAM154に蓄積された画像データに対して予め定められた画像処理を適用する。画像処理部152が適用する画像処理には、ホワイトバランス調整処理、色補間(デモザイク)処理、ガンマ補正処理といった所謂現像処理のほか、信号形式変換処理、スケーリング処理などがあるが、これらに限定されない。さらに、画像処理部152は後述する動体検出処理を実行し、動体を主被写体として選択する。動体検出処理において画像処理部152は、距離マップ生成部161が生成した距離マップと動き検出部162が検出した動きを、動体情報に基づく主被写体の判別処理に用いることができる。
The
判別した主被写体の領域に関する情報を、他の画像処理(例えばホワイトバランス調整処理や被写体の輝度情報の生成処理など)に利用してもよい。なお、フォーカス制御部133がコントラスト検出方式のAFを行う場合、コントラスト評価値を画像処理部152が生成してフォーカス制御部133に供給することができる。画像処理部152は、処理した画像データや、主被写体の領域に関する情報などをRAM154に保存する。
Information related to the determined area of the main subject may be used for other image processing (for example, white balance adjustment processing, subject brightness information generation processing, etc.). When the
(動体検出処理)
図2は、本実施形態における動体検出処理を説明するために、画像処理部152を動体検出処理に特化した機能ブロックによって表現した模式図である。図2に示す機能ブロックのそれぞれは、別個のハードウェア回路として実現されてもよいし、画像処理部152が有するプログラマブルプロセッサがメモリにプログラムを読み込んで実行することによって実現されてもよい。
(Moving object detection processing)
FIG. 2 is a schematic diagram showing the
図3は、画像処理部152が実施する動体検出処理のフローチャートである。
S201において画像入力部501は、撮影時刻が異なる2フレームの入力画像をRAM154から取得する。現フレームはセンサ制御部143から取得し、前フレーム(過去フレーム)はRAM154から取得してもよい。画像入力部501は、取得した入力画像を動きベクトル検出部502および顕著度算出部507に供給する。
FIG. 3 is a flowchart of moving object detection processing performed by the
In S<b>201 , the
S202において動きベクトル検出部502は、画像入力部501から供給された2フレームの入力画像について、画像間の複数の動きベクトルを検出する。動きベクトルの検出は、任意の公知の手法を用いて実現することができるが、本実施形態では一例としてテンプレートマッチングを用いて動きベクトルを検出するものとする。
In S<b>202 , 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 S204, the background
S205において背景ベクトル算出部505は、背景クラスタが存在するか否かを判定し、背景クラスタが存在すると判定されればS206へ処理を進め、判定されなければ動体検出結果なしとして動体検出処理を終了する。背景ベクトル算出部505は、背景クラスタの選択結果が背景クラスタ無しだった場合は背景クラスタが存在しないと判定することができる。
In S205, the background
S206において背景ベクトル算出部505は、背景クラスタ選択部504が選択した背景クラスタに属する動きベクトルから、背景の動きを表す背景ベクトルbを算出する。ここでは、一例として、背景クラスタに属する動きベクトルの平均ベクトルを背景ベクトルbとして算出するものとするが、これに限定されない。
In S<b>206 , the background
S207において動体選択部506は、動きベクトル検出部502が検出した全ての動きベクトルについて、S206で得られた背景ベクトルとのユークリッド距離を算出する。そして、動体選択部506は、算出したユークリッド距離が最大となる動きベクトルを選択する。具体的には、動きベクトルviと、背景ベクトルbとのユークリッド距離をdisti、選択される動きベクトルのインデックスをmとすると、以下の式(2)および(3)に従って動体選択部506は動きベクトルのインデックスmを決定する。
検出した動体検出位置は、撮像装置の動作を制御するために用いることができる。例えば、動体検出位置を含むように焦点検出領域の設定することで、動体検出位置に合焦するようにレンズユニットの焦点検出を制御することができる。また、動体検出位置が適正露出になる様に自動露出制御を行うことができる。 The detected moving object 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 object detection position, it is possible to control the focus detection of the lens unit so as to focus on the moving object detection position. Also, automatic exposure control can be performed so that the moving object detection position is properly exposed.
(背景クラスタの選択処理例1)
ここで、S204で背景クラスタ選択部504が行う背景クラスタ選択処理の一例について図5のフローチャートを用いて説明する。この例において背景クラスタ選択部504は、クラスタを構成する動きベクトルの画像中における存在範囲が最大であるクラスタを背景クラスタとして選択する。これは、クラスタを構成する動きベクトルの検出位置の分布範囲が最も広いクラスタを背景クラスタとして選択すると言うこともできる。
(Background cluster selection process example 1)
Here, an example of the background cluster selection process 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 S305, the background
(背景クラスタの選択処理例2)
S204で背景クラスタ選択部504が行う背景クラスタ選択処理の別の例について図6のフローチャートを用いて説明する。この例において背景クラスタ選択部504は、デジタルカメラ100の動きに基づいて背景クラスタを選択する。デジタルカメラの動きを考慮することで、安定した背景クラスタの選択が実現できる。
(Background cluster selection process example 2)
Another example of the background cluster selection process performed by the background
S401において動き入力部508は、動き検出部162からデジタルカメラ100の動き情報(ここではヨー軸およびピッチ軸周りの角速度)を取得し、背景クラスタ選択部504に供給する。
In 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 S405, the background
S406において背景クラスタ選択部504は、S404で選択したクラスタKを背景クラスタとして選択し、背景クラスタ選択処理を終了する。
In S406, the background
S407において背景クラスタ選択部504は、背景クラスタなしと判定して背景クラスタ選択処理を終了する。
In S407, the background
(動体検出処理の別例1)
次に、S207における動体検出処理の別の例について説明する。本例において動体選択部506は、画像内の視覚的に目立った領域(顕著領域)に限定して動体検出処理を適用することで、より被写体らしい領域を選択することが可能となる。
(Another example 1 of moving object detection processing)
Next, another example of the moving object detection process in S207 will be described. In this 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 object detection processing 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. FIGS. 7A and 7B schematically show frame images containing a person and a dog as moving objects. For any frame image, 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, and can be assumed to be the motion vector of a moving object. Among the motion vectors whose Euclidean distance is equal to or greater than the threshold, e i with the smallest object distance corresponding to the end point coordinates e i is used as the moving object detection position. In b) the end point of the dog's motion vector is selected as the motion detection position.
(背景ベクトル算出の別例)
上述の構成では、動きベクトルをクラスタリングして背景クラスタを選択し、背景クラスタを構成する動きベクトルから背景ベクトルbを算出した。しかし、デジタルカメラ100の動きと撮影レンズ101の焦点距離(画角)を用いて、クラスタリングを行わずに背景ベクトルを算出してもよい。これにより、動きベクトルのクラスタリングに係る演算負荷を除去することができる。また、背景領域に色変化が少なく動きベクトルを検出することが難しいシーンでこの手法が有用である。
(another example of background vector calculation)
In the above configuration, motion vectors are clustered to select a background cluster, and the background vector b is calculated from the motion vectors forming the background cluster. However, 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 this embodiment, even a moving object moving 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 invention will be described. The present embodiment relates to an image processing apparatus and a control method thereof for discriminating a main subject intended by a user with high probability when discriminating a main subject using motion information. Below, the same reference numerals are used for configurations and operations that are similar or similar to those of the first embodiment, and overlapping descriptions are omitted.
図8は、本実施形態における動体検出処理を説明するために、画像処理部152を動体検出処理に特化した機能ブロックによって表現した模式図である。図8に示す機能ブロックのそれぞれは、別個のハードウェア回路として実現されてもよいし、画像処理部152が有するプログラマブルプロセッサがメモリにプログラムを読み込んで実行することによって実現されてもよい。
FIG. 8 is a schematic diagram showing the
画像入力部501は、撮影時刻が異なる2フレームの入力画像をRAM154から取得する。現フレームはセンサ制御部143から取得し、前フレーム(過去フレーム)はRAM154から取得してもよい。
The
動きベクトル検出部502は、画像入力部501が取得した入力画像間で複数の動きベクトルを検出する。動きベクトルの検出は、任意の公知の手法を用いて実現することができるが、本実施形態では一例としてテンプレートマッチングを用いて動きベクトルを検出するものとする。
A motion
クラスタリング部503は、動きベクトル検出部502で検出された複数の動きベクトルを、少なくとも以下の3つのクラスタに分類する。
・背景クラスタ:画像全体の動きベクトル(例えば撮像装置100の動きに基づくベクトル)
・主被写体クラスタ:前フレーム以前の主被写体に関する動きベクトル
・主被写体候補クラスタ:背景クラスタに属する動きベクトルとの距離が大きいベクトル(実空間で動きの大きいベクトル)
A
- Background cluster: a motion vector of the entire image (for example, a vector based on the motion of the imaging device 100)
・Main subject cluster: motion vector related to the main subject in the previous frame ・Main subject candidate cluster: vector with a large distance from the motion vector belonging to the background cluster (vector with large motion in real space)
これら少なくとも3つのクラスタに分類することで、動きに基づく主被写体判別処理において、現在の主被写体の動き情報を考慮した判別を実現できる。そのため、ユーザの意図する主被写体を正しく判別する確率を高めることができる。例えば、現在の主被写体が実空間で静止していれば、動きのある別の被写体を新たな主被写体として判別することが可能である。あるいは、現在の主被写体が実空間で動いていれば、別の動体が存在していても、主被写体の判別結果を変更しないようにすることも可能である。 By classifying into at least these three clusters, it is possible to realize determination that considers the current motion information of the main subject in main subject determination processing based on motion. Therefore, it is possible to increase the probability of correctly determining the main subject intended by the user. For example, if the current main subject is stationary in real space, it is possible to determine another moving subject as the new main subject. Alternatively, if the current main subject is moving in real space, it is possible not to change the determination result of the main subject even if another moving object exists.
主被写体判別部802では、クラスタリング部503によるクラスタリングの結果に基づいて、現フレーム内の主被写体領域を判別する。主被写体判別部802で判別された主被写体領域の情報は、例えば自動露出制御や自動焦点検出といった各種の処理に用いることができる。また、被写体追尾部801は、主被写体判別部802で判別された主被写体領域をテンプレートとしたマッチング処理により、次フレーム以降の入力画像中の主被写体領域を探索する被写体追尾処理を実行する。被写体追尾部801による被写体追尾結果(画像内の主被写体領域に関する情報)は、クラスタリング部503にも供給される。
A 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 processing)
FIG. 9 is a flowchart of main subject determination processing performed by the
In S901, the
(Motion vector detection)
In S<b>902 , the motion
(クラスタリング)
S903からS906までは、クラスタリング部503よる、動きベクトルのクラスタリング処理に関する。
S903においてクラスタリング部503は、S902において検出された動きベクトル群viをクラスタリングする。クラスタリングは第1実施形態と同様にK-Means法や、Affinity Propagationなど、公知の任意のクラスタリング手法を用いることができる。
(Clustering)
S 903 to S 906 relate to clustering processing of motion vectors by the
In S903, the
現フレームの画像と、現フレームと前フレームとの間で検出された動きベクトルとを模式的に図10(a)に示す。そして、この動きベクトルを、クラスタ数を自動決定可能なクラスタリング手法であるAffinity Propagationを用いたクラスタリング結果の例を図10(c)に示す。K-Means法のようなクラスタ数を自動決定出来ないクラスタリング手法を用いる場合には何らかの方法でクラスタ数を決定してからクラスタリングを実行する。 FIG. 10A schematically shows an image of the current frame and motion vectors detected between the current frame and the previous frame. FIG. 10(c) shows an example of clustering results using Affinity Propagation, which is a clustering method capable of automatically determining the number of clusters, for these motion vectors. When using a clustering method such as the K-Means method that cannot automatically determine the number of clusters, clustering is performed after determining the number of clusters by some method.
(背景クラスタの選択)
S904において、クラスタリング部503は、S903におけるクラスタリングによって得られたクラスタ(図10(c))のうち、背景領域のベクトルから成る背景クラスタを選択する(図10(d))。背景クラスタの選択は、第1実施形態で図5や図6を用いて説明した方法で行うことができる。
(select background cluster)
In S904, the
(主被写体クラスタの選択)
図9に戻り、S905においてクラスタリング部503は、S903で得られたクラスタのうち、主被写体領域のベクトルから構成される主被写体クラスタを選択する。主被写体領域は前フレーム以前で、主被写体判別部802によって判別されている。そして、被写体追尾部801は、例えば直近に判別された主被写体領域をテンプレートとしたテンプレートマッチングにより、画像入力部501が取得する現フレームの画像内で主被写体領域を探索する。
(Selection of main subject cluster)
Returning to FIG. 9, in S905, 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))が、これに限定されない。
(Selection of main subject candidate cluster)
In S906, the
そして、クラスタリング部503は、動きベクトル検出部502が検出した全ての動きベクトルについて、背景ベクトルbとのユークリッド距離を算出する。そして、クラスタリング部503は、算出したユークリッド距離が最大となる動きベクトルを選択する。この処理は、第1実施形態の動体選択部506がS207で行う処理と同様である。具体的には、クラスタリング部503は式(2)および(3)に従って動きベクトルのインデックスmを決定する。なお、ユークリッド距離が最大となる動きベクトルが複数検出されている場合、インデックスmも複数決定される。なお、distm(すなわち、背景ベクトルbと動きベクトルviとの最大のユークリッド距離)が所定の閾値未満である場合、クラスタリング部503は主被写体候補クラスタに割り当てる動きベクトルが存在しないと判定する。一方、distmが閾値以上であれば、クラスタリング部503は、動きベクトルvmを主被写体候補クラスタに割り当てる(図10(d))。
The
(主被写体判別)
S907において主被写体判別部802は、背景、主被写体、および主被写体候補の3つのクラスタに属する動きベクトルに基づいて、主被写体を判別する。図11は、S907における主被写体判別処理の詳細に関するフローチャートである。
(Main subject discrimination)
In S907, the main
S1101で主被写体判別部802は、主被写体クラスタに属する動きベクトルの代表ベクトル(例えば平均ベクトル)と、背景クラスタに属する動きベクトルの代表ベクトル(例えば背景ベクトルb)とのユークリッド距離を算出する。そして、主被写体判別部802は、算出したユークリッド距離が所定の閾値未満であるか否かを判定し、閾値未満(距離が小さい)と判定されればS1102へ、閾値未満と判定されなければS1104へ処理を進める。ここで、距離が閾値未満であることは、実空間での主被写体の動きが小さい状態を示す。なお、主被写体判別部802は、主被写体クラスタに属する動きベクトルが存在しない場合にはS1102へ、背景クラスタに属する動きベクトルが存在しない場合にはS1104へ、処理を進める。
In S1101, the main
S1102で主被写体判別部802は、主被写体候補クラスタに所定の条件を満たす動きベクトルが存在するか否か判定し、存在すると判定されればS1103へ、判定されなければS1104へ処理を進める。なお、本実施形態では主被写体候補クラスタを構成する動きベクトルは1種類であるため、主被写体判別部802は、主被写体候補クラスタに属する動きベクトルが所定の条件を満たすか否かを判定してもよい。
In S1102, the main
S1103で主被写体判別部802は、主被写体候補クラスタに属する動きベクトル(ここでは動きベクトルvm)を検出した現フレーム画像内の部分領域を、新たな主被写体領域と判別する。すなわち、主被写体判別部802は、主被写体を変更することを決定する。なお、主被写体候補クラスタに属する動きベクトルを検出した現フレーム画像内の部分領域が複数存在する場合、主被写体判別部802は、他の1つ以上の部分領域と隣接する部分領域群を主被写体領域と判別してもよい。
In S1103, the main
ここで、S1102における所定の条件は、ユーザの意図する主被写体が、現在の主被写体よりも、主被写体候補クラスタに属する動きベクトルに対応する別の被写体である可能性が高いか否かを判定するための条件である。そして、所定の条件が満たされると判定される場合、主被写体判別部802は、ユーザの意図する主被写体が主被写体候補クラスタに属する動きベクトルに対応する別の被写体であると推定し、主被写体を変更する。そして、主被写体判別部802は、新たな主被写体領域の情報を被写体追尾部801に通知する。通知に応じて被写体追尾部801は、追尾処理に用いるテンプレートを、新たな主被写体領域に基づくテンプレートに更新する。
Here, the predetermined condition in S1102 is to determine 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 Then, when it is determined that the predetermined condition is satisfied, the main
例えば、被写体を画面の中央に配置するためにデジタルカメラ100をフレーミングしている場合、その被写体はユーザが意図した主被写体である可能性が高い。主被写体候補クラスタに属する動きベクトルが画像中心に近づく方向の動きベクトルであることを所定の条件とすることで、別の被写体に対してこのようなカメラ操作が行われている場合に、主被写体領域を変更することができる。その結果、ユーザが意図した主被写体を確率よく判別することができる。
For example, when framing the
また、デジタルカメラ100に近づいている被写体は主被写体である可能性が高い。そのため、主被写体候補クラスタに属する動きベクトルが、デジタルカメラ100に近づく方向の動きベクトルであることを所定の条件とすることで、別の被写体がデジタルカメラ100に近づいている場合に、主被写体領域を変更することができる。この場合も、ユーザが意図した主被写体を確率よく判別することができる。
Also, there is a high possibility that the subject approaching the
なお、動きベクトルがカメラに近づく方向の動きベクトルであるか否かは、距離マップ入力部509が取得する距離マップを用いて判定することができる。デジタルカメラ100に近づく方向の動きベクトルは、別の被写体の距離が小さくなる方向の動きベクトルである。主被写体候補クラスタに属する動きベクトルの始点より終点の距離が小さい動きベクトルは、デジタルカメラ100に近づく方向の動きベクトルであると判定できる。
It should be noted that whether or not the motion vector is in the direction of approaching the camera can be determined using the distance map acquired by the distance
なお、ここで説明した所定の条件は単なる例示であり、主被写体候補クラスタに属する動きベクトルに対応する被写体が、ユーザの意図する主被写体である可能性が高いと判定するための他の任意の条件を定めることができる。また、所定の条件は複数存在してもよい。この場合、複数の条件の1つでも満たすと判定されれば主被写体領域を変更するようにしたり、複数の条件を全て満たすと判定されれば主被写体領域を変更するようにしたりすることができる。 Note that the predetermined condition described here is merely an example, and any other condition for determining that the subject corresponding to the motion vector belonging to the main subject candidate cluster is likely to be the main subject intended by the user. You can set the conditions. Also, a plurality of predetermined conditions may exist. In this case, it is possible to change the main subject area if it is determined that even one of a plurality of conditions is satisfied, or to change the main subject area if it is determined that all of the plurality of conditions are satisfied. .
S1104で主被写体判別部802は、主被写体領域を維持する(変更しない)ことを決定する。例えば、主被写体クラスタに属する動きベクトルの代表ベクトルと、背景クラスタに属する動きベクトルの代表ベクトルとのユークリッド距離が閾値以上の場合には、主被写体が有意に移動していると考えられる。この場合には現在の主被写体を変更しない。また、移動している被写体が検出されない場合には、上述したdistmが閾値未満となり、主被写体候補クラスタに割り当てられる動きベクトルが存在しないため、現在の主被写体領域が維持される。
In S1104, the main
以上説明したように、本実施形態では、フレーム間で検出した動きベクトルに基づいて主被写体を判別する際、現在の主被写体と別の被写体の動きベクトルを考慮するようにした。そして、別の被写体の動きベクトルから、例えばユーザが意図する主被写体が、現在の主被写体ではなく別の被写体であると想定される場合には、主被写体を変更するようにした。そのため、ユーザの意図にあった主被写体を判別できる可能性を高めることができる。 As described above, in this embodiment, when the main subject is determined based on the motion vector detected between frames, the motion vector of the current main subject and another subject is taken into consideration. Then, for example, when 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 another subject, the main subject is changed. Therefore, it is possible to increase the possibility of determining the main subject that matches the user's intention.
なお、本実施形態では、主被写体候補クラスタを、背景ベクトルbとのユークリッド距離が最大の動きベクトルのみから構成されるクラスタとした。しかし、他の方法で主被写体候補クラスタを規定してもよい。例えば、主被写体候補クラスタを、背景ベクトルbとのユークリッド距離が最大の動きベクトルを含む、背景ベクトルbとのユークリッド距離が最大の動きベクトルと大きさおよび方向の差が閾値未満である動きベクトルから構成されるクラスタとしてもよい。 In this 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, other methods may be used to define the main subject candidate clusters. For example, main subject candidate clusters are selected from motion vectors having the largest Euclidean distance from the background vector b and the difference in magnitude and direction from the motion vector having the largest Euclidean distance from the background vector b. It may be a configured cluster.
また、S1101では、主被写体クラスタに属する動きベクトルの代表ベクトルと、背景クラスタに属する動きベクトルの代表ベクトルとのユークリッド距離が閾値未満の場合には処理をS1102に進めていた。しかし、ユークリッド距離が閾値未満の場合でも、距離マップに基づいて主被写体が近付いていると判定される場合には処理をS1102に進めずにS1104に進めてもよい。 Also, 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, the process proceeds to S1102. However, even if the Euclidean distance is less than the threshold, if it is determined that the main subject is approaching based on the distance map, the process may proceed to S1104 without proceeding to 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 the computer of the system or apparatus reads and executes the program. It can also be realized by processing to It can also be implemented by a circuit (for example, ASIC) that implements one or more functions.
また、上述の実施形態は本発明の理解を助けることを目的とした具体例に過ぎず、いかなる意味においても本発明を上述の実施形態に限定する意図はない。特許請求の範囲に規定される範囲に含まれる全ての実施形態は本発明に包含される。 Moreover, 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 falling 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…動き検出部
DESCRIPTION OF
Claims (19)
複数の画像間の複数の動きベクトルを検出する動きベクトル検出手段と、
前記動きベクトルに基づいて、背景の動きを表す背景ベクトルを算出する算出手段と、
前記複数の動きベクトルのそれぞれと前記背景ベクトルとのユークリッド距離の大きさに基づいて、前記複数の動きベクトルから動体の動きベクトルを検出する動体検出手段と、
前記複数の動きベクトルをクラスタリングしてクラスタを生成するクラスタリング手段と、
前記クラスタリング手段が生成したクラスタから、背景クラスタを選択する選択手段と、
前記画像処理装置の動きを検出する動き検出手段と、を有し、
前記算出手段は、前記背景クラスタを構成する動きベクトルから前記背景ベクトルを算出し、
前記選択手段は、前記動き検出手段が検出した前記画像処理装置の動きから背景の動き方向を推定し、前記背景の動き方向を用いて、前記クラスタリング手段が生成したクラスタから前記背景クラスタを選択する、
ことを特徴とする画像処理装置。 An image processing device,
motion vector detection means for detecting a plurality of motion vectors between a plurality of images;
calculation means for calculating a background vector representing the motion of the background based on the motion vector;
moving object detection means for detecting a motion vector of a moving object from the plurality of motion vectors based on the Euclidean distance between each of the plurality of motion vectors and the background vector;
clustering means for clustering the plurality of motion vectors to generate clusters;
a selection means for selecting a background cluster from the clusters generated by the clustering means;
and motion detection means for detecting motion of the image processing device,
The calculation means calculates the background vector from motion vectors forming the background cluster ,
The selecting means estimates the direction of motion of the background from the motion of the image processing device detected by the motion detecting means, and selects the background cluster from the clusters generated by the clustering means using the direction of motion of the background. ,
An image processing apparatus characterized by:
前記画像処理装置の動きを検出する動き検出手段と、
複数の画像間の複数の動きベクトルを検出する動きベクトル検出手段と、
前記複数の画像を撮影した撮影光学系の焦点距離および撮像素子の情報を取得する取得手段と、
前記画像処理装置の動きと、前記焦点距離と、前記撮像素子の情報と、前記複数の画像の撮影間隔とから、背景の動きを表す背景ベクトルを算出する算出手段と、
前記複数の動きベクトルのそれぞれと前記背景ベクトルとのユークリッド距離の大きさに基づいて、前記複数の動きベクトルから動体の動きベクトルを検出する動体検出手段と、
を有することを特徴とする画像処理装置。 An image processing device,
motion detection means for detecting motion of the image processing device;
motion vector detection means for detecting a plurality of motion vectors between a plurality of images;
Acquisition means for acquiring information about the focal length of the imaging optical system and the imaging device that captured the plurality of images;
a calculation means for calculating a background vector representing the movement of the background from the movement of the image processing device, the focal length, the information of the image sensor, and the photographing intervals of the plurality of images;
moving object detection means for detecting a motion vector of a moving object from the plurality of motion vectors based on the Euclidean distance between each of the plurality of motion vectors and the background vector;
An image processing device comprising :
前記動体検出手段は、前記複数の動きベクトルのうち、終点座標における画像の顕著度が閾値以上である動きベクトルから前記動体の動きベクトルを検出することを特徴とする請求項1または2に記載の画像処理装置。 further comprising saliency calculation means for calculating the salience of the image at the end point coordinates of the motion vector;
3. The moving object detection means according to claim 1, wherein said moving object detection means detects the motion vector of said moving object from among said plurality of motion vectors, the motion vectors whose saliency of the image at the coordinates of the end point is equal to or greater than a threshold. Image processing device.
前記動体検出手段は、前記複数の動きベクトルのうち、終点座標の画素位置における被写体距離が閾値未満である動きベクトルから前記動体の動きベクトルを検出する、
ことを特徴とする請求項1または2に記載の画像処理装置。 further comprising distance detection means for detecting a subject distance at a pixel position;
The moving object detection means detects the motion vector of the moving object from among the plurality of motion vectors, the motion vector of which the subject distance at the pixel position of the end point coordinates is less than a threshold.
3. The image processing apparatus according to claim 1, wherein:
前記動体検出手段は、前記複数の動きベクトルのうち、前記ユークリッド距離が閾値以上である動きベクトルであり、かつ終点座標の画素位置における被写体距離が最小である動きベクトルを前記動体の動きベクトルとして検出する、
ことを特徴とする請求項1または2に記載の画像処理装置。 further comprising distance detection means for detecting a subject distance at a pixel position;
The moving object detection means detects, from among the plurality of motion vectors, a motion vector having the Euclidean distance equal to or greater than a threshold and having a minimum object distance at a pixel position of end point coordinates as the motion vector of the moving object. do,
3. The image processing apparatus according to claim 1, wherein:
前記複数の画像を撮影する撮像素子と、
前記画像処理装置が検出した動体の動きベクトルに基づいて焦点検出および/または露出制御を行う制御手段と、
を有することを特徴とする撮像装置。 An image processing device according to any one of claims 1 to 5;
an imaging device that captures the plurality of images;
a control means for performing focus detection and/or exposure control based on the motion vector of the moving object detected by the image processing device;
An imaging device characterized by comprising:
複数の画像間の複数の動きベクトルを検出することと、
前記複数の動きベクトルに基づいて、背景の動きを表す背景ベクトルを算出することと、
前記複数の動きベクトルのそれぞれと前記背景ベクトルとのユークリッド距離の大きさに基づいて、前記複数の動きベクトルから動体の動きベクトルを検出することと、
前記複数の動きベクトルをクラスタリングしてクラスタを生成することと、
前記クラスタから、背景クラスタを選択することと、
前記画像処理装置の動きを検出することと、を有し、
前記算出することは、前記背景クラスタを構成する動きベクトルから前記背景ベクトルを算出することを含み、
前記選択することは、
前記画像処理装置の動きから背景の動き方向を推定することと、
前記背景の動き方向を用いて、前記クラスタから前記背景クラスタを選択することとを含む、
ことを特徴とする画像処理装置の制御方法。 A control method for an image processing device,
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 a motion vector of a 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;
clustering the plurality of motion vectors to generate clusters;
selecting a background cluster from the clusters;
detecting motion of the image processing device;
the calculating includes calculating the background vector from motion vectors that make up the background cluster;
Said selecting is
estimating the motion direction of the background from the motion of the image processing device;
selecting the background cluster from the clusters using the background motion direction;
A control method for an image processing apparatus, characterized by:
前記画像処理装置の動きを検出することと、
複数の画像間の複数の動きベクトルを検出することと、
前記複数の画像を撮影した撮影光学系の焦点距離および撮像素子の情報を取得することと、
前記画像処理装置の動きと、前記焦点距離と、前記撮像素子の情報と、前記複数の画像の撮影間隔とから、背景の動きを表す背景ベクトルを算出することと、
前記複数の動きベクトルのそれぞれと前記背景ベクトルとのユークリッド距離の大きさに基づいて、前記複数の動きベクトルから動体の動きベクトルを検出することと、
を有することを特徴とする画像処理装置の制御方法。 A control method for an image processing device,
detecting motion of the image processing device;
detecting multiple motion vectors between multiple images;
Acquiring information about the focal length of the imaging optical system and the imaging device that captured the plurality of images;
calculating a background vector representing the movement of the background from the movement of the image processing device, the focal length, the information of the imaging element, and the photographing intervals of the plurality of images;
Detecting a motion vector of a 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;
A control method for an image processing device, comprising :
前記複数の動きベクトルに基づいて、主被写体の領域を判別する判別手段と、を有し、
前記判別手段は、
前記複数の動きベクトルのうち、現在の主被写体とは別の被写体に関する動きベクトルを検出し、
前記複数の動きベクトルのうち、背景に関する動きベクトルを代表する背景ベクトルを算出し、
前記複数の動きベクトルのうち、前記背景ベクトルとのユークリッド距離の大きさが閾値以上である動きベクトルを、前記別の被写体に関する動きベクトルとして検出し、
前記別の被写体を新たな主被写体として判別する、
ことを特徴とする画像処理装置。 vector detection means for detecting a plurality of motion vectors between a plurality of images;
determining means for determining an area of the main subject based on the plurality of motion vectors;
The determination means is
Detecting a motion vector related to a subject other than the current main subject from among the plurality of motion vectors;
calculating a background vector representative of the motion vectors relating to the background among the plurality of motion vectors;
Detecting, from among the plurality of motion vectors, a motion vector having a Euclidean distance to the background vector equal to or greater than a threshold value as a motion vector relating to the another subject;
determining the another subject as a new main subject;
An image processing apparatus characterized by:
前記判別手段は、
前記クラスタリング手段が生成したクラスタのうち、クラスタを構成する動きベクトルの検出位置の分布範囲が最も広いクラスタを背景クラスタとして選択し、
前記背景クラスタを構成する動きベクトルから前記背景ベクトルを算出する、
ことを特徴とする請求項10から12のいずれか1項に記載の画像処理装置。 further comprising clustering means for clustering the plurality of motion vectors to generate clusters;
The determination means is
Selecting, from among the clusters generated by the clustering means, a cluster having the widest distribution range of detection positions of motion vectors constituting the cluster as a background cluster;
calculating the background vector from the motion vectors that make up the background cluster;
13. The image processing apparatus according to any one of claims 10 to 12, characterized by:
前記判別手段は、
前記クラスタリング手段が生成したクラスタのうち、クラスタを構成する動きベクトルの始点または終点の座標の分散が最大であるクラスタを背景クラスタとして選択し、
前記背景クラスタを構成する動きベクトルから前記背景ベクトルを算出する、
ことを特徴とする請求項10から12のいずれか1項に記載の画像処理装置。 further comprising clustering means for clustering the plurality of motion vectors to generate clusters;
The determination means is
Selecting, from among the clusters generated by the clustering means, a cluster having the largest variance of the coordinates of the start point or the end point of the motion vectors forming the cluster as a background cluster;
calculating the background vector from the motion vectors that make up the background cluster;
13. The image processing apparatus according to any one of claims 10 to 12, characterized by:
前記画像処理装置の動きを検出する動き検出手段と、をさらに有し、
前記判別手段は、
前記動き検出手段が検出した前記画像処理装置の動きから背景の動き方向を推定し、
前記背景の動き方向を用いて、前記クラスタリング手段が生成したクラスタから背景クラスタを選択し、
前記背景クラスタを構成する動きベクトルから前記背景ベクトルを算出する、
ことを特徴とする請求項10から12のいずれか1項に記載の画像処理装置。 clustering means for clustering the plurality of motion vectors to generate clusters;
and motion detection means for detecting motion of the image processing device,
The determination means is
estimating the motion direction of the background from the motion of the image processing device detected by the motion detection means;
selecting a background cluster from the clusters generated by the clustering means using the motion direction of the background;
calculating the background vector from the motion vectors that make up the background cluster;
13. The image processing apparatus according to any one of claims 10 to 12, characterized by:
前記複数の画像を撮影する撮像素子と、
前記画像処理装置が検出した動体の動きベクトルに基づいて焦点検出および/または露出制御を行う制御手段と、
を有することを特徴とする撮像装置。 an image processing device according to any one of claims 10 to 16;
an imaging device that captures the plurality of images;
a control means for performing focus detection and/or exposure control based on the motion vector of the moving object detected by the image processing device;
An imaging device characterized by comprising:
前記複数の動きベクトルに基づいて、主被写体の領域を判別することと、を有し、
前記判別することは、
前記複数の動きベクトルのうち、現在の主被写体とは別の被写体に関する動きベクトルを検出することと、
前記複数の動きベクトルのうち、背景に関する動きベクトルを代表する背景ベクトルを算出することと、
前記複数の動きベクトルのうち、前記背景ベクトルとのユークリッド距離の大きさが閾値以上である動きベクトルを、前記別の被写体に関する動きベクトルとして検出し、前記別の被写体を新たな主被写体として判別することと、を含む
ことを特徴とする画像処理装置の制御方法。 detecting multiple motion vectors between multiple images;
determining a region of a main subject based on the plurality of motion vectors;
The determining is
Detecting a motion vector related to a subject other than the current main subject among the plurality of motion vectors;
Calculating a background vector representing a motion vector related to the background among the plurality of motion vectors;
Among the plurality of motion vectors, a motion vector having a magnitude of Euclidean distance to the background vector equal to or greater than a threshold is detected as a motion vector related to the another subject, and the another subject is determined as a new main subject. A control method for an image processing device, comprising:
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 JP2020095673A (en) | 2020-06-18 |
| JP2020095673A5 JP2020095673A5 (en) | 2022-07-04 |
| JP7324066B2 true 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) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP7766406B2 (en) | 2021-03-12 | 2025-11-10 | キヤノン株式会社 | Image processing device and image processing method |
| JP7739059B2 (en) * | 2021-06-10 | 2025-09-16 | キヤノン株式会社 | Information processing device, information processing method, and program |
| CN115914612A (en) * | 2021-08-23 | 2023-04-04 | 北京字跳网络技术有限公司 | Method, device, equipment and medium for determining video fluency |
| JP7844159B2 (en) * | 2021-12-24 | 2026-04-13 | キヤノン株式会社 | Image processing apparatus and image processing method, and imaging apparatus |
| CN118261884B (en) * | 2024-04-09 | 2024-11-22 | 吉林省送变电工程有限公司 | Wind turbine tower hoisting screw loosening detection method based on feature difference distance threshold |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010258710A (en) | 2009-04-23 | 2010-11-11 | Canon Inc | Motion vector detection device, control method therefor, and imaging device |
| 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 shake correction apparatus, control method therefor, optical apparatus, 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 device, control method therefor, and imaging device |
| 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 shake correction apparatus, control method therefor, optical apparatus, and imaging apparatus |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2020095673A (en) | 2020-06-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11070729B2 (en) | Image processing apparatus capable of detecting moving objects, control method thereof, and image capture apparatus | |
| JP7324066B2 (en) | IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND IMAGING APPARATUS | |
| JP4274233B2 (en) | Imaging apparatus, image processing apparatus, image processing method therefor, and program causing computer to execute the method | |
| JP7223079B2 (en) | IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND IMAGING APPARATUS | |
| EP3093822B1 (en) | Displaying a target object imaged in a moving picture | |
| JP4575829B2 (en) | Display screen position analysis device and display screen position analysis program | |
| JP2010114752A (en) | Device and method of imaging and program | |
| CN105979135A (en) | Image processing apparatus, image processing method | |
| CN113610865A (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
| JP2023033355A (en) | Image processing device and its control method | |
| JP2019175112A (en) | Image processing device, photographing device, image processing method, and program | |
| US10880457B2 (en) | Image processing apparatus, image capturing apparatus, image processing method, and storage medium | |
| US20230237758A1 (en) | Image processing apparatus, control method therefor, image capturing apparatus, and storage medium | |
| JP2008211534A (en) | Face detection device | |
| JP7657611B2 (en) | Image processing device and control method thereof, imaging device, and program | |
| JP6063680B2 (en) | Image generation apparatus, image generation method, imaging apparatus, and imaging method | |
| JP7122916B2 (en) | IMAGING DEVICE AND CONTROL METHOD THEREOF, PROGRAM AND STORAGE MEDIUM | |
| JP2022054247A (en) | Information processing device and information processing method | |
| JP2017102748A (en) | Pupil image learning device, pupil position detection device, and program therefor | |
| JP7642592B2 (en) | Focus adjustment device, imaging device, focus adjustment method, and program | |
| JP2025180116A (en) | Information processing device, control method and program for information processing device | |
| KR20130000929A (en) | Apparatus for detecting a moving object and detecting method thereof | |
| JP2017228873A (en) | Image processing apparatus, imaging apparatus, control method, and program | |
| JP2022140058A (en) | Image processing apparatus and image processing method | |
| JP2011090488A (en) | Object tracking device, object tracking program, and camera |
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 |