JP2014123069A - Image capturing device and control method therefor - Google Patents

Image capturing device and control method therefor Download PDF

Info

Publication number
JP2014123069A
JP2014123069A JP2012280062A JP2012280062A JP2014123069A JP 2014123069 A JP2014123069 A JP 2014123069A JP 2012280062 A JP2012280062 A JP 2012280062A JP 2012280062 A JP2012280062 A JP 2012280062A JP 2014123069 A JP2014123069 A JP 2014123069A
Authority
JP
Japan
Prior art keywords
distance measurement
focus
area
measurement area
subject
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012280062A
Other languages
Japanese (ja)
Other versions
JP6087617B2 (en
JP2014123069A5 (en
Inventor
Genshiro Shibaue
玄志郎 芝上
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 JP2012280062A priority Critical patent/JP6087617B2/en
Publication of JP2014123069A publication Critical patent/JP2014123069A/en
Publication of JP2014123069A5 publication Critical patent/JP2014123069A5/ja
Application granted granted Critical
Publication of JP6087617B2 publication Critical patent/JP6087617B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

PROBLEM TO BE SOLVED: To reduce effect of focusing on background when obtaining an in-focus position for each subregion.SOLUTION: An image capturing device obtains a first in-focus position for each ranging subregion included in a first ranging region comprising a plurality of predefined ranging subregions (S208, S209), sets a part of the first ranging region as a second ranging region to obtain a second in-focus position for each ranging subregion included in the second ranging region (S212), and corrects the first in-focus positions using the second in-focus positions (S213). The first and second in-focus positions are focus lens positions corresponding to peaks of an evaluation value, which is obtained based on the evaluation value, representing a focusing condition, derived at a plurality of focusing lens positions while driving a focusing lens in first and second predefined scanning ranges, where the second scanning range is narrower than the first scanning range.

Description

本発明は、撮像装置及びその制御方法に関し、更に詳しくは、撮像装置における焦点検出技術に関する。   The present invention relates to an imaging apparatus and a control method thereof, and more particularly to a focus detection technique in the imaging apparatus.

従来、撮像範囲内の部分領域毎に算出された距離に基づいて、画像処理を行う技術がある(例えば、特許文献1参照)。また、それぞれの部分領域毎の距離に基づいて、異なる被写体に順次ピントが合うようにフォーカスレンズ位置を移動させて撮影を行うフォーカスブラケット技術がある(例えば、特許文献2参照)。   Conventionally, there is a technique for performing image processing based on a distance calculated for each partial region within an imaging range (see, for example, Patent Document 1). In addition, there is a focus bracket technique in which shooting is performed by moving the focus lens position so that different subjects are sequentially focused based on the distance of each partial region (see, for example, Patent Document 2).

特開2006−311505号公報JP 2006-311505 A 特開2010−286752号公報JP 2010-286752 A

しかしながら、部分領域内に、異なる距離、例えば、無限遠側、至近側の両方に複数の被写体が存在し、無限遠側の被写体の影響を至近側の被写体が受けてしまう場合、その領域に適した合焦位置を正しく求めることができない、所謂背景抜けの問題があった。   However, if there are multiple subjects within a partial area at different distances, for example, both the infinity side and the near side, and the subject on the near side is affected by the subject at the infinity side, it is suitable for that area. There has been a problem of so-called background loss, in which the in-focus position cannot be obtained correctly.

本発明は上記問題点を鑑みてなされたものであり、部分領域毎の合焦位置を求める場合に、背景抜けの影響を低減することを目的とする。   The present invention has been made in view of the above problems, and an object of the present invention is to reduce the influence of background loss when obtaining the in-focus position for each partial area.

上記目的を達成するために、本発明の撮像装置は、予め決められた複数の測距領域からなる第1の測距領域の一部を第2の測距領域として設定する設定手段と、前記第1の測距領域に含まれる各測距領域について第1の合焦位置を取得する第1の処理と、前記第2の測距領域に含まれる各測距領域について第2の合焦位置を取得する第2の処理とを行う取得手段と、前記第1の合焦位置を前記第2の合焦位置を用いて補正する補正手段とを有し、前記第1の合焦位置は、フォーカスレンズを予め決められた第1のスキャン範囲で駆動しながら複数のフォーカスレンズ位置で求めた合焦状態を示す評価値に基づいて求められた、該評価値がピークとなるフォーカスレンズ位置であり、前記第2の合焦位置は、前記フォーカスレンズを前記第1のスキャン範囲よりも狭い第2のスキャン範囲で駆動しながら複数のフォーカスレンズ位置で得られた評価値に基づいて求められた、該評価値がピークとなるフォーカスレンズ位置であることを特徴とする。   In order to achieve the above object, the imaging apparatus of the present invention includes a setting unit configured to set a part of a first ranging area including a plurality of predetermined ranging areas as a second ranging area, A first process for acquiring a first focus position for each distance measurement area included in the first distance measurement area, and a second focus position for each distance measurement area included in the second distance measurement area. Acquisition means for performing the second processing for acquiring the first focusing position, and correction means for correcting the first focusing position using the second focusing position, wherein the first focusing position is: A focus lens position that is obtained based on an evaluation value indicating a focus state obtained at a plurality of focus lens positions while driving the focus lens within a predetermined first scan range and at which the evaluation value reaches a peak. , The second in-focus position moves the focus lens to the first position. While driving a narrow second scanning range than the can range determined based on the evaluation value obtained by the plurality of focus lens positions, characterized in that it is a focus lens position where the evaluation value becomes a peak.

本発明によれば、部分領域毎の合焦位置を求める場合に、背景抜けの影響を低減することができる。   According to the present invention, it is possible to reduce the influence of background loss when obtaining the in-focus position for each partial region.

本発明の実施形態における撮像装置の構成を示すブロック図。1 is a block diagram illustrating a configuration of an imaging apparatus according to an embodiment of the present invention. 実施形態における撮像時のメインルーチンを示すフローチャート。The flowchart which shows the main routine at the time of the imaging in embodiment. 実施形態におけるピークポジション情報生成判定処理のフローチャート。The flowchart of the peak position information production | generation determination process in embodiment. 実施形態における合わせ込みスキャン処理のフローチャート。The flowchart of the fitting scan process in embodiment. 実施形態におけるピークポジション情報合成処理のフローチャート。The flowchart of the peak position information synthetic | combination process in embodiment. 実施形態における各被写体エリアの代表ピークポジション設定処理のフローチャート。6 is a flowchart of representative peak position setting processing for each subject area in the embodiment. 実施形態における測距領域を説明するための図。The figure for demonstrating the ranging area in embodiment. 実施形態におけるピークポジションの取得結果を及び合成結果の一例を示す図。The figure which shows an example of the acquisition result of the peak position in an embodiment, and an example of a synthetic result. 実施形態におけるピークポジションを選択するエリアを決定する方法を示す図。The figure which shows the method of determining the area which selects the peak position in embodiment. 実施形態における被写体エリアに対応した測距領域を示す図。The figure which shows the ranging area corresponding to the to-be-photographed object area in embodiment. 実施形態における背景抜けを説明するための図。The figure for demonstrating the omission of the background in embodiment.

以下、添付図面を参照して本発明を実施するための最良の形態を詳細に説明する。   The best mode for carrying out the present invention will be described below in detail with reference to the accompanying drawings.

(撮像装置のブロック図)
図1は本発明の実施形態における撮像装置である電子カメラの構成を示すブロック図である。図1において、ズーム機構を含む撮影レンズ101及び光量を制御する絞り・シャッタ102を介して入射した被写体からの反射光は、フォーカスレンズ104により撮像素子107上に結像される。撮像素子107は結像された光を受光して電気信号に変換し、A/D変換部108に出力する。A/D変換部108は撮像素子107から出力された電気信号からの出力ノイズを除去するCDS回路や、A/D変換前に行う非線形増幅回路、A/D変換を行うA/D変換回路を含み、デジタル信号に変換した画像信号を画像処理部109に出力する。
(Block diagram of imaging device)
FIG. 1 is a block diagram illustrating a configuration of an electronic camera that is an imaging apparatus according to an embodiment of the present invention. In FIG. 1, reflected light from a subject that has entered through a photographing lens 101 including a zoom mechanism and a diaphragm / shutter 102 that controls the amount of light is imaged on an image sensor 107 by a focus lens 104. The image sensor 107 receives the imaged light, converts it into an electrical signal, and outputs it to the A / D converter 108. The A / D converter 108 includes a CDS circuit that removes output noise from the electrical signal output from the image sensor 107, a non-linear amplifier circuit that is performed before A / D conversion, and an A / D converter circuit that performs A / D conversion. The image signal converted into a digital signal is output to the image processing unit 109.

画像処理部109において、A/D変換部108から出力された画像信号にガンマ変換等の所定の画像処理が施され、フォーマット変換部110において、記録や表示に適したフォーマットに変換されて、内蔵メモリ111に記憶される。内蔵メモリ111は、例えばランダムアクセスメモリなどの高速なメモリであり、以下「DRAM」と記す。DRAM111は一時的な画像記憶手段としての高速バッファとして、あるいは画像の圧縮伸張における作業用メモリとして使用される。画像記録部112はメモリカードなどの記録媒体とそのインターフェースからなり、DRAM111を介して画像等が記録される。画像表示部115は、画像表示の他、操作補助のための表示やカメラ状態の表示、撮影時には撮影画面と測距領域の表示を行い、画像表示用メモリ114(以下「VRAM」と記す。)を介して表示が行われる。   The image processing unit 109 performs predetermined image processing such as gamma conversion on the image signal output from the A / D conversion unit 108, and the format conversion unit 110 converts the image signal into a format suitable for recording and display, and incorporates the image signal. Stored in the memory 111. The built-in memory 111 is a high-speed memory such as a random access memory, for example, and is hereinafter referred to as “DRAM”. The DRAM 111 is used as a high-speed buffer as temporary image storage means or as a working memory for image compression / decompression. The image recording unit 112 includes a recording medium such as a memory card and an interface thereof, and images and the like are recorded via the DRAM 111. In addition to displaying images, the image display unit 115 displays operations for assisting operation, displays camera status, displays a shooting screen and a distance measurement area during shooting, and displays an image display memory 114 (hereinafter referred to as “VRAM”). The display is performed via.

操作部116はカメラを外部から操作するためのもので、例えば次のようなスイッチ等が含まれる。即ち、撮像装置の撮影機能や画像再生時の設定などの各種設定を行うメニュースイッチ、撮影レンズ101のズーム動作を指示するズームレバー、撮影モードと再生モードの動作モード切換えスイッチなどである。撮影モードスイッチ117は、マクロモード、遠景モード、スポーツモードなどの撮影モードを選択するためのもので、本実施形態では、ユーザーが選択した撮影モードに応じてAFスキャン範囲やAF動作などが変更される。カメラは、更に、システムに電源を投入するためのメインスイッチ118、AFやAE等の撮影準備動作を行うためのスイッチ119(以下「SW1」と記す。)、SW1の操作後、撮影を行うための撮影スイッチ120(以下「SW2」と記す。)を有する。   The operation unit 116 is for operating the camera from the outside, and includes, for example, the following switches. That is, 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 photographing lens 101, an operation mode switching switch between a shooting mode and a playback mode, and the like. The shooting mode switch 117 is used to select a shooting mode such as a macro mode, a distant view mode, and a sports mode. In this embodiment, the AF scan range, the AF operation, and the like are changed according to the shooting mode selected by the user. The The camera further includes a main switch 118 for powering on the system, a switch 119 (hereinafter referred to as “SW1”) for performing shooting preparation operations such as AF and AE, and shooting after the operation of SW1. Imaging switch 120 (hereinafter referred to as “SW2”).

また、システム制御部113は撮影シーケンスなどシステム全体を制御する。また、システム制御部113は画像処理部109により処理された画像データから、被写体を検出する処理も行う(被写体検出手段)。AE処理部103は、画像処理部109から出力された画像処理済みの画像信号に対して測光処理を行い、露出制御のためのAE評価を求め、シャッタ速度、絞り、感度を制御することにより露出を制御する。なお、撮像素子107が電子シャッタ機能を有する場合には、撮像素子107のリセット及び読み出しタイミングも制御する。AF処理部106は、画像のコントラストからAF評価値を算出し、算出したAF評価値に基づいて合焦位置を求め(焦点検出)、モータ105を駆動することでフォーカスレンズ104を駆動する。AF評価値が高いほどコントラストが強く、合焦状態に近いことを示し、AF評価値が低いほどコントラストが弱く、合焦状態から遠いことを示す。   The system control unit 113 controls the entire system such as a shooting sequence. The system control unit 113 also performs a process of detecting a subject from the image data processed by the image processing unit 109 (subject detection unit). The AE processing unit 103 performs photometric processing on the image processed image signal output from the image processing unit 109, obtains an AE evaluation for exposure control, and controls the shutter speed, aperture, and sensitivity to perform exposure. To control. When the image sensor 107 has an electronic shutter function, the reset and readout timing of the image sensor 107 are also controlled. The AF processing unit 106 calculates an AF evaluation value from the contrast of the image, obtains an in-focus position based on the calculated AF evaluation value (focus detection), and drives the motor 105 to drive the focus lens 104. The higher the AF evaluation value, the stronger the contrast and the closer to the in-focus state, and the lower the AF evaluation value, the weaker the contrast and the farther from the in-focus state.

角速度センサ部121は手ぶれやパンなどによるカメラの動きを検知し、動体検出部122は撮像した映像出力信号より動体を検出する。   The angular velocity sensor unit 121 detects camera movement due to camera shake or panning, and the moving object detection unit 122 detects a moving object from the captured video output signal.

(撮像装置の動作)
次に、上記構成を有する撮像装置の実施形態における動作について、図2のフローチャートに沿って説明する。図2は、撮像時のメインルーチンを示すフローチャートである。まず、S201にて、SW1(119)が押されたかどうかの判定を行う。SW1(119)が押されていないと判定された場合はS201に戻り、SW1(119)の判定を繰り返す。
(Operation of imaging device)
Next, the operation in the embodiment of the imaging apparatus having the above configuration will be described along the flowchart of FIG. FIG. 2 is a flowchart showing a main routine during imaging. First, in S201, it is determined whether or not SW1 (119) has been pressed. If it is determined that SW1 (119) is not pressed, the process returns to S201, and the determination of SW1 (119) is repeated.

SW1(119)が押されたと判定された場合は、S202に進んで、測距領域毎にピークポジションを取得するかどうかの判断を行う。なお、ピークポジションとは、AF評価値が極大となるフォーカスレンズ位置、即ち、各測距領域のピントが合うフォーカスレンズ位置(各測距領域の合焦位置)のことを指す。   If it is determined that SW1 (119) has been pressed, the process proceeds to S202 to determine whether to acquire a peak position for each distance measurement area. The peak position refers to the focus lens position where the AF evaluation value is maximized, that is, the focus lens position where each distance measurement area is in focus (the focus position of each distance measurement area).

(測距領域毎のピークポジション取得判定)
ここでS202で行われる測距領域毎のピークポジション取得判断処理について、図3を用いて説明する。測距領域毎にピークポジションを取得する為には、画面内の全ての被写体の距離情報を取得する為に、フォーカスレンズ104を無限遠から至近までの全域(第1のスキャン範囲)で駆動する(スキャンする)場合があり、長く時間がかかることがある。そのため、測距領域毎にピークポジションを取得する為のスキャンを行うのに適した条件かどうかの判定を行うことで、不要なスキャンを避けるようにする。
(Peak position acquisition judgment for each ranging area)
Here, the peak position acquisition determination process for each distance measurement area performed in S202 will be described with reference to FIG. In order to acquire the peak position for each distance measurement area, the focus lens 104 is driven in the entire region from the infinity to the nearest (first scan range) in order to acquire distance information of all subjects in the screen ( Scanning) and may take a long time. Therefore, unnecessary scanning is avoided by determining whether or not the conditions are suitable for performing a scan for acquiring a peak position for each distance measurement area.

まずS301にて、検出されている被写体が、複数配置した測距領域よりも外側にあるかどうかの判定を行う。本実施形態では、例えば、図7(a)に示すような画像701に対して、図7(b)で示すように9行7列に測距領域を配置する。なお、この9行7列に配置された測距領域をまとめて測距エリア801(第1の測距領域)と呼ぶ。   First, in S301, it is determined whether or not the detected subject is outside the plurality of arranged ranging areas. In this embodiment, for example, with respect to an image 701 as shown in FIG. 7A, ranging areas are arranged in 9 rows and 7 columns as shown in FIG. 7B. The distance measurement areas arranged in 9 rows and 7 columns are collectively referred to as a distance measurement area 801 (first distance measurement area).

検出された被写体が測距エリア801の外側にある場合はその被写体までの距離を測距することができないので、測距領域毎のピークポジションを取得する必要がない。そのため、被写体が測距エリア801の外であると判定された場合は(S301でYES)、S306にて測距領域毎のピークポジションを取得しないと判定し、処理を完了する。   When the detected subject is outside the distance measuring area 801, the distance to the subject cannot be measured, and it is not necessary to acquire the peak position for each distance measuring region. Therefore, if it is determined that the subject is outside the distance measurement area 801 (YES in S301), it is determined in S306 that the peak position for each distance measurement area is not acquired, and the process is completed.

検出された被写体が測距エリア801内にあると判定された場合は(S301でNO)、S302にて検出された被写体が動いているかどうかの判定を行う。被写体が動いている場合は(S302でYES)正しく測距を行うことができず、測距領域毎のピークポジションを取得することができないため、S306にて測距領域毎のピークポジションを取得しないと判定し、処理を完了する。   If it is determined that the detected subject is within the distance measuring area 801 (NO in S301), it is determined whether the subject detected in S302 is moving. If the subject is moving (YES in S302), the distance cannot be measured correctly, and the peak position for each distance measurement area cannot be acquired. Therefore, the peak position for each distance measurement area is not acquired in S306. To complete the process.

被写体が動いていないと判定された場合は(S302でNO)、S303にて撮影シーンが低照度かどうかの判定を行う。撮影シーンが低照度になると輝度を適正に保つ為にゲインをかける必要があるが、ゲインが所定以上かかると正しく測距を行うことができないため、測距領域毎のピークポジションを取得することができない。そのため、撮影シーンが低照度であると判定された場合は(S303でYES)、S306にて測距領域毎のピークポジションを取得しないと判定し、処理を完了する。   If it is determined that the subject is not moving (NO in S302), it is determined in S303 whether the photographic scene has low illuminance. When the shooting scene is low illuminance, it is necessary to apply a gain to keep the brightness appropriate. However, if the gain exceeds a predetermined value, the distance cannot be measured correctly, so the peak position for each distance measurement area can be acquired. Can not. Therefore, when it is determined that the shooting scene has low illuminance (YES in S303), it is determined in S306 that the peak position for each distance measurement area is not acquired, and the process is completed.

撮影シーンが低照度でないと判定された場合は(S303でNO)、S304にて撮影シーンが点光源かの判定を行う。点光源とは、光源が小さく点となってるようなシーンで、そのようなシーンでは正しく測距を行うことができず、測距領域毎のピークポジションを取得することができない。そのため、撮影シーンが点光源であると判定された場合は(S304でYES)、S306にて測距領域毎のピークポジションを取得しないと判定し、処理を完了する。   If it is determined that the shooting scene is not low illuminance (NO in S303), it is determined in S304 whether the shooting scene is a point light source. The point light source is a scene in which the light source is a small point, and in such a scene, distance measurement cannot be performed correctly, and the peak position for each distance measurement area cannot be obtained. Therefore, when it is determined that the shooting scene is a point light source (YES in S304), it is determined in S306 that the peak position for each distance measurement area is not acquired, and the process is completed.

撮影シーンが点光源でないと判定された場合は(S304でNO)、S305において測距領域毎のピークポジションを取得すると判定し、処理を完了する。   If it is determined that the shooting scene is not a point light source (NO in S304), it is determined in S305 that a peak position for each distance measurement area is acquired, and the process is completed.

上述したS202の処理の結果、S203において測距領域毎のピークポジションを取得しないと判定した場合はS204に進み、フォーカスレンズ104を移動させながら測距領域毎のピークポジションを取得せずにAF評価値を取得するスキャンを行う。ここでは例えば、画面の中央付近の領域や、画面全体など、予め決められた領域から得られる画像信号等に基づいてAF評価値を取得する。そして、取得したAF評価値に基づいてS205にて合焦位置へ移動する。なお、合焦位置とは、画像全体においてピントを合わせるべきであると判断したピークポジションのことであり、例えば、AF評価値に基づいて求められたピークポジションの中の、最至近のピークポジションとする。   As a result of the processing of S202 described above, if it is determined in S203 that the peak position for each distance measurement area is not acquired, the process proceeds to S204, and AF evaluation is performed without acquiring the peak position for each distance measurement area while moving the focus lens 104. Perform a scan to get the value. Here, for example, the AF evaluation value is acquired based on an image signal obtained from a predetermined area such as an area near the center of the screen or the entire screen. And based on the acquired AF evaluation value, it moves to a focus position in S205. The in-focus position is a peak position at which it is determined that the entire image should be focused. For example, the in-focus position is the nearest peak position among the peak positions obtained based on the AF evaluation value. To do.

次に、S206にてSW2(120)が押されたかどうかの判定を行う。SW2(120)が押されていないと判定された場合はS206に戻ってSW2(120)の判定を繰り返す。SW2(120)が押されたと判定されると、S207で撮影を行う。ここで、例えば、露出条件や色効果フィルタ等を変更して連続して画像を撮影するブラケット撮影を行っても良い。   Next, in S206, it is determined whether or not SW2 (120) has been pressed. When it is determined that SW2 (120) is not pressed, the process returns to S206 and the determination of SW2 (120) is repeated. If it is determined that SW2 (120) is pressed, shooting is performed in S207. Here, for example, bracket shooting may be performed in which exposure conditions, color effect filters, and the like are changed to continuously capture images.

一方、S203にて測距領域毎のピークポジションを取得すると判定した場合は、S208に進む。S208では、測距領域毎のピークポジションを取得する為に、画面内に複数の測距領域を配置し、測距領域毎のピークポジション取得スキャン(以下、単に「ピークポジション取得スキャン」と記す。)を行って、各領域毎にAF評価値を取得する。なお、測距領域は上述したように、例えば、図7(b)のように9行7列に配置されているものとするが、本発明はこれに限られるものではなく、画面内の距離が分かるのであれば、他の配置であっても構わない。   On the other hand, if it is determined in S203 that the peak position for each ranging area is acquired, the process proceeds to S208. In S208, in order to acquire the peak position for each distance measurement area, a plurality of distance measurement areas are arranged in the screen, and the peak position acquisition scan for each distance measurement area (hereinafter simply referred to as “peak position acquisition scan”). ) To obtain an AF evaluation value for each area. As described above, the distance measurement areas are arranged in 9 rows and 7 columns as shown in FIG. 7B, for example. However, the present invention is not limited to this, and the distance within the screen. If it is understood, other arrangements may be used.

次に、S209にて、S208で得られたAF評価値に基づいて、測距領域毎のピークポジション(各測距領域の合焦位置)を取得する。以下、ここで得られた測距領域毎のピークポジションを「第1のピークポジション情報」(第1の合焦位置)と呼び、その一例を図8(a)に示す。上述したS208及びS209の処理が第1の処理に相当する。)なお、図8(a)の「×」は、被写体のコントラストが低い、または被写体がスキャン中に測距領域から移動した等の理由により、正しく測距できなかった場合の、使用不可能な測距結果を表している。このように、測距結果の使用の可否を判断し、使用可能な測距結果を用いるようにする。   Next, in S209, based on the AF evaluation value obtained in S208, the peak position for each distance measurement area (the focus position of each distance measurement area) is acquired. Hereinafter, the peak position for each distance measurement area obtained here is referred to as “first peak position information” (first in-focus position), and an example thereof is shown in FIG. The processes of S208 and S209 described above correspond to the first process. Note that “x” in FIG. 8A cannot be used when the subject cannot be measured correctly because the subject contrast is low or the subject has moved from the ranging area during scanning. Indicates the distance measurement result. In this way, it is determined whether or not the distance measurement result can be used, and the usable distance measurement result is used.

次にS210にて、第1のピークポジション情報のうち、合焦させるべきピークポジション、即ち、合焦位置を選択する。ここで、合焦位置の決定方法について説明する。   Next, in S210, a peak position to be focused, that is, a focus position is selected from the first peak position information. Here, a method for determining the in-focus position will be described.

被写体が検出されている場合は、図9(a)に示すように被写体枠1201が画面に表示される。この被写体枠1201は被写体と判定されている領域を示す。この被写体領域にかかる測距領域1202で示す領域(第2の測距領域)を、ピークポジションを選択するエリアとする。一方、被写体が検出されていない場合は、図9(b)に示すように画面中央の所定領域1301(第2の測距領域)をピークポジションを選択するエリアとする。   When a subject is detected, a subject frame 1201 is displayed on the screen as shown in FIG. The subject frame 1201 indicates an area determined as a subject. An area indicated by a distance measurement area 1202 (second distance measurement area) relating to the subject area is set as an area for selecting a peak position. On the other hand, when no subject is detected, a predetermined area 1301 (second distance measurement area) in the center of the screen is set as an area for selecting a peak position, as shown in FIG. 9B.

そして、選択されたエリア内において、所定深度内のピークポジションを持ち、かつ、隣接する測距領域が存在するかどうかを判定する。この条件にあてはまる測距領域を隣接測距領域とする。隣接測距領域が存在する場合は、各隣接測距領域の中で最至近のピークポジションを持つ隣接測距領域を選択し、そのピークポジションを合焦位置として選択する。隣接する測距領域が存在しない場合は、選択されたエリアの中での最至近のピークポジションを合焦位置とする。   Then, it is determined whether or not there is an adjacent distance measurement area having a peak position within a predetermined depth in the selected area. A distance measurement area that satisfies this condition is set as an adjacent distance measurement area. If there is an adjacent ranging area, an adjacent ranging area having the nearest peak position is selected from each adjacent ranging area, and the peak position is selected as the in-focus position. If there is no adjacent distance measurement area, the closest peak position in the selected area is set as the in-focus position.

次に、S211にて、第1のピークポジション情報を用いて、撮像しているシーンに距離差が無いか、つまり所定距離範囲内に被写体が分布しているかどうかの判定を行う。本実施形態での距離分布判定では、第1のピークポジション情報を比較し、差が少なければ所定距離範囲内に被写体が分布していると判定する。なお、この距離分布判定は、被写体が所定距離範囲内にあるかどうかを判定することができるならば、他の方法を用いても良い。   Next, in S211, it is determined using the first peak position information whether there is no distance difference in the scene being imaged, that is, whether the subject is distributed within a predetermined distance range. In the distance distribution determination in the present embodiment, the first peak position information is compared, and if the difference is small, it is determined that the subject is distributed within a predetermined distance range. In this distance distribution determination, other methods may be used as long as it can be determined whether or not the subject is within a predetermined distance range.

所定距離範囲内に被写体が分布していると判定された場合は、S205に進んで、上述した処理を行う。なお、S205では、S210で求めた合焦位置へフォーカスレンズ104を移動する。S211において被写体が所定距離範囲内に無いと判定された場合は、次にS212にて合わせ込みスキャン処理を行う。   If it is determined that the subject is distributed within the predetermined distance range, the process proceeds to S205 and the above-described processing is performed. In S205, the focus lens 104 is moved to the in-focus position obtained in S210. If it is determined in S211 that the subject is not within the predetermined distance range, an alignment scan process is performed in S212.

(合わせ込みスキャン)
ここでS212で行われる合わせ込みスキャン処理(第2の処理)について、図4のフローチャートを参照して説明する。まず、S401にて、被写体が検出されていて、かつ、その検出されている被写体が顔かどうかの判定を行う。顔だと判定された場合は、被写体のサイズが検出可能であるので、次にS402にて、背景抜けを抑える為に、その被写体のサイズに合わせて測距エリアの再設定を行う。なお、本実施形態では、被写体が顔の場合に再設定を行うとしているが、被写体のサイズが検出できるならば、どのような被写体でも測距エリアの再設定をしても構わない。
(Adjusting scan)
Here, the alignment scan process (second process) performed in S212 will be described with reference to the flowchart of FIG. First, in step S401, it is determined whether a subject is detected and whether the detected subject is a face. If it is determined that the subject is a face, the size of the subject can be detected. In step S402, the distance measurement area is reset according to the size of the subject in order to suppress background loss. In the present embodiment, resetting is performed when the subject is a face. However, the distance measurement area may be reset for any subject as long as the size of the subject can be detected.

ここで、背景抜けについて図11を用いて説明する。図11(a)において、1501は無限遠側にある被写体のAF評価値、1502はその被写体より至近側にある別の被写体のAF評価値、1503はピークポジション取得スキャンにおいてAF評価値を取得した位置である。   Here, background loss will be described with reference to FIG. In FIG. 11A, reference numeral 1501 denotes an AF evaluation value of a subject on the infinity side, 1502 denotes an AF evaluation value of another subject closer to the subject, and 1503 acquires an AF evaluation value in a peak position acquisition scan. Position.

上述したピークポジション取得スキャンでは無限遠側から至近側までの広い範囲をスキャンするので、フォーカスレンズ104を速い速度で動かしている。その為、AF評価値を取得するポイント間隔は広くなり、無限遠側と至近側の両方のAF評価値からピークポジションが求められるので、至近側に被写体が有っても無限遠側の被写体の影響を受ける。この現象を背景抜けという。   Since the peak position acquisition scan described above scans a wide range from the infinity side to the close side, the focus lens 104 is moved at a high speed. For this reason, the point interval for acquiring the AF evaluation value is wide, and the peak position is obtained from the AF evaluation values on both the infinity side and the close side, so even if there is a subject on the close side, to be influenced. This phenomenon is called background loss.

次に、S403にて、スキャン時にフォーカスレンズ104を移動させる速度、及び、AF評価値を取得するポイント数からなるスキャンパラメータの設定を行う。合わせ込みスキャンにおいてフォーカスレンズ104を移動させる速度は、ピークポジション取得スキャン時の速度より遅い速度に設定する。   Next, in S403, a scan parameter including a speed at which the focus lens 104 is moved during scanning and the number of points from which an AF evaluation value is acquired is set. The speed at which the focus lens 104 is moved in the alignment scan is set to a speed slower than the speed at the time of peak position acquisition scan.

なお、被写体のサイズが分かっており、背景抜けが発生しないように測距領域を設定している場合は、背景抜けが発生しないので、スキャンのパラメータを、被写体のサイズが分からない場合と異らせてもよい。   Note that if the subject size is known and the ranging area is set so that background loss does not occur, background loss does not occur, so the scan parameters differ from those when the subject size is unknown. It may be allowed.

次に、S404にてフォーカスレンズ104のスキャン範囲を設定する。スキャン範囲は、図2のS210にて決定された合焦位置を中心として設定する。合焦位置として、被写体にピントの合う位置が選択されているので、この位置を中心にしてスキャンを行えば、対象となる被写体のピークポジションを正しく捉えることができる。これにより、図11(b)の1504で示すように狭い範囲(第2のスキャン範囲)にてAF評価値を取得することができ、無限遠側の被写体の影響を受けずに、至近側の被写体のピークポジションを計算すことが可能である。   In step S404, the scan range of the focus lens 104 is set. The scan range is set around the in-focus position determined in S210 of FIG. Since a focus position is selected as the in-focus position, if the scan is performed around this position, the peak position of the target subject can be correctly captured. As a result, the AF evaluation value can be acquired in a narrow range (second scan range) as indicated by 1504 in FIG. 11B, and is not affected by the subject on the infinity side. It is possible to calculate the peak position of the subject.

次に、S405にて、設定したスキャンパラメータ及びスキャン範囲にて、合わせ込みスキャンを行い、得られたAF評価値に基づいて測距エリアの測距領域毎のピークポジションを取得する。ここで求められた測距エリアの測距領域毎のピークポジションを、以下、「第2のピークポジション情報」(第2の合焦位置)と呼び、その一例を図8(b)に示す。図8(b)において、測距エリア外の領域、被写体のコントラストが低い、被写体がスキャン中に測距領域から移動した、スキャン範囲に被写体が存在しない等の理由により、正しく測距できなかった測距領域には「×」が記されている。なお、スキャン範囲に被写体が存在しないとは、スキャン範囲の至近側端よりも更に近側側、もしくは無限遠側端よりも更に無限遠側に被写体がある場合である。   Next, in S405, an alignment scan is performed with the set scan parameter and scan range, and a peak position for each distance measurement area of the distance measurement area is acquired based on the obtained AF evaluation value. The peak position for each distance measurement area obtained here is hereinafter referred to as “second peak position information” (second focus position), and an example thereof is shown in FIG. In FIG. 8B, the distance could not be measured correctly because the area outside the distance measurement area, the contrast of the subject was low, the subject moved from the distance measurement area during scanning, or the subject did not exist in the scan range. “×” is written in the distance measurement area. Note that the absence of a subject in the scan range is a case where the subject is closer to the near end of the scan range or closer to the infinity side than the infinity end.

この合わせ込みスキャンを行うことで、顔のように被写体領域が分かる被写体の場合は、被写体に適したピントの位置を取得することができ、被写体のサイズが分からない場合でも遠近競合の影響を少なくしたピントの位置を取得することができる。   By performing this fitting scan, it is possible to acquire the focus position suitable for the subject when the subject area is known like a face, and the influence of perspective conflict is reduced even if the subject size is unknown. The focus position can be acquired.

図4に示す合わせ込みスキャンが終了すると図2のS213に進み、S212における合わせ込みスキャンの処理結果(第2のピークポジション情報)と、S209で得られた第1のピークポジション情報とを合成する。   When the alignment scan shown in FIG. 4 is completed, the process proceeds to S213 in FIG. 2 to synthesize the alignment scan processing result (second peak position information) in S212 and the first peak position information obtained in S209. .

(ピークポジション情報の合成)
ここでS213で行われるピークポジション情報合成処理について、図5のフローチャートを参照して説明する。まず、S501にて、図7(b)に示すように配置された測距領域の1つについて、図8(a)に示すように第1のピークポジション情報が得られている場合に、第1のピークポジション情報が使用可能かの判定を行う。例えば、図8(a)において、「×」が記されている測距領域は、第1のピークポジション情報が使用不可能な測距領域である。
(Composition of peak position information)
Here, the peak position information synthesis processing performed in S213 will be described with reference to the flowchart of FIG. First, in S501, when the first peak position information is obtained for one of the ranging areas arranged as shown in FIG. 7B, as shown in FIG. It is determined whether the peak position information of 1 can be used. For example, in FIG. 8A, a distance measurement area marked with “x” is a distance measurement area where the first peak position information cannot be used.

なお、被写体がスキャン中に測距領域から移動したかの判定には、AF評価値を使用しても良い。また、被写体がスキャン中に測距領域から移動しない場合、AF評価値はフォーカスレンズ104の位置と被写体までの距離に応じて山の形状になるが、被写体が移動した場合は、山の形状にならない。このことを利用して移動したかどうかの判定を行ってもよい。   An AF evaluation value may be used to determine whether the subject has moved from the distance measurement area during scanning. Also, if the subject does not move from the ranging area during scanning, the AF evaluation value has a mountain shape according to the position of the focus lens 104 and the distance to the subject, but if the subject moves, it has a mountain shape. Don't be. You may determine whether it moved using this.

S501にて、第1のピークポジション情報が使用可能ではないと判定された場合は、次にS503にて第2のピークポジション情報が使用可能かの判定を行う。例えば、図8(b)に示すように、同じ測距領域が「×」であれば、第2のピークポジション情報は使用不可能である。第2のピークポジション情報が使用可能であれば、S504にて第2のピークポジション情報を採用し、S510に進む。   If it is determined in S501 that the first peak position information is not usable, it is next determined in S503 whether the second peak position information is usable. For example, as shown in FIG. 8B, if the same distance measurement area is “x”, the second peak position information cannot be used. If the second peak position information is usable, the second peak position information is adopted in S504, and the process proceeds to S510.

S503で第2のピークポジション情報も使用可能でなければ、第1、第2のピークポジション情報のどちらも使用可能ではないので、S505にてその測距領域のデータは不正なデータとし、S510に進む。   If the second peak position information is not usable in S503, neither the first peak position information nor the second peak position information can be used. Therefore, in S505, the data of the ranging area is invalid data, and the process returns to S510. move on.

一方、S501において第1のピークポジション情報が使用可能であると判定された場合は、次にS502において第2のピークポジション情報が使用可能であるかどうかを判定する。第2のピークポジション情報が使用可能ではないと判定された場合は、S506にて第1のピークポジション情報を採用し、S510に進む。   On the other hand, if it is determined in S501 that the first peak position information is usable, it is next determined in S502 whether the second peak position information is usable. If it is determined that the second peak position information is not usable, the first peak position information is adopted in S506, and the process proceeds to S510.

S502において第2のピークポジション情報が使用可能であると判定された場合は、S507にて第2のピークポジション情報が、第1のピークポジション情報と比較して至近側にピントが合うピークポジション情報であるかの判定を行う。背景抜けにて背景の被写体のAF評価値の影響を受けている場合は、至近側の被写体のピークポジションは無限遠側の被写体のピークポジションの影響を受け、無限遠側のピークポジションに近い数値となる。その数値よりも至近側であれば、正しく被写体のAF評価値にて測距できていると判断できる。第2のピークポジション情報が第1のピークポジション情報より至近側にピントが合うピークポジション情報であると判定された場合は、S508にて第2のピークポジション情報を採用し、S510に進む。また、第2のピークポジション情報が第1のピークポジション情報より無限遠側にピントが合うピークポジション情報であると判定された場合は、S509にて第1のピークポジション情報を採用し、S510に進む。   If it is determined in S502 that the second peak position information can be used, the second peak position information is focused on the closest side in comparison with the first peak position information in S507. It is determined whether or not. If the background subject is affected by the AF evaluation value of the background subject, the peak position of the subject on the near side is affected by the peak position of the subject on the infinity side, and is close to the peak position on the infinity side. It becomes. If it is closer to the numerical value, it can be determined that the distance is correctly measured using the AF evaluation value of the subject. When it is determined that the second peak position information is the peak position information that is in focus closer to the first peak position information, the second peak position information is adopted in S508, and the process proceeds to S510. Further, when it is determined that the second peak position information is the peak position information that is focused on the infinity side with respect to the first peak position information, the first peak position information is adopted in S509, and in S510 move on.

S510では測距エリア801の全ての測距領域における情報をチェックしたかの判定を行い、全測距領域のチェックを完了していれば、処理を完了する。全測距領域のチェックを完了していなければS501に戻り、別の測距領域について上記処理を繰り返す。   In S510, it is determined whether information in all the ranging areas in the ranging area 801 has been checked. If all the ranging areas have been checked, the process is completed. If the check of all the ranging areas has not been completed, the process returns to S501 and the above processing is repeated for another ranging area.

第1のピークポジション情報が図8(a)に示すものであり、第2のピークポジション情報が図8(b)に示すものである場合、上述した図5に示す合成処理により、図8(c)に示すように合成されたピークポジション情報が得られる。即ち、各測距領域において、第1のピークポジション情報と第2のピークポジション情報とを比較し、×ではない方を用いる。また、ピークポジション情報が異なる場合には、至近側を示すピークポジション情報を用いることにより(902、1002、1102、1103)、合成ピークポジション情報を得る。   When the first peak position information is shown in FIG. 8A and the second peak position information is shown in FIG. 8B, the combining process shown in FIG. As shown in c), synthesized peak position information is obtained. That is, in each ranging area, the first peak position information and the second peak position information are compared, and the one that is not x is used. If the peak position information is different, the combined peak position information is obtained by using the peak position information indicating the closest side (902, 1002, 1102, 1103).

次にS214にて、合成ピークポジション情報を用いて、合焦させるべきピークポジションを選択する。なお、合焦させるべきピークポジションの選択方法は、S210における処理と同様である。そして、補正したピークポジション情報を用いて、S211で説明した処理と同様にして、所定距離範囲内に被写体が分布しているかどうかを判定する。被写体が所定距離範囲内に分布していると判定された場合は、S205に進んで上述した処理を行う。なお、この場合S205では、S214にて決定した合焦位置へフォーカスレンズ104を移動する。   Next, in S214, the peak position to be focused is selected using the combined peak position information. Note that the method of selecting the peak position to be focused is the same as the processing in S210. Then, using the corrected peak position information, it is determined whether or not the subject is distributed within the predetermined distance range in the same manner as the processing described in S211. If it is determined that the subject is distributed within the predetermined distance range, the process proceeds to S205 and the above-described processing is performed. In this case, in S205, the focus lens 104 is moved to the in-focus position determined in S214.

一方、被写体が所定距離範囲内に無いと判定された場合は、次にS216にて、被写体エリアを生成する。本実施形態では、画面内の色情報や輝度情報から画像の領域分割を行い、被写体らしい領域を決め、その被写体らしい領域に対応する測距領域の合成ピークポジション情報の差分が所定範囲内であれば、その領域を被写体エリアとして設定する。また、被写体らしい領域が複数あり、それらの領域に対応する測距領域の合成ピークポジション情報の差分が所定範囲内であれば、それらの測距領域を1つの被写体エリアとして設定する。なお、その他の方法でも、画像の情報、被写体の距離情報などから、領域分割を行い被写体エリアを設定することが可能であれば、どのような方法でも構わない。被写体を検出するための領域分割は任意の分割方法で分割したものであって構わないが、測距領域と一致するように分割すれば、領域の色情報や輝度情報と被写体の距離情報を容易に一致させることが可能となる。図10は、測距領域と一致するように分割した場合の一例として、被写体エリア1401〜1405を示している。   On the other hand, if it is determined that the subject is not within the predetermined distance range, then a subject area is generated in S216. In this embodiment, the image is divided from the color information and luminance information in the screen, the region that is likely to be the subject is determined, and the difference in the combined peak position information of the ranging area corresponding to the region that is likely to be the subject is within the predetermined range. For example, the area is set as the subject area. Further, if there are a plurality of regions that are likely to be subjects, and the difference in the combined peak position information of the distance measurement regions corresponding to these regions is within a predetermined range, those distance measurement regions are set as one subject area. It should be noted that any other method may be used as long as it is possible to divide a region and set a subject area from image information, subject distance information, and the like. The area for detecting the subject may be divided by an arbitrary division method, but if it is divided so as to match the distance measurement area, the color information and luminance information of the area and the distance information of the subject can be easily obtained. Can be matched. FIG. 10 shows subject areas 1401 to 1405 as an example of the case of division so as to coincide with the distance measurement area.

次に、S217にて、生成された各被写体エリアの代表ピークポジション(代表合焦位置)を設定する。なお、代表ピークポジションの設定方法については、図6を用いて後述する。   Next, in S217, a representative peak position (representative in-focus position) of each generated subject area is set. The method for setting the representative peak position will be described later with reference to FIG.

次に、S218にて、被写体エリアの優先順位を設定する。ここで、被写体エリアの優先順位とは、フォーカスブラケット撮影時にピントを合わせる被写体エリアの順番のことであり、優先順位が高い被写体エリアから先にピントを合わせて撮影する。この優先順位は、S214で決められた、合焦位置となる代表ピークポジションを持つ測距領域に対応する被写体エリアを第1優先とし、被写体エリアのサイズが大きい、被写体エリアの位置が画像の中心に近い、等の状態から第2以降の優先順位を決定する。   Next, in S218, the priority order of the subject areas is set. Here, the priority order of the subject areas is the order of the subject areas to be focused at the time of focus bracket shooting, and the subject areas with higher priorities are focused first. This priority order is given priority to the subject area corresponding to the ranging area having the representative peak position as the in-focus position determined in S214, the subject area size is large, and the subject area position is the center of the image. The second and subsequent priorities are determined from a state such as close to.

次に、S219にて、SW2(120)が押されたかどうかの判定を行う。SW2(120)が押されていないと判定された場合は、S219に戻ってSW2(120)の判定を繰り返す。SW2(120)が押されたと判定された場合は、次にS220にて、S218にて決定した優先順位に基づいて、各被写体エリアにピントの合うフォーカスレンズ104の位置へ順に移動させながら、フォーカスブラケット撮影処理を行う。   Next, in S219, it is determined whether or not SW2 (120) has been pressed. If it is determined that SW2 (120) is not pressed, the process returns to S219 and repeats the determination of SW2 (120). If it is determined that SW2 (120) has been pressed, in step S220, the focus lens 104 is sequentially moved to the position of the focus lens 104 in focus on each subject area based on the priority order determined in step S218. Perform bracket shooting processing.

次に、S221にて各被写体エリアのピークポジション情報に基づき、画像処理によるボカシ処理を付与し、処理を完了する。画像処理によるボカシ処理は、各被写体エリアのピークポジションの差分により、ボカシ量が異なる。例えば、各被写体エリアのピークポジション差分が所定以上大きい場合は、光学的なボケが大きいのでそれ以上のボカシ処理は付与しないが、差分が少ない場合は、画像処理によるボカシ量を多くする。   Next, in S221, based on the peak position information of each subject area, blur processing by image processing is applied, and the processing is completed. In the blur processing by image processing, the amount of blur varies depending on the difference in peak position of each subject area. For example, when the peak position difference of each subject area is larger than a predetermined value, the optical blur is large and no further blur processing is applied, but when the difference is small, the blur amount by image processing is increased.

(各被写体エリアの代表ピークポジション設定)
S217で行われる、各被写体エリアの代表ピークポジション設定処理について、図6を参照して説明する。なお、この図6に示す処理は、S216で生成された全ての被写体エリアに対する処理が終了するまで、繰り返し行われる。まず、S601にて、撮影しているシーンにおける被写体が顔であるかどうかを判定する。被写体が顔であると判定された場合は、S602にて、検出されている顔に対応する被写体エリアを決定する。なお、顔に対応する被写体エリアは、S216で生成された被写体エリアの内、検出されている顔の位置に対応する位置にある被写体エリアを選択することで決定することができる。
(Representative peak position setting for each subject area)
The representative peak position setting process for each subject area performed in S217 will be described with reference to FIG. Note that the processing shown in FIG. 6 is repeated until the processing for all the subject areas generated in S216 is completed. First, in S601, it is determined whether or not the subject in the scene being shot is a face. If it is determined that the subject is a face, a subject area corresponding to the detected face is determined in S602. The subject area corresponding to the face can be determined by selecting the subject area at the position corresponding to the detected face position from the subject areas generated in S216.

次に、S603にて、合わせ込みスキャン時に顔領域に再設定した測距エリアのピークポジションを、対応する被写体エリアの代表ピークポジションとして設定する。これにより、顔に対応する被写体エリアに適したピークポジションを対応付けることができる。   Next, in S603, the peak position of the distance measurement area reset to the face area during the fitting scan is set as the representative peak position of the corresponding subject area. Thereby, the peak position suitable for the subject area corresponding to the face can be associated.

一方、S601にて顔ではないと判定された場合は、次にS604にて被写体エリアに対応する測距領域を選択する。被写体エリアに対応する測距領域とは、図10の1401〜1405のように、点線や実線で囲われている領域のことである。領域1403、1404、1405は、合成ピークポジション情報が所定範囲内にあるので、一つの測距エリアにまとめられる。つまり、被写体エリアに対応する測距領域としては、1401に示す測距エリア1、1402に示す測距エリア2、1403、1404、1405が統合された背景エリアとしての測距エリア3となる。   On the other hand, if it is determined in step S601 that the face is not a face, in step S604, a distance measurement area corresponding to the subject area is selected. The distance measurement area corresponding to the subject area is an area surrounded by a dotted line or a solid line as indicated by reference numerals 1401 to 1405 in FIG. The areas 1403, 1404, and 1405 are combined into one distance measurement area because the combined peak position information is within a predetermined range. That is, the distance measurement area 3 corresponding to the subject area is the distance measurement area 3 as a background area in which the distance measurement areas 1 and 1402 indicated by reference numeral 1401 and the distance measurement areas 2, 1403, 1404, and 1405 indicated by reference numeral 1402 are integrated.

次に、S605にて、S604で選択した測距領域の中で正しく測距できている測距領域を選択エリアとして選択する。図10に示す例では、被写体エリアとして選択された測距領域内は全て合焦ピークポジション情報が設定されているが、適切な情報が得られなかった(「×」で示す)場合もあるので、ここでそのような測距領域を除去した測距領域を選択エリアとして設定する。   Next, in S605, a distance measurement area that is correctly measured in the distance measurement area selected in S604 is selected as a selection area. In the example shown in FIG. 10, in-focus peak position information is set for all the distance measurement areas selected as the subject areas, but appropriate information may not be obtained (indicated by “x”). Here, a ranging area from which such a ranging area is removed is set as a selection area.

次に選択エリアに含まれる測距領域、即ち、合成ピークポジション情報を有する有効な測距領域の数を判定する。まずS606にて選択エリアに有効な測距領域が3つ以上含まれているかどうかの判定を行う。3つよりも少ないと判定された場合は、次にS607にて、選択エリアに含まれる有効な測距領域が0かを判定する。   Next, the number of distance measurement areas included in the selected area, that is, the number of effective distance measurement areas having composite peak position information is determined. First, in S606, it is determined whether or not three or more effective ranging areas are included in the selected area. If it is determined that there are fewer than three, it is next determined in S607 whether the effective distance measurement area included in the selected area is zero.

有効な測距領域が0と判定された場合は、次に、S608にて、その被写体エリアの代表ピークポジションを予め決めておいた定点(例えば、無限にピントの合うフォーカスレンズ位置)に設定し、処理を完了する。なお、代表ピークポジションとは、その被写体エリアに対応するピークポジションのことであり、被写体エリアの広い範囲にピントを合わせることができるフォーカスレンズ位置のことを指す。   If it is determined that the effective distance measurement area is 0, in step S608, the representative peak position of the subject area is set to a predetermined fixed point (for example, an infinitely focused focus lens position). , Complete the process. The representative peak position refers to a peak position corresponding to the subject area, and refers to a focus lens position that can focus on a wide range of the subject area.

有効な測距領域が0ではないと判定された場合は、次にS609にて有効な測距領域が1つかの判定を行う。選択エリア内の有効な測距領域が1つであると判定された場合は、S610にて、その測距領域の合成ピークポジション情報を被写体エリアの代表ピークポジションとする。有効な測距領域が1つではないと判定された場合は、選択エリアに含まれる有効な測距領域は2つとなるので、S611にて、2つのうち、至近側にピントの合う合成ピークポジション情報を代表ピークポジションとする。   If it is determined that the effective distance measurement area is not 0, it is next determined in step S609 whether one effective distance measurement area is present. If it is determined that there is one effective ranging area in the selected area, the combined peak position information of the ranging area is set as the representative peak position of the subject area in S610. If it is determined that there is not one effective distance measurement area, there are two effective distance measurement areas included in the selected area. Therefore, in S611, the combined peak position that is in focus on the closest side of the two areas. Information is the representative peak position.

S606にて、有効な測距領域が3つ以上であると判定された場合は、次にS612にて、選択エリア内の測距領域の合成ピークポジション情報を至近側からピントの合う順に並び替える。次に、S613にて最至近にピントの合う合成ピークポジション情報を最初の比較基データとして設定する。   If it is determined in S606 that there are three or more effective ranging areas, then in S612, the composite peak position information of the ranging areas in the selected area is rearranged in the order of focus from the closest side. . Next, in S613, the synthetic peak position information that is in closest focus is set as the first comparison base data.

次にS614にて、選択エリア内の測距領域における合成ピークポジション情報全てに対して比較が行われたかどうかの判定を行う。全てに対しての比較が行われていない場合は、次にS615にて1つ無限遠側の合成ピークポジションを比較基データとの比較対象として設定する。1度目の比較では比較基データが示す合成ピークポジション情報に対して1つ無限遠側、2度目以降の比較では、その前に比較対象となった合成ピークポジション情報の1つ無限遠側が、比較対象の合成ピークポジション情報となる。   Next, in S614, it is determined whether or not comparison has been performed for all the combined peak position information in the distance measurement area within the selected area. If all the comparisons have not been performed, next, one synthetic peak position on the infinity side is set as a comparison target with the comparison base data in S615. In the first comparison, one infinity side is compared to the synthetic peak position information indicated by the comparison base data. In the second and subsequent comparisons, one infinity side of the synthetic peak position information that was compared before is compared. This is the target synthetic peak position information.

次にS616にて、比較基データと、比較対象の合成ピークポジション情報との差分を計算する。その差分が所定焦点深度以内、例えば比較基データと比較対象の合成ピークポジション情報が1深度内であると判定された場合は、次にS618にて、同一深度カウンタを増分する。同一深度カウンタは、比較基データの測距領域に対して付与され、その測距領域と同一深度の測距領域の数がいくつあるかどうかを判定する為に用いられる。   Next, in S616, the difference between the comparison base data and the composite peak position information to be compared is calculated. If it is determined that the difference is within a predetermined depth of focus, for example, the comparison base data and the combined peak position information to be compared are within one depth, then in S618, the same depth counter is incremented. The same depth counter is given to the distance measurement area of the comparison base data, and is used to determine how many distance measurement areas have the same depth as the distance measurement area.

次にS619にて、現在の比較基データの測距領域に付与されている同一深度カウンタが選択エリア内の他の測距領域と比べて最大かの判定を行う。同一深度カウンタが最大であると判定された場合は、比較基データとして設定されている合成ピークポジション情報を代表ピークポジションとして設定する。この処理により、合成ピークポジション情報が最も集中している深度を求めることができる。最大でないと判定された場合は、S614に戻る。   In step S619, it is determined whether the same depth counter assigned to the distance measurement area of the current comparison base data is the maximum as compared to other distance measurement areas in the selected area. When it is determined that the same depth counter is maximum, the combined peak position information set as the comparison base data is set as the representative peak position. By this processing, the depth at which the combined peak position information is most concentrated can be obtained. If it is determined that it is not the maximum, the process returns to S614.

S616にて差分が所定深度外であると判定された場合は、S617にて比較対象の測距領域の合成ピークポジション情報を比較基データとして設定し、S614に戻る。S614にて選択エリア内の有効な測距領域における合成ピークポジション情報全てに対しての比較が行われていると判定された場合は、S621にて、代表ピークポジションが設定されているかの判定を行う。代表ピークポジションが設定されていると判定された場合は、処理を完了する。   If it is determined in S616 that the difference is outside the predetermined depth, the combined peak position information of the distance measurement area to be compared is set as comparison base data in S617, and the process returns to S614. If it is determined in S614 that all the combined peak position information in the effective ranging area in the selected area has been compared, it is determined in S621 whether a representative peak position has been set. Do. If it is determined that the representative peak position is set, the process is completed.

代表ピークポジションが設定されていないと判定された場合は、選択エリア内の有効な測距領域間で、同一深度の合成ピークポジション情報が1つも無い、ということになる。この場合、S622にて、有効な測距領域の合成ピークポジション情報のうち、最至近の合成ピークポジション情報を代表ピークポジションに設定し、処理を完了する。   If it is determined that the representative peak position is not set, it means that there is no composite peak position information of the same depth between valid ranging areas in the selected area. In this case, in S622, the nearest synthetic peak position information is set as the representative peak position among the synthetic peak position information of the effective ranging area, and the processing is completed.

なお、上述した例では、同一深度カウンタが最大となる比較基データを代表ピークポジションとして設定する場合について説明したが、本発明はこれに限るものではない。例えば、同一深度カウンタが最大となる深度内に分布する合成ピークポジション情報の中央値、平均値、極大値等の統計的な値を代表ピークポジションとしてもよい。   In the example described above, the case where the comparison base data that maximizes the same depth counter is set as the representative peak position has been described, but the present invention is not limited to this. For example, a statistical value such as a median value, an average value, and a maximum value of the combined peak position information distributed within the depth at which the same depth counter is maximum may be used as the representative peak position.

以上説明したように、本発明によれば、領域分割された被写体の代表ピークポジションを決めることが可能である。これにより各領域分割された被写体に適したフォーカスレンズ位置での撮影を行うことができる。   As described above, according to the present invention, it is possible to determine the representative peak position of the subject divided into regions. As a result, it is possible to perform photographing at the focus lens position suitable for the subject divided into the respective regions.

以上、本発明をその好適な実施形態に基づいて詳述してきたが、本発明はこれら特定の実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。上述の実施形態の一部を適宜組み合わせてもよい。   Although the present invention has been described in detail based on preferred embodiments thereof, the present invention is not limited to these specific embodiments, and various forms within the scope of the present invention are also included in the present invention. included. A part of the above-described embodiments may be appropriately combined.

また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(または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.

Claims (12)

予め決められた複数の測距領域からなる第1の測距領域の一部を第2の測距領域として設定する設定手段と、
前記第1の測距領域に含まれる各測距領域について第1の合焦位置を取得する第1の処理と、前記第2の測距領域に含まれる各測距領域について第2の合焦位置を取得する第2の処理とを行う取得手段と、
前記第1の合焦位置を前記第2の合焦位置を用いて補正する補正手段とを有し、
前記第1の合焦位置は、フォーカスレンズを予め決められた第1のスキャン範囲で駆動しながら複数のフォーカスレンズ位置で求めた合焦状態を示す評価値に基づいて求められた、該評価値がピークとなるフォーカスレンズ位置であり、前記第2の合焦位置は、前記フォーカスレンズを前記第1のスキャン範囲よりも狭い第2のスキャン範囲で駆動しながら複数のフォーカスレンズ位置で得られた評価値に基づいて求められた、該評価値がピークとなるフォーカスレンズ位置であることを特徴とする撮像装置。
Setting means for setting a part of a first distance measurement area composed of a plurality of predetermined distance measurement areas as a second distance measurement area;
A first process for obtaining a first focus position for each distance measurement area included in the first distance measurement area, and a second focus for each distance measurement area included in the second distance measurement area. Acquisition means for performing a second process of acquiring a position;
Correction means for correcting the first in-focus position using the second in-focus position;
The first in-focus position is obtained based on an evaluation value indicating an in-focus state obtained at a plurality of focus lens positions while driving the focus lens in a predetermined first scan range. The second focus position is obtained at a plurality of focus lens positions while driving the focus lens in a second scan range narrower than the first scan range. An imaging apparatus characterized by a focus lens position obtained based on an evaluation value, at which the evaluation value reaches a peak.
前記第2のスキャン範囲は、前記第2の測距領域に対応する第1の測距領域の前記第1の合焦位置を中心として設定することを特徴とする請求項1に記載の撮像装置。   2. The imaging apparatus according to claim 1, wherein the second scan range is set around the first focus position of the first distance measurement area corresponding to the second distance measurement area. . 前記第2の処理における前記複数のフォーカスレンズ位置の間隔は、前記第1の処理における間隔よりも狭いことを特徴とする請求項1または2に記載の撮像装置。   The imaging apparatus according to claim 1, wherein an interval between the plurality of focus lens positions in the second process is narrower than an interval in the first process. 前記補正手段は、前記第1の合焦位置と前記第2の合焦位置が共に得られた測距領域について、互いに値が異なる場合に、前記第1の合焦位置と前記第2の合焦位置のうち、より至近側の方を選択して、該測距領域の合焦位置とすることを特徴とする請求項1乃至3のいずれか1項に記載の撮像装置。   The correction means is configured to detect the first focusing position and the second focusing position when the distance measurement areas in which both the first focusing position and the second focusing position are obtained have different values. The imaging apparatus according to any one of claims 1 to 3, wherein a closer side of the focus positions is selected and set as a focus position of the distance measurement area. 前記補正手段は、前記第1の合焦位置と前記第2の合焦位置のいずれかが得られた測距領域について、得られた合焦位置を前記測距領域の合焦位置とすることを特徴とする請求項1乃至4のいずれか1項に記載の撮像装置。   The correction means sets the obtained focus position as the focus position of the distance measurement area for the distance measurement area from which either the first focus position or the second focus position is obtained. The imaging device according to any one of claims 1 to 4, wherein 撮影した画像から被写体を検出する被写体検出手段を更に有し、
前記設定手段は、前記被写体検出手段により被写体が検出された場合に、前記第1の測距領域のうち、前記被写体に対応する測距領域を前記第2の測距領域として設定し、被写体が検出されなかった場合に、前記第1の測距領域のうち、予め決められた測距領域を前記第2の測距領域として設定することを特徴とする請求項1乃至5のいずれか1項に記載の撮像装置。
It further has subject detection means for detecting a subject from the photographed image,
The setting means sets, as the second distance measurement area, a distance measurement area corresponding to the subject in the first distance measurement area when the subject is detected by the subject detection means. 6. The method according to claim 1, wherein a predetermined distance measurement area of the first distance measurement areas is set as the second distance measurement area when not detected. 7. The imaging device described in 1.
前記取得手段は、前記評価値に基づいて各測距領域の合焦位置の使用の可否を判断して、使用可能な合焦位置を前記第1及び第2の合焦位置とすることを特徴とする請求項乃至6のいずれか1項に記載の撮像装置。   The acquisition unit determines whether or not the focus position of each ranging area can be used based on the evaluation value, and sets the usable focus positions as the first and second focus positions. The imaging apparatus according to any one of claims 1 to 6. 前記取得手段は、各測距領域の前記評価値が成す形状に基づいて、前記合焦位置の使用の可否を判断することを特徴とする請求項7に記載の撮像装置。   The imaging apparatus according to claim 7, wherein the acquisition unit determines whether or not the focus position can be used based on a shape formed by the evaluation value of each distance measurement area. 前記第1の合焦位置が所定の距離範囲内に分布している場合に、前記第2の処理を行わないことを特徴とする請求項1乃至8のいずれか1項に記載の撮像装置。   9. The imaging apparatus according to claim 1, wherein the second process is not performed when the first in-focus positions are distributed within a predetermined distance range. 10. 取得手段が、予め決められた複数の測距領域からなる第1の測距領域に含まれる各測距領域について第1の合焦位置を取得する第1の処理工程と、
設定手段が、前記第1の測距領域の一部を第2の測距領域として設定する設定工程と、
前記取得手段が、前記第2の測距領域に含まれる各測距領域について第2の合焦位置を取得する第2の処理工程と、
補正手段が、前記第1の合焦位置を前記第2の合焦位置を用いて補正する補正工程とを有し、
前記第1の合焦位置は、フォーカスレンズを予め決められた第1のスキャン範囲で駆動しながら複数のフォーカスレンズ位置で求めた合焦状態を示す評価値に基づいて求められた、該評価値がピークとなるフォーカスレンズ位置であり、前記第2の合焦位置は、前記フォーカスレンズを前記第1のスキャン範囲よりも狭い第2のスキャン範囲で駆動しながら複数のフォーカスレンズ位置で得られた評価値に基づいて求められた、該評価値がピークとなるフォーカスレンズ位置であることを特徴とする撮像装置の制御方法。
A first processing step in which the acquisition means acquires a first in-focus position for each ranging area included in the first ranging area composed of a plurality of predetermined ranging areas;
A setting step in which a setting unit sets a part of the first ranging area as a second ranging area;
A second processing step in which the acquisition means acquires a second in-focus position for each ranging area included in the second ranging area;
A correction unit, the correction step of correcting the first focus position using the second focus position,
The first in-focus position is obtained based on an evaluation value indicating an in-focus state obtained at a plurality of focus lens positions while driving the focus lens in a predetermined first scan range. The second focus position is obtained at a plurality of focus lens positions while driving the focus lens in a second scan range narrower than the first scan range. A control method for an image pickup apparatus, characterized in that a focus lens position at which the evaluation value reaches a peak is obtained based on the evaluation value.
コンピュータに、請求項10に記載の制御方法の各工程を実行させるためのプログラム。   The program for making a computer perform each process of the control method of Claim 10. 請求項11に記載のプログラムを格納したコンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 11.
JP2012280062A 2012-12-21 2012-12-21 Imaging apparatus and control method thereof Active JP6087617B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012280062A JP6087617B2 (en) 2012-12-21 2012-12-21 Imaging apparatus and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012280062A JP6087617B2 (en) 2012-12-21 2012-12-21 Imaging apparatus and control method thereof

Publications (3)

Publication Number Publication Date
JP2014123069A true JP2014123069A (en) 2014-07-03
JP2014123069A5 JP2014123069A5 (en) 2015-10-08
JP6087617B2 JP6087617B2 (en) 2017-03-01

Family

ID=51403585

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012280062A Active JP6087617B2 (en) 2012-12-21 2012-12-21 Imaging apparatus and control method thereof

Country Status (1)

Country Link
JP (1) JP6087617B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10564392B2 (en) 2016-03-30 2020-02-18 Fujifilm Corporation Imaging apparatus and focus control method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06317740A (en) * 1993-05-10 1994-11-15 Olympus Optical Co Ltd Line-of-sight detection device for camera
JP2001249267A (en) * 2000-03-03 2001-09-14 Ricoh Co Ltd Automatic focusing device, digital camera, portable information inputting device, focal position detecting method, and recording medium which can be read by computer
JP2004361484A (en) * 2003-06-02 2004-12-24 Nikon Corp Autofocus camera
JP2008281714A (en) * 2007-05-09 2008-11-20 Canon Inc Focus adjusting device, control method therefor, imaging apparatus, program and storage medium
JP2009025770A (en) * 2007-07-24 2009-02-05 Hoya Corp Focusing method and device
JP2010191084A (en) * 2009-02-17 2010-09-02 Canon Inc Focusing device and focusing method
JP2012123324A (en) * 2010-12-10 2012-06-28 Fujifilm Corp Imaging apparatus and main subject detection method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06317740A (en) * 1993-05-10 1994-11-15 Olympus Optical Co Ltd Line-of-sight detection device for camera
JP2001249267A (en) * 2000-03-03 2001-09-14 Ricoh Co Ltd Automatic focusing device, digital camera, portable information inputting device, focal position detecting method, and recording medium which can be read by computer
JP2004361484A (en) * 2003-06-02 2004-12-24 Nikon Corp Autofocus camera
JP2008281714A (en) * 2007-05-09 2008-11-20 Canon Inc Focus adjusting device, control method therefor, imaging apparatus, program and storage medium
JP2009025770A (en) * 2007-07-24 2009-02-05 Hoya Corp Focusing method and device
JP2010191084A (en) * 2009-02-17 2010-09-02 Canon Inc Focusing device and focusing method
JP2012123324A (en) * 2010-12-10 2012-06-28 Fujifilm Corp Imaging apparatus and main subject detection method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10564392B2 (en) 2016-03-30 2020-02-18 Fujifilm Corporation Imaging apparatus and focus control method

Also Published As

Publication number Publication date
JP6087617B2 (en) 2017-03-01

Similar Documents

Publication Publication Date Title
JP6204660B2 (en) Imaging apparatus and control method thereof
JP4578334B2 (en) In-focus position determining apparatus and method for imaging lens
JP5895270B2 (en) Imaging device
JP4923005B2 (en) Digital still camera and control method thereof
JP6518452B2 (en) Imaging apparatus and imaging method
CN104702824A (en) Image capturing apparatus and control method of image capturing apparatus
JP2014123809A (en) Imaging apparatus, imaging system, and imaging apparatus control method
JP2012049773A (en) Imaging apparatus and method, and program
JP2018107526A (en) Image processing device, imaging apparatus, image processing method and computer program
JP5100410B2 (en) Imaging apparatus and control method thereof
JP2015018084A (en) Imaging apparatus, image processing method, and image processing program
JP6234016B2 (en) Focus adjustment device, imaging device, and control method thereof
JP2023033355A (en) Image processing device and control method therefor
JP6087617B2 (en) Imaging apparatus and control method thereof
JP5387341B2 (en) Imaging device
JP2007248698A (en) Method and apparatus for imaging
JP6351255B2 (en) Imaging apparatus, imaging method, program, and storage medium
JP6089232B2 (en) Imaging device
JP2015118274A (en) Imaging device, imaging device control method, and program
JP6355324B2 (en) Imaging apparatus and control method thereof
US10277796B2 (en) Imaging control apparatus, imaging apparatus, and imaging control method
JP7271316B2 (en) Imaging device and its control method
JP5631084B2 (en) Image recording device
JP2009159238A (en) Automatic focus adjusting apparatus and imaging apparatus
JP2007184787A (en) Digital camera

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150818

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150818

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160527

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160603

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160721

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170202

R151 Written notification of patent or utility model registration

Ref document number: 6087617

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151