JP2017108243A - Image processing device and image processing method - Google Patents
Image processing device and image processing method Download PDFInfo
- Publication number
- JP2017108243A JP2017108243A JP2015239393A JP2015239393A JP2017108243A JP 2017108243 A JP2017108243 A JP 2017108243A JP 2015239393 A JP2015239393 A JP 2015239393A JP 2015239393 A JP2015239393 A JP 2015239393A JP 2017108243 A JP2017108243 A JP 2017108243A
- Authority
- JP
- Japan
- Prior art keywords
- region
- feature amount
- unit
- image
- point spread
- 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
Links
- 238000012545 processing Methods 0.000 title claims abstract description 116
- 238000003672 processing method Methods 0.000 title claims abstract description 9
- 238000012937 correction Methods 0.000 claims description 48
- 229920006395 saturated elastomer Polymers 0.000 claims description 40
- 238000004364 calculation method Methods 0.000 claims description 39
- 238000001514 detection method Methods 0.000 claims description 30
- 230000015572 biosynthetic process Effects 0.000 claims description 9
- 238000003786 synthesis reaction Methods 0.000 claims description 9
- 230000002194 synthesizing effect Effects 0.000 claims description 3
- 238000000034 method Methods 0.000 description 34
- 230000006870 function Effects 0.000 description 20
- 230000008569 process Effects 0.000 description 19
- 239000013598 vector Substances 0.000 description 16
- 238000006243 chemical reaction Methods 0.000 description 14
- 238000000605 extraction Methods 0.000 description 13
- 230000007274 generation of a signal involved in cell-cell signaling Effects 0.000 description 13
- 230000003287 optical effect Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 10
- 238000003384 imaging method Methods 0.000 description 7
- 230000007423 decrease Effects 0.000 description 3
- 238000001914 filtration Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 229920013655 poly(bisphenol-A sulfone) Polymers 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000002939 conjugate gradient method Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- ORQBXQOJMQIAOY-UHFFFAOYSA-N nobelium Chemical compound [No] ORQBXQOJMQIAOY-UHFFFAOYSA-N 0.000 description 1
- 230000035939 shock Effects 0.000 description 1
Images
Abstract
Description
本発明は、画像処理装置及び画像処理方法に関する。 The present invention relates to an image processing apparatus and an image processing method.
合焦ミスや手ブレ等に起因する画質の劣化を、画像中のブレやボケを表す点拡がり関数(PSF:Point Spread Function)を用いて補正する技術が提案されている。 There has been proposed a technique for correcting image quality degradation caused by a focus error or camera shake using a point spread function (PSF) representing blur or blur in an image.
例えば、特許文献1には、ブラインドデコンボリューションと称される技術を用いて画像のブレやボケを補正する以下のような技術が開示されている。具体的には、まず、撮影画像から主被写体領域を決定する。主被写体領域は、ユーザによって選択されてもよいし、画像の鮮明度等を利用して自動的に選択するようにしてもよい。次に、ブラインドデコンボリューション技術を用いて主被写体領域からPSFを推定する。そして、推定したPSFと入力画像とをデコンボリューションすることによって、画像のブレやボケを補正する。 For example, Patent Document 1 discloses the following technique for correcting image blur and blur using a technique called blind deconvolution. Specifically, first, the main subject region is determined from the captured image. The main subject area may be selected by the user, or may be automatically selected using the sharpness of the image. Next, the PSF is estimated from the main subject area using the blind deconvolution technique. Then, the estimated PSF and the input image are deconvoluted to correct image blur and blur.
また、特許文献2には、画像を領域分割し、それぞれの領域において、PSFの推定と、PSFの信頼度の算出とを行い、これらに基づいてPSFの精度を向上する技術が開示されている。具体的には、飽和画素の数や勾配情報に基づいて信頼度を領域毎に算出し、信頼度の低い領域については、周辺の領域から推定されたPSFを用いて補完することによってPSFの精度を向上させる。なお、飽和画素の数や勾配情報に基づいて信頼度を算出するのは、飽和画素が多い場合や、勾配情報が少ない場合には、平坦な被写体である可能性が高く、PSFの推定に必要な情報を十分取得し得ないためである。 Patent Document 2 discloses a technique for dividing an image into regions, estimating PSF and calculating PSF reliability in each region, and improving the accuracy of PSF based on these. . Specifically, the reliability is calculated for each region based on the number of saturated pixels and gradient information, and the accuracy of the PSF is compensated for by using the PSF estimated from the surrounding region for regions with low reliability. To improve. Note that the degree of reliability is calculated based on the number of saturated pixels and gradient information. When there are many saturated pixels or when there is little gradient information, there is a high possibility that the subject is a flat subject, which is necessary for PSF estimation. This is because sufficient information cannot be acquired sufficiently.
しかしながら、従来の技術では、ブレ・ボケの補正を必ずしも良好に行い得ない場合があった。 However, with the conventional technology, there has been a case where correction of blur / blur cannot always be performed satisfactorily.
本発明の目的は、点拡がり関数等を良好に推定し得る画像処理装置及び画像処理方法を提供することにある。 An object of the present invention is to provide an image processing apparatus and an image processing method capable of satisfactorily estimating a point spread function and the like.
本発明の一態様によれば、画像から第1の領域を検出する第1の領域検出部と、前記第1の領域に類似する第2の領域を前記画像から検出する第2の領域検出部と、前記第1の領域と前記第2の領域とのうちの少なくともいずれかにおける特徴量を算出する特徴量算出部と、前記特徴量算出部によって算出された前記特徴量に基づいて前記第1の領域又は前記第2の領域を選択する領域選択部と、前記領域選択部によって選択された前記第1の領域又は前記第2の領域から点拡がり関数を推定する点拡がり関数推定部とを有することを特徴とする画像処理装置が提供される。 According to one aspect of the present invention, a first region detection unit that detects a first region from an image, and a second region detection unit that detects a second region similar to the first region from the image. A feature amount calculating unit that calculates a feature amount in at least one of the first region and the second region, and the first amount based on the feature amount calculated by the feature amount calculating unit. A region selection unit that selects the region or the second region, and a point spread function estimation unit that estimates a point spread function from the first region or the second region selected by the region selection unit An image processing apparatus is provided.
また、本発明の他の態様によれば、画像から第1の領域を検出する第1の領域検出部と、前記第1の領域に類似する第2の領域を前記画像から検出する第2の領域検出部と、前記第1の領域と前記第2の領域とのうちの少なくともいずれかにおける特徴量を算出する特徴量算出部と、前記第1の領域から第1の点拡がり関数を推定し、前記第2の領域から第2の点拡がり関数を推定する点拡がり関数推定部と、前記特徴量算出部によって算出された前記特徴量に基づいて、合成比率を決定する合成比率決定部と、前記第1の点拡がり関数と前記第2の点拡がり関数とを前記合成比率に基づいて合成する、又は、前記第1の点拡がり関数に基づく情報と前記第2の点拡がり関数に基づく情報とを前記合成比率に基づいて合成する合成部とを有することを特徴とする画像処理装置が提供される。 According to another aspect of the present invention, a first region detection unit that detects a first region from an image, and a second region that detects a second region similar to the first region from the image. An area detector, a feature quantity calculator for calculating a feature quantity in at least one of the first area and the second area, and a first point spread function is estimated from the first area. A point spread function estimating unit that estimates a second point spread function from the second region, and a composition ratio determining unit that determines a composition ratio based on the feature amount calculated by the feature amount calculating unit, Combining the first point spread function and the second point spread function based on the combination ratio; or information based on the first point spread function and information based on the second point spread function; And a synthesizing unit for synthesizing based on the synthesis ratio The image processing apparatus is provided, characterized in that.
本発明によれば、点拡がり関数等を良好に推定し得る画像処理装置及び画像処理方法を提供することができる。 ADVANTAGE OF THE INVENTION According to this invention, the image processing apparatus and image processing method which can estimate a point spread function etc. favorably can be provided.
以下に、本発明の好ましい実施の形態を、図面を参照しながら詳細に説明する。 Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings.
[第1実施形態]
本発明の第1実施形態による画像処理装置及び画像処理方法について図1乃至図6を用いて説明する。図1は、本実施形態による画像処理装置の構成を示すブロック図である。本実施形態による画像処理装置111は、例えば撮像装置である。より具体的には、本実施形態による画像処理装置111は、電子カメラ、即ち、デジタルカメラである。なお、画像処理装置111は、撮像装置に限定されるものではなく、撮像機能を有しない電子機器であってもよい。
[First Embodiment]
An image processing apparatus and an image processing method according to a first embodiment of the present invention will be described with reference to FIGS. FIG. 1 is a block diagram showing the configuration of the image processing apparatus according to the present embodiment. The
本実施形態における画像処理装置111は、光学系101、撮像素子102、A/D変換部103、画像処理部104、記録部105、制御部106、測距部107、画像メモリ108、操作部109、及び、表示部110を備えている。光学系101には、フォーカスレンズ、絞り、シャッター等が含まれる。
The
光学系101は、フォーカスレンズ(図示せず)を駆動することによって被写体にピントを合わせ、絞り(図示せず)やシャッター(図示せず)を制御することによって露光量を調節する。なお、光学系101は、画像処理装置111から着脱不能であってもよいし、着脱可能であってもよい。撮像素子102は、光学系101において結像される被写体の光学像を光電変換によって電気信号に変換するためのものであり、例えば、CCDイメージセンサやCMOSイメージセンサ等である。A/D変換部103は、撮像素子102から出力されるアナログの画像信号をデジタル化するためのものである。
The
画像処理部104は、A/D変換部103によってデジタル化された画像信号に対して、同時化処理、ホワイトバランス補正処理、色変換処理、輪郭強調処理、ガンマ処理、ブレやボケの補正処理等を施す。また、画像処理部104は、主被写体を検出する処理や動きベクトルの検出処理等をも実行する。画像処理部104によって所定の処理が施された画像信号(画像、画像情報)は、記録部105に出力される。記録部105は、画像処理部104から出力される画像をJPEG形式等の所定の形式の画像に変換し、所定の形式に変換した画像を記録媒体に記録する。
The
制御部106は、本実施形態による画像処理装置111の全体の動作を司る。制御部106は、例えば、撮影された画像に基づいて所定の評価値を算出し、画像処理部104によって行われる画像処理のパラメータを決定する。測距部(距離情報取得部)107は、被写体までの距離情報を取得し、距離マップを生成する。距離マップとは、撮影された画像における被写体までの距離情報を画素単位で2次元的に示すものである。
The
画像メモリ108は、画像処理部104において画像処理を行う際に必要な情報を格納するためのものである。操作部109は、画像処理装置111に対してユーザが操作指示を行うためのものである。表示部110は、例えば、画像処理装置111の例えば背面に設置された液晶ディスプレイ等であり、撮影時の操作の補助を行うための画面や、記録部105に保存されている画像等を表示するものである。
The
次に、画像処理部104についての詳細な説明を図2を用いて行う。図2は、本実施形態による画像処理部104の構成を示すブロック図である。
Next, a detailed description of the
画像処理部104は、同時化処理部201、ホワイトバランス補正処理部202、輝度・色信号生成部203、色変換処理部204、輪郭強調処理部205、色ガンマ処理部206、輝度ガンマ処理部207、及び、色差信号生成部208を備えている。また、画像処理部104は、ブレ・ボケ補正部209、主被写体検出部210、及び、動きベクトル検出部211を更に備えている。
The
A/D変換部103から出力されるデジタルの画像信号は、画像処理部104に設けられた同時化処理部201に入力される。同時化処理部201は、カラーフィルタ配列に伴う色信号の空間的なズレを補間して各点の色を計算する処理である同時化処理を行うものである。同時化処理部201は、A/D変換部103から出力されるベイヤーRGBの画像データに対して同時化処理を行い、色信号R,G,Bを生成する。同時化処理部201によって生成された色信号R,G,Bは、ホワイトバランス補正処理部202に入力される。ホワイトバランス補正処理部202は、制御部106によって算出されたホワイトバランスゲイン値に基づいて、色信号R,G,Bにゲインを適用することにより、ホワイトバランスを調整する。ホワイトバランスが調整された色信号R,G,Bは、輝度・色信号生成部203に出力される。輝度・色信号生成部203では、ホワイトバランス補正処理部202から出力される色信号R,G,Bから輝度信号Yを生成し、生成した輝度信号Yを輪郭強調処理部205に出力する。また、輝度・色信号生成部203は、色信号R,G,Bを色変換処理部204に出力する。
The digital image signal output from the A /
色変換処理部204は、マトリクス演算等によって色変換を行い、所望のカラーバランスの色信号R,G,Bを得る。色ガンマ処理部206は、色信号R,G,Bに対してガンマ補正を行う。色差信号生成部208は、色信号R,G,Bに基づいて色差信号R−Y、B−Yを生成する。色差信号生成部208によって生成された色差信号R−Y、B−Yは、ブレ・ボケ補正部209に出力される。
The color
輪郭強調処理部205は、輝度信号Yに対して輪郭強調処理を行い、輪郭強調処理が施された輝度信号Yを輝度ガンマ処理部207に出力する。輝度ガンマ処理部207は、輝度信号Yに対してガンマ補正を行い、ガンマ補正が施された輝度信号Yを、ブレ・ボケ補正部209、主被写体検出部210、動きベクトル検出部211、及び、画像メモリ108に出力する。
The contour
主被写体検出部210は、輝度信号Yに基づいて、主たる被写体である主被写体の位置と大きさとを検出する。主被写体としては、例えば、人物の顔等が挙げられる。主被写体検出部210は、公知の手法によって、顔の位置と大きさとを検出する。なお、主被写体は、人物の顔に限定されるものではなく、例えば、人物の胴体等であってもよい。また、主被写体は、人物に限定されるものではなく、人物以外の動物であってもよいし、物体等であってもよい。
Based on the luminance signal Y, the main
動きベクトル検出部(動き情報検出部)211は、輝度ガンマ処理部207から出力された輝度信号Yと、直前に撮影された画像の輝度信号Yとに基づいて、動きベクトルを検出する。なお、直前に撮影された画像は、画像メモリ108に記録されている。動きベクトルの検出方法としては、公知の技術を用いることができものとする。が、具体的には、画像を所定のサイズのブロックに分割し、ブロック毎に所定の範囲内でテンプレートマッチングを行う。テンプレートマッチングとは、テンプレートと称される小さい一部の画像領域とマッチングする画像領域を探し出すものである。テンプレートの座標と、当該テンプレートとマッチングがとれた画像領域の座標とに基づいて、各ブロックにおける動きベクトルを求めることができる。
The motion vector detection unit (motion information detection unit) 211 detects a motion vector based on the luminance signal Y output from the luminance
なお、ブレ・ボケ補正部209は、色差信号生成部208から出力される色差信号R−Y、B−Yと、輝度ガンマ処理部207から出力される輝度信号Yとに対して、ブレ・ボケ補正処理を施す。なお、ブレ・ボケ補正部209において行われるブレ・ボケ補正処理の詳細については後述することとする。ブレ・ボケ補正部209によってブレ・ボケ補正処理が施された画像信号は、記録部105に出力され、記録部105に記録される。
Note that the blur /
次に、本実施形態による画像処理装置111において行われるブレ・ボケ補正処理について図3及び図4を用いて詳細に説明する。
Next, blur / blur correction processing performed in the
図3は、ブレ・ボケ補正部209の構成を示すブロック図である。図3に示すように、ブレ・ボケ補正部209は、RGB信号変換部301、類似領域検出部302、第1の局所領域抽出部303、第2の局所領域抽出部304、第1の特徴量算出部305、及び、第2の特徴量算出部306を備えている。また、ブレ・ボケ補正部209は、領域決定部307、領域選択部308、PSF推定部309、補正処理部310、及び、輝度・色差信号生成部311を更に備えている。
FIG. 3 is a block diagram illustrating a configuration of the blur /
図4は、本実施形態による画像処理装置111において行われるブレ・ボケ補正処理を示すフローチャートである。
FIG. 4 is a flowchart showing a blur / blur correction process performed in the
ステップS401では、類似領域検出部302が、主被写体検出部210で検出された主被写体領域の位置とサイズと、動きベクトル検出部211で検出されたブロック毎の動きベクトルと、測距部107で生成した距離マップとを取得する。また、ステップS401では、類似領域検出部302が、主被写体に生じているブレ・ボケと類似するブレ・ボケが生じている類似領域を検出する。
In step S <b> 401, the similar
類似領域を検出するのは、以下のような理由によるものである。即ち、例えば、主被写体領域の画像に飽和画素が多く含まれている場合には、平坦な領域である可能性が高く、PSFの推定に必要な情報を十分取得し得ない可能性が高い。一方、類似領域から良好なPSFを求め得る場合もある。類似領域から良好なPSFを求め得る場合には、類似領域から求められたPSFを用いて、ブレやボケを良好に補正することが可能である。このような理由により、類似領域が検出される。 The similar area is detected for the following reason. That is, for example, when the image of the main subject area includes many saturated pixels, there is a high possibility that the image is a flat area, and there is a high possibility that information necessary for PSF estimation cannot be acquired sufficiently. On the other hand, a good PSF may be obtained from a similar region. When a good PSF can be obtained from a similar region, it is possible to correct blur and blur well using the PSF obtained from the similar region. For this reason, a similar region is detected.
主被写体に生じたブレ・ボケを良好に補正し得るPSFを得るためには、主被写体に生じているブレと同様のブレが生じており、且つ、主被写体に生じている焦点ボケと同様の焦点ボケが生じている領域を、類似領域として検出することが好ましい。このため、類似領域の検出の処理においては、以下の2つの処理が少なくとも行われる。1つは、主被写体に生じているブレと同様のブレを有する領域を検出する処理である。かかる処理は、例えば、ブロック毎の動きベクトルに基づいて行うことができる。もう1つは、主被写体に生じている焦点ボケと同様の焦点ボケが生じている領域を検出する処理である。かかる処理は、例えば、距離マップに基づいて行うことができる。そして、これらの処理の結果に基づいて、主被写体に生じているブレと同様のブレが生じており、且つ、主被写体に生じている焦点ボケと同様の焦点ボケが生じている領域である類似領域が検出される。 In order to obtain a PSF that can satisfactorily correct blur and blurring that occurs in the main subject, blurring similar to that occurring in the main subject has occurred, and the same blurring as that occurring in the main subject has occurred. It is preferable to detect a region where the out-of-focus is generated as a similar region. For this reason, at least the following two processes are performed in the similar area detection process. One is a process of detecting a region having a blur similar to the blur generated in the main subject. Such processing can be performed based on, for example, a motion vector for each block. The other is a process for detecting a region where a focal blur similar to the focal blur occurring in the main subject has occurred. Such processing can be performed based on a distance map, for example. Based on the results of these processes, a blur similar to the blur generated in the main subject is generated, and a similar blur is a region in which the same blur is generated as the focal blur generated in the main subject. A region is detected.
主被写体に生じているブレと同様のブレが生じている領域を検出する処理について、更に詳しく説明する。単位時間内に同じ動きが生じた領域には、同様のブレが生じていると考えられる。単位時間内に同じ動きが生じた領域であるか否かは、動きベクトルに基づいて判定することができる。このため、主被写体領域における動きベクトル(動き情報)と類似している動きベクトルの領域を検出することによって、主被写体に生じているブレと同様のブレが生じている領域を検出することができる。なお、動きベクトルが類似しているか否かは、動きベクトルの方向や大きさに基づいて判定することができる。こうして、主被写体における動き情報に近い動き情報の領域が検出される。 Processing for detecting a region where a blur similar to the blur occurring in the main subject has occurred will be described in more detail. It is considered that the same blur occurs in the region where the same movement occurs within the unit time. It can be determined based on the motion vector whether or not the same motion has occurred within the unit time. For this reason, by detecting a motion vector region similar to the motion vector (motion information) in the main subject region, it is possible to detect a region where a blur similar to the blur occurring in the main subject has occurred. . Note that whether or not the motion vectors are similar can be determined based on the direction and magnitude of the motion vector. Thus, a motion information area close to the motion information in the main subject is detected.
また、主被写体に生じている焦点ボケと同様の焦点ボケが生じている領域を検出する処理について、更に詳しく説明する。撮像装置からの距離が同等である被写体には同等の焦点ボケが生じていると考えられる。撮像装置からの距離が同等であるか否かは、距離マップに基づいて判定することができる。このため、距離マップを用いることによって、主被写体に生じている焦点ボケと同様の焦点ボケが生じている領域を検出することができる。例えば、距離マップを所定のサイズのブロックにおいてブロック積分し、ブロック積分の結果に基づいて、主被写体領域までの距離と同等の距離に位置するブロック領域を検出する。このようにして、主被写体に生じている焦点ボケと同様の焦点ボケが生じている領域を検出することができる。 In addition, a process for detecting a region where a focal blur similar to the focal blur occurring in the main subject is detected will be described in more detail. It is considered that the same out-of-focus blur occurs in the subjects having the same distance from the imaging device. Whether or not the distance from the imaging device is the same can be determined based on the distance map. For this reason, by using the distance map, it is possible to detect a region where a focal blur similar to the focal blur occurring in the main subject has occurred. For example, the distance map is subjected to block integration in a block of a predetermined size, and a block area located at a distance equivalent to the distance to the main subject area is detected based on the result of block integration. In this way, it is possible to detect a region where a focal blur similar to the focal blur occurring in the main subject has occurred.
このようにして、類似領域検出部302は、主被写体に生じているブレと同様のブレが生じており、且つ、主被写体に生じている焦点ボケと同様の焦点ボケが生じている領域を、類似領域として検出することができる。そして、類似領域検出部302は、検出した類似領域の位置及びサイズを、第2の局所領域抽出部304に出力する。
In this way, the similar
ところで、撮像装置からの距離が同等であっても、倍率色収差等の光学特性が著しく異なっている領域を類似領域とした場合には、主被写体領域におけるブレやボケを良好に補正し得るようなPSFを取得し得ないことも考えられる。このため、主被写体領域における光学特性と同等の光学特性の領域を類似領域として検出することが好ましい。光学特性が同等か否かは、例えば、像高情報を用いて判定することができる。主被写体におけるブレと同様のブレが生じており、主被写体における焦点ボケと同様の焦点ボケが生じており、且つ、主被写体領域と同等の光学特性の領域を、類似領域として検出すれば、主被写体領域のブレ・ボケをより良好に補正し得るPSFを取得し得る。主被写体と同等の光学特性の領域としては、主被写体領域と同程度の像高位置の領域を挙げることができる。なお、主被写体領域よりも像高の低い領域を類似領域として検出するようにしてもよい。像高が高くなるほど光学特性が劣化するため、像高が高い領域を用いるよりは像高が低い領域を用いる方が好ましいためである。 By the way, even if the distance from the imaging device is the same, if a region where the optical characteristics such as chromatic aberration of magnification are significantly different is used as a similar region, blur and blur in the main subject region can be corrected well. It is also conceivable that PSF cannot be obtained. For this reason, it is preferable to detect an area having optical characteristics equivalent to the optical characteristics in the main subject area as a similar area. Whether or not the optical characteristics are equivalent can be determined using image height information, for example. If a blur similar to the blur on the main subject is generated, a focal blur similar to the focus blur on the main subject is generated, and an area having optical characteristics equivalent to the main subject area is detected as a similar area, It is possible to obtain a PSF that can correct blurring and blurring of the subject area more favorably. As an area having the same optical characteristics as the main subject, an area having an image height position similar to that of the main subject area can be cited. An area having an image height lower than that of the main subject area may be detected as a similar area. This is because the optical characteristics deteriorate as the image height increases, so it is preferable to use a region with a low image height rather than a region with a high image height.
ステップS402では、主被写体検出部210によって検出された主被写体の位置及びサイズと、輝度ガンマ処理部207から出力された輝度信号Yとに基づいて、第1の局所領域抽出部303が主被写体領域を抽出する。第1の局所領域抽出部303は、抽出した主被写体領域の輝度信号Yを、第1の特徴量算出部305と領域選択部308とに出力する。
In step S402, based on the position and size of the main subject detected by the main
ステップS403では、第2の局所領域抽出部304が、類似領域検出部302によって検出された類似領域の位置及びサイズと、輝度ガンマ処理部207から出力された輝度信号Yとに基づいて、類似領域を抽出する。第2の局所領域抽出部304は、抽出した類似領域の輝度信号Yを、第2の特徴量算出部306と領域選択部308とに出力する。
In step S <b> 403, the second local
ステップS404では、第1の局所領域抽出部303から出力される主被写体領域の輝度信号Yにおける特徴量が第1の特徴量算出部305によって算出され、算出された特徴量が領域決定部307に出力される。かかる特徴量は、主被写体領域の輝度信号Y、即ち、入力画像がPSFの推定に適したものであるか否かを判断するために用いられる。かかる特徴量は、入力画像のエッジ強度と、入力画像における飽和画素の数とに基づいて算出される。
In step S404, the feature amount in the luminance signal Y of the main subject region output from the first local
ここで、第1の特徴量算出部305について、図5を用いて説明する。図5は、第1の特徴量算出部305の構成を示すブロック図である。なお、第2の特徴量算出部306の構成も、図5に示す第1の特徴量算出部305と同様の構成になっている。
Here, the first feature
第1の特徴量算出部305においては、まず、入力画像における水平方向のエッジ強度と、入力画像における垂直方向のエッジ強度とが求められる。具体的には、水平方向バンドパスフィルタ部501によって入力画像にフィルタ処理が施され、第1の絶対値計算部503によってエッジの強度が算出される。入力画像内の全画素の水平方向におけるエッジ強度に基づいて、水平方向におけるエッジ強度の平均値(エッジ強度平均値)が第1の平均値算出部505によって算出される。また、垂直方向バンドパスフィルタ部502によって入力画像にフィルタ処理が施され、第2の絶対値計算部504によってエッジの強度が算出される。入力画像の全画素の垂直方向におけるエッジ強度に基づいて、垂直方向におけるエッジ強度の平均値が第2の平均値算出部506によって求められる。水平方向におけるエッジ強度平均値と垂直方向におけるエッジ強度平均値とのうちの小さい方が最小値選択部507によって選択され、選択されたエッジ強度平均値の最小値が最小値選択部507から出力される。こうして、エッジ強度に応じた値であるエッジ情報が得られる。入力画像自体にエッジが少ない場合や、水平方向又は垂直方向におけるエッジが少ない場合には、最小値選択部507から出力される信号は小さくなる。
In the first feature
一方、入力画像内における飽和画素の割合、即ち、飽和画素比率が、飽和画素比率検出部508によって算出される。飽和画素か否かは、画素値が所定の閾値を超えるか否かによって判定される。入力画像における飽和画素の割合が100%である場合には、飽和画素比率は1とされ、入力画像における飽和画素の割合が0%である場合には、飽和画素比率は0とされる。従って、飽和画素比率の値域は、0〜1となる。飽和画素比率検出部508によって求められた飽和画素の割合に基づいて、ゲイン算出部(ゲイン設定部)509によってゲインが算出される。ゲインの値域は、0〜1となる。乗算部510が、最小値選択部507から出力される値に、ゲイン算出部509によって算出されたゲインを乗じる。こうして得られた乗算値、即ち、特徴量が、第1の特徴量算出部305から領域決定部307に出力される。
On the other hand, the saturated pixel
なお、水平方向におけるエッジ強度平均値と垂直方向におけるエッジ強度平均値とのうちの大きい方ではなく小さい方を最小値選択部507によって選択するのは、PSFを取得するのに適していない領域の画像がPSFの取得に用いられるのを、より厳格に防止するためである。
Note that the minimum
図6は、飽和画素の比率とゲインとの関係を示すグラフである。図6(a)は、飽和画素の比率とゲイン算出部509によって設定されるゲインとの関係の一例を示すグラフである。図6(a)は、飽和画素の比率が0の際のゲインを1とし、飽和画素の比率が1の際のゲインを0とし、飽和画素の比率が増加するに伴ってゲインが直線的に低下するようにした場合を示している。飽和画素の比率が大きくなるとゲインが小さくなり、第1の特徴量算出部305から出力される特徴量が小さくなる。主被写体領域の画像がPSFの推定に適していない場合には、第1の特徴量算出部305から出力される特徴量が十分に小さくなるため、後述する領域選択部308によって主被写体領域の画像が選択されない。従って、主被写体領域の画像がPSFの推定に適していない場合には、主被写体領域の画像がPSFの推定に用いられないこととなる。
FIG. 6 is a graph showing the relationship between the saturated pixel ratio and the gain. FIG. 6A is a graph illustrating an example of the relationship between the saturated pixel ratio and the gain set by the
なお、飽和画素の比率とゲインとの関係は、図6(a)に示すような関係に限定されるものではない。例えば、飽和画素の比率とゲインとの関係を図6(b)のように設定してもよい。図6(b)は、飽和画素の比率とゲインとの関係の他の例を示すグラフである。図6(b)に示すように、飽和画素の比率が閾値Th1以下の場合には、ゲインが1に設定される。一方、飽和画素の比率が閾値Th2以上の場合には、ゲインが0に設定される。そして、飽和画素の比率が閾値Th1から閾値Th2の範囲内においては、飽和画素の比率が増加するに伴ってゲインが直線的に低下する。入力画像における飽和画素の比率がTh1以下である場合には、当該入力画像から良好にPSFを取得し得ると考えられる。従って、この場合には、ゲインを1とし、当該入力画像をPSFの推定に用いられやすくなっても、特段の問題はない。従って、飽和画素の比率が閾値Th1以下である場合には、ゲインを1としている。一方、入力画像における飽和画素の比率が閾値Th2以上である場合には、当該入力画像からPSFを良好に推定し得ないと考えられる。従って、この場合には、ゲインを0とし、当該入力画像がPSFの推定に用いられにくくすることが好ましい。従って、飽和画素の比率が閾値Th2以上である場合には、ゲインを0としている。 The relationship between the saturated pixel ratio and the gain is not limited to the relationship shown in FIG. For example, the relationship between the ratio of saturated pixels and the gain may be set as shown in FIG. FIG. 6B is a graph showing another example of the relationship between the ratio of saturated pixels and the gain. As shown in FIG. 6B, the gain is set to 1 when the ratio of saturated pixels is equal to or less than the threshold Th1. On the other hand, when the ratio of saturated pixels is equal to or greater than the threshold Th2, the gain is set to zero. When the saturated pixel ratio is in the range from the threshold Th1 to the threshold Th2, the gain decreases linearly as the saturated pixel ratio increases. When the ratio of saturated pixels in the input image is equal to or less than Th1, it is considered that the PSF can be acquired favorably from the input image. Therefore, in this case, there is no particular problem even if the gain is set to 1 and the input image can be easily used for PSF estimation. Therefore, when the ratio of saturated pixels is equal to or less than the threshold Th1, the gain is set to 1. On the other hand, when the ratio of saturated pixels in the input image is equal to or greater than the threshold Th2, it is considered that the PSF cannot be estimated well from the input image. Therefore, in this case, it is preferable to set the gain to 0 so that the input image is not easily used for PSF estimation. Therefore, when the ratio of saturated pixels is equal to or greater than the threshold value Th2, the gain is set to zero.
ステップS405では、第2の局所領域抽出部304から出力される類似領域の画像における特徴量が、第2の特徴量算出部306によって、第1の特徴量算出部305と同様にして算出され、算出された特徴量が領域決定部307に出力される。なお、上述したように、第2の特徴量算出部306の構成は、上述した第1の特徴量算出部305の構成と同様である。従って、第2の特徴量算出部306についての詳細な説明は、ここでは省略することとする。
In step S405, the feature amount in the image of the similar region output from the second local
ステップS406では、第1の特徴量算出部305から出力される主被写体領域の特徴量と、第2の特徴量算出部306から出力される類似領域の特徴量とが、領域決定部307によって比較される。特徴量が大きいほど、PSFの推定に適していると考えられる。従って、領域決定部307は、主被写体領域と類似領域とのうちの特徴量が大きい方の領域をPSFの推定に適した領域と判定し、当該領域をPSFの推定に用いられる領域として決定する。領域決定部307は、PSFの推定に用いられる領域、即ち、主被写体領域と類似領域とのうちの特徴が大きい方の領域を示す情報を、領域選択部308に出力する。
In step S <b> 406, the
ステップS407では、領域選択部308が、領域決定部307によって決定された領域の輝度信号を選択し、選択した輝度信号をPSF推定部(点拡がり関数推定部)309に出力する。即ち、主被写体領域の特徴量が類似領域の特徴量よりも大きい場合には、第1の局所領域抽出部303によって抽出された主被写体領域の輝度信号が領域選択部308によって選択され、かかる主被写体領域の輝度信号がPSF推定部309に出力される。一方、類似領域の特徴量が主被写体領域の特徴量よりも大きい場合には、第2の局所領域抽出部304によって抽出された類似領域の輝度信号が領域選択部308によって選択され、かかる類似領域の輝度信号がPSF推定部309に出力される。
In step S407, the
ステップS408では、PSF推定部309が、領域選択部308から出力された輝度信号に基づいて、PSFを推定する。PSFは、例えば公知の方法によって推定することができる。公知のPSF推定手法について以下に説明する。PSF推定部309に入力される画像をM、PSFをK、ブレやボケのない画像である潜像をLとすると、以下のような式(1)が成立する。
M=K*L ・・・(1)
なお、*は、畳み込み演算を表す記号である。
In step S408, the
M = K * L (1)
Note that * is a symbol representing a convolution operation.
PSFを示すKと潜像を示すLとは未知数である。しかし、潜像Lの初期値を適宜設定することによって、暫定的なPSFを推定することが可能である。暫定的なPSFを用いて暫定的な潜像を推定し、更に、暫定的な潜像を用いて暫定的なPSFを推定する。このようにしてPSFの推定と潜像の推定とを反復し、更新を繰り返すことにより、PSFと潜像の推定精度を高めることができ、一定の条件を満たしたPSFを最終的なPSFとすることができる。 K indicating PSF and L indicating latent image are unknowns. However, the provisional PSF can be estimated by appropriately setting the initial value of the latent image L. A temporary latent image is estimated using the temporary PSF, and a temporary PSF is estimated using the temporary latent image. By repeating the PSF estimation and the latent image estimation in this manner and repeating the update, it is possible to improve the estimation accuracy of the PSF and the latent image, and the PSF that satisfies a certain condition is set as the final PSF. be able to.
PSFと潜像とは、式(1)の両辺の差を表す項を含むエネルギー関数を最小化することによって推定し得る。かかるエネルギー関数は、例えば、以下のような式(2)、(3)によって表される。式(2)、(3)におけるσは、正則化項を示している。正則化項σとしては、例えば、画像やPSFをベクトルとして扱った際における要素の二乗和であるL2ノルム等が挙げられる。
ところで、画像のエッジ情報を用いると高精度にPSFを推定し得ることが知られている(非特許文献2)。そこで、本実施形態では、入力画像Mのエッジ情報M′と潜像Lのエッジ情報L’とを用いた式(4)のようなエネルギー関数を最小化することによって、PSFを推定する。
最初にPSFを求める際における潜像Lのエッジ情報L′の初期値は、例えば、以下のようにして得ることができる。即ち、入力画像Mにショックフィルタを適用することによって、平坦部を残したままエッジを強調する。こうして得られた画像のエッジ部をエッジ情報L′の初期値として用いる。 The initial value of the edge information L ′ of the latent image L when the PSF is first obtained can be obtained as follows, for example. That is, by applying a shock filter to the input image M, the edge is enhanced while leaving a flat portion. The edge portion of the image thus obtained is used as the initial value of the edge information L ′.
ステップS409では、RGB信号変換部301が、ブレ・ボケ補正部209に入力された色差信号R−Y、B−Y、及び、輝度信号Yを、色信号R,G,Bに変換し、当該色信号R,G,Bを補正処理部310に出力する。
In step S409, the RGB
ステップS410では、補正処理部310が、PSF推定部309から出力されるPSFを用いて、色信号R,G,Bのそれぞれに対してブレ・ボケ補正処理を行う。例えば、デコンボリューション法、より具体的には、ウィナーデコンボリューション法によって、以下のようにしてブレ・ボケ補正処理を行うことが可能である。即ち、PSF推定部309によって推定されたPSFをKとし、撮影された画像をMとし、潜像をLとすると、以下のような式(5)が成立する。
なお、ブレ・ボケ補正処理を行う際に用いられる手法は、デコンボリューション法に限定されるものではない。例えば、逆フィルタを用いてブレ・ボケ補正処理を行うようにしてもよい。かかる逆フィルタは、以下のような式(6)によって表される。
また、ブレ・ボケ補正処理を行う際に用いられる手法はこれらに限定されるものではない。例えば、推定されたPSFからエッジ強調用のフィルタを作成し、かかるフィルタを用いた処理によってエッジを強調させることによって、ブレやボケを補正するようにしてもよい。 Further, the method used when performing the blur / blur correction process is not limited to these. For example, a filter for edge emphasis may be created from the estimated PSF, and blurring and blurring may be corrected by emphasizing the edge by processing using the filter.
上記のようにして補正処理部310によってブレ・ボケ補正処理が施された色信号R,G,Bは、輝度・色差信号生成部311に出力される。輝度・色差信号生成部311は、輝度信号Yと色差信号R−Y、R−Bとを生成し、生成した輝度信号Yと色差信号R−Y、R−Bとを出力する。ブレ・ボケ補正部209から出力される輝度信号Yと色差信号R−Y、R−Bとは、記録部105に記録される。
The color signals R, G, and B that have been subjected to the blur / blur correction process by the
このように、本実施形態によれば、主被写体の領域の画像がPSFの推定に適していない場合であっても、主被写体の領域に類似する領域からPSFを推定することができる。このため、本実施形態によれば、PSFを良好に取得し得る画像処理装置を得ることができる。 Thus, according to the present embodiment, even if the image of the main subject region is not suitable for PSF estimation, the PSF can be estimated from a region similar to the main subject region. For this reason, according to the present embodiment, it is possible to obtain an image processing apparatus that can acquire PSF satisfactorily.
[第2実施形態]
本発明の第2実施形態による画像処理装置及び画像処理方法について図7及び図8を用いて説明する。図1乃至図6に示す第1実施形態による画像処理装置及び画像処理方法と同一の構成要素には、同一の符号を付して説明を省略または簡潔にする。
[Second Embodiment]
An image processing apparatus and an image processing method according to the second embodiment of the present invention will be described with reference to FIGS. The same components as those in the image processing apparatus and the image processing method according to the first embodiment shown in FIGS. 1 to 6 are denoted by the same reference numerals, and description thereof is omitted or simplified.
画像からPSFを推定する際には、推定誤差が生じ得る。かかる推定誤差は、PSFの推定に用いられる被写体に依存する。複数の被写体からそれぞれ推定されたPSFを合成するようにすれば、被写体への依存性を緩和することができ、推定誤差を抑制することが可能である。従って、本実施形態では、複数の領域の画像から得られるPSFを適宜合成することによって、PSFを推定する。ところで、特徴量の低い領域から得られるPSFは、大きい推定誤差を含む可能性が高い。このため、主被写体領域から推定したPSFと類似領域から推定したPSFとを合成する際には、それぞれの領域から算出される特徴量に基づいて合成を行う。 When estimating the PSF from the image, an estimation error may occur. Such an estimation error depends on a subject used for PSF estimation. By combining PSFs estimated from a plurality of subjects, the dependence on the subjects can be relaxed, and estimation errors can be suppressed. Therefore, in this embodiment, the PSF is estimated by appropriately combining PSFs obtained from images of a plurality of regions. By the way, a PSF obtained from a region having a low feature amount is likely to include a large estimation error. For this reason, when the PSF estimated from the main subject area and the PSF estimated from the similar area are combined, the combination is performed based on the feature amount calculated from each area.
図7は、本実施形態による画像処理装置111のブレ・ボケ補正部209の構成を示すブロック図である。本実施形態では、図3を用いて第1実施形態において上述した領域決定部307と領域選択部308とPSF推定部309とが、ブレ・ボケ補正部209内に設けられていない。一方、本実施形態では、第1のPSF推定部701と第2のPSF推定部702と合成比率決定部703と合成部704とがブレ・ボケ補正部209内に設けられている。
FIG. 7 is a block diagram illustrating a configuration of the blur /
図8は、本実施形態による画像処理装置111において行われるブレ・ボケ補正処理を示すフローチャートである。
FIG. 8 is a flowchart showing a blur / blur correction process performed in the
まず、ステップS801からステップS805までは、第1の実施形態におけるステップS401からステップS405と同様であるため、これらの説明については省略する。 First, step S801 to step S805 are the same as step S401 to step S405 in the first embodiment, and thus description thereof will be omitted.
ステップS806では、第1のPSF推定部701が、第1の局所領域抽出部303によって抽出された主被写体領域の画像情報からPSF(第1のPSF)を推定し、推定したPSFを合成部704に出力する。
In step S806, the first
ステップS807では、第2のPSF推定部702が、第2の局所領域抽出部304によって抽出された類似領域の画像情報からPSF(第2のPSF)を推定し、推定したPSFを合成部704に出力する。
In step S807, the second
ステップS808では、合成比率決定部703が、第1の特徴量算出部305から出力された主被写体の特徴量a1と第2の特徴量算出部306から出力された類似領域の特徴量a2とに基づいて、合成比率mを決定する。かかる合成比率mは、例えば以下のような式(7)によって求められる。合成比率決定部703は、決定した合成比率mを合成部704に出力する。なお、合成比率mの値域は、0〜1となる。
m=a1/(a1+a2) ・・・(7)
In step S <b> 808, the composition
m = a1 / (a1 + a2) (7)
なお、a1<a2であり、且つ、a1が所定の閾値以下である場合には、主被写体領域がPSFの推定に著しく適していないと判断し、m=0としてもよい。また、a1>a2であり、且つ、a2が所定の閾値以下である場合には、類似領域がPSFの推定に著しく適していないと判断し、m=1としてもよい。 If a1 <a2 and a1 is equal to or smaller than a predetermined threshold value, it may be determined that the main subject area is not extremely suitable for PSF estimation, and m = 0 may be set. Further, when a1> a2 and a2 is equal to or smaller than a predetermined threshold, it is determined that the similar region is not extremely suitable for PSF estimation, and m = 1 may be set.
ステップS809では、第1のPSF推定部701によって推定されたPSFと、第2のPSF推定部702によって推定されたPSFとを、合成比率決定部703によって決定された合成比率mに基づいて、合成部704が合成する。PSFは2次元的な配列によって表現されているため、PSFの各要素同士を合成比率mに基づいて合成する。まず、第1のPSFの中心と第2のPSFの中心とを位置合わせし、第1のPSFと第2のPSFとが重なり合った領域を、合成後のPSFの大きさ(N×M)として定める。合成後のPSFをKm(i,j)、第1のPSFをK1(i,j)、第2のPSFをK2(i,j)とすると、合成後のPSFは、以下のような式(8)を用いて表すことができる。なお、(i,j)は、座標を示している。
Km(i,j)=m×K1(i,j)+(1−m)×K2(i,j) ・・・(8)
式(8)に基づいて演算を行うことによって、合成後のPSFが得られる。なお、iの範囲は0〜N−1であり、jの範囲は0〜M−1である。
In step S809, the PSF estimated by the first
Km (i, j) = m * K1 (i, j) + (1-m) * K2 (i, j) (8)
By performing the calculation based on the equation (8), the combined PSF is obtained. The range of i is 0 to N-1, and the range of j is 0 to M-1.
ステップS810では、補正処理部310が、合成部704によって合成されたPSFに基づいて、RGB信号変換部301から出力された色信号R,G,Bのそれぞれに対して補正処理を行う。補正処理部310は、補正処理が施された色信号R,G,Bを輝度・色差信号生成部311に出力する。輝度・色差信号生成部311は、色信号R,G,Bに基づいて色差信号R−Y、B−Y及び輝度信号Yを生成し、生成したこれらの信号を出力する。
In step S810, the
このように、本実施形態によれば、主被写体領域から推定されたPSFと類似領域から推定されたPSFとを合成することによってPSFを生成するため、被写体への依存性を緩和することができる。このため、本実施形態によれば、推定誤差を低減することができ、より良好なPSFを得ることが可能となる。 As described above, according to the present embodiment, since the PSF is generated by combining the PSF estimated from the main subject area and the PSF estimated from the similar area, the dependence on the subject can be reduced. . Therefore, according to the present embodiment, it is possible to reduce the estimation error and obtain a better PSF.
[変形実施形態]
上記実施形態に限らず種々の変形が可能である。
例えば、上記実施形態では、主被写体領域と類似領域とのうちの特徴量が大きい方の領域を、PSFを推定するために用いる場合を例に説明したが、これに限定されるものではない。例えば、主被写体領域における特徴量が所定の閾値以上である場合には、類似領域における特徴量の如何にかかわらず、主被写体領域をPSFの推定に用いるようにしてもよい。主被写体領域における特徴量が所定の閾値以上である場合には、主被写体領域の画像からPSFを良好に推定し得るためである。
[Modified Embodiment]
The present invention is not limited to the above embodiment, and various modifications are possible.
For example, in the above-described embodiment, an example has been described in which the region having the larger feature amount of the main subject region and the similar region is used for estimating the PSF. However, the present invention is not limited to this. For example, when the feature amount in the main subject region is equal to or greater than a predetermined threshold, the main subject region may be used for PSF estimation regardless of the feature amount in the similar region. This is because when the feature amount in the main subject area is equal to or larger than a predetermined threshold, the PSF can be estimated well from the image of the main subject area.
また、上記実施形態では、類似領域を1つだけ抽出する場合を例に説明したが、類似領域を複数抽出するようにしてもよい。この場合には、特徴量が最も大きい方の領域が、PSFを推定するために用いられる。 In the above embodiment, the case where only one similar region is extracted has been described as an example. However, a plurality of similar regions may be extracted. In this case, the region having the largest feature amount is used for estimating the PSF.
また、第1の特徴量算出部305や第2の特徴量算出部306において行われる特徴量の算出処理は、上記実施形態において上述したような算出処理に限定されるものではない。即ち、上記実施形態では、水平方向と垂直方向の2方向におけるエッジ強度と、飽和画素の比率とに基づいて特徴量を算出したが、これに限定されるものではない。例えば、4方向におけるエッジ強度と飽和画素の比率とに基づいて特徴量を算出するようにしてもよい。4方向としては、例えば、水平方向、垂直方向、斜め45度の方向と、斜め135度の方向等を挙げることができる。
In addition, the feature amount calculation processing performed in the first feature
また、上記実施形態では、特徴量の算出に用いられるエッジ情報がエッジ強度そのものである場合を例に説明したが、特徴量の算出に用いられるエッジ情報はエッジ強度そのものに限定されるものではない。エッジ強度に応じた値を、特徴量の算出に用いられるエッジ情報として適宜用いることができる。例えば、エッジ強度の平均値を複数の方向においてそれぞれ算出し、当該平均値が所定の閾値以上となるような方向の数を算出し、算出された方向の数に基づいて特徴量を算出してもよい。即ち、特徴量の算出に用いられるエッジ情報は、エッジ強度に基づく値がそれぞれ算出される複数の方向のうちの、エッジ強度に基づく値が所定の閾値以上となる方向の数であってもよい。この場合には、上記のようにして算出されたエッジ情報に、飽和画素の比率に応じたゲインを乗算することによって、特徴量が算出される。また、エッジ強度の平均値を複数の方向においてそれぞれ算出し、算出されたエッジ強度平均値の分散値に基づいて特徴量を算出してもよい。また、エッジ方向に依存せずにエッジ強度を取得し得る手段を用いて算出されたエッジ情報に基づいて、特徴量を算出してもよい。エッジ方向に依存せずにエッジ強度を取得し得る手段としては、例えばラプラシアンフィルタ等が挙げられる。こうして得られたエッジ情報に、飽和画素の比率に応じたゲインを乗算することによって、特徴量が算出される。 In the above embodiment, the case where the edge information used for calculating the feature amount is the edge strength itself has been described as an example. However, the edge information used for calculating the feature amount is not limited to the edge strength itself. . A value corresponding to the edge strength can be appropriately used as edge information used for calculating the feature amount. For example, the average value of the edge strength is calculated in each of a plurality of directions, the number of directions in which the average value is equal to or greater than a predetermined threshold is calculated, and the feature amount is calculated based on the calculated number of directions. Also good. That is, the edge information used for calculating the feature amount may be the number of directions in which the value based on the edge strength is equal to or greater than a predetermined threshold among the plurality of directions in which the value based on the edge strength is calculated. . In this case, the feature amount is calculated by multiplying the edge information calculated as described above by a gain corresponding to the ratio of saturated pixels. Alternatively, the average value of the edge strength may be calculated in each of a plurality of directions, and the feature amount may be calculated based on the calculated variance value of the average edge strength value. Further, the feature amount may be calculated based on the edge information calculated using a means that can acquire the edge strength without depending on the edge direction. As a means for acquiring the edge strength without depending on the edge direction, for example, a Laplacian filter or the like can be cited. The feature amount is calculated by multiplying the edge information obtained in this way by a gain corresponding to the ratio of saturated pixels.
また、第2実施形態では、主被写体領域の画像情報から得られる第1のPSFと類似領域の画像情報から得られる第2のPSFとを、合成比率mに基づいて合成することによって、合成後のPSFを得る場合を例に説明したが、これに限定されるものではない。例えば、第1のPSFに基づいて算出される第1の情報と、第2のPSFに基づいて算出される第2の情報とを、合成比率mに基づいて合成することによって、合成後の情報を得るようにしてもよい。そして、合成された情報を用いてブレやボケを補正するようにしてもよい。PSFに基づいて算出される情報としては、例えば、エッジ強調用のフィルタ等が挙げられる。 In the second embodiment, the first PSF obtained from the image information of the main subject area and the second PSF obtained from the image information of the similar area are synthesized based on the synthesis ratio m, so that However, the present invention is not limited to this. For example, the first information calculated based on the first PSF and the second information calculated based on the second PSF are combined based on the combination ratio m, thereby combining the combined information. May be obtained. Then, blurring and blurring may be corrected using the synthesized information. Examples of information calculated based on the PSF include an edge enhancement filter.
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
111…画像処理装置
308…領域選択部
309…PSF推定部
111...
Claims (17)
前記第1の領域に類似する第2の領域を前記画像から検出する第2の領域検出部と、
前記第1の領域と前記第2の領域とのうちの少なくともいずれかにおける特徴量を算出する特徴量算出部と、
前記特徴量算出部によって算出された前記特徴量に基づいて前記第1の領域又は前記第2の領域を選択する領域選択部と、
前記領域選択部によって選択された前記第1の領域又は前記第2の領域から点拡がり関数を推定する点拡がり関数推定部と
を有することを特徴とする画像処理装置。 A first region detection unit for detecting a first region from an image;
A second region detecting unit for detecting a second region similar to the first region from the image;
A feature amount calculation unit that calculates a feature amount in at least one of the first region and the second region;
A region selection unit that selects the first region or the second region based on the feature amount calculated by the feature amount calculation unit;
An image processing apparatus comprising: a point spread function estimating unit that estimates a point spread function from the first region or the second region selected by the region selecting unit.
前記第1の領域に類似する第2の領域を前記画像から検出する第2の領域検出部と、
前記第1の領域と前記第2の領域とのうちの少なくともいずれかにおける特徴量を算出する特徴量算出部と、
前記第1の領域から第1の点拡がり関数を推定し、前記第2の領域から第2の点拡がり関数を推定する点拡がり関数推定部と、
前記特徴量算出部によって算出された前記特徴量に基づいて、合成比率を決定する合成比率決定部と、
前記第1の点拡がり関数と前記第2の点拡がり関数とを前記合成比率に基づいて合成する、又は、前記第1の点拡がり関数に基づく情報と前記第2の点拡がり関数に基づく情報とを前記合成比率に基づいて合成する合成部と
を有することを特徴とする画像処理装置。 A first region detection unit for detecting a first region from an image;
A second region detecting unit for detecting a second region similar to the first region from the image;
A feature amount calculation unit that calculates a feature amount in at least one of the first region and the second region;
A point spread function estimator that estimates a first point spread function from the first region and estimates a second point spread function from the second region;
A composition ratio determining unit that determines a composition ratio based on the feature amount calculated by the feature amount calculating unit;
Combining the first point spread function and the second point spread function based on the combination ratio; or information based on the first point spread function and information based on the second point spread function; An image processing apparatus comprising: a combining unit configured to combine the image processing unit based on the combining ratio.
ことを特徴とする請求項1又は2に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the first region is a main subject region that is a region of a main subject.
前記第2の領域検出部は、前記距離情報に基づいて前記第2の領域を検出する
ことを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。 A distance information acquisition unit that acquires distance information indicating a distance to the subject;
The image processing apparatus according to claim 1, wherein the second area detection unit detects the second area based on the distance information.
前記第2の領域検出部は、前記動き情報に基づいて前記第2の領域を検出する
ことを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。 A motion information detector that detects motion information indicating the motion of the subject;
The image processing apparatus according to claim 1, wherein the second area detection unit detects the second area based on the motion information.
ことを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the second area detection unit detects the second area based on an image height.
ことを特徴とする請求項1乃至6のいずれか1項に記載の画像処理装置。 The feature amount calculation unit calculates the feature amount in the first region based on edge information in the first region, and the feature in the second region based on edge information in the second region. The image processing apparatus according to claim 1, wherein an amount is calculated.
ことを特徴とする請求項7に記載の画像処理装置。 The image processing apparatus according to claim 7, wherein the edge information is a value corresponding to an edge strength.
ことを特徴とする請求項7に記載の画像処理装置。 The edge information is a number of directions in which a value corresponding to the edge strength is equal to or greater than a predetermined threshold among a plurality of directions in which values corresponding to the edge strength are respectively calculated. Item 8. The image processing device according to Item 7.
ことを特徴とする請求項1乃至9のいずれか1項に記載の画像処理装置。 The feature amount calculating unit calculates the feature amount in the first region based further on the ratio of saturated pixels in the first region, and further based on the proportion of saturated pixels in the second region. The image processing apparatus according to claim 1, wherein the feature amount in the area of 2 is calculated.
ことを特徴とする請求項1に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the region selection unit selects a region having the largest feature amount from the first region and the second region.
ことを特徴とする請求項1に記載の画像処理装置。 When the feature amount in the first region is equal to or greater than a predetermined threshold, the region selection unit selects the first region regardless of the feature amount in the second region. The image processing apparatus according to claim 1.
前記第2の点拡がり関数に基づく情報は、前記第2の点拡がり関数に基づいて生成される第2のフィルタである
ことを特徴とする請求項2に記載の画像処理装置。 The correction means based on the first point spread function is a first filter generated based on the first point spread function;
The image processing apparatus according to claim 2, wherein the information based on the second point spread function is a second filter generated based on the second point spread function.
前記第1の領域に類似する第2の領域を前記画像から検出するステップと、
前記第1の領域と前記第2の領域とのうちの少なくともいずれかにおける特徴量を算出するステップと、
前記特徴量を算出するステップにおいて算出された前記特徴量に基づいて、前記第1の領域又は前記第2の領域を選択するステップと、
前記第1の領域又は前記第2の領域を選択するステップにおいて選択された前記第1の領域又は前記第2の領域から点拡がり関数を推定するステップと
を有することを特徴とする画像処理方法。 Detecting a first region from the image;
Detecting a second region similar to the first region from the image;
Calculating a feature amount in at least one of the first region and the second region;
Selecting the first region or the second region based on the feature amount calculated in the step of calculating the feature amount;
And a step of estimating a point spread function from the first region or the second region selected in the step of selecting the first region or the second region.
前記第1の領域に類似する第2の領域を前記画像から検出するステップと、
前記第1の領域と前記第2の領域とのうちの少なくともいずれかにおける特徴量を算出するステップと、
前記第1の領域から第1の点拡がり関数を推定し、前記第2の領域から第2の点拡がり関数を推定するステップと、
前記特徴量を算出するステップにおいて算出された前記特徴量に基づいて、合成比率を決定する合成比率決定部と、
前記第1の点拡がり関数と前記第2の点拡がり関数とを前記合成比率に基づいて合成する、又は、前記第1の点拡がり関数に基づく情報と前記第2の点拡がり関数に基づく情報とを前記合成比率に基づいて合成するステップと
を有することを特徴とする画像処理方法。 Detecting a first region from the image;
Detecting a second region similar to the first region from the image;
Calculating a feature amount in at least one of the first region and the second region;
Estimating a first point spread function from the first region and estimating a second point spread function from the second region;
A composition ratio determining unit that determines a composition ratio based on the feature amount calculated in the step of calculating the feature amount;
Combining the first point spread function and the second point spread function based on the combination ratio; or information based on the first point spread function and information based on the second point spread function; Combining the image processing method based on the combining ratio.
画像から第1の領域を検出するステップと、
前記第1の領域に類似する第2の領域を前記画像から検出するステップと、
前記第1の領域と前記第2の領域とのうちの少なくともいずれかにおける特徴量を算出するステップと、
前記特徴量を算出するステップにおいて算出された前記特徴量に基づいて、前記第1の領域又は前記第2の領域を選択するステップと、
前記第1の領域又は前記第2の領域を選択するステップにおいて選択された前記第1の領域又は前記第2の領域から点拡がり関数を推定するステップと
を実行させるためのプログラム。 On the computer,
Detecting a first region from the image;
Detecting a second region similar to the first region from the image;
Calculating a feature amount in at least one of the first region and the second region;
Selecting the first region or the second region based on the feature amount calculated in the step of calculating the feature amount;
A program for executing a step of estimating a point spread function from the first region or the second region selected in the step of selecting the first region or the second region.
画像から第1の領域を検出するステップと、
前記第1の領域に類似する第2の領域を前記画像から検出するステップと、
前記第1の領域と前記第2の領域とのうちの少なくともいずれかにおける特徴量を算出するステップと、
前記第1の領域から第1の点拡がり関数を推定し、前記第2の領域から第2の点拡がり関数を推定するステップと、
前記特徴量を算出するステップにおいて算出された前記特徴量に基づいて、合成比率を決定する合成比率決定部と、
前記第1の点拡がり関数と前記第2の点拡がり関数とを前記合成比率に基づいて合成する、又は、前記第1の点拡がり関数に基づく情報と前記第2の点拡がり関数に基づく情報とを前記合成比率に基づいて合成するステップと
を実行させるためのプログラム。 On the computer,
Detecting a first region from the image;
Detecting a second region similar to the first region from the image;
Calculating a feature amount in at least one of the first region and the second region;
Estimating a first point spread function from the first region and estimating a second point spread function from the second region;
A composition ratio determining unit that determines a composition ratio based on the feature amount calculated in the step of calculating the feature amount;
Combining the first point spread function and the second point spread function based on the combination ratio; or information based on the first point spread function and information based on the second point spread function; A program for executing the step of synthesizing based on the synthesis ratio.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015239393A JP2017108243A (en) | 2015-12-08 | 2015-12-08 | Image processing device and image processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015239393A JP2017108243A (en) | 2015-12-08 | 2015-12-08 | Image processing device and image processing method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2017108243A true JP2017108243A (en) | 2017-06-15 |
Family
ID=59061050
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015239393A Pending JP2017108243A (en) | 2015-12-08 | 2015-12-08 | Image processing device and image processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2017108243A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021059990A1 (en) * | 2019-09-26 | 2021-04-01 | 株式会社日立国際電気 | Image capturing device and image capturing method |
-
2015
- 2015-12-08 JP JP2015239393A patent/JP2017108243A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021059990A1 (en) * | 2019-09-26 | 2021-04-01 | 株式会社日立国際電気 | Image capturing device and image capturing method |
JPWO2021059990A1 (en) * | 2019-09-26 | 2021-04-01 | ||
JP7232928B2 (en) | 2019-09-26 | 2023-03-03 | 株式会社日立国際電気 | Imaging device and imaging method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9357144B2 (en) | Image processing apparatus, imaging device, image processing method, and computer-readable recording medium | |
KR101574733B1 (en) | Image processing apparatus for obtaining high-definition color image and method therof | |
JP5968073B2 (en) | Image processing apparatus, imaging apparatus, image processing method, and image processing program | |
JP5709911B2 (en) | Image processing method, image processing apparatus, image processing program, and imaging apparatus | |
US9508153B2 (en) | Distance measurement apparatus, imaging apparatus, distance measurement method, and program | |
KR101424923B1 (en) | Image synthesis device and computer program for image synthesis | |
JP7032913B2 (en) | Image processing device, image processing method, computer program | |
US9538074B2 (en) | Image processing apparatus, imaging apparatus, and image processing method | |
US10204400B2 (en) | Image processing apparatus, imaging apparatus, image processing method, and recording medium | |
US20150161771A1 (en) | Image processing method, image processing apparatus, image capturing apparatus and non-transitory computer-readable storage medium | |
US10217193B2 (en) | Image processing apparatus, image capturing apparatus, and storage medium that stores image processing program | |
JP2009088935A (en) | Image recording apparatus, image correcting apparatus, and image pickup apparatus | |
JP7263149B2 (en) | Image processing device, image processing method, and program | |
US9270883B2 (en) | Image processing apparatus, image pickup apparatus, image pickup system, image processing method, and non-transitory computer-readable storage medium | |
JP2017108243A (en) | Image processing device and image processing method | |
US10062150B2 (en) | Image processing apparatus, image capturing apparatus, and storage medium | |
JP2012085205A (en) | Image processing apparatus, imaging device, image processing method, and image processing program | |
JP2017130167A (en) | Image processing device, imaging device, and image processing program | |
JP6739955B2 (en) | Image processing apparatus, image processing method, image processing program, and recording medium | |
JP5115297B2 (en) | Image processing apparatus, imaging apparatus, image processing method, and program | |
JP2016119532A (en) | Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium | |
JP6570406B2 (en) | Image processing apparatus, imaging apparatus, image processing method, and program | |
JP6381212B2 (en) | Imaging apparatus and control method thereof | |
JP2009088933A (en) | Image recording apparatus, image correcting apparatus and image pickup apparatus | |
JP2015109562A (en) | Image processing device, imaging device, control method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD05 | Notification of revocation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7425 Effective date: 20171214 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20180126 |