[go: up one dir, main page]

JP2018061231A - Imaging apparatus, imaging method, and program - Google Patents

Imaging apparatus, imaging method, and program Download PDF

Info

Publication number
JP2018061231A
JP2018061231A JP2017126241A JP2017126241A JP2018061231A JP 2018061231 A JP2018061231 A JP 2018061231A JP 2017126241 A JP2017126241 A JP 2017126241A JP 2017126241 A JP2017126241 A JP 2017126241A JP 2018061231 A JP2018061231 A JP 2018061231A
Authority
JP
Japan
Prior art keywords
focus position
imaging
image
captured
images
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2017126241A
Other languages
Japanese (ja)
Other versions
JP6929145B2 (en
Inventor
鈴木 孝幸
Takayuki Suzuki
孝幸 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Publication of JP2018061231A publication Critical patent/JP2018061231A/en
Application granted granted Critical
Publication of JP6929145B2 publication Critical patent/JP6929145B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Focusing (AREA)
  • Details Of Cameras Including Film Mechanisms (AREA)
  • Automatic Focus Adjustment (AREA)
  • Adjustment Of Camera Lenses (AREA)
  • Studio Devices (AREA)

Abstract

【課題】 ピント位置を変化させて撮像した複数の画像を用いて合成するとき、手振れなどにより、合成画像にぼける領域が出ることがある。【解決手段】 撮像装置は、撮像手段と、複数の目標ピント位置の設定を行う設定手段と、ピント位置の算出手段と、を有し、前記撮像手段は、前記目標ピント位置に応じた複数の画像を撮像し、前記算出手段は、前記複数の画像のそれぞれが撮像されたときの、被写体に対するピント位置を算出し、前記設定手段は、前記目標ピント位置と、算出されたピント位置との比較結果に応じて、前記目標ピント位置の少なくとも一部を再設定することを特徴とする。【選択図】 図5PROBLEM TO BE SOLVED: To obtain a blurred region in a composite image due to camera shake or the like when synthesizing a plurality of images captured by changing the focus position. An image pickup apparatus includes an image pickup means, a setting means for setting a plurality of target focus positions, and a focus position calculation means, and the image pickup means has a plurality of means according to the target focus position. The image is captured, the calculation means calculates the focus position with respect to the subject when each of the plurality of images is captured, and the setting means compares the target focus position with the calculated focus position. It is characterized in that at least a part of the target focus position is reset according to the result. [Selection diagram] Fig. 5

Description

本発明は、画像合成を行う撮像装置に関するものである。   The present invention relates to an imaging apparatus that performs image composition.

カメラからの距離が異なる複数の被写体を撮像する場合、あるいは、奥行き方向に長い被写体を撮像する場合に、撮像光学系における被写界深度が足りないために、被写体の一部にしかピントを合わせられない場合がある。   When shooting multiple subjects with different distances from the camera, or when shooting subjects that are long in the depth direction, the depth of field in the imaging optical system is insufficient. It may not be possible.

そこで、ピント位置を変化させて複数の画像を撮像し、各画像から合焦している領域のみを抽出して1枚の画像を合成して撮像領域全体に合焦している合成画像を生成する技術(以下、深度合成という)が知られている(特許文献1を参照)。この深度合成の技術を用いることで、意図する被写体の全体に対してピントを合わせた画像を得ることができる。   Therefore, a plurality of images are picked up by changing the focus position, only a focused area is extracted from each image, and a single image is synthesized to generate a composite image focused on the entire imaging area. Technology (hereinafter referred to as depth synthesis) is known (see Patent Document 1). By using this depth synthesis technique, it is possible to obtain an image in which the entire intended subject is in focus.

特開2002−84444号公報JP 2002-84444 A

しかしながら、深度合成の技術を用いて撮像する場合、手振れなどが発生すると、以下の課題が生じることがある。   However, when imaging is performed using the technique of depth synthesis, the following problems may occur when camera shake or the like occurs.

図13は、深度合成における手振れを説明するための図である。図13(a)は理想的な深度合成を用いる撮像を説明するための図である。図13(a)では、ユーザがデジタルカメラを1301に置き、所定の距離1302ずつピント位置を移動させながら複数回撮像を行う。   FIG. 13 is a diagram for explaining camera shake in depth synthesis. FIG. 13A is a diagram for explaining imaging using ideal depth synthesis. In FIG. 13A, the user places the digital camera on 1301, and performs imaging a plurality of times while moving the focus position by a predetermined distance 1302.

図13(b)は図13(a)での撮像において、3枚目の画像を撮像するとき、手振れが発生してしまった場合を示す。撮像位置1301が光軸方向で後方にずれたことで、本来撮像されるべき距離よりも近い位置にピント位置が来る。さらに、図13(c)のように、4枚目の画像を撮像するとき、図13(b)の手振れの方向と反対する方向へ手振れが発生してしまった場合を示す。この場合4枚目の画像は本来撮像されるべきピント位置よりも遠くなっている。図13(c)で撮像された複数の画像を用いて合成処理を行うと、領域1303において合焦している画像が存在せず、合成画像にはぼけた部分が残ってしまう。   FIG. 13B shows a case where camera shake has occurred when the third image is captured in the imaging in FIG. Since the imaging position 1301 is shifted rearward in the optical axis direction, the focus position comes closer to the distance that should be originally captured. Further, as shown in FIG. 13C, when a fourth image is captured, a case where camera shake occurs in a direction opposite to the direction of camera shake in FIG. 13B is shown. In this case, the fourth image is farther from the focus position that should be captured. When combining processing is performed using a plurality of images captured in FIG. 13C, there is no focused image in the region 1303, and a blurred portion remains in the combined image.

本発明は、以上の課題を鑑みてなされたもので、ピント位置を変化させて撮像した複数の画像を用いて合成するとき、手振れなどによるぼけを低減させる合成画像を生成できる撮像装置を提供することが目的とする。   The present invention has been made in view of the above problems, and provides an imaging device capable of generating a composite image that reduces blurring due to camera shake or the like when combining using a plurality of images captured by changing the focus position. The purpose.

本発明は、撮像手段と、複数の目標ピント位置の設定を行う設定手段と、ピント位置の算出手段と、を有し、前記撮像手段は、前記目標ピント位置に応じた複数の画像を撮像し、前記算出手段は、前記複数の画像のそれぞれが撮像されたときの、被写体に対するピント位置を算出し、前記設定手段は、前記目標ピント位置と、算出されたピント位置との比較結果に応じて、前記目標ピント位置の少なくとも一部を再設定することを特徴とする撮像装置を提供する。   The present invention includes an imaging unit, a setting unit that sets a plurality of target focus positions, and a calculation unit for the focus position, and the imaging unit captures a plurality of images according to the target focus position. The calculation unit calculates a focus position with respect to the subject when each of the plurality of images is captured, and the setting unit determines whether the target focus position is compared with the calculated focus position. An imaging apparatus is provided, wherein at least a part of the target focus position is reset.

本発明によれば、ピント位置を変化させて撮像した複数の画像を用いて合成するとき、手振れなどによるぼけを低減させる合成画像を生成できる。   According to the present invention, when combining using a plurality of images picked up by changing the focus position, it is possible to generate a combined image that reduces blur due to camera shake or the like.

本発明の第1の実施形態の撮像装置の一例としてのデジタルカメラの外観図である。1 is an external view of a digital camera as an example of an imaging apparatus according to a first embodiment of the present invention. 本発明の実施形態に係るデジタルカメラの構造を示すブロック図である。It is a block diagram which shows the structure of the digital camera which concerns on embodiment of this invention. 第1の実施形態のセンサのアレイを説明するための図である。It is a figure for demonstrating the array of the sensor of 1st Embodiment. 第1の実施形態における光信号の画素への入射を説明するための図である。It is a figure for demonstrating incidence | injection to the pixel of the optical signal in 1st Embodiment. 第1の実施形態における深度合成の処理を説明するためのフローチャートである。It is a flowchart for demonstrating the process of the depth synthetic | combination in 1st Embodiment. 第1の実施形態における撮像画像評価処理を説明するフローチャートである。It is a flowchart explaining the captured image evaluation process in 1st Embodiment. 第1の実施形態におけるピント位置の補正を説明するためのフローチャートである。5 is a flowchart for explaining correction of a focus position in the first embodiment. 第1の実施形態におけるピント位置の変化量補正を説明するための図である。It is a figure for demonstrating the variation | change_quantity correction | amendment of a focus position in 1st Embodiment. 第2の実施形態におけるデジタル一眼レフカメラの構造を説明するための図である。It is a figure for demonstrating the structure of the digital single-lens reflex camera in 2nd Embodiment. 第2の実施形態における深度合成の処理を説明するためのフローチャートである。It is a flowchart for demonstrating the process of the depth synthetic | combination in 2nd Embodiment. 第3の実施形態における深度合成の処理を説明するためのフローチャートである。It is a flowchart for demonstrating the process of the depth synthetic | combination in 3rd Embodiment. 第3の実施形態におけるコントラスト値の解析を説明するための図である。It is a figure for demonstrating the analysis of the contrast value in 3rd Embodiment. 深度合成における手振れを説明するための図である。It is a figure for demonstrating the camera shake in depth composition.

以下では、添付の図面を参照しながら、本発明の好適な実施形態について詳細に説明する。なお、以下の説明では、デジタルカメラを例にあげて説明を行うが、ピント位置の調整ができる撮像装置を用いれば、本発明を適用することができる。   Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following description, a digital camera will be described as an example, but the present invention can be applied if an imaging apparatus capable of adjusting the focus position is used.

(第1の実施形態)
図1は、本実施形態の撮像装置の一例としてのデジタルカメラの外観図である。モニタ101は画像や各種情報を表示する。シャッターボタン102は撮像指示を行うために設けられる。モード切り替えスイッチ103は各種モードを切り替えるために設けられる。コネクタ104は接続ケーブル105とデジタルカメラとを接続する。コントローラーホイール106は回転操作可能な操作部材である。スイッチ107は電源スイッチであり、電源オン、電源オフを切り替える。メモリカード108は記録媒体である。スロット109はメモリカード108を格納するためのスロットである。スロット109に格納されたメモリカード108は、デジタルカメラの本体との通信が可能である。蓋110はスロット109の蓋である。
(First embodiment)
FIG. 1 is an external view of a digital camera as an example of the imaging apparatus of the present embodiment. The monitor 101 displays images and various information. The shutter button 102 is provided for performing an imaging instruction. A mode switch 103 is provided for switching various modes. The connector 104 connects the connection cable 105 and the digital camera. The controller wheel 106 is an operation member that can be rotated. A switch 107 is a power switch, and switches between power on and power off. The memory card 108 is a recording medium. The slot 109 is a slot for storing the memory card 108. The memory card 108 stored in the slot 109 can communicate with the main body of the digital camera. The lid 110 is a lid of the slot 109.

図2は本実施形態に係るデジタルカメラの構造を示すブロック図である。デジタルカメラ200は、静止画を撮像することができ、かつ、ピント位置の情報を記録し、コントラスト値の算出および画像の合成が可能なものである。さらに、デジタルカメラ200は、撮像して保存した画像、または、外部から入力した画像に対して、拡大処理または縮小処理を行うことができる。   FIG. 2 is a block diagram showing the structure of the digital camera according to this embodiment. The digital camera 200 can capture a still image, records information on a focus position, and can calculate a contrast value and synthesize an image. Furthermore, the digital camera 200 can perform an enlargement process or a reduction process on an image captured and stored or an image input from the outside.

制御部201は、例えばCPUやMPUなどのシグナルプロセッサであり、予め後述するROM205に内蔵されたプログラムを読み出しながら、デジタルカメラ200の各部分を制御する。たとえば、後述するように、制御部201が、後述する撮像部204に対して撮像の開始と終了について指令を出す。または、後述する画像処理部207に対して、予め用意された設定に基づいて、画像処理の指令を出す。ユーザによる指令は、後述する操作部210によってデジタルカメラ200に入力され、制御部201を通して、デジタルカメラ200の各部分に達する。   The control unit 201 is a signal processor such as a CPU or MPU, for example, and controls each part of the digital camera 200 while reading a program built in the ROM 205 described later in advance. For example, as will be described later, the control unit 201 instructs the imaging unit 204 described later to start and end imaging. Alternatively, an image processing command is issued to an image processing unit 207, which will be described later, based on settings prepared in advance. A command from the user is input to the digital camera 200 by an operation unit 210 described later, and reaches each part of the digital camera 200 through the control unit 201.

駆動部202は、モーターなどによって構成され、制御部201の指令の下で、後述する光学系203を機械的に動作させる。たとえば、制御部201の指令に基づいて、駆動部202が光学系203に含まれるフォーカスレンズの位置を移動させ、光学系203の焦点距離を調整する。   The drive unit 202 is configured by a motor or the like, and mechanically operates an optical system 203 described later under a command from the control unit 201. For example, based on a command from the control unit 201, the driving unit 202 moves the position of the focus lens included in the optical system 203 and adjusts the focal length of the optical system 203.

光学系203は、ズームレンズ、フォーカスレンズ、および絞りなどにより構成される。絞りは、透過する光量を調整する機構である。レンズの位置を変えることによって、ピント位置を変えることができる。ただし、ここでいう「ピント位置」は、特に説明がなければ、被写体を基準にして定義されるものである。   The optical system 203 includes a zoom lens, a focus lens, a diaphragm, and the like. The diaphragm is a mechanism that adjusts the amount of transmitted light. The focus position can be changed by changing the lens position. However, the “focus position” here is defined based on the subject unless otherwise specified.

撮像部204は、光電変換素子であり、入射された光信号を電気信号に変換する光電変換を行うものである。たとえば、撮像部204に、CCDやCMOSセンサなどを適用することができる。撮像部の構造について、詳細は後述する。撮像部204は、動画撮像モードを設け、時間的に連続する複数の画像を動画の各々のフレームとして、撮像することができる。   The imaging unit 204 is a photoelectric conversion element, and performs photoelectric conversion that converts an incident optical signal into an electrical signal. For example, a CCD or a CMOS sensor can be applied to the imaging unit 204. Details of the structure of the imaging unit will be described later. The imaging unit 204 is provided with a moving image capturing mode, and can capture a plurality of temporally continuous images as each frame of the moving image.

ROM205は、記録媒体としての読み出し専用の不揮発性メモリであり、デジタルカメラ200が備える各ブロックの動作プログラムに加え、各ブロックの動作に必要なパラメータ等を記憶している。RAM206は、書き換え可能な揮発性メモリであり、デジタルカメラ200が備える各ブロックの動作において出力されたデータの一時的な記憶領域として用いられる。   The ROM 205 is a read-only nonvolatile memory as a recording medium, and stores parameters necessary for the operation of each block in addition to the operation program for each block provided in the digital camera 200. The RAM 206 is a rewritable volatile memory, and is used as a temporary storage area for data output in the operation of each block included in the digital camera 200.

画像処理部207は、撮像部204から出力された画像、あるいは後述する内蔵メモリ209に記録されている画像信号のデータに対して、ホワイトバランス調整、色補間、フィルタリングなど、様々な画像処理を行う。また、撮像部204が撮像した画像信号のデータに対して、JPEGなどの規格で、圧縮処理を行う。   The image processing unit 207 performs various image processing, such as white balance adjustment, color interpolation, and filtering, on the image output from the imaging unit 204 or image signal data recorded in the internal memory 209 described later. . In addition, compression processing is performed on the data of the image signal captured by the imaging unit 204 according to a standard such as JPEG.

画像処理部207は、特定の処理を行う回路を集めた集積回路(ASIC)で構成される。あるいは、制御部201がROM205から読み出したプログラムに従って処理することで、制御部201が画像処理部207の機能の一部または全部を兼用するようにしてもよい。制御部201が画像処理部207の全ての機能を兼用する場合には、画像処理部207をハードウェアとして有する必要はなくなる。   The image processing unit 207 includes an integrated circuit (ASIC) that collects circuits for performing specific processing. Alternatively, the control unit 201 may perform a part of or all of the functions of the image processing unit 207 by performing processing according to a program read from the ROM 205. When the control unit 201 has all the functions of the image processing unit 207, it is not necessary to have the image processing unit 207 as hardware.

表示部208は、RAM206に一時保存されている画像、または、後述する内蔵メモリ209に保存されている画像、あるいは、デジタルカメラ200の設定画面などを表示するための液晶ディスプレイや有機ELディスプレイなどである。図1におけるモニタ101は、表示部208に該当する。   The display unit 208 is a liquid crystal display or an organic EL display for displaying an image temporarily stored in the RAM 206, an image stored in an internal memory 209 described later, a setting screen of the digital camera 200, or the like. is there. The monitor 101 in FIG. 1 corresponds to the display unit 208.

内蔵メモリ209は、撮像部204が撮像した画像や画像処理部207の処理を得た画像、および、画像撮像時のピント位置の情報などを記録する場所である。また、内蔵メモリの代わりに、図1のように、メモリカード108などを用いてもよい。   The built-in memory 209 is a place where an image captured by the image capturing unit 204, an image obtained by the processing of the image processing unit 207, information on a focus position at the time of image capturing, and the like are recorded. Further, instead of the built-in memory, a memory card 108 or the like may be used as shown in FIG.

操作部210は、たとえば、デジタルカメラ200につけるボタンやスイッチ、キー、モードダイアルなど、あるいは、表示部208に兼用されるタッチパネルなどである。ユーザによる指令は、操作部210を経由して、制御部201に達する。図1におけるシャッターボタン102、モード切り替えスイッチ103、コントローラーホイール106およびスイッチ107は操作部210に該当する。   The operation unit 210 is, for example, a button, switch, key, mode dial, or the like attached to the digital camera 200 or a touch panel that is also used as the display unit 208. A command from the user reaches the control unit 201 via the operation unit 210. The shutter button 102, the mode switch 103, the controller wheel 106, and the switch 107 in FIG.

図3は、本実施形態における撮像部204を構成するセンサのアレイを説明するための図である。図3(a)では、画素300は、互いに独立に光信号を読み取れる光電変換部301と302の2つを有することを示す。ただし、それぞれの画素は、3つ以上の光電変換部を有する構造でもよい。たとえば、図3(b)では、画素310は、光電変換部311乃至314の4つを有する構造を示す。以下の記述では、1つの画素が2つの光電変換部を有する構造に基づいて説明する。   FIG. 3 is a diagram for explaining an array of sensors constituting the imaging unit 204 in the present embodiment. FIG. 3A shows that the pixel 300 includes two photoelectric conversion units 301 and 302 that can read an optical signal independently of each other. However, each pixel may have a structure having three or more photoelectric conversion units. For example, FIG. 3B illustrates a structure in which the pixel 310 includes four photoelectric conversion units 311 to 314. In the following description, a description will be given based on a structure in which one pixel has two photoelectric conversion units.

図4は、本実施形態において、光信号の画素への入射を説明するための図である。   FIG. 4 is a diagram for explaining the incidence of an optical signal on a pixel in the present embodiment.

図4では、画素アレイ401には、マイクロレンズ402と、カラーフィルタ403と、光電変換部404と405とがある。光電変換部404と405とは、同じ画素に属し、マイクロレンズ402とカラーフィルタ403に対応する。この図4はデジタルカメラを上から見た図であって、1つの画素に対応する2つの光電変換部404と405が左右に並んで配置されていることを示している。射出瞳406から出る光束のうち、光軸409を境にして、上側の光束(領域407からの光束に相当)は光電変換部405に入射し、下側の光束(領域408からの光束に相当)は光電変換部404に入射する。つまり、光電変換部404と405とはそれぞれ撮像レンズの射出瞳の異なる領域の光を受光している。ここで光電変換部404が受光した信号をA像、光電変換部405で受光した信号をB像とすると、制御部201は、A像とB像の位相差に基づいて焦点ズレ量を算出でき、距離情報を取得することができる。   In FIG. 4, the pixel array 401 includes a microlens 402, a color filter 403, and photoelectric conversion units 404 and 405. The photoelectric conversion units 404 and 405 belong to the same pixel and correspond to the microlens 402 and the color filter 403. FIG. 4 is a top view of the digital camera, and shows that two photoelectric conversion units 404 and 405 corresponding to one pixel are arranged side by side. Out of the luminous flux emitted from the exit pupil 406, the upper luminous flux (corresponding to the luminous flux from the region 407) enters the photoelectric conversion unit 405 with the optical axis 409 as a boundary, and the lower luminous flux (corresponding to the luminous flux from the region 408). ) Enters the photoelectric conversion unit 404. That is, the photoelectric conversion units 404 and 405 receive light in different areas of the exit pupil of the imaging lens. Here, when the signal received by the photoelectric conversion unit 404 is an A image and the signal received by the photoelectric conversion unit 405 is a B image, the control unit 201 can calculate the amount of defocus based on the phase difference between the A image and the B image. , Distance information can be acquired.

図5は、本実施形態における深度合成の処理を説明するためのフローチャートである。   FIG. 5 is a flowchart for explaining the process of depth synthesis in this embodiment.

ユーザの指令が操作部210を経て制御部201に達すると、深度合成の処理が始まる。制御部201はステップS501で、デジタルカメラ200の被写体深度に基づいて1枚目の画像を撮像するときのピント位置と、2枚目以降の画像を撮像するときの画像間のピント位置の変化量、および撮像枚数を設定する。これらの値により複数のピント位置が演算され、設定される。次に制御部201はステップS502で光学系203を構成するレンズを移動させて、デジタルカメラ200のピント位置を変化させる。1枚目であれば予め設定したピント位置となるようにレンズを移動させ、2枚目以降であれば、予め設定したピント位置のうち、撮像が済んでいないピント位置の中で、最も至近側あるいは無限遠側のピント位置まで動かす。ステップS503で撮像部204を制御して撮像を行う。制御部201はステップS504で、ステップS503で撮像した画像の評価を行う。撮像画像評価の詳細については後述する。   When a user command reaches the control unit 201 via the operation unit 210, the process of depth synthesis starts. In step S501, the control unit 201 changes the focus position when the first image is captured based on the subject depth of the digital camera 200 and the amount of change in the focus position between images when the second and subsequent images are captured. , And the number of images to be captured. A plurality of focus positions are calculated and set based on these values. Next, in step S502, the control unit 201 moves the lens constituting the optical system 203 to change the focus position of the digital camera 200. If the first image, the lens is moved to a preset focus position, and if it is the second image or later, the closest focus position that has not been imaged among the preset focus positions. Or move to the focus position on the infinity side. In step S503, the imaging unit 204 is controlled to perform imaging. In step S504, the control unit 201 evaluates the image captured in step S503. Details of the captured image evaluation will be described later.

制御部201はステップS505で撮像画像が基準を満たしているか否かを判定し、基準を満たしている場合はステップS506に進み、設定枚数分の画像を撮像したかどうかを判定する。   In step S505, the control unit 201 determines whether or not the captured image satisfies the criterion. If the criterion is satisfied, the control unit 201 proceeds to step S506 and determines whether or not a set number of images have been captured.

ステップS505で制御部201、撮像画像が基準を満たしていないと判定した場合、設定ステップS507で次の撮像のための設定したピント位置の補正を行い、ステップS502に戻る。ステップS507での設定したピント位置の補正の詳細については後述する。   If the control unit 201 determines in step S505 that the captured image does not satisfy the standard, the focus position set for the next imaging is corrected in setting step S507, and the process returns to step S502. Details of the correction of the set focus position in step S507 will be described later.

ステップS506で設定枚数の画像を撮像したと判定された場合、ステップS508で制御部201は合成処理を実行し、合成画像を生成する。ステップS506で設定枚数の画像を撮像していないと判定された場合、ステップS502に戻る。   If it is determined in step S506 that a set number of images have been captured, in step S508, the control unit 201 executes a combining process to generate a combined image. If it is determined in step S506 that the set number of images has not been captured, the process returns to step S502.

ステップS508での画像合成では、公知の方法を用いればよく、その一例を以下に述べる。まず、位置合わせのため、2つの画像の相対位置をずらしながら、これら複数の画像の画素の出力の差の絶対値総和(SAD:Sum Of Absolute Difference)を求める。この絶対値総和の値が最も小さくなるときの、2つの画像の相対的な移動量と移動方向を求める。そして、求めた移動量と移動方向に応じたアフィン変換もしくは射影変換の変換係数を算出した後、変換係数による移動量と絶対値総和から算出した移動量との誤差が最小となるように、最小二乗法を用いて変換係数を最適化する。その最適化された変換係数に基づいて、位置合わせの対象となる画像に対して、変形処理を行う。画像処理部207は、ステップS503で撮像部204によって撮像されたすべての画像に対して、上述した位置合わせと変形処理とを行った後、各画像の各々の領域に対して合成比率を与える。一例としては、画像処理部207は、同一領域に対応する複数の画像のうち、合焦している領域を有する画像の該当領域に含まれる画素に100%の合成比率を与え、ほかの画像の該当領域に含まれる画素に0%の合成比率を与える。あるいは、各領域の画像間の合焦の度合いに応じて、各画像の該当領域に合成比率を割り振るようにしてもよい。なお、合成境界での不自然さを防ぐため、画像処理部207は隣接画素間で合成比率が段階的に変化するようにする。最後に、各々の画素の合成比率に基づいて、合成画像を生成する。   In the image composition in step S508, a known method may be used, and an example thereof will be described below. First, for alignment, the absolute value sum (SAD: Sum Of Absolute Difference) of the output differences of the pixels of the plurality of images is obtained while shifting the relative positions of the two images. The relative moving amount and moving direction of the two images when the absolute value sum is the smallest are obtained. Then, after calculating the conversion coefficient of the affine transformation or projective transformation according to the obtained movement amount and the movement direction, minimize the error between the movement amount by the conversion coefficient and the movement amount calculated from the absolute value sum. Optimize transform coefficients using the square method. Based on the optimized conversion coefficient, a deformation process is performed on the image to be aligned. The image processing unit 207 performs the above-described alignment and deformation processing on all the images captured by the imaging unit 204 in step S503, and then gives a composition ratio to each region of each image. As an example, the image processing unit 207 gives a composition ratio of 100% to pixels included in a corresponding area of an image having an in-focus area among a plurality of images corresponding to the same area. A synthesis ratio of 0% is given to the pixels included in the corresponding area. Alternatively, the composition ratio may be assigned to the corresponding area of each image in accordance with the degree of focusing between the images in each area. In order to prevent unnaturalness at the synthesis boundary, the image processing unit 207 causes the synthesis ratio to change stepwise between adjacent pixels. Finally, a composite image is generated based on the composite ratio of each pixel.

次に、ステップS504での撮像画像評価について説明する。   Next, the captured image evaluation in step S504 will be described.

図6は本実施形態における撮像画像評価処理を説明するフローチャートである。撮像画像評価処理が始まると制御部201は、ステップS601で、直近のステップS503で撮像した時のピント位置を算出する。本実施形態においては、静止画の撮像時に撮像素子の各画素におけるA像とB像との位相差から撮像時のピント位置を算出する。   FIG. 6 is a flowchart illustrating the captured image evaluation process according to this embodiment. When the captured image evaluation process starts, the control unit 201 calculates a focus position when the image is captured in the latest step S503 in step S601. In the present embodiment, the focus position at the time of imaging is calculated from the phase difference between the A image and the B image at each pixel of the image sensor when capturing a still image.

ステップS602で、制御部201はピント位置のずれ量を算出する。ステップS601で取得した撮像時のピント位置と、ステップS501で設定した各々のピント位置とから、ピント位置のずれ量を算出する。たとえば、ステップS601で取得したピント位置がN番目に撮像された画像のピント位置であれば、ステップS501で設定したピント位置のうち、N番目に位置するピント位置と比較することで、ピント位置のずれ量を算出する。   In step S602, the control unit 201 calculates a shift amount of the focus position. A focus position shift amount is calculated from the focus position at the time of imaging acquired in step S601 and each focus position set in step S501. For example, if the focus position acquired in step S601 is the focus position of the Nth imaged image, the focus position of the focus position set in step S501 is compared with the Nth focus position. The amount of deviation is calculated.

ステップS603で制御部201はピント位置のずれ量が所定値以内であるかを判定る。   In step S603, the control unit 201 determines whether the shift amount of the focus position is within a predetermined value.

ステップS603で焦点距離のずれ量が所定量を超えている場合、制御部201はステップS604に進み、基準を満たしていないと判定し、処理を終了させる。   If the deviation amount of the focal length exceeds the predetermined amount in step S603, the control unit 201 proceeds to step S604, determines that the criterion is not satisfied, and ends the process.

反対に、ステップS603で焦点距離のずれ量が所定値以内である場合、制御部201はステップS605に進み、基準を満たしていると判定し、処理を終了させる。これらステップS604または605の判定結果に基づいて、図5のステップS505の判定が行われる。   Conversely, if the focal length deviation amount is within a predetermined value in step S603, the control unit 201 proceeds to step S605, determines that the criterion is satisfied, and ends the process. Based on the determination result of step S604 or 605, the determination of step S505 in FIG. 5 is performed.

以上、ステップS504での撮像画像評価の処理についての説明である。   This is the description of the captured image evaluation process in step S504.

次に、ステップS507におけるピント位置の補正の処理について説明する。図7は、本実施形態におけるピント位置の補正を説明するためのフローチャートである。   Next, the focus position correction process in step S507 will be described. FIG. 7 is a flowchart for explaining the correction of the focus position in the present embodiment.

ステップS701で、制御部201は前回の撮像におけるピント位置と、今回の撮像におけるピント位置の距離を算出する。ステップS702で、制御部201はステップS701で算出した画像のピント位置の距離が所定値を越えているか否かを判定する。この所定値は、焦点距離と撮像素子の許容錯乱円径に基づいて決められる値であって、この所定値を超えると、これら2つの画像の間に、いずれの画像においても合焦状態とならない領域が生じてしまう。   In step S701, the control unit 201 calculates the distance between the focus position in the previous imaging and the focus position in the current imaging. In step S702, the control unit 201 determines whether the distance of the focus position of the image calculated in step S701 exceeds a predetermined value. This predetermined value is a value determined based on the focal length and the permissible circle of confusion of the image sensor. If this predetermined value is exceeded, no focus is achieved between these two images. An area will be created.

制御部201は、ステップS702でピント位置の距離が所定値を超えていると判定した場合には、ステップS703に進み、前回の撮像位置と今回の撮像位置の間に新たなピント位置を追加する。同時に、制御部201は、前述したステップS506での予定枚数に、1枚を足す。そして、制御部201はステップS704に進む。制御部201がステップS704で新たなピント位置を追加した場合、その直後のステップS603で、この追加したピント位置で画像の撮像を行うことが望ましい。ほかのピント位置での撮像が済んでから、追加したピント位置での撮像を行ってもよいが、その間にカメラに手振れが生じた場合、その手振れに応じて、追加したピント位置を再度修正する必要が生じるためである。反対に、制御部201は、ステップS702でピント位置の距離が所定値以内であると判定した場合には、新たなピント位置を追加せずにステップS704に進む。   If the control unit 201 determines in step S702 that the distance between the focus positions exceeds a predetermined value, the control unit 201 proceeds to step S703 and adds a new focus position between the previous imaging position and the current imaging position. . At the same time, the control unit 201 adds one to the planned number in step S506 described above. Then, the control unit 201 proceeds to step S704. When the control unit 201 adds a new focus position in step S704, it is desirable to capture an image at the added focus position in step S603 immediately after that. You may take an image at the added focus position after taking an image at another focus position, but if camera shake occurs during that time, correct the added focus position again according to the camera shake. This is because a need arises. Conversely, if the control unit 201 determines in step S702 that the distance between the focus positions is within a predetermined value, the control unit 201 proceeds to step S704 without adding a new focus position.

ステップS704では、ステップS501で設定したピント位置、あるいは、前回のステップS704を処理したときに更新されたピント位置を、新たなピント位置で更新する。すなわち、図6のステップS602でピント位置のずれ量を算出する際の、基準となるピント位置を更新する。具体的には、至近側から順にピント位置を設定して撮像している場合には、撮像済みのピント位置のうち最も無限遠側のピント位置を基準として、ステップS501で設定したピント位置の変化量ずつずらしたピント位置を、残りの撮像枚数分だけ設定する。つまり、撮像済みのピント位置のうち最も無限遠側のピント位置が、最初にステップS501で設定したピント位置よりも無限遠側にずれていれば、残りの撮像時に設定される複数のピント位置もそれぞれ同じ量だけ無限遠側にずれた位置に再設定される。こうすることで、ピント位置が途中でずれてしまったとしても、その後に撮像される画像間のピント位置の差を一定に保つことが可能である。   In step S704, the focus position set in step S501 or the focus position updated when the previous step S704 was processed is updated with a new focus position. That is, the reference focus position when calculating the focus position shift amount in step S602 in FIG. 6 is updated. Specifically, when the focus position is set in order from the closest side and the image is captured, the change in the focus position set in step S501 with reference to the focus position on the most infinite side among the captured focus positions. The focus position shifted by the amount is set for the remaining number of images to be captured. That is, if the focus position on the most infinite side among the focus positions that have been imaged is shifted to the infinity side from the focus position initially set in step S501, a plurality of focus positions set at the time of the remaining imaging are also obtained. Each is reset to the position shifted to the infinity side by the same amount. By doing this, even if the focus position is shifted in the middle, it is possible to keep the difference in focus position between images captured thereafter.

このように、制御部201は、ステップS704でピント位置の補正を行い、図7のフローチャートを終了させる。   In this way, the control unit 201 corrects the focus position in step S704, and ends the flowchart of FIG.

図8は、本実施形態におけるピント位置の補正を説明するための図である。図8(a)は、図5のステップS501で設定したピント位置を示す。   FIG. 8 is a diagram for explaining the correction of the focus position in the present embodiment. FIG. 8A shows the focus position set in step S501 of FIG.

図8(b)は3枚目の画像を撮像するときに、光軸方向の手前側に手振れが発生した様子を示す。ピント位置801、ピント位置802、ピント位置803は、それぞれ1枚目、2枚目、3枚目の画像を撮像したときのピント位置を示す。本来の3枚目の画像を撮像するときのピント位置よりも、矢印821が示す量だけ、実際に3枚目の画像を撮像したときのピント位置803がずれている。この状態は、図6のステップS603ではNOと判断され、図7のステップS702ではYESと判断される状態に該当する。ここで、ピント位置がずれてはいるが、2枚目の画像のピント位置に、3枚目の画像のピント位置が近くなっただけであるため、ここではピント位置の追加は行われない。   FIG. 8B shows a state in which camera shake occurs on the near side in the optical axis direction when the third image is captured. A focus position 801, a focus position 802, and a focus position 803 indicate the focus positions when the first, second, and third images are captured, respectively. The focus position 803 when the third image is actually captured is shifted from the focus position when the original third image is captured by the amount indicated by the arrow 821. This state corresponds to a state in which NO is determined in step S603 in FIG. 6 and YES is determined in step S702 in FIG. Here, although the focus position is shifted, since the focus position of the third image is only close to the focus position of the second image, the focus position is not added here.

図8(c)は4枚目の画像を撮像するときのピント位置804を示している。3枚目の画像のピント位置803に対して、図5のステップS501で設定した変化量だけずらした位置に、新たなピント位置804が設定されている。   FIG. 8C shows a focus position 804 when the fourth image is captured. A new focus position 804 is set at a position shifted from the focus position 803 of the third image by the amount of change set in step S501 in FIG.

図8(d)は、5枚目の画像を撮像するときに、光軸方向の無限遠側に手振れが発生した様子を示す。予定していた5枚目の画像を撮像するときのピント位置から、矢印822で示す量だけ、実際に5枚目の画像を撮像したときのピント位置805がずれている。図9(d)では、4枚目の画像を撮像したときのピント位置804と、5枚目の画像を撮像したときのピント位置805との距離が、所定値を越えている。そのため、これらのピント位置の間には、4枚目と5枚目の画像のいずれにおいても被写体深度に含まれない領域が存在する。この状態は、図6のステップS603でNOと判断され、図7のステップS702でNOと判断される状態に該当する。   FIG. 8D shows a state in which camera shake occurs on the infinity side in the optical axis direction when the fifth image is captured. The focus position 805 when the fifth image is actually captured is shifted from the focus position when the fifth image is captured by the amount indicated by the arrow 822. In FIG. 9D, the distance between the focus position 804 when the fourth image is captured and the focus position 805 when the fifth image is captured exceeds a predetermined value. Therefore, there is a region that is not included in the subject depth in any of the fourth and fifth images between these focus positions. This state corresponds to a state where NO is determined in step S603 in FIG. 6 and NO is determined in step S702 in FIG.

そこで、図8(e)に示すように、ピント位置804とピント位置805の間に新たなピント位置811を設定し、このピント位置811で撮像する。このピント位置811を設定するhそりが、図7のステップS703に該当する。もし、ピント位置804とピント位置805の間隔が広く、ピント位置を1つ追加するだけでは十分ではない場合には、2つ以上のピントを追加するようにしてもよい。新たなピント位置を追加することにより、ピント位置が隣接する画像間のピント位置の距離を、所定値以内に収めることができる。   Therefore, as shown in FIG. 8E, a new focus position 811 is set between the focus position 804 and the focus position 805, and an image is taken at this focus position 811. The sled that sets the focus position 811 corresponds to step S703 in FIG. If the distance between the focus position 804 and the focus position 805 is wide and it is not sufficient to add one focus position, two or more focus points may be added. By adding a new focus position, the distance of the focus position between images with adjacent focus positions can be kept within a predetermined value.

図8(f)では、ピント位置805に対して、図5のステップS501で設定した変化量だけずらした位置に、新たなピント位置806を設定し、画像を撮像する様子を示す。   FIG. 8F shows a state where a new focus position 806 is set at a position shifted from the focus position 805 by the amount of change set in step S501 in FIG. 5, and an image is captured.

このように、第1の実施形態によれば、ピント位置を変化させて撮像した複数の画像を用いて合成するとき、実際に画像を撮像したときのピント位置と、予定していたピント位置とのずれを算出することで、次の撮像のピント位置を調整し、合成画像を生成する際のぼけを低減させることができる。   As described above, according to the first embodiment, when combining a plurality of images picked up by changing the focus position, the focus position when the image is actually picked up, the planned focus position, and By calculating the deviation, the focus position of the next imaging can be adjusted, and blurring when generating a composite image can be reduced.

なお、手前側への手振れの量が大きい場合には、予定していた枚数分の画像を撮像したとしても、予定より手前で撮像が完了してしまう可能性がある。そこで、制御部201は、図5のステップS506で予定枚数が完了した場合であっても、最も至近側のピント位置と最も無限遠側のピント位置が当初の設定していた範囲よりも狭い場合には、ピント位置をさらに追加して撮像を行うようにしてもよい。たとえば、ステップS501で設定された値から導ける最後の画像のピント位置に比べ、実際に最後に撮像した画像のピント位置が最初に撮像した画像のピント位置に近ければ、ピント位置の分布範囲が狭いと判断することができる。反対に、無限遠側の手振れの量が大きく、途中でピント位置を追加した結果、予定していた枚数分の画像を撮像する前に、当初予定していたピント位置での撮像を完了した場合には、その時点で撮像を終了してもよい。   Note that if the amount of camera shake toward the front side is large, even if the planned number of images has been captured, there is a possibility that the imaging will be completed before the schedule. Therefore, even when the planned number of sheets is completed in step S506 in FIG. 5, the control unit 201 has a case where the closest focus position and the most infinite focus position are narrower than the initially set range. Alternatively, imaging may be performed by further adding a focus position. For example, if the focus position of the last image actually captured is close to the focus position of the first image compared to the focus position of the last image derived from the value set in step S501, the focus position distribution range is narrow. It can be judged. Conversely, if the amount of camera shake at infinity is large, and as a result of adding a focus position on the way, imaging at the originally planned focus position is completed before taking the image for the scheduled number In this case, the imaging may be terminated at that time.

(第2の実施形態)
第2の実施形態では、撮像部204とは別に、焦点検出用のセンサを設けた撮像装置を用いた例について説明する。以下では、図面を参照しながら詳細に説明する。なお、第1の実施形態と同様な所の説明は省略する。
(Second Embodiment)
In the second embodiment, an example in which an imaging device provided with a focus detection sensor is used separately from the imaging unit 204 will be described. Below, it demonstrates in detail, referring drawings. In addition, the description of the same place as 1st Embodiment is abbreviate | omitted.

図9は、デジタル一眼レフカメラの構造を説明するための図である。以下では、デジタル一眼レフカメラに基づいて説明するが、これに限らず、撮像部204と焦点検出用のセンサとを別々に設けた撮像装置であればよい。デジタル一眼レフカメラ900にはレンズ鏡筒901が装着されており、画像を撮像するときには、ミラー903およびサブミラー904が撮像光路から避難し、レンズ鏡筒901を通過した光は撮像センサ902に導かれる。画像を撮像する前後は、図9に示すように、撮像光路に配置されたミラー903によって反射した光の一部がプリズム905によって屈折された後、ファインダー907に導かれる。ミラー903に到達した光の一部はミラー903を通過し、ミラー903に接続されているサブミラー904により反射してAFセンサ906に導かれる。AFセンサ906は、ピント位置のずれ量と方向とを算出することができる。   FIG. 9 is a diagram for explaining the structure of a digital single-lens reflex camera. The following description is based on a digital single-lens reflex camera. However, the present invention is not limited to this, and any imaging device provided with an imaging unit 204 and a focus detection sensor may be used. A lens barrel 901 is attached to the digital single-lens reflex camera 900, and when taking an image, the mirror 903 and the sub-mirror 904 escape from the imaging optical path, and the light passing through the lens barrel 901 is guided to the imaging sensor 902. . Before and after the image is captured, a part of the light reflected by the mirror 903 arranged in the imaging optical path is refracted by the prism 905 and then guided to the finder 907 as shown in FIG. Part of the light that reaches the mirror 903 passes through the mirror 903, is reflected by the sub-mirror 904 connected to the mirror 903, and is guided to the AF sensor 906. The AF sensor 906 can calculate the shift amount and direction of the focus position.

図10は、本実施形態における深度合成の処理を説明するためのフローチャートである。ステップS1001乃至S1008については、第1の実施形態の図5のステップS501乃至S508と同様である。   FIG. 10 is a flowchart for explaining the depth synthesis processing in this embodiment. Steps S1001 to S1008 are the same as steps S501 to S508 in FIG. 5 of the first embodiment.

制御部201は、ステップS1001で初期ピント位置とピント位置の変化量と撮像回数とを設定すると、ステップS1002でミラー903を撮像光路に挿入する。そして制御部201は、ステップS1003の撮像の前のステップS1013で、ミラー903を撮像光路から退避させる。   When the initial focus position, the focus position change amount, and the number of times of imaging are set in step S1001, the control unit 201 inserts the mirror 903 into the imaging optical path in step S1002. Then, the control unit 201 retracts the mirror 903 from the imaging optical path in step S1013 before imaging in step S1003.

ステップS1012でAFセンサ906が測距情報を取得し、取得した距離情報は、制御部201が行うステップS1004での撮像画像評価に用いられる。実際には、ステップS1012で測距情報を取得するタイミングと、ステップS1003で撮像を行うタイミングにはずれがあるが、その差はわずかであるため、問題はない。よって、ステップS1002で取得した距離情報を用いてステップS1004で撮像画像評価を行うことができる。   In step S1012, the AF sensor 906 acquires distance measurement information, and the acquired distance information is used for captured image evaluation in step S1004 performed by the control unit 201. Actually, there is a difference between the timing at which ranging information is acquired in step S1012 and the timing at which imaging is performed in step S1003, but there is no problem because the difference is slight. Therefore, the captured image evaluation can be performed in step S1004 using the distance information acquired in step S1002.

第2の実施形態によれば、撮像部204とは別に焦点検出用のセンサを設けた撮像装置を用いても、ピント位置を変化させて撮像した複数の画像を用いて合成するとき、手振れが発生してもぼけを低減させる合成画像を生成できる。   According to the second embodiment, even when an imaging apparatus provided with a focus detection sensor in addition to the imaging unit 204 is used, when a plurality of images captured by changing the focus position are combined, camera shake occurs. Even if it occurs, a composite image that reduces blur can be generated.

(第3の実施形態)
第3の実施形態では、ピント位置のずれ量と方向とを直接算出する代わりに、コントラスト値の解析の結果に基づいて、撮像時のピント位置を推定し、撮像画像評価などを行う撮像装置を用いた例について説明する。以下では、図面を参照しながら、第3の実施形態を詳細に説明する。なお、第1の実施形態と同様な所は、省略する。
(Third embodiment)
In the third embodiment, instead of directly calculating the shift amount and direction of the focus position, an imaging apparatus that estimates the focus position at the time of imaging based on the analysis result of the contrast value and performs the captured image evaluation or the like. The used example will be described. Hereinafter, the third embodiment will be described in detail with reference to the drawings. Note that portions similar to those of the first embodiment are omitted.

図11は、本実施形態における深度合成の処理を説明するためのフローチャートである。   FIG. 11 is a flowchart for explaining the depth synthesis processing in this embodiment.

ステップS1101で、制御部201は、ユーザの設定に基づいて、初期ピント位置とピント位置の変化量と撮像枚数とを設定する。ステップS1102で制御部201は、撮像装置のピント位置を、ステップS1101で設定したピント位置のうち、最も無限遠側のピント位置まで移動させる。次に、ステップS1103で撮像装置は設定した各々のピント位置で、撮像を行う。   In step S1101, the control unit 201 sets an initial focus position, a change amount of the focus position, and the number of captured images based on user settings. In step S1102, the control unit 201 moves the focus position of the imaging apparatus to the focus position closest to the infinity among the focus positions set in step S1101. In step S1103, the imaging apparatus performs imaging at each set focus position.

ステップS1104で、画像処理部207は、注目点を設定し、各画像における注目点のコントラスト値を解析する。画像処理部207が、画像からエッジ部を抽出し、このエッジ部に、なるべく多くの注目点を設定するほうが好ましい。図12は、本実施形態における注目点のコントラスト値を説明するための図である。図12(a)は、被写体を表し、領域1201乃至1204は画像処理部207が任意に指定した領域(以下、注目点と称す)である。設定したピント位置で撮像した各画像において、それぞれの注目点のコントラスト値を算出し、プロットすると、コントラスト値と設定したピント位置との関係を得ることができる。図12(b)は、図12(a)の注目点1201乃至1204のそれぞれにおいて、コントラスト値と設定したピント位置との関係を曲線1211乃至1214で示す。図12(b)では、注目点にピントが合うとき、コントラスト値が高くなり、ピント位置がずれるほど、コントラスト値が下がることを示している。手振れが発生しなければ、コントラスト値と設定したピント位置との関係は、図12(b)になる。   In step S1104, the image processing unit 207 sets a point of interest and analyzes the contrast value of the point of interest in each image. It is preferable that the image processing unit 207 extracts an edge portion from the image and sets as many attention points as possible on the edge portion. FIG. 12 is a diagram for explaining the contrast value of the target point in the present embodiment. FIG. 12A shows a subject, and areas 1201 to 1204 are areas arbitrarily designated by the image processing unit 207 (hereinafter referred to as attention points). By calculating and plotting the contrast value of each point of interest in each image captured at the set focus position, the relationship between the contrast value and the set focus position can be obtained. FIG. 12B shows the relationship between the contrast value and the set focus position with curves 1211 to 1214 at the respective attention points 1201 to 1204 in FIG. FIG. 12B shows that when the focused point is in focus, the contrast value increases, and the contrast value decreases as the focus position shifts. If camera shake does not occur, the relationship between the contrast value and the set focus position is as shown in FIG.

次に、ステップS1104での注目点のコントラスト値の解析について、例を挙げながら説明する。簡略のため、以下では注目点1201と1202のみについて解析する例を説明する。図12(c)は、実際の撮像において、注目点1201および1202の各ピント位置のコントラスト値を示す。図12(c)では、撮像部204が離散的なのピント位置で撮像したため、離散的なコントラスト値の値になるが、これらのコントラスト値の近似曲線は図12(b)の曲線1211および1212である。したがって、画像処理部207が図12(c)のようなコントラスト値を算出できれば、制御部201は、撮像中に手振れなどが発生しておらず、ステップS1105で、ピント位置の追加が必要でないと判断する。   Next, the analysis of the contrast value of the attention point in step S1104 will be described with an example. For simplicity, an example in which only the attention points 1201 and 1202 are analyzed will be described below. FIG. 12C shows the contrast values at the respective focus positions of the attention points 1201 and 1202 in actual imaging. In FIG. 12C, since the imaging unit 204 picks up images at discrete focus positions, discrete contrast values are obtained. The approximate curves of these contrast values are the curves 1211 and 1212 in FIG. is there. Therefore, if the image processing unit 207 can calculate the contrast value as shown in FIG. 12C, the control unit 201 does not generate camera shake during imaging, and it is not necessary to add a focus position in step S1105. to decide.

図12(d)は、手前側に手振れてしまう場合のコントラスト値を示す。図12(d)では、コントラスト値は、極大値をもち、滑らかに変化しているが、ピント位置1220のところでのコントラスト値のみ、ほかの値より大きくずれている。ピント位置1220以外のコントラスト値の近似曲線は曲線1221および1222で示す。注目点1201のコントラスト値1223は、曲線1221のピント位置1220での値より高く、注目点1202のコントラスト値1224は、曲線1222のピント位置1220での値より低いことがわかる。つまり、ピント位置1220で撮像した画像の注目点のコントラスト値は、曲線1221と1222において、より手前側のピント位置の値に近くなる。これにより、制御部201は、手前側に手振れてしまうことを判断できる。   FIG. 12D shows a contrast value when the camera shakes to the near side. In FIG. 12D, the contrast value has a maximum value and is smoothly changing, but only the contrast value at the focus position 1220 is greatly deviated from the other values. Approximate curves of contrast values other than the focus position 1220 are indicated by curves 1221 and 1222. It can be seen that the contrast value 1223 of the attention point 1201 is higher than the value at the focus position 1220 of the curve 1221, and the contrast value 1224 of the attention point 1202 is lower than the value at the focus position 1220 of the curve 1222. That is, the contrast value of the attention point of the image captured at the focus position 1220 is closer to the value of the nearer focus position on the curves 1221 and 1222. Thereby, the control part 201 can judge that it shakes to the near side.

図12(e)は、無限遠側に手振れてしまう場合のコントラスト値を示す。図12(e)では、図12(d)と同様に、ピント位置1230のところでのコントラスト値のみ、ほかの値より大きくずれている。ピント位置1220以外のコントラスト値の近似曲線は曲線1231および1232で示す。具体的に、注目点1201のコントラスト値1233は、曲線1231のピント位置1230での値より低く、注目点1202のコントラスト値1234は、曲線1232のピント位置1230での値より高いことがわかる。つまり、ピント位置1230で撮像した画像の注目点のコントラスト値は、曲線1231と1232において、より無限遠側のピント位置の値に近くなる。これにより、制御部201は、無限遠に手振れてしまうことを判断できる。   FIG. 12E shows the contrast value when the camera shakes toward the infinity side. In FIG. 12E, as in FIG. 12D, only the contrast value at the focus position 1230 is greatly deviated from the other values. Approximate curves of contrast values other than the focus position 1220 are indicated by curves 1231 and 1232. Specifically, it can be seen that the contrast value 1233 of the attention point 1201 is lower than the value at the focus position 1230 of the curve 1231, and the contrast value 1234 of the attention point 1202 is higher than the value at the focus position 1230 of the curve 1232. That is, the contrast value of the attention point of the image captured at the focus position 1230 is closer to the focus position value on the infinity side on the curves 1231 and 1232. As a result, the control unit 201 can determine that the camera shakes to infinity.

画像処理部207は、ステップS1101でなるべく多くの注目点を設定すると、上記の手振れの方向の判断の正確性を高めることができる。また、画像処理部207は、近似曲線を算出できないようなコントラスト値をもつ注目点を、ステップS1105でのピント位置の追加の判断に使わない。   When the image processing unit 207 sets as many attention points as possible in step S1101, the accuracy of the determination of the direction of camera shake can be improved. Further, the image processing unit 207 does not use a point of interest having a contrast value that cannot calculate an approximate curve for the determination of addition of the focus position in step S1105.

手振れが発生すると、ピント位置1220または1230で、合成に使える画像を撮像できなかったので、制御部201は、ステップS1105で、ピント位置の追加が必要であると判断する。次に、ステップS1106に進み、ピント位置を追加し、ステップS1107で撮像部204は、追加したピント位置で撮像を行う。追加するピント位置は、前述するピント位置1220また1230にあるのは好ましいが、合焦しない区間が発生しない限り、ピント位置1220また1230の近くにある任意の位置でよい。   When camera shake occurs, an image usable for composition could not be captured at the focus position 1220 or 1230, and therefore the control unit 201 determines in step S1105 that the focus position needs to be added. In step S1106, a focus position is added, and in step S1107, the imaging unit 204 captures an image at the added focus position. The focus position to be added is preferably located at the focus position 1220 or 1230 described above, but may be any position near the focus position 1220 or 1230 as long as an unfocused section does not occur.

一方、ステップS1106で、制御部201は、ピント位置の追加が必要でないと判断する場合、直接、ステップS1108に進む。ステップS1108で、画像処理部207は、合成処理を行う。   On the other hand, when the control unit 201 determines in step S1106 that the addition of the focus position is not necessary, the process directly proceeds to step S1108. In step S1108, the image processing unit 207 performs composition processing.

第3の実施形態によれば、ピント位置を変化させて撮像した複数の画像を用いて合成するとき、手振れによるずれた量と方向とを直接算出しなくても、次の撮像のピント位置を調整し、ぼけを低減させる合成画像を生成できる。   According to the third embodiment, when synthesizing using a plurality of images picked up by changing the focus position, the focus position of the next image pickup can be determined without directly calculating the shift amount and direction due to camera shake. A composite image that can be adjusted to reduce blur can be generated.

(その他の実施形態)
以上の実施形態は、デジタルカメラでの実施をもとに説明したが、デジタルカメラに限定するものではない。たとえば、撮像素子が内蔵した携帯機器などで実施してもよく、画像を撮像することができるネットワークカメラなどでもよい。
(Other embodiments)
The above embodiment has been described based on the implementation with a digital camera, but is not limited to a digital camera. For example, it may be implemented by a portable device with a built-in image sensor or a network camera capable of capturing an image.

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

200 デジタルカメラ
201 制御部
202 駆動部
203 光学系
204 撮像部
205 ROM
206 RAM
207 画像処理部
208 表示部
209 内蔵メモリ
210 操作部
200 Digital Camera 201 Control Unit 202 Drive Unit 203 Optical System 204 Imaging Unit 205 ROM
206 RAM
207 Image processing unit 208 Display unit 209 Built-in memory 210 Operation unit

Claims (11)

撮像手段と、
複数の目標ピント位置の設定を行う設定手段と、
ピント位置の算出手段と、を有し、
前記撮像手段は、前記目標ピント位置に応じた複数の画像を撮像し、
前記算出手段は、前記複数の画像のそれぞれが撮像されたときの、被写体に対するピント位置を算出し、
前記設定手段は、前記目標ピント位置と、算出されたピント位置との比較結果に応じて、前記目標ピント位置の少なくとも一部を再設定することを特徴とする撮像装置。
Imaging means;
Setting means for setting a plurality of target focus positions;
A focus position calculation means,
The imaging means captures a plurality of images according to the target focus position,
The calculating means calculates a focus position with respect to a subject when each of the plurality of images is captured;
The setting device resets at least a part of the target focus position according to a comparison result between the target focus position and the calculated focus position.
前記撮像手段が順に撮像した第1の画像と第2の画像において、前記第1の画像を撮像したときに算出されたピント位置と、前記第2の画像を撮像したときに算出されたピント位置との差が、予め定められた閾値より大きい場合に、前記設定手段は、それより後に撮像する画像のための目標ピント位置の一部を再設定することを特徴とする請求項1に記載の撮像装置。   The focus position calculated when the first image is captured and the focus position calculated when the second image is captured in the first image and the second image sequentially captured by the imaging unit. The setting means resets a part of a target focus position for an image to be captured later when the difference between and a predetermined threshold value is larger than a predetermined threshold value. Imaging device. 前記複数の画像を合成する合成手段を有することを特徴とする請求項1または2に記載の撮像装置。   The imaging apparatus according to claim 1, further comprising a combining unit that combines the plurality of images. 前記複数の画像は、少なくとも一部の画角が重複することを特徴とする請求項3に記載の撮像装置。   The imaging apparatus according to claim 3, wherein at least some of the plurality of images overlap at least part of the angle of view. 前記合成手段は、前記複数の画像のそれぞれの合焦している領域を用いて、前記合成画像を生成することを特徴とする請求項3または4に記載の撮像装置。   5. The imaging apparatus according to claim 3, wherein the synthesizing unit generates the synthesized image using a focused area of each of the plurality of images. 前記撮像手段は、1つのマイクロレンズに対して、複数の光電変換部を有することを特徴とする請求項1乃至5のいずれか1項に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the imaging unit includes a plurality of photoelectric conversion units for one microlens. 前記算出手段は、前記複数の光電変換部の出力に基づいて、それぞれが撮像された時の被写体に対するピント位置を算出することを特徴とする請求項6に記載の撮像装置。   The imaging apparatus according to claim 6, wherein the calculation unit calculates a focus position with respect to a subject when each of the plurality of photoelectric conversion units is imaged based on outputs of the plurality of photoelectric conversion units. 前記画像のコントラスト値の検出を行うコントラスト値の検出手段を有し、
前記算出手段は、前記コントラスト値に基づいて、前記複数の画像のそれぞれが撮像された時の被写体に対するピント位置を算出することを特徴とする請求項1乃至7のいずれか1項に記載の撮像装置。
Contrast value detection means for detecting the contrast value of the image,
The imaging according to any one of claims 1 to 7, wherein the calculating means calculates a focus position with respect to a subject when each of the plurality of images is captured based on the contrast value. apparatus.
焦点検出用のセンサを有し、
前記算出手段は、前記焦点検出用のセンサに基づいて、前記複数の画像のそれぞれが撮像された時の被写体に対するピント位置を算出することを特徴とする請求項1乃至8のいずれか1項に記載の撮像装置。
Having a sensor for focus detection,
9. The calculation unit according to claim 1, wherein the calculation unit calculates a focus position with respect to a subject when each of the plurality of images is captured based on the focus detection sensor. 10. The imaging device described.
撮像ステップと、
複数の目標ピント位置の設定を行う設定ステップと、
ピント位置の算出ステップと、を有し、
前記撮像ステップにおいては、前記目標ピント位置に応じた複数の画像を撮像し、
前記算出ステップにおいては、前記複数の画像のそれぞれが撮像されたときの、被写体に対するピント位置を算出し、
前記設定ステップにおいては、前記目標ピント位置と、算出されたピント位置との比較結果に応じて、前記目標ピント位置の少なくとも一部を再設定することを特徴とする撮像方法。
Imaging step;
A setting step for setting a plurality of target focus positions;
A focus position calculating step, and
In the imaging step, a plurality of images corresponding to the target focus position are captured,
In the calculating step, a focus position with respect to the subject when each of the plurality of images is captured is calculated;
In the setting step, at least a part of the target focus position is reset according to a comparison result between the target focus position and the calculated focus position.
撮像装置のコンピュータに動作させるプログラムであって、
撮像ステップと、
複数の目標ピント位置の設定を行う設定ステップと、
ピント位置の算出ステップと、を行わせ、
前記撮像ステップにおいては、前記目標ピント位置に応じた複数の画像を撮像し、
前記算出ステップにおいては、前記複数の画像のそれぞれが撮像されたときの、被写体に対するピント位置を算出し、
前記設定ステップにおいては、前記目標ピント位置と、算出されたピント位置との比較結果に応じて、前記目標ピント位置の少なくとも一部を再設定することを特徴とするプログラム。
A program for causing a computer of an imaging apparatus to operate,
Imaging step;
A setting step for setting a plurality of target focus positions;
And a step of calculating a focus position,
In the imaging step, a plurality of images corresponding to the target focus position are captured,
In the calculating step, a focus position with respect to the subject when each of the plurality of images is captured is calculated;
In the setting step, at least a part of the target focus position is reset according to a comparison result between the target focus position and the calculated focus position.
JP2017126241A 2016-09-29 2017-06-28 Imaging equipment, imaging methods and programs Active JP6929145B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2016191331 2016-09-29
JP2016191331 2016-09-29

Publications (2)

Publication Number Publication Date
JP2018061231A true JP2018061231A (en) 2018-04-12
JP6929145B2 JP6929145B2 (en) 2021-09-01

Family

ID=61907822

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017126241A Active JP6929145B2 (en) 2016-09-29 2017-06-28 Imaging equipment, imaging methods and programs

Country Status (1)

Country Link
JP (1) JP6929145B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016005224A (en) * 2014-06-19 2016-01-12 オリンパス株式会社 Imaging device, control method of imaging device, and program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016005224A (en) * 2014-06-19 2016-01-12 オリンパス株式会社 Imaging device, control method of imaging device, and program

Also Published As

Publication number Publication date
JP6929145B2 (en) 2021-09-01

Similar Documents

Publication Publication Date Title
JP4985808B2 (en) Imaging apparatus and program
JP5054583B2 (en) Imaging device
JP5563283B2 (en) Image processing device
JP6405243B2 (en) Focus detection apparatus and control method thereof
EP2618585B1 (en) Monocular 3d-imaging device, shading correction method for monocular 3d-imaging device, and program for monocular 3d-imaging device
CN107864315B (en) Image pickup apparatus, control method of image pickup apparatus, and recording medium
JP7086571B2 (en) Image pickup device, lens device and control method thereof
JP5513024B2 (en) Imaging apparatus, zoom correction information creation method, and program
JP6833498B2 (en) Imaging device, imaging method and computer program
US10187564B2 (en) Focus adjustment apparatus, imaging apparatus, focus adjustment method, and recording medium storing a focus adjustment program thereon
US8004596B2 (en) Apparatus for processing a digital image to automatically select a best image from a plurality of images and method of controlling the apparatus
JP2014211574A (en) Imaging apparatus, and control method and program therefor
JP5393300B2 (en) Imaging device
JP2006162991A (en) Stereoscopic image photographing apparatus
JP2020107956A (en) Imaging apparatus, imaging method, and program
JP5832353B2 (en) Imaging device
JP2006033023A (en) Image pickup device
JP2005215373A (en) Imaging apparatus
JP2018074361A (en) Imaging apparatus, imaging method, and program
JP6405163B2 (en) Focus detection apparatus and control method thereof
JP5655804B2 (en) Imaging apparatus and program
JP5306116B2 (en) Focus state detection device, imaging device, and control method thereof
JP5409201B2 (en) Focus detection apparatus and focus detection method
JP4957435B2 (en) Imaging device
JP6929145B2 (en) Imaging equipment, imaging methods and programs

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200519

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210305

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210406

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210528

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210615

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210622

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20210706

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210810

R151 Written notification of patent or utility model registration

Ref document number: 6929145

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151