JP2020036288A - Image processing apparatus and electronic apparatus - Google Patents

Image processing apparatus and electronic apparatus Download PDF

Info

Publication number
JP2020036288A
JP2020036288A JP2018163565A JP2018163565A JP2020036288A JP 2020036288 A JP2020036288 A JP 2020036288A JP 2018163565 A JP2018163565 A JP 2018163565A JP 2018163565 A JP2018163565 A JP 2018163565A JP 2020036288 A JP2020036288 A JP 2020036288A
Authority
JP
Japan
Prior art keywords
image
focus
region
imaging
group
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
JP2018163565A
Other languages
Japanese (ja)
Other versions
JP7224811B2 (en
Inventor
英之 浜野
Hideyuki Hamano
英之 浜野
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 JP2018163565A priority Critical patent/JP7224811B2/en
Priority to US16/547,906 priority patent/US11763538B2/en
Publication of JP2020036288A publication Critical patent/JP2020036288A/en
Application granted granted Critical
Publication of JP7224811B2 publication Critical patent/JP7224811B2/en
Priority to US18/449,072 priority patent/US20230386166A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Focusing (AREA)
  • Indication In Cameras, And Counting Of Exposures (AREA)
  • Automatic Focus Adjustment (AREA)
  • Television Signal Processing For Recording (AREA)
  • Studio Devices (AREA)

Abstract

To make it possible to check a focus state of a plurality of captured images in an area according to user's intention.SOLUTION: An image processing apparatus 121 is configured to: set a region of interest in a first image among a plurality of captured images obtained by imaging at mutually different time; and detect a corresponding region having relevance to the region of interest in a plurality of second images among the plurality of captured images. A focus state of each region of interest and corresponding area is obtained and a classification process for classifying the captured images into a plurality of groups according to the focus state is performed.SELECTED DRAWING: Figure 1

Description

本発明は、撮像画像に対する画像処理を行う画像処理装置に関する。   The present invention relates to an image processing device that performs image processing on a captured image.

デジタルカメラやカメラ付携帯電話等の電子機器には、特許文献1に開示されているように、撮像面位相差検出方式のオートフォーカス(以下、撮像面位相差AFという)を行えるものがある。また、特許文献1には、連写によって得られた複数の撮像画像を合焦画像であるか否かによって分類して記録する方法が開示されている。   2. Description of the Related Art Some electronic devices such as a digital camera and a camera-equipped mobile phone can perform an autofocus (hereinafter, referred to as an imaging surface phase difference AF) of an imaging surface phase difference detection method, as disclosed in Japanese Patent Application Laid-Open No. H11-163873. Patent Document 1 discloses a method of classifying and recording a plurality of captured images obtained by continuous shooting depending on whether or not the images are focused images.

特開2011−209450号公報JP 2011-209450 A

しかしながら、撮像画像においてピント状態を判定すべき領域(ピント判定領域)は、ユーザの意図によって異なる。例えば、人物の顔を撮像する場合において、右眼と左眼のどちらにピントを合わせるのか、まつ毛と眼のどちらにピントを合わせるかはユーザが任意に選択する。これに対して、特許文献1には、ユーザの意図に応じたピント判定領域を選択する方法については開示されていない。   However, the region in which the focus state is to be determined in the captured image (focus determination region) differs depending on the intention of the user. For example, when imaging the face of a person, the user arbitrarily selects which of the right eye and the left eye should be focused, and which of the eyelashes and the eye should be focused. On the other hand, Patent Literature 1 does not disclose a method of selecting a focus determination area according to a user's intention.

本発明は、複数の撮像画像に対して、ユーザの意図に応じた領域でのピント状態の確認を可能とする画像処理装置およびこれを備えた電子機器を提供する。   The present invention provides an image processing apparatus capable of confirming a focus state in a region according to a user's intention with respect to a plurality of captured images, and an electronic apparatus including the image processing apparatus.

本発明の一側面としての画像処理装置は、互いに異なる時刻での撮像により取得された複数の撮像画像のうち第1の画像において着目領域を設定する領域設定手段と、複数の撮像画像のうち複数の第2の画像において着目領域に関連性を有する対応領域を検出する領域検出手段と、着目領域および対応領域のそれぞれのピント状態を取得するピント状態取得手段と、複数の撮像画像をピント状態に応じて複数のグループに分類する分類処理を行う処理手段とを有することを特徴とする。   An image processing apparatus according to one aspect of the present invention includes: an area setting unit configured to set a region of interest in a first image among a plurality of captured images acquired by capturing images at different times from each other; Area detecting means for detecting a corresponding area having relevance to the area of interest in the second image, focus state obtaining means for obtaining the respective focus states of the area of interest and the corresponding area, and setting the plurality of captured images to the focused state Processing means for performing a classification process for classifying the data into a plurality of groups in response to the request.

なお、被写体像を撮像する撮像素子と上記画像処理装置とを有する撮像装置も、本発明の他の一側面を構成する。   Note that an imaging device having an imaging element for imaging a subject image and the image processing device also constitutes another aspect of the present invention.

また、本発明の他の一側面としての画像処理方法は、互いに異なる時刻での撮像により取得された複数の撮像画像のうち第1の画像において着目領域を設定するステップと、複数の撮像画像のうち複数の第2の画像において着目領域に関連性を有する対応領域を検出するステップと、着目領域および対応領域のそれぞれのピント状態を取得するステップと、複数の撮像画像をピント状態に応じて複数のグループに分類する分類処理を行うステップとを有することを特徴とする。   Further, an image processing method according to another aspect of the present invention includes a step of setting a region of interest in a first image among a plurality of captured images acquired by capturing images at different times from each other; Detecting a corresponding region having a relevance to the region of interest in the plurality of second images, obtaining a focus state of each of the region of interest and the corresponding region; And performing a classification process for classifying into a group.

なお、コンピュータに上記画像処理方法に従う処理を実行させるコンピュータプログラムも、本発明の他の一側面を構成する。   Note that a computer program that causes a computer to execute a process according to the image processing method also constitutes another aspect of the present invention.

本発明によれば、複数の撮像画像に対して、ユーザの意図に応じた領域でのピント状態の確認を可能とすることができる。   ADVANTAGE OF THE INVENTION According to this invention, the confirmation of the focus state in the area | region according to the user's intention can be made about several imaging images.

本発明の実施例1であるカメラの構成を示すブロック図。FIG. 1 is a block diagram illustrating a configuration of a camera that is Embodiment 1 of the present invention. 実施例1のカメラにおける画素配列を示す図。FIG. 2 is a diagram illustrating a pixel array in the camera according to the first embodiment. 実施例1における画素の平面図と断面図。2A and 2B are a plan view and a cross-sectional view of a pixel in Embodiment 1. 実施例1における画素構造の説明図。FIG. 2 is an explanatory diagram of a pixel structure according to the first embodiment. 実施例1における瞳分割の説明図。FIG. 4 is an explanatory diagram of pupil division in the first embodiment. 実施例1におけるデフォーカス量と像ずれ量の関係を示す図。FIG. 4 is a diagram illustrating a relationship between a defocus amount and an image shift amount according to the first embodiment. 実施例1における焦点検出領域を示す図。FIG. 3 is a diagram illustrating a focus detection area according to the first embodiment. 実施例1のカメラのAF・撮像処理を示すフローチャート。6 is a flowchart illustrating AF / imaging processing of the camera according to the first embodiment. 実施例1のカメラの撮像サブルーチンを示すフローチャート。6 is a flowchart illustrating an imaging subroutine of the camera according to the first embodiment. 実施例1のカメラにおける連写中焦点検出サブルーチンを示すフローチャート。9 is a flowchart illustrating a focus detection subroutine during continuous shooting in the camera according to the first embodiment. 実施例1のカメラにおける画像再生処理を示すフローチャート。5 is a flowchart illustrating image reproduction processing in the camera according to the first embodiment. 実施例1における表示画像から着目領域を設定する方法を説明する図。FIG. 4 is a diagram illustrating a method for setting a region of interest from a display image according to the first embodiment. 実施例1のカメラの背面図。FIG. 2 is a rear view of the camera according to the first embodiment. 実施例1のカメラにおける第1のグルーピングサブルーチンを示すフローチャート。5 is a flowchart illustrating a first grouping subroutine in the camera according to the first embodiment. 実施例1のカメラにおけるピント状態検出サブルーチンを示すフローチャート。5 is a flowchart illustrating a focus state detection subroutine in the camera according to the first embodiment. 実施例1における第2の評価領域を説明する図。FIG. 4 is a diagram illustrating a second evaluation area according to the first embodiment. 実施例1における第1の評価領域から得られた結果の信頼性が低い場合の検出結果の更新方法を説明する図。FIG. 7 is a diagram for explaining a method of updating a detection result when the reliability of the result obtained from the first evaluation area is low in the first embodiment. 実施例1のカメラにおける第2のグルーピングサブルーチンを示すフローチャート。9 is a flowchart illustrating a second grouping subroutine in the camera according to the first embodiment. 実施例1において第1のグルーピングが行われた画像群を説明する図。FIG. 4 is a diagram illustrating an image group subjected to first grouping in the first embodiment. 実施例1において第2のグルーピングの結果を示す図。FIG. 9 is a diagram illustrating a result of the second grouping in the first embodiment. 実施例1において第2のグルーピング後の再生画像を示す図。FIG. 6 is a diagram illustrating a reproduced image after the second grouping in the first embodiment. 実施例1において第1のグルーピングが行われた画像群の着目領域または対応領域のピント状態を示す図。FIG. 4 is a diagram illustrating a focus state of a focused area or a corresponding area of the image group on which the first grouping has been performed in the first embodiment. 変形例において第1のグルーピングが行われた画像群の着目領域または対応領域のピント状態を示す図。FIG. 14 is a diagram illustrating a focus state of a focused area or a corresponding area of an image group on which a first grouping has been performed in a modified example. 本発明の実施例2であるカメラの第2のグルーピングサブルーチンを示すフローチャート。9 is a flowchart illustrating a second grouping subroutine of the camera that is Embodiment 2 of the present invention. 実施例2のカメラにおける被写体領域の距離情報の取得方法を説明する図。FIG. 8 is a diagram for explaining a method of acquiring distance information of a subject region in the camera according to the second embodiment. 実施例2における被写体距離による被写界深度の違いを説明する図。FIG. 9 is a diagram illustrating a difference in depth of field depending on a subject distance in the second embodiment. 実施例2において第1のグルーピングが行われた画像群の着目領域または対応領域のピント状態を示す図。FIG. 13 is a diagram illustrating a focus state of a focused region or a corresponding region of an image group on which first grouping has been performed in the second embodiment.

以下、本発明の実施例について図面を参照しながら説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本発明の実施例1である画像処理装置を搭載した電子機器または撮像装置としてのカメラ100の構成を示す。図1において、第1レンズ群101は、結像光学系としての撮像光学系のうち最も被写体側(前側)に配置され、光軸方向に移動可能に保持されている。絞り兼シャッタ102は、その開口径を調節することで光量調節を行い、また静止画撮像時には露光秒時を制御するシャッタとして機能する。第2レンズ群103は、絞り兼シャッタ102と一体となって光軸方向に移動し、光軸方向に移動する第1レンズ群101とともに変倍(ズーム)を行う。   FIG. 1 shows a configuration of a camera 100 as an electronic apparatus or an imaging apparatus equipped with an image processing apparatus according to a first embodiment of the present invention. In FIG. 1, a first lens group 101 is disposed closest to a subject (front side) in an imaging optical system as an imaging optical system, and is held so as to be movable in an optical axis direction. The aperture and shutter 102 adjusts the light amount by adjusting the aperture diameter thereof, and also functions as a shutter for controlling the exposure time at the time of capturing a still image. The second lens group 103 moves in the optical axis direction integrally with the stop / shutter 102 and performs magnification (zoom) together with the first lens group 101 moving in the optical axis direction.

第3レンズ群(フォーカスレンズ)105は、光軸方向に移動して焦点調節を行う。光学ローパスフィルタ106は、撮像画像の偽色やモアレを軽減するための光学素子である。第1レンズ群101、絞り兼シャッタ102、第2レンズ群103、第3レンズ群105および光学ローパスフィルタ106により撮像光学系が構成される。   The third lens group (focus lens) 105 moves in the optical axis direction to perform focus adjustment. The optical low-pass filter 106 is an optical element for reducing false colors and moire of a captured image. The first lens group 101, the aperture / shutter 102, the second lens group 103, the third lens group 105, and the optical low-pass filter 106 constitute an imaging optical system.

ズームアクチュエータ111は、不図示のカム筒を光軸回りで回動させることで、該カム筒に設けられたカムによって第1レンズ群101および第2レンズ群103を光軸方向に移動させて変倍を行わせる。絞りシャッタアクチュエータ112は、絞り兼シャッタ102の光量調節動作やシャッタ動作のために不図示の複数の遮光羽根を開閉方向に駆動する。フォーカスアクチュエータ114は、第3レンズ群105を光軸方向に移動させて焦点調節を行わせる。   The zoom actuator 111 rotates a cam cylinder (not shown) around the optical axis, and moves the first lens group 101 and the second lens group 103 in the optical axis direction by a cam provided on the cam cylinder to change the position. Make a doubling. The aperture shutter actuator 112 drives a plurality of light-shielding blades (not shown) in the opening and closing directions for the operation of adjusting the amount of light of the aperture and shutter 102 and the shutter operation. The focus actuator 114 moves the third lens group 105 in the optical axis direction to perform focus adjustment.

フォーカス駆動回路126は、カメラCPU121からのフォーカス駆動指令に応じてフォーカスアクチュエータ114を駆動し、第3レンズ群105を光軸方向に移動させる。絞りシャッタ駆動回路128は、カメラCPU121からの絞りまたはシャッタ駆動指令に応じて絞りシャッタアクチュエータ112を駆動する。ズーム駆動回路129は、ユーザのズーム操作に応じてズームアクチュエータ111を駆動する。   The focus drive circuit 126 drives the focus actuator 114 in response to a focus drive command from the camera CPU 121, and moves the third lens group 105 in the optical axis direction. The aperture shutter drive circuit 128 drives the aperture shutter actuator 112 in response to an aperture or shutter drive command from the camera CPU 121. The zoom drive circuit 129 drives the zoom actuator 111 according to a zoom operation by the user.

なお、本実施例では、撮像光学系、アクチュエータ111,112,114および駆動回路126,128,129が撮像素子107を含むカメラ本体と一体に設けられている場合について説明する。しかし、撮像光学系、アクチュエータ111,112,114および駆動回路126,128,129を有する交換レンズがカメラ本体に着脱可能であってもよい。   In this embodiment, a case will be described in which the imaging optical system, the actuators 111, 112, 114, and the driving circuits 126, 128, 129 are provided integrally with the camera body including the imaging element 107. However, an interchangeable lens having an imaging optical system, actuators 111, 112, 114 and drive circuits 126, 128, 129 may be detachable from the camera body.

電子フラッシュ115は、キセノン管やLED等の発光素子を有し、被写体を照明する光を発する。AF補助光発光部116は、LED等の発光素子を有し、所定の開口パターンを有するマスクの像を投光レンズを介して被写体に投射することで、暗いまたは低コントラストの被写体に対する焦点検出性能を向上させる。電子フラッシュ制御回路122は、撮像動作に同期して電子フラッシュ115を点灯させるように制御する。補助光駆動回路123は、焦点検出動作に同期してAF補助光発光部116を点灯させるように制御する。   The electronic flash 115 has a light-emitting element such as a xenon tube or an LED, and emits light for illuminating a subject. The AF auxiliary light emitting unit 116 has a light emitting element such as an LED, and projects an image of a mask having a predetermined opening pattern onto the subject through a light projecting lens, thereby achieving focus detection performance for a dark or low-contrast subject. Improve. The electronic flash control circuit 122 controls the electronic flash 115 to be turned on in synchronization with the imaging operation. The auxiliary light driving circuit 123 controls the AF auxiliary light emitting unit 116 to light up in synchronization with the focus detection operation.

カメラCPU121は、カメラ100における各種制御を司る。カメラCPU121は、演算部、ROM、RAM、A/Dコンバータ、D/Aコンバータおよび通信インターフェイス回路等を有する。カメラCPU121は、ROMに記憶されたコンピュータプログラムに従ってカメラ100内の各種回路を駆動したり、AF、撮像、画像処理および記録等の一連の動作を制御したりする。カメラCPU121は、画像処理装置として機能する。   The camera CPU 121 controls various controls in the camera 100. The camera CPU 121 includes an arithmetic unit, a ROM, a RAM, an A / D converter, a D / A converter, a communication interface circuit, and the like. The camera CPU 121 drives various circuits in the camera 100 according to a computer program stored in the ROM, and controls a series of operations such as AF, imaging, image processing, and recording. The camera CPU 121 functions as an image processing device.

撮像素子107は、複数の画素を含む2次元CMOSフォトセンサとその周辺回路からなり、撮像光学系の結像面に配置されている。撮像素子107は、撮像光学系により形成される被写体像を光電変換する。撮像素子駆動回路124は、撮像素子107の動作を制御するとともに、光電変換により生成したアナログ信号をA/D変換して、デジタル信号をカメラCPU121に送信する。画像処理回路125は、撮像素子駆動回路124からのデジタル信号としての撮像データに対して、画素欠陥補正、γ変換、カラー補間およびJPEG圧縮等の画像処理を行って表示用のライブビュー画像や記録用の撮像画像として用いられる画像データを生成する。   The imaging element 107 is composed of a two-dimensional CMOS photosensor including a plurality of pixels and its peripheral circuits, and is arranged on an imaging plane of the imaging optical system. The imaging element 107 photoelectrically converts a subject image formed by the imaging optical system. The image sensor driving circuit 124 controls the operation of the image sensor 107, A / D converts an analog signal generated by photoelectric conversion, and transmits a digital signal to the camera CPU 121. The image processing circuit 125 performs image processing such as pixel defect correction, γ conversion, color interpolation, and JPEG compression on the image data as a digital signal from the image sensor driving circuit 124 to perform live view image display and recording. To generate image data used as a captured image for use.

表示器(表示手段)131は、LCD等の表示素子を備え、カメラ100の撮像モードに関する情報、撮像前のプレビュー画像、撮像後の確認用画像、焦点検出領域の指標および合焦画像等を表示する。操作スイッチ群132は、メイン(電源)スイッチ、レリーズ(撮影トリガ)スイッチ、ズーム操作スイッチ、撮影モード選択スイッチ等を含み、ユーザにより操作される。フラッシュメモリ133は、撮像画像を記録する。フラッシュメモリ133は、カメラ100に対して着脱が可能である。   The display (display unit) 131 includes a display element such as an LCD, and displays information on an imaging mode of the camera 100, a preview image before imaging, a confirmation image after imaging, an index of a focus detection area, a focused image, and the like. I do. The operation switch group 132 includes a main (power) switch, a release (photographing trigger) switch, a zoom operation switch, a photographing mode selection switch, and the like, and is operated by the user. The flash memory 133 records a captured image. The flash memory 133 is detachable from the camera 100.

次に、図2を用いて撮像素子107の画像配列について説明する。図2は、撮像素子107のうち4画素列×4画素行の範囲の画素配列を光軸方向(z方向)から見て示している。   Next, the image arrangement of the image sensor 107 will be described with reference to FIG. FIG. 2 illustrates a pixel array in a range of 4 pixel columns × 4 pixel rows in the image sensor 107 when viewed from the optical axis direction (z direction).

1つの画素ユニット200は2行×2列に配置された4つの撮像画素を含む。撮像素子107上に多数の画素ユニット200が配列されることで、2次元の被写体像の光電変換を行うことができる。1つの画素ユニット200のうち左上にはR(赤)の分光感度を有する撮像画素(以下、R画素という)200Rが配置され、右上と左下にはG(緑)の分光感度を有する撮像画素(以下、G画素という)200Gが配置されている。さらに、右下にはB(青)の分光感度を有する撮像画素(以下、B画素という)200Bが配置されている。また、各撮像画素は、水平方向(x方向)に分割された第1焦点検出画素201と第2焦点検出画素202を含む。   One pixel unit 200 includes four imaging pixels arranged in 2 rows × 2 columns. By arranging a large number of pixel units 200 on the image sensor 107, a two-dimensional subject image can be photoelectrically converted. In one pixel unit 200, an imaging pixel (hereinafter, referred to as an R pixel) 200R having an R (red) spectral sensitivity is disposed at the upper left, and an imaging pixel (having a G (green) spectral sensitivity at the upper right and lower left is provided. Hereafter, 200 G are arranged. Further, an imaging pixel (hereinafter, referred to as a B pixel) 200B having a spectral sensitivity of B (blue) is arranged at the lower right. Each imaging pixel includes a first focus detection pixel 201 and a second focus detection pixel 202 divided in the horizontal direction (x direction).

本実施例の撮像素子107において、撮像画素の画素ピッチPは4μm、撮像画素数Nは水平(x)5575列×垂直(y)3725行=約2075万画素である。また、焦点検出画素の画素ピッチPAFは2μm、焦点検出画素数NAFは水平11150列×垂直3725行=約4150万画素である。   In the imaging element 107 of this embodiment, the pixel pitch P of the imaging pixels is 4 μm, and the number N of imaging pixels is 5575 horizontal (x) × 3725 vertical (y) rows = approximately 207.5 million pixels. The pixel pitch PAF of the focus detection pixels is 2 μm, and the number NAF of focus detection pixels is 11150 horizontal rows × 3725 vertical rows = about 41.5 million pixels.

本実施例では、各撮像画素が水平方向に2分割されている場合について説明するが、垂直方向に分割されていてもよい。また、本実施例の撮像素子107は、それぞれ第1および第2焦点検出画素を含む撮像画素を複数有するが、撮像画素と第1および第2焦点検出画素とを別々の画素として設けてもよい。例えば、複数の撮像画素の中に第1および第2焦点検出画素を離散的に配置してもよい。   In the present embodiment, a case where each imaging pixel is divided into two in the horizontal direction will be described, but it may be divided in the vertical direction. In addition, the image sensor 107 of the present embodiment has a plurality of imaging pixels each including the first and second focus detection pixels, but the imaging pixels and the first and second focus detection pixels may be provided as separate pixels. . For example, the first and second focus detection pixels may be discretely arranged among a plurality of imaging pixels.

図3(a)は、撮像素子107の受光面側(+z方向)から見た1つの撮像画素(200R,200G,200B)を示している。図3(b)は、図3(a)の撮像画素のa−a断面を−y方向から見て示している。図3(b)に示すように、1つの撮像画素には、入射光を集光するための1つのマイクロレンズ305が設けられている。   FIG. 3A shows one imaging pixel (200R, 200G, 200B) viewed from the light receiving surface side (+ z direction) of the imaging element 107. FIG. 3B shows an aa cross section of the imaging pixel of FIG. 3A viewed from the −y direction. As shown in FIG. 3B, one imaging lens is provided with one microlens 305 for collecting incident light.

また、撮像画素には、x方向にN分割(本実施例では2分割)された光電変換部301,302が設けられている。光電変換部301,302はそれぞれ、第1焦点検出画素201および第2焦点検出画素202に相当する。光電変換部301,302の重心はそれぞれ、マイクロレンズ305の光軸に対して、−x側および+x側に偏心している。   Further, the imaging pixels are provided with photoelectric conversion units 301 and 302 that are divided into N parts (two parts in this embodiment) in the x direction. The photoelectric conversion units 301 and 302 correspond to the first focus detection pixel 201 and the second focus detection pixel 202, respectively. The centers of gravity of the photoelectric conversion units 301 and 302 are eccentric to the -x side and + x side with respect to the optical axis of the microlens 305, respectively.

各撮像画素におけるマイクロレンズ305と光電変換部301,302との間には、R,GまたはBのカラーフィルタ306が設けられている。なお、光電変換部ごとにカラーフィルタの分光透過率を変えてもよいし、カラーフィルタを省略してもよい。   An R, G or B color filter 306 is provided between the micro lens 305 and the photoelectric conversion units 301 and 302 in each imaging pixel. Note that the spectral transmittance of the color filter may be changed for each photoelectric conversion unit, or the color filter may be omitted.

撮像光学系から撮像画素に入射した光は、マイクロレンズ305により集光され、カラーフィルタ306で分光された後、光電変換部301,302で受光され、ここで光電変換される。   Light that has entered the imaging pixels from the imaging optical system is condensed by the microlens 305, is separated by the color filter 306, is received by the photoelectric conversion units 301 and 302, and is photoelectrically converted here.

次に、図4を用いて、図3に示した画素構造と瞳分割との関係を説明する。図4は、図3(a)に示した撮像画素のa−a断面を+y側から見て示すとともに、撮像光学系の射出瞳を示す。図4では、射出瞳の座標軸との対応を取るために、撮像画素のx方向とy方向とを図3(b)に対して反転させている。   Next, the relationship between the pixel structure shown in FIG. 3 and pupil division will be described with reference to FIG. FIG. 4 shows an a-a section of the imaging pixel shown in FIG. 3A as viewed from the + y side, and also shows an exit pupil of the imaging optical system. In FIG. 4, the x and y directions of the imaging pixels are inverted with respect to FIG. 3B in order to correspond to the coordinate axes of the exit pupil.

射出瞳のうち+X側に重心が偏心した第1瞳領域501は、マイクロレンズ305によって、撮像画素のうち−x側の光電変換部301の受光面と概ね共役な関係とされた領域である。第1瞳領域501を通過した光束は、光電変換部301、すなわち第1焦点検出画素201により受光される。また、射出瞳のうち−X側に重心が偏心した第2瞳領域502は、マイクロレンズ305によって、撮像画素のうち+x側の光電変換部302の受光面と概ね共役な関係とされた領域である。第2瞳領域502を通過した光束は、光電変換部302、すなわち第2焦点検出画素202により受光される。瞳領域500は、光電変換部301,302(第1および第2焦点検出画素201,202)を全て合わせた撮像画素全体で受光可能な瞳領域を示している。   A first pupil region 501 whose center of gravity is decentered on the + X side of the exit pupil is a region that is substantially conjugated with the light receiving surface of the photoelectric conversion unit 301 on the −x side of the imaging pixel by the microlens 305. The light beam that has passed through the first pupil region 501 is received by the photoelectric conversion unit 301, that is, the first focus detection pixel 201. A second pupil region 502 of the exit pupil, the center of gravity of which is decentered on the −X side, is a region that is approximately conjugated with the light receiving surface of the photoelectric conversion unit 302 on the + x side of the imaging pixel by the microlens 305. is there. The light beam that has passed through the second pupil region 502 is received by the photoelectric conversion unit 302, that is, the second focus detection pixel 202. The pupil region 500 indicates a pupil region in which the entire imaging pixel including the photoelectric conversion units 301 and 302 (the first and second focus detection pixels 201 and 202) can receive light.

図5は、撮像素子107による瞳分割を示している。第1瞳領域501と第2瞳領域502をそれぞれ通過した一対の光束は、撮像素子107の各画素にそれぞれ異なる角度で入射し、2分割された第1および第2焦点検出画素201,202により受光される。本実施例では、撮像素子107の複数の第1焦点検出画素201からの出力信号を集めて第1焦点検出信号を生成し、複数の第2焦点検出画素202からの出力信号を集めて第2焦点検出信号を生成する。また、複数の撮像画素の第1焦点検出画素201からの出力信号と第2焦点検出画素202からの出力信号とを加算して撮像画素信号を生成する。そして、複数の撮像画素からの撮像画素信号を合成して、有効画素数Nに相当する解像度の画像を生成するための撮像信号を生成する。   FIG. 5 shows pupil division by the image sensor 107. A pair of light beams that have passed through the first pupil region 501 and the second pupil region 502 respectively enter each pixel of the image sensor 107 at different angles, and are divided by the first and second focus detection pixels 201 and 202 into two. Received. In the present embodiment, a first focus detection signal is generated by collecting output signals from the plurality of first focus detection pixels 201 of the image sensor 107, and a second focus detection signal is generated by collecting output signals from the plurality of second focus detection pixels 202. Generate a focus detection signal. Further, an output signal from the first focus detection pixel 201 of the plurality of imaging pixels and an output signal from the second focus detection pixel 202 are added to generate an imaging pixel signal. Then, an image pickup signal for generating an image having a resolution corresponding to the number N of effective pixels is generated by synthesizing image pickup pixel signals from a plurality of image pickup pixels.

次に、撮像光学系のデフォーカス量と撮像素子107から取得される第1焦点検出信号と第2焦点検出信号の位相差(像ずれ量)との関係について、図6を用いて説明する。図中の撮像面600には撮像素子107が配置されており、図4および図5を参照して説明したように、撮像光学系の射出瞳は第1瞳領域501と第2瞳領域502とに2分割されている。デフォーカス量dは、被写体(801,802)からの光束の結像位置Cから撮像面600までの距離(大きさ)を|d|として、結像位置Cが撮像面600より被写体側にある前ピン状態を負符号(d<0)で表し、結像位置Cが撮像面600より被写体とは反対側にある後ピン状態を正符号(d>0)で表すように定義される。結像位置Cが撮像面600にある合焦状態では、d=0である。撮像光学系は、被写体801に対して合焦状態(d=0)にあり、被写体802に対して前ピン状態(d<0)にある。前ピン状態(d<0)と後ピン状態(d>0)を合わせてデフォーカス状態(|d|>0)という。   Next, the relationship between the defocus amount of the imaging optical system and the phase difference (image shift amount) between the first focus detection signal and the second focus detection signal acquired from the image sensor 107 will be described with reference to FIG. An imaging element 107 is disposed on an imaging plane 600 in the figure, and as described with reference to FIGS. 4 and 5, the exit pupil of the imaging optical system includes a first pupil region 501 and a second pupil region 502. Is divided into two. The defocus amount d is such that the distance (magnitude) from the image forming position C of the light flux from the object (801, 802) to the imaging surface 600 is | d |, and the image forming position C is closer to the object than the imaging surface 600. The front focus state is defined by a minus sign (d <0), and the rear focus state where the image forming position C is on the opposite side of the imaging surface 600 from the subject is defined by a plus sign (d> 0). In an in-focus state where the imaging position C is on the imaging surface 600, d = 0. The imaging optical system is in focus (d = 0) with respect to the subject 801 and in front focus (d <0) with respect to the subject 802. The front focus state (d <0) and the rear focus state (d> 0) are collectively referred to as a defocus state (| d |> 0).

前ピン状態(d<0)では、被写体802からの光束のうち第1瞳領域501(第2瞳領域502)を通過した光束は、一旦集光した後、光束の重心位置G1(G2)を中心として幅Γ1(Γ2)に広がり、撮像面600上でボケ像を形成する。このボケ像は、撮像素子107上の各第1焦点検出画素201(各第2焦点検出画素202)により受光され、第1焦点検出信号(第2焦点検出信号)が生成される。つまり、第1焦点検出信号(第2焦点検出信号)は、撮像面600上での光束の重心位置G1(G2)にて被写体802がボケ幅Γ1(Γ2)だけボケた被写体像を表す信号となる。   In the front focus state (d <0), among the light beams from the subject 802, the light beams that have passed through the first pupil region 501 (the second pupil region 502) are once collected, and then moved to the center of gravity G1 (G2) of the light beams. The center spreads over a width # 1 (# 2) and forms a blurred image on the imaging surface 600. The blurred image is received by each first focus detection pixel 201 (each second focus detection pixel 202) on the image sensor 107, and a first focus detection signal (second focus detection signal) is generated. That is, the first focus detection signal (the second focus detection signal) is a signal representing the subject image in which the subject 802 is blurred by the blur width Γ1 (Γ2) at the center of gravity G1 (G2) of the light beam on the imaging surface 600. Become.

被写体像のボケ幅Γ1(Γ2)は、デフォーカス量dの大きさ|d|の増加に概ね比例して増加する。同様に、第1焦点検出信号と第2焦点検出信号間の像ずれ量p(=光束の重心位置の差G1−G2)の大きさ|p|も、デフォーカス量dの大きさ|d|の増加に概ね比例して増加する。後ピン状態(d>0)でも、第1焦点検出信号と第2焦点検出信号間の像ずれ方向は前ピン状態とは反対となるが、同様である。   The blur width Γ1 (Γ2) of the subject image increases substantially in proportion to the increase of the magnitude | d | of the defocus amount d. Similarly, the magnitude | p | of the image shift amount p (= difference G1-G2 of the center of gravity of the light flux) between the first focus detection signal and the second focus detection signal is also the magnitude | d | of the defocus amount d. Increases almost in proportion to the increase in Even in the back focus state (d> 0), the image shift direction between the first focus detection signal and the second focus detection signal is opposite to that in the front focus state, but is the same.

このように、デフォーカス量の大きさが増加するのに伴って第1および第2焦点検出信号間の像ずれ量の大きさが増加する。本実施例では、撮像素子107を用いて得られた第1および第2焦点検出信号間の像ずれ量からデフォーカス量を算出する撮像面位相差検出方式焦点検出を行う。   As described above, the magnitude of the image shift amount between the first and second focus detection signals increases as the magnitude of the defocus amount increases. In the present embodiment, focus detection is performed by an imaging surface phase difference detection method that calculates a defocus amount from an image shift amount between the first and second focus detection signals obtained by using the imaging element 107.

次に、撮像素子107のうち第1および第2焦点検出信号を取得する焦点検出領域について、図7を用いて説明する。図7において、A(n,m)は、撮像素子107の有効画素領域1000に設定された複数(x方向およびy方向に3つずつの計9つ)の焦点検出領域のうちx方向でのn番目、y方向でのm番目の焦点検出領域を示す。焦点検出領域A(n,m)に含まれる複数の第1および第2焦点検出画素201,202からの出力信号から第1および第2焦点検出信号が生成される。I(n,m)は、表示器131において焦点検出領域A(n,m)の位置を表示する指標を示す。   Next, a focus detection area of the image sensor 107 for obtaining the first and second focus detection signals will be described with reference to FIG. In FIG. 7, A (n, m) is the focus detection area in the x direction among a plurality of focus detection areas (three in the x direction and the y direction, nine in total) set in the effective pixel area 1000 of the image sensor 107. The nth and mth focus detection areas in the y direction are shown. First and second focus detection signals are generated from output signals from the plurality of first and second focus detection pixels 201 and 202 included in the focus detection area A (n, m). I (n, m) indicates an index for displaying the position of the focus detection area A (n, m) on the display 131.

なお、図7に示した9つの焦点検出領域は例に過ぎず、焦点検出領域の数、位置およびサイズは限定されない。例えば、ユーザが指定した位置を中心とした所定の範囲の領域を焦点検出領域として設定してもよい。   Note that the nine focus detection areas shown in FIG. 7 are merely examples, and the number, position, and size of the focus detection areas are not limited. For example, an area in a predetermined range centered on the position designated by the user may be set as the focus detection area.

図8のフローチャートは、本実施例のカメラ100にAF動作および撮像動作を行わせるAF・撮像処理(画像処理方法)を示す。具体的には、カメラ100に表示器131にライブビュー画像を表示する撮像前から静止画撮像を行うまでの動作を行わせる処理を示す。コンピュータであるカメラCPU121は、コンピュータプログラムに従って本処理を実行する。以下の説明において、Sはステップを意味する。   The flowchart in FIG. 8 illustrates an AF / imaging process (image processing method) that causes the camera 100 of the present embodiment to perform an AF operation and an imaging operation. More specifically, a process for causing the camera 100 to perform an operation from before image capturing for displaying a live view image on the display 131 to image capturing for a still image is shown. The camera CPU 121 as a computer executes this processing according to a computer program. In the following description, S means a step.

まずS1では、カメラCPU121は、撮像素子駆動回路124に撮像素子107を駆動させ、撮像素子107から撮像データを取得する。   First, in S1, the camera CPU 121 causes the image sensor driving circuit 124 to drive the image sensor 107, and acquires image data from the image sensor 107.

次にS2では、カメラCPU121は、S1で得られた撮像データのうち、図6に示した9つの焦点検出領域のそれぞれに含まれる複数の第1および第2焦点検出画素から第1および第2焦点検出信号を取得する。また、カメラCPU121は、撮像素子107の全有効画素の第1および第2焦点検出信号を加算して撮像信号を生成し、画像処理回路125に撮像信号(撮像データ)に対する画像処理を行わせて画像データを取得する。なお、撮像画素と第1および第2焦点検出画素と別々に設けた場合は、カメラCPU121は焦点検出用画素に対する補完処理を行って画像データを取得する。   Next, in S2, the camera CPU 121 extracts the first and second focus detection pixels from the plurality of first and second focus detection pixels included in each of the nine focus detection areas shown in FIG. Obtain a focus detection signal. Further, the camera CPU 121 generates an imaging signal by adding the first and second focus detection signals of all effective pixels of the imaging element 107, and causes the image processing circuit 125 to perform image processing on the imaging signal (imaging data). Get image data. When the imaging pixels and the first and second focus detection pixels are separately provided, the camera CPU 121 performs complement processing on the focus detection pixels to obtain image data.

次にS3では、カメラCPU121は、画像処理回路125にS2で得られた画像データからライブビュー画像を生成させ、これを表示器131に表示させる。なお、ライブビュー画像は、表示器131の解像度に合わせた縮小画像であり、ユーザはこれを見ながら撮像構図や露出条件等を調整することができる。   Next, in S3, the camera CPU 121 causes the image processing circuit 125 to generate a live view image from the image data obtained in S2, and causes the display 131 to display the live view image. The live view image is a reduced image that matches the resolution of the display 131, and the user can adjust the imaging composition, exposure conditions, and the like while viewing the image.

次にS4では、カメラCPU121は、S2で取得した9つの焦点検出領域のそれぞれで得られた第1および第2焦点検出信号間の像ずれ量を算出し、該像ずれ量から焦点検出領域ごとのデフォーカス量を算出する。   Next, in S4, the camera CPU 121 calculates the image shift amount between the first and second focus detection signals obtained in each of the nine focus detection regions acquired in S2, and calculates the image shift amount for each focus detection region from the image shift amount. Is calculated.

次にS5では、カメラCPU121は、操作スイッチ群132に含まれるレリーズスイッチの半押し操作によって、撮像準備動作の開始を指示するスイッチSw1がオンされたか否かを判定する。カメラCPU121は、Sw1がオンされていない場合はS11に進む。一方、Sw1がオンされた場合は、カメラCPU121はS6に進み、合焦状態を得る焦点検出領域(以下、合焦目標領域という)を設定する。ここでは、ユーザが選択した焦点検出領域を合焦目標領域として設定してもよいし、S4で算出した9つの焦点検出領域のデフォーカス量やそれら焦点検出領域の撮像範囲中心からの距離に基づいて、カメラCPU121が自動的に合焦目標領域を設定してもよい。   Next, in S5, the camera CPU 121 determines whether or not the switch Sw1 for instructing the start of the imaging preparation operation has been turned on by half-pressing the release switch included in the operation switch group 132. If Sw1 is not turned on, the camera CPU 121 proceeds to S11. On the other hand, when Sw1 is turned on, the camera CPU 121 proceeds to S6, and sets a focus detection area for obtaining a focused state (hereinafter, referred to as a focus target area). Here, the focus detection area selected by the user may be set as the focus target area, or may be determined based on the defocus amounts of the nine focus detection areas calculated in S4 and the distances of the focus detection areas from the center of the imaging range. Thus, the camera CPU 121 may automatically set the focus target area.

S6からS7に進んだカメラCPU121は、設定した合焦目標領域で検出されたデフォーカス量に基づいて、フォーカスレンズ105を合焦状態が得られる位置(合焦位置)に駆動する。   The camera CPU 121 that has proceeded from S6 to S7 drives the focus lens 105 to a position where a focused state can be obtained (a focused position) based on the defocus amount detected in the set focusing target area.

次にS8では、カメラCPU121は、再度、S1と同じ撮像データの取得処理とS4と同じ焦点検出処理を行う。   Next, in S8, the camera CPU 121 again performs the same imaging data acquisition processing as in S1 and the same focus detection processing as in S4.

そしてカメラCPU121はS9に進み、レリーズスイッチの全押し操作によって、撮像動作の開始を指示するスイッチSw2がオンされたか否かを判定する。カメラCPU121は、Sw2がオンされていない場合はS5に戻る。一方、Sw2がオンされた場合はS10に進み、画像記録を行うか否かを判定する。本実施例では、連写(連続撮像)中の画像取得処理を、画像記録用と焦点検出用とで切り替える。この切り替えは、交互に行ってもよいし、3回に2回は画像記録用の画像取得処理を行って1回は焦点検出用の画像取得処理を行う等してもよい。これにより、単位時間当たりの撮像回数(撮像画像数)を大きく減らすことなく、高精度な焦点検出を行うことができる。   Then, the camera CPU 121 proceeds to S9, and determines whether or not the switch Sw2 for instructing the start of the imaging operation has been turned on by the full-press operation of the release switch. If Sw2 is not turned on, the camera CPU 121 returns to S5. On the other hand, if Sw2 is turned on, the process proceeds to S10, and it is determined whether or not to perform image recording. In the present embodiment, the image acquisition process during continuous shooting (continuous imaging) is switched between for image recording and for focus detection. This switching may be performed alternately, or an image acquisition process for image recording may be performed twice in three times, and an image acquisition process for focus detection may be performed once. Thus, highly accurate focus detection can be performed without greatly reducing the number of times of imaging (the number of captured images) per unit time.

カメラCPU121は、S10で画像記録を行う場合はS300に進み、撮像サブルーチンを実行する。撮像サブルーチンの詳細については後述する。撮像サブルーチンが終了すると、カメラCPU121はS9に戻ってSw2がオンされているか否か、すなわち連写が指示されているか否かを判定する。   When performing image recording in S10, the camera CPU 121 proceeds to S300 and executes an imaging subroutine. Details of the imaging subroutine will be described later. When the imaging subroutine ends, the camera CPU 121 returns to S9 and determines whether Sw2 is turned on, that is, whether continuous shooting is instructed.

一方、カメラCPU121は、S10で画像記録を行わない、すなわち焦点検出を行うと判定した場合はS400に進み、連写中焦点検出サブルーチンを実行する。連写中焦点検出サブルーチンの詳細については後述する。連写中焦点検出サブルーチンが終了すると、カメラCPU121はS9に戻り、連写が指示されているか否かを判定する。   On the other hand, when it is determined in S10 that image recording is not to be performed, that is, focus detection is to be performed, the camera CPU 121 proceeds to S400 and executes a focus detection subroutine during continuous shooting. The details of the focus detection subroutine during continuous shooting will be described later. When the focus detection subroutine during continuous shooting ends, the camera CPU 121 returns to S9 and determines whether or not continuous shooting has been instructed.

S11では、カメラCPU121は、操作スイッチ群132に含まれるメインスイッチがオフされたか否かを判別する。カメラCPU121は、メインスイッチがオフされた場合は本処理を終了し、メインスイッチがオフされていない場合はS2に戻る。   In S11, the camera CPU 121 determines whether a main switch included in the operation switch group 132 has been turned off. The camera CPU 121 ends this processing when the main switch is turned off, and returns to S2 when the main switch is not turned off.

次に、図9に示すフローチャートを用いて、図8のS300でカメラCPU121が実行する撮像サブルーチンについて説明する。   Next, an imaging subroutine executed by the camera CPU 121 in S300 of FIG. 8 will be described using a flowchart shown in FIG.

S301において、カメラCPU121は、露出制御処理を行い、撮像条件(シャッタ速度、絞り値、撮像感度等)を決定する。この露出制御処理は、ライブビュー画像の画像データから取得した輝度情報を用いて行うことができる。露出制御処理を行う際に用いる画像データを得るタイミング等の詳細については後述する。   In step S301, the camera CPU 121 performs an exposure control process, and determines imaging conditions (shutter speed, aperture value, imaging sensitivity, and the like). This exposure control processing can be performed using luminance information acquired from the image data of the live view image. Details such as the timing of obtaining image data used when performing the exposure control processing will be described later.

そして、カメラCPU121は、決定した絞り値とシャッタ速度を絞りシャッタ駆動回路128に送信して、絞り兼シャッタ102を駆動させる。さらにカメラCPU121は、撮像素子駆動回路124を通じて露光期間の間、撮像素子107に電荷蓄積を行わせる。   Then, the camera CPU 121 transmits the determined aperture value and shutter speed to the aperture / shutter drive circuit 128 to drive the aperture / shutter 102. Further, the camera CPU 121 causes the image sensor 107 to store charges during the exposure period through the image sensor drive circuit 124.

露光制御処理を行ったカメラCPU121は、S302において、撮像素子駆動回路124に、撮像素子107からの高画素静止画撮像のための撮像信号の全画素読み出しを行わせる。また、カメラCPU121は、撮像素子駆動回路124に撮像素子107内の焦点検出領域(合焦目標領域)からの第1および第2焦点検出信号のうち一方の読み出しを行わせる。このときに読み出される第1または第2焦点検出信号は、後述する画像再生時に画像のピント状態を検出するために用いられる。第1および第2焦点検出信号のうち一方の焦点検出信号を撮像信号から差し引くことで他方の焦点検出信号を取得することができる。   In step S302, the camera CPU 121 that has performed the exposure control process causes the image sensor driving circuit 124 to read all pixels of an image signal from the image sensor 107 for capturing a high-pixel still image. Further, the camera CPU 121 causes the image sensor drive circuit 124 to read one of the first and second focus detection signals from the focus detection area (focus target area) in the image sensor 107. The first or second focus detection signal read at this time is used for detecting the focus state of the image at the time of image reproduction described later. By subtracting one of the first and second focus detection signals from the imaging signal, the other focus detection signal can be obtained.

次にS303では、カメラCPU121は、画像処理回路125に、S302で読み出されてA/D変換された撮像データに対して欠陥画素補正処理を行わせる。   Next, in step S303, the camera CPU 121 causes the image processing circuit 125 to perform a defective pixel correction process on the imaging data read and A / D converted in step S302.

さらにS304では、カメラCPU121は、画像処理回路125に、欠陥画素補正処理後の撮像データに対して、デモザイク(色補間)処理、ホワイトバランス処理、γ補正(階調補正)処理、色変換処理およびエッジ強調処理等の画像処理や符号化処理を行わせる。   Further, in step S304, the camera CPU 121 causes the image processing circuit 125 to perform demosaic (color interpolation) processing, white balance processing, γ correction (tone correction) processing, color conversion processing, and the like on the image data after the defective pixel correction processing. Image processing such as edge enhancement processing and encoding processing are performed.

そしてS305では、カメラCPU121は、S304での画像処理や符号化処理が行われることで得られた画像データとしての高画素静止画データと、S302で読み出された一方の焦点検出信号とを、画像データファイルとしてメモリ133に記録する。   In S305, the camera CPU 121 converts the high-pixel still image data as image data obtained by performing the image processing and the encoding process in S304, and one focus detection signal read out in S302, It is recorded in the memory 133 as an image data file.

次にS306では、カメラCPU121は、S305で記録した高画素静止画データに対応付けて、カメラ100の特性情報としてのカメラ特性情報をメモリ133とカメラCPU121内のメモリに記録する。カメラ特性情報は、例えば以下の情報を含む。
・撮像条件(絞り値、シャッタ速度、撮像感度等)
・画像処理回路125で行った画像処理に関する情報
・撮像素子107の撮像画素および焦点検出画素の受光感度分布に関する情報
・カメラ100内での撮像光束のケラレに関する情報
・カメラ100における撮像光学系の取付け面から撮像素子107までの距離の情報
・カメラ100の製造誤差に関する情報。
撮像画素および焦点検出画素の受光感度分布に関する情報(以下、単に受光感度分布情報という)は、撮像素子107から光軸上の距離(位置)に応じた撮像素子107の感度の情報である。この受光感度分布情報は、マイクロレンズ305と光電変換部301,302に依存するため、これらに関する情報であってもよい。また、受光感度分布情報は、光の入射角度に対する感度の変化の情報であってもよい。
Next, in S306, the camera CPU 121 records the camera characteristic information as the characteristic information of the camera 100 in the memory 133 and the memory in the camera CPU 121 in association with the high pixel still image data recorded in S305. The camera characteristic information includes, for example, the following information.
・ Imaging conditions (aperture value, shutter speed, imaging sensitivity, etc.)
・ Information on image processing performed by the image processing circuit 125 ・ Information on light-receiving sensitivity distribution of imaging pixels and focus detection pixels of the imaging element 107 ・ Information on vignetting of imaging light flux in the camera 100 ・ Mounting of an imaging optical system in the camera 100 Information on the distance from the surface to the image sensor 107 and information on the manufacturing error of the camera 100.
Information on the light-receiving sensitivity distribution of the imaging pixel and the focus detection pixel (hereinafter, simply referred to as light-receiving sensitivity distribution information) is information on the sensitivity of the imaging element 107 according to the distance (position) on the optical axis from the imaging element 107. Since the light receiving sensitivity distribution information depends on the microlens 305 and the photoelectric conversion units 301 and 302, it may be information on these. Further, the light receiving sensitivity distribution information may be information on a change in sensitivity with respect to the incident angle of light.

次にS307では、カメラCPU121は、S305で記録した高画素静止画データに対応付けて、撮像光学系の特性情報としてのレンズ特性情報をメモリ133とカメラCPU121内のメモリに記録する。レンズ特性情報は、例えば、射出瞳に関する情報、光束をける鏡筒等の枠に関する情報、撮像時の焦点距離やFナンバーの情報、撮像光学系の収差に関する情報、撮像光学系の製造誤差に関する情報および撮像時のフォーカスレンズ105の位置(被写体距離)の情報を含む。   Next, in step S307, the camera CPU 121 records lens characteristic information as characteristic information of the imaging optical system in the memory 133 and the memory in the camera CPU 121 in association with the high-pixel still image data recorded in step S305. The lens characteristic information includes, for example, information about an exit pupil, information about a frame such as a lens barrel for emitting a light beam, information about a focal length and an F-number at the time of imaging, information about aberration of an imaging optical system, and information about a manufacturing error of an imaging optical system. And information on the position (subject distance) of the focus lens 105 at the time of imaging.

次にS308では、カメラCPU121は、高画素静止画データに関する情報としての画像関連情報をメモリ133とカメラCPU121内のメモリに記録する。画像関連情報は、例えば、撮像前の焦点検出動作に関する情報、被写体の移動に関する情報、焦点検出精度に関する情報を含む。   Next, in S308, the camera CPU 121 records image-related information as information relating to high-pixel still image data in the memory 133 and the memory in the camera CPU 121. The image-related information includes, for example, information on a focus detection operation before imaging, information on movement of a subject, and information on focus detection accuracy.

次にS309では、カメラCPU121は、表示器131に、撮像画像のプレビュー表示を行う。これにより、ユーザは撮像画像を簡易的に確認することができる。   Next, in step S309, the camera CPU 121 performs a preview display of the captured image on the display 131. Thus, the user can easily check the captured image.

S309の処理が終わると、カメラCPU121は本撮像サブルーチンを終了して、図8のS9に進む。   When the processing in S309 ends, the camera CPU 121 ends the main imaging subroutine, and proceeds to S9 in FIG.

次に、図10に示すフローチャートを用いて、図7のS400でカメラCPU121が実行する連写中焦点検出サブルーチンについて説明する。   Next, the continuous shooting focus detection subroutine executed by the camera CPU 121 in S400 of FIG. 7 will be described using the flowchart shown in FIG.

S401では、カメラCPU121は、図9のS301と同様に露出制御処理を行い、撮像条件を決定する。ここでは、焦点検出のための撮像素子107の露光を行うため、カメラCPU121は、焦点検出に適した絞り値を決定し、その絞り値に応じてシャッタ速度および撮像感度を決定する。   In S401, the camera CPU 121 performs an exposure control process in the same manner as in S301 in FIG. 9, and determines an imaging condition. Here, in order to perform exposure of the imaging element 107 for focus detection, the camera CPU 121 determines an aperture value suitable for focus detection, and determines a shutter speed and an imaging sensitivity according to the aperture value.

そして、カメラCPU121は、決定した絞り値とシャッタ速度を絞りシャッタ駆動回路128に送信し、絞り兼シャッタ102を駆動させる。さらにカメラCPU121は、撮像素子駆動回路124を通じて露光期間の間、撮像素子107に電荷蓄積を行わせる。この際、絞り兼シャッタ102を駆動せずに、露光時間を電気的に制御するスリットローリングシャッタやグローバル電子シャッタを用いて露光を行ってもよい。   Then, the camera CPU 121 transmits the determined aperture value and shutter speed to the aperture shutter drive circuit 128 to drive the aperture / shutter 102. Further, the camera CPU 121 causes the image sensor 107 to store charges during the exposure period through the image sensor drive circuit 124. At this time, the exposure may be performed using a slit rolling shutter or a global electronic shutter that electrically controls the exposure time without driving the aperture / shutter 102.

露光制御処理を行ったカメラCPU121は、S402において、撮像素子駆動回路124に、撮像素子107のうち合焦目標領域から撮像信号と第1および第2焦点検出信号のうち一方の焦点検出信号の全画素読み出しを行わせる。図7のS4での焦点検出時には、ライブビュー画像を生成するために水平方向の画素出力に対して加算または間引き等の処理を行って得られた信号を用いるが、S402では全画素の信号を読み出して用いる。これにより、撮像素子107の駆動を、撮像時とライブビュー画像生成時で切り替える必要がないため、切り替え時間を必要とせずに焦点検出信号を得ることができる。また、この時点で図8のS6で選択された時点から被写体が移動していた場合には、被写体検出処理を用いて合焦目標領域を変更すればよい。   In step S402, the camera CPU 121 that has performed the exposure control process causes the image sensor drive circuit 124 to output all of the image signal and one of the first and second focus detection signals from the focus target area of the image sensor 107. Pixel reading is performed. At the time of focus detection in S4 of FIG. 7, a signal obtained by performing processing such as addition or thinning on a horizontal pixel output to generate a live view image is used. In S402, signals of all pixels are output. Read and use. Accordingly, it is not necessary to switch the driving of the image sensor 107 between the time of imaging and the time of generating a live view image, so that a focus detection signal can be obtained without requiring a switching time. If the subject has moved from the time point selected in S6 of FIG. 8 at this time, the focus target area may be changed using the subject detection process.

次にS403では、カメラCPU121は、画像処理回路125に、S402で読み出されてA/D変換された撮像データに対して欠陥画素補正処理を行わせる。   Next, in S403, the camera CPU 121 causes the image processing circuit 125 to perform a defective pixel correction process on the imaging data read and A / D converted in S402.

次にS404では、カメラCPU121は、合焦目標領域で得られた第1および第2焦点検出信号を用いて、合焦目標領域におけるデフォーカス量を算出する。   Next, in S404, the camera CPU 121 calculates the defocus amount in the focusing target area using the first and second focus detection signals obtained in the focusing target area.

次にS405では、カメラCPU121は、合焦目標領域のデフォーカス量に応じてフォーカスレンズ105を合焦位置に駆動する。この後、カメラCPU121は、本連写中焦点検出サブルーチンを終了し、図7のS9に進む。   Next, in S405, the camera CPU 121 drives the focus lens 105 to a focus position according to the defocus amount of the focus target area. Thereafter, the camera CPU 121 ends the continuous shooting focus detection subroutine, and proceeds to S9 in FIG.

図11のフローチャートは、カメラCPU121が行う画像再生処理を示す。本処理の開始時には、メモリ133に記録された複数の撮像画像が表示器131に表示されているものとする。   The flowchart of FIG. 11 shows an image reproduction process performed by the camera CPU 121. At the start of this processing, it is assumed that a plurality of captured images recorded in the memory 133 are displayed on the display 131.

まずS1001では、カメラCPU121は、ユーザの操作に応じて、表示器131に表示された複数のサムネイル画像のうち1つを選択し、選択されたサムネイル画像に対応する撮像画像を表示器131に再生表示する。   First, in step S1001, the camera CPU 121 selects one of a plurality of thumbnail images displayed on the display unit 131 according to a user operation, and reproduces a captured image corresponding to the selected thumbnail image on the display unit 131. indicate.

次にS1002では、カメラCPU121は、ユーザの操作に応じて、S1001で再生表示された撮像画像(以下、再生画像という)において着目領域を設定する。   Next, in step S1002, the camera CPU 121 sets a region of interest in the captured image reproduced and displayed in step S1001 (hereinafter, referred to as a reproduced image) according to a user operation.

図12(a),(b)を用いて、再生画像から着目領域(第1の評価領域)を設定する方法について説明する。図12(a)は、再生画像の全体を表示器131に表示した状態を示し、図12(b)は再生画像の一部を表示器131に拡大表示した状態を示している。   A method of setting a region of interest (first evaluation region) from a reproduced image will be described with reference to FIGS. FIG. 12A shows a state where the entire reproduced image is displayed on the display 131, and FIG. 12B shows a state where a part of the reproduced image is enlarged and displayed on the display 131.

ユーザは、操作スイッチ群132の操作または表示器131がタッチパネルである場合のそのタッチ操作を通じて、再生画像のうちピント状態を確認する着目領域A100の位置と大きさを指定する。カメラCPU121は、その指定に応じて再生画像における着目領域を設定する。操作スイッチ群132やタッチパネルとしての表示器131およびカメラCPU121は、領域設定手段に相当する。着目領域A100の設定は、再生画像の全体を表示した図12(a)に示す状態で行ってもよいし、一部を拡大表示した図12(b)に示す状態で行ってもよい。   The user designates the position and size of the region of interest A100 for checking the focus state in the reproduced image through the operation of the operation switch group 132 or the touch operation when the display 131 is a touch panel. The camera CPU 121 sets a region of interest in the reproduced image according to the designation. The operation switch group 132, the display 131 as a touch panel, and the camera CPU 121 correspond to an area setting unit. The setting of the region of interest A100 may be performed in the state shown in FIG. 12A in which the entire reproduced image is displayed, or may be performed in the state shown in FIG.

次にS1003では、画像群設定手段としてのカメラCPU121は、S1002で設定した着目領域に基づいて、再生画像を含んで相互に関連する複数の撮像画像を含む画像群を設定する。すなわち、第1のグルーピングを行う。この際、領域検出手段としてのカメラCPU121は、再生画像(第1の画像)と撮像時刻が近い複数の他の撮像画像(第2の画像)に、ユーザが設定した着目領域と関連性を有する(言い換えれば、類似する)領域が含まれるか否かを判定(検出)する。カメラCPU121は、着目領域と類似する領域が含まれる撮像画像がある場合は、その類似する領域を着目領域に対応する対応領域として認定する。そして、再生画像と対応領域を有する複数の他の撮像画像を含む画像群を設定する。画像群は、後述する第2のグルーピングの対象となる。画像群の設定方法については、後に詳しく説明する。なお、本実施例では、着目領域に対して対応領域が「関連性を有する」ことを「類似する」と表現するが、類似すること以外の関連性がある領域を対応領域としてもよい。   Next, in step S1003, the camera CPU 121 as an image group setting unit sets an image group including a plurality of mutually related captured images including a reproduced image based on the region of interest set in step S1002. That is, the first grouping is performed. At this time, the camera CPU 121 as an area detecting unit has relevance to the attention area set by the user in a plurality of other captured images (second images) whose imaging times are close to the reproduced image (first image). It is determined (detected) whether or not (in other words, similar) area is included. When there is a captured image including a region similar to the region of interest, the camera CPU 121 recognizes the similar region as a corresponding region corresponding to the region of interest. Then, an image group including a plurality of other captured images having a reproduction image and a corresponding area is set. The image group is a target of a second grouping described later. The method of setting the image group will be described later in detail. Note that, in the present embodiment, the fact that the corresponding region has “relevance” to the region of interest is expressed as “similar”, but a region having a relationship other than similarity may be the corresponding region.

次にS1004では、ピント状態取得手段としてのカメラCPU121は、S1003で設定した画像群における着目領域と対応領域のピント状態を取得(検出)する。すなわち、カメラCPU121は、着目領域と対応領域のそれぞれについてピント状態を検出して、「合焦状態」、「前ピン状態」および「後ピン状態」を判定する。ピント状態とは、デフォーカス量とデフォーカス方向を含む。   Next, in step S1004, the camera CPU 121 as a focus state obtaining unit obtains (detects) the focus state of the attention area and the corresponding area in the image group set in step S1003. That is, the camera CPU 121 detects the focus state of each of the attention area and the corresponding area, and determines the “focus state”, the “front focus state”, and the “back focus state”. The focus state includes a defocus amount and a defocus direction.

そして処理手段としてのカメラCPU121は、S1005に進み、第1のグルーピングで設定された画像群に含まれる複数の撮像画像(再生画像と他の撮像画像)をS1004でのピント状態の検出結果に応じて複数のグループに分類する分類処理を行う。この分類処理を、第2のグルーピングといい、後に詳しく説明する。   Then, the camera CPU 121 as a processing unit proceeds to S1005, in which a plurality of captured images (reproduced images and other captured images) included in the image group set in the first grouping are determined according to the focus state detection result in S1004. To perform a classification process for classifying into a plurality of groups. This classification processing is called second grouping, and will be described later in detail.

次にS1006では、カメラCPU121は、ユーザが操作スイッチ群132にて再生画像を時系列に変更する操作を行ったか否かを判定する。ユーザが該操作を行っていない場合はカメラCPU121はS1007に進み、ユーザが該操作を行った場合はS1008に進む。   Next, in step S1006, the camera CPU 121 determines whether or not the user has performed an operation of changing the reproduced image in a time series with the operation switch group 132. If the user has not performed the operation, the camera CPU 121 proceeds to S1007. If the user has performed the operation, the camera CPU 121 proceeds to S1008.

S1007では、カメラCPU121は、ユーザが操作スイッチ群132にて再生画像をピント方向に変更する操作を行ったか否かを判定する。ユーザが該操作を行っていない場合はカメラCPU121はS1006に戻ってユーザ操作を待ち、ユーザが該操作を行った場合はS1009に進む。   In step S <b> 1007, the camera CPU 121 determines whether the user has performed an operation of changing the playback image in the focusing direction using the operation switch group 132. If the user has not performed the operation, the camera CPU 121 returns to S1006 and waits for a user operation. If the user has performed the operation, the camera CPU 121 proceeds to S1009.

図13を用いて、S1006およびS1007においてユーザが操作する操作スイッチ群132の例について説明する。図13は、背面から見たカメラ100を示している。表示器131には、再生画像が表示される。カメラ100の背面には、操作ボタンB1〜B4が十字状に配置されている。   An example of the operation switch group 132 operated by the user in S1006 and S1007 will be described with reference to FIG. FIG. 13 shows the camera 100 viewed from the back. The display 131 displays a reproduced image. On the back of the camera 100, operation buttons B1 to B4 are arranged in a cross shape.

S1006において再生画像を時系列に変更するユーザ操作は、第1の表示画像変更手段としての操作ボタンB2,B4に対して行われる。例えば、操作ボタンB2が押されることで現在の再生画像よりも時間的に後に取得された撮像画像が新たに再生画像として表示され、操作ボタンB4が押されることで現在の再生画像よりも時間的に前に取得された撮像画像が新たに再生画像として表示される。   In S1006, the user operation for changing the reproduction image in time series is performed on the operation buttons B2 and B4 as first display image changing means. For example, when the operation button B2 is pressed, a captured image acquired after the current playback image in time is newly displayed as a playback image, and when the operation button B4 is pressed, the captured image is temporally shorter than the current playback image. The captured image acquired earlier is displayed as a new reproduced image.

S1007において再生画像をピント方向に変更するユーザ操作は、第2の表示画像変更手段としての操作ボタンB1,B3に対して行われる。例えば、操作ボタンB1が押されることで現在の再生画像より無限遠側にピントが合っている撮像画像が新たに再生画像として表示され、操作ボタンB3が押されることで現在の再生画像より至近側にピントが合っている撮像画像が新たに再生画像として表示される。   In S1007, the user operation for changing the playback image in the focus direction is performed on the operation buttons B1 and B3 as the second display image changing unit. For example, when the operation button B1 is pressed, a captured image focused on the infinity side from the current reproduction image is newly displayed as a reproduction image, and when the operation button B3 is pressed, the image is closer to the current reproduction image. The captured image focused on is displayed as a new reproduced image.

十字状に配置された操作ボタンB1〜B4に代えて、ダイヤルの回転操作によって再生画像を変更するユーザ操作が行われるようにしてもよい。この場合、再生画像を時系列に変更するためのダイヤルと、再生画像をピント方向に変更するためのダイヤルとを別々に設ければよい。また、ダイヤルと操作ボタンを組み合わせて再生画像を時系列およびピント方向に変更してもよい。さらに、操作スイッチ群132ではなく、表示器131のタッチパネルに対するタッチ操作(例えば、左右方向と上下方向のスワイプ操作)によって時系列およびピント方向に変更してもよい。   Instead of the operation buttons B <b> 1 to B <b> 4 arranged in a cross shape, a user operation of changing a playback image by rotating a dial may be performed. In this case, a dial for changing the reproduced image in time series and a dial for changing the reproduced image in the focusing direction may be separately provided. Also, the playback image may be changed in time series and in the focus direction by combining the dial and the operation buttons. Furthermore, instead of the operation switch group 132, a touch operation (for example, a swipe operation in the left-right direction and the up-down direction) on the touch panel of the display 131 may change the time series and the focus direction.

S1008では、カメラCPU121は、S1005で分類された同一ピント状態の撮像画像のグループの中に、S1006でのユーザ操作に応じて再生画像として変更可能な時系列での次の撮像画像(以下、次の時系列画像という)が存在するか否かを判定する。次の時系列画像が存在しない場合は、カメラCPU121はS1011に進み、表示器131に次の時系列画像が存在しない旨を表示させる。具体的には、文字により次の時系列画像が存在しない旨を通知してもよいし、ユーザ操作(操作ボタンB2,B4やタッチパネルの操作)がなされても再生画像が変更されないことで次の時系列画像が存在しない旨を通知してもよい。一方、次の時系列画像が存在する場合は、カメラCPU121はS1012に進み、表示器131に該次の時系列画像を表示する。こうしてS1011またはS1012を終えたカメラCPU121は、S1013に進む。   In step S1008, the camera CPU 121 selects the next captured image in the time series that can be changed as a playback image in response to the user operation in step S1006, in the group of captured images in the same focus state classified in step S1005. Is determined. If the next time series image does not exist, the camera CPU 121 proceeds to S1011 and causes the display 131 to display that the next time series image does not exist. Specifically, the fact that the next time-series image does not exist may be notified by a character, or the next image is not changed even if a user operation (operation of the operation buttons B2, B4 or the touch panel) is performed. You may notify that a time-series image does not exist. On the other hand, when the next time-series image exists, the camera CPU 121 proceeds to S1012, and displays the next time-series image on the display 131. The camera CPU 121 that has completed S1011 or S1012 proceeds to S1013.

S1009では、カメラCPU121は、現在の再生画像に対してS1007でのユーザ操作に対応するピント方向にてピント状態が異なる撮像画像のグループが存在するか否かを判定する。例えば、現在の再生画像が「合焦状態」のグループに含まれる場合においてユーザ操作が前ピン方向に対応する場合は、「前ピン状態」のグループに撮像画像が存在するか否かを判定する。また、現在の再生画像が「前ピン状態」のグループに含まれる場合においてユーザ操作が前ピン方向に対応する場合は、より「前ピン状態」のグループに撮像画像が存在するか否かを判定する。ユーザ操作に対応するピント状態が異なる撮像画像のグループが存在する場合はS1010に進み、そうでなければS1011に進んで表示器131にピント方向における次の撮像画像が存在しない旨を表示させる。   In S1009, the camera CPU 121 determines whether or not there is a group of captured images having different focus states in the focus direction corresponding to the user operation in S1007 with respect to the current playback image. For example, when the current playback image is included in the “focused state” group and the user operation corresponds to the front focus direction, it is determined whether or not the captured image exists in the “front focus state” group. . When the current playback image is included in the “front focus state” group and the user operation corresponds to the front focus direction, it is determined whether or not the captured image exists in the “front focus state” group. I do. If there is a group of captured images corresponding to the user operation with different focus states, the process proceeds to S1010; otherwise, the process proceeds to S1011 to display on the display 131 that there is no next captured image in the focus direction.

S1010では、カメラCPU121は、S1007でのユーザ操作に対応するピント方向における次の撮像画像であって、現在の再生画像に対して時系列で最も近い撮像画像を新たな再生画像として表示器131に表示する。   In step S1010, the camera CPU 121 sets the next captured image in the focus direction corresponding to the user operation in step S1007, which is closest in time series to the current reproduced image, to the display 131 as a new reproduced image. indicate.

こうしてS1010またはS1011を終えたカメラCPU121は、S1013に進む。   The camera CPU 121 that has completed S1010 or S1011 proceeds to S1013.

S1013では、カメラCPU121は、本画像再生処理を終了するか否かを判定する。ユーザによって電源をオフにされたり、画像再生状態から撮像状態に移行するよう指示されたりした場合は、カメラCPU121は画像再生処理を終了するためにS1014に進む。また、後述するS1014で説明する撮像画像のグルーピングの再設定を行う場合にも、カメラCPU121はS1013では画像再生処理を終了すると判定してS1014に進む。一方、本画像再生処理を終了せずに継続する場合は、カメラCPU121は、S1006に戻ってユーザ操作を待つ。   In step S1013, the camera CPU 121 determines whether to end the main image reproduction process. If the user turns off the power or instructs to shift from the image playback state to the imaging state, the camera CPU 121 proceeds to S1014 to end the image playback processing. In addition, also in the case where the grouping of the captured images described below in S1014 is reset, the camera CPU 121 determines in S1013 to end the image reproduction process, and proceeds to S1014. On the other hand, if the main image reproduction process is to be continued without ending, the camera CPU 121 returns to S1006 and waits for a user operation.

S1014では、カメラCPU121は、S1003またはS1005で行った撮像画像のグルーピングに関する処理を改めて行うか否かを判定する。時系列において前後の撮像画像を追加または削減したい場合、ピント状態に応じて撮像画像を分類するグループ数やピント状態の判定を行うための閾値等を変更する場合および着目領域の再設定を行う場合は、S1001に戻る。一方、撮像画像のグルーピングの再設定を行わない場合は、カメラCPU121は本画像再生処理を終了する。   In step S1014, the camera CPU 121 determines whether to perform the process regarding the grouping of the captured images performed in step S1003 or S1005 again. When adding or reducing captured images before and after in the time series, when changing the number of groups for classifying captured images according to the focus state, changing the threshold value for determining the focus state, and resetting the region of interest Returns to S1001. On the other hand, when the grouping of the captured images is not reset, the camera CPU 121 ends the main image reproduction process.

本実施例では、S1014で説明したように着目領域の再設定により、撮像画像(再生画像)のうちピント状態を確認する領域を変更可能としている。このため、撮像時に設定された着目領域(合焦目標領域)に限らず、その後にユーザが望む着目領域でピント状態を確認することができる。また、1つの撮像画像について複数の着目領域でピント状態を確認することも可能である。例えば、乗り物に乗った人物の撮像画像において、人物の顔だけでなく、乗り物にも着目領域を設定することができる。   In this embodiment, as described in step S1014, the region of the captured image (reproduced image) for checking the focus state can be changed by resetting the region of interest. For this reason, the focus state can be confirmed not only in the region of interest (focusing target region) set at the time of imaging but also in the region of interest desired by the user. It is also possible to check the focus state in a plurality of regions of interest for one captured image. For example, in a captured image of a person riding a vehicle, a region of interest can be set not only on the face of the person but also on the vehicle.

次に、図14のフローチャートを用いて、図11のS1003でカメラCPU121が行う第1のグル―ピングのサブルーチンについて説明する。本サブルーチンでは、カメラCPU121は、S1002で設定された着目領域に基づいて相互に関連する画像群を設定する。   Next, a first grouping subroutine performed by the camera CPU 121 in S1003 of FIG. 11 will be described with reference to the flowchart of FIG. In this subroutine, the camera CPU 121 sets a group of mutually related images based on the region of interest set in S1002.

S3001では、カメラCPU121は、検出画像群を設定する。検出画像群の設定方法としては種々な方法があるが、S1002で設定された着目領域に対応する対応領域を有する複数の撮像画像を検出画像群として設定する。例えば、S1002で設定された着目領域および対応領域を有する複数の撮像画像が連写により取得されたものであれば、対応領域を有する複数の連続撮像画像(連写画像群)を検出画像群として設定する。   In S3001, the camera CPU 121 sets a group of detected images. There are various methods for setting a group of detected images, and a plurality of captured images having a corresponding area corresponding to the target area set in S1002 are set as a group of detected images. For example, if a plurality of captured images having a target area and a corresponding area set in S1002 are obtained by continuous shooting, a plurality of continuous captured images (continuously shot image group) having a corresponding area are set as a detection image group. Set.

また、S1002で設定された着目領域を有する撮像画像の撮像時間に対して所定範囲内(例えば、10分以内)の時刻を撮像時間とする複数の撮像画像を検出画像群として設定してもよい。さらに、連写中の焦点調節の追従状況や露出制御状況によって検出画像群を設定してもよい。例えば、焦点調節をサーボ制御する、いわゆるサーボAFを行っている間の撮像により取得された複数の撮像画像を検出画像群と設定してもよい。上述した連写中の焦点調節の追従状況や露出制御状況等、一度の画像記録指示により記録されたことを識別するために複数の連続撮像画像に付与される情報が連続撮像情報に相当する。   Further, a plurality of captured images having a time within a predetermined range (for example, within 10 minutes) with respect to the capturing time of the captured image having the region of interest set in S1002 may be set as the detection image group. . Further, a group of detected images may be set according to a tracking state of focus adjustment or an exposure control state during continuous shooting. For example, a plurality of picked-up images obtained by picking up images while performing so-called servo AF for performing servo control of focus adjustment may be set as a detected image group. Information added to a plurality of consecutively captured images to identify that the images have been recorded by a single image recording instruction, such as the above-described focus adjustment tracking state and exposure control state during continuous shooting, corresponds to continuous imaging information.

次にS3002では、カメラCPU121は、検出画像群に含まれる各撮像画像に対して対応領域を有するか否かを判定する。そして、対応領域を有する撮像画像において、その対応領域の撮像画像内での位置および大きさを検出する。この判定と検出には、テンプレートマッチングを用いる。テンプレートマッチングにおける被写体モデル(テンプレート)を着目領域とし、この着目領域の画素パターンを特徴量として扱う。   Next, in S3002, the camera CPU 121 determines whether or not each captured image included in the detected image group has a corresponding area. Then, in the captured image having the corresponding area, the position and the size of the corresponding area in the captured image are detected. For this determination and detection, template matching is used. A subject model (template) in template matching is set as a region of interest, and a pixel pattern of the region of interest is treated as a feature amount.

特徴量T(i,j)は、テンプレート内の座標を(i,j)、水平画素数をW、垂直画素数をHとすると、式(2)で表現される。
T(i, j) = {T(0, 0), T(1, 0), ... , T(W-1, H-1)} (2)
対応領域を探索する撮像画像において、マッチングを行う範囲(探索範囲)は、該撮像画像の全領域とする。探索範囲における座標は(x,y)で表現する。マッチングの評価値を取得するための部分領域を設定し、テンプレートの特徴量と同様に、各部分領域の輝度信号を特徴量S(i,j)とする。特徴量S(i,j)は、部分領域内の座標を(i,j)、水平画素数をW、垂直画素数をHとすると、式(3)で表現される。
S(i, j) = {S(0, 0), S(1, 0), ... , S(W-1, H-1)} (3)
テンプレートと部分領域との類似性を評価する演算方法として、差分絶対和、いわゆるSAD(Sum of Absolute Difference)値を用いる。SAD値は、式(4)により算出される。
The feature amount T (i, j) is represented by Expression (2), where (i, j) is the coordinate in the template, W is the number of horizontal pixels, and H is the number of vertical pixels.
T (i, j) = {T (0, 0), T (1, 0), ..., T (W-1, H-1)} (2)
In a captured image in which a corresponding area is searched, the range in which matching is performed (search range) is the entire area of the captured image. The coordinates in the search range are represented by (x, y). A partial area for acquiring a matching evaluation value is set, and the luminance signal of each partial area is set as a feature amount S (i, j), similarly to the template feature amount. The feature amount S (i, j) is represented by Expression (3), where (i, j) is the coordinate in the partial area, W is the number of horizontal pixels, and H is the number of vertical pixels.
S (i, j) = {S (0, 0), S (1, 0), ..., S (W-1, H-1)} (3)
As a calculation method for evaluating the similarity between the template and the partial area, an absolute difference sum, a so-called SAD (Sum of Absolute Difference) value is used. The SAD value is calculated by equation (4).

部分領域を探索範囲である撮像画像の全領域の左上から順に1画素ずつずらしながら、SAD値V(x,y)を演算する。演算されたV(x,y)が最小値を示す座標(x,y)がテンプレートと最も類似した位置を示す。つまり、最小値を示す位置が探索範囲において目的とする追尾対象の被写体が存在する可能性の高い位置となる。ここでは、特徴量として輝度信号の1次元の情報を用いる例を示したが、明度・色相・彩度の信号等の3次元の情報を特徴量として扱ってもよい。また、ここではマッチングの評価値としてSAD値を用いる場合について説明したが、正規化相互相関、いわゆるNCC(Normalized Correlation Coefficient)等の異なる演算方法により得られた値を用いてもよい。 The SAD value V (x, y) is calculated while shifting the partial area one pixel at a time from the upper left of the entire area of the captured image that is the search range. The coordinates (x, y) at which the calculated V (x, y) indicates the minimum value indicate the position most similar to the template. In other words, the position indicating the minimum value is the position where there is a high possibility that the target tracking target subject exists in the search range. Here, an example in which one-dimensional information of a luminance signal is used as the feature amount has been described, but three-dimensional information such as lightness, hue, and saturation signals may be handled as the feature amount. Although the case where the SAD value is used as the matching evaluation value has been described here, a value obtained by a different calculation method such as normalized cross-correlation, so-called NCC (Normalized Correlation Coefficient) may be used.

最も類似した位置におけるSAD値V(x,y)が所定の値より大きい場合には、検出対象の撮像画像は対応領域を有さないと判定する。これにより、S3001で設定した検出画像群を再設定することができる。   If the SAD value V (x, y) at the most similar position is larger than a predetermined value, it is determined that the captured image to be detected does not have a corresponding region. Thereby, the detected image group set in S3001 can be reset.

次にS3003では、カメラCPU121は、再生画像と検出画像群のうち対応領域を有する撮像画像を画像群として設定し、該画像群の各撮像画像に対応領域の位置と大きさ(範囲)の情報を付与する。S3003を終えたカメラCPU121は、本サブルーチンの処理を終了する。   Next, in step S3003, the camera CPU 121 sets a captured image having a corresponding region in the reproduced image and the detected image group as an image group, and stores information on the position and size (range) of the corresponding region in each captured image of the image group. Is given. The camera CPU 121 that has completed S3003 ends the processing of this subroutine.

次に、図15のフローチャートを用いて、図11のS1004でカメラCPU121が着目および対応領域のピント状態を検出するサブルーチンについて説明する。本サブルーチンでは、カメラCPU121は、S1003で設定された画像群に含まれる各撮像画像における着目領域または対応領域のピント状態を検出する。   Next, a subroutine in which the camera CPU 121 detects the focused state and the focus state of the corresponding area in S1004 of FIG. 11 will be described using the flowchart of FIG. In this subroutine, the camera CPU 121 detects the focus state of the focused area or the corresponding area in each captured image included in the image group set in S1003.

S4001では、カメラCPU121は、画像群に含まれる各撮像画像における第1の評価領域としての着目または対応領域の位相差(像ずれ量)を検出する。上述したS302で説明したように、本実施例のカメラ100は通常の撮像画像を記録する際に、第1および第2焦点検出信号のうち一方も記録する。カメラCPU121は、記録された一方の焦点検出信号と、撮像信号から該一方の焦点検出信号を差し引いて得られる他方の焦点検出信号との間の像ずれ量を検出する。   In step S4001, the camera CPU 121 detects a phase difference (image shift amount) of a focused or corresponding region as a first evaluation region in each captured image included in the image group. As described in S302 described above, the camera 100 of this embodiment also records one of the first and second focus detection signals when recording a normal captured image. The camera CPU 121 detects an image shift amount between one of the recorded focus detection signals and the other focus detection signal obtained by subtracting the one focus detection signal from the imaging signal.

S4001で行う像ずれ量検出は、ライブビュー画像を表示している状態(ライブビュー状態)に行う像ずれ量検出と算出方法は同じであるが、用いる焦点検出信号の画素ピッチが異なる。ライブビュー画像の生成には、水平方向の画素出力に対して加算または間引き等の処理を行って得られる信号が用いられるが、S4001では高画素静止画を記録するために全画素読み出しされた撮像信号を用いるため、より細かい画素ピッチの信号を得る。このため、S4001では、より高精度な像ずれ量検出が可能となる。   The image shift amount detection performed in step S4001 is the same as the image shift amount detection method performed when a live view image is displayed (live view state), but the pixel pitch of the focus detection signal used is different. For generating a live view image, a signal obtained by performing processing such as addition or thinning on a pixel output in the horizontal direction is used. In step S4001, an image obtained by reading all pixels to record a high-pixel still image is used. Since a signal is used, a signal with a finer pixel pitch is obtained. For this reason, in S4001, it is possible to detect the image shift amount with higher accuracy.

また、ライブビュー状態での焦点検出タイミングと記録用撮像タイミングとが異なるため、必ずしもこれらのタイミングでピント状態が等しいとは限らない。撮像タイミングにおけるピント状態をライブビュー状態での焦点検出結果から予測することは可能であるが、誤差をなくすことは困難である。一方、複数の視点の位置と該視点からの視線方向の情報(複数の視点に関する情報:視点情報)を含む記録用撮像画像の撮像信号を用いた像ずれ量検出は、タイムラグなく記録用撮像画像のピント状態を検出することができる。   Further, since the focus detection timing and the recording imaging timing in the live view state are different, the focus states are not necessarily equal at these timings. Although it is possible to predict the focus state at the imaging timing from the focus detection result in the live view state, it is difficult to eliminate the error. On the other hand, image shift amount detection using an imaging signal of a captured image for recording including information on the positions of a plurality of viewpoints and line-of-sight directions from the viewpoints (information on the plurality of viewpoints: viewpoint information) is performed without any time lag. Can be detected.

さらにS4001では、カメラCPU121は、各撮像画像において検出した像ずれ量を、各撮像画像を取得した際のカメラ特性情報(S306で取得)やレンズ特性情報(S307で取得)を用いて、デフォーカス量や被写体距離に換算する。デフォーカス量に換算する際には、光束範囲情報(射出瞳の光軸上の位置、撮像光学系のFナンバーおよび枠に関する情報)と焦点検出画素の受光感度分布情報とを用いて、光束範囲情報を考慮した受光感度分布情報を算出する。カメラCPU121は、対の焦点検出画素の受光感度分布情報から、これら受光感度分布情報を示す座標上での対の代表値(代表座標)を算出する。そして、該対の代表値の間隔Wと撮像素子107から受光感度分布情報を示す光軸上の位置までの距離Lとを用いてL/Wを算出し、検出された像ずれ量にL/Wを乗じることによりデフォーカス量を算出する。なお、対の代表値は、受光感度分布の重心座標でもよいし、受光感度分布の範囲の中心座標でもよい。   Further, in S4001, the camera CPU 121 defocuses the image shift amount detected in each captured image using the camera characteristic information (acquired in S306) and the lens characteristic information (acquired in S307) at the time of acquiring each captured image. It is converted into the amount and subject distance. When converting to a defocus amount, the luminous flux range is calculated using luminous flux range information (information on the position of the exit pupil on the optical axis, F number and frame of the imaging optical system) and light receiving sensitivity distribution information of the focus detection pixels. The light receiving sensitivity distribution information considering the information is calculated. The camera CPU 121 calculates a representative value (representative coordinate) of the pair on the coordinates indicating the light receiving sensitivity distribution information from the light receiving sensitivity distribution information of the pair of focus detection pixels. Then, L / W is calculated using the interval W between the representative value of the pair and the distance L from the image sensor 107 to the position on the optical axis indicating the light-receiving sensitivity distribution information, and the detected image shift amount is calculated as L / W. The defocus amount is calculated by multiplying W. Note that the representative value of the pair may be the barycentric coordinates of the light-receiving sensitivity distribution or the center coordinates of the range of the light-receiving sensitivity distribution.

また、記録用撮像画像の取得時に撮像光学系のFナンバーと射出瞳距離に応じた変換係数を記憶しておき、これを像ずれ量に乗じることでデフォーカス量を算出してもよい。   Further, a conversion coefficient corresponding to the F-number of the imaging optical system and the exit pupil distance may be stored at the time of acquiring the captured image for recording, and the defocus amount may be calculated by multiplying the conversion coefficient by the image shift amount.

さらに、デフォーカス量を距離情報に換算する際には、撮像時のフォーカスレンズ105の位置に対応付けられた被写体距離情報Dと焦点距離情報fとから撮像倍率(横倍率)Bを求め、デフォーカス量をB倍する。これにより、被写体距離上でのデフォーカス量(距離情報)を算出することができる。被写体距離は、被写体距離情報Dに対して被写体距離上でのデフォーカス量を加減算することにより求められる。 Further, when converting the defocus amount into the distance information, the imaging magnification (lateral magnification) B is obtained from the subject distance information D and the focal distance information f associated with the position of the focus lens 105 at the time of imaging. the focus amount to 2 times B. Thereby, the defocus amount (distance information) on the subject distance can be calculated. The subject distance is obtained by adding or subtracting the defocus amount on the subject distance to the subject distance information D.

次にS4002では、信頼性判定手段としてのカメラCPU121は、S4001で画像群に含まれる全ての撮像画像の着目および対応領域(第1の評価領域)から得られたデフォーカス量の信頼性が高いか否かを判定する。   Next, in step S4002, the camera CPU 121 serving as the reliability determination unit has high reliability of the focus of all the captured images included in the image group and the defocus amount obtained from the corresponding area (first evaluation area) in step S4001. It is determined whether or not.

本実施例において、画像群に含まれる複数の撮像画像は連写によって得られたものであるため、それらの撮像タイミングにより被写体の位置(像高)が大きく変化したりレンズ状態(フォーカスレンズ位置や絞り値等)が大きく変化したりする場合がある。そのような場合に、着目および対応領域の信号量が不足して安定的な像ずれ量の検出が行えない場合がある。このため、カメラCPU121は、各撮像画像において像ずれ量を検出する際の第1および第2焦点検出信号間の相関量の極小値の大きさや該極小値近傍の相関量の変化の大きさを用いて、デフォーカス量の信頼性を判定する。具体的には、カメラCPU121は、相関量の極小値が小さい場合や極小値近傍の相関量の変化が大きい場合には、信頼性が高いと判定する。   In the present embodiment, since the plurality of captured images included in the image group are obtained by continuous shooting, the position (image height) of the subject greatly changes or the lens state (focus lens position, Aperture value) may change significantly. In such a case, there may be a case where the amount of signal in the target and corresponding areas is insufficient, and stable detection of an image shift amount cannot be performed. For this reason, the camera CPU 121 determines the magnitude of the minimum value of the correlation amount between the first and second focus detection signals when detecting the image shift amount in each captured image, and the magnitude of the change in the correlation amount near the minimum value. To determine the reliability of the defocus amount. Specifically, the camera CPU 121 determines that the reliability is high when the minimum value of the correlation amount is small or when the change in the correlation amount near the minimum value is large.

カメラCPU121は、画像群の中にデフォーカス量の信頼性が低い撮像画像が含まれる場合は、画像群の各撮像画像に対して着目および対応領域である第1の評価領域と少なくとも一部が異なる第2の評価領域を設定する。そして、該第2の評価領域でデフォーカス量を算出する。   When the image group includes captured images with low reliability of the defocus amount, at least a part of the captured image of the image group and the first evaluation area that is the attention and corresponding area are included in the image group. A different second evaluation area is set. Then, the defocus amount is calculated in the second evaluation area.

なお、S4002では相関量の大きさや相関量の変化の大きさにより着目および対応領域におけるデフォーカス量の信頼性を判定したが、他の判定方法を用いてもよい。例えば、着目および対応領域のコントラストの情報や所定の空間周波数の信号量に関する情報を用い、コントラストが低い場合や信号量が少ない場合に信頼性が低いと判定してもよい。   In step S4002, the reliability of the defocus amount in the attention area and the corresponding area is determined based on the magnitude of the correlation amount and the magnitude of the change in the correlation amount. However, another determination method may be used. For example, it may be determined that the reliability is low when the contrast is low or the signal amount is small, using the information on the contrast of the focused and corresponding region or the information on the signal amount at a predetermined spatial frequency.

S4002で着目および対応領域(第1の評価領域)でのデフォーカス量の信頼性が低いと判定したカメラCPU121は、S4003に進む。   The camera CPU 121 that has determined in S4002 that the reliability of the defocus amount in the focused and corresponding area (first evaluation area) is low, proceeds to S4003.

S4003では、カメラCPU121は、再生画像の着目領域(第1の評価領域)の近傍に第2の評価領域を設定する。この際、カメラCPU121は、第1の評価領域よりも高精度なデフォーカス量の検出が見込めるように第2の評価領域を設定する。図16は、図12(b)に示した着目領域A100に対して、その少なくとも一部が異なるように設定された第2の評価領域A101を示している。   In step S4003, the camera CPU 121 sets a second evaluation area near the target area (first evaluation area) of the reproduced image. At this time, the camera CPU 121 sets the second evaluation area so that the detection of the defocus amount with higher accuracy than the first evaluation area can be expected. FIG. 16 shows a second evaluation area A101 in which at least a part thereof is set to be different from the attention area A100 shown in FIG.

図16では、被写体の目の領域を中心とする着目領域A100に対して、髪の生え際の領域を含む第2の評価領域A101を設定することにより、よりコントラストが高い信号を取得してより高精度なデフォーカス量を検出する。第2の評価領域は、複数設定してもよい。この場合、複数の第2の評価領域のそれぞれで得られたデフォーカス量の平均値を算出することにより、被写体の傾きが変化した場合等でもより安定的に高精度なデフォーカス量を検出することができる。   In FIG. 16, by setting a second evaluation area A101 including a hairline area with respect to an area of interest A100 centered on the eye area of the subject, a signal having a higher contrast is obtained and a higher signal is obtained. An accurate defocus amount is detected. A plurality of second evaluation areas may be set. In this case, by calculating the average value of the defocus amounts obtained in each of the plurality of second evaluation areas, a more accurate and accurate defocus amount is detected even when the inclination of the subject changes. be able to.

次にS4004では、カメラCPU121は、S3002と同様に、画像群に含まれる再生画像以外の複数の撮像画像が第2の評価領域に類似する対応領域を有するか否かを判定し、対応領域を有する場合は該対応領域の位置とサイズを検出する。   Next, in S4004, the camera CPU 121 determines whether or not a plurality of captured images other than the reproduced images included in the image group have a corresponding area similar to the second evaluation area, as in S3002, If so, the position and size of the corresponding area are detected.

さらにS4005では、カメラCPU121は、S4001と同様に、第2の評価領域と対応領域において、像ずれ量、デフォーカス量および被写体距離を検出(算出)する。   Further, in S4005, the camera CPU 121 detects (calculates) the image shift amount, the defocus amount, and the subject distance in the second evaluation region and the corresponding region, as in S4001.

次にS4006では、カメラCPU121は、S4002と同様に、第2の評価領域および対応領域で得られたデフォーカス量の信頼性が高いか否かを判定する。第2の評価領域または対応領域で得られたデフォーカス量の信頼性が低いと判定した場合は、カメラCPU121はS4003に戻り、改めて第2の評価領域を設定する。なお、第2の評価領域を保持しつつ、該第2の評価領域とは少なくとも一部が異なる第3の評価領域を設定してもよい。   Next, in step S4006, the camera CPU 121 determines whether the reliability of the defocus amount obtained in the second evaluation area and the corresponding area is high, as in step S4002. If it is determined that the reliability of the defocus amount obtained in the second evaluation area or the corresponding area is low, the camera CPU 121 returns to S4003, and sets a second evaluation area again. Note that a third evaluation area that is at least partially different from the second evaluation area may be set while holding the second evaluation area.

一方、S4006で第2の評価領域で得られたデフォーカス量の信頼性が高いと判定したカメラCPU121はS4007に進む。S4007では、カメラCPU121は、第2の評価領域で得られたデフォーカス量および被写体距離により、S4001にて第1の評価領域で得られたデフォーカス量および被写体距離を更新する。   On the other hand, the camera CPU 121 that has determined in S4006 that the reliability of the defocus amount obtained in the second evaluation area is high proceeds to S4007. In S4007, the camera CPU 121 updates the defocus amount and the subject distance obtained in the first evaluation area in S4001 with the defocus amount and the subject distance obtained in the second evaluation area.

図17を用いて、デフォーカス量の更新方法について説明する。図17は、第1の評価領域A100で得られたデフォーカス量(A100_2〜A100_5)と第2の評価領域A101で得られたデフォーカス量(A101_2〜A101_5)を撮像順に時系列に示している。横軸は撮像時刻の順序を示しており、縦軸は検出されたデフォーカス量を示している。図中の黒点A100_2〜A100_5は、第1の評価領域A100で得られたデフォーカス量を示しており、白丸A101_2〜A101_5は第2の評価領域A101で得られたデフォーカス量を示している。   A method of updating the defocus amount will be described with reference to FIG. FIG. 17 shows the defocus amounts (A100_2 to A100_5) obtained in the first evaluation region A100 and the defocus amounts (A101_2 to A101_5) obtained in the second evaluation region A101 in chronological order. . The horizontal axis indicates the order of the imaging times, and the vertical axis indicates the detected defocus amount. In the figure, black points A100_2 to A100_5 indicate the defocus amounts obtained in the first evaluation area A100, and white circles A101_2 to A101_5 indicate the defocus amounts obtained in the second evaluation area A101.

ここでは、例として、第1の評価領域から得られたデフォーカス量A100_3の信頼性が低い場合のデフォーカス量の更新方法について説明する。デフォーカス量A100_3の時間的前後に得られたデフォーカス量A100_2,A100_4はともに信頼性が高い。また、第2の評価領域で得られたデフォーカス量A101_2,A101_3,A101_4も信頼性が高い。このような場合、デフォーカス量A100_3に対して、更新されたデフォーカス量A100_3Cは、以下の式(5)により算出される。   Here, as an example, a method of updating the defocus amount when the reliability of the defocus amount A100_3 obtained from the first evaluation area is low will be described. The defocus amounts A100_2 and A100_4 obtained before and after the time of the defocus amount A100_3 are both highly reliable. Further, the defocus amounts A101_2, A101_3, and A101_4 obtained in the second evaluation area also have high reliability. In such a case, the updated defocus amount A100_3C is calculated by the following equation (5) with respect to the defocus amount A100_3.

式(5)では、信頼性が高いデフォーカス量A101_3を、その前後において第1および第2の評価領域A100,A101で得られたデフォーカス量の差分の平均値でオフセットする。そして、オフセットしたデフォーカス量で信頼性が低いデフォーカス量A100_3を更新することで、信頼性がある程度高いデフォーカス量A100_3Cを得る。   In the equation (5), the highly reliable defocus amount A101_3 is offset by the average value of the difference between the defocus amounts obtained in the first and second evaluation regions A100 and A101 before and after the highly reliable defocus amount A101_3. Then, by updating the defocus amount A100_3 having low reliability with the offset defocus amount, the defocus amount A100_3C having high reliability to some extent is obtained.

図17は、デフォーカス量A100_5の信頼性が低いことも示している。式(5)で説明した通り、デフォーカス量A100_5の時間的前後で得られたデフォーカス量を利用してデフォーカス量を更新することで、信頼性がある程度高いデフォーカス量A100_5Cを得る。   FIG. 17 also shows that the reliability of the defocus amount A100_5 is low. As described in the equation (5), by updating the defocus amount using the defocus amount obtained before and after the defocus amount A100_5 in time, a highly reliable defocus amount A100_5C is obtained.

本実施例では、2つの評価領域で得られた評価結果(デフォーカス量)の差を利用して信頼性が低い評価結果を更新したが、該差をより多くの評価領域で得られた評価結果から得てもよい。ただし、連写中に被写体の状況(距離や大きさ)が大きく変化する場合は、2つの評価領域で得られるデフォーカス量の差も大きく変化するため、より時間的に近いデフォーカス量の差を用いることが好ましい。また、図17ではデフォーカス量の更新について説明したが、被写体距離を更新してもよい。2つの評価領域で得られる評価結果としての被写体距離の差は連写中の被写体の状況の変化に左右されにくいため、より精度良く被写体距離を更新することができる。   In the present embodiment, the evaluation result with low reliability is updated by using the difference between the evaluation results (defocus amount) obtained in the two evaluation regions, but the difference is evaluated in the evaluation region obtained in more evaluation regions. May be obtained from the results. However, if the situation (distance or size) of the subject changes greatly during continuous shooting, the difference between the defocus amounts obtained in the two evaluation areas also changes greatly, so that the difference between the defocus amounts that are closer in time is larger. It is preferable to use Also, although the updating of the defocus amount has been described with reference to FIG. 17, the subject distance may be updated. Since the difference between the subject distances as the evaluation results obtained in the two evaluation areas is hardly influenced by a change in the situation of the subject during continuous shooting, the subject distance can be updated more accurately.

また、本実施例では、着目領域(第1の評価領域)の大きさによらず第2の評価領域を設定する場合について説明したが、着目領域の大きさに応じて第2の評価領域を設定する場合を限定してもよい。着目領域が小さい場合は、被写体が小さいため、評価領域内に明暗差を持つエッジが存在する確率が高い。一方、着目領域が大きい場合は、被写体が大きいため、評価領域内に明暗差を持つエッジが存在する確率が低くなる。このため、着目領域が大きい場合にのみ第2の評価領域を設定することにより、第2の評価領域に関する演算量を低減しつつ、高精度なデフォーカス量を検出することができる。   Further, in the present embodiment, the case has been described where the second evaluation region is set regardless of the size of the region of interest (first evaluation region), but the second evaluation region is set according to the size of the region of interest. The setting may be limited. When the region of interest is small, the subject is small, and there is a high probability that an edge having a light-dark difference exists in the evaluation region. On the other hand, when the region of interest is large, since the subject is large, the probability that an edge having a light-dark difference exists in the evaluation region is low. For this reason, by setting the second evaluation region only when the region of interest is large, it is possible to detect the defocus amount with high accuracy while reducing the amount of calculation relating to the second evaluation region.

S4007を終えたカメラCPU121は、S4008に進み、画像群に含まれる各撮像画像のピント状態、各撮像画像の撮像時の絞り値等の撮像条件や被写体距離および後述する深度関連情報を各撮像画像に紐付けて記憶する。そして、本サブルーチンを終了する。   After completing S4007, the camera CPU 121 proceeds to S4008, and stores the focus state of each captured image included in the image group, imaging conditions such as the aperture value at the time of capturing each captured image, the subject distance, and depth-related information to be described later, for each captured image. And store it. Then, this subroutine ends.

次に、図18のフローチャートを用いて、図11のS1005でカメラCPU121が行う第2のグルーピングのサブルーチンについて説明する。本サブルーチンでは、カメラCPU121は、S1003で設定した画像群をS1004で検出されたピント状態に基づいて分類する。   Next, a second grouping subroutine performed by the camera CPU 121 in S1005 of FIG. 11 will be described with reference to the flowchart of FIG. In this subroutine, the camera CPU 121 classifies the image group set in S1003 based on the focus state detected in S1004.

S5001では、カメラCPU121は、画像群に含まれる複数の撮像画像から深度関連情報を取得する。深度関連情報とは、焦点深度を算出するために用いられる、各撮像画像を取得した際の許容錯乱円径と絞り値の情報である。一般に許容錯乱円は、画像サイズや鑑賞距離にもよるが、その直径以上のボケを鑑賞者が認識することができるサイズである。本実施例では、画像サイズに応じた許容錯乱円径としてεを設定する。絞り値をFとすると、焦点深度は、±εFで表される。カメラCPU121は、各撮像画像における焦点深度を算出する。   In S5001, the camera CPU 121 acquires depth-related information from a plurality of captured images included in an image group. The depth-related information is information on the permissible circle of confusion and the aperture value when each captured image is acquired, which is used to calculate the depth of focus. Generally, the permissible circle of confusion depends on the image size and the viewing distance, but is a size that allows the viewer to recognize a blur larger than the diameter of the circle. In the present embodiment, ε is set as the permissible circle of confusion according to the image size. Assuming that the aperture value is F, the depth of focus is represented by ± εF. The camera CPU 121 calculates the depth of focus in each captured image.

次にS5002では、カメラCPU121は、ピント状態を判定するための閾値(以下、判定閾値という)を設定する。具体的には、カメラCPU121は、判定閾値(所定デフォーカス量)として、前ピン方向の判定閾値(負の第1の閾値)Th1=−εF/2と後ピン方向の判定閾値(正の第2の閾値)Th2=+εF/2を設定する。画像群のピント状態等に応じて、ユーザ操作に応じて判定閾値を変更できるようにしてもよい。判定閾値の変更方法については後述する。   Next, in step S5002, the camera CPU 121 sets a threshold for determining the focus state (hereinafter, referred to as a determination threshold). Specifically, the camera CPU 121 sets the determination threshold value (predetermined defocus amount) to the determination threshold value in the front focus direction (negative first threshold value) Th1 = −εF / 2 and the determination threshold value in the rear focus direction (positive defocus amount). (Threshold of 2) Th2 = + εF / 2 is set. The determination threshold may be changed according to a user operation according to the focus state of the image group. A method for changing the determination threshold will be described later.

次にS5003では、カメラCPU121は、画像群からピント状態を判定する撮像画像(以下、判定画像という)を設定する。この際、カメラCPU121は、判定画像が事前に設定されていた場合は、撮像時刻順における次の撮像画像を新たな判定画像として設定する。一方、判定画像が事前に設定されていなかった場合は、カメラCPU121は、画像群に含まれる複数の撮像画像のうち撮像時刻が最も古いものを判定画像として設定する。   Next, in S5003, the camera CPU 121 sets a captured image (hereinafter, referred to as a determination image) for determining a focus state from the image group. At this time, if the determination image has been set in advance, the camera CPU 121 sets the next captured image in the order of imaging time as a new determination image. On the other hand, if the determination image has not been set in advance, the camera CPU 121 sets the image with the oldest imaging time among the plurality of captured images included in the image group as the determination image.

次にS5004では、カメラCPU121は、判定画像の着目領域または対応領域のデフォーカス量(ピント状態)が判定閾値Th1より小さいか否かを判定する。カメラCPU121は、デフォーカス量が判定閾値Th1より小さい場合はS5006に進み、判定画像を第1のグループ(前ピングループ)Gr.1と判定する。   Next, in S5004, the camera CPU 121 determines whether or not the defocus amount (focus state) of the region of interest or the corresponding region of the determination image is smaller than the determination threshold Th1. If the defocus amount is smaller than the determination threshold Th1, the camera CPU 121 proceeds to S5006, and stores the determination image in the first group (front pin group) Gr. Judge as 1.

一方、デフォーカス量が判定閾値Th1以上である場合は、カメラCPU121はS5005に進み、着目領域のデフォーカス量が判定閾値Th2より小さいか否かを判定する。カメラCPU121は、デフォーカス量が判定閾値Th2より小さい場合はS5007に進み、判定画像を第2のグループ(合焦近傍グループ)Gr.2と判定する。さらに、着目領域のデフォーカス量が判定閾値Th2以上である場合は、カメラCPU121はS5008に進み、判定画像を第3のグループ(後ピングループ)Gr.3と判定する。   On the other hand, if the defocus amount is equal to or greater than the determination threshold Th1, the camera CPU 121 proceeds to S5005, and determines whether the defocus amount of the region of interest is smaller than the determination threshold Th2. When the defocus amount is smaller than the determination threshold Th2, the camera CPU 121 proceeds to S5007, and transfers the determination image to the second group (focusing near group) Gr. Judge as 2. Further, if the defocus amount of the region of interest is equal to or greater than the determination threshold Th2, the camera CPU 121 proceeds to S5008, and transfers the determination image to the third group (back focus group) Gr. 3 is determined.

S5006、S5007およびS5008のいずれかを終えたカメラCPU121は、S5009に進み、画像群に含まれる全ての撮像画像についてピント状態の判定を終えたか否かを判定する。カメラCPU121は、全撮像画像のピント状態の判定を終えていない場合はS5003に戻って次の撮像画像に対する判定を行い、全撮像画像のピント状態の判定を終えた場合は本サブルーチンを終了する。   The camera CPU 121 that has completed any of S5006, S5007, and S5008 proceeds to S5009, and determines whether the focus state determination has been completed for all captured images included in the image group. The camera CPU 121 returns to S5003 if the determination of the focus state of all captured images has not been completed, and determines the next captured image. If the determination of the focus state of all captured images has been completed, the camera CPU 121 ends this subroutine.

本実施例では、連写情報、着目領域の有無および撮像時刻を用いて設定された画像群において1つの撮像画像の着目領域に対応する他の撮像画像の対応領域を検出し、該着目および対応領域のデフォーカス量を検出する。そして、各撮像画像で検出されたデフォーカス量(大きさと方向)と焦点深度から各撮像画像のピント状態を判定する。これにより、画像再生時に時系列に再生画像を変更するだけでなく、ピント状態を変更することができる。   In the present embodiment, a corresponding area of another captured image corresponding to a focused area of one captured image is detected in an image group set using continuous shooting information, presence / absence of a focused area, and capturing time, and the focused and corresponding areas are detected. Detect the defocus amount of the area. Then, the focus state of each captured image is determined from the defocus amount (magnitude and direction) and the depth of focus detected in each captured image. This makes it possible not only to change the reproduced image in time series at the time of reproducing the image, but also to change the focus state.

本実施例では、着目領域または対応領域のピント状態のバラつきが撮像時の焦点調節精度のばらつきによって生じることを想定して、ピント状態による撮像画像のグルーピングを行う。撮像時に被写体が激しく移動する場合や被写体のコントラストが低い場合等のように焦点調節精度のばらつきが大きい環境では、ピント状態によるグルーピングが有効に機能する。しかし、高い焦点調節精度が得られる環境ではピント状態を変更できるほど着目領域または対応領域のピント状態がばらつかないことが想定される。そのような場合でも、ユーザが意図する合焦状態を得たい着目領域とカメラ100において設定されている焦点検出領域とに差がある場合があり、この差によって着目領域が合焦状態ではない画像が安定的に得られる場合がある。   In the present embodiment, the grouping of the captured images based on the focus state is performed on the assumption that the focus state of the attention area or the corresponding area varies due to the variation in the focus adjustment accuracy at the time of imaging. In an environment where the focus adjustment accuracy varies greatly, such as when the subject moves violently during imaging or when the contrast of the subject is low, the grouping based on the focus state functions effectively. However, in an environment in which high focus adjustment accuracy is obtained, it is assumed that the focus state of the focused area or the corresponding area does not vary so much that the focus state can be changed. Even in such a case, there is a case where there is a difference between the region of interest where the user wants to obtain the in-focus state and the focus detection region set in the camera 100. May be obtained stably.

このような状況において、ユーザが撮像後にピント状態を選択したい場合には、焦点調節精度のばらつきを期待せずに、意図的にピント状態が異なる複数の撮像画像を取得すればよい。例えば、焦点深度に合わせて、前ピン状態、合焦状態および後ピン状態で連続的に撮像することで、ピント状態が異なる複数の撮像画像を取得することができる。   In such a situation, if the user wants to select a focus state after imaging, it is sufficient to intentionally acquire a plurality of captured images with different focus states without expecting a variation in focus adjustment accuracy. For example, a plurality of captured images having different focus states can be acquired by continuously capturing images in the front focus state, the focus state, and the rear focus state according to the depth of focus.

また、本実施例では、図11のS1002で着目領域を設定した後に、S1003で第1のグルーピングを行った。しかし、第1のグルーピングの後に、着目領域の設定をより容易にできる撮像画像を選択して表示し、その選択された撮像画像にて着目領域を設定してもよい。この場合、第1のグルーピングは、着目領域の有無ではできないが、撮像時刻や連写撮像画像であるか等を考慮して行えばよい。着目領域の設定がより容易な撮像画像としては、被写体がより大きく映っている画像、合焦している被写体までの距離がより近い画像、絞りがより開かれた状態での撮像により取得された画像等、より焦点深度が浅い画像を選択するとよい。これにより、着目領域の設定やピント状態の確認が容易な撮像画像を用いて、着目領域を設定することができる。   Further, in the present embodiment, after setting the region of interest in S1002 in FIG. 11, the first grouping is performed in S1003. However, after the first grouping, a picked-up image in which the setting of the focused area can be more easily selected and displayed, and the focused area may be set with the selected captured image. In this case, the first grouping cannot be performed based on the presence or absence of the region of interest, but may be performed in consideration of the imaging time, whether the image is a continuously captured image, and the like. Examples of the captured image in which the region of interest is easier to set include an image in which the subject is projected larger, an image in which the distance to the focused subject is shorter, and an image in which the aperture is more opened. It is preferable to select an image having a smaller depth of focus, such as an image. Thus, the region of interest can be set using a captured image in which setting of the region of interest and confirmation of the focus state are easy.

次に、ここまで説明した処理における画像群の各撮像画像の判定方法や再生画像の選択方法について、より具体的に説明する。   Next, a method of determining each captured image of the image group and a method of selecting a reproduced image in the processing described above will be described more specifically.

図19は、連写により得られた複数の撮像画像のうち図12(a)に示すように設定された着目領域と類似の対応領域を含む撮像画像として、第1のグルーピングの結果として得られた画像群を示している。Frame1からFrame15までの画像は、撮像時刻が古い順の撮像画像を示している。図12(a)に示した撮像画像は、Frame10に相当する。Frame10の撮像画像は、被写体距離が近いために焦点深度が浅く、被写体として顔だけでなく体全体が映っている画像であるため、着目領域の設定に適した画像である。   19 is obtained as a result of the first grouping as a captured image including a corresponding area similar to the target area set as shown in FIG. 12A among a plurality of captured images obtained by continuous shooting. 5 shows a group of images. The images from Frame 1 to Frame 15 show the captured images in order of the image capturing time being old. The captured image shown in FIG. 12A corresponds to Frame 10. The captured image of Frame 10 has a small depth of focus because the subject distance is short, and is an image in which not only the face but also the entire body is reflected as the subject, and thus is an image suitable for setting the region of interest.

図20は、図19に示した画像群に対して、S1005で第2のグルーピングが行われた結果を示している。各撮像画像の左上にピント状態を示すグループ名(分類処理の結果を示す情報)が、前ピン(Gr.1)、合焦近傍(Gr.2)、後ピン(Gr.3)として示されている。   FIG. 20 shows the result of the second grouping performed in S1005 on the image group shown in FIG. The group name indicating the focus state (information indicating the result of the classification process) is shown as a front focus (Gr. 1), a near focus (Gr. 2), and a rear focus (Gr. 3) at the upper left of each captured image. ing.

図21(a),(b)は、第2のグルーピングの後のFrame10の撮像画像が表示器131に再生表示されている様子を示している。表示処理手段としてのカメラCPU121は、表示器131に再生表示する画像を変更する画像変更処理を行う。図21(a)ではFrame10の撮像画像の全体が表示され、図12(b)ではその一部が拡大表示されている。Frame10の撮像画像の左上にはピント状態を示すグループ名(Gr.2)が表示されている。   FIGS. 21A and 21B show a state in which the captured image of Frame 10 after the second grouping is reproduced and displayed on the display 131. FIG. The camera CPU 121 as a display processing unit performs an image change process for changing an image to be reproduced and displayed on the display 131. In FIG. 21A, the entire captured image of Frame 10 is displayed, and in FIG. 12B, a part of the captured image is enlarged. A group name (Gr. 2) indicating the focus state is displayed at the upper left of the captured image of Frame 10.

図21(a)のようにFrame10の撮像画像が表示された状態でS1012の処理を行ったカメラCPU121は、第1の画像変更処理として、ピント状態が同じである(ピント状態が同じグループに属する)次の時系列画像を表示器131に表示させる。例えば、図13に示した操作ボタンB2が操作された場合はFrame8の撮像画像が表示され、操作ボタンB4が操作された場合はFrame12の撮像画像が表示される。   The camera CPU 121 that has performed the process of S1012 while the captured image of Frame 10 is displayed as shown in FIG. 21A has the same focus state as the first image change process (the focus state belongs to the same group). ) The next time series image is displayed on the display 131. For example, when the operation button B2 shown in FIG. 13 is operated, a captured image of Frame 8 is displayed, and when the operation button B4 is operated, a captured image of Frame 12 is displayed.

また、Frame10の撮像画像が表示された状態でS1010の処理を行ったカメラCPU121は、第2の画像変更処理として、撮像時刻が近い異なるピント状態(ピント状態が異なるグループに属する)の撮像画像を表示器131に表示させる。例えば、図13に示した操作ボタンB1が操作された場合はFrame11の撮像画像が表示され、操作ボタンB3が操作された場合はFrame9の撮像画像が表示される。   In addition, the camera CPU 121 that has performed the process of S1010 in a state where the captured image of Frame 10 is displayed displays, as the second image change process, a captured image of a different focus state with a similar imaging time (belonging to a group with a different focus state). It is displayed on the display 131. For example, when the operation button B1 shown in FIG. 13 is operated, a captured image of Frame 11 is displayed, and when the operation button B3 is operated, a captured image of Frame 9 is displayed.

このように、本実施例では、連写等によって構図が類似する多数の撮像画像が取得された場合に、所望の構図(撮像時刻)の撮像画像や所望のピント状態の撮像画像の選択および再生を迅速に行うことができる。また、図19および図20に示した複数の撮像画像を、ユーザが第1のグルーピングを確認するためにサムネイル画像として表示器131に一括表示してもよい。   As described above, in the present embodiment, when a large number of captured images having similar compositions are obtained by continuous shooting or the like, selection and reproduction of a captured image of a desired composition (imaging time) and a captured image of a desired focus state are performed. Can be done quickly. Further, the plurality of captured images shown in FIGS. 19 and 20 may be displayed collectively on the display 131 as thumbnail images so that the user can confirm the first grouping.

次に、図22(a),(b)を用いて、S5002で設定される判定閾値を変更する方法について説明する。図22(a),(b)は、第1のグルーピングが行われた画像群の着目領域および対応領域のピント状態を示す。第1の尺度としての横軸は撮像時刻の順序を示しており、第2の尺度としての縦軸は着目領域および対応領域のピント状態を焦点深度単位で示している。図中の15個の黒点は、図20に示したFrame1からFrame15の撮像画像のピント状態を示している。   Next, a method of changing the determination threshold value set in S5002 will be described with reference to FIGS. FIGS. 22A and 22B show the focus state of the target area and the corresponding area of the image group subjected to the first grouping. The horizontal axis as the first scale indicates the order of imaging time, and the vertical axis as the second scale indicates the focus state of the focused area and the corresponding area in units of depth of focus. The fifteen black dots in the figure indicate the focus states of the captured images of Frame 1 to Frame 15 shown in FIG.

また、図の左上には、ユーザにより設定された着目領域とその近傍を含む被写体領域が着目領域を設定した撮像画像から切り出されて示されている。また、図の右側には、ピント状態を示すグループ名(Gr.1,Gr.2,Gr.3)が示されているとともに、各グループに属している撮像画像の数が示されている。例えば、合焦近傍グループGr.2には、15の撮像画のうち7つの撮像画像が属している。破線は各グループ間の境界を示す。   In the upper left part of the figure, a target region set by the user and a subject region including the vicinity thereof are shown cut out from a captured image in which the target region is set. On the right side of the figure, the group names (Gr. 1, Gr. 2, Gr. 3) indicating the focus state are shown, and the number of captured images belonging to each group is shown. For example, the focus vicinity group Gr. 2 includes seven captured images among the 15 captured images. Dashed lines indicate boundaries between groups.

S5002においてユーザが判定閾値を変更する場合には、表示器131に図22(a),(b)のような表示を行えばよい。このような表示を行うことにより、ユーザは、画像群内でのピント状態のばらつきを直感的に確認することができる。また、各グループにいくつの撮像画像が属するかも容易に確認することができる。   When the user changes the determination threshold value in S5002, the display 131 may be displayed as shown in FIGS. By performing such display, the user can intuitively confirm the variation of the focus state in the image group. Also, it is possible to easily confirm how many captured images belong to each group.

判定閾値が変更された際に、図中の破線の表示位置が変更されることにより、各グループにいくつの撮像画像が属するかをリアルタイムに確認しながら操作を行うことができる。評価更新手段としてのカメラCPU121が行う判定閾値の変更の指示は、タッチパネルの操作や専用に設けられた操作部材の操作によって行われるようにすればよい。   When the determination threshold is changed, the display position of the broken line in the drawing is changed, so that the operation can be performed while checking how many captured images belong to each group in real time. The instruction to change the determination threshold value performed by the camera CPU 121 as the evaluation updating unit may be performed by operating a touch panel or an operation member provided exclusively.

図22(a),(b)は、ユーザ操作によって判定閾値が変更した際の表示器131上での表示の変化を示している。図22(a)に対して、図22(b)は、破線(Th1,Th2)の位置が垂直方向に移動している。また、各グループに属する撮像画像の数が変化している。   FIGS. 22A and 22B show changes in the display on the display 131 when the determination threshold is changed by a user operation. In FIG. 22B, the position of the broken line (Th1, Th2) moves in the vertical direction, as compared to FIG. Also, the number of captured images belonging to each group has changed.

また、図22(a),(b)のような表示において、第1のグルーピングを変更可能に構成してもよい。その場合には、横軸の方向に設定可能な境界を設け、ユーザがその境界を操作可能にすればよい。   Further, in the display as shown in FIGS. 22A and 22B, the first grouping may be configured to be changeable. In that case, a boundary that can be set in the direction of the horizontal axis may be provided so that the user can operate the boundary.

本実施例では、ピント状態が異なる撮像画像を図22(a),(b)のように縦軸上に異なる位置に散布図としてプロットすることにより、画像群に含まれる複数の撮像画像の撮像時刻(第1の尺度)とピント状態(第2の尺度)に関する分布を視認し易くすることができる。画像群に含まれる複数の撮像画像を分類する指標は、ピント状態に限らない。例えば、被写体が人の顔である場合に笑顔の度合いを数値化して縦軸に示してもよい。その際に、笑顔の程度が微笑みから大笑いであるかによって、縦軸上の異なる位置にプロットし、境界線を表示してもよい。これにより、ユーザは、好みの笑顔の画像がどの程度存在するかやグループをどのように分ければよいかを容易に認識することができる。ピント状態や笑顔の程度に限らず、被写体の顔の向き(正面、右向き、左向き等)によって撮像画像を分類してもよい。   In the present embodiment, a plurality of captured images included in the image group are captured by plotting captured images having different focus states at different positions on the vertical axis as shown in FIGS. 22A and 22B. The distribution relating to the time (first scale) and the focus state (second scale) can be easily recognized. The index for classifying a plurality of captured images included in the image group is not limited to the focus state. For example, when the subject is a human face, the degree of smile may be quantified and shown on the vertical axis. At this time, the boundary may be displayed by plotting at different positions on the vertical axis depending on whether the degree of smile is from smile to laughter. Thus, the user can easily recognize how many favorite smile images exist and how to divide the groups. The captured image may be classified according to the orientation of the face of the subject (front, right, left, etc.) without being limited to the focus state and the degree of smile.

また本実施例では、図22(a),(b)に示したようにピント状態が異なるグループのそれぞれいくつの撮像画像が属するかをユーザに分かりやすく表示する。これにより、ユーザがグルーピングの境界を変更する際に、グルーピングによりどのグループにいくつの撮像画像が属するかを確認することができる。   Further, in the present embodiment, as shown in FIGS. 22A and 22B, the number of captured images belonging to groups having different focus states is displayed in a manner that is easy for the user to understand. Accordingly, when the user changes the boundary of the grouping, it is possible to confirm how many captured images belong to which group by the grouping.

また、撮像画像を分類する指標が撮像時刻、ピント状態および笑顔の程度のように3つある場合は、使用する2つの指標を切り替えてグループを表示してもよいし、プロットされる点の色や大きさを変えることで3つの指標を使用してグループを表示してもよい。   When there are three indices for classifying the captured image, such as the imaging time, the focus state, and the degree of smile, the two indices to be used may be switched to display the group, or the color of the plotted points The group may be displayed using three indices by changing the size or size.

ユーザが判定閾値の設定を終えると、その設定に基づいて図20に示すような複数の撮像画像のサムネイル表示や、図21(a)に示すような1つの撮像画像の単独表示を行えばよい。また、グループの選択により、選択れたグループ内の撮像画像をサムネイル表示したり単独表示したりしてもよい。   When the user finishes the setting of the determination threshold, thumbnail display of a plurality of captured images as shown in FIG. 20 or single display of one captured image as shown in FIG. . Further, by selecting a group, the captured images in the selected group may be displayed as thumbnails or individually.

以上説明したように、本実施例によれば、複数の撮像画像に対して、ユーザの意図に応じた着目領域および対応領域でのピント状態の確認を容易に行うことを可能とすることができる。
(変形例1)
ライトフィールド情報を用いたリフォーカス技術が知られている。本実施例では水平方向における2分割に対応するライトフィールド情報しか得られないが、水平方向、さらには垂直方向により多くの分割数に対応するライトフィールド情報を得られるように構成することで、リフォーカス処理によってピント状態を変更することができる。
As described above, according to the present embodiment, it is possible to easily confirm the focus state in the attention area and the corresponding area according to the user's intention with respect to a plurality of captured images. .
(Modification 1)
A refocus technique using light field information is known. In this embodiment, only light field information corresponding to two divisions in the horizontal direction can be obtained. The focus state can be changed by the focus processing.

図23を用いて、リフォーカス処理によるピント状態の変更について説明する。図23は、第1のグルーピングがなされた画像群に含まれる撮像画像のピント状態がリフォーカス処理によって変更される場合の表示器131における表示例を示している。横軸は撮像時刻の順序を示しており、縦軸は着目領域または対応領域のピント状態を示している。図23は、合焦近傍グループ(Gr.2)に属している撮像画像のピント状態は変更されず、前ピングループ(Gr.1)および後ピングループ(Gr.3)に属している撮像画像のピント状態がリフォーカス処理によって変更される例を示している。   The change of the focus state by the refocus processing will be described with reference to FIG. FIG. 23 illustrates a display example on the display unit 131 in a case where the focus state of a captured image included in the group of images subjected to the first grouping is changed by the refocus processing. The horizontal axis indicates the order of the imaging times, and the vertical axis indicates the focus state of the attention area or the corresponding area. FIG. 23 shows a state in which the focus state of the captured images belonging to the in-focus vicinity group (Gr. 2) is not changed, and the captured images belonging to the front pin group (Gr. 1) and the rear pin group (Gr. 3). 2 shows an example in which the focus state is changed by the refocus processing.

15個の黒点は、図20に示したFrame1からFrame15までの撮像画像のピント状態を示す。また、白丸は、リフォーカス処理後のピント状態を示す。例えば、黒点F3_1は、Frame3の撮像画像のリフォーカス処理前のピント状態を示しており、白丸F3_2は、Frame3の撮像画像のリフォーカス処理後のピント状態を示している。図23の右側には、リフォーカス処理の前後における各グループに属する撮像画像の数の変化を示している。   The 15 black dots indicate the focus states of the captured images from Frame 1 to Frame 15 shown in FIG. White circles indicate the focus state after the refocus processing. For example, a black point F3_1 indicates a focus state of the captured image of Frame 3 before the refocus processing, and a white circle F3_2 indicates a focus state of the captured image of Frame 3 after the refocus processing. The right side of FIG. 23 illustrates a change in the number of captured images belonging to each group before and after the refocus processing.

このようにリフォーカス処理によるピント状態の変化を表示器131に表示することにより、ユーザは画像群におけるピント状態の分布を容易に確認することができる。
(変形例2)
実施例1において、ユーザが所望のピント状態の撮像画像を抽出できた場合に、設定した着目領域(および対応領域)に関する情報を撮像画像に付帯情報として付加してもよい。着目領域に関する情報としては、画像群に属する撮像画像のID情報や、着目領域および第2の評価領域の座標および大きさの情報等が含まれる。
By displaying the change in the focus state due to the refocus processing on the display 131 in this way, the user can easily check the distribution of the focus state in the image group.
(Modification 2)
In the first embodiment, when the user can extract a captured image in a desired focus state, information on the set target area (and the corresponding area) may be added to the captured image as supplementary information. The information on the region of interest includes ID information of a captured image belonging to the image group, information on coordinates and size of the region of interest and the second evaluation region, and the like.

また、画像群に属する撮像画像のID情報は、各撮像画像が消去された場合に対応して、画像群を構成する全撮像画像に同様に付加してもよい。   Also, the ID information of the captured images belonging to the image group may be similarly added to all the captured images constituting the image group, corresponding to the case where each captured image is deleted.

次に、本発明の実施例2について説明する。本実施例は、第1のグルーピングが行われた画像群の各撮像画像に対してピント状態を判定して第2のグルーピングを行う際に、1つの撮像画像が、複数のグループに属することを許容する点で実施例1と異なる。   Next, a second embodiment of the present invention will be described. In the present embodiment, when the focus state is determined for each of the captured images of the image group to which the first grouping has been performed and the second grouping is performed, it is determined that one captured image belongs to a plurality of groups. Embodiment 2 is different from Embodiment 1 in the point of allowing.

実施例1では、1つの撮像画像は1つのグループにのみ属するようにグルーピングする場合について説明した。しかし、ユーザがピント状態で撮像画像を分類する場合に、より使い勝手の良さが求められる。例えば、ユーザが人物の顔にピントを合った複数の撮像画像から左目ではなく右目にピントがあった撮像画像を抽出したい場合がある。この場合には、左目と右目に対して焦点深度差があれば、ユーザは右目にピントが合うような操作を行えばよい。このとき、左目にピントがあった撮像画像は、右目にピントが合った撮像画像に対して、後ピンもしくは前ピンのグループに属することとなる。   In the first embodiment, a case has been described in which one captured image is grouped so as to belong to only one group. However, when the user classifies the captured images in a focused state, more ease of use is required. For example, the user may want to extract a captured image in which the right eye is focused instead of the left eye from a plurality of captured images focused on a human face. In this case, if there is a depth of focus difference between the left eye and the right eye, the user may perform an operation to focus on the right eye. At this time, the captured image focused on the left eye belongs to the rear focus or front focus group with respect to the captured image focused on the right eye.

ただし、被写体が遠かったり、絞り込まれたF値での撮像が行われたりした場合には、画像群の中に左目にも右目にもピントが合った撮像画像も存在し得る。このような撮像画像は、ユーザが意図する右目にピントが合った撮像画像としてもユーザが意図しない左目にピントがあった撮像画像としても抽出されるべきである。   However, when the subject is far away or when imaging is performed with a narrowed F value, there may be a captured image in which both the left eye and the right eye are in focus in the image group. Such a captured image should be extracted as a captured image focused on the right eye intended by the user or as a captured image focused on the left eye unintended by the user.

このため、本実施例では、被写体領域のデフォーカス量差(距離差)の情報や被写体と背景(周囲の被写体)とのデフォーカス量差の情報を取得し、該情報に応じて複数のピント状態のグループに属する撮像画像を許容する。すなわち、被写体領域でのデフォーカス量差が(所定値より)小さい撮像画像を、複数のグループのうち少なくとも2つのグループに属するように分類する。これにより、ユーザが意図する撮像画像を漏れなく抽出することができ、ユーザによる撮像画像の選択および確認を効率的に行わせることができる。   For this reason, in the present embodiment, information on the defocus amount difference (distance difference) in the subject area and information on the defocus amount difference between the subject and the background (surrounding subject) are acquired, and a plurality of focuses are obtained in accordance with the information. The captured images belonging to the state group are allowed. That is, a captured image in which the defocus amount difference in the subject region is smaller (less than a predetermined value) is classified so as to belong to at least two of the plurality of groups. Thus, the captured image intended by the user can be extracted without omission, and the user can efficiently select and confirm the captured image.

本実施例のカメラの構成、焦点検出方式、焦点検出領域、AF・撮像処理および画像再生処理は、実施例1のカメラ100の構成(図1)、焦点検出方式(図3(a)〜図6)、焦点検出領域(図7)、AF・撮像処理(図8〜図10)および画像再生処理(図11〜図17)と同じである。   The configuration of the camera, the focus detection method, the focus detection area, the AF / imaging process, and the image reproduction process according to the present embodiment are the same as the configuration of the camera 100 according to the first embodiment (FIG. 1) and the focus detection method (FIG. 3A to FIG. 6), focus detection area (FIG. 7), AF / imaging processing (FIGS. 8 to 10), and image reproduction processing (FIGS. 11 to 17).

本実施例において図11のS1005でカメラCPU121が行う画像群の分類(第2のグルーピング)の処理について、図24のフローチャートを用いて説明する。   In the present embodiment, the processing of the image group classification (second grouping) performed by the camera CPU 121 in S1005 of FIG. 11 will be described with reference to the flowchart of FIG.

S6001では、カメラCPU121は、画像群に含まれる複数画像から深度関連情報を取得する。深度関連情報は、図18のS5001で説明したように、許容錯乱円εと絞り値Fの情報である。カメラCPU121は、各撮像画像における焦点深度(±εF)を算出する。   In S6001, the camera CPU 121 acquires depth-related information from a plurality of images included in the image group. The depth-related information is information on the permissible circle of confusion ε and the aperture value F, as described in S5001 of FIG. The camera CPU 121 calculates the depth of focus (± εF) in each captured image.

次にS6002では、カメラCPU121は、各撮像画像における被写体領域の距離情報を取得する。図25(a),(b)を用いて、被写体領域の距離情報の取得方法について説明する。   Next, in step S6002, the camera CPU 121 obtains distance information of a subject area in each captured image. A method of acquiring distance information of a subject area will be described with reference to FIGS.

図25(a)は、図12(a)に示したFrame10の撮像画像に着目領域A100が設定された状態に加えて、被写体領域の検出と被写体領域の距離情報を取得するために焦点検出ポイントを重畳して示している。図25(a)には、焦点検出ポイントとして、水平方向に12箇所、垂直方向に8箇所の計96箇所に十字のマークPhを示している。   FIG. 25A shows a focus detection point for detecting a subject area and acquiring distance information of the subject area in addition to a state in which a focused area A100 is set in the captured image of Frame 10 shown in FIG. Are superimposed. In FIG. 25A, cross marks Ph are shown at a total of 96 locations, 12 locations in the horizontal direction and 8 locations in the vertical direction, as focus detection points.

本実施例では、カメラCPU121は、計96箇所の焦点検出ポイントにおいて図15のS4001と同様に位相差(像ずれ量)を検出し、デフォーカス量または被写体距離を算出する。そして、得られた各焦点検出ポイントにおけるデフォーカス量または被写体距離から、まず被写体領域を抽出する。具体的には、カメラCPU121は、着目領域のデフォーカス量または被写体距離に対して、デフォーカス量または被写体距離が所定値以下の小さい差を有する領域を被写体領域として抽出する。被写体が人物である場合には、その身体や器官の検出によって被写体領域を抽出してもよい。   In this embodiment, the camera CPU 121 detects a phase difference (image shift amount) at a total of 96 focus detection points in the same manner as in S4001 in FIG. 15, and calculates a defocus amount or a subject distance. Then, a subject area is first extracted from the obtained defocus amount or subject distance at each focus detection point. Specifically, the camera CPU 121 extracts a region where the defocus amount or the subject distance has a small difference equal to or less than a predetermined value with respect to the defocus amount or the subject distance of the region of interest as the subject region. If the subject is a person, the subject region may be extracted by detecting the body or organ.

さらに、カメラCPU121は、被写体領域内に配置された焦点検出ポイントで得られたデフォーカス量と各撮像画像の取得時のフォーカスレンズ105の位置とを用いて、代表値としての被写体距離を算出する。図25(b)は、図19に示した15の撮像画像から得られた被写体距離を示している。縦軸は被写体距離を、横軸は撮像時刻の順序を示している。被写体距離Dを示す折れ線は、被写体が遠距離から徐々に近づいて最後の数番目の撮像画像ではほぼ距離が変わっていないことを示している。被写体距離D(1)は1番目の撮像画像(Frame1)における被写体距離を示し、被写体距離D(15)は15番目の撮像画像(Frame15)における被写体距離を示している。   Further, the camera CPU 121 calculates the subject distance as a representative value using the defocus amount obtained at the focus detection points arranged in the subject area and the position of the focus lens 105 at the time of acquiring each captured image. . FIG. 25B shows the subject distance obtained from the 15 captured images shown in FIG. The vertical axis indicates the subject distance, and the horizontal axis indicates the order of the imaging time. The polygonal line indicating the subject distance D indicates that the subject gradually approaches from a long distance and the distance is not substantially changed in the last few captured images. The subject distance D (1) indicates the subject distance in the first captured image (Frame1), and the subject distance D (15) indicates the subject distance in the fifteenth captured image (Frame15).

F値や撮像光学系の焦点距離が一定である場合には、被写体距離によって被写界深度が変化する。具体的には、被写体距離が遠くなるにつれて、被写界深度は広く(深く)なる。本実施例では、被写界深度の変化を加味してピント状態を判定する。   When the F value or the focal length of the imaging optical system is constant, the depth of field changes depending on the subject distance. Specifically, as the subject distance increases, the depth of field becomes wider (deeper). In this embodiment, the focus state is determined in consideration of the change in the depth of field.

次にS6003では、カメラCPU121は、ピント状態を判定するための閾値である判定閾値を設定する。具体的には、カメラCPU121は、前ピン側合焦状態の判定閾値Th2=−εF/2と、後ピン側合焦状態の判定閾値Th3=+εF/2とを設定する。さらに、カメラCPU121は、前ピン状態と判定するための判定閾値Th1と、後ピン状態と判定するための判定閾値Th4とを設定する。判定閾値Th1,Th4は、各撮像画像の被写界深度により異なるため、それぞれをTh1(i),Th4(i)と表すと、以下の式(6),(7)で算出される。   Next, in step S6003, the camera CPU 121 sets a determination threshold that is a threshold for determining a focus state. Specifically, the camera CPU 121 sets a determination threshold Th2 = −εF / 2 for the front focus state and a determination threshold Th3 = + εF / 2 for the rear focus state. Further, the camera CPU 121 sets a determination threshold Th1 for determining the front focus state and a determination threshold Th4 for determining the back focus state. Since the determination thresholds Th1 and Th4 are different depending on the depth of field of each captured image, if they are expressed as Th1 (i) and Th4 (i), they are calculated by the following equations (6) and (7).

図26を用いて、前ピン状態と後ピン状態の判定閾値の設定方法について説明する。図26は、Frame1とFrame15を撮像した状態での被写体距離と被写界深度を示している。Frame1を撮像した際の被写体距離はD(1)であり、焦点深度±εFに対応する被写界深度は±H(1)である。同様に、Frame15を撮像した際の被写体距離はD(15)であり、焦点深度±εFに対応する被写界深度は±H(15)である。   With reference to FIG. 26, a method of setting a determination threshold for the front focus state and the rear focus state will be described. FIG. 26 shows the subject distance and the depth of field in a state where Frame 1 and Frame 15 are imaged. The subject distance when capturing the image of Frame 1 is D (1), and the depth of field corresponding to the depth of focus ± εF is ± H (1). Similarly, the subject distance when the frame 15 is imaged is D (15), and the depth of field corresponding to the depth of focus ± εF is ± H (15).

Frame15の撮像画像を再生表示する際に、ユーザが、着目領域のデフォーカス量が単位焦点深度分ずれたピント状態を望んでいる場合は、被写体距離D(15)±H(15)の被写体距離にピントが合った状態がそれに相当する。例えば、デフォーカス量がほぼ0である右目に対して単位焦点深度分ずれた左目にピントが合った状態にピント状態を変更したい場合には、ユーザは、ピントが合う被写体距離をD(15)からH(15)だけ移動させる操作を行えばよい。   When reproducing and displaying the captured image of Frame 15, if the user desires a focus state in which the defocus amount of the focused area is shifted by the unit depth of focus, the object distance D (15) ± H (15) The state where the focus is on corresponds to that. For example, when the user wants to change the focus state to a state where the left eye is in focus by the unit depth of focus with respect to the right eye where the defocus amount is almost 0, the user sets the in-focus subject distance to D (15). The operation of moving the object by H (15) may be performed.

このユーザ操作を被写体距離D(1)の被写体に対して行う際にも、被写体上では左目と右目の間隔は変わらないため、ピントが合う被写体距離をD(1)からH(15)だけ移動させる操作を行えばよい。被写体距離D(1)はD(15)より遠いため、被写界深度H(1)の方がH(15)より深い(広い)。このため、被写体距離D(1)に対するH(15)のピント状態の変更量は、焦点深度εFよりも小さい値となる。小さくなる比率をkとすると、kは以下の式(8)で算出される。   Even when this user operation is performed on the subject at the subject distance D (1), the distance between the left eye and the right eye does not change on the subject, so that the focused subject distance is shifted from D (1) by H (15). What is necessary is just to perform the operation which makes it. Since the subject distance D (1) is farther than D (15), the depth of field H (1) is deeper (wider) than H (15). Therefore, the change amount of the focus state of H (15) with respect to the subject distance D (1) is a value smaller than the depth of focus εF. Assuming that the decreasing ratio is k, k is calculated by the following equation (8).

式(8)では、前側被写界深度と後側被写界深度を区分せず、概算値としての被写界深度が被写体距離の二乗を焦点距離の二乗で除することで算出されるものとして、kを算出している。kの算出精度を上げるために、被写界深度を前側被写界深度と後側被写界深度に区別して算出に用いてもよい。 In equation (8), the front depth of field and the rear depth of field are not distinguished, and the depth of field as an approximate value is calculated by dividing the square of the subject distance by the square of the focal length. Is calculated. In order to increase the calculation accuracy of k, the depth of field may be distinguished into the front depth of field and the rear depth of field and used for calculation.

上述した式(6),(7)は、式(8)で算出されたkを焦点深度εFに乗じて得られた値として判定閾値Th1,Th4を算出している。これにより、被写界深度が浅い状態で選択したピント状態(例えば右目または左目に合焦した状態)と同様のピント状態の撮像画像を、被写体距離が遠く被写界深度が深い撮像画像から漏れなく抽出することができる。また、ピント状態の変更を、被写体距離の遠近によらず適切に行うこともできる。   In the above equations (6) and (7), the determination thresholds Th1 and Th4 are calculated as values obtained by multiplying the depth of focus εF by k calculated in the equation (8). As a result, a captured image in a focus state similar to the focus state selected in a state with a small depth of field (for example, a state in which the right eye or the left eye is focused) is leaked from a captured image with a long subject distance and a large depth of field. It can be extracted without. Further, the focus state can be appropriately changed regardless of the distance of the subject.

S6003でピント状態の判定閾値が設定された状態を、第1のグルーピングが行われた画像群の着目領域および対応領域のピント状態を示す図27を用いて説明する。図27において、前ピン側合焦状態の判定閾値Th2および後ピン側合焦状態の判定閾値Th3は、図22における判定閾値と同様に破線で示されている。実線で示された前ピン状態の判定閾値Th1は、撮像時刻が後半の撮像画像では前ピン側合焦状態の判定閾値Th2と等しいが、撮像時刻が前半の撮像画像では前ピン側合焦状態の判定閾値Th2よりも上側(より合焦状態の近く)に変化している。これは、上述しように、被写界深度の変化によりピント状態が維持される範囲が異なることに対応して、第2のグルーピングの境界を変化させているためである。   The state in which the focus state determination threshold is set in step S6003 will be described with reference to FIG. 27 showing the focus state of the focused area and the corresponding area of the image group on which the first grouping has been performed. In FIG. 27, the threshold value Th2 for the in-focus state on the front focus side and the threshold value Th3 for the in-focus state on the rear focus side are indicated by broken lines similarly to the determination threshold value in FIG. The determination threshold Th1 of the front focus state shown by the solid line is equal to the determination threshold Th2 of the front focus side focus state in the captured image whose imaging time is the latter half, but is the front focus side focus state in the captured image whose imaging time is the first half. Above the determination threshold value Th2 (closer to the in-focus state). This is because, as described above, the boundary of the second grouping is changed in response to the range in which the focus state is maintained due to the change in the depth of field.

同様に、実線で示された後ピン状態の判定閾値Th4は、撮像時刻が後半の撮像画像では後ピン側合焦状態の判定閾値Th3と等しいが、撮像時刻が前半の撮像画像では、後ピン側合焦状態の判定閾値Th3よりも下側(より合焦状態の近く)に変化している。   Similarly, the determination threshold Th4 of the rear focus state indicated by the solid line is equal to the determination threshold Th3 of the rear focus side focus state in the captured image of the latter half of the imaging time, but is equal to the rear focus state in the first half of the captured image of the imaging time. It has changed below (closer to the in-focus state) than the side focus state determination threshold value Th3.

なお、図27では、撮像時刻が後半の撮像画像に対する判定閾値Th2,Th3を判定閾値Th1,Th4に対して若干ずらして分かり易く表示しているが、これらを重ねて表示してもよい。   In FIG. 27, the determination thresholds Th2 and Th3 for the captured image whose imaging time is the latter half are displayed slightly shifted from the determination thresholds Th1 and Th4 for easy understanding, but they may be displayed in an overlapping manner.

図27では、2番目の撮像画像のピント状態F2は、Th2とTh3の間にあるため、2番目の撮像画像はGr.2に属する。一方、F2は、Th4より大きいため、2番目の撮像画像はGr.3にも属している。この場合、2番目の撮像画像は、ユーザがGr.2に属する撮像画像を抽出する際でも、Gr.3に属する撮像画像を抽出する際でも再生表示される。したがって、ユーザが望むピント状態の撮像画像を漏れなく再生表示することができる。   In FIG. 27, the focus state F2 of the second captured image is between Th2 and Th3, so that the second captured image is Gr. Belongs to 2. On the other hand, since F2 is larger than Th4, the second captured image is Gr. Also belongs to 3. In this case, the second captured image indicates that the user has Gr. 2 when extracting a captured image belonging to Gr. Even when the captured image belonging to No. 3 is extracted, it is reproduced and displayed. Therefore, it is possible to reproduce and display the focused image desired by the user without omission.

また、図27に示したような表示を行うことにより、散布図上において複数のグループに属する領域を容易に確認することができる。実施例1で説明したように、ピント状態を判定するための判定閾値を容易に変更することも可能となる。   Also, by performing the display as shown in FIG. 27, it is possible to easily confirm the regions belonging to a plurality of groups on the scatter diagram. As described in the first embodiment, the determination threshold for determining the focus state can be easily changed.

S6003を終えたカメラCPU121は、S6004に進み、図18のS5003と同様に、画像群からピント状態を判定する撮像画像としての判定画像を設定する。   After completing S6003, the camera CPU 121 proceeds to S6004, and sets a determination image as a captured image for determining the focus state from the image group, similarly to S5003 in FIG.

次にS6005では、カメラCPU121は、着目領域または対応領域のデフォーカス量(ピント状態)が判定閾値Th1より小さいか否かを判定する。カメラCPU121は、デフォーカス量が判定閾値Th1より小さい場合はS6006に進み、判定画像を前ピングループGr.1と判定する。その後、カメラCPU121は、デフォーカス量にかかわらずS6007に進む。   Next, in S6005, the camera CPU 121 determines whether the defocus amount (focus state) of the region of interest or the corresponding region is smaller than the determination threshold Th1. When the defocus amount is smaller than the determination threshold Th1, the camera CPU 121 proceeds to S6006, and stores the determination image in the front focus group Gr. Judge as 1. Thereafter, the camera CPU 121 proceeds to S6007 regardless of the defocus amount.

S6007では、カメラCPU121は、デフォーカス量が判定閾値Th2以上で判定閾値Th3以下であるか否かを判定する。カメラCPU121は、デフォーカス量が判定閾値Th2以上でTh3以下である場合はS6008に進み、判定画像を合焦近傍グループGr.2と判定する。その後、カメラCPU121は、S6007での判定結果にかかわらずS6009に進む。   In S6007, the camera CPU 121 determines whether the defocus amount is equal to or greater than the determination threshold Th2 and equal to or less than the determination threshold Th3. If the defocus amount is equal to or greater than the determination threshold value Th2 and equal to or less than Th3, the camera CPU 121 proceeds to S6008, and transfers the determination image to the in-focus neighborhood group Gr. Judge as 2. Thereafter, the camera CPU 121 proceeds to S6009 irrespective of the determination result in S6007.

S6009では、カメラCPU121は、デフォーカス量が判定閾値Th4より大きいか否かを判定する。カメラCPU121は、デフォーカス量が判定閾値Th4より大きい場合はS6010に進み、判定画像を後ピングループGr.3と判定する。その後、カメラCPU121は、S6009の判定結果にかかわらずS6011に進む。   In S6009, the camera CPU 121 determines whether the defocus amount is larger than the determination threshold Th4. If the defocus amount is larger than the determination threshold Th4, the camera CPU 121 proceeds to S6010, and transfers the determination image to the rear focus group Gr. 3 is determined. After that, the camera CPU 121 proceeds to S6011 irrespective of the determination result of S6009.

S6011では、カメラCPU121は、画像群に含まれる全ての撮像画像についてピント状態の判定を終えたか否かを判定する。カメラCPU121は、全撮像画像のピント状態の判定を終えていない場合はS6004に戻って次の撮像画像に対する判定を行い、全撮像画像のピント状態の判定を終えた場合は本サブルーチンを終了する。   In step S6011, the camera CPU 121 determines whether the focus state determination has been completed for all captured images included in the image group. If the determination of the focus state of all the captured images has not been completed, the camera CPU 121 returns to S6004 to perform determination on the next captured image, and terminates this subroutine if the determination of the focus state of all the captured images has been completed.

本実施例では、ユーザが望むピント状態が得られる領域での被写体距離の変化は被写界深度によらないことに着目して、被写界深度の状況に応じて、1つの撮像画像が複数のピント状態のグループに属することを可能とする。これにより、前述したように、ユーザが望むピント状態が得られている撮像画像を漏れなく抽出することができ、ユーザによる撮像画像の選択および確認を効率的に行わせることができる。   In the present embodiment, attention is paid to the fact that the change in the subject distance in the area where the user desires the focus state is not dependent on the depth of field. It is possible to belong to the group in the focused state. As a result, as described above, it is possible to extract a captured image in which a focus state desired by the user is obtained without omission, and it is possible to efficiently select and confirm the captured image by the user.

本実施例では、画像群に含まれる複数の撮像画像の焦点距離や絞り値が互いに等しく、被写体距離によってのみ被写界深度が変わる場合について説明した。しかし、撮像時の焦点距離や絞り値が変化する場合にも、それに対応した被写界深度を加味して、同様にピント状態のグルーピング(第2のグルーピング)を行えばよい。この結果、1つの撮像画像が3つ以上のグループに属することがあってもよい。   In the present embodiment, a case has been described in which a plurality of captured images included in an image group have the same focal length and aperture value, and the depth of field changes only depending on the subject distance. However, even when the focal length and the aperture value at the time of imaging change, the focusing state (second grouping) may be similarly performed in consideration of the depth of field corresponding thereto. As a result, one captured image may belong to three or more groups.

また、本実施例では、被写体領域を抽出し、その被写体距離を算出することで、被写界深度の変化を取得する場合について説明した。しかし、被写体領域に限らず、背景や他の被写体も含めて被写界深度を考慮してもよい。例えば、被写体も背景も含む全撮像範囲内が焦点深度内に収まっている撮像画像は、第2のグルーピングの結果の全グループに属するようにしてもよい。また、グループを判定するための判定閾値も、被写体領域内の奥行きや距離の情報を用いて変更してもよい。これにより、被写体の奥行に応じて適切にピント状態を変更することができる。   In the present embodiment, a case has been described in which a change in the depth of field is obtained by extracting a subject region and calculating the subject distance. However, the depth of field may be considered not only in the subject area but also in the background and other subjects. For example, a captured image in which the entire imaging range including the subject and the background falls within the depth of focus may belong to all groups as a result of the second grouping. Also, the determination threshold for determining the group may be changed using information on the depth and distance in the subject area. This makes it possible to appropriately change the focus state according to the depth of the subject.

さらに、カメラCPU121は、着目領域または対応領域とその近傍領域を含む被写体領域でのデフォーカス量の変化に応じて判定閾値を変更してもよい。例えば、被写体領域内でデフォーカス量の変化が小さい場合には判定閾値の絶対値を小さくし、反対に被写体領域内でデフォーカス量の変化が大きい場合に判定閾値の絶対値を大きくしてもよい。   Further, the camera CPU 121 may change the determination threshold value in accordance with a change in the defocus amount in a subject region including the region of interest or the corresponding region and its neighboring region. For example, when the change in the defocus amount is small in the subject area, the absolute value of the determination threshold is reduced, and when the change in the defocus amount is large in the subject area, the absolute value of the determination threshold is increased. Good.

さらに本実施例では、1つの撮像画像が互いにピント状態が異なる複数のグループに属する場合がある。この場合に、実施例1で図20や図21を用いて説明した表示を行う場合には、複数のグループ名を示す文字やアイコンを表示すればよい。   Furthermore, in this embodiment, one captured image may belong to a plurality of groups having different focus states. In this case, when the display described in the first embodiment with reference to FIGS. 20 and 21 is performed, characters or icons indicating a plurality of group names may be displayed.

また、上記各実施例では画像処理装置(カメラCPU121)を内蔵したカメラについて説明した。しかし、カメラおよび画像処理装置を内蔵した携帯電話等のモバイル機器や、撮像機能を有さないパーソナルコンピュータにより構成される画像処理装置も本発明の他の実施例に含まれる。
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
Further, in each of the above embodiments, the camera having the image processing device (camera CPU 121) is described. However, other embodiments of the present invention also include a mobile device such as a mobile phone having a built-in camera and image processing device, and an image processing device including a personal computer without an imaging function.
(Other Examples)
The present invention supplies a program for realizing one or more functions of the above-described embodiments to a system or an apparatus via a network or a storage medium, and one or more processors in a computer of the system or the apparatus read and execute the program. This processing can be realized. Further, it can also be realized by a circuit (for example, an ASIC) that realizes one or more functions.

以上説明した各実施例は代表的な例にすぎず、本発明の実施に際しては、各実施例に対して種々の変形や変更が可能である。   Each of the embodiments described above is only a typical example, and various modifications and changes can be made to each embodiment when the present invention is implemented.

100 カメラ
105 フォーカスレンズ
107 撮像素子
121 カメラCPU
133 メモリ
Reference Signs List 100 Camera 105 Focus lens 107 Image sensor 121 Camera CPU
133 memory

Claims (13)

互いに異なる時刻での撮像により取得された複数の撮像画像のうち第1の画像において着目領域を設定する領域設定手段と、
前記複数の撮像画像のうち複数の第2の画像において前記着目領域に関連性を有する対応領域を検出する領域検出手段と、
前記着目領域および前記対応領域のそれぞれのピント状態を取得するピント状態取得手段と、
前記複数の撮像画像を前記ピント状態に応じて複数のグループに分類する分類処理を行う処理手段とを有することを特徴とする画像処理装置。
Region setting means for setting a region of interest in a first image among a plurality of captured images obtained by imaging at different times from each other;
Region detection means for detecting a corresponding region having relevance to the region of interest in a plurality of second images of the plurality of captured images;
Focus state acquisition means for acquiring the respective focus states of the region of interest and the corresponding region,
Processing means for performing classification processing for classifying the plurality of captured images into a plurality of groups according to the focus state.
前記分類処理は、前記複数の撮像画像のそれぞれを、該撮像装置の前記ピント状態を示すデフォーカス量が負の第1の閾値より小さい場合は第1のグループに分類し、前記デフォーカス量が前記第1の閾値より大きく、正の第2の閾値より小さい場合は第2のグループに分類し、前記デフォーカス量が前記第2の閾値より大きい場合は第3のグループに分類することを特徴とする請求項1に記載の画像処理装置。   The classification process classifies each of the plurality of captured images into a first group when a defocus amount indicating the focus state of the imaging device is smaller than a negative first threshold, and the defocus amount is If the defocus amount is larger than the first threshold value and smaller than the positive second threshold value, the data is classified into a second group, and if the defocus amount is larger than the second threshold value, the data is classified into a third group. The image processing apparatus according to claim 1. 前記分類処理手段は、ユーザ操作に応じて前記第1および第2の閾値のうち少なくとも一方を変更することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the classification processing unit changes at least one of the first and second thresholds according to a user operation. 前記分類処理手段は、前記着目領域または前記対応領域を含む被写体領域での前記デフォーカス量の変化に応じて前記第1および第2の閾値のうち少なくとも一方を変更することを特徴とする請求項2に記載の画像処理装置。   The method according to claim 1, wherein the classification processing unit changes at least one of the first and second thresholds in accordance with a change in the defocus amount in a subject area including the target area or the corresponding area. 3. The image processing device according to 2. 前記分類処理手段は、前記複数の撮像画像のうち前記着目領域または前記対応領域を含む被写体領域での前記デフォーカス量の差が所定値より小さい撮像画像を、前記複数のグループのうち少なくとも2つのグループに属するように分類することを特徴とする請求項2に記載の画像処理装置。   The classification processing unit is configured to generate a captured image in which a difference in the defocus amount in a subject area including the target area or the corresponding area among the plurality of captured images is smaller than a predetermined value by at least two of the plurality of groups. The image processing apparatus according to claim 2, wherein the image processing apparatus is classified so as to belong to a group. 前記複数の撮像画像として、連写により取得された画像群を設定する画像群設定手段を有し、
前記分類処理手段は、前記画像群を対象として前記分類処理を行うことを特徴とする請求項1から5のいずれか一項に記載の画像処理装置。
As the plurality of captured images, has an image group setting means to set an image group obtained by continuous shooting,
The image processing apparatus according to claim 1, wherein the classification processing unit performs the classification processing on the image group.
前記複数の撮像画像として、前記第1の画像と、該第1の画像に設定された前記着目領域に対する前記対応領域が検出された前記複数の第2の画像とを含む画像群を設定する画像群設定手段を有し、
前記分類処理手段は、前記画像群を対象として前記分類処理を行うことを特徴とする請求項1から6のいずれか一項に記載の画像処理装置。
An image for setting an image group including, as the plurality of captured images, the first image and the plurality of second images in which the corresponding region corresponding to the region of interest set in the first image is detected. Having group setting means,
The image processing apparatus according to claim 1, wherein the classification processing unit performs the classification processing on the image group.
表示手段に前記撮像画像を表示させる表示処理手段を有し、
前記表示処理手段は、前記分類処理の結果を示す情報を前記撮像画像とともに表示させることを特徴とする請求項1から7のいずれか一項に記載の画像処理装置。
Display processing means for displaying the captured image on a display means,
The image processing apparatus according to claim 1, wherein the display processing unit displays information indicating a result of the classification process together with the captured image.
表示手段に前記撮像画像または該撮像画像から生成された画像を表示させる表示処理手段を有し、
前記表示処理手段は、前記表示手段に表示する画像を、前記ピント状態が同じで前記撮像時刻が異なる画像に変更する第1の画像変更処理と、前記ピント状態が異なる画像に変更する第2の画像変更処理とを行うことを特徴とする請求項1から8のいずれか一項に記載の画像処理装置。
Display processing means for displaying the captured image or an image generated from the captured image on a display means,
The display processing means includes a first image change processing for changing an image displayed on the display means to an image having the same focus state and a different imaging time, and a second image change processing for changing the image to a different focus state. The image processing apparatus according to claim 1, wherein the image processing apparatus performs an image change process.
前記撮像画像は複数の視点に関する情報を含み、
前記ピント状態取得手段は、前記複数の視点に関する情報を用いて前記ピント状態を取得することを特徴とする請求項1から9のいずれか一項に記載の画像処理装置。
The captured image includes information on a plurality of viewpoints,
The image processing apparatus according to claim 1, wherein the focus state obtaining unit obtains the focus state using information on the plurality of viewpoints.
被写体像を撮像する撮像素子と、
請求項1から10のいずれか一項に記載の画像処理装置とを有することを特徴とする電子機器。
An image sensor that captures a subject image;
An electronic apparatus, comprising: the image processing apparatus according to claim 1.
互いに異なる時刻での撮像により取得された複数の撮像画像のうち第1の画像において着目領域を設定するステップと、
前記複数の撮像画像のうち複数の第2の画像において前記着目領域に関連性を有する対応領域を検出するステップと、
前記着目領域および前記対応領域のそれぞれのピント状態を取得するステップと、
前記複数の撮像画像を前記ピント状態に応じて複数のグループに分類する分類処理を行うステップとを有することを特徴とする画像処理方法。
Setting a region of interest in a first image of a plurality of captured images obtained by imaging at different times from each other;
Detecting a corresponding region having relevance to the region of interest in a plurality of second images of the plurality of captured images;
Acquiring the focus state of each of the noted area and the corresponding area;
Performing a classification process of classifying the plurality of captured images into a plurality of groups according to the focus state.
画像処理装置のコンピュータに、請求項12に記載の画像処理方法に従う処理を実行させることを特徴とするコンピュータプログラム。   A computer program for causing a computer of an image processing apparatus to execute a process according to the image processing method according to claim 12.
JP2018163565A 2018-08-31 2018-08-31 Image processing device and electronic equipment Active JP7224811B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2018163565A JP7224811B2 (en) 2018-08-31 2018-08-31 Image processing device and electronic equipment
US16/547,906 US11763538B2 (en) 2018-08-31 2019-08-22 Image processing apparatus and electronic apparatus
US18/449,072 US20230386166A1 (en) 2018-08-31 2023-08-14 Image processing apparatus and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018163565A JP7224811B2 (en) 2018-08-31 2018-08-31 Image processing device and electronic equipment

Publications (2)

Publication Number Publication Date
JP2020036288A true JP2020036288A (en) 2020-03-05
JP7224811B2 JP7224811B2 (en) 2023-02-20

Family

ID=69668761

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018163565A Active JP7224811B2 (en) 2018-08-31 2018-08-31 Image processing device and electronic equipment

Country Status (1)

Country Link
JP (1) JP7224811B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007312097A (en) * 2006-05-18 2007-11-29 Fujifilm Corp Image processing apparatus, image processing method and program
US20140193088A1 (en) * 2010-11-11 2014-07-10 DigitalOptics Corporation Europe Limited Rapid Auto-Focus Using Classifier Chains, Mems And Multiple Object Focusing
JP2014232181A (en) * 2013-05-28 2014-12-11 キヤノン株式会社 Imaging device and control method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007312097A (en) * 2006-05-18 2007-11-29 Fujifilm Corp Image processing apparatus, image processing method and program
US20140193088A1 (en) * 2010-11-11 2014-07-10 DigitalOptics Corporation Europe Limited Rapid Auto-Focus Using Classifier Chains, Mems And Multiple Object Focusing
JP2014232181A (en) * 2013-05-28 2014-12-11 キヤノン株式会社 Imaging device and control method thereof

Also Published As

Publication number Publication date
JP7224811B2 (en) 2023-02-20

Similar Documents

Publication Publication Date Title
KR101632578B1 (en) Image capturing apparatus, image processing apparatus, and image processing method for generating auxiliary information for captured image
KR101441586B1 (en) Apparatus and method for capturing image
US10009540B2 (en) Image processing device, image capturing device, and image processing method for setting a combination parameter for combining a plurality of image data
US8184192B2 (en) Imaging apparatus that performs an object region detection processing and method for controlling the imaging apparatus
JP2012173531A (en) Imaging device, focus control method and program
US20110228053A1 (en) Stereoscopic imaging apparatus
JP2012044564A (en) Imaging apparatus
JP5750551B2 (en) Apparatus and method for measuring distance of multiple subjects
JP2012049773A (en) Imaging apparatus and method, and program
CN102811312A (en) Image pickup apparatus and control method therefor
JP4995002B2 (en) Imaging device, focusing device, imaging method, and focusing method
US20230386166A1 (en) Image processing apparatus and electronic apparatus
JP2007279333A (en) Device and method for deciding focusing position
JP7500844B2 (en) Image processing device and control method thereof
JP7224811B2 (en) Image processing device and electronic equipment
JP7242278B2 (en) Image processing device and its control method
JP5240591B2 (en) Imaging device, focusing device, imaging method, and focusing method
JP4954834B2 (en) Imaging device, focusing information acquisition device, imaging method, and focusing information acquisition method
JP6210836B2 (en) IMAGING DEVICE, IMAGING CONTROL DEVICE, ITS CONTROL METHOD, AND PROGRAM
JP2015084518A (en) Image processing apparatus, image processing method, program and recording medium
US20220272271A1 (en) Image pickup apparatus capable of keeping focus on subject even when moving direction of subject changes in time series, control method for image pickup apparatus, and storage medium
JP6833772B2 (en) Image processing equipment, imaging equipment, image processing methods and programs
JP6291605B2 (en) Image processing apparatus and control method thereof
JP2022126423A (en) Imaging apparatus, image processing apparatus, method for controlling image processing apparatus, method for controlling imaging apparatus, and program
JP2003319235A (en) Photographing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210830

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220711

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220823

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221018

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221108

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221216

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230208

R151 Written notification of patent or utility model registration

Ref document number: 7224811

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151