JP6489150B2 - Image processing apparatus and imaging apparatus - Google Patents

Image processing apparatus and imaging apparatus Download PDF

Info

Publication number
JP6489150B2
JP6489150B2 JP2017088041A JP2017088041A JP6489150B2 JP 6489150 B2 JP6489150 B2 JP 6489150B2 JP 2017088041 A JP2017088041 A JP 2017088041A JP 2017088041 A JP2017088041 A JP 2017088041A JP 6489150 B2 JP6489150 B2 JP 6489150B2
Authority
JP
Japan
Prior art keywords
image
mask
subject
area
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2017088041A
Other languages
Japanese (ja)
Other versions
JP2017192131A (en
Inventor
鉾井 逸人
逸人 鉾井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nikon Corp
Original Assignee
Nikon Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nikon Corp filed Critical Nikon Corp
Priority to JP2017088041A priority Critical patent/JP6489150B2/en
Publication of JP2017192131A publication Critical patent/JP2017192131A/en
Application granted granted Critical
Publication of JP6489150B2 publication Critical patent/JP6489150B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像処理装置及び撮像装置に関する。 The present invention relates to an image processing apparatus and an imaging apparatus .

従来、被写体の動きに合わせて、焦点調節時に用いるフォーカスエリアを追従させる、所謂追尾に関して様々な技術が考案されている。この追尾に関する技術として、カメラに近づく、或いはカメラから離れる方向に移動する被写体の形状や大きさ等に応じて、AF測距枠を変化させる技術がある(特許文献1参照)。   Conventionally, various techniques have been devised for so-called tracking in which a focus area used for focus adjustment is followed in accordance with the movement of a subject. As a technique related to this tracking, there is a technique for changing an AF distance measurement frame in accordance with the shape or size of a subject that moves toward or away from the camera (see Patent Document 1).

特開2009−69748号公報JP 2009-69748 A

上述した特許文献1は、カメラに近づく又はカメラから離れる方向に移動する被写体に対して焦点調節を行う場合に効果的な技術である。しかしながら、被写体の動きはカメラに近づく又はカメラから離れる方向に移動するばかりではない。このため、追尾対象となる被写体が撮影範囲(画角)から外れてしまう場合や、他の被写体が入り込む場合など、画角内における被写体の変化に応じて、追尾対象となる被写体を切り替える技術については考慮されていない。   Patent Document 1 described above is an effective technique when focus adjustment is performed on a subject that moves in a direction that approaches or moves away from the camera. However, the movement of the subject does not only move toward or away from the camera. For this reason, a technique for switching a subject to be tracked according to a change in the subject within the angle of view, such as when the subject to be tracked is out of the shooting range (angle of view) or when another subject enters. Is not considered.

本発明は、上述した課題を鑑みて発明されたものであり、追尾対象とする被写体の切り替えを、容易且つ的確に行うことを目的とする。   The present invention has been invented in view of the above-described problems, and an object thereof is to easily and accurately switch a subject to be tracked.

本発明の画像処理装置は、特定の被写体を追尾対象とする画像処理装置であって、第1画像に含まれている被写体と前記第1画像よりも後に生成される第2画像に含まれている被写体とを検出する検出部と、前記検出部により、前記第1画像の中心部分を含む第1領域において追尾対象になっている第1被写体が検出され、かつ、前記第2画像の中心部分を含み、前記第1領域よりも面積の大きい第2領域において前記第1被写体が検出されず、前記第2画像の中心部分を含み、前記第2領域よりも面積の小さい第3領域において前記第1被写体とは異なる第2被写体が検出されると、前記第1被写体から切り替えて前記第2被写体を前記特定の被写体として設定する設定部と、を備え、前記第3領域は、前記第2画像において前記第2領域に含まれ、前記第1画像の前記第1領域と面積、形状及び位置が対応する。
また、本発明の画像処理装置は、特定の被写体を追尾対象とする画像処理装置であって、第1画像に含まれている被写体と前記第1画像よりも後に生成される第2画像に含まれている被写体とを検出する検出部と、前記検出部により前記第1画像の中心部分を含む第1領域において検出された、追尾対象になっている第1被写体が、前記検出部により、前記第2画像の中心部分を含み、前記第1領域よりも面積の大きい第2領域において検出されず、かつ、前記第2画像の中心部分を含み、前記第2領域よりも面積の小さい第3領域において第2被写体が検出されると、前記第1被写体から切り替えて前記第2被写体を前記特定の被写体として設定する設定部と、を備え、前記第3領域は、前記第2画像において前記第2領域に含まれ、前記第1画像の前記第1領域と面積、形状及び位置が対応する。
また、本発明の撮像装置は、上述した画像処理装置を備える。
The image processing apparatus of the present invention is an image processing apparatus that targets a specific subject as a tracking target, and is included in a subject included in the first image and a second image generated after the first image. A detection unit that detects a subject that is present, and the detection unit detects a first subject that is a tracking target in a first region that includes a central portion of the first image, and a central portion of the second image The first subject is not detected in the second region having a larger area than the first region , and includes the central portion of the second image, and the third region having a smaller area than the second region. When a different second object is detected as 1 subject, and a setting unit that sets the second object as the specific object is switched from the first object, the third region, the second image In the second region Included, the first region and the area of the first image, the shape and position corresponding.
The image processing apparatus according to the present invention is an image processing apparatus for tracking a specific subject, and is included in a subject included in the first image and a second image generated after the first image. A detection unit that detects a subject that is being tracked, and a first subject that is detected in a first region including a central portion of the first image by the detection unit, A third region including a central portion of the second image and not detected in a second region having a larger area than the first region, and including a central portion of the second image and having a smaller area than the second region; When the second object is detected in, and a setting unit that sets the second object as the specific object is switched from the first object, the third region, said in the second image a second Included in the region, said Wherein the first region and the area of one image, shape and position correspond.
The imaging apparatus of the present invention includes the above-described image processing apparatus.

本発明によれば、追尾対象とする被写体の切り替えを、容易且つ的確に行うことができる。   According to the present invention, it is possible to easily and accurately switch the subject to be tracked.

撮像装置の構成における一形態を示す機能ブロック図である。It is a functional block diagram which shows one form in the structure of an imaging device. 画像処理回路の一形態を示す機能ブロック図である。It is a functional block diagram showing one form of an image processing circuit. スルー画像に対して設定される、マスク評価時の領域A及び領域Bの一例を示す図である。It is a figure which shows an example of the area | region A and the area | region B at the time of mask evaluation set with respect to a through image. 撮像時の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process at the time of imaging. 撮像時の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process at the time of imaging. (a)は静止する被写体が画角の中央部分に位置する場合のスルー画像及びマスクの一形態を示す図、(b)はマスクに対する評価値の変化の一例を示す図である。(A) is a figure which shows an example of a through image and a mask in case the to-be-photographed object is located in the center part of an angle of view, (b) is a figure which shows an example of the change of the evaluation value with respect to a mask. (a)は静止する被写体が画角の周縁部分に位置する場合のスルー画像及びマスクの一形態を示す図、(b)はマスクに対する評価値の変化を示す図である。(A) is a figure which shows one form of a through image and a mask in case the to-be-photographed object is located in the peripheral part of a view angle, (b) is a figure which shows the change of the evaluation value with respect to a mask. (a)は被写体が画角の中央部分に移動する場合のスルー画像及び抽出されるマスクの一形態を示す図、(b)はマスクに対する評価値の変化を示す図である。(A) is a figure which shows one form of the through image and mask extracted when a to-be-photographed object moves to the center part of a view angle, (b) is a figure which shows the change of the evaluation value with respect to a mask. (a)は画角の中央部分に位置する被写体が画角外に向けて移動する場合のスルー画像及びマスクの一形態を示す図、(b)はマスクに対する評価値の変化を示す図である。(A) is a figure which shows one form of a through image and a mask in case the subject located in the center part of an angle of view moves outside an angle of view, (b) is a figure which shows the change of the evaluation value with respect to a mask. . (a)〜(c)は、画角の中央部分に位置する被写体が画角外に移動し、他の被写体が画角の中央部分に向けて移動する場合のスルー画像及びマスクの一形態を示す図、(d)は画角外に移動した被写体が再度画角内に移動した場合のスルー画像及びマスクの一形態を示す図である。(A)-(c) shows one form of a through image and a mask in the case where a subject located at the center portion of the angle of view moves outside the angle of view and other subjects move toward the center portion of the angle of view. FIG. 4D is a diagram illustrating one form of a through image and a mask when a subject that has moved outside the angle of view moves again within the angle of view. 図10(a)〜(c)における各マスクの評価値の変化を示す図である。It is a figure which shows the change of the evaluation value of each mask in Fig.10 (a)-(c). (a)は、複数の被写体が画角に含まれる場合のスルー画像及びマスクの一形態を示す図、(b)は、複数の被写体のうち、2つの被写体が移動した場合のスルー画像及びマスクの一形態を示す図である。(A) is a diagram showing one form of a through image and a mask when a plurality of subjects are included in the angle of view, and (b) is a through image and a mask when two subjects among the plurality of subjects move. It is a figure which shows one form. 図12における各マスクの評価値の変化を示す図である。It is a figure which shows the change of the evaluation value of each mask in FIG.

以下、撮像装置の一形態について、図1を用いて説明する。この撮像装置10は、装置本体11、レンズ鏡筒12から構成される。ここで、レンズ鏡筒12は、装置本体11に一体であってもよいし、着脱できるものであってもよい。   Hereinafter, an embodiment of the imaging device will be described with reference to FIG. The imaging device 10 includes a device main body 11 and a lens barrel 12. Here, the lens barrel 12 may be integrated with the apparatus main body 11 or may be detachable.

装置本体11は、撮像部21、画像処理回路22、表示部23、バッファメモリ部24、記憶部25、CPU26、操作部27及び通信部28を備えている。撮像部21、画像処理回路22、表示部23、バッファメモリ部24、記憶部25、CPU26、操作部27及び通信部28は、バスを介して電気的に接続される。なお、本発明の画像処理装置は、CPU26及び画像処理回路22からなる。   The apparatus main body 11 includes an imaging unit 21, an image processing circuit 22, a display unit 23, a buffer memory unit 24, a storage unit 25, a CPU 26, an operation unit 27, and a communication unit 28. The imaging unit 21, the image processing circuit 22, the display unit 23, the buffer memory unit 24, the storage unit 25, the CPU 26, the operation unit 27, and the communication unit 28 are electrically connected via a bus. The image processing apparatus of the present invention includes a CPU 26 and an image processing circuit 22.

撮像部21は、撮像素子29、A/D(Analog/Digital)変換部30を有している。撮像部21は、設定された撮像条件(例えば露出値、シャッタ速度等)に従って、CPU26により、その動作が制御される。   The imaging unit 21 includes an imaging element 29 and an A / D (Analog / Digital) conversion unit 30. The operation of the imaging unit 21 is controlled by the CPU 26 in accordance with the set imaging conditions (for example, exposure value, shutter speed, etc.).

撮像素子29は、光電変換面を備え、レンズ鏡筒12により光電変換面に結像された光学像を電気信号に変換して、A/D変換部30に出力する。撮像素子29は、例えば、CMOS(Complementary Metal Oxide Semiconductor)などの光電変換素子で構成される。ここで、撮像素子29は、光電変換面の全領域において光学像を電気信号に変換してもよいし、光電変換面の一部領域において光学像を電気信号に変換するようにしてもよい。この撮像素子29から出力される電気信号が画像データとなる。   The imaging device 29 includes a photoelectric conversion surface, converts an optical image formed on the photoelectric conversion surface by the lens barrel 12 into an electric signal, and outputs the electric signal to the A / D conversion unit 30. The imaging element 29 is configured by a photoelectric conversion element such as a CMOS (Complementary Metal Oxide Semiconductor), for example. Here, the imaging element 29 may convert the optical image into an electric signal in the entire region of the photoelectric conversion surface, or may convert the optical image into an electric signal in a partial region of the photoelectric conversion surface. The electrical signal output from the image sensor 29 becomes image data.

A/D変換部30は、撮像素子29から出力される画像データをデジタル化して、デジタル化した画像データをバッファメモリ部24等に出力する。   The A / D conversion unit 30 digitizes the image data output from the image sensor 29 and outputs the digitized image data to the buffer memory unit 24 or the like.

画像処理回路22は、記憶部25に記憶されている画像処理条件に基づいて、バッファメモリ部24に一時的に記憶されている画像データに対する画像処理を行う。ここで、画像処理としては、ホワイトバランス調整、補間処理、色調補正処理、階調変換処理などが挙げられる。画像処理回路22にて画像処理が施された画像データは、バッファメモリ部24に一次記憶される他、通信部28を介して記憶媒体31に記憶される。   The image processing circuit 22 performs image processing on the image data temporarily stored in the buffer memory unit 24 based on the image processing conditions stored in the storage unit 25. Here, examples of the image processing include white balance adjustment, interpolation processing, color tone correction processing, and gradation conversion processing. Image data subjected to image processing by the image processing circuit 22 is temporarily stored in the buffer memory unit 24 and also stored in the storage medium 31 via the communication unit 28.

また、画像処理回路22は、撮影指示が行われていない状態で撮像部21にて連続して得られる画像データを用いて、主要被写体領域を設定する処理を実行する。ここで、撮影指示が行われていない状態で撮像部21にて連続して得られる画像データを、スルー画像データと称する。なお、主要被写体領域を設定する処理については、後述する。   In addition, the image processing circuit 22 executes a process of setting a main subject region using image data continuously obtained by the imaging unit 21 in a state where no photographing instruction is performed. Here, the image data continuously obtained by the imaging unit 21 in a state where no photographing instruction is performed is referred to as through image data. The process for setting the main subject area will be described later.

表示部23は、例えば液晶ディスプレイが挙げられる。この表示部23は制御部を有し、この制御部により表示部23における画像の表示制御が行われる。ここで、表示部23に表示される画像としては、撮像部21により得られた画像データに基づく画像や、各種設定を行う際に表示する画像が挙げられる。バッファメモリ部24は、撮像部21によって生成された画像データや画像処理回路22によって画像処理が施された画像データを一時的に記憶する。記憶部25は、撮像条件や、各種判定の際にCPU26によって参照される判定条件などを記憶する。   An example of the display unit 23 is a liquid crystal display. The display unit 23 includes a control unit, and display control of images on the display unit 23 is performed by the control unit. Here, examples of the image displayed on the display unit 23 include an image based on image data obtained by the imaging unit 21 and an image displayed when various settings are performed. The buffer memory unit 24 temporarily stores the image data generated by the imaging unit 21 and the image data subjected to image processing by the image processing circuit 22. The storage unit 25 stores imaging conditions, determination conditions referred to by the CPU 26 in various determinations, and the like.

CPU26は、画像処理回路22や記憶部25などから取得した情報や、操作部27の操作状態などに基づいて、装置本体11の各部を統括的に制御する。CPU26による制御には、焦点調整(AF)の設定、露出調整(AE)の設定、ホワイトバランス調整(AWB)の設定、閃光の発光量の変更の設定、被写体追尾の設定、各種撮影モードの設定、各種画像処理の設定、各種表示の設定、ズーム倍率に連動した明るさの最適化の設定などが含まれる。   The CPU 26 comprehensively controls each unit of the apparatus main body 11 based on information acquired from the image processing circuit 22 and the storage unit 25 and the operation state of the operation unit 27. Control by the CPU 26 includes focus adjustment (AF) setting, exposure adjustment (AE) setting, white balance adjustment (AWB) setting, flash emission amount change setting, subject tracking setting, and various shooting mode settings. , Various image processing settings, various display settings, brightness optimization settings linked to zoom magnification, and the like.

操作部27は、電源スイッチ、シャッタボタン、マルチセレクタ(十字キー)、又はその他の操作キーから構成される。なお、表示部23がタッチパネルを備えた表示部23となる場合、タッチパネルも操作部27として機能する。この操作部27は、ユーザの操作入力を受け付け、操作入力に応じた信号をCPU26に出力する。   The operation unit 27 includes a power switch, a shutter button, a multi selector (cross key), or other operation keys. When the display unit 23 is the display unit 23 including a touch panel, the touch panel also functions as the operation unit 27. The operation unit 27 receives a user operation input and outputs a signal corresponding to the operation input to the CPU 26.

通信部28は、不揮発性メモリからなるメモリカード等、装置本体11に対して着脱することができる記憶媒体31と電気的に接続される。通信部28は、装置本体11に装着された記憶媒体31にデータ(画像データ、領域の情報など)を書き込む、記憶媒体31に記憶されたデータを消去する。また、通信部28は、必要に応じて、記憶媒体31に記憶されたデータの読み出しを行う。   The communication unit 28 is electrically connected to a storage medium 31 that can be attached to and detached from the apparatus main body 11 such as a memory card including a nonvolatile memory. The communication unit 28 writes data (image data, area information, etc.) to the storage medium 31 attached to the apparatus main body 11 and erases the data stored in the storage medium 31. Further, the communication unit 28 reads data stored in the storage medium 31 as necessary.

レンズ鏡筒12は、撮像光学系35、レンズ駆動部36、エンコーダ37、鏡筒制御部38を有している。撮像光学系35はフォーカスレンズやズームレンズなどの複数のレンズを有している。この撮像光学系35の各レンズは、レンズ駆動部36により、その位置が光軸方向に移動するように制御される。撮像光学系35は、装置本体11に設けられた撮像素子29の受光面(光電変換面)に取り込まれた光学像を導く。   The lens barrel 12 includes an imaging optical system 35, a lens driving unit 36, an encoder 37, and a barrel control unit 38. The imaging optical system 35 has a plurality of lenses such as a focus lens and a zoom lens. Each lens of the imaging optical system 35 is controlled by the lens driving unit 36 so that the position thereof moves in the optical axis direction. The imaging optical system 35 guides the optical image captured on the light receiving surface (photoelectric conversion surface) of the imaging element 29 provided in the apparatus main body 11.

レンズ駆動部36は、例えば駆動モータや、ギヤ機構又はヘリコイド機構などの駆動機構を有し、撮像光学系35の各レンズを光軸方向に移動させる。エンコーダ37は、撮像光学系35のズームレンズやフォーカスレンズが光軸方向に移動したときに、その移動に伴う位置や移動方向を検出し、鏡筒制御部38に出力する。   The lens driving unit 36 includes a driving mechanism such as a driving motor, a gear mechanism, or a helicoid mechanism, and moves each lens of the imaging optical system 35 in the optical axis direction. When the zoom lens or focus lens of the imaging optical system 35 moves in the optical axis direction, the encoder 37 detects the position and moving direction accompanying the movement and outputs the detected position and moving direction to the lens barrel control unit 38.

鏡筒制御部38は、装置本体11のCPU26から入力される駆動制御信号に応じて、レンズ駆動部36を制御する。ここで、駆動制御信号とは、撮像光学系35の各レンズを光軸方向に移動させる制御信号である。鏡筒制御部38は、駆動制御信号に応じて、レンズ駆動部36に出力するパルス電圧のステップ数を制御する。また、鏡筒制御部38は、撮像光学系の各レンズの移動量に応じた信号に基づいて、フォーカスレンズの位置(フォーカスポジション)を、装置本体11のCPU26に出力する。   The lens barrel control unit 38 controls the lens driving unit 36 in accordance with a drive control signal input from the CPU 26 of the apparatus main body 11. Here, the drive control signal is a control signal for moving each lens of the imaging optical system 35 in the optical axis direction. The lens barrel control unit 38 controls the number of steps of the pulse voltage output to the lens driving unit 36 according to the drive control signal. Further, the lens barrel control unit 38 outputs the position (focus position) of the focus lens to the CPU 26 of the apparatus main body 11 based on a signal corresponding to the movement amount of each lens of the imaging optical system.

次に、画像処理回路22の構成について説明する。上述したように、画像処理回路22は、画像処理条件に基づいて画像データに対する画像処理を実行する他に、スルー画像データを用いて、主要被写体領域を設定する処理を実行する。図2に示すように、画像処理回路22は、検出部41、判定部42、追尾部43、評価部44及び設定部45の機能を有している。   Next, the configuration of the image processing circuit 22 will be described. As described above, the image processing circuit 22 executes processing for setting a main subject area using through image data, in addition to performing image processing on image data based on image processing conditions. As shown in FIG. 2, the image processing circuit 22 has functions of a detection unit 41, a determination unit 42, a tracking unit 43, an evaluation unit 44, and a setting unit 45.

検出部41は、撮像部21にて取得されるスルー画像データを用いて、該スルー画像データに基づいた画像に含まれる被写体の領域を検出する。以下、スルー画像データに基づく画像をスルー画像と称する。ここで、被写体の領域を検出する処理としては、画像から得られる特徴量に基づいて被写体の領域を検出するための一手法であるマスク抽出処理が挙げられる。このマスク抽出処理を行うことで、検出部41は、スルー画像に含まれる被写体の領域を検出する。検出部41は、検出された被写体の領域をマスクとした上で、該マスクに係る情報(以下、マスク情報)を記憶部25に記憶する。ここで、マスク情報としては、マスク抽出処理の抽出条件(色区分やマスク区分など)、マスクの位置、マスクの大きさや形状、マスクの動き(移動方向、移動ベクトル)、マスクに該当する被写体までの距離の情報が含まれる。   The detection unit 41 uses the through image data acquired by the imaging unit 21 to detect the area of the subject included in the image based on the through image data. Hereinafter, an image based on the through image data is referred to as a through image. Here, the process for detecting the subject area includes a mask extraction process which is one method for detecting the subject area based on the feature amount obtained from the image. By performing this mask extraction process, the detection unit 41 detects the area of the subject included in the through image. The detection unit 41 stores information relating to the mask (hereinafter referred to as mask information) in the storage unit 25 using the detected subject area as a mask. Here, the mask information includes extraction conditions for mask extraction processing (color classification, mask classification, etc.), mask position, mask size and shape, mask movement (movement direction, movement vector), and subject corresponding to the mask. Contains distance information.

判定部42は、複数のスルー画像のそれぞれから得られるマスク情報を用いて、同一のマスクがn回(nフレーム)以上連続して検出されるか否かを判定する。この判定を行うことで、同一のマスクが安定しているか否かが判定される。   The determination unit 42 determines whether or not the same mask is continuously detected n times (n frames) or more using mask information obtained from each of the plurality of through images. By performing this determination, it is determined whether or not the same mask is stable.

例えば、図示を省略した撮像光学系35における光学ズーム倍率が一定の場合には、対象となるマスクと同色で、且つ同一サイズとなるマスクが、連続するnフレーム以上のスルー画像データのそれぞれで検出されているか否かを判定する。この場合、被写体自体が動いていても、静止していてもよい。   For example, when the optical zoom magnification in the imaging optical system 35 (not shown) is constant, a mask having the same color and the same size as the target mask is detected in each of the through image data of n or more consecutive frames. It is determined whether or not it has been done. In this case, the subject itself may be moving or may be stationary.

また、撮像光学系35における光学ズーム倍率を変更する場合や、撮像光学系35における光学ズーム倍率が一定で被写体又は撮影者が撮像光学系35の光軸方向に変化する場合もある。このような場合、連続して得られるスルー画像においては検出される被写体の領域の大きさが変化する。よって、対象となるマスクと同色となり、且つ光学ズーム倍率に合わせた拡大率又は縮小率でサイズが変化しているマスクが、連続するnフレーム以上のスルー画像のそれぞれで検出されているか否かを判定すればよい。   In some cases, the optical zoom magnification in the imaging optical system 35 is changed, or the subject or the photographer changes in the optical axis direction of the imaging optical system 35 while the optical zoom magnification in the imaging optical system 35 is constant. In such a case, the size of the area of the detected subject changes in through images obtained continuously. Therefore, whether or not a mask having the same color as the target mask and changing in size at an enlargement rate or reduction rate that matches the optical zoom magnification is detected in each of through images of n or more consecutive frames is detected. What is necessary is just to judge.

なお、判定部42においては、同一のマスクがn回(nフレーム)以上連続して検出されるか否かを判定するようにしているが、少なくとも2回(2フレーム)以上連続して検出される場合に、マスクが安定していると判定することができる。なお、マスクが安定しているか否かの判定として用いるスルー画像については、撮像部21から出力される全てのスルー画像を対象としてもよいし、撮像部21から出力されるスルー画像のうち、例えば3フレームおき等、所定フレーム間隔を空けて得られるスルー画像を対象のスルー画像として、対象となるスルー画像を用いて上記判定を行うことも可能である。   In the determination unit 42, it is determined whether or not the same mask is continuously detected n times (n frames) or more, but it is continuously detected at least twice (2 frames) or more. The mask can be determined to be stable. In addition, about the through image used as determination of whether the mask is stable, all the through images output from the imaging unit 21 may be targeted, and among the through images output from the imaging unit 21, for example, It is also possible to make the above determination using a target through image with a through image obtained at predetermined frame intervals, such as every three frames, as the target through image.

追尾部43は、主要被写体領域が設定された以降に得られるスルー画像に対して、例えば主要被写体領域として設定されたマスクを用いたテンプレートマッチングの手法を用い、取得されるスルー画像に含まれる主要被写体領域の位置を特定する。この処理をスルー画像のそれぞれに対して行うことで、主要被写体を追尾することが可能となる。   The tracking unit 43 uses, for example, a template matching method using a mask set as the main subject region for the through image obtained after the main subject region is set, and includes the main image included in the acquired through image. The position of the subject area is specified. By performing this process on each of the through images, the main subject can be tracked.

評価部44は、判定部42において、n回(nフレーム)以上連続して検出されるマスク(主要被写体領域として設定されるマスクも含む)に対する評価を実行する。ここで、評価部44は、記憶部25に記憶されたマスク情報を用いて、マスクに対する評価を行う。   The evaluation unit 44 performs an evaluation on a mask (including a mask set as a main subject region) that is continuously detected n times (n frames) or more in the determination unit 42. Here, the evaluation unit 44 evaluates the mask using the mask information stored in the storage unit 25.

設定部45は、評価部44における評価結果に基づいて主要被写体領域を設定する。ここで、主要被写体領域を設定する処理としては、主要被写体領域が設定されていないときに、新規に主要被写体領域を設定する場合の他に、主要被写体領域が設定されているときに、主要被写体領域となる被写体の領域を切り替える(再設定する)処理が含まれる。設定部45は、主要被写体領域を設定したときに、該設定した情報を記憶部25に書き込む。なお、この情報は、マスク情報に対応付けて記憶してもよいし、個別に記憶してもよい。   The setting unit 45 sets a main subject area based on the evaluation result in the evaluation unit 44. Here, as a process of setting the main subject area, in addition to setting a new main subject area when the main subject area is not set, the main subject area is set when the main subject area is set. A process of switching (resetting) the area of the subject to be an area is included. The setting unit 45 writes the set information in the storage unit 25 when the main subject area is set. This information may be stored in association with the mask information or may be stored individually.

次に、評価部44における評価について説明する。以下、評価部44の評価において使用するマスク情報として、各マスクの位置情報を用いる場合について説明する。   Next, evaluation in the evaluation unit 44 will be described. Hereinafter, the case where the position information of each mask is used as mask information used in the evaluation of the evaluation unit 44 will be described.

評価部44は、n回(nフレーム)以上連続して検出されるマスクに対して評価値を求める。この評価値は、対象となるマスクの位置がスルー画像の中心から近いほど、評価値が高く、スルー画像の周縁部に近いほど、評価値が低くなる。対象となるマスクの評価値を求めた後、評価部44は、対象となるマスクの評価値に対する評価を行う。この評価の結果を用いて、設定部45は、主要被写体領域を設定する。   The evaluation unit 44 obtains an evaluation value for a mask that is continuously detected n times (n frames) or more. The evaluation value is higher as the position of the target mask is closer to the center of the through image, and the evaluation value is lower as it is closer to the peripheral edge of the through image. After obtaining the evaluation value of the target mask, the evaluation unit 44 evaluates the evaluation value of the target mask. Using the result of this evaluation, the setting unit 45 sets a main subject area.

上述した評価は、各マスクに対して求められる評価値と、スルー画像TIに対して設定される領域A及び領域Bのそれぞれに対する値(後述する閾値Ta及びTb)とを比較することで実行される。   The above-described evaluation is executed by comparing the evaluation value obtained for each mask with the values (thresholds Ta and Tb described later) for the areas A and B set for the through image TI. The

図3に示すように、領域Aは、その横方向の長さW及び縦方向の長さHがスルー画像TIの横方向の長さW及び縦方向の長さHのα(α=0.5〜0.6)倍に設定される。この領域Aは、対象となるマスクに該当する被写体が主要被写体であれば、画角の中央の領域に位置するという概念に基づき設定される領域である。よって、上述した閾値Taは、領域Aにマスクが含まれると評価できる該マスクの評価値の最小値となる。 As shown in FIG. 3, the region A has a horizontal length W 1 and a vertical length H 1 that are α (the horizontal length W 0 and the vertical length H 0 of the through image TI. α = 0.5 to 0.6) times. This area A is an area set based on the concept that if the subject corresponding to the target mask is the main subject, it is located in the center area of the angle of view. Therefore, the above-described threshold value Ta is the minimum value of the evaluation value of the mask that can be evaluated when the region A includes the mask.

また、領域Bは、その横方向の長さW及び縦方向の長さHがスルー画像の横方向の長さW及び縦方向の長さHのβ(β=0.8〜0.9)倍に設定される。ここで、領域Bは必ずしも設定する必要はないが、撮像光学系35におけるレンズ収差等、撮像光学系35のレンズ性能を考慮して設定される。この領域Bは、主要被写体が画角から外れたか否かを評価する際に用いる領域となる。つまり、閾値Tbは、領域Bにマスクが含まれると評価できる該マスクの評価値の最小値となる。 The area B, the horizontal length W 2 and vertical length H 2 of lateral through-image length W 0 and vertical length H 0 β (β = 0.8~ 0.9) times. Here, the region B is not necessarily set, but is set in consideration of lens performance of the imaging optical system 35 such as lens aberration in the imaging optical system 35. This area B is an area used when evaluating whether or not the main subject has deviated from the angle of view. That is, the threshold value Tb is the minimum value of the evaluation value of the mask that can be evaluated when the region B includes the mask.

なお、閾値Taや閾値Tbの値は、マスクの形状や大きさ等によって変動するものであってもよいし、固定であってもよい。また、上述したα及びβの値は、上記に限定されるものではなく、適宜設定してよい。   Note that the values of the threshold value Ta and the threshold value Tb may vary depending on the shape and size of the mask, or may be fixed. Further, the values of α and β described above are not limited to the above, and may be set as appropriate.

本実施形態では、評価部44の評価において使用するマスク情報として、各マスクの位置情報を用いる場合について説明するが、マスクの動き情報や、マスクに該当する被写体までの距離情報のいずれかを用いてもよい。例えばマスクの動き情報や距離情報を用いる場合には、上述した領域Aに含まれる被写体のうち、評価の高いマスクを主要被写体として設定すればよい。さらに、マスク情報として記憶されるマスクの位置情報、マスクの動き情報又はマスクに該当する被写体までの距離情報の少なくとも2つの情報、或いはこれら全ての情報を用いて評価値を算出することも可能である。   In the present embodiment, a case where position information of each mask is used as mask information used in the evaluation by the evaluation unit 44 will be described. However, either mask movement information or distance information to a subject corresponding to the mask is used. May be. For example, when using mask movement information and distance information, a mask having a high evaluation among the subjects included in the region A described above may be set as the main subject. Furthermore, it is also possible to calculate an evaluation value by using at least two pieces of information of the position information of the mask stored as mask information, the movement information of the mask or the distance information to the subject corresponding to the mask, or all of these pieces of information. is there.

次に、撮影時の処理の流れについて、図4及び図5のフローチャートを用いて説明する。なお、このフローチャートは、撮像装置が撮影を行うことが可能な動作モードとなる場合に実行される。   Next, the flow of processing during shooting will be described with reference to the flowcharts of FIGS. This flowchart is executed when the imaging apparatus is in an operation mode in which shooting can be performed.

ステップS101は、スルー画像データを取得する処理である。CPU26は、撮像部21を制御して、スルー画像データの取得を開始する。取得されたスルー画像データの画像情報はバッファメモリ部24に一時的に記憶される。このスルー画像データは、所定の時間間隔で連続して取得される。   Step S101 is processing for obtaining through image data. The CPU 26 controls the imaging unit 21 to start obtaining through image data. The acquired image information of the through image data is temporarily stored in the buffer memory unit 24. This through image data is acquired continuously at predetermined time intervals.

ステップS102は、画像処理である。CPU26は、画像処理回路22に対して画像処理を行う指示を行う。この指示を受けて、画像処理回路22は、バッファメモリ部24に記憶されたスルー画像データを読み出す。そして、画像処理回路22は、読み出したスルー画像データに対して、ホワイトバランス調整、補間処理、色調補正処理、階調変換処理などの画像処理を実行する。これら画像処理が実行された後、画像処理回路22は、スルー画像データをバッファメモリ部24に一時記憶する。   Step S102 is image processing. The CPU 26 instructs the image processing circuit 22 to perform image processing. In response to this instruction, the image processing circuit 22 reads through image data stored in the buffer memory unit 24. Then, the image processing circuit 22 performs image processing such as white balance adjustment, interpolation processing, color tone correction processing, and gradation conversion processing on the read through image data. After these image processes are executed, the image processing circuit 22 temporarily stores the through image data in the buffer memory unit 24.

ステップS103は、スルー画像を表示する処理である。このステップS103の処理において、CPU26は、バッファメモリ部24に一時記憶されたスルー画像データを読み出し、表示部23に出力する。これを受けて、表示部23は読み出したスルー画像データに基づく画像を表示する。これにより、スルー画像が表示される。   Step S103 is processing to display a through image. In the process of step S <b> 103, the CPU 26 reads through image data temporarily stored in the buffer memory unit 24 and outputs it to the display unit 23. In response to this, the display unit 23 displays an image based on the read through image data. Thereby, a through image is displayed.

ステップS104は、マスク抽出処理である。CPU26は、画像処理回路22に対して、主要被写体領域を設定する指示を行う。この指示を受けて、画像処理回路22は、バッファメモリ部24からスルー画像データを読み出す。そして、画像処理回路22は、読み出したスルー画像データを用いてマスク抽出処理を行う。マスク抽出処理が実行されることで被写体の領域が検出され、検出された被写体の領域がマスクとして抽出される。   Step S104 is a mask extraction process. The CPU 26 instructs the image processing circuit 22 to set the main subject area. In response to this instruction, the image processing circuit 22 reads through image data from the buffer memory unit 24. Then, the image processing circuit 22 performs mask extraction processing using the read through image data. By executing the mask extraction process, a subject area is detected, and the detected subject area is extracted as a mask.

ステップS105は、マスクが抽出できたか否かを判定する処理である。ステップS104の処理により、被写体の領域が検出され、該被写体の領域がマスクとして抽出されている場合には、CPU26は、ステップS105の判定結果をYesとする。この場合、ステップS106に進む。一方、ステップS104の処理において被写体の領域が検出できないときにはマスクは抽出されないので、CPU26は、ステップS105の判定結果をNoとする。この場合、ステップS112に進む。   Step S105 is processing to determine whether or not a mask has been extracted. If the subject area is detected by the processing in step S104 and the subject area is extracted as a mask, the CPU 26 sets the determination result in step S105 to Yes. In this case, the process proceeds to step S106. On the other hand, when the subject area cannot be detected in the process of step S104, no mask is extracted, so the CPU 26 sets the determination result of step S105 to No. In this case, the process proceeds to step S112.

ステップS106は、マスク情報を記録する処理である。CPU26は、ステップS104により抽出したマスクに係る情報をマスク情報として記憶部25等に記録する。   Step S106 is processing to record mask information. The CPU 26 records information relating to the mask extracted in step S104 in the storage unit 25 or the like as mask information.

ステップS107は、n回以上連続して抽出されたマスクがあるか否かを判定する処理である。このステップS107における判定は、ステップS104のマスク抽出処理により抽出されたマスクが安定しているか否かを判定するためのものである。よって、n回以上連続して同一のマスクを抽出した場合、CPU26は抽出されたマスクが安定していると判定する。つまり、主要被写体領域を正しく検出していると判断することができる。この場合、CPU26は、ステップS107の判定結果をYesとし、ステップS108に進む。一方、n回以上連続して同一のマスクを抽出していない場合は、CPU26は、ステップS104のマスク抽出処理により抽出されたマスクが安定していないと判定する。この場合、CPU26は、ステップS107の判定結果をNoとし、ステップS112に進む。CPU26は、ステップS107の判定結果を記憶部25に記録する。   Step S107 is processing for determining whether or not there is a mask extracted n times or more continuously. The determination in step S107 is for determining whether or not the mask extracted by the mask extraction process in step S104 is stable. Therefore, if the same mask is extracted n times or more consecutively, the CPU 26 determines that the extracted mask is stable. That is, it can be determined that the main subject area is correctly detected. In this case, the CPU 26 sets the determination result in step S107 to Yes, and proceeds to step S108. On the other hand, if the same mask has not been extracted n times or more consecutively, the CPU 26 determines that the mask extracted by the mask extraction process in step S104 is not stable. In this case, the CPU 26 sets the determination result in step S107 to No, and proceeds to step S112. The CPU 26 records the determination result of step S107 in the storage unit 25.

ステップS108は、抽出したマスクを評価する処理である。画像処理回路22は、n回(nフレーム)以上連続して抽出されたマスクを主要被写体領域の候補となるマスクとする。そして、画像処理回路22は、主要被写体領域の候補となるマスクに対応したマスク情報を記憶部25から読み出す。そして、画像処理回路22は、読み出したマスク情報に基づき、対象となるマスクに対する評価値を求める。画像処理回路22は、求めた評価値と、閾値Taと比較することで、対象となるマスクを評価する。   Step S108 is processing for evaluating the extracted mask. The image processing circuit 22 uses a mask extracted continuously n times (n frames) or more as a mask as a candidate for the main subject region. Then, the image processing circuit 22 reads out mask information corresponding to a mask that is a candidate for the main subject area from the storage unit 25. Then, the image processing circuit 22 obtains an evaluation value for the target mask based on the read mask information. The image processing circuit 22 evaluates the target mask by comparing the obtained evaluation value with the threshold value Ta.

ステップS109は、主要被写体領域を設定する処理である。画像処理回路22は、ステップS108における評価結果を用いて、主要被写体領域を設定する。   Step S109 is processing for setting a main subject area. The image processing circuit 22 sets a main subject region using the evaluation result in step S108.

ステップS110は、主要被写体領域に係る情報を記憶する処理である。画像処理回路22は、主要被写体領域の情報を記憶部25等に記録する。主要被写体領域の情報には、用いられたマスクに関するマスク情報、主要被写体領域の位置、主要被写体領域の大きさや形状などの情報が含まれる。   Step S110 is processing for storing information relating to the main subject area. The image processing circuit 22 records information on the main subject area in the storage unit 25 and the like. The information on the main subject area includes mask information related to the mask used, information on the position of the main subject area, and the size and shape of the main subject area.

ステップS111は、主要被写体領域情報を表示する処理である。CPU26は、主要被写体領域の情報を表示部23に出力する。表示部23は、出力された主要被写体領域の情報に基づいた表示をスルー画像に重畳して表示する。主要被写体領域の情報に基づいた表示としては、例えば主要被写体領域であることを示す枠が挙げられる。なお、この枠は、主要被写体領域の形状に応じた枠であってもよいし、矩形や円形など所定の形状の枠であってもよい。このような表示を行うことにより、ユーザは、自動で検出される主要被写体領域の位置や形状がどのようなものであるかを、容易に把握することができる。   Step S111 is processing for displaying main subject area information. The CPU 26 outputs information on the main subject area to the display unit 23. The display unit 23 displays a display based on the output information on the main subject area so as to be superimposed on the through image. Examples of the display based on the information on the main subject area include a frame indicating that it is the main subject area. This frame may be a frame according to the shape of the main subject area, or may be a frame having a predetermined shape such as a rectangle or a circle. By performing such a display, the user can easily grasp what the position and shape of the main subject area detected automatically are.

ステップS112は、撮影指示があるか否かを判定する処理である。操作部27を用いた入力操作が行われた場合、CPU26には、操作部27における入力操作に基づく信号が入力される。CPU26は、この入力される信号が撮影指示を示す信号であるか否かを判定する。入力される信号が撮影指示を示す信号であれば、CPU26は、ステップS112の判定結果をYesとする。この場合、ステップS113に進む。一方、入力される信号が撮影指示を示す信号でない場合には、CPU26は、ステップS112の判定結果をNoとする。この場合、ステップS120に進む。   Step S112 is processing to determine whether or not there is a shooting instruction. When an input operation using the operation unit 27 is performed, a signal based on the input operation in the operation unit 27 is input to the CPU 26. The CPU 26 determines whether or not the input signal is a signal indicating a shooting instruction. If the input signal is a signal indicating a shooting instruction, the CPU 26 sets the determination result in step S112 to Yes. In this case, the process proceeds to step S113. On the other hand, if the input signal is not a signal indicating a shooting instruction, the CPU 26 sets the determination result in step S112 to No. In this case, the process proceeds to step S120.

ステップS113は、撮像処理である。例えばステップS109で主要被写体領域を設定した場合、CPU26は、設定した主要被写体領域の情報に基づいて、焦点調整(AF)の設定処理、露出調整(AE)の設定処理、ホワイトバランス調整処理(AWB)の3A処理を行うとともに、画像処理回路22における各種画像処理の条件等を決定する。また、ステップS113で主要被写体領域を設定していない場合、CPU26は、例えば中央の領域など特定の領域を用いて、焦点調整(AF)の設定処理、露出調整(AE)の設定処理、ホワイトバランス調整処理(AWB)の3A処理を行うとともに、画像処理回路22における各種画像処理の条件等を決定する。そして、CPU26は、上述した処理の結果に基づいて、撮像処理を実行する。   Step S113 is an imaging process. For example, when the main subject area is set in step S109, the CPU 26 sets focus adjustment (AF) setting processing, exposure adjustment (AE) setting processing, white balance adjustment processing (AWB) based on the set main subject area information. 3A) and the conditions for various image processing in the image processing circuit 22 are determined. If the main subject area is not set in step S113, the CPU 26 uses a specific area such as a central area, for example, a focus adjustment (AF) setting process, an exposure adjustment (AE) setting process, and a white balance. While performing 3A processing of adjustment processing (AWB), conditions for various image processing in the image processing circuit 22 are determined. And CPU26 performs an imaging process based on the result of the process mentioned above.

ステップS114は、画像を記録する処理である。CPU26は、ステップS113による撮像処理により取得された画像データを、通信部28を介して記憶媒体31に記録して一連の処理を終了する。   Step S114 is processing to record an image. CPU26 records the image data acquired by the imaging process by step S113 to the storage medium 31 via the communication part 28, and complete | finishes a series of processes.

上述したステップS112の判定処理において、撮影指示がないと判定された場合には、ステップS120に進む。   If it is determined in the determination process of step S112 described above that there is no shooting instruction, the process proceeds to step S120.

ステップS120は、スルー画像データを取得する処理である。このステップS120の処理は、ステップS101と同一の処理である。   Step S120 is processing for acquiring through image data. The process of step S120 is the same process as step S101.

ステップS121は、画像処理である。このステップS121の処理は、ステップS102と同一の処理である。   Step S121 is image processing. The process of step S121 is the same process as step S102.

ステップS122はスルー画像を表示する処理である。このステップS122の処理は、ステップS103と同一の処理である。   Step S122 is processing to display a through image. The process of step S122 is the same process as step S103.

ステップS123は、主要被写体領域の設定があるか否かを判定する処理である。CPU26は、記憶部25を参照する。そして、主要被写体領域の情報が記憶部25に記憶されていれば、CPU26はステップS123の判定結果をYesとする。この場合、ステップS124及びステップS125の処理と、ステップS126からステップS128の処理とが同時並行にて実行される。   Step S123 is processing for determining whether or not a main subject area is set. The CPU 26 refers to the storage unit 25. If the information on the main subject area is stored in the storage unit 25, the CPU 26 sets the determination result in step S123 to Yes. In this case, the process of step S124 and step S125 and the process of step S126 to step S128 are performed simultaneously in parallel.

一方、主要被写体領域の情報が記憶部25に記憶されていない場合、CPU26はステップS123の判定結果をNoとする。この場合、ステップS104に戻る。つまり、この場合には、主要被写体領域を設定するためのマスク抽出処理が再度実行される。   On the other hand, if the information on the main subject area is not stored in the storage unit 25, the CPU 26 sets the determination result in step S123 to No. In this case, the process returns to step S104. That is, in this case, the mask extraction process for setting the main subject area is executed again.

ステップS124は、追尾処理である。CPU26は、画像処理回路22に対して追尾処理を指示する。これを受けて、画像処理回路22は、バッファメモリ部24からスルー画像データを読み出す。また、画像処理回路22は、記憶部25から主要被写体領域の情報を読み出す。そして、画像処理回路22は、読み出した画像データ及び情報を用いて、例えばテンプレートマッチングなどの手法により、主要被写体領域を特定する。   Step S124 is a tracking process. The CPU 26 instructs the image processing circuit 22 to perform tracking processing. In response to this, the image processing circuit 22 reads through image data from the buffer memory unit 24. Further, the image processing circuit 22 reads information on the main subject area from the storage unit 25. Then, the image processing circuit 22 identifies the main subject region by using a method such as template matching using the read image data and information.

ステップS125は、主要被写体領域の情報を更新する処理である。画像処理回路22は、ステップS124により特定した主要被写体領域に係る情報を、新たな主要被写体領域の情報として記憶部25に記憶する。ここで、ステップS124により新たに得られた主要被写体領域の情報は、先に記憶された主要被写体領域の情報と置き換えて記憶するものであってもよいし、ステップS124により新たに得られた主要被写体領域の情報を先に記憶された主要被写体領域の情報に書き加えるものであってもよい。   Step S125 is processing to update information on the main subject area. The image processing circuit 22 stores the information related to the main subject area identified in step S124 in the storage unit 25 as new main subject area information. Here, the information on the main subject area newly obtained in step S124 may be stored in place of the information on the main subject area stored in advance, or may be newly obtained in step S124. The information on the subject area may be added to the information on the main subject area previously stored.

上述したように、ステップS124及びステップS125の処理と同時並行にて、ステップS126からステップS128の処理が実行される。   As described above, the processing from step S126 to step S128 is executed concurrently with the processing of step S124 and step S125.

ステップS126は、マスク抽出処理である。なお、このステップS126の処理は、ステップS104の処理と同一の処理である。   Step S126 is a mask extraction process. Note that the process of step S126 is the same as the process of step S104.

ステップS127は、新たなマスクが抽出されたか否かを判定する処理である。CPU26は、記憶部25に記憶されたマスク情報を読み出し、ステップS126におけるマスク抽出処理により得られたマスクのうち、新たに抽出したマスクがあるか否かを判定する。新たに抽出されたマスクがあるときには、CPU26は、ステップS128の判定結果をYesとする。この場合、ステップS128に進む。一方、新たに抽出されたマスクがないときには、CPU26は、ステップS128の判定結果をNoとする。この場合、ステップS129に進む。   Step S127 is processing for determining whether or not a new mask has been extracted. The CPU 26 reads out the mask information stored in the storage unit 25, and determines whether or not there is a newly extracted mask among the masks obtained by the mask extraction process in step S126. When there is a newly extracted mask, the CPU 26 determines Yes in step S128. In this case, the process proceeds to step S128. On the other hand, when there is no newly extracted mask, the CPU 26 sets the determination result in step S128 to No. In this case, the process proceeds to step S129.

ステップS128は、新たなマスク情報を記録する処理である。CPU26は、ステップS126にて取得された新たなマスクに係る情報を記憶部25に記録する。   Step S128 is a process for recording new mask information. The CPU 26 records information related to the new mask acquired in step S126 in the storage unit 25.

ステップS129は、主要被写体領域に設定されたマスクの他に、n回以上連続して抽出されたマスクがあるか否かを判定する処理である。n回以上連続して同一のマスクを抽出した場合、CPU26はステップS129の判定結果をYesとする。この場合、ステップS130に進む。一方、n回以上連続して同一のマスクを抽出していない場合は、CPU26はステップS129の判定結果をNoとする。この場合、ステップS131に進む。   Step S129 is processing for determining whether or not there is a mask extracted continuously n times or more in addition to the mask set in the main subject area. When the same mask is extracted n times or more continuously, the CPU 26 sets the determination result in step S129 to Yes. In this case, the process proceeds to step S130. On the other hand, if the same mask is not extracted continuously n times or more, the CPU 26 sets the determination result in step S129 to No. In this case, the process proceeds to step S131.

ステップS130は、主要被写体領域として設定されたマスクを含む、対象となるマスクを評価する処理である。画像処理回路22は、記憶部25から対象となるマスク情報を読み出す。そして、画像処理回路22は、読み出したマスク情報を用いて、対象となるマスクのそれぞれに対する評価を行う。なお、ステップS130における評価においては、主要被写体領域として設定される被写体の領域に対応するマスクに対しては閾値Tbを用いた評価を行う。また、その他の被写体の領域に対応するマスクに対しては閾値Taを用いた評価を行う。   Step S130 is processing for evaluating a target mask including the mask set as the main subject region. The image processing circuit 22 reads target mask information from the storage unit 25. Then, the image processing circuit 22 evaluates each of the target masks using the read mask information. In the evaluation in step S130, an evaluation using the threshold value Tb is performed on the mask corresponding to the subject area set as the main subject area. In addition, evaluation using a threshold Ta is performed for masks corresponding to other subject areas.

上述したステップS129の判定処理でNoとなる場合、ステップS131に進む。   If the determination result in step S129 is No, the process proceeds to step S131.

ステップS131は、主要被写体領域として設定されたマスクに対する評価を行う処理である。画像処理回路22は、記憶部25に記憶された主要被写体領域の情報を読み出す。そして、画像処理回路22は、読み出した主要被写体領域の情報を用いて、主要被写体領域となるマスクの評価を行う。この場合、画像処理回路22は、閾値Tbを用いて評価を行う。   Step S131 is processing for evaluating the mask set as the main subject region. The image processing circuit 22 reads information on the main subject area stored in the storage unit 25. Then, the image processing circuit 22 evaluates the mask serving as the main subject region using the read information on the main subject region. In this case, the image processing circuit 22 performs evaluation using the threshold value Tb.

ステップS132は、主要被写体領域の再設定を行うか否かを判定する処理である。画像処理回路22は、ステップS130又はステップS131のいずれかにおいて実行されたマスクの評価結果を用いて、主要被写体領域を再設定するか否かを判定する。例えば、ステップS130において、主要被写体領域に設定されたマスク及び他のマスクに対する評価を行っている場合、主要被写体領域に設定されたマスクの評価結果と、他のマスクの評価結果とから、主要被写体領域として設定されたマスクの再設定を行うか否かを判定する。なお、この場合のマスクの再設定とは、マスクを切り替えることを指す。主要被写体領域として設定されたマスクの再設定を行う場合、画像処理回路22は、ステップS132の判定結果をYesとする。この場合、ステップS133に進む。一方、主要被写体領域として設定されたマスクの再設定を行う必要がない場合には、画像処理回路22は、ステップS132の判定結果をNoとする。この場合、ステップS135に進む。   Step S132 is processing for determining whether or not to reset the main subject area. The image processing circuit 22 determines whether to reset the main subject area using the mask evaluation result executed in either step S130 or step S131. For example, if the mask set in the main subject area and other masks are evaluated in step S130, the main subject is determined from the evaluation results of the mask set in the main subject area and the evaluation results of the other masks. It is determined whether or not to reset the mask set as the area. Note that resetting the mask in this case refers to switching the mask. When resetting the mask set as the main subject area, the image processing circuit 22 sets the determination result in step S132 to Yes. In this case, the process proceeds to step S133. On the other hand, when it is not necessary to reset the mask set as the main subject area, the image processing circuit 22 sets the determination result in step S132 to No. In this case, the process proceeds to step S135.

一方、ステップS131において、主要被写体領域に設定されたマスクに対する評価を行っている場合、主要被写体領域に設定されたマスクの評価から、主要被写体領域として設定されたマスクの再設定を行うか否かを判定する。この場合の再設定は、主要被写体領域となるマスクの設定を解除することを指す。この場合も、主要被写体領域として設定されたマスクの再設定を行う場合、画像処理回路22は、ステップS132の判定結果をYesとする。この場合、ステップS133に進む。一方、主要被写体領域として設定されたマスクの再設定を行う必要がない場合には、画像処理回路22は、ステップS132の判定結果をNoとする。この場合、ステップS135に進む。   On the other hand, if the mask set in the main subject area is evaluated in step S131, whether or not the mask set as the main subject area is reset based on the evaluation of the mask set in the main subject area. Determine. The resetting in this case refers to canceling the setting of the mask that becomes the main subject area. Also in this case, when resetting the mask set as the main subject region, the image processing circuit 22 sets the determination result in step S132 to Yes. In this case, the process proceeds to step S133. On the other hand, when it is not necessary to reset the mask set as the main subject area, the image processing circuit 22 sets the determination result in step S132 to No. In this case, the process proceeds to step S135.

ステップS133は、主要被写体領域を再設定する処理である。画像処理回路22は、主要被写体領域を再設定する。例えばステップS130において、主要被写体領域に設定されたマスク及び他のマスクに対して評価を行っている場合、画像処理回路22は、主要被写体領域となるマスク設定を解除し、他のマスクに対して主要被写体領域を設定する。また、ステップS131において、主要被写体領域に設定されたマスクの評価を行っている場合、画像処理回路22は、主要被写体領域となるマスク設定を解除する。   Step S133 is processing for resetting the main subject area. The image processing circuit 22 resets the main subject area. For example, if the mask set in the main subject area and other masks are evaluated in step S130, the image processing circuit 22 cancels the mask setting as the main subject area and applies to other masks. Set the main subject area. In step S131, when the mask set in the main subject area is being evaluated, the image processing circuit 22 cancels the mask setting as the main subject area.

ステップS134は、主要被写体情報を更新する処理である。画像処理回路22は、ステップS133により実行された主要被写体領域を再設定した結果に基づいて、記憶部25に記録された主要被写体領域情報を更新する。   Step S134 is processing to update main subject information. The image processing circuit 22 updates the main subject area information recorded in the storage unit 25 based on the result of resetting the main subject area executed in step S133.

ステップS135は、主要被写体に設定されたマスクがあるか否かを判定する処理である。CPU26は、記憶部25を参照する。記憶部25に主要被写体領域情報があれば、CPU26は、ステップS135の判定結果をYesとする。この場合、ステップS136に進む。一方、記憶部25に主要被写体領域情報がない場合、CPU26は、ステップS135の判定結果をNoとする。この場合、ステップS112に戻る。なお、記憶部25に主要被写体領域情報がない場合としては、例えばステップS133における主要被写体領域の再設定において、主要被写体領域に対する設定が解除された場合が挙げられる。   Step S135 is processing for determining whether or not there is a mask set for the main subject. The CPU 26 refers to the storage unit 25. If there is main subject area information in the storage unit 25, the CPU 26 sets the determination result in step S135 to Yes. In this case, the process proceeds to step S136. On the other hand, when there is no main subject area information in the storage unit 25, the CPU 26 sets the determination result in step S135 to No. In this case, the process returns to step S112. An example of the case where there is no main subject area information in the storage unit 25 is a case where the setting for the main subject area is canceled in the resetting of the main subject area in step S133.

ステップS136は、主要被写体情報を表示する処理である。このステップS111の処理と同一の処理である。このステップS136の処理が実行されると、ステップS112に戻る。   Step S136 is processing for displaying main subject information. This is the same process as that in step S111. When the process of step S136 is executed, the process returns to step S112.

このようにして、主要被写体領域が設定されていない場合には、取得されたスルー画像データから求めた特徴量に基づいて検出された被写体の領域をマスクとして抽出する。この処理を複数のスルー画像データに対して行い、複数のスルー画像データから抽出されたマスクを比較する。この比較により、検出されたマスクが安定しているかが判定される。そして、マスクが安定していると判定された場合、そのマスクに対する評価を行い、評価が良いマスクに該当する被写体の領域を主要被写体領域として設定する。   In this way, when the main subject region is not set, the subject region detected based on the feature amount obtained from the acquired through image data is extracted as a mask. This process is performed on a plurality of through image data, and masks extracted from the plurality of through image data are compared. This comparison determines whether the detected mask is stable. When it is determined that the mask is stable, the mask is evaluated, and the subject area corresponding to the mask with good evaluation is set as the main subject area.

一般に被写体を撮影する場合、被写体が画角の中央部分に位置するように撮像装置10を構える。よって、図6(a)に示すように、撮像装置10により得られるスルー画像TIからは、中央部分(例えば領域A)に位置する被写体の領域がマスク51として抽出される。ここで、静止する被写体を撮影する場合、撮像装置10の位置や向きが変化しない、又は撮像装置10の撮像光学系35における撮影倍率(光学ズーム倍率)を変更しない限りは、画角が固定される。よって、画角に対する被写体の位置は同一の位置となる。つまり、連続して得られる複数のスルー画像TIからは、常に同一のマスク51が検出され、したがって、マスク51は安定していると判定される。また、マスク51は領域Aの内部に位置しているので、マスク51に対する評価値Tは一定の値で、且つ閾値Taを超過する(図6(b)参照)。よって、このような場合には、マスク51に該当する被写体の領域が主要被写体領域として設定される。   In general, when photographing a subject, the imaging device 10 is held so that the subject is located at the center of the angle of view. Therefore, as illustrated in FIG. 6A, a region of the subject located in the central portion (for example, region A) is extracted as a mask 51 from the through image TI obtained by the imaging device 10. Here, when shooting a still subject, the angle of view is fixed unless the position or orientation of the imaging device 10 changes or the imaging magnification (optical zoom magnification) in the imaging optical system 35 of the imaging device 10 is changed. The Therefore, the position of the subject with respect to the angle of view is the same position. That is, the same mask 51 is always detected from a plurality of through images TI obtained in succession, and therefore it is determined that the mask 51 is stable. Further, since the mask 51 is located inside the region A, the evaluation value T for the mask 51 is a constant value and exceeds the threshold value Ta (see FIG. 6B). Therefore, in such a case, the subject area corresponding to the mask 51 is set as the main subject area.

一方、構図によっては、静止する被写体を画角の中央部分ではなく、画角の周縁部に位置して撮影する場合もある。図7(a)に示すように、撮像装置10により得られるスルー画像TIからは、中央部分からずれた位置にある被写体の領域がマスク52として抽出される。この場合、抽出されたマスク52は、複数のスルー画像TIのそれぞれから検出されることから、安定するマスクとして判定される。しかしながら、このマスク52は、領域Aから外れた位置にある。したがって、マスク52に対する評価値Tは一定の値となるが、閾値Ta以下となる(図7(b)参照)。よって、マスク52に該当する被写体の領域は、主要被写体領域として設定されることがない。   On the other hand, depending on the composition, a stationary subject may be photographed not at the center of the angle of view but at the periphery of the angle of view. As shown in FIG. 7A, from the through image TI obtained by the imaging device 10, a region of the subject at a position shifted from the central portion is extracted as a mask 52. In this case, since the extracted mask 52 is detected from each of the plurality of through images TI, it is determined as a stable mask. However, the mask 52 is at a position outside the region A. Therefore, the evaluation value T for the mask 52 is a constant value, but is not more than the threshold value Ta (see FIG. 7B). Therefore, the subject area corresponding to the mask 52 is not set as the main subject area.

一方、移動する被写体が撮像装置10における画角内に入り込む場合や、撮像装置10における画角内から外れる場合もある。   On the other hand, there are cases where the moving subject enters within the angle of view of the imaging device 10 or deviates from the angle of view of the imaging device 10.

まず、移動する被写体が画角内に入り込む場合について考慮する。図8(a)に示すように、移動する被写体を撮影する場合、複数のスルー画像TIから検出される被写体の領域、言い換えれば抽出されるマスク53は、図中X1方向に移動し、画角の中央部分に到達する。ここで、複数のスルー画像TIから得られるマスク53は、同一のマスクであるとして抽出されるので、マスク53は安定していると判定される。   First, consider a case where a moving subject enters an angle of view. As shown in FIG. 8A, when shooting a moving subject, the region of the subject detected from the plurality of through images TI, in other words, the extracted mask 53 moves in the X1 direction in the drawing, and the angle of view. Reach the middle part of. Here, since the masks 53 obtained from the plurality of through images TI are extracted as being the same mask, it is determined that the masks 53 are stable.

ここで、図8(b)に示すように、マスク53に対する評価値は、徐々に高くなる。そして、マスク53がスルー画像TIの中央部分に到達する、言い換えれば領域Aに入り込むいと、その評価値Tは閾値Taを超過する。よって、マスク53がスルー画像TIの中央部分(領域A)に入り込む以降に、このマスク53に該当する被写体の領域が主要被写体領域として設定される。   Here, as shown in FIG. 8B, the evaluation value for the mask 53 gradually increases. When the mask 53 reaches the central portion of the through image TI, in other words, enters the region A, the evaluation value T exceeds the threshold value Ta. Therefore, after the mask 53 enters the central portion (region A) of the through image TI, the subject region corresponding to the mask 53 is set as the main subject region.

次に、画角の中央部分に位置する被写体が移動する場合もある。この場合、図9(a)に示すように、被写体が画角の中央部分に位置している場合には、複数のスルー画像TIから、該被写体が検出され、被写体の領域がそれぞれマスク54として検出される。ここで、マスクはスルー画像TIの領域Aに位置しているので、このマスク54に対する評価値Tは、それぞれ一定の値となり、閾値Taを超過する。よって、マスク54に対応する被写体の領域が主要被写体領域として設定される。   Next, the subject located at the center of the angle of view may move. In this case, as shown in FIG. 9A, when the subject is located at the center of the angle of view, the subject is detected from a plurality of through images TI, and the subject areas are respectively used as masks 54. Detected. Here, since the mask is located in the region A of the through image TI, the evaluation value T for the mask 54 is a constant value and exceeds the threshold value Ta. Therefore, the subject area corresponding to the mask 54 is set as the main subject area.

その後、被写体が移動すると、複数のスルー画像TIから抽出されるマスク54の位置は、それぞれX2方向に変化する。上述したように、マスクに対する評価値は、スルー画像TIの周辺部に近づくほど、その値が低くなる。よって、図9(b)に示すように、X2方向に移動するマスク54に対する評価値Tは、徐々に低くなる。よって、この評価値Tは、画角から外れたことを示す閾値Tb以下となる。この評価値Tが、閾値Tb以下となる場合に、マスク54に該当する被写体の領域に対する主要被写体領域の設定が解除される。   Thereafter, when the subject moves, the position of the mask 54 extracted from the plurality of through images TI changes in the X2 direction. As described above, the evaluation value for the mask becomes lower as it approaches the periphery of the through image TI. Therefore, as shown in FIG. 9B, the evaluation value T for the mask 54 moving in the X2 direction gradually decreases. Therefore, the evaluation value T is equal to or less than the threshold value Tb indicating that the angle of view is deviated. When the evaluation value T is equal to or less than the threshold value Tb, the setting of the main subject area for the subject area corresponding to the mask 54 is cancelled.

例えば主要被写体領域が設定された後、撮影操作が実行されない場合には、引き続きスルー画像TIが取得される。この場合も、スルー画像TIから抽出されたマスクに対して、安定しているか否かの判定、及びマスクに対する評価が行われる。この過程で、新たにスルー画像TIから抽出されたマスクがあれば、新たに抽出されたマスクのそれぞれに対して、安定しているか否かの判定、及びマスクに対する評価を行う。なお、主要被写体領域として設定される被写体の領域に基づくマスクに対しては、追尾処理が実行された後、追尾処理により検出されたマスクに対する評価が実行される。したがって、これら評価に基づき、必要に応じて、主要被写体領域の再設定が実行される。   For example, when the photographing operation is not executed after the main subject area is set, the through image TI is continuously acquired. Also in this case, it is determined whether the mask extracted from the through image TI is stable and the mask is evaluated. In this process, if there is a mask newly extracted from the through image TI, it is determined whether or not each newly extracted mask is stable and the mask is evaluated. For a mask based on the subject area set as the main subject area, the tracking process is executed, and then the mask detected by the tracking process is evaluated. Therefore, based on these evaluations, resetting of the main subject area is executed as necessary.

例えば、画角の中心部分に位置している被写体が移動し、同時に、他の被写体が画角の中心部分に向けて移動する場合について説明する。この場合、図10(a)に示すように、主要被写体領域に設定された被写体の領域に基づくマスク55は、図中X3方向に移動する。これに併せて、他の被写体の領域に基づくマスク56が、図中X3方向に移動する。よって、図10(b)に示すように、主要被写体領域に設定されるマスク55は、スルー画像TIから徐々に消えていき、他の被写体の領域に基づいたマスク56が徐々にスルー画像TIの中央部分に近づく。そして、図10(c)に示すように、他の被写体の領域に基づくマスク56のみが、スルー画像TIの内部に含まれることになる。   For example, a case will be described in which a subject located at the center portion of the angle of view moves while another subject moves toward the center portion of the angle of view. In this case, as shown in FIG. 10A, the mask 55 based on the subject area set as the main subject area moves in the X3 direction in the figure. At the same time, the mask 56 based on the area of the other subject moves in the X3 direction in the figure. Therefore, as shown in FIG. 10B, the mask 55 set in the main subject region gradually disappears from the through image TI, and the mask 56 based on the regions of other subjects gradually becomes the through image TI. Approach the center part. Then, as shown in FIG. 10C, only the mask 56 based on the area of the other subject is included in the through image TI.

図11は、マスク55に対する評価値T1と、マスク56に対する評価値T2とのそれぞれの評価値の変化を示すグラフである。なお、マスク55に対する評価値T1を「○」で示し、マスク56に対する評価値T2を図中「△」で示している。   FIG. 11 is a graph showing changes in evaluation values of the evaluation value T1 for the mask 55 and the evaluation value T2 for the mask 56. In FIG. The evaluation value T1 for the mask 55 is indicated by “◯”, and the evaluation value T2 for the mask 56 is indicated by “Δ” in the figure.

図11中「t1」にて示す各マスクの評価値T1,T2が、図10(a)に示すスルー画像TIにおけるマスクの評価値である。つまり、図10(a)に示すスルー画像TIにおいては、マスク55に対する評価値T1のみが求められる。ここで、マスク55は、スルー画像TIにおける領域A内に位置することから、マスク55に対する評価値T1は閾値Taを超過している。よって、マスク55に該当する被写体の領域が主要被写体領域として設定される。   Evaluation values T1 and T2 of the respective masks indicated by “t1” in FIG. 11 are the evaluation values of the masks in the through image TI illustrated in FIG. That is, in the through image TI shown in FIG. 10A, only the evaluation value T1 for the mask 55 is obtained. Here, since the mask 55 is located in the area A in the through image TI, the evaluation value T1 for the mask 55 exceeds the threshold value Ta. Therefore, the subject area corresponding to the mask 55 is set as the main subject area.

図11中「t2」にて示す各マスクの評価値T1,T2が、図10(b)に示すスルー画像TIにおけるマスクの評価値である。つまり、図10(b)に示すスルー画像TIにおいては、マスク55の他に、マスク56も抽出されている。よって、これらマスクに対する評価値がそれぞれ求められる。この場合、マスク55に対する評価値T1は、閾値Tb以下となり、また、マスク56に対する評価値T2は、閾値Taを超過している。この場合、主要被写体領域として、マスク55に該当する被写体の領域の設定を解除する。同時に、マスク56に該当する被写体の領域を主要被写体領域として設定する。よって、主要被写体領域として設定される被写体の領域が切り替えられる。   Evaluation values T1 and T2 of the respective masks indicated by “t2” in FIG. 11 are mask evaluation values in the through image TI shown in FIG. That is, in the through image TI shown in FIG. 10B, in addition to the mask 55, the mask 56 is also extracted. Therefore, the evaluation values for these masks are obtained respectively. In this case, the evaluation value T1 for the mask 55 is equal to or less than the threshold value Tb, and the evaluation value T2 for the mask 56 exceeds the threshold value Ta. In this case, the setting of the subject area corresponding to the mask 55 is canceled as the main subject area. At the same time, the subject area corresponding to the mask 56 is set as the main subject area. Therefore, the subject area set as the main subject area is switched.

図11中「t3」にて示すマスクの評価値T1,T2が、図10(c)に示すスルー画像TIにおけるマスクの評価値である。図10(c)に示すスルー画像TIにおいては、マスク56に対する評価値T2のみが求められる。ここで、マスク56は、スルー画像TIにおける領域A内に位置することから、マスク56に対する評価値T2は閾値Taを超過している。よって、以降に得られるスルー画像TIにおいて、マスク56の評価値T2が閾値Tbを越えていれば、マスク56に該当する被写体の領域が、引き続き、主要被写体領域となる。このように、スルー画像TIから検出される被写体が異なる被写体に入れ替わる場合であっても、主要被写体領域を容易に且つ的確に再設定することが可能となる。   Mask evaluation values T1 and T2 indicated by “t3” in FIG. 11 are mask evaluation values in the through image TI shown in FIG. In the through image TI shown in FIG. 10C, only the evaluation value T2 for the mask 56 is obtained. Here, since the mask 56 is located in the region A in the through image TI, the evaluation value T2 for the mask 56 exceeds the threshold Ta. Therefore, in the through image TI obtained thereafter, if the evaluation value T2 of the mask 56 exceeds the threshold value Tb, the subject area corresponding to the mask 56 continues to be the main subject area. As described above, even when the subject detected from the through image TI is changed to a different subject, the main subject region can be easily and accurately reset.

ここで、図10(d)に示すように、スルー画像TI(画角)から検出されなくなった被写体の領域(図10においてはマスク55)が、所定時間経過後に得られるスルー画像TIにより再度検出される場合がある。このような場合には、主要被写体領域として設定される被写体の領域を、評価値に関係なく変更する(切り替える)ようにしてもよいし、そのときに主要被写体領域として設定される被写体の領域と、再度検出された被写体の領域との両方の領域を主要被写体領域としてもよい。これら場合、主要被写体領域として設定された被写体の領域に基づくマスク情報を消去せずに、記憶部25に保持しておけばよい。   Here, as shown in FIG. 10 (d), the region of the subject that is not detected from the through image TI (view angle) (the mask 55 in FIG. 10) is detected again by the through image TI obtained after a predetermined time has elapsed. May be. In such a case, the subject area set as the main subject area may be changed (switched) regardless of the evaluation value, and the subject area set as the main subject area at that time Both of the areas with the re-detected object area may be set as the main object area. In these cases, the mask information based on the subject area set as the main subject area may be stored in the storage unit 25 without being erased.

また、スルー画像TIから抽出される被写体の領域が複数検出される場合もある。このような場合には、評価値が閾値Taを超過するマスクのうち、最も評価値の高いマスクに該当する被写体の領域が主要被写体領域として設定される。図12(a)に示すように、スルー画像TIからマスク58,59,60が抽出される場合について説明する。このとき、図12(b)に示すように、マスク58に該当する被写体は画角から外れる方向(図中X4方向に)に移動し、マスク59に該当する被写体は図中X5方向に移動し、画角の中央部分で停止すると仮定する。また、マスク60に該当する被写体は、静止していると仮定する。   In some cases, a plurality of subject areas extracted from the through image TI are detected. In such a case, the area of the subject corresponding to the mask having the highest evaluation value among the masks whose evaluation value exceeds the threshold value Ta is set as the main subject area. A case where masks 58, 59, and 60 are extracted from the through image TI as shown in FIG. At this time, as shown in FIG. 12B, the subject corresponding to the mask 58 moves in a direction deviating from the angle of view (X4 direction in the figure), and the subject corresponding to the mask 59 moves in the X5 direction in the figure. Suppose that it stops at the center of the angle of view. Further, it is assumed that the subject corresponding to the mask 60 is stationary.

図13は、各マスク58,59,60に対する評価値の変化を示すグラフである。ここで、図13中「○」はマスク58に対する評価値T3、「△」はマスク59に対する評価値T4、「◇」はマスク60に対する評価値T5をそれぞれ示す。   FIG. 13 is a graph showing changes in evaluation values for the masks 58, 59 and 60. Here, “◯” in FIG. 13 indicates the evaluation value T 3 for the mask 58, “Δ” indicates the evaluation value T 4 for the mask 59, and “は” indicates the evaluation value T 5 for the mask 60.

図13に示すように、マスク58に対する評価値T3は、時間経過とともに低下し、画角から外れることで評価値が算出されなくなる。また、マスク59に対する評価値T4は、画角の中央部分に移動することで、その評価値T4が高くなる。一方、マスク60は、静止している被写体に該当することから、その評価値T5は一定の値となる。   As shown in FIG. 13, the evaluation value T3 for the mask 58 decreases with time, and the evaluation value is not calculated when the evaluation value T3 deviates from the angle of view. Further, the evaluation value T4 for the mask 59 increases to the evaluation value T4 by moving to the center portion of the angle of view. On the other hand, since the mask 60 corresponds to a stationary subject, the evaluation value T5 is a constant value.

この場合、閾値Taを超過する評価値となるマスク58及びマスク59において、マスク58に対する評価値T3がマスク59に対する評価値T4よりも高いことから、この場合、マスク58に該当する被写体の領域が主要被写体領域として設定される。   In this case, in the mask 58 and the mask 59 that are evaluation values exceeding the threshold Ta, the evaluation value T3 for the mask 58 is higher than the evaluation value T4 for the mask 59. Set as the main subject area.

上述したように、マスク58は、該当する被写体が画角から外れる方向に移動しているので、マスク58に対する評価値T3は低くなる。一方、マスク59は、該当する被写体が画角の中央に向けて移動することから、マスク59に対する評価値T4は高くなる。マスク58に対する評価値T3が閾値Tb以下となるときには、マスク59に対する評価値T5は閾値Taを超過しているので、主要被写体領域に設定される被写体の領域が切り替わる。つまり、主要被写体領域に設定される被写体の領域が、マスク58に該当する被写体の領域から、マスク59に該当する被写体の領域に切り替わる。   As described above, the mask 58 moves in a direction in which the corresponding subject deviates from the angle of view, so the evaluation value T3 for the mask 58 is low. On the other hand, the mask 59 has a higher evaluation value T4 for the mask 59 because the corresponding subject moves toward the center of the angle of view. When the evaluation value T3 for the mask 58 is equal to or less than the threshold value Tb, the evaluation value T5 for the mask 59 exceeds the threshold value Ta, so that the subject region set as the main subject region is switched. That is, the subject region set as the main subject region is switched from the subject region corresponding to the mask 58 to the subject region corresponding to the mask 59.

このように、複数の被写体が画角内で移動する場合であっても、主要被写体領域の再設定を容易に、かつ的確に行うことが可能となる。   Thus, even when a plurality of subjects move within the angle of view, the main subject region can be reset easily and accurately.

本実施形態においては、撮像光学系35における光学ズーム倍率を一定にした場合について説明しているが、これに限定される必要はなく、撮像光学系35における光学ズーム倍率を変更した場合であっても、本発明を適用することができる。つまり、光学ズーム倍率を変更した場合、画角が変化する。例えば、光学ズーム倍率を高くした場合には、画角に含まれる実際の撮影範囲が狭くなる。よって、意図する主要被写体領域に設定した被写体の領域が画角から外れる場合がある。この場合、ユーザが意図していなくとも、画角に含まれる他の被写体の領域が主要被写体領域として自動的に設定される。   In this embodiment, the case where the optical zoom magnification in the imaging optical system 35 is made constant is described. However, the present invention is not limited to this, and the optical zoom magnification in the imaging optical system 35 is changed. Also, the present invention can be applied. That is, when the optical zoom magnification is changed, the angle of view changes. For example, when the optical zoom magnification is increased, the actual shooting range included in the angle of view is narrowed. Therefore, the subject area set as the intended main subject area may deviate from the angle of view. In this case, even if the user does not intend, the area of another subject included in the angle of view is automatically set as the main subject area.

一方、光学ズーム倍率を低くした場合には、画角に含まれる実際の撮影範囲が広くなることから、ユーザが意図する被写体だけでなく、他の被写体も画角に含まれる。この場合意図する被写体の領域を主要被写体領域として設定していても、他の被写体の領域に対する評価が高くなるときがある。このようなときには、主要被写体領域は、ユーザの意図する被写体の領域から、他の被写体の領域に再設定される。このように、スルー画像TIにおける主要被写体領域切り替えを、容易に、且つ的確に行うことができる。なお、主要被写体領域の再設定により、ユーザが意図していない被写体の領域が主要被写体領域となる場合には、撮像装置における画角や向きなどを調整すればよい。   On the other hand, when the optical zoom magnification is lowered, the actual shooting range included in the angle of view is widened, so that not only the subject intended by the user but also other subjects are included in the angle of view. In this case, even if the intended subject area is set as the main subject area, the evaluation of other subject areas may be high. In such a case, the main subject area is reset from the subject area intended by the user to another subject area. In this way, the main subject area switching in the through image TI can be easily and accurately performed. Note that, when the main subject area is changed to a main subject area by resetting the main subject area, the angle of view, orientation, and the like of the imaging apparatus may be adjusted.

本実施形態では、安定していると判定されたマスクに対する評価を行うことで、主要被写体領域を設定している。しかしながら、これに限定される必要はない。例えば表示部として、タッチパネルを備えた表示部を備えた撮像装置の場合には、操作部としてタッチパネルが機能する。この場合、取得されるスルー画像TIから被写体の検出を行い、その結果をスルー画像TIに重畳させて表示する。この表示は、例えば検出された被写体の領域に対して枠などを用いて表示すればよい。そして、表示されるスルー画像TIにユーザが意図する被写体がある場合に、該被写体の領域に対応する箇所へのタッチ操作をタッチパネルに対して実行する。このタッチパネルへのタッチ操作が行われたときに、その操作された位置にある被写体の領域を主要被写体領域として設定すればよい。   In the present embodiment, the main subject region is set by performing an evaluation on a mask determined to be stable. However, it is not necessary to be limited to this. For example, in the case of an imaging apparatus including a display unit including a touch panel as the display unit, the touch panel functions as the operation unit. In this case, the subject is detected from the acquired through image TI, and the result is superimposed on the through image TI and displayed. This display may be performed using a frame or the like for the detected subject area, for example. Then, when there is a subject intended by the user in the displayed through image TI, a touch operation on a portion corresponding to the region of the subject is performed on the touch panel. When the touch operation on the touch panel is performed, the area of the subject at the operated position may be set as the main subject area.

また、タッチパネルを備えていない表示部の場合には、重畳表示される枠のうち、選択候補の被写体の領域に対する枠を他の枠とは異なる表示にて表示する。そして、十字キーなどの操作により、選択候補となる被写体の領域に対する枠の表示を他の被写体の領域に切り替えながら表示する。そして、意図する被写体の領域に、選択候補の被写体の領域に対する枠を移動させたときに、選択を意図する操作を行うことで、主要被写体領域を設定することも可能である。   Further, in the case of a display unit that does not include a touch panel, the frame for the subject region of the selection candidate is displayed with a display different from the other frames among the superimposed frames. Then, the display of the frame for the subject area to be selected is switched to another subject area by an operation of the cross key or the like. It is also possible to set the main subject region by performing an operation intended to be selected when the frame for the subject region of the selection candidate is moved to the intended subject region.

本実施形態では、撮像装置を例に取り上げているが、これに限定される必要はなく、例えばカメラ機能を備えた携帯電話機やスマートフォンなどの携帯型情報端末機や、カメラとコンピュータとからなるカメラシステムであっても、本発明を適用することが可能である。また、この他に、取得された画像データを入力することで、図4及び図5のフローチャートの処理を実行する画像処理装置であってもよい。この場合、ステップS101及びステップS120の処理は省略すればよい。   In this embodiment, the imaging apparatus is taken as an example, but the present invention is not limited to this. For example, a portable information terminal such as a mobile phone or a smartphone having a camera function, or a camera including a camera and a computer. The present invention can be applied even to a system. In addition, an image processing apparatus that executes the processes of the flowcharts of FIGS. 4 and 5 by inputting the acquired image data may be used. In this case, the processing of step S101 and step S120 may be omitted.

また、この他に、図4及び図5におけるフローチャートの処理をコンピュータに実行させることが可能な画像処理プログラムであってもよい。この場合、画像処理プログラムは、メモリカード、光学ディスク、磁気ディスクなど、コンピュータにより読み取ることが可能な記憶媒体に記憶されていることが好ましい。   In addition, an image processing program capable of causing a computer to execute the processes of the flowcharts in FIGS. 4 and 5 may be used. In this case, the image processing program is preferably stored in a computer-readable storage medium such as a memory card, an optical disk, or a magnetic disk.

10…撮像装置、21…撮像部、22…画像処理回路、23…表示部、26…CPU、41…検出部、42…判定部、43…追尾部、44…評価部、45…設定部   DESCRIPTION OF SYMBOLS 10 ... Imaging device, 21 ... Imaging part, 22 ... Image processing circuit, 23 ... Display part, 26 ... CPU, 41 ... Detection part, 42 ... Determination part, 43 ... Tracking part, 44 ... Evaluation part, 45 ... Setting part

Claims (10)

特定の被写体を追尾対象とする画像処理装置であって、
第1画像に含まれている被写体と前記第1画像よりも後に生成される第2画像に含まれている被写体とを検出する検出部と、
前記検出部により、前記第1画像の中心部分を含む第1領域において追尾対象になっている第1被写体が検出され、かつ、前記第2画像の中心部分を含み、前記第1領域よりも面積の大きい第2領域において前記第1被写体が検出されず、前記第2画像の中心部分を含み、前記第2領域よりも面積の小さい第3領域において前記第1被写体とは異なる第2被写体が検出されると、前記第1被写体から切り替えて前記第2被写体を前記特定の被写体として設定する設定部と、を備え、
前記第3領域は、前記第2画像において前記第2領域に含まれ、前記第1画像の前記第1領域と面積、形状及び位置が対応する画像処理装置。
An image processing apparatus for tracking a specific subject,
A detection unit for detecting a subject included in the first image and a subject included in the second image generated after the first image;
The detection unit detects a first subject that is a tracking target in a first region that includes a central portion of the first image, and includes a central portion of the second image and has an area larger than that of the first region. The first subject is not detected in the second region having a large size, and a second subject different from the first subject is detected in the third region including the central portion of the second image and having a smaller area than the second region. Once, and a setting unit that sets the second object as the specific object is switched from the first object,
The third area is included in the second area in the second image, and the area, shape, and position of the first area correspond to the first area of the first image .
特定の被写体を追尾対象とする画像処理装置であって、
第1画像に含まれている被写体と前記第1画像よりも後に生成される第2画像に含まれている被写体とを検出する検出部と、
前記検出部により前記第1画像の中心部分を含む第1領域において検出された、追尾対象になっている第1被写体が、前記検出部により、前記第2画像の中心部分を含み、前記第1領域よりも面積の大きい第2領域において検出されず、かつ、前記第2画像の中心部分を含み、前記第2領域よりも面積の小さい第3領域において第2被写体が検出されると、前記第1被写体から切り替えて前記第2被写体を前記特定の被写体として設定する設定部と、を備え、
前記第3領域は、前記第2画像において前記第2領域に含まれ、前記第1画像の前記第1領域と面積、形状及び位置が対応する画像処理装置。
An image processing apparatus for tracking a specific subject,
A detection unit for detecting a subject included in the first image and a subject included in the second image generated after the first image;
The first subject to be tracked , detected in the first region including the central part of the first image by the detection unit , includes the central part of the second image by the detection unit , and the first not detected in a large second region area than the area, and comprises a central portion of the second image, the second object is detected in the small third region area than the second region, the second the second object is switched from 1 object and a setting unit configured to set as the specific subject,
The third area is included in the second area in the second image, and the area, shape, and position of the first area correspond to the first area of the first image .
前記検出部は、前記第1画像から得られる特徴量と前記第2画像から得られる特徴量とに基づいて前記第1画像に含まれる被写体と前記第2画像に含まれる被写体とを検出する請求項1又は請求項2に記載の画像処理装置。 The detection unit detects a subject included in the first image and a subject included in the second image based on a feature amount obtained from the first image and a feature amount obtained from the second image. The image processing apparatus according to claim 1 or 2 . 請求項1から請求項3のいずれか一項に記載の画像処理装置を備える撮像装置。An imaging device comprising the image processing device according to any one of claims 1 to 3. 被写体を撮像して画像データを出力する撮像素子を備え、An image sensor that images a subject and outputs image data is provided.
前記検出部は、前記撮像素子から出力された第1画像データにより生成される前記第1画像に含まれる被写体と、前記第1画像データよりも後に前記撮像素子から出力された第2画像データにより生成される前記第2画像に含まれる被写体と、を検出する請求項4に記載の撮像装置。  The detection unit includes a subject included in the first image generated by the first image data output from the image sensor, and a second image data output from the image sensor after the first image data. The imaging apparatus according to claim 4, wherein a subject included in the generated second image is detected.
前記撮像素子は、フォーカスレンズを含む光学系からの光を電荷に変換する光電変換素子を有し、
前記設定部により前記特定の被写体として設定された前記第2被写体の情報に基づいて前記フォーカスレンズを駆動させる制御部を備える請求項5に記載の撮像装置。
The imaging element has a photoelectric conversion element that converts light from an optical system including a focus lens into electric charge,
The imaging apparatus according to claim 5, further comprising a control unit that drives the focus lens based on information about the second subject set as the specific subject by the setting unit .
前記制御部は、前記設定部により設定された前記特定の被写体を示す画像を表示部に表示させる請求項6に記載の撮像装置。 The imaging apparatus according to claim 6, wherein the control unit causes the display unit to display an image indicating the specific subject set by the setting unit. 前記画像は、前記設定部により設定された前記特定の被写体の少なくとも一部を囲むように表示される請求項7に記載の撮像装置。 The imaging apparatus according to claim 7, wherein the image is displayed so as to surround at least a part of the specific subject set by the setting unit. 前記制御部は、前記設定部により前記特定の被写体として設定された前記第2被写体の情報に基づいて露出調整を行う請求項6から請求項のいずれか一項に記載の撮像装置。 The imaging device according to any one of claims 6 to 8 , wherein the control unit performs exposure adjustment based on information on the second subject set as the specific subject by the setting unit. 前記制御部は、前記設定部により前記特定の被写体として設定された前記第2被写体の情報に基づいてホワイトバランス調整を行う請求項6から請求項のいずれか一項に記載の撮像装置。 Wherein the control unit, the imaging apparatus according to any one of claims 9 claims 6 to perform white balance adjustment on the basis of the second object of the information set as a specific subject by the setting unit.
JP2017088041A 2017-04-27 2017-04-27 Image processing apparatus and imaging apparatus Active JP6489150B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017088041A JP6489150B2 (en) 2017-04-27 2017-04-27 Image processing apparatus and imaging apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017088041A JP6489150B2 (en) 2017-04-27 2017-04-27 Image processing apparatus and imaging apparatus

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2013113858A Division JP6136583B2 (en) 2013-05-30 2013-05-30 Image processing apparatus, imaging apparatus, and image processing program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2019035938A Division JP2019134438A (en) 2019-02-28 2019-02-28 Image processing apparatus, imaging apparatus, and image processing program

Publications (2)

Publication Number Publication Date
JP2017192131A JP2017192131A (en) 2017-10-19
JP6489150B2 true JP6489150B2 (en) 2019-03-27

Family

ID=60085101

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017088041A Active JP6489150B2 (en) 2017-04-27 2017-04-27 Image processing apparatus and imaging apparatus

Country Status (1)

Country Link
JP (1) JP6489150B2 (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5309490B2 (en) * 2007-07-26 2013-10-09 カシオ計算機株式会社 Imaging device, subject tracking zooming method, and subject tracking zooming program
JP4544282B2 (en) * 2007-09-14 2010-09-15 ソニー株式会社 Data processing apparatus, data processing method, and program
JP5207918B2 (en) * 2008-10-27 2013-06-12 キヤノン株式会社 Image processing apparatus, imaging apparatus, and image processing method
JP5127686B2 (en) * 2008-12-11 2013-01-23 キヤノン株式会社 Image processing apparatus, image processing method, and imaging apparatus
JP5144487B2 (en) * 2008-12-15 2013-02-13 キヤノン株式会社 Main face selection device, control method thereof, imaging device, and program
JP2011124614A (en) * 2009-12-08 2011-06-23 Panasonic Corp Subject tracking device and subject tracking method
JP5864938B2 (en) * 2011-07-25 2016-02-17 キヤノン株式会社 Imaging apparatus and control method thereof
JP6136583B2 (en) * 2013-05-30 2017-05-31 株式会社ニコン Image processing apparatus, imaging apparatus, and image processing program

Also Published As

Publication number Publication date
JP2017192131A (en) 2017-10-19

Similar Documents

Publication Publication Date Title
JP5380784B2 (en) Autofocus device, imaging device, and autofocus method
US9906708B2 (en) Imaging apparatus, imaging method, and non-transitory storage medium storing imaging program for controlling an auto-focus scan drive
US10148889B2 (en) Image processing apparatus and control method thereof, image capturing apparatus and storage medium
US10477101B2 (en) Focus detection apparatus, control method and storage medium
EP3125037B1 (en) Lens control device, lens control method, and recording medium
US9781330B2 (en) Focus detection apparatus and control method for focus detection apparatus
JP6136583B2 (en) Image processing apparatus, imaging apparatus, and image processing program
US11178337B2 (en) Image capturing apparatus, method of controlling the same, and non-transitory computer readable storage medium for calculating a depth width for an object area based on depth information
JP2014078826A (en) Imaging apparatus, control method therefor, control program, and recording medium
JP2019134438A (en) Image processing apparatus, imaging apparatus, and image processing program
WO2013094551A1 (en) Imaging device, method for controlling same, and program
WO2013094552A1 (en) Imaging device, method for controlling same, and program
US20180309932A1 (en) Image stabilization apparatus, image stabilization method, image capturing apparatus, image capturing system and non-transitory storage medium
JP6431429B2 (en) IMAGING DEVICE, ITS CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM
US9264603B2 (en) Imaging apparatus and imaging method
JP6489150B2 (en) Image processing apparatus and imaging apparatus
JP5062095B2 (en) Imaging device
JP2015111226A (en) Subject tracking device and control method of the same, imaging device, program, and storage medium
JP5871196B2 (en) Focus adjustment device and imaging device
JP6858065B2 (en) Imaging device and its control method
US11050923B2 (en) Imaging apparatus and control method
US10681274B2 (en) Imaging apparatus and control method thereof
WO2016157569A1 (en) Imaging device and focus evaluation device
JP5938268B2 (en) Imaging apparatus and control method thereof
JP5040669B2 (en) Imaging device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A132

Effective date: 20180227

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180412

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180925

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20181122

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190116

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190211

R150 Certificate of patent or registration of utility model

Ref document number: 6489150

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250