JP2017010092A - Image processing apparatus, imaging device, image processing method, image processing program, and recording medium - Google Patents

Image processing apparatus, imaging device, image processing method, image processing program, and recording medium Download PDF

Info

Publication number
JP2017010092A
JP2017010092A JP2015121677A JP2015121677A JP2017010092A JP 2017010092 A JP2017010092 A JP 2017010092A JP 2015121677 A JP2015121677 A JP 2015121677A JP 2015121677 A JP2015121677 A JP 2015121677A JP 2017010092 A JP2017010092 A JP 2017010092A
Authority
JP
Japan
Prior art keywords
blur
estimation
image
signal
blur estimation
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
JP2015121677A
Other languages
Japanese (ja)
Inventor
法人 日浅
Norito Hiasa
法人 日浅
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 JP2015121677A priority Critical patent/JP2017010092A/en
Priority to US15/177,451 priority patent/US10002411B2/en
Publication of JP2017010092A publication Critical patent/JP2017010092A/en
Pending legal-status Critical Current

Links

Classifications

    • G06T5/73
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/207Analysis of motion for motion estimation over a hierarchy of resolutions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20201Motion blur correction

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus that, when estimating blur from an area where the amount of change in signal in a blur image is small, can suppress a reduction in estimation accuracy.SOLUTION: An image processing apparatus comprises acquisition means that acquires a blur image and creation means that acquires at least part of a first blur estimation area in the blur image and creates estimated blur. The creation means creates the estimated blur by performing repeated arithmetic processing of repeating correction processing of determining a second blur estimation area on the basis of the amount of change in signal in the first blur estimation area and correcting blur included in information on a signal in the second blur estimation area to create information on a correction signal, and estimation processing of estimating blur on the basis of information on the signal and information on the correction signal.SELECTED DRAWING: Figure 1

Description

本発明は、単一のぼけ画像から、ぼけ画像に作用している劣化成分であるぼけを推定する画像処理方法に関する。   The present invention relates to an image processing method for estimating blur, which is a degradation component acting on a blurred image, from a single blurred image.

近年、表示装置の高精細化に伴い、撮影画像の高画質化が望まれている。撮影画像においては、撮影に用いられる光学系の収差や回折、または、撮影時の手ぶれなどの劣化要因により、被写体空間の情報が失われている。このため従来から、これらの要因に基づく撮影画像の劣化を補正し、より高画質な画像を得る手法が提案されている。そのような手法として、例えば、WienerフィルタやRichardson−Lucy法などが挙げられる。しかし、これらの手法では、画像に作用している劣化成分(ぼけ)が既知でない場合、高い補正効果を得ることができない。   In recent years, with higher definition of display devices, higher quality of captured images is desired. In the photographed image, information on the subject space is lost due to deterioration factors such as aberration and diffraction of an optical system used for photographing or camera shake during photographing. For this reason, conventionally, a method has been proposed in which deterioration of a captured image based on these factors is corrected to obtain a higher quality image. Examples of such a method include a Wiener filter and a Richardson-Lucy method. However, with these methods, when the deterioration component (blur) acting on the image is not known, a high correction effect cannot be obtained.

一方、従来から、手ぶれにより劣化した一枚の画像から手ぶれ成分を推定する手法が提案されている。特許文献1には、手ぶれにより劣化した一枚の画像から、既知である自然画像の強度勾配分布に関する統計情報を用いることにより、手ぶれ成分を推定する手法が開示されている。ここで自然画像とは、近代の人間が生活する上で自然と目にするような画像という意味である。このため自然画像は、樹木や動物などが写った画像に限定されるものではなく、人間、建築物、電子機器などが写った画像も含まれる。自然画像の性質として、信号の強度勾配に関するヒストグラム(強度勾配ヒストグラム)は、勾配の強さに応じて裾の重い分布(Heavy Tailed Distribution)に従うことが知られている。特許文献1には、手ぶれが補正された画像の強度勾配ヒストグラムが、裾の重い分布に従うように制約をかけることにより、手ぶれ画像のみから手ぶれ補正画像を推定する手法が開示されている。そして、その手ぶれ補正画像と手ぶれ画像との比較結果に基づいて、ぶれ成分が推定される。このときのぶれ成分の推定精度は、手ぶれ画像内にエッジが多く含まれているほど上昇する。   On the other hand, conventionally, a method for estimating a camera shake component from one image deteriorated due to camera shake has been proposed. Patent Document 1 discloses a method for estimating a camera shake component by using statistical information related to a known intensity gradient distribution of a natural image from a single image deteriorated by camera shake. Here, the natural image means an image that is seen naturally by a modern human being. For this reason, the natural image is not limited to an image showing a tree or an animal, but includes an image showing a person, a building, an electronic device, or the like. As a nature of a natural image, it is known that a histogram related to the intensity gradient of a signal (intensity gradient histogram) follows a heavy tailed distribution according to the intensity of the gradient. Patent Document 1 discloses a method for estimating a camera shake correction image from only a camera shake image by constraining the intensity gradient histogram of the image with the camera shake corrected to follow a heavy distribution. Then, a shake component is estimated based on a comparison result between the camera shake correction image and the camera shake image. At this time, the blur component estimation accuracy increases as more edges are included in the hand shake image.

米国特許第7616826号明細書U.S. Pat. No. 7,616,826

しかしながら、ぼけ画像内のエッジ量は、写っている被写体の構造に依存する。このため、常に推定に充分なエッジ量が画像内に存在しているとは限らない。特に、画像内の領域に応じてぼけの形状が変化する(Shift−variantと呼ばれる)場合、ぼけ画像内の特定の部分領域のみを用いてぼけの推定を行う必要があるため、エッジ量が不足しやすい。エッジやテクスチャなどの信号変化が少ない領域においては、ぼけの推定精度が極端に低下する。このような領域に対して特許文献1の推定手法を用いると、推定された手ぶれ成分には大きな誤差が生じる。これは、手ぶれ以外の回折、収差、デフォーカス、または、擾乱(これらの劣化要因を総称して、「ぼけ」と呼ぶ)においても同様である。   However, the amount of edges in the blurred image depends on the structure of the subject being photographed. For this reason, there is not always an edge amount sufficient for estimation in the image. In particular, when the blur shape changes according to the area in the image (referred to as shift-variant), it is necessary to estimate the blur using only a specific partial area in the blurred image, so the edge amount is insufficient. It's easy to do. In regions where there are few signal changes such as edges and textures, the blur estimation accuracy is extremely reduced. When the estimation method of Patent Document 1 is used for such a region, a large error occurs in the estimated camera shake component. The same applies to diffraction, aberration, defocus, or disturbance (generally referred to as “blur” of these deterioration factors) other than camera shake.

そこで本発明は、ぼけ画像における信号変化が少ない領域からぼけを推定する際、推定精度の低下を抑制可能な画像処理装置、撮像装置、画像処理方法、画像処理プログラム、および、記憶媒体を提供する。   Therefore, the present invention provides an image processing device, an imaging device, an image processing method, an image processing program, and a storage medium that can suppress a decrease in estimation accuracy when blur is estimated from an area where there is little signal change in a blurred image. .

本発明の一側面としての画像処理装置は、ぼけ画像を取得する取得手段と、前記ぼけ画像における少なくとも一部の第1のぼけ推定領域を取得し、推定ぼけを生成する生成手段とを有し、前記生成手段は、前記第1のぼけ推定領域における信号変化の量に基づいて、第2のぼけ推定領域を決定し、前記第2のぼけ推定領域における信号に関する情報に含まれるぼけを補正して補正信号に関する情報を生成する補正処理と、該信号に関する情報と該補正信号に関する情報とに基づいてぼけを推定する推定処理と、を反復する反復演算処理を行って前記推定ぼけを生成する。   An image processing apparatus according to one aspect of the present invention includes an acquisition unit that acquires a blur image, and a generation unit that acquires at least a part of a first blur estimation region in the blur image and generates an estimated blur. The generation means determines a second blur estimation area based on the amount of signal change in the first blur estimation area, and corrects blur included in the information regarding the signal in the second blur estimation area. The estimation blur is generated by performing an iterative calculation process that repeats a correction process for generating information on the correction signal and an estimation process for estimating the blur based on the information on the signal and the information on the correction signal.

本発明の他の側面としての撮像装置は、光学系を介して形成された光学像を光電変換して画像信号を出力する撮像素子と、前記画像信号に基づいてぼけ画像を取得する取得手段と、前記ぼけ画像における少なくとも一部の第1のぼけ推定領域を取得し、推定ぼけを生成する生成手段とを有し、前記生成手段は、前記第1のぼけ推定領域における信号変化の量に基づいて、第2のぼけ推定領域を決定し、前記第2のぼけ推定領域における信号に関する情報に含まれるぼけを補正して補正信号に関する情報を生成する補正処理と、該信号に関する情報と該補正信号に関する情報とに基づいてぼけを推定する推定処理と、を反復する反復演算処理を行って前記推定ぼけを生成する。   An imaging apparatus according to another aspect of the present invention includes an imaging element that photoelectrically converts an optical image formed via an optical system and outputs an image signal, and an acquisition unit that acquires a blurred image based on the image signal. Generating at least a part of the first blur estimation area in the blurred image and generating an estimated blur, wherein the generation means is based on the amount of signal change in the first blur estimation area. Correction processing for determining a second blur estimation area, correcting blur included in the information regarding the signal in the second blur estimation area to generate information regarding the correction signal, information regarding the signal, and the correction signal The estimated blur is generated by performing an iterative calculation process that repeats the estimation process for estimating the blur based on the information on the information.

本発明の他の側面としての画像処理方法は、ぼけ画像を取得するステップと、前記ぼけ画像における少なくとも一部の第1のぼけ推定領域を取得し、推定ぼけを生成するステップとを有し、前記推定ぼけを生成するステップにおいて、前記第1のぼけ推定領域における信号変化の量に基づいて、第2のぼけ推定領域を決定し、前記第2のぼけ推定領域における信号に関する情報に含まれるぼけを補正して補正信号に関する情報を生成する補正処理と、該信号に関する情報と該補正信号に関する情報とに基づいてぼけを推定する推定処理と、を反復する反復演算処理を行って前記推定ぼけを生成する。   An image processing method according to another aspect of the present invention includes a step of acquiring a blur image, and acquiring at least a part of a first blur estimation region in the blur image and generating an estimated blur. In the step of generating the estimated blur, a second blur estimation area is determined based on an amount of signal change in the first blur estimation area, and the blur included in the information regarding the signal in the second blur estimation area is determined. The estimation blur is performed by performing an iterative calculation process that repeats the correction process for generating the information related to the correction signal by correcting the correction and the estimation process for estimating the blur based on the information related to the signal and the information related to the correction signal. Generate.

本発明の他の側面としてのプログラムは、コンピュータに、前記画像処理方法を実行させるように構成されている。   A program according to another aspect of the present invention is configured to cause a computer to execute the image processing method.

本発明の他の側面としての記憶媒体は、前記プログラムを記憶している。   A storage medium according to another aspect of the present invention stores the program.

本発明の他の目的及び特徴は、以下の実施例において説明される。   Other objects and features of the present invention are illustrated in the following examples.

本発明によれば、ぼけ画像における信号変化が少ない領域からぼけを推定する際、推定精度の低下を抑制可能な画像処理装置、撮像装置、画像処理方法、画像処理プログラム、および、記憶媒体を提供することができる。 According to the present invention, it is possible to provide an image processing device, an imaging device, an image processing method, an image processing program, and a storage medium that can suppress a decrease in estimation accuracy when blur is estimated from an area where a signal change in a blurred image is small. can do.

実施例1、3における画像処理方法を示すフローチャートである。6 is a flowchart illustrating an image processing method according to the first and third embodiments. 実施例1における画像処理システムのブロック図である。1 is a block diagram of an image processing system in Embodiment 1. FIG. 実施例1、2における画像処理システムの外観図である。1 is an external view of an image processing system in Embodiments 1 and 2. FIG. 実施例1、3における推定ぼけの生成方法を示すフローチャートである。6 is a flowchart illustrating a method for generating estimated blur in the first and third embodiments. 実施例1〜3において、第1のぼけ推定領域と第2のぼけ推定領域との関係を示す図である。In Examples 1-3, it is a figure which shows the relationship between a 1st blur estimation area | region and a 2nd blur estimation area | region. 実施例1〜3において、デフォーカスを推定する際の第1のぼけ推定領域と第2のぼけ推定領域との関係を示す図である。In Examples 1-3, it is a figure which shows the relationship between the 1st blur estimation area | region at the time of estimating a defocus, and a 2nd blur estimation area | region. 実施例2における画像処理システムのブロック図である。6 is a block diagram of an image processing system in Embodiment 2. FIG. 実施例2における画像処理方法を示すフローチャートである。10 is a flowchart illustrating an image processing method according to the second exemplary embodiment. 実施例3における撮像システムのブロック図である。FIG. 6 is a block diagram of an imaging system in Embodiment 3. 実施例3における撮像システムの外観図である。FIG. 6 is an external view of an imaging system in Embodiment 3.

以下、本発明の実施例について、図面を参照しながら詳細に説明する。各図において、同一の部材については同一の参照符号を付し、重複する説明は省略する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In each figure, the same members are denoted by the same reference numerals, and redundant description is omitted.

本実施形態において、被写体空間の情報を劣化させる要因を「ぼけ」と総称するが、ぼけの要因としては、回折、収差、デフォーカス、ぶれ、および、擾乱が含まれる。本実施形態を説明する前に、これらのぼけの要因について詳述する。   In the present embodiment, the factors that degrade the information of the subject space are collectively referred to as “blur”, but the factors of blur include diffraction, aberration, defocus, blurring, and disturbance. Before describing the present embodiment, these blurring factors will be described in detail.

回折とは、画像を撮影した撮像装置の光学系で発生する、回折に起因する劣化である。これは、光学系の開口径が有限であるために生じる。   Diffraction is degradation caused by diffraction, which occurs in the optical system of the imaging device that captured the image. This occurs because the aperture diameter of the optical system is finite.

収差とは、光学系で発生する理想波面からのずれに起因する劣化である。光学系の設計値により発生する収差を設計収差、光学系の製造誤差や環境変化により発生する収差を誤差収差と呼ぶ。環境変化とは、温度、湿度、気圧などの変化を示し、これらの変化に応じて光学系の性能も変化する。単に収差という場合、設計収差および誤差収差の両方が含まれる。   Aberration is deterioration caused by deviation from an ideal wavefront generated in an optical system. Aberrations that occur due to design values of the optical system are called design aberrations, and aberrations that occur due to optical system manufacturing errors and environmental changes are called error aberrations. The environmental change indicates changes in temperature, humidity, atmospheric pressure, etc., and the performance of the optical system also changes in accordance with these changes. When referring simply to aberrations, both design aberrations and error aberrations are included.

デフォーカスとは、光学系の焦点と被写体とが合致しないことに起因する劣化である。デフォーカスが画像の全体に及ぶものをピントずれ、デフォーカスが画像の一部のみであるものをデフォーカスぼけと呼ぶ。具体的は、デフォーカスぼけとは、画像内に異なる距離の主要被写体と背景とが存在し、主要被写体に合焦していた場合において、背景の情報を劣化させている成分をいう。この劣化の大きさは、背景がどれだけ主要被写体から奥行き方向に離れているかに依存して変化する。デフォーカスぼけは、例えば、画像内の主要被写体を際立たせる表現方法として用いられる。単にデフォーカスという場合、ピントずれとデフォーカスぼけとの両方が含まれる。   Defocus is deterioration caused by the fact that the focus of the optical system and the subject do not match. A case where defocusing extends over the entire image is called out-of-focus, and a case where defocusing is only part of the image is called defocusing blur. Specifically, defocus blur refers to a component that degrades background information when the main subject and background at different distances exist in the image and the main subject is in focus. The magnitude of this degradation varies depending on how far the background is from the main subject in the depth direction. Defocus blur is used, for example, as an expression method that makes a main subject in an image stand out. In the case of simply defocusing, both defocusing and defocus blur are included.

ぶれとは、撮影の際、露光中に被写体と撮像装置との間の相対関係(位置および角度)が変化することにより生じる劣化である。ぶれのうち、画像の全体を劣化させるものを手ぶれ、画像の一部が劣化するものを被写体ぶれと呼ぶ。単にぶれという場合、手ぶれおよび被写体ぶれの両方が含まれる。   The blur is deterioration caused by a change in the relative relationship (position and angle) between the subject and the imaging apparatus during exposure during shooting. Among the blurs, those that degrade the entire image are called camera shakes, and those that partially degrade the image are called subject blurs. In the case of simply blurring, both camera shake and subject blur are included.

擾乱とは、撮影中に被写体と撮像装置との間に存在する物質が揺らぐことにより生じる劣化である。例えば、大気の揺らぎや水中撮影における水の揺らぎが挙げられる。短秒露光中に擾乱が発生している場合、ぼけ画像では被写体空間の直線が揺らめいた曲線になる。この曲がりを補正するため、擾乱成分の異なる複数のフレーム(または連写)画像を合成することがある。しかし、このような合成処理では、エッジの曲がりを補正することができても、周波数成分の劣化は残存する。ここで取り扱うぼけ画像は、1回の露光中に擾乱に伴う周波数成分の劣化が起きた画像(長秒露光画像)だけでなく、前述のような複数フレーム(または連写)の画像を合成した画像を含む。   Disturbance is deterioration caused by fluctuation of a substance existing between a subject and an imaging device during photographing. For example, atmospheric fluctuations and water fluctuations in underwater photography can be mentioned. When disturbance occurs during short-second exposure, the straight line in the subject space becomes a curved curve in the blurred image. In order to correct this bending, a plurality of frame (or continuous shooting) images having different disturbance components may be synthesized. However, in such a synthesis process, even if the edge curvature can be corrected, the deterioration of the frequency component remains. The blurred image handled here is not only an image (long-second exposure image) in which the degradation of the frequency component due to the disturbance occurred during one exposure, but also a composite of multiple frames (or continuous shots) as described above. Includes images.

本実施形態において、点像強度分布はPSF(Point Spread Function)と記す。また本実施形態において、1次元(モノクロ)画像に対する処理について説明するが、多次元(例えばRGB)画像にも同様に適用可能であり、RGBの各チャンネルで処理を行えばよい。チャンネル間における差がない、または無視できる程度のぼけでは、チャンネル数を減らして(RGBをモノクロ化するなど)、処理しても構わない。各チャンネルが異なる波長を取得している場合、チャンネル間における差がないぼけとしては、ぶれが挙げられる。   In the present embodiment, the point image intensity distribution is referred to as PSF (Point Spread Function). In this embodiment, processing for a one-dimensional (monochrome) image will be described. However, the present invention can be similarly applied to a multi-dimensional (for example, RGB) image, and processing may be performed for each of RGB channels. If there is no difference between channels or the blur is negligible, the number of channels may be reduced (eg, RGB is converted into monochrome) and processed. When each channel acquires a different wavelength, blurring is an example of a blur that has no difference between channels.

一方、収差、回折、デフォーカス、および、擾乱は、波長に依存してぼけが変化する。ここでデフォーカスは、ピント位置から大きく離れていても、軸上色収差の影響で波長によってぼけの広がりが変わる。しかし、これらの波長依存性を有するぼけに対しても、撮影に用いる撮像素子のサンプリング周波数に対して、チャンネル間の性能差が充分に小さければ、チャンネル間の差が無視できると考えてよい。ただし、これらチャンネル間における差が無視できるぼけを推定する場合、前述のチャンネル数を減らす処理を行うよりも、複数のチャンネルのままで1つのぼけを推定することが望ましい。ぼけの推定は、画像の信号勾配に関する情報を用いて行うため、その情報が多いほど推定精度が向上する。すなわち、チャンネル数を減らさずに複数の画像で推定したほうが、信号勾配の情報が増加する(ただし、各チャンネルの画像がそれぞれの比例倍に一致する場合、信号勾配の情報は増加しない)ため、ぼけをより高精度に推定することができる。また本実施形態では、チャンネルが異なる波長を撮影する例を挙げているが、それ以外のパラメータ(偏光など)でも同様に考えればよい。   On the other hand, the aberration, diffraction, defocus, and disturbance change in blur depending on the wavelength. Here, even when the defocus is far away from the focus position, the spread of blur varies depending on the wavelength due to the influence of axial chromatic aberration. However, even for these blurs having wavelength dependency, if the performance difference between channels is sufficiently small with respect to the sampling frequency of the image sensor used for imaging, it may be considered that the difference between channels can be ignored. However, when estimating blur where the difference between these channels can be ignored, it is preferable to estimate one blur with a plurality of channels, rather than performing the above-described process of reducing the number of channels. Since blur estimation is performed using information related to the signal gradient of the image, the estimation accuracy improves as the information increases. In other words, signal gradient information increases when estimating with multiple images without reducing the number of channels (however, if the images of each channel match their proportional multiples, the signal gradient information does not increase) The blur can be estimated with higher accuracy. In the present embodiment, an example in which wavelengths with different channels are photographed is given, but other parameters (polarized light, etc.) may be considered in the same manner.

ここで、具体的な実施例を説明する前に、本実施形態の簡単な概要について説明する。ぼけ推定の際には、ぼけ画像からぼけを推定するためのぼけ推定領域を取得し、ぼけ推定領域内の信号勾配と、信号勾配のぼけが補正された補正信号勾配とを比較することにより、推定ぼけを生成する。このとき、ぼけ推定領域内に信号変化(エッジやテクスチャなど)の量(信号変化量)が少ないと、推定ぼけの推定精度が低下してしまう。そこでまず、ぼけ画像から第1のぼけ推定領域を取得し、第1のぼけ推定領域内に含まれる信号変化の量に着目する。この信号変化量が少ない場合、推定精度が低下してしまうため、第1のぼけ推定領域よりも信号変化量が多い第2のぼけ推定領域を取得する。第1のぼけ推定領域と第2のぼけ推定領域は、位置と形状の少なくとも一方が互いに異なる。信号変化量が多い第2のぼけ推定領域をぼけ推定に用いることにより、ぼけの推定精度を向上させることができる。   Here, before describing specific examples, a brief overview of the present embodiment will be described. At the time of blur estimation, a blur estimation area for estimating blur from a blur image is obtained, and by comparing a signal gradient in the blur estimation area with a corrected signal gradient in which the blur of the signal gradient is corrected, Generate an estimated blur. At this time, if the amount of signal change (edge, texture, etc.) (signal change amount) in the blur estimation region is small, the estimation accuracy of the estimated blur is lowered. Therefore, first, the first blur estimation area is acquired from the blur image, and attention is paid to the amount of signal change included in the first blur estimation area. When the amount of signal change is small, the estimation accuracy decreases, and therefore, a second blur estimation area having a larger signal change amount than the first blur estimation area is acquired. The first blur estimation area and the second blur estimation area are different from each other in at least one of position and shape. By using the second blur estimation region having a large amount of signal change for blur estimation, it is possible to improve blur estimation accuracy.

ここで、ぼけがぼけ画像における位置に応じて変化する場合(Shift−variantの場合)、ぼけ推定に用いる領域を変化させたことにより、推定ぼけは、第1のぼけ推定領域における本来のぼけとは異なる。Shift−variantなぼけとしては、ヴィネッティングが無視できない場合の回折、収差、デフォーカス、回転または深度方向の位置変化を伴うぶれ、および、擾乱がある。しかし、このようなShift−variantなぼけの殆どは、ぼけ画像上の位置変化に対して連続的にぼけが変化するという性質がある。このため、第2のぼけ推定領域が第1のぼけ推定領域と近い場合、推定ぼけに関しては大きな差異は生じない。この差異は、信号変化量が不足している場合に発生する推定誤差に比べて小さいため、第2のぼけ推定領域を用いることにより、結果的に推定ぼけの誤差は低減される。   Here, when the blur changes according to the position in the blur image (in the case of Shift-variant), the estimated blur is the same as the original blur in the first blur estimation region by changing the region used for blur estimation. Is different. Shift-variant blur includes diffraction, aberration, defocus, blurring with rotation or position change in the depth direction, and disturbance when vignetting cannot be ignored. However, most of the shift-variant blur has a property that the blur continuously changes with respect to the position change on the blur image. For this reason, when the second blur estimation area is close to the first blur estimation area, there is no significant difference regarding the estimated blur. Since this difference is smaller than the estimation error that occurs when the signal change amount is insufficient, the error of the estimation blur is reduced as a result by using the second blur estimation region.

なお、仮に第1のぼけ推定領域における信号変化量がぼけ推定に充分である場合、第1のぼけ推定領域をそのまま第2の推定領域として設定すればよい。このため、第2のぼけ推定領域における信号変化量は、常に第1のぼけ推定領域における信号変化量よりも大きいか、または等しい。   If the signal change amount in the first blur estimation area is sufficient for blur estimation, the first blur estimation area may be set as the second estimation area as it is. For this reason, the signal change amount in the second blur estimation region is always greater than or equal to the signal change amount in the first blur estimation region.

まず、図2および図3を参照して、本発明の実施例1における画像処理システムについて説明する。図2は、本実施例における画像処理システム100のブロック図である。図3は、画像処理システム100の外観図である。   First, the image processing system according to the first embodiment of the present invention will be described with reference to FIGS. FIG. 2 is a block diagram of the image processing system 100 in the present embodiment. FIG. 3 is an external view of the image processing system 100.

画像処理システム100は、撮像装置101、記録媒体102、表示装置103、出力装置104、および、画像処理装置105を備えて構成される。画像処理装置105は、通信部106、記憶部107、および、ぼけ補正部108(画像処理部)を有する。ぼけ補正部108は、取得部1081(取得手段)、生成部1082(生成手段)、および、補正部1083(補正手段)を有する。ぼけ補正部108の各部は、後述のように本実施例の画像処理方法を実行する。なお、撮像装置101の内部に画像処理装置105(ぼけ補正部108)を備えるように構成してもよい。   The image processing system 100 includes an imaging device 101, a recording medium 102, a display device 103, an output device 104, and an image processing device 105. The image processing apparatus 105 includes a communication unit 106, a storage unit 107, and a blur correction unit 108 (image processing unit). The blur correction unit 108 includes an acquisition unit 1081 (acquisition unit), a generation unit 1082 (generation unit), and a correction unit 1083 (correction unit). Each unit of the blur correction unit 108 executes the image processing method of the present embodiment as will be described later. Note that the image processing apparatus 105 (blur correction unit 108) may be provided inside the imaging apparatus 101.

撮像装置101は、光学系1011(撮像光学系)および撮像素子1012を有する。光学系1011は、被写体空間からの光線を撮像素子1012上に結像させる。撮像素子1012は、複数の画素を有し、光学系1011を介して形成された光学像(被写体像)を光電変換して画像信号を出力する。撮像装置101は、撮像素子1012から出力された画像信号に基づいて撮影画像(ぼけ画像)を生成する。撮像装置101により得られたぼけ画像は、通信部106を介して画像処理装置105へ出力される。ぼけ画像に関しては、前述のような複数の種類のぼけの少なくとも一つが作用することにより、被写体空間の情報が劣化している。   The imaging apparatus 101 includes an optical system 1011 (imaging optical system) and an imaging element 1012. The optical system 1011 forms an image of light rays from the subject space on the image sensor 1012. The image sensor 1012 has a plurality of pixels, photoelectrically converts an optical image (subject image) formed via the optical system 1011, and outputs an image signal. The imaging device 101 generates a captured image (blurred image) based on the image signal output from the image sensor 1012. The blurred image obtained by the imaging device 101 is output to the image processing device 105 via the communication unit 106. Regarding the blurred image, information on the subject space is deteriorated by the action of at least one of a plurality of types of blur as described above.

記憶部107は、画像処理装置105に入力されたぼけ画像、および、ぼけ画像を撮影した際の撮影条件に関する情報を記憶する。ここで撮影条件とは、撮影時における撮像装置101の焦点距離、絞り、シャッタースピード、ISO感度などである。ぼけ補正部108は、ぼけ画像に基づいて特定のぼけ成分を推定して補正し、ぼけ補正画像を生成する。ぼけ補正画像は、通信部106を介して、表示装置103、記録媒体102、および、出力装置104のいずれか一つまたは複数に出力される。表示装置103は、例えば液晶ディスプレイやプロジェクタなどである。ユーザは、表示装置103を介して、処理途中の画像を確認しながら作業を行うことができる。記録媒体102は、半導体メモリ、ハードディスク、ネットワーク上のサーバなどである。出力装置104は、プリンタなどである。画像処理装置105は、必要に応じて、現像処理やその他の画像処理を行う機能を有してもよい。   The storage unit 107 stores a blurred image input to the image processing apparatus 105 and information regarding shooting conditions when the blurred image is shot. Here, the shooting conditions are the focal length, aperture, shutter speed, ISO sensitivity, and the like of the imaging apparatus 101 at the time of shooting. The blur correction unit 108 estimates and corrects a specific blur component based on the blur image, and generates a blur correction image. The blur correction image is output to any one or more of the display device 103, the recording medium 102, and the output device 104 via the communication unit 106. The display device 103 is, for example, a liquid crystal display or a projector. The user can perform work while confirming an image being processed via the display device 103. The recording medium 102 is a semiconductor memory, a hard disk, a server on a network, or the like. The output device 104 is a printer or the like. The image processing apparatus 105 may have a function of performing development processing and other image processing as necessary.

本実施例の画像処理方法を実現するため、ソフトウエア(画像処理プログラム)を、ネットワークまたはCD−ROMなどの記憶媒体を介して、画像処理装置105に供給することもできる。この際、画像処理プログラムは、画像処理装置105のコンピュータ(又は、CPUやMPUなど)によって読み出され、ぼけ補正部108の機能を実行する。   In order to implement the image processing method of the present embodiment, software (image processing program) can be supplied to the image processing apparatus 105 via a network or a storage medium such as a CD-ROM. At this time, the image processing program is read by the computer (or CPU, MPU, etc.) of the image processing apparatus 105 and executes the function of the blur correction unit 108.

ぼけ補正部108は、図1および図4のフローチャートで示される画像処理を実行する。その画像処理に関する説明を行う前に、ぼけ推定領域(ぼけ画像の少なくとも一部)における信号勾配のぼけを補正する方法(補正処理)、および、ぼけを推定する方法(推定処理)に関して説明する。なお本実施例において、信号勾配とは、ぼけ推定領域における信号に関する情報であり、画像そのもの(画像の輝度分布)に関する情報またはそのn次微分(nは0を含む整数)に関する情報(微分値に関する情報)を含む。   The blur correction unit 108 performs image processing shown in the flowcharts of FIGS. 1 and 4. Before explaining the image processing, a method for correcting the blur of the signal gradient in the blur estimation region (at least a part of the blur image) (correction processing) and a method for estimating the blur (estimation processing) will be described. In the present embodiment, the signal gradient is information related to the signal in the blur estimation region, and information related to the image itself (the luminance distribution of the image) or information related to the n-th derivative (n is an integer including 0) (related to the differential value). Information).

本実施例において、ぼけ(劣化成分)はPSFの形で表現されるが、これに限定されるものではなく、例えばOTF(Optical Transfer Function)の形で表現しても構わない。まず、適当なPSFの初期値(Gauss分布や1次元のラインなど)を与え、そのPSFで第2のぼけ推定領域における信号勾配のぼけを補正し、補正信号勾配を生成する。続いて、信号勾配と補正信号勾配とに基づいてPSFを推定する。推定されたPSFを用いて、再度、第2のぼけ推定領域の信号勾配を補正して新たな補正信号勾配を生成し、PSFを推定する。これを反復すること(ループ処理)により、ぼけ画像(より正確には、ぼけ画像の少なくとも一部である第2のぼけ推定領域)のみからぼけを推定することができる。   In this embodiment, the blur (deterioration component) is expressed in the form of PSF, but is not limited to this, and may be expressed in the form of, for example, OTF (Optical Transfer Function). First, an appropriate initial value of PSF (Gaussian distribution, one-dimensional line, etc.) is given, and the signal gradient in the second blur estimation region is corrected with the PSF to generate a corrected signal gradient. Subsequently, the PSF is estimated based on the signal gradient and the correction signal gradient. Using the estimated PSF, the signal gradient in the second blur estimation region is corrected again to generate a new corrected signal gradient, and the PSF is estimated. By repeating this (loop processing), it is possible to estimate the blur only from the blur image (more precisely, the second blur estimation region that is at least a part of the blur image).

次に、信号勾配のぼけ補正方法(補正処理)について、具体的に説明する。第2のぼけ推定領域とぼけの関係は、以下の式(1)のように表される。   Next, the signal gradient blur correction method (correction process) will be specifically described. The relationship between the second blur estimation area and the blur is expressed by the following equation (1).

式(1)において、b-はi番目のループ処理における第2のぼけ推定領域の信号分布、kはぼけ、aはぼけkによる劣化がない信号分布、nはノイズである。「*」はコンボリューション演算を表す。 In the formula (1), b-i signal distribution of the second blur estimation region in the i-th loop, k i is blurred, a i no degradation due to blur k i signal distribution, n i is the noise . “*” Represents a convolution operation.

以下の式(2)のように表される最適化問題を解くことにより、i番目のループ処理におけるaの推定値d-(補正信号分布に相当)を推定する。 By solving the optimization problem is represented by the following equation (2), (corresponding to a correction signal distribution) estimate d-i of a i in the i-th loop process to estimate.

式(2)において、Lは損失関数、Φはdに対する正則化項であり、それぞれの具体的な例については後述する。損失関数Lは、解をモデル(ここでは式(1)を指す)へフィッティングさせる効果を持つ。正則化項Φは、解を尤もらしい値へ収束させる効果を有する。正則化項には、事前知識と呼ばれる解(a)が持つべき性質を用いる。また、正則化項は損失関数のみを考えた際に起こる過剰なフィッティング(ノイズnの影響をdへ反映させてしまうこと)を防ぐ役割を有する。なお、第2のぼけ推定領域を複数のチャンネル(例えばRGB)から取得している場合、各チャンネルに対して式(2)を解く。 In Expression (2), L is a loss function, Φ is a regularization term for d i , and specific examples of each will be described later. The loss function L has an effect of fitting the solution to a model (here, the equation (1) is indicated). The regularization term Φ has the effect of converging the solution to a plausible value. For the regularization term, a property that the solution (a i ) called prior knowledge should have is used. Moreover, regularization term has a role of preventing excessive fitting experience when considering only loss function (to the influence of noise n i will be reflected to d i). When the second blur estimation area is acquired from a plurality of channels (for example, RGB), Equation (2) is solved for each channel.

本実施例では、式(2)を解くことにより、補正信号勾配を求めるが、その他の手法を用いてもよい。例えば、Wienerフィルタなどの逆フィルタを用いた手法、または、Richardson−Lucy法などの超解像手法を用いることができる。さらに、逆フィルタや超解像手法と合わせて、ショックフィルタなどの先鋭化フィルタを適用して補正信号勾配を生成してもよい。さらに、先鋭化フィルタを併用する際には、バイラテラルフィルタやガイデッドフィルタなどのエッジの解像感を保つ平滑化フィルタを用いて、ノイズやリンギングを抑制することが好ましい。   In this embodiment, the correction signal gradient is obtained by solving Equation (2), but other methods may be used. For example, a method using an inverse filter such as a Wiener filter or a super-resolution method such as a Richardson-Lucy method can be used. Further, a correction signal gradient may be generated by applying a sharpening filter such as a shock filter in combination with an inverse filter or a super-resolution technique. Furthermore, when a sharpening filter is used in combination, it is preferable to suppress noise and ringing by using a smoothing filter that maintains edge resolution such as a bilateral filter or a guided filter.

次に、式(2)中の損失関数Lおよび正則化項Φの具体例について説明する。損失関数Lとしては、以下の式(3)のように示される関数が考えられる。   Next, specific examples of the loss function L and the regularization term Φ in Expression (2) will be described. As the loss function L, a function represented by the following equation (3) is conceivable.

式(3)において、以下の式(4)のように表される記号はp次平均ノルムを表し、p=2の場合にはユークリッドノルムを示す。 In the expression (3), a symbol represented as the following expression (4) represents a p-order average norm, and in the case of p = 2, represents a Euclidean norm.

正則化項Φの例としては、以下の式(5)のように示される1次平均ノルムがある。   As an example of the regularization term Φ, there is a first-order average norm represented by the following equation (5).

式(5)において、λは正則化項Φの重みを表すパラメータ、Ψは画像に対する基底変換を表す関数であり、その例としてウェーブレット変換や離散コサイン変換などがある。式(5)の正則化項Φは、画像がウェーブレット変換や離散コサイン変換などの基底変換を施されることで、信号成分がスパース(疎)になる、すなわち、より少ない数の信号で表すことができるという性質に基づく。これに関しては、例えば、「Richard G.Baraniuk,“Compressive Sensing”,IEEE SIGNAL PROCESSING MAGAZINE [118] JULY 2007」に説明されている。また、その他の正則化項の例として、Tikhonov正則化項やTV(Total Variation)ノルム正則化項などを用いてもよい。 In Equation (5), λ is a parameter that represents the weight of the regularization term Φ, and ψ is a function that represents a basis transformation for the image, examples of which include wavelet transformation and discrete cosine transformation. The regularization term Φ in equation (5) is expressed by a smaller number of signals because the image component is subjected to base transformation such as wavelet transformation or discrete cosine transformation, so that the signal component becomes sparse. Based on the nature of being able to. This is described, for example, in “Richard G. Baraniuk,“ Compressive Sensing ”, IEEE SIGNAL PROCESSING MAGAZINE [118] JULY 2007”. In addition, as examples of other regularization terms, a Tikhonov regularization term, a TV (Total Variation) norm regularization term, or the like may be used.

最適化問題である式(2)で表される推定式を解くには、繰り返し演算を用いた手法を利用し、例えばTikhonov正則化項を採用した場合は、共役勾配法などを使用すればよい。また、式(5)またはTVノルム正則化項を採用する場合、TwIST(Two−step Iterative Shrinkage/Thresholding)などを用いるとよい。TwISTに関しては、「J.M.Bioucas−Dias,et al.,“A new TwIST:two−step iterative shrinkage/thresholding algorithms for image restoration”,IEEE Trans.on Image Processing,vol.16,Dec.2007」に説明されている。   In order to solve the estimation equation represented by Expression (2), which is an optimization problem, a technique using an iterative operation is used. For example, when a Tikhonov regularization term is employed, a conjugate gradient method or the like may be used. . In addition, when adopting the formula (5) or the TV norm regularization term, TwIST (Two-step Iterative Shrinkage / Thresholding) or the like may be used. Regarding TwIST, “J. M. Bioucas-Dias, et al.,“ A new TwIST: two-step iterative shrinkage / thresholding algorithms for image restoration ”, IEEE Trave. Explained.

また、これらの繰り返し演算を行う際、繰り返しの度に正則化の重みなどのパラメータを更新してもよい。なお、式(1)、(2)は、画像(信号分布)に対して記載されているが、画像の微分に関しても同様に成り立つ。このため、画像に代えて、画像の微分(両者を含めて信号勾配と表現する)に対してぼけ補正を行ってもよい。   In addition, when performing these repetitive calculations, parameters such as regularization weights may be updated each time it is repeated. The expressions (1) and (2) are described for the image (signal distribution), but the same holds true for the differentiation of the image. Therefore, in place of the image, blur correction may be performed on the differentiation of the image (which is expressed as a signal gradient including both).

次に、ぼけの推定方法(推定処理)について具体的に説明する。PSFに関しても、式(2)と同様に、以下の式(6)を用いて推定することができる。   Next, the blur estimation method (estimation process) will be specifically described. PSF can also be estimated using the following equation (6), as in equation (2).

なお、第2のぼけ推定領域を複数のチャンネルから取得している(チャンネルによるぼけの変化がない、または無視できる)場合、式(6)は以下の式(6a)に示されるように変形される。 When the second blur estimation area is acquired from a plurality of channels (the blur due to the channel is not changed or can be ignored), the formula (6) is transformed as shown in the following formula (6a). The

式(6a)において、Hは第2のぼけ推定領域に含まれるチャンネルの総数、di,hはh番目のチャンネルにおけるd、vは重みを示す。信号勾配の補正の場合、式(2)を各チャンネルに対して解けばよいが、ぼけ推定では式(6a)のように全チャンネルで纏められた形になる。これは、推定する対象が、式(2)では各チャンネルで異なるのに対し、式(6a)では共通している(同一のPSFである)ためである。 In the formula (6a), H denotes the total number of channels included in the second blur estimation region, d i, h is d at h-th channel i, v h is the weight. In the case of signal gradient correction, equation (2) may be solved for each channel, but in blur estimation, the form is summarized for all channels as in equation (6a). This is because the target to be estimated is different for each channel in Equation (2), but is common in Equation (6a) (the same PSF).

式(6)、(6a)の損失関数Lとして、以下の式(7)が考えられる。   As the loss function L of the equations (6) and (6a), the following equation (7) can be considered.

式(7)において、∂は微分演算子を表す。∂(j=0)は恒等演算子であり、∂、∂はそれぞれ、画像の横方向と縦方向の微分を表す。さらに高次の微分は、例えば∂xxや∂xyyのように表される。なお、ぼけ推定領域の信号勾配とは、これら全てのj(j=0,x,y,xx,xy,yy,yx,xxx,……)を含むが、本実施例ではj=x,yのみを考える。uは重みである。 In Expression (7), j j represents a differential operator. 0 0 (j = 0) is an identity operator, and ∂ x and ∂ y represent the horizontal and vertical differentiations of the image, respectively. Further, the higher-order differentiation is expressed as ∂ xx or ∂ xyy , for example. Note that the signal gradient in the blur estimation area includes all these j (j = 0, x, y, xx, xy, yy, yx, xxx,...). In this embodiment, j = x, y Think only. u j is a weight.

式(6)の正則化項Φとしては、推定するPSFの性質に沿ったものを用いることができる。例えば、PSFがデフォーカスのように潰れた形になる場合、以下の式(8)のように表されるTVノルム正則化を用いることが好ましい。   As the regularization term Φ in the equation (6), one that conforms to the property of the PSF to be estimated can be used. For example, when the PSF is in a collapsed form such as defocus, it is preferable to use TV norm regularization represented by the following equation (8).

式(8)において、ζは正則化項の重みである。 In equation (8), ζ is the weight of the regularization term.

また、PSFがぶれのようにライン状の形になる場合、以下の式(9)のように表される1次平均ノルム正則化を用いることが好ましい。   In addition, when the PSF has a linear shape such as blurring, it is preferable to use a first-order average norm regularization represented by the following formula (9).

また、PSFの形に依存せず、ある程度の精度が確保され、かつ、高速に解ける正則化項として、Tikhonov正則化を用いてもよい。   Further, Tikhonov regularization may be used as a regularization term that is not dependent on the shape of the PSF, ensures a certain degree of accuracy, and can be solved at high speed.

次に、本実施例の画像処理方法に関して説明する。本実施例では、第1のぼけ推定領域内の信号変化(エッジ、テクスチャ、または、グラデーション)の量(信号変化量)に応じて、第2のぼけ推定領域を取得する。第1のぼけ推定領域における信号変化量が、ぼけ推定を行うのに充分な量である場合、第1のぼけ推定領域をそのまま第2のぼけ推定領域とする。一方、第1のぼけ推定領域における信号変化量が不足している場合、すなわちぼけ推定を行うのに不充分な量である場合、第1のぼけ推定領域よりも信号変化量が多い第2のぼけ推定領域を取得する。この際、第2のぼけ推定領域は、第1のぼけ推定領域に対して、その位置と形状(形と大きさの両方を含む)の少なくとも一方が異なる。ただし、第2のぼけ推定領域は、第2のぼけ推定領域内に作用しているぼけが、第1のぼけ推定領域内に作用しているぼけからあまり変化しないように(実質的に変化しないように)取得される。このような第2のぼけ推定領域に対して、補正信号勾配の生成(補正処理)とぼけの推定(推定処理)とを行うことにより、第1のぼけ推定領域に対応する推定ぼけを得る。   Next, the image processing method of the present embodiment will be described. In the present embodiment, the second blur estimation region is acquired according to the amount of signal change (edge, texture, or gradation) (signal change amount) in the first blur estimation region. If the amount of signal change in the first blur estimation area is an amount sufficient to perform blur estimation, the first blur estimation area is directly used as the second blur estimation area. On the other hand, when the amount of signal change in the first blur estimation region is insufficient, that is, when the amount of signal change is insufficient to perform blur estimation, the second amount of signal change is larger than that in the first blur estimation region. Get the blur estimation area. At this time, the second blur estimation area is different from the first blur estimation area in at least one of position and shape (including both shape and size). However, in the second blur estimation area, the blur acting in the second blur estimation area does not change so much from the blur acting in the first blur estimation area (substantially does not change). To be acquired). An estimated blur corresponding to the first blur estimation area is obtained by generating a correction signal gradient (correction process) and estimating a blur (estimation process) on the second blur estimation area.

ここで、ぼけを推定するぼけ推定領域内における信号変化の量が、ぼけの推定精度に及ぼす効果について詳述する。式(1)から分かるように、ぼけ推定の際の推定対象であるぼけkは、1次方程式で表現されている。この1次方程式は、ぼけ推定領域bの画素数だけ存在するため、kの推定は、bの画素数個ある連立方程式を解く問題に相当する。このため、未知数の数よりも独立な1次方程式の数が多ければ、解は一意的に決定されることになる。しかし、一般的に、未知数の数より独立な1次方程式の数が多くなることはない。これは、ぼけkだけでなく、ノイズnも未知であることによる(ぼけを求める際には、aに推定したdの値を代入するため、aは既知となる)。すなわち、未知数の数は、ぼけkの成分数と、ノイズnの成分数(bの画素数と等しい)との和に相当し、常に1次方程式の数(bの画素数)より多い。このため、ぼけkを求めるには、推定処理が必要となる。 Here, the effect of the amount of signal change in the blur estimation area for estimating blur on the blur estimation accuracy will be described in detail. As can be seen from the equation (1), the blur k i that is an estimation target in blur estimation is expressed by a linear equation. Since this linear equation exists for the number of pixels in the blur estimation region b i , estimation of k i corresponds to a problem of solving simultaneous equations having the number of pixels of b i . For this reason, if the number of independent linear equations is larger than the number of unknowns, the solution is uniquely determined. However, in general, the number of independent linear equations does not increase beyond the number of unknowns. This is because the blur k i as well, the noise n i also unknown (when determining the blur, in order to assign the value of d i estimated in a i, a i is known). That is, the number of unknowns is equivalent to the sum of the number of components of the blur k i, the number of components in the noise n i and (equal to the number of pixels b i), always (number of pixels b i) number of linear equations is more than. Therefore, in order to determine the blur k i, estimation processing is required.

ここで、ノイズnの影響を抑え、高精度にぼけkを求める方法について考える。まず、式(1)を、未知数k(数はkの成分数)の連立1次方程式(数はbの画素数)それぞれに、ノイズが含まれていると考える。ただし、b-の画素数がkの成分数より多いとする。仮に、ノイズが含まれていない場合、連立1次方程式の数が未知数の数よりも多いため、1次方程式の中には必ず従属関係となるものが存在する。すなわち、同一の方程式が複数存在することになる。しかし、実際にはノイズが存在するため、それらの方程式はノイズの分だけずれを生じている。一方、ノイズは、原信号が同じで異なるノイズの値を有する信号を平均化することにより、抑制可能である。このため、ノイズの出方が異なる従属な1次方程式が多ければ、平均化の効果によりノイズの影響を抑えたぼけ推定が可能になる。この平均化によるノイズ抑制効果が充分に作用している場合、式(6)、(6a)の正則化項Φを0にしてもよい。 Here, to suppress the influence of noise n i, considered method of obtaining the blur k i with high accuracy. First, Equation (1) is considered that noise is included in each of the simultaneous linear equations (the number is the number of pixels of b i ) of the unknown number k i (the number is the number of components of k i ). However, the number of pixels of the b-i is the larger number of components in k i. If no noise is included, the number of simultaneous linear equations is larger than the number of unknowns, and some linear equations always have a dependency. That is, there are a plurality of the same equations. However, since there is actually noise, these equations are shifted by the amount of noise. On the other hand, noise can be suppressed by averaging signals having the same original signal but different noise values. For this reason, if there are many dependent linear equations with different ways of generating noise, blur estimation with the influence of noise suppressed by the effect of averaging becomes possible. When the noise suppression effect by this averaging is sufficiently acting, the regularization term Φ in the equations (6) and (6a) may be set to zero.

また、ぼけkを高精度に推定するには、更なる条件が必要となる。それは、ノイズを除いた連立1次方程式中で、独立な方程式の数ができるだけ多いことである。ぼけkの成分数(つまり未知数の数)よりも独立な方程式の数が少なすぎると、推定は充分な精度を得られない。連立1次方程式の係数は、補正信号勾配dであるから、独立な方程式の数が多くなるためには、補正信号勾配dが様々な組み合わせを持っている必要がある。換言すると、ぼけ推定領域内において、様々な方向または強度の信号変化(エッジ、テクスチャ、または、グラデーション)が存在している程、推定精度が向上する。例えば、ぼけ推定領域bおよび補正信号勾配dの信号値が一定(画像で言うと、完全な平坦部)であると仮定すると、式(1)の連立1次方程式は(ノイズを除いて)全て同じとなるため、ぼけkを推定することができない。 Also, to estimate the blur k i with high accuracy, further conditions are necessary. That is, there are as many independent equations as possible in the simultaneous linear equations excluding noise. The number of independent equations than the number of components of the blur k i (i.e. the number of unknowns) is too small, estimated it can not be obtained with sufficient accuracy. Since the coefficient of the simultaneous linear equations is the correction signal gradient d i , the correction signal gradient d i needs to have various combinations in order to increase the number of independent equations. In other words, the estimation accuracy improves as signal changes (edges, textures, or gradations) of various directions or intensities exist in the blur estimation area. For example, if it is assumed that the signal values of the blur estimation region b i and the correction signal gradient d i are constant (in the image, a completely flat portion), the simultaneous linear equations of Equation (1) are (excluding noise) ) Since all are the same, the blur k i cannot be estimated.

以上の議論を纏めると、ぼけ推定領域内において様々な方向や強度を持つ信号変化が多く存在し、かつ、同じ信号変化でありながらノイズの出方が異なるものが複数存在すると、ぼけの推定精度が向上する。これを実現するため、本実施例では、第1のぼけ推定領域における信号変化(信号変化量)が少ない場合、ぼけ画像内における第1のぼけ推定領域とはその位置または形状が異なる第2のぼけ推定領域を取得する。第2のぼけ推定領域は、第1のぼけ推定領域よりもエッジなどの信号変化を多く含む。さらに、第2のぼけ推定領域の面積が第1のぼけ推定領域の面積よりも大きい場合、1次方程式(ノイズの出方が異なる方程式)の数が増えるため、ノイズ抑制効果も得ることができる。ただし、前述のように、ぼけがShift−variantな場合、ぼけ推定領域が変化することにより、推定されたぼけは本来のぼけとやや異なる(ただし、信号変化量が不足している場合の推定精度の低下よりは誤差が小さい)。このため、第1のぼけ推定領域内における信号変化量が少ない場合のみ、位置または形状の異なる第2のぼけ推定領域を取得する。一方、それ以外の場合(第1のぼけ推定領域内に充分な信号変化量がある場合)、第1のぼけ推定領域そのものを第2のぼけ推定領域とする。   Summarizing the above discussion, if there are many signal changes with various directions and intensities in the blur estimation area, and there are multiple signals that have the same signal change but different noise appearance, the blur estimation accuracy Will improve. In order to realize this, in this embodiment, when the signal change (signal change amount) in the first blur estimation area is small, the second blur position is different from the first blur estimation area in the blur image. Get the blur estimation area. The second blur estimation area includes more signal changes such as edges than the first blur estimation area. Further, when the area of the second blur estimation area is larger than the area of the first blur estimation area, the number of linear equations (equations with different noise appearances) increases, so that a noise suppression effect can also be obtained. . However, as described above, when the blur is Shift-variant, the estimated blur is slightly different from the original blur due to a change in the blur estimation area (however, the estimation accuracy when the signal change amount is insufficient) The error is smaller than the decrease in. For this reason, the second blur estimation region having a different position or shape is acquired only when the signal change amount in the first blur estimation region is small. On the other hand, in other cases (when there is a sufficient signal change amount in the first blur estimation area), the first blur estimation area itself is set as the second blur estimation area.

次に、図1を参照して、ぼけ補正部108で行われる画像処理に関して説明する。図1は、本実施例の画像処理方法を示すフローチャートである。図1の各ステップは、ぼけ補正部108の取得部1081、生成部1082、および、補正部1083により実行される。   Next, image processing performed by the blur correction unit 108 will be described with reference to FIG. FIG. 1 is a flowchart illustrating an image processing method according to the present exemplary embodiment. Each step in FIG. 1 is executed by the acquisition unit 1081, the generation unit 1082, and the correction unit 1083 of the blur correction unit 108.

まずステップS101において、ぼけ補正部108の取得部1081は、ぼけ画像(撮影画像)を取得する。続いてステップS102において、ぼけ補正部108の生成部1082は、ぼけ画像における信号変化の量(信号変化量)に関する分布情報を取得する。信号変化の量に関する分布情報とは、ぼけ画像内のどの位置または領域にエッジなどの信号変化が存在し、その強度がどの程度かを示す情報である。信号変化の量に関する分布情報を取得する方法として、ぼけ画像(輝度分布)の微分値を取得する方法がある。微分値の絶対値が大きいほど、大きな信号変化が発生している位置を示し、その位置がぼけ推定領域に含まれる場合に推定の精度が向上する。   First, in step S101, the acquisition unit 1081 of the blur correction unit 108 acquires a blurred image (captured image). Subsequently, in step S102, the generation unit 1082 of the blur correction unit 108 acquires distribution information regarding the amount of signal change (signal change amount) in the blurred image. The distribution information relating to the amount of signal change is information indicating in which position or region in the blurred image a signal change such as an edge exists and to what extent. As a method of acquiring distribution information regarding the amount of signal change, there is a method of acquiring a differential value of a blurred image (luminance distribution). As the absolute value of the differential value increases, the position where a large signal change occurs is indicated, and the accuracy of estimation is improved when the position is included in the blur estimation region.

続いてステップS103において、生成部1082は、ぼけ画像内から第1のぼけ推定領域を取得する。第1のぼけ推定領域は、ぼけを推定しようとする領域である。第1のぼけ推定領域は、ユーザが指定した領域または自動的に取得されるものであってもよい。本実施例では、ぼけがShift−variantの場合を取り扱う。この際、第1のぼけ推定領域は、例えば、ぼけ画像を複数の部分領域に分割し、分割した複数の部分領域のうちの1つの部分領域を選択することにより取得される。一方、ぼけ画像の全体においてぼけが一定の場合(Shift−invariantと呼ぶ)、第1のぼけ推定領域として、ぼけ画像の全体の領域が設定される。ただしこの場合、第1のぼけ推定領域よりも信号変化量の多い第2のぼけ推定領域を、ぼけ画像から取得することはできない。このため本実施例では、Shift−variantなぼけを対象として説明する。   Subsequently, in step S103, the generation unit 1082 acquires a first blur estimation region from the blurred image. The first blur estimation region is a region where blur is to be estimated. The first blur estimation area may be an area specified by the user or automatically acquired. In this embodiment, a case where the blur is a shift-variant is handled. At this time, the first blur estimation area is acquired by, for example, dividing the blurred image into a plurality of partial areas and selecting one partial area from the plurality of divided partial areas. On the other hand, when the blur is constant in the entire blur image (referred to as Shift-invariant), the entire area of the blur image is set as the first blur estimation area. However, in this case, it is not possible to acquire from the blurred image the second blurred estimated area having a larger signal variation amount than the first blurred estimated area. For this reason, in this embodiment, a shift-variant blur will be described.

続いてステップS104において、生成部1082は、第2のぼけ推定領域を取得する。第2のぼけ推定領域は、実際にぼけを算出(推定)する領域であり、第2のぼけ推定領域において得られた推定ぼけが第1のぼけ推定領域に作用しているぼけとして出力される。ぼけ推定の際、第2のぼけ推定領域内においては、同じぼけが作用しているものと仮定する。第2のぼけ推定領域は、第1のぼけ推定領域における信号変化量に基づいて決定される。第1のぼけ推定領域内における信号変化量がぼけ推定に充分である場合、第1のぼけ推定領域をそのまま第2のぼけ推定領域とする。一方、第1のぼけ推定領域内における信号変化量がぼけ推定に不充分である場合、信号変化量が多くなるように、第1のぼけ推定領域とは位置または形状が異なる第2のぼけ推定領域を取得する。信号変化量がぼけ推定に充分であるか否かは、例えば、予め設定された閾値(第1の閾値)よりも信号変化量が大きいか否かにより判定可能である。この閾値は、推定するぼけの成分数(未知数の数)などから決定することが好ましい。第1のぼけ推定領域における信号変化量は、例えば、ステップS102にて算出された信号変化量に関する分布情報を用いればよい。この分布情報のうち、第1のぼけ推定領域に相当する部分の値だけを抽出する。この分布情報の値(信号変化量)と閾値(第1の閾値)とを比較するには、信号変化量を分布情報からスカラー値に変換する必要がある。以下、その例について説明するが、本実施例はこれらに限定されるものではない。   Subsequently, in step S104, the generation unit 1082 acquires a second blur estimation area. The second blur estimation area is an area where the blur is actually calculated (estimated), and the estimated blur obtained in the second blur estimation area is output as blur acting on the first blur estimation area. . In the blur estimation, it is assumed that the same blur is acting in the second blur estimation area. The second blur estimation area is determined based on the signal change amount in the first blur estimation area. When the amount of signal change in the first blur estimation area is sufficient for blur estimation, the first blur estimation area is directly used as the second blur estimation area. On the other hand, when the amount of signal change in the first blur estimation area is insufficient for blur estimation, the second blur estimation is different in position or shape from the first blur estimation area so that the signal change amount increases. Get the area. Whether or not the signal change amount is sufficient for blur estimation can be determined, for example, based on whether or not the signal change amount is larger than a preset threshold value (first threshold value). This threshold is preferably determined from the number of blur components to be estimated (the number of unknowns). As the signal change amount in the first blur estimation region, for example, distribution information relating to the signal change amount calculated in step S102 may be used. Of this distribution information, only the value of the portion corresponding to the first blur estimation area is extracted. In order to compare this distribution information value (signal change amount) with a threshold value (first threshold value), it is necessary to convert the signal change amount from the distribution information to a scalar value. Examples thereof will be described below, but the present embodiment is not limited to these examples.

最も簡単な手法は、第1のぼけ推定領域における微分値の二乗(絶対値でもよい)の総和をとることである。好ましくは、微分値の二乗、または絶対値を量子化し、その後にそれらの総和を取る。量子化せずに総和をとる場合、信号変化が多く存在するのか、非常に大きな信号変化が少量だけ存在するのかを明確に区別することはできない。前者の場合、エッジやテクスチャなどの方向や強度にバリエーションが多く存在する。一方、後者の場合、そのようなバリエーションが少ない。エッジやテクスチャなどのバリエーションが少ないと、式(1)により表される連立1次方程式の中で独立な方程式の数が小さくなるため、ぼけの推定精度は低下する。このため、第1のぼけ推定領域内で信号変化が複数の領域に存在するのか、または、非常に大きな信号変化が少量だけ存在するのかを区別可能であることが好ましい。量子化を行うことにより、この区別を実現することができる。例えば、微分量の二乗(または絶対値)が、所定の閾値(第3の閾値)よりも大きい場合には1、所定の閾値よりも小さい場合(平坦部の場合)には0というように、二値化してから総和を取る。これにより、エッジやテクスチャが多いのか否かを区別することができる。ここでは量子化として二値化による手法を用いているが、それより多いビット数で量子化しても構わない。   The simplest method is to take the sum of the squares of differential values (may be absolute values) in the first blur estimation region. Preferably, the square of the differential value or the absolute value is quantized, and then the sum thereof is taken. When the sum is taken without quantization, it cannot be clearly distinguished whether there are many signal changes or only a very small amount of signal change. In the former case, there are many variations in the direction and strength of edges and textures. On the other hand, in the latter case, there are few such variations. If there are few variations such as edges and textures, the number of independent equations among the simultaneous linear equations expressed by Equation (1) becomes small, so that the blur estimation accuracy decreases. For this reason, it is preferable to be able to distinguish whether there are signal changes in a plurality of regions within the first blur estimation region or only a small amount of very large signal changes. This distinction can be realized by performing quantization. For example, when the square (or absolute value) of the differential amount is larger than a predetermined threshold (third threshold), it is 1, and when it is smaller than the predetermined threshold (in the case of a flat portion), it is 0. Take the sum after binarization. Thereby, it can be distinguished whether there are many edges and textures. Here, a binarization technique is used as quantization, but quantization may be performed with a larger number of bits.

第1のぼけ推定領域よりも信号変化量の多い第2のぼけ推定領域は、例えば、図5に示されるように取得する。図5は、第1のぼけ推定領域と第2のぼけ推定領域との関係を示す図である。図5(A)は、ぼけ画像201において、第1のぼけ推定領域202とは位置の異なる第2のぼけ推定領域203aを取得している様子を示している。ぼけ画像201におけるどの位置から第2のぼけ推定領域203aを取得すればより多くの信号変化量が得られるかに関しては、図1のステップS102にて取得したぼけ画像の信号変化量に関する分布情報に基づいて判定可能である。ただし、第2のぼけ推定領域に作用しているぼけが第1のぼけ推定領域のぼけと大きく異なると、推定ぼけの精度は低下してしまう。このため、第1のぼけ推定領域および第2のぼけ推定領域におけるぼけが概ね同じになるように、第2のぼけ推定領域を取得する。殆どのぼけは、ぼけ画像上の位置に応じて連続的に変化する。このため、第2のぼけ推定領域は、第1のぼけ推定領域の面積の半分以上を含むように取得されることが好ましい。これにより、ぼけ画像中の位置変化によるぼけの変化を抑制することができる。このことから、第2のぼけ推定領域を決定する際に用いる信号変化の量に関する分布情報は、ステップS102のようにぼけ画像の全体から取得する必要はなく、第1のぼけ推定領域の周辺のみに関して取得すればよい。   The second blur estimation area having a signal change amount larger than that of the first blur estimation area is acquired as shown in FIG. 5, for example. FIG. 5 is a diagram illustrating a relationship between the first blur estimation area and the second blur estimation area. FIG. 5A shows a state in which a second blur estimation region 203 a having a position different from that of the first blur estimation region 202 is acquired in the blur image 201. As to which position in the blurred image 201 the second blur estimation region 203a is acquired to obtain a larger amount of signal change, the distribution information relating to the signal change amount of the blurred image acquired in step S102 in FIG. It can be determined on the basis of. However, if the blur acting on the second blur estimation area is significantly different from the blur of the first blur estimation area, the accuracy of the estimation blur is lowered. For this reason, the second blur estimation area is acquired so that the blurs in the first blur estimation area and the second blur estimation area are substantially the same. Most blurs change continuously according to their position on the blurred image. For this reason, it is preferable that the second blur estimation area is acquired so as to include half or more of the area of the first blur estimation area. Thereby, a change in blur due to a position change in the blurred image can be suppressed. Therefore, the distribution information relating to the amount of signal change used when determining the second blur estimation area does not need to be acquired from the entire blur image as in step S102, and only around the first blur estimation area. You can get about.

図5(B)は、ぼけ画像201において、第1のぼけ推定領域202とは異なる形状(形と大きさの両方)を有する第2のぼけ推定領域203bを取得している様子を示している。第2のぼけ推定領域203bをどのような形状にすればより多くの信号変化量が得られるかに関しては、ステップS102にて取得したぼけ画像の信号変化の量に関する分布情報から判定可能である。前述のように、ぼけ推定領域が大きい(一次方程式の数が多い)ほど、ぼけ推定の精度低下を抑制することができる。このため、図5(B)に示されるように、第2のぼけ推定領域203bは、その面積が第1のぼけ推定領域202の面積よりも大きくなるように取得されることが好ましい。この際、第1のぼけ推定領域および第2のぼけ推定領域におけるぼけが概ね同じになるように、第2のぼけ推定領域が第1のぼけ推定領域を全て含むように取得することがより好ましい。さらに好ましくは、第2のぼけ推定領域の中心と第1のぼけ推定領域の中心とが互いに一致する。これにより、第1のぼけ推定領域と第2のぼけ推定領域におけるぼけの乖離を抑制することができる。   FIG. 5B shows a state where a second blur estimation area 203b having a shape (both shape and size) different from that of the first blur estimation area 202 is acquired in the blur image 201. . It can be determined from the distribution information regarding the amount of signal change in the blurred image acquired in step S102 as to what shape the second blur estimation region 203b can be made to obtain a larger amount of signal change. As described above, as the blur estimation area is larger (the number of linear equations is larger), it is possible to suppress a decrease in the accuracy of blur estimation. For this reason, as shown in FIG. 5B, the second blur estimation region 203b is preferably acquired so that the area thereof is larger than the area of the first blur estimation region 202. At this time, it is more preferable that the second blur estimation area is acquired so as to include all the first blur estimation areas so that blurs in the first blur estimation area and the second blur estimation area are substantially the same. . More preferably, the center of the second blur estimation area and the center of the first blur estimation area coincide with each other. Thereby, the deviation of the blur in the first blur estimation area and the second blur estimation area can be suppressed.

なお、図5(A)、(B)においては、位置と形状が異なる場合をそれぞれ個別に示しているが、第2のぼけ推定領域は、位置および形状の両方に関して、第1のぼけ推定領域と異なっていてもよい。また、第1のぼけ推定領域および第2のぼけ推定領域の位置や形状は、図5(A)、(B)に示されるものに限定されるものではない。   In FIGS. 5A and 5B, the case where the position and the shape are different is shown individually. However, the second blur estimation area is the first blur estimation area with respect to both the position and the shape. And may be different. Further, the positions and shapes of the first blur estimation area and the second blur estimation area are not limited to those shown in FIGS. 5 (A) and 5 (B).

次に、Shift−variantなぼけのうち、ぼけ画像中の位置変化による連続性が小さいデフォーカスにおける第2のぼけ推定領域について説明する。デフォーカスのぼけは、被写体空間の奥行き(デプス)方向に対して連続的に変化するが、一般的に、撮影画角内の被写体群に関しては連続的にデプスが変化しない。特に、異なるデプスに存在する被写体同士の境目は、不連続性が大きい。このため、デフォーカスを推定する際には、被写体空間のデプス情報(距離情報)を取得し、それを用いて第2のぼけ推定領域を決定することが好ましい。デプス情報は、多眼カメラ等の多視点撮像系やTOF(Time of Flight)センサ、または、レーザなどを用いた測距部を撮像装置101に設けることにより取得可能である。   Next, of the shift-variant blur, a second blur estimation area in defocusing with low continuity due to a position change in the blurred image will be described. Although the defocus blur continuously changes in the depth (depth) direction of the subject space, generally, the depth does not continuously change for the subject group within the shooting angle of view. In particular, the boundary between subjects existing at different depths has a large discontinuity. For this reason, when defocusing is estimated, it is preferable to obtain depth information (distance information) of the subject space and use it to determine the second blur estimation region. The depth information can be acquired by providing the imaging apparatus 101 with a distance measuring unit using a multi-view imaging system such as a multi-view camera, a TOF (Time of Flight) sensor, or a laser.

ここで、図6を参照して、第2のぼけ推定領域の取得方法に関して説明する。図6は、デフォーカスを推定する際の第1のぼけ推定領域と第2のぼけ推定領域との関係を示す図である。図6において、デプス情報204は、ぼけ画像に対応する被写体空間のデプスの分布を濃淡で表している。なお図6では、デプス情報204中に第1のぼけ推定領域202および第2のぼけ推定領域203cが描画されているが、両者は、実際にはぼけ画像から取得される。デプス情報204は、第2のぼけ推定領域203cの位置および形状を決定するために用いられる。図6に示されるように第1のぼけ推定領域202が設定されている場合、第2のぼけ推定領域203cを、第1のぼけ推定領域202とデプスが近い領域のみを含むように設定する。大きくデプスが変化する領域(被写体の境目を含む)を除外することにより、第1のぼけ推定領域および第2のぼけ推定領域におけるぼけの変化を低減することができる。   Here, with reference to FIG. 6, a method for obtaining the second blur estimation area will be described. FIG. 6 is a diagram illustrating the relationship between the first blur estimation area and the second blur estimation area when defocusing is estimated. In FIG. 6, the depth information 204 represents the depth distribution of the subject space corresponding to the blurred image in shades. In FIG. 6, the first blur estimation area 202 and the second blur estimation area 203c are drawn in the depth information 204, but both are actually acquired from the blur image. The depth information 204 is used to determine the position and shape of the second blur estimation area 203c. As shown in FIG. 6, when the first blur estimation area 202 is set, the second blur estimation area 203c is set so as to include only an area whose depth is close to that of the first blur estimation area 202. By excluding a region where the depth changes greatly (including the boundary of the subject), it is possible to reduce a change in blur in the first blur estimation region and the second blur estimation region.

また、デフォーカスのぼけ形状は、撮像装置101内の光学系1011の瞳に応じて決定される。図6では、光学系1011のヴィネッティングの影響を考慮して、第2のぼけ推定領域203cを第1のぼけ推定領域202周辺のみに限定している。しかし、光学系1011のヴィネッティングの影響が無視できる場合、デフォーカスのぼけはデプスに応じてのみ変化する。この場合、第1のぼけ推定領域と近いデプスの領域の全てを第2のぼけ推定領域と設定することができる。または、第1のぼけ推定領域と近いデプスであれば、その領域を全く含まないように第2のぼけ推定領域を設定しても構わない。   The defocus blur shape is determined according to the pupil of the optical system 1011 in the imaging apparatus 101. In FIG. 6, the second blur estimation area 203 c is limited only to the vicinity of the first blur estimation area 202 in consideration of the vignetting effect of the optical system 1011. However, when the influence of the vignetting of the optical system 1011 can be ignored, the defocus blur changes only in accordance with the depth. In this case, all of the depth regions close to the first blur estimation region can be set as the second blur estimation region. Alternatively, if the depth is close to the first blur estimation area, the second blur estimation area may be set so as not to include the area at all.

なお、推定する対象のぼけがデフォーカスであるか否かを判定する方法として、例えば以下の方法がある。まず、ユーザ自身が推定対象をデフォーカスに指定する場合である。また、自動判定には、ぼけ画像の周波数特性や撮像装置101の撮影条件に関する情報が用いられる。F値が非常に大きい場合、ユーザはパンフォーカス画像を意図していると考えられるため、デフォーカスぼけを推定する。また、ぼけ画像の高周波成分が等方的に欠落している場合、ピントずれが発生していると判定することができる。   As a method for determining whether or not the blur of the target to be estimated is defocused, for example, there are the following methods. First, the user himself / herself designates the estimation target as defocus. For automatic determination, information on the frequency characteristics of the blurred image and the shooting conditions of the imaging apparatus 101 is used. When the F value is very large, it is considered that the user intends a pan-focus image, so defocus blur is estimated. Further, when the high-frequency component of the blurred image is isotropically missing, it can be determined that a focus shift has occurred.

続いて、図1のステップS105において、生成部1082は、第2のぼけ推定領域から推定ぼけを生成する。ステップS105の詳細は、図4のフローチャートに示されており、その説明に関しては後述する。   Subsequently, in step S105 of FIG. 1, the generation unit 1082 generates an estimated blur from the second blur estimation area. Details of step S105 are shown in the flowchart of FIG. 4, and the description thereof will be described later.

続いてステップS106において、生成部1082は、ぼけ画像における所定の領域(例えば、ぼけ画像の全体)に対して、推定ぼけの生成が完了したか否かを判定する。推定ぼけの生成が完了している場合、ステップS107へ進む。一方、推定ぼけの生成が完了していない場合、ステップS103へ戻る。そして生成部1082は、ぼけ画像における所定の領域内から、推定ぼけが生成されていない部分領域を新たな第1のぼけ推定領域として取得する。   Subsequently, in step S106, the generation unit 1082 determines whether or not the generation of the estimated blur has been completed for a predetermined region (for example, the entire blurred image) in the blurred image. If the generation of the estimated blur has been completed, the process proceeds to step S107. On the other hand, if the generation of the estimated blur has not been completed, the process returns to step S103. Then, the generation unit 1082 acquires a partial area where no estimated blur is generated from a predetermined area in the blurred image as a new first blur estimated area.

続いてステップS107において、生成部1082は、生成された推定ぼけを出力する。第1のぼけ推定領域として、複数のぼけ推定領域が存在する場合、複数の推定ぼけが存在するため、それらの全てを出力する。本実施例において、推定ぼけはPSFのデータである。ただし、本実施例はこれに限定されるものではなく、OTF、PSFもしくはOTFを所定の基底でフィッティングした係数データ、または、PSFもしくはOTFを画像データに変換した画像などの形で出力してもよい。   Subsequently, in step S107, the generation unit 1082 outputs the generated estimated blur. When there are a plurality of blur estimation areas as the first blur estimation area, since there are a plurality of estimation blurs, all of them are output. In this embodiment, the estimated blur is PSF data. However, the present embodiment is not limited to this, and may be output in the form of coefficient data obtained by fitting OTF, PSF or OTF with a predetermined basis, or an image obtained by converting PSF or OTF into image data. Good.

続いてステップS108において、ぼけ補正部108の補正部1083は、出力された推定ぼけを用いてぼけ画像のぼけを補正する。補正には、例えば、Wienerフィルタなどの逆フィルタを用いた手法や、Richardson−Lucy法などの超解像手法を用いることができる。複数の推定ぼけが存在する場合、補正部1083は、対応するそれぞれの推定ぼけが得られた第1のぼけ推定領域に対して、推定ぼけを用いて補正を行う。また、全ての推定ぼけが出力される前に、ステップS105にて生成された推定ぼけを用いて、逐次、第1のぼけ推定領域のぼけを補正し、最後にそれらを合わせることで、ぼけ補正画像を生成してもよい。   Subsequently, in step S108, the correction unit 1083 of the blur correction unit 108 corrects the blur of the blurred image using the output estimated blur. For the correction, for example, a method using an inverse filter such as a Wiener filter or a super-resolution method such as a Richardson-Lucy method can be used. When there are a plurality of estimated blurs, the correction unit 1083 corrects the first blur estimation region from which each corresponding estimated blur is obtained using the estimated blur. Further, before all the estimated blurs are output, the blur of the first blur estimation area is sequentially corrected using the estimated blur generated in step S105, and finally, the blur is corrected by combining them. An image may be generated.

次に、図4を参照して、推定ぼけの生成処理(ステップS105)について詳述する。図4は、推定ぼけの生成方法を示すフローチャートである。図4の各ステップは、ぼけ補正部108の生成部1082により実行される。   Next, the estimated blur generation process (step S105) will be described in detail with reference to FIG. FIG. 4 is a flowchart illustrating a method for generating estimated blur. Each step in FIG. 4 is executed by the generation unit 1082 of the blur correction unit 108.

まず、ステップS201において、生成部1082は、第2のぼけ推定領域のデノイジングを行う。第2のぼけ推定領域のデノイジングは、第2のぼけ推定領域にノイズが存在していることによる、ぼけの推定精度の劣化を低減するために行われる。なお、ステップS201に代えて、図1のステップS103の前に、ぼけ画像の全体をデノイジングするステップを挿入してもよい。デノイジング手法としては、バイラテラルフィルタやNLM(Non Local Means)フィルタなどを用いる手法がある。   First, in step S201, the generation unit 1082 performs denoising of the second blur estimation area. The denoising of the second blur estimation region is performed in order to reduce deterioration in blur estimation accuracy due to the presence of noise in the second blur estimation region. Instead of step S201, a step of denoising the entire blurred image may be inserted before step S103 in FIG. As a denoising method, there is a method using a bilateral filter, an NLM (Non Local Means) filter, or the like.

好ましくは、生成部1082は、以下の手法で第2のぼけ推定領域(または、ぼけ画像)をデノイジングする。まず、生成部1082は、第2のぼけ推定領域を周波数分解して、周波数分解ぼけ推定領域を生成する。そして生成部1082は、第2のぼけ推定領域のノイズ量に基づいて、周波数分解ぼけ推定領域をデノイジングする。次に、生成部1082は、周波数分解ぼけ推定領域を再合成することにより、ノイズ低減されたぼけ第2のぼけ推定領域を取得する。一般に、デノイジング処理は、画像からノイズを低減するとともに、画像をぼかすという問題がある。第2のぼけ推定領域がデノイジングによってぼけると、後の推定処理を行う際に、画像を元来劣化させているぼけと、デノイジングによるぼけが混在したPSFを推定してしまうことになる。このため、画像に与えるぼけが小さいデノイジング手法を用いることが好ましい。このような手法として、画像の周波数分解を利用したデノイジング処理を適用する。ここでは、周波数分解としてウェーブレット変換を用いた例を説明する。なお、この詳細については、「Donoho D.L.,“De−noising by soft−thresholding”,IEEE Trans. on Inf. Theory,41,3,pp.613−627」に記載されている。   Preferably, the generation unit 1082 denoises the second blur estimation area (or blur image) by the following method. First, the generation unit 1082 generates a frequency-resolved blur estimation region by performing frequency decomposition on the second blur estimation region. Then, the generation unit 1082 denoises the frequency-resolved blur estimation area based on the amount of noise in the second blur estimation area. Next, the generation unit 1082 obtains a second blur estimation area with reduced noise by recombining the frequency-resolved blur estimation area. In general, the denoising process has a problem of reducing noise from an image and blurring the image. If the second blur estimation area is blurred by denoising, a PSF in which the blur that originally deteriorated the image and the blur due to denoising is mixed is estimated when performing the subsequent estimation process. For this reason, it is preferable to use a denoising technique with a small blur on the image. As such a technique, a denoising process using frequency decomposition of an image is applied. Here, an example using wavelet transform as frequency decomposition will be described. The details are described in “Donoho DL,“ De-noising by soft-thresholding ”, IEEE Trans. On Inf. Theory, 41, 3, pp. 613-627.

ウェーブレット変換とは、局在する小さな波(ウェーブレット)を用いて画像の位置ごとに周波数解析を行い、信号を高周波成分と低周波成分に分解していく変換である。画像のウェーブレット変換では、画像の水平方向に対してウェーブレット変換を行って低周波成分と高周波成分に分解し、さらに分解して得られた低周波成分と高周波成分の垂直方向に対してウェーブレット変換を行う。ウェーブレット変換により、画像は4分割され、周波数帯域が互いに異なる4つのサブバンド画像に周波数分解される。このとき、左上の低周波帯域成分(スケーリング係数)のサブバンド画像をLL1とし、右下の高周波帯域成分(ウェーブレット係数)のサブバンド画像をHH1とする。また、右上(HL1)と左下(LH1)のサブバンド画像はそれぞれ、水平方向に高周波帯域成分をとって垂直方向に低周波帯域成分を取り出したものと、水平方向に低周波帯域成分をとって垂直方向に高周波帯域成分を取り出したものである。   The wavelet transform is a transform in which a frequency analysis is performed for each position of an image using a localized small wave (wavelet) and a signal is decomposed into a high frequency component and a low frequency component. In the wavelet transform of an image, the wavelet transform is performed on the horizontal direction of the image to decompose it into a low frequency component and a high frequency component. Do. By the wavelet transform, the image is divided into four and is frequency-resolved into four subband images having different frequency bands. At this time, the subband image of the upper left low frequency band component (scaling coefficient) is LL1, and the subband image of the lower right high frequency band component (wavelet coefficient) is HH1. The upper right (HL1) and lower left (LH1) subband images are obtained by taking a high frequency band component in the horizontal direction and taking out a low frequency band component in the vertical direction, and taking a low frequency band component in the horizontal direction, respectively. A high frequency band component is extracted in the vertical direction.

さらに、サブバンド画像LL1をウェーブレット変換すると、画像サイズを半分にして、サブバンド画像LL2、HL2、LH2、HH2に分解することができ、分解して得られたサブバンド画像LLに対して変換レベル回数だけ分解することができる。   Further, when the subband image LL1 is wavelet transformed, the image size can be halved and decomposed into subband images LL2, HL2, LH2, and HH2, and the conversion level for the subband image LL obtained by the decomposition can be reduced. It can be disassembled as many times as possible.

ウェーブレット変換を用いてノイズ低減処理を行う方法として、スレッショルディングが知られている。これは、設定したしきい値より小さい量の成分をノイズとみなし、そのノイズを低減する方法である。ウェーブレット空間上でのしきい値処理は、サブバンド画像LL以外のサブバンド画像に対して行われ、以下の式(10)に示されるように、しきい値以下の絶対値を有するウェーブレット係数wsubband(x,y)を0に置き換えてデノイジングを行う。 Thresholding is known as a method for performing noise reduction processing using wavelet transform. In this method, a component having an amount smaller than a set threshold value is regarded as noise, and the noise is reduced. The threshold processing on the wavelet space is performed on the subband images other than the subband image LL, and the wavelet coefficient w having an absolute value equal to or smaller than the threshold is represented by the following equation (10). Denoising is performed by replacing subband (x, y) with 0.

式(10)において、x、yはそれぞれ、画像の縦と横の座標であり、ρsubbandは重みパラメータ、σはノイズの標準偏差である。第2のぼけ推定領域に含まれるノイズ量σは、第2のぼけ推定領域から測定または推定することにより求められる。ノイズが実空間および周波数空間において一様なホワイトガウシアンノイズである場合、第2のぼけ推定領域のノイズを、以下の式(11)に示されるようなMAD(Median Absolute Deviation)から推定する手法が知られている。 In Equation (10), x and y are the vertical and horizontal coordinates of the image, ρ subband is a weight parameter, and σ is a standard deviation of noise. The amount of noise σ included in the second blur estimation area is obtained by measuring or estimating from the second blur estimation area. When the noise is white Gaussian noise that is uniform in real space and frequency space, there is a technique for estimating the noise in the second blur estimation region from MAD (Media Absolute Deviation) as shown in the following equation (11). Are known.

MADは、第2のぼけ推定領域をウェーブレット変換して得られたサブバンド画像HH1におけるウェーブレット係数wHH1のメディアン(中央値)を用いて求められる。標準偏差とMADとは、以下の式(12)に示される関係であることから、ノイズ成分の標準偏差を推定することができる。 The MAD is obtained by using the median (median value) of the wavelet coefficient w HH1 in the subband image HH1 obtained by wavelet transform of the second blur estimation region. Since the standard deviation and the MAD have the relationship shown in the following formula (12), the standard deviation of the noise component can be estimated.

なお、式(11)、(12)に代えて、撮影条件(撮影の際におけるISO感度)に基づいてノイズ量σを取得してもよい。 In place of the equations (11) and (12), the noise amount σ may be acquired based on the shooting condition (ISO sensitivity at the time of shooting).

続いてステップS202において、生成部1082は、第2のぼけ推定領域の解像度を低下させ、低解像ぼけ推定領域を生成する。第2のぼけ推定領域の解像度を低下させることにより、推定するぼけの解像度も同様に低下する。その結果、後述するぼけ推定の収束性が向上し、かつ、推定結果が最適解とは異なる局所解へ落ち込む可能性を低減することができる。第2のぼけ推定領域の解像度を下げる割合は、ダウンサンプリングパラメータに応じて決定される。ステップS202は、ループ処理(反復演算)によって複数回実行されるが、初回の実行時には、所定のダウンサンプリングパラメータが用いられる。2回目以降の実行の際には、後述のステップS208にて設定されたダウンサンプリングパラメータを用いて、低解像ぼけ推定領域を生成する。ループを反復する度に、解像度の低下量は小さくなり、低解像ぼけ推定領域の解像度は、第2のぼけ推定領域に徐々に近づく。すなわち、最初は低解像のぼけを推定し、その推定結果を新たな初期値として、解像度を少しずつ上げながら推定を繰り返す。これにより、局所解を回避して最適なぼけを推定することができる。なお、低解像ぼけ推定領域の解像度は、第2のぼけ推定領域の解像度以下であり、両者の解像度が一致することもある。   Subsequently, in step S202, the generation unit 1082 reduces the resolution of the second blur estimation area and generates a low-resolution blur estimation area. By reducing the resolution of the second blur estimation area, the resolution of the blur to be estimated is similarly reduced. As a result, the convergence of the blur estimation described later can be improved, and the possibility that the estimation result falls into a local solution different from the optimal solution can be reduced. The rate of lowering the resolution of the second blur estimation area is determined according to the downsampling parameter. Step S202 is executed a plurality of times by loop processing (repetitive calculation), but a predetermined downsampling parameter is used at the first execution. In the second and subsequent executions, a low-resolution blur estimation region is generated using the downsampling parameters set in step S208 described later. Each time the loop is repeated, the amount of decrease in resolution decreases, and the resolution of the low-resolution blur estimation area gradually approaches the second blur estimation area. That is, at first, low-resolution blur is estimated, and the estimation result is used as a new initial value, and the estimation is repeated while gradually increasing the resolution. Thereby, it is possible to estimate the optimum blur while avoiding the local solution. Note that the resolution of the low-resolution blur estimation area is equal to or lower than the resolution of the second blur estimation area, and the resolutions of both may be the same.

続いてステップS203において、生成部1082は、低解像ぼけ推定領域における信号勾配(信号に関する情報)のぼけを補正して、補正信号勾配(補正信号に関する情報)を生成する(補正処理)。補正信号勾配の生成には、前述のように、式(2)を用いた最適化やその他の超解像、逆フィルタなどを用いる。ぼけ補正に用いるPSFは、前のループにおけるステップS204にて推定された結果(ぼけ)を用いる。ループの初回においては、適当な形状のPSF(Gauss分布や1次元のラインなど)を用いる。続いてステップS204において、生成部1082は、低解像ぼけ推定領域の信号勾配と補正信号勾配とに基づいて、ぼけを推定する(ぼけの推定処理)。ぼけの推定には、式(6)または式(6a)による最適化などを用いる。   Subsequently, in step S203, the generation unit 1082 corrects the blur of the signal gradient (information about the signal) in the low-resolution blur estimation region, and generates a correction signal gradient (information about the correction signal) (correction processing). As described above, the correction using the equation (2), other super-resolution, an inverse filter, and the like are used to generate the correction signal gradient. The PSF used for blur correction uses the result (blur) estimated in step S204 in the previous loop. At the first time of the loop, an appropriately shaped PSF (Gauss distribution, one-dimensional line, etc.) is used. Subsequently, in step S204, the generation unit 1082 estimates blur based on the signal gradient and the correction signal gradient in the low-resolution blur estimation region (blur estimation process). For the estimation of the blur, optimization by the formula (6) or the formula (6a) is used.

続いてステップS205において、生成部1082は、ステップS204(第2の推定処理)にて推定されたぼけ(第2のぼけ)と、前ループのステップS204(第1の推定処理)にて推定されたぼけ(第1のぼけ)とを比較する。具体的には、生成部1082は、第1のぼけと第2のぼけとの差異が所定値(第2の閾値)以下であるか否かを判定する。この差異が所定値以下である場合、ステップS207へ進む。一方、この差異が所定値よりも大きい場合、ステップS206へ進む。ステップS202にて説明したとおり、本実施例においては、第2のぼけ推定領域内の解像度を変更しながら、補正信号勾配の生成(補正処理)とぼけの推定(推定処理)をループさせる。ループ初期の低解像ぼけ推定領域は、画素数が少ないため、ぼけの推定結果は収束しやすい。一方、ループを繰り返して低解像ぼけ推定領域の画素数が多くなると、結果は収束しにくくなる。さらにエッジなどの信号変化が不足していると、推定したぼけは正しい値から大きく外れてしまう。これを回避するため、生成部1082は、現在のループで推定したぼけと前のループのぼけの差異を評価する。ここでは、現ループと前ループにおけるぼけのいずれか一方をバイリニア補間により、他方と同じ成分数にリサイズし、各成分の二乗和を取って差異を評価する。ただし本実施例は、これに限定されるものではなく、他の手法を用いてもよい。両方のぼけの差異が所定値よりも大きい場合、現ループにおいてぼけ推定に必要な信号変化の情報が不足して推定精度が低下していると考えられる。このため生成部1082は、ステップS206にて第2のぼけ推定領域を広げ、再度、ぼけ推定を行う。ループ初回においては、前のループの推定ぼけが存在しないため、ステップS205を実行することなくステップS207へ進む。   Subsequently, in step S205, the generation unit 1082 estimates the blur estimated in step S204 (second estimation process) (second blur) and the previous loop in step S204 (first estimation process). Compare with blur (first blur). Specifically, the generation unit 1082 determines whether or not the difference between the first blur and the second blur is equal to or less than a predetermined value (second threshold). If this difference is less than or equal to the predetermined value, the process proceeds to step S207. On the other hand, if the difference is greater than the predetermined value, the process proceeds to step S206. As described in step S202, in the present embodiment, the correction signal gradient generation (correction processing) and blur estimation (estimation processing) are looped while changing the resolution in the second blur estimation region. Since the low-resolution blur estimation region at the beginning of the loop has a small number of pixels, the blur estimation result is likely to converge. On the other hand, if the number of pixels in the low-resolution blur estimation area increases by repeating the loop, the result becomes difficult to converge. Further, if the signal change such as the edge is insufficient, the estimated blur is greatly deviated from the correct value. In order to avoid this, the generation unit 1082 evaluates the difference between the blur estimated in the current loop and the blur in the previous loop. Here, one of the blur in the current loop and the previous loop is resized to the same number of components as the other by bilinear interpolation, and the difference is evaluated by taking the sum of squares of each component. However, the present embodiment is not limited to this, and other methods may be used. When the difference between the two blurs is larger than a predetermined value, it is considered that the estimation accuracy is lowered due to insufficient signal change information necessary for blur estimation in the current loop. For this reason, the generation unit 1082 expands the second blur estimation area in step S206 and performs blur estimation again. In the first loop, since there is no estimated blur of the previous loop, the process proceeds to step S207 without executing step S205.

ステップS206において、生成部1082は、第2のぼけ推定領域の面積を大きくする。この理由は、前述のとおりである。そしてステップS202に戻り、生成部1082は、新たな第2のぼけ推定領域において低解像ぼけ推定領域を生成し、補正信号勾配を生成する。この際、面積を大きくした第2のぼけ推定領域にもステップS201にて説明したデノイジングを行うことが好ましい。   In step S206, the generation unit 1082 increases the area of the second blur estimation region. The reason is as described above. Then, returning to step S202, the generation unit 1082 generates a low-resolution blur estimation region in the new second blur estimation region, and generates a correction signal gradient. At this time, it is preferable to perform the denoising described in step S <b> 201 also on the second blur estimation region having an enlarged area.

ステップS207において、生成部1082は、反復(ループ)演算が完了したか否か、すなわち第2のぼけ推定領域と低解像ぼけ推定領域との解像度差が所定値よりも小さいか否か、を判定する。この判定は、第2のぼけ推定領域の解像度と低解像ぼけ推定領域の解像度とを比較することにより行われる。両者の解像度差が所定値よりも小さい場合、反復演算を終了する。そして、ステップS204にて推定されたぼけを最終的な推定ぼけとして、ステップS209へ進む。両者の解像度差が所定値よりも小さいか否かは、両者の解像度差の絶対値が所定値よりも小さいか否かに限定されるものではなく、両者の画素数差の絶対値が所定値よりも小さいか否か、または、両者の画素数の比が所定値よりも1に近いか否かなどで判定してもよい。所定の条件を満たさない場合(例えば、両者の解像度差の絶対値が所定値よりも大きい場合)、推定されたぼけの解像度がまだ不充分であるため、ステップS208へ進み、反復演算を行う。   In step S207, the generation unit 1082 determines whether or not the iterative (loop) calculation is completed, that is, whether or not the resolution difference between the second blur estimation area and the low-resolution blur estimation area is smaller than a predetermined value. judge. This determination is performed by comparing the resolution of the second blur estimation area with the resolution of the low-resolution blur estimation area. When the resolution difference between the two is smaller than a predetermined value, the iterative calculation is terminated. Then, the blur estimated in step S204 is regarded as the final estimated blur, and the process proceeds to step S209. Whether or not the resolution difference between the two is smaller than a predetermined value is not limited to whether or not the absolute value of the resolution difference between the two is smaller than the predetermined value, and the absolute value of the difference in the number of pixels between the two is a predetermined value. It may be determined based on whether or not the ratio is smaller, or whether the ratio of the number of pixels is closer to 1 than a predetermined value. When the predetermined condition is not satisfied (for example, when the absolute value of the resolution difference between the two is larger than the predetermined value), the estimated blur resolution is still insufficient, so the process proceeds to step S208, and the iterative calculation is performed.

ステップS208において、生成部1082は、ステップS202にて用いられるダウンサンプリングパラメータを設定する。ステップS202〜S206を反復する過程で解像度を上げていくため、ここでは前のループよりもダウンサンプリングの度合いを弱めるように(解像度低下量を下げるように)パラメータを設定する。また、反復演算では、前ループのステップS204にて推定されたぼけを新たな初期解として用いるが、その際、ぼけの解像度を上げる必要がある。解像度の向上には、バイリニア補間やバイキュービック補間を用いることが好ましい。   In step S208, the generation unit 1082 sets downsampling parameters used in step S202. In order to increase the resolution in the process of repeating steps S202 to S206, parameters are set so that the degree of downsampling is weaker than that of the previous loop (so that the amount of resolution decrease is reduced). In the iterative calculation, the blur estimated in step S204 of the previous loop is used as a new initial solution. At this time, it is necessary to increase the resolution of the blur. In order to improve the resolution, it is preferable to use bilinear interpolation or bicubic interpolation.

ステップS209において、生成部1082は、ステップS204にて推定されたぼけ(推定ぼけ)のデノイジングを行う。式(1)に示されるように、ぼけ画像(第2のぼけ推定領域)にはノイズが存在するため、その影響を受けて推定PSFにもノイズが発生する。このため、生成部1082はデノイジング処理を行う。デノイジング処理を行う際は、スレッショルディング処理、孤立点を除去するオープニング処理、または、平滑化フィルタや前述の周波数分解を用いたデノイジング処理などを用いることが好ましい。   In step S209, the generation unit 1082 performs denoising of the blur (estimated blur) estimated in step S204. As shown in Expression (1), since noise exists in the blurred image (second blur estimation region), noise is also generated in the estimated PSF due to the influence. Therefore, the generation unit 1082 performs a denoising process. When performing the denoising process, it is preferable to use a thresholding process, an opening process for removing isolated points, or a denoising process using a smoothing filter or the above-described frequency decomposition.

本実施例によれば、ぼけ画像の信号変化が少ない領域からぼけを推定する際、推定精度の低下を抑制可能な画像処理システムを提供することができる。   According to the present embodiment, it is possible to provide an image processing system capable of suppressing a decrease in estimation accuracy when blur is estimated from an area where a signal change of a blurred image is small.

次に、図7を参照して、本発明の実施例2における画像処理システムについて説明する。図7は、本実施例における画像処理システム300のブロック図である。   Next, an image processing system according to the second embodiment of the present invention will be described with reference to FIG. FIG. 7 is a block diagram of the image processing system 300 in the present embodiment.

本実施例の画像処理システム300は、ぼけ補正部108を有する画像処理装置105に代えて、推定ぼけ生成部308を有する画像処理装置305を備えている点で、実施例1の画像処理システム100とは異なる。本実施例の画像処理システム300は、実施例1の画像処理システム100よりも簡易な処理により、ぼけ推定を行うことが可能である。推定ぼけ生成部308は、撮像装置101にて撮像されたぼけ画像からぼけ成分を推定して出力する。画像処理システム300のそれ以外の部位は、実施例1の画像処理システム100と同様であるため、それらの説明は省略する。   The image processing system 300 according to the present embodiment includes an image processing device 305 having an estimated blur generation unit 308 instead of the image processing device 105 having the blur correction unit 108. Is different. The image processing system 300 according to the present exemplary embodiment can perform blur estimation by a simpler process than the image processing system 100 according to the first exemplary embodiment. The estimated blur generation unit 308 estimates and outputs a blur component from the blur image captured by the imaging device 101. Since other parts of the image processing system 300 are the same as those of the image processing system 100 of the first embodiment, description thereof is omitted.

次に、図8を参照して、推定ぼけ生成部308で行われる画像処理に関して説明する。図8は、本実施例の画像処理方法を示すフローチャートである。図8の各ステップは、推定ぼけ生成部308の取得部3081(取得手段)および生成部3082(生成手段)により実行される。   Next, image processing performed by the estimated blur generation unit 308 will be described with reference to FIG. FIG. 8 is a flowchart showing the image processing method of the present embodiment. Each step in FIG. 8 is executed by the acquisition unit 3081 (acquisition unit) and the generation unit 3082 (generation unit) of the estimated blur generation unit 308.

まずステップS301において、推定ぼけ生成部308の取得部3081は、ぼけ画像を取得する。なおステップS301は、図1を参照して説明した実施例1のステップS101と同様である。続いてステップS302において、推定ぼけ生成部308の生成部3082は、ぼけ画像から、第1のぼけ推定領域、および、第1のぼけ推定領域における信号変化の量(信号変化量)を取得する。信号変化の量についての具体的な説明は、実施例1におけるステップS104と同様である。   First, in step S301, the acquisition unit 3081 of the estimated blur generation unit 308 acquires a blurred image. Note that step S301 is the same as step S101 of the first embodiment described with reference to FIG. Subsequently, in step S302, the generation unit 3082 of the estimated blur generation unit 308 acquires a first blur estimation region and a signal change amount (signal change amount) in the first blur estimation region from the blur image. A specific description of the amount of signal change is the same as that in step S104 in the first embodiment.

続いてステップS303において、生成部3082は、ぼけ画像から第2のぼけ推定領域を取得する。ステップS302にて取得した信号変化量が閾値(第1の閾値)以上である場合、生成部3082は、第1のぼけ推定領域を第2のぼけ推定領域とする。一方、信号変化量が閾値よりも小さい場合、生成部3082は、第1のぼけ推定領域よりも面積の大きい第2のぼけ推定領域を取得する。本実施例において、第2のぼけ推定領域は、その中心位置が常に第1のぼけ推定領域の中心位置と同じであり、第1のぼけ推定領域と比較してその面積が所定値だけ比例倍された領域である。これは、図5(B)に示される第2のぼけ推定領域203bのように、第2のぼけ推定領域を取得するということである。   Subsequently, in step S303, the generation unit 3082 acquires a second blur estimation area from the blur image. If the signal change amount acquired in step S302 is equal to or greater than the threshold (first threshold), the generation unit 3082 sets the first blur estimation area as the second blur estimation area. On the other hand, when the signal change amount is smaller than the threshold value, the generation unit 3082 acquires a second blur estimation area having a larger area than the first blur estimation area. In the present embodiment, the center position of the second blur estimation area is always the same as the center position of the first blur estimation area, and its area is proportionally multiplied by a predetermined value compared to the first blur estimation area. This is the area that has been This means that the second blur estimation area is acquired as in the second blur estimation area 203b shown in FIG.

続いてステップS304において、生成部3082は、第2のぼけ推定領域の信号勾配(信号に関する情報)を補正して、補正信号勾配(補正信号に関する情報)を生成する(補正処理)。この補正処理は、実施例1のステップS203における補正処理と同様である。続いてステップS305において、生成部3082は、第2のぼけ推定領域における信号勾配と、ステップS304にて生成された補正信号勾配とに基づいて、ぼけを推定する(ぼけの推定処理)。この推定処理は、実施例1のステップS204における推定処理と同様である。   Subsequently, in step S304, the generation unit 3082 corrects the signal gradient (information related to the signal) in the second blur estimation region, and generates a correction signal gradient (information related to the correction signal) (correction processing). This correction process is the same as the correction process in step S203 of the first embodiment. Subsequently, in step S305, the generation unit 3082 estimates blur based on the signal gradient in the second blur estimation region and the correction signal gradient generated in step S304 (blur estimation process). This estimation process is the same as the estimation process in step S204 of the first embodiment.

続いてステップS306において、生成部3082は、ステップS305にて推定したぼけが収束したか否かを判定する。ぼけが収束した場合、ステップS307へ進む。一方、ぼけが収束していない場合、ステップS304へ戻る。ステップS304へ戻った場合、生成部3082は、ステップS305にて推定したぼけを用いて、ステップS304において新たに補正信号勾配を生成する。推定したぼけが収束したか否かの判定方法は、例えば、補正信号勾配を推定したぼけで劣化させた値と、第2のぼけ推定領域の信号勾配との差、またはそれらの比を求め、所定値と比べればよい。または、ステップS305にて共役勾配法などの繰り返し演算でぼけを推定している場合、この繰り返し演算によるぼけの更新量が所定値よりも小さいか否かにより判定してもよい。ぼけが収束した場合、生成部3082は、ステップS305にて推定されたぼけを第1のぼけ推定領域における最終的な推定ぼけとする。   Subsequently, in step S306, the generation unit 3082 determines whether the blur estimated in step S305 has converged. If the blur has converged, the process proceeds to step S307. On the other hand, if the blur has not converged, the process returns to step S304. When the processing returns to step S304, the generation unit 3082 newly generates a correction signal gradient in step S304 using the blur estimated in step S305. The method of determining whether or not the estimated blur has converged is, for example, obtaining a difference between the value obtained by degrading the correction signal gradient due to the estimated blur and the signal gradient of the second blur estimation region, or a ratio thereof. What is necessary is just to compare with a predetermined value. Alternatively, when blur is estimated by iterative calculation such as the conjugate gradient method in step S305, determination may be made based on whether or not the update amount of blur by this iterative calculation is smaller than a predetermined value. When the blur converges, the generation unit 3082 sets the blur estimated in step S305 as the final estimated blur in the first blur estimation region.

続いてステップS307において、生成部3082は、ぼけ画像における所定の領域(例えば、ぼけ画像の全体)に対して、推定ぼけの生成が完了したか否かを判定する。推定ぼけの生成が完了している場合、ステップS308へ進む。一方、推定ぼけの生成が完了していない場合、ステップS302へ戻る。なおステップS307は、実施例1のステップS106と同様である。   Subsequently, in step S307, the generation unit 3082 determines whether or not generation of estimated blur has been completed for a predetermined region (for example, the entire blurred image) in the blurred image. If the generation of the estimated blur has been completed, the process proceeds to step S308. On the other hand, if the generation of the estimated blur has not been completed, the process returns to step S302. Step S307 is the same as step S106 in the first embodiment.

ステップS308において、生成部3082は、生成された推定ぼけを出力する。ぼけ画像における所定の領域内に複数の第1のぼけ推定領域が含まれる場合、生成部3082は複数の推定ぼけを出力する。このとき、複数の推定ぼけを求める途中で逐次出力しても構わない。出力された推定ぼけは、ぼけ画像の補正、撮影した光学系の光学性能測定、または、撮影の際の手ぶれの解析などに用いることができる。   In step S308, the generation unit 3082 outputs the generated estimated blur. When a plurality of first blur estimation regions are included in a predetermined region in the blurred image, the generation unit 3082 outputs a plurality of estimated blurs. At this time, you may output sequentially in the middle of calculating | requiring several estimation blur. The output estimated blur can be used for correcting a blurred image, measuring optical performance of a photographed optical system, or analyzing camera shake during photographing.

本実施例によれば、ぼけ画像の信号変化が少ない領域からぼけを推定する際、推定精度の低下を抑制可能な画像処理システムを提供することができる。   According to the present embodiment, it is possible to provide an image processing system capable of suppressing a decrease in estimation accuracy when blur is estimated from an area where a signal change of a blurred image is small.

次に、図9および図10を参照して、本発明の実施例3における撮像システムについて説明する。図9は、本実施例における撮像システム400のブロック図である。図10は、撮像システム400の外観図である。   Next, an imaging system according to Embodiment 3 of the present invention will be described with reference to FIGS. FIG. 9 is a block diagram of the imaging system 400 in the present embodiment. FIG. 10 is an external view of the imaging system 400.

撮像システム400は、撮像装置401、ネットワーク402、および、サーバ403(画像処理装置)により構成される。撮像装置401とサーバ403とは無線で接続されており、撮像装置401からの画像はサーバ403へ転送され、サーバ403がぼけの推定および補正を行う。   The imaging system 400 includes an imaging device 401, a network 402, and a server 403 (image processing device). The imaging apparatus 401 and the server 403 are connected wirelessly, and an image from the imaging apparatus 401 is transferred to the server 403, and the server 403 performs blur estimation and correction.

サーバ403は、通信部404、記憶部405、および、ぼけ補正部406(画像処理部)を有する。サーバ403の通信部404は、ネットワーク402を介して撮像装置401と接続されている。本実施例において、撮像装置401とサーバ403とは無線で接続されているが、これに限定されるものではなく、有線で接続されてもよい。サーバ403の通信部404は、撮像装置401からぼけ画像を受信するように構成されている。撮像装置401により撮影が行われると、ぼけ画像(入力画像または撮影画像)は、自動的または手動でサーバ403に入力され、記憶部405およびぼけ補正部406に送られる。記憶部405は、ぼけ画像およびそのぼけ画像を撮影した撮影条件に関する情報を記憶する。ぼけ補正部406は、ぼけ画像に基づいてぼけ(推定ぼけ)を推定する。そしてぼけ補正部406は、推定ぼけに基づいて、ぼけ補正画像を生成する。ぼけ補正画像は、記憶部405に記憶されるか、または、通信部404を介して撮像装置401へ送られる。   The server 403 includes a communication unit 404, a storage unit 405, and a blur correction unit 406 (image processing unit). A communication unit 404 of the server 403 is connected to the imaging device 401 via the network 402. In this embodiment, the imaging device 401 and the server 403 are connected wirelessly, but the present invention is not limited to this, and may be connected by wire. The communication unit 404 of the server 403 is configured to receive a blurred image from the imaging device 401. When shooting is performed by the imaging device 401, a blurred image (input image or captured image) is automatically or manually input to the server 403 and sent to the storage unit 405 and the blur correction unit 406. The storage unit 405 stores information regarding a blurred image and shooting conditions for shooting the blurred image. The blur correction unit 406 estimates blur (estimated blur) based on the blur image. Then, the blur correction unit 406 generates a blur correction image based on the estimated blur. The blur correction image is stored in the storage unit 405 or sent to the imaging device 401 via the communication unit 404.

本実施例の画像処理方法を実現するため、ソフトウエア(画像処理プログラム)を、ネットワーク、またはCD−ROMなどの記憶媒体を介して、サーバ403に供給することもできる。この際、画像処理プログラムは、サーバ403のコンピュータ(またはCPUやMPUなど)により読み出されて、サーバ403の機能を実行する。   In order to realize the image processing method of the present embodiment, software (image processing program) can be supplied to the server 403 via a network or a storage medium such as a CD-ROM. At this time, the image processing program is read by the computer (or CPU, MPU, etc.) of the server 403 and executes the function of the server 403.

なお、ぼけ補正部406で行われる処理は、図1および図4を参照して説明した実施例1の画像処理方法と同様であるため、その説明は省略する。本実施例によれば、ぼけ画像における信号変化の量が少ない領域からぼけを推定する際、推定精度の低下を抑制可能な撮像システムを提供することができる。   Note that the processing performed by the blur correction unit 406 is the same as the image processing method according to the first embodiment described with reference to FIGS. 1 and 4, and thus description thereof is omitted. According to the present embodiment, it is possible to provide an imaging system capable of suppressing a decrease in estimation accuracy when blur is estimated from an area where the amount of signal change in a blurred image is small.

このように各実施例において、画像処理装置(画像処理装置105、305、サーバ403)は、取得手段(取得部1081、3081)および生成手段(生成部1082、3082)を有する。取得手段は、ぼけ画像(撮影画像または入力画像)を取得する。生成手段は、ぼけ画像における少なくとも一部の第1のぼけ推定領域を取得し、推定ぼけを生成する。また生成手段は、第1のぼけ推定領域における信号変化の量に基づいて、第2のぼけ推定領域を決定する。そして生成手段は、第2のぼけ推定領域における信号に関する情報に含まれるぼけを補正して補正信号に関する情報を生成する補正処理と、信号に関する情報と補正信号に関する情報とに基づいてぼけを推定する推定処理と、を反復する反復演算処理を行う。これにより、生成手段は推定ぼけを生成する。   As described above, in each embodiment, the image processing apparatus (the image processing apparatuses 105 and 305 and the server 403) includes an acquisition unit (acquisition units 1081 and 3081) and a generation unit (generation units 1082 and 3082). The acquisition unit acquires a blurred image (a captured image or an input image). The generation unit acquires at least a part of the first blur estimation region in the blur image and generates an estimated blur. In addition, the generation unit determines the second blur estimation area based on the amount of signal change in the first blur estimation area. The generation unit estimates the blur based on the correction processing for correcting the blur included in the information on the signal in the second blur estimation region to generate the information on the correction signal, and the information on the signal and the information on the correction signal. An iterative calculation process that repeats the estimation process is performed. Thereby, the generation means generates an estimated blur.

好ましくは、第2のぼけ推定領域における信号変化の量は、第1のぼけ推定領域における信号変化の量以上である。また好ましくは、生成手段は、第1のぼけ推定領域における信号変化の量が第1の閾値よりも大きい場合、第1のぼけ推定領域を第2のぼけ推定領域として決定する。また生成手段は、第1のぼけ推定領域における信号変化の量が第1の閾値よりも小さい場合、第1のぼけ推定領域よりも信号変化の量が大きい第2のぼけ推定領域を決定する。より好ましくは、生成手段は、第1のぼけ推定領域における信号変化の量が第1の閾値よりも小さい場合、第1のぼけ推定領域とは異なる位置または形状の第2のぼけ推定領域を決定する。また好ましくは、生成手段は、第1のぼけ推定領域における信号変化の量が第1の閾値よりも小さい場合、第1のぼけ推定領域よりも面積が大きい第2のぼけ推定領域を決定する。また好ましくは、第2のぼけ推定領域は、第1のぼけ推定領域の半分以上を含む。より好ましくは、第2のぼけ推定領域は、第1のぼけ推定領域の全てを含む。また好ましくは、生成手段は、被写体空間の距離情報を取得し、被写体空間の距離情報に基づいて第2のぼけ推定領域を決定する。   Preferably, the amount of signal change in the second blur estimation region is equal to or greater than the amount of signal change in the first blur estimation region. Preferably, the generating unit determines the first blur estimation area as the second blur estimation area when the amount of signal change in the first blur estimation area is larger than the first threshold. In addition, when the amount of signal change in the first blur estimation region is smaller than the first threshold, the generation unit determines a second blur estimation region in which the amount of signal change is larger than that of the first blur estimation region. More preferably, when the amount of signal change in the first blur estimation area is smaller than the first threshold, the generation unit determines a second blur estimation area having a position or shape different from that of the first blur estimation area. To do. Further preferably, when the amount of signal change in the first blur estimation area is smaller than the first threshold, the generation unit determines a second blur estimation area having an area larger than that of the first blur estimation area. Preferably, the second blur estimation area includes at least half of the first blur estimation area. More preferably, the second blur estimation area includes all of the first blur estimation area. Preferably, the generation unit acquires distance information of the subject space, and determines a second blur estimation area based on the distance information of the subject space.

好ましくは、生成手段は、反復演算処理の推定処理として、第1の推定処理および第1の推定処理よりも後に第2の推定処理を行う。また生成手段は、第1の推定処理において推定された第1のぼけと、第2の推定処理において推定された第2のぼけとの差異を判定する。そして生成手段は、差異が第2の閾値よりも大きい場合、第2のぼけ推定領域の面積を大きくして、再度、推定処理を行う(S205、S206)。   Preferably, the generation unit performs the second estimation process after the first estimation process and the first estimation process as the estimation process of the iterative calculation process. The generation unit determines a difference between the first blur estimated in the first estimation process and the second blur estimated in the second estimation process. When the difference is larger than the second threshold, the generation unit increases the area of the second blur estimation region and performs the estimation process again (S205 and S206).

好ましくは、生成手段は、第2のぼけ推定領域の解像度を低下させて低解像ぼけ推定領域を生成する。また生成手段は、低解像ぼけ推定領域において、信号に関する情報に含まれるぼけを補正して補正信号に関する情報を生成する補正処理と、信号に関する情報と補正信号に関する情報とに基づいてぼけを推定する推定処理とを反復する反復演算処理を行う。これにより、生成手段は推定ぼけを生成する。また生成手段は、反復演算処理の過程において、低解像ぼけ推定領域の解像度を第2のぼけ推定領域の解像度に近づける(S208)。   Preferably, the generation unit generates a low-resolution blur estimation area by reducing the resolution of the second blur estimation area. Further, the generation unit estimates the blur based on the correction processing for generating the information on the correction signal by correcting the blur included in the information on the signal in the low-resolution blur estimation region, and the information on the signal and the information on the correction signal. Iterative calculation processing is performed to repeat the estimation processing to be performed. Thereby, the generation means generates an estimated blur. Further, the generation means brings the resolution of the low-resolution blur estimation area closer to the resolution of the second blur estimation area in the process of the iterative calculation process (S208).

好ましくは、生成手段は、第2のぼけ推定領域に含まれるノイズ量を取得し、第2のぼけ推定領域を周波数分解して周波数分解ぼけ推定領域を生成する。そして生成手段は、ノイズ量に基づいて周波数分解ぼけ推定領域に対するデノイジング処理を行い、デノイジング処理後の周波数分解ぼけ推定領域を再合成する(S201)。   Preferably, the generation unit acquires the amount of noise included in the second blur estimation area, and generates a frequency resolution blur estimation area by performing frequency decomposition on the second blur estimation area. Then, the generation unit performs denoising processing on the frequency resolution blur estimation region based on the amount of noise, and re-synthesizes the frequency resolution blur estimation region after the denoising processing (S201).

好ましくは、画像処理装置は、推定ぼけを用いてぼけ画像の少なくとも一部を補正する補正手段(補正部1083)を有する。また好ましくは、第1のぼけ推定領域における信号変化の量は、第1のぼけ推定領域における輝度分布の微分値の絶対値和または二乗和に相当する量である。また好ましくは、信号に関する情報は、第2のぼけ推定領域における輝度分布または輝度分布の微分値に関する情報である。   Preferably, the image processing apparatus includes a correction unit (correction unit 1083) that corrects at least a part of the blurred image using the estimated blur. Further preferably, the amount of signal change in the first blur estimation region is an amount corresponding to the sum of absolute values or the sum of squares of the differential values of the luminance distribution in the first blur estimation region. Preferably, the information related to the signal is information related to a luminance distribution or a differential value of the luminance distribution in the second blur estimation region.

(その他の実施例)
本発明は、上述の実施例の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.

各実施例によれば、ぼけ画像における信号変化が少ない領域からぼけを推定する際、推定精度の低下を抑制可能な画像処理装置、撮像装置、画像処理方法、画像処理プログラム、および、記憶媒体を提供することができる。   According to each embodiment, an image processing device, an imaging device, an image processing method, an image processing program, and a storage medium that can suppress a decrease in estimation accuracy when blur is estimated from an area where a signal change in a blurred image is small. Can be provided.

以上、本発明の好ましい実施例について説明したが、本発明はこれらの実施例に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。   As mentioned above, although the preferable Example of this invention was described, this invention is not limited to these Examples, A various deformation | transformation and change are possible within the range of the summary.

105、305 画像処理装置
1081、3081 取得部(取得手段)
1082、3082 生成部(生成手段)
105, 305 Image processing apparatus 1081, 3081 Acquisition unit (acquisition means)
1082, 3082 Generation unit (generation means)

Claims (18)

ぼけ画像を取得する取得手段と、
前記ぼけ画像における少なくとも一部の第1のぼけ推定領域を取得し、推定ぼけを生成する生成手段と、を有し、
前記生成手段は、
前記第1のぼけ推定領域における信号変化の量に基づいて、第2のぼけ推定領域を決定し、
前記第2のぼけ推定領域における信号に関する情報に含まれるぼけを補正して補正信号に関する情報を生成する補正処理と、該信号に関する情報と該補正信号に関する情報とに基づいてぼけを推定する推定処理と、を反復する反復演算処理を行って前記推定ぼけを生成する、ことを特徴とする画像処理装置。
An acquisition means for acquiring a blurred image;
Generating means for acquiring at least a part of a first blur estimation region in the blur image and generating an estimated blur;
The generating means includes
Determining a second blur estimation region based on the amount of signal change in the first blur estimation region;
Correction processing for correcting the blur included in the information regarding the signal in the second blur estimation region to generate information regarding the correction signal, and estimation processing for estimating the blur based on the information regarding the signal and the information regarding the correction signal And generating the estimated blur by performing an iterative calculation process that repeats the above.
前記第2のぼけ推定領域における信号変化の量は、前記第1のぼけ推定領域における前記信号変化の量以上であることを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the amount of signal change in the second blur estimation region is equal to or greater than the amount of signal change in the first blur estimation region. 前記生成手段は、
前記第1のぼけ推定領域における前記信号変化の量が第1の閾値よりも大きい場合、該第1のぼけ推定領域を前記第2のぼけ推定領域として決定し、
前記第1のぼけ推定領域における前記信号変化の量が前記第1の閾値よりも小さい場合、該第1のぼけ推定領域よりも信号変化の量が大きい前記第2のぼけ推定領域を決定する、ことを特徴とする請求項1または2に記載の画像処理装置。
The generating means includes
If the amount of signal change in the first blur estimation area is greater than a first threshold, determine the first blur estimation area as the second blur estimation area;
When the amount of signal change in the first blur estimation region is smaller than the first threshold, determine the second blur estimation region having a larger amount of signal change than the first blur estimation region; The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記生成手段は、前記第1のぼけ推定領域における前記信号変化の量が前記第1の閾値よりも小さい場合、該第1のぼけ推定領域とは異なる位置または形状の前記第2のぼけ推定領域を決定することを特徴とする請求項3に記載の画像処理装置。   When the signal change amount in the first blur estimation area is smaller than the first threshold, the generation unit generates the second blur estimation area at a position or shape different from that of the first blur estimation area. The image processing apparatus according to claim 3, wherein: 前記生成手段は、前記第1のぼけ推定領域における前記信号変化の量が前記第1の閾値よりも小さい場合、該第1のぼけ推定領域よりも面積が大きい前記第2のぼけ推定領域を決定することを特徴とする請求項3に記載の画像処理装置。   The generation unit determines the second blur estimation area having an area larger than that of the first blur estimation area when the amount of the signal change in the first blur estimation area is smaller than the first threshold. The image processing apparatus according to claim 3, wherein: 前記第2のぼけ推定領域は、前記第1のぼけ推定領域の半分以上を含むことを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the second blur estimation area includes half or more of the first blur estimation area. 前記第2のぼけ推定領域は、前記第1のぼけ推定領域の全てを含むことを特徴とする請求項6に記載の画像処理装置。   The image processing apparatus according to claim 6, wherein the second blur estimation area includes all of the first blur estimation area. 前記生成手段は、
被写体空間の距離情報を取得し、
前記被写体空間の距離情報に基づいて前記第2のぼけ推定領域を決定する、ことを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。
The generating means includes
Get distance information of subject space,
The image processing apparatus according to claim 1, wherein the second blur estimation area is determined based on distance information of the subject space.
前記生成手段は、
前記反復演算処理の前記推定処理として、第1の推定処理および該第1の推定処理よりも後に第2の推定処理を行い、
前記第1の推定処理において推定された第1のぼけと、前記第2の推定処理において推定された第2のぼけとの差異を判定し、
前記差異が第2の閾値よりも大きい場合、前記第2のぼけ推定領域の面積を大きくして、再度、前記推定処理を行うことを特徴とする請求項1乃至9のいずれか1項に記載の画像処理装置。
The generating means includes
As the estimation process of the iterative calculation process, a first estimation process and a second estimation process after the first estimation process are performed,
Determining a difference between the first blur estimated in the first estimation process and the second blur estimated in the second estimation process;
10. The method according to claim 1, wherein when the difference is larger than a second threshold value, the area of the second blur estimation region is increased and the estimation process is performed again. 10. Image processing apparatus.
前記生成手段は、
前記第2のぼけ推定領域の解像度を低下させて低解像ぼけ推定領域を生成し、
前記低解像ぼけ推定領域において、前記信号に関する情報に含まれるぼけを補正して前記補正信号に関する情報を生成する補正処理と、該信号に関する情報と該補正信号に関する情報とに基づいてぼけを推定する推定処理とを反復する反復演算処理を行って前記推定ぼけを生成し、
前記反復演算処理の過程において、前記低解像ぼけ推定領域の解像度を前記第2のぼけ推定領域の前記解像度に近づける、ことを特徴とする請求項1乃至9のいずれか1項に記載の画像処理装置。
The generating means includes
Reducing the resolution of the second blur estimation region to generate a low-resolution blur estimation region;
In the low-resolution blur estimation region, blur is estimated based on correction processing for correcting blur included in the information on the signal to generate information on the correction signal, and information on the signal and information on the correction signal. The estimation blur is generated by performing an iterative calculation process that repeats the estimation process to be performed,
10. The image according to claim 1, wherein the resolution of the low-resolution blur estimation region is made closer to the resolution of the second blur estimation region in the process of the iterative calculation process. Processing equipment.
前記生成手段は、
前記第2のぼけ推定領域に含まれるノイズ量を取得し、
前記第2のぼけ推定領域を周波数分解して周波数分解ぼけ推定領域を生成し、
前記ノイズ量に基づいて、前記周波数分解ぼけ推定領域に対するデノイジング処理を行い、
デノイジング処理後の周波数分解ぼけ推定領域を再合成する、ことを特徴とする請求項1乃至10のいずれか1項に記載の画像処理装置。
The generating means includes
Obtaining an amount of noise included in the second blur estimation region;
Frequency-resolving the second blur estimation region to generate a frequency-resolved blur estimation region;
Based on the amount of noise, performing a denoising process on the frequency-resolved blur estimation region,
The image processing apparatus according to claim 1, wherein the frequency-resolved blur estimation region after the denoising process is re-synthesized.
前記推定ぼけを用いて前記ぼけ画像の少なくとも一部を補正する補正手段を更に有することを特徴とする請求項1乃至11のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, further comprising a correction unit that corrects at least a part of the blurred image using the estimated blur. 前記第1のぼけ推定領域における前記信号変化の量は、前記第1のぼけ推定領域における輝度分布の微分値の絶対値和または二乗和に相当する量であることを特徴とする請求項1乃至12のいずれか1項に記載の画像処理装置。   The amount of the signal change in the first blur estimation region is an amount corresponding to an absolute value sum or a square sum of a differential value of a luminance distribution in the first blur estimation region. 13. The image processing apparatus according to any one of items 12. 前記信号に関する情報は、前記第2のぼけ推定領域における輝度分布または該輝度分布の微分値に関する情報であることを特徴とする請求項1乃至13のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the information regarding the signal is information regarding a luminance distribution in the second blur estimation region or a differential value of the luminance distribution. 光学系を介して形成された光学像を光電変換して画像信号を出力する撮像素子と、
前記画像信号に基づいてぼけ画像を取得する取得手段と、
前記ぼけ画像における少なくとも一部の第1のぼけ推定領域を取得し、推定ぼけを生成する生成手段と、を有し、
前記生成手段は、
前記第1のぼけ推定領域における信号変化の量に基づいて、第2のぼけ推定領域を決定し、
前記第2のぼけ推定領域における信号に関する情報に含まれるぼけを補正して補正信号に関する情報を生成する補正処理と、該信号に関する情報と該補正信号に関する情報とに基づいてぼけを推定する推定処理と、を反復する反復演算処理を行って前記推定ぼけを生成する、ことを特徴とする撮像装置。
An image sensor that photoelectrically converts an optical image formed through the optical system and outputs an image signal;
Obtaining means for obtaining a blurred image based on the image signal;
Generating means for acquiring at least a part of a first blur estimation region in the blur image and generating an estimated blur;
The generating means includes
Determining a second blur estimation region based on the amount of signal change in the first blur estimation region;
Correction processing for correcting the blur included in the information regarding the signal in the second blur estimation region to generate information regarding the correction signal, and estimation processing for estimating the blur based on the information regarding the signal and the information regarding the correction signal And generating the estimated blur by performing an iterative calculation process that repeats.
ぼけ画像を取得するステップと、
前記ぼけ画像における少なくとも一部の第1のぼけ推定領域を取得し、推定ぼけを生成するステップと、を有し、
前記推定ぼけを生成するステップにおいて、
前記第1のぼけ推定領域における信号変化の量に基づいて、第2のぼけ推定領域を決定し、
前記第2のぼけ推定領域における信号に関する情報に含まれるぼけを補正して補正信号に関する情報を生成する補正処理と、該信号に関する情報と該補正信号に関する情報とに基づいてぼけを推定する推定処理と、を反復する反復演算処理を行って前記推定ぼけを生成する、ことを特徴とする画像処理方法。
Obtaining a blurred image;
Obtaining at least a portion of a first blur estimation region in the blur image and generating an estimated blur;
Generating the estimated blur;
Determining a second blur estimation region based on the amount of signal change in the first blur estimation region;
Correction processing for correcting the blur included in the information regarding the signal in the second blur estimation region to generate information regarding the correction signal, and estimation processing for estimating the blur based on the information regarding the signal and the information regarding the correction signal And generating the estimated blur by performing an iterative calculation process that repeats the above.
ぼけ画像を取得するステップと、
前記ぼけ画像における少なくとも一部の第1のぼけ推定領域を取得し、推定ぼけを生成するステップと、をコンピュータに実行させるように構成された画像処理プログラムであって、
前記推定ぼけを生成するステップにおいて、
前記第1のぼけ推定領域における信号変化の量に基づいて、第2のぼけ推定領域を決定し、
前記第2のぼけ推定領域における信号に関する情報に含まれるぼけを補正して補正信号に関する情報を生成する補正処理と、該信号に関する情報と該補正信号に関する情報とに基づいてぼけを推定する推定処理と、を反復する反復演算処理を行って前記推定ぼけを生成する、ことを特徴とする画像処理プログラム。
Obtaining a blurred image;
An image processing program configured to cause a computer to execute at least a part of a first blur estimation area in the blur image and generate an estimated blur,
Generating the estimated blur;
Determining a second blur estimation region based on the amount of signal change in the first blur estimation region;
Correction processing for correcting the blur included in the information regarding the signal in the second blur estimation region to generate information regarding the correction signal, and estimation processing for estimating the blur based on the information regarding the signal and the information regarding the correction signal An image processing program characterized by generating the estimated blur by performing an iterative calculation process that repeats.
請求項17に記載の画像処理プログラムを記憶していることを特徴とする記憶媒体。   A storage medium storing the image processing program according to claim 17.
JP2015121677A 2015-06-17 2015-06-17 Image processing apparatus, imaging device, image processing method, image processing program, and recording medium Pending JP2017010092A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2015121677A JP2017010092A (en) 2015-06-17 2015-06-17 Image processing apparatus, imaging device, image processing method, image processing program, and recording medium
US15/177,451 US10002411B2 (en) 2015-06-17 2016-06-09 Image processing apparatus, image pickup apparatus, image processing method, and non-transitory computer-readable storage medium for estimating blur

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015121677A JP2017010092A (en) 2015-06-17 2015-06-17 Image processing apparatus, imaging device, image processing method, image processing program, and recording medium

Publications (1)

Publication Number Publication Date
JP2017010092A true JP2017010092A (en) 2017-01-12

Family

ID=57588272

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015121677A Pending JP2017010092A (en) 2015-06-17 2015-06-17 Image processing apparatus, imaging device, image processing method, image processing program, and recording medium

Country Status (2)

Country Link
US (1) US10002411B2 (en)
JP (1) JP2017010092A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2021124385A1 (en) * 2019-12-16 2021-06-24
CN116098047A (en) * 2023-02-16 2023-05-12 昆明理工大学 Vegetable culture method and system

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6317618B2 (en) * 2014-05-01 2018-04-25 キヤノン株式会社 Information processing apparatus and method, measuring apparatus, and working apparatus
US10628924B2 (en) * 2015-12-14 2020-04-21 Peking University Shenzhen Graduate School Method and device for deblurring out-of-focus blurred images
CN110166684B (en) * 2018-06-29 2021-09-17 腾讯科技(深圳)有限公司 Image processing method, image processing device, computer readable medium and electronic equipment
CN109389617A (en) * 2018-08-27 2019-02-26 深圳大学 A kind of motion estimate based on piece heterogeneous system and method for tracing and system
JP7455542B2 (en) * 2019-09-27 2024-03-26 キヤノン株式会社 Image processing method, program, image processing device, learned model manufacturing method, and image processing system
CN110995960A (en) * 2019-10-18 2020-04-10 凯迈(洛阳)测控有限公司 FPGA-based airborne pod real-time image scene locking device and method
JP2022142932A (en) * 2021-03-17 2022-10-03 ラピステクノロジー株式会社 Head-up display, image correction method, and image correction program
CN113129235A (en) * 2021-04-22 2021-07-16 深圳市深图医学影像设备有限公司 Medical image noise suppression algorithm
CN117593192B (en) * 2024-01-18 2024-03-26 大连云间来客科技有限公司 Gynecological cervical image enhancement analysis method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080025627A1 (en) * 2006-07-28 2008-01-31 Massachusetts Institute Of Technology Removing camera shake from a single photograph
JP2008176735A (en) * 2007-01-22 2008-07-31 Toshiba Corp Image processing apparatus and method

Family Cites Families (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4764974A (en) 1986-09-22 1988-08-16 Perceptics Corporation Apparatus and method for processing an image
US6330353B1 (en) * 1997-12-18 2001-12-11 Siemens Corporate Research, Inc. Method of localization refinement of pattern images using optical flow constraints
US7720302B2 (en) 2003-09-25 2010-05-18 Fujifilm Corporation Method, apparatus and program for image processing
JP4515208B2 (en) 2003-09-25 2010-07-28 富士フイルム株式会社 Image processing method, apparatus, and program
US7294817B2 (en) * 2004-05-06 2007-11-13 Siemens Power Generation, Inc. System and methods for determining nonuniformity correction parameters in detector-array imaging
JP4345651B2 (en) 2004-11-29 2009-10-14 セイコーエプソン株式会社 Image information evaluation method, image information evaluation program, and image information evaluation apparatus
WO2008050320A2 (en) 2006-10-23 2008-05-02 Ben Gurion University Of The Negev, Research And Development Authority Blind restoration of images degraded by isotropic blur
US7982776B2 (en) 2007-07-13 2011-07-19 Ethicon Endo-Surgery, Inc. SBI motion artifact removal apparatus and method
KR100990791B1 (en) * 2008-12-31 2010-10-29 포항공과대학교 산학협력단 Method For Removing Blur of Image And Recorded Medium For Perfoming Method of Removing Blur
JP4591603B2 (en) 2009-01-26 2010-12-01 セイコーエプソン株式会社 Image information evaluation method, image information evaluation program, and image information evaluation apparatus
WO2010095065A1 (en) * 2009-02-17 2010-08-26 Koninklijke Philips Electronics N.V. Functional imaging
JP2011010275A (en) 2009-05-26 2011-01-13 Sanyo Electric Co Ltd Image reproducing apparatus and imaging apparatus
US8682102B2 (en) 2009-06-18 2014-03-25 Schlumberger Technology Corporation Cyclic noise removal in borehole imaging
US8452124B2 (en) 2010-04-30 2013-05-28 Honeywell International Inc. Method and system for detecting motion blur
US8503801B2 (en) 2010-09-21 2013-08-06 Adobe Systems Incorporated System and method for classifying the blur state of digital image pixels
KR101839617B1 (en) * 2011-07-11 2018-03-19 포항공과대학교 산학협력단 Method and apparatus for removing non-uniform motion blur using multiframe
JP5979553B2 (en) 2011-08-29 2016-08-24 パナソニックIpマネジメント株式会社 Image processing apparatus, imaging apparatus, and image processing method
US8885941B2 (en) * 2011-09-16 2014-11-11 Adobe Systems Incorporated System and method for estimating spatially varying defocus blur in a digital image
KR101705605B1 (en) 2011-11-14 2017-02-23 삼성전자주식회사 Photographing apparatus and image processing apparatus using a coded light, and methods thereof
KR101810876B1 (en) * 2012-03-13 2018-01-26 삼성전자주식회사 A method and an apparatus for debluring non-uniform motion blur of a large scale input image based on a tile unit
US9143687B2 (en) 2012-03-14 2015-09-22 University Of Dayton Method of analyzing motion blur using double discrete wavelet transform
US9008453B2 (en) * 2012-06-25 2015-04-14 Yissum Research Development Company Of The Hebrew University Of Jerusalem Ltd. Blur-kernel estimation from spectral irregularities
US9066002B2 (en) * 2012-08-29 2015-06-23 Sony Corporation System and method for utilizing enhanced scene detection in a depth estimation procedure
WO2014074137A1 (en) 2012-11-09 2014-05-15 Nikon Corporation Point spread function classification using structural properties
US8897588B2 (en) * 2012-11-20 2014-11-25 Adobe Systems Incorporated Data-driven edge-based image de-blurring
JP2015041200A (en) 2013-08-21 2015-03-02 富士ゼロックス株式会社 Image processor, image forming apparatus, and program
US9445115B2 (en) * 2013-11-21 2016-09-13 Bae Systems Information And Electronic Systems Integration Inc. Coded image system and method thereof
US9357123B1 (en) 2014-12-23 2016-05-31 Adobe Systems Incorporated Image defocus blur estimation
US9607359B2 (en) * 2014-12-29 2017-03-28 Kabushiki Kaisha Toshiba Electronic device, method, and computer program product

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080025627A1 (en) * 2006-07-28 2008-01-31 Massachusetts Institute Of Technology Removing camera shake from a single photograph
JP2008176735A (en) * 2007-01-22 2008-07-31 Toshiba Corp Image processing apparatus and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
大越 喬介 他: "Total Variation正則化およびShock Filterを用いたぶれ画像のブラインド画像復", 映像情報メディア学会, vol. 2013年年次大会講演予稿集, JPN6019017448, 7 August 2013 (2013-08-07), pages 1 - 2, ISSN: 0004034122 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2021124385A1 (en) * 2019-12-16 2021-06-24
WO2021124385A1 (en) * 2019-12-16 2021-06-24 三菱電機株式会社 Image processing device and image processing method
JP7209867B2 (en) 2019-12-16 2023-01-20 三菱電機株式会社 Image processing device and image processing method
CN116098047A (en) * 2023-02-16 2023-05-12 昆明理工大学 Vegetable culture method and system

Also Published As

Publication number Publication date
US20160371820A1 (en) 2016-12-22
US10002411B2 (en) 2018-06-19

Similar Documents

Publication Publication Date Title
JP2017010092A (en) Image processing apparatus, imaging device, image processing method, image processing program, and recording medium
JP4799428B2 (en) Image processing apparatus and method
JP2019121252A (en) Image processing method, image processing apparatus, image processing program and storage medium
US6754398B1 (en) Method of and system for image processing and recording medium for carrying out the method
JP2017010095A (en) Image processing apparatus, imaging device, image processing method, image processing program, and recording medium
US10417746B2 (en) Image processing apparatus and image processing method for estimating fixed-pattern noise attributable to image sensor
JP2007188493A (en) Method and apparatus for reducing motion blur in motion blur image, and method and apparatus for generating image with reduced motion blur by using a plurality of motion blur images each having its own blur parameter
JP2013143599A (en) Image processing device, imaging device, image processing method, and program
JP2013192224A (en) Method and apparatus for deblurring non-uniform motion blur using multi-frame including blurred image and noise image
JP6395655B2 (en) How to process image signals
JP6541454B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JPWO2017169039A1 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP5765893B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP2017010093A (en) Image processing apparatus, imaging device, image processing method, image processing program, and recording medium
US9947083B2 (en) Image processing method, image processing apparatus, image capturing apparatus, image processing program and non-transitory computer-readable storage medium
JP2019169000A (en) Image processing apparatus, image processing method, and program
JP6614843B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP2007299068A (en) Image processing device and image restoration method
JP7191588B2 (en) Image processing method, image processing device, imaging device, lens device, program, and storage medium
JP2012003454A (en) Image processing apparatus, imaging device and image processing program
JP2023055848A (en) Image processing method, image processing apparatus, image processing system, and program
WO2011086594A1 (en) Image processing apparatus and method therefor
JP6661491B2 (en) Image processing apparatus and image processing method
JP2017130167A (en) Image processing device, imaging device, and image processing program
JP2017028583A (en) Image processor, imaging apparatus, image processing method, image processing program, and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180611

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190422

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190521

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20191217