JP2014131188A - Imaging apparatus, control method of the same, and control program - Google Patents

Imaging apparatus, control method of the same, and control program Download PDF

Info

Publication number
JP2014131188A
JP2014131188A JP2012288033A JP2012288033A JP2014131188A JP 2014131188 A JP2014131188 A JP 2014131188A JP 2012288033 A JP2012288033 A JP 2012288033A JP 2012288033 A JP2012288033 A JP 2012288033A JP 2014131188 A JP2014131188 A JP 2014131188A
Authority
JP
Japan
Prior art keywords
image
background
focal length
subject
region
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
JP2012288033A
Other languages
Japanese (ja)
Inventor
Atsushi Fujita
篤史 藤田
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 JP2012288033A priority Critical patent/JP2014131188A/en
Publication of JP2014131188A publication Critical patent/JP2014131188A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To allow a user who is to perform photographing in which a background is to be blurred to easily obtain a background blurred image without performing any complicated operation.SOLUTION: A subject area and a background area are discriminated in accordance with a first image obtained by focusing it to a subject and a second image obtained by focusing it to a background except for the subject. The background in the first image or the second image is blurred in accordance with an area discrimination result and a background blurred image is generated. The first image and the background blurred image are synthesized and the background blurred image is generated. It is determined whether the area can be discriminated in accordance with depth of field. When discrimination of the area is impossible, a focal distance is changed to a focal distance in which the area can be discriminated. The first image and the second image are obtained by the changed focal distance.

Description

本発明は、複数枚の画像を撮影して当該画像を用いて背景ぼかし画像を生成するための撮像装置、その制御方法、および制御プログラムに関する。   The present invention relates to an imaging apparatus for capturing a plurality of images and generating a background blurred image using the images, a control method thereof, and a control program.

一般に、ポートレート写真などにおいて被写体を印象づけるため、被写体以外の背景をぼかして被写体を浮き立たせる手法がある。一眼レフカメラのように撮像素子が大きい撮像装置では、絞りを開き、焦点距離を長くすることによって、被写界深度が浅くなるので、比較的容易に被写体以外の背景をぼかした画像を撮影することができる。   In general, in order to impress a subject in a portrait photograph or the like, there is a method of making a subject stand out by blurring a background other than the subject. In an imaging device with a large imaging device such as a single-lens reflex camera, the depth of field becomes shallow by opening the aperture and increasing the focal length, so it is relatively easy to shoot an image with a background other than the subject blurred. be able to.

一方、所謂コンパクトデジタルカメラなどの撮像素子が小さい撮像装置では、上記の手法を用いても、被写界深度が深くなる傾向にあるので、背景をぼかした画像を撮影することは困難である。   On the other hand, in an imaging apparatus with a small imaging element such as a so-called compact digital camera, even if the above method is used, it is difficult to capture an image with a blurred background because the depth of field tends to be deep.

このため、コンパクトデジタルカメラなどの撮像装置には、画像処理によって疑似的に背景にぼかし効果を与える機能を有するものがある。この機能では、例えば、合焦位置を変化させて撮影した複数枚の画像間の差分情報に応じて主要被写体の領域と背景の領域とを分離し、背景とする画像にぼかし処理を施して、当該ぼかし処理を施した画像と主要被写体に合焦した画像と合成している。   For this reason, some imaging apparatuses such as compact digital cameras have a function of artificially blurring the background by image processing. In this function, for example, the main subject region and the background region are separated according to difference information between a plurality of images taken by changing the in-focus position, and the background image is subjected to blurring processing. The blurred image and the image focused on the main subject are combined.

なお、主要被写体の領域と背景の領域とを分離するため、所謂二眼撮像装置の視差を用いて領域の判別を行う手法があるが、この手法では撮像装置にレンズが2つ必要となるため、不可避的に撮像装置が大型化し、さらには生産コストが増加してしまう。   In order to separate the main subject region from the background region, there is a method of determining a region using the parallax of a so-called binocular imaging device, but this method requires two lenses in the imaging device. This inevitably increases the size of the imaging device, and further increases the production cost.

さらに、任意の位置でぼけ効果を付加するため、合焦したい位置と、ぼけ効果を付加したい位置とを指定して、両方の位置についてオートフォーカス動作によって、被写体のズームレンズからの距離を測定し、当該測定結果に応じて開口径を制御し、ぼけ効果を付加したい位置を被写界深度外とするようにしたものがある(特許文献1参照)。   Furthermore, in order to add a blur effect at any position, specify the position where you want to focus and the position where you want to add the blur effect, and measure the distance from the zoom lens of the subject by autofocus operation at both positions. In some cases, the aperture diameter is controlled according to the measurement result so that the position where the blur effect is to be added is outside the depth of field (see Patent Document 1).

特開2003−125281号公報JP 2003-125281 A

ところで、合焦位置を変化させて撮影した複数枚画像から被写体の領域と背景の領域とを分離するアルゴリズムにおいて、被写体の領域と背景の領域とを分離する際には、被写体の領域と背景の領域とが少なくとも1深度以上の差を有する位置関係にある必要がある。従って、同一深度内に位置する被写体領域と背景の領域とを分離することは困難である。   By the way, in the algorithm for separating the subject area and the background area from a plurality of images taken by changing the focus position, when separating the subject area and the background area, the subject area and the background area are separated. The area needs to be in a positional relationship having a difference of at least one depth or more. Therefore, it is difficult to separate the subject area and the background area located within the same depth.

このため、被写体の領域と背景の領域との距離が近く、深度差がない状態で撮影する場合には、撮影前後において背景ぼかし撮影ができない(又はできなかった)旨をユーザに警告することが行われている。さらには、現在の絞り値および背景までの距離情報に応じて背景をぼかすことのできる被写体までの距離の概略値を表示装置に表示して、ユーザに撮影条件の変更を促すことも行われている。   For this reason, when shooting in a state where the distance between the subject region and the background region is short and there is no difference in depth, the user may be warned that background blur shooting cannot be performed (or could not be performed) before and after shooting. Has been done. Furthermore, an approximate value of the distance to the subject that can blur the background is displayed on the display device according to the current aperture value and the distance information to the background, and the user is prompted to change the shooting condition. Yes.

しかしながら、上述のようなユーザに対して被写体までの距離を提示する手法および撮影後に「背景をぼかすことができませんでした」などの警告を表示する手法では、背景ぼかし画像を撮影するまでの手順が煩雑となってしまう。このため、背景をぼかした画像を撮影したいというユーザの希望に対して十分に対処することができない。   However, in the method of presenting the distance to the subject to the user as described above and the method of displaying a warning such as “The background could not be blurred” after shooting, the procedure for shooting the background blurred image is It becomes complicated. For this reason, the user's desire to take an image with a blurred background cannot be sufficiently dealt with.

従って、本発明の目的は、煩雑な操作を行うことなく背景をぼかした撮影を行いたいユーザが容易に背景ぼかし画像を得ることのできる撮像装置、その制御方法、および制御プログラムを提供することにある。   Accordingly, an object of the present invention is to provide an imaging apparatus, a control method thereof, and a control program that enable a user who wants to perform shooting with a blurred background without performing complicated operations to obtain a blurred background image. is there.

上記の目的を達成するため、本発明による撮像装置は、合焦位置を変化させて複数枚の画像を撮影する撮像手段を備え、前記複数の画像に応じて背景をぼかし処理した背景ぼかし処理画像を生成する撮像装置であって、被写体に合焦した状態で得られた第1の画像と前記被写体を除く前記背景に合焦した状態で得られた第2の画像に応じて前記被写体の領域および前記背景の領域を判別して領域判別結果を出力する判別手段と、前記領域判別結果に応じて前記第1の画像又は前記第2の画像における背景にぼかし処理を施して背景ぼかし画像を生成するぼかし処理手段と、前記第1の画像と前記背景ぼかし画像とを合成して前記背景ぼかし画像を生成する合成手段と、被写界深度に応じて、前記判別手段による領域の判別が可能であるか否かを判定する判定手段と、前記判定手段によって前記判別手段による領域の判別が不可であると判定されると焦点距離を前記領域の判別が可能である焦点距離に変更して、当該変更後の焦点距離によって前記撮像手段を制御して前記第1の画像および前記第2の画像を得る制御手段と、を有することを特徴とする。   In order to achieve the above object, an imaging apparatus according to the present invention includes an imaging unit that captures a plurality of images by changing a focus position, and a background blur-processed image obtained by blurring a background according to the plurality of images. The first image obtained in a state where the subject is in focus and the second image obtained in a state where the background excluding the subject is in focus. And a discriminating means for discriminating the background region and outputting a region discriminating result, and generating a background blur image by subjecting the background in the first image or the second image to blur processing according to the region discriminating result The determining unit can determine the area according to the blur processing unit, the combining unit that combines the first image and the background blurred image to generate the background blurred image, and the depth of field. Whether or not When the determination unit determines that the determination unit cannot determine the region, the focal length is changed to a focal length at which the region can be determined, and the changed focal length Control means for controlling the imaging means to obtain the first image and the second image.

本発明による制御方法は、合焦位置を変化させて複数枚の画像を撮影する撮像手段を備え、前記複数の画像に応じて背景をぼかし処理した背景ぼかし処理画像を生成する撮像装置の制御方法であって、被写体に合焦した状態で得られた第1の画像と前記被写体を除く前記背景に合焦した状態で得られた第2の画像に応じて前記被写体の領域および前記背景の領域を判別して領域判別結果を出力する判別ステップと、前記領域判別結果に応じて前記第1の画像又は前記第2の画像における背景にぼかし処理を施して背景ぼかし画像を生成するぼかし処理ステップと、前記第1の画像と前記背景ぼかし画像とを合成して前記背景ぼかし画像を生成する合成ステップと、被写界深度に応じて、前記判別ステップによる領域の判別が可能であるか否かを判定する判定ステップと、前記判定ステップで前記判別ステップによる領域の判別が不可であると判定されると焦点距離を前記領域の判別が可能である焦点距離に変更して、当該変更後の焦点距離によって前記撮像手段を制御して前記第1の画像および前記第2の画像を得る制御ステップと、を有することを特徴とする。   A control method according to the present invention includes an imaging unit that captures a plurality of images by changing a focus position, and a method for controlling an imaging apparatus that generates a background blurred image in which a background is blurred according to the plurality of images. The subject area and the background area according to the first image obtained in focus on the subject and the second image obtained in focus on the background excluding the subject. A discrimination step for discriminating and outputting a region discrimination result; and a blur processing step for generating a background blur image by performing blur processing on the background in the first image or the second image according to the region discrimination result; Whether the region can be determined by the determining step according to the combining step of generating the background blurred image by combining the first image and the background blurred image, and the depth of field. A determination step, and if it is determined in the determination step that the determination of the region by the determination step is impossible, the focal length is changed to a focal length that allows the determination of the region, and the changed focal length And a control step of controlling the imaging means to obtain the first image and the second image.

本発明による制御プログラムは、合焦位置を変化させて複数枚の画像を撮影する撮像手段を備え、前記複数の画像に応じて背景をぼかし処理した背景ぼかし処理画像を生成する撮像装置で用いられる制御プログラムであって、前記撮像装置が備えるコンピュータに、被写体に合焦した状態で得られた第1の画像と前記被写体を除く前記背景に合焦した状態で得られた第2の画像に応じて前記被写体の領域および前記背景の領域を判別して領域判別結果を出力する判別ステップと、前記領域判別結果に応じて前記第1の画像又は前記第2の画像における背景にぼかし処理を施して背景ぼかし画像を生成するぼかし処理ステップと、前記第1の画像と前記背景ぼかし画像とを合成して前記背景ぼかし画像を生成する合成ステップと、被写界深度に応じて、前記判別ステップによる領域の判別が可能であるか否かを判定する判定ステップと、前記判定ステップで前記判別ステップによる領域の判別が不可であると判定されると焦点距離を前記領域の判別が可能である焦点距離に変更して、当該変更後の焦点距離によって前記撮像手段を制御して前記第1の画像および前記第2の画像を得る制御ステップと、を実行させることを特徴とする。   The control program according to the present invention is used in an imaging apparatus that includes an imaging unit that captures a plurality of images by changing a focus position, and generates a background blurred image in which a background is blurred according to the plurality of images. A control program according to a first image obtained in a state where the subject is in focus and a second image obtained in a state where the background excluding the subject is in focus on a computer included in the imaging apparatus. A discrimination step of discriminating the area of the subject and the background area and outputting an area discrimination result; and performing a blurring process on the background in the first image or the second image according to the area discrimination result A blur processing step for generating a background blurred image, a combining step for generating the background blurred image by combining the first image and the background blurred image, and a depth of field. Next, a determination step for determining whether or not the region can be determined by the determination step, and a determination of whether or not the determination of the region by the determination step is impossible in the determination step, the focal length is A control step of changing the focal length to a discriminable state and controlling the imaging means according to the changed focal length to obtain the first image and the second image. To do.

本発明によれば、煩雑な操作を行うことなく背景をぼかした撮影を行いたいユーザは容易に背景ぼかし画像を得ることができる。   According to the present invention, a user who wants to perform shooting with a blurred background without performing complicated operations can easily obtain a blurred background image.

本発明の第1の実施形態による撮像装置の一例についてその構成を示すブロック図である。1 is a block diagram illustrating a configuration of an example of an imaging apparatus according to a first embodiment of the present invention. 図1に示すカメラにおける被写界深度を説明するための図である。It is a figure for demonstrating the depth of field in the camera shown in FIG. 図2に示す前方被写界深度および後方被写界深度を求める計算式を示す図である。It is a figure which shows the calculation formula which calculates | requires the front depth of field and back depth of field shown in FIG. 図1に示すカメラで行われる背景ぼかし画像の生成のアルゴリズムを説明するためのフローチャートである。3 is a flowchart for explaining an algorithm for generating a background blurred image performed by the camera shown in FIG. 1. 焦点距離を推奨焦点距離に変更した際の画角の変動を示す図である。It is a figure which shows the fluctuation | variation of a view angle at the time of changing a focal distance into a recommended focal distance. 図1に示す画像処理回路で生成される切り出しマップの一例を示す図である。It is a figure which shows an example of the clipping map produced | generated by the image processing circuit shown in FIG. 本発明の第2の実施形態によるカメラで行われる画像合成を説明するための図である。It is a figure for demonstrating the image composition performed with the camera by the 2nd Embodiment of this invention. 図7に示す切り出しマップの画角拡張を説明するための図であり、(a)は拡張したエリアをすべて背景領域とする例を示す図、(b)は原領域情報の上下左右の4辺を拡張する例を示す図、(c)は被写体領域検出を行う例を示す図、(d)は被写体と同一色領域を同一の被写体領域であるとみなす例を示す図である。8A and 8B are diagrams for explaining an expansion of the angle of view of the cut-out map illustrated in FIG. 7, in which FIG. 7A is a diagram illustrating an example in which all expanded areas are background areas, and FIG. (C) is a diagram illustrating an example of subject area detection, and (d) is a diagram illustrating an example in which the same color area as the subject is regarded as the same subject area.

以下、本発明の実施の形態による撮像装置の一例について図面を参照して説明する。   Hereinafter, an example of an imaging apparatus according to an embodiment of the present invention will be described with reference to the drawings.

[第1の実施形態]
図1は、本発明の第1の実施形態による撮像装置の一例についてその構成を示すブロック図である。
[First Embodiment]
FIG. 1 is a block diagram showing the configuration of an example of an imaging apparatus according to the first embodiment of the present invention.

図示の撮像装置は、例えば、デジタルカメラ(以下単にカメラと呼ぶ)であり、光学系1を有している。光学系1は複数のレンズ群と絞り機構とを備え、レンズ群には測距用レンズおよびズーム用レンズが含まれている。光学系1を介して入射した光学像は、CCD又はCMOSイメージセンサなどの撮像素子2に結像する。この撮像素子2にはA/D変換器が含まれており、その表面には、例えば、ベイヤー配列のRGBカラーフィルタに覆われ、カラー撮影が可能となっている。   The illustrated imaging apparatus is, for example, a digital camera (hereinafter simply referred to as a camera) and has an optical system 1. The optical system 1 includes a plurality of lens groups and a diaphragm mechanism, and the lens group includes a distance measuring lens and a zoom lens. An optical image incident through the optical system 1 is formed on an image sensor 2 such as a CCD or CMOS image sensor. The image pickup device 2 includes an A / D converter, and the surface thereof is covered with, for example, an RGB color filter having a Bayer array, so that color photographing is possible.

撮像素子2は光学像に応じた電気信号(アナログ信号)を生成し、A/D変換器によって当該アナログ信号をデジタル信号(画像データ)に変換して、メモリ3に記録する。このメモリ3には上記の画像データの他、画像処理に必要なデータおよび画像処理済みの画像データ(処理済み画像データ)が保存される。   The image sensor 2 generates an electrical signal (analog signal) corresponding to the optical image, converts the analog signal into a digital signal (image data) by an A / D converter, and records the signal in the memory 3. In addition to the above-described image data, the memory 3 stores data necessary for image processing and image processed image data (processed image data).

画像処理回路4はメモリ3に記録された画像データに対して所定の画素補間処理および色変換処理などの画像処理を行う。また、画像処理回路4は画像データについて画像切り出し処理および変倍処理によって所謂電子ズームを行う。   The image processing circuit 4 performs image processing such as predetermined pixel interpolation processing and color conversion processing on the image data recorded in the memory 3. The image processing circuit 4 performs so-called electronic zoom on the image data by image cutout processing and scaling processing.

さらに、画像処理回路4は画像データに応じて所定の演算処理を行い、システム制御部5は当該演算処理によって得られた演算結果に基づいて適正露出になるようにシャッター速度および絞り値を求めるとともに、被写体に合焦するようにフォーカスレンズ(ズーム用レンズ)の駆動量を求める。そして、システム制御部5はシャッター速度、絞り値、および駆動量に応じて露光制御部6、測距制御部7、および焦点距離制御部8を制御する。なお、システム制御部5はカメラ全体の制御を司る。   Further, the image processing circuit 4 performs a predetermined calculation process according to the image data, and the system control unit 5 obtains the shutter speed and the aperture value so as to obtain an appropriate exposure based on the calculation result obtained by the calculation process. Then, the drive amount of the focus lens (zoom lens) is obtained so as to focus on the subject. Then, the system control unit 5 controls the exposure control unit 6, the distance measurement control unit 7, and the focal length control unit 8 according to the shutter speed, the aperture value, and the driving amount. The system control unit 5 controls the entire camera.

加えて、画像処理回路04は画像データの解析、フィルタ処理、および合成処理などを行って、後述するアルゴリズムに応じて背景ぼかし画像を生成する。   In addition, the image processing circuit 04 performs image data analysis, filter processing, synthesis processing, and the like, and generates a background blurred image according to an algorithm described later.

露光制御部6は、システム制御部5の制御下で光学系1に備えられた絞り機構、撮像素子2の露光時間、および撮影感度を制御して適正露光を行う。測距制御部7は、システム制御部5の制御下で光学系1に備えられた測距レンズを制御する。焦点距離制御部8は、システム制御部5の制御下で光学系1に備えられたズーム用レンズを制御して焦点距離を変更する。   The exposure controller 6 controls the aperture mechanism provided in the optical system 1, the exposure time of the image sensor 2, and the imaging sensitivity under the control of the system controller 5 to perform proper exposure. The ranging control unit 7 controls the ranging lens provided in the optical system 1 under the control of the system control unit 5. The focal length control unit 8 controls the zoom lens provided in the optical system 1 under the control of the system control unit 5 to change the focal length.

画像処理回路4で画像処理された処理済み画像データは圧縮回路9に与えられる。圧縮回路9は当該処理済み画像データをJPEGなどの圧縮画像データとして、圧縮画像データを記録媒体10に記録する。   The processed image data subjected to the image processing by the image processing circuit 4 is given to the compression circuit 9. The compression circuit 9 records the processed image data on the recording medium 10 as compressed image data such as JPEG.

なお、メモリ3に保存された処理済み画像データは、LCD又は外部モニタなどの表示部11に与えられ、表示部11は処理済み画像データに応じた画像を画面表示する。   The processed image data stored in the memory 3 is given to a display unit 11 such as an LCD or an external monitor, and the display unit 11 displays an image corresponding to the processed image data on the screen.

ところで、背景ぼかし処理を行う際には、カメラは合焦位置の異なる複数枚の画像の撮影を行う(この撮影をピント振り撮影と呼ぶ)。つまり、カメラは合焦位置を変化させて複数枚の画像の撮影を行う。   By the way, when performing the background blurring process, the camera shoots a plurality of images having different in-focus positions (this shooting is referred to as “focus shake shooting”). That is, the camera takes a plurality of images by changing the focus position.

このピント振り撮影においては、主要被写体に合焦した状態の画像(以下第1の画像と呼ぶ)を少なくとも一枚撮影して、背景領域と被写体領域との分離処理を行うため、主要被写体以外の背景(又はもしくは前景)に合焦した状態の画像(以下第2の画像と呼ぶ)を少なくとも一枚撮影する。   In this focus shooting, since at least one image in the state of focusing on the main subject (hereinafter referred to as the first image) is taken and separation processing of the background area and the subject area is performed, At least one image in the state focused on the background (or foreground) (hereinafter referred to as a second image) is taken.

第2の画像を撮影する際には、予め定められた移動量だけフォーカスレンズを遠側にずらして撮影してもよいし、無限遠に合焦するようにフォーカスレンズを移動させてもよい。また、撮影待機中に取得した画像データに応じて、画像処理回路4が画角内における主被写体の位置を推定して、当該推定結果に応じて、システム制御部5が主要被写体以外の領域を仮に背景と設定して、当該背景にピントが合うようにフォーカス制御を行って撮影を行うようにしてもよい。   When shooting the second image, the focus lens may be shifted to the far side by a predetermined amount of movement, or the focus lens may be moved to focus on infinity. Further, the image processing circuit 4 estimates the position of the main subject within the angle of view in accordance with the image data acquired during shooting standby, and the system control unit 5 determines an area other than the main subject in accordance with the estimation result. Temporarily, a background may be set, and focus control may be performed so that the background is in focus.

一方、後述するように、第1の画像および第2の画像のエッジを抽出してその差分から被写体領域と背景領域とを分離する際には、当然のことながら第2の画像と第1の画像との間でエッジに差があることが必要である。   On the other hand, as will be described later, when the edges of the first image and the second image are extracted and the subject area and the background area are separated from the difference, of course, the second image and the first image are separated. It is necessary that there is a difference in edge from the image.

図2は、図1に示すカメラにおける被写界深度を説明するための図である。なお、図2において、光学系(つまり、レンズ)および撮像素子はそれぞれ参照番号100および101で示されている。   FIG. 2 is a diagram for explaining the depth of field in the camera shown in FIG. In FIG. 2, the optical system (that is, the lens) and the image sensor are denoted by reference numerals 100 and 101, respectively.

いま、撮像素子101の撮像面から主要被写体(以下単に被写体と呼ぶ)102までの距離(被写体距離)をD、撮像面から背景103までの距離(背景距離)をDbとする。そして、被写体102に合焦して(ピントを合わせて)撮影を行うものとする。この際の焦点距離をfとする。   Now, let D be the distance (subject distance) from the imaging surface of the image sensor 101 to the main subject (hereinafter simply referred to as the subject) 102, and Db be the distance from the imaging surface to the background 103 (background distance). Then, it is assumed that shooting is performed with the subject 102 in focus (in focus). The focal length at this time is assumed to be f.

被写体102と前方の許容錯乱円104との距離が前方被写界深度L1であり、被写体102と後方の許容錯乱円104との距離が後方被写界深度L2である。そして、被写体深度Lは、L=L1+L2となる。   The distance between the subject 102 and the front permissible circle of confusion 104 is the front depth of field L1, and the distance between the subject 102 and the back permissible circle of confusion 104 is the rear depth of field L2. The subject depth L is L = L1 + L2.

図示のように、同一の被写界深度L内に被写体102と背景103とが存在する場合には、それらのエッジに差が生じない。よって、被写体102と背景103とを分離することが難しい。   As shown in the figure, when the subject 102 and the background 103 exist within the same depth of field L, there is no difference between their edges. Therefore, it is difficult to separate the subject 102 and the background 103.

図3は、図2に示す前方被写界深度L1および後方被写界深度L2を求める計算式を示す図である。   FIG. 3 is a diagram showing a calculation formula for obtaining the front depth of field L1 and the rear depth of field L2 shown in FIG.

図3において、式(1)は前方被写界深度を求めるための計算式であり、式(2)は後方被写界深度を求めるための計算式である。式(1)および(2)において、kdは許容錯乱円104の径であり、ここでkは定数(例えば、2)、dは撮像素子101の画素ピッチである。また、Fは絞り値を示す。   In FIG. 3, Expression (1) is a calculation expression for obtaining the front depth of field, and Expression (2) is a calculation expression for obtaining the rear depth of field. In Expressions (1) and (2), kd is the diameter of the allowable circle of confusion 104, where k is a constant (for example, 2), and d is the pixel pitch of the image sensor 101. F represents the aperture value.

図4は、図1に示すカメラで行われる背景ぼかし画像の生成のアルゴリズムを説明するためのフローチャートである。   FIG. 4 is a flowchart for explaining an algorithm for generating a background blurred image performed by the camera shown in FIG.

背景ぼかしモードによる撮影を開始すると、システム制御部5は測距によって得られた被写体の推定距離(つまり、被写体距離D)に基づいて、図3に示す式(1)および(2)によって被写界深度Lを算出する。そして、システム制御部5は被写界深度Lに基づいて現在の撮影条件において背景ぼかし画像が生成可能であるか否かを判定する(被写界深度判定:ステップS101)。   When shooting in the background blur mode is started, the system control unit 5 captures the image by the equations (1) and (2) shown in FIG. 3 based on the estimated distance of the subject (that is, the subject distance D) obtained by the distance measurement. The depth of field L is calculated. Then, the system control unit 5 determines whether or not a background blurred image can be generated under the current shooting conditions based on the depth of field L (depth of field determination: step S101).

図3に示す式(1)および(2)において、画素ピッチdおよび定数kは撮影環境によって固定値であり、被写体距離Dは測距によって得られる。さらに、絞り値Fはカメラで設定されるので既知である。なお、被写界深度Lを浅くするため、一般に、背景ぼかしモードの際には開放F値が用いられる。   In equations (1) and (2) shown in FIG. 3, the pixel pitch d and the constant k are fixed values depending on the shooting environment, and the subject distance D is obtained by distance measurement. Further, the aperture value F is known because it is set by the camera. In order to reduce the depth of field L, generally, an open F value is used in the background blur mode.

被写界深度判定の際には、システム制御部5は、測距によって得られた背景の推定距離(背景距離)Dbが次の(3)式を満たす場合に背景ぼかし処理が可能であると判定する。
Db>D+L/2+α (3)
When determining the depth of field, the system control unit 5 determines that the background blurring process is possible when the estimated background distance (background distance) Db obtained by distance measurement satisfies the following expression (3). judge.
Db> D + L / 2 + α (3)

ここで、αは設計値に基づく定数であって、α=0の時には背景103が少なくとも被写界深度Lの外に存在することを意味する。αを大きく設定すると、後述する焦点距離変更の際の画角変動が大きくなるが、式(3)式を満たした場合の背景分離の精度が向上する。一方、αを小さく設定すると、焦点距離変更の際の画角変動は小さくなるが、背景分離の精度は低下する。   Here, α is a constant based on the design value, and when α = 0, it means that the background 103 exists at least outside the depth of field L. When α is set to a large value, the angle of view changes when the focal length is changed, which will be described later, but the accuracy of background separation is improved when Expression (3) is satisfied. On the other hand, if α is set small, the angle of view variation when changing the focal length becomes small, but the accuracy of the background separation decreases.

なお、被写体および背景の推定距離は、撮影待機においてAF情報から求めるようにしてもよく、また、被写体が人物である場合には画面における人物の顔の大きさに応じて推定距離を求めてもよい。さらには、外部の測距センサなどを用いて推定距離を求めるようにしてもよい。   Note that the estimated distance between the subject and the background may be obtained from the AF information during shooting standby, and when the subject is a person, the estimated distance may be obtained according to the size of the person's face on the screen. Good. Furthermore, the estimated distance may be obtained using an external distance measuring sensor or the like.

背景距離Dbが上記の式(3)を満たさないと判定すると(ステップS101において、NO)、システム制御部5は上記の式(3)を満たすための推奨焦点距離f’を算出する(ステップS102)。   If it is determined that the background distance Db does not satisfy the above equation (3) (NO in step S101), the system control unit 5 calculates a recommended focal length f ′ for satisfying the above equation (3) (step S102). ).

前述の式(1)および(2)で得られる被写界深度Lを小さくするためには、絞り値Fを小さくするか又は焦点距離fを大きくすればよい。しかしながら、前述したように、背景ぼかしモードにおいては、一般に絞り値Fを開放値とするので、絞り値によって被写界深度Lを調整することは困難である。よって、システム制御部5は焦点距離fを変更して被写界深度Lを調整して、式(3)式を満たす推奨焦点距離f’を算出する。   In order to reduce the depth of field L obtained by the above equations (1) and (2), the aperture value F may be reduced or the focal length f may be increased. However, as described above, in the background blur mode, since the aperture value F is generally set to an open value, it is difficult to adjust the depth of field L with the aperture value. Therefore, the system control unit 5 adjusts the depth of field L by changing the focal length f, and calculates a recommended focal length f ′ that satisfies Equation (3).

但し、式(3)を満たさない状況では背景103と被写体103との深度差が小さいので、撮影待機におけるAF情報などを用いて被写体距離Dおよび背景距離Dbを推定すると、被写体距離Dおよび背景距離Dbが正確に求められず、D=Dbとなってしまうことがある。   However, since the depth difference between the background 103 and the subject 103 is small in a situation where Expression (3) is not satisfied, the subject distance D and the background distance are estimated when the subject distance D and the background distance Db are estimated using AF information in shooting standby. Db may not be obtained accurately and D = Db.

この場合には、式(2)を満たす推奨焦点距離f’を直接的に求めることは困難であるので、システム制御部5は所定量f_sだけ焦点距離を変更して、再度被写体距離Dおよび背景距離Dbを求めて、推奨焦点距離f’を算出する。   In this case, since it is difficult to directly obtain the recommended focal length f ′ satisfying Expression (2), the system control unit 5 changes the focal length by a predetermined amount f_s, and again the subject distance D and the background. A distance Db is obtained, and a recommended focal length f ′ is calculated.

次に、システム制御部5は、焦点距離を推奨焦点距離f’に変更して撮影を行うことが可能であるか否かを判定する(焦点距離変更判定:ステップS103)。焦点距離を変更することは画角が変動することを意味するので、ユーザが撮影したい構図から大きく外れてしまう可能性がある。   Next, the system control unit 5 determines whether it is possible to perform imaging by changing the focal length to the recommended focal length f ′ (focal length change determination: step S103). Changing the focal length means that the angle of view fluctuates, so there is a possibility that the user will deviate greatly from the composition that the user wants to photograph.

図5は焦点距離を推奨焦点距離に変更した際の画角の変動を示す図である。   FIG. 5 is a diagram illustrating the change in the angle of view when the focal length is changed to the recommended focal length.

焦点距離変更判定の際には、システム制御部5は画像処理回路4およびメモリ3を介して、変更前の画角200に対して変更後の画角(推奨焦点距離で撮影した際の画角)201を表示部11に被写体202とともに表示する。これによって、システム制御部5はユーザに当該画角201で撮影を行うか否かの指示を促す。ユーザが操作部(図示せず)から了解の旨の指示を入力すると、システム制御部5は推奨焦点距離で撮影を行うことが可能であると判定する。   When determining the focal length change, the system control unit 5 uses the image processing circuit 4 and the memory 3 to change the angle of view after the change to the angle of view 200 before the change (the angle of view when shooting at the recommended focal length). ) 201 is displayed on the display unit 11 together with the subject 202. As a result, the system control unit 5 prompts the user to instruct whether to shoot at the angle of view 201. When the user inputs an instruction to the effect from the operation unit (not shown), the system control unit 5 determines that shooting can be performed at the recommended focal length.

なお、ユーザの指示によることなく、変更前後の焦点距離の変動量Δf=f−f’が所定の閾値未満であると、システム制御部5は推奨焦点距離で撮影を行うことが可能であると判定するようにしてもよい。また、例えば、被写体が人物である場合には、カメラに備えられた顔検出部(図示せず)によって検出された被写体の顔位置およびサイズに基づいて、システム制御部5は焦点距離を変更した際に被写体の一部が画角の外に出てしまうと判定すると、推奨焦点距離で撮影を行うことが不可であると判定するようにしてもよい。   It should be noted that the system control unit 5 can perform shooting at the recommended focal length when the variation Δf = f−f ′ of the focal length before and after the change is less than a predetermined threshold without being directed by the user. You may make it determine. For example, when the subject is a person, the system control unit 5 changes the focal length based on the face position and size of the subject detected by a face detection unit (not shown) provided in the camera. At this time, if it is determined that a part of the subject goes out of the angle of view, it may be determined that it is impossible to perform shooting at the recommended focal length.

推奨焦点距離f’における撮影が不可であると判定すると(ステップS103において、NO)、システム制御部5は背景ぼかしモードを中止して、通常撮影モードに移行して、撮影を実行する(ステップS104。そして、システム制御部5は撮影を終了する。   If it is determined that shooting at the recommended focal length f ′ is not possible (NO in step S103), the system control unit 5 stops the background blur mode, shifts to the normal shooting mode, and executes shooting (step S104). Then, the system control unit 5 ends the photographing.

一方、推奨焦点距離f’における撮影が可であると判定すると(ステップS103において、YES)、システム制御部5はピント振り撮影を実行して、合焦位置を異ならせて複数枚の画像を撮影する(ステップS105)。ステップS105では、システム制御部5は焦点距離制御部8に焦点距離を推奨焦点距離f’に変更する旨を指示する。これによって、焦点距離制御部8は焦点距離が推奨焦点距離とf’となる位置にズームレンズを制御する。   On the other hand, if it is determined that photographing at the recommended focal length f ′ is possible (YES in step S103), the system control unit 5 performs focus photographing and photographs a plurality of images with different focus positions. (Step S105). In step S105, the system control unit 5 instructs the focal length control unit 8 to change the focal length to the recommended focal length f '. Accordingly, the focal length control unit 8 controls the zoom lens to a position where the focal length becomes the recommended focal length and f ′.

なお、ステップS101において、背景距離Dbが上記の式(3)を満たすと判定すると(ステップS101において、YES)、システム制御部5はステップS105に進んでピント振り撮影を行う。また、ステップS105においては、前述のように、第1の画像を少なくとも一枚、そして、背景寄りに合焦位置をずらした第2の画像を少なくとも一枚撮影する。   If it is determined in step S101 that the background distance Db satisfies the above equation (3) (YES in step S101), the system control unit 5 proceeds to step S105 and performs focus shake shooting. In step S105, as described above, at least one first image and at least one second image with the focus position shifted toward the background are photographed.

上述のようにして、ピント振り撮影を行った後、システム制御部5の制御下で、画像処理回路4は第1の画像および第2の画像の各々についてそのエッジを抽出する(ステップS107)。エッジを抽出する際には、例えば、第1の画像および第2の画像の各々にバンドパスフィルタ処理を施して、その出力の絶対値を求め、当該絶対値に応じてエッジを抽出してエッジ画像とする。以下の説明では、第1の画像に係るエッジ画像を第1のエッジ画像と呼び、第2の画像に係るエッジ画像を第2のエッジ画像と呼ぶ。   As described above, after performing focus swing shooting, the image processing circuit 4 extracts the edge of each of the first image and the second image under the control of the system control unit 5 (step S107). When extracting an edge, for example, each of the first image and the second image is subjected to bandpass filter processing to obtain an absolute value of the output, and the edge is extracted according to the absolute value to obtain an edge. An image. In the following description, the edge image related to the first image is called a first edge image, and the edge image related to the second image is called a second edge image.

続いて、画像処理回路4は第1のエッジ画像から第2のエッジ画像を画素毎に減算して、エッジ差分画像を生成する(ステップS108)。さらに、画像処理回路4はエッジ差分画像を複数の領域に分割して、領域毎にその画素値(エッジ量)を積分して積分値(領域積分値)を求める。   Subsequently, the image processing circuit 4 subtracts the second edge image for each pixel from the first edge image to generate an edge difference image (step S108). Further, the image processing circuit 4 divides the edge difference image into a plurality of regions and integrates the pixel value (edge amount) for each region to obtain an integrated value (region integrated value).

次に、画像処理回路4は領域積分値に応じて領域判別を行う(ステップS109)。ここでは、領域積分値が予め定められた閾値を超えていると、画像処理回路4は当該領域積分値に係る領域が被写体領域であるとする。一方、領域積分値が閾値以下であると、画像処理回路4は当該領域積分値に係る領域が背景領域であるとして、領域判別結果を示す領域情報を生成する。なお、上記の閾値はエッジのヒストグラム分布から適応的に求めるようにしてもよい。   Next, the image processing circuit 4 performs area discrimination according to the area integration value (step S109). Here, if the area integration value exceeds a predetermined threshold, the image processing circuit 4 assumes that the area related to the area integration value is a subject area. On the other hand, if the area integration value is equal to or smaller than the threshold value, the image processing circuit 4 generates area information indicating the area determination result, assuming that the area related to the area integration value is the background area. Note that the threshold value may be obtained adaptively from the histogram distribution of edges.

続いて、画像処理回路4は、上記の領域情報に基づいて、被写体領域と背景領域とを分離する切り出しマップを生成する(ステップS110)。この切り出しマップは画像合成の際の合成比率を示すものである。   Subsequently, the image processing circuit 4 generates a cut-out map that separates the subject area and the background area based on the area information (step S110). This cut-out map shows a composition ratio at the time of image composition.

図6は、図1に示す画像処理回路4で生成される切り出しマップの一例を示す図である。   FIG. 6 is a diagram showing an example of a cut-out map generated by the image processing circuit 4 shown in FIG.

図6に示す例では、切り出しマップは、被写体領域を”1”、背景領域を”0”、その境界領域を0.5として、合成比率を0〜1の値で表現する。なお、切り出しマップの生成の際には、領域境界の段差を目立たなくするため境界領域にローパスフィルタによる平滑化処理を行うようにしてもよい。   In the example illustrated in FIG. 6, the cut-out map represents the composition ratio as a value of 0 to 1, where “1” is the subject area, “0” is the background area, and 0.5 is the boundary area. When generating the cut-out map, a smoothing process using a low-pass filter may be performed on the boundary region in order to make the step at the region boundary inconspicuous.

次に、画像処理回路4は第1の画像又は第2の画像にぼかし処理(ぼかしフィルタ処理)を施して、ぼかし処理画像を生成する(ステップS111)。ぼかし処理の際には、第1の画像又は第2の画像に対して二次元フィルタリング処理が行われる。さらに、画像処理回路4はぼかし処理画像と第1の画像とを切り出しマップに応じて画像合成する(ステップS112)。   Next, the image processing circuit 4 performs blurring processing (blurring filter processing) on the first image or the second image to generate a blurring processed image (step S111). In the blurring process, a two-dimensional filtering process is performed on the first image or the second image. Further, the image processing circuit 4 combines the blurred image and the first image according to the cutout map (step S112).

ここで、図4に示すステップS112で行われる画像合成処理の一例について説明する。   Here, an example of the image composition process performed in step S112 illustrated in FIG. 4 will be described.

画像処理回路4は、切り出しマップの合成比率α(0≦α≦1)を参照して、第1の画像(IMG1)とぼかし処理画像(IMG2)とを式(4)に応じて、合成して合成画像B[i,j]を背景ぼかし画像として生成する(i,jは座標)。
B[i,j]=IMG1[i,j]*α[i,j]+IMG2[i,j]*(1−α) (4)
The image processing circuit 4 synthesizes the first image (IMG1) and the blurred image (IMG2) according to the equation (4) with reference to the cutout map synthesis ratio α (0 ≦ α ≦ 1). Thus, the composite image B [i, j] is generated as a background blurred image (i, j are coordinates).
B [i, j] = IMG1 [i, j] * α [i, j] + IMG2 [i, j] * (1-α) (4)

画像処理回路4における画像合成が終了すると、システム制御部5は撮影を終了する。   When the image composition in the image processing circuit 4 is finished, the system control unit 5 finishes photographing.

このように、本発明の第1の実施形態では、撮影の際に背景ぼかし処理の可否を判定して、焦点距離を変更するようにしたので、背景ぼかしモードの際に背景ぼかし画像を生成する頻度を向上させることができる。   As described above, in the first embodiment of the present invention, since the focal length is changed by determining whether or not the background blur processing is possible at the time of shooting, the background blur image is generated in the background blur mode. The frequency can be improved.

なお、第1の実施形態では、第1の画像および第2の画像の2枚の画像から切り出しマップを生成するようにしたが、被写体よりも前側に焦点をずらした画像も用いて切り出しマップを生成するようにしてもよい。   In the first embodiment, the cutout map is generated from the two images of the first image and the second image. However, the cutout map is also generated using an image whose focus is shifted in front of the subject. You may make it produce | generate.

[第2の実施形態]
続いて、本発明の第2の実施形態による撮像装置(カメラ)の一例について説明する。なお、第2の実施形態による撮像装置の構成は図1に示す撮像装置と同様である。
[Second Embodiment]
Subsequently, an example of an imaging apparatus (camera) according to the second embodiment of the present invention will be described. The configuration of the imaging apparatus according to the second embodiment is the same as that of the imaging apparatus shown in FIG.

第2の実施形態によるカメラにおいても、図2に示すフローチャートに応じて撮影が行われるが、ここでは、推奨焦点距離f’(第1の焦点距離)で被写体に合焦した状態の画像(第1の画像)および推奨焦点距離f’で背景に合焦した状態の画像(第2の画像)の他に、変更前の焦点距離f(第2の焦点距離)で被写体に合焦した状態第3の画像を用いて、背景ぼかし画像(合成画像)を生成する。図2に関連して説明したように、ステップS107〜S110の処理において、第1および第2の画像を用いて、切り出しマップが生成される。   The camera according to the second embodiment also performs shooting according to the flowchart shown in FIG. 2, but here, an image (first image) in a state where the subject is focused at the recommended focal length f ′ (first focal length). 1) and an image focused on the background at the recommended focal length f ′ (second image), and a state where the subject is focused on at the focal length f (second focal length) before the change. 3 is used to generate a background-blurred image (synthesized image). As described with reference to FIG. 2, in the processes of steps S <b> 107 to S <b> 110, a cutout map is generated using the first and second images.

なお、第3の画像において背景は被写体に合焦した際の被写界深度に入っているので、実質的に第3の画像においては背景も合焦した状態にある。   Note that since the background in the third image is within the depth of field when the subject is focused, the background is substantially in focus in the third image.

図7は、本発明の第2の実施形態によるカメラで行われる画像合成を説明するための図である。   FIG. 7 is a view for explaining image composition performed by the camera according to the second embodiment of the present invention.

前述のように、図2に示すステップS110の処理において、第1の画像300と第2の画像301とに応じて切り出しマップ304が生成される。画像処理回路4は、システム制御部5の制御下において焦点距離fで撮影された第3の画像302と同一の画角に切り出しマップ304を拡張して、第3の画像302と同一の画角の切り出しマップ305を生成する。   As described above, the cutout map 304 is generated according to the first image 300 and the second image 301 in the process of step S110 illustrated in FIG. The image processing circuit 4 extends the cutout map 304 to the same angle of view as the third image 302 photographed at the focal length f under the control of the system control unit 5, and has the same angle of view as the third image 302. A cutout map 305 is generated.

図8は、図7に示す切り出しマップの画角拡張を説明するための図である。そして、図8(a)は拡張したエリアをすべて背景領域とする例を示す図であり、図8(b)は原領域情報の上下左右の4辺を拡張する例を示す図である。また、図8(c)は被写体領域検出を行う例を示す図であり、図8(d)は被写体と同一色領域を同一の被写体領域であるとみなす例を示す図である。   FIG. 8 is a diagram for explaining field angle expansion of the cut-out map shown in FIG. FIG. 8A is a diagram illustrating an example in which all expanded areas are used as background regions, and FIG. 8B is a diagram illustrating an example in which four sides on the top, bottom, left, and right of the original region information are expanded. FIG. 8C is a diagram illustrating an example in which subject area detection is performed, and FIG. 8D is a diagram illustrating an example in which the same color area as the subject is regarded as the same subject area.

切り出しマップ304を第3の画像302と同一の画角に拡張すると、拡張前の領域(原領域)801と拡張後の領域(拡張領域)802が存在する(図8(a)参照)。この場合、画像処理回路4は拡張領域(拡張エリア)801の全てを背景領域に設定する。   When the cutout map 304 is expanded to the same angle of view as that of the third image 302, a region (original region) 801 before expansion and a region (expansion region) 802 after expansion exist (see FIG. 8A). In this case, the image processing circuit 4 sets all of the extended area (extended area) 801 as the background area.

また、図8(b)に示すように、画像処理回路4は原領域801の上下左右の4辺をそれぞれラインコピーによって拡張して、その四隅を背景領域とするようにしてもよい。   Further, as shown in FIG. 8B, the image processing circuit 4 may expand the four sides of the original area 801 on the top, bottom, left, and right sides by line copy so that the four corners become background areas.

さらには、画像処理回路4は、Canny法などのエッジ検出手法によって被写体のエッジを検出し、図8(c)に示すように、被写体のエッジ804と画面端に囲まれた領域803を同一の被写体領域であるとして、被写体領域の検出を行うようにしてもよい。加えて、画像処理回路4は、図8(d)に示すように、被写体と同一の色領域805を同一の被写体領域であるとみなすようにしてもよい。   Further, the image processing circuit 4 detects the edge of the subject by an edge detection method such as the Canny method, and as illustrated in FIG. The subject area may be detected as being the subject area. In addition, as shown in FIG. 8D, the image processing circuit 4 may regard the same color area 805 as the subject as the same subject area.

そして、画像処理回路4は拡張後の切り出しマップ305、第3の画像302、およびステップS111で生成されるぼかし処理画像を用いて、合成画像(背景ぼかし画像)306を生成する。   Then, the image processing circuit 4 generates a composite image (background blurred image) 306 using the expanded cutout map 305, the third image 302, and the blurred image generated in step S111.

第2の実施形態においては、まず、図2に示すステップS111の処理において、画像処理回路4は第3の画像302に対してぼかしフィルタ処理を行って、ぼかし処理画像303を生成する。   In the second embodiment, first, in the process of step S <b> 111 shown in FIG. 2, the image processing circuit 4 performs a blur filter process on the third image 302 to generate a blur processed image 303.

次に、図2に示すステップS112において、画像処理回路4はぼかし処理画像303と第3の画像302とを拡張後の切り出しマップ305に応じて画像合成して、背景ぼかし画像306を生成する。ここでは、拡張後の切り出しマップ305の合成比率α(0≦α≦1)に基づいて、第3の画像302(IMG1)と背景ぼかし処理画像303(IMG2)とを、前述の式(4)に応じて合成して、合成画像である背景ぼかし画像306B[i,j]を生成する(i,jは座標)。   Next, in step S <b> 112 shown in FIG. 2, the image processing circuit 4 combines the blurred image 303 and the third image 302 according to the expanded cutout map 305 to generate a background blurred image 306. Here, based on the composition ratio α (0 ≦ α ≦ 1) of the expanded cutout map 305, the third image 302 (IMG1) and the background blurred image 303 (IMG2) are expressed by the above-described equation (4). And a background blurred image 306B [i, j], which is a composite image, is generated (i and j are coordinates).

このように、本発明の第2の実施形態においても、撮影の際に背景ぼかし処理の可否を判定して、焦点距離を変更するようにしたので、所望の画角を維持して背景ぼかしモードの際に背景ぼかし画像を生成する頻度を向上させることができる。   As described above, also in the second embodiment of the present invention, since the focal length is changed by determining whether or not the background blur processing is performed at the time of shooting, the background blur mode is maintained while maintaining a desired angle of view. In this case, the frequency of generating the background blurred image can be improved.

上述の説明から明らかなように、図1に示す例においては、システム制御部5および画像処理回路4が判別手段、ぼかし処理手段、合成手段、および判定手段として機能する。また、システム制御部5および焦点距離制御部8は制御手段として機能する。さらに、システム制御部5および画像処理回路4は変更手段として機能する。なお、少なくとも光学系1および撮像素子が撮像手段を構成する。   As is clear from the above description, in the example shown in FIG. 1, the system control unit 5 and the image processing circuit 4 function as a determination unit, a blur processing unit, a combining unit, and a determination unit. Further, the system control unit 5 and the focal length control unit 8 function as control means. Furthermore, the system control unit 5 and the image processing circuit 4 function as changing means. Note that at least the optical system 1 and the imaging element constitute imaging means.

以上、本発明について実施の形態に基づいて説明したが、本発明は、これらの実施の形態に限定されるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。   As mentioned above, although this invention was demonstrated based on embodiment, this invention is not limited to these embodiment, Various forms of the range which does not deviate from the summary of this invention are also contained in this invention. .

例えば、上記の実施の形態の機能を制御方法として、この制御方法を撮像装置に実行させるようにすればよい。また、上述の実施の形態の機能を有するプログラムを制御プログラムとして、当該制御プログラムを撮像装置が備えるコンピュータに実行させるようにしてもよい。なお、制御プログラムは、例えば、コンピュータに読み取り可能な記録媒体に記録される。   For example, the function of the above embodiment may be used as a control method, and this control method may be executed by the imaging apparatus. Further, a program having the functions of the above-described embodiments may be used as a control program, and the control program may be executed by a computer included in the imaging apparatus. The control program is recorded on a computer-readable recording medium, for example.

上記の制御方法および制御プログラムの各々は、少なくとも判別ステップ、ぼかし処理ステップ、合成ステップ、判定ステップ、および制御ステップを有している。   Each of the above control method and control program has at least a determination step, a blurring processing step, a synthesis step, a determination step, and a control step.

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

1 光学系
2 撮像素子
3 メモリ
4 画像処理回路
5 システム制御部
6 露光制御部
7 測距制御部
8 焦点距離制御部
9 圧縮回路
10 記録媒体
DESCRIPTION OF SYMBOLS 1 Optical system 2 Image pick-up element 3 Memory 4 Image processing circuit 5 System control part 6 Exposure control part 7 Distance control part 8 Focal length control part 9 Compression circuit 10 Recording medium

Claims (8)

合焦位置を変化させて複数枚の画像を撮影する撮像手段を備え、前記複数の画像に応じて背景をぼかし処理した背景ぼかし処理画像を生成する撮像装置であって、
被写体に合焦した状態で得られた第1の画像と前記被写体を除く前記背景に合焦した状態で得られた第2の画像に応じて前記被写体の領域および前記背景の領域を判別して領域判別結果を出力する判別手段と、
前記領域判別結果に応じて前記第1の画像又は前記第2の画像における背景にぼかし処理を施して背景ぼかし画像を生成するぼかし処理手段と、
前記第1の画像と前記背景ぼかし画像とを合成して前記背景ぼかし画像を生成する合成手段と、
被写界深度に応じて、前記判別手段による領域の判別が可能であるか否かを判定する判定手段と、
前記判定手段によって前記判別手段による領域の判別が不可であると判定されると焦点距離を前記領域の判別が可能である焦点距離に変更して、当該変更後の焦点距離によって前記撮像手段を制御して前記第1の画像および前記第2の画像を得る制御手段と、
を有することを特徴とする撮像装置。
An imaging apparatus that includes an imaging unit that captures a plurality of images by changing a focus position, and that generates a background blurred image in which a background is blurred according to the plurality of images,
The region of the subject and the region of the background are discriminated according to the first image obtained in focus on the subject and the second image obtained in focus on the background excluding the subject. Discriminating means for outputting an area discrimination result;
Blur processing means for performing a blur process on the background of the first image or the second image according to the region determination result to generate a background blurred image;
Combining means for combining the first image and the background blurred image to generate the background blurred image;
A determination unit that determines whether or not the determination unit can determine a region according to a depth of field;
When the determination unit determines that the region cannot be determined by the determination unit, the focal length is changed to a focal length that allows the region to be determined, and the imaging unit is controlled by the changed focal length. Control means for obtaining the first image and the second image;
An imaging device comprising:
前記変更後の焦点距離は前記被写体に合焦した際の被写界深度に前記背景が入らない焦点距離であることを特徴とする請求項1に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the changed focal length is a focal length at which the background does not enter a depth of field when the subject is focused. 前記制御手段は、少なくとも前記変更後の焦点距離で撮影を行った際の画角を表示部に表示することを特徴とする請求項1又は2に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the control unit displays at least a field angle when photographing is performed at the changed focal length on the display unit. 前記制御手段は、変更前後の焦点距離の変動量が所定の閾値未満であると、前記変更後の焦点距離で撮影を行うことが可能であると判定することを特徴とする請求項1又は2に記載の撮像装置。   3. The control unit according to claim 1, wherein if the amount of change in focal length before and after the change is less than a predetermined threshold, it is determined that photographing can be performed at the focal length after the change. The imaging device described in 1. 前記制御手段は、前記変更後の焦点距離で撮影すると少なくとも前記被写体の一部が画角の外に出てしまう場合に、前記変更後の焦点距離で撮影を行うことが不可であると判定することを特徴とする請求項1又は2に記載の撮像装置。   The control means determines that it is impossible to perform imaging at the changed focal length when at least a part of the subject comes out of the angle of view when shooting at the changed focal length. The imaging apparatus according to claim 1 or 2, wherein 合焦位置を変化させて複数枚の画像を撮影する撮像手段を備え、前記複数の画像に応じて背景をぼかし処理した背景ぼかし処理画像を生成する撮像装置であって、
第1の焦点距離で被写体に合焦した状態で得られた第1の画像と前記第1の焦点距離で前記被写体を除く前記背景に合焦した状態で得られた第2の画像とに応じて、前記被写体の領域および前記背景の領域を判別して領域判別結果を出力する判別手段と、
前記被写体に合焦した際の被写界深度に応じて、前記判別手段による領域の判別が可能であるか否かを判定する判定手段と、
前記第1の焦点距離と異なりかつ前記被写界深度に前記背景が入る第2の焦点距離で撮影した際に得られる第3の画像における背景にぼかし処理を施して背景ぼかし画像を生成するぼかし処理手段と、
前記領域判別結果を前記第2の焦点距離による画角に応じて変更して変更後の領域判別結果とする変更手段と、
前記変更後の領域判別結果に応じて前記第3の画像と前記背景ぼかし画像とを合成して前記背景ぼかし画像を生成する合成手段と、
前記判定手段によって前記判別手段による領域の判別が不可である判定されると前記第2の焦点距離を前記第1の焦点距離に変更して、前記第1の焦点距離によって前記撮像手段を制御して前記第1の画像および前記第2の画像を得る制御手段と、
を有することを特徴とする撮像装置。
An imaging apparatus that includes an imaging unit that captures a plurality of images by changing a focus position, and that generates a background blurred image in which a background is blurred according to the plurality of images,
According to a first image obtained in the state of focusing on the subject at the first focal length and a second image obtained in the state of focusing on the background excluding the subject at the first focal length. Discriminating means for discriminating the area of the subject and the area of the background and outputting an area discrimination result;
A determination unit that determines whether or not the determination unit can determine a region according to a depth of field when the subject is focused;
A blur that generates a background-blurred image by performing a blurring process on a background in a third image obtained when shooting at a second focal length that is different from the first focal length and the background falls within the depth of field Processing means;
Changing means for changing the area determination result according to the angle of view by the second focal length to obtain a changed area determination result;
Combining means for generating the background blurred image by combining the third image and the background blurred image according to the area determination result after the change;
If the determination means determines that the determination by the determination means is impossible, the second focal length is changed to the first focal length, and the imaging means is controlled by the first focal length. Control means for obtaining the first image and the second image;
An imaging device comprising:
合焦位置を変化させて複数枚の画像を撮影する撮像手段を備え、前記複数の画像に応じて背景をぼかし処理した背景ぼかし処理画像を生成する撮像装置の制御方法であって、
被写体に合焦した状態で得られた第1の画像と前記被写体を除く前記背景に合焦した状態で得られた第2の画像に応じて前記被写体の領域および前記背景の領域を判別して領域判別結果を出力する判別ステップと、
前記領域判別結果に応じて前記第1の画像又は前記第2の画像における背景にぼかし処理を施して背景ぼかし画像を生成するぼかし処理ステップと、
前記第1の画像と前記背景ぼかし画像とを合成して前記背景ぼかし画像を生成する合成ステップと、
被写界深度に応じて、前記判別ステップによる領域の判別が可能であるか否かを判定する判定ステップと、
前記判定ステップで前記判別ステップによる領域の判別が不可であると判定されると焦点距離を前記領域の判別が可能である焦点距離に変更して、当該変更後の焦点距離によって前記撮像手段を制御して前記第1の画像および前記第2の画像を得る制御ステップと、
を有することを特徴とする制御方法。
An imaging apparatus control method comprising: an imaging unit that captures a plurality of images by changing a focus position, and generating a background blurred image in which a background is blurred according to the plurality of images,
The region of the subject and the region of the background are discriminated according to the first image obtained in focus on the subject and the second image obtained in focus on the background excluding the subject. A discrimination step for outputting an area discrimination result;
A blur processing step of generating a background blur image by performing a blur process on the background in the first image or the second image according to the region determination result;
Combining the first image and the background blurred image to generate the background blurred image;
A determination step for determining whether or not the region can be determined by the determination step according to a depth of field;
If it is determined in the determination step that the region cannot be determined in the determination step, the focal length is changed to a focal length that allows the region to be determined, and the imaging unit is controlled by the changed focal length. A control step of obtaining the first image and the second image;
A control method characterized by comprising:
合焦位置を変化させて複数枚の画像を撮影する撮像手段を備え、前記複数の画像に応じて背景をぼかし処理した背景ぼかし処理画像を生成する撮像装置で用いられる制御プログラムであって、
前記撮像装置が備えるコンピュータに、
被写体に合焦した状態で得られた第1の画像と前記被写体を除く前記背景に合焦した状態で得られた第2の画像に応じて前記被写体の領域および前記背景の領域を判別して領域判別結果を出力する判別ステップと、
前記領域判別結果に応じて前記第1の画像又は前記第2の画像における背景にぼかし処理を施して背景ぼかし画像を生成するぼかし処理ステップと、
前記第1の画像と前記背景ぼかし画像とを合成して前記背景ぼかし画像を生成する合成ステップと、
被写界深度に応じて、前記判別ステップによる領域の判別が可能であるか否かを判定する判定ステップと、
前記判定ステップで前記判別ステップによる領域の判別が不可であると判定されると焦点距離を前記領域の判別が可能である焦点距離に変更して、当該変更後の焦点距離によって前記撮像手段を制御して前記第1の画像および前記第2の画像を得る制御ステップと、
を実行させることを特徴とする制御プログラム。
A control program that includes an imaging unit that captures a plurality of images by changing the in-focus position, and that is used in an imaging device that generates a background blurred image in which a background is blurred according to the plurality of images,
In the computer provided in the imaging device,
The region of the subject and the region of the background are discriminated according to the first image obtained in focus on the subject and the second image obtained in focus on the background excluding the subject. A discrimination step for outputting an area discrimination result;
A blur processing step of generating a background blur image by performing a blur process on the background in the first image or the second image according to the region determination result;
Combining the first image and the background blurred image to generate the background blurred image;
A determination step for determining whether or not the region can be determined by the determination step according to a depth of field;
If it is determined in the determination step that the region cannot be determined in the determination step, the focal length is changed to a focal length that allows the region to be determined, and the imaging unit is controlled by the changed focal length A control step of obtaining the first image and the second image;
A control program characterized by causing
JP2012288033A 2012-12-28 2012-12-28 Imaging apparatus, control method of the same, and control program Pending JP2014131188A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012288033A JP2014131188A (en) 2012-12-28 2012-12-28 Imaging apparatus, control method of the same, and control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012288033A JP2014131188A (en) 2012-12-28 2012-12-28 Imaging apparatus, control method of the same, and control program

Publications (1)

Publication Number Publication Date
JP2014131188A true JP2014131188A (en) 2014-07-10

Family

ID=51409204

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012288033A Pending JP2014131188A (en) 2012-12-28 2012-12-28 Imaging apparatus, control method of the same, and control program

Country Status (1)

Country Link
JP (1) JP2014131188A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107635093A (en) * 2017-09-18 2018-01-26 维沃移动通信有限公司 A kind of image processing method, mobile terminal and computer-readable recording medium
CN107948519A (en) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 Image processing method, device and equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107635093A (en) * 2017-09-18 2018-01-26 维沃移动通信有限公司 A kind of image processing method, mobile terminal and computer-readable recording medium
CN107948519A (en) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 Image processing method, device and equipment
CN107948519B (en) * 2017-11-30 2020-03-27 Oppo广东移动通信有限公司 Image processing method, device and equipment
US10997696B2 (en) 2017-11-30 2021-05-04 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Image processing method, apparatus and device

Similar Documents

Publication Publication Date Title
US9313419B2 (en) Image processing apparatus and image pickup apparatus where image processing is applied using an acquired depth map
JP5460173B2 (en) Image processing method, image processing apparatus, image processing program, and imaging apparatus
JP4497211B2 (en) Imaging apparatus, imaging method, and program
KR101847392B1 (en) Image processing apparatus and method for controlling the same
JP2008271241A (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
US9865064B2 (en) Image processing apparatus, image processing method, and storage medium
JP2011029905A (en) Imaging device, method and program
JP2008271240A (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP6472183B2 (en) Image processing apparatus, control method thereof, and program
JP7158180B2 (en) Image processing device, image processing method, program, storage medium
JP5144724B2 (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP2014235224A (en) Imaging device and control program
JP2023033355A (en) Image processing device and control method therefor
JP2014131188A (en) Imaging apparatus, control method of the same, and control program
JP7198055B2 (en) Image processing device, its control method, and program
JP2012142729A (en) Camera
JP2014138378A (en) Image pickup device, control method thereof, and control program thereof
JP6029464B2 (en) Imaging device, control method thereof, and control program
JP2015118274A (en) Imaging device, imaging device control method, and program
JP5871590B2 (en) Imaging apparatus and control method thereof
JP2014175703A (en) Imaging apparatus, control method for the same, and program
US20220358667A1 (en) Image processing apparatus and method, and image capturing apparatus and control method thereof, and storage medium
US20230179860A1 (en) Image processing device, imaging device, method of controlling image processing device, and storage medium
JP2008263386A (en) Still image pickup apparatus
JP2016178632A (en) Imaging device, image processing device and image processing method