JP2023033355A - Image processing device and control method therefor - Google Patents

Image processing device and control method therefor Download PDF

Info

Publication number
JP2023033355A
JP2023033355A JP2022212105A JP2022212105A JP2023033355A JP 2023033355 A JP2023033355 A JP 2023033355A JP 2022212105 A JP2022212105 A JP 2022212105A JP 2022212105 A JP2022212105 A JP 2022212105A JP 2023033355 A JP2023033355 A JP 2023033355A
Authority
JP
Japan
Prior art keywords
image
subject
focus
distance
image processing
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
JP2022212105A
Other languages
Japanese (ja)
Inventor
裕紀子 久保
Yukiko Kubo
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 JP2022212105A priority Critical patent/JP2023033355A/en
Publication of JP2023033355A publication Critical patent/JP2023033355A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)
  • Exposure Control For Cameras (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing device for assisting capturing of images with various depths of field, and to provide a control method therefor.
SOLUTION: An image processing device is configured to acquire distance information indicative of a distribution of distances to scenes captured in an image, and then determine a plurality of aperture values to be used in bracket shooting with different apertures on the basis of the distance information.
SELECTED DRAWING: Figure 3
COPYRIGHT: (C)2023,JPO&INPIT

Description

本発明は、画像処理装置およびその制御方法に関する。 The present invention relates to an image processing apparatus and its control method.

被写界深度が浅い(狭い)条件で主被写体を撮影することにより背景や前景をボカし、主被写体を協調した画像を得る方法が知られている。また、前景と背景についてはボケた画像を、主被写体については合焦した画像を取得して合成することにより、指定した仮想の絞り値に対応した被写界深度の画像を生成する方法も提案されている(特許文献1)。 A method is known in which the background and foreground are blurred by photographing the main subject with a shallow (narrow) depth of field to obtain an image in which the main subject is in harmony. We also proposed a method to generate an image with a depth of field corresponding to a specified virtual aperture value by combining blurred images of the foreground and background and a focused image of the main subject. (Patent Document 1).

特開2003-209727号公報Japanese Patent Application Laid-Open No. 2003-209727

特許文献1の方法を用いることで、撮影環境や撮像装置による制約を受けない被写界深度の画像を得ることができる。しかしながら、被写界深度は絞り値だけでなく、合焦距離やレンズの焦点距離(画角)にも依存するため、所望の画像を得るために設定する仮想の絞り値を決定することは容易でない。また、複数枚の画像を合成するため、被写体が動くと合成画像の品質が低下する。 By using the method of Patent Document 1, it is possible to obtain an image with a depth of field that is not restricted by the imaging environment or imaging apparatus. However, since the depth of field depends not only on the aperture value, but also on the focusing distance and the focal length (angle of view) of the lens, it is easy to determine the virtual aperture value to set to obtain the desired image. not. Also, since a plurality of images are synthesized, the quality of the synthesized image deteriorates when the subject moves.

本発明はこのような従来技術の課題に鑑みてなされたものである。したがって、本発明の目的は、様々な被写界深度を有する画像の撮影を支援する画像処理装置及びその制御方法を提供することにある。 The present invention has been made in view of such problems of the prior art. SUMMARY OF THE INVENTION Accordingly, it is an object of the present invention to provide an image processing apparatus and a control method thereof that support shooting of images having various depths of field.

上述の目的は、撮影された画像と、画像に撮影されたシーンの距離の分布を表す距離情報とを取得する取得手段と、距離情報に基づいて、絞りを異ならせるブラケット撮影において用いる複数の絞り値を決定する制御手段と、を有することを特徴とする画像処理装置によって達成される。 The above-mentioned object is an acquisition means for acquiring a photographed image and distance information representing the distribution of the distance of the scene photographed in the image, and a plurality of diaphragms used in bracket photography in which the aperture is changed based on the distance information. and control means for determining the value.

本発明によれば、様々な被写界深度を有する画像の撮影を支援する画像処理装置及びその制御方法を提供することができる。 According to the present invention, it is possible to provide an image processing apparatus and a control method thereof that support shooting of images having various depths of field.

実施形態に係る画像処理装置の一例であるデジタルカメラの機能構成例を示すブロック図1 is a block diagram showing a functional configuration example of a digital camera as an example of an image processing apparatus according to an embodiment; FIG. 実施形態におけるブラケット撮影時の動作に関するフローチャートFlowchart relating to operations during bracket shooting in the embodiment シーン解析部の動作を説明するための模式図Schematic diagram for explaining the operation of the scene analysis unit シーン解析部の動作を説明するための模式図Schematic diagram for explaining the operation of the scene analysis unit ボケ量算出部の操作を説明するための模式図Schematic diagram for explaining the operation of the bokeh amount calculator ボケ量算出部の操作を説明するための模式図Schematic diagram for explaining the operation of the bokeh amount calculator 絞り値の決定方法を説明するための図Diagram for explaining how the aperture value is determined 距離情報の信頼度について説明するための模式図Schematic diagram for explaining the reliability of distance information

以下、添付図面を参照して、本発明の例示的な実施形態を詳細に説明する。なお、本発明は説明する実施形態に限定されない。また、実施形態で説明される構成要素の全てが本発明に必須とは限らない。実施形態における個々の機能ブロックは、プログラマブルロジックや回路部品といったハードウェア、プログラマブルプロセッサが実行可能なソフトウェア、またはそれらハードウェアとソフトウェアとの組み合わせによって実現することができる。また、1つの機能ブロックは複数のハードウェアで実現されてもよい。また、1つのハードウェアが複数の機能ブロックを実現してもよい。また、1つ以上の機能ブロックは、1つ以上のプログラマブルプロセッサ(CPU、MPUなど)がメモリに読み込まれたコンピュータプログラムを実行することにより実現されてもよい。 Exemplary embodiments of the invention will now be described in detail with reference to the accompanying drawings. It should be noted that the invention is not limited to the described embodiments. Also, not all of the components described in the embodiments are essential to the present invention. Individual functional blocks in the embodiments can be realized by hardware such as programmable logic and circuit components, software executable by a programmable processor, or a combination of these hardware and software. Also, one functional block may be realized by multiple pieces of hardware. Also, one piece of hardware may implement a plurality of functional blocks. Also, one or more functional blocks may be implemented by one or more programmable processors (CPU, MPU, etc.) executing a computer program loaded into memory.

以下、添付図面を参照して、本発明をその例示的な実施形態に基づいて詳細に説明する。なお、説明する実施形態は単なる例示であり、本発明の範囲を限定するものではない。例えば、以下では本発明をデジタルカメラに適用した実施形態を説明する。しかし、デジタルカメラは本発明を適用可能な画像処理装置の一例にすぎない。本発明は任意の電子機器において実施可能である。このような電子機器には、デジタルカメラやデジタルビデオカメラといった撮像装置はもちろん、パーソナルコンピュータ、タブレット端末、携帯電話機、ゲーム機、ドライブレコーダ、ロボット、ドローンなどが含まれるが、これらに限定されない。なお、本発明には撮影機能は必須でなく、外部の撮像装置から画像を取得して撮影条件を決定し、外部の撮像装置による撮影動作を制御する装置で実施することもできる。 The invention will now be described in detail on the basis of its exemplary embodiments with reference to the accompanying drawings. It should be noted that the described embodiments are merely examples and do not limit the scope of the present invention. For example, an embodiment in which the present invention is applied to a digital camera will be described below. However, a digital camera is only one example of an image processing device to which the present invention can be applied. The present invention can be implemented in any electronic device. Such electronic devices include, but are not limited to, imaging devices such as digital cameras and digital video cameras, as well as personal computers, tablet terminals, mobile phones, game machines, drive recorders, robots, and drones. Note that the present invention does not require a photographing function, and can be implemented by a device that obtains an image from an external imaging device, determines photographing conditions, and controls the photographing operation of the external photographing device.

(デジタルカメラの構成)
図1は実施形態に係るデジタルカメラ100の機能構成例を示すブロック図である。デジタルカメラ100は動画および静止画の撮影ならびに記録が可能である。デジタルカメラ100内の各機能ブロックは、バス160を介して互いに通信可能に接続されている。デジタルカメラ100の動作は、主制御部151が有する1つ以上のプログラマブルプロセッサが例えばROM155に記憶されているプログラムをRAM154に読み込んで実行し、各機能ブロックを制御することにより実現される。また、特に記載が無い限り、各機能ブロックは、ASICなどのハードウェア回路、もしくは、1つ以上のプログラマブルプロセッサがプログラムをメモリに読み込んで実行することにより実現することができる。
(Configuration of digital camera)
FIG. 1 is a block diagram showing a functional configuration example of a digital camera 100 according to an embodiment. The digital camera 100 can shoot and record moving and still images. Each functional block within the digital camera 100 is communicably connected to each other via a bus 160 . The operation of the digital camera 100 is realized by one or more programmable processors of the main control unit 151 reading, for example, a program stored in the ROM 155 into the RAM 154 and executing the program to control each functional block. Moreover, unless otherwise specified, each functional block can be implemented by a hardware circuit such as an ASIC, or by one or more programmable processors reading a program into a memory and executing it.

撮影レンズ101(レンズユニット)は、固定1群レンズ102、ズームレンズ111、絞り103、固定3群レンズ121、フォーカスレンズ131、ズームモータ(ZM)112、絞りモータ(AM)104、およびフォーカスモータ(FM)132を有する。固定1群レンズ102、ズームレンズ111、絞り103、固定3群レンズ121、フォーカスレンズ131は撮影光学系を構成する。なお、便宜上レンズ102、111、121、131を1枚のレンズとして図示しているが、それぞれ複数のレンズで構成されてもよい。また、撮影レンズ101は撮像装置100から取り外し可能な交換レンズとして構成されてもよい。 The taking lens 101 (lens unit) includes a fixed 1st group lens 102, a zoom lens 111, an aperture 103, a fixed 3rd group lens 121, a focus lens 131, a zoom motor (ZM) 112, an aperture motor (AM) 104, and a focus motor ( FM) 132. A fixed 1st group lens 102, a zoom lens 111, an aperture 103, a fixed 3rd group lens 121, and a focus lens 131 constitute a photographing optical system. Although the lenses 102, 111, 121, and 131 are illustrated as one lens for convenience, they may each be composed of a plurality of lenses. Also, the photographing lens 101 may be configured as an interchangeable lens that can be removed from the imaging device 100 .

絞り制御部105は、主制御部151の命令にしたがって絞りモータ104の動作を制御し、絞り103の開口径を変更する。
ズーム制御部113は、主制御部151の命令にしたがってズームモータ112の動作を制御し、撮影レンズ101の焦点距離(画角)を変更する。
The aperture control unit 105 controls the operation of the aperture motor 104 according to the command from the main control unit 151 to change the aperture diameter of the aperture 103 .
The zoom control unit 113 controls the operation of the zoom motor 112 according to commands from the main control unit 151 to change the focal length (angle of view) of the photographing lens 101 .

フォーカス制御部133は、例えば撮像素子141から得られる1対の焦点検出用信号の位相差に基づいて撮影レンズ101のデフォーカス量およびデフォーカス方向を算出する。そしてフォーカス制御部133は、デフォーカス量およびデフォーカス方向をフォーカスモータ132の駆動量および駆動方向に変換する。この駆動量および駆動方向に基づいてフォーカス制御部133はフォーカスモータ132の動作を制御し、フォーカスレンズ131を駆動することにより、撮影レンズ101の焦点状態を制御する。 The focus control unit 133 calculates the defocus amount and the defocus direction of the photographing lens 101 based on the phase difference between the pair of focus detection signals obtained from the image sensor 141, for example. The focus control unit 133 then converts the defocus amount and defocus direction into the drive amount and drive direction of the focus motor 132 . The focus control unit 133 controls the operation of the focus motor 132 based on the drive amount and the drive direction, and drives the focus lens 131 to control the focus state of the photographing lens 101 .

このように、フォーカス制御部133は位相差検出方式の自動焦点検出(AF)を実施するが、フォーカス制御部133は撮像素子141から得られる画像信号のコントラスト評価値に基づくコントラスト検出方式のAFを実行してもよい。また、撮像素子141とは別個に設けたAFセンサから得られる焦点検出用信号を用いて位相差検出方式のAFを実行してもよい。なお、フォーカス制御部133におけるAF動作において、後述する画像処理部152が検出する主被写体の領域に焦点検出領域を設定することができる。 In this manner, the focus control unit 133 performs automatic focus detection (AF) using a phase difference detection method. may be executed. Alternatively, phase difference detection AF may be performed using a focus detection signal obtained from an AF sensor provided separately from the imaging device 141 . In the AF operation of the focus control section 133, the focus detection area can be set to the area of the main subject detected by the image processing section 152, which will be described later.

撮影レンズ101によって撮像素子141の結像面に形成される被写体像は、撮像素子141に配置された複数の画素のそれぞれが有する光電変換素子により電気信号(画像信号)に変換される。本実施形態では、撮像素子141に、水平方向にm、垂直方向にn(n,mは複数)の画素が行列状に配置されており、各画素には2つの光電変換素子(光電変換領域)が設けられている。撮像素子141からの信号読み出しは、主制御部151からの指示に従ってセンサ制御部143が制御する。 A subject image formed on the imaging plane of the imaging element 141 by the imaging lens 101 is converted into an electric signal (image signal) by a photoelectric conversion element of each of a plurality of pixels arranged on the imaging element 141 . In this embodiment, m pixels in the horizontal direction and n pixels in the vertical direction (where n and m are plural) are arranged in a matrix in the image sensor 141, and each pixel has two photoelectric conversion elements (photoelectric conversion regions). ) is provided. Signal reading from the imaging device 141 is controlled by the sensor control section 143 according to instructions from the main control section 151 .

個々の画素が有する2つの光電変換領域を領域Aおよび領域Bと呼び、個々の画素の領域Aから読み出した画像信号群からなる画像をA画像、個々の画素の領域Bから読み出した画像信号群からなる画像をB画像と呼ぶ。また、A画像とB画像を画素単位で加算した画像をA+B画像と呼ぶ。A画像とB画像は視差画像対を形成する。表示や記録にはA+B画像を用いる。また、位相差検出方式のAFに用いる焦点検出用信号の生成や、距離マップの生成にはA画像とB画像を用いる。 The two photoelectric conversion regions of each pixel are called region A and region B. An image composed of a group of image signals read out from region A of each pixel is called A image, and a group of image signals read out from region B of each pixel. is called a B-image. An image obtained by adding the A image and the B image pixel by pixel is called an A+B image. The A and B images form a parallax image pair. A+B images are used for display and recording. Further, the A image and the B image are used to generate a focus detection signal used in phase difference detection AF and to generate a distance map.

撮像素子141から読み出された画像信号は信号処理部142に供給される。信号処理部142は、画像信号にノイズ低減処理、A/D変換処理、自動利得制御処理などの信号処理を適用し、画像データとしてセンサ制御部143に出力する。センサ制御部143は信号処理部142から受信した画像データをRAM(ランダム・アクセス・メモリ)154に蓄積する。 An image signal read out from the imaging element 141 is supplied to the signal processing section 142 . The signal processing unit 142 applies signal processing such as noise reduction processing, A/D conversion processing, and automatic gain control processing to the image signal, and outputs the image signal to the sensor control unit 143 as image data. The sensor control unit 143 stores the image data received from the signal processing unit 142 in a RAM (random access memory) 154 .

RAM154に保存された画像データを記録する場合、主制御部151は画像データに例えば所定のヘッダを追加するなどして、記録形式に応じたデータファイルを生成する。この際、主制御部151は必要に応じて圧縮解凍部153で画像データを符号化し、符号化データをデータファイルに格納する。主制御部151は、生成したデータファイルを例えばメモリカードのような記録媒体157に記録する。 When recording the image data stored in the RAM 154, the main control unit 151 adds, for example, a predetermined header to the image data to generate a data file according to the recording format. At this time, the main control unit 151 encodes the image data in the compression/decompression unit 153 as necessary, and stores the encoded data in the data file. The main controller 151 records the generated data file in a recording medium 157 such as a memory card.

また、RAM154に保存された画像データを表示する場合、主制御部151は表示部150での表示サイズに適合するように画像データを画像処理部152でスケーリングした後、RAM154のうちビデオメモリとして用いる領域(VRAM領域)に書き込む。表示部150は、RAM154のVRAM領域から表示用の画像データを読み出し、例えばLCDや有機ELディスプレイなどの表示装置に表示する。表示部150では、画像処理部152が検出した主被写体(動体)の検出結果(主被写体領域を示す枠など)も表示する。 When displaying the image data stored in the RAM 154, the main control unit 151 scales the image data in the image processing unit 152 so as to fit the display size of the display unit 150, and then uses the RAM 154 as a video memory. Write to the area (VRAM area). The display unit 150 reads image data for display from the VRAM area of the RAM 154, and displays it on a display device such as an LCD or an organic EL display. The display unit 150 also displays the detection result of the main subject (moving object) detected by the image processing unit 152 (the frame indicating the main subject area, etc.).

デジタルカメラ100は、動画撮影時(撮影スタンバイ状態や動画記録中)に、撮影された動画を表示部150に即時表示することにより、表示部150を電子ビューファインダー(EVF)として機能させる。表示部150をEVFとして機能させる際に表示する動画およびそのフレーム画像を、ライブビュー画像もしくはスルー画像と呼ぶ。また、デジタルカメラ100は、静止画撮影を行った場合、撮影結果をユーザが確認できるように、直前に撮影した静止画を一定時間表示部150に表示する。これらの表示動作についても、主制御部151の制御によって実現される。 The digital camera 100 causes the display unit 150 to function as an electronic viewfinder (EVF) by immediately displaying the captured moving image on the display unit 150 during moving image capturing (shooting standby state or moving image recording). A moving image and its frame images displayed when the display unit 150 functions as an EVF are called a live view image or a through image. Further, when a still image is captured, the digital camera 100 displays the last captured still image on the display unit 150 for a certain period of time so that the user can confirm the result of the capturing. These display operations are also realized under the control of the main control unit 151 .

圧縮解凍部153は画像データを符号化したり復号したりする。例えば静止画や動画を記録する場合、予め定められた符号化方式によって画像データや音声データを符号化する。また、記録媒体157に記録された静止画データファイルや動画データファイルを再生する際、圧縮解凍部153は符号化データを復号してRAM154に格納する。 A compression/decompression unit 153 encodes and decodes image data. For example, when recording still images and moving images, image data and audio data are encoded by a predetermined encoding method. Also, when reproducing a still image data file or a moving image data file recorded on the recording medium 157 , the compression/decompression unit 153 decodes the encoded data and stores it in the RAM 154 .

RAM154はプログラムを実行するためのシステムメモリ、ビデオメモリ、バッファメモリなどとして用いられる。
ROM155は主制御部151のプロセッサが実行可能なプログラム、各種の設定値、デジタルカメラ100の固有情報、GUIデータなどを記憶する。ROM155は電気的に書き換え可能であってよい。
The RAM 154 is used as system memory, video memory, buffer memory, etc. for executing programs.
The ROM 155 stores programs that can be executed by the processor of the main control unit 151, various setting values, unique information of the digital camera 100, GUI data, and the like. The ROM 155 may be electrically rewritable.

操作部156は、ユーザがデジタルカメラ100に指示を入力するためのスイッチ、ボタン、キー、タッチパネルなどの入力デバイス群の総称である。操作部156を通じた入力はバス160を通じて主制御部151が検知し、主制御部151は入力に応じた動作を実現するために各部を制御する。 The operation unit 156 is a general term for a group of input devices such as switches, buttons, keys, and touch panels for the user to input instructions to the digital camera 100 . An input through the operation unit 156 is detected by the main control unit 151 through the bus 160, and the main control unit 151 controls each unit in order to realize operations according to the input.

主制御部151は例えばCPUやMPUなどのプログラマブルプロセッサを1つ以上有し、例えばROM155に記憶されたプログラムをRAM154に読み込んで実行することにより各部を制御し、デジタルカメラ100の機能を実現する。主制御部151はまた、被写体輝度の情報に基づいて露出条件(シャッタースピードもしくは蓄積時間、絞り値、感度)を自動的に決定するAE処理を実行する。被写体輝度の情報は例えば画像処理部152から取得することができる。主制御部151は、例えば人物の顔など、特定被写体の領域の輝度情報に基づいて露出条件を決定することもできる。 The main control unit 151 has one or more programmable processors such as a CPU and an MPU, and controls each unit by reading a program stored in the ROM 155 into the RAM 154 and executing it, thereby realizing the functions of the digital camera 100 . The main control unit 151 also executes AE processing for automatically determining exposure conditions (shutter speed or accumulation time, aperture value, sensitivity) based on subject brightness information. Information on subject brightness can be acquired from the image processing unit 152, for example. The main control unit 151 can also determine exposure conditions based on luminance information of a specific subject area such as a person's face.

主制御部151は、動画撮影時には絞り103は固定とし、電子シャッタスピード(蓄積時間)とゲインの大きさで露出を制御する。主制御部151は決定した蓄積時感とゲインの大きさをセンサ制御部143に通知する。センサ制御部143は通知された露出条件に従った撮影が行われるように撮像素子141の動作を制御する。 The main control unit 151 fixes the aperture 103 during moving image shooting, and controls the exposure based on the electronic shutter speed (accumulation time) and the magnitude of the gain. The main control unit 151 notifies the sensor control unit 143 of the determined sense of accumulation and the magnitude of the gain. The sensor control unit 143 controls the operation of the imaging device 141 so that shooting is performed according to the notified exposure conditions.

距離マップ生成部161(距離検出手段)は、例えばRAM154に保存された画像データを用いて距離マップを生成する。距離マップは、撮影範囲内に存在する物体のデジタルカメラ100からの距離(被写体距離)の分布を示す情報である。距離マップは例えば輝度値が被写体距離を表す2次元画像の形態であってよく、デプスマップ距離画像、奥行き画像などと呼ばれることもある。距離マップは公知の方法で生成することができる。例えば、距離マップ生成部161は、視差画像(上述したA画像およびB画像)の像ズレ量から各画素位置におけるデフォーカス量(フォーカスレンズの合焦位置からのズレ量およびズレの方向)を求めることができる。デフォーカス量は現在の被写体距離を基準としたピントのズレ量を表すので、デフォーカス量を距離情報と見なすことができる。もちろん、デフォーカス量に基づいてフォーカスレンズの合焦位置を求め、合焦位置に対応する被写体距離を求めてもよい。なお、撮像装置100をステレオカメラのような多眼カメラとして視差画像を取得してもよいし、記憶媒体や外部装置から視差画像を取得してもよい。 The distance map generator 161 (distance detector) generates a distance map using image data stored in the RAM 154, for example. The distance map is information indicating the distribution of distances (object distances) from the digital camera 100 to objects existing within the shooting range. The distance map may be in the form of, for example, a two-dimensional image in which the brightness value represents the object distance, and is sometimes called a depth map distance image, a depth image, or the like. A distance map can be generated by a known method. For example, the distance map generation unit 161 obtains the defocus amount (the amount of deviation from the in-focus position of the focus lens and the direction of deviation) at each pixel position from the amount of image deviation of the parallax images (images A and B described above). be able to. Since the defocus amount represents the amount of defocus based on the current subject distance, the defocus amount can be regarded as distance information. Of course, the in-focus position of the focus lens may be obtained based on the defocus amount, and the object distance corresponding to the in-focus position may be obtained. Note that parallax images may be acquired by using the imaging device 100 as a multi-view camera such as a stereo camera, or parallax images may be acquired from a storage medium or an external device.

また、距離マップは視差画像を用いずに生成することもできる。コントラスト評価値が極大となるフォーカスレンズ位置を画素ごとに求めることで、画素ごとに被写体距離を取得することができる。また、合焦距離を変えて同一シーンを複数回撮影して得られる画像データと光学系の点像分布関数(PSF)とから、ボケ量と距離との相関関係に基づいて画素ごとの距離情報を求めることもできる。距離マップ生成部161は、画像全体に対して距離マップを生成してもよいし、画像のうち、動体検出に必要な部分領域に対してだけ距離マップを生成してもよい。距離マップ生成部161は、生成した距離マップをRAM154に保存する。距離マップは画像処理部152から参照される。 Also, the distance map can be generated without using parallax images. By finding the focus lens position that maximizes the contrast evaluation value for each pixel, the subject distance can be obtained for each pixel. In addition, from the image data obtained by shooting the same scene multiple times with different focal distances and the point spread function (PSF) of the optical system, distance information for each pixel is calculated based on the correlation between the amount of bokeh and the distance. can also be asked for. The distance map generator 161 may generate a distance map for the entire image, or may generate a distance map only for a partial area of the image that is necessary for detecting a moving object. Distance map generator 161 stores the generated distance map in RAM 154 . The distance map is referred to by the image processing unit 152 .

さらに、距離マップ生成部161は、距離マップに領域ごとに信頼度を算出し、距離マップとともに保存することができる。信頼度の算出方法には特に制限はない。例えば、視差画像を用いて距離マップを生成する際、視差画像間の像ズレ量を求めるために、相対的なシフト量を変えながら例えばSADなどの相関量(類似度)を演算し、相関が最大(相関量が最小)になるシフト量を像ズレ量として検出する。算出した相関量の平均値と最大値との差が大きい程、検出した像ズレ量(デフォーカス量)の信頼度は高いと考えられる。したがって、各画素位置で算出した相関量の平均値と最大値との差を、その画素位置信頼度として用いることができる。なお、距離マップ生成部161は、被写体距離やその信頼度を、画素ごとに求める代わりに小領域(画素ブロック)ごとに求めて距離マップを生成してもよい。 Furthermore, the distance map generation unit 161 can calculate the reliability for each area of the distance map and store it together with the distance map. There is no particular limitation on the method of calculating the reliability. For example, when generating a distance map using parallax images, in order to obtain an image shift amount between parallax images, a correlation amount (similarity) such as SAD is calculated while changing the relative shift amount, and the correlation is The amount of shift that maximizes (minimizes the amount of correlation) is detected as the amount of image deviation. It is considered that the larger the difference between the calculated average value and the maximum value of the correlation amount, the higher the reliability of the detected image shift amount (defocus amount). Therefore, the difference between the average value and the maximum value of correlation amounts calculated at each pixel position can be used as the pixel position reliability. Note that the distance map generation unit 161 may generate the distance map by obtaining the subject distance and its reliability for each small area (pixel block) instead of obtaining it for each pixel.

シーン解析部162は、距離マップ生成部161が生成した距離マップと、距離マップの生成に用いた画像とその撮像条件とから、撮影シーンを解析する。シーン解析部162はシーン解析により、例えば、合焦している被写体の位置(像高)とコントラスト情報、および、被写体の認識情報を取得する。例えばシーン解析部162は、距離マップから、合焦している被写体領域が存在する位置(像高)の範囲を検出する。また、シーン解析部162は、合焦している被写体領域の画像に対してバンドパスフィルタを適用してエッジ強度を検出し、その積分値をコントラスト情報として取得することができる。また、シーン解析部162は、画像処理部152による被写体検出結果に基づいて、合焦している被写体領域が人体であるか否かを判定し、判定結果を認識情報とする。シーン解析部162は、取得した情報をRAM154に保存する。 The scene analysis unit 162 analyzes the shooting scene from the distance map generated by the distance map generation unit 161, the image used to generate the distance map, and the imaging conditions thereof. The scene analysis unit 162 acquires, for example, the position (image height) and contrast information of the subject in focus, and the recognition information of the subject by scene analysis. For example, the scene analysis unit 162 detects the range of the position (image height) where the in-focus subject area exists from the distance map. Also, the scene analysis unit 162 can apply a band-pass filter to the image of the focused subject area to detect the edge strength, and acquire the integrated value as the contrast information. Also, the scene analysis unit 162 determines whether or not the focused subject region is a human body based on the result of subject detection by the image processing unit 152, and uses the determination result as recognition information. The scene analysis unit 162 saves the acquired information in the RAM 154 .

ボケ量算出部163は、RAM154に保存されたシーン解析結果に基づいて、背景(非合焦被写体)のボケ量を算出する。ボケ量算出部163の動作の詳細については後述する。 The blur amount calculation unit 163 calculates the blur amount of the background (out-of-focus subject) based on the scene analysis result stored in the RAM 154 . Details of the operation of the blur amount calculation unit 163 will be described later.

画像処理部152は、RAM154に蓄積された画像データに対して予め定められた画像処理を適用する。画像処理部152が適用する画像処理には、ホワイトバランス調整処理、色補間(デモザイク)処理、ガンマ補正処理といった所謂現像処理のほか、信号形式変換処理、スケーリング処理などがあるが、これらに限定されない。さらに、画像処理部152は特定の特徴を有する領域を被写体領域として検出する。特定の特徴を有する領域は、例えば人体の領域や、人間の顔領域であってよい。 The image processing unit 152 applies predetermined image processing to the image data accumulated in the RAM 154 . Image processing applied by the image processing unit 152 includes, but is not limited to, so-called development processing such as white balance adjustment processing, color interpolation (demosaicing) processing, and gamma correction processing, as well as signal format conversion processing and scaling processing. . Furthermore, the image processing unit 152 detects a region having specific characteristics as a subject region. A region with specific features may be, for example, a human body region or a human face region.

検出した被写体領域に関する情報を、他の画像処理(例えばホワイトバランス調整処理や被写体の輝度情報の生成処理など)に利用してもよい。なお、フォーカス制御部133がコントラスト検出方式のAFを行う場合、コントラスト評価値を画像処理部152が生成してフォーカス制御部133に供給することができる。画像処理部152は、処理した画像データや、被写体領域に関する情報などをRAM154に保存する。 Information about the detected subject area may be used for other image processing (for example, white balance adjustment processing, subject brightness information generation processing, etc.). When the focus control unit 133 performs contrast detection AF, the image processing unit 152 can generate a contrast evaluation value and supply it to the focus control unit 133 . The image processing unit 152 stores the processed image data, information about the subject area, and the like in the RAM 154 .

図2は、本実施形態のデジタルカメラ100のフォーカスブラケットモードにおける撮影動作に関するフローチャートである。フォーカスブラケットモードは例えば操作部156を通じたメニュー画面の操作によって設定されてよい。 FIG. 2 is a flowchart relating to the shooting operation in the focus bracket mode of the digital camera 100 of this embodiment. The focus bracket mode may be set by operating a menu screen through the operation unit 156, for example.

図2に示す処理は、撮影スタンバイ状態において例えば操作部156を通じて撮影準備指示が入力されたことに応じて実行されてよい。撮影準備指示は例えばシャッターボタンの半押しであってよい。撮影スタンバイ状態では動画撮影が実施され、表示部150がEVFとして機能しているものとする。 The processing shown in FIG. 2 may be executed in response to a shooting preparation instruction being input through the operation unit 156, for example, in the shooting standby state. The shooting preparation instruction may be, for example, a half-press of the shutter button. It is assumed that moving image shooting is performed in the shooting standby state, and the display unit 150 functions as an EVF.

S201で主制御部151は、EVF表示用に撮影された動画像のデータを距離マップ生成部161に供給し、距離マップ生成部161は距離情報を生成する。なお、距離マップの生成方法に応じて主制御部151は、フォーカス制御部133を通じてフォーカスレンズ131を駆動したり、上述したA画像とB画像のデータを距離マップ生成部161に供給したりする。距離マップ生成部161は、生成した距離情報をシーン解析部162に出力する。また、主制御部151は、上述したA+B画像を画像処理部152に供給する。画像処理部152は、A+B画像に対して被写体検出処理を適用し、検出された被写体領域ごとの、位置、大きさ、信頼度などを被写体検出結果として生成する。また、画像処理部152は、A+B画像から、EVF表示用の画像を生成する。 In S201, the main control unit 151 supplies the moving image data shot for EVF display to the distance map generation unit 161, and the distance map generation unit 161 generates distance information. Note that the main control unit 151 drives the focus lens 131 through the focus control unit 133 or supplies the data of the A image and the B image to the distance map generation unit 161 according to the method of generating the distance map. Distance map generation section 161 outputs the generated distance information to scene analysis section 162 . Also, the main control unit 151 supplies the above-described A+B image to the image processing unit 152 . The image processing unit 152 applies subject detection processing to the A+B image, and generates the position, size, reliability, etc. of each detected subject area as subject detection results. Also, the image processing unit 152 generates an image for EVF display from the A+B image.

S202でシーン解析部162は、距離マップ生成部161から距離情報を取得する。また、シーン解析部162は、距離マップの生成に用いられた画像の撮影条件(合焦距離、絞り値、シャッタースピード、撮影感度など)を主制御部151から取得する。さらにシーン解析部162は、被写体領域の検出結果を画像処理部152から取得する。 In S<b>202 , the scene analysis unit 162 acquires distance information from the distance map generation unit 161 . The scene analysis unit 162 also acquires from the main control unit 151 the image capturing conditions (focus distance, aperture value, shutter speed, image capturing sensitivity, etc.) used to generate the distance map. Furthermore, the scene analysis unit 162 acquires the detection result of the subject area from the image processing unit 152 .

S203でシーン解析部162はシーン解析処理を実行する。シーン解析部162はまず、距離情報を用いて距離範囲を複数に分割する。この際、シーン解析部162は、例えば距離情報から被写体距離のヒストグラムを生成し、生成したヒストグラムに基づいて距離範囲を分割することができる。ヒストグラムの階級数は予め定めておくことができる。シーン解析部162は、例えば、ヒストグラムの度数にピーク(極大点)が存在する場合には、各ピークを被写体の代表距離として、ピークを1つずつ含むように距離範囲を分割することができる。なお、ヒストグラムのピークは、信号波形のピーク検出と同様の方法を利用して検出することができる。 In S203, the scene analysis unit 162 executes scene analysis processing. The scene analysis unit 162 first divides the distance range into multiple parts using the distance information. At this time, the scene analysis unit 162 can generate, for example, a subject distance histogram from the distance information, and divide the distance range based on the generated histogram. The number of histogram classes can be determined in advance. For example, when there is a peak (maximum point) in the frequency of the histogram, the scene analysis unit 162 can divide the distance range so as to include each peak, with each peak as the representative distance of the subject. The peak of the histogram can be detected using the same method as the peak detection of the signal waveform.

例えば、図3のヒストグラム501の度数には3つのピーク322~324が存在する。そのため、シーン解析部162は、各ピークから近距離側でカウント値が最初に極小となる位置で距離範囲を分割する(範囲1~範囲3)。 For example, there are three peaks 322-324 in the frequency of histogram 501 in FIG. Therefore, the scene analysis unit 162 divides the distance range (range 1 to range 3) at the position where the count value first becomes minimum on the short distance side from each peak.

一方、図4のようにピークが1つの場合、シーン解析部162は、ピークを含んだ距離範囲(範囲1)以外の距離範囲(背景の距離範囲)について、複数に分割することができる。例えばシーン解析部162は、背景の距離範囲を予め定められた距離ごとに分割してもよい。あるいは、分割単位を条件に応じて異ならせてもよい。例えば、シーン解析部162は、合焦被写体の距離が至近(所定の距離以下)である場合には、そうでない場合よりも細かく分割することができる。これにより、マクロ撮影時のように被写界深度の浅い撮影において、被写界深度を細かく制御したブラケット撮影が実現できる。 On the other hand, when there is one peak as shown in FIG. 4, the scene analysis unit 162 can divide the distance range (background distance range) other than the distance range (range 1) including the peak into a plurality of parts. For example, the scene analysis unit 162 may divide the distance range of the background by predetermined distances. Alternatively, the division unit may be changed according to conditions. For example, the scene analysis unit 162 can divide more finely when the distance of the focused subject is close (a predetermined distance or less) than when it is not. As a result, bracket photography with a finely controlled depth of field can be achieved in photography with a shallow depth of field, such as macro photography.

また、例えば背景の距離範囲に、変動の少ないカウント値が連続する距離区間がある場合、その区間が同一被写体に対応するのか、複数の被写体に対応するのかによって分割方法を異ならせてもよい。同一被写体に対応すると判定される場合、シーン解析部162は通常よりも細かく分割することができる。一方、異なる被写体に対応すると判定される場合、シーン解析部162は1つの区間に2つの被写体が含まれないように分割することができる。なお、距離ヒストグラムにおけるある距離範囲が同一被写体に対応するか否かは、距離マップにおいてその距離範囲に属する画素の分布に基づいて判定することができる。例えば、分布がある範囲に集中していれば、同一被写体に対応するものと判定することができる。 Further, for example, when there is a distance section in which the count value continues with little fluctuation in the distance range of the background, the dividing method may be changed depending on whether the section corresponds to the same subject or a plurality of subjects. When it is determined that the images correspond to the same subject, the scene analysis unit 162 can divide the images more finely than usual. On the other hand, if it is determined to correspond to different subjects, the scene analysis unit 162 can divide one section so that two subjects are not included. Whether or not a certain distance range in the distance histogram corresponds to the same subject can be determined based on the distribution of pixels belonging to that distance range in the distance map. For example, if the distribution is concentrated in a certain range, it can be determined that they correspond to the same subject.

次に、シーン解析部162は、画像内の被写体領域の位置や大きさ、コントラストを解析する。シーン解析部162は、例えば距離情報のヒストグラムのピークごとに、ピーク位置を含む所定距離範囲に存在する被写体を検出し、被写体の領域および画像中における位置を検出することができる。なお、ここでは被写体領域の位置を、被写体領域の代表位置(例えば重心位置)の像高として検出するものとする。像高は、撮像光学系の光軸と撮像面との交点を原点とした距離である。また、シーン解析部162は、検出した被写体の領域のそれぞれが人物の領域であるか否かを、画像処理部152による被写体検出結果に基づいて判定する。なお、シーン解析部162は、距離情報を用いて画像中の被写体領域およびその位置を検出する代わりに、画像処理部152が検出した被写体領域とその位置を用いてもよい。 Next, the scene analysis unit 162 analyzes the position, size, and contrast of the subject area within the image. For example, the scene analysis unit 162 can detect a subject existing within a predetermined distance range including the peak position for each peak of the distance information histogram, and detect the area of the subject and the position in the image. Here, the position of the subject area is detected as the image height of the representative position (for example, the barycentric position) of the subject area. The image height is the distance with the origin at the intersection of the optical axis of the imaging optical system and the imaging surface. In addition, the scene analysis unit 162 determines whether each of the detected subject regions is a person region based on the subject detection result by the image processing unit 152 . Note that the scene analysis section 162 may use the subject area and its position detected by the image processing section 152 instead of detecting the subject area and its position in the image using the distance information.

また、シーン解析部162は、被写体領域のそれぞれについてのコントラスト情報を取得する。コントラスト情報は例えばエッジ強度の情報であってよい。シーン解析部は、被写体領域内の所定サイズの矩形領域の各画素に対して空間バンドパスフィルタ処理を適用して算出したエッジ強度の積分値を被写体領域のコントラスト情報とする。このコントラスト情報は以下の式(1)によって表すことができ、コントラスト情報の値が大きいほど、被写体領域のコントラストが高いことを示す。

Figure 2023033355000002
fr(i,j):個々の画素のエッジ強度値
Fr:コントラスト情報 The scene analysis unit 162 also acquires contrast information for each subject area. The contrast information may be edge strength information, for example. The scene analysis unit uses the integrated value of the edge intensity calculated by applying the spatial band-pass filtering process to each pixel of a rectangular area of a predetermined size in the subject area as the contrast information of the subject area. This contrast information can be represented by the following formula (1), and the larger the value of the contrast information, the higher the contrast of the subject area.
Figure 2023033355000002
fr(i, j): edge intensity value of individual pixels Fr: contrast information

そして、シーン解析部162は、分割した距離範囲の情報と、被写体領域ごとの画像内の位置、コントラスト情報、人物の領域と判定されたか否かの情報とを、シーン情報としてボケ量算出部163に出力する。 Then, the scene analysis unit 162 uses the divided distance range information, the position in the image of each subject area, the contrast information, and the information as to whether or not the area is determined to be a human area as scene information, and the blur amount calculation unit 163 output to

S204でボケ量算出部163は、シーン情報に基づいて、非合焦被写体もしくは分割範囲ごとのボケ量を算出する。ボケ量算出部163は、シーン情報のうち、1つ以上に基づいてボケ量を算出することができる。
まず、合焦している被写体領域の位置に基づくボケ量の算出例について説明する。ボケ量算出部163は例えば、シーン情報のうち、コントラスト情報が最も大きな被写体領域を合焦している被写体領域と見なすことができる。
In S204, the blur amount calculation unit 163 calculates the blur amount for each out-of-focus subject or divided range based on the scene information. The blur amount calculation unit 163 can calculate the blur amount based on one or more pieces of scene information.
First, an example of calculation of the blur amount based on the position of the in-focus subject area will be described. For example, the blur amount calculation unit 163 can regard the subject area with the largest contrast information among the scene information as the in-focus subject area.

図6は、合焦被写体領域602の位置(像高)が小さい撮像画像601、合焦被写体領域612の位置(像高)が大きい撮像画像611、画像での像高位置621をそれぞれ示す。像高は画像(撮像素子)と撮像光学系の光軸との交点を原点とした距離である。ここでは撮像素子と光軸とが撮像素子の中心で交わるものとする。また、画像座標を、画像の左上角の画素623の座標を原点(0,0)とした直交座標系で表すものとする。 FIG. 6 shows a captured image 601 in which the position (image height) of the focused object region 602 is small, a captured image 611 in which the position (image height) of the focused object region 612 is large, and an image height position 621 in the image. The image height is the distance from the point of intersection between the image (imaging device) and the optical axis of the imaging optical system. Here, it is assumed that the imaging device and the optical axis intersect at the center of the imaging device. Also, the image coordinates are expressed in an orthogonal coordinate system with the coordinates of the pixel 623 at the upper left corner of the image as the origin (0, 0).

この場合、画像の4頂点で像高は最大となり、画像サイズを水平M画素、垂直N画素とすると、像高の最大値HmaxはHmax=√(M2+N2)/2である。また、合焦被写体の位置624(x,y)の像高HsはHs=√(|(x-1)-M/2|2+|(y-1)-N/2|2)である。ここでは、像高の大きさを、最大値を10割(100%)とした割合Hs/Hmax×100[%]で評価するものとする。 In this case, the image height is maximum at the four vertices of the image, and if the image size is horizontal M pixels and vertical N pixels, the maximum image height H max is H max =√(M 2 +N 2 )/2. Also, the image height H s at the position 624 (x, y) of the focused object is H s =√(|(x−1)−M/2| 2 +|(y−1)−N/2| 2 ) is. Here, the magnitude of the image height is evaluated by the ratio H s /H max ×100[%] with the maximum value being 100% (100%).

合焦被写体領域の像高が小さい場合(例えば0≦像高≦30%)は、合焦被写体が画像の中心付近に存在している。この場合、撮影者は主に合焦被写体に着目して撮影している可能性が高いと考えられる。そのため、ボケ量算出部163は、非合焦被写体のボケ量が大きくなる条件でブラケット撮影されるようなボケ量を算出する。これにより、合焦被写体が目立つ撮像画像が得られる。 When the image height of the focused subject area is small (for example, 0≦image height≦30%), the focused subject exists near the center of the image. In this case, it is highly likely that the photographer is mainly focusing on the in-focus subject. Therefore, the bokeh amount calculation unit 163 calculates the bokeh amount such that the bracket photographing is performed under the condition that the out-of-focus subject has a large blur amount. As a result, a captured image in which the focused subject stands out is obtained.

一方で、合焦被写体領域の像高が大きい(例えば30%<像高)場合、撮影者は合焦被写体だけでなく、その背景(非合焦被写体)にも着目して撮影している可能性が高いと考えられる。そのため、非合焦被写体についてもぼけが小さくなる条件でブラケット撮影されるようなボケ量を算出する。これにより、背景の情報も活かした撮像画像が得られる。 On the other hand, when the image height of the in-focus subject area is large (for example, 30%<image height), the photographer may be focusing not only on the in-focus subject but also on its background (out-of-focus subject). It is considered to be of high quality. Therefore, the amount of blur is calculated so that bracket photography can be performed under the condition that blur is reduced even for an out-of-focus subject. This makes it possible to obtain a captured image that also makes use of background information.

図5の501は、合焦被写体領域の位置(像高)と、ボケ量算出部163が算出する背景(非合焦被写体)のボケ量δとの関係例を示している。ここでは、合焦被写体領域の像高[%]に閾値th1、th2を設定し、
・0≦像高[%]<th1ではボケ量δを最大(上限値)
・th2<像高[%]≦100ではボケ量δを最小(下限値)
・th1≦像高[%]≦th2ではボケ量δを像高に反比例して低減させる
例を示している。なお、th1、th2は予め、例えば実験的に求めることができる。なお、基本的に像高が小さい範囲において背景のボケ量が大きくなる様な特性であれば、像高とボケ量δの関係は501に示した関係に限定されない。
Reference numeral 501 in FIG. 5 indicates an example of the relationship between the position (image height) of the focused subject area and the blur amount δ of the background (out-of-focus subject) calculated by the blur amount calculation unit 163 . Here, thresholds th1 and th2 are set for the image height [%] of the in-focus subject area,
・When 0 ≤ image height [%] < th1, blur amount δ is maximized (upper limit)
・When th2 < image height [%] ≤ 100, the blur amount δ is the minimum (lower limit value)
· th1 ≤ image height [%] ≤ th2 shows an example in which the blur amount δ is reduced in inverse proportion to the image height. Note that th1 and th2 can be obtained in advance, for example, experimentally. Note that the relationship between the image height and the blur amount δ is not limited to the relationship shown in 501 as long as the background blur amount is basically large in a range where the image height is small.

次に、非合焦被写体領域のコントラスト値に基づくボケ量の算出例について説明する。非合焦被写体領域のコントラスト値が大きい場合、ボケ量算出部163は、合焦被写体を目立たせるよりも非合焦被写体のコントラストを残すことを優先し、非合焦被写体のぼけを小さくする。一方、非合焦被写体領域のコントラスト値が小さい場合、ボケ量算出部163は、非合焦被写体のコントラストを残すよりも合焦被写体を目立たせることを優先し、非合焦被写体のぼけを大きくする。 Next, an example of calculating the blur amount based on the contrast value of the out-of-focus subject area will be described. When the contrast value of the out-of-focus subject area is large, the blur amount calculation unit 163 gives priority to keeping the contrast of the out-of-focus subject rather than making the in-focus subject stand out, and reduces the blur of the out-of-focus subject. On the other hand, when the contrast value of the out-of-focus subject area is small, the blur amount calculation unit 163 gives priority to making the focused subject stand out rather than leaving the contrast of the out-of-focus subject, and increases the blur of the out-of-focus subject. do.

図5の502は、非合焦被写体領域のコントラスト値Frと、ボケ量算出部163が算出する背景のボケ量δとの関係例を示している。ここでは、非合焦被写体のコントラスト値Frに閾値th3、th4を設定し、
・0≦非合焦被写体領域のコントラスト値Fr<th3ではボケ量δを最大(上限値)
・th4<非合焦被写体領域のコントラスト値Fr≦100ではボケ量δを最小(下限値)
・th3≦非合焦被写体領域のコントラスト値Fr≦th4ではボケ量δを非合焦被写体領域のコントラスト値Frに反比例して低減させる
例を示している。なお、th3、th4は予め、例えば実験的に求めることができる。なお、ここでは非合焦被写体領域のコントラスト値が第1の値の場合のボケ量が、第1の値よりも小さな第2の値の場合のボケ量以下になるようにボケ量を算出する例を示したが、これは単なる一例である。
Reference numeral 502 in FIG. 5 indicates an example of the relationship between the contrast value Fr of the out-of-focus subject area and the background blur amount δ calculated by the blur amount calculation unit 163 . Here, thresholds th3 and th4 are set for the contrast value Fr of the out-of-focus object,
・Bokeh amount δ is maximized (upper limit value) when 0≦out-of-focus subject area contrast value Fr<th3
・When th4<contrast value of out-of-focus subject area Fr≦100, blur amount δ is minimized (lower limit)
When th3≦contrast value Fr of out-of-focus object region≦th4, an example is shown in which the blur amount δ is reduced in inverse proportion to the contrast value Fr of the out-of-focus object region. Note that th3 and th4 can be obtained in advance, for example, experimentally. Here, the amount of blur is calculated so that the amount of blur when the contrast value of the out-of-focus subject area is the first value is less than or equal to the amount of blur when the contrast value is the second value smaller than the first value. An example was given, but this is only an example.

次に、合焦被写体領域が人物の領域であると判定されている場合の背景(非合焦被写体)のボケ量の算出例について説明する。合焦被写体領域が人物の領域であると判定されており、かつ、合焦被写体領域の画像全体に占める割合が大きい(例えば50%以上の)場合、合焦被写体に着目して撮影している可能性が高い。この場合、合焦被写体領域の像高が小さい場合と同ように、背景(非合焦被写体)のボケ量を大きく算出して、合焦被写体が目立つ画像が得られるようにする。 Next, an example of calculation of the blur amount of the background (out-of-focus subject) when the in-focus subject area is determined to be the area of a person will be described. If the in-focus subject area is determined to be the area of a person, and if the in-focus subject area occupies a large proportion of the entire image (e.g., 50% or more), the in-focus subject is focused on and photographed. Probability is high. In this case, similarly to the case where the image height of the in-focus object area is small, the blur amount of the background (out-of-focus object) is calculated to be large so that the in-focus object stands out in an image.

例えば、ボケ量算出部163は、
・50≦合焦被写体が画像に占める割合[%]ではボケ量δを最大(上限値)
・合焦被写体が画像に占める割合[%]<50ではボケ量δを合焦被写体が画像に占める割合[%]に比例して低減させる
ようにボケ量δを算出することができる。
For example, the blur amount calculation unit 163
・Bokeh amount δ is maximum (upper limit) at 50 ≤ the ratio [%] of the in-focus subject to the image
If the ratio [%] of the focused object in the image is <50, the amount of blur δ can be calculated so as to decrease in proportion to the ratio [%] of the focused object in the image.

なお、合焦被写体領域が人物の領域であると判定され、かつ距離ヒストグラムにおける合焦被写体領域のカウント値のピークが非合焦被写体のカウント値のピークよりも大きい場合には、合焦被写体領域を主被写体とした撮影である可能性が高いと判定してもよい。例えば、図3の321に示す様な距離ヒストグラムが得られている場合が該当する。 If the in-focus subject area is determined to be a human area and the peak count value of the in-focus subject area in the distance histogram is greater than the peak count value of the out-of-focus subject, the in-focus subject area It may be determined that there is a high possibility of photographing with the main subject. For example, this corresponds to the case where a distance histogram as indicated by 321 in FIG. 3 is obtained.

この場合、ボケ量算出部163は、
・th5<合焦被写体が画像に占める割合[%]ではボケ量δを最大(上限値)
・合焦被写体が画像に占める割合[%]<th6ではボケ量δを最小(下限値)
・th6≦合焦被写体が画像に占める割合[%]≦th5ではボケ量δを合焦被写体が画像に占める割合[%]に比例して増加させる
ようにボケ量δを算出することができる。なお、th5、th6は予め、例えば実験的に求めることができる。
In this case, the blur amount calculation unit 163
・Bokeh amount δ is maximized (upper limit) when th5 < the ratio [%] of the in-focus subject in the image
・Bokeh amount δ is the minimum (lower limit value) when the ratio [%] of the focused subject in the image < th6
When th6≤ratio [%] of the focused subject in the image≤th5, the blur amount δ can be calculated so as to increase in proportion to the percentage [%] of the focused subject in the image. Note that th5 and th6 can be obtained in advance, for example, experimentally.

一方、合焦被写体領域が人物の領域であると判定されていない場合には、合焦被写体の距離や、被写体の距離分布に基づいて、シーン解析によって分割された距離範囲ごとに背景のボケ量を算出することができる。
例えば、合焦被写体までの距離が非常に近い(例えば30cm以下の)場合、マクロ撮影している可能性が高い。マクロ撮影のような至近撮影では被写界深度が非常に浅くなる。そのため、基本的に背景のボケ量δは小さく算出する。
On the other hand, if the in-focus subject area is not determined to be a person's area, the background blur amount is calculated for each distance range divided by scene analysis based on the distance of the in-focus subject and the distance distribution of the subject. can be calculated.
For example, when the distance to the in-focus subject is very short (for example, 30 cm or less), there is a high possibility that macro photography is being performed. The depth of field is very shallow when shooting close-up, such as macro photography. Therefore, the blur amount δ of the background is basically calculated to be small.

例えば、ボケ量算出部163は、
・最短撮影可能距離=合焦被写体の距離でボケ量δが下限値となり、
・合焦被写体の距離=th7でボケ量δが予め定めた値(例えば上限値/3)となり、
・最短撮影可能距離<合焦被写体の距離<th7の範囲では、合焦被写体の距離に比例してボケ量δが増加する
ようにボケ量δを算出することができる。なお、th7は例えばレンズの最短撮影距離+1mなどとして予め定めることができる。このように、至近撮影と判定される場合には、ボケ量δの最大値が上限値よりも小さくなる範囲でボケ量を算出する。これにより、被写界深度の浅い至近撮影において、被写界深度を細かく制御したブラケット撮影が実現できる。
For example, the blur amount calculation unit 163
・The shortest shooting distance is the distance of the in-focus subject, and the amount of bokeh δ is the lower limit.
When the distance of the in-focus subject is th7, the blur amount δ becomes a predetermined value (for example, the upper limit value/3),
In the range of shortest photographable distance<distance of focused subject<th7, the amount of blur δ can be calculated so that the amount of blur δ increases in proportion to the distance of the focused subject. Note that th7 can be predetermined as, for example, the shortest shooting distance of the lens +1 m. In this way, when it is determined that close-up photography is performed, the blur amount is calculated within a range in which the maximum value of the blur amount δ is smaller than the upper limit value. As a result, in close-up photography with a shallow depth of field, bracket photography with finely controlled depth of field can be realized.

また、ボケ量算出部163は、同一被写体に対応する複数の距離範囲については、ボケの絶対量が小さい範囲で変化するように個々の距離範囲についてボケ量δを算出する。
一方、異なる被写体に対応する距離範囲については、被写体ごとにボケ量の差が明確になるようにボケ量δに差を付けて算出する。
For a plurality of distance ranges corresponding to the same subject, the blur amount calculation unit 163 calculates the blur amount δ for each distance range so that the absolute amount of blur changes within a small range.
On the other hand, distance ranges corresponding to different subjects are calculated by adding a difference to the amount of blur δ so that the difference in the amount of blur for each subject becomes clear.

以上のようにして非合焦被写体もしくは分割範囲ごとに算出した1つ以上のボケ量δから、ボケ量算出部163は最終的にブラケット撮影条件を決定するためのボケ量Δを算出する。ボケ量算出部163はボケ量Δを例えば以下の式(2)を用いて算出することができる。ここでのαは、算出した情報毎のボケ量に設定された重み、nは取得された情報の数を表している。重みαは、ボケ量Δの算出に用いるボケ量δの組み合わせに応じて予め定められており、例えばROM155に記憶されているものとする。重みは、重みαは、複数のボケ量δそれぞれの優先度に応じて決定することができる。

Figure 2023033355000003
δ:情報毎に決定したボケ量
Δ:撮影で使用するボケ量 From one or more blur amounts δ calculated for each out-of-focus object or divided range as described above, the blur amount calculator 163 calculates the blur amount Δ for finally determining the bracket shooting conditions. The blur amount calculator 163 can calculate the blur amount Δ using, for example, the following equation (2). Here, α n represents the weight set for the calculated blur amount for each piece of information, and n represents the number of acquired information. The weight α n is determined in advance according to the combination of the blur amounts δ used to calculate the blur amount Δ, and is stored in the ROM 155, for example. The weight α n can be determined according to the priority of each of the plurality of blur amounts δ.
Figure 2023033355000003
δn : Amount of bokeh determined for each information Δ: Amount of bokeh used for shooting

例えば、合焦被写体の像高が大きく、非合焦被写体のコントラストが高い場合、合焦被写体に隠されていない非合焦被写体の領域が大きく、非合焦被写体のコントラストを残して撮影することが好適と考えられる。上述したように、合焦被写体の像高が大きい場合も、非合焦被写体のコントラストが高い場合も、非合焦被写体のボケ量δは小さく算出される。したがって、このような組み合わせの場合、非合焦被写体のボケ量Δも小さくなる。 For example, when the image height of the in-focus subject is large and the contrast of the out-of-focus subject is high, the area of the out-of-focus subject that is not hidden by the in-focus subject is large, and the contrast of the out-of-focus subject is preserved when shooting. is considered suitable. As described above, the blur amount δ of the out-of-focus subject is calculated to be small both when the image height of the in-focus subject is large and when the contrast of the out-of-focus subject is high. Therefore, in the case of such a combination, the blur amount Δ of the out-of-focus subject is also small.

一方、合焦被写体の像高が小さく、非合焦被写体のコントラストが低い場合、非合焦被写体の多くが合焦被写体に隠されており、非合焦被写体のコントラストを残す必要性が小さいと考えられる。上述したように、合焦被写体の像高が小さい場合も、非合焦被写体のコントラストが低い場合も、非合焦被写体のボケ量δは大きく算出される。したがって、このような組み合わせの場合、非合焦被写体のボケ量Δも大きくなる。 On the other hand, when the image height of the in-focus subject is small and the contrast of the out-of-focus subject is low, most of the out-of-focus subject is hidden behind the in-focus subject, and there is little need to preserve the contrast of the out-of-focus subject. Conceivable. As described above, the blur amount δ of the out-of-focus subject is calculated to be large both when the image height of the in-focus subject is small and when the contrast of the out-of-focus subject is low. Therefore, in such a combination, the blur amount Δ of the out-of-focus subject also increases.

S205で主制御部151は、ボケ量算出部163で算出したボケ量Δ、カメラ情報入力部102から取得したカメラ情報、距離情報入力部103から取得した被写体距離情報を基に、ブラケット撮影で用いる複数の絞り値を算出する。図7は被写体距離と焦点距離、ボケ量の関係を示した図である。 In S205, the main control unit 151 uses the blur amount Δ calculated by the blur amount calculation unit 163, the camera information acquired from the camera information input unit 102, and the subject distance information acquired from the distance information input unit 103 for bracket shooting. Calculate multiple aperture values. FIG. 7 is a diagram showing the relationship between the subject distance, focal length, and blur amount.

図7において、以下の式(3)が成り立つ。
dF=Δ×S2/(S2-S1)・・・(3)
ここで、
dF:レンズの絞り口径のサイズ
Δ:ボケ量
S1:光学中心から合焦被写体の結像面までの距離
S2:光学中心から非合焦被写体の結像面までの距離
である。
In FIG. 7, the following formula (3) holds.
dF=Δ×S2/(S2-S1) (3)
here,
dF: size of lens aperture diameter Δ: blur amount S1: distance from the optical center to the imaging plane of the in-focus subject S2: distance from the optical center to the imaging plane of the out-of-focus subject.

また、レンズの公式より式(4)、(5)が成り立つ。
S1=d1×f/(d1-f)・・・(4)
S2=d2×f/(d2-f)・・・(5)
ここで、
d1:光学中心から合焦被写体までの距離
d2:光学中心から非合焦被写体までの距離
f:撮像光学系の焦点距離
である。
Equations (4) and (5) hold from the lens formula.
S1=d1×f/(d1−f) (4)
S2=d2×f/(d2−f) (5)
here,
d1: Distance from the optical center to the focused subject d2: Distance from the optical center to the out-of-focus subject f: Focal length of the imaging optical system.

式(3)~(5)より、式(6)が成り立つ。
dF=Δ×S2×(d1-f)/{f×(d1-d2)}・・・(6)
Equation (6) holds from equations (3) to (5).
dF=Δ×S2×(d1−f)/{f×(d1−d2)} (6)

また、レンズの絞り口径dFは焦点距離fと絞り値Fの関係から式(7)を用いて算出することができる。
dF=f/F・・・(7)
Also, the aperture diameter dF of the lens can be calculated from the relationship between the focal length f and the aperture value F using equation (7).
dF=f/F (7)

式(6)に式(7)を代入し、ブラケット撮影で使用する絞り値を、式(8)を用いて決定する。
F=f2×(d1-d2)/{Δ×d2×(d1-f)}・・・(8)
Substituting equation (7) into equation (6), the aperture value used in bracket shooting is determined using equation (8).
F=f 2 ×(d1−d2)/{Δ×d2×(d1−f)} (8)

具体的には、主制御部151は、撮影時における撮影光学系の焦点距離fと、合焦被写体の距離d1とを式(8)に代入する。そして、非合焦被写体もしくは分割範囲ごとに、算出したボケ量Δと、距離d2を代入することにより、ブラケット撮影で用いる複数の絞り値Fを決定する。ここで、距離d1、d2は、距離ヒストグラムで分割した個々の距離範囲の代表距離であってよい。例えば、距離範囲内でカウント値が最大となる距離を代表距離として用いることができる。 Specifically, the main control unit 151 substitutes the focal length f of the photographing optical system at the time of photographing and the distance d1 of the focused object into the equation (8). Then, by substituting the calculated blur amount Δ and the distance d2 for each out-of-focus subject or divided range, a plurality of aperture values F used in bracket photography are determined. Here, the distances d1 and d2 may be representative distances of individual distance ranges divided by the distance histogram. For example, the distance with the maximum count value within the distance range can be used as the representative distance.

なお、絞り値の算出に用いる被写体距離d1、d2を、距離マップ生成部161が視差画像に基づいて生成する場合、距離情報の精度は被写体のコントラストなどに影響を受ける。例えば、コントラストの低い被写体では距離情報の精度が低下する。そのため、ブラケット撮影で使用する絞り値の算出に用いる被写体距離情報として、信頼度の高い情報を選択することにより、式(8)で決定される絞り値の精度を向上させることができる。 Note that when the distance map generator 161 generates the object distances d1 and d2 used to calculate the aperture value based on the parallax image, the accuracy of the distance information is affected by the contrast of the object and the like. For example, the accuracy of distance information decreases for a subject with low contrast. Therefore, by selecting information with a high degree of reliability as the subject distance information used to calculate the aperture value used in bracket shooting, it is possible to improve the accuracy of the aperture value determined by equation (8).

図8の撮影シーン801を例にして説明すると、高コントラストである被写体領域802~804部分については信頼度が高い距離情報が算出できる。一方で、低コントラストの残りの領域については距離情報の信頼度が低下する。また、被写体のエッジ部分の画像は距離の異なる被写体を含んでいるため、距離情報の信頼度が低下する。信頼度マップ811は、撮影シーン801について距離マップ生成部161が生成する距離情報の信頼度を二値化し、信頼度が高い領域を白、信頼度が低い領域を黒で模式的に示したものである。被写体のエッジ部分と被写体領域でない領域については、コントラストが低いかエッジ部分であることから信頼度が低い。 Taking the photographed scene 801 in FIG. 8 as an example, highly reliable distance information can be calculated for subject regions 802 to 804 with high contrast. On the other hand, the reliability of the distance information decreases for the remaining low-contrast regions. In addition, since the image of the edge portion of the subject includes subjects at different distances, the reliability of the distance information is lowered. The reliability map 811 binarizes the reliability of the distance information generated by the distance map generation unit 161 for the shooting scene 801, and schematically shows areas with high reliability in white and areas with low reliability in black. is. The edge portion of the object and the area other than the object region have low contrast or are edge portions, so the reliability is low.

このような場合、主制御部151は、式(8)に用いる距離d1を合焦被写体領域812内部で得られた距離情報から取得する。また、主制御部151は、式(8)に用いる距離d2を、非合焦被写体領域813および814内部で得られた距離情報から取得する。例えば、非合焦被写体1に関しては、距離マップにおいて範囲2に該当する画素のうち、領域813に含まれる画素に対応する距離に基づいて代表距離を決定することができる。 In such a case, the main control unit 151 acquires the distance d1 used in Equation (8) from the distance information obtained inside the in-focus subject area 812 . Also, the main control unit 151 acquires the distance d2 used in Equation (8) from the distance information obtained inside the out-of-focus subject areas 813 and 814 . For example, for the out-of-focus object 1, the representative distance can be determined based on the distance corresponding to the pixels included in the area 813 among the pixels corresponding to the range 2 in the distance map.

なお、例えば撮影シーンA(図3)のように、被写体ごとに距離範囲を分割した場合、ボケ量Δを算出した非合焦被写体の数よりもブラケット撮影枚数が少ないことが起こりうる。この場合、画像中で領域を大きく占めている非合焦被写体を優先してブラケット撮影の条件を決定することができる。これは、画像中に占める割合が大きい被写体は視覚的な影響が大きいからである。 For example, when the distance range is divided for each subject as in the shooting scene A (FIG. 3), the number of bracket shots may be smaller than the number of out-of-focus subjects for which the blur amount Δ is calculated. In this case, bracketing conditions can be determined with priority given to an out-of-focus subject that occupies a large area in the image. This is because a subject that occupies a large proportion of the image has a large visual impact.

例えば、距離ヒストグラム821が得られている場合、非合焦被写体1に対応する範囲2のカウント値の積分値が非合焦被写体2に対応する範囲3のカウント値の積分値よりも大きいため、非合焦被写体2よりも非合焦被写体1が優先される。なお、カウント値の積分値の代わりに、対応する最大カウント値が大きい非合焦被写体を優先してもよい。図8の例では、最大カウント値823が最大カウント値824より大きいため、非合焦被写体2よりも非合焦被写体1が優先される。なお、信頼度が高い距離情報が得られない非合焦被写体については、距離を無限遠として絞り値を算出してもよい。 For example, when the distance histogram 821 is obtained, since the integrated value of the count values in the range 2 corresponding to the out-of-focus subject 1 is larger than the integrated value of the count values in the range 3 corresponding to the out-of-focus subject 2, The out-of-focus subject 1 is prioritized over the out-of-focus subject 2. - 特許庁It should be noted that priority may be given to an out-of-focus subject with a large corresponding maximum count value instead of the integral value of the count value. In the example of FIG. 8, since the maximum count value 823 is greater than the maximum count value 824, the out-of-focus subject 1 is prioritized over the out-of-focus subject 2. In FIG. For an out-of-focus subject for which highly reliable distance information cannot be obtained, the aperture value may be calculated with the distance set to infinity.

また、例えば撮影シーンB(図4)のように、背景の距離範囲を所定数に分割した場合、ボケ量Δを算出した距離範囲の分割数よりもブラケット撮影枚数が少ないことが起こりうる。この場合、算出した複数の絞り値の一部を、ブラケット撮影枚数に応じて選択することができる。例えば、選択する絞り値の間隔を調整することにより、ブラケット撮影枚数を満たすように選択することができる。 Also, for example, when the background distance range is divided into a predetermined number as in the shooting scene B (FIG. 4), the number of bracket shots may be smaller than the number of divisions of the distance range for which the blur amount Δ is calculated. In this case, some of the plurality of calculated aperture values can be selected according to the number of bracket shots. For example, by adjusting the interval of aperture values to be selected, it is possible to select such that the number of bracket shots is satisfied.

主制御部151は、式(8)に基づいて算出した絞り値Fで撮影するための他の撮影条件(シャッタースピードおよび撮影感度)を決定する。絞り値Fが変わっても露出量が変わらないように、また、撮影感度はシャッタースピードが所定時間より遅くならない限り変更しないように撮影条件を決定する。例えば、撮影感度を変更せずに露出量を満たすためのシャッタースピードTvが焦点距離fの逆数(1/f)またはそれより速ければ、撮影感度は変更せず、シャッタースピードだけを変更する。撮影感度を変更せずに露出量を満たすためのシャッタースピードTvが1/fより遅くなる場合には、シャッタースピードが1/fまたはそれより速くなるように撮影感度を上げる。主制御部151は、このようにして、ブラケット撮影で用いる複数の撮影条件を決定する。 The main control unit 151 determines other shooting conditions (shutter speed and shooting sensitivity) for shooting with the aperture value F calculated based on Equation (8). The photographing conditions are determined so that the exposure amount does not change even if the aperture value F changes, and the photographing sensitivity does not change unless the shutter speed becomes slower than a predetermined time. For example, if the shutter speed Tv for satisfying the exposure without changing the sensitivity is the reciprocal of the focal length f (1/f) or faster, the sensitivity is not changed and only the shutter speed is changed. If the shutter speed Tv for satisfying the exposure amount without changing the photographic sensitivity is slower than 1/f, the photographic sensitivity is increased so that the shutter speed becomes 1/f or faster. The main control unit 151 thus determines a plurality of imaging conditions used in bracket imaging.

S206で主制御部151は、撮影指示(例えばシャッターボタンの全押し)を検出したか否かを調べ、撮影指示を検出していれば処理をS207に進め、検出していなければ処理をS201に戻す。 In S206, the main control unit 151 checks whether or not a photographing instruction (for example, a full press of the shutter button) has been detected. If a photographing instruction has been detected, the process proceeds to S207. return.

S207で主制御部151は、S205で決定した撮影条件を用いたブラケット撮影を開始する。ブラケット撮影中、主制御部151は、シーン解析時の合焦被写体への合焦を維持するようにフォーカスレンズの位置を継続的に調整する。 In S207, the main control unit 151 starts bracket imaging using the imaging conditions determined in S205. During bracket shooting, the main control unit 151 continuously adjusts the position of the focus lens so as to maintain the focus on the in-focus subject during scene analysis.

1回(1フレーム)の撮影が終了し、記録用の画像データをRAM154に格納すると、S208で主制御部151は、S205で決定した複数の絞り値のうち、未撮影の絞り値が残っているか否かを判定する。未撮影の絞り値が残っていれば処理をS206に戻し、残っていなければ処理をS209に進める。 When the image data for recording is stored in the RAM 154 after one shot (one frame) of shooting is completed, the main control unit 151 determines in S208 whether the aperture values that have not yet been shot remain among the plurality of aperture values determined in S205. determine whether or not there is If there remains an unphotographed aperture value, the process returns to S206, and if not, the process proceeds to S209.

S209で主制御部151は、RAM154に格納されている記録用の画像データを記録媒体157に順次記録して処理を終了する。なお、例えば表示部150にブラケット撮影で得られた画像のサムネイルを一覧表示し、記録する画像をユーザに選択させてもよい。また、ブラケット撮影した画像を別個に記録する代わりに、あるいはそれとは別に、ブラケット撮影で得られた画像を用いた合成画像を記録してもよい。 In S209, the main control unit 151 sequentially records the image data for recording stored in the RAM 154 on the recording medium 157, and ends the process. Note that, for example, a list of thumbnails of images obtained by bracket photography may be displayed on the display unit 150 to allow the user to select an image to be recorded. Alternatively, instead of separately recording the bracketed images, or separately, a composite image using the bracketed images may be recorded.

以上説明した様に、本実施形態によれば、絞り値を変更するブラケット撮影に用いる複数の絞り値を、撮影シーンに存在する被写体の距離の分布に基づいて自動的に決定するようにした。そのため、ユーザは、所望の被写界深度を有する画像を、絞り値、撮像光学系の焦点距離、被写体距離といった条件を考慮する必要なしに容易に得ることができる。 As described above, according to this embodiment, a plurality of aperture values to be used for bracket shooting in which aperture values are changed are automatically determined based on the distribution of distances of subjects present in the shooting scene. Therefore, the user can easily obtain an image having a desired depth of field without having to consider conditions such as the aperture value, the focal length of the imaging optical system, and the subject distance.

(その他の実施形態)
上述したブラケット撮影動作の実施は、明示的に被写界深度(絞り)ブラケット撮影モードが設定されている場合に限定されない。ブラケット撮影モードが設定されていない場合でも、シーン判別結果に応じて絞りブラケット撮影を行うことを決定してもよい。例えば、合焦被写体が人物であると判定される場合には絞りブラケット撮影を実施するようにしてもよい。
(Other embodiments)
Implementation of the above-described bracket shooting operation is not limited to the case where the depth of field (aperture) bracket shooting mode is explicitly set. Even if the bracket shooting mode is not set, it may be decided to perform aperture bracket shooting according to the scene determination result. For example, when it is determined that the in-focus subject is a person, aperture bracket photography may be performed.

なお、上述の実施形態では、被写体の距離情報に基づいて算出した非合焦被写体や背景のボケ量に基づいてブラケット撮影に用いる絞り値を決定する構成について説明した。しかし、被写体の距離情報に基づいて他の方法によってブラケット撮影に用いる絞り値を決定してもよい。 Note that in the above-described embodiment, a configuration has been described in which the aperture value used for bracket shooting is determined based on the blur amount of the out-of-focus subject and the background calculated based on the distance information of the subject. However, the aperture value used for bracket shooting may be determined by another method based on the distance information of the object.

例えば、合焦被写体の後ろにある非合焦被写体のうち、最も近いものが被写界深度に入らないようにブラケット撮影に用いる絞り値を決定することができる。図3に示すシーンであれば、非合焦被写体1に対応する距離範囲におけるピーク323に対応する距離が合焦被写体の被写界深度に含まれないように絞り値Fを決定することができる。これにより、非合焦被写体1(および非合焦被写体2)をボカすことができ、合焦被写体が目立つ画像を撮影することができる。 For example, it is possible to determine the aperture value used for bracketing so that the closest out-of-focus subject behind the in-focus subject does not fall within the depth of field. For the scene shown in FIG. 3, the aperture value F can be determined so that the distance corresponding to the peak 323 in the distance range corresponding to the out-of-focus subject 1 is not included in the depth of field of the in-focus subject. . As a result, the out-of-focus subject 1 (and the out-of-focus subject 2) can be blurred, and an image in which the in-focus subject stands out can be captured.

例えば、主制御部151は、シーン解析部162から合焦被写体の代表距離と、合焦被写体の後方で被写体に最も近い非合焦被写体の代表距離とを取得する。また、主制御部151は、シーン解析した画像の撮影条件のうち、少なくとも撮影光学系の焦点距離を取得する。そして、主制御部151は、代表距離の差が被写界深度以下となる絞り値を公知の式に基づいて算出する(許容錯乱円径には撮像素子141の画素ピッチを用いることができる)。主制御部151はブラケット撮影に用いる絞り値を、算出した絞り値よりも開放側の絞り値から選択する。 For example, the main control unit 151 acquires from the scene analysis unit 162 the representative distance of the in-focus subject and the representative distance of the out-of-focus subject behind the in-focus subject and closest to the subject. In addition, the main control unit 151 acquires at least the focal length of the imaging optical system among the imaging conditions for the scene-analyzed image. Then, the main control unit 151 calculates the aperture value at which the difference in the representative distance is equal to or less than the depth of field based on a known formula (the pixel pitch of the image sensor 141 can be used as the permissible circle of confusion diameter). . The main control unit 151 selects an aperture value to be used for bracket shooting from aperture values on the open side of the calculated aperture value.

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

100…デジタルカメラ、101…レンズユニット、141…撮像素子、142…撮像信号処理部、151…主制御部、152…画像処理部、154…RAM、155…ROM、161…距離マップ生成部、162…シーン解析部、163…ボケ量算出部 DESCRIPTION OF SYMBOLS 100... Digital camera, 101... Lens unit, 141... Imaging element, 142... Imaging signal processing part, 151... Main control part, 152... Image processing part, 154... RAM, 155... ROM, 161... Distance map generation part, 162 ... scene analysis unit, 163 ... blur amount calculation unit

上述の目的は、撮影された画像と、画像に撮影されたシーンの距離の分布を表す距離情報とを取得する取得手段と、距離情報に基づいて、絞りを異ならせるブラケット撮影において用いる複数の絞り値を決定する制御手段と、を有し、前記制御手段は、前記距離情報に基づいて合焦被写体よりも遠くに存在する非合焦被写体を検出する解析手段と、前記非合焦被写体ごとにボケ量を算出する算出手段と、前記ボケ量に基づいて前記複数の絞り値を前記合焦被写体のボケ量が所定の値以下に収まる範囲で決定する設定手段と、を有し、前記設定手段は、前記非合焦被写体が被写界深度に入らないように前記複数の絞り値を決定することを特徴とする画像処理装置によって達成される。 The above-mentioned object is an acquisition means for acquiring a photographed image and distance information representing the distribution of the distance of the scene photographed in the image, and a plurality of diaphragms used in bracket photography in which the aperture is changed based on the distance information. a control means for determining a value, wherein the control means includes an analysis means for detecting an out-of-focus subject existing farther than the in-focus subject based on the distance information; calculating means for calculating an amount of blur; and setting means for determining the plurality of aperture values based on the amount of blur within a range in which the amount of blur of the focused subject is within a predetermined value, wherein the setting means is achieved by an image processing apparatus that determines the plurality of aperture values so that the out-of-focus subject does not enter the depth of field .

Claims (15)

撮影された画像と、該画像に撮影されたシーンの距離の分布を表す距離情報とを取得する取得手段と、
前記距離情報に基づいて、絞りを異ならせるブラケット撮影において用いる複数の絞り値を決定する制御手段と、
を有することを特徴とする画像処理装置。
Acquisition means for acquiring a photographed image and distance information representing the distribution of distances of the scene photographed in the image;
a control means for determining a plurality of aperture values used in bracket photography with different apertures based on the distance information;
An image processing device comprising:
前記制御手段は、
前記距離情報に基づいて合焦被写体よりも遠くに存在する非合焦被写体を検出する解析手段と、
前記非合焦被写体ごとにボケ量を算出する算出手段と、
前記ボケ量に基づいて前記複数の絞り値を決定する決定手段と、
を有することを特徴とする請求項1に記載の画像処理装置。
The control means is
analysis means for detecting an out-of-focus subject existing farther than a focused subject based on the distance information;
calculating means for calculating a blur amount for each out-of-focus subject;
determining means for determining the plurality of aperture values based on the amount of blur;
2. The image processing apparatus according to claim 1, comprising:
前記算出手段は、
前記合焦被写体の前記画像における位置、
前記合焦被写体の前記画像に占める割合、
前記非合焦被写体のコントラストの高さ、
の少なくとも1つに応じて前記ボケ量の大きさを異ならせることを特徴とする請求項2に記載の画像処理装置。
The calculation means is
a position in the image of the focused object;
the proportion of the focused object in the image;
high contrast of said out-of-focus object;
3. The image processing apparatus according to claim 2, wherein the magnitude of said blur amount is varied according to at least one of the above.
前記算出手段は、前記合焦被写体が第1の位置にある場合よりも、前記第1の位置より画像の中心に近い第2の位置にある場合に、前記非合焦被写体のボケ量を大きく算出することを特徴とする請求項3に記載の画像処理装置。 The calculation means increases the blur amount of the out-of-focus subject when the focused subject is at a second position closer to the center of the image than when the focused subject is at the first position. 4. The image processing apparatus according to claim 3, wherein the calculation is performed. 前記算出手段は、前記合焦被写体が前記画像に占める割合が第1の値である場合よりも、前記第1の値より大きい第2の値である場合に、前記非合焦被写体のボケ量を大きく算出することを特徴とする請求項3に記載の画像処理装置。 The calculation means calculates the blur amount of the out-of-focus object when the proportion of the focused object in the image is a second value larger than the first value than when the ratio is the first value. 4. The image processing apparatus according to claim 3, wherein the calculation is large. 前記算出手段は、前記非合焦被写体のコントラスト値が第1の値である場合よりも、前記第1の値よりコントラストが高いことを示す第2の値である場合に、前記非合焦被写体のボケ量を小さく算出することを特徴とする請求項3から5のいずれか1項に記載の画像処理装置。 When the contrast value of the out-of-focus object is a second value indicating that the contrast value of the out-of-focus object is higher than the first value, the out-of-focus object 6. The image processing apparatus according to any one of claims 3 to 5, wherein the blur amount of is calculated to be small. 前記決定手段は、前記非合焦被写体に対して複数のボケ量が算出された場合、前記複数のボケ量を重み加算したボケ量に基づいて前記絞り値を決定することを特徴とする請求項2から6のいずれか1項に記載の画像処理装置。 3. The determining means determines the aperture value based on the blur amount obtained by weighting addition of the plurality of blur amounts when a plurality of blur amounts are calculated for the out-of-focus object. 7. The image processing device according to any one of 2 to 6. 前記制御手段は、
合焦被写体よりも遠い距離範囲を複数に分割する解析手段と、
前記分割した距離範囲ごとにボケ量を算出する算出手段と、
前記ボケ量に基づいて前記複数の絞り値を決定する決定手段と、
を有することを特徴とする請求項1に記載の画像処理装置。
The control means is
an analysis means for dividing a distance range farther than a focused object into a plurality of parts;
calculation means for calculating a blur amount for each of the divided distance ranges;
determining means for determining the plurality of aperture values based on the amount of blur;
2. The image processing apparatus according to claim 1, comprising:
前記解析手段は、前記合焦被写体の距離が予め定められた距離以下である場合には、そうでない場合よりも前記距離範囲を細かく分割することを特徴とする請求項8に記載の画像処理装置。 9. The image processing apparatus according to claim 8, wherein when the distance of the in-focus object is equal to or less than a predetermined distance, the analysis means divides the distance range more finely than otherwise. . 前記解析手段は、同一被写体に対応する距離範囲については、そうでない距離範囲よりも細かく分割することを特徴とする請求項8に記載の画像処理装置。 9. The image processing apparatus according to claim 8, wherein the analysis means divides the distance range corresponding to the same subject more finely than the distance range not corresponding to the same subject. 前記解析手段は、2つの被写体が1つの範囲に含まれないように前記距離範囲を分割することを特徴とする請求項8に記載の画像処理装置。 9. The image processing apparatus according to claim 8, wherein said analysis means divides said distance range so that two subjects are not included in one range. 前記制御手段は、
前記距離情報に基づいて、合焦被写体よりも遠くに存在し、かつ前記合焦被写体に最も近い非合焦被写体を検出し、
前記検出した非合焦被写体が被写界深度に入らないように前記複数の絞り値を決定する、
ことを特徴とする請求項1に記載の画像処理装置。
The control means is
detecting an out-of-focus subject that is farther than the focused subject and closest to the focused subject based on the distance information;
determining the plurality of aperture values so that the detected out-of-focus object does not fall within the depth of field;
2. The image processing apparatus according to claim 1, wherein:
前記画像を撮影する撮影手段と、
請求項1から12のいずれか1項に記載の画像処理装置とを有し、
前記制御手段が決定した複数の絞り値を用いて前記撮影手段でブラケット撮影を実行することを特徴とする撮像装置。
a photographing means for photographing the image;
An image processing device according to any one of claims 1 to 12,
An imaging apparatus, wherein the photographing means executes bracket photographing using a plurality of aperture values determined by the control means.
取得手段が、撮影された画像と、該画像に撮影されたシーンの距離の分布を表す距離情報とを取得する取得工程と、
制御手段が、前記距離情報に基づいて、絞りを異ならせるブラケット撮影において用いる複数の絞り値を決定する制御工程と、
を有することを特徴とする画像処理装置の制御方法。
an acquisition step in which the acquisition means acquires the photographed image and distance information representing the distribution of distances of the scene photographed in the image;
a control step in which the control means determines a plurality of aperture values to be used in bracket photography with different apertures based on the distance information;
A control method for an image processing device, comprising:
コンピュータを、請求項1から12のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。 A program for causing a computer to function as each means of the image processing apparatus according to any one of claims 1 to 12.
JP2022212105A 2018-09-14 2022-12-28 Image processing device and control method therefor Pending JP2023033355A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022212105A JP2023033355A (en) 2018-09-14 2022-12-28 Image processing device and control method therefor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018172825A JP7204387B2 (en) 2018-09-14 2018-09-14 Image processing device and its control method
JP2022212105A JP2023033355A (en) 2018-09-14 2022-12-28 Image processing device and control method therefor

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2018172825A Division JP7204387B2 (en) 2018-09-14 2018-09-14 Image processing device and its control method

Publications (1)

Publication Number Publication Date
JP2023033355A true JP2023033355A (en) 2023-03-10

Family

ID=69901281

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2018172825A Active JP7204387B2 (en) 2018-09-14 2018-09-14 Image processing device and its control method
JP2022212105A Pending JP2023033355A (en) 2018-09-14 2022-12-28 Image processing device and control method therefor

Family Applications Before (1)

Application Number Title Priority Date Filing Date
JP2018172825A Active JP7204387B2 (en) 2018-09-14 2018-09-14 Image processing device and its control method

Country Status (1)

Country Link
JP (2) JP7204387B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7019895B2 (en) * 2020-04-07 2022-02-16 エスゼット ディージェイアイ テクノロジー カンパニー リミテッド Devices, imaging devices, imaging systems, moving objects, methods, and programs

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4565549B2 (en) * 2004-06-03 2010-10-20 株式会社リコー Imaging apparatus and focus control method thereof
JP4582295B2 (en) * 2004-05-28 2010-11-17 カシオ計算機株式会社 Imaging apparatus and program thereof
CN101196670A (en) * 2006-12-05 2008-06-11 华晶科技股份有限公司 Field depth encompassed shooting method and device
JP2008294785A (en) * 2007-05-25 2008-12-04 Sanyo Electric Co Ltd Image processor, imaging apparatus, image file, and image processing method
KR101510098B1 (en) * 2007-12-21 2015-04-08 삼성전자주식회사 Apparatus and method for blurring an image background in digital image processing device
JP2015204470A (en) * 2014-04-10 2015-11-16 キヤノン株式会社 Imaging apparatus, control method thereof, and program
JP2017010093A (en) * 2015-06-17 2017-01-12 キヤノン株式会社 Image processing apparatus, imaging device, image processing method, image processing program, and recording medium
JP2017038338A (en) * 2015-08-15 2017-02-16 国立大学法人北陸先端科学技術大学院大学 Photographing support method and photographing support device

Also Published As

Publication number Publication date
JP7204387B2 (en) 2023-01-16
JP2020046475A (en) 2020-03-26

Similar Documents

Publication Publication Date Title
CN107948519B (en) Image processing method, device and equipment
JP5390707B2 (en) Stereoscopic panorama image synthesis apparatus, imaging apparatus, stereo panorama image synthesis method, recording medium, and computer program
JP4497211B2 (en) Imaging apparatus, imaging method, and program
US9992478B2 (en) Image processing apparatus, image pickup apparatus, image processing method, and non-transitory computer-readable storage medium for synthesizing images
JP5434361B2 (en) Image processing apparatus and image processing method
US20100177979A1 (en) Image processing apparatus and image processing method
JP2008271241A (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP6518452B2 (en) Imaging apparatus and imaging method
JP6223059B2 (en) Imaging apparatus, control method thereof, and program
JP2018174502A (en) Imaging apparatus, image processing apparatus, control method of imaging apparatus, and program
JP2010114752A (en) Device and method of imaging and program
JP5144724B2 (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP6261205B2 (en) Image processing device
JP2010072619A (en) Exposure operation device and camera
JP4866317B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP6604908B2 (en) Image processing apparatus, control method thereof, and control program
JP2023033355A (en) Image processing device and control method therefor
JP2009284056A (en) Image processing apparatus, method, and program
JP2020017807A (en) Image processing apparatus, image processing method, and imaging apparatus
JP2017143354A (en) Image processing apparatus and image processing method
JP2018182700A (en) Image processing apparatus, control method of the same, program, and storage medium
JP6486453B2 (en) Image processing apparatus, image processing method, and program
JP2012142729A (en) Camera
JP2014131188A (en) Imaging apparatus, control method of the same, and control program
JP2015118274A (en) Imaging device, imaging device control method, and program

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230127

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230127

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20240304