JP2015159357A - Image processing system, image processing method, and program - Google Patents

Image processing system, image processing method, and program Download PDF

Info

Publication number
JP2015159357A
JP2015159357A JP2014031962A JP2014031962A JP2015159357A JP 2015159357 A JP2015159357 A JP 2015159357A JP 2014031962 A JP2014031962 A JP 2014031962A JP 2014031962 A JP2014031962 A JP 2014031962A JP 2015159357 A JP2015159357 A JP 2015159357A
Authority
JP
Japan
Prior art keywords
processing
filter
distance
image
subject
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2014031962A
Other languages
Japanese (ja)
Other versions
JP6516410B2 (en
Inventor
寧司 大輪
Yasushi Owa
寧司 大輪
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 JP2014031962A priority Critical patent/JP6516410B2/en
Publication of JP2015159357A publication Critical patent/JP2015159357A/en
Application granted granted Critical
Publication of JP6516410B2 publication Critical patent/JP6516410B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Focusing (AREA)
  • Automatic Focus Adjustment (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Studio Devices (AREA)

Abstract

PROBLEM TO BE SOLVED: To exactly reproduce background blurring by suppressing a circuit scale and a processing period even when the number of subjects is large when varying the degree of blurring depending on a subject distance.SOLUTION: When the number of subjects is large and a high luminance area is not included, a simple filter is used to perform filtering. At this time, when the degree of blurring is small, a simple filter composed of a single filter is used; when the degree of blurring is intermediate, a simple filter composed of five same filters are used; and when the degree of blurring is large, a simple filter composed of 13 same filters are used.

Description

本発明は、特に、ぼかし処理を行うために用いて好適な画像処理装置、画像処理方法及びプログラムに関する。   In particular, the present invention relates to an image processing apparatus, an image processing method, and a program suitable for use in performing blurring processing.

従来、コンパクトデジタルカメラで撮影すると、一眼レフカメラで撮影する場合に比べて相対的に広い距離範囲に対して焦点が合ってしまうため、一眼レフカメラのように背景を大きくぼかした画像を撮影することができない。このため、従来のコンパクトデジタルカメラでは、大きなぼかし効果を得るために、デジタルフィルタ処理で一眼レフカメラ相当の大きさのボケを撮影画像に付与している。   Conventionally, taking a picture with a compact digital camera focuses on a relatively wide distance range compared to taking a picture with a single-lens reflex camera. I can't. For this reason, in a conventional compact digital camera, in order to obtain a large blurring effect, a blur equivalent to a single-lens reflex camera is added to the captured image by digital filter processing.

例えば特許文献1には、縮小した画像に小さいサイズのフィルタ処理を施したのちに元のサイズに拡大して、小さいサイズのフィルタ処理で大きなボケを画像に付与する技術が開示されている。また、例えば特許文献2には、焦点条件の異なる2枚の画像から主被写体領域と背景領域とを検出し、この結果に応じて背景をぼかす効果を付与した画像を形成する技術が開示されている。   For example, Patent Document 1 discloses a technique in which a reduced image is subjected to filter processing of a small size and then enlarged to the original size, and large blur is added to the image by filter processing of a small size. For example, Patent Document 2 discloses a technique for detecting a main subject region and a background region from two images having different focus conditions and forming an image with an effect of blurring the background according to the result. Yes.

特開2004−102904号公報JP 2004-102904 A 特開平10−233919号公報Japanese Patent Laid-Open No. 10-233919

しかしながら、上述の特許文献1及び2に開示された従来技術では、フィルタサイズが小さいため、一眼レフカメラのような背景ボケを忠実に再現することができない。例えば一眼レフカメラでは、背景の点光源を大きく丸くぼかすような撮影を行うことができるが、特許文献1及び2に開示されている小さいサイズのフィルタ処理では、丸ボケの形状の詳細を十分に表現できない。また、被写体距離によってぼかし度合を変える場合には、被写体距離の種類が増えると全体の処理時間が増大するという問題がある。   However, in the conventional techniques disclosed in Patent Documents 1 and 2 described above, since the filter size is small, it is impossible to faithfully reproduce background blur as in a single-lens reflex camera. For example, with a single-lens reflex camera, it is possible to capture a background point light source with a large rounded blur, but the small size filter processing disclosed in Patent Documents 1 and 2 provides sufficient details of the shape of the round blur. I can't express it. In addition, when the degree of blur is changed depending on the subject distance, there is a problem that the overall processing time increases as the types of subject distances increase.

本発明は前述の問題点に鑑み、被写体距離によってぼかし度合を変える際に、被写体の数が多い場合にも回路規模及び処理時間を抑えて背景ボケを忠実に再現できるようにすることを目的としている。   The present invention has been made in view of the above-described problems, and it is an object of the present invention to faithfully reproduce background blur while suppressing the circuit scale and processing time even when the number of subjects is large when changing the degree of blur according to the subject distance. Yes.

本発明に係る画像処理装置は、焦点までの距離が互いに異なる少なくとも2つの被写体を含む撮影画像を入力する入力手段と、前記撮影画像における各被写体までの距離と、合焦位置までの距離との情報を取得する取得手段と、前記取得手段によって取得された各被写体までの距離及び合焦位置までの距離に基づいて前記各被写体に対して異なるフィルタ処理を施す第1の処理手段とを有し、前記第1の処理手段は、前記各被写体までの距離及び合焦位置までの距離に基づいた回数で前記各被写体に対してそれぞれフィルタ処理を行い、前記フィルタ処理ごとに生成される画像を合成することを特徴とする。   The image processing apparatus according to the present invention includes an input unit that inputs a captured image including at least two subjects having different distances to the focal point, a distance to each subject in the captured image, and a distance to the in-focus position. Acquisition means for acquiring information, and first processing means for performing different filter processing on each subject based on the distance to each subject and the distance to the in-focus position acquired by the acquisition means. The first processing means performs filter processing on each subject by the number of times based on the distance to each subject and the distance to the in-focus position, and synthesizes an image generated for each filter processing. It is characterized by doing.

本発明によれば、被写体距離によってぼかし度合を変える際に、被写体の数が多い場合にも回路規模及び処理時間を抑えて背景ボケを忠実に再現することができる。   According to the present invention, when changing the degree of blur according to the subject distance, it is possible to faithfully reproduce the background blur while suppressing the circuit scale and processing time even when the number of subjects is large.

実施形態に係るデジタルカメラの構成例を示すブロック図である。It is a block diagram which shows the structural example of the digital camera which concerns on embodiment. 画像処理部に含まれる構成の一部を説明するための図である。It is a figure for demonstrating a part of structure contained in an image process part. 撮影画像に適用する2次元フィルタ処理のフィルタ係数を説明するための図である。It is a figure for demonstrating the filter coefficient of the two-dimensional filter process applied to a picked-up image. 図3の2次元フィルタを撮影画像に適用する様子を説明するための図である。It is a figure for demonstrating a mode that the two-dimensional filter of FIG. 3 is applied to a picked-up image. デジタルカメラと撮影される被写体との位置関係を示した図である。It is the figure which showed the positional relationship of a digital camera and the to-be-photographed object. 図5に示した位置関係の例で撮影された撮影画像を示す図である。It is a figure which shows the picked-up image image | photographed with the example of the positional relationship shown in FIG. 撮影画像における被写体の距離マップの例を示す図である。It is a figure which shows the example of the distance map of the to-be-photographed object in a picked-up image. 実施形態におけるぼかし処理を行う一連の処理手順の一例を示すフローチャートである。It is a flowchart which shows an example of a series of processing procedures which perform the blurring process in embodiment. 輝度ヒストグラムの一例を示す図である。It is a figure which shows an example of a brightness | luminance histogram. 実施形態におけるぼかし処理の詳細な手順の一例を示すフローチャートである。It is a flowchart which shows an example of the detailed procedure of the blurring process in embodiment. ぼかしモードごとのフィルタの選択条件の一例を示す図である。It is a figure which shows an example of the selection conditions of the filter for every blurring mode. ぼかし度合を決定する条件の一例を示す図である。It is a figure which shows an example of the conditions which determine the blurring degree. フィルタの種類とぼかし度合とにより適用するフィルタの一例を示す図である。It is a figure which shows an example of the filter applied with the kind of filter, and the blurring degree. フィルタの形状の一例を示す図である。It is a figure which shows an example of the shape of a filter. 簡略フィルタの詳細な構成を説明するための図である。It is a figure for demonstrating the detailed structure of a simple filter. 簡略フィルタによるフィルタ処理の詳細な手順の一例を示すフローチャートである。It is a flowchart which shows an example of the detailed procedure of the filter process by a simple filter.

以下、本発明の好ましい実施形態について、添付の図面に基づいて詳細に説明する。本実施形態では、画像処理装置としてデジタルカメラに適用した例について説明する。   Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In this embodiment, an example applied to a digital camera as an image processing apparatus will be described.

図1は、本実施形態に係るデジタルカメラ100の構成例を示すブロック図である。
図1において、撮影レンズ103はフォーカスレンズを含むレンズであり、シャッター101は絞り機能を備えている。撮像部22は光学像を電気信号に変換するCCDやCMOS素子等で構成されている。A/D変換器23はアナログ信号をデジタル信号に変換するための回路であり、撮像部22から出力されるアナログ信号をデジタル信号に変換するために用いられる。バリア102は、デジタルカメラ100の、撮影レンズ103を含む撮像ユニットを覆うことにより、撮影レンズ103、シャッター101、及び撮像部22を含む撮像系の汚れや破損を防止する。
FIG. 1 is a block diagram illustrating a configuration example of a digital camera 100 according to the present embodiment.
In FIG. 1, a photographing lens 103 is a lens including a focus lens, and a shutter 101 has an aperture function. The imaging unit 22 is configured by a CCD, a CMOS element, or the like that converts an optical image into an electrical signal. The A / D converter 23 is a circuit for converting an analog signal into a digital signal, and is used for converting the analog signal output from the imaging unit 22 into a digital signal. The barrier 102 covers the imaging unit including the imaging lens 103 of the digital camera 100, thereby preventing the imaging system including the imaging lens 103, the shutter 101, and the imaging unit 22 from becoming dirty or damaged.

画像処理部24は、A/D変換器23から出力されるデータ、又は、メモリ制御部15から出力されるデータに対し所定の画素補間、縮小といったリサイズ処理や色変換処理を行う。また、画像処理部24では、撮像して得られた画像データを用いて所定の演算処理が行われ、得られた演算結果に基づいてシステム制御部50が露光制御及び測距制御を行う。これにより、TTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)処理、AE(自動露出)処理、EF(フラッシュプリ発光)処理が行われる。システム制御部50によるAF処理では、主被写体に対する合焦制御が行われ、主被写体距離として合焦距離が得られる。画像処理部24では更に、撮像して得られた画像データを用いて所定の演算処理を行い、得られた演算結果に基づいてTTL方式のAWB(オートホワイトバランス)処理も行っている。また、さらに画像処理部24では、撮像して得られた画像データに対して所望のボカシ効果を付与した画像を形成する。   The image processing unit 24 performs resize processing and color conversion processing such as predetermined pixel interpolation and reduction on the data output from the A / D converter 23 or the data output from the memory control unit 15. The image processing unit 24 performs predetermined calculation processing using image data obtained by imaging, and the system control unit 50 performs exposure control and distance measurement control based on the obtained calculation result. Thereby, AF (autofocus) processing, AE (automatic exposure) processing, and EF (flash pre-emission) processing of the TTL (through-the-lens) method are performed. In the AF processing by the system control unit 50, focus control for the main subject is performed, and the focus distance is obtained as the main subject distance. The image processing unit 24 further performs predetermined calculation processing using image data obtained by imaging, and also performs TTL AWB (auto white balance) processing based on the obtained calculation result. Further, the image processing unit 24 forms an image with a desired blur effect applied to image data obtained by imaging.

距離マップ生成部104は、例えば焦点条件の異なる2枚の画像から被写体の距離マップを生成する。例えば、2枚の画像のエッジ成分、すなわち高周波数成分や中周波数成分を取り出し、これらの絶対値成分の差分値とることによってこの差分値から被写体距離を抽出する。焦点条件の種類を増やして複数枚の撮影画像から被写体距離情報を抽出することにより、被写体距離の分解能及び精度を高くすることもできる。これにより、撮影画像に対する距離マップを生成する。   The distance map generation unit 104 generates a distance map of the subject from, for example, two images with different focus conditions. For example, an edge component of two images, that is, a high frequency component and a medium frequency component are extracted, and a subject distance is extracted from the difference value by taking a difference value of these absolute value components. By increasing the types of focus conditions and extracting subject distance information from a plurality of photographed images, the resolution and accuracy of the subject distance can be increased. Thereby, a distance map for the captured image is generated.

A/D変換器23から出力される出力データは、画像処理部24及びメモリ制御部15を介して、或いは、メモリ制御部15を介してメモリ32に直接書き込まれる。メモリ32は、撮像部22によって得られ、A/D変換器23によりデジタルデータに変換された画像データや、表示部28に表示するための画像データを格納する。メモリ32は、所定枚数の静止画像や所定時間の動画像および音声のデータを格納するのに十分な記憶容量を備えている。また、メモリ32は画像表示用のメモリ(ビデオメモリ)を兼ねている。   Output data output from the A / D converter 23 is directly written into the memory 32 via the image processing unit 24 and the memory control unit 15 or via the memory control unit 15. The memory 32 stores image data obtained by the imaging unit 22 and converted into digital data by the A / D converter 23 and image data to be displayed on the display unit 28. The memory 32 has a storage capacity sufficient to store a predetermined number of still images, a moving image for a predetermined time, and audio data. The memory 32 also serves as an image display memory (video memory).

D/A変換器13は、メモリ32に格納されている画像表示用のデータをアナログ信号に変換して表示部28に供給する。こうして、メモリ32に書き込まれた表示用の画像データはD/A変換器13を介して表示部28により表示される。表示部28は、LCD等の表示器上に、D/A変換器13から出力されたアナログ信号に応じた表示を行う。   The D / A converter 13 converts the image display data stored in the memory 32 into an analog signal and supplies the analog signal to the display unit 28. Thus, the display image data written in the memory 32 is displayed on the display unit 28 via the D / A converter 13. The display unit 28 performs display according to the analog signal output from the D / A converter 13 on a display such as an LCD.

不揮発性メモリ56は、電気的に消去・記録可能なメモリであり、例えばEEPROM等が用いられる。不揮発性メモリ56には、システム制御部50の動作用の定数、プログラム等が記憶されている。この不揮発性メモリ56に記憶されているプログラムとは、本実施形態にて後述する各種フローチャートを実行するためのプログラムのことである。   The nonvolatile memory 56 is an electrically erasable / recordable memory, and for example, an EEPROM or the like is used. The nonvolatile memory 56 stores constants and programs for operating the system control unit 50. The program stored in the nonvolatile memory 56 is a program for executing various flowcharts described later in the present embodiment.

システム制御部50は、デジタルカメラ100全体を制御する。前述した不揮発性メモリ56に記憶されたプログラムを実行することにより、後述する本実施形態の各処理を実現する。また、システム制御部50はメモリ32、D/A変換器13、表示部28等を制御することにより表示制御も行う。システムメモリ52は例えばRAMが用いられ、システムメモリ52には、システム制御部50の動作用の定数、変数、不揮発性メモリ56から読み出されたプログラム等を展開する。   The system control unit 50 controls the entire digital camera 100. By executing the program stored in the nonvolatile memory 56 described above, each process of the present embodiment to be described later is realized. The system control unit 50 also performs display control by controlling the memory 32, the D / A converter 13, the display unit 28, and the like. For example, a RAM is used as the system memory 52, and constants and variables for operation of the system control unit 50, a program read from the nonvolatile memory 56, and the like are expanded in the system memory 52.

モード切替スイッチ60、シャッターボタン61、第1シャッタースイッチ62、第2シャッタースイッチ64、及び操作部70はシステム制御部50に各種の動作指示を入力するための操作手段である。モード切替スイッチ60は、システム制御部50の動作モードを静止画記録モード、動画記録モード、再生モード等のいずれかに切り替える。   The mode switch 60, the shutter button 61, the first shutter switch 62, the second shutter switch 64, and the operation unit 70 are operation means for inputting various operation instructions to the system control unit 50. The mode switch 60 switches the operation mode of the system control unit 50 to any one of a still image recording mode, a moving image recording mode, a reproduction mode, and the like.

シャッターボタン61は撮影指示を行うための操作手段であり、第1シャッタースイッチ62および第2シャッタースイッチによって構成されている。第1シャッタースイッチ62は、デジタルカメラ100に設けられたシャッターボタン61の操作途中、いわゆる半押し(撮影準備指示)でONとなり、第1シャッタースイッチ信号SW1を発生する。第1シャッタースイッチ信号SW1がシステム制御部50に入力されると、AF(オートフォーカス)処理、AE(自動露出)処理、AWB(オートホワイトバランス)処理、EF(フラッシュプリ発光)処理等の動作が開始される。   The shutter button 61 is an operation means for issuing a shooting instruction, and includes a first shutter switch 62 and a second shutter switch. The first shutter switch 62 is turned on when the shutter button 61 provided in the digital camera 100 is being operated, so-called half-press (shooting preparation instruction), and generates a first shutter switch signal SW1. When the first shutter switch signal SW1 is input to the system control unit 50, operations such as AF (autofocus) processing, AE (automatic exposure) processing, AWB (auto white balance) processing, and EF (flash pre-flash) processing are performed. Be started.

第2シャッタースイッチ64は、シャッターボタン61の操作完了、いわゆる全押し(撮影指示)でONとなり、第2シャッタースイッチ信号SW2を発生する。第2シャッタースイッチ信号SW2がシステム制御部50に入力されると、撮像部22からの信号読み出しから記録媒体200に画像データを書き込むまでの一連の撮影処理の動作が開始される。   The second shutter switch 64 is turned ON when the operation of the shutter button 61 is completed, that is, when it is fully pressed (shooting instruction), and generates a second shutter switch signal SW2. When the second shutter switch signal SW <b> 2 is input to the system control unit 50, a series of shooting processing operations from reading a signal from the imaging unit 22 to writing image data on the recording medium 200 is started.

操作部70の各操作部材は、表示部28に表示される種々の機能アイコンを選択操作することなどにより、場面ごとに適宜機能が割り当てられ、各種機能ボタンとして作用する。機能ボタンとしては、例えば終了ボタン、戻るボタン、画像送りボタン、ジャンプボタン、絞込みボタン、属性変更ボタン等がある。例えば、メニューボタンが押されると各種の設定可能なメニュー画面が表示部28に表示される。利用者は、表示部28に表示されたメニュー画面と、4方向ボタンやSETボタンとを用いて直感的に各種設定を行うことができる。   Each operation member of the operation unit 70 is appropriately assigned a function for each scene by selecting and operating various function icons displayed on the display unit 28, and functions as various function buttons. Examples of the function buttons include an end button, a return button, an image advance button, a jump button, a narrowing button, and an attribute change button. For example, when a menu button is pressed, various setting menu screens are displayed on the display unit 28. The user can make various settings intuitively using the menu screen displayed on the display unit 28, the four-way button, and the SET button.

電源制御部80は、電池検出回路、DC−DCコンバータ、通電するブロックを切り替えるスイッチ回路等により構成され、電池の装着の有無、電池の種類、電池残量の検出を行う。また、電源制御部80は、その検出結果及びシステム制御部50の指示に基づいてDC−DCコンバータを制御し、必要な電圧を必要な期間、記録媒体200を含む各部へ供給する。   The power control unit 80 includes a battery detection circuit, a DC-DC converter, a switch circuit that switches a block to be energized, and the like, and detects whether or not a battery is installed, the type of battery, and the remaining battery level. Further, the power control unit 80 controls the DC-DC converter based on the detection result and an instruction from the system control unit 50, and supplies a necessary voltage to each unit including the recording medium 200 for a necessary period.

電源部30は、アルカリ電池やリチウム電池等の一次電池やNiCd電池やNiMH電池、Li電池等の二次電池、ACアダプター等からなる。インターフェース18はメモリカードやハードディスク等の記録媒体200と接続するためのインターフェースである。記録媒体200は、メモリカード等の記録媒体であり、半導体メモリや磁気ディスク等から構成される。電源スイッチ72は、電源オン、電源オフを切り替えるためのスイッチである。   The power supply unit 30 includes a primary battery such as an alkaline battery or a lithium battery, a secondary battery such as a NiCd battery, a NiMH battery, or a Li battery, an AC adapter, or the like. The interface 18 is an interface for connecting to a recording medium 200 such as a memory card or a hard disk. The recording medium 200 is a recording medium such as a memory card, and includes a semiconductor memory or a magnetic disk. The power switch 72 is a switch for switching between power-on and power-off.

次に、図2から図4を参照しながら、再現性の高いフィルタ処理を行うための、画像処理部24の詳細な構成及び動作について説明する。   Next, a detailed configuration and operation of the image processing unit 24 for performing highly reproducible filter processing will be described with reference to FIGS.

図3は、撮影画像に適用する2次元フィルタ処理のフィルタ係数を説明するための図である。図3に示すように、フィルタの形状は、円柱形のフィルタ形状となっており、撮影画像にこのフィルタ処理を適用することにより一眼レフカメラのような丸ボケを表現することができる。また、フィルタのサイズは、円柱部分が(47タップ)×(47タップ)である。f1、f2、・・・、f36は、サイズが(9タップ)×(9タップ)の2次元フィルタ係数であり、縦6ブロック×横6ブロックで最大(54タップ)×(54タップ)の2次元フィルタ係数を表現することができる。   FIG. 3 is a diagram for explaining the filter coefficient of the two-dimensional filter process applied to the captured image. As shown in FIG. 3, the shape of the filter is a cylindrical filter shape, and by applying this filter processing to the captured image, it is possible to express a circular blur like a single-lens reflex camera. The size of the filter is (47 taps) × (47 taps) in the cylindrical portion. .., f36 are two-dimensional filter coefficients having a size of (9 taps) × (9 taps), and the maximum (54 taps) × (54 taps) is 2 in 6 vertical blocks × 6 horizontal blocks. Dimensional filter coefficients can be expressed.

図4は、図3の2次元フィルタを撮影画像に適用する様子を説明するための図である。図4において、領域401は撮影された入力画像の領域である。領域402は(54タップ)×(54タップ)の2次元フィルタを適用した後の出力画像の領域である。   FIG. 4 is a diagram for explaining a state in which the two-dimensional filter of FIG. 3 is applied to a captured image. In FIG. 4, an area 401 is an imaged input image area. A region 402 is a region of an output image after applying a (54 tap) × (54 tap) two-dimensional filter.

図2は、画像処理部24に含まれる構成の一部を説明するための図である。
図2(a)に示す2次元フィルタ回路201は、(9タップ)×(9タップ)の2次元フィルタ処理を施す回路である。信号203は、2次元フィルタ回路201に入力される2次元フィルタ係数の信号であり、信号204は、2次元フィルタ回路201に入力される入力画像である。また、2次元フィルタ回路201から出力される信号205は、2次元フィルタが適用された画像信号である。
FIG. 2 is a diagram for explaining a part of the configuration included in the image processing unit 24.
A two-dimensional filter circuit 201 shown in FIG. 2A is a circuit that performs a two-dimensional filter process of (9 taps) × (9 taps). A signal 203 is a signal of a two-dimensional filter coefficient input to the two-dimensional filter circuit 201, and a signal 204 is an input image input to the two-dimensional filter circuit 201. A signal 205 output from the two-dimensional filter circuit 201 is an image signal to which a two-dimensional filter is applied.

2次元フィルタ回路201は、入力画像の所望の領域を読み出し、2次元コンボリューション処理を施す。まず、2次元フィルタ回路201は、図3に示す2次元フィルタ係数f1を入力画像に適用する。その際、図4に示すように入力画像中の領域403を部分的に読み出してフィルタ処理を適用することによって、第1の中間画像を生成する。同様に、図3に示す2次元フィルタ係数f2で図4に示す領域404をフィルタ処理することによって第2の中間画像を生成する。   The two-dimensional filter circuit 201 reads a desired region of the input image and performs a two-dimensional convolution process. First, the two-dimensional filter circuit 201 applies the two-dimensional filter coefficient f1 shown in FIG. 3 to the input image. At that time, as shown in FIG. 4, a first intermediate image is generated by partially reading out a region 403 in the input image and applying a filter process. Similarly, a second intermediate image is generated by filtering the region 404 shown in FIG. 4 with the two-dimensional filter coefficient f2 shown in FIG.

図2(b)には、画像合成回路206を示している。本実施形態では、加算処理により画像を合成する例について説明する。まず、画像合成回路206は、入力信号207、208として第1の中間画像及び第2の中間画像を入力して第1の合成画像を生成し、出力信号209として出力する。次に、図3に示す2次元フィルタ係数f2の処理と同様に、2次元フィルタ回路201において、入力画像の領域をずらして図3に示す2次元フィルタ係数f3によるフィルタ処理を行って第3の中間画像を生成する。そして、画像合成回路206において、第1の合成画像と第3の中間画像とを加算合成することによって第2の合成画像を生成する。以下、図3に示す2次元フィルタ係数f4〜f36についても同様の処理を行って、最終的に第35の合成画像を生成する。   FIG. 2B shows the image composition circuit 206. In this embodiment, an example in which an image is synthesized by addition processing will be described. First, the image composition circuit 206 inputs the first intermediate image and the second intermediate image as the input signals 207 and 208, generates a first composite image, and outputs it as an output signal 209. Next, in the same way as the processing of the two-dimensional filter coefficient f2 shown in FIG. 3, in the two-dimensional filter circuit 201, the region of the input image is shifted and the filtering process using the two-dimensional filter coefficient f3 shown in FIG. An intermediate image is generated. Then, the image synthesis circuit 206 generates a second synthesized image by adding and synthesizing the first synthesized image and the third intermediate image. Thereafter, the same processing is performed on the two-dimensional filter coefficients f4 to f36 shown in FIG. 3 to finally generate a 35th composite image.

本実施形態において図3に示す2次元フィルタ係数f1〜f36は、それぞれ不揮発性メモリ56に予め記憶されており、メモリ32上に展開されて2次元フィルタ回路201に入力される。ただし、これに限定されるものではなく、システム制御部50が、図3に示す(54タップ)×(54タップ)の2次元フィルタ係数をメモリ32上に生成し、図3に示す36個の2次元フィルタ係数f1〜f36に分割してもよい。これにより、不揮発性メモリ56に記憶される2次元フィルタ係数のデータを削減するように構成してもよい。   In the present embodiment, the two-dimensional filter coefficients f1 to f36 shown in FIG. 3 are stored in advance in the nonvolatile memory 56, developed on the memory 32, and input to the two-dimensional filter circuit 201. However, the present invention is not limited to this, and the system control unit 50 generates (54 taps) × (54 taps) two-dimensional filter coefficients shown in FIG. You may divide | segment into the two-dimensional filter coefficient f1-f36. Thereby, the data of the two-dimensional filter coefficient stored in the nonvolatile memory 56 may be reduced.

図2(c)には、画像除算回路210が示されている。画像除算回路210には、入力信号211、213として第35の合成画像及び正規化係数が入力され、第35の合成画像を正規化係数で除算し、処理後の出力信号212として最終的なぼかし画像を出力する。図3に示す2次元フィルタ係数の係数値の合計は1653なので、正規化係数として「1653」が入力される。   FIG. 2C shows an image division circuit 210. The image division circuit 210 receives the 35th composite image and the normalization coefficient as the input signals 211 and 213, divides the 35th composite image by the normalization coefficient, and finally outputs the final blur as the processed output signal 212. Output an image. Since the sum of the coefficient values of the two-dimensional filter coefficients shown in FIG. 3 is 1653, “1653” is input as the normalization coefficient.

次に、図5〜図7を参照しながら、距離マップ生成部104で生成される距離マップについて説明する。   Next, a distance map generated by the distance map generation unit 104 will be described with reference to FIGS.

図5は、本実施形態に係るデジタルカメラと撮影される被写体との位置関係を示した図である。図5(a)には、第1の被写体504と背景506との位置関係を示しており、デジタルカメラ501で撮像された被写体の距離(以下、被写体距離D)が2種類の場合を示している。図5(a)において、画角502、503は、デジタルカメラ501で撮像される範囲を示しており、第1の被写体504の距離505で合焦している。以下、合焦距離をDFとし、図5(a)に示す例では、DF=200である。   FIG. 5 is a diagram showing the positional relationship between the digital camera according to the present embodiment and the subject to be photographed. FIG. 5A shows the positional relationship between the first subject 504 and the background 506, and shows the case where there are two types of subject distances (hereinafter, subject distance D) imaged by the digital camera 501. FIG. Yes. In FIG. 5A, angle of view 502 and 503 indicate a range captured by the digital camera 501, and is focused at a distance 505 of the first subject 504. Hereinafter, the focus distance is DF, and in the example shown in FIG. 5A, DF = 200.

図5(b)は、第1の被写体514と、第2の被写体515と、第3の被写体516と、背景520との位置関係を示しており、デジタルカメラ511で撮像される被写体の距離が4種類の場合を示している。図5(b)において、画角512、513はデジタルカメラ511で撮像される範囲を示している。また、第1の被写体514、第2の被写体515、第3の被写体516、及び背景520は、それぞれ距離517、518、519、520の位置にあり、それぞれの距離は200、100、300、1000である。また、図5(b)に示す例では、第1の被写体514で合焦しており、合焦距離はDF=200である。   FIG. 5B shows the positional relationship among the first subject 514, the second subject 515, the third subject 516, and the background 520, and the distance of the subject imaged by the digital camera 511 is as follows. Four cases are shown. In FIG. 5B, the angle of view 512, 513 indicates a range imaged by the digital camera 511. Further, the first subject 514, the second subject 515, the third subject 516, and the background 520 are located at distances 517, 518, 519, and 520, respectively, and the distances are 200, 100, 300, and 1000, respectively. It is. In the example shown in FIG. 5B, the first subject 514 is in focus, and the focus distance is DF = 200.

図6は、図5に示した位置関係の例で撮影された撮影画像を示す図である。図6(a)は、図5(a)に示した位置関係での撮影画像を示しており、デジタルカメラ501で撮影された撮影画像601において、第1の被写体602及び背景603が含まれている。図6(b)は、図5(b)に示した位置関係での撮影画像を示しており、デジタルカメラ511で撮影された撮影画像611において、第1の被写体612、第2の被写体613、第3の被写体614、及び背景615が含まれている。   FIG. 6 is a diagram illustrating a captured image captured in the example of the positional relationship illustrated in FIG. FIG. 6A shows a photographed image in the positional relationship shown in FIG. 5A, and the photographed image 601 photographed by the digital camera 501 includes the first subject 602 and the background 603. Yes. FIG. 6B shows a photographed image in the positional relationship shown in FIG. 5B. In the photographed image 611 photographed by the digital camera 511, the first subject 612, the second subject 613, A third subject 614 and a background 615 are included.

図7は、図6に示す撮影画像における被写体の距離マップの例を示す図である。距離マップ生成部104は、図6に示すような撮影画像から図7に示す距離マップを生成する。図7(a)は、図6(a)に示す撮影画像における距離マップ701を示しており、第1の被写体702での距離が200であり、背景703での距離が1000であることを示している。   FIG. 7 is a diagram illustrating an example of a distance map of a subject in the captured image illustrated in FIG. The distance map generation unit 104 generates the distance map shown in FIG. 7 from the captured image as shown in FIG. FIG. 7A shows a distance map 701 in the photographed image shown in FIG. 6A, and shows that the distance at the first subject 702 is 200 and the distance at the background 703 is 1000. ing.

一方、図7(b)は、図6(b)に示す撮影画像における距離マップ711を示している。図7(b)において、第1の被写体712での距離が200であり、第2の被写体713での距離が100であり、第3の被写体714での距離が300であり、背景715での距離が1000であることを示している。   On the other hand, FIG. 7B shows a distance map 711 in the captured image shown in FIG. In FIG. 7B, the distance at the first subject 712 is 200, the distance at the second subject 713 is 100, the distance at the third subject 714 is 300, and the background 715 The distance is 1000.

図8は、本実施形態において、ぼかし処理を行う一連の処理手順の一例を示すフローチャートである。
まず、ステップS801において、距離マップ生成部104は、例えば図7に示したような距離マップを取得する。そして、ステップS802において、システム制御部50は、距離の種類の数NDを取得する。例えば、図7(a)に示す例の場合は、ND=2であり、図7(b)に示す例の場合は、ND=4である。
FIG. 8 is a flowchart illustrating an example of a series of processing procedures for performing the blurring process in the present embodiment.
First, in step S801, the distance map generation unit 104 acquires a distance map as shown in FIG. 7, for example. In step S802, the system control unit 50 acquires the number ND of distance types. For example, in the example shown in FIG. 7A, ND = 2, and in the example shown in FIG. 7B, ND = 4.

次に、ステップS803において、システム制御部50は、合焦距離DFを取得する。図7(a)及び図7(b)に示す例の場合は、DF=200である。そして、ステップS804において、システム制御部50は、高輝度の分布情報を取得する。例えば、撮影画像601、611に対して水平方向にM個、垂直方向にN個のM×Nのブロック領域に分割し、各ブロック領域に対して図9に示すような輝度ヒストグラムを取得する。図9(a)に示す例の場合は、輝度ヒストグラムのピークの輝度値はYp1であり、図9(b)に示す例の場合は、輝度ヒストグラムのピークの輝度値はYp2である。このようにステップS804の処理では、M×Nのブロック領域のピークの輝度値YpMNを取得する。   Next, in step S803, the system control unit 50 acquires the focusing distance DF. In the case of the example shown in FIGS. 7A and 7B, DF = 200. In step S804, the system control unit 50 acquires high-luminance distribution information. For example, the captured images 601 and 611 are divided into M M × N block areas in the horizontal direction and N M × N block areas in the vertical direction, and a luminance histogram as shown in FIG. 9 is acquired for each block area. In the case of the example shown in FIG. 9A, the luminance value of the peak of the luminance histogram is Yp1, and in the example of FIG. 9B, the luminance value of the peak of the luminance histogram is Yp2. Thus, in the process of step S804, the peak luminance value YpMN of the M × N block region is acquired.

次のステップS805はぼかし処理であり、ステップS804までに取得した距離マップ、距離の種類の数ND、合焦距離DF、及び高輝度の分布情報を用いて、画像処理部24により各被写体距離に応じたぼかし処理を施す。   The next step S805 is a blurring process, and the image processing unit 24 uses the distance map, the distance type number ND, the focusing distance DF, and the high-intensity distribution information acquired up to step S804 to determine each subject distance. Appropriate blurring is performed.

図10は、画像処理部24により行われる、ステップS805のぼかし処理の詳細な処理手順の一例を示すフローチャートである。以下、図10を参照しながらぼかし処理の手順について説明する。
ステップS1001において、撮影画像内の全ての被写体距離Dに対して以下のステップS1002〜S1012のループ処理を開始する。まず、ステップS1002において、図8のステップS802で取得した距離の種類の数NDと閾値ND0とを比較する。この比較の結果、距離の種類の数NDが閾値ND0よりも大きい場合はステップS1003へ進み、距離の種類の数NDが閾値ND0以下(所定値以下)である場合はステップ1009へ進む。
FIG. 10 is a flowchart illustrating an example of a detailed processing procedure of the blurring process in step S805 performed by the image processing unit 24. Hereinafter, the procedure of the blurring process will be described with reference to FIG.
In step S1001, the following loop processing of steps S1002 to S1012 is started for all subject distances D in the captured image. First, in step S1002, the number ND of distance types acquired in step S802 of FIG. 8 is compared with the threshold value ND0. As a result of the comparison, if the distance type number ND is larger than the threshold value ND0, the process proceeds to step S1003. If the distance type number ND is less than or equal to the threshold value ND0 (predetermined value), the process proceeds to step 1009.

ステップS1003においては、図8のステップS803で取得した合焦距離DFと被写体距離Dとの関係から、ぼかしフィルタが簡略フィルタ条件に該当するか否かを判定する。ぼかしフィルタとして簡略フィルタを用いるか否かについては、例えば図11に示すテーブルを参照して決定する。この判定の結果、再現性の低い簡略フィルタを用いる場合はステップ1004へ進み、再現性の高いフィルタを用いる場合はステップS1009へ進む。   In step S1003, it is determined whether or not the blur filter satisfies the simple filter condition from the relationship between the focusing distance DF and the subject distance D acquired in step S803 in FIG. Whether or not to use a simple filter as a blurring filter is determined with reference to a table shown in FIG. 11, for example. As a result of the determination, if a simple filter with low reproducibility is used, the process proceeds to step 1004. If a filter with high reproducibility is used, the process proceeds to step S1009.

ここで、図11に示すテーブルでは、ぼかしモードごとに、合焦距離DFが被写体距離Dよりも大きいか否かによって選択されるフィルタが異なっている。すなわち、被写体の前後関係に基づいてぼかしフィルタが再現性の高いフィルタか再現性の低い簡略フィルタかを定義している。図11において、「○」は再現性の高いフィルタA(高級フィルタ)を使用することを示し、「×」は再現性の低いフィルタB(簡略フィルタ)を使用することを示している。   Here, in the table shown in FIG. 11, the filter to be selected differs depending on whether the in-focus distance DF is larger than the subject distance D for each blur mode. That is, the blur filter is defined as a filter with high reproducibility or a simple filter with low reproducibility based on the context of the subject. In FIG. 11, “◯” indicates that the filter A (high quality filter) with high reproducibility is used, and “X” indicates that the filter B (simple filter) with low reproducibility is used.

図11に示す例の場合、ぼかしモード1では、被写体距離Dによらず再現性の高いフィルタAを使用する。ぼかしモード2では、対象となる被写体が合焦距離DFに位置する被写体よりも手前である場合にはフィルタAを用い、後ろである場合にはフィルタBを用いる。一方、ぼかしモード3では、対象となる被写体が合焦距離DFに位置する被写体よりも手前である場合にはフィルタBを用い、後ろである場合にはフィルタAを用いる。また、ぼかしモード4では、被写体距離Dによらず再現性の低いフィルタBを用いる。なお、これらのぼかしモード1〜4はデジタルカメラ100で表示されるメニュー画面などから操作者によって選択されてよいし、連写を行うか否か、複数枚合成をともなう撮影モードか、など撮影モードや撮影条件によって選択されるようにしてもよい。   In the case of the example shown in FIG. 11, in the blur mode 1, the filter A having high reproducibility is used regardless of the subject distance D. In the blur mode 2, the filter A is used when the target subject is in front of the subject located at the focusing distance DF, and the filter B is used when the subject is behind. On the other hand, in the blur mode 3, the filter B is used when the target subject is in front of the subject located at the focusing distance DF, and the filter A is used when it is behind. In the blur mode 4, the filter B having low reproducibility is used regardless of the subject distance D. Note that these blur modes 1 to 4 may be selected by an operator from a menu screen displayed on the digital camera 100, or whether or not continuous shooting is performed, whether or not a shooting mode with a combination of a plurality of images is taken. It may be selected depending on the shooting conditions.

次に、ステップS1004において、図8のステップS801で取得した距離マップから得られる被写体距離Dの領域と、図8のステップS804で取得した高輝度の分布情報とから被写体距離Dの領域の高輝度情報を取得する。そして、ステップS1005において、ステップS1004で取得した被写体距離Dの領域の高輝度情報から被写体距離Dの領域に高輝度領域が存在するか否かを判定する。すなわち、ステップS804で取得した輝度値のうち、被写体距離Dの領域における輝度値が所定値以上であるか否かを判定する。この判定の結果、高輝度領域が存在しない場合はステップS1006に進み、高輝度領域が存在する場合はステップS1009に進む。   Next, in step S1004, the high brightness of the area of the subject distance D from the area of the subject distance D obtained from the distance map obtained in step S801 of FIG. 8 and the high brightness distribution information obtained in step S804 of FIG. Get information. In step S1005, it is determined whether or not there is a high brightness area in the area of subject distance D from the high brightness information of the area of subject distance D acquired in step S1004. That is, it is determined whether or not the luminance value in the area of the subject distance D is greater than or equal to a predetermined value among the luminance values acquired in step S804. If the result of this determination is that there is no high brightness area, processing proceeds to step S1006, and if there is a high brightness area, processing proceeds to step S1009.

以下に説明するステップS1006〜S1008までの処理では、簡略フィルタによるフィルタ処理を行う。
まず、ステップS1006において、合焦距離DFと被写体距離Dとからぼかし度合を決定する。以下、図12に示すテーブルを例に、ぼかし度合の決定方法について説明する。まず、合焦位置からの相対位置DDを以下の式(1)により算出する。
(合焦位置からの相対位置DD)=(被写体距離D)−(合焦距離DF) 式(1)
In the processing from step S1006 to S1008 described below, filter processing using a simple filter is performed.
First, in step S1006, the blurring degree is determined from the focusing distance DF and the subject distance D. Hereinafter, the method for determining the degree of blur will be described using the table shown in FIG. 12 as an example. First, the relative position DD from the in-focus position is calculated by the following equation (1).
(Relative position DD from in-focus position) = (Subject distance D) − (In-focus distance DF) Equation (1)

次に、図12に示すテーブルで相対位置DDがどの条件に該当するかを判別し、ぼかし度合を決定する。ここで、D1、D2、D3、D4は相対位置DDに対してぼかし度合を決定するために必要な閾値であり、仮想的な絞り値によって決定される。また、前方被写界深度、及び後方被写界深度に関しても、仮想的な絞り値、光学レンズ特性などによって決定される。なお、仮想的な絞り値は、デジタルカメラ100の操作者によってダイヤル、ボタン、タッチパネルなどにより指定される。   Next, it is determined in the table shown in FIG. 12 which condition the relative position DD corresponds to, and the degree of blur is determined. Here, D1, D2, D3, and D4 are threshold values necessary for determining the degree of blurring with respect to the relative position DD, and are determined by a virtual aperture value. Further, the front depth of field and the rear depth of field are also determined by a virtual aperture value, optical lens characteristics, and the like. Note that the virtual aperture value is designated by the operator of the digital camera 100 using a dial, a button, a touch panel, or the like.

図12に示す例では、相対位置DDが閾値D1より小さい場合は、ぼかし度合は「大」である。相対位置DDが閾値D1以上であって閾値D2より小さい場合は、ぼかし度合は「中」である。相対位置DDが閾値D2以上であって、かつ前方被写界深度より手前である場合は、ぼかし度合は「小」である。相対位置DDが前方被写界深度と後方被写界深度との間である場合は、合焦位置でぼかし度合は「無し」である。相対位置DDが後方被写界深度より後方であって、かつ閾値D3以下である場合は、ぼかし度合は「小」である。相対位置DDが閾値D3より大きく閾値D4以下の場合は、ぼかし度合は「中」である。そして、相対位置DDが閾値D4より大きい場合は、ぼかし度合は「大」である。   In the example shown in FIG. 12, when the relative position DD is smaller than the threshold value D1, the degree of blurring is “large”. When the relative position DD is equal to or greater than the threshold value D1 and smaller than the threshold value D2, the blurring degree is “medium”. When the relative position DD is equal to or greater than the threshold value D2 and is closer to the front depth of field, the degree of blurring is “small”. When the relative position DD is between the front depth of field and the rear depth of field, the blurring degree is “none” at the in-focus position. When the relative position DD is behind the rear depth of field and is equal to or less than the threshold value D3, the degree of blurring is “small”. When the relative position DD is greater than the threshold value D3 and less than or equal to the threshold value D4, the blurring degree is “medium”. When the relative position DD is larger than the threshold value D4, the blurring degree is “large”.

なお、本実施形態では、ぼかし度合に関して「無し」を含め4段階の場合を例として説明したが、より細かくぼかし度合と閾値を設けることにより、相対位置DDに対してより多段階のぼかし度合を設けてもよい。   In the present embodiment, the case of four stages including “None” is described as an example of the blurring degree. However, by providing finer the blurring degree and threshold value, more stages of blurring degree can be obtained with respect to the relative position DD. It may be provided.

次に、ステップS1007においては、被写体距離D用の簡略フィルタを取得する。ここで、フィルタの種類は図13に示すようなテーブルで管理されている。ステップS1006で決定されたぼかし度合に従って、ぼかし度合が「小」の場合はフィルタ1Bを取得し、「中」の場合はフィルタ2Bを取得し、「大」の場合はフィルタ3Bを取得する。また、図14(b)に示す簡略フィルタ1404〜1406は、それぞれフィルタ1B、フィルタ2B、フィルタ3Bの形状を表している。   Next, in step S1007, a simple filter for subject distance D is acquired. Here, the types of filters are managed in a table as shown in FIG. According to the blurring degree determined in step S1006, if the blurring degree is “small”, the filter 1B is acquired, if it is “medium”, the filter 2B is acquired, and if it is “large”, the filter 3B is acquired. Also, simplified filters 1404 to 1406 shown in FIG. 14B represent the shapes of the filter 1B, the filter 2B, and the filter 3B, respectively.

そして、ステップS1008において、ステップS1007で取得した簡略フィルタを用いてフィルタ処理を行う。この処理の詳細については後述する。   In step S1008, filter processing is performed using the simple filter acquired in step S1007. Details of this processing will be described later.

一方、ステップS1009〜S1011までの処理では、ぼかし像の再現性の高い高級フィルタによるフィルタ処理を行う。まず、ステップS1009においては、合焦距離DFと被写体距離Dとからぼかし度合を決定する。ぼかし度合の決定方法についてはステップS1006と同様である。   On the other hand, in the processing from step S1009 to S1011, filter processing using a high-quality filter with high reproducibility of a blurred image is performed. First, in step S1009, the blurring degree is determined from the focusing distance DF and the subject distance D. The method for determining the degree of blur is the same as in step S1006.

次に、ステップS1010においては、被写体距離D用の高級フィルタを取得する。フィルタの種類は、図13に示すようなテーブルで管理されている。ステップS1009で決定されたぼかし度合に従って、ぼかし度合が「小」の場合はフィルタ1Aを取得し、「中」の場合はフィルタ2Aを取得し、「大」の場合はフィルタ3Aを取得する。また、図14(a)に示す高級フィルタ1401〜1403は、それぞれフィルタ1A、フィルタ2A、フィルタ3Aの形状を表しており、例えば図3で示したような分割フィルタで構成される2次元フィルタである。   Next, in step S1010, a high-grade filter for subject distance D is acquired. The type of filter is managed in a table as shown in FIG. According to the blurring degree determined in step S1009, if the blurring degree is “small”, the filter 1A is acquired, if it is “medium”, the filter 2A is acquired, and if it is “large”, the filter 3A is acquired. Further, the high-level filters 1401 to 1403 shown in FIG. 14A represent the shapes of the filter 1A, the filter 2A, and the filter 3A, respectively. is there.

次にステップS1011においては、ステップ1010で取得した高級フィルタを用いてフィルタ処理を行う。高級フィルタによるフィルタ処理は、図2〜図4を参照しながら説明した手順と同様の処理によって行われる。   Next, in step S1011, filter processing is performed using the high-level filter acquired in step 1010. Filter processing by the high-level filter is performed by the same processing as the procedure described with reference to FIGS.

最後にステップS1012においては、フィルタ処理の結果と、それまでのぼかし処理が施された中間画像との合成処理を行い、新たな中間画像を生成する。以上のように全ての被写体距離Dについてループ処理を行うと、処理を終了する。   Finally, in step S1012, the result of the filtering process and the intermediate image subjected to the previous blurring process are combined to generate a new intermediate image. As described above, when the loop processing is performed for all the subject distances D, the processing ends.

次に簡略フィルタであるフィルタ1B、フィルタ2B、フィルタ3Bのフィルタ構成について説明する。図15は、フィルタ1B、フィルタ2B、フィルタ3Bの構成例を説明するための図である。図15に示すように、フィルタ1BはフィルタB0(0,0)の構成で表現されており、2次元フィルタのフィルタB0が1個で構成されている。図14(c)に示す簡略フィルタ1407は、フィルタB0の形状を表しており、(9タップ)×(9タップ)の2次元フィルタであって、係数が全て1のフィルタである。   Next, filter configurations of the simple filter 1B, filter 2B, and filter 3B will be described. FIG. 15 is a diagram for describing a configuration example of the filter 1B, the filter 2B, and the filter 3B. As shown in FIG. 15, the filter 1B is expressed by a configuration of a filter B0 (0, 0), and a single two-dimensional filter B0 is configured. A simplified filter 1407 shown in FIG. 14C represents the shape of the filter B0, is a (9 tap) × (9 tap) two-dimensional filter, and is a filter with all coefficients of 1.

一方、フィルタ2Bは、図15に示すように、2次元フィルタのフィルタB0が5個で構成されており、図14(b)に示す簡略フィルタ1405のように、フィルタB0が十字に5個連結された2次元形状を有している。このフィルタ2Bによるフィルタ処理では、(9タップ)×(9タップ)を基準として、フィルタB0のフィルタ処理結果を座標(x,y)に従って水平に(9×x)画素、垂直に(9×y)画素シフトして加算合成する。   On the other hand, the filter 2B includes five two-dimensional filters B0 as shown in FIG. 15, and five filters B0 are connected in a cross like a simple filter 1405 shown in FIG. 14B. It has a two-dimensional shape. In the filter processing by the filter 2B, the filter processing result of the filter B0 is horizontally (9 × x) pixels and vertically (9 × y) according to the coordinates (x, y) with (9 taps) × (9 taps) as a reference. ) Pixel shift and addition synthesis.

また、フィルタ3Bは、図15に示すように、2次元フィルタのフィルタB0が13個で構成されており、図14(b)に示す簡略フィルタ1406のような配置で連結された形状を有している。フィルタ3Bのフィルタ処理では、フィルタ2Bと同様に、フィルタB0の処理結果を座標(x,y)に従って水平に(9×x)画素、垂直に(9×y)画素シフトして加算合成する。   Further, as shown in FIG. 15, the filter 3 </ b> B includes 13 two-dimensional filters B <b> 0, and has a shape connected in an arrangement like a simple filter 1406 shown in FIG. 14B. ing. In the filter processing of the filter 3B, similarly to the filter 2B, the processing result of the filter B0 is shifted by (9 × x) pixels horizontally and (9 × y) pixels vertically according to the coordinates (x, y) and added and synthesized.

図16は、図10のステップS1008における簡略フィルタによるフィルタ処理の詳細な処理手順の一例を示すフローチャートである。
ステップS1601において、簡略フィルタを構成する全ての構成フィルタ(フィルタB0)についてのループ処理を開始する。例えば、図15に示すフィルタ2Bの場合、5個のフィルタB0によって構成されているので、5回のループ処理となる。以下、フィルタ2Bを用いてフィルタ処理を行う例を参照しながら説明する。
FIG. 16 is a flowchart illustrating an example of a detailed processing procedure of the filter processing by the simple filter in step S1008 of FIG.
In step S1601, loop processing is started for all the constituent filters (filter B0) constituting the simple filter. For example, in the case of the filter 2B shown in FIG. 15, since it is configured by five filters B0, the loop processing is performed five times. Hereinafter, a description will be given with reference to an example of performing filter processing using the filter 2B.

まず、ステップS1602において、処理対象であるフィルタによって処理された画像データが既に存在するか否かを判定する。この判定の結果、既に存在する場合はステップS1605に進み、存在しない場合はステップS1603に進む。   First, in step S1602, it is determined whether image data processed by the filter to be processed already exists. As a result of this determination, if it already exists, the process proceeds to step S1605, and if it does not exist, the process proceeds to step S1603.

ステップS1603においては、処理対象であるフィルタの係数情報を取得する。例えば、図14(c)に示すような2次元フィルタ係数f1の情報を取得する。次に、ステップS1604において、構成されているフィルタB0によるフィルタ処理を行う。そして、ステップS1605において、フィルタ処理結果である出力画像Fを一時記憶管理する。   In step S1603, coefficient information of a filter to be processed is acquired. For example, information on the two-dimensional filter coefficient f1 as shown in FIG. Next, in step S1604, a filter process using the configured filter B0 is performed. In step S1605, the output image F that is the filter processing result is temporarily stored and managed.

一方、ステップS1606においては、フィルタの処理結果が存在するため、出力済みのフィルタ処理結果である出力画像Fを取得する。   On the other hand, in step S1606, since there is a filter processing result, an output image F that is an output filter processing result is acquired.

次に、ステップS1607において、処理対象であるフィルタのシフト量(x,y)を取得する。このシフト量は、図15の各フィルタB0に示される(x,y)に該当する。   In step S1607, the shift amount (x, y) of the filter to be processed is acquired. This shift amount corresponds to (x, y) shown in each filter B0 in FIG.

次に、ステップS1608において、ステップS1605又はS1606で取得した出力画像Fを、ステップS1607で取得したシフト量(x,y)に従ってシフトし、これまでの処理結果である中間画像に対して合成処理を行って新たな中間画像を生成する。構成されているフィルタが(9タップ)×(9タップ)の場合0、シフト量(x,y)は水平に(9×x)画素、垂直に(9×y)画素となり、合成した結果が得られる。例えば、フィルタB0(1,2)の場合、フィルタB0の処理結果を水平に(9×1)画素、垂直に(9×2)画素シフトして合成した結果を中間画像として出力する。以上のように全ての構成フィルタに関してフィルタの数の回数分処理が終了すると、ループ処理を終了する。   Next, in step S1608, the output image F acquired in step S1605 or S1606 is shifted according to the shift amount (x, y) acquired in step S1607, and a synthesis process is performed on the intermediate image that is the processing result so far. To generate a new intermediate image. When the configured filter is (9 taps) × (9 taps), the shift amount (x, y) is (9 × x) pixels horizontally and (9 × y) pixels vertically, and the combined result is can get. For example, in the case of the filter B0 (1, 2), the processing result of the filter B0 is shifted horizontally (9 × 1) pixels and vertically shifted (9 × 2) pixels, and the combined result is output as an intermediate image. As described above, when the processing for the number of filters is completed for all the constituent filters, the loop processing is ended.

なお、図10のステップS1007でフィルタ1Bを取得した場合には、フィルタB0を1つしか有していないため、ステップS1605でフィルタ処理した結果がそのまま出力される。したがってこの場合は、ステップS1607及びS1608の処理が行われないことになる。   Note that when the filter 1B is acquired in step S1007 in FIG. 10, since only one filter B0 is provided, the result of the filter processing in step S1605 is output as it is. Therefore, in this case, the processes in steps S1607 and S1608 are not performed.

また、ステップS1602の判定の結果、出力済みのフィルタ処理結果が存在する場合、実際のフィルタ処理が不要となるため、出力画像Fをシフトして中間画像と合成処理を行うのみでよい。これにより、例えば同じぼかし度合である、高級フィルタであるフィルタ2Aに対して簡略フィルタであるフィルタ2B、高級フィルタであるフィルタ3Aに対して簡略フィルタであるフィルタ3Bの処理時間を大幅に抑えることができる。   Further, if there is a filter processing result that has already been output as a result of the determination in step S1602, it is not necessary to perform the actual filter processing. Therefore, it is only necessary to shift the output image F and perform synthesis processing with the intermediate image. As a result, for example, the processing time of the filter 2B that is a simple filter with respect to the filter 2A that is a high-grade filter and the filter 3B that is a simple filter with respect to the filter 3A that is a high-quality filter is greatly reduced. it can.

なお、図15のフローチャートでは、図14(c)に示した(9タップ)×(9タップ)で全て係数が1のフィルタB0を構成フィルタとする例について説明したが、これに限定されない。また、構成フィルタの組み合わせについても図15に示した例について説明したが、これに限定されない。例えば、基本となる構成フィルタを数種類用意し、複数種類の構成フィルタを組み合わせて簡略フィルタを構成することにより、簡略フィルタの形状の自由度を広げることができる。   In the flowchart of FIG. 15, the example in which the filter B0 having (9 taps) × (9 taps) and all coefficients of 1 shown in FIG. 14C is used as the constituent filter has been described. However, the present invention is not limited to this. Moreover, although the example shown in FIG. 15 was demonstrated also about the combination of a structure filter, it is not limited to this. For example, by preparing several basic configuration filters and combining a plurality of types of configuration filters to configure a simple filter, the degree of freedom of the shape of the simple filter can be expanded.

以上のように本実施形態によれば、9タップのような小さいサイズの2次元フィルタによる処理で、54タップの2次元フィルタによる処理で得られるような大きなぼかし処理を撮像画像に付与することができる。つまり、フィルタ処理の回路規模を抑えつつ、一眼レフカメラのような大きな背景ぼかしを再現することができる。   As described above, according to the present embodiment, it is possible to give a captured image a large blurring process that can be obtained by processing using a two-dimensional filter with a small size such as 9 taps. it can. That is, a large background blur like a single-lens reflex camera can be reproduced while suppressing the circuit scale of the filter processing.

さらに本実施形態によれば、被写体距離、合焦位置、および仮想的な絞り情報に従って背景ぼかし処理を行う際に、被写体距離の種類が多い場合でも、ぼかし度合の効果を残しつつ全体の処理時間を抑えることができる。   Furthermore, according to the present embodiment, when performing background blurring processing according to subject distance, focus position, and virtual aperture information, the entire processing time remains while maintaining the effect of blurring degree even when there are many types of subject distances. Can be suppressed.

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

24 画像処理部
50 システム制御部
104 距離マップ生成部
24 image processing unit 50 system control unit 104 distance map generation unit

Claims (8)

焦点までの距離が互いに異なる少なくとも2つの被写体を含む撮影画像を入力する入力手段と、
前記撮影画像における各被写体までの距離と、合焦位置までの距離との情報を取得する取得手段と、
前記取得手段によって取得された各被写体までの距離及び合焦位置までの距離に基づいて前記各被写体に対して異なるフィルタ処理を施す第1の処理手段とを有し、
前記第1の処理手段は、前記各被写体までの距離及び合焦位置までの距離に基づいた回数で前記各被写体に対してそれぞれフィルタ処理を行い、前記フィルタ処理ごとに生成される画像を合成することを特徴とする画像処理装置。
Input means for inputting a photographed image including at least two subjects having different distances to the focal point;
Acquisition means for acquiring information on the distance to each subject in the captured image and the distance to the in-focus position;
First processing means for performing different filter processing on each subject based on the distance to each subject and the distance to the in-focus position obtained by the obtaining means;
The first processing means performs filter processing on each subject by the number of times based on the distance to each subject and the distance to the in-focus position, and synthesizes an image generated for each filter processing. An image processing apparatus.
前記第1の処理手段によるフィルタ処理を適用するか否かを選択する選択手段と、
前記選択手段によって前記第1の処理手段によるフィルタ処理を適用しないことが選択された場合に、前記第1の処理手段によるフィルタ処理よりも再現性の高いフィルタ処理を行って処理後の画像を生成する第2の処理手段とをさらに有することを特徴とする請求項1に記載の画像処理装置。
Selecting means for selecting whether or not to apply the filter processing by the first processing means;
When the selection unit selects not to apply the filter processing by the first processing unit, the processed image is generated by performing filter processing with higher reproducibility than the filter processing by the first processing unit. The image processing apparatus according to claim 1, further comprising: a second processing unit that performs processing.
前記選択手段は、前記被写体の数が所定値以下である場合は、前記第1の処理手段によるフィルタ処理を適用しないことを選択することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the selection unit selects not to apply the filter processing by the first processing unit when the number of subjects is equal to or less than a predetermined value. 前記選択手段は、前記撮影画像に含まれる被写体までの距離と前記合焦位置までの距離との関係に応じて前記第1の処理手段によるフィルタ処理を適用するか否かを選択することを特徴とする請求項2又は3に記載の画像処理装置。   The selection unit selects whether or not to apply the filter processing by the first processing unit according to the relationship between the distance to the subject included in the captured image and the distance to the in-focus position. The image processing apparatus according to claim 2 or 3. 前記選択手段は、前記撮影画像に含まれる被写体の輝度値に応じて前記第1の処理手段によるフィルタ処理を適用するか否かを選択することを特徴とする請求項2〜4の何れか1項に記載の画像処理装置。   5. The method according to claim 1, wherein the selection unit selects whether or not to apply the filter processing by the first processing unit according to a luminance value of a subject included in the captured image. The image processing apparatus according to item. 前記第2の処理手段は、円柱形のフィルタを用いてフィルタ処理を行うことを特徴とする請求項2〜5の何れか1項に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the second processing unit performs filter processing using a cylindrical filter. 焦点までの距離が互いに異なる少なくとも2つの被写体を含む撮影画像を入力する入力工程と、
前記撮影画像における各被写体までの距離と、合焦位置までの距離との情報を取得する取得工程と、
前記取得工程において取得された各被写体までの距離及び合焦位置までの距離に基づいて前記各被写体に対して異なるフィルタ処理を施す処理工程とを有し、
前記処理工程においては、前記各被写体までの距離及び合焦位置までの距離に基づいた回数で前記各被写体に対してそれぞれフィルタ処理を行い、前記フィルタ処理ごとに生成される画像を合成することを特徴とする画像処理方法。
An input step of inputting a photographed image including at least two subjects having different distances to the focal point;
An acquisition step of acquiring information on the distance to each subject in the captured image and the distance to the in-focus position;
A processing step of performing different filter processing on each subject based on the distance to each subject and the distance to the in-focus position acquired in the acquisition step,
In the processing step, each of the subjects is subjected to filter processing by the number of times based on the distance to each subject and the distance to the in-focus position, and an image generated for each filter processing is synthesized. A featured image processing method.
焦点までの距離が互いに異なる少なくとも2つの被写体を含む撮影画像を入力する入力工程と、
前記撮影画像における各被写体までの距離と、合焦位置までの距離との情報を取得する取得工程と、
前記取得工程において取得された各被写体までの距離及び合焦位置までの距離に基づいて前記各被写体に対して異なるフィルタ処理を施す処理工程とをコンピュータに実行させ、
前記処理工程においては、前記各被写体までの距離及び合焦位置までの距離に基づいた回数で前記各被写体に対してそれぞれフィルタ処理を行い、前記フィルタ処理ごとに生成される画像を合成することを特徴とするプログラム。
An input step of inputting a photographed image including at least two subjects having different distances to the focal point;
An acquisition step of acquiring information on the distance to each subject in the captured image and the distance to the in-focus position;
Causing the computer to execute a processing step of performing different filter processing on each subject based on the distance to each subject and the distance to the in-focus position obtained in the obtaining step,
In the processing step, each of the subjects is subjected to filter processing by the number of times based on the distance to each subject and the distance to the in-focus position, and an image generated for each filter processing is synthesized. A featured program.
JP2014031962A 2014-02-21 2014-02-21 Image processing apparatus, image processing method and program Active JP6516410B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014031962A JP6516410B2 (en) 2014-02-21 2014-02-21 Image processing apparatus, image processing method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014031962A JP6516410B2 (en) 2014-02-21 2014-02-21 Image processing apparatus, image processing method and program

Publications (2)

Publication Number Publication Date
JP2015159357A true JP2015159357A (en) 2015-09-03
JP6516410B2 JP6516410B2 (en) 2019-05-22

Family

ID=54183077

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014031962A Active JP6516410B2 (en) 2014-02-21 2014-02-21 Image processing apparatus, image processing method and program

Country Status (1)

Country Link
JP (1) JP6516410B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019533957A (en) * 2016-10-28 2019-11-21 華為技術有限公司Huawei Technologies Co.,Ltd. Photography method for terminal and terminal

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62206682A (en) * 1986-03-07 1987-09-11 Hitachi Ltd Image processing method by division spatial filter
JPH11266388A (en) * 1998-03-17 1999-09-28 Canon Inc Digital camera, photographing method and storage medium
JP2005025766A (en) * 2003-07-03 2005-01-27 Thomson Licensing Sa Method for generating blur and blur generation device
JP2010092094A (en) * 2008-10-03 2010-04-22 Nikon Corp Image processing apparatus, image processing program, and digital camera
JP2012142729A (en) * 2010-12-28 2012-07-26 Nikon Corp Camera
JP2012222641A (en) * 2011-04-11 2012-11-12 Sony Corp Image processing apparatus, image processing method, and program

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62206682A (en) * 1986-03-07 1987-09-11 Hitachi Ltd Image processing method by division spatial filter
JPH11266388A (en) * 1998-03-17 1999-09-28 Canon Inc Digital camera, photographing method and storage medium
JP2005025766A (en) * 2003-07-03 2005-01-27 Thomson Licensing Sa Method for generating blur and blur generation device
JP2010092094A (en) * 2008-10-03 2010-04-22 Nikon Corp Image processing apparatus, image processing program, and digital camera
JP2012142729A (en) * 2010-12-28 2012-07-26 Nikon Corp Camera
JP2012222641A (en) * 2011-04-11 2012-11-12 Sony Corp Image processing apparatus, image processing method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019533957A (en) * 2016-10-28 2019-11-21 華為技術有限公司Huawei Technologies Co.,Ltd. Photography method for terminal and terminal
US10827107B2 (en) 2016-10-28 2020-11-03 Huawei Technologies Co., Ltd. Photographing method for terminal and terminal

Also Published As

Publication number Publication date
JP6516410B2 (en) 2019-05-22

Similar Documents

Publication Publication Date Title
WO2016002228A1 (en) Image-capturing device
US8837864B2 (en) Image synthesis and rotation processing apparatus and image synthesis processing method
JP2013162425A (en) Imaging apparatus, imaging method, and program
US10388035B2 (en) Image processing apparatus, image processing method, and storage medium
JP6056551B2 (en) Image processing program and digital camera
JP6116436B2 (en) Image processing apparatus and image processing method
JP5409483B2 (en) Imaging device
US11367229B2 (en) Image processing apparatus, image processing method, and storage medium
JP6746468B2 (en) IMAGING DEVICE, DISPLAY CONTROL METHOD THEREOF, AND PROGRAM
US20230007150A1 (en) Image capturing apparatus, control method thereof, and non-transitory computer-readable storage medium
JP2017212550A (en) Image reproducer, control method thereof, program, and storage medium
JP6516410B2 (en) Image processing apparatus, image processing method and program
JP2017169188A (en) Imaging device
JP5163333B2 (en) CAMERA DEVICE, IMAGE DISPLAY METHOD, AND IMAGE DISPLAY PROGRAM
JP5340042B2 (en) Imaging apparatus and control method thereof
JP2014138378A (en) Image pickup device, control method thereof, and control program thereof
JP7270819B2 (en) IMAGING DEVICE, CONTROL METHOD AND PROGRAM THEREOF
US10999552B2 (en) Image capturing apparatus, control method therefor, and non-transitory computer-readable storage medium
JP2018098764A (en) Imaging apparatus and image synthesis method
JP2010243923A (en) Imaging apparatus and method of controlling the same
JP5648563B2 (en) Image processing apparatus, image processing method, and program
JP5641352B2 (en) Image processing apparatus, image processing method, and program
JP2018107560A (en) Imaging apparatus
JP2018054815A (en) Region discrimination device, control method therefor, and control program, and imaging apparatus
JP2009296143A (en) Imaging device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170216

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171107

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20171226

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180216

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180807

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181003

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190319

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190416

R151 Written notification of patent or utility model registration

Ref document number: 6516410

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151