JP2017050605A - Image processing apparatus and method, imaging device, program - Google Patents

Image processing apparatus and method, imaging device, program Download PDF

Info

Publication number
JP2017050605A
JP2017050605A JP2015170517A JP2015170517A JP2017050605A JP 2017050605 A JP2017050605 A JP 2017050605A JP 2015170517 A JP2015170517 A JP 2015170517A JP 2015170517 A JP2015170517 A JP 2015170517A JP 2017050605 A JP2017050605 A JP 2017050605A
Authority
JP
Japan
Prior art keywords
shooting
otf
image
unit
target
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
JP2015170517A
Other languages
Japanese (ja)
Inventor
将司 上原
Masashi Uehara
将司 上原
前田 浩二
Koji Maeda
浩二 前田
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 JP2015170517A priority Critical patent/JP2017050605A/en
Publication of JP2017050605A publication Critical patent/JP2017050605A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

PROBLEM TO BE SOLVED: To reproduce the optical characteristics of target shooting conditions, while suppressing the required amount of data.SOLUTION: A region splitting unit 102 acquires shooting conditions 113 and a distance map 112 from an image input unit 101, and splits the region of an image 111 into multiple regions of different shooting distance by using a threshold 116, based on the distance map 112. A blur control unit 103 determines an OTF application region. A shooting time OTF acquisition unit 104 acquires a shooting time OTF corresponding to the focus position at the time of shooting, from the shooting conditions 113 at the time of shooting. A target OTF acquisition unit 105 acquires a target OTF corresponding to the target shooting conditions 117 for each region. A filter generation unit 106 generates a filter applied to an input image, from the shooting time OTF, the target OTF and a blur coefficient. A filter application unit 107 applies a filter, generated by the filter generation unit 107, to the image 111.SELECTED DRAWING: Figure 2

Description

本発明は、撮像により得られた画像に対して光学特性の復元処理を行う技術に関する。   The present invention relates to a technique for performing optical characteristic restoration processing on an image obtained by imaging.

従来、撮影された画像に生じたボケ(Blur)を復元するための画像復元アルゴリズムが知られている。ボケには、収差、焦点ずれ、露光時間中の撮像装置の移動(手ぶれを含む)、露光時間中の被写体の移動、大気のゆらぎ等の要因がある。画像復元に関する技術が特許文献1に開示されている。   2. Description of the Related Art Conventionally, an image restoration algorithm for restoring blur (Blur) generated in a captured image is known. The blur includes factors such as aberration, defocus, movement of the imaging device during exposure time (including camera shake), movement of the subject during exposure time, and atmospheric fluctuation. A technique relating to image restoration is disclosed in Patent Document 1.

画像のボケが起こる要因は、撮像系の球面収差、コマ収差、像面湾曲および非点収差等である。これら収差は、点像分布関数(PSF、Point Spread Function)により表すことができる。点像分布関数(以下、PSF)をフーリエ変換することにより得ることができる光学伝達関数(OTF、Optic Transfer Function)は、収差の周波数空間における情報である。この光学伝達関数(以下、OTF)は複素数で表すことができる。画像復元に関する技術について特許文献1を参考に簡単に説明する。   Causes of image blurring include spherical aberration, coma aberration, field curvature, astigmatism, and the like of the imaging system. These aberrations can be expressed by a point spread function (PSF). An optical transfer function (OTF) that can be obtained by Fourier transforming a point spread function (hereinafter referred to as PSF) is information in the frequency space of aberration. This optical transfer function (hereinafter referred to as OTF) can be represented by a complex number. A technique relating to image restoration will be briefly described with reference to Patent Document 1.

PSFは、一般には入力及び出力の位置に依存してその値が変わるが、2次元システムの応答が均一で入力の位置による応答が変わらないとみなせる領域内では、次の式1が成り立つ。
g(x,y)=f(x,y)*h(x,y)・・・(式1)
The value of PSF generally changes depending on the input and output positions. However, in the region where the response of the two-dimensional system is uniform and the response due to the input position is not changed, the following expression 1 holds.
g (x, y) = f (x, y) * h (x, y) (Formula 1)

ここで、*は、畳み込み積分(convolution integral)を表している。これをフーリエ変換して空間周波数領域で表現すると、式1は次の式2のようになる。
G(u,v)=H(u,v)・F(u,v)・・・(式2)
Here, * represents a convolution integral. When this is Fourier-transformed and expressed in the spatial frequency domain, Equation 1 becomes Equation 2 below.
G (u, v) = H (u, v) · F (u, v) (Expression 2)

ここで、u、vはそれぞれx方向、y方向の空間周波数、F(u,v)、G(u,v)、H(u,v)は、f(x,y)、g(x,y)、h(x,y)を2次元フーリエ変換したものである。H(u,v)は、システムの周波数応答特性を示す空間周波数伝達関数、即ち、2次元フィルタの周波数特性を示すもので、これがOTFと呼ばれるものである。撮像された画像g(x,y)から画像復元を行うには、式2を変形した次の式3を利用すればよい。
F(u,v)=G(u,v)/H(u,v)・・・(式3)
Here, u and v are spatial frequencies in the x and y directions, respectively, and F (u, v), G (u, v) and H (u, v) are f (x, y) and g (x, x, y) and h (x, y) are two-dimensional Fourier transforms. H (u, v) represents a spatial frequency transfer function indicating the frequency response characteristic of the system, that is, a frequency characteristic of a two-dimensional filter, and this is called OTF. In order to restore an image from the captured image g (x, y), the following Expression 3 obtained by transforming Expression 2 may be used.
F (u, v) = G (u, v) / H (u, v) (Equation 3)

OTFの逆フィルタである1/H(u,v)をかけて求めたF(u,v)を、逆フーリエ変換して実空間に戻すことで、原画像f(x,y)を回復画像として求めることができる。また、次の式4のように、1/H(u,v)を逆フーリエ変換して求めた画像復元フィルタを、撮像された画像g(x,y)に対して畳み込み積分することで、原画像f(x,y)を求めることができる。
f(x,y)=g(x,y)*F^(−1){1/H(u,v)}・・・式4
The original image f (x, y) is restored to the real space by performing inverse Fourier transform on F (u, v) obtained by multiplying 1 / H (u, v), which is an inverse filter of OTF, into the real space. Can be obtained as Further, by performing convolution integration on the captured image g (x, y), an image restoration filter obtained by performing inverse Fourier transform on 1 / H (u, v), as in the following Expression 4: An original image f (x, y) can be obtained.
f (x, y) = g (x, y) * F ^ (− 1) {1 / H (u, v)} Equation 4

実際に画像を復元処理する際には、撮影された画像g(x,y)にノイズ成分が含まれるため、画像復元フィルタであるF^(−1){1/H(u,v)}をそのまま用いるとノイズが増幅された画像となってしまう。この問題については、例えば、ウィーナフィルタのようにノイズ成分が存在することを考慮した方法を用いればよい。なお、PSFであるh(x,y)は、ズーム、絞り、被写***置、像高で変わる。   When actually restoring the image, since the captured image g (x, y) includes a noise component, F ^ (− 1) {1 / H (u, v)} which is an image restoration filter. If is used as it is, an image in which noise is amplified is obtained. For this problem, for example, a method considering the presence of a noise component such as a Wiener filter may be used. Note that h (x, y), which is a PSF, varies depending on zoom, aperture, subject position, and image height.

像平面上に焦点の合った像を形成するのは、物体空間の面である焦平面(focal plane)である。撮像装置では、AFやマニュアル操作で光学系のフォーカス用レンズ群を繰り出し、物体空間の一つの面(焦平面)に焦点を合わせて撮影する。画像復元を行う場合、フォーカス用レンズ群の繰り出しにより焦点の合った被写体距離(以下、合焦被写体距離と称す)に基づく画像復元フィルタが適用されることになる。データを膨大に持つことで、合焦被写体距離以外の被写体についても、撮影距離からフィルタを生成して画像へ適用することで、画像復元や画像のシミュレートを行うことができる。   It is the focal plane that is the surface of the object space that forms a focused image on the image plane. In the imaging apparatus, the focusing lens group of the optical system is extended by AF or manual operation, and a single surface (focal plane) in the object space is focused and photographed. In the case of performing image restoration, an image restoration filter based on a subject distance focused on by extending the focusing lens group (hereinafter referred to as a focused subject distance) is applied. By having enormous amounts of data, it is possible to perform image restoration and image simulation by generating a filter from the shooting distance and applying it to the image for subjects other than the focused subject distance.

このようなシステムにおける、実際に撮影で得られた画像にはデフォーカスした領域がある。そのため、焦点合わせをした被写体距離でのPSFに基づいて復元処理を行うと、デフォーカスや絞り状態に応じたぼけをもつ良好な復元画像を得ることができないという問題がある。この問題について、画像の中にデフォーカスした領域がある場合でも、撮像光学系の光学収差によるぼけを補正し、デフォーカスや絞り状態に応じたぼけを出す良好な復元画像を得る技術が特許文献2で提案されている。   In such a system, an image actually obtained by shooting has a defocused area. For this reason, when the restoration process is performed based on the PSF at the focused subject distance, there is a problem in that a good restored image having a blur corresponding to the defocus or the aperture state cannot be obtained. Regarding this problem, even if there is a defocused area in the image, a technique for correcting a blur due to the optical aberration of the imaging optical system and obtaining a good restored image that produces a blur corresponding to the defocus or aperture state is disclosed in Patent Literature. 2 proposed.

この技術を応用することで、撮影時とは異なる撮影条件を再現することが可能である。例えば、プロ仕様のレンズ交換式の一眼レフカメラのような撮像装置を考える。交換できるレンズには複数の特性を持つレンズが存在し、特性の1つに開放F値が存在する。レンズが選択できる絞りの値のうち、一番明るい絞りの値がレンズごとに決まっており、それを開放F値と呼ぶ。開放F値が小さい、いわゆる明るいレンズであれば、一般的にはレンズ本体の重量は重い傾向がある。しかし、明るいレンズであれば被写界深度の浅い画像を撮影することができ、特にポートレート撮影などの場面ではできる限り明るいレンズを用いたいと思うユーザは多い。そのため、重くて持ち運びがしにくい明るいレンズを持っていくか、軽くて暗いレンズを持っていくかを、ユーザは常に選択する必要があり、撮影を行うによっては明るいレンズの使用を断念することもあった。   By applying this technique, it is possible to reproduce shooting conditions different from those at the time of shooting. For example, consider an imaging device such as a professional interchangeable lens single-lens reflex camera. The interchangeable lens includes a lens having a plurality of characteristics, and one of the characteristics includes an open F value. Among the aperture values that can be selected by the lens, the brightest aperture value is determined for each lens, and this is called the open F value. In the case of a so-called bright lens having a small open F value, the weight of the lens body generally tends to be heavy. However, a bright lens can shoot an image with a shallow depth of field, and many users want to use a lens that is as bright as possible, particularly in portrait photography. Therefore, the user must always choose whether to bring a heavy lens that is heavy and difficult to carry, or a light and dark lens. Depending on the shooting, the user may give up using a bright lens. there were.

この場合、上記技術を応用すれば、撮影時は開放F値が大きい軽量なレンズで撮影し、復元技術を用いて、より明るいレンズで撮影されたのと同様の画像を後処理により再現し、ユーザのニーズを満たすことができる。撮影時のレンズと再現したいレンズのPSFをはじめとした光学特性を用いることで、撮影時のレンズの開放F値よりも小さいF値のレンズでの撮影を擬似的に再現することもできる。すなわち、撮影時のレンズの特性で一度復元し、その後、目標のF値を実現するPSFから収差を含めた光学特性を適用することで、収差によるボケ具合等のレンズの味とよばれる特性も再現できる。この場合、撮影距離については、撮影時のフォーカス位置と、実際の被写体距離の組み合わせごとに光学特性を求めることで、どのようなフォーカス位置でどの撮影距離であっても等しく光学特性を再現することが可能になる。   In this case, if the above technique is applied, at the time of shooting, the image is shot with a light lens having a large open F value, and using a restoration technique, an image similar to that shot with a brighter lens is reproduced by post-processing, It can meet the needs of users. By using optical characteristics such as the PSF of the lens at the time of photographing and the lens to be reproduced, it is possible to simulate the photographing with a lens having an F value smaller than the open F value of the lens at the time of photographing. That is, by restoring once with the lens characteristics at the time of shooting, and then applying optical characteristics including aberration from the PSF that achieves the target F value, characteristics called lens taste such as blur due to aberration can also be obtained. Can be reproduced. In this case, regarding the shooting distance, the optical characteristics are obtained for each combination of the focus position at the time of shooting and the actual subject distance, so that the optical characteristics can be reproduced equally at any focus position and at any shooting distance. Is possible.

特許文献2に示される手法は従来から知られており、撮影条件の取得や、撮影時の条件にあったPSFの取得なども、周辺技術の技術革新により、昨今、精度の高い実用的な結果が得られるようになってきた。その一方で、特許文献2の手法のように、フォーカス位置のみではなく、画面全体における全ての被写体距離に応じたOTFを用いる方法では、精度が上がりデータ量が増大したOTFデータを扱うことが現実的に難しくなってきている。   The technique disclosed in Patent Document 2 has been known in the past, and acquisition of shooting conditions and acquisition of PSF that meet the conditions at the time of shooting have also resulted in highly accurate and practical results due to technological innovation in peripheral technology. Has come to be obtained. On the other hand, as in the method of Patent Document 2, in the method using OTF corresponding to all subject distances in the entire screen, not only the focus position, it is practical to handle OTF data with increased accuracy and increased data amount. It is getting harder.

特開昭62−127976号公報Japanese Patent Laid-Open No. 62-127976 特開2012−5056号公報JP 2012-5056 A

しかしながら、従来技術では、画像復元によって目標の撮影条件の光学特性を精度良く再現するためには、全てのフォーカス位置に対する撮影距離の組み合わせの光学特性を保持しておく必要があった。通常、PSFやOTFのデータは、任意の1点に対して数百から数千倍以上のデータが必要となるため、全てのフォーカス位置に対応して全撮影距離のOTFデータを保持することは、データ量が膨大になり過ぎ現実的でない。例えば、目標の撮影条件の光学特性を、撮影距離ごとではなく、フォーカス位置のみの撮影時のOTFと目標のOTFとから再現することが実現できなかった。   However, in the prior art, in order to accurately reproduce the optical characteristics of the target shooting condition by image restoration, it is necessary to retain the optical characteristics of combinations of shooting distances for all focus positions. Normally, PSF or OTF data requires several hundred to several thousand times more data for an arbitrary point. Therefore, it is not possible to hold OTF data for all shooting distances corresponding to all focus positions. The amount of data becomes too large and is not realistic. For example, it has not been possible to reproduce the optical characteristics of the target shooting conditions from the OTF at the time of shooting only at the focus position and the target OTF, not at each shooting distance.

ところで、デフォーカスを算出する際に関連する技術として、撮影時に画像全域に亘って被写体の距離を取得するという技術も存在する。その代表的なものとして、視差画像という異なる位置から同じ領域を撮影した2つの画像を用い、その位置の差と写っている被写体のずれ具合を検出し、それぞれについて距離を求めるという手法がある。この場合、撮像装置に予め視差画像を取得する機構を用意しておく必要があるが、撮影は1回行うだけで画像中の被写体の距離が求まるというメリットがある。   By the way, as a technique related to calculating the defocus, there is a technique of acquiring the distance of the subject over the entire image at the time of shooting. As a typical example, there is a technique of using two images obtained by photographing the same region from different positions as parallax images, detecting a difference between the positions and a degree of shift of a photographed subject, and obtaining a distance for each. In this case, it is necessary to prepare a mechanism for acquiring a parallax image in advance in the imaging device, but there is an advantage that the distance of the subject in the image can be obtained by performing shooting only once.

本発明の目的は、必要なデータ量を抑えつつ目標の撮影条件の光学特性を再現することである。   An object of the present invention is to reproduce the optical characteristics of a target photographing condition while suppressing a necessary amount of data.

上記目的を達成するために本発明は、撮影により得られた画像、該画像の撮影時の撮影条件、及び該画像に関する距離マップを取得する第1の取得手段と、前記第1の取得手段により取得された距離マップに基づいて、前記第1の取得手段により取得された画像の領域を、閾値を用いて撮影距離の異なる複数の領域に分割する分割手段と、前記分割手段により分割された複数の領域のうち、OTF(光学伝達関数)を適用するOTF適用領域を決定する決定手段と、前記第1の取得手段により取得された撮影時の撮影条件に基づいて、撮影時のフォーカス位置に対応する撮影時OTFを取得する第2の取得手段と、前記複数の領域ごとに、指定された目標撮影条件に基づいて目標OTFを取得する第3の取得手段と、前記第2の取得手段により取得された撮影時OTFと前記第3の取得手段により取得された目標OTFとに基づいて、画像復元を行うためのフィルタを生成する生成手段と、前記生成手段により生成されたフィルタを前記画像に適用することで、前記画像の前記OTF適用領域の光学収差を補正する補正手段と、を有することを特徴とする。   In order to achieve the above object, the present invention provides a first acquisition unit that acquires an image obtained by shooting, shooting conditions at the time of shooting the image, and a distance map related to the image, and the first acquisition unit. Based on the acquired distance map, a dividing unit that divides the region of the image acquired by the first acquiring unit into a plurality of regions having different shooting distances using a threshold value, and a plurality of portions divided by the dividing unit And a focus position at the time of shooting based on a shooting condition at the time of shooting acquired by the first acquisition unit and a determination unit that determines an OTF application region to which an OTF (optical transfer function) is applied. A second acquisition unit that acquires an OTF during shooting, a third acquisition unit that acquires a target OTF based on a specified target shooting condition for each of the plurality of regions, and a second acquisition unit. Based on the acquired photographing OTF and the target OTF acquired by the third acquiring unit, a generating unit that generates a filter for performing image restoration, and the filter generated by the generating unit in the image And correcting means for correcting optical aberrations in the OTF application region of the image by applying.

本発明によれば、必要なデータ量を抑えつつ目標の撮影条件の光学特性を再現することができる。   According to the present invention, it is possible to reproduce the optical characteristics of a target photographing condition while suppressing a necessary data amount.

画像処理装置の構成を示す図である。It is a figure which shows the structure of an image processing apparatus. デジタルカメラの処理部を示すブロック図である。It is a block diagram which shows the process part of a digital camera. 領域分割部による処理を示すフローチャートである。It is a flowchart which shows the process by an area | region division part. 画像の全領域を5つの領域に分割した例を示す図(図(a))、分割した領域の撮影レンズからの距離を示す図(図(b))である。It is a figure (Drawing (a)) which shows the example which divided all the fields of a picture into five fields, and is a figure (Drawing (b)) which shows the distance from the photography lens of the divided field. ボケコントロール部による処理を示すフローチャートである。It is a flowchart which shows the process by a blur control part. 撮影時OTF取得部、目標OTF取得部による各処理を示すフローチャートである。It is a flowchart which shows each process by the OTF acquisition part at the time of imaging | photography, and a target OTF acquisition part. フィルタ生成部、フィルタ適用部による各処理を示すフローチャートである。It is a flowchart which shows each process by a filter production | generation part and a filter application part.

以下、本発明の実施の形態を図面を参照して説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、発明の一実施の形態に係る画像処理装置の構成を示す図である。図1では、画像処理装置の一例として、撮像装置であるデジタルカメラ100を示す。図1のデジタルカメラ100において、撮像素子や表示素子のような物理的デバイスを除き、各ブロックは専用ロジック回路やメモリを用いてハードウェア的に構成されてもよい。或いは、メモリに記憶されている処理プログラムをCPU等のコンピュータが実行することにより、ソフトウェア的に構成されてもよい。   FIG. 1 is a diagram showing a configuration of an image processing apparatus according to an embodiment of the invention. In FIG. 1, a digital camera 100 that is an imaging device is shown as an example of an image processing device. In the digital camera 100 of FIG. 1, each block may be configured by hardware using a dedicated logic circuit or a memory, except for a physical device such as an imaging device or a display device. Alternatively, the processing program stored in the memory may be configured by software by a computer such as a CPU executing the processing program.

また、本画像処理装置は、デジタルカメラ以外に、例えばパーソナルコンピュータ、携帯電話、スマートフォン、PDA、タブレット端末、デジタルビデオカメラなどの任意の情報処理端末或いは撮像装置として構成してもよい。あるいは、ディスプレイを備えるプリンタ装置、デジタルフォトフレーム、音楽プレーヤ、ゲーム機、電子ブックリーダとして構成してもよい。   In addition to the digital camera, the image processing apparatus may be configured as an arbitrary information processing terminal such as a personal computer, a mobile phone, a smartphone, a PDA, a tablet terminal, a digital video camera, or an imaging device. Or you may comprise as a printer apparatus provided with a display, a digital photo frame, a music player, a game machine, and an electronic book reader.

カメラ100において、撮像光学系を構成する撮影レンズ110を介して入射した被写体からの反射光は、撮像素子142上で光学像として結像し被写体像を形成する。当該被写体像は画素単位に電気信号に変換(光電変換)され、アナログ画素信号が生成される。アナログ画素信号はA/D変換器144においてデジタル信号に変換され、画像処理部146で画像処理される。画像処理部146は、A/D変換器144からのデータ或いはメモリ制御部120からのデータに対して所定のデモザイク処理や色変換処理を行う。メモリ制御部120は、A/D変換器144や画像処理部146の動作を制御する。   In the camera 100, the reflected light from the subject incident through the photographing lens 110 constituting the imaging optical system forms an optical image on the image sensor 142 to form a subject image. The subject image is converted into an electrical signal (photoelectric conversion) in units of pixels, and an analog pixel signal is generated. The analog pixel signal is converted into a digital signal by the A / D converter 144 and subjected to image processing by the image processing unit 146. The image processing unit 146 performs predetermined demosaic processing and color conversion processing on the data from the A / D converter 144 or the data from the memory control unit 120. The memory control unit 120 controls operations of the A / D converter 144 and the image processing unit 146.

A/D変換器144から出力されたデジタル信号は、画像処理部146、メモリ制御部120を介して、或いは直接にメモリ制御部120を介して、画像表示メモリ126或いはメモリ128に書き込まれる。画像表示メモリ126は、画像表示部124の表示用の画像データを記憶するメモリであって、画像表示メモリ126が記憶するデータはD/A変換器122を介して画像表示部124により表示される。システム制御部132はCPU、ROM、RAMを有し、CPUがROMに格納されたプログラムをRAMの作業エリアに展開し、実行することにより、カメラ100の全体的な動作制御を行う。   The digital signal output from the A / D converter 144 is written to the image display memory 126 or the memory 128 via the image processing unit 146, the memory control unit 120, or directly via the memory control unit 120. The image display memory 126 is a memory for storing image data for display of the image display unit 124, and the data stored in the image display memory 126 is displayed by the image display unit 124 via the D / A converter 122. . The system control unit 132 includes a CPU, a ROM, and a RAM. The CPU expands and executes a program stored in the ROM in a RAM work area, thereby performing overall operation control of the camera 100.

シャッタースイッチ134は、ユーザからの撮影のための前処理の開始指示(SW1)を受け付けるための操作部であって、不図示のシャッターボタンの操作途中でオンとなる。シャッタースイッチ136は、ユーザからの撮影指示(SW2)を受け付けるための操作部であって、不図示のシャッターボタンの完全な押下でオンとなる。撮影指示がなされると撮像素子142から読み出されたアナログ信号がA/D変換器144、メモリ制御部120を介して、画像処理部146やメモリ制御部120で演算により現像処理される。現像処理の結果はメモリ128に画像データとして記憶される。画像データはメモリ128から読み出されて画像処理部146にて圧縮処理が行われ、SDカードなどの記録媒体を含む記録部130に書き込まれる。なお、記録媒体はカメラ100に対して取り外し可能に装着されていてもよい。操作部140は、画像表示部124に表示されたメニュー画面に対する操作や、表示画像の選択など、各種の選択操作をユーザから受け付けるためのユーザ・インタフェースである。操作部140が検出した信号は、システム制御部132に入力される。   The shutter switch 134 is an operation unit for receiving a preprocessing start instruction (SW1) for photographing from the user, and is turned on during operation of a shutter button (not shown). The shutter switch 136 is an operation unit for receiving a shooting instruction (SW2) from the user, and is turned on when a shutter button (not shown) is completely pressed. When a shooting instruction is given, the analog signal read from the image sensor 142 is developed by the image processing unit 146 and the memory control unit 120 through calculation via the A / D converter 144 and the memory control unit 120. The result of the development process is stored in the memory 128 as image data. The image data is read from the memory 128, compressed by the image processing unit 146, and written to the recording unit 130 including a recording medium such as an SD card. Note that the recording medium may be detachably attached to the camera 100. The operation unit 140 is a user interface for accepting various selection operations from the user, such as operations on the menu screen displayed on the image display unit 124 and selection of a display image. A signal detected by the operation unit 140 is input to the system control unit 132.

図2は、本発明を実現するためのデジタルカメラ100の処理部を示すブロック図である。このカメラ100は、距離マップを取得可能な撮像装置である。以下、光学伝達関数をOTF(Optic Transfer Function)と記す。カメラ100は、処理部として、画像入力部101、領域分割部102、ボケコントロール部103、撮影時OTF取得部104、目標OTF取得部105、フィルタ生成部106、フィルタ適用部107を有する。これらの処理部は画像処理部146に含まれる。   FIG. 2 is a block diagram showing a processing unit of the digital camera 100 for realizing the present invention. The camera 100 is an imaging device that can acquire a distance map. Hereinafter, the optical transfer function is referred to as OTF (Optic Transfer Function). The camera 100 includes an image input unit 101, an area dividing unit 102, a blur control unit 103, a shooting OTF acquisition unit 104, a target OTF acquisition unit 105, a filter generation unit 106, and a filter application unit 107 as processing units. These processing units are included in the image processing unit 146.

カメラ100では、被写体を撮影して画像111を得る際に、撮影時の撮影条件113が取得されると共に、視差センサ114(図1には図示せず)により距離マップ112が取得される。画像111が画像入力部101に入力され、これにより、第1の取得手段としての画像入力部101は画像111を取得する。画像111が画像入力部101に入力される際、撮影条件113及び距離マップ112は、画像111に対応付けられるかまたは画像111の属性情報として画像入力部101に入力される。撮影条件113には、シャッタ速度、絞り値、撮影感度、露出時間、フォーカス位置等が含まれるが、例示に限定されず、また、撮影条件113に含まれる項目のうち少なくとも1つが、実際に算出や処理に利用される。   In the camera 100, when the subject is photographed to obtain the image 111, the photographing condition 113 at the time of photographing is acquired, and the distance map 112 is acquired by the parallax sensor 114 (not shown in FIG. 1). The image 111 is input to the image input unit 101, whereby the image input unit 101 as the first acquisition unit acquires the image 111. When the image 111 is input to the image input unit 101, the shooting condition 113 and the distance map 112 are associated with the image 111 or input to the image input unit 101 as attribute information of the image 111. The shooting conditions 113 include shutter speed, aperture value, shooting sensitivity, exposure time, focus position, etc., but are not limited to examples, and at least one of the items included in the shooting conditions 113 is actually calculated. Used for processing.

領域分割部102は、画像入力部101から撮影条件113及び距離マップ112を取得する。閾値設定部115により閾値116が設定され、設定された閾値116が領域分割部102へ入力される。閾値設定部115は操作部140に含まれ、閾値116はユーザが指定できる。なお、閾値116は固定値としてもよい。分割手段としての領域分割部102は、距離マップ112に基づいて、画像111の領域を、閾値116を用いて撮影距離の異なる複数の領域に分割する。   The area dividing unit 102 acquires the shooting condition 113 and the distance map 112 from the image input unit 101. A threshold 116 is set by the threshold setting unit 115, and the set threshold 116 is input to the region dividing unit 102. The threshold setting unit 115 is included in the operation unit 140, and the threshold 116 can be specified by the user. The threshold value 116 may be a fixed value. The area dividing unit 102 as a dividing unit divides the area of the image 111 into a plurality of areas having different shooting distances using a threshold 116 based on the distance map 112.

ボケコントロール部103は、分割された領域ごとに、被写界深度と撮影距離に応じたボケ係数を算出する。ボケコントロール部103は、領域分割部102を通じて撮影時の撮影条件113を取得する。第2の取得手段としての撮影時OTF取得部104は、画像入力部101から撮影条件113を取得する。撮影時OTF取得部104は、撮影時の撮影条件113から、撮影時のフォーカス位置に対応する撮影時OTFを取得する。目標撮影条件117がボケコントロール部103及び目標OTF取得部105に入力される。目標撮影条件117に含まれ得る項目は撮影条件113と同様であり、例えば操作部140によって指定される。第3の取得手段としての目標OTF取得部105は、分割された領域ごとに目標撮影条件117に対応する目標OTFを取得する。生成手段としてのフィルタ生成部106は、撮影時OTFと目標OTFとボケ係数とから、入力画像に適用するフィルタを生成する。補正手段としてのフィルタ適用部107は、フィルタ生成部106により生成されたフィルタを画像111に適用する。   The blur control unit 103 calculates a blur coefficient corresponding to the depth of field and the shooting distance for each divided area. The blur control unit 103 acquires the shooting condition 113 at the time of shooting through the area dividing unit 102. The shooting OTF acquisition unit 104 as the second acquisition unit acquires the shooting condition 113 from the image input unit 101. The shooting OTF acquisition unit 104 acquires the shooting OTF corresponding to the focus position at the time of shooting from the shooting conditions 113 at the time of shooting. The target shooting condition 117 is input to the blur control unit 103 and the target OTF acquisition unit 105. Items that can be included in the target shooting condition 117 are the same as those in the shooting condition 113, and are specified by the operation unit 140, for example. A target OTF acquisition unit 105 as a third acquisition unit acquires a target OTF corresponding to the target imaging condition 117 for each divided area. A filter generation unit 106 serving as a generation unit generates a filter to be applied to the input image from the shooting OTF, the target OTF, and the blur coefficient. A filter application unit 107 serving as a correction unit applies the filter generated by the filter generation unit 106 to the image 111.

次に、図3〜図7を用いて、画像復元等のための画像処理部146による各種の処理について説明する。この処理は、撮影が完了した直後、または所定の操作によって開始される。なお、撮像機能を備えない画像処理装置でこの処理を実行する場合は、所定の指示操作により開始されるようにしてもよい。   Next, various processes performed by the image processing unit 146 for image restoration and the like will be described with reference to FIGS. This process is started immediately after the photographing is completed or by a predetermined operation. Note that when this processing is executed by an image processing apparatus that does not have an imaging function, it may be started by a predetermined instruction operation.

図3は、領域分割部102による処理を示すフローチャートである。領域分割部102は、視差センサ114を用いて取得された距離マップ112を取得する(ステップS201)。距離マップ112では、画像111中の各位置において、被写体までの距離が記録されているが、それぞれの値はある程度の階調を持って連続的に変化する値である。次に、領域分割部102は、閾値116を取得する(ステップS202)。ここで、閾値116は、処理の精度に関わる値であり、値が大きくなるとその後の処理の精度が下がる。次に、領域分割部102は、画像111における領域を距離マップ112及び閾値116を元に複数に分割する。そして、領域分割部102は、領域を分割した結果、分割後の領域の数が2つ以上存在するか否かを判別し(ステップS203)、分割後の領域の数が1つしかなかった場合は処理を終了させる。一方、領域分割部102は、分割後の領域の数が2つ以上であればその情報をメモリ128等に記録してから(ステップS204)、処理を終了させる。   FIG. 3 is a flowchart showing processing by the area dividing unit 102. The area dividing unit 102 acquires the distance map 112 acquired using the parallax sensor 114 (step S201). In the distance map 112, the distance to the subject is recorded at each position in the image 111, but each value is a value that continuously changes with a certain level of gradation. Next, the area dividing unit 102 acquires a threshold value 116 (step S202). Here, the threshold value 116 is a value related to the accuracy of processing, and as the value increases, the accuracy of subsequent processing decreases. Next, the region dividing unit 102 divides the region in the image 111 into a plurality based on the distance map 112 and the threshold value 116. Then, as a result of dividing the area, the area dividing unit 102 determines whether or not there are two or more divided areas (step S203), and when there is only one divided area. Terminates the process. On the other hand, if the number of divided areas is two or more, the area dividing unit 102 records the information in the memory 128 or the like (step S204), and ends the process.

ここで、領域分割の例を説明する。図4(a)は、画像111の全領域を5つの領域A、B、C、D、Eに分割した例を示している。図4(b)は、分割した領域の撮影レンズ110からの距離を示す図である。画像111の撮影時のフォーカス位置(ピント位置)を中心とする閾値116の範囲が領域Dとされる。領域Dはピント面を含んでいて最もピントが合っている領域である。領域Dを基準として、画像111の他の領域は、距離に応じて閾値116ごとに区切られる。例えば、領域Dより閾値116だけ遠い側の領域であって閾値116の範囲の領域が領域Eである。領域Eより閾値116だけ遠い側の領域であって閾値116の範囲の領域が領域Fである。同様に、領域Dより閾値116だけ近い側の領域であって閾値116の範囲の領域が領域Cである。なお、分割数の上限を予め決め、ピント面を含んでいる領域から定まる領域数が上限に達したらそれより遠い領域及び近い領域をそれぞれ1つの領域としてもよい。その場合、例えば、分割数の上限が7つであるとすると、領域G、Aはそれぞれ閾値116よりも長い領域となる。領域Gは無限遠を含んでいる。なお、分割の手法については、距離マップを用いて距離に応じて領域を分割すればよく、例示の手法に限定されない。   Here, an example of area division will be described. FIG. 4A shows an example in which the entire area of the image 111 is divided into five areas A, B, C, D, and E. FIG. 4B is a diagram illustrating the distance from the photographing lens 110 in the divided area. Region D is a range of threshold 116 centered on the focus position (focus position) at the time of shooting image 111. A region D is a region that includes the focus surface and is most in focus. With reference to the region D, the other regions of the image 111 are divided for each threshold 116 according to the distance. For example, a region that is farther than the region D by the threshold value 116 and is within the range of the threshold value 116 is the region E. A region far from the region E by the threshold 116 and within the range of the threshold 116 is a region F. Similarly, a region that is closer to the threshold 116 than the region D and is within the range of the threshold 116 is a region C. Note that the upper limit of the number of divisions is determined in advance, and when the number of areas determined from the area including the focus surface reaches the upper limit, the areas farther and closer may be set as one area. In this case, for example, if the upper limit of the number of divisions is 7, the regions G and A are regions longer than the threshold value 116, respectively. Region G includes infinity. In addition, about the method of a division | segmentation, an area | region should just be divided | segmented according to distance using a distance map, and is not limited to the example method.

図5は、ボケコントロール部103による処理を示すフローチャートである。ボケコントロール部103では、撮影条件が変わったことで変化したボケをコントロールするためのボケ係数が算出される。   FIG. 5 is a flowchart showing processing by the blur control unit 103. The blur control unit 103 calculates a blur coefficient for controlling blur that has changed due to a change in shooting conditions.

まず、ボケコントロール部103は、撮影時の撮影条件113及び目標撮影条件117を取得する(ステップS301)。そしてボケコントロール部103は、領域分割部102により分割された画像111の複数の領域を、ボケを付加するボケ付加領域とボケを付加しない領域とにグループ分けする(ステップS302)。ここで、ボケを付加しない領域は、OTFフィルタを適用するOTF適用領域となる。従って、ボケ付加領域を決定することは、OTF適用領域を決定することでもあり、ボケコントロール部103が、本発明における決定手段としての役割を果たす。ここで、OTF適用領域の決定手法の例として、例えばボケコントロール部103は、目標撮影条件下において、撮影距離が被写界深度に含まれる領域をOTF適用領域として決定する。   First, the blur control unit 103 acquires a shooting condition 113 and a target shooting condition 117 at the time of shooting (step S301). Then, the blur control unit 103 groups the plurality of regions of the image 111 divided by the region dividing unit 102 into a blur added region where blur is added and a region where blur is not added (step S302). Here, the region to which no blur is added is an OTF application region to which the OTF filter is applied. Therefore, determining the blur added area is also determining the OTF application area, and the blur control unit 103 plays a role as a determination unit in the present invention. Here, as an example of a method for determining the OTF application area, for example, the blur control unit 103 determines an area in which the shooting distance is included in the depth of field as the OTF application area under the target shooting conditions.

具体例を示す。例えば、撮影時の絞り値が5.6であって、ピント位置の前後1mの領域まで被写界深度に含まれているとする。図4(a)を例にとると、撮影時には、フォーカス位置を中心とする5つの領域B、C、D、E、Fが被写界深度に含まれていたとする。一方、目標撮影条件117では絞り値が2.6であって、ピント面の前後50cmの範囲にまで被写界深度は浅くなる。その結果、5つの領域B、C、D、E、Fのうち、前後両外側の2つの領域B、Fは被写界深度の範囲外となることがわかる。従って、この場合は、3つの領域C、D、EがOTF適用領域として決定され、それ以外がボケ付加領域とされる。   A specific example is shown. For example, it is assumed that the aperture value at the time of shooting is 5.6, and the area of 1 m before and after the focus position is included in the depth of field. Taking FIG. 4A as an example, it is assumed that five regions B, C, D, E, and F centered at the focus position are included in the depth of field at the time of shooting. On the other hand, under the target photographing condition 117, the aperture value is 2.6, and the depth of field becomes shallower to a range of 50 cm before and after the focus surface. As a result, it can be seen that out of the five regions B, C, D, E, and F, the two regions B and F outside the front and rear sides are outside the range of the depth of field. Therefore, in this case, the three areas C, D, and E are determined as the OTF application areas, and the other areas are the blur addition areas.

なお、OTF適用領域の決定の詳細なルールは例示したものに限定されない。例えば、目標撮影条件117における絞り値によると被写界深度の限界位置を含む領域は、OTF適用領域としてもよいが、ボケ付加領域としてもよい。   Note that the detailed rules for determining the OTF application area are not limited to those illustrated. For example, according to the aperture value in the target shooting condition 117, an area including the limit position of the depth of field may be an OTF application area or a blur added area.

次に、ボケコントロール部103は、決定したボケ付加領域の各々に対するボケ係数を算出する(ステップS303)。ここで、撮影条件の主に絞り値に基づき、撮影時と目標との絞り値の差分から、現在のピント面を中心としてボケ状態がどのように変化するかを考慮してボケ係数が算出される。   Next, the blur control unit 103 calculates a blur coefficient for each of the determined blur addition areas (step S303). Here, based on the aperture value mainly in the shooting conditions, the blur coefficient is calculated from the difference between the aperture value at the time of shooting and the target, taking into account how the blur condition changes around the current focus surface. The

具体的にはまず、ボケコントロール部103は、全てのボケ付加領域に対するボケ係数の算出が完了したか否かを判別する(ステップS304)。その判別の結果、ボケコントロール部103は、ボケ係数の算出が完了していない場合は、今回の算出対象のボケ付加領域に関する撮影時の撮影条件113から撮影距離を取得する(ステップS305)。さらにボケコントロール部103は、撮影時のフォーカス位置を取得する(ステップS306)。そして、ボケコントロール部103は、取得した撮影距離とフォーカス位置との差分からボケ係数を算出する(ステップS307)。その後、処理はステップS304に戻る。図5の全てのボケ付加領域に対するボケ係数の算出が完了した場合は、図5の処理は終了する。   Specifically, first, the blur control unit 103 determines whether or not the calculation of the blur coefficient for all blur added regions has been completed (step S304). As a result of the determination, if the calculation of the blur coefficient is not completed, the blur control unit 103 acquires the shooting distance from the shooting condition 113 at the time of shooting related to the blur added region to be calculated this time (step S305). Further, the blur control unit 103 acquires a focus position at the time of shooting (step S306). Then, the blur control unit 103 calculates a blur coefficient from the difference between the acquired shooting distance and the focus position (step S307). Thereafter, the process returns to step S304. When the calculation of the blur coefficient for all the blur added areas in FIG. 5 is completed, the process in FIG. 5 ends.

例えば、領域B、Fは、撮影時は被写界深度内であったが、目標撮影条件下では被写界深度外となり、ボケを付加する必要がある。そこでボケコントロール部103は、撮影距離とフォーカス位置との差分(図4の例では50cm)に対応したボケ係数を領域B、Fに対して割り当てる。   For example, regions B and F are within the depth of field at the time of shooting, but are outside the depth of field under the target shooting conditions, and it is necessary to add blur. Therefore, the blur control unit 103 assigns a blur coefficient corresponding to the difference between the shooting distance and the focus position (50 cm in the example of FIG. 4) to the regions B and F.

なお、後述するフィルタを画像111に適用することで、実際にぼかしが画像111に作用する。従って、OTF適用領域に対しては、ボケ係数は、フィルタを適用しても実質的にぼかしが作用しないような値が設定される。   Note that blurring actually acts on the image 111 by applying a filter described later to the image 111. Therefore, for the OTF application region, the blur coefficient is set to a value that does not substantially blur even when a filter is applied.

図6(a)、(b)はそれぞれ、撮影時OTF取得部104、目標OTF取得部105による各処理を示すフローチャートである。   FIGS. 6A and 6B are flowcharts showing the processes performed by the photographing OTF acquisition unit 104 and the target OTF acquisition unit 105, respectively.

まず、撮影時OTF取得部104は、撮影時の撮影条件113を取得し(ステップS401)、撮影条件113に基づいて、撮影時のフォーカス位置に対応する撮影時OTFを取得する(ステップS402)。すなわち、撮影時OTF取得部104は、上記特許文献2(特開2012−5056号公報)と同様に、絞り値やフォーカス位置から求めた撮影距離、レンズの焦点距離等の設計データ等から、光学的な特性であるPSF及びOTFを取得する。これにより、撮影時の撮影条件113にマッチした撮影時OTFが取得される。   First, the shooting OTF acquisition unit 104 acquires the shooting condition 113 at the time of shooting (step S401), and acquires the shooting OTF corresponding to the focus position at the time of shooting based on the shooting condition 113 (step S402). In other words, the OTF acquisition unit 104 at the time of shooting uses optical data from design data such as the shooting distance obtained from the aperture value and the focus position, the focal length of the lens, and the like, as in Patent Document 2 (Japanese Patent Laid-Open No. 2012-5056). PSF and OTF which are typical characteristics are obtained. As a result, a shooting OTF that matches the shooting conditions 113 at the time of shooting is acquired.

一方、目標OTF取得部105は、目標撮影条件117を取得し(ステップS501)、分割された複数の領域ごとに、目標撮影条件117に基づいて目標OTFを取得する(ステップS502)。すなわち、目標OTF取得部105は、上記特許文献2(特開2012−5056号公報)と同様に、絞り値やフォーカス位置から求めた撮影距離、レンズの焦点距離等の設計データ等から、光学的な特性であるPSF及びOTFを取得する。これにより、目標撮影条件117にマッチした目標OTFが取得される。   On the other hand, the target OTF acquisition unit 105 acquires the target imaging condition 117 (step S501), and acquires the target OTF based on the target imaging condition 117 for each of the divided areas (step S502). That is, the target OTF acquisition unit 105 optically calculates from the design data such as the photographing distance obtained from the aperture value and the focus position, the focal length of the lens, and the like, as in the above-described Patent Document 2 (Japanese Patent Laid-Open No. 2012-5056). PSF and OTF, which are unique characteristics, are obtained. Thereby, the target OTF that matches the target shooting condition 117 is acquired.

図7(a)、(b)はそれぞれ、フィルタ生成部106、フィルタ適用部107による各処理を示すフローチャートである。   FIGS. 7A and 7B are flowcharts showing processes performed by the filter generation unit 106 and the filter application unit 107, respectively.

図7(a)では、フィルタ生成部106は、分割された全ての領域に対し、ボケ係数と撮影時OTFと目標OTFとに基づいてフィルタを生成する。フィルタは、OTFから光学特性を元にして算出するものと、先に求めたボケ係数を元にローパス処理をかけるものとを組み合わせて生成される。   In FIG. 7A, the filter generation unit 106 generates a filter for all the divided areas based on the blur coefficient, the photographing OTF, and the target OTF. The filter is generated by combining a filter that is calculated from the OTF based on the optical characteristics and a filter that is subjected to low-pass processing based on the previously obtained blur coefficient.

まず、フィルタ生成部106は、分割された全ての領域に対する処理が完了したか否かを判別する(ステップS601)。処理が完了していない場合は、フィルタ生成部106は、撮影時OTFを取得し(ステップS602)、目標OTFを取得し(ステップS603)、今回の対象領域のボケ係数を取得する(ステップS604)。次に、フィルタ生成部106は、これら取得した撮影時OTF、目標OTF及びボケ係数を加味して、適用すべきフィルタを生成する(ステップS605)。   First, the filter generation unit 106 determines whether or not the processing for all the divided areas has been completed (step S601). If the process has not been completed, the filter generation unit 106 acquires the OTF at the time of shooting (step S602), acquires the target OTF (step S603), and acquires the blur coefficient of the current target region (step S604). . Next, the filter generation unit 106 generates a filter to be applied in consideration of the acquired photographing OTF, target OTF, and blur coefficient (step S605).

具体的には、フィルタ生成部106は、撮影時OTFからは逆特性としてのフィルタを生成し、目標OTFからは特性を掛け合わせるためのフィルタを生成する。ボケ係数に関しては、一般的に行われる平滑化フィルタを用い、フィルタに用いる強度を、ボケ係数の値を用いて変動させることで、間接的に撮影条件やフォーカス位置に応じた領域ごとの制御が行われる。つまり、フィルタ生成部106は、撮影時OTFから生成したフィルタ、目標OTFから生成したフィルタ、ボケ係数から生成したフィルタを合成する。全ての領域について処理が完了すると、図7(a)の処理は終了し、その時点で合成されているフィルタが、実際に画像111に適用されるフィルタとなる。   Specifically, the filter generation unit 106 generates a filter having a reverse characteristic from the OTF during shooting, and generates a filter for multiplying the characteristic from the target OTF. With regard to the blur coefficient, a smoothing filter that is generally used is used, and the intensity used for the filter is varied using the value of the blur coefficient, so that each region can be controlled indirectly according to the shooting conditions and the focus position. Done. That is, the filter generation unit 106 combines a filter generated from the OTF at the time of shooting, a filter generated from the target OTF, and a filter generated from the blur coefficient. When the processing is completed for all the regions, the processing in FIG. 7A ends, and the filter synthesized at that time becomes a filter that is actually applied to the image 111.

図7(b)において、フィルタ適用部107は、フィルタ生成部106で生成されたフィルタを取得し(ステップS701)、画像111に対してそれを適用することで画像復元を行う(ステップS702)。上記数式4で説明したように、フィルタを画像111に適用することで、画像111のOTF適用領域の光学収差が補正され、目標撮影条件117に応じた特性となる。また、ボケ付加領域には目標撮影条件117に応じたボケが付加される。従って、光学収差及びボケに関し、目標の撮影条件の光学特性を再現することができる。   In FIG. 7B, the filter application unit 107 acquires the filter generated by the filter generation unit 106 (step S701), and performs image restoration by applying it to the image 111 (step S702). As described in Equation 4 above, by applying the filter to the image 111, the optical aberration of the OTF application region of the image 111 is corrected, and the characteristic according to the target imaging condition 117 is obtained. In addition, a blur according to the target shooting condition 117 is added to the blur added area. Therefore, it is possible to reproduce the optical characteristics of the target shooting conditions with respect to optical aberration and blur.

図4に示す例で、撮影時の撮影条件113では絞り値が5.6で、目標撮影条件117では絞り値が2.6である場合を考える。3つの領域C、D、EがOTF適用領域として決定される。フィルタの適用によって、OTF適用領域である領域C、D、Eには目標撮影条件117に応じた光学収差の画像となる。ボケ付加領域である領域A、B、F、Gにはそれぞれのボケ係数に応じたボケが付加される。必要なデータについては、撮影距離がフォーカス位置のデータのみあればよく、フォーカス位置とは異なる被写体に関するデータは不要となるので、必要なデータ量を抑えることができる。   In the example shown in FIG. 4, a case is considered in which the aperture value is 5.6 in the shooting condition 113 at the time of shooting, and the aperture value is 2.6 in the target shooting condition 117. Three regions C, D, and E are determined as OTF application regions. By applying the filter, the regions C, D, and E, which are the OTF application regions, are optical aberration images according to the target imaging condition 117. The blurs corresponding to the respective blur coefficients are added to the areas A, B, F, and G that are the blur addition areas. Regarding the necessary data, it is sufficient that the shooting distance is only the data of the focus position, and the data related to the subject different from the focus position is not necessary, so that the necessary data amount can be suppressed.

本実施の形態によれば、撮影時OTFと目標OTFとに基づいて生成されたフィルタを画像111に適用してOTF適用領域の光学収差を補正するので、必要なデータ量を抑えつつ目標の撮影条件の光学特性を再現することができる。しかも、フィルタの生成はボケ係数にも基づくので、撮影条件113と目標撮影条件117とに応じたボケがOTF適用領域でない領域に施される。従って、所望の撮影条件のボケを含む光学特性を再現することができる。このように、ユーザは、撮影時には暗い軽量なレンズや機材を用いて撮影を行い、後処理において、より明るいレンズをシミュレートした画像を再現することができるようになる。   According to the present embodiment, the filter generated based on the OTF at the time of shooting and the target OTF is applied to the image 111 to correct the optical aberration in the OTF application area, so that the target shooting can be performed while suppressing the necessary data amount. The optical characteristics of the conditions can be reproduced. In addition, since the generation of the filter is also based on the blur coefficient, the blur corresponding to the shooting condition 113 and the target shooting condition 117 is applied to a region that is not the OTF application region. Therefore, it is possible to reproduce the optical characteristics including the blur of the desired shooting condition. In this way, the user can shoot using a dark lightweight lens or equipment at the time of shooting, and can reproduce an image simulating a brighter lens in post-processing.

ところで、閾値116はユーザが指定できるか、または固定値であるとしたが、これに限定されない。撮影条件113等を考慮し、閾値設定部115が自動的に閾値116を指定するようにしてもよい。例えば、距離マップ112を出力する視差センサ114の精度に応じて複数のパターンを持つことが考えられる。すなわち閾値設定部115は、閾値116を、視差センサ114の精度が高い場合は小さい値に設定し、視差センサ114の精度が低い場合は大きい値に設定する。また、領域の分割数の上限を定め、一定数を超えないように制御する場合は、閾値116を小さい値から大きくしていき、領域数が上限以下になるところの閾値116を採用することで、閾値116を動的に決める手法も考えられる。さらに、撮影条件113そのものに応じて閾値設定部115が閾値116を決めるようにしてもよい。特に高感度では精度が低くなる可能性があるため閾値116を大きくし、低感度の場合には閾値116を小さく設定する、等の態様が考えられる。これら例示したいずれかまたは複数の手法の組み合わせによって閾値116を指定してもよい。   By the way, although the threshold value 116 can be specified by the user or is a fixed value, it is not limited to this. The threshold setting unit 115 may automatically specify the threshold 116 in consideration of the shooting conditions 113 and the like. For example, it may be possible to have a plurality of patterns according to the accuracy of the parallax sensor 114 that outputs the distance map 112. That is, the threshold setting unit 115 sets the threshold 116 to a small value when the accuracy of the parallax sensor 114 is high, and sets it to a large value when the accuracy of the parallax sensor 114 is low. In addition, when the upper limit of the division number of the area is set and control is performed so as not to exceed a certain number, the threshold value 116 is increased from a small value, and the threshold value 116 where the number of areas is equal to or less than the upper limit is adopted. A method for dynamically determining the threshold value 116 is also conceivable. Further, the threshold value setting unit 115 may determine the threshold value 116 according to the photographing condition 113 itself. In particular, there is a possibility that the accuracy may be lowered at high sensitivity, so that the threshold value 116 is increased, and when the sensitivity is low, the threshold value 116 is set small. The threshold value 116 may be designated by a combination of any one or more of the exemplified methods.

(他の実施形態)
本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)をネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(又はCPUやMPU等)がプログラムコードを読み出して実行する処理である。この場合、そのプログラム、及び該プログラムを記憶した記憶媒体は本発明を構成することになる。
(Other embodiments)
The present invention is also 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, etc.) of the system or apparatus reads the program code. It is a process to be executed. In this case, the program and the storage medium storing the program constitute the present invention.

以上、本発明をその好適な実施形態に基づいて詳述してきたが、本発明はこれら特定の実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。   Although the present invention has been described in detail based on preferred embodiments thereof, the present invention is not limited to these specific embodiments, and various forms within the scope of the present invention are also included in the present invention. included.

101 画像入力部
102 領域分割部
103 ボケコントロール部
104 撮影時OTF取得部
105 目標OTF取得部
106 フィルタ生成部
112 距離マップ
113 撮影条件
117 目標撮影条件
DESCRIPTION OF SYMBOLS 101 Image input part 102 Area division part 103 Blur control part 104 Shooting OTF acquisition part 105 Target OTF acquisition part 106 Filter generation part 112 Distance map 113 Shooting condition 117 Target shooting condition

Claims (8)

撮影により得られた画像、該画像の撮影時の撮影条件、及び該画像に関する距離マップを取得する第1の取得手段と、
前記第1の取得手段により取得された距離マップに基づいて、前記第1の取得手段により取得された画像の領域を、閾値を用いて撮影距離の異なる複数の領域に分割する分割手段と、
前記分割手段により分割された複数の領域のうち、OTF(光学伝達関数)を適用するOTF適用領域を決定する決定手段と、
前記第1の取得手段により取得された撮影時の撮影条件に基づいて、撮影時のフォーカス位置に対応する撮影時OTFを取得する第2の取得手段と、
前記複数の領域ごとに、指定された目標撮影条件に基づいて目標OTFを取得する第3の取得手段と、
前記第2の取得手段により取得された撮影時OTFと前記第3の取得手段により取得された目標OTFとに基づいて、画像復元を行うためのフィルタを生成する生成手段と、
前記生成手段により生成されたフィルタを前記画像に適用することで、前記画像の前記OTF適用領域の光学収差を補正する補正手段と、を有することを特徴とする画像処理装置。
First acquisition means for acquiring an image obtained by shooting, shooting conditions at the time of shooting the image, and a distance map related to the image;
A dividing unit that divides the region of the image acquired by the first acquiring unit into a plurality of regions having different shooting distances using a threshold based on the distance map acquired by the first acquiring unit;
Determining means for determining an OTF application area to which an OTF (optical transfer function) is applied among the plurality of areas divided by the dividing means;
Second acquisition means for acquiring a shooting OTF corresponding to a focus position at the time of shooting based on the shooting conditions at the time of shooting acquired by the first acquisition means;
Third acquisition means for acquiring a target OTF based on a specified target imaging condition for each of the plurality of areas;
Generating means for generating a filter for performing image restoration based on the photographing OTF acquired by the second acquisition means and the target OTF acquired by the third acquisition means;
An image processing apparatus comprising: a correction unit that corrects an optical aberration of the OTF application region of the image by applying the filter generated by the generation unit to the image.
前記補正手段は、前記第1の取得手段により取得された撮影条件と前記目標撮影条件とに応じたボケを、前記画像の前記OTF適用領域でない領域に施すことを特徴とする請求項1に記載の画像処理装置。   2. The correction unit according to claim 1, wherein the correction unit applies blur according to the imaging condition acquired by the first acquisition unit and the target imaging condition to an area that is not the OTF application area of the image. Image processing apparatus. 前記画像の前記OTF適用領域でない領域ごとに、前記第1の取得手段により取得された撮影条件と前記目標撮影条件とに応じたボケ係数を算出する算出手段を有し、
前記生成手段は、前記算出手段により算出されたボケ係数と前記撮影時OTFと前記目標OTFとに基づいて前記フィルタを生成することを特徴とする請求項2に記載の画像処理装置。
For each area that is not the OTF application area of the image, a calculation unit that calculates a blur coefficient according to the shooting condition acquired by the first acquisition unit and the target shooting condition;
The image processing apparatus according to claim 2, wherein the generation unit generates the filter based on the blur coefficient calculated by the calculation unit, the shooting OTF, and the target OTF.
前記決定手段は、前記目標撮影条件下において、撮影距離が被写界深度に含まれる領域を前記OTF適用領域として決定することを特徴とする請求項1〜3のいずれか1項に記載の画像処理装置。   The image according to any one of claims 1 to 3, wherein the determination unit determines an area in which an imaging distance is included in a depth of field as the OTF application area under the target imaging condition. Processing equipment. 前記閾値は、前記撮影時の撮影条件に基づいて設定されることを特徴とする請求項1〜4のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the threshold is set based on shooting conditions at the time of shooting. 請求項1〜5に記載の画像処理装置を備える撮像装置であって、被写体を撮像する機能を有することを特徴とする撮像装置。   An imaging apparatus comprising the image processing apparatus according to claim 1, wherein the imaging apparatus has a function of imaging a subject. 撮影により得られた画像、該画像の撮影時の撮影条件、及び該画像に関する距離マップを取得する第1の取得ステップと、
前記第1の取得ステップにより取得された距離マップに基づいて、前記第1の取得ステップにより取得された画像の領域を、閾値を用いて撮影距離の異なる複数の領域に分割する分割ステップと、
前記分割ステップにより分割された複数の領域のうち、OTF(光学伝達関数)を適用するOTF適用領域を決定する決定ステップと、
前記第1の取得ステップにより取得された撮影時の撮影条件に基づいて、撮影時のフォーカス位置に対応する撮影時OTFを取得する第2の取得ステップと、
前記複数の領域ごとに、指定された目標撮影条件に基づいて目標OTFを取得する第3の取得ステップと、
前記第2の取得ステップにより取得された撮影時OTFと前記第3の取得ステップにより取得された目標OTFとに基づいて、画像復元を行うためのフィルタを生成する生成ステップと、
前記生成ステップにより生成されたフィルタを前記画像に適用することで、前記画像の前記OTF適用領域の光学収差を補正する補正ステップと、を有することを特徴とする画像処理方法。
A first acquisition step of acquiring an image obtained by shooting, shooting conditions at the time of shooting the image, and a distance map related to the image;
A division step of dividing the region of the image acquired by the first acquisition step into a plurality of regions having different shooting distances using a threshold based on the distance map acquired by the first acquisition step;
A determination step of determining an OTF application region to which an OTF (optical transfer function) is applied among a plurality of regions divided by the division step;
A second acquisition step of acquiring a shooting OTF corresponding to a focus position at the time of shooting based on the shooting conditions at the time of shooting acquired in the first acquisition step;
A third acquisition step of acquiring a target OTF for each of the plurality of regions based on a specified target imaging condition;
A generation step of generating a filter for performing image restoration based on the photographing OTF acquired by the second acquisition step and the target OTF acquired by the third acquisition step;
An image processing method comprising: a correction step of correcting an optical aberration of the OTF application region of the image by applying the filter generated in the generation step to the image.
請求項7に記載の画像処理方法をコンピュータに実行させることを特徴とするプログラム。   A program causing a computer to execute the image processing method according to claim 7.
JP2015170517A 2015-08-31 2015-08-31 Image processing apparatus and method, imaging device, program Pending JP2017050605A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015170517A JP2017050605A (en) 2015-08-31 2015-08-31 Image processing apparatus and method, imaging device, program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015170517A JP2017050605A (en) 2015-08-31 2015-08-31 Image processing apparatus and method, imaging device, program

Publications (1)

Publication Number Publication Date
JP2017050605A true JP2017050605A (en) 2017-03-09

Family

ID=58280319

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015170517A Pending JP2017050605A (en) 2015-08-31 2015-08-31 Image processing apparatus and method, imaging device, program

Country Status (1)

Country Link
JP (1) JP2017050605A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113795862A (en) * 2019-11-27 2021-12-14 深圳市晟视科技有限公司 Depth of field synthesis system, camera and microscope

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113795862A (en) * 2019-11-27 2021-12-14 深圳市晟视科技有限公司 Depth of field synthesis system, camera and microscope

Similar Documents

Publication Publication Date Title
JP6271990B2 (en) Image processing apparatus and image processing method
US10282822B2 (en) Digital correction of optical system aberrations
JP5709911B2 (en) Image processing method, image processing apparatus, image processing program, and imaging apparatus
EP2574039B1 (en) Image pickup device, image processing device, image processing method, and image processing program
JP6218377B2 (en) Image processing apparatus and image processing method
JP5535053B2 (en) Image processing apparatus and image processing method
TWI626500B (en) Image capturing apparatus, lens unit, and signal processing apparatus
JP4958806B2 (en) Blur detection device, blur correction device, and imaging device
JP2005332381A (en) Image processing method, device and program
JP6645711B2 (en) Image processing apparatus, image processing method, and program
JP7191588B2 (en) Image processing method, image processing device, imaging device, lens device, program, and storage medium
JP2017050605A (en) Image processing apparatus and method, imaging device, program
JPWO2014157348A1 (en) Image processing apparatus, image processing system, image processing method, and image processing program
JP6157238B2 (en) Image processing apparatus, image processing method, and image processing program
JP6385206B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP6468751B2 (en) Image processing apparatus, image processing method, and program
JP6537228B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP2017173920A (en) Image processor, image processing method, image processing program, and record medium
CN104125385B (en) Image editing method and image processor
JP2015109681A (en) Image processing method, image processing apparatus, image processing program, and imaging apparatus
JP2016010080A (en) Image processing apparatus, image processing method and program
JP2019096364A (en) Image evaluation device
US20230146844A1 (en) Image processing apparatus and image processing method
JP4770965B2 (en) Image matching device and camera
JP2009088933A (en) Image recording apparatus, image correcting apparatus and image pickup apparatus