JP2018116723A - Image processing system - Google Patents
Image processing system Download PDFInfo
- Publication number
- JP2018116723A JP2018116723A JP2018038635A JP2018038635A JP2018116723A JP 2018116723 A JP2018116723 A JP 2018116723A JP 2018038635 A JP2018038635 A JP 2018038635A JP 2018038635 A JP2018038635 A JP 2018038635A JP 2018116723 A JP2018116723 A JP 2018116723A
- Authority
- JP
- Japan
- Prior art keywords
- tracking
- cpu
- processing
- mask
- mask extraction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Studio Devices (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、画像処理装置に関する。 The present invention relates to an image processing apparatus.
従来、被写体抽出に関する様々な技術が考えられている。例えば、特許文献1の発明では、被写体形状の変化量に応じてAF測距枠を変形することにより、被写体がカメラ方向に移動する場合でも、被写体に対して最適に自動焦点調節する撮像装置が開示されている。 Conventionally, various techniques relating to subject extraction have been considered. For example, in the invention of Patent Document 1, an imaging device that automatically adjusts an automatic focus on a subject even when the subject moves in the camera direction by deforming an AF distance measurement frame according to the amount of change in the subject shape. It is disclosed.
特許文献1に開示された撮像装置は、被写体形状の変化量に応じてAF測距枠を変形するため、被写体がカメラ方向に移動する場合に良好な効果を得ることができる。しかし、精度に応じて処理負荷も増大するという問題がある。 Since the imaging device disclosed in Patent Document 1 deforms the AF distance measurement frame in accordance with the amount of change in the subject shape, a favorable effect can be obtained when the subject moves in the camera direction. However, there is a problem that the processing load increases according to the accuracy.
本発明は、前記の点に鑑みてなされたものであり、主要被写体領域の抽出を継続的に行う際に、抽出の精度や安定性を維持しつつ処理負荷を軽減することを目的とする。 The present invention has been made in view of the above points, and an object of the present invention is to reduce the processing load while maintaining the accuracy and stability of extraction when the main subject region is continuously extracted.
本発明の画像処理装置は、時間的に連続して生成された複数の画像データを順次取得する取得部と、前記取得部により取得した前記画像データにより示される画像の特徴量を算出し、前記特徴量に基づいて被写体領域を検出する領域検出部と、前記領域検出部により前記被写体領域を検出すると、検出した前記被写体領域を追尾対象として、前記追尾対象を複数の前記画像から検出する追尾部とを備える。 The image processing apparatus of the present invention calculates an image feature amount indicated by the image data acquired by the acquisition unit that sequentially acquires a plurality of image data generated successively in time, and the acquisition unit, A region detection unit that detects a subject region based on a feature amount, and a tracking unit that detects the subject region from the plurality of images with the detected subject region as a tracking target when the region detection unit detects the subject region With.
本発明によれば、主要被写体領域の抽出を継続的に行う際に、抽出の精度や安定性を維持しつつ処理負荷を軽減することができる。 According to the present invention, when the main subject area is continuously extracted, the processing load can be reduced while maintaining the accuracy and stability of the extraction.
<第1実施形態>
以下、第1実施形態について図面を参照して詳細に説明する。
<First Embodiment>
Hereinafter, a first embodiment will be described in detail with reference to the drawings.
第1実施形態では、図1に示すようなレンズ鏡筒10と、撮像装置20と、記録媒体40とからなる装置を例に挙げて説明する。
In the first embodiment, an apparatus including a lens barrel 10, an
撮像装置20は、レンズ鏡筒10から入射される光学像を撮像する。得られた画像は静止画又は動画の画像として、記憶媒体40に記憶される。
The
レンズ鏡筒10は、焦点調整レンズ(以下、「AF(Auto Focus)レンズ」と称する)11と、レンズ駆動部12と、AFエンコーダ13と、鏡筒制御部14とを備える。なお、レンズ鏡筒10は、撮像装置20に着脱可能に接続されても良いし、撮像装置20と一体であっても良い。
The lens barrel 10 includes a focus adjustment lens (hereinafter referred to as an “AF (Auto Focus) lens”) 11, a
撮像装置20は、撮像部21と、画像処理装置22と、表示部23と、バッファメモリ部24と、記憶部25と、CPU26と、操作部27と、通信部28とを備える。撮像部21は、撮像素子29と、A/D(Analog/Digital)変換部30とを備える。撮像部21は、設定された撮像条件(例えば絞り値、露出値等)に従って、CPU26により制御される。
The
レンズ鏡筒10において、AFレンズ11は、レンズ駆動部12により駆動され、撮像装置20の撮像素子29の受光面(光電変換面)に、光学像を導く。AFエンコーダ13は、AFレンズ11の移動を検出し、AFレンズ11の移動量に応じた信号を、鏡筒制御部14に出力する。ここで、AFレンズ11の移動量に応じた信号とは、例えば、AFレンズ11の移動量に応じて位相が変化するサイン(sin)波信号であってもよい。
In the lens barrel 10, the AF lens 11 is driven by the
鏡筒制御部14は、撮像装置20のCPU26から入力される駆動制御信号に応じて、レンズ駆動部12を制御する。ここで、駆動制御信号とは、AFレンズ11を光軸方向に駆動させる制御信号である。鏡筒制御部14は、駆動制御信号に応じて、例えば、レンズ駆動部12に出力するパルス電圧のステップ数を変更する。また、鏡筒制御部14は、AFレンズ11の移動量に応じた信号に基づいて、レンズ鏡筒10におけるAFレンズ11の位置(フォーカスポジション)を、撮像装置20のCPU26に出力する。ここで、鏡筒制御部14は、例えば、AFレンズ11の移動量に応じた信号を、AFレンズ11の移動方向に応じて積算することで、レンズ鏡筒10におけるAFレンズ11の移動量(位置)を算出してもよい。レンズ駆動部12は、鏡筒制御部14の制御に応じてAFレンズ11を駆動し、AFレンズ11をレンズ鏡筒10内で光軸方向に移動させる。
The lens
撮像装置20において、撮像素子29は、光電変換面を備え、レンズ鏡筒10(光学系)により光電変換面に結像された光学像を電気信号に変換して、A/D変換部30に出力する。撮像素子29は、例えば、CMOS(Complementary Metal Oxide Semiconductor)などの光電変換素子で構成される。また、撮像素子29は、光電変換面の一部の領域について、光学像を電気信号に変換するようにしてもよい(画像切り出し)。また、撮像素子29は、操作部27を介してユーザからの撮影指示を受け付けた際に得られる画像を、A/D変換部30および通信部28を介して記憶媒体40に出力する。一方、撮像素子29は、操作部27を介してユーザからの撮影指示を受け付ける前の状態において、連続的に得られる画像をスルー画像として、バッファメモリ部24及び表示部23に、A/D変換部30を介して出力する。
In the
A/D変換部30は、撮像素子29によって変換された電気信号をデジタル化して、デジタル信号である画像をバッファメモリ部24等に出力する。
The A /
画像処理装置22は、記憶部25に記憶されている画像処理条件に基づいて、バッファメモリ部24に一時的に記憶されている画像に対する画像処理を行う。そして、画像処理後の画像は、通信部28を介して記憶媒体40に記憶される。また、画像処理装置22は、バッファメモリ部24に一時的に記憶されている画像に対して、マスク抽出処理を行う(詳細は後述する)。そして、抽出したマスクに関する情報は、CPU26に出力されるとともに、記憶部25や記憶媒体40等に記憶される。
The
表示部23は、例えば液晶ディスプレイであって、撮像部21によって生成された画像、及び操作画面等を表示する。バッファメモリ部24は、撮像部21によって生成された画像を一時的に記憶する。記憶部25は、撮像条件や、各種判定の際にCPU26によって参照される判定条件などを記憶する。
The display unit 23 is, for example, a liquid crystal display, and displays an image generated by the imaging unit 21, an operation screen, and the like. The
CPU26は、画像処理部22や記憶部25などから適宜必要な情報を取得し、取得した情報に基づいて、撮像装置20内の各部を統括的に制御する。CPU26による制御には、焦点調整(AF)の設定、露出調整(AE)の設定、ホワイトバランス調整(AWB)の設定、閃光の発光量の変更の設定、被写体追尾の設定、各種撮影モードの設定、各種画像処理の設定、各種表示の設定、ズーム倍率に連動した明るさの最適化の設定などが含まれる。また、CPU26は、操作部27の操作状態を監視するとともに、表示部23への画像データの出力を行う。
The
操作部27は、例えば、電源スイッチ、シャッタボタン、マルチセレクタ(十字キー)、又はその他の操作キーを備え、ユーザによって操作されることでユーザの操作入力を受け付け、操作入力に応じた信号をCPU26に出力する。
The
通信部28は、カードメモリ等の取り外しが可能な記憶媒体40と接続され、この記憶媒体40への情報(画像データ、領域の情報など)の書込み、読み出し、あるいは消去を行う。
The
記憶媒体40は、撮像装置20に対して着脱可能に接続される記憶部であって、情報(画像データ、領域の情報など)を記憶する。なお、記憶媒体40は、撮像装置20と一体であってもよい。
The
撮像装置20は、撮影時に、焦点調節情報に基づいて主要被写体領域を検出する通常モードの他に、自動で主要被写体領域を検出する自動検出モードを備える。自動検出モードは、構図確認用のスルー画像等に基づいて、主要被写体領域を自動で継続的に検出し、検出した主要被写体領域の情報を表示部23に表示するとともに、バッファメモリ部24や記憶部25等に記憶するモードである。この自動検出モードは操作部27を介したユーザ操作により設定可能であっても良いし、CPU26により自動で設定可能であっても良い。
The
以下、自動検出モード実行時のCPU26の動作について、図2のフローチャートを参照して説明する。
Hereinafter, the operation of the
ステップS101において、CPU26は、撮像部21を制御して、スルー画像の取得を開始する。取得されたスルー画像の画像情報はバッファメモリ部24に一時的に記憶される。このスルー画像は、所定の時間間隔で連続して生成される。そして、CPU26によるスルー画像の取得は、時間的に連続して順次行われる。
In step S <b> 101, the
ステップS102において、CPU26は、画像処理装置22を制御して通常の画像処理を行う。通常の画像処理とは、ホワイトバランス調整、補間処理、色調補正処理、階調変換処理などである。各処理の具体的な方法は公知技術と同様であるため説明を省略する。画像処理装置22は、バッファメモリ部24から対象となる画像の画像データを取得し、画像処理を施した後に、再びバッファメモリ部24に出力する。
In step S102, the
ステップS103において、CPU26は、画像処理装置22を制御してマスク抽出処理を行う。マスク抽出処理とは、画像における特徴量を算出し、特徴量に基づいて主要被写体領域を検出するための一手法である。例えば、画像における特徴量から評価値を求め、同じ評価値の連続領域を求めることによりマスク抽出を行う。マスク抽出の手法はどのような方法であっても良い。また、マスク抽出の具体的な方法は公知技術と同様であるため説明を省略する。なお、CPU26は、マスク抽出処理の結果を、マスク情報としてバッファメモリ部24や記憶部25等に記録する。マスク情報には、ステップS103のマスク抽出処理の抽出条件(色区分やマスク区分など)、マスクの位置、マスクの大きさや形状などの情報が含まれる。
In step S103, the
また、ステップS103の処理の後に、マスク抽出により主要被写体領域を抽出できたか否かを判定する構成としても良い。すなわち、ステップS103の処理の後に、マスク抽出処理によりマスク抽出が成功したか否かを判定し、例えば、ステップS103におけるマスク抽出処理において、特徴量が算出できなかったり、評価値が低すぎたりした場合には、マスク抽出が失敗し、主要被写体領域を抽出できないと判定する。このような場合、CPU26は、以降の処理を行わずに、主要被写体領域を抽出できるまで、ステップS102の通常の画像処理およびステップS103のマスク抽出処理を繰り返しても良い。この場合、マスク抽出処理によって主要被写体領域が抽出されると、後述する追尾処理が開始される構成とすれば良い。
Further, it may be configured to determine whether or not the main subject region has been extracted by mask extraction after the process of step S103. That is, after the process of step S103, it is determined whether the mask extraction is successful by the mask extraction process. For example, in the mask extraction process in step S103, the feature amount cannot be calculated or the evaluation value is too low. In this case, it is determined that the mask extraction has failed and the main subject area cannot be extracted. In such a case, the
さらに、CPU26は、表示部26を制御し、マスク抽出により抽出した主要被写体領域の情報を表示部23に表示しても良い。例えば、CPU26は、スルー画像に重畳して、主要被写体領域に枠などを表示することにより、主要被写体領域を視認可能に表示することができる。なお、この枠は、主要被写体領域の形状に応じたものであっても良いし、矩形や円形など所定の形状であっても良い。また、線の太さ、濃淡、色などはどのようなものであっても良い。いずれにせよ、このような表示を行うことにより、ユーザは、CPU26によるマスク抽出処理の結果を、容易に把握することができる。
Further, the
ステップS104において、CPU26は、ステップS103のマスク抽出処理の結果に基づいて、テンプレートを設定する。このテンプレートは、後述する追尾処理に用いるテンプレートである。CPU26は、ステップS103のマスク抽出により抽出したマスクに基づいて主要被写体領域を決定し、例えば、RGB各色について追尾対象のテンプレートを設定する。
In step S104, the
ステップS105において、CPU26は、ステップS104で設定したテンプレートに基づいて、ステップS101で取得を開始したスルー画像についてテンプレートマッチング処理を行うことにより、追尾処理を開始する。追尾処理とは、追尾対象の位置や領域を、時系列で記憶および更新し、その状態を解析、更新、利用、表示することを含む。追尾処理におけるテンプレートマッチング処理等の具体的な方法は公知技術と同様であるため説明を省略する。CPU26は、ステップS103で行ったマスク抽出処理により抽出した主要被写体領域を追尾対象として追尾処理を行うことにより、マスク抽出処理よりも負荷の軽い処理で、初期に行ったマスク抽出処理を繰り返す場合を相応の検出結果を得ることができる。
In step S105, based on the template set in step S104, the
なお、CPU26は、ステップS103で説明したマスク抽出処理の場合と同様に、表示部26を制御し、追尾処理により検出した主要被写体領域の情報を表示部23に表示しても良い。
Note that the
また、ステップS104で説明したテンプレートの設定およびステップS105で説明した追尾処理は一例である。追尾処理の際には、ステップS103で説明したマスク抽出処理よりも処理負荷の軽い処理であれば、テンプレートマッチング処理以外の手法を用いても良い。例えば、ブロックマッチング処理を用いた追尾処理、動きベクトルを用いた追尾処理、限定的なマスク処理を用いた追尾処理などであっても良い。また、複数の手法を組み合わせて追尾処理を行っても良い。 Further, the template setting described in step S104 and the tracking process described in step S105 are examples. In the tracking process, a technique other than the template matching process may be used as long as the processing load is lighter than the mask extraction process described in step S103. For example, a tracking process using a block matching process, a tracking process using a motion vector, a tracking process using a limited mask process may be used. Further, the tracking process may be performed by combining a plurality of methods.
動きベクトルを用いた追尾処理は、ステップS103で説明したマスク抽出処理の結果に基づいて、主要被写体領域の動きを示す動きベクトルを求め、動きベクトルの分布をモニタすることにより実行することができる。なお、この動きベクトルは、MPEG形式の動画像生成時に利用される動きベクトルを転用しても良い。 The tracking process using the motion vector can be executed by obtaining a motion vector indicating the motion of the main subject region based on the result of the mask extraction process described in step S103 and monitoring the motion vector distribution. Note that this motion vector may be diverted from a motion vector used when generating an MPEG moving image.
また、限定的なマスク処理を用いた追尾処理は、ステップS103で説明したマスク抽出処理の抽出条件よりも緩いマスク抽出処理により実行できる。例えば、抽出するマスクの色区分を、ステップS103で説明したマスク抽出処理よりも限定したり(減らしたり)、マスク抽出処理において2値化画像を作成する際の閾値を、ステップS103で説明したマスク抽出処理における閾値から変更したりして、限定的なマスク処理を行うことにより、追尾処理を実行しても良い。 Further, the tracking process using the limited mask process can be executed by a mask extraction process that is looser than the extraction conditions of the mask extraction process described in step S103. For example, the color classification of the mask to be extracted is limited (reduced) than the mask extraction process described in step S103, or the threshold value for creating a binarized image in the mask extraction process is the mask described in step S103. The tracking process may be executed by changing the threshold value in the extraction process or performing a limited mask process.
ステップS106において、CPU26は、撮影指示が行われたか否かを判定する。CPU26は、撮影指示が行われるまで待機し、撮影指示が行われたと判定するとステップS107に進む。なお、撮影指示は、操作部27のシャッタボタンを介したユーザ操作により行われる。このユーザ操作は、いわゆる半シャッタと全シャッタの何れであっても良い。
In step S106, the
ステップS107において、CPU26は、各部を制御して撮影を実行する。このとき、CPU26は、ステップS105で開始した追尾処理の結果に基づいて、焦点調整(AF)の設定処理、露出調整(AE)の設定処理、ホワイトバランス調整処理(AWB)の3A処理を行うとともに、画像処理装置22における各種画像処理の条件等を決定する。
In step S <b> 107, the
ステップS108において、CPU26は、撮像により生成した画像を、通信部28を介して記憶媒体40に記録して一連の処理を終了する。
In step S <b> 108, the
以上説明したように、第1実施形態によれば、時間的に連続して生成された複数の画像データを順次取得し、画像データにより示される画像の特徴量を算出し、特徴量に基づいて主要被写体領域を検出する。そして、主要被写体領域を検出すると、検出した主要被写体領域を追尾対象として、追尾対象を複数の画像から検出する。したがって、上述の構成により、特徴量に基づいて検出した主要被写体領域を追尾対象として、処理負荷のより軽い追尾処理を行うことができるので、主要被写体領域の抽出を継続的に行う際に、抽出の精度や安定性を維持しつつ処理負荷を軽減することができる。そのため、主要被写体領域の抽出の高速化も期待できる。 As described above, according to the first embodiment, a plurality of pieces of image data generated successively in time are sequentially acquired, the feature amount of the image indicated by the image data is calculated, and based on the feature amount. A main subject area is detected. When the main subject area is detected, the detected main subject area is set as a tracking target, and the tracking target is detected from a plurality of images. Therefore, with the above-described configuration, it is possible to perform tracking processing with a lighter processing load using the main subject area detected based on the feature amount as a tracking target, so that the extraction is performed when the main subject area is continuously extracted. The processing load can be reduced while maintaining the accuracy and stability. Therefore, it can be expected to speed up the extraction of the main subject area.
また、第1実施形態によれば、特徴量に基づいてマスク抽出を行うことにより、主要被写体領域を検出する。したがって、精度良く検出した主要被写体領域を追尾対象とすることができる。 Further, according to the first embodiment, the main subject region is detected by performing mask extraction based on the feature amount. Therefore, the main subject area detected with high accuracy can be set as the tracking target.
また、第1実施形態によれば、追尾処理を行う際に、ブロックマッチング処理、テンレートマッチング処理、動きベクトルを用いた追尾処理、限定的なマスク処理を用いた追尾処理などを実行する。したがって、処理負荷を軽減することができる。 Further, according to the first embodiment, when performing the tracking process, a block matching process, a template matching process, a tracking process using a motion vector, a tracking process using a limited mask process, and the like are executed. Therefore, the processing load can be reduced.
<第2実施形態>
以下、第2実施形態について図面を参照して詳細に説明する。第2実施形態は、第1実施形態の変形例である。したがって、第1実施形態と異なる部分についてのみ説明し、第1実施形態と同様の部分については説明を省略する。
Second Embodiment
Hereinafter, the second embodiment will be described in detail with reference to the drawings. The second embodiment is a modification of the first embodiment. Therefore, only the parts different from the first embodiment will be described, and the description of the same parts as the first embodiment will be omitted.
第2実施形態では、第1実施形態の図1に示したレンズ鏡筒10と、撮像装置20と、記録媒体40とからなる装置を例に挙げて説明する。
In the second embodiment, a description will be given by taking as an example an apparatus including the lens barrel 10, the
第1実施形態では、上述したように、マスク抽出処理の結果に基づいて追尾処理を行う基本的な例を説明した。第2実施形態では、マスク抽出処理と追尾処理とを併用して行い、主要被写体領域の抽出の安定性をより向上させる構成について説明する。 In the first embodiment, as described above, the basic example in which the tracking process is performed based on the result of the mask extraction process has been described. In the second embodiment, a configuration will be described in which mask extraction processing and tracking processing are performed in combination to further improve the extraction stability of the main subject region.
以下、自動検出モード実行時のCPU26の動作について、図3のフローチャートを参照して説明する。
Hereinafter, the operation of the
ステップS201において、CPU26は、第1実施形態のステップS101と同様に、撮像部21を制御して、スルー画像の取得を開始する。
In step S <b> 201, the
ステップS202において、CPU26は、第1実施形態のステップS102と同様に、画像処理装置22を制御して通常の画像処理を行う。
In step S202, the
ステップS203において、CPU26は、第1実施形態のステップS103と同様に、画像処理装置22を制御してマスク抽出処理を行う。
In step S203, the
ステップS204において、CPU26は、第1実施形態のステップS104と同様に、ステップS203のマスク抽出処理の結果に基づいて、テンプレートを設定する。
In step S204, the
ステップS205において、CPU26は、第1実施形態のステップS105と同様に、ステップS204で設定したテンプレートに基づいて、追尾処理を開始する。
In step S205, the
ステップS206において、CPU26は、ステップS205で開始した追尾処理をNフレーム継続したか否かを判定する。CPU26は、ステップS205で開始した追尾処理をNフレーム継続していないと判定すると、ステップS207に進む。一方、CPU26は、ステップS205で開始した追尾処理をNフレーム継続したと判定するとステップS203に戻る。Nは予め定められた値(例えば、N=5)である。ステップS205で開始した追尾処理をNフレーム継続した場合とは、追尾処理がある程度継続され、主要被写体領域に何らかの変化(形状の変化、位置の移動など)が発生している可能性がある場合である。このような場合には、ステップS203に戻り、再びマスク抽出処理を行うことにより、追尾の経過時間に応じて、継続的な追尾処理とマスク抽出処理に基づく追尾処理とを切り替えることができる。そのため、確実に主要被写体領域をとらえることができる。
In step S206, the
ステップS207において、CPU26は、第1実施形態のステップS106と略同様に、撮影指示が行われたか否かを判定する。CPU26は、撮影指示が行われたと判定するとステップS208に進む。一方、撮影指示が行われないと判定すると、CPU26は
、ステップS206に戻り、次のフレームの画像に対してステップS206以降の処理を行う。
In step S207, the
ステップS208において、CPU26は、第1実施形態のステップS107と同様に、各部を制御して撮影を実行する。
In step S <b> 208, the
ステップS209において、CPU26は、第1実施形態のステップS108と同様に、撮像により生成した画像を、通信部28を介して記憶媒体40に記録して一連の処理を終了する。
In step S209, as in step S108 of the first embodiment, the
以上説明したように、第2実施形態によれば、前回の追尾時の追尾対象を継続的に検出する第1のモードと、マスク抽出処理により新たに検出した主要被写体領域を追尾対象として検出する第2のモードとを切り替えて主要被写体領域の追尾処理を行う。したがって、主要被写体領域に何らかの変化が発生しても、適宜追尾対象を更新し、確実に主要被写体領域の抽出を行うことができる。 As described above, according to the second embodiment, the first mode for continuously detecting the tracking target at the time of the previous tracking and the main subject area newly detected by the mask extraction process are detected as the tracking target. The main subject area is tracked by switching to the second mode. Therefore, even if some change occurs in the main subject area, the tracking target can be updated as appropriate, and the main subject area can be reliably extracted.
また、第2実施形態によれば、追尾処理を、上述した第1のモードにより所定回数実行するたびに、上述した第2のモードにより少なくとも1回実行する。したがって、高速化が可能となる継続的な追尾処理と、精度の良いマスク抽出処理とを、バランス良く併用することができる。 Further, according to the second embodiment, every time the tracking process is executed a predetermined number of times in the first mode, the tracking process is executed at least once in the second mode. Therefore, it is possible to use a continuous tracking process capable of speeding up and an accurate mask extraction process in a balanced manner.
<第3実施形態>
以下、第3実施形態について図面を参照して詳細に説明する。第3実施形態は、第2実施形態の変形例である。したがって、第1実施形態および第2実施形態と異なる部分についてのみ説明し、第1実施形態および第2実施形態と同様の部分については説明を省略する。
<Third Embodiment>
Hereinafter, a third embodiment will be described in detail with reference to the drawings. The third embodiment is a modification of the second embodiment. Therefore, only different parts from the first embodiment and the second embodiment will be described, and the description of the same parts as the first embodiment and the second embodiment will be omitted.
第3実施形態では、第1実施形態の図1に示したレンズ鏡筒10と、撮像装置20と、記録媒体40とからなる装置を例に挙げて説明する。
In the third embodiment, a description will be given by taking as an example an apparatus including the lens barrel 10, the
第2実施形態では、上述したように、マスク抽出処理と追尾処理とを併用して行う基本的な例を説明した。第3実施形態では、マスク抽出処理と追尾処理とを併用する際に、より適切に切り替えを行う構成について説明する。 In the second embodiment, as described above, the basic example in which the mask extraction process and the tracking process are performed in combination has been described. In the third embodiment, a configuration will be described in which switching is performed more appropriately when the mask extraction process and the tracking process are used in combination.
以下、自動検出モード実行時のCPU26の動作について、図4のフローチャートを参照して説明する。
Hereinafter, the operation of the
ステップS301において、CPU26は、第1実施形態のステップS101と同様に、撮像部21を制御して、スルー画像の取得を開始する。
In step S301, the
ステップS302において、CPU26は、第1実施形態のステップS102と同様に、画像処理装置22を制御して通常の画像処理を行う。
In step S302, the
ステップS303において、CPU26は、第1実施形態のステップS103と同様に、画像処理装置22を制御してマスク抽出処理を行う。ただし、CPU26は、第1実施形態および第2実施形態とは異なり、継続的にマスク抽出処理を行う。なお、マスク抽出処理はすべてのフレームを対象としても良いし、間引きを行った一部のフレームを対象としても良い。
In step S303, the
ステップS304において、CPU26は、テンプレートを設定する。ただし、CPU
26は、1回目のステップS304においては、第1実施形態のステップS104と同様に、ステップS303のマスク抽出処理の結果に基づいてテンプレート設定し、2回目以降のステップS304においては、後述するステップS308の補正マスク抽出処理の結果に基づいてテンプレートを設定する。
In step S304, the
26, in step S304 for the first time, as in step S104 of the first embodiment, a template is set based on the result of the mask extraction process in step S303. In step S304 for the second and subsequent times, step S308, which will be described later, is set. A template is set based on the result of the correction mask extraction process.
ステップS305において、CPU26は、第1実施形態のステップS105と同様に、ステップS304で設定したテンプレートに基づいて、追尾処理を開始する。つまり、この時点で、ステップS303で開始されたマスク抽出処理と、追尾処理とが並行して行われることになる。ただし、ステップS303で説明したマスク抽出処理は、ステップS305で開始する追尾処理よりも低いフレームレートで実行されても良い。
In step S305, the
ステップS306において、CPU26は、最新のマスク抽出処理の結果と、最新の追尾処理の結果とを比較し、その差異が大きいか否かを判定する。CPU26は、差異が大きいと判定すると、ステップS307に進み、差異が大きくないと判定すると、後述するステップS309に進む。
In step S306, the
差異は、例えば、最新のマスク抽出処理において抽出したマスクに基づく主要被写体領域(領域A)と、最新の追尾処理において検出した主要被写体領域(領域B)とに基づいて求めることができる。より具体的には、領域Aおよび領域Bの位置、大きさ、明るさ、色、形状等の差異が考えられる。差異は、どのように求めても良いが、例えば、上述した位置、大きさ、明るさ、色、形状(アスペクト比、充填率など)等を表す評価値を、領域Aおよび領域Bのそれぞれについて求め、求めた評価値の差が所定の閾値より大きい場合に、差異が大きいと判定しても良い。 The difference can be obtained based on, for example, the main subject region (region A) based on the mask extracted in the latest mask extraction processing and the main subject region (region B) detected in the latest tracking processing. More specifically, differences in the position, size, brightness, color, shape, and the like of region A and region B can be considered. The difference may be obtained in any way. For example, evaluation values representing the above-described position, size, brightness, color, shape (aspect ratio, filling rate, etc.), etc. are obtained for each of the regions A and B. If the difference between the obtained and obtained evaluation values is larger than a predetermined threshold, it may be determined that the difference is large.
なお、上述したマスク抽出処理に基づく主要被写体領域(領域A)および追尾処理に基づく主要被写体領域(領域B)の定め方は一例である。また、差異の求め方についても、どのような方法を用いても良い。 Note that the main subject region (region A) based on the above-described mask extraction processing and the main subject region (region B) based on the tracking processing are examples. Also, any method may be used for obtaining the difference.
ところで、差異が大きい場合とは、追尾処理がある程度継続された場合など、主要被写体領域に何らかの変化(形状の変化、位置の移動など)が発生している場合である。このような場合には、マスク抽出処理に基づく主要被写体領域(領域A)と、追尾処理に基づく主要被写体領域(領域B)とが一致しない、あるいは、類似性が低下していると考えられるため、ステップS307に進み、その原因を解析する。 By the way, the case where the difference is large is a case where some change (shape change, position movement, etc.) occurs in the main subject area, for example, when the tracking process is continued to some extent. In such a case, it is considered that the main subject region (region A) based on the mask extraction process and the main subject region (region B) based on the tracking process do not match or the similarity is reduced. In step S307, the cause is analyzed.
一方、差異が大きくない(つまり、差異が小さい)場合とは、マスク抽出処理に基づく主要被写体領域(領域A)と、追尾処理に基づく主要被写体領域(領域B)とが一致している、あるいは、類似性が十分に高い状態が保たれていると考えられるため、現状を維持して、後述するステップS309に進む。 On the other hand, when the difference is not large (that is, the difference is small), the main subject region (region A) based on the mask extraction processing and the main subject region (region B) based on the tracking processing match, or Since the similarity is considered to be sufficiently high, the current state is maintained and the process proceeds to step S309 described later.
ステップS307において、CPU26は、ステップS303のマスク抽出処理の結果、および、ステップS305で開始した追尾処理の結果に基づいて、差異が大きくなった原因を解析する。
In step S307, the
差異が大きくなった場合には、主要被写体領域に何らかの変化が起こったと考えることができる。原因としては、例えば、被写体自体の位置、大きさ、明るさ、色、形状等が変化することや、撮像装置20のユーザの動作等に起因して、検出される主要被写体領域が変化することなどがある。CPU26は、ステップS306で説明した判定の内容に鑑み、差異が大きくなった原因を解析する。
When the difference becomes large, it can be considered that some change has occurred in the main subject area. Causes include, for example, a change in the position, size, brightness, color, shape, and the like of the subject itself, and a change in the detected main subject region due to the operation of the user of the
例えば、明るさ、色、形状の類似性はある程度高いが、位置や大きさの類似性が低い場
合には、被写体自体の位置が変化したと考えられる。また、例えば、位置や大きさの類似性はある程度高いが、明るさ、色、形状の類似性が低い場合には、被写体自体が間違っている、つまり、マスク抽出処理に基づく主要被写体領域(領域A)と、追尾処理に基づく主要被写体領域(領域B)とが異なる主要被写体領域である可能性が高い。
For example, if the similarity in brightness, color, and shape is high to some extent, but the similarity in position and size is low, it is considered that the position of the subject itself has changed. For example, if the similarity in position and size is high to some extent, but the similarity in brightness, color, and shape is low, the subject itself is wrong, that is, the main subject region (region) based on mask extraction processing There is a high possibility that A) is different from the main subject region (region B) based on the tracking process.
原因解析はどのような手法で行われても良い。また、CPU26は、原因解析の結果をバッファメモリ部24や記憶部25等に記憶しておき、後述するステップS308の補正マスク抽出処理以外の処理(例えば、後述するステップS310の撮影実行処理など)の際にも、その情報を利用しても良い。
The cause analysis may be performed by any method. Further, the
ステップS308において、CPU26は、ステップS307で行った原因解析の結果に基づいて、ステップS303において説明したマスク抽出処理に準じた補正マスク抽出処理を行う。CPU26は、補正マスク抽出処理を行うと、ステップS304に戻り、再びテンプレートの設定を行う。
In step S308, the
補正マスク抽出処理とは、ステップS307で行った原因解析の結果に基づき、追尾処理に用いるテンプレートを再度設定するための新たなマスク抽出処理である。CPU26は、ステップS306で説明した判定の内容や、ステップS307で行った原因解析の結果に基づいて抽出条件を最適化して、マスク抽出処理を行う。
The correction mask extraction process is a new mask extraction process for resetting a template used for the tracking process based on the result of the cause analysis performed in step S307. The
この際、補正マスク抽出処理は、ステップS303で説明したマスク抽出処理の抽出条件よりも緩いマスク抽出処理としても良い。例えば、ステップS307で行った原因解析の結果等に基づいて、抽出するマスクの色区分をステップS303で説明したマスク抽出処理よりも限定したり(減らしたり)、マスク抽出処理において2値化画像を作成する際の閾値をステップS303で説明したマスク抽出処理における閾値から変更したりして、限定的なマスク処理を行っても良い。 At this time, the correction mask extraction process may be a mask extraction process that is looser than the extraction conditions of the mask extraction process described in step S303. For example, based on the result of the cause analysis performed in step S307, the color classification of the mask to be extracted is limited (reduced) than the mask extraction process described in step S303, or the binarized image is extracted in the mask extraction process. A limited mask process may be performed by changing the threshold at the time of creation from the threshold in the mask extraction process described in step S303.
また、補正マスク抽出処理を行う代わりに、マスク抽出処理に基づく主要被写体領域(領域A)と、追尾処理に基づく主要被写体領域(領域B)との何れかを選択する構成としても良い。例えば、差異が大きい場合には、追尾処理の精度が落ちているためリセットする必要があると考え、最新のマスク抽出処理に基づく主要被写体領域(領域A)を選択して、ステップS304に戻ってテンプレートの設定を行っても良い。また、例えば、位置や大きさに関する差異のみが大きい場合には、被写体自体が間違っている訳ではないと考え、追尾処理に基づく主要被写体領域(領域B)を選択しても良い。いずれにせよ、マスク抽出処理と追尾処理とを補完的に組み合わせて利用することにより、主要被写体領域の抽出を継続的に行う際に、抽出の精度や安定性を維持しつつ処理負荷を軽減することができる。 Instead of performing the correction mask extraction process, either a main subject area (area A) based on the mask extraction process or a main subject area (area B) based on the tracking process may be selected. For example, if the difference is large, it is considered that the tracking process is inaccurate and needs to be reset, so the main subject area (area A) based on the latest mask extraction process is selected, and the process returns to step S304. A template may be set. Further, for example, when only the difference regarding the position and size is large, it is considered that the subject itself is not wrong, and the main subject region (region B) based on the tracking process may be selected. In any case, by using a complementary combination of mask extraction processing and tracking processing, the processing load is reduced while maintaining the accuracy and stability of extraction when continuously extracting the main subject area. be able to.
ステップS309において、CPU26は、第1実施形態のステップS106と略同様に、撮影指示が行われたか否かを判定する。CPU26は、撮影指示が行われたと判定するとステップS310に進む。一方、撮影指示が行われないと判定すると、CPU26は、ステップS306に戻り、次のフレームの画像に対してステップS306以降の処理を行う。つまり、ステップS306において差異が大きいと判定されるか、ステップS309で撮影指示が行われたと判定するまで、ステップS306およびステップS309の判定を繰り返す。
In step S309, the
ステップS310において、CPU26は、第1実施形態のステップS107と同様に、各部を制御して撮影を実行する。
In step S <b> 310, the
ステップS311において、CPU26は、第1実施形態のステップS108と同様に
、撮像により生成した画像を、通信部28を介して記憶媒体40に記録して一連の処理を終了する。
In step S <b> 311, the
以上説明したように、第3実施形態によれば、追尾の結果に基づいて、前回の追尾時の追尾対象を継続的に検出する第1のモードと、マスク抽出処理により新たに検出した主要被写体領域を追尾対象として検出する第2のモードとを切り替えて主要被写体領域の追尾処理を行う。したがって、追尾が好適に行われている際には、処理負荷の小さい追尾を継続的に行い、主要被写体領域に何らかの変化が発生するなど追尾が好適に行われなくなった場合には、適宜追尾対象と更新し、確実に主要被写体領域の抽出を行うことができる。 As described above, according to the third embodiment, based on the result of tracking, the first mode for continuously detecting the tracking target at the time of the previous tracking and the main subject newly detected by the mask extraction process The main subject area tracking process is performed by switching to the second mode in which the area is detected as a tracking target. Therefore, when tracking is suitably performed, tracking with a small processing load is continuously performed, and when tracking is not suitably performed due to some change in the main subject area, an appropriate tracking target And the main subject area can be reliably extracted.
また、第3実施形態によれば、追尾処理における類似度が所定の閾値を下回った場合には、第2のモードに切り替える。したがって、追尾が好適に行われなくなった場合に、速やかに精度の良いマスク抽出処理に基づく追尾処理に移行することができる。 Further, according to the third embodiment, when the similarity in the tracking process is below a predetermined threshold, the mode is switched to the second mode. Therefore, when tracking is not performed properly, it is possible to promptly shift to tracking processing based on accurate mask extraction processing.
また、第3実施形態によれば、追尾処理により検出した追尾対象の評価値を算出し、算出した評価値と、過去に検出した所定の追尾対象の評価値との変化量に基づいて、上述した追尾モードを決定する。したがって、評価値に応じて追尾処理の安定性を監視し、追尾が好適に行われなくなった場合に、速やかに精度の良いマスク抽出処理に基づく追尾処理に移行することができる。 Further, according to the third embodiment, the evaluation value of the tracking target detected by the tracking process is calculated, and based on the amount of change between the calculated evaluation value and the evaluation value of the predetermined tracking target detected in the past, Determine the tracking mode. Therefore, the stability of the tracking process can be monitored according to the evaluation value, and when the tracking is not suitably performed, the tracking process based on the accurate mask extraction process can be promptly shifted.
また、第3実施形態によれば、上述した評価値として、追尾対象の位置を示す値、追尾対象の大きさを示す値、追尾対象の明るさを示す値、追尾対象の色を示す値、追尾対象の形状を示す値等を用い、評価値の変化量が所定の閾値を上回った場合には、上述した第2のモードに切り替える。したがって、被写体の変化に応じた評価値を用いることにより、高速化が可能となる継続的な追尾処理と、精度の良いマスク抽出処理に基づく追尾処理とを、バランス良く併用することができる。 Further, according to the third embodiment, as the evaluation value described above, the value indicating the position of the tracking target, the value indicating the size of the tracking target, the value indicating the brightness of the tracking target, the value indicating the color of the tracking target, When a value indicating the shape of the tracking target is used and the change amount of the evaluation value exceeds a predetermined threshold, the mode is switched to the second mode described above. Therefore, by using the evaluation value according to the change of the subject, it is possible to use in a well-balanced manner the continuous tracking processing that enables high speed and the tracking processing based on the accurate mask extraction processing.
<第4実施形態>
以下、第4実施形態について図面を参照して詳細に説明する。第4実施形態は、第2実施形態の変形例である。したがって、第1実施形態から第3実施形態と異なる部分についてのみ説明し、第1実施形態から第3実施形態と同様の部分については説明を省略する。
<Fourth embodiment>
Hereinafter, the fourth embodiment will be described in detail with reference to the drawings. The fourth embodiment is a modification of the second embodiment. Therefore, only different parts from the first embodiment to the third embodiment will be described, and description of the same parts as the first embodiment to the third embodiment will be omitted.
第4実施形態では、第1実施形態の図1に示したレンズ鏡筒10と、撮像装置20と、記録媒体40とからなる装置を例に挙げて説明する。
In the fourth embodiment, an apparatus including the lens barrel 10, the
第2実施形態では、上述したように、マスク抽出処理と追尾処理とを併用して行う基本的な例を説明し、第3実施形態では、マスク抽出処理と追尾処理とを併用する際に、より適切に切り替えを行う構成について説明した。第4実施形態では、マスク抽出処理と追尾処理とを併用する際に、より適切に切り替えを行う別の構成について説明する。 In the second embodiment, as described above, a basic example in which mask extraction processing and tracking processing are used in combination will be described. In the third embodiment, when mask extraction processing and tracking processing are used in combination, The configuration for switching more appropriately has been described. In the fourth embodiment, another configuration will be described in which switching is performed more appropriately when the mask extraction process and the tracking process are used together.
以下、自動検出モード実行時のCPU26の動作について、図5のフローチャートを参照して説明する。
Hereinafter, the operation of the
ステップS401において、CPU26は、第1実施形態のステップS101と同様に、撮像部21を制御して、スルー画像の取得を開始する。
In step S401, the
ステップS402において、CPU26は、第1実施形態のステップS102と同様に、画像処理装置22を制御して通常の画像処理を行う。
In step S402, the
ステップS403において、CPU26は、第1実施形態のステップS103と同様に
、画像処理装置22を制御してマスク抽出処理を行う。ただし、CPU26は、第3実施形態とは異なり、継続的なマスク抽出処理は行わない。
In step S403, the
ステップS404において、CPU26は、テンプレートを設定する。ただし、CPU26は、1回目のステップS404においては、第1実施形態のステップS104と同様に、ステップS403のマスク抽出処理の結果に基づいてテンプレート設定し、2回目以降のステップS404においては、ステップS403のマスク抽出処理の結果、または、後述するステップS409の補正マスク抽出処理の結果に基づいてテンプレートを設定する。
In step S404, the
ステップS405において、CPU26は、第1実施形態のステップS105と同様に、ステップS404で設定したテンプレートに基づいて、追尾処理を開始する。
In step S405, the
ステップS406において、CPU26は、ステップS405で開始した追尾処理が失敗したか否かを判定する。CPU26は、追尾処理が失敗したと判定すると、ステップS403に戻り、再びマスク抽出処理を行う。一方、追尾処理が成功した(失敗していない)と判定すると、ステップS407に進む。
In step S406, the
追尾処理が失敗したと判定される場合とは、追尾処理により主要被写体領域が検出できない場合や、検出された主要被写体領域が明らかに異常である場合などである。追尾処理が失敗したか否かの判定は、公知技術のどのような方法を用いても良い。 The case where it is determined that the tracking process has failed is a case where the main subject area cannot be detected by the tracking process, or a case where the detected main subject area is clearly abnormal. Any method known in the art may be used to determine whether or not the tracking process has failed.
追尾処理が失敗したと判定すると、CPU26は、改めてマスク抽出処理を行って、テンプレートの設定もし直し、再び追尾処理を開始する。一方、追尾処理が成功した(失敗していない)と判定すると、CPU26は、さらなる判定を行う。
If it is determined that the tracking process has failed, the
ステップS407において、CPU26は、所定時間が経過したか否かを判定する。CPU26は、所定時間が経過したと判定すると、ステップS408に進み、所定時間が経過していないと判定すると、後述するステップS411に進む。所定時間は、予め定められた時間であり、第2実施形態のステップS206で説明したNフレームに相当する時間である。ステップS405で追尾処理を開始してから所定時間が経過した場合とは、追尾処理がある程度継続され、主要被写体領域に何らかの変化(形状の変化、位置の移動など)が発生している可能性がある場合である。このような場合には、ステップS408に進み、マスク状態の変化を判定する(詳細は後述する)ことにより、追尾の経過時間に応じて、マスク状態の変化を確認することができる。一方、所定時間が経過していないと判定すると、CPU26は、撮影指示の有無を確認する(詳細は後述する)。
In step S407, the
ステップS408において、CPU26は、マスク状態が変化したか否かを判定する。CPU26は、マスク状態が変化したと判定すると、ステップS409に進み、マスク状態が変化していないと判定すると、ステップS407に戻る。
In step S408, the
マスク状態が変化したか否かの判定は、追尾処理において検出した主要被写体領域の変化に基づいて求めることができる。より具体的には、例えば、追尾処理において検出した主要被写体領域の位置の変化、大きさの変化、明るさの変化、色の変化、形状の変化等に基づいて、マスク状態の変化を求めることができる。上述した各変化は、どのように求めても良いが、例えば、上述した位置、大きさ、明るさ、色、形状(アスペクト比、充填率など)等を表す評価値をそれぞれについて求め、求めた評価値の変化が所定の閾値より大きい場合に、マスク状態が変化したと判定しても良い。 The determination of whether or not the mask state has changed can be obtained based on the change in the main subject area detected in the tracking process. More specifically, for example, a change in the mask state is obtained based on a change in position, size change, brightness change, color change, shape change, etc. of the main subject area detected in the tracking process. Can do. Each change described above may be obtained in any way. For example, an evaluation value representing the position, size, brightness, color, shape (aspect ratio, filling rate, etc.) described above is obtained for each. When the change in the evaluation value is larger than a predetermined threshold, it may be determined that the mask state has changed.
CPU26は、マスク状態が変化したと判定すると、上述したようにステップS409
に進み、是正処理を行う(詳細は後述する)。一方、マスク状態が変化していないと判定すると、CPU26は、ステップS407に戻り、所定時間が経過したか否かを再び判定する。なお、ステップS407に戻った際には、CPU26は、例えば、計測用のタイマをリセットするなどして、所定時間の計測をゼロから行う。
When the
Proceed to, and corrective processing is performed (details will be described later). On the other hand, when determining that the mask state has not changed, the
ステップS409において、CPU26は、補正マスク抽出処理を行う。
In step S409, the
補正マスク抽出処理は、第3実施形態のステップS308と略同様の処理であり、ステップS408で行ったマスク状態の変化判定の結果に基づき、追尾処理に用いるテンプレートを再度設定するための新たなマスク抽出処理である。CPU26は、ステップS408で行ったマスク状態の変化判定の結果に基づいて抽出条件を最適化して、補正マスク抽出処理を行う。
The correction mask extraction process is substantially the same as step S308 in the third embodiment, and a new mask for resetting a template used for the tracking process based on the result of the mask state change determination performed in step S408. It is an extraction process. The
この際、補正マスク抽出処理は、第3実施形態のステップS308と略同様に、ステップS403で説明したマスク抽出処理の抽出条件よりも緩いマスク抽出処理(限定的なマスク処理)とすると良い。 At this time, the correction mask extraction process may be a mask extraction process (limited mask process) that is looser than the extraction conditions of the mask extraction process described in step S403, as in step S308 of the third embodiment.
ステップS410において、CPU26は、補正マスク抽出処理が成功したか否かを判定する。CPU26は、ステップS409で行った補正マスク抽出処理が成功したと判定すると、ステップS404に戻り、再びテンプレートの設定を行う。一方、補正マスク抽出処理が成功していない(失敗した)と判定すると、ステップS403に戻り、再びマスク抽出処理を行う。
In step S410, the
つまり、ステップS408において、マスク状態が変化したと判定されると、テンプレートの再設定を目的として補正マスク抽出処理を行い、補正マスク抽出処理が成功した場合にはテンプレートの再設定を行い、補正マスク抽出処理が失敗した場合にはマスク抽出処理を再び行ってテンプレートとして再設定する。 That is, if it is determined in step S408 that the mask state has changed, a correction mask extraction process is performed for the purpose of resetting the template. If the correction mask extraction process is successful, the template is reset and the correction mask is reset. If the extraction process fails, the mask extraction process is performed again to reset the template.
ステップS411において、CPU26は、第1実施形態のステップS106と略同様に、撮影指示が行われたか否かを判定する。CPU26は、撮影指示が行われたと判定するとステップS412に進む。一方、撮影指示が行われないと判定すると、CPU26は、ステップS406に戻り、次のフレームの画像に対してステップS406以降の処理を行う。
In step S <b> 411, the
ステップS412において、CPU26は、第1実施形態のステップS107と同様に、各部を制御して撮影を実行する。
In step S <b> 412, the
ステップS413において、CPU26は、第1実施形態のステップS108と同様に、撮像により生成した画像を、通信部28を介して記憶媒体40に記録して一連の処理を終了する。
In step S413, as in step S108 of the first embodiment, the
以上説明したように、第4実施形態によれば、追尾の結果、追尾の経過時間、マスク抽出処理の結果などに基づいて、前回の追尾時の追尾対象を継続的に検出する第1のモードと、マスク抽出処理により新たに検出した主要被写体領域を追尾対象として検出する第2のモードとを切り替えて主要被写体領域の追尾処理を行う。したがって、追尾やマスク抽出処理の状況に応じて、処理内容を好適に変更することにより、確実に主要被写体領域の抽出を行うことができる。 As described above, according to the fourth embodiment, the first mode for continuously detecting the tracking target at the previous tracking based on the tracking result, the tracking elapsed time, the mask extraction processing result, and the like. The main subject area tracking process is performed by switching between the second mode in which the main subject area newly detected by the mask extraction process is detected as a tracking target. Therefore, the main subject region can be reliably extracted by appropriately changing the processing contents in accordance with the status of the tracking or mask extraction processing.
なお、第2実施形態では、追尾処理およびマスク抽出処理の2種類の処理を適宜切り替える構成を例示し、第3実施形態および第4実施形態では、追尾処理、マスク抽出処理、
補正マスク抽出処理の3種類の処理を適宜切り替える構成を例示した。また、第2実施形態から第4実施形態では、追尾処理を継続したフレーム数、追尾処理の結果とマスク抽出処理の結果との差異、追尾処理の成否、追尾処理を継続した時間、追尾処理に基づくマスクの状態、マスク抽出処理の成否等に基づいて、上述した各処理を適宜切り替える構成を例示した。しかし、各実施形態で説明した処理の組み合わせや、処理を切り替えるトリガーの組み合わせはどのようなものであっても良い。
The second embodiment exemplifies a configuration that appropriately switches between two types of processing, tracking processing and mask extraction processing. In the third and fourth embodiments, tracking processing, mask extraction processing,
A configuration in which the three types of correction mask extraction processing are appropriately switched is illustrated. In the second to fourth embodiments, the number of frames for which the tracking process has been continued, the difference between the result of the tracking process and the result of the mask extraction process, the success or failure of the tracking process, the time for which the tracking process has been continued, The configuration in which each process described above is appropriately switched based on the state of the mask based on the success or failure of the mask extraction process is illustrated. However, any combination of processes described in the embodiments and combinations of triggers for switching processes may be used.
トリガーとしては、上述した各例を含めて、以下1)から6)からのようなものが考えられる。
1)追尾処理において検出される主要被写体領域の位置の変化量が、初期の追尾処理を基準として、所定の閾値を超えた場合、あるいは、上述した変化量が、前回(あるいは数回前)の追尾処理を基準として、所定の閾値を超えた場合。マスク抽出処理については、逆に、マスク抽出処理において検出される主要被写体領域の位置の変化量が、初期のマスク抽出処理を基準として、所定の閾値を下回った場合、あるいは、上述した変化量が、前回(あるいは数回前)のマスク抽出処理を基準として、所定の閾値を下回った場合。補正マスク抽出処理については、上述した追尾処理またはマスク抽出処理との相対的な関係において、補正マスク抽出処理において検出される主要被写体領域の位置の変化量が、初期の補正マスク抽出処理を基準として、所定の閾値を超えたか下回った場合、あるいは、上述した変化量が、前回(あるいは数回前)の補正マスク抽出処理を基準として、所定の閾値を超えるか下回った場合。
2)1)の位置の変化量に代えて、追尾処理において検出される主要被写体領域の大きさの変化量。
3)1)の位置の変化量に代えて、追尾処理において検出される主要被写体領域の明るさの変化量が。
4)1)の位置の変化量に代えて、追尾処理において検出される主要被写体領域の色の変化量。
5)1)の位置の変化量に代えて、追尾処理において検出される主要被写体領域の形状(アスペクト比、充填率など)の変化量。
6)追尾処理、マスク抽出処理、補正マスク抽出処理の何れかにおいて、検出に失敗した場合、あるいは、検出の精度が非常に低下した場合。
As triggers, the following ones from 1) to 6) can be considered including the above-described examples.
1) When the amount of change in the position of the main subject area detected in the tracking process exceeds a predetermined threshold with reference to the initial tracking process, or when the above-described change amount is the previous (or several times before) When a predetermined threshold is exceeded based on the tracking process. Concerning the mask extraction processing, conversely, when the amount of change in the position of the main subject area detected in the mask extraction processing falls below a predetermined threshold with reference to the initial mask extraction processing, or the amount of change described above When the threshold value is below a predetermined threshold on the basis of the previous (or several times before) mask extraction process. With respect to the correction mask extraction process, the amount of change in the position of the main subject area detected in the correction mask extraction process in relation to the tracking process or the mask extraction process described above is based on the initial correction mask extraction process. When the threshold value exceeds or falls below the predetermined threshold value, or when the above-described change amount exceeds or falls below the predetermined threshold value based on the correction mask extraction process of the previous time (or several times before).
2) A change amount of the size of the main subject area detected in the tracking process instead of the change amount of the position of 1).
3) Instead of the change amount of the position of 1), the change amount of the brightness of the main subject area detected in the tracking process.
4) The amount of change in the color of the main subject area detected in the tracking process instead of the amount of change in the position of 1).
5) A change amount of the shape (aspect ratio, filling rate, etc.) of the main subject area detected in the tracking process instead of the change amount of the position of 1).
6) When the detection fails in any of the tracking process, the mask extraction process, and the correction mask extraction process, or when the detection accuracy is very low.
また、処理の切り替えとしては、上述した各例を含めて、以下1)および2)のようなものが考えられる。
1)上述した各変化量の度合に応じて、上述した複数種類の処理を適宜切り替える。例えば、追尾処理、マスク抽出処理、補正マスク抽出処理の3種類の処理を切り替える場合、検出精度はマスク抽出処理、補正マスク抽出処理、追尾処理の順で高く、検出負荷は追尾処理、補正マスク処理、マスク処理の順で軽い。
In addition, as the process switching, the following 1) and 2) are conceivable including the above-described examples.
1) The above-described plurality of types of processing are appropriately switched according to the degree of each change amount described above. For example, when switching between three types of processing, that is, tracking processing, mask extraction processing, and correction mask extraction processing, the detection accuracy is higher in the order of mask extraction processing, correction mask extraction processing, and tracking processing, and the detection load is tracking processing and correction mask processing. Light in the order of mask processing.
したがって、例えば、追尾処理を実行中に、上述した変化量を監視し、所定の閾値を超えた場合には精度を重視して補正マスク抽出処理に移行し、補正マスク抽出処理に移行した後に、変化量がさらに所定の閾値を超えた場合にはさらなる精度を重視してマスク抽出処理に移行しても良い。また、追尾処理を実行中に、上述した変化量を監視し、その変化量が中程度に大きい場合には補正マスク抽出処理に移行する一方、変化量が非常に大きい場合には補正マスク抽出処理を経由せずに、追尾処理からマスク抽出処理に移行しても良い。 Therefore, for example, during the tracking process, the amount of change described above is monitored, and when a predetermined threshold is exceeded, the process shifts to the correction mask extraction process with emphasis on accuracy, and after the process shifts to the correction mask extraction process, When the amount of change further exceeds a predetermined threshold value, the process may be shifted to mask extraction processing with an emphasis on further accuracy. Also, during the tracking process, the above-described change amount is monitored, and if the change amount is moderately large, the process proceeds to the correction mask extraction process, whereas if the change amount is very large, the correction mask extraction process is performed. The process may be shifted from the tracking process to the mask extraction process without going through the process.
逆に、マスク抽出処理を実行中に、上述した変化量を監視し、所定の閾値を下回った場合には負荷の軽減を重視して補正マスク抽出処理に移行し、補正マスク抽出処理に移行した後に、変化量がさらに所定の閾値を下回った場合にはさらなる負荷の軽減を重視して追尾処理に移行しても良い。また、マスク抽出処理を実行中に、上述した変化量を監視し、
その変化量が中程度に小さい場合には補正マスク抽出処理に移行する一方、変化量が非常に小さい場合には補正マスク抽出処理を経由せずに、マスク抽出処理から追尾処理に移行しても良い。
2)上述した追尾処理、マスク抽出処理、補正マスク抽出処理の何れかによる検出の成否に応じて、上述した複数種類の処理を適宜切り替える。例えば、追尾処理を実行中に、追尾処理による検出が失敗した場合には精度を重視して補正マスク抽出処理に移行し、補正マスク抽出処理に移行した後に、補正マスク抽出処理による検出が失敗した場合にはさらなる精度を重視してマスク抽出処理に移行しても良い。また、追尾処理を実行中に、追尾処理による検出が失敗した場合に、補正マスク抽出処理を経由せずに、追尾処理からマスク抽出処理に移行しても良い。
逆に、マスク抽出処理を実行中に、マスク抽出処理による検出が有る程度連続して成功した場合には負荷の軽減を重視して補正マスク抽出処理に移行し、補正マスク抽出処理に移行した後に、補正マスク抽出処理による検出が有る程度連続して成功した場合にはさらなる負荷の軽減を重視して追尾処理に移行しても良い。
Conversely, while the mask extraction process is being performed, the amount of change described above is monitored, and if it falls below a predetermined threshold value, the shift to the correction mask extraction process is made with emphasis on reducing the load, and the process proceeds to the correction mask extraction process. Later, when the amount of change further falls below a predetermined threshold value, the load may be shifted to the tracking process with an emphasis on further load reduction. In addition, during the mask extraction process, the amount of change described above is monitored,
When the amount of change is moderate, the process proceeds to correction mask extraction processing, while when the amount of change is very small, the process proceeds from mask extraction processing to tracking processing without going through correction mask extraction processing. good.
2) The plurality of types of processing described above are switched as appropriate according to the success or failure of detection by any of the tracking processing, mask extraction processing, or correction mask extraction processing described above. For example, if detection by the tracking process fails during execution of the tracking process, the process shifts to the correction mask extraction process with emphasis on accuracy, and after the shift to the correction mask extraction process, the detection by the correction mask extraction process fails. In this case, the mask extraction process may be shifted with emphasis on further accuracy. Further, when the detection by the tracking process fails during the tracking process, the tracking process may be shifted to the mask extracting process without going through the correction mask extracting process.
On the other hand, when the mask extraction process is successful, if the detection succeeds to some extent by the mask extraction process, after shifting to the correction mask extraction process with emphasis on reducing the load, If the detection by the correction mask extraction process succeeds to some extent, the process may be shifted to the tracking process with an emphasis on further load reduction.
また、上述した各トリガーや処理の切り替え方法を複数備え、画像解析、シーン解析、撮影モードの種類などにより判別し、ケース毎に予め定められたトリガーを用いて処理の切り替えを行う構成としても良い。この場合、ケース毎に適切な閾値や判定条件を定めることが好ましい。 In addition, a plurality of triggers and process switching methods described above may be provided, and the process may be switched by using a trigger predetermined for each case according to the type of image analysis, scene analysis, and shooting mode. . In this case, it is preferable to determine an appropriate threshold value and determination condition for each case.
以上、この発明の実施形態について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。 The embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and includes designs and the like that do not depart from the gist of the present invention.
上述の各実施形態において、追尾処理、マスク抽出処理、補正マスク抽出処理による検出では、単数の主要被写体領域が検出されても良いし、複数の主要被写体領域が検出されても良い。複数の主要被写体領域が検出される場合は、表示部23に主要被写体領域の情報を表示する際に、表示内容を工夫することが好ましい。例えば、表示枠の色を変える、線の太さを変える、線の濃淡を変える、線の種類(実線/点線)を変えるなどし、区別可能とするのが好ましい。 In each of the above-described embodiments, a single main subject region or a plurality of main subject regions may be detected in the detection by the tracking process, the mask extraction process, and the correction mask extraction process. When a plurality of main subject areas are detected, it is preferable to devise display contents when displaying information on the main subject area on the display unit 23. For example, it is preferable to make the distinction possible by changing the color of the display frame, changing the thickness of the line, changing the density of the line, changing the type of line (solid line / dotted line), and the like.
また、複数の主要被写体領域のうち、一部の主要被写体領域のみを対象として以降の各処理を行う場合には、対象外となる主要被写体領域についても一部の処理を行い、情報の記録のみを行っても良い。また、複数の主要被写体領域が検出された場合には、表示部23等を利用して、エラー表示を行っても良い。 In addition, when performing the following processes for only a part of the main subject areas among the plurality of main subject areas, a part of the processing is also performed for the main subject areas that are not targeted, and only information recording is performed. May be performed. Further, when a plurality of main subject areas are detected, an error display may be performed using the display unit 23 or the like.
また、上述の各実施形態において、自動検出モードの中断処理、再開処理を適宜実行しても良い。例えば、上述した自動検出モードにおいて、一定の時間を経過しても主要被写体領域を検出できない場合など、自動検出モードによる検出は困難である場合には、自動検出モードから通常モードなどのモードへ自動で変更する構成としても良い。さらに、自動検出モードからその他のモードへの変更を行った後に、撮像装置20の動き量や動きセンサの出力に応じて、自動検出モードを再開しても良い。
Further, in each of the above-described embodiments, the automatic detection mode interruption processing and resumption processing may be appropriately executed. For example, in the above-described automatic detection mode, when detection in the automatic detection mode is difficult, such as when the main subject region cannot be detected even after a certain period of time, the automatic detection mode is automatically switched to the normal mode. It is good also as a structure changed by. Furthermore, after changing from the automatic detection mode to another mode, the automatic detection mode may be resumed according to the amount of motion of the
また、上記の各実施形態においては、構図確認用のスルー画像に基づいて、一連の処理を行う例を示したが、本発明はこの例に限定されない。例えば、一眼レフカメラなどにおいて生成される構図確認用のライブビュー画像を対象とする場合にも、本発明を同様に適用することができる。また、記録媒体40等に記録された動画像を対象とする場合にも、本発明を同様に適用することができる。
In each of the above embodiments, an example in which a series of processing is performed based on a through image for composition confirmation has been described, but the present invention is not limited to this example. For example, the present invention can be similarly applied to a case where a live view image for composition confirmation generated in a single-lens reflex camera or the like is targeted. Further, the present invention can be similarly applied to a case where a moving image recorded on the
また、上記の各実施形態においては、すべてのフレームを対象として一連の処理を行う例を示したが、本発明はこの例に限定されない。例えば、時間的に間欠して生成された複数の画像を対象としても良い。具体的には、適宜フレーム間引きを行った複数の画像を対象としても良い。このような処理を行うことにより、処理負荷を軽減することができる。 In each of the above embodiments, an example in which a series of processing is performed for all frames has been described. However, the present invention is not limited to this example. For example, a plurality of images generated intermittently in time may be targeted. Specifically, a plurality of images subjected to frame thinning as appropriate may be targeted. By performing such processing, the processing load can be reduced.
また、コンピュータと画像処理プログラムとからなる「コンピュータシステム」により、上述した各実施形態で説明した画像処理をソフトウェア的に実現しても良い。この場合、各実施形態で説明したフローチャートの処理の一部または全部をコンピュータシステムで実行する構成とすれば良い。例えば、図2のステップS101からステップS105の処理の一部または全部をコンピュータで実行しても良い。また、図3のステップS201からステップS206の処理の一部または全部をコンピュータで実行しても良い。また、図4のステップS301からステップS308の処理の一部または全部をコンピュータで実行しても良い。また、図5のステップS401からステップS410の処理の一部または全部をコンピュータで実行しても良い。このような構成とすることにより、上述した各実施形態と同様の処理を実施することが可能になる。 Further, the image processing described in each of the above-described embodiments may be realized by software by a “computer system” including a computer and an image processing program. In this case, the computer system may be configured to execute part or all of the processing of the flowcharts described in the embodiments. For example, part or all of the processing from step S101 to step S105 in FIG. 2 may be executed by a computer. Also, part or all of the processing from step S201 to step S206 in FIG. 3 may be executed by a computer. Also, some or all of the processing from step S301 to step S308 in FIG. 4 may be executed by a computer. Also, some or all of the processing from step S401 to step S410 in FIG. 5 may be executed by a computer. By adopting such a configuration, it is possible to perform the same processing as in the above-described embodiments.
また、「コンピュータシステム」は、wwwシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。また、コンピュータ読み取り可能な記録媒体とは、フレキシブルディスク、光磁気ディスク、ROM、フラッシュメモリ等の書き込み可能な不揮発性メモリ、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。 Further, the “computer system” includes a homepage providing environment (or display environment) if a www system is used. The computer-readable recording medium is a writable nonvolatile memory such as a flexible disk, a magneto-optical disk, a ROM, or a flash memory, a portable medium such as a CD-ROM, and a storage such as a hard disk built in the computer system. Refers to the device.
さらにコンピュータ読み取り可能な記録媒体とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリ(例えばDRAM(Dynamic Random Access Memory))のように、一定時間プログラムを保持しているものも含むものとする。 Further, the computer-readable recording medium is a volatile memory (for example, DRAM (Dynamic Random Access) in a computer system serving as a server or a client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. Memory)) that holds a program for a certain period of time is also included.
また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。 The program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line.
また、上記プログラムは、前述した機能の一部を実現するためのものであっても良い。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。 The program may be for realizing a part of the functions described above. Furthermore, what can implement | achieve the function mentioned above in combination with the program already recorded on the computer system, and what is called a difference file (difference program) may be sufficient.
20…撮像装置、21…撮像部、22…画像処理装置、23‥表示部、26…CPU
DESCRIPTION OF
Claims (1)
前記取得部により取得した前記画像データにより示される画像の特徴量を算出し、前記特徴量に基づいて被写体領域を検出する領域検出部と、
前記領域検出部により前記被写体領域を検出すると、検出した前記被写体領域を追尾対象として、前記追尾対象を複数の前記画像から検出する追尾部と
を備えることを特徴とする画像処理装置。 An acquisition unit that sequentially acquires a plurality of pieces of image data generated continuously in time;
A region detection unit that calculates a feature amount of an image indicated by the image data acquired by the acquisition unit and detects a subject region based on the feature amount;
An image processing apparatus comprising: a tracking unit configured to detect the tracking target from a plurality of the images, with the detected subject region detected as the tracking target when the region detection unit detects the subject region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018038635A JP2018116723A (en) | 2018-03-05 | 2018-03-05 | Image processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018038635A JP2018116723A (en) | 2018-03-05 | 2018-03-05 | Image processing system |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013112777A Division JP2014232418A (en) | 2013-05-29 | 2013-05-29 | Image processing apparatus, imaging device, and image processing program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2018116723A true JP2018116723A (en) | 2018-07-26 |
Family
ID=62984021
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018038635A Pending JP2018116723A (en) | 2018-03-05 | 2018-03-05 | Image processing system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2018116723A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010157924A (en) * | 2008-12-26 | 2010-07-15 | Canon Inc | Subject tracking apparatus, method for controlling the same, imaging apparatus, display apparatus and program |
JP2011015201A (en) * | 2009-07-02 | 2011-01-20 | Nikon Corp | Electronic camera |
-
2018
- 2018-03-05 JP JP2018038635A patent/JP2018116723A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010157924A (en) * | 2008-12-26 | 2010-07-15 | Canon Inc | Subject tracking apparatus, method for controlling the same, imaging apparatus, display apparatus and program |
JP2011015201A (en) * | 2009-07-02 | 2011-01-20 | Nikon Corp | Electronic camera |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6518452B2 (en) | Imaging apparatus and imaging method | |
JP7086571B2 (en) | Image pickup device, lens device and control method thereof | |
US10530986B2 (en) | Image capturing apparatus, image capturing method, and storage medium | |
JP5115210B2 (en) | Imaging device | |
JP5950664B2 (en) | Imaging apparatus and control method thereof | |
JP2010054730A (en) | Focusing position detecting device, imaging apparatus, and focusing position detecting method | |
JP2020022012A (en) | Imaging device and control method thereof | |
JP5217451B2 (en) | Imaging device | |
JP5169542B2 (en) | Electronic camera | |
US11985420B2 (en) | Image processing device, image processing method, program, and imaging device | |
JP2018116723A (en) | Image processing system | |
JP2019041414A (en) | Electronic apparatus, imaging apparatus, and program | |
JP2014023054A (en) | Image processing apparatus, imaging apparatus, and image processing program | |
JP2009188480A (en) | Subject tracing program, subject tracing device, and camera | |
JP6273766B2 (en) | Image processing apparatus, imaging apparatus, and image processing program | |
JP2016032180A (en) | Imaging apparatus, control method and program | |
JP2014232418A (en) | Image processing apparatus, imaging device, and image processing program | |
JP6421032B2 (en) | Focus detection apparatus, focus detection method, and focus detection program | |
JP6443486B2 (en) | Image processing apparatus, imaging apparatus, and image processing program | |
US9525815B2 (en) | Imaging apparatus, method for controlling the same, and recording medium to control light emission | |
JP2017223865A (en) | Imaging device and automatic focus adjustment method | |
JP2006215379A (en) | Imaging apparatus and imaging method | |
JP6858022B2 (en) | Focus detector, its control method and program, and imaging device | |
JP6303395B2 (en) | Image processing apparatus, imaging apparatus, and image processing program | |
JP2019205172A (en) | Image processing apparatus, imaging apparatus, and image processing program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180307 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20190306 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20190319 |
|
A601 | Written request for extension of time |
Free format text: JAPANESE INTERMEDIATE CODE: A601 Effective date: 20190517 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20190718 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20191210 |