JP2017108243A - Image processing device and image processing method - Google Patents

Image processing device and image processing method Download PDF

Info

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
Application number
JP2015239393A
Other languages
Japanese (ja)
Inventor
遥平 豊原
Yohei TOYOHARA
遥平 豊原
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 JP2015239393A priority Critical patent/JP2017108243A/en
Publication of JP2017108243A publication Critical patent/JP2017108243A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an image processing device and an image processing method, capable of successfully estimating a point spread function and the like.SOLUTION: An image processing device comprises: a first region detecting unit which detects a first region from an image; a second region detecting unit which detects a second region similar to the first region from the image; an amount-of-characteristics calculating unit which calculates the amount of characteristics in at least either of the first region and the second region; a region selecting unit which selects the first region or the second region on the basis of the amount of characteristics calculated by the amount-of-characteristics calculating unit; and a point spread function estimating unit which estimates a point spread function from the first region or the second region selected by the region selecting unit.SELECTED DRAWING: Figure 3

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.

特開2007−306548号公報JP 2007-306548 A 特開2012−155456号公報JP 2012-155456 A

G.R.Ayers and J.C.Dainty,”Iterative blind deconvolution method and its applications,”Optics Letters,vol.13(7),pp,547-549,july 1988.G.R.Ayers and J.C.Dainty, “Iterative blind deconvolution method and its applications,” Optics Letters, vol. 13 (7), pp, 547-549, july 1988. Xu L, Jia J (2010) Two-phase kernel estimation for robust motion deblurring. In: Proceedings of European Conference on Computer Vision, pp 157-170.Xu L, Jia J (2010) Two-phase kernel estimation for robust motion deblurring. In: Proceedings of European Conference on Computer Vision, pp 157-170.

しかしながら、従来の技術では、ブレ・ボケの補正を必ずしも良好に行い得ない場合があった。   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.

本発明の第1実施形態による画像処理装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of an image processing device according to a first embodiment of the present invention. 本発明の第1実施形態による画像処理装置の画像処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the image processing part of the image processing apparatus by 1st Embodiment of this invention. 本発明の第1実施形態による画像処理装置のブレ・ボケ補正部の構成を示すブロック図である。It is a block diagram which shows the structure of the blurring / blur correction | amendment part of the image processing apparatus by 1st Embodiment of this invention. 本発明の第1実施形態による画像処理装置において行われるブレ・ボケ補正処理を示すフローチャートである。4 is a flowchart illustrating blur / blur correction processing performed in the image processing apparatus according to the first embodiment of the present invention. 本発明の第1実施形態による画像処理装置の特徴量算出部の構成を示すブロック図である。It is a block diagram which shows the structure of the feature-value calculation part of the image processing apparatus by 1st Embodiment of this invention. 飽和画素の比率とゲインとの関係を示すグラフである。It is a graph which shows the relationship between the ratio of a saturated pixel, and a gain. 本発明の第2実施形態による画像処理装置のブレ・ボケ補正部の構成を示すブロック図である。It is a block diagram which shows the structure of the blurring / blur correction | amendment part of the image processing apparatus by 2nd Embodiment of this invention. 本発明の第2実施形態による画像処理装置において行われるブレ・ボケ補正処理を示すフローチャートである。It is a flowchart which shows the blurring-blur correction process performed in the image processing apparatus by 2nd Embodiment of this invention.

以下に、本発明の好ましい実施の形態を、図面を参照しながら詳細に説明する。   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 image processing apparatus 111 according to the present embodiment is an imaging apparatus, for example. More specifically, the image processing apparatus 111 according to the present embodiment is an electronic camera, that is, a digital camera. Note that the image processing apparatus 111 is not limited to an imaging apparatus, and may be an electronic device that does not have an imaging function.

本実施形態における画像処理装置111は、光学系101、撮像素子102、A/D変換部103、画像処理部104、記録部105、制御部106、測距部107、画像メモリ108、操作部109、及び、表示部110を備えている。光学系101には、フォーカスレンズ、絞り、シャッター等が含まれる。   The image processing apparatus 111 according to this embodiment includes an optical system 101, an image sensor 102, an A / D conversion unit 103, an image processing unit 104, a recording unit 105, a control unit 106, a distance measuring unit 107, an image memory 108, and an operation unit 109. And a display unit 110. The optical system 101 includes a focus lens, a diaphragm, a shutter, and the like.

光学系101は、フォーカスレンズ(図示せず)を駆動することによって被写体にピントを合わせ、絞り(図示せず)やシャッター(図示せず)を制御することによって露光量を調節する。なお、光学系101は、画像処理装置111から着脱不能であってもよいし、着脱可能であってもよい。撮像素子102は、光学系101において結像される被写体の光学像を光電変換によって電気信号に変換するためのものであり、例えば、CCDイメージセンサやCMOSイメージセンサ等である。A/D変換部103は、撮像素子102から出力されるアナログの画像信号をデジタル化するためのものである。   The optical system 101 focuses a subject by driving a focus lens (not shown), and adjusts an exposure amount by controlling a diaphragm (not shown) and a shutter (not shown). The optical system 101 may be detachable from the image processing apparatus 111 or may be detachable. The imaging element 102 is for converting an optical image of a subject formed in the optical system 101 into an electrical signal by photoelectric conversion, and is, for example, a CCD image sensor or a CMOS image sensor. The A / D conversion unit 103 is for digitizing an analog image signal output from the image sensor 102.

画像処理部104は、A/D変換部103によってデジタル化された画像信号に対して、同時化処理、ホワイトバランス補正処理、色変換処理、輪郭強調処理、ガンマ処理、ブレやボケの補正処理等を施す。また、画像処理部104は、主被写体を検出する処理や動きベクトルの検出処理等をも実行する。画像処理部104によって所定の処理が施された画像信号(画像、画像情報)は、記録部105に出力される。記録部105は、画像処理部104から出力される画像をJPEG形式等の所定の形式の画像に変換し、所定の形式に変換した画像を記録媒体に記録する。   The image processing unit 104 performs synchronization processing, white balance correction processing, color conversion processing, edge enhancement processing, gamma processing, blurring / blurring correction processing, and the like on the image signal digitized by the A / D conversion unit 103. Apply. The image processing unit 104 also executes processing for detecting the main subject, motion vector detection processing, and the like. An image signal (image, image information) that has been subjected to predetermined processing by the image processing unit 104 is output to the recording unit 105. The recording unit 105 converts the image output from the image processing unit 104 into an image of a predetermined format such as a JPEG format, and records the image converted into the predetermined format on a recording medium.

制御部106は、本実施形態による画像処理装置111の全体の動作を司る。制御部106は、例えば、撮影された画像に基づいて所定の評価値を算出し、画像処理部104によって行われる画像処理のパラメータを決定する。測距部(距離情報取得部)107は、被写体までの距離情報を取得し、距離マップを生成する。距離マップとは、撮影された画像における被写体までの距離情報を画素単位で2次元的に示すものである。   The control unit 106 governs the overall operation of the image processing apparatus 111 according to the present embodiment. For example, the control unit 106 calculates a predetermined evaluation value based on the photographed image, and determines parameters for image processing performed by the image processing unit 104. A distance measuring unit (distance information acquiring unit) 107 acquires distance information to the subject and generates a distance map. A distance map is a two-dimensional representation of distance information to a subject in a captured image in pixel units.

画像メモリ108は、画像処理部104において画像処理を行う際に必要な情報を格納するためのものである。操作部109は、画像処理装置111に対してユーザが操作指示を行うためのものである。表示部110は、例えば、画像処理装置111の例えば背面に設置された液晶ディスプレイ等であり、撮影時の操作の補助を行うための画面や、記録部105に保存されている画像等を表示するものである。   The image memory 108 is for storing information necessary for image processing in the image processing unit 104. The operation unit 109 is for a user to give an operation instruction to the image processing apparatus 111. The display unit 110 is, for example, a liquid crystal display or the like installed on the back surface of the image processing apparatus 111, and displays a screen for assisting operations during shooting, an image stored in the recording unit 105, and the like. Is.

次に、画像処理部104についての詳細な説明を図2を用いて行う。図2は、本実施形態による画像処理部104の構成を示すブロック図である。   Next, a detailed description of the image processing unit 104 will be given with reference to FIG. FIG. 2 is a block diagram illustrating a configuration of the image processing unit 104 according to the present embodiment.

画像処理部104は、同時化処理部201、ホワイトバランス補正処理部202、輝度・色信号生成部203、色変換処理部204、輪郭強調処理部205、色ガンマ処理部206、輝度ガンマ処理部207、及び、色差信号生成部208を備えている。また、画像処理部104は、ブレ・ボケ補正部209、主被写体検出部210、及び、動きベクトル検出部211を更に備えている。   The image processing unit 104 includes a synchronization processing unit 201, a white balance correction processing unit 202, a luminance / color signal generation unit 203, a color conversion processing unit 204, a contour enhancement processing unit 205, a color gamma processing unit 206, and a luminance gamma processing unit 207. , And a color difference signal generation unit 208. The image processing unit 104 further includes a blur / blur correction unit 209, a main subject detection unit 210, and a motion vector detection unit 211.

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 / D conversion unit 103 is input to the synchronization processing unit 201 provided in the image processing unit 104. The synchronization processing unit 201 performs a synchronization process that is a process of calculating the color of each point by interpolating a spatial shift of the color signal associated with the color filter array. The synchronization processing unit 201 performs synchronization processing on the Bayer RGB image data output from the A / D conversion unit 103 to generate color signals R, G, and B. The color signals R, G, and B generated by the synchronization processing unit 201 are input to the white balance correction processing unit 202. The white balance correction processing unit 202 adjusts the white balance by applying a gain to the color signals R, G, and B based on the white balance gain value calculated by the control unit 106. The color signals R, G, and B whose white balance has been adjusted are output to the luminance / color signal generation unit 203. The luminance / color signal generation unit 203 generates a luminance signal Y from the color signals R, G, and B output from the white balance correction processing unit 202, and outputs the generated luminance signal Y to the contour enhancement processing unit 205. Further, the luminance / color signal generation unit 203 outputs the color signals R, G, and B to the color conversion processing unit 204.

色変換処理部204は、マトリクス演算等によって色変換を行い、所望のカラーバランスの色信号R,G,Bを得る。色ガンマ処理部206は、色信号R,G,Bに対してガンマ補正を行う。色差信号生成部208は、色信号R,G,Bに基づいて色差信号R−Y、B−Yを生成する。色差信号生成部208によって生成された色差信号R−Y、B−Yは、ブレ・ボケ補正部209に出力される。   The color conversion processing unit 204 performs color conversion by matrix calculation or the like, and obtains color signals R, G, and B having a desired color balance. The color gamma processing unit 206 performs gamma correction on the color signals R, G, and B. The color difference signal generation unit 208 generates color difference signals RY and BY based on the color signals R, G, and B. The color difference signals RY and BY generated by the color difference signal generation unit 208 are output to the blur / blur correction unit 209.

輪郭強調処理部205は、輝度信号Yに対して輪郭強調処理を行い、輪郭強調処理が施された輝度信号Yを輝度ガンマ処理部207に出力する。輝度ガンマ処理部207は、輝度信号Yに対してガンマ補正を行い、ガンマ補正が施された輝度信号Yを、ブレ・ボケ補正部209、主被写体検出部210、動きベクトル検出部211、及び、画像メモリ108に出力する。   The contour enhancement processing unit 205 performs contour enhancement processing on the luminance signal Y and outputs the luminance signal Y subjected to the contour enhancement processing to the luminance gamma processing unit 207. The luminance gamma processing unit 207 performs gamma correction on the luminance signal Y, and the luminance signal Y subjected to the gamma correction is converted into a blur / blur correction unit 209, a main subject detection unit 210, a motion vector detection unit 211, and Output to the image memory 108.

主被写体検出部210は、輝度信号Yに基づいて、主たる被写体である主被写体の位置と大きさとを検出する。主被写体としては、例えば、人物の顔等が挙げられる。主被写体検出部210は、公知の手法によって、顔の位置と大きさとを検出する。なお、主被写体は、人物の顔に限定されるものではなく、例えば、人物の胴体等であってもよい。また、主被写体は、人物に限定されるものではなく、人物以外の動物であってもよいし、物体等であってもよい。   Based on the luminance signal Y, the main subject detection unit 210 detects the position and size of the main subject that is the main subject. Examples of the main subject include a human face. The main subject detection unit 210 detects the position and size of the face by a known method. The main subject is not limited to a person's face, and may be a person's torso, for example. The main subject is not limited to a person, and may be an animal other than a person or an object.

動きベクトル検出部(動き情報検出部)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 gamma processing unit 207 and the luminance signal Y of the image taken immediately before. Note that the image taken immediately before is recorded in the image memory 108. As a motion vector detection method, a known technique can be used. Specifically, the image is divided into blocks of a predetermined size, and template matching is performed within a predetermined range for each block. Template matching refers to finding an image area that matches a small part of an image area called a template. A motion vector in each block can be obtained based on the coordinates of the template and the coordinates of the image area matched with the template.

なお、ブレ・ボケ補正部209は、色差信号生成部208から出力される色差信号R−Y、B−Yと、輝度ガンマ処理部207から出力される輝度信号Yとに対して、ブレ・ボケ補正処理を施す。なお、ブレ・ボケ補正部209において行われるブレ・ボケ補正処理の詳細については後述することとする。ブレ・ボケ補正部209によってブレ・ボケ補正処理が施された画像信号は、記録部105に出力され、記録部105に記録される。   Note that the blur / blur correction unit 209 applies blur / blur to the color difference signals RY and BY output from the color difference signal generation unit 208 and the luminance signal Y output from the luminance gamma processing unit 207. A correction process is performed. The details of the blur / blur correction process performed in the blur / blur correction unit 209 will be described later. The image signal that has been subjected to the blur / blur correction process by the blur / blur correction unit 209 is output to the recording unit 105 and recorded in the recording unit 105.

次に、本実施形態による画像処理装置111において行われるブレ・ボケ補正処理について図3及び図4を用いて詳細に説明する。   Next, blur / blur correction processing performed in the image processing apparatus 111 according to the present embodiment will be described in detail with reference to FIGS. 3 and 4.

図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 / blur correction unit 209. As shown in FIG. 3, the blur / blur correction unit 209 includes an RGB signal conversion unit 301, a similar region detection unit 302, a first local region extraction unit 303, a second local region extraction unit 304, and a first feature amount. A calculation unit 305 and a second feature amount calculation unit 306 are provided. The blur / blur correction unit 209 further includes an area determination unit 307, an area selection unit 308, a PSF estimation unit 309, a correction processing unit 310, and a luminance / color difference signal generation unit 311.

図4は、本実施形態による画像処理装置111において行われるブレ・ボケ補正処理を示すフローチャートである。   FIG. 4 is a flowchart showing a blur / blur correction process performed in the image processing apparatus 111 according to the present embodiment.

ステップS401では、類似領域検出部302が、主被写体検出部210で検出された主被写体領域の位置とサイズと、動きベクトル検出部211で検出されたブロック毎の動きベクトルと、測距部107で生成した距離マップとを取得する。また、ステップS401では、類似領域検出部302が、主被写体に生じているブレ・ボケと類似するブレ・ボケが生じている類似領域を検出する。   In step S <b> 401, the similar region detection unit 302 detects the position and size of the main subject region detected by the main subject detection unit 210, the motion vector for each block detected by the motion vector detection unit 211, and the distance measurement unit 107. Get the generated distance map. In step S401, the similar region detection unit 302 detects a similar region in which blur / blur similar to the blur / blur generated in the main subject occurs.

類似領域を検出するのは、以下のような理由によるものである。即ち、例えば、主被写体領域の画像に飽和画素が多く含まれている場合には、平坦な領域である可能性が高く、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 region detection unit 302 detects a region where blurring similar to the blurring occurring in the main subject has occurred and the same focal blurring as that occurring in the main subject is occurring. It can be detected as a similar region. Then, the similar region detection unit 302 outputs the detected position and size of the similar region to the second local region extraction unit 304.

ところで、撮像装置からの距離が同等であっても、倍率色収差等の光学特性が著しく異なっている領域を類似領域とした場合には、主被写体領域におけるブレやボケを良好に補正し得るような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 subject detection unit 210 and the luminance signal Y output from the luminance gamma processing unit 207, the first local region extraction unit 303 performs the main subject region. To extract. The first local region extraction unit 303 outputs the extracted luminance signal Y of the main subject region to the first feature amount calculation unit 305 and the region selection unit 308.

ステップS403では、第2の局所領域抽出部304が、類似領域検出部302によって検出された類似領域の位置及びサイズと、輝度ガンマ処理部207から出力された輝度信号Yとに基づいて、類似領域を抽出する。第2の局所領域抽出部304は、抽出した類似領域の輝度信号Yを、第2の特徴量算出部306と領域選択部308とに出力する。   In step S <b> 403, the second local region extraction unit 304 determines the similar region based on the position and size of the similar region detected by the similar region detection unit 302 and the luminance signal Y output from the luminance gamma processing unit 207. To extract. The second local region extraction unit 304 outputs the extracted luminance signal Y of the similar region to the second feature amount calculation unit 306 and the region selection unit 308.

ステップ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 region extraction unit 303 is calculated by the first feature amount calculation unit 305, and the calculated feature amount is sent to the region determination unit 307. Is output. This feature amount is used to determine whether or not the luminance signal Y of the main subject area, that is, the input image is suitable for PSF estimation. The feature amount is calculated based on the edge strength of the input image and the number of saturated pixels in the input image.

ここで、第1の特徴量算出部305について、図5を用いて説明する。図5は、第1の特徴量算出部305の構成を示すブロック図である。なお、第2の特徴量算出部306の構成も、図5に示す第1の特徴量算出部305と同様の構成になっている。   Here, the first feature amount calculation unit 305 will be described with reference to FIG. FIG. 5 is a block diagram illustrating a configuration of the first feature amount calculation unit 305. The configuration of the second feature quantity calculation unit 306 is the same as that of the first feature quantity calculation unit 305 shown in FIG.

第1の特徴量算出部305においては、まず、入力画像における水平方向のエッジ強度と、入力画像における垂直方向のエッジ強度とが求められる。具体的には、水平方向バンドパスフィルタ部501によって入力画像にフィルタ処理が施され、第1の絶対値計算部503によってエッジの強度が算出される。入力画像内の全画素の水平方向におけるエッジ強度に基づいて、水平方向におけるエッジ強度の平均値(エッジ強度平均値)が第1の平均値算出部505によって算出される。また、垂直方向バンドパスフィルタ部502によって入力画像にフィルタ処理が施され、第2の絶対値計算部504によってエッジの強度が算出される。入力画像の全画素の垂直方向におけるエッジ強度に基づいて、垂直方向におけるエッジ強度の平均値が第2の平均値算出部506によって求められる。水平方向におけるエッジ強度平均値と垂直方向におけるエッジ強度平均値とのうちの小さい方が最小値選択部507によって選択され、選択されたエッジ強度平均値の最小値が最小値選択部507から出力される。こうして、エッジ強度に応じた値であるエッジ情報が得られる。入力画像自体にエッジが少ない場合や、水平方向又は垂直方向におけるエッジが少ない場合には、最小値選択部507から出力される信号は小さくなる。   In the first feature quantity calculation unit 305, first, the horizontal edge strength in the input image and the vertical edge strength in the input image are obtained. Specifically, the horizontal band-pass filter unit 501 performs filtering on the input image, and the first absolute value calculation unit 503 calculates the edge strength. Based on the edge strength in the horizontal direction of all pixels in the input image, the average value of edge strength in the horizontal direction (edge strength average value) is calculated by the first average value calculation unit 505. In addition, the vertical band-pass filter unit 502 performs filtering on the input image, and the second absolute value calculation unit 504 calculates the edge strength. Based on the edge strength in the vertical direction of all pixels of the input image, the average value of the edge strength in the vertical direction is obtained by the second average value calculation unit 506. The smaller one of the edge strength average value in the horizontal direction and the edge strength average value in the vertical direction is selected by the minimum value selection unit 507, and the minimum value of the selected edge strength average value is output from the minimum value selection unit 507. The In this way, edge information that is a value corresponding to the edge strength is obtained. When the input image itself has few edges, or when there are few edges in the horizontal or vertical direction, the signal output from the minimum value selection unit 507 is small.

一方、入力画像内における飽和画素の割合、即ち、飽和画素比率が、飽和画素比率検出部508によって算出される。飽和画素か否かは、画素値が所定の閾値を超えるか否かによって判定される。入力画像における飽和画素の割合が100%である場合には、飽和画素比率は1とされ、入力画像における飽和画素の割合が0%である場合には、飽和画素比率は0とされる。従って、飽和画素比率の値域は、0〜1となる。飽和画素比率検出部508によって求められた飽和画素の割合に基づいて、ゲイン算出部(ゲイン設定部)509によってゲインが算出される。ゲインの値域は、0〜1となる。乗算部510が、最小値選択部507から出力される値に、ゲイン算出部509によって算出されたゲインを乗じる。こうして得られた乗算値、即ち、特徴量が、第1の特徴量算出部305から領域決定部307に出力される。   On the other hand, the saturated pixel ratio detection unit 508 calculates the ratio of saturated pixels in the input image, that is, the saturated pixel ratio. Whether or not the pixel is a saturated pixel is determined by whether or not the pixel value exceeds a predetermined threshold value. When the ratio of saturated pixels in the input image is 100%, the saturated pixel ratio is 1, and when the ratio of saturated pixels in the input image is 0%, the saturated pixel ratio is 0. Therefore, the value range of the saturated pixel ratio is 0-1. Based on the saturated pixel ratio obtained by the saturated pixel ratio detection unit 508, a gain is calculated by a gain calculation unit (gain setting unit) 509. The gain range is 0-1. Multiplier 510 multiplies the value output from minimum value selector 507 by the gain calculated by gain calculator 509. The multiplication value thus obtained, that is, the feature amount is output from the first feature amount calculation unit 305 to the region determination unit 307.

なお、水平方向におけるエッジ強度平均値と垂直方向におけるエッジ強度平均値とのうちの大きい方ではなく小さい方を最小値選択部507によって選択するのは、PSFを取得するのに適していない領域の画像がPSFの取得に用いられるのを、より厳格に防止するためである。   Note that the minimum value selection unit 507 selects the smaller one of the average edge strength value in the horizontal direction and the average edge strength value in the vertical direction instead of the larger one in the region that is not suitable for acquiring the PSF. This is to more strictly prevent the image from being used for acquiring the PSF.

図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 gain calculation unit 509. FIG. 6A shows that when the ratio of saturated pixels is 0, the gain is 1, and when the ratio of saturated pixels is 1, the gain is 0. As the ratio of saturated pixels increases, the gain increases linearly. The case where it falls is shown. As the saturated pixel ratio increases, the gain decreases and the feature amount output from the first feature amount calculation unit 305 decreases. If the image of the main subject area is not suitable for PSF estimation, the feature quantity output from the first feature quantity calculation unit 305 is sufficiently small. Is not selected. Therefore, when the image of the main subject area is not suitable for PSF estimation, the image of the main subject area is not used for PSF estimation.

なお、飽和画素の比率とゲインとの関係は、図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 region extraction unit 304 is calculated by the second feature amount calculation unit 306 in the same manner as the first feature amount calculation unit 305. The calculated feature amount is output to the region determination unit 307. As described above, the configuration of the second feature quantity calculation unit 306 is the same as the configuration of the first feature quantity calculation unit 305 described above. Therefore, a detailed description of the second feature amount calculation unit 306 is omitted here.

ステップS406では、第1の特徴量算出部305から出力される主被写体領域の特徴量と、第2の特徴量算出部306から出力される類似領域の特徴量とが、領域決定部307によって比較される。特徴量が大きいほど、PSFの推定に適していると考えられる。従って、領域決定部307は、主被写体領域と類似領域とのうちの特徴量が大きい方の領域をPSFの推定に適した領域と判定し、当該領域をPSFの推定に用いられる領域として決定する。領域決定部307は、PSFの推定に用いられる領域、即ち、主被写体領域と類似領域とのうちの特徴が大きい方の領域を示す情報を、領域選択部308に出力する。   In step S <b> 406, the region determination unit 307 compares the feature amount of the main subject region output from the first feature amount calculation unit 305 with the feature amount of the similar region output from the second feature amount calculation unit 306. Is done. It can be considered that the larger the feature amount, the better the PSF estimation. Therefore, the region determination unit 307 determines a region having a larger feature amount of the main subject region and the similar region as a region suitable for PSF estimation, and determines the region as a region used for PSF estimation. . The region determination unit 307 outputs information indicating a region used for PSF estimation, that is, a region having a larger feature of the main subject region and the similar region to the region selection unit 308.

ステップS407では、領域選択部308が、領域決定部307によって決定された領域の輝度信号を選択し、選択した輝度信号をPSF推定部(点拡がり関数推定部)309に出力する。即ち、主被写体領域の特徴量が類似領域の特徴量よりも大きい場合には、第1の局所領域抽出部303によって抽出された主被写体領域の輝度信号が領域選択部308によって選択され、かかる主被写体領域の輝度信号がPSF推定部309に出力される。一方、類似領域の特徴量が主被写体領域の特徴量よりも大きい場合には、第2の局所領域抽出部304によって抽出された類似領域の輝度信号が領域選択部308によって選択され、かかる類似領域の輝度信号がPSF推定部309に出力される。   In step S407, the region selection unit 308 selects the luminance signal of the region determined by the region determination unit 307, and outputs the selected luminance signal to the PSF estimation unit (point spread function estimation unit) 309. That is, when the feature amount of the main subject region is larger than the feature amount of the similar region, the luminance signal of the main subject region extracted by the first local region extraction unit 303 is selected by the region selection unit 308, and the main subject region is extracted. The luminance signal of the subject area is output to the PSF estimation unit 309. On the other hand, when the feature amount of the similar region is larger than the feature amount of the main subject region, the luminance signal of the similar region extracted by the second local region extraction unit 304 is selected by the region selection unit 308, and the similar region Are output to the PSF estimation unit 309.

ステップS408では、PSF推定部309が、領域選択部308から出力された輝度信号に基づいて、PSFを推定する。PSFは、例えば公知の方法によって推定することができる。公知のPSF推定手法について以下に説明する。PSF推定部309に入力される画像をM、PSFをK、ブレやボケのない画像である潜像をLとすると、以下のような式(1)が成立する。
M=K*L ・・・(1)
なお、*は、畳み込み演算を表す記号である。
In step S408, the PSF estimation unit 309 estimates the PSF based on the luminance signal output from the region selection unit 308. The PSF can be estimated by a known method, for example. A known PSF estimation method will be described below. When an image input to the PSF estimation unit 309 is M, a PSF is K, and a latent image that is an image without blurring or blurring is L, the following equation (1) is established.
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ノルム等が挙げられる。

Figure 2017108243
Figure 2017108243
式(2)、(3)に示すエネルギー関数を最小化する手法としては、例えば共役勾配法が挙げられる。こうして、PSFを推定することが可能である。 The PSF and the latent image can be estimated by minimizing an energy function including a term representing a difference between both sides of the equation (1). Such an energy function is represented by the following equations (2) and (3), for example. In equations (2) and (3), σ represents a regularization term. Examples of the regularization term σ include an L2 norm that is a sum of squares of elements when an image or PSF is handled as a vector.
Figure 2017108243
Figure 2017108243
As a method for minimizing the energy function shown in the equations (2) and (3), for example, a conjugate gradient method can be cited. In this way, it is possible to estimate the PSF.

ところで、画像のエッジ情報を用いると高精度にPSFを推定し得ることが知られている(非特許文献2)。そこで、本実施形態では、入力画像Mのエッジ情報M′と潜像Lのエッジ情報L’とを用いた式(4)のようなエネルギー関数を最小化することによって、PSFを推定する。

Figure 2017108243
By the way, it is known that PSF can be estimated with high accuracy by using edge information of an image (Non-Patent Document 2). Therefore, in this embodiment, the PSF is estimated by minimizing an energy function such as Expression (4) using the edge information M ′ of the input image M and the edge information L ′ of the latent image L.
Figure 2017108243

最初に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 signal conversion unit 301 converts the color difference signals RY and BY and the luminance signal Y input to the blur / blur correction unit 209 into color signals R, G, and B. Color signals R, G, and B are output to the correction processing unit 310.

ステップS410では、補正処理部310が、PSF推定部309から出力されるPSFを用いて、色信号R,G,Bのそれぞれに対してブレ・ボケ補正処理を行う。例えば、デコンボリューション法、より具体的には、ウィナーデコンボリューション法によって、以下のようにしてブレ・ボケ補正処理を行うことが可能である。即ち、PSF推定部309によって推定されたPSFをKとし、撮影された画像をMとし、潜像をLとすると、以下のような式(5)が成立する。

Figure 2017108243
ここで、Fはフーリエ変換、F−1は逆フーリエ変換、 ̄は共役な複素数、λはブレやボケのない画像に含まれるノイズ成分の比率(S/N)である。 In step S410, the correction processing unit 310 performs blur / blur correction processing on each of the color signals R, G, and B using the PSF output from the PSF estimation unit 309. For example, the blur / blur correction process can be performed by the deconvolution method, more specifically, the winner deconvolution method as follows. That is, when the PSF estimated by the PSF estimation unit 309 is K, the captured image is M, and the latent image is L, the following equation (5) is established.
Figure 2017108243
Here, F is a Fourier transform, F −1 is an inverse Fourier transform,  ̄ is a conjugate complex number, and λ is a ratio (S / N) of a noise component included in an image free from blur or blur.

なお、ブレ・ボケ補正処理を行う際に用いられる手法は、デコンボリューション法に限定されるものではない。例えば、逆フィルタを用いてブレ・ボケ補正処理を行うようにしてもよい。かかる逆フィルタは、以下のような式(6)によって表される。

Figure 2017108243
Note that the method used when performing the blur / blur correction process is not limited to the deconvolution method. For example, blur / blur correction processing may be performed using an inverse filter. Such an inverse filter is represented by the following equation (6).
Figure 2017108243

また、ブレ・ボケ補正処理を行う際に用いられる手法はこれらに限定されるものではない。例えば、推定された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 correction processing unit 310 as described above are output to the luminance / color difference signal generation unit 311. The luminance / color difference signal generation unit 311 generates a luminance signal Y and color difference signals RY and RB, and outputs the generated luminance signal Y and color difference signals RY and RB. The luminance signal Y and the color difference signals RY and RB output from the blur / blur correction unit 209 are recorded in the recording unit 105.

このように、本実施形態によれば、主被写体の領域の画像が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 / blur correction unit 209 of the image processing apparatus 111 according to the present embodiment. In the present embodiment, the region determination unit 307, the region selection unit 308, and the PSF estimation unit 309 described above in the first embodiment with reference to FIG. 3 are not provided in the blur / blur correction unit 209. On the other hand, in the present embodiment, a first PSF estimation unit 701, a second PSF estimation unit 702, a synthesis ratio determination unit 703, and a synthesis unit 704 are provided in the blur / blur correction unit 209.

図8は、本実施形態による画像処理装置111において行われるブレ・ボケ補正処理を示すフローチャートである。   FIG. 8 is a flowchart showing a blur / blur correction process performed in the image processing apparatus 111 according to the present embodiment.

まず、ステップ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 PSF estimation unit 701 estimates the PSF (first PSF) from the image information of the main subject region extracted by the first local region extraction unit 303, and combines the estimated PSF with the synthesis unit 704. Output to.

ステップS807では、第2のPSF推定部702が、第2の局所領域抽出部304によって抽出された類似領域の画像情報からPSF(第2のPSF)を推定し、推定したPSFを合成部704に出力する。   In step S807, the second PSF estimation unit 702 estimates the PSF (second PSF) from the image information of the similar region extracted by the second local region extraction unit 304, and sends the estimated PSF to the synthesis unit 704. Output.

ステップ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 ratio determination unit 703 converts the main subject feature amount a <b> 1 output from the first feature amount calculation unit 305 and the similar region feature amount a <b> 2 output from the second feature amount calculation unit 306. Based on this, the composition ratio m is determined. Such a synthesis ratio m is obtained by the following equation (7), for example. The composition ratio determination unit 703 outputs the determined composition ratio m to the composition unit 704. Note that the range of the composition ratio m is 0 to 1.
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 PSF estimation unit 701 and the PSF estimated by the second PSF estimation unit 702 are combined based on the combination ratio m determined by the combination ratio determination unit 703. Unit 704 synthesizes. Since the PSF is expressed by a two-dimensional array, the elements of the PSF are synthesized based on the synthesis ratio m. First, the center of the first PSF and the center of the second PSF are aligned, and the area where the first PSF and the second PSF overlap is defined as the size (N × M) of the combined PSF. Determine. Assuming that the combined PSF is Km (i, j), the first PSF is K1 (i, j), and the second PSF is K2 (i, j), the combined PSF is expressed by the following formula ( 8). Note that (i, j) indicates coordinates.
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 correction processing unit 310 performs correction processing on each of the color signals R, G, and B output from the RGB signal conversion unit 301 based on the PSF combined by the combining unit 704. The correction processing unit 310 outputs the color signals R, G, and B subjected to the correction processing to the luminance / color difference signal generation unit 311. The luminance / color difference signal generation unit 311 generates the color difference signals RY, BY and the luminance signal Y based on the color signals R, G, B, and outputs these generated signals.

このように、本実施形態によれば、主被写体領域から推定された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 amount calculation unit 305 and the second feature amount calculation unit 306 is not limited to the calculation processing as described above in the embodiment. That is, in the above embodiment, the feature amount is calculated based on the edge strength in the two directions of the horizontal direction and the vertical direction and the ratio of the saturated pixels, but the present invention is not limited to this. For example, the feature amount may be calculated based on the edge strength in four directions and the ratio of saturated pixels. Examples of the four directions include a horizontal direction, a vertical direction, an oblique 45 degree direction, and an oblique 135 degree direction.

また、上記実施形態では、特徴量の算出に用いられるエッジ情報がエッジ強度そのものである場合を例に説明したが、特徴量の算出に用いられるエッジ情報はエッジ強度そのものに限定されるものではない。エッジ強度に応じた値を、特徴量の算出に用いられるエッジ情報として適宜用いることができる。例えば、エッジ強度の平均値を複数の方向においてそれぞれ算出し、当該平均値が所定の閾値以上となるような方向の数を算出し、算出された方向の数に基づいて特徴量を算出してもよい。即ち、特徴量の算出に用いられるエッジ情報は、エッジ強度に基づく値がそれぞれ算出される複数の方向のうちの、エッジ強度に基づく値が所定の閾値以上となる方向の数であってもよい。この場合には、上記のようにして算出されたエッジ情報に、飽和画素の比率に応じたゲインを乗算することによって、特徴量が算出される。また、エッジ強度の平均値を複数の方向においてそれぞれ算出し、算出されたエッジ強度平均値の分散値に基づいて特徴量を算出してもよい。また、エッジ方向に依存せずにエッジ強度を取得し得る手段を用いて算出されたエッジ情報に基づいて、特徴量を算出してもよい。エッジ方向に依存せずにエッジ強度を取得し得る手段としては、例えばラプラシアンフィルタ等が挙げられる。こうして得られたエッジ情報に、飽和画素の比率に応じたゲインを乗算することによって、特徴量が算出される。   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... Image processing device 308... Area selection unit 309... PSF estimation unit

Claims (17)

画像から第1の領域を検出する第1の領域検出部と、
前記第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の領域を検出する第1の領域検出部と、
前記第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の領域は、主たる被写体の領域である主被写体領域である
ことを特徴とする請求項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.
前記第2の領域検出部は、像高に基づいて前記第2の領域を検出する
ことを特徴とする請求項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の領域におけるエッジ情報に基づいて前記第1の領域における前記特徴量を算出し、前記第2の領域におけるエッジ情報に基づいて前記第2の領域における前記特徴量を算出する
ことを特徴とする請求項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の領域における飽和画素の割合に更に基づいて前記第1の領域における前記特徴量を算出し、前記第2の領域における飽和画素の割合に更に基づいて前記第2の領域における前記特徴量を算出する
ことを特徴とする請求項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の領域と前記第2の領域とのうちから選択する
ことを特徴とする請求項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の領域における前記特徴量が所定の閾値以上である場合には、前記領域選択部は、前記第2の領域の前記特徴量の如何に拘わらず、前記第1の領域を選択する
ことを特徴とする請求項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.
前記第1の点拡がり関数に基づく補正手段は、前記第1の点拡がり関数に基づいて生成される第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の領域を検出するステップと、
前記第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の領域を検出するステップと、
前記第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.
JP2015239393A 2015-12-08 2015-12-08 Image processing device and image processing method Pending JP2017108243A (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021059990A1 (en) * 2019-09-26 2021-04-01 株式会社日立国際電気 Image capturing device and image capturing method

Cited By (3)

* Cited by examiner, † Cited by third party
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