JP2016032180A - Imaging apparatus, control method and program - Google Patents

Imaging apparatus, control method and program Download PDF

Info

Publication number
JP2016032180A
JP2016032180A JP2014153295A JP2014153295A JP2016032180A JP 2016032180 A JP2016032180 A JP 2016032180A JP 2014153295 A JP2014153295 A JP 2014153295A JP 2014153295 A JP2014153295 A JP 2014153295A JP 2016032180 A JP2016032180 A JP 2016032180A
Authority
JP
Japan
Prior art keywords
image
evaluation value
acquired
value
imaging
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.)
Pending
Application number
JP2014153295A
Other languages
Japanese (ja)
Inventor
進洋 柴田
Nobuhiro Shibata
進洋 柴田
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 JP2014153295A priority Critical patent/JP2016032180A/en
Publication of JP2016032180A publication Critical patent/JP2016032180A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To acquire an image in which influences of blurring of subjects are suppressed, in the state where a plurality of subjects are focused.SOLUTION: An imaging apparatus is configured to acquire a first image for generating an image focusing the plurality of subjects by continuously performing imaging with different lens positions of a focus lens. The imaging apparatus includes: evaluation value acquisition means for acquiring a first evaluation value based on a second image acquired for setting the lens position and a second evaluation value based on a first image acquired on the basis of the first evaluation value; determination means for determining whether a difference between the first evaluation value and the second evaluation value based on the first image and the second image which are acquired with the same lens position is greater than a first value; and first control means by which, in the case where it is determined that the difference is greater than the first value, control is performed in such a manner that a pixel region corresponding to the subject that is focused at a maximum, in the second image is not used when generating the image focusing the plurality of subjects.SELECTED DRAWING: Figure 3

Description

本発明は、フォーカスレンズのレンズ位置を異ならせて連続して被写体を撮像する撮像装置と、その制御方法およびプログラムに関する。   The present invention relates to an imaging apparatus that continuously images a subject by changing the lens position of a focus lens, and a control method and program thereof.

従来、フォーカスレンズを含む撮影レンズを備え、当該フォーカスレンズのレンズ位置を異ならせて連続して被写体を撮像する所謂フォーカスブラケット撮影をおこなう撮像装置がある。   2. Description of the Related Art Conventionally, there is an image pickup apparatus that includes a photographing lens including a focus lens and performs so-called focus bracket photographing in which a subject is continuously photographed by changing the lens position of the focus lens.

特許文献1では、カメラから被写体までの被写体距離と絞り値に基づいて、ピント位置と撮影枚数を自動的に設定してフォーカスブラケット撮影をおこなうカメラについて提案されている。   Patent Document 1 proposes a camera that performs focus bracket shooting by automatically setting the focus position and the number of shots based on the subject distance from the camera to the subject and the aperture value.

特開2004−333924号公報JP 2004-333924 A

上述したフォーカスブラケット撮影によって取得された複数の画像同士を合成して、複数の被写体に合焦した状態の画像(以下、全焦点画像と称す)を取得することが知られている。   It is known to synthesize a plurality of images acquired by the above-described focus bracket shooting to acquire an image in which a plurality of subjects are focused (hereinafter referred to as an omnifocal image).

しかしながら、特許文献1では、フォーカスブラケット撮影によって被写体がぶれた状態の画像が取得される場合については言及されていない。この場合、当該被写体がぶれた状態の画像を用いて全焦点画像を生成すると、被写体がぶれた状態の不自然な全焦点画像となってしまう。   However, Patent Document 1 does not mention a case where an image in which a subject is blurred by focus bracket shooting is acquired. In this case, if an omnifocal image is generated using an image in which the subject is blurred, an unnatural omnifocal image in which the subject is blurred is obtained.

本発明の目的は、複数の被写体に合焦した状態であって、被写体のぶれの影響を抑制した画像を取得することである。   An object of the present invention is to acquire an image in which a plurality of subjects are in focus and the influence of subject blurring is suppressed.

上記目的を達成するための本発明の撮像装置は、フォーカスレンズのレンズ位置を異ならせて連続して被写体を撮像することで、複数の被写体に合焦した状態の画像を生成するための第1の画像を取得する撮像装置であって、前記フォーカスレンズのレンズ位置を設定するために取得した第2の画像に基づく第1の評価値と、前記第1の評価値に基づいて取得した前記第1の画像に基づく第2の評価値と、を取得する評価値取得手段と、同一のレンズ位置で取得した前記第1の画像と前記第2の画像に基づく前記第1の評価値と前記第2の評価値との差異が第1の値よりも大きいか否かを判定する判定手段と、前記判定手段によって、前記第1の評価値と前記第2の評価値との差異が前記第1の値よりも大きいと判定された場合に、当該第2の評価値を取得した前記第2の画像で最も合焦している被写体に対応する画素領域を、前記複数の被写体に合焦した状態の画像を生成する際の画素領域として用いないように制御する第1の制御手段と、を有することを特徴とする。   In order to achieve the above object, an imaging apparatus according to an embodiment of the present invention is configured to generate a first image for focusing on a plurality of subjects by continuously imaging the subject with different focus lens positions. An imaging device that acquires the first image, the first evaluation value based on the second image acquired to set the lens position of the focus lens, and the first evaluation value acquired based on the first evaluation value. Evaluation value acquisition means for acquiring a second evaluation value based on one image, the first evaluation value based on the first image and the second image acquired at the same lens position, and the first A difference between the first evaluation value and the second evaluation value is determined by the determination unit that determines whether or not the difference between the first evaluation value and the second evaluation value is greater than the first value. If it is determined that the value is larger than the value of the second Control is performed so that the pixel area corresponding to the most focused subject in the second image for which the evaluation value has been acquired is not used as a pixel area when generating an image focused on the plurality of subjects. And a first control means.

本発明によれば、複数の被写体に合焦した状態であって、被写体のぶれの影響を抑制した画像を取得することができる。   According to the present invention, it is possible to acquire an image in which a plurality of subjects are in focus and the influence of subject blurring is suppressed.

本発明を実施した撮像装置の実施形態であるデジタルカメラ100の構成を説明するブロック図である。1 is a block diagram illustrating a configuration of a digital camera 100 that is an embodiment of an imaging apparatus embodying the present invention. 本発明を実施した撮像装置の実施形態であるデジタルカメラ100で取得する全焦点画像と、当該全焦点画像を生成する際の各種の条件を例示的に説明する図である。It is a figure which illustrates omnifocal image acquired with the digital camera 100 which is embodiment of the imaging device which implemented this invention, and various conditions at the time of producing | generating the said omnifocal image. 本発明を実施した撮像装置の実施形態であるデジタルカメラ100のフォーカスブラケット処理を説明するフローチャートである。It is a flowchart explaining the focus bracket process of the digital camera 100 which is embodiment of the imaging device which implemented this invention. 本発明を実施した撮像装置の実施形態であるデジタルカメラ100において、フォーカスブラケット撮影中に被写体が移動してしまった場合に取得される全焦点画像と、当該全焦点画像を生成する際の各種の条件を例示的に説明する図である。In the digital camera 100, which is an embodiment of an imaging apparatus that implements the present invention, an omnifocal image acquired when the subject moves during focus bracket shooting, and various types of images when generating the omnifocal image. It is a figure explaining conditions exemplarily. 本発明を実施した撮像装置の実施形態であるデジタルカメラ100の合成処理を説明するフローチャートである。It is a flowchart explaining the synthetic | combination process of the digital camera 100 which is embodiment of the imaging device which implemented this invention. 本発明を実施した撮像装置の実施形態であるデジタルカメラ100の補償画像設定処理を説明するフローチャートである。It is a flowchart explaining the compensation image setting process of the digital camera 100 which is embodiment of the imaging device which implemented this invention.

本発明に係る実施形態としての撮像装置であるデジタルカメラ(以下、単にカメラと称す)100の基本構成について図1を参照して説明する。図1は、本発明を実施した撮像装置の実施形態であるカメラ100の構成を説明するブロック図である。   A basic configuration of a digital camera (hereinafter simply referred to as a camera) 100 as an imaging apparatus according to an embodiment of the present invention will be described with reference to FIG. FIG. 1 is a block diagram illustrating the configuration of a camera 100 that is an embodiment of an imaging apparatus embodying the present invention.

撮像レンズ群101は、ズームレンズ102、フォーカスレンズ103、防振レンズ104、絞り105から構成される撮像レンズ群である。ズームレンズ102は焦点距離を調節することで光学的に画角を変更する撮像レンズである。   The imaging lens group 101 is an imaging lens group including a zoom lens 102, a focus lens 103, an anti-vibration lens 104, and a diaphragm 105. The zoom lens 102 is an imaging lens that optically changes the angle of view by adjusting the focal length.

フォーカスレンズ103は焦点位置を調節する撮像レンズである。本実施形態では、フォーカスレンズ103のレンズ位置を光軸方向に動作することで、焦点位置を変更することができる。そして、フォーカスレンズ103のレンズ位置を異ならせて連続して被写体を撮像することで、それぞれが異なる位置に合焦した状態の複数の画像を取得することができる。この詳細については後述する。   The focus lens 103 is an imaging lens that adjusts the focal position. In the present embodiment, the focus position can be changed by operating the lens position of the focus lens 103 in the optical axis direction. Then, by continuously imaging the subject while changing the lens position of the focus lens 103, it is possible to acquire a plurality of images in a state where each is focused on a different position. Details of this will be described later.

防振レンズ104は手ぶれなどの種々の要因によって生じる像振れを補正する撮像レンズである。絞り105は、後述する撮像素子106に入射する光量を調節する光量調節部材である。本実施形態では、絞り105に機械的なシャッタ(不図示)が設けられており、当該シャッタの駆動を制御することで、撮像素子106に光を露光する時間(露光時間)を制御することができる。なお、複数の撮像レンズが設けられていない場合は、上述した各撮像レンズが有する、ズームやフォーカス、防振などの機能を一つの撮像レンズによって実現するような構成であってもよい。   The anti-vibration lens 104 is an imaging lens that corrects image blur caused by various factors such as camera shake. The diaphragm 105 is a light amount adjustment member that adjusts the amount of light incident on the image sensor 106 described later. In this embodiment, the diaphragm 105 is provided with a mechanical shutter (not shown), and the time (exposure time) for exposing the image sensor 106 to light can be controlled by controlling the driving of the shutter. it can. In the case where a plurality of imaging lenses are not provided, a configuration in which functions such as zooming, focusing, and image stabilization included in each imaging lens described above are realized by one imaging lens may be used.

以下の説明では、カメラ本体と撮像レンズ群101を備えたレンズ鏡筒とが一体的に設けられているような、所謂レンズ一体型のカメラ100について説明する。なお、カメラ本体とレンズ鏡筒とが別々に設けられているような所謂レンズ交換式のカメラ100を採用するような構成であってもよい。   In the following description, a so-called lens-integrated camera 100 in which a camera body and a lens barrel including an imaging lens group 101 are integrally provided will be described. Note that a so-called interchangeable lens type camera 100 in which the camera body and the lens barrel are separately provided may be adopted.

撮像素子106は、電荷を蓄積することで画像を生成することができるCCDやCMOSなどの固体撮像素子からなる電荷蓄積型の撮像素子であって、2次元的に撮像用の画素が配列された撮像手段である。撮像レンズ群101を透過した被写体の光学像が撮像素子106に結像することで、当該被写体の光学像に応じたアナログ電気信号(アナログ画像データ)が出力される。なお、撮像素子106には不図示のAFE(Analog Front End)が接続されており、取得したアナログ画像データに対するアナログゲイン量の調整や、レンズの収差補正やサンプリングをおこなうことができる。当該AFEから出力されたアナログ画像データは不図示のA/D変換部によってデジタル電気信号(デジタル画像データ)に変換され、画像処理部107に出力される。なお、以下の説明では、特記しないものについては、デジタル画像データを「画像」と称する。   The image sensor 106 is a charge storage type image sensor composed of a solid-state image sensor such as a CCD or a CMOS that can generate an image by accumulating charges, and pixels for imaging are two-dimensionally arranged. It is an imaging means. When an optical image of the subject that has passed through the imaging lens group 101 is formed on the image sensor 106, an analog electrical signal (analog image data) corresponding to the optical image of the subject is output. Note that an AFE (Analog Front End) (not shown) is connected to the image sensor 106, and it is possible to adjust an analog gain amount with respect to the acquired analog image data, and to correct aberration of the lens and perform sampling. The analog image data output from the AFE is converted into a digital electric signal (digital image data) by an A / D conversion unit (not shown) and output to the image processing unit 107. In the following description, digital image data is referred to as “image” unless otherwise specified.

画像処理部107は、取得した画像に対して画素補間処理や色変換処理などの画像処理を施す画像処理手段である。また、画像処理部107は、取得した画像に基づいて被写体の輝度値(輝度情報)を算出する測光演算手段でもある。被写体の輝度値の算出方法については後述する。さらに、画像処理部107は、取得した画像のデジタルゲイン量を調整することができる。画像処理部107で各種の処理が施されたデジタル画像データはメモリ108に記録される。   The image processing unit 107 is an image processing unit that performs image processing such as pixel interpolation processing and color conversion processing on the acquired image. The image processing unit 107 is also a photometric calculation unit that calculates the luminance value (luminance information) of the subject based on the acquired image. A method for calculating the luminance value of the subject will be described later. Furthermore, the image processing unit 107 can adjust the digital gain amount of the acquired image. Digital image data subjected to various processes by the image processing unit 107 is recorded in the memory 108.

メモリ108は、電気的に消去や記憶ができる記憶手段であり、例えば、フラッシュメモリ等に代表されるEEPROMなどである。メモリ108には、本実施形態において使用される種々のデータが格納されている。例えば、カメラ100において実行されるプログラムや動作用の定数、種々の露出条件、カメラ100内の処理で使用する算出式や閾値、所定の値などがメモリ108に予め格納されている。さらに、メモリ108は、画像表示用メモリ(ビデオメモリ)、カメラ100の各部の作業領域や、後述する記録メモリ111の記録用バッファとしても使用される。   The memory 108 is a storage means that can be electrically erased and stored, and is, for example, an EEPROM represented by a flash memory or the like. The memory 108 stores various data used in the present embodiment. For example, a program executed in the camera 100, operation constants, various exposure conditions, calculation formulas and threshold values used in processing in the camera 100, predetermined values, and the like are stored in the memory 108 in advance. Further, the memory 108 is also used as an image display memory (video memory), a work area of each part of the camera 100, and a recording buffer of the recording memory 111 described later.

なお、カメラ100において実行されるプログラムとは、後述する図3や図5、図6に示すフローと同様の動作を指示するためのプログラムである。また、メモリ108には、RAM(Random Access Memory)などの記録素子によって構成された画像データの記録領域を有している。当該RAMは、所定枚数の静止画や所定時間の動画、音声データを記録できる記憶容量を備え、取得した画像を記録することができる。   The program executed in the camera 100 is a program for instructing an operation similar to the flow shown in FIGS. 3, 5, and 6 described later. Further, the memory 108 has a recording area for image data constituted by a recording element such as a RAM (Random Access Memory). The RAM has a storage capacity capable of recording a predetermined number of still images, a moving image for a predetermined time, and audio data, and can record acquired images.

表示部109は、TFT型LCD(薄膜トランジスタ駆動型液晶表示器)などで構成された表示手段である。後述するシステム制御部(以下、単にCPUと称す)119によってメモリ108から読み出された画像は、不図示のD/A変換部によって表示用にアナログ画像データ(以下、表示画像と称す)に変換されて、表示部109に表示される。   The display unit 109 is a display unit constituted by a TFT type LCD (Thin Film Transistor Driven Liquid Crystal Display) or the like. An image read from the memory 108 by a system control unit (hereinafter simply referred to as a CPU) 119 described later is converted into analog image data (hereinafter referred to as a display image) for display by a D / A conversion unit (not shown). And displayed on the display unit 109.

なお、当該表示画像を表示部109に逐次表示することで所謂ライブビュー表示をおこなうことができる。また、電子ビューファインダ(不図示)で当該ライブビュー表示をおこなうような構成であってもよい。   Note that so-called live view display can be performed by sequentially displaying the display image on the display unit 109. Moreover, the structure which performs the said live view display with an electronic view finder (not shown) may be sufficient.

圧縮伸長処理部110は、メモリ108に記録されている画像を、画像フォーマットに応じて圧縮伸長する処理部である。記録メモリ111は、圧縮伸長処理部110によって圧縮伸長された画像データの記録が可能なメモリーカードやハードディスクなどの不揮発性の記録媒体である。なお、本実施形態では記録メモリ111として、カメラ100に対して挿抜可能なものを採用するが、DVD−RWディスク等の光学ディスクやハードディスク等の磁気ディスクを採用するような構成であってもよい。また、記録メモリ111を予めカメラ100に内蔵するような構成であってもよい。   The compression / decompression processing unit 110 is a processing unit that compresses / decompresses an image recorded in the memory 108 according to an image format. The recording memory 111 is a non-volatile recording medium such as a memory card or a hard disk capable of recording image data compressed and expanded by the compression / decompression processing unit 110. In the present embodiment, a recording memory 111 that can be inserted into and removed from the camera 100 is used. However, an optical disk such as a DVD-RW disk or a magnetic disk such as a hard disk may be used. . Further, the recording memory 111 may be built in the camera 100 in advance.

絞り駆動部112は、設定された絞り値および露光時間に基づいて絞り105およびシャッタ(不図示)を駆動する駆動手段である。なお、絞り値および露光時間は、画像処理部107によって算出した被写体の輝度値に基づき、後述するCPU119によって設定(演算)される。すなわち、本実施形態における自動露出(AE)制御は、CPU119からの指示に応じて、絞り駆動部112が絞り105やシャッタを駆動することでおこなわれる。なお、本実施形態のAE制御としては、画像処理部107においてゲイン量を調整することも含む。   The aperture driving unit 112 is a driving unit that drives the aperture 105 and a shutter (not shown) based on the set aperture value and exposure time. The aperture value and the exposure time are set (calculated) by the CPU 119 described later based on the luminance value of the subject calculated by the image processing unit 107. That is, automatic exposure (AE) control in the present embodiment is performed by driving the diaphragm 105 and the shutter by the diaphragm driving unit 112 in accordance with an instruction from the CPU 119. Note that the AE control of the present embodiment includes adjusting the gain amount in the image processing unit 107.

防振レンズ駆動部113は、角速度センサ125やジャイロセンサ126の情報に基づいてカメラ100に加わるぶれの量を演算し、そのぶれを打ち消すように防振レンズ104を駆動する駆動制御手段である。なお、カメラ100に加わる振れの量の演算は、CPU119によって演算するような構成であってもよい。ズームレンズ駆動部115は、ユーザによるズーム操作指示に従ってズームレンズ102を駆動する駆動手段である。   The anti-vibration lens driving unit 113 is a drive control unit that calculates the amount of shake applied to the camera 100 based on information from the angular velocity sensor 125 and the gyro sensor 126 and drives the anti-vibration lens 104 so as to cancel the shake. The calculation of the amount of shake applied to the camera 100 may be calculated by the CPU 119. The zoom lens driving unit 115 is a driving unit that drives the zoom lens 102 in accordance with a zoom operation instruction from the user.

フォーカスレンズ駆動部114はフォーカスレンズ103を駆動するレンズ駆動手段である。後述するCPU119の指示に従ってフォーカスレンズ駆動部114を駆動することで、フォーカスレンズ103のレンズ位置を移動させることができる。   The focus lens driving unit 114 is a lens driving unit that drives the focus lens 103. The lens position of the focus lens 103 can be moved by driving the focus lens driving unit 114 in accordance with an instruction from the CPU 119 described later.

本実施形態では、後述する評価値取得部120で取得した焦点検出用の評価値(コントラスト評価値)に基づいてフォーカスレンズ駆動部114を駆動し、フォーカスレンズ103のレンズ位置を移動させる。この動作によって、フォーカスレンズ103のレンズ位置を所定の被写体に合焦させた状態に設定することができる。この動作をAF(AutoForcus)制御と称する。なお、上述したような所謂コントラスト検出方式のAF制御ではなく、所謂位相差検出方式のAF制御をおこなうような構成であってもよい。   In the present embodiment, the focus lens driving unit 114 is driven based on an evaluation value (contrast evaluation value) for focus detection acquired by an evaluation value acquisition unit 120 described later, and the lens position of the focus lens 103 is moved. By this operation, the lens position of the focus lens 103 can be set to a state in which a predetermined subject is focused. This operation is referred to as AF (Auto Focus) control. Instead of the so-called contrast detection AF control described above, a so-called phase difference detection AF control may be performed.

操作部116は、ユーザによって、各種の指示や設定を入力するための操作手段である。操作部116は、スイッチ、ボタン、ダイヤルなどの入力デバイス群によって構成されている。また、操作部116は、レリーズスイッチ117やメニュー操作ボタン118を含んだ構成である。   The operation unit 116 is an operation unit for inputting various instructions and settings by the user. The operation unit 116 includes a group of input devices such as switches, buttons, and dials. The operation unit 116 includes a release switch 117 and a menu operation button 118.

ユーザの操作によって、レリーズスイッチ117がSW1状態(例えば、半押し状態)にされると、被写体を撮像する前の準備動作(撮像準備)が指示される。なお、撮像準備とは、測光演算やAF制御、露出制御(AE制御を含む)を指す。   When the release switch 117 is set to the SW1 state (for example, half-pressed state) by a user operation, a preparatory operation (imaging preparation) before imaging the subject is instructed. Note that imaging preparation refers to photometric calculation, AF control, and exposure control (including AE control).

また、ユーザの操作によって、レリーズスイッチ117がSW2状態(例えば、全押状態)にされると、被写体の撮像開始(本撮像)が指示される。なお、被写体の撮像開始とは、撮像素子106における露光の開始を指す。   In addition, when the release switch 117 is set to the SW2 state (for example, fully pressed) by a user operation, an instruction to start imaging of the subject (main imaging) is instructed. Note that the imaging start of the subject refers to the start of exposure in the image sensor 106.

また、ユーザはメニュー操作ボタン(モード選択手段)118を操作することによって、被写体を撮像する際の撮影モードを設定することができる。設定可能な撮影モードとしては、少なくともフォーカスブラケット撮影をおこなうモードを含んでいる。   Further, the user can set a shooting mode for shooting a subject by operating a menu operation button (mode selection means) 118. The settable shooting modes include at least a mode for performing focus bracket shooting.

さらに、ユーザはメニュー操作ボタン118を操作することによって、一度のフォーカスブラケット処理(後述)において撮像をおこなう回数(以下、撮像回数と称す)を設定することもできる。   Further, the user can set the number of times of imaging (hereinafter referred to as the number of imaging) in one focus bracket process (described later) by operating the menu operation button 118.

システム制御部(CPU)119は、カメラ100の全体的な動作を統括的に制御する制御手段である。CPU119は、ユーザの操作指示に応じてカメラ100の各部に動作を指示することでカメラ100全体を制御することができる。なお、CPU119は、メモリ108に格納されているプログラムを実行し、当該プログラムの処理に応じたカメラ100の動作や処理を制御することもできる。例えば、撮像素子106の制御や露出制御、AF制御、ズーム制御などをおこなうためのプログラムを実行する。また、CPU119には、評価値取得部120、距離算出部121、合成判定部122、フォーカスブラケット制御部123、合成部124が設けられている。以下、この詳細を説明する。   A system control unit (CPU) 119 is a control unit that comprehensively controls the overall operation of the camera 100. The CPU 119 can control the entire camera 100 by instructing each unit of the camera 100 to perform an operation in accordance with a user operation instruction. Note that the CPU 119 can execute a program stored in the memory 108 and control the operation and processing of the camera 100 according to the processing of the program. For example, a program for performing control of the image sensor 106, exposure control, AF control, zoom control, and the like is executed. Further, the CPU 119 is provided with an evaluation value acquisition unit 120, a distance calculation unit 121, a synthesis determination unit 122, a focus bracket control unit 123, and a synthesis unit 124. The details will be described below.

評価値取得部120は、取得した画像のコントラスト情報に基づく焦点検出用の評価値(以下、コントラスト評価値と称す)を取得するための評価値取得手段である。本実施形態において評価値取得部120は、フォーカスレンズ103を駆動しながら所定の間隔で取得した画像(第2の画像)に基づいて、一画面中のコントラス評価値の推移に関する情報を取得する。以下、当該コントラス評価値の推移に関する情報を取得するための動作をフォーカススキャンと称してその詳細を説明する。   The evaluation value acquisition unit 120 is an evaluation value acquisition unit for acquiring an evaluation value for focus detection (hereinafter referred to as a contrast evaluation value) based on the acquired contrast information of the image. In the present embodiment, the evaluation value acquisition unit 120 acquires information on the transition of the contrast evaluation value in one screen based on an image (second image) acquired at a predetermined interval while driving the focus lens 103. Hereinafter, an operation for acquiring information related to the transition of the contrast evaluation value will be referred to as a focus scan, and the details will be described.

なお、上述したコントラスト評価値の推移とは、例えば、後述する図2(b)の下段に図示するようなグラフで表される。このグラフでは、被写体に合焦する位置でコントラス評価値が最も大きくなる。したがって、コントラス評価値が最も大きくなるフォーカスレンズ103のレンズ位置で撮像をおこなうことで、被写体に合焦した状態の合成用の画像(第1の画像)を取得することができる。本実施形態では、上述した合成用の画像を被合成画像(第1の画像)と称して説明する。また、被合成画像を取得するための撮像をおこなうフォーカスレンズ103のレンズ位置をフォーカス位置と称して説明する。   Note that the transition of the contrast evaluation value described above is represented by, for example, a graph as illustrated in the lower part of FIG. In this graph, the contrast evaluation value is the largest at the position where the subject is in focus. Therefore, by performing imaging at the lens position of the focus lens 103 where the contrast evaluation value is the largest, it is possible to acquire a composite image (first image) in a state where the subject is in focus. In the present embodiment, the above-described synthesis image is referred to as a synthesized image (first image). In addition, the lens position of the focus lens 103 that performs imaging for acquiring a composite image will be described as a focus position.

なお、本実施形態では、取得した画像のコントラスト情報に基づいてコントラスト評価値を算出するような構成であるが、これに限定されるものではない。例えば、撮像素子106から出力された信号を画像として取得(現像)せずにコントラスト評価値を算出するような構成であってもよい。   In the present embodiment, the contrast evaluation value is calculated based on the contrast information of the acquired image. However, the present invention is not limited to this. For example, the contrast evaluation value may be calculated without acquiring (developing) the signal output from the image sensor 106 as an image.

距離算出部121は、評価値取得部120で取得したコントラスト評価値に基づいて、フォーカスブラケット撮影で合焦させる対象(合焦対象)とする被写体までの距離(以下、被写体距離と称す)に関する情報を算出する算出手段である。なお、顔検出や人体検出などの検出結果に関する情報を用いて、被写体距離に関する情報を算出するような構成であってもよい。   Based on the contrast evaluation value acquired by the evaluation value acquisition unit 120, the distance calculation unit 121 is information regarding the distance to the subject (hereinafter referred to as the subject distance) to be a target to be focused (focus target) in focus bracket shooting. Is a calculating means for calculating. In addition, the structure which calculates the information regarding a to-be-photographed object distance using the information regarding detection results, such as a face detection and a human body detection, may be sufficient.

また、距離算出部121は、算出した被写体距離に関する情報に基づいて、フォーカスブラケット撮影をおこなう領域(以下、被写体領域)を設定する手段でもある。本実施形態では、合焦対象として検出した複数の被写体のうち、カメラ100に対して至近側の被写体が存在する位置から無限遠側の被写体が存在する位置までの領域を被写体領域としてフォーカスブラケット撮影をおこなう。そして、当該被写体領域に基づいてフォーカスブラケット撮影をおこなうことで、合焦位置の異なる複数の被合成画像を取得することができる。   The distance calculation unit 121 is also a means for setting a region for focus bracket shooting (hereinafter referred to as a subject region) based on information about the calculated subject distance. In the present embodiment, focus bracket shooting is performed using a region from a position where a subject close to the camera 100 is present to a position where a subject at infinity is present among a plurality of subjects detected as in-focus objects as a subject area. To do. Then, by performing focus bracket shooting based on the subject area, it is possible to acquire a plurality of composite images having different in-focus positions.

なお、本実施形態では、撮像素子106から被写体までの距離に関する情報を被写体距離とするが、これに限定されるものではない。例えば、撮像レンズ群101から被写体までの距離に関する情報を被写体距離とするような構成であってもよい。また、測距センサを用いた位相差方式など、上述した方法以外の公知の方法で被写体距離を算出するような構成であってもよい。   In the present embodiment, information on the distance from the image sensor 106 to the subject is the subject distance, but the present invention is not limited to this. For example, the configuration may be such that information on the distance from the imaging lens group 101 to the subject is the subject distance. Further, the subject distance may be calculated by a known method other than the above-described method such as a phase difference method using a distance measuring sensor.

合成判定部122は、取得したコントラスト評価値に基づいて、被合成画像が複数の被写体に合焦した状態の画像データ(以下、全焦点画像と称す)を生成するために適した画像であるか否かを判定するための判定手段である。また、合成判定部122は、当該判定の結果に基づいて、被合成画像の中から、全焦点画像を生成する際に用いる画像を設定する制御手段(第1の制御手段)でもある。本実施形態では、合成判定部122によって、全焦点画像を生成するのに適した画像でないと判定された被合成画像が合焦している画素領域を、全焦点画像を生成する際の所定の画素領域としては用いないように制御する。この詳細については後述する。   Whether the combination determination unit 122 is an image suitable for generating image data (hereinafter referred to as an omnifocal image) in a state where the combined image is focused on a plurality of subjects based on the acquired contrast evaluation value. It is a determination means for determining whether or not. The combination determination unit 122 is also a control unit (first control unit) that sets an image to be used when generating an omnifocal image from among the combined images based on the determination result. In the present embodiment, a pixel region in which a combined image determined to be an image that is not suitable for generating an omnifocal image by the synthesis determination unit 122 is a predetermined area when generating an omnifocal image. The pixel area is controlled so as not to be used. Details of this will be described later.

さらに、合成判定部122は、全焦点画像を生成するのに適した画像でないと判定された被合成画像において最も合焦している被写体に対応した画素領域を補償するための補償画像を設定する補償画像設定手段でもある。この詳細については後述する。   Further, the composition determination unit 122 sets a compensation image for compensating the pixel region corresponding to the most focused subject in the composite image determined not to be an image suitable for generating an omnifocal image. It is also a compensation image setting means. Details of this will be described later.

フォーカスブラケット制御部123は、取得したコントラスト評価値や被写体距離などの情報に基づいて、フォーカスブラケット撮影をおこなう際の撮影条件を設定する制御部である。本実施形態での撮像条件とは、フォーカスブラケット撮影をおこなう際の露出量、撮像回数や前述したフォーカス位置である。   The focus bracket control unit 123 is a control unit that sets shooting conditions for performing focus bracket shooting based on information such as the acquired contrast evaluation value and subject distance. The imaging conditions in the present embodiment are the exposure amount, the number of times of imaging, and the focus position described above when performing focus bracket shooting.

なお、本実施形態での露出量は、絞り値やシャッタ速度、ゲイン量などの露出条件に基づいて変化する値である。したがって、フォーカスブラケット制御部123は、フォーカスレンズ103や絞り105およびシャッタの動作を制御することで、フォーカスブラケット撮影をおこなう際の露出量を設定する露出制御手段でもある。   Note that the exposure amount in this embodiment is a value that changes based on exposure conditions such as the aperture value, shutter speed, and gain amount. Accordingly, the focus bracket control unit 123 is also an exposure control unit that sets the exposure amount when performing the focus bracket photographing by controlling the operations of the focus lens 103, the aperture 105, and the shutter.

合成部124は、フォーカスブラケット処理によって取得した複数の被合成画像をメモリ108から読み出し、当該複数の被合成画像を合成することで全焦点画像を生成する合成手段である。具体的には、合成部124は、合成判定部122の判定結果に基づいて、取得した複数の被合成画像のそれぞれから所定の画素領域を抽出し、合成することで全焦点画像を生成する。ここで、抽出する画素領域は被合成画像ごとに異なる。この詳細については後述する。以上で説明した被写体距離の算出から全焦点画像の取得までの一連の処理を、本実施形態ではフォーカスブラケット処理と称して説明する。フォーカスブラケット処理の説明については後述する。以上がカメラ100の基本的な構成である。   The synthesizing unit 124 is a synthesizing unit that reads a plurality of synthesized images acquired by the focus bracket process from the memory 108 and synthesizes the plurality of synthesized images to generate an omnifocal image. Specifically, the synthesizing unit 124 extracts a predetermined pixel area from each of the acquired plurality of synthesized images based on the determination result of the synthesizing determination unit 122, and generates an omnifocal image by synthesizing. Here, the pixel area to be extracted differs for each synthesized image. Details of this will be described later. A series of processes from the calculation of the subject distance to the acquisition of the omnifocal image described above will be described as a focus bracket process in the present embodiment. The focus bracket process will be described later. The basic configuration of the camera 100 has been described above.

以下、フォーカスブラケット処理の詳細について図2、図3を参照して説明する。図2は、本発明を実施した撮像装置の実施形態であるカメラ100で取得する全焦点画像と、当該全焦点画像を生成する際の各種の条件を例示的に説明する図である。図2(a)は、取得する全焼端画像と当該全焦点画像の画角内に含まれる被写体を例示的に説明する図である。本実施形態では、被写体として人物1、人物2、木が画角内に存在する場合について例示的に説明する。また、図2(b)は、画角内に存在する被写体の被写体距離とコントラスト評価値との関係を例示的に説明する図であって、図中の上段は被写体距離、下段はコントラスト評価値を示している。図2(b)に図示するように、それぞれの被写体に関する被写体距離は、人物1が約1m(L1)、人物2が約5m、木が約30m(L3)である。すなわち、本実施形態において、カメラ100から最も近い被写体は人物1であって、カメラ100から最も遠い被写体は木である。なお、なお、同一の絞り値であっても、被写体距離に応じて被写界深度は変化するため、図2(b)の横軸は対数に換算した被写体距離を示している。   Details of the focus bracket process will be described below with reference to FIGS. FIG. 2 is a diagram illustratively illustrating an omnifocal image acquired by the camera 100 that is an embodiment of an imaging apparatus that implements the present invention, and various conditions for generating the omnifocal image. FIG. 2A is a diagram for exemplarily explaining the entire burnt edge image to be acquired and the subject included in the angle of view of the omnifocal image. In the present embodiment, a case in which a person 1, a person 2, and a tree are present within the angle of view will be described as an example. FIG. 2B is a diagram for exemplarily explaining the relationship between the subject distance of the subject existing within the angle of view and the contrast evaluation value, in which the upper part is the subject distance and the lower part is the contrast evaluation value. Is shown. As shown in FIG. 2B, the subject distances for the respective subjects are about 1 m (L1) for the person 1, about 5 m for the person 2, and about 30 m (L3) for the tree. That is, in this embodiment, the subject closest to the camera 100 is the person 1 and the subject farthest from the camera 100 is a tree. Note that even if the aperture value is the same, the depth of field changes according to the subject distance, so the horizontal axis in FIG. 2B indicates the subject distance converted to logarithm.

以下、図2に図示する画角で撮像する場合のフォーカスブラケット処理について図3を参照して例示的に説明する。図3は本発明を実施した撮像装置の実施形態であるカメラ100のフォーカスブラケット処理を説明するフローチャートである。なお、本実施形態では、ユーザがメニュー操作ボタン118を操作することによって、事前にフォーカスブラケット撮影をおこなうモードが設定されている場合について説明する。また、以下に説明する各ステップで取得する情報や画像データは、メモリ108への記録およびメモリ108からの読み出しが適宜おこなわれるものとする。   Hereinafter, the focus bracketing process in the case of imaging at the angle of view shown in FIG. 2 will be exemplarily described with reference to FIG. FIG. 3 is a flowchart for explaining the focus bracketing process of the camera 100 which is an embodiment of the imaging apparatus embodying the present invention. In the present embodiment, a case will be described in which a mode for performing focus bracket shooting is set in advance by the user operating the menu operation button 118. In addition, information and image data acquired in each step described below are appropriately recorded in the memory 108 and read out from the memory 108.

ユーザによってレリーズスイッチ117がSW1状態(半押し)にされたことに応じてフォーカスブラケット処理が開始される。ステップS101でCPU119は、フォーカスレンズ103のレンズ位置を所定の間隔で変更させながら撮像をおこなう。そして、CPU119は、当該撮像によって焦点検出用画像(第2の画像)を複数取得する。上述した所定の間隔に関する情報はメモリ108に予め記録されている。また、フォーカスレンズ103のレンズ位置を変更する所定の間隔とは、画角内のコントラスト評価値の推移に関する情報を取得できるものであれば、どのようなものであってもよい。   The focus bracket process is started in response to the release switch 117 being set to the SW1 state (half-pressed) by the user. In step S101, the CPU 119 performs imaging while changing the lens position of the focus lens 103 at a predetermined interval. Then, the CPU 119 acquires a plurality of focus detection images (second images) by the imaging. Information on the predetermined interval described above is recorded in the memory 108 in advance. Further, the predetermined interval for changing the lens position of the focus lens 103 may be any as long as it can acquire information on the transition of the contrast evaluation value within the angle of view.

上述した焦点検出用の画像(第2の画像)は、フォーカスブラケット処理におけるフォーカス位置を設定するために取得する画像である。この詳細については後述する。   The focus detection image (second image) described above is an image acquired to set a focus position in the focus bracket process. Details of this will be described later.

また、ステップS101で画像処理部(測光演算手段)107は、取得した焦点検出用画像に基づいて測光演算をおこない、被写体の輝度値(輝度情報)を算出する。具体的に、本実施形態では、取得した焦点検出用画像の一画面を複数のブロックに分割し、これらのブロックごとに平均輝度値を算出する。そして、全ブロックの平均輝度値を積分して算出した代表輝度値を算出する。さらに、焦点検出用画像ごとに算出した代表輝度値を加算平均することで、後述する種々の処理に用いる被写体の輝度値を算出する。   In step S101, the image processing unit (photometric calculation means) 107 performs photometric calculation based on the acquired focus detection image, and calculates the luminance value (luminance information) of the subject. Specifically, in this embodiment, one screen of the acquired focus detection image is divided into a plurality of blocks, and an average luminance value is calculated for each of these blocks. Then, a representative luminance value calculated by integrating the average luminance values of all blocks is calculated. Furthermore, the luminance value of the subject used for various processes to be described later is calculated by averaging the representative luminance values calculated for each focus detection image.

なお、測光演算の方法としてはこれに限定されるものではなく、その他の公知の方法によって輝度値を算出するような構成であってもよい。例えば、本実施形態では、焦点検出用画像ごとに算出した代表輝度値を加算平均することで被写体の輝度値を算出するような構成であるが、これに限定されるものではない。代表となる所定の焦点検出用画像を設定し、当該焦点検出用画像の代表輝度値を被写体の輝度値として設定するような構成であってもよい。   Note that the photometric calculation method is not limited to this, and the luminance value may be calculated by another known method. For example, in the present embodiment, the luminance value of the subject is calculated by averaging the representative luminance values calculated for each focus detection image, but the present invention is not limited to this. A configuration may be adopted in which a predetermined focus detection image as a representative is set and the representative luminance value of the focus detection image is set as the luminance value of the subject.

次に、ステップS102で、評価値取得部120は、取得した複数の焦点検出用の画像(第2の画像)に基づいて、前述したフォーカススキャンをおこない、画角内のコントラスト評価値の推移に関する情報を取得する。そして、評価値取得部120は、フォーカススキャンによって取得したコントラスト評価値の推移において、予め設定された所定の閾値を超える領域ごとに最も大きい(ピーク値となる)コントラスト評価値を取得する。なお、上述した閾値としては、どの様な値を設定してもよい。本実施形態では、この各領域のピーク値となるコントラスト評価値を、フォーカスブラケット処理で合焦対象とする被写体の第1のコントラスト評価値(第1の評価値)α(n)として設定する(nは自然数)。そして、当該第1の評価値を取得したフォーカスレンズ103のレンズ位置をフォーカス位置として設定する。フォーカス位置の設定方法については後述する。   Next, in step S102, the evaluation value acquisition unit 120 performs the above-described focus scan based on the acquired plurality of focus detection images (second images), and relates to the transition of the contrast evaluation value within the angle of view. Get information. Then, the evaluation value acquisition unit 120 acquires the largest (becomes a peak value) contrast evaluation value for each region exceeding a predetermined threshold value in the transition of the contrast evaluation value acquired by the focus scan. Note that any value may be set as the above-described threshold. In the present embodiment, the contrast evaluation value serving as the peak value of each region is set as the first contrast evaluation value (first evaluation value) α (n) of the subject to be focused in the focus bracket process ( n is a natural number). Then, the lens position of the focus lens 103 that has acquired the first evaluation value is set as the focus position. A method for setting the focus position will be described later.

なお、第1の評価値α(n)は、カメラ100の至近側から無限遠側に向けて順に番号が付与され、当該番号に沿って撮像がおこなわれる。例えば、図2(b)に図示するように、コントラスト評価値が閾値よりも大きくなる人物1、人物2、木が合焦対象の被写体となる。したがって、当該合焦対象の被写体に対しては、カメラ100の至近側から順に、第1の評価値α(1)、α(2)、α(3)を設定する。そして、人物1、人物2、木の順に被写体を撮像する。   The first evaluation value α (n) is assigned a number in order from the closest side of the camera 100 to the infinity side, and imaging is performed along the number. For example, as illustrated in FIG. 2B, a person 1, a person 2, and a tree whose contrast evaluation values are larger than a threshold are subjects to be focused. Accordingly, the first evaluation values α (1), α (2), and α (3) are set in order from the closest side of the camera 100 to the subject to be focused. Then, the subject is imaged in the order of person 1, person 2, and tree.

次に、ステップS103で距離算出部121は、先に取得した第1の評価値α(n)に関する情報に基づいて、被写体ごとに被写体距離に関する情報を算出する。本実施形態では、人物1の被写体距離をL1、人物2の被写体距離をL2、木の被写体距離をL3とする。   Next, in step S103, the distance calculation unit 121 calculates information related to the subject distance for each subject based on the information related to the first evaluation value α (n) acquired in advance. In the present embodiment, the subject distance of the person 1 is L1, the subject distance of the person 2 is L2, and the subject distance of the tree is L3.

また、ステップS103において距離算出部121は、フォーカスブラケット撮影をおこなう領域(被写体領域)を設定する。本実施形態では、図2(b)に図示するように、人物1から木までの領域(L3−L1の領域)を被写体領域として設定する。   In step S103, the distance calculation unit 121 sets an area (subject area) for focus bracket shooting. In the present embodiment, as illustrated in FIG. 2B, an area from the person 1 to the tree (L3-L1 area) is set as the subject area.

次に、ステップS104でフォーカスブラケット制御部123は、先に算出した被写体の輝度値や被写体距離に関する情報に基づいて、フォーカスブラケット撮影時の撮像条件を設定する。具体的には、フォーカスブラケット制御部123は、被写体に対して適正な明るさであって合焦した状態の画像を取得することができる露出量(絞り値、シャッタ速度、ゲイン量)を設定する。なお、本実施形態では一度のフォーカスブラケット処理において、同一の絞り値を設定する構成である。ここで、同一の絞り値であっても被写体距離に応じて被写界深度が異なるため、撮像する複数の被写体に合焦させることができる絞り値を設定する必要がある。さらに、絞り値が大きい(絞り径が小さい)場合は、光の回折現象によって画像の解像度が低下してしまうため、出来るだけ解像度が低下しないような絞りを設定する必要がある。   Next, in step S104, the focus bracket control unit 123 sets an imaging condition at the time of focus bracket shooting based on the previously calculated information on the luminance value and the subject distance of the subject. Specifically, the focus bracket control unit 123 sets an exposure amount (aperture value, shutter speed, gain amount) that can acquire an image that is in appropriate brightness and focused on the subject. . In the present embodiment, the same aperture value is set in one focus bracket process. Here, even if the aperture value is the same, the depth of field varies depending on the subject distance, so it is necessary to set an aperture value that can be focused on a plurality of subjects to be imaged. Furthermore, when the aperture value is large (the aperture diameter is small), the resolution of the image is lowered due to the light diffraction phenomenon, so it is necessary to set an aperture that does not reduce the resolution as much as possible.

また、フォーカスブラケット制御部123は、設定した絞り値と被写体距離に関する情報に基づいて、1度のフォーカスブラケット処理における撮像回数および、フォーカス位置を設定する。ここで設定する撮像回数およびフォーカス位置としては、先に設定した被写体領域の全域をカバーできるようなものとする。すなわち、取得する複数の画像の少なくとも一つの被写界深度内に合焦対象とする被写体が含まれるようにフォーカス位置および撮像回数を設定する。以上説明した露出量や撮像回数、フォーカス位置が本実施形態の撮像条件である。なお、被写体領域の全域に合焦した状態の全焦点画像を生成できるものであれば、フォーカスブラケット処理における絞り値や撮像回数、フォーカス位置はどのように設定してもよい。以下の説明では、撮像回数が3回に設定される場合であって、3回の撮像で被写体領域の全域をカバーできる(合焦させることができる)フォーカス位置が設定される場合のフォーカスブラケット処理について例示的に説明する。   Further, the focus bracket control unit 123 sets the number of times of imaging and the focus position in one focus bracket process based on the set aperture value and information on the subject distance. The number of times of imaging and the focus position set here are set so as to cover the entire subject area set previously. That is, the focus position and the number of imaging are set so that the subject to be focused is included within at least one depth of field of the plurality of images to be acquired. The exposure amount, the number of imaging operations, and the focus position described above are the imaging conditions of this embodiment. Note that the aperture value, the number of times of imaging, and the focus position in the focus bracket process may be set in any way as long as an omnifocal image focused on the entire subject area can be generated. In the following description, the focus bracketing process is performed when the number of times of imaging is set to 3 and the focus position is set so that the entire region of the subject area can be covered (focused) by 3 times of imaging. Will be exemplarily described.

次に、ステップS105でCPU119は、先に算出した絞り値に関する情報に基づき、絞り駆動部112を介して絞り105を駆動する。   Next, in step S <b> 105, the CPU 119 drives the diaphragm 105 via the diaphragm driver 112 based on the information regarding the previously calculated diaphragm value.

次に、ステップS106でCPU119は、レリーズスイッチ117がSW2状態にされたか否かを判定する。ステップS106の処理は、レリーズスイッチ117がSW2状態に変更されるまで繰り返す。   Next, in step S106, the CPU 119 determines whether or not the release switch 117 is in the SW2 state. The process of step S106 is repeated until the release switch 117 is changed to the SW2 state.

次に、ステップS107でフォーカスブラケット制御部123は、先に設定した撮像条件に関する情報に基づいて撮像をおこない、全焦点画像を生成する際に用いる被合成画像(n)を取得する(nは自然数)。なお、前述したように、本実施形態では、設定した撮像条件に基づいて、カメラ100の至近側から無限遠側に向かって順に被合成画像(第2の画像)を取得する構成である。   Next, in step S107, the focus bracket control unit 123 performs imaging based on the previously set information regarding the imaging conditions, and acquires a composite image (n) used when generating an omnifocal image (n is a natural number). ). Note that, as described above, in the present embodiment, a composite image (second image) is acquired in order from the closest side of the camera 100 toward the infinity side based on the set imaging condition.

本実施形態では、被合成画像を取得するごとに、ステップS107〜S112の処理を繰り返しおこなう。例えば、撮像回数が3回に設定されている場合は、ステップS107〜S112の処理を3回繰り返すことで被合成画像(1)〜(3)を順次取得する。なお、設定された撮像回数に応じて、先に全ての被合成画像を取得するような構成であってもよい。この場合、全ての被合成画像を取得してから、後述するステップS108〜S111の処理を実行する。   In this embodiment, every time a synthesized image is acquired, the processes in steps S107 to S112 are repeated. For example, when the number of times of imaging is set to 3, the combined images (1) to (3) are sequentially acquired by repeating the processing of steps S107 to S112 three times. In addition, according to the set imaging frequency, the structure which acquires all the synthesized images previously may be sufficient. In this case, after all the synthesized images are acquired, the processes of steps S108 to S111 described later are executed.

次に、ステップS108で、評価値取得部120は、取得した被合成画像(n)のコントラスト情報に基づいてコントラスト評価値(第2の評価値)β(n)を取得する(nは自然数)。   Next, in step S108, the evaluation value acquisition unit 120 acquires a contrast evaluation value (second evaluation value) β (n) based on the acquired contrast information of the combined image (n) (n is a natural number). .

本実施形態では、図4(a)に図示するように、カメラ100の光軸方向に対して、第1の評価値α(n)と同じフォーカスレンズ103のレンズ位置で第2の評価値β(n)を取得する。これは、第1の評価値α(n)を取得したフォーカスレンズ103のレンズ位置で被合成画像(n)を取得することに起因している。   In the present embodiment, as shown in FIG. 4A, the second evaluation value β at the same lens position of the focus lens 103 as the first evaluation value α (n) with respect to the optical axis direction of the camera 100. (N) is acquired. This is because the synthesized image (n) is obtained at the lens position of the focus lens 103 from which the first evaluation value α (n) has been obtained.

なお、図4は、本発明を実施した撮像装置の実施形態であるカメラ100において、フォーカスブラケット撮影中に被写体が移動してしまった場合に取得される全焦点画像と、当該全焦点画像を生成する際の各種の条件を例示的に説明する図である。図4(a)は、人物2が撮像開始当初の位置から移動することで人物2がぶれた状態の被写体距離とコントラスト評価値の関係を例示的に説明した図であって、第2の評価値β(n)を点で示し、第1の評価値α(n)を破線で示している。図4(b)は、図4(a)に図示したような条件で取得された複数の被合成画像を合成することで生成される全焦点画像を例示的に説明した図である。   Note that FIG. 4 shows an omnifocal image acquired when the subject moves during focus bracket shooting, and the omnifocal image generated in the camera 100 which is an embodiment of the imaging apparatus embodying the present invention. It is a figure explaining various conditions at the time of doing. FIG. 4A is a diagram illustrating an example of the relationship between the subject distance and the contrast evaluation value in a state where the person 2 is shaken by the person 2 moving from the initial position at which imaging starts. The value β (n) is indicated by a point, and the first evaluation value α (n) is indicated by a broken line. FIG. 4B is a diagram exemplarily illustrating an omnifocal image generated by combining a plurality of combined images acquired under the conditions illustrated in FIG.

本実施形態では、先に取得した被合成画像(n)のコントラスト情報のみに基づいて第2の評価値β(n)を取得する構成である。すなわち、第2の評価値β(n)は、フォーカススキャンをおこなわずに取得する。したがって、図4(a)で図示するように、第2の評価値β(n)は設定したフォーカス位置ごとにコントラスト評価値として取得される。   In the present embodiment, the second evaluation value β (n) is acquired based only on the contrast information of the composite image (n) acquired previously. That is, the second evaluation value β (n) is acquired without performing a focus scan. Therefore, as illustrated in FIG. 4A, the second evaluation value β (n) is acquired as a contrast evaluation value for each set focus position.

ここで、第2の評価値β(n)を取得した被合成画像(n)における被写体の合焦状態に応じて、当該第2の評価値β(n)の大きさは異なる。例えば、被合成画像中において、被写体に対して鮮明に合焦しているほど、第2の評価値は大きくなる。   Here, the magnitude of the second evaluation value β (n) varies depending on the focus state of the subject in the synthesized image (n) from which the second evaluation value β (n) has been acquired. For example, the second evaluation value increases as the subject is focused more clearly in the combined image.

なお、本実施形態では、第1の評価値α(n)を取得できるフォーカスレンズ103のレンズ位置と同一のレンズ位置をフォーカス位置として設定する構成である。したがって、第1の評価値と第2の評価値とは同一のレンズ位置で取得することができる。これに対して、第1の評価値α(n)を取得できるフォーカスレンズ103のレンズ位置とは異なる位置をフォーカス位置として設定する構成の場合は、第1の評価値と第2の評価値とは異なるレンズ位置で取得される。すなわち、第1の評価値α(n)を取得できるフォーカスレンズ103のレンズ位置と、第2の評価値β(n)を取得できるフォーカスレンズ103のレンズ位置との関係は、設定するフォーカス位置によって変化する。   In this embodiment, the same lens position as that of the focus lens 103 capable of acquiring the first evaluation value α (n) is set as the focus position. Therefore, the first evaluation value and the second evaluation value can be acquired at the same lens position. On the other hand, in the case of a configuration in which a position different from the lens position of the focus lens 103 capable of acquiring the first evaluation value α (n) is set as the focus position, the first evaluation value and the second evaluation value are Are acquired at different lens positions. That is, the relationship between the lens position of the focus lens 103 that can acquire the first evaluation value α (n) and the lens position of the focus lens 103 that can acquire the second evaluation value β (n) depends on the focus position to be set. Change.

以上説明したように、第2の評価値β(n)は、フォーカスレンズ103のレンズ位置に依らず、少なくとも第1の評価値α(n)に基づいて取得した被合成画像のコントラスト情報に基づいて取得される値である。   As described above, the second evaluation value β (n) is based on the contrast information of the composite image acquired based on at least the first evaluation value α (n) regardless of the lens position of the focus lens 103. Is the value obtained.

なお、取得した第2の評価値には、前述した第1の評価値と同様に、カメラ100の至近側から無限遠側に向けて順に番号が付与される。例えば、本実施形態では、合焦対象の被写体として人物1、人物2、木が設定されているので、これらの被写体に対応した第2の評価値がそれぞれ、β(1)、β(2)、β(3)となる。   Note that numbers are assigned to the acquired second evaluation values in order from the closest side of the camera 100 to the infinity side in the same manner as the first evaluation value described above. For example, in the present embodiment, person 1, person 2, and tree are set as the subjects to be focused on, so the second evaluation values corresponding to these subjects are β (1) and β (2), respectively. , Β (3).

次に、ステップS109で合成判定部122は、先に取得した第1の評価値α(n)と、第2の評価値β(n)とを比較して、取得した被合成画像(n)が全焦点画像を生成するために適しているか否かを判定する。以下、この詳細について説明する。   Next, in step S109, the combination determination unit 122 compares the first evaluation value α (n) acquired previously with the second evaluation value β (n), and acquires the combined image (n) acquired. Is suitable for generating an omnifocal image. The details will be described below.

フォーカスブラケット撮影をおこなう場合、フォーカスレンズ103のレンズ位置を異ならせて連続して被写体を撮像することで合焦状態が異なる複数の画像を取得する。したがって、合焦対象の被写体の撮像順に応じて、ユーザによる撮像指示から実際に撮像がおこなわれるまでの期間は変化する。特に、撮像する順序が遅い被写体は、ユーザによる撮像指示から、実際に撮像がおこなわれるまでの期間が長くなってしまう。   When focus bracket shooting is performed, a plurality of images with different in-focus states are acquired by continuously imaging a subject by changing the lens position of the focus lens 103. Therefore, the period from when the user gives an imaging instruction to when the actual imaging is performed changes according to the imaging order of the subject to be focused. In particular, for a subject whose order of imaging is slow, the period from when the user gives an imaging instruction until when the imaging is actually performed becomes long.

ここで、本実施形態では、各被合成画像において、それぞれ異なる合焦対象の被写体に合焦するように複数の被合成画像を取得している。そして、本実施形態では、各被合成画像において合焦している画素領域を抽出し、それぞれの画素領域同士を合成することで一つの全焦点画像を生成する構成である。すなわち、本実施形態の被合成画像は、画像ごとに合焦している被写体が異なる。   Here, in the present embodiment, a plurality of synthesized images are acquired so that different synthesized subjects are focused on each synthesized image. And in this embodiment, it is the structure which produces | generates one omnifocal image by extracting the pixel area | region which has focused in each to-be-combined image, and synthesize | combining each pixel area | region. In other words, the synthesized image of the present embodiment has a different subject in focus for each image.

したがって、ある被合成画像において、合焦対象の被写体がぶれてしまっている場合は、当該被合成画像を用いて生成した全焦点画像が、当該合焦対象の被写体がぶれた状態の画像となってしまう。なお、本実施形態では、被写体がぼけている状態の画像や、被写体がいびつな形状に変形した不鮮明な画像をまとめて、被写体がぶれた状態の画像と称す。   Therefore, when a subject to be focused is blurred in a certain synthesized image, an omnifocal image generated using the synthesized image is an image in which the subject to be focused is blurred. End up. In the present embodiment, an image in which the subject is blurred and an unclear image in which the subject is deformed into an irregular shape are collectively referred to as an image in which the subject is blurred.

例えば、図4(a)に図示するように、フォーカスブラケット撮影中に人物2が移動することで、当該人物2に合焦させるために取得した被合成画像(2)は、人物2がぶれた不鮮明な画像となってしまう場合がある。したがって、当該被合成画像(2)で合焦している画素領域を用いて全焦点画像を生成したとしても、図4(b)に図示するように、人物2がぶれた不自然な画像となってしまう。   For example, as illustrated in FIG. 4A, the person 2 is moved during the focus bracket shooting, so that the person 2 is blurred in the composite image (2) acquired to focus on the person 2. The image may become unclear. Therefore, even if an omnifocal image is generated using the pixel region in focus in the combined image (2), as shown in FIG. 4B, an unnatural image in which the person 2 is blurred turn into.

そこで、本実施形態では、第1の評価値α(n)と第2の評価値β(n)との差異が所定の閾値(第1の値)よりも大きいか否かを判定することで、被合成画像(n)が合焦している画素領域が、全焦点画像を生成するのに適しているか否かを判定する。そして、当該判定の結果に応じて、全焦点画像を生成する際の合成に用いる被合成画像と画素領域を設定する。   Therefore, in the present embodiment, it is determined whether or not the difference between the first evaluation value α (n) and the second evaluation value β (n) is larger than a predetermined threshold value (first value). Then, it is determined whether or not the pixel region in which the combined image (n) is in focus is suitable for generating an omnifocal image. Then, in accordance with the result of the determination, a composite image and a pixel area used for composition when generating an omnifocal image are set.

図3に戻り、ステップS109で合成判定部122は、第2の評価値β(n)を、第1の評価値α(n)で除算して算出した値(以下、移動割合を称す)が所定の割合(第1の値)γよりも大きいか否かを判定する。なお、移動割合は、撮像を指示した際の被写体の位置と、実際に撮像した被写体の位置との差異を示す値である。また、上述した所定の割合γはメモリ108に予め格納されている値である。当該所定の割合γとしては、被合成画像が全焦点画像を生成するのに適した画像であるか否かを判定できるようなものであればどのような値であってもよい。   Returning to FIG. 3, in step S <b> 109, the composition determination unit 122 calculates a value (hereinafter referred to as a movement ratio) calculated by dividing the second evaluation value β (n) by the first evaluation value α (n). It is determined whether or not it is larger than a predetermined ratio (first value) γ. The movement ratio is a value indicating the difference between the position of the subject when the imaging is instructed and the position of the actually captured subject. The predetermined ratio γ described above is a value stored in the memory 108 in advance. The predetermined ratio γ may be any value as long as it can be determined whether or not the synthesized image is an image suitable for generating an omnifocal image.

ここで、第1の評価値α(n)と第2の評価値β(n)との比較は、同一の被写体に基づいて算出したコントラスト評価値同士を用いておこなう。例えば、人物1に関する第1の評価値α(1)との比較には、被合成画像(1)に基づいて取得した第2の評価値β(1)を用いる。また、木に関する第1の評価値α(3)との比較には、被合成画像(3)に基づいて取得した第2の評価値β(3)を用いる。   Here, the comparison between the first evaluation value α (n) and the second evaluation value β (n) is performed using contrast evaluation values calculated based on the same subject. For example, the second evaluation value β (1) acquired based on the synthesized image (1) is used for comparison with the first evaluation value α (1) regarding the person 1. Further, the second evaluation value β (3) acquired based on the synthesized image (3) is used for the comparison with the first evaluation value α (3) regarding the tree.

なお、上述した移動割合を求める方法ではなく、第1の評価値α(n)と第2の評価値β(n)との差分が所定の値(第2の値)よりも大きいか否かを判定するような構成であってもよい。   In addition, it is not the method of calculating | requiring the movement ratio mentioned above, but whether the difference of 1st evaluation value (alpha) (n) and 2nd evaluation value (beta) (n) is larger than predetermined value (2nd value). It is also possible to adopt a configuration that determines the above.

次に、算出した移動割合が所定の割合γよりも大きくない(ステップS109でNO)と判定された場合(β(n)/α(n)≦γ)、ステップS110で合成判定部(第1の制御部)123は、被合成画像(n)の合成フラグ(n)を有効に設定する。すなわち、合成判定部122は、被合成画像(n)において、合焦対象の被写体がぶれていない状態であると判定する。そして、合成判定部122は、当該被合成画像(n)を、全焦点画像を生成する際に用いる画像に設定する。   Next, when it is determined that the calculated movement ratio is not greater than the predetermined ratio γ (NO in step S109) (β (n) / α (n) ≦ γ), in step S110, the combination determination unit (first Control unit) 123 sets the composite flag (n) of the composite image (n) to be valid. That is, the composition determination unit 122 determines that the subject to be focused is not blurred in the composite image (n). Then, the combination determination unit 122 sets the combined image (n) as an image used when generating an omnifocal image.

さらに、合成判定部122は、合成用に設定された被合成画像の(n)において合焦している画素領域を、全焦点画像を生成する際の合成に用いる画素領域に設定する。例えば、被合成画像(1)の合成フラグ(1)が有効に設定された場合、被合成画像(1)において最も合焦している画素領域を、全焦点画像の生成する際の合成に用いる画素領域に設定する。   Furthermore, the composition determination unit 122 sets the pixel area focused in (n) of the composition image set for composition as the pixel area used for composition when generating the omnifocal image. For example, when the synthesis flag (1) of the synthesized image (1) is set to be valid, the pixel region that is most focused on the synthesized image (1) is used for synthesis when generating the omnifocal image. Set to pixel area.

次に、移動割合が前述した所定の割合γよりも大きい(β(n)/α(n)>γ)と判定された場合(ステップS109でYES)、ステップS111で合成判定部122は、取得した被合成画像(n)の合成フラグ(n)を無効に設定する。   Next, when it is determined that the movement ratio is larger than the above-described predetermined ratio γ (β (n) / α (n)> γ) (YES in step S109), the composition determination unit 122 acquires in step S111. The composite flag (n) of the composite image (n) thus set is set to invalid.

次に、ステップS112でフォーカスブラケット制御部123は、既に撮像が完了している回数が、設定した撮像回数に達したか否かを判定する。ステップS112の処理で、撮像した回数が設定した撮像回数に達していないと判定された場合は、ステップS107に戻り、前述したステップS107〜S112の処理を繰り返す。例えば、設定された撮像回数が3回で、現在までに被合成画像(1)および被合成画像(2)を取得するための撮像が完了している場合は、被合成画像(3)を取得するために、前述したステップS107〜S112の処理を繰り返す。   Next, in step S112, the focus bracket control unit 123 determines whether or not the number of times that imaging has already been completed has reached the set number of imaging. If it is determined in step S112 that the number of times of imaging has not reached the set number of times of imaging, the process returns to step S107, and the processes of steps S107 to S112 described above are repeated. For example, when the set number of times of imaging is 3 and imaging for acquiring the synthesized image (1) and the synthesized image (2) has been completed so far, the synthesized image (3) is obtained. In order to do so, the processes of steps S107 to S112 described above are repeated.

撮像した回数が設定した撮像回数に達したと判定された場合(ステップS112でYES)は、ステップS113で合成判定部122は合成処理をおこなう。合成処理の詳細については後述する。当該合成処理が終了したら、フォーカスブラケット処理を終了する。以上が本実施形態のフォーカスブラケット処理である。   If it is determined that the number of times of imaging has reached the set number of times of imaging (YES in step S112), the synthesis determination unit 122 performs a synthesis process in step S113. Details of the synthesis process will be described later. When the compositing process ends, the focus bracket process ends. The above is the focus bracket process of the present embodiment.

以下、本実施形態の合成処理について図5を参照して説明する。図5は、本発明を実施した撮像装置の実施形態であるカメラ100の合成処理を説明するフローチャートである。ステップS201で合成判定部122は、被合成画像(1)の合成フラグが有効に設定されているか否かを判定する。ここで、前述したように、被合成画像(1)は、カメラ100に対して最も至近側の被写体(例えば、図2(b)の人物1)に合焦させるために取得する画像である。   Hereinafter, the composition processing of this embodiment will be described with reference to FIG. FIG. 5 is a flowchart for describing the composition processing of the camera 100 which is an embodiment of the imaging apparatus embodying the present invention. In step S201, the composition determination unit 122 determines whether the composition flag of the composite image (1) is set to be valid. Here, as described above, the composite image (1) is an image acquired to focus on the subject closest to the camera 100 (for example, the person 1 in FIG. 2B).

被合成画像(1)の合成フラグが有効に設定されている(ステップS201でYES)と判定された場合はステップS204に進む。また、被合成画像(1)の合成フラグが無効に設定されている(ステップS201でNO)と判定された場合はステップS202に進む。   If it is determined that the combination flag of the image to be combined (1) is set valid (YES in step S201), the process proceeds to step S204. On the other hand, if it is determined that the composite flag of the composite image (1) is set to invalid (NO in step S201), the process proceeds to step S202.

次に、ステップS202で合成判定部(第2の制御部)123は、フォーカスブラケット処理を中止する旨の警告表示を表示部109に表示させる制御をおこなう。次に、ステップS203で合成判定部122は、フォーカスブラケット処理を中止するか否かを判定する。当該警告表示は、フォーカスブラケット処理を中止するか否かをユーザに問う旨の表示である。   Next, in step S202, the composition determination unit (second control unit) 123 performs control for causing the display unit 109 to display a warning display indicating that the focus bracket process is to be stopped. Next, in step S203, the composition determination unit 122 determines whether to stop the focus bracket process. The warning display is a display for asking the user whether or not to cancel the focus bracket process.

被合成画像(1)は、一度のフォーカスブラケット処理において、ユーザによる撮像の指示から最初に取得される画像である。すなわち、被合成画像(1)は、ユーザによる撮像指示後、最初の撮像によって取得した画像である。   The composite image (1) is an image that is first acquired from an imaging instruction by the user in one focus bracket process. That is, the synthesized image (1) is an image acquired by the first imaging after the imaging instruction by the user.

以上説明したように、被合成画像(1)は、他の被合成画像と比較して、ユーザの撮像指示から最も短い時間で取得される画像である。したがって、被合成画像(1)は、他の被合成画像に比べて被写体にぶれが生じにくい画像である。   As described above, the synthesized image (1) is an image acquired in the shortest time from the user's imaging instruction as compared with other synthesized images. Therefore, the synthesized image (1) is an image in which the subject is less likely to be shaken compared to other synthesized images.

被合成画像(1)において被写体にぶれが生じている(合成フラグが無効に設定されている)場合は、当該被合成画像(1)よりも後に取得した被合成画像においても被写体にぶれが生じている確率が高い。   When the subject is blurred in the synthesized image (1) (the synthesis flag is set to invalid), the subject is also blurred in the synthesized image acquired after the synthesized image (1). There is a high probability of being.

そこで、本実施形態では、被合成画像(1)の合成フラグが無効に設定されている場合に、表示部109に警告表示をおこなう。そして、当該警告表示に対するユーザの操作に基づいて、現在のフォーカスブラケット処理を中止するか否かを判定する。この構成によって、ユーザが意図する被写体がぶれている確率が高い全焦点画像を生成するために、無駄にフォーカスブラケット処理をおこなうことを抑制することができる。   Therefore, in the present embodiment, a warning is displayed on the display unit 109 when the composite flag of the composite image (1) is set to invalid. Then, based on the user's operation on the warning display, it is determined whether or not to stop the current focus bracket process. With this configuration, it is possible to suppress unnecessary use of the focus bracket process in order to generate an omnifocal image with a high probability that the subject intended by the user is blurred.

フォーカスブラケット処理を中止する場合は、現在の合成処理を終了し次のフォーカスブラケット処理を開始する。また、フォーカスブラケット処理を中止しない場合は、ステップS204の処理に進む。   When canceling the focus bracket process, the current composition process is terminated and the next focus bracket process is started. If the focus bracket process is not canceled, the process proceeds to step S204.

次に、ステップS204でフォーカスブラケット制御部123は、現在までに完了している処理のカウント数を1に設定する(Count=1)。そして、ステップS205でフォーカスブラケット制御部123は、変数nの値を、n=Count+1に設定する(nは自然数)。例えば、ステップS204の処理を終了した直後の処理では、カウント数が1(Count=1)に設定されているので、nは2(n=2)に設定される。   Next, in step S204, the focus bracket control unit 123 sets the count number of processes completed so far to 1 (Count = 1). In step S205, the focus bracket control unit 123 sets the value of the variable n to n = Count + 1 (n is a natural number). For example, in the process immediately after the process of step S204 is completed, the count is set to 1 (Count = 1), so n is set to 2 (n = 2).

次に、ステップS206で合成判定部122は、被合成画像(n)の合成フラグが有効に設定されているか否かを判定する。被合成画像(n)の合成フラグが有効に設定されている(ステップS206でYES)と判定された場合は、ステップS208に進む。また、被合成画像(n)の合成フラグが無効に設定されている(ステップS206でNO)と判定された場合はステップS207に進む。   Next, in step S206, the composition determination unit 122 determines whether the composition flag of the composite image (n) is set to be valid. If it is determined that the composite flag of the composite image (n) is set to be valid (YES in step S206), the process proceeds to step S208. On the other hand, if it is determined that the composite flag of the composite image (n) is set to invalid (NO in step S206), the process proceeds to step S207.

次に、ステップS207で合成判定部(補償画像設定手段)123は、合成フラグが無効に設定された被合成画像(n)の代わりに、合成に用いる画素領域を抽出する補償画像を設定する。以下、上述した補償画像設定するための補償画像設定処理の詳細について図6を参照して説明する。図6は、本発明を実施した撮像装置の実施形態であるカメラ100の補償画像設定処理を説明するフローチャートである。   Next, in step S207, the synthesis determination unit (compensation image setting unit) 123 sets a compensation image for extracting a pixel region used for synthesis, instead of the synthesized image (n) in which the synthesis flag is set to invalid. Hereinafter, the details of the compensation image setting process for setting the compensation image described above will be described with reference to FIG. FIG. 6 is a flowchart for explaining a compensation image setting process of the camera 100 which is an embodiment of the imaging apparatus embodying the present invention.

本実施形態では、取得した複数の被合成画像ごとに合焦している状態の画素領域を抽出し、当該抽出した画素領域同士を合成することで全焦点画像を生成する。この場合、被合成画像ごとに抽出する画素領域は異なる。そして、異なる画素領域同士を合成することで1つの全焦点画像を生成する。   In the present embodiment, a pixel area in a focused state is extracted for each of a plurality of acquired combined images, and an omnifocal image is generated by combining the extracted pixel areas. In this case, the pixel area to be extracted is different for each composite image. Then, one omnifocal image is generated by combining different pixel regions.

本実施形態では、被合成画像(n)の合成フラグ(n)が無効に設定されている場合、当該被合成画像(n)で最も合焦している被写体に対応する画素領域は、全焦点画像を生成する際の画素領域として使用しない。例えば、被合成画像(2)の合成フラグ(2)が無効に設定されている場合を想定する。この場合、被合成画像(2)において最も合焦している被写体である人物2に対応する画素領域(2)(例えば、図4(b)に図示する点線で囲まれた領域)は、全焦点画像を生成する際の画素領域として用いない。   In the present embodiment, when the composite flag (n) of the composite image (n) is set to be invalid, the pixel region corresponding to the subject in focus in the composite image (n) is the omnifocal. It is not used as a pixel area when generating an image. For example, it is assumed that the synthesis flag (2) of the synthesized image (2) is set to invalid. In this case, the pixel area (2) corresponding to the person 2 who is the most focused subject in the synthesized image (2) (for example, the area surrounded by the dotted line shown in FIG. 4B) It is not used as a pixel area when generating a focus image.

したがって、全焦点画像を生成する際に用いる画素領域として、画素領域(2)を補償する画素領域を設定する必要がある。したがって、被合成画像(n)の合成フラグ(n)が無効に設定されている場合は、被合成画像(n)以外の被合成画像の画素領域を用いて、全焦点画像を生成する必要がある。   Therefore, it is necessary to set a pixel region that compensates for the pixel region (2) as a pixel region used when generating an omnifocal image. Therefore, when the composite flag (n) of the composite image (n) is set to invalid, it is necessary to generate an omnifocal image using the pixel area of the composite image other than the composite image (n). is there.

そこで、本実施形態では、被合成画像(n)の合成フラグが無効に設定されている場合に、当該被合成画像(n)以外の被合成画像を、全焦点画像の生成時に用いる補償画像として設定する。そして、当該補償画像の画素領域のうち、被合成画像(n)で合焦している画素領域と同じ画素領域を全焦点画像の生成に用いる。すなわち、全焦点画像を生成する際に被合成画像(n)から抽出する予定だった画素領域の代わりに、当該画素領域と同様の位置の画素領域を抽出する補償画像を設定する。   Therefore, in this embodiment, when the composite flag of the composite image (n) is set to invalid, the composite image other than the composite image (n) is used as a compensation image used when generating the omnifocal image. Set. And among the pixel areas of the compensation image, the same pixel area as the focused pixel area in the synthesized image (n) is used for generating the omnifocal image. That is, instead of the pixel region that was scheduled to be extracted from the synthesized image (n) when the omnifocal image is generated, a compensation image that extracts a pixel region at the same position as the pixel region is set.

本実施形態では、合成フラグが無効に設定されている被合成画像のフォーカス位置を基準として、所定の閾値(第3の値)以内のフォーカス位置に対応した被合成画像を補正画像として設定する。以下、この詳細について説明する。   In the present embodiment, a synthesized image corresponding to a focus position within a predetermined threshold (third value) is set as a corrected image with reference to the focus position of the synthesized image in which the synthesis flag is set to invalid. The details will be described below.

補償画像設定処理を開始すると、ステップS301でフォーカスブラケット制御部123は、補償画像を選定するための所定の閾値(第3の値)を設定する。前述したように、当該所定の閾値は、合成フラグ(n)が無効に設定されている被合成画像(n)のフォーカス位置を基準とした閾値である。なお、当該所定の閾値はフォーカス位置に関する値なので、フォーカスブラケット撮影時に設定する絞り値に応じて変化する。   When the compensation image setting process is started, the focus bracket control unit 123 sets a predetermined threshold (third value) for selecting a compensation image in step S301. As described above, the predetermined threshold value is a threshold value based on the focus position of the synthesized image (n) in which the synthesis flag (n) is set to invalid. Since the predetermined threshold value is a value related to the focus position, it changes according to the aperture value set during focus bracket shooting.

例えば、フォーカスブラケット撮影時の絞り値が、絞り値F5.6(第1の絞り値)である場合は、絞り値F11(第2の絞り値)である場合よりも、上述した所定の閾値を大きくする。これは、絞り値が大きい(絞り径が小さい)ほど、撮像時の被写界深度が深くなることに起因している。   For example, when the aperture value at the time of focus bracket shooting is the aperture value F5.6 (first aperture value), the above-described predetermined threshold is set more than when the aperture value is F11 (second aperture value). Enlarge. This is because the depth of field at the time of imaging becomes deeper as the aperture value is larger (the aperture diameter is smaller).

以上説明したように、対応するフォーカス位置が、上述した閾値以内となる被合成画像を補償画像として設定する。この構成によって、補償する画素領域において被写体のぼけが小さい被合成画像を補償画像として設定することができる。すなわち、被写体のぶれが小さい被合成画像を補償画像として設定することができる。   As described above, a composite image whose corresponding focus position is within the above-described threshold is set as a compensation image. With this configuration, it is possible to set a composite image with a small subject blur in the pixel region to be compensated as a compensation image. That is, a composite image with a small subject blur can be set as a compensation image.

次に、ステップS302でフォーカスブラケット制御部123は、被合成画像(1)のフォーカス位置が所定の閾値以内であるか否かを判定する。1度のフォーカスブラケット処理では、ユーザによる撮像開始の指示から実際に撮像が開始されるまでの期間が短いほど、被合成画像中で被写体がぶれる確率が低い。特に、1度のフォーカスブラケット処理において、最初の撮像によって取得する被合成画像(1)は、他の被合成画像よりも被写体がぶれる確率が低い。   Next, in step S302, the focus bracket control unit 123 determines whether or not the focus position of the combined image (1) is within a predetermined threshold. In one focus bracket process, the shorter the period from the user's instruction to start imaging until the actual imaging starts, the lower the probability that the subject will blur in the combined image. In particular, in one focus bracket process, the composite image (1) acquired by the first imaging has a lower probability of subject blurring than other composite images.

そこで、ステップS302の処理では、被合成画像(1)を撮像した際のフォーカス位置が、先に設定した所定の閾値以内であるか否かを判定する。   Therefore, in the process of step S302, it is determined whether or not the focus position when the composite image (1) is captured is within a predetermined threshold value set previously.

ステップS302の処理で、被合成画像(1)を撮像した際のフォーカス位置が所定の閾値以内であると判定された場合、ステップS303でフォーカスブラケット制御部123は、被合成画像(1)を被合成画像(n)の補償画像として設定する。この構成によって、被写体がぶれにくい被合成画像を補償画像として設定することができる。   If it is determined in step S302 that the focus position when the composite image (1) is captured is within a predetermined threshold, the focus bracket control unit 123 in step S303 captures the composite image (1). It is set as a compensation image for the composite image (n). With this configuration, it is possible to set a composite image in which the subject is difficult to shake as a compensation image.

次に、ステップS304でフォーカスブラケット制御部123は、取得した被合成画像のうち、被合成画像(1)以外で被合成画像(n−1)に該当する画像を取得しているか否かを判定する。すなわち、被合成画像(n)を取得するまでに、被合成画像(1)以外の被合成画像を取得しているか否かを判定する。   Next, in step S304, the focus bracket control unit 123 determines whether or not an image corresponding to the synthesized image (n−1) other than the synthesized image (1) is obtained among the obtained synthesized images. To do. That is, it is determined whether or not a composite image other than the composite image (1) has been acquired before the composite image (n) is acquired.

ステップS304の処理で、(被合成画像(1)以外に)被合成画像(n−1)を取得していると判定された場合はステップS305に進む。また、ステップS304の処理で、(被合成画像(1)以外に)被合成画像(n−1)を取得していないと判定された場合はステップS303に進む。   If it is determined in step S304 that the combined image (n−1) is acquired (in addition to the combined image (1)), the process proceeds to step S305. If it is determined in step S304 that the combined image (n-1) has not been acquired (other than the combined image (1)), the process proceeds to step S303.

次に、ステップS305でフォーカスブラケット制御部123は、取得した被合成画像(1)〜被合成画像(n−1)において、フォーカス位置が所定の閾値以内の被合成画像を判定する。ステップS305の処理で、被合成画像(1)〜被合成画像(n−1)のうち、フォーカス位置が所定の閾値以内の被合成画像が存在すると判定された場合はステップS306に進む。また、ステップS305の処理で、被合成画像(1)〜被合成画像(n−1)のうち、フォーカス位置が所定の閾値以内の被合成画像が存在しないと判定された場合はステップS303に進む。   Next, in step S305, the focus bracket control unit 123 determines a synthesized image whose focus position is within a predetermined threshold in the obtained synthesized images (1) to (n-1). If it is determined in the process of step S305 that there is a composite image having a focus position within a predetermined threshold among the composite images (1) to (n-1), the process proceeds to step S306. If it is determined in step S305 that there is no synthesized image having a focus position within a predetermined threshold among the synthesized images (1) to (n-1), the process proceeds to step S303. .

次に、ステップS306でフォーカスブラケット制御部123は、取得した被合成画像(n−1)のうち、対応するフォーカス位置が所定の閾値以内であって、撮像した(取得した)順序が最も早い画像を補償画像に設定する。例えば、被合成画像(3)の合成フラグ(3)が無効に設定されている場合であって、被合成画像(2)のフォーカス位置だけが所定の閾値以内である場合は、被合成画像(2)を補償画像に設定する。ステップS303またはステップS306の処理で、補償画像の設定が完了したら、補償画像設定処理を終了する。   Next, in step S306, the focus bracket control unit 123, among the acquired composite images (n−1), the corresponding focus position is within a predetermined threshold and the image that is captured (acquired) is the earliest. To the compensation image. For example, when the composite flag (3) of the composite image (3) is set to invalid and only the focus position of the composite image (2) is within a predetermined threshold, the composite image ( 2) is set as a compensation image. When the setting of the compensation image is completed in the process of step S303 or step S306, the compensation image setting process is terminated.

ここで、ステップS304の処理またはステップS305の処理でNOと判定された場合、所定の閾値以内のフォーカス位置で撮像することで取得した被合成画像は存在しない。この場合は、被合成画像(1)を補償画像として設定する。被合成画像(1)を補償画像に設定することで、出来るだけ被写体のぶれが少ない被合成画像を補償画像に設定することができる。すなわち、本実施形態では、少なくとも、合成フラグ(n)が無効に設定された被合成画像(n)よりも前の撮像によって取得した被合成画像を補償画像に設定する構成である。   Here, when it is determined NO in the process of step S304 or the process of step S305, there is no composite image acquired by capturing an image at a focus position within a predetermined threshold. In this case, the synthesized image (1) is set as the compensation image. By setting the combined image (1) as the compensation image, it is possible to set the combined image with as little subject blur as possible as the compensation image. That is, in the present embodiment, at least a composite image acquired by imaging before the composite image (n) in which the composite flag (n) is set to be invalid is set as a compensation image.

なお、本実施形態の補償画像の設定方法としては、上述したものに限定されるものではない。例えば、補償画像として常に被合成画像(1)を設定するような構成であってもよい。また、合成フラグが無効に設定された被合成画像(n)の前後に取得した被合成画像(被合成画像(n−1)または被合成画像(n+1))のうちの一方を、補償画像として設定するような構成であってもよい。   Note that the compensation image setting method of the present embodiment is not limited to the above-described method. For example, the composition image (1) may always be set as the compensation image. Further, one of the synthesized images (the synthesized image (n−1) or the synthesized image (n + 1)) acquired before and after the synthesized image (n) in which the synthesis flag is set to be invalid is used as a compensation image. The configuration may be set.

図5に戻り、ステップS208でフォーカスブラケット制御部123は、ステップS205で設定したカウント数に1を追加する(Count=Count+1)。そして、ステップS209でフォーカスブラケット制御部123は、現在までのカウント数が、設定した撮像回数に到達しているか否かを判定する。   Returning to FIG. 5, in step S208, the focus bracket control unit 123 adds 1 to the count set in step S205 (Count = Count + 1). In step S209, the focus bracket control unit 123 determines whether or not the number of counts up to now has reached the set number of times of imaging.

カウント数が撮像回数に到達していない(ステップS209でNO)と判定された場合は、ステップS205に戻り、残りの被合成画像についても、ステップS205〜S209の処理を繰り返す。   If it is determined that the count has not reached the number of times of imaging (NO in step S209), the process returns to step S205, and the processes in steps S205 to S209 are repeated for the remaining composite images.

カウント数が撮像回数に到達している(ステップS209でYES)と判定された場合、ステップS210で合成部124は、合成フラグが有効に設定されている被合成画像および補償画像から合成用の画素領域を抽出する。そして、合成部124は、抽出した画像領域同士を合成して全焦点画像を生成する。最後に、生成した全焦点画像をメモリ108に記録し画像合成処理を終了する。なお、生成した全焦点画像は、表示部109にレビュー表示するような構成でもよい。以上が、本実施形態の画像合成処理である。   If it is determined that the count number has reached the number of times of imaging (YES in step S209), in step S210, the combining unit 124 combines pixels from the combined image and the compensation image in which the combining flag is set to be valid. Extract regions. Then, the combining unit 124 combines the extracted image areas to generate an omnifocal image. Finally, the generated omnifocal image is recorded in the memory 108, and the image composition process ends. The generated omnifocal image may be displayed on the display unit 109 for review. The above is the image composition processing of the present embodiment.

以上説明したように、本実施形態では、第1の評価値α(n)と第2の評価値β(n)との差異が所定の閾値よりも大きいか否かを判定することで、フォーカスブラケット撮影で取得した画像が、全焦点画像を生成するために適した画像であるかを否か判定する。そして、当該判定の結果に応じて全焦点画像を生成するための合成用の被合成画像を設定する。   As described above, in the present embodiment, the focus is determined by determining whether or not the difference between the first evaluation value α (n) and the second evaluation value β (n) is larger than a predetermined threshold value. It is determined whether or not the image acquired by bracket shooting is an image suitable for generating an omnifocal image. Then, a composite image for synthesis for generating an omnifocal image is set according to the result of the determination.

この構成によって、フォーカスブラケット撮影によって被写体がぶれた状態の画像を取得したとしても、当該被写体のぶれを抑制した全焦点画像を生成することができる。したがって、本実施形態のカメラ100は、複数の被写体に合焦した状態であって、被写体のぶれの影響を抑制した画像を取得することができる。   With this configuration, even when an image in which the subject is shaken by focus bracket shooting is acquired, an omnifocal image in which the shake of the subject is suppressed can be generated. Therefore, the camera 100 of the present embodiment can acquire an image in which a plurality of subjects are in focus and the influence of subject blurring is suppressed.

また、取得した被合成画像が、全焦点画像を生成するために適した画像ではないと判定された場合は、当該被合成画像で最も合焦している被写体に対応した画素領域を補償する補償画像を設定する。そして、当該補償画像から抽出した画素領域を、全焦点画像を生成する際の画素領域として設定する。ここで、補償画像として設定する被合成画像は、少なくとも、被写体のぶれが小さい画像を用いる。以上説明した構成によって、フォーカスブラケット撮影で被写体がぶれた状態の画像を取得したとしても、被写体のぶれを抑制した全焦点画像を生成することができる。   In addition, when it is determined that the acquired composite image is not an image suitable for generating an omnifocal image, compensation is performed to compensate the pixel region corresponding to the subject that is most focused on the composite image. Set the image. Then, the pixel area extracted from the compensation image is set as the pixel area when generating the omnifocal image. Here, the composite image set as the compensation image uses at least an image with a small subject blur. With the configuration described above, an omnifocal image in which blurring of the subject is suppressed can be generated even if an image in which the subject is blurred in focus bracket shooting is acquired.

以上、本発明の好ましい実施形態について説明したが、本発明はこの実施形態に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。例えば、取得した全ての被合成画像のうち、合成フラグが無効に設定されている画像が多い場合は、ユーザ意図した被写体に適正に合焦した状態の画像を取得することは難しい。そこで、フォーカスブラケット撮影で取得した全ての被合成画像のうち、合成フラグが有効に設定された画像の割合に応じて全焦点画像を生成するか否かを判定するような構成であってもよい。例えば、取得した全ての被合成画像のうち、半数以上の合成フラグが無効に設定されている場合は、ユーザに対して現在処理中のフォーカスブラケット処理を中止し、次の処理へと移行する旨の警告表示を表示部109に表示させる。   As mentioned above, although preferable embodiment of this invention was described, this invention is not limited to this embodiment, A various deformation | transformation and change are possible within the range of the summary. For example, when there are many images in which the combination flag is set to invalid among all the acquired images to be combined, it is difficult to acquire an image in a state in which the subject intended by the user is properly focused. Therefore, it may be configured to determine whether or not to generate an omnifocal image according to the proportion of images in which the combination flag is set to be effective among all the combined images acquired by focus bracket shooting. . For example, if more than half of the acquired images to be combined are set to invalid, the focus bracket processing currently being processed is canceled for the user, and the process proceeds to the next processing. Is displayed on the display unit 109.

この構成によって、ユーザ意図した被写体に合焦している確率が低い全焦点画像を生成することなく、次のフォーカスブラケット処理に移行することができる。すなわち、効果の小さい全焦点画像を生成せずに次の処理へと移行することができる。したがって、効果の小さい全焦点画像を生成するために無駄な時間が掛ることを抑制することができる。   With this configuration, it is possible to shift to the next focus bracketing process without generating an omnifocal image with a low probability of focusing on the subject intended by the user. That is, it is possible to proceed to the next process without generating an omnifocal image with a small effect. Therefore, it is possible to suppress wasted time for generating an omnifocal image with a small effect.

なお、本実施形態では、1度のフォーカスブラケット処理において、同一の絞り値でフォーカスブラケット撮影をおこなうような構成であるが、これに限定されるものではない。例えば、被写体領域の全域をカバーするような絞り値であれば、一度のフォーカスブラケット処理中に、絞り値を変更して撮像をおこなうような構成であってもよい。例えば、最初の撮像では小絞り側の絞り値を設定して撮像することで、比較的広い領域に合焦する被合成画像を取得する。そして、それ以外の撮像時は開放側の絞り値を設定して撮像する。この構成であれば、被合成画像(1)以外の被合成画像中で被写体がぶれているような場合に、広い領域に合焦している被合成画像(1)を補償画像として設定することができる。この場合、被写体のぶれを抑制しつつ、画角内の広い領域に合焦した状態の全焦点画像を取得することができる。   In the present embodiment, the focus bracket photographing is performed with the same aperture value in one focus bracket process, but the present invention is not limited to this. For example, as long as the aperture value covers the entire subject area, the configuration may be such that imaging is performed by changing the aperture value during one focus bracketing process. For example, in the first imaging, a composite image that is focused on a relatively wide area is acquired by setting an aperture value on the small aperture side and imaging. In other cases of imaging, the aperture value on the open side is set for imaging. With this configuration, when the subject is blurred in the synthesized image other than the synthesized image (1), the synthesized image (1) focused on a wide area is set as the compensation image. Can do. In this case, it is possible to acquire an omnifocal image in a state in which a wide area within the angle of view is focused while suppressing blurring of the subject.

また、取得した被合成画像の合成フラグが無効に設定されている場合に、当該被合成画像で合焦している被写体に合焦させて、新たに被合成画像を取得するような構成であってもよい。この場合、取得した被合成画像中で被写体がぶれている場合であっても、当該被写体がぶれていない状態の被合成画像を改めて取得することができる。したがって、被写体のブレを抑制した全焦点画像を生成することができる。   In addition, when the composite flag of the acquired composite image is set to invalid, the composite image is acquired by focusing on the subject focused on the composite image. May be. In this case, even if the subject is blurred in the acquired synthesized image, it is possible to newly acquire the synthesized image in a state where the subject is not blurred. Therefore, it is possible to generate an omnifocal image in which blurring of the subject is suppressed.

また、前述した実施形態では、フォーカスブラケット撮影中に被写体が移動することで、当該被写体がぶれた状態の被合成画像を取得する場合を想定したが、これに限定されるものではない。例えば、カメラ100に加わるぶれの影響によって被写体がぶれた状態の画像を取得する場合であっても、前述したフォーカスブラケット処理および画像合成処理を実行して、被写体のぶれの影響を抑制した画像を生成することができる。ここで、カメラ100に加わるぶれ量は、角速度センサ125やジャイロセンサ126からの出力に基づいて検出する。   Further, in the above-described embodiment, it is assumed that the subject is moved during focus bracket shooting, and thus a composite image in which the subject is blurred is acquired. However, the present invention is not limited to this. For example, even when an image in which the subject is shaken due to the influence of the shake applied to the camera 100 is acquired, an image in which the influence of the shake of the subject is suppressed by executing the focus bracketing process and the image combining process described above. Can be generated. Here, the amount of blur applied to the camera 100 is detected based on outputs from the angular velocity sensor 125 and the gyro sensor 126.

なお、ユーザがメニュー操作ボタン118を操作することで、前述したフォーカスブラケット処理と画像合成処理を実行するためのモードを選択できる構成であってもよい。すなわち、ユーザによって設定されたモードに応じて、図3、図5および図6に図示した処理を実行するような構成であってもよい。   Note that the user may operate the menu operation button 118 to select a mode for executing the focus bracketing process and the image composition process described above. That is, the configuration shown in FIGS. 3, 5, and 6 may be executed in accordance with the mode set by the user.

また、前述した実施形態では、カメラ100の内部に設けられた制御部や処理部などが互いに連携して動作することによって、カメラ100の動作を制御するような構成であるが、これに限定されるものではない。前述した図3や図5、図6のフローに従ったプログラムを予めメモリ108に格納しておき、当該プログラムをCPU119が実行することで、カメラ100の動作を制御するような構成であってもよい。   In the above-described embodiment, the configuration is such that the control unit and the processing unit provided in the camera 100 operate in cooperation with each other to control the operation of the camera 100. However, the configuration is not limited thereto. It is not something. Even if the program according to the flow of FIG. 3, FIG. 5, or FIG. 6 is stored in the memory 108 in advance, and the CPU 119 executes the program, the operation of the camera 100 is controlled. Good.

また、プログラムの機能を有していれば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等、プログラムの形態を問わない。また、プログラムを供給するための記録媒体としては、例えば、ハードディスク、磁気テープ等の磁気記録媒体、光/光磁気記録媒体でもあってもよい。   Moreover, as long as it has the function of a program, it does not ask | require the form of programs, such as an object code, the program run by an interpreter, and the script data supplied to OS. The recording medium for supplying the program may be, for example, a magnetic recording medium such as a hard disk or a magnetic tape, or an optical / magneto-optical recording medium.

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

100 デジタルカメラ(撮像装置)
103 フォーカスレンズ
119 システム制御部(CPU)
120 評価値取得部(評価値取得手段)
122 合成判定部(判定手段、第1の制御手段)
100 Digital camera (imaging device)
103 Focus lens 119 System controller (CPU)
120 evaluation value acquisition unit (evaluation value acquisition means)
122 Synthesis determination unit (determination means, first control means)

Claims (15)

フォーカスレンズのレンズ位置を異ならせて連続して被写体を撮像することで、複数の被写体に合焦した状態の画像を生成するための第1の画像を取得する撮像装置であって、
前記フォーカスレンズのレンズ位置を設定するために取得した第2の画像に基づく第1の評価値と、前記第1の評価値に基づいて取得した前記第1の画像に基づく第2の評価値と、を取得する評価値取得手段と、
同一のレンズ位置で取得した前記第1の画像と前記第2の画像に基づく前記第1の評価値と前記第2の評価値との差異が第1の値よりも大きいか否かを判定する判定手段と、
前記判定手段によって、前記第1の評価値と前記第2の評価値との差異が前記第1の値よりも大きいと判定された場合に、当該第2の評価値を取得した前記第2の画像で最も合焦している被写体に対応する画素領域を、前記複数の被写体に合焦した状態の画像を生成する際の画素領域として用いないように制御する第1の制御手段と、を有することを特徴とする撮像装置。
An imaging apparatus that acquires a first image for generating an image focused on a plurality of subjects by continuously imaging subjects with different lens positions of a focus lens,
A first evaluation value based on the second image acquired to set the lens position of the focus lens, and a second evaluation value based on the first image acquired based on the first evaluation value; Evaluation value acquisition means for acquiring
It is determined whether the difference between the first evaluation value and the second evaluation value based on the first image and the second image acquired at the same lens position is larger than the first value. A determination means;
When the determination means determines that the difference between the first evaluation value and the second evaluation value is greater than the first value, the second evaluation value acquired from the second evaluation value First control means for controlling so as not to use a pixel area corresponding to the most focused subject in the image as a pixel area when generating an image focused on the plurality of subjects. An imaging apparatus characterized by that.
前記評価値取得手段は、前記第2の画像のコントラスト情報に基づいて前記第1の評価値を取得し、前記第1の画像のコントラスト情報に基づいて前記第2の評価値を取得することを特徴とする請求項1に記載の撮像装置。   The evaluation value acquisition means acquires the first evaluation value based on the contrast information of the second image, and acquires the second evaluation value based on the contrast information of the first image. The imaging apparatus according to claim 1, wherein the imaging apparatus is characterized. 第1の制御手段は、前記判定手段によって、前記第1の評価値と前記第2の評価値との差異が前記第1の値よりも大きくないと判定された場合に、当該第2の評価値を取得した前記第1の画像で最も合焦している被写体に対応した画素領域を、前記複数の被写体に合焦した状態の画像を生成する際の画素領域として用いるように制御することを特徴とする請求項1又は2に記載の撮像装置。   When the determination unit determines that the difference between the first evaluation value and the second evaluation value is not larger than the first value, the first control unit performs the second evaluation. Controlling to use a pixel area corresponding to the most focused subject in the first image from which the value is acquired as a pixel area when generating an image focused on the plurality of subjects. The imaging apparatus according to claim 1, wherein the imaging apparatus is characterized. 前記判定手段は、前記評価値取得手段によって取得した前記第2の評価値を前記第1の評価値で除算した値が所定の割合よりも大きいか否かを判定することを特徴とする請求項1乃至3の何れか一項に記載の撮像装置。   The determination means determines whether or not a value obtained by dividing the second evaluation value acquired by the evaluation value acquisition means by the first evaluation value is larger than a predetermined ratio. The imaging device according to any one of 1 to 3. 前記判定手段は、前記第1の評価値と前記第2の評価値との差分が第2の値よりも大きいか否かを判定することを特徴とする請求項1乃至3の何れか一項に記載の撮像装置。   The said determination means determines whether the difference of the said 1st evaluation value and the said 2nd evaluation value is larger than a 2nd value. The imaging device described in 1. 前記判定手段によって、前記第1の評価値と前記第2の評価値との差異が前記第1の値よりも大きくないと判定された場合に、当該第2の評価値を取得した前記第1の画像の画素領域を合成することで、前記複数の被写体に合焦した状態の画像を生成する合成手段を有することを特徴とする請求項1乃至5の何れか一項に記載の撮像装置。   When the determination means determines that the difference between the first evaluation value and the second evaluation value is not greater than the first value, the first evaluation value acquired from the first evaluation value 6. The imaging apparatus according to claim 1, further comprising: a combining unit configured to generate an image focused on the plurality of subjects by combining pixel regions of the image. 前記合成手段は、前記第1の画像ごとに異なる画素領域を合成に用いることを特徴とする請求項6に記載の撮像装置。   The imaging apparatus according to claim 6, wherein the synthesizing unit uses a different pixel area for each of the first images for synthesis. 前記判定手段によって前記第1の評価値と前記第2の評価値との差異が前記第1の値よりも大きいと判定された場合に、当該第2の評価値を取得した前記第1の画像において最も合焦している被写体に対応した画素領域を補償する補償画像を、当該第1の画像とは異なる前記第1の画像の中から設定する補償画像設定手段を有することを特徴とする請求項1乃至7の何れか一項に記載の撮像装置。   The first image obtained by acquiring the second evaluation value when the determination unit determines that the difference between the first evaluation value and the second evaluation value is larger than the first value. And a compensation image setting means for setting a compensation image for compensating a pixel region corresponding to the most focused subject in the first image different from the first image. Item 8. The imaging device according to any one of Items 1 to 7. 前記補償画像設定手段は、取得した前記第1の画像のうち、一度の連続した撮像において、撮像された順序が最も早い画像を前記補償画像に設定することを特徴とする請求項8に記載の撮像装置。   9. The compensation image setting unit according to claim 8, wherein, among the acquired first images, the image having the earliest image capturing order is set as the compensation image in one continuous image capturing. Imaging device. 前記補償画像設定手段は、取得した前記第1の画像のうち、前記フォーカスレンズのレンズ位置が前記第2の評価値を取得した前記フォーカスレンズのレンズ位置を基準とした所定の範囲内となる画像を前記補償画像に設定することを特徴とする請求項8又は9に記載の撮像装置。   The compensation image setting means is an image in which the lens position of the focus lens is within a predetermined range based on the lens position of the focus lens from which the second evaluation value is acquired, among the acquired first images. The imaging apparatus according to claim 8 or 9, wherein is set to the compensation image. 前記複数の被写体に合焦した状態の画像の生成を中止する旨の警告表示を表示手段に表示させる制御をおこなう第2の制御手段を有し、
前記第2の制御手段は、取得した前記第1の画像のうちで最初に取得した画像に基づいて取得した前記第2の評価値が、前記判定手段によって前記第1の評価値との差異が前記第1の値よりも大きいと判定された場合に、前記表示手段に前記警告表示させる制御をおこなうことを特徴とする請求項1乃至10の何れか一項に記載の撮像装置。
A second control unit that performs control to display on the display unit a warning display to the effect that generation of an image focused on the plurality of subjects is stopped;
The second control means determines that the second evaluation value acquired based on the first acquired image among the acquired first images is different from the first evaluation value by the determination means. The imaging apparatus according to any one of claims 1 to 10, wherein when it is determined that the value is larger than the first value, the warning is displayed on the display unit.
複数の被写体に合焦した状態の画像を生成するために、フォーカスレンズのレンズ位置を異ならせて連続して被写体を撮像することで第1の画像を取得する撮像装置であって、
前記フォーカスレンズのレンズ位置を設定するために取得した第2の画像に基づく第1の評価値と、前記第1の評価値に基づく前記フォーカスレンズのレンズ位置で撮像することによって取得した前記第1の画像に基づく第2の評価値と、を取得する評価値取得手段と、
前記第1の評価値と、当該第1の評価値に基づいて取得した前記第2の評価値との差異が第1の値よりも大きいか否かを判定する判定手段と、
前記判定手段によって前記第1の評価値と前記第2の評価値との差異が前記第1の値よりも大きいと判定された場合は、前記第2の画像で最も合焦している被写体の画素領域を、前記複数の被写体に合焦した状態の画像を生成する際の画素領域として用いないように制御する第1の制御手段と、を有することを特徴とする撮像装置。
An imaging device that acquires a first image by continuously imaging a subject with different lens positions of a focus lens in order to generate an image focused on a plurality of subjects,
The first evaluation value acquired based on the second image acquired to set the lens position of the focus lens and the first acquired by imaging at the lens position of the focus lens based on the first evaluation value. Evaluation value acquisition means for acquiring a second evaluation value based on the image of
Determining means for determining whether or not a difference between the first evaluation value and the second evaluation value acquired based on the first evaluation value is larger than the first value;
When the determination means determines that the difference between the first evaluation value and the second evaluation value is larger than the first value, the most focused subject in the second image An image pickup apparatus comprising: a first control unit configured to control a pixel area so as not to be used as a pixel area when generating an image focused on the plurality of subjects.
フォーカスレンズのレンズ位置を異ならせて連続して被写体を撮像することで、複数の被写体に合焦した状態の画像を生成するための合成用の画像を取得する撮像装置の制御方法であって、
前記フォーカスレンズのレンズ位置を設定するために取得した第2の画像に基づく第1の評価値と、前記第1の評価値に基づいて取得した前記第1の画像に基づく第2の評価値と、を取得する評価値取得工程と、
同一のレンズ位置で取得した前記第1の画像と前記第2の画像に基づく前記第1の評価値と前記第2の評価値との差異が第1の値よりも大きいか否かを判定する判定工程と、
前記判定工程によって、前記第1の評価値と前記第2の評価値との差異が前記第1の値よりも大きいと判定された場合に、当該第2の評価値を取得した前記第2の画像で最も合焦している被写体に対応する画素領域を、前記複数の被写体に合焦した状態の画像を生成する際の画素領域として用いないように制御する第1の制御工程と、を有することを特徴とする撮像装置の制御方法。
A method of controlling an imaging apparatus that acquires a composite image for generating an image focused on a plurality of subjects by continuously imaging subjects with different lens positions of a focus lens,
A first evaluation value based on the second image acquired to set the lens position of the focus lens, and a second evaluation value based on the first image acquired based on the first evaluation value; , Obtaining an evaluation value, and
It is determined whether the difference between the first evaluation value and the second evaluation value based on the first image and the second image acquired at the same lens position is larger than the first value. A determination process;
When it is determined by the determination step that the difference between the first evaluation value and the second evaluation value is larger than the first value, the second evaluation value is acquired. A first control step for controlling not to use a pixel region corresponding to a subject that is most in focus in the image as a pixel region when generating an image focused on the plurality of subjects. And a method of controlling the imaging apparatus.
複数の被写体に合焦した状態の画像を生成するために、フォーカスレンズのレンズ位置を異ならせて連続して被写体を撮像することで第1の画像を取得する撮像装置の制御方法であって、
前記フォーカスレンズのレンズ位置を設定するために取得した第2の画像に基づく第1の評価値と、前記第1の評価値に基づく前記フォーカスレンズのレンズ位置で撮像することによって取得した前記第1の画像に基づく第2の評価値と、を取得する評価値取得工程と、
前記第1の評価値と、当該第1の評価値に基づいて取得した前記第2の評価値との差異が第1の値よりも大きいか否かを判定する判定工程と、
前記判定工程によって前記第1の評価値と前記第2の評価値との差異が前記第1の値よりも大きいと判定された場合は、前記第2の画像で最も合焦している被写体の画素領域を、前記複数の被写体に合焦した状態の画像を生成する際の画素領域として用いないように制御する第1の制御工程と、を有することを特徴とする撮像装置の制御方法。
A method for controlling an imaging apparatus that acquires a first image by continuously imaging a subject with different lens positions of a focus lens in order to generate an image focused on a plurality of subjects,
The first evaluation value acquired based on the second image acquired to set the lens position of the focus lens and the first acquired by imaging at the lens position of the focus lens based on the first evaluation value. A second evaluation value based on the image of the evaluation value acquisition step of acquiring,
A determination step of determining whether or not a difference between the first evaluation value and the second evaluation value acquired based on the first evaluation value is larger than the first value;
If it is determined in the determination step that the difference between the first evaluation value and the second evaluation value is larger than the first value, the most focused subject in the second image is determined. And a first control step for controlling the pixel area not to be used as a pixel area when generating an image focused on the plurality of subjects.
請求項13又は14に記載の撮像装置の制御方法をコンピュータで実行させるためのコンピュータで読み取り可能なプログラム。   15. A computer-readable program for causing a computer to execute the control method for an imaging apparatus according to claim 13 or 14.
JP2014153295A 2014-07-28 2014-07-28 Imaging apparatus, control method and program Pending JP2016032180A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014153295A JP2016032180A (en) 2014-07-28 2014-07-28 Imaging apparatus, control method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014153295A JP2016032180A (en) 2014-07-28 2014-07-28 Imaging apparatus, control method and program

Publications (1)

Publication Number Publication Date
JP2016032180A true JP2016032180A (en) 2016-03-07

Family

ID=55442330

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014153295A Pending JP2016032180A (en) 2014-07-28 2014-07-28 Imaging apparatus, control method and program

Country Status (1)

Country Link
JP (1) JP2016032180A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113163114A (en) * 2021-03-29 2021-07-23 无锡闻泰信息技术有限公司 Image focusing method, device, equipment and medium
WO2021152933A1 (en) * 2020-01-31 2021-08-05 富士フイルム株式会社 Imaging device, operation method for imaging device, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021152933A1 (en) * 2020-01-31 2021-08-05 富士フイルム株式会社 Imaging device, operation method for imaging device, and program
CN113163114A (en) * 2021-03-29 2021-07-23 无锡闻泰信息技术有限公司 Image focusing method, device, equipment and medium

Similar Documents

Publication Publication Date Title
JP5036599B2 (en) Imaging device
KR20100039430A (en) Image processor, image processing method, digital camera, and imaging apparatus
JP2007043637A (en) Image pick-up apparatus, image pick-up program, and image processing program
JP2006033241A (en) Image pickup device and image acquiring means
JP6391304B2 (en) Imaging apparatus, control method, and program
JP7086571B2 (en) Image pickup device, lens device and control method thereof
JP6634298B2 (en) Imaging device and imaging method
JP2016143022A (en) Imaging device and imaging method
JP2015231118A (en) Image composition device, image composition system and image composition method
JP2018101951A (en) Imaging device, imaging method, and program for computer
US10412321B2 (en) Imaging apparatus and image synthesis method
JP2015204470A (en) Imaging apparatus, control method thereof, and program
JP6608194B2 (en) Image processing apparatus, control method therefor, and program
US20160012562A1 (en) Image processing apparatus and image processing method
JP6758950B2 (en) Imaging device, its control method and program
JP2009302794A (en) Imaging apparatus
JP7169773B2 (en) IMAGING DEVICE, CONTROL METHOD THEREOF, AND PROGRAM
JP2016032180A (en) Imaging apparatus, control method and program
JP2013192121A (en) Imaging apparatus and imaging method
JP2016076747A (en) Imaging apparatus, camera system, control method and program
JP2015233211A (en) Imaging apparatus, control method thereof, and program
JP5062095B2 (en) Imaging device
JP6429497B2 (en) Imaging apparatus, control method, and program
JP6257186B2 (en) Imaging apparatus, imaging method, and program
JP2015232620A (en) Imaging device, control method and program