JP5355381B2 - Imaging apparatus and focus control method thereof - Google Patents

Imaging apparatus and focus control method thereof Download PDF

Info

Publication number
JP5355381B2
JP5355381B2 JP2009298226A JP2009298226A JP5355381B2 JP 5355381 B2 JP5355381 B2 JP 5355381B2 JP 2009298226 A JP2009298226 A JP 2009298226A JP 2009298226 A JP2009298226 A JP 2009298226A JP 5355381 B2 JP5355381 B2 JP 5355381B2
Authority
JP
Japan
Prior art keywords
focus
determination
process proceeds
shooting
focus adjustment
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.)
Expired - Fee Related
Application number
JP2009298226A
Other languages
Japanese (ja)
Other versions
JP2011138016A (en
Inventor
直樹 岩▲崎▼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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
Priority to JP2009298226A priority Critical patent/JP5355381B2/en
Publication of JP2011138016A publication Critical patent/JP2011138016A/en
Application granted granted Critical
Publication of JP5355381B2 publication Critical patent/JP5355381B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To rapidly bring a subject to be focused into focus even when a photographic scene changes. <P>SOLUTION: The imaging apparatus performs focus adjustment while obtaining a focus signal indicating a focusing state based on image data obtained by imaging the subject by an imaging device 106. According to a command of a system controller 112, an AF processing part 105 drives a focus lens 103 based on the focus signal. The system controller 112 calculates temporal difference quantity in terms of luminance in a photographic image plane by using the image data obtained by imaging, and compares the difference quantity with a threshold to determine the state of the photographic scene. Monitoring the state is continued until the photographic scene is decided. When the photographic scene is decided, focus adjustment operation is performed immediately according to the command of the system controller 112. <P>COPYRIGHT: (C)2011,JPO&amp;INPIT

Description

本発明は、撮像装置とその合焦制御方法に関し、より詳しくは電子スチルカメラやビデオカメラ等に利用される自動焦点調節の技術に関する。   The present invention relates to an imaging apparatus and its focus control method, and more particularly to an automatic focus adjustment technique used for an electronic still camera, a video camera, and the like.

従来、カメラ等でのオートフォーカス(以下、AFとも記す)では、撮像素子により得られる輝度信号の高域周波数成分が最大になるレンズ位置を合焦位置とする、コントラスAF方式が用いられている。この方式の1つにスキャン方式が知られている。即ち、焦点検出範囲の全域に亘ってレンズを駆動しながら撮像素子から得られる輝度信号の高域周波数成分に基づく評価値(以下、焦点評価値ともいう)が算出される。焦点評価値をメモリにその都度に記憶していき、記憶値のうち、その最大値に相当するレンズ位置が合焦位置となる。   Conventionally, in autofocus (hereinafter also referred to as AF) in a camera or the like, a contrast AF method is used in which a lens position at which a high frequency component of a luminance signal obtained by an imaging element is maximized is set as a focus position. . A scanning method is known as one of these methods. That is, an evaluation value (hereinafter also referred to as a focus evaluation value) based on the high frequency component of the luminance signal obtained from the image sensor while driving the lens over the entire focus detection range is calculated. The focus evaluation value is stored in the memory each time, and the lens position corresponding to the maximum value among the stored values becomes the focus position.

焦点評価値が増加する方向にレンズを動かし、焦点評価値が最大になる位置を合焦位置とする、いわゆる山登り方式が知られている。この方式は、合焦動作を所定間隔で繰り返し行うAF動作(以下、コンティニュアスAFという)モードに採用されている。また、撮影準備指示前にコンティニュアスAFを行い合焦状態を維持することで、撮影準備指示後に行うスキャン方式によるAFの焦点検出範囲を制限し、AF動作の時間を短縮する方法がある。特許文献1には、撮影光学系のフォーカシングレンズを所定量移動する前に算出された焦点評価値と、その移動後に算出された焦点評価値とから、フォーカシングレンズを次に移動する時の移動方向を決定してフォーカシングレンズを移動する手段が開示されている。   A so-called hill-climbing method is known in which the lens is moved in the direction in which the focus evaluation value increases, and the position where the focus evaluation value is maximized is set as the in-focus position. This method is employed in an AF operation (hereinafter referred to as continuous AF) mode in which a focusing operation is repeated at a predetermined interval. Further, there is a method of reducing the AF operation time by limiting the AF focus detection range by the scanning method performed after the shooting preparation instruction by performing continuous AF before the shooting preparation instruction and maintaining the focused state. Japanese Patent Application Laid-Open No. 2004-228561 describes a moving direction when the focusing lens is moved next from a focus evaluation value calculated before moving the focusing lens of the photographing optical system by a predetermined amount and a focus evaluation value calculated after the movement. And a means for moving the focusing lens is disclosed.

特許第4106485号公報Japanese Patent No. 4106485

ところでコンティニュアスAFにおいて、焦点評価値の増加する方向にレンズを動かそうとした場合、画面内において合焦すべき領域が分からないと、適切な対象にピントを合わせることができない。そこでコンティニュアスAFでは前記スキャン方式を組み合わせることで、合焦動作にかかる時間を短縮している。   By the way, in continuous AF, when an attempt is made to move the lens in the direction in which the focus evaluation value increases, it is impossible to focus on an appropriate target unless the region to be focused on is known in the screen. Therefore, in continuous AF, the time required for the focusing operation is shortened by combining the scanning methods.

しかし、従来の装置では撮影シーンが変化した場合、合焦すべき被写体に素早くピントを合わせることが難しい。例えば、撮影者が画面内でピント合わせを意図している、合焦すべき被写体(以下、主被写体とも記す)を判断せずにAF制御が行われてしまうと、撮影シーンによっては合焦すべき被写体にピント合わせができないという事態が起こり得る。また、撮影シーンが変化した場合に、撮影画面内の合焦すべき被写体の領域が判別できなくなる可能性がある。
そこで本発明は、撮影シーンが変化した場合でも、合焦すべき被写体に対して迅速なピント合わせを可能にすることを目的とする。
However, in the conventional apparatus, when the shooting scene changes, it is difficult to focus quickly on the subject to be focused. For example, if AF control is performed without determining a subject to be focused (hereinafter also referred to as a main subject) that the photographer intends to focus on the screen, the focus is adjusted depending on the shooting scene. There is a possibility that the subject cannot be brought into focus. Further, when the shooting scene changes, there is a possibility that the area of the subject to be focused in the shooting screen cannot be determined.
Therefore, an object of the present invention is to enable quick focusing on a subject to be focused even when a shooting scene changes.

上記課題を解決するために、本発明に係る装置は、撮像素子によって被写体を撮像した画像データに基づいて合焦状態を示す焦点信号を得て焦点調節を行う撮像装置であって、撮影準備指示を行う指示手段と、前記焦点信号に基づいて焦点調節動作を行う焦点調節手段と、撮影シーンの状態を判定する判定手段と、を備え、前記焦点調節手段は、前記撮影準備指示の前に、合焦すべき被写体領域を特定するために所定のスキャン範囲で前記焦点信号を算出し焦点調節を行う第1の焦点調節動作と、順次取得される前記焦点信号の高い方に焦点調節を行う第2の焦点調節動作と、を行い、前記撮影準備指示の後に、特定された合焦すべき被写体領域に基づいたスキャン範囲で前記焦点信号を算出し焦点調節を行い、前記撮影準備指示の前の前記第2の焦点調節動作中に前記判定手段によって撮影シーンの変化が検出された場合には、前記第1の焦点調節動作を行う。
In order to solve the above problems, the device according to the present invention is an imaging apparatus that performs focus adjustment to obtain a focus signal indicating a focus state based on the image data obtained by imaging a subject by the image pickup device, an instruction of photographing preparation A focus adjusting unit that performs a focus adjustment operation based on the focus signal, and a determination unit that determines the state of the shooting scene, the focus adjusting unit, before the shooting preparation instruction, In order to specify a subject area to be focused, a first focus adjustment operation that calculates the focus signal in a predetermined scan range and performs focus adjustment, and a first focus adjustment operation that performs focus adjustment on the higher one of the focus signals acquired sequentially. After the shooting preparation instruction, the focus signal is calculated in the scan range based on the specified subject area to be focused, and the focus adjustment is performed. Above By when the change of the photographic scene is detected the determination means in the second focus adjustment operation, performs the first focus adjustment operation.

本発明によれば、撮影シーンが変化した場合でも、合焦すべき被写体に対する迅速なピント合わせが可能となる。   According to the present invention, it is possible to quickly focus on a subject to be focused even when a shooting scene changes.

本発明の一実施形態に係る撮像装置の構成例を示すブロック図である。It is a block diagram showing an example of composition of an imaging device concerning one embodiment of the present invention. 本発明の実施形態における自動合焦制御動作を例示したフローチャートである。5 is a flowchart illustrating an automatic focusing control operation in the embodiment of the invention. 図2における安定判断処理のサブルーチンを説明するフローチャートである。It is a flowchart explaining the subroutine of the stability determination process in FIG. 図2における顔検出時AFスキャンのサブルーチンを説明するフローチャートである。3 is a flowchart for explaining a face detection AF scan subroutine in FIG. 2; 図4、図10、図14、図19におけるシーン変化判定のサブルーチンを説明するフローチャートである。20 is a flowchart illustrating a subroutine for scene change determination in FIGS. 4, 10, 14, and 19. 図4、図11、図15における合焦判定処理のサブルーチンを説明するフローチャートである。16 is a flowchart for explaining a subroutine of focus determination processing in FIGS. 4, 11, and 15. 図6における合焦判定の仕方を説明するためのグラフ図である。It is a graph for demonstrating the method of the focus determination in FIG. 図2における被写体領域を特定するためのAFスキャンのサブルーチンを説明するフローチャートである。FIG. 3 is a flowchart illustrating an AF scan subroutine for specifying a subject area in FIG. 2. FIG. 図8における前回参照判定のサブルーチンを説明するフローチャートである。It is a flowchart explaining the subroutine of the last reference determination in FIG. 図8における前回参照AFスキャンのサブルーチンを説明するフローチャートである。10 is a flowchart for explaining a subroutine of a previous reference AF scan in FIG. 8. 図10、図14における主被写体領域判定のサブルーチンを説明するフローチャートであり、処理の前半部を示す。FIG. 15 is a flowchart for explaining a main subject area determination subroutine in FIGS. 10 and 14 and shows a first half of processing; FIG. 主被写体領域判定のサブルーチンを説明するフローチャートであり、処理の後半部を示す。10 is a flowchart for explaining a main subject area determination subroutine, showing the latter half of the process. 主被写体領域判定の処理例を説明する図である。It is a figure explaining the process example of main subject area | region determination. 図8におけるゾーンAFスキャンのサブルーチンを説明するフローチャートである。FIG. 9 is a flowchart for describing a zone AF scan subroutine in FIG. 8. FIG. 図14におけるゾーン更新判定のサブルーチンを説明するフローチャートであり、処理の前半部を示す。FIG. 15 is a flowchart for explaining a zone update determination subroutine in FIG. 14, showing the first half of the process. 図14におけるゾーン更新判定のサブルーチンを説明するフローチャートであり、処理の後半部を示す。FIG. 15 is a flowchart for explaining a subroutine for zone update determination in FIG. 14 and shows the latter half of the process. FIG. ゾーン更新判定の処理例を説明する図である。It is a figure explaining the example of a process of zone update determination. 図8におけるフォーカス駆動のサブルーチンを説明するフローチャートである。FIG. 9 is a flowchart for explaining a focus driving subroutine in FIG. 8. FIG. 図2におけるコンティニュアスAFのサブルーチンを説明するフローチャートであり、処理の前半部を示す。3 is a flowchart for explaining a subroutine of continuous AF in FIG. 2 and shows a first half of processing. 図2におけるコンティニュアスAFのサブルーチンを説明するフローチャートであり、処理の後半部を示す。FIG. 3 is a flowchart for explaining a subroutine of continuous AF in FIG. 2 and shows the latter half of the process. FIG. 図2におけるシーン不安定判断のサブルーチンを説明するフローチャートである。3 is a flowchart illustrating a subroutine for determining scene instability in FIG. 2. 本露光用AFのサブルーチンを説明するフローチャートである。It is a flowchart explaining the subroutine of AF for this exposure.

以下、図面を参照しながら本発明の実施形態に係る撮像装置とその合焦制御法を説明する。
図1は本発明の一実施形態を適用した電子カメラの構成例を示すブロック図である。撮影光学系は、ズーム機構を含む撮影レンズ101、光量を制御する絞り及びシャッタ102、焦点調節用のフォーカスレンズ103を備える。
Hereinafter, an imaging apparatus and an in-focus control method according to an embodiment of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram showing a configuration example of an electronic camera to which an embodiment of the present invention is applied. The photographing optical system includes a photographing lens 101 including a zoom mechanism, a diaphragm and shutter 102 for controlling the amount of light, and a focus lens 103 for focus adjustment.

AE(自動露出)処理部104は、後述のシステム制御部からの指示に従い絞り及びシャッタ102を制御する。AF処理部105は、後述のシステム制御部からの指示に従いフォーカスレンズ103を制御し、自動焦点調節を行う。撮像素子106は被写体からの反射光を受光して電気信号に変換する光電変換手段であり、その出力はA/D変換部107に送られる。   An AE (automatic exposure) processing unit 104 controls the aperture and shutter 102 in accordance with instructions from a system control unit described later. The AF processing unit 105 controls the focus lens 103 in accordance with an instruction from a system control unit described later, and performs automatic focus adjustment. The image sensor 106 is a photoelectric conversion unit that receives reflected light from a subject and converts it into an electrical signal, and its output is sent to an A / D converter 107.

A/D変換部107は、出力ノイズを除去するCDS回路やA/D変換前に行う非線形増幅回路を含む。画像処理部108はA/D変換部107の出力信号を処理して、AE処理部104や後述のシステム制御部等に信号を送出する。システム制御部は画像データに基づいて合焦状態を示す焦点信号を得て、AF処理部105に制御指令を送り、焦点調節動作を制御する。画像処理部108による画像データはフォーマット変換部109によって変換されて、高速なメモリ110に記憶される。例えばランダムアクセスメモリ(以下、DRAMと記す)が使用され、一時的な画像記憶手段としての高速バッファや、画像の圧縮伸張における作業用メモリ等に使用される。画像記録部111はメモリカード等の記録媒体とそのインターフェース部を備え、画像データを記録媒体に記録する。   The A / D conversion unit 107 includes a CDS circuit that removes output noise and a non-linear amplification circuit that is performed before A / D conversion. The image processing unit 108 processes the output signal of the A / D conversion unit 107 and sends the signal to the AE processing unit 104 and a system control unit described later. The system control unit obtains a focus signal indicating an in-focus state based on the image data, and sends a control command to the AF processing unit 105 to control the focus adjustment operation. Image data from the image processing unit 108 is converted by the format conversion unit 109 and stored in the high-speed memory 110. For example, a random access memory (hereinafter referred to as DRAM) is used, and it is used as a high-speed buffer as temporary image storage means, a working memory for image compression / decompression, and the like. The image recording unit 111 includes a recording medium such as a memory card and its interface unit, and records image data on the recording medium.

装置全体の制御を司るシステム制御部112は、撮影シーケンス等を制御する。画像表示用メモリ(以下、VRAMと記す)113は、操作表示部114に撮影画像を表示するための画像データを記憶している。操作表示部114は画像表示の他、操作補助のための表示やカメラ状態の表示を行い、撮影時には撮影した画像と焦点検出領域を表示する。なお後述する各種の処理はシステム制御部112を構成するCPU(中央演算処理装置)によって解釈及び実行されるプログラムに従って実現される。   A system control unit 112 that controls the entire apparatus controls an imaging sequence and the like. An image display memory (hereinafter referred to as VRAM) 113 stores image data for displaying a captured image on the operation display unit 114. In addition to image display, the operation display unit 114 performs display for assisting operations and display of the camera state, and displays a captured image and a focus detection area at the time of shooting. Various processes described later are realized according to a program interpreted and executed by a CPU (central processing unit) constituting the system control unit 112.

操作部115はカメラの操作手段であり、各種の操作指示をシステム制御部112に伝える。例えば撮像装置の撮影機能や画像再生時の設定等の各種設定を行うメニュースイッチ、撮影レンズのズーム動作を指示するズームレバー、撮影モードと再生モードの動作モード切換えスイッチ等が挙げられる。撮影モードスイッチ116は、顔検出モードのオン/オフを切り替える等の設定を行うためのスイッチであり、その指示はシステム制御部112に送られる。メインスイッチ117の操作によりシステムに電源が投入され、又は電源が遮断される。スイッチ118はAFやAE等の撮影スタンバイ動作を行うためのスイッチ(以下、SW1と記す)であり、スイッチ119はSW1の操作後、撮影を行うための撮影スイッチ(以下、SW2と記す)である。   The operation unit 115 is a camera operation unit, and transmits various operation instructions to the system control unit 112. For example, there are a menu switch for performing various settings such as a shooting function of the image pickup apparatus and a setting at the time of image reproduction, a zoom lever for instructing a zoom operation of the shooting lens, an operation mode switching switch between a shooting mode and a playback mode, and the like. The shooting mode switch 116 is a switch for performing settings such as switching on / off of the face detection mode, and the instruction is sent to the system control unit 112. By operating the main switch 117, the system is turned on or turned off. The switch 118 is a switch (hereinafter referred to as SW1) for performing a shooting standby operation such as AF or AE, and the switch 119 is a shooting switch (hereinafter referred to as SW2) for performing shooting after the operation of SW1. .

顔検出モジュール120は画像処理部108で処理した画像信号を用いて顔検出を行う。ここで検出した1つ又は複数の顔情報(位置・大きさ・信頼度)はシステム制御部112に送られる。なお顔検出については既知の方法を使用でき、また本発明の主眼点ではないので詳細な説明は省略する。   The face detection module 120 performs face detection using the image signal processed by the image processing unit 108. The one or more pieces of face information (position / size / reliability) detected here are sent to the system control unit 112. It should be noted that a known method can be used for face detection, and since it is not the main point of the present invention, detailed description is omitted.

動体検出部121は画像処理部108に接続されており、撮影画面内の被写体及び背景が動いているか否かを検出し、動体情報をシステム制御部112に送る。具体的には、画像処理部108で処理した画像信号のうち、時系列的に並んだ2枚の画像を比較し、その輝度の差分情報から被写体や背景の動体情報(動作量、位置、範囲)を検出する。   The moving object detection unit 121 is connected to the image processing unit 108, detects whether or not the subject and background in the shooting screen are moving, and sends moving object information to the system control unit 112. Specifically, among the image signals processed by the image processing unit 108, two images arranged in time series are compared, and moving object information (motion amount, position, range) of the subject and the background is obtained from the difference information of the luminance. ) Is detected.

次に図2のフローチャートを参照しながらカメラ動作について説明する。まずS201ではシステム制御部112が、撮影準備を指示するSW1の状態(ON/OFF)を判定する。その結果、SW1の状態がON(オン)状態の場合、S212へ進み、OFF(オフ)状態の場合にはS202へ進む。S202ではシーン安定判断が行われる。これは撮影シーンが安定したか否かの判断処理であり、その手順の詳細は後述する。S203ではS202において撮影シーンが安定したと判断したか否かをシステム制御部112が調べる。安定の判断時には戻り値がTRUE(真)であり、撮影シーンが安定していないと判断された場合には戻り値がFALSE(偽)となる。TRUEの場合、S204へ進み、FALSEの場合、S201へ戻る。なお撮影シーンが安定した状態とは、撮影する被写体、カメラの状態が安定して維持され、撮影に適した状態になっている事である。撮影シーンが安定せず、当該シーンが確定しないと判断された場合には、無闇にフォーカスレンズ103を駆動させずに、停止させることが望ましい。   Next, the camera operation will be described with reference to the flowchart of FIG. First, in S201, the system control unit 112 determines the state (ON / OFF) of SW1 instructing preparation for photographing. As a result, when the state of SW1 is ON (on), the process proceeds to S212, and when it is OFF (off), the process proceeds to S202. In S202, a scene stability determination is performed. This is a process for determining whether or not the shooting scene is stable, and details of the procedure will be described later. In S203, the system control unit 112 checks whether or not the shooting scene is determined to be stable in S202. When the stability is determined, the return value is TRUE (true), and when it is determined that the shooting scene is not stable, the return value is FALSE (false). In the case of TRUE, the process proceeds to S204, and in the case of FALSE, the process returns to S201. The state where the shooting scene is stable is that the state of the subject to be shot and the camera are stably maintained and are in a state suitable for shooting. When it is determined that the shooting scene is not stable and the scene is not fixed, it is desirable to stop the focus lens 103 without driving it.

S204にて、被写体輝度が所定値以下か否かをシステム制御部112が判定する。その結果、被写体輝度が所定値以下であればS205へ進むが、そうでなければS206へ進む。S205では、低照度時用のAF枠が設定される。ここでAF枠とは、撮影画面内の焦点評価値を取得する領域の事である。また、焦点評価値とは、撮像素子106から読み出したアナログ映像信号をA/D変換部107がデジタル信号に変換し、その出力から画像処理部108が輝度信号の高周波成分を抽出した値のことである。この値を示すデータは、フォーカスレンズ103の位置及びAF枠位置と対応づけてシステム制御部112が内蔵のメモリに記憶する。「焦点評価値を取得する」とは、AF処理部105がAF制御における判断のために、システム制御部112がメモリに記憶している焦点評価値を読み出すことである。低照度時には露光時間が延びる為、スキャンでのAF精度を確保する事が出来ない。そこで本実施形態では、低照度時に、被写体領域特定や顔検出時のスキャンは行わず、画面中央付近に所定の大きさのAF枠を1枠設定する。   In S204, the system control unit 112 determines whether or not the subject brightness is equal to or lower than a predetermined value. As a result, if the subject brightness is equal to or lower than the predetermined value, the process proceeds to S205, but if not, the process proceeds to S206. In S205, an AF frame for low illumination is set. Here, the AF frame is an area for acquiring a focus evaluation value in the photographing screen. The focus evaluation value is a value obtained by converting the analog video signal read from the image sensor 106 into a digital signal by the A / D converter 107 and extracting the high frequency component of the luminance signal from the output from the output. It is. Data indicating this value is stored in the built-in memory by the system control unit 112 in association with the position of the focus lens 103 and the AF frame position. “Obtain a focus evaluation value” means that the AF processing unit 105 reads out the focus evaluation value stored in the memory by the system control unit 112 for determination in AF control. Since the exposure time is extended at low illuminance, AF accuracy in scanning cannot be ensured. Therefore, in the present embodiment, at the time of low illuminance, scanning at the time of subject area specification or face detection is not performed, and one AF frame having a predetermined size is set near the center of the screen.

S206では顔検出モジュール120において、顔検出が行われたか否かを調べる。顔検出が行われていればS207へ進むが、顔検出が行われていなければS208へ進む。S207では顔検出時AFスキャンが行われ、この処理は後述する手順に従って実行され、その後にS209へ進む。S208では被写体領域を特定するためのAFスキャン処理が実行され、その手順の詳細は後述する。S205、S207、S208の後、S209に進み、コンティニュアスAFの処理が実行され、その手順の詳細は後述する。そしてS210ではシーン不安定判断の処理が実行される。これは撮影シーンが不安定か否かの判断処理であり、その手順の詳細は後述する。S211では撮影シーンが不安定か否かをシステム制御部112が判断し、不安定と判断された場合、S201へ戻る。不安定でないと判断された場合、S209に戻る。ここで、「撮影シーンが不安定である」とは、撮影する被写体の状態、カメラの状態が不安定となり、撮影に適した状態ではなくなる事である。
S201からS212に進んだ場合、合焦度判定フラグがFALSEに設定される。次のS213では、後述する手順に従って撮影処理が行われた後、S201に戻る。
In S206, the face detection module 120 checks whether face detection has been performed. If face detection has been performed, the process proceeds to S207. If face detection has not been performed, the process proceeds to S208. In S207, a face detection AF scan is performed, and this process is executed according to a procedure to be described later, and then the process proceeds to S209. In S208, AF scan processing for specifying a subject area is executed, and details of the procedure will be described later. After S205, S207, and S208, the process proceeds to S209, where the continuous AF process is executed, and details of the procedure will be described later. In step S210, a scene instability determination process is executed. This is a process of determining whether or not the shooting scene is unstable, and details of the procedure will be described later. In S211, the system control unit 112 determines whether the shooting scene is unstable. If it is determined that the shooting scene is unstable, the process returns to S201. If it is determined that it is not unstable, the process returns to S209. Here, “the photographing scene is unstable” means that the state of the subject to be photographed and the state of the camera are unstable and are not suitable for photographing.
When the process proceeds from S201 to S212, the focus degree determination flag is set to FALSE. In the next S213, the photographing process is performed according to the procedure described later, and then the process returns to S201.

以上のように、システム制御部112は撮影シーンが安定状態となって該撮影シーンが確定するまでの間は状態の監視を続行し、撮影シーンが確定した場合には焦点調節動作を行うように制御する。なお上述の動作と並行して常にAE動作が行われる。これは、システム制御部112からの制御信号に基づきAE処理部104が、絞り及びシャッタ102を制御して操作表示部114に表示される画像の明るさが適正になるよう制御する。   As described above, the system control unit 112 continues to monitor the state until the shooting scene becomes stable and the shooting scene is determined, and performs the focus adjustment operation when the shooting scene is determined. Control. Note that the AE operation is always performed in parallel with the above-described operation. In this case, the AE processing unit 104 controls the aperture and the shutter 102 based on the control signal from the system control unit 112 so that the brightness of the image displayed on the operation display unit 114 is appropriate.

次に、図3のフローチャートを用いて、図2に示したS202のシーン安定判断について説明する。まずS301にてシステム制御部112は図1の動体検出部121から出力される2枚の画像データ間の輝度差分量を取得する。これは撮影画面内の輝度に関する時間的な差分量、つまり異なる時刻における画像間での輝度差を表す。次のS302でシステム制御部112は、S301で得た輝度差分量に対してフィルタ処理を実行し、ノイズ成分の除去及び被写体像の特徴量の抽出処理を行う。S303では現在の画面の明るさに応じた閾値が設定される。この閾値は撮影シーンの安定判断に用いる基準値であり、画面の明るさだけでなく、シャッタスピード、絞り値、感度、その他の撮影条件によって決定してもよい。S304ではS302で得た輝度差分量と、S303で設定した閾値とが比較される。その結果、輝度差分値が閾値以上の場合、S305に進む。現時点では、ユーザによって撮影シーンが決定されておらず、安定状態でないと判断され、戻り値としてFALSEを返して処理が終了する。一方、輝度差分値が閾値よりも小さい場合、S306に進む。ユーザは撮影シーンを決定しており、安定状態であると判断され、戻り値としてTRUEを返して処理が終了する。   Next, the scene stability determination of S202 shown in FIG. 2 will be described using the flowchart of FIG. First, in S301, the system control unit 112 acquires a luminance difference amount between two pieces of image data output from the moving object detection unit 121 of FIG. This represents a temporal difference amount related to the luminance in the photographing screen, that is, a luminance difference between images at different times. In next step S302, the system control unit 112 performs a filtering process on the luminance difference amount obtained in step S301, and performs a process of removing a noise component and extracting a feature amount of a subject image. In S303, a threshold corresponding to the current screen brightness is set. This threshold value is a reference value used for determining the stability of the shooting scene, and may be determined not only by the brightness of the screen but also by the shutter speed, aperture value, sensitivity, and other shooting conditions. In S304, the luminance difference amount obtained in S302 is compared with the threshold set in S303. As a result, if the luminance difference value is greater than or equal to the threshold value, the process proceeds to S305. At the present time, it is determined that the shooting scene has not been determined by the user and is not in a stable state, FALSE is returned as a return value, and the process ends. On the other hand, if the luminance difference value is smaller than the threshold value, the process proceeds to S306. The user has determined the shooting scene, and is determined to be in a stable state, returns TRUE as a return value, and the process ends.

次に、図4のフローチャートを用いて、図2に示したS207の顔検出時AFスキャンについて説明する。まずS401にてシステム制御部112は、顔検出モジュール120が検出した顔情報(位置・大きさ)に基づいてAF枠設定を行う。S402ではAF処理部105がフォーカスレンズ103をスキャン開始位置へと移動させる。ここで、スキャン開始位置は、例えば検出した顔の大きさより推定した人物までの距離に基づいて決定される。S403にてシステム制御部112は、現時点のフォーカスレンズ位置における焦点評価値のデータを取得してDRAM110へ記憶させる。S404ではフォーカスレンズ103の現在位置を取得し、システム制御部112は該位置のデータをDRAM110へ記憶させる。S405にてシステム制御部112は、撮影準備を指示するSW1の状態(ON/OFF)を判定する。該状態がON状態の場合、本処理を終了して図2のS212(ノードA参照)へ進むが、OFF状態の場合にはS406へ進む。S406では後述する手順に従ってシーン変化判定が実行される。このシーン変化判定とは、撮影シーンが変わったか否かを、カメラの状態や被写体の状態から判定する処理である。   Next, the face detection AF scan of S207 shown in FIG. 2 will be described using the flowchart of FIG. First, in step S401, the system control unit 112 performs AF frame setting based on face information (position / size) detected by the face detection module 120. In S402, the AF processing unit 105 moves the focus lens 103 to the scan start position. Here, the scan start position is determined based on the distance to the person estimated from the detected face size, for example. In step S <b> 403, the system control unit 112 acquires focus evaluation value data at the current focus lens position and stores the data in the DRAM 110. In S404, the current position of the focus lens 103 is acquired, and the system control unit 112 stores the data of the position in the DRAM 110. In step S405, the system control unit 112 determines the state (ON / OFF) of SW1 that instructs preparation for shooting. If this state is the ON state, this process is terminated and the process proceeds to S212 (see node A) in FIG. 2, but if it is the OFF state, the process proceeds to S406. In S406, scene change determination is executed according to the procedure described later. This scene change determination is a process for determining whether or not the shooting scene has changed from the state of the camera or the state of the subject.

S407でシステム制御部112は、フォーカスレンズ103の現在位置がスキャン終了位置と等しいかを判定する。その結果、両者が等しい場合にはS409へ進むが、そうでなければS408へ進む。なおスキャン終了位置については、例えば、検出した顔の大きさより推定した人物までの距離に基づいて決定される。S408ではAF処理部105がフォーカスレンズ103をスキャン終了方向へ向けて所定量だけ移動させた後、S403に戻る。またS409では後述する手順に従って合焦判定が行われる。S410ではS409における合焦判定により○判定となったか否かをシステム制御部112が調べる。ここで「○判定」とは、被写体のコントラストが十分にあり、かつスキャンした距離範囲内に被写体が存在する場合に得られる判定結果として定義される。判定結果が○判定の場合、S411へ進み、○判定でない場合、S414へ進む。
S411ではS403で取得した焦点評価値がピークとなる合焦位置の算出処理が行われる。S412でAF処理部105はフォーカスレンズ103を、S411で算出した合焦位置へと移動させる。S413ではピーク検出フラグがTRUEに設定される。
In step S407, the system control unit 112 determines whether the current position of the focus lens 103 is equal to the scan end position. As a result, if both are equal, the process proceeds to S409, but if not, the process proceeds to S408. The scan end position is determined based on, for example, the distance to the person estimated from the detected face size. In S408, the AF processing unit 105 moves the focus lens 103 by a predetermined amount in the scan end direction, and then returns to S403. In step S409, focus determination is performed according to a procedure described later. In S410, the system control unit 112 checks whether or not the result of the focus determination in S409 is “good”. Here, “◯ determination” is defined as a determination result obtained when the contrast of the subject is sufficient and the subject exists within the scanned distance range. If the determination result is ◯, the process proceeds to S411, and if not, the process proceeds to S414.
In S411, a process for calculating an in-focus position where the focus evaluation value acquired in S403 reaches a peak is performed. In step S412, the AF processing unit 105 moves the focus lens 103 to the in-focus position calculated in step S411. In S413, the peak detection flag is set to TRUE.

一方、S410からS414に進んだ場合には、○判定ではない、つまり、被写体のコントラストが不十分であるか、又はスキャンした距離範囲外に被写体が存在することになる。AF処理部105はフォーカスレンズ103を、予めDRAM110に記憶しているデータの示す位置(定点)へと移動させる。ここで定点については被写体の存在確率の高い距離に設定され、例えば、顔が検出されていれば、検出した顔の大きさより推定した人物までの距離とする。S413、S414の後、リターン処理となる。   On the other hand, when the process proceeds from S410 to S414, it is not “good” determination, that is, the contrast of the subject is insufficient, or the subject exists outside the scanned distance range. The AF processing unit 105 moves the focus lens 103 to a position (fixed point) indicated by data stored in the DRAM 110 in advance. Here, the fixed point is set to a distance with a high probability of existence of the subject. For example, if a face is detected, the distance to the person estimated from the size of the detected face is used. After S413 and S414, return processing is performed.

次に図5のフローチャートを用いて、シーン変化判定について説明する。本判定は図4のS406、後述する図10のS1106、図14のS1405、図19のS2107で行われる定義済み処理である。まずS501でシステム制御部112は、顔検出モジュール120で検出した顔検出状態が変化したか否かを調べる。顔検出状態が変化していれば本判定処理を終了し、図2のS201(ノードB参照)へ戻る。顔検出状態が変化していない場合、S502へ進む。「顔検出状態」とは、顔検出されているか否かを意味する。例えば、前回のシーン変化判定時に顔検出されていて今回のシーン変化判定時に顔検出されていなければ、顔検出状態が変化したことになる。   Next, scene change determination will be described using the flowchart of FIG. This determination is a predefined process performed in S406 of FIG. 4, S1106 of FIG. 10, which will be described later, S1405 of FIG. 14, and S2107 of FIG. First, in step S501, the system control unit 112 checks whether the face detection state detected by the face detection module 120 has changed. If the face detection state has changed, this determination process is terminated, and the process returns to S201 (see node B) in FIG. If the face detection state has not changed, the process proceeds to S502. “Face detection state” means whether or not a face is detected. For example, if the face is detected at the previous scene change determination and the face is not detected at the current scene change determination, the face detection state has changed.

S502でシステム制御部112は、カメラを特定方向に振った量(以下、カメラ動き量という)が所定量以上となっているか否かを調べる。カメラ動き量が所定量以上であって、判定結果が不安定であれば、本判定処理を終了して図2のS201へ戻るが、そうでなければS503へ進む。   In step S <b> 502, the system control unit 112 checks whether or not the amount by which the camera is shaken in a specific direction (hereinafter referred to as camera movement amount) is equal to or greater than a predetermined amount. If the camera movement amount is equal to or greater than the predetermined amount and the determination result is unstable, the determination process is terminated and the process returns to S201 in FIG. 2, but if not, the process proceeds to S503.

S503でシステム制御部112は、コンティニュアスAF中であるか否かを判定する。コンティニュアスAF中の場合、S504へ進み、これは被写体輝度差が所定値(基準値)以下か否かの判断処理である。「被写体輝度差」とは、前回のシーン変化判定時に取得した被写体輝度値と、今回のシーン変化判定時に検出された被写体輝度値の差である。被写体輝度値の差が所定値より大きい場合、撮影シーンが変化したと判断され、本判定処理を終了して図2のS201へ戻る。また、被写体輝度差が所定値以下であれば、本判定処理を終了してリターン処理となる。   In step S503, the system control unit 112 determines whether continuous AF is being performed. In the case of continuous AF, the process proceeds to S504, which is a process for determining whether or not the subject luminance difference is equal to or smaller than a predetermined value (reference value). The “subject brightness difference” is a difference between the subject brightness value acquired at the previous scene change determination and the subject brightness value detected at the current scene change determination. If the difference between the subject luminance values is greater than the predetermined value, it is determined that the shooting scene has changed, the determination process ends, and the process returns to S201 in FIG. On the other hand, if the subject luminance difference is equal to or smaller than the predetermined value, the determination process is terminated and the return process is performed.

S503にてコンティニュアスAF中でないと判定された場合、S505へ進む。ここでシステム制御部112は、露光時間が所定時間以上であるか否かを判定する。露光時間が所定時間以上であれば、本判定処理を終了して図2のS201へ戻る。つまり、露光時間が所定時間以上の場合、焦点評価値を取得する間隔が延びてしまう為、AFの制御精度を確保出来なくなるからである。一方、露光時間が所定時間未満の場合、S506へ進む。ここでシステム制御部112は、絞り102の状態が変化したか否かを調べる。絞り102の状態が変化した場合、S507へ進むが、変化していない場合には本判定処理を終了し、リターン処理となる。なお本実施形態では、絞り制御を用いた場合について説明しているが、絞り制御の変わりにNDフィルタによって露出制御を行った場合は、NDフィルタの状態の変化を判定してもよい。これは、絞り又はNDフィルタの状態が変化した場合、焦点評価値のピーク位置が変化するためである。   If it is determined in S503 that the continuous AF is not in progress, the process proceeds to S505. Here, the system control unit 112 determines whether or not the exposure time is equal to or longer than a predetermined time. If the exposure time is equal to or longer than the predetermined time, the determination process ends and the process returns to S201 in FIG. That is, when the exposure time is equal to or longer than the predetermined time, the interval for acquiring the focus evaluation value is extended, so that the AF control accuracy cannot be ensured. On the other hand, if the exposure time is less than the predetermined time, the process proceeds to S506. Here, the system control unit 112 checks whether or not the state of the diaphragm 102 has changed. If the state of the aperture 102 has changed, the process proceeds to S507, but if it has not changed, this determination process ends and the process returns. In the present embodiment, the case of using the aperture control has been described. However, when exposure control is performed using an ND filter instead of the aperture control, a change in the state of the ND filter may be determined. This is because the peak position of the focus evaluation value changes when the state of the diaphragm or the ND filter changes.

S507は顔検出モジュール120が顔を検出しているか否かの判定処理である。システム制御部112は、被写体である人の顔を検出していると判定した場合、本判定処理を終了して図4のS402(ノードD参照)へ進む。顔を検出していないと判定された場合、本処理を終了して後述する図8のS809(ノードC参照)へ進む。   S507 is processing for determining whether or not the face detection module 120 detects a face. If the system control unit 112 determines that the face of the person who is the subject has been detected, the system control unit 112 ends the determination process and proceeds to S402 (see node D) in FIG. If it is determined that no face has been detected, the process ends and the process proceeds to S809 (see node C) in FIG.

次に図6のフローチャート及び図7のグラフを用いて、合焦判定のサブルーチンについて説明する。この処理は、図4のS409、後述する図11のS1201、図15のS1501で行われる定義済み処理である。焦点評価値は遠近競合等の場合を除けば、図7に示すように、横軸にフォーカスレンズ位置をとり、縦軸に焦点評価値をとって示すグラフの形が山状になる。そこで焦点評価値の最大値と最小値との差と、一定値(これを「SlopeThr」と記す)以上の傾きで傾斜している部分の長さと、傾斜部分の勾配に基づき、山の形状を判断することにより、合焦判定を行うことができる。   Next, an in-focus determination subroutine will be described with reference to the flowchart of FIG. 6 and the graph of FIG. This process is a predefined process performed in S409 of FIG. 4, S1201 of FIG. 11 described later, and S1501 of FIG. As shown in FIG. 7, the focus evaluation value has a mountain shape, with the focus lens position on the horizontal axis and the focus evaluation value on the vertical axis, as shown in FIG. Therefore, based on the difference between the maximum value and the minimum value of the focus evaluation value, the length of the portion that is inclined with a certain value (this is referred to as “SlopeThr”), and the slope of the inclined portion, the shape of the mountain is determined. By determining, focus determination can be performed.

合焦判定結果は、前述の○判定を含む以下の3つのうちの1つで出力される。
○判定:被写体のコントラストが十分であって、かつスキャンした距離範囲内の距離に被写体が位置する場合の判定結果。
×判定:被写体のコントラストが不十分であるか、又はスキャンした距離範囲外の距離に被写体が位置する場合の判定結果。
△判定:×判定のうち、至近側方向へスキャンした距離範囲外に被写体が位置する場合の判定結果。
The in-focus determination result is output as one of the following three items including the above-described ○ determination.
Judgment: Judgment result when the subject has sufficient contrast and the subject is located at a distance within the scanned distance range.
X Determination: Determination result when the subject has insufficient contrast or the subject is located at a distance outside the scanned distance range.
Δ Determination: The determination result when the subject is located outside the distance range scanned in the closest direction in the X determination.

山の形状を判断する為の、一定値以上の傾きで傾斜している部分の長さをLとし、傾斜している部分の平均勾配をSL/Lとして、図7を用いて各量の定義を説明する。図中に示す山の頂上(A点)から傾斜が続いていると認められる点をD点(左側)、E点(右側)とし、D点からE点までの幅を山の幅Lとする。傾斜が続いていると認められる範囲は、A点から所定量、つまりSlopeThr以上に亘って焦点評価値が下がっており、かつスキャンポイントが続く範囲とする。「スキャンポイント」とは、連続的にフォーカスレンズを動かした場合、該レンズがスキャン開始点からスキャン終了点まで移動する間に、焦点評価値を取得するポイントの事である。
A点での焦点評価値とD点での焦点評価値との差をSL1と記し、A点での焦点評価値とE点での焦点評価値の差SL2を記すと、両者の和「SL1+SL2」がSLである。
Definition of each quantity with reference to FIG. 7, where L is the length of the sloped portion with an inclination greater than a certain value, and SL / L is the average slope of the sloped portion for judging the shape of the mountain Will be explained. In the figure, the point where it is recognized that the slope continues from the top of the mountain (point A) is D point (left side) and point E (right side), and the width from point D to point E is the width L of the mountain. . The range in which the inclination is recognized to be continued is a range in which the focus evaluation value decreases from the point A over a predetermined amount, that is, SlopeThr or more, and the scan point continues. The “scan point” is a point at which a focus evaluation value is acquired while the focus lens is continuously moved while the lens moves from the scan start point to the scan end point.
The difference between the focus evaluation value at point A and the focus evaluation value at point D is denoted SL1, and the difference SL2 between the focus evaluation value at point A and the focus evaluation value at point E is denoted as SL1 + SL2. "Is SL.

図6のフローチャートを用いて、合焦判定について説明する。まずS601でシステム制御部112は焦点評価値の最大値(Max)と最小値(Min)を求め、次にS602では焦点評価値が最大となるスキャンポイント(Max Point)を求め、S603へ進む。ここでシステム制御部112はスキャンポイント、焦点評価値から、山の形状を判断する為のLとSLを求め、SL/Lを得る。次のS604は、山の形状が至近側への登り止まりか否かの判断処理である。システム制御部112によって至近側への登り止まりと判断されるのは、以下の2条件がともに満たされる場合である。
・焦点評価値が最大値となるスキャンポイントが、スキャンを行った所定範囲における近端であること。
・近端のスキャンポイントにおける焦点評価値と、近端のスキャンポイントより1ポイント分だけ無限遠寄りのスキャンポイントにおける焦点評価値との差が、所定の基準値以上である場合であること。
The focus determination will be described with reference to the flowchart of FIG. First, in step S601, the system control unit 112 obtains the maximum value (Max) and the minimum value (Min) of the focus evaluation value. Next, in step S602, obtains a scan point (Max Point) at which the focus evaluation value is maximum, and the process proceeds to step S603. Here, the system control unit 112 obtains L and SL for judging the shape of the mountain from the scan point and the focus evaluation value, and obtains SL / L. The next step S604 is a process for determining whether or not the mountain shape stops climbing to the closest side. The system controller 112 determines that the climb to the near side is stopped when both of the following two conditions are satisfied.
The scan point with the maximum focus evaluation value is the near end in the predetermined range where the scan was performed.
The difference between the focus evaluation value at the near-end scan point and the focus evaluation value at the scan point that is one point closer to infinity from the near-end scan point is greater than or equal to a predetermined reference value.

至近側への登り止まりと判断された場合、S609へ進むが、そうでなければS605へ進む。ここでシステム制御部112は山の形状が無限遠側への登り止まりか否かを判断する。無限遠側への登り止まりと判断されるのは、以下の2条件がともに満たされる場合である。
・焦点評価値の最大値となるスキャンポイントが、スキャンを行った所定範囲における無限遠端であること。
・無限遠端のスキャンポイントにおける焦点評価値と、無限遠端のスキャンポイントより1ポイント分だけ至近端寄りのスキャンポイントにおける焦点評価値との差が、所定の基準値以上であること。
If it is determined that the climb to the closest side is stopped, the process proceeds to S609. Otherwise, the process proceeds to S605. Here, the system control unit 112 determines whether or not the mountain shape stops climbing to the infinity side. It is determined that the climb to the infinity side is stopped when both of the following two conditions are satisfied.
The scan point that is the maximum focus evaluation value is the infinity end in the predetermined range where the scan was performed.
The difference between the focus evaluation value at the scan point at the infinity end and the focus evaluation value at the scan point closer to the closest end by one point from the scan point at the infinity end is greater than or equal to a predetermined reference value.

無限遠側への登り止まりと判断された場合、S608へ進むが、そうでなければS606へ進む。ここでシステム制御部112は以下の3条件がともに満たされるか否かを判定する。
・一定値以上の傾きで傾斜している部分の長さLが所定の基準値以上であること。
・傾斜している部分の平均勾配SL/Lが所定の基準値以上であること。
・焦点評価値の最大値(Max)と最小値(Min)の差が所定の基準値以上であること。
If it is determined that the climb to the infinity side is stopped, the process proceeds to S608. Otherwise, the process proceeds to S606. Here, the system control unit 112 determines whether or not both of the following three conditions are satisfied.
-The length L of the portion inclined at a certain inclination or more is not less than a predetermined reference value.
The average slope SL / L of the inclined part is not less than a predetermined reference value.
-The difference between the maximum value (Max) and the minimum value (Min) of the focus evaluation value is greater than or equal to a predetermined reference value.

これらの条件が全て満たされた場合、S607へ進むが、1つでも条件が満たされない場合にはS608へ進む。判別結果はS607で○判定、S608で×判定、S609で△判定である。つまりS607では、得られた焦点評価値が山状となっていて、被写体のコントラストが十分であり、焦点調節が可能である為、システム制御部112は判定結果を○判定とする。これに対してS608では、得られた焦点評価値が山状となっておらず、被写体のコントラストが不十分であって焦点調節が不可能であるため、システム制御部112は判定結果を×判定とする。またS609では、得られた焦点評価値が山状となってはいないが、近端方向に登り続けている状態となっており、さらに至近側に被写体ピークが存在している可能性があるため、システム制御部112は判定結果を△判定とする。   If all of these conditions are satisfied, the process proceeds to S607. If even one of the conditions is not satisfied, the process proceeds to S608. The determination result is “Yes” in S607, “No” in S608, and “No” in S609. That is, in S607, the obtained focus evaluation value has a mountain shape, the subject has sufficient contrast, and focus adjustment is possible, and therefore the system control unit 112 sets the determination result as “good”. On the other hand, in S608, since the obtained focus evaluation value is not mountain-shaped and the subject contrast is insufficient and focus adjustment is impossible, the system control unit 112 determines the determination result as x determination. And In S609, although the obtained focus evaluation value is not mountain-shaped, it is in a state of continuing to climb in the near-end direction, and there is a possibility that a subject peak exists on the near side. The system control unit 112 sets the determination result as Δ.

次に図8のフローチャートを用いて、図2に示したS208の処理、つまり被写体領域を特定するAFスキャンについて説明する。ここでは撮影画面内の主被写体の領域を特定するためのAFスキャンが行われる。   Next, the process of S208 shown in FIG. 2, that is, the AF scan for specifying the subject area will be described with reference to the flowchart of FIG. Here, AF scanning is performed to identify the area of the main subject in the shooting screen.

まずS801にてシステム制御部112は、電子ズームを行っているか否かを判定する。電子ズームを行っていると判定された場合、S802へ進むが、電子ズーム中でなければS803へ進む。S802では電子ズーム用のAF枠設定が行われる。ここで「電子ズーム」とは、画面の中央領域を拡大して操作表示部114に表示することである。拡大するため操作表示部114に表示される画像の画素数は、電子ズームを行わない場合に比べて少なくなる。従って電子ズーム時に操作表示部114が表示する画像に対して、電子ズームを行わない時と同じ割合になるようにAF枠を設定したのでは、電子ズームを行う場合、これを行わない時に比べてAF枠内の画素数が少なくなる。よって焦点評価値のS/N比が低下する。そのため、電子ズーム時と電子ズームを行わない時とでは、AF枠設定の仕方を変える必要がある。本実施形態では電子ズーム時において、撮影画面の中央付近に、所定の大きさのAF枠を1枠設定する。   First, in step S801, the system control unit 112 determines whether electronic zoom is being performed. If it is determined that the electronic zoom is being performed, the process proceeds to S802. If the electronic zoom is not being performed, the process proceeds to S803. In S802, AF frame setting for electronic zoom is performed. Here, “electronic zoom” means to enlarge the central area of the screen and display it on the operation display unit 114. Since the image is enlarged, the number of pixels of the image displayed on the operation display unit 114 is smaller than that when the electronic zoom is not performed. Therefore, if the AF frame is set so that the ratio of the image displayed on the operation display unit 114 during the electronic zoom is the same as when the electronic zoom is not performed, the case where the electronic zoom is performed is compared to the case where the electronic zoom is not performed. The number of pixels in the AF frame is reduced. Therefore, the S / N ratio of the focus evaluation value decreases. For this reason, it is necessary to change the AF frame setting method between when the electronic zoom is performed and when the electronic zoom is not performed. In the present embodiment, at the time of electronic zoom, one AF frame having a predetermined size is set near the center of the shooting screen.

S803では画面内にN×N個のAF枠が設定される。例えば、N=5とし、AF枠の大きさを縦横の長さ共に撮影画面の10%とした場合、図13に示すAF枠設定となる。なお、N値又はAF枠の大きさについては画面内の主被写体の存在確率を考慮して設定することができる。また、横方向と縦方向でAF枠の数は異なっていてもよい。   In S803, N × N AF frames are set in the screen. For example, when N = 5 and the size of the AF frame is 10% of the shooting screen in both vertical and horizontal lengths, the AF frame setting shown in FIG. 13 is obtained. The N value or the size of the AF frame can be set in consideration of the existence probability of the main subject in the screen. Further, the number of AF frames may be different between the horizontal direction and the vertical direction.

次のS804では前回参照判定が行われ、その手順については後述する。S805に進み、S804での前回参照判定の結果、システム制御部112は前回の撮影シーンと今回の撮影シーンとで変化があったか否かを判定する。その結果、前回と今回とでシーンがあまり変わらないと判定された場合、S806へ進み、シーンの変化があったと判定された場合、S809へ進む。S806では前回参照AFスキャンが行われ、その手順については後述する。そしてS807では、S806の前回参照AFスキャンにおいて主被写体領域が特定できたか否かが判定される。その結果、主被写体領域が特定できた場合、S808へ進むが、そうでなければS809へ進む。S808でピーク検出フラグがTRUEに設定された後、S813に進む。   In the next S804, the previous reference determination is performed, and the procedure will be described later. In step S805, as a result of the previous reference determination in step S804, the system control unit 112 determines whether there is a change between the previous shooting scene and the current shooting scene. As a result, when it is determined that the scene does not change much between the previous time and the current time, the process proceeds to S806, and when it is determined that the scene has changed, the process proceeds to S809. In S806, the previous reference AF scan is performed, and the procedure will be described later. In step S807, it is determined whether the main subject area has been identified in the previous reference AF scan in step S806. As a result, if the main subject area can be identified, the process proceeds to S808, but if not, the process proceeds to S809. After the peak detection flag is set to TRUE in S808, the process proceeds to S813.

S809では、後述する手順に従ってゾーンAFスキャンが行われる。次のS810は、S809のゾーンAFスキャンにおいて主被写体領域が特定できたか否かの判定処理である。主被写体領域が特定できればS808へ進み、特定できなければS811へ進む。S811は一様面判断処理であり、「一様面である状態」の有無について判断が行われる。「一様面である状態」とは画面内に輝度差がなく、コントラストがないため、AF制御を行っても焦点評価値ピークが充分に得られない状態のことである。この状態で撮影シーンが安定する度に図2のS208に示すAFスキャンが繰り返されると、画面のピント変動が無駄に繰り返されるため、煩わしい。そこで、「一様面である状態」と判定された場合には、当該状態の判定が下されなくなるまでの間、フォーカスレンズ103を停止することが望ましい。なお、一様面判断処理の詳細については説明を省略する。   In step S809, zone AF scanning is performed according to a procedure described later. The next step S810 is a process for determining whether or not the main subject area has been identified in the zone AF scan in step S809. If the main subject area can be identified, the process proceeds to S808, and if it cannot be identified, the process proceeds to S811. In step S811, uniform surface determination processing is performed to determine whether there is a “uniform surface state”. The “state that is a uniform surface” is a state in which there is no brightness difference in the screen and there is no contrast, so that a focus evaluation value peak cannot be obtained sufficiently even when AF control is performed. If the AF scan shown in S208 of FIG. 2 is repeated each time the shooting scene is stabilized in this state, the focus variation on the screen is repeated unnecessarily, which is troublesome. Thus, when it is determined that the state is a uniform surface, it is desirable to stop the focus lens 103 until the determination of the state is not made. Note that description of the details of the uniform surface determination process is omitted.

S809のゾーンAFスキャンにおいて主被写体領域が特定できなかった場合、S812では、撮影画面内に予め設定してある所定領域にAF枠を設定する処理が行われる。ここで所定領域のAF枠としては、例えば撮影画面の中央領域内の1枠が設定され、主被写体が存在する蓋然性の高い領域に設定することが望ましい。そしてS813に進み、後述する手順に従ってフォーカス駆動が行われた後、リターン処理となる。   If the main subject area cannot be identified in the zone AF scan in S809, in S812, processing for setting an AF frame in a predetermined area set in advance in the shooting screen is performed. Here, as the AF frame of the predetermined area, for example, one frame in the central area of the shooting screen is set, and it is desirable to set the AF frame in a highly likely area where the main subject exists. Then, the process proceeds to S813, and after the focus drive is performed according to the procedure described later, the return process is performed.

次に図9のフローチャートを用いて、図8に示したS804の前回参照判定について説明する。本処理は、前回にAFスキャンを行った撮影シーンに対して、今回の撮影シーンがあまり変化していないか否かを判定する処理である。   Next, the previous reference determination of S804 shown in FIG. 8 will be described using the flowchart of FIG. This process is a process for determining whether or not the current shooting scene has changed much with respect to the shooting scene in which the previous AF scan was performed.

まずS1001でシステム制御部112は、前回のAFスキャンにおいて主被写体領域を特定できていたか否かを調べる。その結果、主被写体領域が特定できていればS1002へ進み、該領域が特定できていない場合にはS1005へ進む。S1002では現在のフォーカスレンズ103の位置が所定位置よりも至近側にあるか否かの判定が行われる。その結果、フォーカスレンズ103の現在位置が所定位置よりも至近側にあればS1003へ進み、そうでなければS1005へ進む。なおS1002ではフォーカスレンズ103の現在位置が所定位置よりも至近側か否かを判定したが、フォーカスレンズ103の現在位置が所定位置より無限遠側か否かを判定してもよい。   First, in step S1001, the system control unit 112 checks whether the main subject area has been specified in the previous AF scan. As a result, if the main subject area can be identified, the process proceeds to S1002, and if the area cannot be identified, the process proceeds to S1005. In S1002, it is determined whether or not the current position of the focus lens 103 is closer to the predetermined position. As a result, if the current position of the focus lens 103 is closer to the predetermined position, the process proceeds to S1003, and if not, the process proceeds to S1005. In S1002, it is determined whether or not the current position of the focus lens 103 is closer to the predetermined position, but it may be determined whether or not the current position of the focus lens 103 is on the infinity side from the predetermined position.

S1003では前回と今回のAFスキャンの時間差、つまり前回からの経過時間が所定時間以内か否かの判定が行われる。その結果、前回のAFスキャンの時点から所定時間以内であればS1004へ進むが、そうでなければS1005へ進む。S1004では前回のAFスキャンでの撮影シーンとあまり変わらないという判定が下される。またS1005では、前回のAFスキャンの時点から撮影シーンが大きく変わったとの判定が下される。S1004、S1005の後、本判定処理が終了し、リターン処理となる。   In S1003, it is determined whether or not the time difference between the previous and current AF scans, that is, the elapsed time from the previous time is within a predetermined time. As a result, if it is within a predetermined time from the time of the previous AF scan, the process proceeds to S1004, but if not, the process proceeds to S1005. In S1004, it is determined that the shooting scene in the previous AF scan is not so different. In S1005, it is determined that the shooting scene has changed significantly since the previous AF scan. After S1004 and S1005, the determination process ends, and a return process is performed.

次に図10のフローチャートを用いて、図8に示したS806の前回参照AFスキャンについて説明する。まずS1101では、フォーカスレンズ103の現在位置を中心にスキャン範囲が第1の範囲(図には丸枠内に数字1を付して示す)に設定される。ここでは上述の前回参照判定にて前回と今回とで撮影シーンがあまり変わらないと判断されているので、第1のスキャン範囲は狭い範囲とする。S1102では、システム制御部112の指令を受けたAF処理部105がフォーカスレンズ103をスキャン開始位置へと移動させる。S1103では撮像素子106から読み出されたアナログ映像信号をA/D変換部107がデジタル信号に変換する。この信号から画像処理部108が輝度信号の高周波成分を抽出し、システム制御部112はこれを焦点評価値のデータとしてメモリに記憶させる。S1104ではフォーカスレンズ103の現在位置を取得してシステム制御部112が該位置のデータをメモリに記憶させる。S1105でシステム制御部112は、撮影準備を指示するSW1の状態(ON/OFF)を判定し、該状態がON状態の場合、本処理を終了して図2のS212(ノードA参照)へ進む。またSW1がOFF状態の場合にはS1106へ進む。S1106で前述したシーン変化判定が行われた後、S1107でシステム制御部112は、フォーカスレンズ103の現在位置がスキャン終了位置と等しいか否かを判定する。両位置が等しい場合にはS1108へ進むが、両位置が異なる場合、S1109へ進む。S1108では後述する主被写体領域判定が行われた後、リターン処理となる。またS1109ではAF処理部105がフォーカスレンズ103をスキャン終了方向に向けて所定量だけ移動させた後、S1103に戻る。   Next, the previous reference AF scan of S806 shown in FIG. 8 will be described using the flowchart of FIG. First, in S1101, the scan range centering on the current position of the focus lens 103 is set to a first range (indicated by a numeral 1 in a circle). Here, since it is determined in the previous reference determination that the shooting scene does not change much between the previous time and the current time, the first scan range is a narrow range. In step S1102, the AF processing unit 105 that has received a command from the system control unit 112 moves the focus lens 103 to the scan start position. In S1103, the A / D conversion unit 107 converts the analog video signal read from the image sensor 106 into a digital signal. The image processing unit 108 extracts a high-frequency component of the luminance signal from this signal, and the system control unit 112 stores it in the memory as focus evaluation value data. In step S1104, the current position of the focus lens 103 is acquired, and the system control unit 112 stores the data of the position in the memory. In step S1105, the system control unit 112 determines the state (ON / OFF) of SW1 that instructs to prepare for shooting. If the state is ON, the process ends and the process proceeds to step S212 (see node A) in FIG. . If SW1 is OFF, the process proceeds to S1106. After the scene change determination described above is performed in S1106, the system control unit 112 determines whether the current position of the focus lens 103 is equal to the scan end position in S1107. If both positions are equal, the process proceeds to S1108. If both positions are different, the process proceeds to S1109. In S1108, after the main subject area determination described later is performed, the return process is performed. In S1109, the AF processing unit 105 moves the focus lens 103 by a predetermined amount in the scan end direction, and the process returns to S1103.

次に図11及び図12のフローチャートを用いて、主被写体領域判定について説明する。本処理は、図10に示したS1108や、後述する図14のS1411で行われる定義済み処理であり、撮影画面内の主被写体領域が特定できたか否かが判定される。図13は主被写体領域判定の処理例についての説明図である。本例では、AF枠サイズの大きさを画面の10%とし、N=5、スキャン範囲を0乃至500、所定深度範囲を±10とする。なおスキャン範囲及び所定深度範囲を示す数値は、フォーカスレンズ103の位置を表す。これは図示しないフォーカスレンズ103の駆動用モータとしてステッピングモータを使用する場合、駆動用のパルス数に相当し、値が大きい位置が至近側であることを示している。   Next, main subject area determination will be described with reference to the flowcharts of FIGS. This process is a predefined process performed in S1108 shown in FIG. 10 or S1411 in FIG. 14 described later, and it is determined whether or not the main subject area in the shooting screen has been identified. FIG. 13 is an explanatory diagram of a processing example of main subject area determination. In this example, the AF frame size is 10% of the screen, N = 5, the scan range is 0 to 500, and the predetermined depth range is ± 10. The numerical values indicating the scan range and the predetermined depth range represent the position of the focus lens 103. This indicates that when a stepping motor is used as the driving motor for the focus lens 103 (not shown), the position corresponding to the number of driving pulses is large and the position where the value is large is on the near side.

まず図11のS1201では、設定した各AF枠の全てにおいて、前述した合焦判定が行われる。例えば、各AF枠において図13(a)に示す合焦判定結果が得られたものとする。本例では、最上行のAF枠での判定結果が全て×判定であり、上から2行目では2つの○判定と3つの×判定とされ、3行目では4つの○判定と1つの×判定とされる。下2行分のAF枠での判定結果は○判定である。
S1202では各AF枠における焦点評価値のピーク位置(以下、PeakPosと記す)が算出され、メモリに記憶される。例えば、図13(b)に示すように、各AF枠において○判定の箇所には、数値で示すピーク位置算出結果、つまりPeakPosの値をそれぞれ示している。S1203は、設定しているAF枠が1枠か否かの判定処理である。設定しているAF枠が1枠であればS1214へ進むが、1枠でない場合、S1204へ進む。ここでは中央M×M枠の各AF枠におけるPeakPosの値を至近順にソートする処理が行われる。ここでソートされた数をSと記す。以下の説明ではM=3とする。図13の例では、太線で囲んだ縦3枠、横3枠の合計9枠が各AF枠を示す。ここで、S1201の合焦判定で×判定とされたAF枠ではピーク位置が算出できないのでソートの対象としていない。図13(b)に示す例では、9枠内のピーク位置が左上隅から右下隅にかけて「100、90、400、400、100、410、400、100」である。至近順に「410、400、400、400、100、100、100、90」とソートされ、ソート数S=8となる。S1205ではS1202で算出したM×M枠内のピーク位置の至近順を示すカウンタPの値が初期値1に設定される。次にS1206ではソート順でP番目のPeakPosを「PeakPosP」とする(「P」は自然数の変数を示す)。例えば、図13(b)では、P=1の場合、PeakPosP=410となる。
First, in S1201 of FIG. 11, the above-described focus determination is performed in all the set AF frames. For example, it is assumed that the focus determination result shown in FIG. 13A is obtained in each AF frame. In this example, the determination results in the topmost AF frame are all X determinations, and in the second line from the top, there are two ◯ determinations and three X determinations, and in the third line, four ◯ determinations and one X determination. It is judged. The determination result in the AF frame for the lower two lines is “good”.
In S1202, the peak position of the focus evaluation value in each AF frame (hereinafter referred to as PeakPos) is calculated and stored in the memory. For example, as shown in FIG. 13B, the peak position calculation result indicated by a numerical value, that is, the value of PeakPos is shown in each of the AF frames at the position where the circle is determined. In step S1203, it is determined whether or not the set AF frame is one frame. If the set AF frame is one frame, the process proceeds to S1214, but if it is not one frame, the process proceeds to S1204. Here, processing for sorting PeakPos values in each AF frame of the center M × M frame in ascending order is performed. The number sorted here is denoted as S. In the following description, M = 3. In the example of FIG. 13, a total of nine frames including three vertical frames and three horizontal frames surrounded by a thick line indicate each AF frame. Here, since the peak position cannot be calculated in the AF frame determined to be x in the focus determination in S1201, it is not included in the sorting target. In the example shown in FIG. 13B, the peak positions in the nine frames are “100, 90, 400, 400, 100, 410, 400, 100” from the upper left corner to the lower right corner. Sorted as “410, 400, 400, 400, 100, 100, 100, 90” in the closest order, and the sort number S = 8. In S1205, the value of the counter P indicating the closest order of the peak positions in the M × M frame calculated in S1202 is set to the initial value 1. In step S1206, the P-th PeakPos in the sort order is set to “PeakPosP” (“P” represents a natural number variable). For example, in FIG. 13B, when P = 1, PeakPosP = 410.

S1207では所定の条件を満たすAF枠の「かたまり」を検出する処理が実行され、「かたまり」を構成するAF枠の数と各AF枠の位置がメモリに記憶される。ここで「かたまり」とは、中央のM×M個のAF枠中において○判定であり、かつPeakPosPに対して所定深度範囲内のAF枠をひとまとめした一群を意味する。換言すれば、「かたまり」とは、上記条件を満たすAF枠が上下左右に隣接している状態における当該AF枠の集合である。なお、「かたまり」が複数存在する場合には、「かたまり」を構成するAF枠の数や「かたまり」の位置に基づいて、複数の「かたまり」のうちの1つを選択することができる。   In S1207, a process of detecting “a lump” of AF frames satisfying a predetermined condition is executed, and the number of AF frames constituting the “a lump” and the positions of the respective AF frames are stored in the memory. Here, “chunk” means a group in which AF frames in a predetermined depth range with respect to PeakPosP are grouped together in a central M × M AF frame, and a circle is determined. In other words, “a lump” is a set of AF frames in a state where the AF frames satisfying the above condition are adjacent vertically and horizontally. When there are a plurality of “chunks”, one of the “chunks” can be selected based on the number of AF frames constituting the “chunk” and the position of the “chunks”.

S1208では中央のN×N個のAF枠中において、中央のM×M個のAF枠中を1枠以上含むように、判定結果が○判定であって、かつPeakPosPに対して所定深度内の「かたまり」を検出する処理が行われる。そして、検出された「かたまり」を構成するAF枠の数と各AF枠の位置を示すデータがメモリに記憶される。例えば、図13(a)及び(b)に示す判定結果に対して、図13(c)に灰色枠で示す「かたまり」、即ち○判定の箇所のうち、PeakPosPの値が400以上とされるAF枠の一群が検出される。そして図12のS1209(ノードF参照)に進む。   In S1208, the determination result is ◯ determination so that one or more of the central M × M AF frames are included in the central N × N AF frames, and within a predetermined depth with respect to PeakPosP. A process of detecting “a lump” is performed. Then, data indicating the number of AF frames constituting the detected “lumps” and the position of each AF frame is stored in the memory. For example, with respect to the determination results shown in FIGS. 13 (a) and 13 (b), the value of PeakPosP is set to 400 or more in the “lumps” shown in gray frames in FIG. A group of AF frames is detected. Then, the process proceeds to S1209 (see node F) in FIG.

S1203からS1214に進んだ場合には、S1201での合焦判定結果が○判定であるか否かが判定され、○判定の場合、図12のS1215(ノードG参照)へ進み、そうでなければ図12のS1217(ノードH参照)へ進む。   When the process proceeds from S1203 to S1214, it is determined whether or not the focus determination result at S1201 is a ◯ determination. If the determination is ◯, the process proceeds to S1215 (see node G) in FIG. The process proceeds to S1217 (see node H) in FIG.

図12のS1209では図11のS1207又はS1208で検出した「かたまり」が、中央枠を含む「かたまり」であるか否かの判定処理が行われる。その結果、中央枠を含む「かたまり」の判定が下された場合、S1215へ進み、そうでなければS1210へ進む。S1210ではS1207又はS1208で検出した「かたまり」が、M×M枠内にAF枠を所定数以上含む「かたまり」であるか否かの判定処理が行われる。肯定的判定結果が得られた場合、S1215へ進み、否定的判定結果が得られた場合、S1211へ進む。S1211ではS1207又はS1208で検出した「かたまり」が、中央M×M枠のうちの1枠以上を含み、かつN×N枠内のAF枠を所定数以上含む「かたまり」であるか否かの判定処理が行われる。肯定的判定結果が得られた場合、S1215へ進み、否定的判定結果が得られた場合、S1212へ進む。S1212はカウンタPのインクリメント処理が行われ、P値に1が加算される。そしてS1213にてカウンタPの値とソート数Sが比較され、P値がS値よりも大きい場合、S1217へ進むが、P値がS値以下の場合、図11のS1206(ノードI参照)に戻る。   In S1209 of FIG. 12, a determination process is performed to determine whether or not the “chunk” detected in S1207 or S1208 of FIG. 11 is a “chunk” including the center frame. As a result, if it is determined that the “chunk” including the central frame is made, the process proceeds to S1215; otherwise, the process proceeds to S1210. In S1210, a determination process is performed to determine whether the “chunk” detected in S1207 or S1208 is a “chunk” that includes a predetermined number or more of AF frames within the M × M frame. If a positive determination result is obtained, the process proceeds to S1215. If a negative determination result is obtained, the process proceeds to S1211. In S1211, whether or not the “chunk” detected in S1207 or S1208 is a “chunk” that includes one or more of the central M × M frames and includes a predetermined number or more of the AF frames in the N × N frame. Judgment processing is performed. If a positive determination result is obtained, the process proceeds to S1215. If a negative determination result is obtained, the process proceeds to S1212. In S1212, the counter P is incremented, and 1 is added to the P value. In S1213, the value of the counter P is compared with the sort number S. If the P value is larger than the S value, the process proceeds to S1217. If the P value is equal to or smaller than the S value, the process proceeds to S1206 (see node I) in FIG. Return.

S1215では主被写体領域が特定できたとの判定が下された後、S1216では「かたまり」を構成する各AF枠が主被写体領域と判断され、これらが選択されて本判定処理を終了する。なお、ここで設定しているAF枠が1枠の場合には当該1枠を選択する処理が行われる。一方、S1217では主被写体領域の特定ができなかったとの判定が下された後、本判定処理が終了する。   After it is determined in S1215 that the main subject area has been specified, in S1216, each AF frame constituting the “chunk” is determined to be the main subject area, and these are selected, and this determination process ends. Note that when one AF frame is set here, processing for selecting the one frame is performed. On the other hand, after it is determined in S1217 that the main subject area cannot be specified, this determination process ends.

次に図14のフローチャートを用いて、図8に示したS809のゾーンAFスキャンについて説明する。ここで「ゾーン」とは、合焦可能距離範囲を複数の範囲に分割した際の、個々の範囲を指す。   Next, the zone AF scan of S809 shown in FIG. 8 will be described using the flowchart of FIG. Here, the “zone” refers to individual ranges when the focusable distance range is divided into a plurality of ranges.

まずS1401ではシステム制御部112の指示に従いAF処理部105がフォーカスレンズ103をスキャン開始位置へと移動させる。ここでスキャン開始位置は、例えば無限遠端位置とする。S1402では撮像素子106から読み出されたアナログ映像信号をA/D変換部107がデジタル信号に変換し、その出力から画像処理部108が輝度信号の高周波成分を抽出する。システム制御部112はこれを焦点評価値のデータとしてメモリに記憶させる。S1403ではフォーカスレンズ103の現在位置を取得して、システム制御部112が該位置のデータをメモリに記憶させる。S1404でシステム制御部112は、撮影準備を指示するSW1の状態(ON/OFF)を判定する。該状態がON状態の場合、本処理を終了して図2のS212(ノードA参照)へ進み、OFF状態の場合にはS1405へ進む。S1405では前述したシーン変化判定が行われ、S1406ではフォーカスレンズ103が予め設定したゾーンの境界位置にあるか否かについて判定される。肯定的判定結果の場合、S1407へ進み、否定的判定結果の場合、S1409へ進む。   In step S1401, the AF processing unit 105 moves the focus lens 103 to the scan start position in accordance with an instruction from the system control unit 112. Here, the scan start position is, for example, the infinity end position. In S1402, the analog video signal read from the image sensor 106 is converted into a digital signal by the A / D conversion unit 107, and the image processing unit 108 extracts a high-frequency component of the luminance signal from the output. The system control unit 112 stores this in the memory as focus evaluation value data. In step S1403, the current position of the focus lens 103 is acquired, and the system control unit 112 stores the position data in the memory. In step S <b> 1404, the system control unit 112 determines the state (ON / OFF) of SW <b> 1 that instructs preparation for shooting. If this state is the ON state, this process is terminated and the process proceeds to S212 (see node A) in FIG. 2, and if it is the OFF state, the process proceeds to S1405. In S1405, the scene change determination described above is performed, and in S1406, it is determined whether or not the focus lens 103 is at a preset zone boundary position. If the result is affirmative, the process proceeds to S1407. If the result is negative, the process proceeds to S1409.

S1407ではゾーン更新判定が行われ、その手順については後述する。ここで「ゾーン更新」とは、あるゾーンのスキャン後に、当該ゾーンに隣接するゾーンのスキャンを続行することを指す。S1408にてシステム制御部112は、S1407での判定の結果、ゾーン更新を行うか否かを判定し、ゾーン更新を行う場合、S1409へ進むが、ゾーン更新を行わない場合、S1411へ進む。S1409でシステム制御部112は、フォーカスレンズ103の現在位置がスキャン終了位置と等しいか否かを調べ、両位置が等しい場合、S1411へ進み、両位置が異なる場合にはS1410へ進む。S1410にてAF処理部105はフォーカスレンズ103をスキャン終了方向へ向けて所定量だけ移動させた後、S1402に戻る。またS1411では前述した主被写体領域判定が行われた後、リターン処理となる。   In S1407, zone update determination is performed, and the procedure will be described later. Here, “zone update” refers to continuing scanning of a zone adjacent to the zone after scanning of a certain zone. In S1408, the system control unit 112 determines whether or not to perform zone update as a result of the determination in S1407. If zone update is to be performed, the process proceeds to S1409. If zone update is not to be performed, the process proceeds to S1411. In step S1409, the system control unit 112 checks whether or not the current position of the focus lens 103 is equal to the scan end position. If both positions are equal, the process proceeds to step S1411. If both positions are different, the process proceeds to step S1410. In S1410, the AF processing unit 105 moves the focus lens 103 by a predetermined amount in the scan end direction, and then returns to S1402. In S1411, after the above-described main subject area determination is performed, return processing is performed.

次に図15及び図16のフローチャートを用いて、図14に示したS1407のゾーン更新判定について説明する。本処理はスキャン方向の先に主被写体が存在する蓋然性が高いか否か、つまりAFスキャンを続けるか否かについての判定処理である。図17はゾーン更新判定例を説明する図であり、本例では、AF枠の大きさを画面の10%のサイズとし、N=5、M=3とする。   Next, the zone update determination in S1407 shown in FIG. 14 will be described using the flowcharts of FIGS. This process is a process for determining whether or not there is a high probability that the main subject exists ahead in the scan direction, that is, whether or not to continue the AF scan. FIG. 17 is a diagram for explaining an example of zone update determination. In this example, the size of the AF frame is 10% of the screen, and N = 5 and M = 3.

まず図15のS1501では、設定した各AF枠の全てにおいて前述した合焦判定が行われる。例えば、各AF枠において図17(a)に示す合焦判定結果が得られたものとする。本例では左隅部の6箇所での判定結果が△判定である。また、上から2行分の判定結果及び3行目の右2箇所の判定結果が×判定であり、その他の箇所では○判定である。S1502は最終ゾーンまでスキャンが行われたか否かについて判定され、最終ゾーンまでスキャンが行われた場合、図16のS1512(ノードQ参照)へ進むが、そうでなければS1503へ進む。ここで判定結果が○判定の枠があるか否かについて判定が行われる。○判定の枠があればS1504へ進み、○判定の枠がなければ図16のS1511(ノードJ参照)へ進む。S1504は中央枠の判定結果が△判定であるか否かの判定処理である。中央枠の判定結果が△判定であれば図16のS1511へ進み、そうでなければS1505へ進む。S1505では中央M×M枠の中で判定結果が△判定の枠の数が計数される。△判定とされた枠の数が所定枠数以上の「かたまり」があるか否かについて判定される。図17の例では、3×3の中央枠内において、△判定の枠の数が2であり、所定枠数を2とする。△判定の枠数が所定枠数以上であれば図16のS1511へ進み、そうでなければS1506へ進む。   First, in S1501 in FIG. 15, the above-described focus determination is performed in all the set AF frames. For example, it is assumed that the focus determination result shown in FIG. 17A is obtained in each AF frame. In this example, the determination results at six locations in the left corner are Δ determinations. In addition, the determination results for the two rows from the top and the determination results at the two right locations on the third row are “x” determinations, and “good” determinations are made at other locations. In S1502, it is determined whether or not the scan has been performed up to the final zone. If the scan has been performed up to the final zone, the process proceeds to S1512 (see node Q) in FIG. 16, but otherwise the process proceeds to S1503. Here, a determination is made as to whether or not the determination result has a frame for determination. If there is a judgment frame, the process proceeds to S1504, and if there is no judgment frame, the process proceeds to S1511 (see node J) in FIG. S1504 is a determination process of whether or not the determination result of the center frame is Δ determination. If the determination result of the center frame is Δ, the process proceeds to S1511 in FIG. 16, and if not, the process proceeds to S1505. In S1505, the number of frames for which the determination result is Δ in the central M × M frame is counted. It is determined whether or not there is a “cluster” in which the number of frames determined to be Δ is greater than or equal to a predetermined number of frames. In the example of FIG. 17, in the 3 × 3 central frame, the number of Δ determination frames is 2, and the predetermined number of frames is 2. Δ If the number of frames for determination is equal to or greater than the predetermined number of frames, the process proceeds to S1511 in FIG.

S1506では中央M×M枠のうち1枠以上を含むようにN×N枠のAF枠中に△判定の枠が所定枠数以上の「かたまり」があるか否かについて判定される。図17の例では、所定枠数を4とする。△判定の枠が6箇所であり、「かたまり」のうち2箇所の枠が中央枠内に含まれているので、この場合には、図16のS1511へ進む。一方、上記判定条件を満たさない場合、図16のS1507(ノードK参照)へ進む。   In step S1506, it is determined whether or not there is a “chunk” that is greater than or equal to the predetermined number of frames in the N × N AF frames so that one or more of the central M × M frames are included. In the example of FIG. 17, the predetermined number of frames is four. ΔThere are six frames for determination, and two frames of the “lumps” are included in the central frame. In this case, the process proceeds to S1511 in FIG. On the other hand, if the determination condition is not satisfied, the process proceeds to S1507 (see node K) in FIG.

S1507では中央M×M枠内における○判定の枠が計数される。その枠の数が所定数以上の「かたまり」があるか否かについて判定され、そのような「かたまり」が存在する場合、S1512へ進むが、「かたまり」がない場合、S1508へ進む。図17の例では、中央枠内での○判定の枠が3つであり、所定数を5とすると、上記判定条件は満たされていない。S1508は中央枠の判定結果が×判定であるか否かの判定処理である。中央枠の判定結果が×判定であればS1511へ進むが、そうでなければS1509へ進む。S1509では中央M×M枠の中で△判定又は×判定の枠の数が所定枠数以上の「かたまり」があるか否かについて判定される。そのような「かたまり」があればS1511へ進み、そうでなければS1510へ進む。図17の例で所定枠数を2とすると、中央枠内にて△判定の枠数が2、×判定の枠数が4であるため、上記判定条件を満たしている。S1510では、中央M×M枠の1枠以上を含むようにN×N枠の全ての枠中に△判定又は×判定の枠の数が所定数以上の「かたまり」があるか否かについて判定される。そのような「かたまり」が存在する場合、S1511へ進むが、「かたまり」が存在しなければS1512へ進む。図17にて、例えば所定数を4とすると、△判定の「かたまり」を構成する枠の数は6であって、中央枠内で△判定の枠の数が2であり、上記判定条件が満たされている。S1511では「ゾーン更新する」との判定が下され、S1512では「ゾーン更新しない」との判定が下される。例えばN=5、M=3としたとき、図17(b)に灰色で示す領域で△判定の「かたまり」が上記判定条件を満たしており、S1511で「ゾーン更新する」と判定される。そしてS1511、S1512の後、リターン処理となる。   In S1507, the ◯ determination frames in the center M × M frame are counted. It is determined whether or not there is a “chunk” whose number of frames is equal to or greater than a predetermined number. If such a “chunk” exists, the process proceeds to S1512. If there is no “chunk”, the process proceeds to S1508. In the example of FIG. 17, if there are three “◯” determination frames in the center frame and the predetermined number is five, the above determination condition is not satisfied. S1508 is a process for determining whether or not the determination result of the center frame is x determination. If the determination result of the center frame is x, the process proceeds to S1511. Otherwise, the process proceeds to S1509. In S1509, it is determined whether or not there is a “cluster” in which the number of frames for Δ determination or × determination in the central M × M frame is equal to or larger than the predetermined number of frames. If there is such a “chunk”, the process proceeds to S1511, and if not, the process proceeds to S1510. If the predetermined number of frames is 2 in the example of FIG. 17, the number of frames for determination Δ is 2 and the number of frames for determination x is 4 in the central frame, so the above determination condition is satisfied. In S1510, a determination is made as to whether or not there is a “chunk” in which all of the N × N frames have a Δ determination or X determination frame number exceeding a predetermined number so as to include one or more of the central M × M frames. Is done. If such a “chunk” exists, the process proceeds to S1511. If no “chunk” exists, the process proceeds to S1512. In FIG. 17, for example, if the predetermined number is 4, the number of frames constituting the “group” of Δ determination is 6, the number of Δ determination frames is 2 in the center frame, and the determination condition is as follows. be satisfied. In S1511, the determination “update zone” is made, and the determination “do not update zone” is made in S1512. For example, when N = 5 and M = 3, the “mass” of the Δ determination satisfies the above determination condition in the gray area in FIG. 17B, and it is determined to “update the zone” in S1511. After S1511 and S1512, return processing is performed.

次に図18のフローチャートを用いて、図8におけるS813のフォーカス駆動について説明する。まずS2001では主被写体領域が特定できたか否かについて判定され、当該領域が特定できていればS2002へ進むが、そうでなければS2003へ進む。S2002では、選択したAF枠中の最至近位置にフォーカスレンズ103が駆動される。またS2003では中央M×M枠中に○判定のAF枠があるか否かについて判定される。その結果、○判定のAF枠があればS2004へ進むが、無い場合にはS2005へ進む。S2004では中央M×M枠中で○判定のAF枠のうち、最至近位置にフォーカスレンズ103が駆動される。S2005ではフォーカスレンズ103を、予め記憶している位置(定点)へと移動させる制御が行われる。ここで「定点」については、例えば、被写体の存在確率の高い距離に対応する位置に設定する。S2002、S2004、S2005の後、本処理が終了し、リターン処理となる。   Next, focus driving in S813 in FIG. 8 will be described using the flowchart in FIG. First, in S2001, it is determined whether or not the main subject area can be specified. If the area can be specified, the process proceeds to S2002. If not, the process proceeds to S2003. In S2002, the focus lens 103 is driven to the closest position in the selected AF frame. In S2003, it is determined whether or not there is an AF frame for ◯ determination in the center M × M frame. As a result, if there is an AF frame for ◯ determination, the process proceeds to S2004, but if not, the process proceeds to S2005. In S2004, the focus lens 103 is driven to the closest position in the AF frame determined as ◯ in the center M × M frame. In S2005, control is performed to move the focus lens 103 to a previously stored position (fixed point). Here, the “fixed point” is set, for example, at a position corresponding to a distance where the existence probability of the subject is high. After S2002, S2004, and S2005, this process ends and a return process is performed.

次に図19及び図20のフローチャートを用いて、図2に示したS209のコンティニュアスAFについて説明する。まず図19のS2101では、合焦度判定フラグがTRUEに設定される。S2102では設定した各AF枠での焦点評価値の取得処理が行われる。S2103では設定しているAF枠が1枠か否かについて判定され、該AF枠が1枠の場合、S2105へ進み、そうでない場合はS2104へ進む。S2104では主被写体領域として選択したAF枠の焦点評価値を用いて演算した評価値を、S2105以降で用いる焦点評価値として設定し直す処理が行われる。これにより、撮影シーンが変化して画面内の主被写体領域が変化したとしても、常に画面内の主被写体領域の焦点評価値を算出することができる。   Next, the continuous AF of S209 shown in FIG. 2 will be described using the flowcharts of FIGS. First, in S2101 of FIG. 19, the focus degree determination flag is set to TRUE. In step S2102, focus evaluation value acquisition processing for each set AF frame is performed. In S2103, it is determined whether or not the set AF frame is one frame. If the AF frame is one frame, the process proceeds to S2105. Otherwise, the process proceeds to S2104. In S2104, the evaluation value calculated using the focus evaluation value of the AF frame selected as the main subject region is reset as the focus evaluation value used in S2105 and thereafter. Thereby, even if the shooting scene changes and the main subject area in the screen changes, the focus evaluation value of the main subject area in the screen can always be calculated.

S2105では焦点評価値に基づいて合焦度が算出され、例えば、焦点評価値に基づいて、合焦度が高、中、低の3段階で決定される。S2106ではシステム制御部112が、撮影準備を指示するSW1の状態(ON/OFF)を判定し、該状態がON状態の場合、本処理を終了して図2のS213(ノードE参照)へ進む。SW1がOFF状態の場合にはS2107へ進み、前述したシーン変化判定が行われる。S2108では、ピーク検出フラグがTRUEであるか否かについて判定され、TRUEであれば図20のS2125(ノードS参照)へ進み、FALSEであれば図20のS2109(ノードR参照)へ進む。   In S2105, the degree of focus is calculated based on the focus evaluation value. For example, the degree of focus is determined in three stages of high, medium, and low based on the focus evaluation value. In S2106, the system control unit 112 determines the state (ON / OFF) of SW1 that instructs to prepare for photographing. If the state is ON, the process is terminated and the process proceeds to S213 (see node E) in FIG. . When SW1 is in the OFF state, the process proceeds to S2107, and the scene change determination described above is performed. In S2108, it is determined whether or not the peak detection flag is TRUE. If TRUE, the process proceeds to S2125 (see node S) in FIG. 20, and if FALSE, the process proceeds to S2109 (see node R) in FIG.

S2109ではフォーカスレンズ103の現在位置が取得され、S2110では、取得カウンタの値に1が加算される。「取得カウンタ」とは、焦点評価値の取得数及びフォーカスレンズ103の現在位置の取得数を計数するためのカウンタである。この取得カウンタの値は、初期化動作にて予めゼロに設定されているものとする。S2111では取得カウンタの値が1と比較され、値が1ならばS2114へ進むが、取得カウンタの値が1でなければS2112へ進む。   In S2109, the current position of the focus lens 103 is acquired. In S2110, 1 is added to the value of the acquisition counter. The “acquisition counter” is a counter for counting the number of acquired focus evaluation values and the number of acquired current positions of the focus lens 103. It is assumed that the value of this acquisition counter is set to zero in advance in the initialization operation. In S2111, the value of the acquisition counter is compared with 1. If the value is 1, the process proceeds to S2114. If the value of the acquisition counter is not 1, the process proceeds to S2112.

S2112では、今回の焦点評価値が前回の焦点評価値と比較され、今回の方が前回よりも焦点評価値が大きい場合、S2113へ進み、そうでなければS2120へ進む。S2113で増加カウンタの値には1が加算される。「増加カウンタ」とは、今回の方が前回よりも焦点評価値が大きいと判定された場合の回数を計数するためのカウンタである。S2114でシステム制御部112は、今回の焦点評価値を焦点評価値の最大値とした後、S2115にて、フォーカスレンズ103の現在の位置を焦点評価値のピーク位置とする。そしてS2116でシステム制御部112は、今回の焦点評価値を前回の焦点評価値として再設定する。S2114乃至2116での焦点評価値を示すデータは、システム制御部112に内蔵の演算メモリに記憶される。S2117では、フォーカスレンズ103の現在位置が焦点検出範囲の端にあるか否かについて判定され、現在位置が末端の位置であればS2118へ進み、そうでなければS2119へ進む。S2118ではシステム制御部112の指令に従い、フォーカスレンズ103の移動方向が反転し、S2119でフォーカスレンズ103が所定量だけ移動する。そしてリターン処理となる。   In S2112, the current focus evaluation value is compared with the previous focus evaluation value. If the current focus evaluation value is larger than the previous focus evaluation value, the process proceeds to S2113; otherwise, the process proceeds to S2120. In S2113, 1 is added to the value of the increment counter. The “increase counter” is a counter for counting the number of times when it is determined that the current focus evaluation value is larger than the previous time. In S2114, the system control unit 112 sets the current focus evaluation value as the maximum value of the focus evaluation value, and then sets the current position of the focus lens 103 as the peak position of the focus evaluation value in S2115. In step S <b> 2116, the system control unit 112 resets the current focus evaluation value as the previous focus evaluation value. Data indicating the focus evaluation values in S2114 to S2116 is stored in a calculation memory built in the system control unit 112. In S2117, it is determined whether or not the current position of the focus lens 103 is at the end of the focus detection range. If the current position is the end position, the process proceeds to S2118; otherwise, the process proceeds to S2119. In S2118, the moving direction of the focus lens 103 is reversed in accordance with a command from the system control unit 112, and in S2119, the focus lens 103 is moved by a predetermined amount. Then, return processing is performed.

S2112からS2120に進んだ場合、ピーク評価値と今回の評価値との差、つまり「焦点評価値の最大値−今回の焦点評価値」が所定量と比較される。「焦点評価値の最大値−今回の焦点評価値」が所定量より大きい場合、S2121へ進むが、そうでなければS2116へ進む。S2120では、「焦点評価値の最大値−今回の焦点評価値」が所定量より大きいこと、即ち最大値から所定量だけ焦点評価値が減少していれば、その最大値をピントのピーク位置での値とみなす。S2121では増加カウンタの値がゼロより大きいか否かについて判定され、その値がゼロより大きい場合、S2122へ進み、ゼロの場合、S2116へ進む。S2122では、フォーカスレンズ103が前記S2115でのピーク位置、つまり、記憶済みの焦点評価値が最大値となったピーク位置へ移動する。S2123では、ピーク検出フラグがTRUEに設定された後、S2124では、取得カウンタの値がゼロに設定されて、S2119に進む。   When the processing proceeds from S2112 to S2120, the difference between the peak evaluation value and the current evaluation value, that is, “the maximum value of the focus evaluation value−the current focus evaluation value” is compared with a predetermined amount. If “the maximum value of the focus evaluation value—the current focus evaluation value” is larger than the predetermined amount, the process proceeds to S2121; otherwise, the process proceeds to S2116. In S2120, if “the maximum value of the focus evaluation value−the current focus evaluation value” is larger than the predetermined amount, that is, if the focus evaluation value has decreased by a predetermined amount from the maximum value, the maximum value is set at the focus peak position. It is considered as the value of. In S2121, it is determined whether or not the value of the increment counter is greater than zero. If the value is greater than zero, the process proceeds to S2122, and if it is zero, the process proceeds to S2116. In S2122, the focus lens 103 moves to the peak position in S2115, that is, the peak position at which the stored focus evaluation value becomes the maximum value. In S2123, after the peak detection flag is set to TRUE, in S2124, the value of the acquisition counter is set to zero, and the process proceeds to S2119.

S2125(ノードS参照)は、今回の焦点評価値が焦点評価値の最大値に対して所定の割合以上変動したか否かの判定処理である。所定の割合以上に亘る大きな変動が生じていればS2127へ進み、所定の割合未満の小さな変動であればS2126へ進む。S2126ではフォーカスレンズ103はその位置のまま停止し、S2119に進む。またS2127では、ピーク検出フラグをFALSEとし、焦点評価値の最大値及びピーク位置をリセットする処理が行われる。その理由は焦点評価値が最大となるフォーカスレンズ位置を再び探索するためである。そしてS2128で増加カウンタがリセットされた上で、S2119に進む。
以上のようにして、コンティニュアスAF動作では常に主被写体に対して合焦状態が得られるように、フォーカスレンズ103の駆動制御が行われる。
S2125 (refer to node S) is a determination process as to whether or not the current focus evaluation value has changed by a predetermined ratio or more with respect to the maximum value of the focus evaluation value. If a large fluctuation over a predetermined ratio has occurred, the process proceeds to S2127, and if a small fluctuation less than the predetermined ratio, the process proceeds to S2126. In S2126, the focus lens 103 stops at that position, and the process proceeds to S2119. In S2127, the peak detection flag is set to FALSE, and the maximum focus evaluation value and the peak position are reset. This is because the focus lens position where the focus evaluation value is maximized is searched again. Then, after the increment counter is reset in S2128, the process proceeds to S2119.
As described above, the drive control of the focus lens 103 is performed so that the focused state is always obtained with respect to the main subject in the continuous AF operation.

次に図21のフローチャートを用いて、図2に示したS210のシーン不安定判断について説明する。まずS2201でシステム制御部112は、図1の動体検出部121から出力される2枚の画像に係る各データに基づき、画像データ間の輝度差分量を取得する。次にS2202では、S2201で得た輝度差分量に対し、フィルタ処理を実行することで、ノイズ成分の除去及び被写体像の特徴量の抽出が行われる。S2203では現在の画面の明るさに応じた閾値を設定する。この不安定判断用の閾値については、画面の明るさだけでなく、シャッタスピード、絞り値、感度、その他の撮影条件に応じて決定することができる。またこの閾値を図3の前記S303で設定した閾値とは異なる値に設定することで、判定処理にヒステリシス特性を持たせてもよい。S2204では、S2202で得た輝度差分量とS2203で設定した閾値が比較される。フィルタリング処理後の輝度差分量が閾値以下の場合にはS2205へと進み、現在、ユーザによって撮影シーンが変更されておらず、不安定状態でないと判断される。戻り値としてFALSEのリターン処理が行われて一連の処理が終了する。一方、フィルタリング処理後の輝度差分量が閾値より大きい場合にはS2206に進み、ユーザは撮影シーンを変更しており、不安定状態であると判断される。戻り値としてTRUEのリターン処理が行われて一連の処理が終了する。
使用する画像データとしては、特定の撮影画面内領域(例えば画面内の8割を占める領域)のデータでもよいし、撮影画面内で被写体領域が特定された場合、該被写体領域に対して輝度差分量を算出してもよい。これを、設定された閾値と比較することにより、所定領域の輝度差分量に基づいて撮影シーンの状態を判定することができる。
Next, the scene instability determination of S210 shown in FIG. 2 will be described using the flowchart of FIG. First, in step S <b> 2201, the system control unit 112 acquires a luminance difference amount between image data based on the data related to the two images output from the moving object detection unit 121 in FIG. 1. Next, in S2202, noise component removal and subject image feature value extraction are performed by performing filter processing on the luminance difference amount obtained in S2201. In S2203, a threshold value corresponding to the current screen brightness is set. The threshold value for determining instability can be determined according to not only the screen brightness but also the shutter speed, aperture value, sensitivity, and other shooting conditions. Further, by setting this threshold value to a value different from the threshold value set in S303 in FIG. 3, the determination process may have a hysteresis characteristic. In S2204, the luminance difference amount obtained in S2202 is compared with the threshold set in S2203. If the luminance difference amount after the filtering process is equal to or smaller than the threshold value, the process advances to step S2205, and it is determined that the shooting scene has not been changed by the user and is not in an unstable state. As a return value, FALSE return processing is performed, and a series of processing ends. On the other hand, if the luminance difference amount after the filtering process is larger than the threshold value, the process proceeds to S2206, and it is determined that the user has changed the shooting scene and is in an unstable state. As a return value, TRUE return processing is performed and a series of processing ends.
The image data to be used may be data of a specific area within the shooting screen (for example, an area that occupies 80% of the screen), or when a subject area is specified within the shooting screen, a luminance difference with respect to the subject area. A quantity may be calculated. By comparing this with a set threshold value, the state of the photographic scene can be determined based on the luminance difference amount of the predetermined area.

次に図2に示すS213の撮影処理を説明すると、以下の処理が実行される。
(A1)本露光用AE処理。
(A2)本露光用AF処理。
(A3)SW1及びSW2の状態判定処理。
(A4)本露光処理。
Next, the photographing process of S213 shown in FIG. 2 will be described. The following process is executed.
(A1) AE processing for main exposure.
(A2) AF processing for main exposure.
(A3) SW1 and SW2 state determination processing.
(A4) Main exposure process.

なお(A3)での状態判定処理は以下の通りである。
・システム制御部112は撮影スイッチSW2の状態(ON/OFF)を判定し、SW2がON状態ならば(A4)の本露光処理へ進み、SW2がOFF状態の場合にはSW1の状態を判定する。
・SW1の状態がON状態であれば、再びSW2の状態判定処理に戻るが、SW1がOFF状態の場合には本露光処理を行わずに処理が終了する。
The state determination process in (A3) is as follows.
The system control unit 112 determines the state of the photographing switch SW2 (ON / OFF). If the SW2 is in the ON state, the system control unit 112 proceeds to the main exposure process in (A4). If SW2 is in the OFF state, the state of the SW1 is determined. .
If the SW1 state is ON, the process returns to the SW2 state determination process again. However, if SW1 is OFF, the process ends without performing the main exposure process.

図22は上記本露光用AF処理例を説明するフローチャートである。まずS2401では主被写体検出フラグがTRUEであるか否かについて判定され、TRUEであればS2402へ進み、FALSEの場合、S2403へ進む。
S2402では本露光用のAF枠設定として第1の設定(図22では丸枠内に数字1を付して示す)が行われ、S2403では本露光用のAF枠設定として第2の設定(図22では丸枠内に数字2を付して示す)が行われる。ここでの枠数設定については主被写体領域判定にて設定したN×Nの枠とは異なる。本実施形態では、AF評価値の演算量を低減させる為、「N>n」を満たす自然変数nを用いて、n×nの枠設定とする。さらに枠サイズとしてはS/N比を向上させるため、N×Nの枠サイズを「Size」と記し、n×nの枠サイズを「Size」と記すとき、「Size<Size」を満たすように枠サイズを設定することが望ましい。
FIG. 22 is a flowchart for explaining an example of the main exposure AF process. First, in S2401, it is determined whether or not the main subject detection flag is TRUE. If TRUE, the process proceeds to S2402, and if FALSE, the process proceeds to S2403.
In S2402, the first setting is performed as the AF frame setting for main exposure (indicated by the numeral 1 in the round frame in FIG. 22), and in S2403, the second setting is set as the AF frame setting for main exposure (FIG. 22). In FIG. 22, the number 2 is shown in a round frame). The frame number setting here is different from the N × N frame set in the main subject region determination. In the present embodiment, in order to reduce the calculation amount of the AF evaluation value, a natural variable n satisfying “N> n” is used to set the frame to n × n. Further, in order to improve the S / N ratio, the frame size of N × N is described as “Size N ”, and the frame size of n × n is described as “Size n ”, so that “Size N <Size n ”. It is desirable to set the frame size to satisfy the above.

また、枠設定については主被写体の検出結果に基づいて決定してもよい。主被写体が検出できていた場合、AF評価値の演算量を低減し、S/N比を向上させる為、S2402では「N>n、Size<Size」を満たすAF枠設定(第1の設定)とする。主被写体が検出できていない場合には、主被写体検出用に設定した枠に対して、細かな被写体を撮影しており、背景抜け等の現象が起こっている可能性がある。そこで、主被写体検出の分解能をあげる為、S2403では、「ν>N、Size>Sizeν」を満たすAF枠設定(第2の設定)とする。ここでνは自然数の変数である。 Further, the frame setting may be determined based on the detection result of the main subject. When the main subject has been detected, in order to reduce the calculation amount of the AF evaluation value and improve the S / N ratio, in S2402, an AF frame setting that satisfies “N> n, Size N <Size n ” (the first frame) Setting). If the main subject has not been detected, a fine subject is photographed in the frame set for main subject detection, and a phenomenon such as background loss may occur. Therefore, in order to increase the resolution of main subject detection, in S2403, AF frame setting (second setting) that satisfies “ν> N, Size N > Size ν ” is set. Here, ν is a natural number variable.

S2402からS2404に進み、図19のS2105で算出した合焦度が「高」であるか否かについて判定される。合焦度が「高」であればS2405へ進み、そうでなければS2406へ進む。S2405では現在のフォーカスレンズ103の位置を中心に、第1のスキャン範囲(図22では丸枠内に数字1を付して示す)が設定される。ここではコンティニュアスAF動作により主被写体にほぼピントが合っている状態、つまり焦点評価値がピークを示す合焦位置付近にフォーカスレンズが位置すると判断され、狭いスキャン範囲を設定する処理が行われる。   Proceeding from S2402 to S2404, it is determined whether or not the degree of focus calculated in S2105 of FIG. 19 is “high”. If the in-focus degree is “high”, the process proceeds to S2405; otherwise, the process proceeds to S2406. In S2405, a first scan range (shown with a numeral 1 in a round frame in FIG. 22) is set around the current position of the focus lens 103. In this case, it is determined that the focus lens is positioned almost in focus by the continuous AF operation, that is, near the in-focus position where the focus evaluation value shows a peak, and processing for setting a narrow scan range is performed. .

S2406は、図19のS2105で算出した合焦度が「中」であるか否かの判定処理である。合焦度が「中」であればS2407へ進み、そうでなければS2408へ進む。S2407では現在のフォーカスレンズ103の位置を中心に、第2のスキャン範囲(図22では丸枠内に数字2を付して示す)が設定される。ここではコンティニュアスAF動作により合焦位置付近にフォーカスレンズが位置しているが、合焦度が「高」の状態ほどではないと判断され、第1のスキャン範囲よりも広げた範囲が設定される。S2408ではフォーカスレンズ103の現在位置がマクロ領域内か否かについて判定され、当該位置がマクロ領域内であればS2409へ進み、そうでなければS2410へ進む。S2409では予め記憶済みのマクロ領域に対応した、第3のスキャン範囲(図22では丸枠内に数字3を付して示す)が設定される。S2410では予め記憶済みの範囲全域である、第4のスキャン範囲(図22では丸枠内に数字4を付して示す)が設定される。S2405、S2407、S2409、S2410の後、S2411では本露光用AFスキャンが行われる。S2412では、後述の処理で算出したピーク位置にフォーカスレンズ103が移動した後、リターン処理となる。   S2406 is a process for determining whether or not the degree of focus calculated in S2105 of FIG. 19 is “medium”. If the degree of focus is “medium”, the process proceeds to S2407; otherwise, the process proceeds to S2408. In S2407, a second scan range (shown with a numeral 2 in a round frame in FIG. 22) is set around the current position of the focus lens 103. Here, the focus lens is located near the in-focus position by the continuous AF operation, but it is determined that the in-focus degree is not as high as the “high” state, and a range wider than the first scan range is set. Is done. In S2408, it is determined whether or not the current position of the focus lens 103 is within the macro area. If the position is within the macro area, the process proceeds to S2409; otherwise, the process proceeds to S2410. In S2409, a third scan range (shown with a numeral 3 in a round frame in FIG. 22) corresponding to a macro area that has been stored in advance is set. In S2410, a fourth scan range (shown with a numeral 4 in a round frame in FIG. 22), which is the entire range stored in advance, is set. After S2405, S2407, S2409, and S2410, an AF scan for main exposure is performed in S2411. In S2412, after the focus lens 103 moves to the peak position calculated in the process described later, the return process is performed.

上記S2411の本露光用AFスキャンにおける処理の流れは、以下の通りである。
(B1)スキャン開始位置へのレンズ移動
フォーカスレンズ103はスキャン開始位置へと移動する。ここで「スキャン開始位置」とは、図22のS2405、S2407、S2409又はS2410で設定したスキャン範囲の端位置とする。
(B2)焦点評価値の取得処理
撮像素子106から読み出されたアナログ映像信号をA/D変換部107がデジタル信号に変換し、その出力から画像処理部108が輝度信号の高周波成分を抽出する。システム制御部112はこれを焦点評価値のデータとしてメモリに記憶させる。
(B3)レンズ位置の取得処理
フォーカスレンズ103の現在位置を取得して、システム制御部112が該位置のデータをメモリに記憶させる。
(B4)レンズ位置とスキャン終了位置との比較処理
システム制御部112はフォーカスレンズ103の現在位置とスキャン終了位置を比較して、両位置が等しいか否かを調べる。両位置が等しい場合には次の(B5)へ進む。両位置が異なる場合には、システム制御部112の指令に従って、フォーカスレンズ103がスキャン終了方向へ向けて所定量だけ移動した後、上記(B2)に戻る。
(B5)ピーク位置の計算処理
上記(B2)で記憶した焦点評価値とそのレンズ位置から、焦点評価値のピーク位置が計算される。ここで焦点評価値のピーク位置を計算するにあたって、AF枠を複数枠設定した場合は、図11で説明した主被写体領域判定により決定した主被写体領域の最至近ピーク位置に基づいて計算することができる。あるいは別の判断法を採用してピーク位置計算を行ってもよい。
The flow of processing in the main exposure AF scan in S2411 is as follows.
(B1) Lens movement to the scan start position The focus lens 103 moves to the scan start position. Here, the “scan start position” is the end position of the scan range set in S2405, S2407, S2409, or S2410 in FIG.
(B2) Focus Evaluation Value Acquisition Processing The analog video signal read from the image sensor 106 is converted into a digital signal by the A / D conversion unit 107, and the image processing unit 108 extracts a high-frequency component of the luminance signal from the output. . The system control unit 112 stores this in the memory as focus evaluation value data.
(B3) Lens Position Acquisition Processing The current position of the focus lens 103 is acquired, and the system control unit 112 stores the position data in the memory.
(B4) Comparison processing between lens position and scan end position The system control unit 112 compares the current position of the focus lens 103 with the scan end position to check whether or not the two positions are equal. If both positions are equal, the process proceeds to the next (B5). If the two positions are different, the focus lens 103 moves by a predetermined amount in the scan end direction in accordance with a command from the system control unit 112, and then the process returns to (B2).
(B5) Peak Position Calculation Processing The peak position of the focus evaluation value is calculated from the focus evaluation value stored in (B2) and its lens position. Here, in calculating the peak position of the focus evaluation value, when a plurality of AF frames are set, the calculation can be performed based on the closest peak position of the main subject area determined by the main subject area determination described with reference to FIG. it can. Or you may employ | adopt another judgment method and may perform peak position calculation.

次に本露光処理の流れを説明すると、以下の処理が実行される。
(C1)撮像素子106の露光
(C2)データ読み出し処理
撮像素子106に蓄積された電荷に対応するデータが読み出される。
(C3)A/D変換処理
A/D変換部107は、撮像素子106から読み出したアナログ信号をデジタル信号に変換する。
(C4)画像処理
画像処理部108は、A/D変換部107から出力されるデジタル信号に対して各種画像処理を施す。
(C5)画像圧縮処理
上記(C4)で処理した画像データは、システム制御部112の制御下でJPEG等のフォーマットに従ってフォーマット変換部109で圧縮される。
(C6)データ転送・記録処理
上記(C5)で圧縮したデータは画像記録部111に送られ、記録媒体に記録される。
Next, the flow of the main exposure process will be described. The following process is executed.
(C1) Exposure of the image sensor 106 (C2) Data read processing Data corresponding to the electric charge accumulated in the image sensor 106 is read.
(C3) A / D Conversion Processing The A / D conversion unit 107 converts an analog signal read from the image sensor 106 into a digital signal.
(C4) Image Processing The image processing unit 108 performs various types of image processing on the digital signal output from the A / D conversion unit 107.
(C5) Image Compression Processing The image data processed in the above (C4) is compressed by the format conversion unit 109 according to a format such as JPEG under the control of the system control unit 112.
(C6) Data Transfer / Recording Process The data compressed in (C5) above is sent to the image recording unit 111 and recorded on a recording medium.

以上説明したように、本実施形態では、撮影シーンが変化した後に、撮影画面内の合焦すべき被写体領域を判断し、撮影準備前にピントを合わせておく。これにより、撮影シーンが変化した場合においても、撮影準備指示後に主被写体に素早くピントを合わせることができる。また、撮影シーンが確定していない場合には、焦点調節用のレンズ駆動を停止させることで焦点調節動作が頻繁に行われないように防止でき、画面の見栄えを損なわずに消費電力を抑えることができる。   As described above, in this embodiment, after the shooting scene changes, the subject area to be focused in the shooting screen is determined, and the focus is adjusted before shooting preparation. Thus, even when the shooting scene changes, the main subject can be quickly focused after the shooting preparation instruction. In addition, when the shooting scene is not confirmed, it is possible to prevent the focus adjustment operation from being performed frequently by stopping the lens drive for focus adjustment, and to reduce power consumption without impairing the appearance of the screen. Can do.

また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。   The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.

101 撮影レンズ
102 絞り及びシャッタ
103 フォーカスレンズ
105 AF処理部
106 撮像素子
108 画像処理部
112 システム制御部
121 動体検出部
DESCRIPTION OF SYMBOLS 101 Shooting lens 102 Aperture and shutter 103 Focus lens 105 AF processing part 106 Image pick-up element 108 Image processing part 112 System control part 121 Moving body detection part

Claims (7)

撮像素子によって被写体を撮像した画像データに基づいて合焦状態を示す焦点信号を得て焦点調節を行う撮像装置であって、
撮影準備指示を行う指示手段と、
前記焦点信号に基づいて焦点調節動作を行う焦点調節手段と、
撮影シーンの状態を判定する判定手段と、を備え、
前記焦点調節手段は、
前記撮影準備指示の前に、合焦すべき被写体領域を特定するために所定のスキャン範囲で前記焦点信号を算出し焦点調節を行う第1の焦点調節動作と、順次取得される前記焦点信号の高い方に焦点調節を行う第2の焦点調節動作と、を行い、
前記撮影準備指示の後に、特定された合焦すべき被写体領域に基づいたスキャン範囲で前記焦点信号を算出して焦点調節を行い、
前記撮影準備指示の前の前記第2の焦点調節動作中に前記判定手段によって撮影シーンの変化が検出された場合には、前記第1の焦点調節動作を行うことを特徴とする撮像装置。
An imaging device that performs focus adjustment by obtaining a focus signal indicating a focused state based on image data obtained by imaging a subject with an imaging device,
Instruction means for instructing shooting preparation;
Focus adjustment means for performing a focus adjustment operation based on the focus signal;
Determination means for determining the state of the shooting scene,
The focusing means is
Before the shooting preparation instruction, a first focus adjustment operation for calculating the focus signal in a predetermined scan range to specify a subject area to be focused and adjusting the focus, and sequentially acquiring the focus signal And a second focus adjustment operation for adjusting the focus to the higher side,
After the shooting preparation instruction, perform the focus adjustment by calculating the focus signal in the scan range based on the specified subject area to be focused,
An imaging apparatus that performs the first focus adjustment operation when a change in a shooting scene is detected by the determination unit during the second focus adjustment operation before the shooting preparation instruction .
前記判定手段は、前記画像データを用いて撮影画面内の輝度に関する時間的な差分量を算出し、該差分量を閾値と比較することで撮影シーンの安定性を判定することを特徴とする、請求項1に記載の撮像装置。   The determination means calculates a temporal difference amount related to luminance in the shooting screen using the image data, and determines the stability of the shooting scene by comparing the difference amount with a threshold value. The imaging device according to claim 1. 前記判定手段は前記差分量に対してフィルタリング処理を行って被写体像の特徴量を抽出することを特徴とする、請求項1又は2記載の撮像装置。   The imaging apparatus according to claim 1, wherein the determination unit extracts a feature amount of a subject image by performing a filtering process on the difference amount. 前記判定手段はシャッタスピード又は絞り値又は感度に応じて前記閾値を変更することを特徴とする、請求項2記載の撮像装置。   The imaging apparatus according to claim 2, wherein the determination unit changes the threshold value according to a shutter speed, an aperture value, or sensitivity. 前記判定手段は前記撮影シーンが変化した場合、撮影画面内の合焦すべき被写体領域を判断することを特徴とする、請求項1から4のいずれか1項記載の撮像装置。   5. The imaging apparatus according to claim 1, wherein the determination unit determines a subject area to be focused in a shooting screen when the shooting scene changes. 前記判定手段は前記画像データに基づいて前記被写体領域を特定し、該被写体領域に対して前記差分量を算出するとともに、前記閾値及び算出した前記被写体領域の差分量に基づいて前記撮影シーンの状態を判定することを特徴とする、請求項5記載の撮像装置。   The determination unit specifies the subject area based on the image data, calculates the difference amount for the subject area, and determines the state of the shooting scene based on the threshold and the calculated difference amount of the subject area. The imaging apparatus according to claim 5, wherein the imaging device is determined. 撮像素子によって被写体を撮像した画像データに基づいて合焦状態を示す焦点信号を得て焦点調節を行う撮像装置の合焦制御方法であって、
撮影準備指示を行う指示ステップと、
撮影シーンの状態を判定する判定ステップと、
前記撮影準備指示の前に、合焦すべき被写体領域を特定するために所定のスキャン範囲で前記焦点信号を算出し焦点調節を行う第1の焦点調節動作と、順次取得される前記焦点信号の高い方に焦点調節を行う第2の焦点調節動作と、を行い、
前記撮影準備指示の後に、特定された合焦すべき被写体領域に基づいたスキャン範囲で前記焦点信号を算出して焦点調節を行う焦点調節ステップと、を備え、
前記焦点調節ステップでは、前記撮影準備指示の前の前記第2の焦点調節動作中に前記判定ステップにより撮影シーンの変化が検出された場合には、前記第1の焦点調節動作を行うことを特徴とする撮像装置の合焦制御方法。
A focus control method for an image pickup apparatus that performs focus adjustment by obtaining a focus signal indicating a focus state based on image data obtained by imaging a subject with an image pickup device,
An instruction step for instructing shooting preparation;
A determination step for determining the state of the shooting scene;
Before the shooting preparation instruction, a first focus adjustment operation for calculating the focus signal in a predetermined scan range to specify a subject area to be focused and adjusting the focus, and sequentially acquiring the focus signal And a second focus adjustment operation for adjusting the focus to the higher side,
A focus adjustment step of performing focus adjustment by calculating the focus signal in a scan range based on the specified subject area to be focused after the shooting preparation instruction , and
In the focus adjustment step, the first focus adjustment operation is performed when a change in the shooting scene is detected in the determination step during the second focus adjustment operation before the shooting preparation instruction. A focusing control method for the imaging apparatus.
JP2009298226A 2009-12-28 2009-12-28 Imaging apparatus and focus control method thereof Expired - Fee Related JP5355381B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009298226A JP5355381B2 (en) 2009-12-28 2009-12-28 Imaging apparatus and focus control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009298226A JP5355381B2 (en) 2009-12-28 2009-12-28 Imaging apparatus and focus control method thereof

Publications (2)

Publication Number Publication Date
JP2011138016A JP2011138016A (en) 2011-07-14
JP5355381B2 true JP5355381B2 (en) 2013-11-27

Family

ID=44349500

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009298226A Expired - Fee Related JP5355381B2 (en) 2009-12-28 2009-12-28 Imaging apparatus and focus control method thereof

Country Status (1)

Country Link
JP (1) JP5355381B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6071295B2 (en) * 2012-07-18 2017-02-01 キヤノン株式会社 Focus adjustment device, imaging device, and control method of focus adjustment device
JP6655973B2 (en) * 2015-12-16 2020-03-04 三菱電機株式会社 In-vehicle display control device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005267510A (en) * 2004-03-22 2005-09-29 Secom Co Ltd Image processing device, image processing method, and intruder detection system
JP2008191391A (en) * 2007-02-05 2008-08-21 Nikon Corp Focusing mechanism, and camera
JP4311457B2 (en) * 2007-02-15 2009-08-12 ソニー株式会社 Motion detection device, motion detection method, imaging device, and monitoring system
JP5332160B2 (en) * 2007-09-18 2013-11-06 ソニー株式会社 Imaging apparatus, control method thereof, and program
JP4879127B2 (en) * 2007-09-21 2012-02-22 富士フイルム株式会社 Digital camera and digital camera focus area selection method

Also Published As

Publication number Publication date
JP2011138016A (en) 2011-07-14

Similar Documents

Publication Publication Date Title
JP5339954B2 (en) Focus adjustment device and focus adjustment method
JP5376986B2 (en) Focus adjustment device and focus adjustment method
JP5300520B2 (en) Focus adjustment device and focus adjustment method
US8194175B2 (en) Image pickup apparatus focusing on an object to be focused in continuous shooting mode
JP5297222B2 (en) Focus adjustment device and focus adjustment method
JP5406552B2 (en) Focus adjustment device and focus adjustment method
JP2002318341A (en) Device and method for automatic focusing
JP2007206433A (en) Focusing apparatus, imaging apparatus, and control method
JP5339955B2 (en) Focus adjustment device and focus adjustment method
JP4649715B2 (en) Automatic focus adjustment device
JP2012058587A (en) Autofocus device, image pickup device, focus control method, and program
JP5406553B2 (en) Focus adjustment device and focus adjustment method
JP5762156B2 (en) IMAGING DEVICE, FOCUS ADJUSTMENT METHOD, AND PROGRAM
JP5300521B2 (en) Focus adjustment device and focus adjustment method
JP6139960B2 (en) Imaging apparatus and control method thereof
JP2002311325A (en) Automatic focusing device and method
JP5355381B2 (en) Imaging apparatus and focus control method thereof
JP5855054B2 (en) Focus adjustment device and focus adjustment method
JP2014215476A (en) Imaging apparatus and method for controlling the same
JP4320767B2 (en) Automatic focusing apparatus and method
JP2020181147A (en) Focusing apparatus, image pickup apparatus, focusing method, and program
JP2008197676A (en) Focusing device, imaging apparatus, and control method
JP6071561B2 (en) Focus adjustment apparatus and method
JP6590496B2 (en) Imaging device, control method thereof, and program
CN112422811A (en) Lens control apparatus, control method, and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20111003

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120529

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120605

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120806

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130219

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130422

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130827

R151 Written notification of patent or utility model registration

Ref document number: 5355381

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees