JP2020039165A - Zoom control device, imaging apparatus, control method of zoom control device, control program of zoom control device - Google Patents

Zoom control device, imaging apparatus, control method of zoom control device, control program of zoom control device Download PDF

Info

Publication number
JP2020039165A
JP2020039165A JP2019206451A JP2019206451A JP2020039165A JP 2020039165 A JP2020039165 A JP 2020039165A JP 2019206451 A JP2019206451 A JP 2019206451A JP 2019206451 A JP2019206451 A JP 2019206451A JP 2020039165 A JP2020039165 A JP 2020039165A
Authority
JP
Japan
Prior art keywords
subject
zoom
composition
size
control device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2019206451A
Other languages
Japanese (ja)
Other versions
JP6839254B2 (en
Inventor
昭洋 粒崎
Akihiro Ryuzaki
昭洋 粒崎
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Publication of JP2020039165A publication Critical patent/JP2020039165A/en
Application granted granted Critical
Publication of JP6839254B2 publication Critical patent/JP6839254B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Lens Barrels (AREA)
  • Studio Devices (AREA)
  • Adjustment Of Camera Lenses (AREA)
  • Exposure Control For Cameras (AREA)
  • Details Of Cameras Including Film Mechanisms (AREA)

Abstract

To perform auto zoom control with a composition suitable for a scene determined on the basis of photographic subject detection information without requiring a photographer to select a composition.SOLUTION: The zoom control device includes: a subject detection unit 123 for detecting a subject image from an image acquired using an imaging optical system; an AZ control unit 122, for setting a reference size of the subject image used for controlling a zoom magnification and controlling the zoom magnification on the basis of the set reference size and sizes of subject images sequentially detected by the subject detection unit 123. The AZ control unit 122 changes the reference size on the basis of at least one of whether the zoom control device is in a hand-held state, whether a self-photographing mode is set, a distance to the subject, and a still time of the subject.SELECTED DRAWING: Figure 14

Description

本発明は、画像から被写体像を検出してズーム倍率を制御する技術に関するものである。   The present invention relates to a technology for detecting a subject image from an image and controlling a zoom magnification.

従来から、ズームレンズを駆動して光学的な変倍(以下、光学ズームという)を行う機能、及び、撮影画像の一部を拡大して電子的な変倍(以下、電子ズームという)を行う機能を有する撮像装置がある。さらに、被写体の検出情報に応じて自動でズーム倍率を変更するオートズーム(自動変倍)機能がある。以下、光学ズーム動作と電子ズーム動作を総称してズーム動作という。   2. Description of the Related Art Conventionally, a function of driving a zoom lens to perform optical zooming (hereinafter, referred to as optical zoom), and performing zooming electronically (hereinafter, electronic zooming) by enlarging a part of a captured image. Some imaging devices have a function. Further, there is an auto zoom (automatic scaling) function for automatically changing the zoom magnification according to the detection information of the subject. Hereinafter, the optical zoom operation and the electronic zoom operation are collectively referred to as a zoom operation.

特許文献1では、被写体の大きさを一定に維持するオートズーム機能を搭載するカメラの構成が開示されている。特許文献1では、オートズーム機能において「顔アップ」、「バストアップ」、「全身」といった複数の選択肢の中から撮影者が構図を選択する方法が開示されている。被写体像の大きさを維持するオートズーム制御では、選択された構図に基づいて、ズーム制御の基準となる被写体像の大きさが決定される。例えば撮影者が「全身」の構図を選択した場合、被写体である人物の全身の像を撮影画面内に収めるようにズーム動作が行われる。   Patent Literature 1 discloses a configuration of a camera equipped with an auto-zoom function for maintaining a size of a subject constant. Patent Literature 1 discloses a method in which a photographer selects a composition from a plurality of options such as “face up”, “bust up”, and “whole body” in an auto zoom function. In the auto zoom control for maintaining the size of the subject image, the size of the subject image serving as a reference for the zoom control is determined based on the selected composition. For example, when the photographer selects the “whole body” composition, the zoom operation is performed so that the whole body image of the person who is the subject is included in the shooting screen.

特開2012−95019号公報JP 2012-95019 A

しかしながら、特許文献1では、オートズーム機能にて撮影者が撮影したい構図をあらかじめ選択しておく必要がある。そのため、撮影シーンや被写体の状態(動きや数等)が変わるごとに撮影者が設定変更の操作を行う必要がある。また、撮影するシーンに対して構図の設定が適切でない場合、適切な大きさで被写体を撮影できない可能性がある。例えば、動き回る被写体や遠くの被写体を撮影するシーンで「顔」の構図に設定された場合、被写体がフレームアウトしてしまう可能性がある。また、静止している被写体を撮影するシーンで「全身」の構図に設定された場合には、被写体が小さすぎる構図になってしまう可能性がある。   However, in Patent Literature 1, it is necessary for the photographer to select a composition to be photographed in advance by using the auto zoom function. Therefore, every time the shooting scene or the state (movement, number, etc.) of the subject changes, the photographer needs to perform a setting change operation. In addition, if the composition setting is not appropriate for the scene to be photographed, the subject may not be photographed in an appropriate size. For example, when the composition of a “face” is set in a scene in which a moving subject or a distant subject is photographed, the subject may go out of frame. In addition, when the composition of a “still body” is set in a scene in which a still subject is photographed, the composition of the subject may be too small.

上記課題に鑑みて、本発明は、撮影者が構図を選択することなく、被写体の検出情報に基づき判定したシーンに適した構図でオートズーム制御を行うことを目的とする。   In view of the above problems, an object of the present invention is to perform auto zoom control with a composition suitable for a scene determined based on subject detection information without a photographer selecting a composition.

本発明に係る装置は、撮影光学系を用いて取得された画像から被写体像を検出する被写体検出手段と、ズーム倍率の制御に用いる被写体像の基準サイズを設定する設定手段と、
前記設定手段により設定された前記基準サイズと前記被写体検出手段により逐次検出される被写体像のサイズに基づいて、ズーム倍率を制御する制御手段と、を有する。前記設定手段は、前記ズーム制御装置が手持ち状態であるか否か、自分撮りモードが設定されているか否か、被写体までの距離、前記被写体の静止時間の少なくともいずれかに基づいて前記基準サイズを変更する。
An apparatus according to the present invention includes: a subject detection unit configured to detect a subject image from an image acquired using an imaging optical system; and a setting unit configured to set a reference size of the subject image used for controlling a zoom magnification.
Control means for controlling a zoom magnification based on the reference size set by the setting means and a size of a subject image sequentially detected by the subject detection means. The setting unit is configured to determine whether the zoom control device is in a hand-held state, whether a self-portrait mode is set, a distance to a subject, or at least one of a time during which the subject is at rest, to set the reference size. change.

本発明によれば、撮影者が構図を選択することなく、被写体の検出情報に基づき判定したシーンに適した構図でオートズーム制御を行うことができる。   According to the present invention, auto-zoom control can be performed with a composition suitable for a scene determined based on subject detection information without a photographer selecting a composition.

本発明の実施形態に係るデジタルカメラの構成例を示すブロック図である。FIG. 1 is a block diagram illustrating a configuration example of a digital camera according to an embodiment of the present invention. 焦点距離と、被写体距離ごとのフォーカスレンズ位置との関係を例示した図である。FIG. 3 is a diagram illustrating a relationship between a focal length and a focus lens position for each subject distance. 被写体(物体)の画面外へのフレームアウトを防止する処理の説明図である。FIG. 9 is an explanatory diagram of a process of preventing a subject (object) from going out of the frame; 被写体(人物)の画面外へのフレームアウトを防止する処理の説明図である。FIG. 9 is an explanatory diagram of a process of preventing a subject (person) from being out of the frame; 被写体(人物)の画面内でのサイズ変化を防止する処理の説明図である。FIG. 9 is an explanatory diagram of a process for preventing a change in size of a subject (person) in a screen. 被写体が人物の場合の構図設定を説明する図である。FIG. 3 is a diagram illustrating composition setting when a subject is a person. オートズーム機能の処理の流れを説明するフローチャートである。5 is a flowchart illustrating a flow of processing of an auto zoom function. 被写体探索処理を説明するフローチャートである。It is a flowchart explaining a subject search process. 被写体探索処理の探索終了領域を説明する図である。It is a figure explaining the search end area of subject search processing. 被写体指定処理を説明するフローチャートである。It is a flowchart explaining a subject specification process. 被写体指定処理の別例を説明するフローチャートである。13 is a flowchart illustrating another example of the subject specification process. 基準サイズの設定処理を説明するフローチャートである。It is a flowchart explaining a setting process of a reference size. 画面サイズの算出処理を説明するフローチャートである。It is a flowchart explaining the calculation process of a screen size. 構図設定「オート」における自動構図判定を説明する遷移図である。FIG. 8 is a transition diagram illustrating automatic composition determination in composition setting “auto”. 最周辺の被写体位置と画面サイズとを示す図である。FIG. 3 is a diagram showing the position of the subject at the outermost periphery and the screen size. 構図設定「オート」における基準サイズの算出処理を説明するフローチャートである。9 is a flowchart illustrating a reference size calculation process in a composition setting “auto”. 水平方向被写体位置比率の算出処理を説明するフローチャートである。11 is a flowchart illustrating a calculation process of a horizontal subject position ratio. 垂直方向被写体位置比率の算出処理を説明するフローチャートである。9 is a flowchart illustrating a calculation process of a vertical subject position ratio. 被写体位置を推定する顔個数を示す表である。9 is a table showing the number of faces for estimating a subject position. オートズーム制御の処理を説明するフローチャートである。6 is a flowchart illustrating a process of automatic zoom control. ズーム動作を説明するフローチャートである。5 is a flowchart illustrating a zoom operation. 第2の実施形態における構図設定「オート」における自動構図判定を説明する遷移図である。FIG. 11 is a transition diagram illustrating automatic composition determination in composition setting “auto” according to the second embodiment.

(第1の実施形態)
以下に、本発明の一実施形態を添付図面に基づいて詳細に説明する。図1は、本実施形態におけるズーム制御装置を備えた撮像装置の一例として、オートズーム機能を有するデジタルカメラ100の構成例を示すブロック図である。
(First embodiment)
Hereinafter, an embodiment of the present invention will be described in detail with reference to the accompanying drawings. FIG. 1 is a block diagram illustrating a configuration example of a digital camera 100 having an automatic zoom function as an example of an imaging apparatus including a zoom control device according to the present embodiment.

レンズ鏡筒101は、その内部にレンズ群を保持している。ズームレンズ102は、レンズ鏡筒101の光軸方向に移動することで焦点距離を調節し、光学的に画角を変更(ズーム位置を移動)する。フォーカスレンズ103は、レンズ鏡筒101の光軸方向に移動することで焦点調節を行う。防振レンズ(像ブレ補正用レンズ)104は、手ぶれ等に起因する像ブレを補正する。光量調節を行う絞り及びシャッタ105は、露出制御に用いられる。なお、本実施形態において、デジタルカメラ100は、レンズ鏡筒101とカメラ本体部とが一体的に構成された撮像装置であるが、これに限定されるものではない。本実施形態は、カメラ本体部と、カメラ本体部に着脱可能な交換レンズとから構成される撮像システムにも適用可能である。   The lens barrel 101 holds a lens group inside. The zoom lens 102 adjusts the focal length by moving in the optical axis direction of the lens barrel 101, and optically changes the angle of view (moves the zoom position). The focus lens 103 performs focus adjustment by moving in the optical axis direction of the lens barrel 101. An anti-shake lens (image blur correction lens) 104 corrects image blur caused by camera shake or the like. A diaphragm and a shutter 105 for adjusting the amount of light are used for exposure control. Note that, in the present embodiment, the digital camera 100 is an imaging device in which the lens barrel 101 and the camera body are integrally configured, but is not limited to this. The present embodiment is also applicable to an imaging system including a camera body and an interchangeable lens that is detachable from the camera body.

撮像素子106は、レンズ鏡筒101を通過した光を受光し、光電変換によって被写体像を電気信号に変換することで撮像信号を生成する。撮像素子106はCCD(電荷結合素子)型またはCMOS(相補型金属酸化膜半導体)型のイメージセンサ等である。撮像素子106による撮像信号は、画像処理回路107に入力されて、画素補間処理や色変換処理等の各種処理が行われる。各種処理後の画像データは画像メモリ108に記憶される。画像メモリ108は、DRAM(Dynamic Random Access Memory)やSRAM(Static Random Access Memory)等の記憶デバイスである。   The image sensor 106 receives light that has passed through the lens barrel 101 and generates an image signal by converting a subject image into an electric signal by photoelectric conversion. The image sensor 106 is a CCD (charge coupled device) type or CMOS (complementary metal oxide semiconductor) type image sensor or the like. An image signal from the image sensor 106 is input to an image processing circuit 107, and various processes such as a pixel interpolation process and a color conversion process are performed. The image data after various processes is stored in the image memory 108. The image memory 108 is a storage device such as a DRAM (Dynamic Random Access Memory) or an SRAM (Static Random Access Memory).

表示部109は、TFT型LCD(薄膜トランジスタ駆動型液晶表示器)等を備えて構成され、撮影画像(画像データ)や、特定の情報(例えば、撮影情報等)を表示する。撮影画像に係るライブビュー等の情報表示により、撮影者が画角合わせを行うための電子ビューファインダ(EVF)機能を提供できる。   The display unit 109 includes a TFT LCD (thin film transistor driven liquid crystal display) and the like, and displays a captured image (image data) and specific information (for example, imaging information). By displaying information such as a live view on a captured image, an electronic viewfinder (EVF) function for a photographer to adjust the angle of view can be provided.

絞りシャッタ駆動部110は、画像処理回路107での画像処理によって得られた輝度情報に基づいて露出制御値(絞り値及びシャッタ速度)を演算し、演算結果に基づいて絞り及びシャッタ105を駆動する。これにより、自動露出(AE)制御が行われる。防振レンズ駆動部111は、ジャイロセンサ等の角速度センサによる振れ検出情報に基づいてデジタルカメラ100に加わる振れ量を演算する。演算結果にしたがって、デジタルカメラ100に加わる振れ量を打ち消す(低減する)ように防振レンズ104が駆動される。   The aperture shutter drive unit 110 calculates an exposure control value (aperture value and shutter speed) based on luminance information obtained by the image processing in the image processing circuit 107, and drives the aperture and the shutter 105 based on the calculation result. . Thereby, automatic exposure (AE) control is performed. The image stabilizing lens driving unit 111 calculates a shake amount applied to the digital camera 100 based on shake detection information from an angular velocity sensor such as a gyro sensor. The image stabilizing lens 104 is driven to cancel (reduce) the amount of shake applied to the digital camera 100 according to the calculation result.

フォーカスレンズ駆動部112は、フォーカスレンズ103を駆動する。本実施形態において、デジタルカメラ100は、コントラスト方式で自動焦点調節(AF)制御を行う。つまりフォーカスレンズ駆動部112は、画像処理回路107での画像処理により得られた撮影光学系の焦点調節情報(コントラスト評価値)に基づいて、被写体に焦点が合うようにフォーカスレンズ103を駆動する。ただし、これに限定されるものではなく、コントラスト方式以外のAF制御として、位相差AF方式でもよいし、また、コントラスト方式と他の方式との組み合わせのように、複数の方式でAF制御を行う構成でもよい。   The focus lens driving unit 112 drives the focus lens 103. In the present embodiment, the digital camera 100 performs automatic focus adjustment (AF) control by a contrast method. That is, the focus lens driving unit 112 drives the focus lens 103 based on the focus adjustment information (contrast evaluation value) of the photographing optical system obtained by the image processing in the image processing circuit 107 so that the subject is in focus. However, the present invention is not limited to this, and as the AF control other than the contrast method, a phase difference AF method may be used, or AF control is performed by a plurality of methods such as a combination of a contrast method and another method. A configuration may be used.

ズームレンズ駆動部113は、ズーム操作指示に従ってズームレンズ102を駆動する。操作部117は、撮影者がカメラにズーミングを指示するためのズーム操作部材としてのズームレバーまたはズームボタン等を備える。システム制御部114は、ズーム指示操作に用いるズーム操作部材の操作量及び操作方向を検知して、ズーム駆動速度やズーム駆動方向を演算し、演算結果に従ってズームレンズ102を光軸に沿って移動させる制御を行う。   The zoom lens driving unit 113 drives the zoom lens 102 according to a zoom operation instruction. The operation unit 117 includes a zoom lever or a zoom button as a zoom operation member for the photographer to instruct the camera to perform zooming. The system control unit 114 detects the operation amount and operation direction of the zoom operation member used for the zoom instruction operation, calculates the zoom drive speed and the zoom drive direction, and moves the zoom lens 102 along the optical axis according to the calculation result. Perform control.

撮影動作によって生成された画像データは、インターフェース(I/F)部115を介して記録部116に送られて記録される。画像データは、外部記録媒体、または不揮発性のメモリ118、あるいはそれらの両方に記録される。外部記録媒体は、デジタルカメラ100に装着して使用されるメモリカード等である。不揮発性のメモリ118は、デジタルカメラ100に内蔵されている記憶媒体である。メモリ118は、プログラムデータや画像データの他に、デジタルカメラ100の設定情報や、後述するオートズーム機能におけるズームイン位置等の情報を記憶する。
操作部117は、前記ズーム操作部材に加えて、撮影開始を指示するレリーズスイッチ、オートズーム機能の開始や終了を指示するオートズーム操作スイッチ等を含む。操作部117からの信号は、システム制御部114に送られる。
The image data generated by the photographing operation is sent to the recording unit 116 via the interface (I / F) unit 115 and recorded. The image data is recorded on an external recording medium, the nonvolatile memory 118, or both. The external recording medium is a memory card or the like used by being attached to the digital camera 100. The non-volatile memory 118 is a storage medium built in the digital camera 100. The memory 118 stores, in addition to the program data and the image data, setting information of the digital camera 100 and information such as a zoom-in position in an auto-zoom function described later.
The operation unit 117 includes, in addition to the zoom operation members, a release switch for instructing the start of photographing, an auto zoom operation switch for instructing start and end of the auto zoom function, and the like. A signal from the operation unit 117 is sent to the system control unit 114.

システム制御部114は、CPU(中央演算処理装置)等の演算装置を備える。システム制御部114は、撮影者の操作に応じて各部に制御命令を送ることによりデジタルカメラ100全体を制御する。システム制御部114は、メモリ118に記憶されている各種の制御プログラム、例えば撮像素子106の制御やAE/AF制御、ズーム制御(オートズーム処理を含む)等を行うためのプログラムを実行する。   The system control unit 114 includes an arithmetic device such as a CPU (Central Processing Unit). The system control unit 114 controls the entire digital camera 100 by sending a control command to each unit according to the operation of the photographer. The system control unit 114 executes various control programs stored in the memory 118, for example, a program for performing control of the image sensor 106, AE / AF control, zoom control (including automatic zoom processing), and the like.

光学ズームによる画角変更時に合焦状態を維持するには、レンズ鏡筒101がリアフォーカスタイプである場合、ズームレンズ102の位置に応じてフォーカスレンズ103を適正なフォーカス位置へ移動させる必要がある。このような制御をコンピュータズーム(CZ)制御といい、システム制御部114におけるCZ制御部119が行う。図2は、ズームレンズの焦点距離と、被写体距離ごとのフォーカス位置との関係を例示する図である。図2では、ズームレンズの焦点距離と、ピントが合うフォーカス位置との関係を、被写体までの距離ごとに示すデータテーブルとしてグラフ化して示す。本実施形態において、このテーブルをフォーカスカムテーブルと称する。図2において、横軸はズーム位置に対応する焦点距離を示し、縦軸はフォーカス位置を示す。各グラフ線の横には、デジタルカメラ100から被写体までの距離(被写体距離)を例示する。   In order to maintain a focused state when the angle of view is changed by optical zoom, when the lens barrel 101 is a rear focus type, it is necessary to move the focus lens 103 to an appropriate focus position according to the position of the zoom lens 102. . Such control is called computer zoom (CZ) control, and is performed by the CZ control unit 119 in the system control unit 114. FIG. 2 is a diagram illustrating the relationship between the focal length of the zoom lens and the focus position for each subject distance. FIG. 2 is a graph showing the relationship between the focal length of the zoom lens and the focus position where focus is achieved, as a data table indicating the distance to the subject. In the present embodiment, this table is called a focus cam table. In FIG. 2, the horizontal axis indicates the focal length corresponding to the zoom position, and the vertical axis indicates the focus position. A distance (subject distance) from the digital camera 100 to the subject is illustrated next to each graph line.

システム制御部114は、AF制御を行う際にフォーカスレンズ駆動部112を制御して、フォーカスレンズ103を所定の範囲において移動させることによりスキャン動作を行う。スキャン動作中に得られるコントラスト評価値等を用いて既知の方法により、合焦点であるフォーカス位置が検出される。そのときのズーム位置及びフォーカス位置を用い、フォーカスカムテーブルを参照することにより、被写体距離が計測される。   The system control unit 114 controls the focus lens driving unit 112 when performing the AF control, and performs a scanning operation by moving the focus lens 103 within a predetermined range. The focus position, which is the focal point, is detected by a known method using a contrast evaluation value or the like obtained during the scanning operation. The subject distance is measured by referring to the focus cam table using the zoom position and the focus position at that time.

次に、システム制御部114におけるオートズーム機能に関連する制御について説明する。図1に示すように、システム制御部114は、CZ制御部119、電子ズーム制御部120、オートズーム制御部(以下、AZ制御部という)122、被写体検出部123を備える。   Next, control related to the auto zoom function in the system control unit 114 will be described. As shown in FIG. 1, the system control unit 114 includes a CZ control unit 119, an electronic zoom control unit 120, an auto zoom control unit (hereinafter, referred to as an AZ control unit) 122, and a subject detection unit 123.

デジタルカメラ100は、光学ズーム機能及び電子ズーム機能を有しており、CZ制御部119及びズームレンズ駆動部113が光学ズームの制御を担当する。CZ制御部119は、ズーム動作時に、所定の制御周期ごとにズームレンズ102のズーム位置を検出する。そしてCZ制御部119は、検出したズーム位置に応じたAF制御にて計測された被写体距離でのフォーカスカムテーブルに追従するように、フォーカスレンズ103を駆動させる制御を行う。これにより、合焦状態を維持したまま光学ズーム動作を行うことが可能となる。   The digital camera 100 has an optical zoom function and an electronic zoom function, and the CZ control unit 119 and the zoom lens driving unit 113 control the optical zoom. The CZ control unit 119 detects a zoom position of the zoom lens 102 at a predetermined control cycle during a zoom operation. Then, the CZ control unit 119 performs control to drive the focus lens 103 so as to follow the focus cam table at the subject distance measured by the AF control according to the detected zoom position. This makes it possible to perform the optical zoom operation while maintaining the in-focus state.

一方、電子ズーム制御部120及び画像メモリ108は電子ズームの制御を担当する。電子ズーム制御部120は、画像メモリ108に転送された画像データから対象領域内のデータを切り出すことにより、電子ズーム機能を実現する。また、電子ズーム制御部120は、撮像素子106に取り込む画像のフレームレート周期で切り出す範囲を徐々に大きくしながら表示部109に表示させることにより、滑らかな電子ズーム表示を実現する。
被写体検出部123は、画像メモリ108に記憶された画像データから所望の被写体領域を逐次検出する。本実施形態では、画像データに含まれる顔情報または色情報に基づいて被写体(人物等の顔、または物体)を検出する被写体検出方法(顔検出処理、色検出処理)について説明する。
On the other hand, the electronic zoom control unit 120 and the image memory 108 are in charge of controlling the electronic zoom. The electronic zoom control unit 120 realizes an electronic zoom function by cutting out data in the target area from the image data transferred to the image memory 108. In addition, the electronic zoom control unit 120 realizes a smooth electronic zoom display by causing the display unit 109 to display the image to be captured by the image sensor 106 while gradually increasing the range to be cut out at the frame rate cycle.
The subject detection unit 123 sequentially detects a desired subject area from the image data stored in the image memory 108. In the present embodiment, a subject detection method (face detection processing, color detection processing) for detecting a subject (a face such as a person or an object) based on face information or color information included in image data will be described.

顔検出処理は、画像データ中に存在する顔領域を公知のアルゴリズムにより検出する処理である。例えば、被写体検出部123は、画像データ上での正方形状の部分領域から特徴量を抽出し、その特徴量を予め用意された顔の特徴量と比較する。そして被写体検出部123は、両者の相関値が所定の閾値を超える場合、その部分領域を顔領域であると判定する。この判定処理は、部分領域のサイズ、配置位置、配置角度の組み合わせを変更しながら繰り返されることにより、画像データ中に存在する種々の顔領域を検出できる。   The face detection process is a process of detecting a face region existing in image data by a known algorithm. For example, the subject detection unit 123 extracts a feature amount from a square partial region on the image data, and compares the feature amount with a previously prepared face feature amount. When the correlation value between the two exceeds a predetermined threshold, the subject detection unit 123 determines that the partial area is a face area. This determination processing is repeated while changing the combination of the size, arrangement position, and arrangement angle of the partial area, so that various face areas existing in the image data can be detected.

色検出処理では、後述の被写体指定方法に従って指定された被写体領域の色情報を特徴色として記憶する処理が実行される。色検出処理は、検出対象の被写体が物体(人物以外の「モノ」)である場合に行われる。色情報としては、画像処理回路107からの出力信号であるRGB信号や輝度信号(Y信号)及び色差(R−Y、B−Y)信号等が用いられる。被写体検出時に被写体検出部123は、画像データを複数の部分領域に分割し、部分領域ごとの輝度及び色差の平均値を算出する。また、被写体検出部123は、予め記憶された特徴色情報と被写体検出時の各領域の色情報を比較し、輝度及び色差の差分が所定量以下の部分領域を被写体領域の候補とする。この被写体領域の候補で隣り合う部分領域の一群を同一色領域として、同一色領域が所定のサイズ範囲となる領域を最終的な被写体領域とする処理が行われる。   In the color detection process, a process of storing color information of a subject area designated according to a subject designation method described later as a characteristic color is executed. The color detection process is performed when the subject to be detected is an object (a “thing” other than a person). As the color information, an RGB signal, a luminance signal (Y signal), a color difference (RY, BY) signal, which is an output signal from the image processing circuit 107, and the like are used. When detecting a subject, the subject detection unit 123 divides the image data into a plurality of partial areas, and calculates an average value of luminance and color difference for each partial area. In addition, the subject detection unit 123 compares the previously stored characteristic color information with the color information of each area at the time of subject detection, and sets a partial area in which the difference between the luminance and the color difference is equal to or less than a predetermined amount as a subject area candidate. A process is performed in which a group of adjacent partial regions in the candidate of the subject region is set as the same color region, and a region where the same color region has a predetermined size range is set as a final subject region.

被写体検出部123は、顔情報及び色情報とともに、CZ制御部119で計測された被写体距離情報及びズームレンズ102の焦点距離情報を用いることにより、画像データ上での被写体領域の大きさを算出する。姿勢検出部124は、加速度センサの情報に基づいてデジタルカメラ100の姿勢(例えば正位置/グリップ上/グリップ下)を検出する。揺れ検出部125は、ジャイロセンサによる角速度情報等に基づいてデジタルカメラ100の振れ状態を判定により検出する。揺れ検出部125は、ジャイロセンサ等に加わる振れ量(検出値)が所定量(閾値)以上である場合にカメラが手持ち状態であると判定し、所定量未満である場合には三脚等に固定された状態であると判定する。姿勢検出及び揺れ検出に用いる加速度センサ及びジャイロセンサについては、防振レンズ駆動部111の制御情報を取得するための検出部のセンサと兼用する構成でもよい。   The subject detection unit 123 calculates the size of the subject area on the image data by using the subject distance information measured by the CZ control unit 119 and the focal length information of the zoom lens 102 together with the face information and the color information. . The posture detection unit 124 detects the posture (for example, the normal position / above the grip / below the grip) of the digital camera 100 based on the information of the acceleration sensor. The shake detection unit 125 determines the shake state of the digital camera 100 based on angular velocity information and the like from the gyro sensor. The shake detection unit 125 determines that the camera is in a hand-held state when the shake amount (detected value) applied to the gyro sensor or the like is equal to or more than a predetermined amount (threshold), and fixes the camera to a tripod or the like when the shake amount (detection value) is less than the predetermined amount. It is determined that the state has been performed. The acceleration sensor and the gyro sensor used for the posture detection and the shake detection may be configured to also serve as the sensor of the detection unit for acquiring the control information of the image stabilizing lens driving unit 111.

次に、本実施形態におけるオートズーム機能の概要と、AZ制御部122を説明する。オートズーム機能を搭載していないカメラでは、撮影者が望遠状態でフレーミングしてシャッタチャンスを待っている間に被写体が動いてフレームアウトした場合等において、以下の操作が必要であった。
まず撮影者は、ズーム操作部材の操作によりズームアウト動作を行ってから被写体を探索する。被写体の探索後、撮影者は再び所望の画角になるまでズーム操作を行って画角調整する。また、被写体が動いたために被写体像の大きさが変わった場合等においても、撮影者はズーム操作部材を操作して被写体像の大きさを調整する必要があった。
Next, an overview of the auto zoom function and the AZ control unit 122 according to the present embodiment will be described. In a camera not equipped with an auto-zoom function, the following operation is required when a photographer moves in a frame while moving in a telephoto state while waiting for a photo opportunity.
First, the photographer searches for a subject after performing a zoom-out operation by operating the zoom operation member. After searching for the subject, the photographer performs a zoom operation again to adjust the angle of view until the desired angle of view is obtained. In addition, even when the size of the subject image changes due to the movement of the subject, the photographer has to operate the zoom operation member to adjust the size of the subject image.

一方、オートズーム機能を搭載しているカメラでは、撮影者がオートズーム機能を設定した後、タッチパネル等で被写体を指定する操作を行い、撮影したい被写体を指定しておけばよい。オートズーム機能が設定されると、指定された被写体を画像の中央付近で所定のサイズに収めるように、自動でズーム動作が行われる。なお、被写体の指定方法としてはタッチパネル操作以外に、撮影者が特定のボタンを操作したときに画面中央付近にいる被写体を指定する方法や、カメラが検出した被写体の中から自動的に主被写体を選択する方法等がある。   On the other hand, in a camera equipped with an auto-zoom function, after the photographer sets the auto-zoom function, an operation of designating a subject with a touch panel or the like may be performed to designate a subject to be photographed. When the auto-zoom function is set, the zoom operation is automatically performed so that the designated subject fits in a predetermined size near the center of the image. In addition to the touch panel operation, the subject can be specified by specifying the subject near the center of the screen when the photographer operates a specific button, or automatically selecting the main subject from among the subjects detected by the camera. There is a selection method.

被写体検出部123は、画像メモリ108から指定された被写体領域の画像データ上での位置や大きさを算出する。この処理を、ライブビューとして画像表示するごとに、サンプリングの画像データに対して連続的に行うことにより、被写体の動きを追尾可能となる。追尾している被写体の画像が後述するズームアウト領域で検出された場合や、検出した被写体の画像が所定の大きさよりも大きくなった場合、AZ制御部122はズームアウト動作を開始する。すなわち、AZ制御部122はCZ制御部119または電子ズーム制御部120に対して、広角方向へのズームアウト指示を行う。被写体をズームイン領域内に検出し、かつ、被写体像が所定の大きさの範囲内に収まった場合には、望遠側へズームイン動作が行われる。このような処理により、撮影者はズーム操作を気にせず、所望の被写体の画像を画面内に収めるようにカメラを動かすだけでよい。仮に、被写体がフレームアウトしそうになった場合でも、自動的にズーム倍率が変更されるため、より簡単に画角合わせを行うことができる。   The subject detection unit 123 calculates the position and size of the subject area specified from the image memory 108 on the image data. This processing is continuously performed on the sampled image data every time an image is displayed as a live view, so that the movement of the subject can be tracked. The AZ control unit 122 starts a zoom-out operation when an image of the tracked subject is detected in a zoom-out area described later or when the detected image of the subject becomes larger than a predetermined size. That is, the AZ control unit 122 instructs the CZ control unit 119 or the electronic zoom control unit 120 to zoom out in the wide angle direction. When the subject is detected in the zoom-in area and the subject image falls within a predetermined size range, a zoom-in operation is performed on the telephoto side. By such a process, the photographer does not care about the zoom operation, but only needs to move the camera so that the image of the desired subject is included in the screen. Even if the subject is about to go out of frame, the zoom magnification is automatically changed, so that the angle of view can be adjusted more easily.

次に、図3から図5を参照して、ズームアウト動作やズームイン動作の開始条件について説明する。図3は、被写体(物体)が画面外へフレームアウトすることを防止する処理の説明図である。図4は、被写体(人物)が画面外へフレームアウトすることを防止する処理の説明図である。   Next, a start condition of the zoom-out operation or the zoom-in operation will be described with reference to FIGS. FIG. 3 is an explanatory diagram of a process for preventing a subject (object) from going out of the frame. FIG. 4 is an explanatory diagram of a process for preventing a subject (person) from going out of the frame.

図3及び図4において、枠300a及び枠300bは被写体(物体)を追尾する第1の追尾枠(以下、モノ追尾枠という)であり、枠400a〜fは被写体(人物の顔)を追尾する第2の追尾枠(以下、顔追尾枠という)である。以下では、被写体が人物と物体のいずれにも適用可能な場合、モノ追尾枠及び顔追尾枠を総称して被写体追尾枠ということもある。被写体追尾枠は、撮影者が指定した被写体が分かるように、表示部109のEVF画面(電子ビューファインダ画面)にて被写体像を囲むように表示される。被写体追尾枠の画面上での位置及び大きさは、顔情報及び色情報に基づいて被写体検出部123が逐次算出し、フレームレート周期で更新される。   3 and 4, frames 300a and 300b are first tracking frames (hereinafter referred to as mono-tracking frames) for tracking a subject (object), and frames 400a to 400f track the subject (human face). This is a second tracking frame (hereinafter, referred to as a face tracking frame). Hereinafter, when a subject can be applied to both a person and an object, the mono tracking frame and the face tracking frame may be collectively referred to as a subject tracking frame. The subject tracking frame is displayed on the EVF screen (electronic viewfinder screen) of the display unit 109 so as to surround the subject image so that the subject specified by the photographer can be recognized. The position and size of the subject tracking frame on the screen are sequentially calculated by the subject detection unit 123 based on the face information and the color information, and are updated at the frame rate cycle.

図3を参照して、被写体(飛行機)が画面外にフレームアウトすることを防止する処理について説明する。図3(A)にてズームアウト領域ZO(以下、ZO領域という)は、EVFで表示される画角全体(画面全体)に対して所定の比率よりも外側の領域を示している。例えば、画面の中心点を0%、画面全体を100%とし、画面全体に対して80%となる位置をZO領域の境界として設定する場合を想定する。この場合、画面全体における80〜100%の領域がZO領域となる。ZO領域にモノ追尾枠300aの一部が進入すると、AZ制御部122は、ズームアウト動作を開始させる制御を行う。また、AZ制御部122は、ズーム移動前のズーム倍率(ズームイン画角に相当)をメモリ118に記憶する。ズームアウト動作中の目標ズーム倍率やズーム速度は、被写体像のサイズや移動速度に応じて予め設定される。また、目標ズーム倍率やズーム速度を被写体像のサイズや移動速度に応じて適宜算出してもよい。ズームアウト動作は、その目標ズーム倍率やズーム速度に従って実行される。これにより、被写体のフレームアウトを効果的に防止することができる。   With reference to FIG. 3, a process for preventing the subject (airplane) from going out of the frame out of the screen will be described. In FIG. 3A, a zoom-out area ZO (hereinafter, referred to as a ZO area) indicates an area outside a predetermined ratio with respect to the entire angle of view (entire screen) displayed by the EVF. For example, assume that the center point of the screen is 0%, the entire screen is 100%, and a position that is 80% of the entire screen is set as a boundary of the ZO region. In this case, an area of 80 to 100% of the entire screen is a ZO area. When a part of the mono tracking frame 300a enters the ZO area, the AZ control unit 122 performs control to start a zoom-out operation. In addition, the AZ control unit 122 stores the zoom magnification (corresponding to the zoomed-in angle of view) before the zoom movement in the memory 118. The target zoom magnification and zoom speed during the zoom-out operation are set in advance according to the size and moving speed of the subject image. Further, the target zoom magnification and the zoom speed may be appropriately calculated according to the size and the moving speed of the subject image. The zoom-out operation is executed according to the target zoom magnification and zoom speed. This makes it possible to effectively prevent the subject from going out of the frame.

図3(B)は、図3(A)の画角から、所定のズーム変化量分に相当するズームアウト動作が行われたときの画角を示している。図3(B)に示すズームイン領域ZI(以下、ZI領域という)は、被写体探索状態においてズームイン画角(ズームアウト前の画角)301に対して所定の比率よりも内側の領域を示している。例えば、画面の中心点を0%とし、ズームイン画角301を100%とし、ズームイン画角301に対して70%となる位置をZI領域の境界として設定する場合を想定する。この場合、ズームイン画角301の全体における0〜70%の領域がZI領域となる。このとき、例えばズームアウト倍率が1/2倍である場合、ズームイン画角301は画面全体に対して50%の大きさとなる。よって、ZI領域の境界は画面全体に対して70%×(1/2)=35%であり、ZI領域は、画面全体に対して0〜35%の領域であるとも言える。撮影者が、ZI領域の内部にモノ追尾枠300bが収まるようにカメラの向きを変更すると、AZ制御部122は、ズームイン動作を開始させる制御を行う。   FIG. 3B illustrates an angle of view when a zoom-out operation corresponding to a predetermined zoom change amount is performed from the angle of view in FIG. A zoom-in area ZI (hereinafter, referred to as a ZI area) illustrated in FIG. 3B indicates an area inside a predetermined ratio with respect to a zoom-in angle of view (an angle of view before zoom-out) 301 in a subject search state. . For example, assume that the center point of the screen is 0%, the zoom-in angle of view 301 is 100%, and a position that is 70% of the zoom-in angle of view 301 is set as the boundary of the ZI area. In this case, a region of 0 to 70% of the entire zoomed-in angle of view 301 is a ZI region. At this time, for example, when the zoom-out magnification is 1/2, the zoom-in angle of view 301 is 50% of the entire screen. Therefore, the boundary of the ZI area is 70% × (1 /) = 35% with respect to the entire screen, and the ZI area can be said to be an area of 0 to 35% with respect to the entire screen. When the photographer changes the direction of the camera so that the mono tracking frame 300b falls within the ZI area, the AZ control unit 122 performs control to start a zoom-in operation.

次に図4を参照して、被写体(人物)が画面外にフレームアウトすることを防止する処理について説明する。被写体が人物である場合に、顔追尾枠の一部がZO領域に進入するとズームアウト動作が開始し、また顔追尾枠がZI領域の内部に収まるとズームイン動作が行われる。被写体が人物である場合には物体の場合とは異なり、被写体の移動方向をある程度予測できるため、予測される移動方向の領域に応じてZO領域及びZI領域が設定される。また、手持ちでの撮影では、手ぶれ等の影響によって被写体がフレームアウトしてしまう場合がある。しかし、手ぶれ等によって被写体がフレームアウトした場合には、撮影者が被写体をフレームインさせようとする動作によってフレームインし直すことが可能である。ここで、画面の上部にZO領域を設定した場合、人物を中央付近に配置して撮影するときにもZO領域に顔追尾枠が進入してしまい、意図せずズームアウトする場合がある。そこで、被写体が人物であって、かつ手持ち状態(撮影者がカメラを把持した状態)である場合には、撮影者のフレーミング操作を考慮して、画面の上部にはZO領域が設定されない。   Next, a process for preventing a subject (person) from going out of the frame outside the screen will be described with reference to FIG. When the subject is a person, a zoom-out operation starts when a part of the face tracking frame enters the ZO region, and a zoom-in operation is performed when the face tracking frame is within the ZI region. When the subject is a person, unlike the case of the object, the moving direction of the subject can be predicted to some extent, so that the ZO region and the ZI region are set according to the region of the predicted moving direction. Also, in hand-held shooting, the subject may go out of frame due to the influence of camera shake or the like. However, when the subject goes out of the frame due to camera shake or the like, the photographer can re-frame in by performing an operation of putting the subject into the frame. Here, when the ZO area is set in the upper part of the screen, the face tracking frame enters the ZO area even when a person is placed near the center and shooting is performed, and there is a case where the zoom-out is performed unintentionally. Therefore, when the subject is a person and is in a hand-held state (a state in which the photographer holds the camera), a ZO area is not set at the top of the screen in consideration of the framing operation of the photographer.

このように、本実施形態では、被写体検出部123で顔が検出された場合、AZ制御部122は、カメラの姿勢や揺れ状態に応じてZO領域及びZI領域を変更する。カメラの姿勢については姿勢検出部124により検出され、また、揺れ状態については揺れ検出部125による検出結果から判定される。揺れ検出部125による検出結果とは、カメラが手持ち状態であるか否かの検出結果である。以下、図4(A)から(C)を参照して具体的に説明する。   As described above, in the present embodiment, when the face is detected by the subject detection unit 123, the AZ control unit 122 changes the ZO area and the ZI area according to the posture and the shaking state of the camera. The posture of the camera is detected by the posture detection unit 124, and the swing state is determined from the detection result by the shake detection unit 125. The detection result by the shake detection unit 125 is a detection result of whether the camera is in a hand-held state. Hereinafter, a specific description will be given with reference to FIGS.

図4(A)は、撮影者が手持ちでカメラを正位置に構えたときに設定されるZO領域及びZI領域を示している。このような撮影シーンで、被写体が水平方向に移動してフレームアウトする場合、画面内での被写体の位置は正位置の画面に対して水平方向(長手方向)に移動する。そこで、ZO領域及びZI領域はいずれも、正位置の画面に対して垂直方向(短手方向)の縦帯状に配置される。ZO領域は、横長の長方形の画面にて水平方向の両端寄りに位置する縦帯状に設定され、ZI領域は、画面の中央部に位置する縦帯状に設定される。この場合、顔追尾枠400aがZO領域内に進入すると、AZ制御部122はズームアウト開始を判定し、所定のズーム倍率分に対応するズームアウトの動作制御を行う。また、顔追尾枠400bがZI領域内に包含されると、AZ制御部122はズームイン開始を判定し、ズーム戻り位置まで所定のズーム倍率分に対応するズームインの動作制御を行う。このようにZO領域及びZI領域を設定することで、被写体(人物)のフレームアウトを効果的に防止できる。   FIG. 4A shows a ZO area and a ZI area which are set when the photographer holds the camera in a normal position by hand. In such a shooting scene, when the subject moves in the horizontal direction and goes out of the frame, the position of the subject in the screen moves in the horizontal direction (longitudinal direction) with respect to the screen at the normal position. Therefore, both the ZO area and the ZI area are arranged in a vertical band (short direction) with respect to the screen at the normal position. The ZO area is set as a vertical band located near both ends in the horizontal direction on a horizontally long rectangular screen, and the ZO area is set as a vertical band located at the center of the screen. In this case, when the face tracking frame 400a enters the ZO area, the AZ control unit 122 determines the start of zoom-out, and performs zoom-out operation control corresponding to a predetermined zoom magnification. When the face tracking frame 400b is included in the ZI area, the AZ control unit 122 determines the start of zoom-in, and performs zoom-in operation control corresponding to a predetermined zoom magnification up to the zoom return position. By setting the ZO area and the ZI area in this way, it is possible to effectively prevent the subject (person) from going out of the frame.

図4(B)は、同様の撮影シーンにてカメラ姿勢が変更され、撮影者がグリップ下もしくはグリップ上の縦位置状態にカメラを構えたときに設定されるZO領域及びZI領域を示している。この場合、縦位置の画面に対して垂直方向(長手方向)の縦帯状にZO領域及びZI領域が配置される。つまり、ZO領域は、縦長の長方形の画面にて水平方向の両端寄りに位置する縦帯状に設定され、ZI領域は、画面の中央部に位置する縦帯状に設定される。この場合、顔追尾枠400cがZO領域内に進入すると、AZ制御部122はズームアウト開始を判定し、所定のズーム倍率分に対応するズームアウトの動作制御を行う。また、顔追尾枠400dがZI領域内に包含されると、AZ制御部122はズームイン開始を判定し、ズーム戻り位置まで所定のズーム倍率分に対応するズームインの動作制御を行う。このようにZO領域及びZI領域を設定することで、水平方向への被写体の動きを検出し、フレームアウトを効果的に防止できる。   FIG. 4B shows the ZO area and the ZI area set when the camera posture is changed in the same shooting scene and the photographer holds the camera in the vertical position below or above the grip. . In this case, the ZO area and the ZI area are arranged in a vertical band shape in the vertical direction (longitudinal direction) with respect to the screen at the vertical position. That is, the ZO area is set in a vertical band shape located near both ends in the horizontal direction on a vertically long rectangular screen, and the ZI area is set in a vertical band shape positioned at the center of the screen. In this case, when the face tracking frame 400c enters the ZO area, the AZ control unit 122 determines the start of zoom-out, and performs zoom-out operation control corresponding to a predetermined zoom magnification. When the face tracking frame 400d is included in the ZI area, the AZ control unit 122 determines the start of zoom-in, and performs zoom-in operation control corresponding to a predetermined zoom magnification up to the zoom return position. By setting the ZO area and the ZI area in this manner, the movement of the subject in the horizontal direction can be detected, and frame out can be effectively prevented.

図4(C)は、揺れ検出部125での検出状態が固定状態のときに設定されるZO領域及びZI領域を示している。固定状態とは、三脚等によってカメラが固定されている状態であり、手ぶれによるフレームアウトの可能性はない。さらには、画面の中央付近に被写体がフレームインしていないときにズームインすると、その動作によってフレームアウトしてしまう可能性がある。そこで、画面の周辺部全体にZO領域が設定され、ズームイン画角よりも内側にZI領域が設定される。つまり、ZO領域は、画面の縦方向及び横方向の端寄りに位置する矩形帯状に設定され、ZI領域は、画面の中央部に位置する矩形状に設定される。この場合、顔追尾枠400eがZO領域内に進入すると、AZ制御部122は、ズームアウト開始を判定し、所定のズーム倍率分に対応するズームアウトの動作制御を行う。また、顔追尾枠400fがZI領域内に包含されると、AZ制御部122は、ズームイン開始を判定し、ズーム戻り位置まで所定のズーム倍率分に対応するズームインの動作制御を行う。   FIG. 4C shows the ZO area and the ZI area set when the detection state of the shake detection unit 125 is the fixed state. The fixed state is a state in which the camera is fixed by a tripod or the like, and there is no possibility of frame out due to camera shake. Furthermore, if the subject zooms in when the subject is not in the frame near the center of the screen, the operation may cause a frame out. Therefore, a ZO area is set on the entire peripheral portion of the screen, and a ZI area is set inside the zoomed-in angle of view. That is, the ZO area is set in a rectangular band shape located near the vertical and horizontal edges of the screen, and the ZI area is set in a rectangular shape located in the center of the screen. In this case, when the face tracking frame 400e enters the ZO area, the AZ control unit 122 determines the start of zoom-out, and performs zoom-out operation control corresponding to a predetermined zoom magnification. When the face tracking frame 400f is included in the ZI area, the AZ control unit 122 determines the start of zoom-in, and performs zoom-in operation control corresponding to a predetermined zoom magnification up to the zoom return position.

以上のように本実施形態では、カメラの姿勢や撮影状態(手持ち状態/固定状態)の変化に応じてZO領域及びZI領域の各範囲を動的に変更する。これにより、手ぶれ等による誤作動を防止しながら、被写体のフレームアウトを効果的に防止できる。なお、カメラの姿勢と撮影状態(手持ち状態/固定状態)のいずれか一方に応じてZO領域又はZI領域を変更してもよく、またZO領域とZI領域のいずれか一方のみを変更してもよい。   As described above, in the present embodiment, the respective ranges of the ZO region and the ZI region are dynamically changed according to changes in the posture of the camera and the shooting state (hand-held state / fixed state). As a result, it is possible to effectively prevent the subject from going out of the frame while preventing malfunction due to camera shake or the like. Note that the ZO area or the ZI area may be changed according to one of the posture of the camera and the shooting state (hand-held state / fixed state), or only one of the ZO area and the ZI area may be changed. Good.

次に、被写体像が画面に占める割合を所定の範囲内に保つためのズーム動作について説明する。本実施形態では、検出された被写体像のサイズが基準サイズの所定倍より大きく変化した場合に自動でズーム動作を行うことで、被写体像のサイズを基準サイズから所定の範囲内に保つように制御(サイズ保持制御)が行われる。図5は、画面内における被写体(人物)像のサイズを保つための処理を説明する図である。図6は被写体(人物)の構図設定の説明図である。   Next, a zoom operation for maintaining the ratio of the subject image to the screen within a predetermined range will be described. In the present embodiment, when the size of the detected subject image changes more than a predetermined multiple of the reference size, the zoom operation is automatically performed so that the size of the subject image is kept within a predetermined range from the reference size. (Size holding control) is performed. FIG. 5 is a diagram illustrating a process for maintaining the size of the subject (person) image in the screen. FIG. 6 is an explanatory diagram of composition setting of a subject (person).

まず、図6を参照して、追尾対象とする被写体を画面内に収める範囲(構図)の設定について説明する。図6(A)は、構図設定が「マニュアル」に設定されている場合の画面表示を例示する。「マニュアル」設定時には、撮影者が画面内の人物の像を見ながらズームレバー操作でマニュアルズーム動作を行って追尾する顔の大きさを変更する。そのときの被写体像のサイズは基準サイズとしてメモリ118に記憶される。図6(B)は構図設定が「顔」に設定されている場合の画面表示を例示する。「顔」の構図設定時には、カメラの姿勢や顔の方向によって顔が画面に収まる大きさが基準サイズとして算出され、メモリ118に記憶される。同様に、図6(C)は構図設定が「上半身」に設定されている場合の画面表示を例示し、図6(D)は構図設定が「全身」に設定されている場合の画面表示を例示する。それぞれ画面上で設定された大きさとなるように基準サイズが算出されてメモリ118に記憶される。   First, the setting of the range (composition) within which the subject to be tracked falls within the screen will be described with reference to FIG. FIG. 6A illustrates a screen display when the composition setting is set to “manual”. When "manual" is set, the photographer changes the size of the face to be tracked by performing a manual zoom operation by operating the zoom lever while viewing the image of a person on the screen. The size of the subject image at that time is stored in the memory 118 as a reference size. FIG. 6B illustrates a screen display when the composition setting is set to “face”. When the composition of the “face” is set, the size of the face that fits on the screen is calculated as the reference size according to the posture of the camera and the direction of the face, and stored in the memory 118. Similarly, FIG. 6C illustrates a screen display when the composition setting is set to “upper body”, and FIG. 6D illustrates a screen display when the composition setting is set to “whole body”. For example. A reference size is calculated so as to have a size set on the screen, and stored in the memory 118.

図6(E)は構図設定が「オート」に設定されている場合の画面表示を例示する。「オート」設定時には、AZ制御部122が、画面内での被写体位置や被写体サイズ、被写体数、カメラの姿勢等を基づき、適切な構図を判定する。さらに、判定された構図となるように基準サイズが算出されてメモリ118に記憶される。基準サイズの算出方法については図12を用いて後述する。   FIG. 6E illustrates a screen display when the composition setting is set to “auto”. When “auto” is set, the AZ control unit 122 determines an appropriate composition based on the position of the subject in the screen, the size of the subject, the number of subjects, the posture of the camera, and the like. Further, a reference size is calculated so that the determined composition is obtained and stored in the memory 118. The method of calculating the reference size will be described later with reference to FIG.

撮影者は撮影画面から操作部117の左右ボタン操作や設定メニュー上での選択によって構図設定を変更する操作を行える。構図設定の変更操作が行われると、AZ制御部122は、メモリ118に記憶されている構図設定の情報を更新する。なお、図6では被写体が人物の場合に「マニュアル」、「顔」、「上半身」、「全身」、「オート」の各構図を設定する例を示したが、構図の設定はこれに限定されるものではない。例示した5つの構図の一部のみを設定し、または他の構図を含んでもよい。また、被写体が物体の場合には、例えば「マニュアル」、「大」、「中」、「小」、「オート」の各構図を設定してもよい。   The photographer can perform an operation of changing the composition setting by operating the left and right buttons of the operation unit 117 or making a selection on the setting menu from the shooting screen. When a composition setting change operation is performed, the AZ control unit 122 updates the composition setting information stored in the memory 118. Although FIG. 6 shows an example in which the composition of “manual”, “face”, “upper body”, “whole body”, and “auto” is set when the subject is a person, the composition setting is not limited to this. Not something. Only a part of the five exemplified compositions may be set, or another composition may be included. When the subject is an object, for example, each composition of “manual”, “large”, “medium”, “small”, and “auto” may be set.

図5を参照して、被写体像が画面に占める割合を所定の範囲内に保つためのズーム動作について、構図設定が「マニュアル」の場合を例に説明する。図5(A)〜(C)は、被写体(人物)がカメラに近づいてきた場合に、カメラが自動的に行うズーム動作を例示する。これは、被写体像が画面に占める割合を所定の比率内に収めるためのズームアウト動作である。なお、図5では、顔追尾枠500a〜fを、被写体である人物の特徴領域として顔領域を囲むように表示している。したがって、ここでは顔追尾枠の大きさを、被写体サイズとして説明する。   With reference to FIG. 5, a description will be given of a zoom operation for keeping the ratio of the subject image occupying the screen within a predetermined range, taking a case where the composition setting is “manual” as an example. FIGS. 5A to 5C illustrate a zoom operation automatically performed by a camera when a subject (person) approaches the camera. This is a zoom-out operation for keeping the ratio of the subject image to the screen within a predetermined ratio. In FIG. 5, the face tracking frames 500a to 500f are displayed so as to surround the face area as the characteristic area of the person who is the subject. Therefore, the size of the face tracking frame will be described here as the subject size.

図5(A)は、後述する被写体指定方法に従って被写体が指定されたときの画角を示している。被写体指定時の顔追尾枠500aの大きさは、基準の被写体サイズ(基準サイズ)としてメモリ118に記憶される。図5(B)は、図5(A)の状態からズーム倍率を変更しない状態で、被写体がカメラに向かって近づいてきたときの画角を示している。例えば、基準の被写体サイズである顔追尾枠500aの大きさに対して150%となる大きさをズームアウト動作の開始サイズとする。被写体追尾枠(顔追尾枠)の関係が、「顔追尾枠500b>顔追尾枠500a×150%」となったとき、つまり、基準サイズに対して所定の変化量を超えて追尾枠が変化したときに、AZ制御部122はズームアウト動作の開始を判定する。   FIG. 5A shows an angle of view when a subject is designated according to a subject designation method described later. The size of the face tracking frame 500a when the subject is specified is stored in the memory 118 as a reference subject size (reference size). FIG. 5B shows the angle of view when the subject approaches the camera without changing the zoom magnification from the state of FIG. 5A. For example, a size that is 150% of the size of the face tracking frame 500a that is the reference subject size is set as the start size of the zoom-out operation. When the relationship between the subject tracking frame (face tracking frame) is “face tracking frame 500b> face tracking frame 500a × 150%”, that is, the tracking frame has changed beyond a predetermined change amount with respect to the reference size. At this time, the AZ control unit 122 determines the start of the zoom-out operation.

図5(C)は、図5(B)の画角501から所定のズーム倍率分だけズームアウトした画角と、顔追尾枠500cを示している。ここでは、ズームアウト動作を開始するときの顔追尾枠サイズの基準被写体サイズに対する変化率(150%)を考慮して、所定のズーム倍率を1/1.5倍としている。この後、さらに被写体がカメラに近づいてくる場合、さらに広角側へズームアウトを行うことにより、被写体像を所定の比率内に収め続けることができる。したがって、撮影者はレリーズスイッチの操作だけに集中することが可能である。   FIG. 5C shows an angle of view obtained by zooming out from the angle of view 501 of FIG. 5B by a predetermined zoom magnification, and a face tracking frame 500c. Here, the predetermined zoom magnification is set to 1 / 1.5 in consideration of the change rate (150%) of the face tracking frame size to the reference subject size when starting the zoom-out operation. Thereafter, when the subject further approaches the camera, the subject image can be kept within a predetermined ratio by zooming out further to the wide angle side. Therefore, the photographer can concentrate on only the operation of the release switch.

一方、図5(D)〜(F)は、被写体である人物がカメラから遠ざかる場合に、カメラが自動的に行うズーム動作を例示する。これは、被写体像が画面に占める割合を所定の範囲内に収めるためのズームイン動作である。図5(D)は、後述する被写体指定方法に従って被写体が指定されたときの画角を示している。被写体指定時の顔追尾枠500dの大きさは、基準の被写体サイズとしてメモリ118に記憶される(構図設定が「マニュアル」の場合)。   On the other hand, FIGS. 5D to 5F illustrate a zoom operation performed automatically by the camera when a person who is the subject moves away from the camera. This is a zoom-in operation for keeping the ratio of the subject image on the screen within a predetermined range. FIG. 5D shows the angle of view when a subject is designated according to a subject designation method described later. The size of the face tracking frame 500d when the subject is designated is stored in the memory 118 as the reference subject size (when the composition setting is "manual").

図5(E)は、図5(D)の状態からズーム倍率を変更しない状態で、被写体がカメラから遠ざかったときの画角を示している。例えば、基準の被写体サイズである顔追尾枠500dの大きさに対して50%となる大きさをズームイン動作の開始サイズとする。顔追尾枠の関係が、「顔追尾枠500e<顔追尾枠500d×50%」となったときに、基準サイズに対して所定の変化量を超えて追尾枠が変化したと判定される。この判定条件を満たし、かつ、顔追尾枠500eがZI領域内に包含されると、AZ制御部122はズームイン動作の開始を判定する。ここで、図5(E)の画角に対して所定のズーム倍率分だけズームインした画角502よりも内側にZI領域が設定される。   FIG. 5E shows the angle of view when the subject moves away from the camera without changing the zoom magnification from the state of FIG. 5D. For example, a size that is 50% of the size of the face tracking frame 500d, which is the reference subject size, is set as the start size of the zoom-in operation. When the relationship between the face tracking frames becomes “face tracking frame 500e <face tracking frame 500d × 50%”, it is determined that the tracking frame has changed by more than a predetermined change amount with respect to the reference size. When this determination condition is satisfied and the face tracking frame 500e is included in the ZI region, the AZ control unit 122 determines the start of the zoom-in operation. Here, the ZI area is set inside the angle of view 502 obtained by zooming in by a predetermined zoom magnification with respect to the angle of view in FIG.

図5(F)は、図5(E)の画角から所定のズーム倍率分だけズームインした画角(画角502に対応)と、顔追尾枠500fを示している。ここでは、ズームイン動作を開始するときの顔追尾枠サイズの基準被写体サイズに対する変化率(50%)を考慮して、所定のズーム倍率を1/0.5倍としている。   FIG. 5F shows an angle of view (corresponding to the angle of view 502) obtained by zooming in from the angle of view of FIG. 5E by a predetermined zoom magnification, and a face tracking frame 500f. Here, the predetermined zoom magnification is set to 1 / 0.5 times in consideration of the rate of change (50%) of the face tracking frame size to the reference subject size when starting the zoom-in operation.

図3では被写体が物体である場合、また図4では被写体が人物である場合にフレームアウトを防止する処理について説明した。また、図5では被写体が人物である場合に、画面に占める被写体像の大きさの比率を、所定の範囲内に収める処理について説明した。なお、追尾対象とする被写体が物体である場合にも、被写体が人物である場合と同様に、図5で示した被写体像のサイズ保持の制御のためのズーム動作開始判定を行ってもよい。また、構図設定が「マニュアル」以外の場合においても、それぞれの基準サイズに応じて、図5と同様に自動的にズーム動作が行われる。   FIG. 3 illustrates the process of preventing frame-out when the subject is an object, and FIG. 4 illustrates the case where the subject is a person. Further, FIG. 5 has described the process of setting the ratio of the size of the subject image on the screen to a predetermined range when the subject is a person. Note that, even when the subject to be tracked is an object, the zoom operation start determination for controlling the holding of the size of the subject image shown in FIG. 5 may be performed as in the case where the subject is a person. Further, even when the composition setting is other than "manual", the zoom operation is automatically performed according to the respective reference sizes, similarly to FIG.

次に、図7から図21を参照して、オートズーム機能の処理について説明する。図7は、オートズーム機能の全体の処理例を示すフローチャートである。以下のオートズーム機能は、特に明示的な記載がない限り、システム制御部114(AZ制御部122)の指令に基づいて行われるものとする。
まずS700でAZ制御部122は、操作部117のオートズーム操作スイッチの操作状態を判定する。オートズーム操作スイッチが押下された場合、S701に進み、当該スイッチが押下されない場合にはS700の判定処理が繰り返される。S701で被写体探索処理が実行され、さらに、S702の被写体指定処理、S703の基本サイズ設定処理、S704のオートズーム制御が順次に実行される。
Next, the processing of the auto zoom function will be described with reference to FIGS. FIG. 7 is a flowchart illustrating an example of the entire processing of the auto zoom function. The following auto zoom function is performed based on a command from the system control unit 114 (AZ control unit 122) unless otherwise specified.
First, in S700, the AZ control unit 122 determines the operation state of the auto zoom operation switch of the operation unit 117. When the auto zoom operation switch is pressed, the process proceeds to S701, and when the switch is not pressed, the determination process of S700 is repeated. A subject search process is executed in S701, and a subject designation process in S702, a basic size setting process in S703, and an auto zoom control in S704 are sequentially executed.

オートズーム機能の処理が開始された直後、または、操作部117の被写体探索ボタンが押下された場合(S705でyes)に、S701の被写体探索処理が実行される。図8を参照して、S701のステップで実行する被写体探索処理を説明する。撮影対象の被写体がカメラから遠く離れている場合、画面内に被写体像が存在しても被写体の特徴領域が小さすぎると、被写体検出部123で検出できない可能性がある。このようなシーンでは、被写体情報に基づくオートズーム機能を実行することができない。そこで、所定の焦点距離まで被写体を検出しながらズームイン動作を行う被写体探索処理が実行される。   Immediately after the processing of the auto zoom function is started, or when the subject search button of the operation unit 117 is pressed (Yes in S705), the subject search processing of S701 is executed. With reference to FIG. 8, the subject search processing executed in step S701 will be described. When the subject to be photographed is far away from the camera, the subject detection unit 123 may not be able to detect the subject if the feature area of the subject is too small even if the subject image exists in the screen. In such a scene, the automatic zoom function based on the subject information cannot be executed. Therefore, a subject search process of performing a zoom-in operation while detecting a subject up to a predetermined focal length is executed.

S800では、オートズーム開始の直後であるか、または、オートズーム開始の直後でなく、オートズーム中に被写体探索ボタンが押下されたかの判定処理が行われる。S800で前者の肯定的判定結果(yes)の場合にはS801に進み、否定的判定結果(no)の場合にはS803に移行する。S801では、被写体探索終了焦点距離(以下、探索終了焦点距離という)を取得する処理が実行される。本実施形態ではオートズーム開始直後に、探索終了焦点距離は35mm判換算で85mmの焦点距離としている。この焦点距離は一般的に人物を撮影する場合に適しているとされる標準レンズの焦点距離であり、被写体(人物)がいない場合や(後ろ向き状態等で)顔が検出できない場合でも探索終了後に適切な画角で被写体検出の待ち状態とすることができる。ただし、焦点距離は85mmに限らず、他の焦点距離(例えば50mmや100mm等)であってもよい。また、メニュー設定から撮影者が探索終了焦点距離を変更可能な構成や、撮影モードまたは撮影する被写体等に応じて探索終了焦点距離を変更可能な構成としてもよい。S801からS802に進むと、モード開始時の焦点距離が探索終了焦点距離と比較され、当該焦点距離が探索終了焦点距離よりも広角側か望遠側かについて判定される。オートズーム開始時の焦点距離が探索終了焦点距離よりも望遠側である場合(S802でno)には、被写体探索の処理を終了する。また、オートズーム開始時の焦点距離が探索終了焦点距離よりも広角側である場合(S802でyes)には、S805に進む。   In S800, a process is performed to determine whether the subject search button has been pressed immediately after the start of the auto zoom, or not immediately after the start of the auto zoom, but during the auto zoom. In the case of the former positive determination result (yes) in S800, the process proceeds to S801, and in the case of a negative determination result (no), the process proceeds to S803. In S801, a process of acquiring a subject search end focal length (hereinafter, referred to as a search end focal length) is performed. In this embodiment, immediately after the start of the auto zoom, the search end focal length is set to a focal length of 85 mm in 35 mm format conversion. This focal length is a focal length of a standard lens which is generally considered to be suitable for photographing a person. Even when there is no subject (person) or a face cannot be detected (in a backward state, etc.), the search is performed after the search is completed. A waiting state for subject detection can be set at an appropriate angle of view. However, the focal length is not limited to 85 mm, and may be another focal length (for example, 50 mm or 100 mm). Further, a configuration in which the photographer can change the search end focal length from the menu setting, or a configuration in which the search end focal length can be changed according to the shooting mode or the subject to be shot may be adopted. When the process proceeds from step S801 to step S802, the focal length at the start of the mode is compared with the search end focal length, and it is determined whether the focal length is wider than the search end focal length or on the telephoto side. If the focal length at the start of the auto-zoom is on the telephoto side of the search end focal length (no in S802), the processing of the subject search ends. If the focal length at the start of the auto zoom is wider than the search end focal length (Yes in S802), the process proceeds to S805.

一方、S800で被写体探索ボタンの操作による被写体探索であると判定された場合にS803では、探索終了焦点距離を取得する処理が実行される。本実施形態では、被写体探索ボタンの操作での探索終了焦点距離を、当該操作が実行されたときの焦点距離に対して2.5倍だけ望遠側の焦点距離としている。ただし、この倍率は例示であって、他の倍率でもよい。また、メニュー設定から撮影者が探索終了焦点距離を変更可能な構成や、撮影モードまたは撮影する被写体等に応じて探索終了焦点距離を変更可能な構成としてもよい。S803からS804に進み、S803で取得した探索終了焦点距離がテレ端(望遠端)の焦点距離と比較され、探索終了焦点距離がテレ端の焦点距離よりも広角側か望遠側かについて判定される。探索終了焦点距離がテレ端の焦点距離よりも望遠側である場合には、被写体探索の処理を終了する。探索終了焦点距離がテレ端の焦点距離よりも広角側である場合には、S805に進む。S805でAZ制御部122は、S801またはS803にて取得した探索終了焦点距離に対応するズーム変化量を、CZ制御部119または電子ズーム制御部120に設定し、ズームイン動作を行うように指示する。   On the other hand, if it is determined in S800 that the object search is performed by operating the object search button, a process of acquiring the search end focal length is executed in S803. In the present embodiment, the search end focal length in the operation of the subject search button is set to a focal length on the telephoto side by 2.5 times the focal length when the operation is performed. However, this magnification is an example, and another magnification may be used. Further, a configuration in which the photographer can change the search end focal length from the menu setting, or a configuration in which the search end focal length can be changed according to the shooting mode or the subject to be shot may be adopted. Proceeding from S803 to S804, the search end focal length obtained in S803 is compared with the focal length at the tele end (telephoto end), and it is determined whether the search end focal length is wider or telephoto than the focal length at the tele end. . If the search end focal length is on the telephoto side of the focal length at the telephoto end, the subject search process ends. If the search end focal length is on the wider angle side than the focal length at the tele end, the process proceeds to S805. In step S805, the AZ control unit 122 sets the zoom change amount corresponding to the search end focal length acquired in step S801 or S803 in the CZ control unit 119 or the electronic zoom control unit 120, and instructs the zoom in operation.

次にS806では、現在の焦点距離が探索終了焦点距離に到達したか否かについて判定が行われる。現在の焦点距離が探索終了焦点距離に到達した場合、S809に進み、ズームイン動作を停止した後、被写体探索処理が終了する。また、S806で現在の焦点距離が探索終了焦点距離に到達していないと判定された場合には、S807に処理を進める。S807は、被写体検出部123によって被写体が検出されているか否かの判定処理である。S807で被写体が検出されたと判定された場合にはS808に進み、被写体が検出されたと判定されない場合にはS806に戻る。S808では、被写体を検出した位置が画面の所定の探索終了領域内であるか否かの判定が行われる。所定の探索終了領域については被写体に応じて予め設定された閾値(位置の判定基準値)により決定されるものとする。判定の結果、S807にて検出された被写体の検出位置が画面上の所定の探索終了領域内である場合にはS809に進み、ズームイン動作を停止して被写体探索処理を終了する。また、S808にて被写体の検出位置が画面上の所定の探索終了領域内でないと判定された場合には、S806に戻り、S806からS808の判定処理を継続する。   Next, in S806, it is determined whether or not the current focal length has reached the search end focal length. If the current focal length has reached the search end focal length, the process advances to step S809 to stop the zoom-in operation and then end the subject search process. If it is determined in step S806 that the current focal length has not reached the search end focal length, the process proceeds to step S807. Step S807 is processing for determining whether or not a subject has been detected by the subject detection unit 123. If it is determined in S807 that the subject has been detected, the process proceeds to S808, and if it is not determined that the subject has been detected, the process returns to S806. In S808, it is determined whether or not the position where the subject is detected is within a predetermined search end area on the screen. It is assumed that the predetermined search end area is determined by a threshold value (position determination reference value) set in advance according to the subject. If the result of determination is that the detection position of the subject detected in S807 is within the predetermined search end area on the screen, the flow advances to S809 to stop the zoom-in operation and end the subject search processing. If it is determined in step S808 that the detected position of the subject is not within the predetermined search end area on the screen, the process returns to step S806, and the determination processing of steps S806 to S808 is continued.

ここで、図9を参照して、S808で説明した所定の探索終了領域について説明する。特定の被写体(人物や物体)の撮影にて、撮影対象とする被写体は画面の中央付近に配置される場合が多い。また、画面周辺で撮影対象としない被写体を検出して被写体探索処理を終了した場合、撮影対象とする被写体を検出する前に被写体探索処理が終了する可能性がある。この場合、撮影者の意図通りのオートズーム機能を実行できない。そこで、本実施形態では、画面中央付近の領域内で被写体が検出された場合にのみ、被写体探索処理を終了するように、判定用領域としての探索終了領域が設定される。図9(A)は、被写体が物体(飛行機)である場合に設定される探索終了領域900aを例示する。物体の場合、画面の上下左右のいずれの方向に対しても、画面中央から所定の割合、例えば70%の範囲が被写体の探索終了領域として設定される。一方、図9(B)は、被写体が人物である場合に設定される探索終了領域900bを例示する。人物の場合、画面上部の領域については画面中央から100%の範囲を含み、それ以外の方向(左右方向、下方)では画面中央から所定の割合、例えば70%の範囲を含むように、探索終了領域が設定される。被写体が人物である場合、画面上部にも撮影対象である被写体の顔追尾枠902が配置される可能性がある。そのため、画面上部で被写体を検出した場合でも、被写体探索処理が終了するように探索終了領域の設定が行われる。   Here, the predetermined search end area described in S808 will be described with reference to FIG. In photographing a specific subject (person or object), the subject to be photographed is often arranged near the center of the screen. Further, when a subject not to be photographed is detected around the screen and the subject search processing is terminated, the subject search processing may be completed before the subject to be photographed is detected. In this case, the auto zoom function as intended by the photographer cannot be executed. Therefore, in the present embodiment, a search end area as a determination area is set so that the object search processing is ended only when an object is detected in an area near the center of the screen. FIG. 9A illustrates a search end area 900a set when the subject is an object (airplane). In the case of an object, a predetermined ratio, for example, a range of 70% from the center of the screen is set as the subject search end area in any of the vertical and horizontal directions of the screen. On the other hand, FIG. 9B illustrates a search end area 900b set when the subject is a person. In the case of a person, the search is terminated so that the upper region of the screen includes a range of 100% from the center of the screen, and the other directions (left and right directions, downwards) include a predetermined ratio from the center of the screen, for example, a range of 70%. The area is set. When the subject is a person, there is a possibility that the face tracking frame 902 of the subject to be photographed is also arranged at the top of the screen. Therefore, even when a subject is detected in the upper part of the screen, the search end area is set so that the subject search processing ends.

次に図10を参照して、図7にS702のステップで示す被写体指定処理について説明する。図10(A)は、操作部117を構成するタッチパネルを用いてユーザが所望の被写体を指定する処理例を示すフローチャートである。この例では、ユーザが表示部109に表示された被写体像をタッチして指定する操作を行うものとする。S1000でAZ制御部122は、タッチパネルが押下されたか否かを判定する。タッチパネルが押下された場合、S1001に進み、タッチパネルが押下されない場合にはS1000の判定処理が繰り返される。   Next, with reference to FIG. 10, the subject designation processing shown in step S702 in FIG. 7 will be described. FIG. 10A is a flowchart illustrating an example of processing in which a user specifies a desired subject using a touch panel included in the operation unit 117. In this example, it is assumed that the user performs an operation of touching and specifying a subject image displayed on the display unit 109. In S1000, AZ control unit 122 determines whether or not the touch panel has been pressed. When the touch panel is pressed, the process proceeds to S1001, and when the touch panel is not pressed, the determination process of S1000 is repeated.

S1001でAZ制御部122は、ユーザがタッチした位置(タッチ位置)の情報を取得する。次のS1002でAZ制御部122は、タッチ位置を被写体検出部123に通知し、被写体検出部123はタッチ位置付近で顔検出を行う。S1002でタッチ位置付近に顔が検出された場合、主被写体は人物であると判定されて、S1003に進む。また、S1002にてタッチ位置付近に顔が検出されなかった場合、主被写体は人物以外の物体であると判定されてS1004に進む。   In S1001, the AZ control unit 122 acquires information on the position touched by the user (touch position). In the next step S1002, the AZ control unit 122 notifies the subject detection unit 123 of the touch position, and the subject detection unit 123 performs face detection near the touch position. If a face is detected near the touch position in S1002, it is determined that the main subject is a person, and the process proceeds to S1003. If no face is detected near the touch position in S1002, the main subject is determined to be an object other than a person, and the process proceeds to S1004.

S1003にてAZ制御部122は、自動追尾の対象である人物の顔情報をメモリ118に記憶させる制御を行う。具体的な顔情報としては、被写体指定時の顔のサイズと顔の検出位置、顔の向き等の情報がある。また、顔認証機能を有するカメラにおいては、認証ID等の識別情報もメモリ118に記憶される。S1004でAZ制御部122は、タッチ位置付近の特徴色を自動追尾対象の色情報としてメモリ118に記憶させる制御を行う。具体的な色情報としては、被写体指定時の特徴色とその輝度、色差の値や同一色領域のサイズ、同一色領域の重心位置等の情報がある。以下の説明では顔情報及び色情報を総称して、被写体情報(被写体サイズ、被写体検出位置等を含む)という。   In S1003, the AZ control unit 122 performs control to store the face information of the person to be automatically tracked in the memory 118. Specific face information includes information such as a face size when a subject is specified, a face detection position, and a face direction. In a camera having a face authentication function, identification information such as an authentication ID is also stored in the memory 118. In step S <b> 1004, the AZ control unit 122 performs control to store the characteristic color near the touch position in the memory 118 as color information of an automatic tracking target. As specific color information, there are information such as a characteristic color at the time of subject designation, its luminance, a color difference value, the size of the same color area, the position of the center of gravity of the same color area, and the like. In the following description, face information and color information are collectively referred to as subject information (including subject size, subject detection position, and the like).

S1003またはS1004にて被写体情報がメモリ118に記憶された後、S1005に進み、被写体追尾枠が表示される。S1005でAZ制御部122は、被写体検出位置を中心にて、被写体サイズに対応した大きさの被写体追尾枠(モノ追尾枠または顔追尾枠)を表示部109に表示させる制御を行う。その後、被写体指定処理が終了する。
このようにシステム制御部114にて、被写体検出部123は、表示部109において撮影者により指定された位置、または指定された位置の近傍で被写体を検出する。そしてAZ制御部122は、被写体追尾枠を表示部109に表示させる。図10(A)の処理例によれば、撮影者が追尾したい被写体を、直感的な方法で簡単に指定可能となる。ただし、被写体の指定方法はこの方法に限定されない。図10(B)を参照して別の方法を説明する。
After the subject information is stored in the memory 118 in S1003 or S1004, the process proceeds to S1005, and the subject tracking frame is displayed. In step S <b> 1005, the AZ control unit 122 controls the display unit 109 to display a subject tracking frame (mono tracking frame or face tracking frame) having a size corresponding to the subject size around the subject detection position. Thereafter, the subject designation processing ends.
As described above, in the system control unit 114, the subject detection unit 123 detects the subject at the position specified by the photographer on the display unit 109 or in the vicinity of the specified position. Then, the AZ control unit 122 causes the display unit 109 to display the subject tracking frame. According to the processing example of FIG. 10A, the subject that the photographer wants to track can be easily specified in an intuitive manner. However, the method of designating the subject is not limited to this method. Another method will be described with reference to FIG.

図10(B)は、操作部117を構成する操作部材として、オートズーム操作スイッチとは別のスイッチ(被写体指定用スイッチ)を用いて、ユーザが被写体を指定する場合の処理例を示すフローチャートである。まずS1006にてAZ制御部122は、表示部109の画面中央付近に被写体指定の目安となる枠を表示する。撮影者は、この枠を目安として追尾したい被写体の画像を画面中央付近に収めるようにカメラの向きを調整する。次のS1007でAZ制御部122は、被写体指定用スイッチが押下されたか否かを判定する。被写体指定用スイッチが押下された場合、S1008に進み、当該スイッチが押下されない場合には待ち状態でS1007の判定処理が繰り返される。   FIG. 10B is a flowchart illustrating a processing example in which the user designates a subject by using a switch (subject designation switch) different from the auto-zoom operation switch as an operation member configuring the operation unit 117. is there. First, in step S <b> 1006, the AZ control unit 122 displays a frame serving as an indication of subject specification near the center of the screen of the display unit 109. The photographer adjusts the direction of the camera such that the image of the subject to be tracked is positioned near the center of the screen using the frame as a guide. In the next step S1007, the AZ control unit 122 determines whether the subject designation switch has been pressed. If the subject specifying switch is pressed, the process proceeds to S1008. If the switch is not pressed, the determination process of S1007 is repeated in a waiting state.

S1008で被写体検出部123は、画面中央付近で顔検出を行う。画面中央付近に顔が検出した場合、主被写体は人物であると判定され、S1009に進む。一方、画面中央付近に顔が検出されなかった場合、主被写体は人物以外の物体であると判定され、S1010に進む。S1009では図10(A)のS1003と同様の処理が行われ、またS1010では図10(A)のS1004と同様の処理が行われるので、それらの説明を省略する。S1009またはS1010にて被写体情報がメモリ118に記憶された後、S1011に進み、被写体追尾枠(モノ追尾枠または顔追尾枠)が表示され、被写体指定処理は終了となる。   In step S1008, the subject detection unit 123 performs face detection near the center of the screen. If a face is detected near the center of the screen, it is determined that the main subject is a person, and the process proceeds to S1009. On the other hand, if no face is detected near the center of the screen, the main subject is determined to be an object other than a person, and the process proceeds to S1010. In S1009, the same processing as in S1003 in FIG. 10A is performed, and in S1010, the same processing as in S1004 in FIG. 10A is performed, and thus description thereof will be omitted. After the subject information is stored in the memory 118 in S1009 or S1010, the process advances to S1011 to display a subject tracking frame (mono tracking frame or face tracking frame), and the subject specification processing ends.

このように図10(B)の処理例では、被写体検出部123が表示部109の画面中央位置または画面中央位置の近傍で被写体を検出する。そしてAZ制御部122は、被写体の位置を示す被写体追尾枠を表示部109に表示させる。タッチパネル等の操作部材を搭載しないカメラにおいても、ユーザは被写体を簡単に指定可能となる。   As described above, in the processing example of FIG. 10B, the subject detection unit 123 detects the subject at or near the center position of the screen of the display unit 109. Then, the AZ control unit 122 causes the display unit 109 to display a subject tracking frame indicating the position of the subject. The user can easily specify a subject even in a camera without an operation member such as a touch panel.

図11は、操作部117を構成するオートズーム操作スイッチが押下された時点で検出された顔の中から、追尾する被写体を自動的に選択する処理例を示すフローチャートである。まずS1100で被写体検出部123は、画面全体で顔検出を行い、人物の顔が検出されたか否かを判定する。画面全体で一人でも顔が検出された場合、主被写体は人物であると判定され、S1101に進む。また、画面内にひとつも顔が検出されない場合にはS1105に移行する。   FIG. 11 is a flowchart illustrating an example of processing for automatically selecting a subject to be tracked from faces detected at the time when an auto zoom operation switch constituting the operation unit 117 is pressed. First, in step S1100, the subject detection unit 123 performs face detection on the entire screen and determines whether a human face has been detected. If at least one face is detected on the entire screen, it is determined that the main subject is a person, and the process proceeds to S1101. If no face is detected in the screen, the flow shifts to S1105.

S1101で被写体検出部123は、検出した顔の人物が一人の場合、その顔を主顔として選択する。被写体検出部123は、検出した顔が複数の場合、その顔の中から追尾する被写体とする主顔を選択する。主顔選択の判定基準として、例えば、顔検出位置がより画面中央付近に位置する顔を優先して選択する方法がある。また、同程度の位置に複数の顔がある場合、サイズのより大きい顔を主顔として選択する方法がある。また、顔認証機能を有するカメラの場合には、認証登録されている顔がある場合、その顔を優先して主顔とする方法がある。   In step S1101, the subject detection unit 123 selects the face as the main face when the detected face is a single person. When there are a plurality of detected faces, the subject detection unit 123 selects a main face as a subject to be tracked from the faces. As a criterion for selecting the main face, for example, there is a method of preferentially selecting a face whose face detection position is located closer to the center of the screen. In addition, when there are a plurality of faces at substantially the same position, there is a method of selecting a face having a larger size as a main face. Further, in the case of a camera having a face authentication function, there is a method in which, when there is a face registered for authentication, that face is preferentially set as the main face.

S1101からS1102に進み、AZ制御部122は、選択された主顔の顔情報をメモリ118に記憶した後、S1103に進んで顔追尾枠を画面上に表示させる。次のS1104において、顔の変更判定が行われる。つまり、複数の顔が検出された場合に自動で選択された主顔が撮影者の意図する顔であるとは限らない。そのために、撮影者が主顔を変更することが可能である。このとき、撮影者が操作部117のスイッチ(オートズーム操作スイッチ等)を押下して所望の顔を指定すると、顔追尾枠が検出された顔の中から主顔として選択されなかった別の顔に主顔を変更する処理が行われる。S1104にて主顔が変更された場合、再度、S1102に戻って、メモリ118に記憶すべき顔情報が更新される。また、S1103にて顔追尾枠が、新たに選択された主顔のサイズ及び検出位置に変更される。   Proceeding from S1101 to S1102, the AZ control unit 122 stores the face information of the selected main face in the memory 118, and then proceeds to S1103 to display a face tracking frame on the screen. In the next step S1104, a face change determination is made. That is, when a plurality of faces are detected, the main face automatically selected is not necessarily the face intended by the photographer. Therefore, the photographer can change the main face. At this time, if the photographer presses a switch (auto-zoom operation switch or the like) of the operation unit 117 to specify a desired face, another face which is not selected as the main face from the faces whose face tracking frames have been detected is selected. Is performed to change the main face. When the main face is changed in S1104, the process returns to S1102 again, and the face information to be stored in the memory 118 is updated. In step S1103, the face tracking frame is changed to the size and detection position of the newly selected main face.

一方、S1100からS1105に移行した場合、主被写体は人物以外の物体であると判定され、AZ制御部122は、画面中央付近の特徴色を自動追尾対象の色情報として、メモリ118に記憶する制御を行う。次のS1106ではモノ追尾枠が画面上に表示された後、被写体指定処理が終了する。図11のS1102、S1105、S1103(S1106)における基本的な処理は、図10(A)のS1003、S1004、S1005の場合とそれぞれ同様である。   On the other hand, when the process proceeds from S1100 to S1105, it is determined that the main subject is an object other than a person, and the AZ control unit 122 stores the characteristic color near the center of the screen in the memory 118 as color information for automatic tracking. I do. In the next step S1106, after the mono tracking frame is displayed on the screen, the subject specifying process ends. The basic processes in S1102, S1105, and S1103 (S1106) in FIG. 11 are the same as those in S1003, S1004, and S1005 in FIG.

このように図11の処理例では、システム制御部114にて被写体検出部123が表示部109の画面全体において顔検出を行う。AZ制御部122は、複数の顔が検出された場合、複数の顔の中から被写体として第1の顔の位置を示す被写体追尾枠を表示部109に表示させる制御を行う。またAZ制御部122は、被写体として第1の顔が第2の顔に変更された場合、第2の顔の位置を示す被写体追尾枠を表示部109に表示させる制御を行う。撮影者は、より少ない操作回数で所望の被写体を簡単に指定できる。   As described above, in the processing example of FIG. 11, the subject detection unit 123 in the system control unit 114 performs face detection on the entire screen of the display unit 109. When a plurality of faces are detected, the AZ control unit 122 controls the display unit 109 to display a subject tracking frame indicating the position of the first face as a subject from the plurality of faces. In addition, when the first face is changed to the second face as the subject, the AZ control unit 122 performs control to cause the display unit 109 to display a subject tracking frame indicating the position of the second face. The photographer can easily specify a desired subject with a smaller number of operations.

被写体指定処理については、操作部117を構成するタッチパネルと被写体指定用スイッチの両方があるカメラの場合には、図10(A)の方法と図10(B)の方法との両方を同時に適用してもよい。また、図7に示すS706での被写体変更の判定がなされた後では、図10(A)または図10(B)の方法で被写体を指定し、S701の被写体探索処理の後では、図11の方法で被写体を指定することもできる。処理の流れに応じて適用する被写体指定処理を変更してもよい。被写体指定処理(図7のS702)が終了すると、図7のS703に進み、追尾する被写体の大きさを基準サイズとして設定する処理が実行される。   Regarding the subject designating process, in the case of a camera having both a touch panel and a subject designating switch constituting the operation unit 117, both the method of FIG. 10A and the method of FIG. You may. After the subject change is determined in S706 shown in FIG. 7, the subject is designated by the method shown in FIG. 10A or FIG. The subject can also be specified by a method. The subject specifying process to be applied may be changed according to the flow of the process. When the subject specifying process (S702 in FIG. 7) is completed, the process proceeds to S703 in FIG. 7, and a process of setting the size of the tracked subject as a reference size is executed.

図12から図19を参照して、図7に示すS703の基準サイズ設定処理について説明する。図12は被写体が人物である場合の基準サイズの設定処理例を示すフローチャートである。まずS1200でAZ制御部122は、メモリ118に記憶されている構図設定が上述した「マニュアル」であるか否かを判定する。構図設定が「マニュアル」である場合にはS1201に進み、「マニュアル」以外である場合にはS1203に進む。   The reference size setting process in S703 shown in FIG. 7 will be described with reference to FIGS. FIG. 12 is a flowchart illustrating an example of a reference size setting process when a subject is a person. First, in S1200, the AZ control unit 122 determines whether or not the composition setting stored in the memory 118 is the “manual” described above. If the composition setting is “manual”, the flow proceeds to S1201; otherwise, the flow proceeds to S1203.

S1201にてAZ制御部122は、被写体検出の判定を行う。AZ制御部122は、被写体検出部123にて、被写体が人物であるときには顔が検出されるか否か、また被写体が物体であるときには同一の特徴色が検出されるか否かを判定する。被写体が検出されるまでS1201の判定処理が繰り返され、被写体が検出された場合にS1202に進む。S1202でAZ制御部122は、検出された被写体像の大きさを基準サイズとして設定し、メモリ118に記憶して処理を終了する。これによって、構図設定が「マニュアル」である場合には、基準サイズ設定処理を開始したときに最初に検出した被写体像の大きさ(検出サイズ)が、基準サイズとしてメモリ118に記憶される。   In S1201, the AZ control unit 122 makes a determination of subject detection. The AZ control unit 122 determines whether or not a face is detected when the subject is a person, and whether or not the same characteristic color is detected when the subject is an object. The determination process of S1201 is repeated until a subject is detected, and the process proceeds to S1202 when a subject is detected. In step S1202, the AZ control unit 122 sets the size of the detected subject image as a reference size, stores the reference size in the memory 118, and ends the process. Thus, when the composition setting is “manual”, the size (detection size) of the subject image first detected when the reference size setting process is started is stored in the memory 118 as the reference size.

一方、S1203でAZ制御部122は、姿勢検出部124によって判定したカメラの姿勢情報に基づいて画面サイズを算出する。この画面サイズは、後述のS1211、S1704、S1705、S1806、S1807にて基準サイズの算出に用いる。図13を参照して、画面サイズの算出処理について説明する。本実施形態では、静止画の画面サイズを長辺×短辺=640×480とし、動画の画面サイズを長辺×短辺=640×360とした場合を例示するが、画面サイズはこれに限定されるものではない。   On the other hand, in step S1203, the AZ control unit 122 calculates the screen size based on the posture information of the camera determined by the posture detection unit 124. This screen size is used for calculating a reference size in S1211, S1704, S1705, S1806, and S1807, which will be described later. With reference to FIG. 13, the process of calculating the screen size will be described. In the present embodiment, a case where the screen size of a still image is long side × short side = 640 × 480 and the screen size of a moving image is long side × short side = 640 × 360, but the screen size is not limited to this. It is not done.

S1300では、撮影者がカメラを正位置に構えているか、または縦位置に構えているかについて、姿勢検出部124により判定される。撮影者がカメラを正位置に構えていると判定された場合、S1301に進むが、縦位置に構えている場合にはS1306に移行する。S1301では、長辺サイズである640を水平方向の画面サイズに設定する処理が実行される。次のS1302では現在の設定モードが、静止画と動画とを同時に撮影できるモード(静止画/動画同時撮影モード)であるか否かの判定処理が行われる。静止画/動画同時撮影モードとは、動画の撮影中に撮影者が操作部117のレリーズスイッチを押下することで静止画撮影も同時に行えるか、または静止画撮影直前のフレーミング操作の様子を動画として自動的に記録可能なモードのことである。S1302で静止画/動画同時撮影モードであると判定された場合、動画の短辺サイズと静止画の短辺サイズとを比較し、より小さいサイズを垂直画面サイズとして設定する処理が実行される。これは、小さい画面サイズに合わせてオートズームを行うことで、静止画と動画のいずれの画角でも被写体が画面からフレームアウトすることを防止するためである。したがって、本実施形態では静止画/動画同時撮影モードの場合にS1304に進み、動画の短辺サイズである360が垂直画面サイズとして設定される。その後、画面サイズ算出処理が終了する。   In S1300, the posture detection unit 124 determines whether the photographer holds the camera in the normal position or in the vertical position. If it is determined that the photographer holds the camera at the normal position, the process proceeds to S1301, whereas if the photographer holds the camera at the vertical position, the process proceeds to S1306. In S1301, a process of setting the long side size 640 to the horizontal screen size is performed. In the next step S1302, a determination process is performed to determine whether or not the current setting mode is a mode in which a still image and a moving image can be simultaneously shot (still image / moving image simultaneous shooting mode). In the still image / moving image simultaneous shooting mode, a photographer can simultaneously shoot a still image by pressing a release switch of the operation unit 117 during shooting of a moving image, or a framing operation immediately before shooting a still image as a moving image. This is a mode that can be recorded automatically. If it is determined in step S1302 that the mode is the still image / moving image simultaneous shooting mode, a process of comparing the short side size of the moving image with the short side size of the still image and setting a smaller size as the vertical screen size is executed. This is to prevent the subject from going out of the frame at any angle of view of the still image and the moving image by performing the auto zoom in accordance with the small screen size. Accordingly, in the present embodiment, in the case of the still image / moving image simultaneous shooting mode, the process proceeds to S1304, and the short side size 360 of the moving image is set as the vertical screen size. Thereafter, the screen size calculation processing ends.

S1302で静止画/動画同時撮影モードでないと判定された場合には、S1303へ進む。S1303では、動画記録中であるか、または静止画フレーミング中であるかが判定される。動画記録中であると判定された場合、S1304に進むが、動画記録中でないと判定された場合にはS1305に移行する。S1305では静止画の短辺サイズである480が垂直画面サイズとして設定される。   If it is determined in step S1302 that the mode is not the still image / moving image simultaneous shooting mode, the process advances to step S1303. In step S1303, it is determined whether moving image recording is in progress or still image framing is in progress. If it is determined that the moving image is being recorded, the process proceeds to S1304, but if it is determined that the moving image is not being recorded, the process proceeds to S1305. In S1305, 480 which is the short side size of the still image is set as the vertical screen size.

S1300で撮影者が縦位置に構えていると判定された場合、S1306からS1310の処理が実行される。S1306からS1310の処理はそれぞれ、S1301からS1305の処理に対して、水平画面サイズと垂直画面サイズの設定を逆にした処理である。つまり、前記の説明にて「水平」と「垂直」を入れ替えることで読み替えればよいので詳細な説明を省略する。なお、本実施形態では静止画の画面サイズが4:3であって(図15(A)及び(B)参照)、動画の画面サイズが16:9である例(図15(C)参照)を示すが、アスペクト比の設定に応じて画面サイズを変更してもよい。それによってアスペクト比に依らず、画面に対して人物の画像が占める割合を一定とすることが可能である。また、静止画/動画同時撮影モードとして静止画と動画で画面サイズが異なる例を示したが、異なる画面サイズの複数の静止画や動画を同時に撮影する形態であってもよい。   If it is determined in S1300 that the photographer is in the vertical position, the processing from S1306 to S1310 is performed. The processing from S1306 to S1310 is processing in which the setting of the horizontal screen size and the vertical screen size are reversed from the processing of S1301 to S1305, respectively. In other words, the above description may be replaced by replacing “horizontal” and “vertical”, and a detailed description thereof will be omitted. In the present embodiment, the screen size of the still image is 4: 3 (see FIGS. 15A and 15B), and the screen size of the moving image is 16: 9 (see FIG. 15C). However, the screen size may be changed according to the setting of the aspect ratio. This makes it possible to make the ratio of the image of the person to the screen constant regardless of the aspect ratio. Further, an example in which the screen size is different between the still image and the moving image in the still image / moving image simultaneous shooting mode has been described, but a mode in which a plurality of still images and moving images with different screen sizes are simultaneously shot may be adopted.

図12のS1203にて画面サイズが決定されると、S1204に処理を進める。メモリ118に記憶されている構図設定が「顔」、「上半身」、「全身」のいずれかである場合、S1204からS1209にてAZ制御部122は、構図設定に応じて画面に占める顔画像のサイズの比率(顔比率という)を決定する。本実施形態の顔比率は、画面に対する顔追尾枠の垂直方向における長さの比率を示すが、水平方向における長さの比率や、面積比などで示してもよい。具体的には例えば、S1204で構図設定が「顔」であるか否かが判定され、「顔」の構図の場合(S1204でyes)、顔比率が27%に決定される(S1207)。また、構図設定が「顔」でない場合にはS1205に進み、構図設定が「上半身」であるか否かが判定され、「上半身」の構図の場合(S1205でyes)、顔比率が16%に決定される(S1208)。構図設定が「上半身」でない場合にはS1206に進み、構図設定が「全身」であるか否かが判定され、「全身」の構図の場合(S1206でyes)、顔比率が7%と決定される(S1209)。S1204からS1209の各ステップにより顔比率が決定された後、S1210に進む。   When the screen size is determined in S1203 in FIG. 12, the process proceeds to S1204. If the composition setting stored in the memory 118 is any one of “face”, “upper body”, and “whole body”, the AZ control unit 122 determines in step S1204 to S1209 the face image occupied on the screen according to the composition setting. Determine the size ratio (called face ratio). The face ratio in the present embodiment indicates the ratio of the length of the face tracking frame to the screen in the vertical direction, but may be indicated by the ratio of the length in the horizontal direction or the area ratio. More specifically, for example, it is determined whether the composition setting is “face” in S1204. If the composition is “face” (yes in S1204), the face ratio is determined to be 27% (S1207). If the composition setting is not “face”, the process proceeds to S1205, and it is determined whether the composition setting is “upper body”. If the composition setting is “upper body” (yes in S1205), the face ratio is reduced to 16%. It is determined (S1208). If the composition setting is not “upper body”, the process proceeds to S1206, and it is determined whether the composition setting is “whole body”. If the composition setting is “whole body” (yes in S1206), the face ratio is determined to be 7%. (S1209). After the face ratio is determined in each step from S1204 to S1209, the process proceeds to S1210.

S1210でAZ制御部122は、S1204からS1209で決定した顔比率と、S1203で算出した垂直画面サイズとを乗算することで基準サイズを算出する。これは、立位姿勢の被写体(人物)を前提として、垂直方向の画面サイズに対する顔比率から基準サイズを算出する方法である。被写体検出部123により顔の方向が判定できる場合には、画面上での顔の上下方向に基づいて画面サイズの方向を決定してもよい。さらに、算出した基準サイズをメモリ118に記憶する処理が実行された後、基準サイズ設定の処理を終了する。これによって、構図設定が「顔」、「上半身」、「全身」のいずれかである場合、画面サイズに対して構図設定に応じた所定の顔比率となるサイズが基準サイズとして設定される。   In S1210, the AZ control unit 122 calculates the reference size by multiplying the face ratio determined in S1204 to S1209 by the vertical screen size calculated in S1203. This is a method of calculating a reference size from a face ratio with respect to a screen size in the vertical direction, assuming a subject (person) in a standing posture. If the direction of the face can be determined by the subject detection unit 123, the direction of the screen size may be determined based on the vertical direction of the face on the screen. Further, after the process of storing the calculated reference size in the memory 118 is performed, the process of setting the reference size ends. Thus, when the composition setting is any one of “face”, “upper body”, and “whole body”, a size having a predetermined face ratio according to the composition setting with respect to the screen size is set as the reference size.

S1206にて構図設定が「全身」でない場合、すなわち、構図設定が「オート」であると判定された場合には、S1211に進み、AZ制御部122は、撮影状態や被写体の数、被写体の動き等に応じて適切な構図を自動で判定する。図14を参照して、S1211の構図設定「オート」での自動構図判定及び構図選択処理について説明する。構図設定「オート」は、撮影シーンを判別して適切な構図をカメラが自動で選択する(自動構図選択)ことによって、構図合わせをさらに簡単に行えるモードである。   If the composition setting is not “whole body” in S1206, that is, if it is determined that the composition setting is “auto”, the process proceeds to S1211, and the AZ control unit 122 determines the shooting state, the number of subjects, and the movement of the subjects. An appropriate composition is automatically determined according to the above. The automatic composition determination and composition selection processing in the composition setting “auto” in S1211 will be described with reference to FIG. The composition setting “auto” is a mode in which the composition can be further easily adjusted by the camera automatically selecting an appropriate composition by selecting a shooting scene (automatic composition selection).

図14は、本実施形態にて自動で選択される構図の遷移図を示す。本実施形態においては、上半身1400、全身1401、顔1402、複数人1403、マニュアル1404という5つの構図の中から、撮影シーンに応じて適切な構図を選択する構図選択処理が行われる。構図合わせの操作において、静止画撮影時には、撮影前に瞬時に被写体像を適切な大きさとする必要がある。一方、動画撮影時には、動いている被写体を追い続けたり、静止した被写体に寄ったりする等、撮影している間は常に被写体像を適切な大きさとする必要がある。また、動画撮影時には構図の変更によるズームイン動作時やズームアウト動作時の画像データも記録されるため、適切なタイミングで構図を変更することで効果的な映像を撮影できる。このように、静止画と動画とではそれぞれに適切な構図が異なる。そこで、静止画フレーミング中1405と、動画記録中1406とで、撮影状態によって選択する構図を変更する処理が実行される。すなわち、本実施形態では第1の動作状態として静止画の撮影準備状態を例示し、第2の動作状態として動画の記録状態を例示する。静止画フレーミング中1405での第1の構図群に属する選択候補の構図として、上半身1400、全身1401、複数人1403からいずれかの構図が選択される。動画記録中1406での第2の構図群に属する選択候補の構図としては、上半身1400、全身1401、顔1402からいずれかの構図が選択される。つまり、上半身1400、全身1401の各構図が第1の構図群と第2の構図群とで共通し、複数人1403の構図は第1の構図群にのみ包含され、顔1402の構図は第2の構図群にのみ包含される。なお、撮像装置の仕様等に応じて、3以上の動作状態と、それぞれに対応する複数の構図群(各動作状態にて選択可能な構図を含む)を設定可能である。   FIG. 14 shows a transition diagram of a composition automatically selected in the present embodiment. In the present embodiment, a composition selection process is performed to select an appropriate composition from the five compositions of the upper body 1400, the whole body 1401, the face 1402, the plural persons 1403, and the manual 1404 according to the shooting scene. In the composition adjustment operation, when photographing a still image, it is necessary to instantaneously make the subject image an appropriate size before photographing. On the other hand, when capturing a moving image, it is necessary to always keep the subject image in an appropriate size while capturing the moving subject, such as following a moving subject or approaching a stationary subject. Further, at the time of shooting a moving image, image data during a zoom-in operation or a zoom-out operation due to a change in composition is also recorded, so that an effective video can be shot by changing the composition at an appropriate timing. As described above, an appropriate composition differs between a still image and a moving image. Thus, during still image framing 1405 and during moving image recording 1406, a process of changing the selected composition depending on the shooting state is executed. That is, in the present embodiment, the first operation state exemplifies a still image shooting preparation state, and the second operation state exemplifies a moving image recording state. As the composition of the selection candidate belonging to the first composition group during the still image framing 1405, any composition is selected from the upper body 1400, the whole body 1401, and the plurality 1403. As the composition of the selection candidate belonging to the second composition group during the moving image recording 1406, any one of the upper body 1400, the whole body 1401, and the face 1402 is selected. That is, the respective compositions of the upper body 1400 and the whole body 1401 are common to the first composition group and the second composition group, the composition of a plurality of persons 1403 is included only in the first composition group, and the composition of the face 1402 is the second composition group. Are included only in the composition group. Note that three or more operation states and a plurality of composition groups (including compositions that can be selected in each operation state) can be set in accordance with the specifications and the like of the imaging device.

ここで、撮影シーンの判定条件と、各構図の遷移について説明する。構図設定「オート」の自動構図判定処理S1211が開始すると、初期状態の構図として上半身1400が設定される。上半身1400の構図は、静止画フレーミング中1405もしくは動画記録中1406に、静止している単数の被写体を撮影するシーンであると判定された場合に選択される構図である。このようなシーンでは、被写体の上半身を画面内に収める構図とすることで適度に被写体に寄った構図とすることができる。   Here, the determination conditions of the shooting scene and the transition of each composition will be described. When the automatic composition determination process S1211 of the composition setting “auto” starts, the upper body 1400 is set as the composition in the initial state. The composition of the upper body 1400 is a composition selected when it is determined that a still image of a single subject is captured during still image framing 1405 or moving image recording 1406. In such a scene, the composition can be appropriately adjusted to the subject by setting the composition of the upper body of the subject within the screen.

上半身1400の構図で、撮影対象の被写体の動きが検出された場合、または、カメラから被写体までの距離が所定距離D1(第1閾値)よりも大きいと判定された場合には、構図が全身1401に変更される。全身1401の構図は、静止画フレーミング中1405もしくは動画記録中1406に、動いている被写体や遠くの被写体、すなわち、被写体が画面からフレームアウトしやすい被写体を撮影するシーンであると判定された場合に選択される構図である。このようなシーンでは、被写体の全身を収める構図で被写体を追うことによって、できるだけ画面から被写体がフレームアウトしないように設定される。さらに、全身1401の構図で、撮影対象の被写体が所定時間以上に静止したことが検出され、かつ、カメラから被写体までの距離が所定距離D2(第2閾値)よりも小さいと判定された場合には、構図を上半身1400に戻す処理が実行される。所定時間とは予め設定される判定用の基準時間である。   When the movement of the subject to be photographed is detected in the composition of the upper body 1400, or when it is determined that the distance from the camera to the subject is larger than a predetermined distance D1 (first threshold), the composition is set to the whole body 1401. Is changed to The composition of the whole body 1401 is determined when a moving object or a distant object is determined during still image framing 1405 or moving image recording 1406, that is, a scene in which the subject easily shoots out of the screen. It is a composition to be selected. In such a scene, the subject is set such that the subject does not go out of the frame as much as possible by following the subject with a composition that accommodates the whole body of the subject. Further, when the composition of the whole body 1401 detects that the subject to be photographed has stopped for a predetermined time or more, and it is determined that the distance from the camera to the subject is smaller than a predetermined distance D2 (second threshold). Is executed to return the composition to the upper body 1400. The predetermined time is a reference time for determination set in advance.

以下、被写体の動きや静止の判定方法について説明する。被写体検出部123が検出した被写体の位置やサイズの変化量、または、被写体を検出している状態で揺れ検出部125が検出した揺れ量のうち、少なくとも一つが所定量よりも大きい場合には、撮影対象の被写体が動いていると判定される。被写体検出部123が検出した被写体の位置やサイズの変化量、及び、被写体を検出している状態で揺れ検出部125が検出した揺れ量の全てが所定量よりも小さい状態が所定時間以上続いた場合に撮影対象の被写体が静止していると判定される。検出状態の継続時間については、計時用タイマで計測されるものとする。   Hereinafter, a method for determining whether the subject is moving or stationary will be described. When at least one of the change amount of the position or size of the subject detected by the subject detection unit 123 or the swing amount detected by the shake detection unit 125 while the subject is being detected is larger than a predetermined amount, It is determined that the subject to be photographed is moving. A state in which the amount of change in the position or size of the subject detected by the subject detection unit 123 and the amount of shake detected by the shake detection unit 125 while the subject is being detected are all smaller than a predetermined amount for a predetermined time or more. In this case, it is determined that the subject to be photographed is stationary. The duration of the detection state is measured by a timer.

さらに、カメラから被写体までの距離の算出方法について説明する。まず、基準とする焦点距離と、被写体サイズに対する被写体距離を予め計測しておき、メモリ118に計測データが記憶される。メモリ118に記憶された基準値に対して、「被写体距離=(基準被写体距離×焦点距離×基準被写体サイズ)/(基準焦点距離×検出サイズ)」という演算を行うことで被写体距離が算出される。例えば、基準値が基準被写体距離2m、基準焦点距離24mm、基準被写体サイズ20pix(ピクセル)である場合に、焦点距離120mmで検出サイズ40pixの被写体像を検出した場合を想定する。この場合、被写体距離は、(2m×120mm×20pix)/(24mm×40pix)=5mと算定される。   Further, a method of calculating the distance from the camera to the subject will be described. First, the reference focal length and the subject distance with respect to the subject size are measured in advance, and the measurement data is stored in the memory 118. The subject distance is calculated by performing an operation of “subject distance = (reference subject distance × focal length × reference subject size) / (reference focal length × detection size)” on the reference value stored in the memory 118. . For example, it is assumed that when the reference values are a reference subject distance of 2 m, a reference focal length of 24 mm, and a reference subject size of 20 pix (pixels), a subject image having a focal length of 120 mm and a detection size of 40 pix is detected. In this case, the subject distance is calculated as (2 m × 120 mm × 20 pix) / (24 mm × 40 pix) = 5 m.

次に画面内に複数人の被写体を検出した場合の構図について説明する。静止画フレーミング中1405の上半身1400または全身1401の構図で、画面内に複数人の被写体が検出された場合には、構図を複数人1403に変更する処理が行われる。このとき、検出された被写体の数がメモリ118に記憶される。複数人1403の構図は、静止画フレーミング中1405に、複数の全ての被写体を所定の画角に収める集合写真の撮影シーンであると判定された場合に選択される構図である。複数人1403の構図の状態では、検出された被写体の数が変化したか否かの判定処理が行われる。検出された被写体の数が増加した場合には、新しい被写体が画面内に入って来たことで、即座にメモリ118に記憶した被写体の数が更新されて、構図の変更が行われる。一方、検出された被写体の数が減少した場合には、例えば、いずれかの被写体が横を向いたときのように、一時的に検出できない状態となる可能性がある。そのため、即座に構図を変更したのでは、検出できなくなった被写体がフレームアウトしてしまう可能性がある。そこで、被写体の数が減少した場合には、その状態が所定時間以上に亘って継続したか否かが判定される。当該状態が所定時間以上継続した場合、メモリ118に記憶される被写体の数が更新され、構図が変更される。さらに、被写体が一人になった場合には、構図を上半身1400に戻す処理が実行される。   Next, the composition when a plurality of subjects are detected in the screen will be described. When a plurality of subjects are detected on the screen in the composition of the upper body 1400 or the whole body 1401 during the still image framing 1405, a process of changing the composition to the plurality of persons 1403 is performed. At this time, the number of detected subjects is stored in the memory 118. The composition of the plurality of persons 1403 is selected when it is determined during the still image framing 1405 that the scene is a group photograph shooting scene in which all the plurality of subjects are included in a predetermined angle of view. In the composition state of the plurality of persons 1403, a process of determining whether or not the number of detected subjects has changed is performed. When the number of detected subjects increases, the number of subjects stored in the memory 118 is immediately updated because a new subject has entered the screen, and the composition is changed. On the other hand, when the number of detected subjects decreases, for example, there is a possibility that a state where detection is temporarily impossible, such as when one of the subjects faces sideways. Therefore, if the composition is changed immediately, the subject that cannot be detected may go out of the frame. Therefore, when the number of subjects decreases, it is determined whether the state has continued for a predetermined time or more. If the state continues for a predetermined time or more, the number of subjects stored in the memory 118 is updated, and the composition is changed. Further, when the subject is alone, a process of returning the composition to the upper body 1400 is performed.

動画記録中1406には、全ての被写体を画角に収める構図にすると、撮影対象以外の被写体が動き回っている場合に、その被写体に反応してズームの誤作動が発生することが懸念される。そこで、動画記録中1406に複数人の被写体が検出された場合でも、主被写体のみを撮影対象として、構図を上半身1400または全身1401のままに維持する処理が行われる。動画記録中1406での上半身1400の構図で、画面の中心付近にて顔が所定時間以上に亘って検出された場合には、構図を顔1402に変更する処理が行われる。顔1402の構図は、動画記録中1406に、撮影者が被写体の顔に注目しているシーンであると判定された場合に選択される構図である。このようなシーンでは、上半身よりもさらに顔に寄った構図とすることで、注目する被写体の顔をより大きなサイズで撮影できる。また、この構図変更によるズームイン動作中に、ズーム速度を通常の速度よりも、著しく低速もしくは高速に変更することで、さらに効果的な映像を撮影できる。さらに、顔1402の構図で、画面の周辺付近にて顔が所定時間以上に亘って検出された場合、または、撮影者がフレーミングを変更したと判定された場合には、構図を上半身1400に戻す処理が行われる。本実施形態では、画面の周辺領域を画像の特定領域として例示し、被写体検出部123の検出した被写体の顔画像の位置が周辺領域である状態の継続時間を計時用タイマが計測する。また、フレーミング変更の判定方法としては、被写体検出部123が被写体を検出していない状態であって、かつ揺れ検出部125の検出した揺れ量が所定量よりも大きい場合に、撮影者がフレーミングを変更したと判定される。   If a composition is adopted in which all subjects are included in the angle of view during recording of a moving image 1406, when a subject other than the subject to be photographed is moving around, there is a concern that malfunction of the zoom may occur in response to the subject. Therefore, even when a plurality of subjects are detected during the recording of a moving image 1406, a process of maintaining the composition as the upper body 1400 or the whole body 1401 with only the main subject as a shooting target is performed. In the composition of the upper body 1400 during recording of a moving image 1406, when a face is detected near the center of the screen for a predetermined time or more, a process of changing the composition to the face 1402 is performed. The composition of the face 1402 is a composition selected when it is determined during recording of a moving image 1406 that the scene focuses on the face of the subject. In such a scene, by making the composition closer to the face than the upper body, the face of the subject of interest can be photographed in a larger size. Further, during the zoom-in operation due to the composition change, by changing the zoom speed to be significantly lower or higher than the normal speed, a more effective image can be captured. Further, in the composition of the face 1402, when the face is detected for a predetermined time or more near the periphery of the screen, or when it is determined that the photographer has changed the framing, the composition is returned to the upper body 1400. Processing is performed. In the present embodiment, the peripheral area of the screen is exemplified as the specific area of the image, and the timer for measuring the duration of the state where the position of the face image of the subject detected by the subject detection unit 123 is the peripheral area is measured. In addition, as a framing change determination method, when the subject detection unit 123 is not detecting a subject and the shake amount detected by the shake detection unit 125 is larger than a predetermined amount, the photographer performs framing. It is determined that it has been changed.

静止画フレーミング中1405に撮影者は、人物の顔の向きや表情が所望の状態となるまで同じ構図でシャッタチャンスを待ち続ける場合がある。この場合、顔に寄った構図とすると撮影者の意図とは違う構図となる可能性がある。したがって、静止画フレーミング中1405の上半身1400の構図で、画面の中心付近にて顔が所定時間以上検出されたとしても、上半身1400の構図を維持する処理が実行される。   During still image framing 1405, the photographer may continue to wait for a photo opportunity with the same composition until the orientation and expression of the person's face are in the desired state. In this case, if the composition is close to the face, the composition may be different from the photographer's intention. Therefore, in the composition of the upper body 1400 during the still image framing, even if a face is detected for a predetermined time or more near the center of the screen, a process of maintaining the composition of the upper body 1400 is executed.

次に、動画記録の開始/終了によって撮影状態を変更する場合の構図について説明する。上半身1400及び全身1401の各構図は、静止画フレーミング中1405や動画記録中1406のいずれの場合でも選択可能な構図である。したがって、それらの構図では撮影状態を変更しても元の構図が維持される。一方、複数人1403や顔1402の構図は、静止画フレーミング中1405や動画記録中1406のいずれかの場合にのみ選択される構図である。そこで、静止画フレーミング中1405に複数人1403の構図で動画記録が開始された場合や、動画記録中1406に顔1402の構図で動画記録が終了された場合に、共通の構図である上半身1400に変更することが考えられる。しかしながら、この場合、動画記録の開始や終了と共にズーム動作が開始することで、動画の始めにズーム動作による画像が記録されたり、静止画のフレーミングで撮影者が煩わしく感じたりすることが懸念される。そこで、そのような状態で撮影状態が変更された場合には、構図を一時的にマニュアル1404に変更する処理が実行される。マニュアル1404の構図は、構図変更後に最初に検出した主被写体像の大きさを基準サイズとする構図である。したがって、撮影状態を変更しただけで直ちにズーム動作が開始することがなく、撮影者に違和感を与えない。また、被写体が動き出した場合であっても、被写体像の大きさを維持することができる。さらに、マニュアル1404の構図で所定時間が経過した場合、構図を上半身1400に戻す処理が実行される。   Next, a composition in a case where the shooting state is changed according to the start / end of the moving image recording will be described. Each composition of the upper body 1400 and the whole body 1401 is a composition that can be selected in any case of 1405 during still image framing and 1406 during moving image recording. Therefore, in those compositions, the original composition is maintained even if the shooting state is changed. On the other hand, the composition of the plurality of persons 1403 and the face 1402 is a composition selected only in one of the cases of 1405 during still image framing and 1406 during moving image recording. Therefore, when moving image recording is started with a composition of a plurality of persons 1403 during still image framing 1405 or when moving image recording is ended with a composition of a face 1402 during moving image recording 1406, the upper body 1400, which is a common composition, is added. It can be changed. However, in this case, when the zoom operation starts at the same time as the start and end of the moving image recording, there is a concern that an image due to the zoom operation is recorded at the beginning of the moving image or that the photographer feels troublesome when framing a still image. . Therefore, when the shooting state is changed in such a state, a process of temporarily changing the composition to the manual 1404 is executed. The composition of the manual 1404 is a composition in which the size of the main subject image detected first after the composition is changed is set as the reference size. Therefore, the zoom operation does not immediately start just by changing the photographing state, and the photographer does not feel uncomfortable. Further, even when the subject starts moving, the size of the subject image can be maintained. Further, when a predetermined time has elapsed in the composition of the manual 1404, a process of returning the composition to the upper body 1400 is performed.

以上のように図12のS1211では、構図設定が「オート」である場合に、撮影状態や被写体の数、被写体の動き等に応じて適切な構図が自動で判定される。判定後の構図を示すデータはメモリ118に記憶され、S1212に進む。   As described above, in S1211 of FIG. 12, when the composition setting is “auto”, an appropriate composition is automatically determined according to the shooting state, the number of subjects, the movement of the subjects, and the like. Data indicating the composition after the determination is stored in the memory 118, and the process proceeds to S1212.

S1212では、S1211にて判定された構図が直前の構図に対して変更されたか(図14で選択された構図が遷移したか、または、複数人1403の状態で被写体数が変化したか)否かが判定される。構図が変更されている場合には、S1213に進み、選択された構図がマニュアル1404の構図であるか否かが判定される。選択された構図がマニュアル1404の構図である場合には、S1201に進み、最初に検出された被写体像の大きさを基準サイズとしてメモリ118に記憶する処理が実行される。選択された構図がマニュアル1404の構図でない場合には、S1215に進み、構図設定「オート」における基準サイズが算出される。S1212で、構図が変更されていないと判定された場合には、S1214に進み、被写体像が画面内で移動したか否かについて判定される。画面内での被写体像の移動量の算出方法としては、S1215で基準サイズが設定された後、その基準サイズとなる画角までズーム動作を行った直後の顔追尾枠の中心位置がメモリ118に記憶される。メモリ118に記憶した位置から、検出された顔追尾枠の中心位置までの距離が移動量として算出される。また、所定の周期ごとに顔追尾枠の中心位置を加算して画面内での移動量を算出してもよい。算出された移動量が所定量以上となった場合に被写体が移動したと判定される。所定量としては、検出された顔追尾枠のサイズで正規化する(顔追尾枠のサイズの所定倍とする)ことで、画面内での被写体像の大きさに依らず実際の被写体の移動量を同程度とすることができる。S1214で、被写体が画面内で移動していると判定された場合にはS1215に進み、構図設定「オート」における基準サイズが算出される。また、S1214で被写体像が画面内で移動していないと判定された場合には、基準サイズを更新することなく、基準サイズの設定処理を終了する。   In step S1212, it is determined whether the composition determined in step S1211 has been changed with respect to the immediately preceding composition (whether the composition selected in FIG. 14 has transitioned or the number of subjects has changed in a state of a plurality of persons 1403). Is determined. If the composition has been changed, the process advances to step S1213 to determine whether the selected composition is a composition of the manual 1404. If the selected composition is the composition of the manual 1404, the process advances to step S1201 to execute a process of storing the size of the first detected subject image in the memory 118 as a reference size. If the selected composition is not the composition of the manual 1404, the process advances to step S1215 to calculate the reference size in the composition setting "auto". If it is determined in step S1212 that the composition has not been changed, the process advances to step S1214 to determine whether the subject image has moved on the screen. As a method of calculating the moving amount of the subject image in the screen, after the reference size is set in S1215, the center position of the face tracking frame immediately after performing the zoom operation to the angle of view that becomes the reference size is stored in the memory 118. It is memorized. The distance from the position stored in the memory 118 to the center position of the detected face tracking frame is calculated as the movement amount. Further, the movement amount in the screen may be calculated by adding the center position of the face tracking frame at every predetermined cycle. It is determined that the subject has moved when the calculated movement amount is equal to or more than a predetermined amount. The predetermined amount is normalized by the size of the detected face tracking frame (to be a predetermined multiple of the size of the face tracking frame), so that the actual moving amount of the subject regardless of the size of the subject image on the screen Can be made comparable. If it is determined in step S1214 that the subject is moving on the screen, the process advances to step S1215 to calculate a reference size in the composition setting “auto”. If it is determined in step S1214 that the subject image has not moved within the screen, the reference size setting process ends without updating the reference size.

以下、図15から図19を参照して、構図設定「オート」における基準サイズの算出処理について説明する。構図設定が「顔」、「上半身」、「全身」のいずれかである場合には、図12のS1210において画面サイズに対して顔が一定の比率となるように、基準サイズが算出される。つまり画面上の被写体像の位置によらずに同じ基準サイズが算出される。そのため、被写体が画面の周辺にいる場合に被写体像が大きくなる(ズームインする)ように構図を変更すると、被写体がフレームアウトしてしまう可能性がある。この方法で基準サイズを算出する場合には、撮影者が被写体を画面の中央付近にフレーミングしている必要がある。したがって、被写体を画面中央からずらして背景と一緒に撮影する場合等には適していない。また、被写体が複数である場合には別の方法で基準サイズを算出する必要がある。そこで、構図設定が「オート」の場合には、S1211で判定された構図に基づいて被写体像の大きさを決定するとともに、検出された被写体の位置によらず被写体が画面内に収まるように基準サイズを算出する処理が行われる。   Hereinafter, the calculation process of the reference size in the composition setting “auto” will be described with reference to FIGS. If the composition setting is any one of “face”, “upper body”, and “whole body”, the reference size is calculated in S1210 of FIG. 12 so that the face has a fixed ratio to the screen size. That is, the same reference size is calculated regardless of the position of the subject image on the screen. Therefore, if the composition is changed so that the subject image becomes large (zoom in) when the subject is around the screen, the subject may be out of frame. When calculating the reference size by this method, the photographer needs to frame the subject near the center of the screen. Therefore, it is not suitable for a case where the subject is shifted from the center of the screen and photographed together with the background. When there are a plurality of subjects, it is necessary to calculate the reference size by another method. Therefore, when the composition setting is “auto”, the size of the subject image is determined based on the composition determined in S1211 and the reference is set so that the subject fits within the screen regardless of the position of the detected subject. Processing for calculating the size is performed.

図15は、複数の被写体のうちで最も画面周辺にいる被写体の位置と、画面サイズとの関係を示す図である。図15(A)及び(B)は静止画撮影の画面例を示し、図15(C)は動画撮影の画面例を示しており、複数人の被写体を例示する。また、図16は構図設定「オート」における基準サイズの算出処理の全体を示すフローチャートである。
まず図16のS1600にて、水平方向の被写体位置比率Rhを算出する処理が実行される。水平方向の被写体位置比率Rhとは、水平方向の画面サイズに対する所定の割合に対して、画面中央から最も周辺にいる被写体の肩部付近の水平位置(以下、肩位置といい、Xsmaxと記す)までの距離×2が占める割合である。所定の割合とは、例えば、水平方向の画面サイズの80%または90%であり、後述するS1703での水平方向の並び人数に応じて変更される。図15(A)では被写体1500a,1501a,1502aのうち、水平方向にて画面中央から最も周辺にいる被写体は被写体1500aである。図17のフローチャートを参照して、水平方向の被写体位置比率Rhの算出処理について説明する。
FIG. 15 is a diagram illustrating the relationship between the position of the subject closest to the screen among the plurality of subjects and the screen size. FIGS. 15A and 15B show an example of a still image shooting screen, and FIG. 15C shows an example of a moving image shooting screen, illustrating a plurality of subjects. FIG. 16 is a flowchart showing the entire process of calculating the reference size in the composition setting “auto”.
First, in S1600 of FIG. 16, a process of calculating the horizontal subject position ratio Rh is performed. The horizontal subject position ratio Rh is a horizontal position in the vicinity of the shoulder of the subject located nearest from the center of the screen with respect to a predetermined ratio with respect to the horizontal screen size (hereinafter, referred to as a shoulder position and described as Xsmax). Distance x 2 is the ratio occupied. The predetermined ratio is, for example, 80% or 90% of the screen size in the horizontal direction, and is changed according to the number of people arranged in the horizontal direction in S1703 described later. In FIG. 15A, among the subjects 1500a, 1501a, and 1502a, the subject that is closest to the periphery from the center of the screen in the horizontal direction is the subject 1500a. The calculation process of the horizontal subject position ratio Rh will be described with reference to the flowchart in FIG.

S1700では、被写体の顔追尾枠の中心位置やサイズに基づき、被写体の肩位置(Xsと記す)が算定される。画面中央を原点(0,0)とし、顔追尾枠の中心位置を(Xc,Yc)とし、顔追尾枠のサイズをSとする。顔追尾枠の中心位置から肩位置までの距離に占める顔追尾枠の個数をNsとして、「Xs=|Xc|+S×Ns」により、画面周辺側の肩位置Xsを算出できる。図19にNsの設定例を示す。Nsの値は、図12のS1211で判定された構図にしたがって変更される。例えば、顔1402の構図の場合、Ns=1(この場合は肩位置ではなく耳付近の水平位置)が設定される。それ以外(「上半身」、「全身」、「複数人」)の場合、Ns=2が設定される。   In S1700, the shoulder position of the subject (denoted as Xs) is calculated based on the center position and size of the face tracking frame of the subject. The center of the screen is the origin (0, 0), the center position of the face tracking frame is (Xc, Yc), and the size of the face tracking frame is S. Assuming that the number of face tracking frames occupying the distance from the center position of the face tracking frame to the shoulder position is Ns, the shoulder position Xs on the peripheral side of the screen can be calculated by “Xs = | Xc | + S × Ns”. FIG. 19 shows an example of setting Ns. The value of Ns is changed according to the composition determined in S1211 of FIG. For example, in the case of the composition of the face 1402, Ns = 1 (in this case, not the shoulder position but the horizontal position near the ear) is set. In other cases (“upper body”, “whole body”, “plurality”), Ns = 2 is set.

被写体の肩位置Xsの算出後、S1701に進む。S1701では、メモリ118に肩位置の最大値Xsmaxが記憶されていない場合に、S1700で算出した肩位置Xsが最大肩位置Xsmaxとして記憶される。またメモリ118に最大肩位置Xsmaxが記憶されている場合には、S1700で算出した肩位置Xsと最大肩位置Xsmaxとが比較される。肩位置Xsが最大肩位置Xsmaxよりも大きい場合には、メモリ118の最大肩位置Xsmaxを肩位置Xsで更新する処理が実行される。最大肩位置Xsmaxの更新処理の後、S1702に進む。S1702では、全ての被写体に対して肩位置Xsを算出して最大肩位置Xsmaxを更新する処理が終了したか否かについて判定される。肩位置Xsの算出及び最大肩位置Xsmaxの更新が終了していない場合、S1700に戻る。全ての被写体に対して最大肩位置Xsmaxの判定が終了し、最大肩位置Xsmaxの更新が終了した場合には、S1703に進む。   After calculating the shoulder position Xs of the subject, the process proceeds to S1701. In S1701, when the maximum value Xsmax of the shoulder position is not stored in the memory 118, the shoulder position Xs calculated in S1700 is stored as the maximum shoulder position Xsmax. If the maximum shoulder position Xsmax is stored in the memory 118, the shoulder position Xs calculated in S1700 is compared with the maximum shoulder position Xsmax. If the shoulder position Xs is larger than the maximum shoulder position Xsmax, a process of updating the maximum shoulder position Xsmax in the memory 118 with the shoulder position Xs is executed. After updating the maximum shoulder position Xsmax, the process proceeds to S1702. In S1702, it is determined whether or not the processing of calculating the shoulder position Xs for all subjects and updating the maximum shoulder position Xsmax has been completed. If the calculation of the shoulder position Xs and the update of the maximum shoulder position Xsmax have not been completed, the process returns to S1700. If the determination of the maximum shoulder position Xsmax has been completed for all the subjects and the update of the maximum shoulder position Xsmax has been completed, the process proceeds to S1703.

S1703では、水平方向に被写体が並んでいる人数(水平方向の並び人数)の判定処理が行われる。これは、集合写真のように被写体が多い場合には、画面一杯に被写体が入る構図とし、被写体が少ない場合には、画面周辺に余白を残した構図とすることを目的とする。また、水平方向の並び人数のカウント方法としては、垂直方向(画面上下方向)に顔追尾枠が重なっている場合には、重なっている被写体を合わせて一人として計数される。例えば、画面内に四人の被写体が検出され、そのうちの二人の顔追尾枠が画面上下に重なっている場合には三人として計数される。S1703にて水平方向の並び人数が閾値(例えば二人)と比較される。水平方向の並び人数が二人以下と判定された場合にはS1704に進み、三人以上と判定された場合にはS1705に進む。S1704及びS1705では、水平方向の被写体位置比率Rhがそれぞれ算出される。S1704での水平方向被写体位置比率Rhは、水平画面サイズの80%に対する最大肩位置Xsmax×2の比率として算出される。またS1705での水平方向被写体位置比率Rhは、水平画面サイズの90%に対する最大肩位置Xsmax×2の比率として算出される。S1704またはS1705の後、被写体位置比率Rhの算出処理を終了する。   In S1703, a determination process of the number of persons in which the subjects are arranged in the horizontal direction (the number of persons arranged in the horizontal direction) is performed. The purpose of this is to provide a composition in which the subject fills the entire screen when there are many subjects, such as a group photo, and a composition in which a margin is left around the screen when there are few subjects. When the face tracking frames overlap in the vertical direction (the vertical direction of the screen), the number of persons arranged in the horizontal direction is counted as one person including the overlapping subjects. For example, if four subjects are detected in the screen, and two face tracking frames of the two subjects overlap the top and bottom of the screen, they are counted as three. In S1703, the number of persons arranged in the horizontal direction is compared with a threshold value (for example, two persons). If it is determined that the number of people arranged in the horizontal direction is two or less, the process proceeds to S1704, and if it is determined that the number of people is three or more, the process proceeds to S1705. In S1704 and S1705, the subject position ratio Rh in the horizontal direction is calculated, respectively. The horizontal subject position ratio Rh in S1704 is calculated as a ratio of the maximum shoulder position Xsmax × 2 to 80% of the horizontal screen size. The horizontal subject position ratio Rh in S1705 is calculated as a ratio of the maximum shoulder position Xsmax × 2 to 90% of the horizontal screen size. After S1704 or S1705, the calculation processing of the subject position ratio Rh ends.

次に図16のS1601にて、垂直方向の被写体位置比率Rvを算出する処理が実行される。垂直方向の被写体位置比率Rvとは、垂直方向の画面サイズの所定の割合に対して、画面中央から最も周辺の被写体の頭部の垂直位置(以下、頭位置という)、または身体部の垂直位置(以下、身体位置という)までの距離×2が占める割合である。所定の割合は、例えば、垂直方向の画面サイズの90%である。以下では、画面中央から最も周辺の被写体の頭位置をYhmaxと記し、画面中央から最も周辺の被写体の身体位置をYbminと記すことにする。図15(B)では被写体1500b,1501b,1502bのうち、垂直方向にて画面中央から最も周辺に頭部がある被写体は被写体1500bであり、また画面中央から最も周辺の身体位置の被写体は被写体1501bである。図18のフローチャートを参照して、垂直方向の被写体位置比率Rvの算出処理について説明する。   Next, in S1601 of FIG. 16, a process of calculating the subject position ratio Rv in the vertical direction is executed. The vertical subject position ratio Rv is the vertical position of the head of the subject closest to the center of the screen (hereinafter referred to as head position) or the vertical position of the body part for a predetermined ratio of the screen size in the vertical direction. (Hereinafter referred to as body position) × 2. The predetermined ratio is, for example, 90% of the screen size in the vertical direction. Hereinafter, the head position of the subject closest to the center of the screen is referred to as Yhmax, and the body position of the subject closest to the center of the screen is referred to as Ybmin. In FIG. 15B, of the subjects 1500b, 1501b, and 1502b, the subject having the head at the periphery from the center of the screen in the vertical direction is the subject 1500b, and the subject at the body position at the periphery from the center of the screen is the subject 1501b. It is. With reference to the flowchart of FIG. 18, a description will be given of a process of calculating the subject position ratio Rv in the vertical direction.

図18のS1800では、被写体の顔追尾枠の中心位置やサイズに基づいて、被写体の頭位置(Yhと記す)が算出される。「Yh=Yc+S×Nh」により頭位置Yhを算出できる。Nhは、顔追尾枠の中心位置から頭位置までの距離に占める顔追尾枠の個数である。図19にNhの設定例を示す。Nhの値については、図12のS1211で判定された構図によらず、Nh=1.5で設定される。被写体の頭位置Yhの算出後にS1801に進む。   In S1800 of FIG. 18, the head position (denoted as Yh) of the subject is calculated based on the center position and size of the face tracking frame of the subject. The head position Yh can be calculated from “Yh = Yc + S × Nh”. Nh is the number of face tracking frames occupying the distance from the center position of the face tracking frame to the head position. FIG. 19 shows an example of setting Nh. The value of Nh is set at Nh = 1.5 regardless of the composition determined in S1211 of FIG. After the calculation of the head position Yh of the subject, the process proceeds to S1801.

S1801では、メモリ118に頭位置の最大値Yhmaxが記憶されていない場合に、S1800で算出された頭位置Yhを最大頭位置Yhmaxとして記憶する処理が実行される。またメモリ118に最大頭位置Yhmaxが記憶されている場合には、S1800で算出された頭位置Yhと最大頭位置Yhmaxとが比較される。頭位置Yhが最大頭位置Yhmaxよりも大きい場合には、メモリ118の最大頭位置Yhmaxを頭位置Yhで更新する処理が行われる。更新処理後にS1802へ進む。   In S1801, when the maximum value Yhmax of the head position is not stored in the memory 118, a process of storing the head position Yh calculated in S1800 as the maximum head position Yhmax is executed. If the maximum head position Yhmax is stored in the memory 118, the head position Yh calculated in S1800 is compared with the maximum head position Yhmax. When the head position Yh is larger than the maximum head position Yhmax, a process of updating the maximum head position Yhmax in the memory 118 with the head position Yh is performed. After the update processing, the process proceeds to S1802.

次のS1802では、被写体の顔追尾枠の中心位置やサイズに基づいて、被写体の身体位置(Ybと記す)が算出される。「Yb=Yc−S×Nb」により身体位置Ybを算出できる。Nbは、顔追尾枠の中心位置から身体位置までの距離に占める顔追尾枠の個数である。図19にNbの設定例を示す。Nbの値については、図12のS1211で判定された構図に応じて変更される。例えば、顔1402の構図の場合にはNb=1.5が設定される。上半身1400の構図の場合にはNb=5、全身1401の構図の場合にはNb=10、複数人1403の構図の場合にはNb=3.5がそれぞれ設定される。この設定は、各構図にて画面中央で、顔1402では胸、上半身1400では腰下、全身1401では足、複数人1403では腰上付近の位置となる設定である。被写体の身体位置Ybの算出後、S1803に進む。   In the next step S1802, the body position of the subject (referred to as Yb) is calculated based on the center position and size of the face tracking frame of the subject. The body position Yb can be calculated from “Yb = Yc−S × Nb”. Nb is the number of face tracking frames occupying the distance from the center position of the face tracking frame to the body position. FIG. 19 shows an example of setting Nb. The value of Nb is changed according to the composition determined in S1211 of FIG. For example, in the case of the composition of the face 1402, Nb = 1.5 is set. Nb = 5 is set for the composition of the upper body 1400, Nb = 10 is set for the composition of the whole body 1401, and Nb = 3.5 is set for the composition of a plurality of persons 1403. This setting is such that the position is in the center of the screen in each composition, the position of the chest in the face 1402, the position of the lower back in the upper body 1400, the position of the feet in the whole body 1401, and the position in the vicinity of the upper waist of the plural persons 1403. After calculating the body position Yb of the subject, the process advances to S1803.

S1803では、メモリ118に身体位置の最小値Ybminが記憶されていない場合に、S1802で算出された身体位置Ybを最小身体位置Ybminとして記憶する処理が実行される。またメモリ118に最小身体位置Ybminが記憶されている場合には、S1802で算出された身体位置Ybと最小身体位置Ybminとが比較される。身体位置Ybが最小身体位置Ybminよりも小さい場合には、メモリ118の最小身体位置Ybminを身体位置Ybで更新する処理が行われる。更新処理後にS1804へ進む。   In S1803, when the minimum value Ybmin of the body position is not stored in the memory 118, a process of storing the body position Yb calculated in S1802 as the minimum body position Ybmin is executed. If the minimum body position Ybmin is stored in the memory 118, the body position Yb calculated in S1802 is compared with the minimum body position Ybmin. When the body position Yb is smaller than the minimum body position Ybmin, a process of updating the minimum body position Ybmin in the memory 118 with the body position Yb is performed. After the update processing, the process advances to step S1804.

S1804では、全ての被写体に対して頭位置Yh及び身体位置Ybが算出されて、最大頭位置Yhmax及び最小身体位置Ybminを更新する処理が終了したか否かについて判定される。最大頭位置Yhmax及び最小身体位置Ybminの更新が終了していない場合には、S1800に戻る。全ての被写体に対して最大頭位置Yhmax及び最小身体位置Ybminの判定が終了し、最大頭位置Yhmax及び最小身体位置Ybminの更新が終了した場合には、S1805に進む。S1805では最大頭位置Yhmaxの絶対値と、最小身体位置Ybminの絶対値とが比較され、どちらがより画面周辺に位置するかを判定する処理が行われる。最大頭位置Yhmaxの方がより画面周辺に位置すると判定された場合には、S1806に進む。また、最小身体位置Ybminの方がより画面周辺に位置すると判定された場合には、S1807に進む。S1806及びS1807では、垂直方向の被写体位置比率Rvがそれぞれ算出される。S1806での垂直方向被写体位置比率Rvは、垂直画面サイズの90%に対する最大頭位置Yhmaxの絶対値×2の比率として算出される。またS1807での垂直方向被写体位置比率Rvは、垂直画面サイズの90%に対する最小身体位置Ybminの絶対値×2の比率として算出される。S1806またはS1807の後、垂直方向被写体位置比率Rvの算出処理を終了する。   In S1804, the head position Yh and the body position Yb are calculated for all the subjects, and it is determined whether or not the process of updating the maximum head position Yhmax and the minimum body position Ybmin has been completed. If the update of the maximum head position Yhmax and the minimum body position Ybmin has not been completed, the process returns to S1800. If the determination of the maximum head position Yhmax and the minimum body position Ybmin has been completed for all the subjects and the update of the maximum head position Yhmax and the minimum body position Ybmin has been completed, the process proceeds to S1805. In S1805, the absolute value of the maximum head position Yhmax and the absolute value of the minimum body position Ybmin are compared, and processing for determining which is located closer to the screen is performed. If it is determined that the maximum head position Yhmax is located closer to the screen periphery, the process proceeds to S1806. If it is determined that the minimum body position Ybmin is located closer to the periphery of the screen, the process proceeds to S1807. In S1806 and S1807, the subject position ratio Rv in the vertical direction is calculated. The vertical subject position ratio Rv in S1806 is calculated as a ratio of the absolute value of the maximum head position Yhmax × 2 to 90% of the vertical screen size. The vertical subject position ratio Rv in S1807 is calculated as a ratio of the absolute value of the minimum body position Ybmin to 90% of the vertical screen size × 2. After S1806 or S1807, the calculation process of the vertical subject position ratio Rv ends.

続いて図16のS1602にて、水平方向の被写体位置比率Rhと、垂直方向の被写体位置比率Rvとが比較される。これによって、各方向の画面サイズの所定比率に対して、画面中央から被写体の各位置までの距離の比率のうちで、最も比率が大きい位置、すなわち、最も画面周辺となる位置を判定することができる。各位置とは、最大肩位置Xsmax、最大頭位置Yhmax、最小身体位置Ybminである。水平方向被写体位置比率Rhが垂直方向の被写体位置比率Rvより大きいと判定された場合には、S1603に進み、水平方向被写体位置比率Rhが垂直方向の被写体位置比率Rv以下であると判定された場合には、S1604に進む。S1603及びS1604では、主被写体の検出サイズと、S1602で判定した最も画面周辺となる被写体位置の比率に基づいて、基準サイズを算出する処理が実行される。基準サイズは、S1603にて「検出サイズ/水平方向被写体位置比率Rh」により算出され、S1604にて「検出サイズ/垂直方向被写体位置比率Rv」により算出される。すなわち、S1603では、主被写体像がそのサイズに「1/水平方向被写体位置比率Rh」を乗算した基準サイズとなるようにズーム動作が実行される。S1604では、主被写体像がそのサイズに「1/垂直方向被写体位置比率Rv」を乗算した基準サイズとなるようにズーム動作が実行される。こうすることで、画面内の被写体をフレームアウトさせることなく、S1211で判定された構図に基づく画角に設定できる。   Subsequently, in S1602 of FIG. 16, the subject position ratio Rh in the horizontal direction and the subject position ratio Rv in the vertical direction are compared. With this, it is possible to determine the position having the largest ratio, that is, the position closest to the screen, among the ratios of the distance from the center of the screen to each position of the subject with respect to the predetermined ratio of the screen size in each direction. it can. The positions are a maximum shoulder position Xsmax, a maximum head position Yhmax, and a minimum body position Ybmin. If it is determined that the horizontal direction subject position ratio Rh is greater than the vertical direction subject position ratio Rv, the process proceeds to S1603, and it is determined that the horizontal direction subject position ratio Rh is equal to or less than the vertical direction subject position ratio Rv. , The process proceeds to S1604. In S1603 and S1604, a process of calculating the reference size is executed based on the detected size of the main subject and the ratio of the position of the subject closest to the screen determined in S1602. The reference size is calculated based on “detected size / horizontal subject position ratio Rh” in S1603, and calculated based on “detected size / vertical subject position ratio Rv” in S1604. That is, in S1603, the zoom operation is performed such that the main subject image has a reference size obtained by multiplying the size by “1 / horizontal subject position ratio Rh”. In S1604, the zoom operation is performed such that the main subject image has a reference size obtained by multiplying the size by “1 / vertical subject position ratio Rv”. By doing so, the angle of view based on the composition determined in S1211 can be set without causing the subject in the screen to go out of the frame.

図12のS1215では、構図設定が「オート」の場合、S1211で判定された構図に基づいて水平方向及び垂直方向で最も画面周辺となる被写体位置が判定され、その位置が画面に収まるように基準サイズが算出される。これによって、被写体像が画面内のどの位置であったとしても、フレームアウトすることなく被写体を適切な画角に収めることができる。また、被写体の数が単数である場合でも複数である場合でも、同じ処理によって基準サイズが算出可能となる。なお、本実施形態では、被写体として立位姿勢の人物を前提に、基準サイズを算出する画面サイズの方向を決定した。これに限らず、被写体検出部123が顔の方向を判定できる場合には、画面上での顔の上下方向に基づいて画面サイズの方向を決定してもよい。さらに、被写体が人物である場合の構図判定や基準サイズの算出例を説明したが、被写体が物体である場合にも適用できる。ただし、この場合には、選択される構図は「顔」、「上半身」、「全身」、「複数人」の代わりに、「大」、「中」、「小」、「複数」とする。それらに応じて被写体位置を算定する場合のモノ追尾枠の個数(人物の場合のNs,Nh,Nbに相当)を設定してもよい。   In S1215 of FIG. 12, when the composition setting is “auto”, the subject position that is the closest to the screen in the horizontal and vertical directions is determined based on the composition determined in S1211, and the reference position is set so that the position fits on the screen. The size is calculated. Thus, regardless of the position of the subject image on the screen, the subject can be set at an appropriate angle of view without going out of the frame. Further, the reference size can be calculated by the same processing regardless of whether the number of subjects is singular or plural. In the present embodiment, the direction of the screen size for calculating the reference size is determined on the assumption that the subject is a person in a standing posture. The present invention is not limited to this, and when the subject detection unit 123 can determine the direction of the face, the direction of the screen size may be determined based on the vertical direction of the face on the screen. Furthermore, the example of composition determination and calculation of the reference size when the subject is a person has been described, but the present invention can also be applied to the case where the subject is an object. However, in this case, the composition to be selected is “large”, “medium”, “small”, and “plural” instead of “face”, “upper body”, “whole body”, and “plurality”. The number of mono tracking frames (corresponding to Ns, Nh, and Nb in the case of a person) when calculating the subject position may be set accordingly.

図12に示す基準サイズ設定処理が終了すると、図7のS704に処理を進める。S704でAZ制御部122は、被写体検出部123により検出された被写体情報やメモリ118に記憶された基準サイズに基づいてオートズーム制御を行う。オートズーム制御については、図20を用いて後述する。オートズーム制御の終了後、S705に進み、AZ制御部122は、撮影者による被写体探索指示を判定する。つまり、撮影者が操作部117の被写体探索ボタンを押下したか否かについて判定される。被写体探索ボタンが押下された場合には、S701に戻り、被写体探索処理が実行される。また、被写体探索ボタンが押下されていない場合には、S706に進む。S706では、操作部117のタッチパネルや被写体指定用スイッチ等の操作によって、オートズームの対象とする被写体が変更されたか否かについて判定される。被写体が変更された場合には、S702に戻って被写体指定処理が実行される。また、被写体が変更されていない場合には、S707に進む。   When the reference size setting process shown in FIG. 12 ends, the process proceeds to S704 in FIG. In step S704, the AZ control unit 122 performs automatic zoom control based on the subject information detected by the subject detection unit 123 and the reference size stored in the memory 118. The automatic zoom control will be described later with reference to FIG. After the end of the auto zoom control, the process proceeds to S705, where the AZ control unit 122 determines a subject search instruction by the photographer. That is, it is determined whether or not the photographer has pressed the subject search button of the operation unit 117. If the subject search button has been pressed, the process returns to S701, and the subject search processing is executed. If the subject search button has not been pressed, the process proceeds to S706. In step S706, it is determined whether the subject to be subjected to the auto-zoom has been changed by operating the touch panel or the subject specifying switch of the operation unit 117. If the subject has been changed, the process returns to S702 and the subject specifying process is executed. If the subject has not been changed, the process proceeds to S707.

S707では、撮影画面から操作部117の左右ボタンの操作によって構図設定が変更されたか否かについて判定される。構図設定が変更された場合には、メモリ118に記憶されている構図設定のデータが更新された後、S703に戻って基準サイズ設定処理が実行される。また、構図設定が変更されていない場合には、S708に進む。S708では、操作部117のオートズーム操作スイッチが押下されたか否かについて判定される。オートズーム操作スイッチが押下されたと判定された場合、オートズーム機能を終了する。また、オートズーム操作スイッチが押下されていないと判定された場合、S709に進む。S709は、メモリ118に記憶されている構図設定が「オート」であるか否かの判定処理である。構図設定が「オート」である場合には、S703に戻って自動構図判定を含む基準サイズの設定処理が実行される。また、構図設定が「オート」以外である場合には、S704に戻ってオートズーム制御が継続する。   In S707, it is determined whether the composition setting has been changed by operating the left and right buttons of the operation unit 117 from the shooting screen. When the composition setting is changed, after the composition setting data stored in the memory 118 is updated, the process returns to S703 to execute the reference size setting processing. If the composition setting has not been changed, the process proceeds to S708. In S708, it is determined whether the auto zoom operation switch of the operation unit 117 has been pressed. If it is determined that the auto zoom operation switch has been pressed, the auto zoom function ends. If it is determined that the auto zoom operation switch has not been pressed, the process proceeds to S709. S709 is a process of determining whether or not the composition setting stored in the memory 118 is “auto”. If the composition setting is “auto”, the process returns to step S703, and the reference size setting processing including automatic composition determination is performed. If the composition setting is other than “auto”, the process returns to step S704 to continue the automatic zoom control.

次に図20のフローチャートを参照して、S704のオートズーム制御の処理について説明する。まず、S2000にてAZ制御部122は、被写体検出部123により被写体が検出されたか否かを判定する。S2000で被写体が検出されなかった場合にはオートズーム制御を終了する。S2000で被写体が検出された場合にはS2001へ進む。S2001からS2003の各ステップに示す判定は、フレームアウト防止制御のためのオートズームの開始判定処理である。すなわち、この処理は、図3及び図4で説明したように、被写体が画面の外にフレームアウトすることを防止するために行われる。S2001でAZ制御部122は、追尾対象とする被写体に係る被写体追尾枠が、ZO領域に進入したか否かを判定する。このZO領域は、図3(A)、図4(A)〜(C)で説明したZO領域に相当する。S2001にて被写体追尾枠がZO領域に進入した場合、すなわち、被写体がフレームアウトする可能性が高い場合、S2004に進み、ズームアウト動作を開始する。ここでのズームアウト動作は、フレームアウト防止制御用のズームアウト動作に相当する。ズームアウト動作の後、オートズーム制御を終了する。   Next, the processing of the auto zoom control in S704 will be described with reference to the flowchart in FIG. First, in S2000, the AZ control unit 122 determines whether or not a subject has been detected by the subject detection unit 123. If no subject is detected in S2000, the automatic zoom control ends. If a subject is detected in S2000, the process proceeds to S2001. The determination shown in each step of S2001 to S2003 is a process of determining the start of auto zoom for frame-out prevention control. That is, this processing is performed to prevent the subject from going out of the frame outside the screen as described with reference to FIGS. In S2001, the AZ control unit 122 determines whether or not the subject tracking frame relating to the subject to be tracked has entered the ZO area. This ZO area corresponds to the ZO area described in FIGS. 3A and 4A to 4C. If the subject tracking frame has entered the ZO area in S2001, that is, if there is a high possibility that the subject will be out of the frame, the process proceeds to S2004, and a zoom-out operation is started. The zoom-out operation here corresponds to a zoom-out operation for frame-out prevention control. After the zoom-out operation, the automatic zoom control ends.

一方、S2001にて被写体追尾枠がZO領域に進入していない場合、すなわち、画面中央付近でカメラが被写体を捉えている場合、S2002に進む。S2002では、直前のズーム動作がS2001でZO領域に進入したことによるズームアウト動作であるか否か、すなわち、フレームアウト防止制御用のズームアウト動作であるか否かが判定される。S2002でフレームアウト防止制御用のズームアウト動作後であると判定された場合、S2003に進む。また、S2002でフレームアウト防止制御用のズームアウト動作後でないと判定された場合、S2006に進む。   On the other hand, if the subject tracking frame has not entered the ZO area in S2001, that is, if the camera is capturing the subject near the center of the screen, the process proceeds to S2002. In S2002, it is determined whether or not the immediately preceding zoom operation is a zoom-out operation due to entry into the ZO region in S2001, that is, whether or not the zoom-out operation is for frame-out prevention control. If it is determined in S2002 that the zoom-out operation for frame-out prevention control has been performed, the process proceeds to S2003. If it is determined in S2002 that the zoom-out operation for frame-out prevention control has not been performed, the process proceeds to S2006.

S2003にてAZ制御部122は、追尾対象とする被写体に係る被写体追尾枠がZI領域の内部に収まっているか否か(包含されているか否か)を判定する。ここでのZI領域は、図3(B)、図4(A)〜(C)で説明したZI領域に相当する。S2003にて被写体追尾枠がZI領域に収まっていないと判定された場合、オートズーム制御処理を終了する。一方、被写体追尾枠がZI領域に収まっていると判定された場合、S2005に進む。すなわち、画面中央付近であって、かつズーム戻り位置の画角内の被写体サイズとなるようにカメラが被写体を捉えている場合、S2005でズームイン動作を開始する。ここでのズームイン動作は、フレームアウト防止制御用のズームイン動作に相当する。ズームイン動作の後、オートズーム制御を終了する。   In S2003, the AZ control unit 122 determines whether or not the subject tracking frame of the subject to be tracked falls within the ZI region (whether or not it is included). The ZI region here corresponds to the ZI region described with reference to FIGS. 3B and 4A to 4C. If it is determined in S2003 that the subject tracking frame does not fall within the ZI region, the auto zoom control process ends. On the other hand, if it is determined that the subject tracking frame falls within the ZI area, the process proceeds to S2005. That is, when the camera is capturing the subject so that the subject size is near the center of the screen and within the angle of view at the zoom return position, the zoom-in operation is started in S2005. The zoom-in operation here corresponds to a zoom-in operation for frame-out prevention control. After the zoom-in operation, the automatic zoom control ends.

本実施形態では、オートズームにおけるフレームアウト防止制御とサイズ保持制御を両立させるために、まずフレームアウト防止制御により被写体を画面中央付近に捉えたうえで、サイズ保持制御を実行できるようにする。そのため、フレームアウト防止制御用のズームアウト動作後の状態では、以降で説明する被写体サイズを一定に維持する(サイズ保持制御の)オートズーム処理(以下のS2006〜S2010)を行わないようにしている。換言すると、フレームアウト防止制御が行われた場合には、フレームアウト防止制御用のズームイン動作が完了するまでサイズ保持制御の実行が制限される。   In the present embodiment, in order to achieve both the frame-out prevention control and the size holding control in the auto-zoom, the subject is first captured near the center of the screen by the frame-out prevention control, and then the size holding control can be executed. For this reason, in the state after the zoom-out operation for the frame-out prevention control, the auto-zoom processing (hereinafter, S2006 to S2010) for maintaining the subject size constant (of size holding control) described below is not performed. . In other words, when the frame-out prevention control is performed, the execution of the size holding control is restricted until the zoom-in operation for the frame-out prevention control is completed.

次に、S2006〜S2010の各処理を説明する。S2002でフレームアウト防止制御用のズームアウト動作後でないと判断された場合、S2006に進み、AZ制御部122は、被写体の検出サイズと、基準サイズに所定倍率(N1と記し、N1>1とする)を乗算したサイズとを比較する。図12のS1202やS1210、S1215で設定される基準被写体情報の被写体サイズと、S2000にて検出された被写体サイズとが比較される。S2000にて検出された被写体のサイズが、基準被写体のサイズに対してN1倍より大きい場合、すなわち被写体像が画面に占める比率が所定値を超える場合、S2009に進む。S2009でAZ制御部122は、ズームアウト動作を開始する。ここでのズームアウト動作は、サイズ保持制御用のズームアウト動作に相当する。ズームアウト動作の後、オートズーム制御を終了する。   Next, each processing of S2006 to S2010 will be described. If it is determined in S2002 that the zoom-out operation has not been performed for the frame-out prevention control, the process proceeds to S2006, in which the AZ control unit 122 sets the subject detection size and the reference size to a predetermined magnification (N1 and N1> 1). ) Is compared with the size. The subject size of the reference subject information set in S1202, S1210, and S1215 of FIG. 12 is compared with the subject size detected in S2000. If the size of the subject detected in S2000 is larger than N1 times the size of the reference subject, that is, if the ratio of the subject image to the screen exceeds a predetermined value, the process proceeds to S2009. In step S2009, the AZ control unit 122 starts a zoom-out operation. The zoom-out operation here corresponds to a zoom-out operation for size holding control. After the zoom-out operation, the automatic zoom control ends.

一方、S2006において、S2000で検出された被写体のサイズが、基準被写体のサイズに対してN1倍以下である場合、S2007に進む。S2007でAZ制御部122は、基準被写体情報の被写体サイズと、S2000にて検出された被写体のサイズとを比較する。検出された被写体のサイズが、基準被写体のサイズに対して所定倍率(N2と記し、N2<1とする)より小さい場合(N2倍未満の場合)、すなわち被写体像が画面に占める比率が所定値未満である場合、S2008に進む。一方、検出された被写体のサイズが、基準被写体のサイズに対してN2倍以上である場合、オートズーム制御を終了する。   On the other hand, in S2006, if the size of the subject detected in S2000 is smaller than or equal to N1 times the size of the reference subject, the process proceeds to S2007. In S2007, the AZ control unit 122 compares the subject size of the reference subject information with the size of the subject detected in S2000. When the detected size of the subject is smaller than a predetermined magnification (described as N2 and N2 <1) with respect to the size of the reference subject (less than N2 times), that is, the ratio of the subject image to the screen is a predetermined value. If it is less, the process proceeds to S2008. On the other hand, if the detected size of the subject is equal to or more than N2 times the size of the reference subject, the automatic zoom control ends.

S2008にてAZ制御部122は、追尾対象とする被写体に係る被写体追尾枠がZI領域の内部に収まっているか否か(包含されているか否か)を判定する。これは、被写体が画面の周辺にいる場合にズームイン動作によってフレームアウトしてしまうことを防ぐためである。ここでのZI領域は、図5(E)で説明したZI領域に相当する。S2008で被写体追尾枠がZI領域に収まっていないと判定された場合、オートズーム制御を終了する。   In S2008, the AZ control unit 122 determines whether or not the subject tracking frame of the subject to be tracked falls within the ZI region (whether or not it is included). This is to prevent the subject from being framed out by the zoom-in operation when the subject is around the screen. The ZI region here corresponds to the ZI region described with reference to FIG. If it is determined in S2008 that the subject tracking frame does not fall within the ZI area, the auto zoom control ends.

一方、S2008で被写体追尾枠がZI領域に収まっていると判定された場合、S2010に進む。S2010にてAZ制御部122は、ズームイン動作を開始する。ここでのズームイン動作は、サイズ保持制御用のズームイン動作に相当する。このように、本実施形態では、サイズ保持制御用のズームイン動作においても被写体のフレームアウトを防ぐために、被写体像がZI領域の内部に収まってからズームイン動作を開始する。ズームイン動作の後、オートズーム制御を終了する。   On the other hand, if it is determined in step S2008 that the subject tracking frame is within the ZI region, the process advances to step S2010. In S2010, the AZ control unit 122 starts the zoom-in operation. The zoom-in operation here corresponds to a zoom-in operation for size holding control. As described above, in the present embodiment, in order to prevent the subject from going out of the frame even in the zoom-in operation for the size holding control, the zoom-in operation is started after the subject image falls within the ZI area. After the zoom-in operation, the automatic zoom control ends.

次に、図21を参照してズーム動作について説明する。図21は、図20のS2004、S2005、S2009、S2010でのズームアウト動作またはズームイン動作を説明するフローチャートである。まずS2100において、AZ制御部122は、メモリ118からズーム変化量(ズーム倍率の変化量)を取得する。フレームアウト防止制御用のズームアウト動作の場合、ズームアウト変化量は検出された被写体情報に応じて設定される。具体的には、フレームアウト防止制御用のズームアウト動作(図20のS2004)では、被写体のサイズが小さいほどズームアウト変化量が小さく設定される。それにより、ズームアウト動作によって被写体のサイズが小さくなりすぎるために被写体が検出できなくなるのを防ぐことができる。なお、被写体検出可能な最小サイズを考慮して、被写体のサイズが所定のサイズより小さい場合は、ズームアウト動作を行わないようにしてもよい。また、フレームアウト防止制御用のズームイン動作では、ズームアウト動作の開始前のズーム倍率がメモリ118に記憶され、ズームアウト動作の開始前と同じズーム倍率となるようにズームイン変化量が設定される。   Next, the zoom operation will be described with reference to FIG. FIG. 21 is a flowchart illustrating the zoom-out operation or the zoom-in operation in S2004, S2005, S2009, and S2010 of FIG. First, in step S2100, the AZ control unit 122 acquires a zoom change amount (zoom magnification change amount) from the memory 118. In the case of a zoom-out operation for frame-out prevention control, the zoom-out change amount is set according to the detected subject information. Specifically, in the zoom-out operation for frame-out prevention control (S2004 in FIG. 20), the smaller the size of the subject, the smaller the zoom-out change amount is set. Thus, it is possible to prevent the subject from being undetectable because the size of the subject becomes too small due to the zoom-out operation. If the size of the subject is smaller than the predetermined size in consideration of the minimum size in which the subject can be detected, the zoom-out operation may not be performed. In the zoom-in operation for frame-out prevention control, the zoom magnification before the start of the zoom-out operation is stored in the memory 118, and the zoom-in change amount is set so as to be the same zoom magnification as before the start of the zoom-out operation.

また、サイズ保持制御用のズームアウト動作(図20のS2009)においては、S2006の判定に用いる所定のN1倍に対応するズームアウト変化量(1/N1倍)が設定される。それにより、被写体が検出できない場合でも、被写体のサイズが基準被写体のサイズとなるまでの最低限のズームアウト動作を行うことができる。サイズ保持制御用のズームイン動作(図20のS2010)の場合にも同様に、S2007の判定に用いる所定のN2倍に対応するズームイン変化量(1/N2倍)が設定される。   In the zoom-out operation for size holding control (S2009 in FIG. 20), a zoom-out change amount (1 / N1 times) corresponding to a predetermined N1 times used in the determination in S2006 is set. Thereby, even when the subject cannot be detected, it is possible to perform the minimum zoom-out operation until the size of the subject becomes the size of the reference subject. Similarly, in the case of the zoom-in operation for size holding control (S2010 in FIG. 20), the zoom-in change amount (1 / N2 times) corresponding to the predetermined N2 times used for the determination in S2007 is set.

S2101でAZ制御部122は、S2100にて取得したズーム変化量をCZ制御部119または電子ズーム制御部120に設定し、変倍処理を行うように指示する。次のS2102でAZ制御部122は、フレームアウト防止制御用とサイズ保持制御用のうちの、いずれのズーム動作中であるかを判定する。現時点でのズーム動作がフレームアウト防止制御用のズーム動作である場合(図20のS2004、S2005)にはS2105に進む。また、現時点でのズーム動作がサイズ保持制御用のズーム動作である場合(図20のS2009、S2010)にはS2103に進む。   In step S2101, the AZ control unit 122 sets the zoom change amount acquired in step S2100 in the CZ control unit 119 or the electronic zoom control unit 120, and instructs the zoom control unit 120 to perform a scaling process. In the next step S2102, the AZ control unit 122 determines which zoom operation is being performed, either for frame-out prevention control or for size holding control. If the current zoom operation is a frame-out prevention control zoom operation (S2004, S2005 in FIG. 20), the process proceeds to S2105. If the current zoom operation is a zoom operation for size holding control (S2009, S2010 in FIG. 20), the process proceeds to S2103.

S2103でAZ制御部122は、被写体検出部123によって被写体が検出されているか否かを判定する。被写体が検出されている場合にはS2104に進み、被写体が検出されていない場合にはS2105に進む。S2104では、基準被写体情報の示す被写体のサイズと、S2103で検出された被写体のサイズとが比較される。比較の結果、S2103にて検出された被写体のサイズと、基準被写体のサイズとが所定比率の範囲内(所定の変化量以内)に収まらない場合には、再度S2102に進み、ズーム動作の判定を継続する。ズーム動作によって、S2103にて検出された被写体のサイズと、基準被写体のサイズとが、所定比率の範囲内となった場合には、S2106に進む。S2106でAZ制御部122はズーム動作を停止した後、ズーム動作処理を終了する。   In step S2103, the AZ control unit 122 determines whether the subject is detected by the subject detection unit 123. If the subject has been detected, the process proceeds to S2104, and if the subject has not been detected, the process proceeds to S2105. In S2104, the size of the subject indicated by the reference subject information is compared with the size of the subject detected in S2103. As a result of the comparison, if the size of the subject detected in S2103 and the size of the reference subject do not fall within the range of a predetermined ratio (within a predetermined change amount), the process proceeds to S2102 again to determine the zoom operation. continue. If the size of the subject detected in S2103 and the size of the reference subject are within the range of the predetermined ratio by the zoom operation, the process proceeds to S2106. After stopping the zoom operation in S2106, the AZ control unit 122 ends the zoom operation processing.

S2102にて、フレームアウト防止制御用のズーム動作中と判定された場合、または、サイズ保持制御用のズーム動作中でS2103にて被写体が検出されない場合にはS2105に進む。S2105にてAZ制御部122は、S2100で取得したズーム変化量に基づき、各ズーム動作に応じた所定量分のズーム変化量に相当する変倍処理を行ったか否かを判定する。所定のズーム変化量の変倍処理が行われていない場合には、再度S2102に戻って処理を継続する。また所定のズーム変化量の変倍処理が行われた場合には、S2106に進み、AZ制御部122は動作中のズームを停止してズーム動作処理を終了する。   If it is determined in step S2102 that a zoom operation for frame-out prevention control is being performed, or if a subject is not detected in step S2103 during a zoom operation for controlling size retention, the process advances to step S2105. In step S2105, the AZ control unit 122 determines based on the zoom change amount acquired in step S2100 whether or not a scaling process corresponding to a predetermined amount of zoom change according to each zoom operation has been performed. If the zoom process for the predetermined zoom change amount has not been performed, the process returns to step S2102 to continue the process. If the zoom process of the predetermined zoom change amount has been performed, the process proceeds to S2106, where the AZ control unit 122 stops the zoom in operation and ends the zoom operation process.

本実施形態では、被写体の動きや数、被写体の検出時間、カメラから被写体までの距離等によって撮影シーンを判別し、判別されたシーンに応じて適切な構図をカメラが自動で選択する。構図選択処理により選択された構図に基づき、被写体像の基準サイズを設定する処理が行われて、検出した被写体の画像が基準サイズとなるようにズーム動作が実行される。本実施形態によれば、撮影者が構図を選択することなく、カメラの検出情報に基づいて判定した撮影シーンに応じて適切な構図となるようにオートズーム制御を行うことができる。   In the present embodiment, the shooting scene is determined based on the movement and the number of the subjects, the detection time of the subject, the distance from the camera to the subject, and the like, and the camera automatically selects an appropriate composition according to the determined scene. Based on the composition selected by the composition selection processing, processing for setting the reference size of the subject image is performed, and the zoom operation is performed so that the detected image of the subject has the reference size. According to the present embodiment, it is possible to perform auto zoom control so that an appropriate composition is obtained according to a shooting scene determined based on camera detection information without a photographer selecting a composition.

(第2の実施形態)
次に、図22を参照して本発明の第2の実施形態について説明する。図22は、図12の構図設定「オート」の自動構図判定処理S1211において、図14とは別の構図の遷移図の例を示している。なお、図14と共通する構図は同一の符号を付し、その詳細な説明は省略する。
(Second embodiment)
Next, a second embodiment of the present invention will be described with reference to FIG. FIG. 22 shows an example of a transition diagram of a composition different from that in FIG. 14 in the automatic composition determination processing S1211 of the composition setting “auto” in FIG. Note that the same components as those in FIG. 14 are denoted by the same reference numerals, and detailed description thereof will be omitted.

第1の実施形態においては、撮影者とは異なる人物を被写体として撮影する場合に、撮影シーンを判別する例について説明した。このときのモードを便宜的に通常モードと呼ぶ。また、カメラを撮影者自身に向けて、撮影者自身を含めた一人乃至複数の人物を被写体として撮影する場合がある。このような撮影に適したモードを自分撮りモードと呼ぶ。自分撮りモードでは、オートズーム制御によって自分撮りに適した画角に調整するとともに、背景ぼかし効果や美肌フィルタ効果などを適用させることで効果的な人物撮影を行うことが可能である。
構図合わせの操作においては、通常モード時には、被写体が静止しているか、動いているかに応じて被写体像を適切な大きさとすることが必要である。一方、自分撮りモード時には、静止している被写体であっても、カメラを手持ちで撮影しているか、置いて撮影しているかによって適切な大きさを変更する必要がある。例えば、手持ちで撮影する場合には顔を画角に大きく収めるように撮影し、カメラを置いて撮影する場合には全身を画角に収めるように撮影する。このように、通常モードでの撮影と自分撮りモードでの撮影ではそれぞれに適切な構図が異なる。
そこで、本実施形態では、図22の通常モード2200と自分撮りモード2201とで、選択する構図を変更する処理が実行される。すなわち、第1のモードとして通常モードを例示し、第2のモードとして自分撮りモードを例示する。通常モード2200での第1の構図群に属する選択候補の構図として、上半身1400、全身1401、複数人1403からいずれかの構図が選択される。自分撮りモード2201での第2の構図群に属する選択候補の構図としては、自分撮り顔2202、自分撮り全身2203からいずれかの構図が選択される。
In the first embodiment, an example has been described in which a photographing scene is determined when a person different from the photographer is photographed as a subject. The mode at this time is called a normal mode for convenience. In some cases, the camera is pointed at the photographer himself, and one or more persons including the photographer himself are photographed as subjects. A mode suitable for such shooting is called a self-portrait mode. In the self-portrait mode, it is possible to perform effective portrait photographing by adjusting the angle of view suitable for self-portrait by auto zoom control and applying a background blurring effect, a beautiful skin filter effect, and the like.
In the composition adjustment operation, in the normal mode, it is necessary to set the subject image to an appropriate size depending on whether the subject is stationary or moving. On the other hand, in the self-portrait mode, even if the subject is stationary, it is necessary to change an appropriate size depending on whether the camera is hand-held or placed and photographed. For example, when taking a picture by hand, the face is photographed so as to be large in the angle of view, and when photographing with the camera placed, the whole body is photographed so as to be within the angle of view. As described above, the appropriate composition differs between the shooting in the normal mode and the shooting in the self-portrait mode.
Therefore, in the present embodiment, a process of changing the composition to be selected is performed between the normal mode 2200 and the self-portrait mode 2201 in FIG. That is, the normal mode is illustrated as the first mode, and the self-portrait mode is illustrated as the second mode. As the composition of the selection candidate belonging to the first composition group in the normal mode 2200, any composition is selected from the upper body 1400, the whole body 1401, and the plurality 1403. As the composition of the selection candidate belonging to the second composition group in the self-portrait mode 2201, any composition from the self-portrait face 2202 and the self-portrait whole body 2203 is selected.

ここで、撮影シーンの判定条件と、各構図の遷移について説明する。構図設定「オート」の自動構図判定処理S1211が開始すると、初期状態の構図として上半身1400が設定される。モードが通常モード2200の場合には、図14の静止画フレーミング中1405と同じ遷移であるため、説明を省略する。
モードが通常モード2200から自分撮りモード2201に変更されると、揺れ検出部125は、ジャイロセンサ等に加わる振れ量を元にカメラが手持ち状態であるかどうかを判定する。自分撮りモード2201に変更され、かつ、振れ量が所定量以上でカメラが手持ちであると判定された場合には、構図を自分撮り顔2202に変更する。自分撮り顔2202の構図は、手持ちで自分の顔をアップにして撮影する場合の構図である。また、撮影者を含めた複数人で撮影する場合にも、全ての被写体の顔ができるだけ大きく画角に収まるようにズームを調整する。
Here, the determination conditions of the shooting scene and the transition of each composition will be described. When the automatic composition determination process S1211 of the composition setting “auto” starts, the upper body 1400 is set as the composition in the initial state. When the mode is the normal mode 2200, the transition is the same as during the still image framing 1405 in FIG. 14, and the description is omitted.
When the mode is changed from the normal mode 2200 to the self-portrait mode 2201, the shake detecting unit 125 determines whether or not the camera is in a hand-held state based on the shake amount applied to the gyro sensor or the like. When the mode is changed to the self-portrait mode 2201 and the shake amount is equal to or more than the predetermined amount and it is determined that the camera is hand-held, the composition is changed to the self-portrait face 2202. The composition of the self-portrait face 2202 is a composition in a case where the user takes a picture with his / her face up by hand. Also, when photographing by a plurality of persons including the photographer, the zoom is adjusted so that the faces of all the subjects are included in the angle of view as large as possible.

自分撮りモード2201の場合には、被写体が撮影者のみであっても複数人であっても同じ構図が選択される。すなわち、図19で示す被写体位置推定顔個数を同じ値に設定する。被写体位置推定顔個数とは、前述のように図12の構図設定「オート」の基準サイズ算出処理S1215において、被写体の肩位置Xs、頭位置Yh、身体位置Ybを推定するための顔追尾枠の中心位置からの追尾枠の数(Ns、Nh、Nb)である。特に、肩位置まで追尾枠数Nsと、身体位置までの追尾枠数Nbが選択される構図によって異なることで、当該構図となるような基準サイズが算出される。第1の実施形態では、一人の被写体を「顔」の構図で撮影する場合、顔追尾枠の中心位置(Xc,Yc)からの追尾枠の数を肩位置Ns=1、身体位置Nb=1.5として、被写体の耳や胸付近までを画角に収める範囲とする基準サイズを算出した。また、複数の被写体を「複数人」の構図で撮影する場合、顔追尾枠の中心位置(Xc,Yc)からの追尾枠の数を肩位置Ns=2、身体位置Nb=3.5として、全ての被写体の肩や腰付近までを画角に収める範囲とする基準サイズを算出した。一方、自分撮り顔2202の場合には、被写体の数によらず「顔」と同じ追尾枠数である肩位置Ns=1、身体位置Nb=1.5が設定される。これによって、全ての被写体の耳や胸付近までを画角に収める範囲とする基準サイズが算出され、手持ちでの自分撮り撮影を行うのに適した画角にズームが調整される。   In the case of the self-portrait mode 2201, the same composition is selected whether the subject is a photographer or a plurality of subjects. That is, the number of estimated subject position faces shown in FIG. 19 is set to the same value. As described above, the number of subject position estimated faces is a face tracking frame for estimating a shoulder position Xs, a head position Yh, and a body position Yb in the reference size calculation processing S1215 of the composition setting “auto” in FIG. The number of tracking frames from the center position (Ns, Nh, Nb). In particular, since the number Ns of tracking frames up to the shoulder position and the number Nb of tracking frames up to the body position are different depending on the selected composition, the reference size for the composition is calculated. In the first embodiment, when one subject is photographed in the “face” composition, the number of tracking frames from the center position (Xc, Yc) of the face tracking frame is determined by the shoulder position Ns = 1 and the body position Nb = 1. As a reference size, a reference size was calculated to be a range within the angle of view including the vicinity of the ear and chest of the subject. Further, when photographing a plurality of subjects with a composition of “multiple persons”, the number of tracking frames from the center position (Xc, Yc) of the face tracking frame is set as shoulder position Ns = 2 and body position Nb = 3.5. The reference size was calculated so that the angle of view included the vicinity of the shoulders and hips of all the subjects within the angle of view. On the other hand, in the case of the self-portrait face 2202, the shoulder position Ns = 1 and the body position Nb = 1.5, which are the same number of tracking frames as “face”, are set regardless of the number of subjects. As a result, the reference size is calculated so that the angle of view covers the ears and chests of all the subjects within the angle of view, and the zoom is adjusted to an angle of view suitable for hand-held self-portrait shooting.

自分撮り顔2202に変更されると、検出された被写体の数がメモリ118に記憶される。自分撮り顔2202の構図の状態では、検出された被写体の数が変化したか否かの判定処理が行われる。検出された被写体の数が増加した場合には、即座にメモリ118に記憶した被写体の数が更新されて、基準サイズの変更が行われる。被写体の数が減少した場合には、当該状態が所定時間以上継続した場合、メモリ118に記憶される被写体の数が更新され、構図が変更される。これは、複数人1403の場合と同様に被写体が横を向くなどして一時的に検出できない場合に、即座に構図を変更することで被写体がフレームアウトしてしまうことを防止するためである。   When the face is changed to the self-portrait face 2202, the number of detected subjects is stored in the memory 118. In the composition state of the self-portrait face 2202, a process of determining whether or not the number of detected subjects has changed is performed. When the number of detected subjects increases, the number of subjects stored in the memory 118 is immediately updated, and the reference size is changed. When the number of subjects decreases, when the state continues for a predetermined time or more, the number of subjects stored in the memory 118 is updated, and the composition is changed. This is to prevent the subject from going out of the frame by immediately changing the composition when the subject is temporarily undetectable due to turning sideways as in the case of the plurality of persons 1403.

モードが通常モード2200から自分撮りモード2201に変更されると、揺れ検出部125は、ジャイロセンサ等に加わる振れ量を元に、カメラが机の上などに置かれている(固定されている)状態であるかどうかを判定する。自分撮りモード2201に変更され、かつ、振れ量が所定量未満でカメラが置かれていると判定された場合には、構図を自分撮り全身2203に変更する。自分撮り全身2203の構図は、カメラを置いて自分の全身を撮影する場合の構図である。また、撮影者を含めた複数人を撮影する場合には、全ての被写体の全身が画角に収まるようにズームを調整する。自分撮り全身2203の場合には、被写体の数によらず「全身」と同じ追尾枠数である肩位置Ns=2、身体位置Nb=10が設定される。これによって、全ての被写体の肩や足までが画角に収める範囲とする基準サイズが算出され、カメラを置いた状態での自分撮り撮影を行うのに適した画角にズームが調整される。自分撮り全身2203に変更されると、検出された被写体の数がメモリ118に記憶される。自分撮り全身2203においても自分撮り顔2202と同様に、被写体の数が変化すると、メモリ118に記憶される被写体の数が更新され、基準サイズが変更される。   When the mode is changed from the normal mode 2200 to the self-portrait mode 2201, the shake detection unit 125 sets the camera on a desk or the like (fixed) based on the shake amount applied to the gyro sensor or the like. It is determined whether or not it is in the state. If the mode is changed to the self-portrait mode 2201 and it is determined that the shake amount is less than the predetermined amount and the camera is placed, the composition is changed to the self-portrait whole body 2203. The composition of the self-portrait whole body 2203 is a composition in a case where a camera is put and the whole body is photographed. Further, when photographing a plurality of persons including the photographer, the zoom is adjusted so that the whole body of all subjects falls within the angle of view. In the case of the self-portrait whole body 2203, the shoulder position Ns = 2 and the body position Nb = 10, which are the same number of tracking frames as “whole body”, are set regardless of the number of subjects. As a result, the reference size is calculated so that the shoulders and feet of all subjects fall within the angle of view, and the zoom is adjusted to an angle of view suitable for performing self-portrait shooting with the camera placed. When the self-portrait whole body 2203 is changed, the number of detected subjects is stored in the memory 118. As in self-portrait face 2202, when the number of subjects changes in self-portrait whole body 2203, the number of subjects stored in memory 118 is updated and the reference size is changed.

本実施形態では、設定されたモードに応じて判別する撮影シーンを変更し、モードごとにより適切な構図をカメラが自動で選択する。また、本実施形態では1つのモードで複数の構図の選択候補から適切な構図を選択する場合について例示したが、モードによっては1つの構図だけが選択候補であってもよい。さらに、モードとして通常モードと自分撮りモードの場合について例示したが、このモードに限らない。例えば、通常モードと自分撮りモードの他に、スポーツモードでは競技者の「全身」の構図が選択される実施形態や、ベビーモードでは赤ちゃんの「顔」の構図が選択される実施形態などであってもよい。
本実施形態によれば、撮影者が構図を選択することなく、設定されたモードとカメラの検出情報に基づいて判定した撮影シーンに応じて適切な構図となるようにオートズーム制御を行うことができる。
In the present embodiment, the shooting scene to be determined is changed according to the set mode, and the camera automatically selects a more appropriate composition for each mode. Further, in the present embodiment, an example has been described in which an appropriate composition is selected from a plurality of composition selection candidates in one mode. However, depending on the mode, only one composition may be a selection candidate. Furthermore, the case of the normal mode and the self-portrait mode has been described as an example, but the mode is not limited to this mode. For example, in addition to the normal mode and the self-portrait mode, an embodiment in which the composition of the athlete's "whole body" is selected in the sports mode, and an embodiment in which the composition of the "face" of the baby is selected in the baby mode. You may.
According to the present embodiment, it is possible to perform auto zoom control so that a photographer can select an appropriate composition according to a set mode and a shooting scene determined based on camera detection information without selecting a composition. it can.

(その他の実施形態)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program for realizing one or more functions of the above-described embodiments to a system or an apparatus via a network or a storage medium, and one or more processors in a computer of the system or the apparatus read and execute the program. This processing can be realized. Further, it can also be realized by a circuit (for example, an ASIC) that realizes one or more functions.

100 デジタルカメラ
102 ズームレンズ
109 表示部
113 ズームレンズ駆動部
117 操作部
118 メモリ
119 CZ制御部
120 電子ズーム制御部
122 オートズーム制御部
123 被写体検出部
100 digital camera
102 zoom lens 109 display unit 113 zoom lens drive unit 117 operation unit 118 memory 119 CZ control unit 120 electronic zoom control unit 122 auto zoom control unit 123 subject detection unit

Claims (13)

ズーム制御装置であって、
撮影光学系を用いて取得された画像から被写体像を検出する被写体検出手段と、
ズーム倍率の制御に用いる被写体像の基準サイズを設定する設定手段と、
前記設定手段により設定された前記基準サイズと前記被写体検出手段により逐次検出される被写体像のサイズに基づいて、ズーム倍率を制御する制御手段と、を有し、
前記設定手段は、前記ズーム制御装置が手持ち状態であるか否か、自分撮りモードが設定されているか否か、被写体までの距離、前記被写体の静止時間の少なくともいずれかに基づいて前記基準サイズを変更することを特徴とするズーム制御装置。
A zoom control device,
Subject detection means for detecting a subject image from an image obtained by using the imaging optical system,
Setting means for setting a reference size of the subject image used for controlling the zoom magnification;
Control means for controlling a zoom magnification based on the reference size set by the setting means and the size of the subject image sequentially detected by the subject detection means,
The setting unit is configured to determine whether the zoom control device is in a hand-held state, whether a self-portrait mode is set, a distance to a subject, or at least one of a time during which the subject is at rest, to set the reference size. A zoom control device characterized by changing.
前記設定手段は、前記被写体像のサイズの変化と前記被写体像の位置の変化と前記ズーム制御装置の振れの検出結果との少なくともいずれかに基づいて前記静止時間を取得することを特徴とする請求項1に記載のズーム制御装置。   The apparatus according to claim 1, wherein the setting unit acquires the still time based on at least one of a change in the size of the subject image, a change in the position of the subject image, and a shake detection result of the zoom control device. Item 2. The zoom control device according to item 1. 前記設定手段は、前記ズーム制御装置の振れ量の検出結果に基づいて前記ズーム制御装置が手持ちであるか否かを判定し、前記判定の結果に基づいて前記基準サイズを変更することを特徴とする請求項1または2に記載のズーム制御装置。   The setting unit determines whether or not the zoom control device is hand-held based on a detection result of a shake amount of the zoom control device, and changes the reference size based on a result of the determination. The zoom control device according to claim 1. 前記設定手段は、前記撮影光学系のフォーカス位置と前記ズーム倍率とに基づいて前記ズーム制御装置と前記被写体との距離を取得し、前記距離に基づいて前記基準サイズを変更することを特徴とする請求項1乃至3のいずれか1項に記載のズーム制御装置。   The setting unit acquires a distance between the zoom control device and the subject based on a focus position of the photographing optical system and the zoom magnification, and changes the reference size based on the distance. The zoom control device according to claim 1. 前記設定手段は、前記自分撮りモードが設定されているか否かに応じて前記基準サイズを変更することを特徴とする請求項1乃至4のいずれか1項に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the setting unit changes the reference size according to whether the self-portrait mode is set. 前記ズーム制御装置が手持ち状態であるか否か、自分撮りモードが設定されているか否か、被写体までの距離、前記被写体の静止時間の少なくともいずれかに基づいて構図を選択する構図選択手段を有し、
前記設定手段は、前記構図選択手段による選択結果に基づいて前記基準サイズを変更することを特徴とする請求項1乃至5のいずれか1項に記載のズーム制御装置。
Composition selecting means for selecting a composition based on at least one of whether the zoom control device is in a hand-held state, whether a self-portrait mode is set, a distance to a subject, and a still time of the subject. And
The zoom control device according to claim 1, wherein the setting unit changes the reference size based on a result of the selection by the composition selecting unit.
前記構図選択手段は、前記被写体検出手段によって検出された被写体像の数に基づいて前記構図を選択する請求項6に記載のズーム制御装置。   The zoom control device according to claim 6, wherein the composition selecting unit selects the composition based on the number of subject images detected by the subject detecting unit. 前記設定手段は、前記構図選択手段によって検出された構図と、前記被写体検出手段によって検出された被写体像の大きさと位置とに基づいて前記基準サイズを設定することを特徴とする請求項6又は7に記載のズーム制御装置。   8. The apparatus according to claim 6, wherein the setting unit sets the reference size based on a composition detected by the composition selection unit and a size and a position of a subject image detected by the subject detection unit. The zoom control device according to item 1. 前記設定手段は、
前記静止時間の変更に基づいて前記基準サイズを変更し、
前記被写体が動いていると判定された場合は、第1の基準サイズを設定し、
前記静止時間が所定の時間よりも長いと判定された場合は、前記第1の基準サイズよりも大きい第2の基準サイズを設定することを特徴とする請求項1乃至8のいずれか1項に記載のズーム制御装置。
The setting means,
Changing the reference size based on the change in the stationary time,
If it is determined that the subject is moving, a first reference size is set,
9. The method according to claim 1, wherein when it is determined that the stationary time is longer than a predetermined time, a second reference size larger than the first reference size is set. The zoom control device according to any one of the preceding claims.
前記設定手段は、前記静止時間の変更に基づいて前記基準サイズを変更し、
前記制御手段は、前記被写体が動いていると判定された場合のほうが、前記静止時間が所定の時間よりも長いと判定された場合よりもズーム倍率が低くなるように前記ズーム倍率を制御することを特徴とする請求項1乃至9のいずれか1項に記載のズーム制御装置。
The setting means changes the reference size based on the change in the stationary time,
The control means controls the zoom magnification such that the zoom magnification is lower when it is determined that the subject is moving than when the stationary time is longer than a predetermined time. The zoom control device according to claim 1, wherein:
請求項1から10のいずれか1項に記載のズーム制御装置と、
被写体像を光電変換して画像を生成する撮像手段と、
レンズの駆動または画像処理によりズーム倍率を変更するズーム手段を備え、
前記制御手段は前記ズーム手段を制御し、前記設定手段により設定された前記基準サイズに基づいて、前記被写体検出手段により検出される被写体像のサイズの変化に応じてズーム倍率を制御することを特徴とする撮像装置。
A zoom control device according to any one of claims 1 to 10,
Imaging means for photoelectrically converting a subject image to generate an image;
A zoom unit for changing a zoom magnification by driving a lens or image processing;
The control unit controls the zoom unit, and controls a zoom magnification according to a change in size of a subject image detected by the subject detection unit based on the reference size set by the setting unit. Imaging device.
ズーム制御装置にて実行される制御方法であって、
撮影光学系を用いて取得された画像から検出された被写体像の検出情報を含む情報を取得する取得ステップと、
ズーム倍率の制御に用いる被写体像の基準サイズを設定する設定ステップと、
前記設定ステップにより設定された前記基準サイズと前記検出情報が示す被写体像のサイズに基づいて、ズーム倍率を制御する制御ステップと、を有し、
前記設定ステップは、前記ズーム制御装置が手持ち状態であるか否か、自分撮りモードが設定されているか否か、被写体までの距離、前記被写体の静止時間の少なくともいずれかに基づいて前記基準サイズを変更することを特徴とするズーム制御装置の制御方法。
A control method executed by a zoom control device,
An acquisition step of acquiring information including detection information of a subject image detected from an image acquired using the imaging optical system,
A setting step of setting a reference size of a subject image used for controlling a zoom magnification;
A control step of controlling a zoom magnification based on the size of the subject image indicated by the reference size and the detection information set by the setting step,
The setting step determines whether or not the zoom control device is in a hand-held state, whether or not a self-portrait mode is set, a distance to a subject, and at least one of a time during which the subject is at rest and the reference size. A control method of a zoom control device, wherein the control method is changed.
請求項12に記載したズーム制御装置の制御方法の各ステップをコンピュータに実行させることを特徴とするズーム制御装置の制御プログラム。   A control program for a zoom control device, which causes a computer to execute each step of the control method for a zoom control device according to claim 12.
JP2019206451A 2014-12-24 2019-11-14 Zoom control device, imaging device, control method of zoom control device, control program of zoom control device Active JP6839254B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2014260109 2014-12-24
JP2014260109 2014-12-24

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2015202330A Division JP6618324B2 (en) 2014-12-24 2015-10-13 Zoom control device, imaging device, control method for zoom control device, control program for zoom control device, and storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2021020239A Division JP7073550B2 (en) 2014-12-24 2021-02-10 Zoom control device, image pickup device, control method of zoom control device, control program of zoom control device

Publications (2)

Publication Number Publication Date
JP2020039165A true JP2020039165A (en) 2020-03-12
JP6839254B2 JP6839254B2 (en) 2021-03-03

Family

ID=56329224

Family Applications (3)

Application Number Title Priority Date Filing Date
JP2015202330A Active JP6618324B2 (en) 2014-12-24 2015-10-13 Zoom control device, imaging device, control method for zoom control device, control program for zoom control device, and storage medium
JP2019206451A Active JP6839254B2 (en) 2014-12-24 2019-11-14 Zoom control device, imaging device, control method of zoom control device, control program of zoom control device
JP2021020239A Active JP7073550B2 (en) 2014-12-24 2021-02-10 Zoom control device, image pickup device, control method of zoom control device, control program of zoom control device

Family Applications Before (1)

Application Number Title Priority Date Filing Date
JP2015202330A Active JP6618324B2 (en) 2014-12-24 2015-10-13 Zoom control device, imaging device, control method for zoom control device, control program for zoom control device, and storage medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
JP2021020239A Active JP7073550B2 (en) 2014-12-24 2021-02-10 Zoom control device, image pickup device, control method of zoom control device, control program of zoom control device

Country Status (1)

Country Link
JP (3) JP6618324B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7374739B2 (en) 2019-11-29 2023-11-07 キヤノン株式会社 Display control device and its control method
CN113079312A (en) * 2020-01-06 2021-07-06 北京小米移动软件有限公司 Method and device for adjusting focal length of camera, electronic equipment and storage medium
KR20210096795A (en) * 2020-01-29 2021-08-06 삼성전자주식회사 Method of automatically photographing an image, image processing device and image photographing system performing the same
CN117597433A (en) 2021-04-30 2024-02-23 国立研究开发法人理化学研究所 Strip-shaped aggregate of retinal pigment epithelial cells, device and method for producing the same, and therapeutic agent containing the same
CA3234671A1 (en) 2021-09-30 2023-04-06 Sumitomo Chemical Company, Limited Method for producing cell mass including pituitary tissue and cell mass
CN116074623B (en) * 2022-05-30 2023-11-28 荣耀终端有限公司 Resolution selecting method and device for camera

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008252711A (en) * 2007-03-30 2008-10-16 Nikon Corp Digital camera
JP2009290635A (en) * 2008-05-30 2009-12-10 Nikon Corp Camera
JP2012039591A (en) * 2010-07-15 2012-02-23 Olympus Corp Imaging apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5225317B2 (en) 2010-04-06 2013-07-03 キヤノン株式会社 IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP2013117650A (en) 2011-12-05 2013-06-13 Nikon Corp Digital camera
JP6331244B2 (en) 2012-06-05 2018-05-30 ソニー株式会社 Image pickup apparatus, image pickup apparatus control method, and computer program.
JP6224925B2 (en) 2013-04-25 2017-11-01 キヤノン株式会社 Control device and angle of view control method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008252711A (en) * 2007-03-30 2008-10-16 Nikon Corp Digital camera
JP2009290635A (en) * 2008-05-30 2009-12-10 Nikon Corp Camera
JP2012039591A (en) * 2010-07-15 2012-02-23 Olympus Corp Imaging apparatus

Also Published As

Publication number Publication date
JP2016123071A (en) 2016-07-07
JP7073550B2 (en) 2022-05-23
JP6839254B2 (en) 2021-03-03
JP6618324B2 (en) 2019-12-11
JP2021078154A (en) 2021-05-20

Similar Documents

Publication Publication Date Title
JP6436760B2 (en) Zoom control device, imaging device, control method for zoom control device, and control program for zoom control device
JP6618255B2 (en) Zoom control device, imaging device, control method for zoom control device, control program for zoom control device, and storage medium
CN110536069B (en) Zoom control device, control method of zoom control device, and recording medium
JP7073550B2 (en) Zoom control device, image pickup device, control method of zoom control device, control program of zoom control device
JP6735583B2 (en) Zoom control device, imaging device and control method thereof, program, and storage medium
JP6296801B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND IMAGING DEVICE CONTROL PROGRAM
JP6512897B2 (en) Zoom control device, control method of zoom control device
JP6429454B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND IMAGING DEVICE CONTROL PROGRAM
US10419683B2 (en) Zoom control device, imaging apparatus, control method of zoom control device, and recording medium
JP6366395B2 (en) Zoom control device, imaging device, control method for zoom control device, control program for subject detection device, and storage medium
JP6370140B2 (en) Zoom control device, imaging device, control method for zoom control device, control program for zoom control device, and storage medium
JP2019029998A (en) Imaging apparatus, control method of imaging apparatus and control program
JP6463123B2 (en) Zoom control device, imaging device, control method for zoom control device, and control program for zoom control device
JP5744581B2 (en) Imaging apparatus and control method thereof
JP6224925B2 (en) Control device and angle of view control method
JP4867136B2 (en) Imaging apparatus and program thereof
JP6289207B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, IMAGING DEVICE CONTROL PROGRAM, AND STORAGE MEDIUM
JP6188455B2 (en) Control apparatus, imaging system, angle of view control method, program, and storage medium
JP6335520B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND IMAGING DEVICE CONTROL PROGRAM
JP6624875B2 (en) Zoom control device, imaging device, control method for zoom control device, control program for zoom control device, and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20191213

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200806

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200825

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201021

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20201110

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201224

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210212

R151 Written notification of patent or utility model registration

Ref document number: 6839254

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151