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

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

Info

Publication number
JP2018107541A
JP2018107541A JP2016250305A JP2016250305A JP2018107541A JP 2018107541 A JP2018107541 A JP 2018107541A JP 2016250305 A JP2016250305 A JP 2016250305A JP 2016250305 A JP2016250305 A JP 2016250305A JP 2018107541 A JP2018107541 A JP 2018107541A
Authority
JP
Japan
Prior art keywords
image
filter
processing
optical system
imaging
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
JP2016250305A
Other languages
Japanese (ja)
Inventor
貴嘉 横山
Takayoshi Yokoyama
貴嘉 横山
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 JP2016250305A priority Critical patent/JP2018107541A/en
Publication of JP2018107541A publication Critical patent/JP2018107541A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To perform filter processing to the vicinity of the ends of an image without adding false images to the ends of an input image.SOLUTION: An image processing apparatus 204 acquires an input image created through imaging using an optical system, and performs image processing on the input image. The image processing apparatus performs first sharpening processing on a first image area of the input image by using a first filter created on the basis of information on an optical transfer function or a point spread function of the optical system. The image processing apparatus performs second sharpening processing on a second image area closer to an end of the image than the first image area by using a second filter having a smaller number of taps than that of the first filter and created not on the basis of the information on the optical transfer function or the point spread function of the optical system.SELECTED DRAWING: Figure 17

Description

本発明は、撮像により生成された入力画像に対して鮮鋭化処理を行う画像処理技術に関する。   The present invention relates to an image processing technique for performing a sharpening process on an input image generated by imaging.

デジタルカメラ等の撮像装置により被写体を撮像して得られた画像には、撮像光学系(以下、単に光学系という)の球面収差、コマ収差、像面湾曲、非点収差等に起因する画像劣化成分としてのぼけ成分が含まれる。このようなぼけ成分は、無収差で回折の影響もない場合に被写体の一点から出た光束が撮像面上で再度一点に集まるべきものが、ある広がりをもって像を結ぶことで発生する。   An image obtained by imaging a subject with an imaging device such as a digital camera has image degradation caused by spherical aberration, coma aberration, field curvature, astigmatism, etc. of an imaging optical system (hereinafter simply referred to as an optical system). A blur component is included as a component. Such a blur component is generated when a light beam emitted from one point of a subject to be collected again at one point on the imaging surface when an aberration is not caused and there is no influence of diffraction is formed by forming an image with a certain spread.

ここにいうぼけ成分は、光学的には、点像分布関数(Point Spread Function:PSF)により表され、ピントのずれによるぼけとは異なる。また、カラー画像での色にじみも、光学系の軸上色収差、色の球面収差、色のコマ収差が原因であるものに関しては、光の波長ごとのぼけ方の相違と言うことができる。さらに、横方向の色ずれも、光学系の倍率色収差が原因であるものに関しては、光の波長ごとの撮像倍率の相違による位置ずれ又は位相ずれと言うことができる。   The blur component here is optically represented by a point spread function (PSF), and is different from blur due to focus shift. In addition, color bleeding in a color image can also be said to be a difference in blurring for each wavelength of light with respect to axial chromatic aberration, chromatic spherical aberration, and chromatic coma aberration of the optical system. Further, the lateral color misregistration can be said to be a positional misalignment or a phase misalignment due to a difference in imaging magnification for each wavelength of light when the lateral chromatic aberration is caused by the optical system.

点像分布関数(PSF)をフーリエ変換して得られる光学伝達関数(Optical Transfer Function:OTF)は、収差の周波数成分情報であり、複素数で表される。光学伝達関数(OTF)の絶対値、すなわち振幅成分を、MTF(Modulation Transfer Function)といい、位相成分をPTF(Phase Transfer Function)という。MTFおよびPTFはそれぞれ、収差による画像劣化の振幅成分および位相成分の周波数特性である。ここでは、位相成分を位相角として以下の式で表す。Re(OTF)およびIm(OTF)はそれぞれ、OTFの実部および虚部を表す。
PTF=tan-1(Im(OTF)/Re(OTF))
このように、光学系の光学伝達関数(OTF)は、画像の振幅成分と位相成分に対して劣化を与えるため、劣化画像は被写体の各点がコマ収差のように非対称にぼけた状態になる。
An optical transfer function (OTF) obtained by Fourier transform of a point spread function (PSF) is frequency component information of aberration and is represented by a complex number. The absolute value of the optical transfer function (OTF), that is, the amplitude component is called MTF (Modulation Transfer Function), and the phase component is called PTF (Phase Transfer Function). MTF and PTF are frequency characteristics of an amplitude component and a phase component of image degradation due to aberration, respectively. Here, the phase component is expressed as the phase angle by the following formula. Re (OTF) and Im (OTF) represent the real part and the imaginary part of the OTF, respectively.
PTF = tan −1 (Im (OTF) / Re (OTF))
As described above, since the optical transfer function (OTF) of the optical system deteriorates the amplitude component and the phase component of the image, each point of the subject becomes asymmetrically blurred like coma aberration in the deteriorated image. .

劣化画像(入力画像)における振幅成分(MTF)の劣化と位相成分(PTF)の劣化を補正する方法として、光学系の光学伝達関数の情報を用いるものが知られている。この方法は、画像回復や画像復元とも呼ばれており、以下、この光学系の光学伝達関数の情報を用いて劣化画像を補正(低減)する処理を画像回復処理と称する。そして、詳細は後述するが、画像回復処理の方法の1つとして、光学伝達関数の逆特性を有する実空間の画像回復フィルタを入力画像に対して畳み込む(コンボリューション)方法が知られている。   As a method for correcting the deterioration of the amplitude component (MTF) and the deterioration of the phase component (PTF) in the deteriorated image (input image), a method using information on the optical transfer function of the optical system is known. This method is also called image restoration or image restoration. Hereinafter, processing for correcting (reducing) a deteriorated image using information on the optical transfer function of the optical system is called image restoration processing. As will be described in detail later, as one of image restoration processing methods, a convolution method is known in which a real space image restoration filter having an inverse characteristic of an optical transfer function is convoluted with an input image.

画像回復フィルタを用いて画像回復処理(フィルタ処理)を行う場合に、入力画像のうち該処理の対象となる画素(以下、処理対象画素という)に画像回復フィルタを畳み込むには、処理対象画素の周囲に画像回復フィルタのサイズ(タップ数)と同数の画素が必要である。このため、入力画像のうち端付近の画像領域においては画像回復フィルタを適用することができない。   When performing image restoration processing (filter processing) using an image restoration filter, in order to convolve an image restoration filter with a pixel to be processed (hereinafter referred to as a processing target pixel) in an input image, the processing target pixel The same number of pixels as the size of the image restoration filter (the number of taps) are required around. For this reason, the image restoration filter cannot be applied to the image area near the edge of the input image.

図2に示す入力画像にフィルタをコンボリューションするフィルタ処理を行う場合について説明する。入力画像の左上の座標を(0,0)として図に示すように各画素の座標を与える。この入力画像に対して図3(a)に示す11×11タップの画像回復フィルタを用いたフィルタ処理を行う場合、処理対象画素から±5画素の画素データがある場合にはフィルタ処理が可能である。しかし、図3(b)や図3(c)に示すように処理対象画素から±5画素の画素データがない画像端付近の周辺画像領域(フィルタ処理不可領域)ではフィルタ処理を行うことができない。このため、画像回復処理を行うことが可能な画像領域(回復処理可能領域)は、図3(d)に示すように、画像端から5画素の周辺画像領域(回復処理不可領域)を除いた画像領域となる。   A case of performing filter processing for convolving a filter on the input image shown in FIG. 2 will be described. The coordinates of each pixel are given as shown in the figure with the upper left coordinate of the input image as (0, 0). When the filter process using the 11 × 11 tap image restoration filter shown in FIG. 3A is performed on this input image, if there is ± 5 pixel data from the processing target pixel, the filter process can be performed. is there. However, as shown in FIG. 3B and FIG. 3C, it is not possible to perform the filtering process in the peripheral image area near the image edge where there is no pixel data of ± 5 pixels from the processing target pixel (non-filterable area). . For this reason, as shown in FIG. 3D, the image area in which the image restoration process can be performed (the area where the restoration process is possible) is excluded from the peripheral image area of 5 pixels (the area where the restoration process is impossible) from the edge of the image. It becomes an image area.

このような場合において、周辺画像領域にもフィルタ処理を行うために、特許文献1や特許文献2にて開示されているように、入力画像の画像端の外側にフィルタ処理に必要な画素の画素データ(つまりは疑似画像)を付加する方法がある。具体的には、単色の同一輝度画像を付加したり、入力画像のうち画像端付近の部分画像をコピーして付加したりする。   In such a case, in order to perform the filtering process on the peripheral image region as well, as disclosed in Patent Document 1 and Patent Document 2, the pixels of the pixels necessary for the filtering process are provided outside the image edge of the input image. There is a method of adding data (that is, a pseudo image). Specifically, a single-color image having the same luminance is added, or a partial image near the edge of the input image is copied and added.

ただし、このような疑似画像を付加してフィルタ処理を行う方法では、実際の被写体画像を示す画素データとは異なる画素データを用いてフィルタ処理を行うため、正しい画像回復処理を行うことができない。特許文献1では、画像端付近の部分画像を入力画像の画像端の外側に付加してフィルタ処理を行う際に、画像回復精度を向上させるために、付加した部分画素の画素数に応じてフィルタの重み付けを変えている。また、特許文献2では、周辺画像領域にてフィルタ処理を行う場合に必要な画素が不足する場合は、不足画素分だけフィルタのサイズを小さくする。   However, in the method of performing filter processing by adding such a pseudo image, since the filter processing is performed using pixel data different from the pixel data indicating the actual subject image, correct image restoration processing cannot be performed. In Patent Document 1, in order to improve image restoration accuracy when performing a filtering process by adding a partial image near the edge of an image to the outside of the image edge of the input image, a filter is added according to the number of added partial pixels. The weight of is changed. Further, in Patent Document 2, when the number of pixels necessary for performing filter processing in the peripheral image region is insufficient, the size of the filter is reduced by the amount of the insufficient pixels.

特開2008−129808号公報JP 2008-129808 A 特開2001−067468号公報JP 2001-0667468 A

画像回復処理とは異なる画像処理を行うフィルタとして、画像のエッジ部分を強調するエッジ強調フィルタがある。OTFに基づいて作成される画像回復フィルタは、エッジ強調フィルタに対して、撮像光学系の光学特性に応じたフィルタであるため、より正確な画像回復処理を可能とする。エッジ強調フィルタとしては、図4(a)に示すように中心の処理対象画素の上下左右の4画素の画素データを用いて鮮鋭化を行うものや、図4(b)に示すように処理対象画素の周囲8画素の画素データを用いて鮮鋭化を行うものがある。   As a filter that performs image processing different from image restoration processing, there is an edge enhancement filter that enhances an edge portion of an image. Since the image restoration filter created based on the OTF is a filter corresponding to the optical characteristics of the imaging optical system with respect to the edge enhancement filter, more accurate image restoration processing is possible. As the edge emphasis filter, sharpening is performed using pixel data of four pixels on the top, bottom, left, and right of the central processing target pixel as shown in FIG. 4A, or the processing target as shown in FIG. 4B. Some perform sharpening using pixel data of eight pixels around the pixel.

しかしながら、ある程度の収差を有する一般的な撮像光学系のOTFに基づいて作成される画像回復フィルタは、これらのエッジ強調フィルタに比べてサイズが大きい。このため、入力画像においてフィルタ処理を行うための画素データがない周辺画像領域が大きくなる。   However, an image restoration filter created based on an OTF of a general imaging optical system having a certain degree of aberration is larger in size than these edge enhancement filters. For this reason, a peripheral image area without pixel data for performing filter processing in the input image becomes large.

特許文献1にて開示されているようにフィルタ処理を行うために画像端の外側に疑似画像を付加する場合は、疑似画像のデータを保持するための記憶領域を確保する必要がある。また、OTFに基づいて作成した画像回復フィルタのサイズを特許文献2にて開示された方法のように周辺画像領域において小さくすると、撮像光学系の実際の収差を反映した画像回復フィルタとはならないため、画像回復処理を十分に行うことができない。   When a pseudo image is added to the outside of the image end in order to perform the filtering process as disclosed in Patent Document 1, it is necessary to secure a storage area for holding the pseudo image data. Further, if the size of the image restoration filter created based on the OTF is reduced in the peripheral image region as in the method disclosed in Patent Document 2, the image restoration filter that reflects the actual aberration of the imaging optical system cannot be obtained. The image restoration process cannot be performed sufficiently.

さらに、フィルタ処理を行うことができない領域においてはフィルタ処理を行わず、フィルタ処理が可能な領域についてのみを切り出してフィルタ処理を行うという方法もあるが、この方法では生成される画像のサイズ(画角)が減少する。   In addition, there is a method in which filter processing is not performed in an area where filter processing cannot be performed, and only the area where filter processing is possible is cut out and filter processing is performed. The angle) decreases.

本発明は、入力画像の画像端に疑似画像を付加することなく画像端近傍までフィルタ処理を行うことができ、良好な画質を有するフィルタ処理画像を生成することができるようにした画像処理装置等を提供する。   The present invention provides an image processing apparatus capable of performing filter processing up to the vicinity of the image end without adding a pseudo image to the image end of the input image, and generating a filtered image having good image quality. I will provide a.

本発明の一側面としての画像処理装置は、光学系を用いた撮像により生成された入力画像を取得する画像取得手段と、入力画像に対して画像処理を行う処理手段とを有する。処理手段は、入力画像のうち、第1の画像領域に対して、光学系の光学伝達関数または点像分布関数に関する情報に基づいて生成された第1のフィルタを用いて第1の鮮鋭化処理を行い、第1の画像領域よりも画像端側の第2の画像領域に対して、第1のフィルタに比べてタップ数が少なく、光学系の光学伝達関数または点像分布関数に関する情報に基づくことなく生成された第2のフィルタを用いて第2の鮮鋭化処理を行うことを特徴とする。   An image processing apparatus according to one aspect of the present invention includes an image acquisition unit that acquires an input image generated by imaging using an optical system, and a processing unit that performs image processing on the input image. The processing means performs a first sharpening process on the first image region of the input image using a first filter generated based on information related to the optical transfer function or point spread function of the optical system. And the second image area closer to the image end than the first image area has a smaller number of taps than the first filter, and is based on information on the optical transfer function or point spread function of the optical system. The second sharpening process is performed using the second filter generated without any other feature.

なお、光学系により形成された被写体像を撮像する撮像素子と、上記画像処理装置とを有する撮像装置も本発明の他の一側面を構成する。   Note that an imaging apparatus having an imaging element that captures a subject image formed by an optical system and the image processing apparatus also constitutes another aspect of the present invention.

また、本発明の他の一側面としての画像処理方法は、光学系を用いた撮像により生成された入力画像を取得するステップと、入力画像に対して画像処理を行う処理ステップとを有する。処理ステップにおいて、入力画像のうち、第1の画像領域に対して、光学系の光学伝達関数または点像分布関数に関する情報に基づいて生成された第1のフィルタを用いて第1の鮮鋭化処理を行い、第1の画像領域よりも画像端側の第2の画像領域に対して、第1のフィルタに比べてタップ数が少なく、光学系の光学伝達関数または点像分布関数に関する情報に基づくことなく生成された第2のフィルタを用いて第2の鮮鋭化処理を行うことを特徴とする。   An image processing method according to another aspect of the present invention includes a step of acquiring an input image generated by imaging using an optical system, and a processing step of performing image processing on the input image. In the processing step, a first sharpening process is performed on the first image region of the input image using a first filter generated based on information related to the optical transfer function or point spread function of the optical system. And the second image area closer to the image end than the first image area has a smaller number of taps than the first filter, and is based on information on the optical transfer function or point spread function of the optical system. The second sharpening process is performed using the second filter generated without any other feature.

なお、上記画像処理方法に従う画像処理をコンピュータに実行させる画像処理プログラムも、本発明の他の一側面を構成する。   An image processing program that causes a computer to execute image processing according to the image processing method also constitutes another aspect of the present invention.

本発明では、第1の画像領域では、光学系の光学伝達関数または点像分布関数に関する情報に基づいて生成された第1のフィルタを用いた第1の鮮鋭化処理を行う。また、第1の画像領域より画像端側の第2の画像領域では、第1のフィルタよりタップ数が少なく、光学系の光学伝達関数または点像分布関数に関する情報に基づくことなく生成された第2のフィルタを用いて第2の鮮鋭化処理を行う。これにより、入力画像の画像端に疑似画像を付加することなく、画像端近傍まで第2のフィルタを用いたフィルタ処理を行うことができ、良好な画質を有するフィルタ処理画像を生成することができる。   In the present invention, in the first image region, a first sharpening process is performed using a first filter generated based on information related to the optical transfer function or point spread function of the optical system. In the second image region closer to the image end than the first image region, the number of taps is smaller than that of the first filter, and the second image region is generated without being based on information on the optical transfer function or point spread function of the optical system. A second sharpening process is performed using the second filter. Accordingly, it is possible to perform filter processing using the second filter up to the vicinity of the image end without adding a pseudo image to the image end of the input image, and it is possible to generate a filtered image having good image quality. .

本発明の実施例における画像回復フィルタを示す図。The figure which shows the image restoration filter in the Example of this invention. 入力画像を示す図。The figure which shows an input image. 従来の画像回復フィルタ、フィルタ処理不可領域、回復可能領域および回復処理不可領域を説明する図。The figure explaining the conventional image recovery filter, filter process impossible area, recoverable area, and recovery process impossible area. 第2のフィルタを示す図。The figure which shows a 2nd filter. 本発明の実施例1における処理を示すフローチャート。The flowchart which shows the process in Example 1 of this invention. 実施例1における画像回復フィルタを示す図。FIG. 3 is a diagram illustrating an image restoration filter according to the first embodiment. 実施例1における画像回復フィルタのタップ値を示す図。FIG. 6 is a diagram illustrating a tap value of an image restoration filter in the first embodiment. 実施例1における劣化点像の補正を示す図。FIG. 6 is a diagram illustrating correction of a deteriorated point image in the first embodiment. 実施例1における振幅と位相を示す図。FIG. 3 is a diagram illustrating an amplitude and a phase in the first embodiment. 実施例1における画像回復フィルタの別の例を示す図。FIG. 6 is a diagram illustrating another example of the image restoration filter according to the first embodiment. 図10に示した画像回復フィルタを用いた画像回復処理を示す図。The figure which shows the image restoration process using the image restoration filter shown in FIG. 実施例1における画像回復処理の別の例を示す図。FIG. 10 is a diagram illustrating another example of image restoration processing according to the first embodiment. 図12の画像回復処理に用いられる画像回復フィルタおよび第2のフィルタの重み付けを説明する図。The figure explaining the weighting of the image restoration filter used for the image restoration process of FIG. 12, and a 2nd filter. 実施例2である画像処理システムの構成を示す図。FIG. 3 is a diagram illustrating a configuration of an image processing system that is Embodiment 2. 実施例2における係数算出処理を示す図。FIG. 10 is a diagram illustrating coefficient calculation processing according to the second embodiment. 実施例2における再構成OTFを説明する図。FIG. 6 is a diagram for explaining a reconfiguration OTF in Embodiment 2. 実施例3である撮像装置の構成を示す図。FIG. 6 is a diagram illustrating a configuration of an imaging apparatus that is Embodiment 3. 実施例4である画像処理システムの構成を示す図。FIG. 10 is a diagram illustrating a configuration of an image processing system that is Embodiment 4. アンシャープマスク処理の説明図Illustration of unsharp mask processing

以下、本発明の実施例について図面を参照しながら説明する。はじめに、後述する本発明の実施例で用いる用語の定義と画像回復処理について説明する。
「入力画像」
入力画像は、撮像装置において撮像光学系により形成された被写体像を光電変換した撮像素子からの出力を用いて生成されたデジタル画像であり、例えばRGB色成分の情報を有するRAW画像(RAWデータ)である。入力画像は、レンズや光学フィルタ等の光学素子を含む撮像光学系の収差を含む光学伝達関数(以下、OTFという)により劣化した画像である。
Embodiments of the present invention will be described below with reference to the drawings. First, definitions of terms and image restoration processing used in embodiments of the present invention described later will be described.
"Input image"
The input image is a digital image generated by using an output from an image sensor obtained by photoelectrically converting a subject image formed by an imaging optical system in the imaging apparatus. For example, a RAW image (RAW data) having RGB color component information is used. It is. The input image is an image degraded by an optical transfer function (hereinafter referred to as OTF) including aberration of an imaging optical system including an optical element such as a lens or an optical filter.

撮像光学系は、曲率を有するミラー(反射面)を含んでもよい。また、撮像光学系は、撮像装置に対して着脱(交換)が可能であってもよい。撮像装置において、撮像素子および該撮像素子の出力を用いて入力画像を生成する信号処理部により撮像系が構成される。撮像素子は、CMOSセンサやCCDセンサ等の光電変換素子により構成される。   The imaging optical system may include a mirror (reflection surface) having a curvature. Further, the imaging optical system may be detachable (exchangeable) with respect to the imaging device. In the imaging apparatus, an imaging system is configured by an imaging device and a signal processing unit that generates an input image using an output of the imaging device. The imaging element is configured by a photoelectric conversion element such as a CMOS sensor or a CCD sensor.

入力画像や出力画像には、撮像光学系の焦点距離および絞り値や撮像距離(被写体距離)等の撮像パラメータや、入力画像を補正するための各種補正情報が付帯されていてもよい。   The input image and output image may be accompanied by imaging parameters such as the focal length and aperture value of the imaging optical system, the imaging distance (subject distance), and various correction information for correcting the input image.

[画像回復処理]
撮像装置により生成された入力画像(劣化画像)をg(x,y)とし、元の画像(劣化していない画像)をf(x,y)とし、光学伝達関数(以下、OTFという)のフーリエペアである点像分布関数(以下、PSFという)をh(x,y)とする。この場合、以下の式(1)が成り立つ。ただし、*はコンボリューション(畳み込み積分または積和)を示し、(x,y)は入力画像上の座標(位置)を示す。
g(x,y)=h(x,y)*f(x,y) …(1)
この式(1)をフーリエ変換して周波数面での表示形式に変換すると、以下の式(2)のように周波数ごとの積の形式になる。H(u,v)はPSFであるh(x,y)をフーリエ変換して得られたOTFである。G(u,v),F(u,v)はそれぞれ、g(x,y),f(x,y)をフーリエ変換して得られた関数である。(u,v)は2次元周波数面での座標、すなわち周波数を示す。
G(u,v)=H(u,v)・F(u,v) …(2)
劣化画像から元の画像を得るためには、以下の式(3)ように、上記式(2)の両辺をH(u,v)で除算すればよい。
G(u,v)/H(u,v)=F(u,v) …(3)
F(u,v)、すなわちG(u,v)/H(u,v)を逆フーリエ変換して実面に戻すことで、元の画像f(x,y)に相当する回復画像が得られる。
[Image recovery processing]
The input image (degraded image) generated by the imaging device is g (x, y), the original image (undegraded image) is f (x, y), and the optical transfer function (hereinafter referred to as OTF) A point spread function (hereinafter referred to as PSF) that is a Fourier pair is represented by h (x, y). In this case, the following formula (1) is established. Note that * indicates convolution (convolution integration or sum of products), and (x, y) indicates coordinates (position) on the input image.
g (x, y) = h (x, y) * f (x, y) (1)
When this equation (1) is Fourier transformed into a display format on the frequency plane, it becomes a product format for each frequency as in the following equation (2). H (u, v) is an OTF obtained by Fourier transform of h (x, y), which is a PSF. G (u, v) and F (u, v) are functions obtained by Fourier transforming g (x, y) and f (x, y), respectively. (U, v) indicates the coordinates on the two-dimensional frequency plane, that is, the frequency.
G (u, v) = H (u, v) · F (u, v) (2)
In order to obtain the original image from the degraded image, both sides of the above equation (2) may be divided by H (u, v) as in the following equation (3).
G (u, v) / H (u, v) = F (u, v) (3)
F (u, v), that is, G (u, v) / H (u, v) is subjected to inverse Fourier transform to return to the actual surface, thereby obtaining a restored image corresponding to the original image f (x, y). It is done.

ここで、H−1(u,v)を逆フーリエ変換したものをRとすると、以下の式(4)のように実面での画像に対するコンボリューション処理を行うことで、同様に元の画像f(x,y)である回復画像を得ることができる。
g(x,y)*R(x,y)=f(x,y) …(4)
式(4)中のR(x,y)が画像回復フィルタである。入力画像が2次元画像であるとき、一般に画像回復フィルタも該2次元画像の各画素に対応したタップ(セル)を有する2次元フィルタとなる。また、一般に画像回復フィルタのタップ数(セル数)が多いほど画像回復精度が向上するため、出力画像としての要求画質、画像処理装置としての画像処理能力、PSFの広がり幅等に応じて実現可能なタップ数が設定される。
Here, assuming that R −1 (u, v) is an inverse Fourier transform, R is the same as the original image by performing convolution processing on the actual image as in the following equation (4). A recovered image that is f (x, y) can be obtained.
g (x, y) * R (x, y) = f (x, y) (4)
R (x, y) in the equation (4) is an image restoration filter. When the input image is a two-dimensional image, generally the image restoration filter is also a two-dimensional filter having taps (cells) corresponding to the respective pixels of the two-dimensional image. In general, as the number of taps (cells) of the image restoration filter increases, the image restoration accuracy improves. Therefore, it can be realized according to the required image quality as an output image, the image processing capability as an image processing device, the spread width of the PSF, etc. The number of taps is set.

画像回復フィルタ(第1のフィルタ)は、OTFに基づいて生成されるため、劣化画像(入力画像)における振幅成分と位相成分の劣化をともに高精度に補正することができる。このため、画像回復フィルタは、光学系の光学伝達関数または点像分布関数に関する情報に基づくことなく生成される第2のフィルタとしての従来の水平垂直各3タップ程度の鮮鋭化フィルタ(エッジ強調フィルタ)等とは全く異なる。   Since the image restoration filter (first filter) is generated based on the OTF, both the amplitude component and the phase component degradation in the degraded image (input image) can be corrected with high accuracy. For this reason, the image restoration filter is a conventional sharpening filter (edge enhancement filter) of about 3 taps in the horizontal and vertical directions as a second filter generated without being based on information on the optical transfer function or point spread function of the optical system. ) Etc. are completely different.

実際の画像にはノイズ成分が含まれるため、上記のようにOTFの完全な逆数をとって作成した画像回復フィルタを用いると、劣化画像が回復されるだけでなくノイズ成分が大幅に増幅されてしまう。これは、入力画像の振幅成分にノイズの振幅が付加されている状態に対して撮像光学系のMTF(振幅成分)を全周波数にわたって1に戻すようにMTFを持ち上げるためである。撮像光学系による振幅劣化であるMTFは1に戻るが、同時にノイズ成分のパワースペクトルも持ち上がってしまい、結果的にMTFを持ち上げる度合い、すなわち回復ゲインに応じてノイズが増幅されてしまう。したがって ノイズ成分が含まれる入力画像からは鑑賞用画像として良好な回復画像が得られない。   Since an actual image contains a noise component, using an image restoration filter created by taking the perfect inverse of OTF as described above not only recovers a degraded image but also greatly amplifies the noise component. End up. This is because the MTF is raised so that the MTF (amplitude component) of the imaging optical system is returned to 1 over the entire frequency in a state where the amplitude of noise is added to the amplitude component of the input image. The MTF, which is amplitude degradation due to the imaging optical system, returns to 1, but the power spectrum of the noise component also rises. As a result, the noise is amplified according to the degree to which the MTF is raised, that is, the recovery gain. Therefore, a good restored image cannot be obtained as an image for viewing from an input image containing a noise component.

ノイズ成分が含まれる画像を画像回復する方法としては、例えば式(6)に示すウィナーフィルタ(Wiener filter)のように画像信号とノイズ信号の強度比(SNR)に応じて回復度合いを制御する方法が知られている。   As a method for image restoration of an image including a noise component, for example, a method of controlling the degree of restoration according to the intensity ratio (SNR) of an image signal and a noise signal like a Wiener filter shown in Expression (6) It has been known.

M(u,v)はウィナーフィルタの周波数特性を示し、|H(u,v)|はOTFの絶対値(MTF)を示す。後述する実施例では、式(6)のM(u,v)が画像回復フィルタの周波数特性を示す。この方法は、周波数ごとに、MTFが小さいほど回復ゲインを抑制し、MTFが大きいほど回復ゲインを強くするものである。一般に、撮像光学系のMTFは、低周波数側が高く、高周波数側が低くなるため、実質的に画像信号の高周波数側の回復ゲインを抑制する方法となる。画像回復フィルタの具体例については後述する。 M (u, v) represents the frequency characteristic of the Wiener filter, and | H (u, v) | represents the absolute value (MTF) of the OTF. In an example described later, M (u, v) in Expression (6) indicates the frequency characteristic of the image restoration filter. In this method, for each frequency, the recovery gain is suppressed as the MTF is small, and the recovery gain is increased as the MTF is large. In general, since the MTF of the imaging optical system is high on the low frequency side and low on the high frequency side, this is a method of substantially suppressing the recovery gain on the high frequency side of the image signal. A specific example of the image restoration filter will be described later.

画像回復フィルタを図6および図7を用いて説明する。画像回復フィルタは、撮像光学系の収差特性や要求される画像回復精度に応じてタップ数が決められる。図6では、例として、11×11タップの2次元画像回復フィルタを示している。図6では、各タップ内の値(係数値)を省略しているが、この画像回復フィルタの1つの断面を図7に示す。画像回復フィルタの各タップ内の値の分布が、収差によって空間的に広がった信号値(PSF)を、理想的には元の1点に戻す役割を果たす。   The image restoration filter will be described with reference to FIGS. The number of taps of the image restoration filter is determined according to the aberration characteristics of the imaging optical system and the required image restoration accuracy. In FIG. 6, an 11 × 11 tap two-dimensional image restoration filter is shown as an example. In FIG. 6, values (coefficient values) in each tap are omitted, but one cross section of this image restoration filter is shown in FIG. The distribution of the values in each tap of the image restoration filter serves to return the signal value (PSF) spatially spread by the aberration to an original one point ideally.

画像回復処理では、画像回復フィルタの各タップの値が、入力画像における各タップに対応する各画素に対してコンボリューション(畳み込み積分や積和ともいう)される。コンボリューションの処理では、ある画素の信号値を改善するために、その画素を画像回復フィルタの中心と一致させる。そして、入力画像と画像回復フィルタの対応画素ごとに入力画像の信号値と画像回復フィルタのタップの値(係数値)との積をとり、その総和を中心画素の信号値として置き換える。   In the image restoration process, the value of each tap of the image restoration filter is convolved (also referred to as convolution integration or product sum) with respect to each pixel corresponding to each tap in the input image. In the convolution process, in order to improve the signal value of a certain pixel, the pixel is matched with the center of the image restoration filter. Then, the product of the signal value of the input image and the tap value (coefficient value) of the image restoration filter is taken for each corresponding pixel of the input image and the image restoration filter, and the sum is replaced with the signal value of the central pixel.

画像回復処理の実空間と周波数空間での特性を図8(a),(b)および図9を用いて説明する。図8(a)は画像回復前のPSFを示し、図8(b)は画像回復後のPSFを示している。また、図9の(M)中の(a)は画像回復前のMTFを示し、(M)中の(b)は画像回復後のMTFを示している。さらに、図9の(P)中の(a)は画像回復前のPTFを示し、(P)中の(b)は画像回復後のPTFを示している。画像回復前のPSFは非対称な広がりを持っており、この非対称性によりPTFは周波数に対して非直線的な値を持つ。画像回復処理は、MTFを増幅し、PTFを零に補正するため、画像回復後のPSFは対称で、かつ鮮鋭になる。   The characteristics of the image restoration processing in the real space and the frequency space will be described with reference to FIGS. 8 (a), 8 (b) and FIG. FIG. 8A shows the PSF before image recovery, and FIG. 8B shows the PSF after image recovery. Further, (a) in (M) of FIG. 9 shows the MTF before image recovery, and (b) in (M) shows the MTF after image recovery. Further, (a) in (P) of FIG. 9 shows the PTF before image recovery, and (b) in (P) shows the PTF after image recovery. The PSF before image restoration has an asymmetric spread, and due to this asymmetry, the PTF has a non-linear value with respect to the frequency. Since the image restoration process amplifies the MTF and corrects the PTF to zero, the PSF after the image restoration is symmetric and sharp.

画像回復フィルタの作成法については、撮像光学系の光学伝達関数(OTF)の逆関数に基づいて設計した関数を逆フーリエ変換して得ることができる。例えば、ウィナーフィルタを用いる場合、式(1)を逆フーリエ変換することで、実際に入力画像に畳み込む実空間の画像回復フィルタを作成することができる。   The method for creating the image restoration filter can be obtained by performing inverse Fourier transform on a function designed based on the inverse function of the optical transfer function (OTF) of the imaging optical system. For example, when a Wiener filter is used, a real space image restoration filter that is actually convolved with the input image can be created by performing inverse Fourier transform on Equation (1).

また、光学伝達関数(OTF)は、同じ撮像条件であっても撮像光学系の像高(画像上での位置)に応じて変化するので、画像回復フィルタは像高に応じて変更して使用される。   Also, since the optical transfer function (OTF) changes according to the image height (position on the image) of the imaging optical system even under the same imaging conditions, the image restoration filter is changed and used according to the image height. Is done.

以下、本発明の具体的な実施例について説明する。   Hereinafter, specific examples of the present invention will be described.

図5を用いて、本発明の実施例1である画像処理(画像処理方法)について説明する。本処理は、コンピュータとしての画像処理装置がコンピュータプログラムである画像処理プログラムに従って実行する。   The image processing (image processing method) that is Embodiment 1 of the present invention will be described with reference to FIG. This processing is executed by an image processing apparatus as a computer according to an image processing program that is a computer program.

ステップS11では、画像処理装置は、撮像系により生成された撮像画像を入力画像として取得する。入力画像は、撮像装置から有線または無線通信を介して取得することもできるし、入力画像が記録された記録媒体を介して取得することもできる。   In step S11, the image processing apparatus acquires a captured image generated by the imaging system as an input image. The input image can be acquired from the imaging device via wired or wireless communication, or can be acquired via a recording medium on which the input image is recorded.

次にステップS12では、画像処理装置は、入力画像が取得された際の撮像系の撮像条件を取得する。撮像条件は、撮像光学系の焦点距離、絞り値、撮像距離(被写体距離)等である。また、撮像装置において撮像光学系の交換が可能な場合は、撮像装置の識別情報であるカメラIDと撮像光学系(交換レンズ)の識別情報であるレンズIDを含む。撮像条件の情報は、撮像装置から直接取得してもよいし、入力画像に付帯された情報から取得してもよい。   Next, in step S12, the image processing apparatus acquires the imaging condition of the imaging system when the input image is acquired. The imaging conditions are a focal length, an aperture value, an imaging distance (subject distance), and the like of the imaging optical system. When the imaging optical system can be exchanged in the imaging apparatus, the camera ID that is identification information of the imaging apparatus and the lens ID that is identification information of the imaging optical system (exchange lens) are included. The imaging condition information may be acquired directly from the imaging apparatus or may be acquired from information attached to the input image.

次にステップS13では、画像処理装置は、ステップS12で今回取得した撮像条件に応じた画像回復フィルタを取得する。具体的には、予め用意(保存)された様々な撮像条件に対応する画像回復フィルタのデータから今回取得した撮像条件に対応する画像回復フィルタを選択する。この際、それぞれの撮像条件に対応する画像回復フィルタを生成するための係数のデータを保存しておき、今回取得した撮像条件に対応する係数を選択することで該撮像条件に対応する画像回復フィルタを生成してもよい。また、今回取得した撮像条件に対応する画像回復フィルタ(または係数)が保存されていない場合は、今回取得した撮像条件に近い複数の撮像条件に対応する画像回復フィルタを用いた補間処理により今回取得した撮像条件に対応する画像回復フィルタを生成してもよい。補間処理の方法としては、バイリニア補間(線形補間)やバイキュービック補間等を用いることができる。   In step S13, the image processing apparatus acquires an image restoration filter corresponding to the imaging condition acquired this time in step S12. Specifically, the image restoration filter corresponding to the imaging condition acquired this time is selected from the image restoration filter data corresponding to various imaging conditions prepared (saved) in advance. At this time, coefficient data for generating an image restoration filter corresponding to each imaging condition is stored, and an image restoration filter corresponding to the imaging condition is selected by selecting a coefficient corresponding to the imaging condition acquired this time. May be generated. In addition, when the image restoration filter (or coefficient) corresponding to the imaging condition acquired this time is not stored, the current acquisition is performed by interpolation processing using the image restoration filter corresponding to a plurality of imaging conditions close to the imaging condition acquired this time. An image restoration filter corresponding to the imaging condition thus obtained may be generated. As a method of the interpolation process, bilinear interpolation (linear interpolation), bicubic interpolation, or the like can be used.

次にステップS14では、画像処理装置は、入力画像に対するフィルタ処理を開始する。次にステップS15では、画像処理装置(判定手段)は、入力画像に対する画像回復処理の可否を判定する。この判定には、画像回復フィルタの特定方向でのタップ数(つまりは必要画素数)と、入力画像において画像回復フィルタを適用して画像回復処理を行う処理対象画素から上記特定方向での画像端の画素までの画素数(画像端までの残り画素数)とを用いる。そして、画像回復フィルタのコンボリューション(フィルタ処理)に必要な画素が入力画像に存在するか否か、つまりは画像端までの残り画素数が必要画素数以上か否かを判定する。   Next, in step S14, the image processing apparatus starts filter processing for the input image. In step S15, the image processing apparatus (determination unit) determines whether or not an image restoration process can be performed on the input image. For this determination, the number of taps (that is, the number of necessary pixels) in the specific direction of the image restoration filter and the image edge in the specific direction from the processing target pixel that performs the image restoration process by applying the image restoration filter to the input image. The number of pixels up to this pixel (the number of remaining pixels up to the end of the image) is used. Then, it is determined whether or not the pixels necessary for convolution (filter processing) of the image restoration filter are present in the input image, that is, whether or not the number of remaining pixels up to the end of the image is greater than or equal to the required number of pixels.

処理対象画素に対する画像回復処理が可能である場合は、画像処理装置はステップS16に進み、処理対象画素に対して画像回復フィルタ(第1のフィルタ)を用いたフィルタ処理(第1の鮮鋭化処理)としての画像回復処理を行う。処理対象画素に対する画像回復処理が不可能である場合は、画像処理装置はステップS17に進む。ステップS17では、処理対象画素に対して、光学系の光学伝達関数または点像分布関数に関する情報に基づくことなく生成された鮮鋭化フィルタ(第2のフィルタ)を用いたフィルタ処理としての鮮鋭化処理(第2の鮮鋭化処理)を行う。   If the image restoration processing for the processing target pixel is possible, the image processing apparatus proceeds to step S16, and performs filtering processing (first sharpening processing) using the image restoration filter (first filter) for the processing target pixel. ) Image recovery processing is performed. When the image restoration process for the processing target pixel is impossible, the image processing apparatus proceeds to step S17. In step S <b> 17, a sharpening process as a filter process using a sharpening filter (second filter) generated on the processing target pixel without being based on information on the optical transfer function or point spread function of the optical system. (Second sharpening process) is performed.

ステップS15〜S17の処理によって、図1に示すように、入力画像のうち画像回復フィルタの適用が可能な第1の画像領域に含まれる処理対象画素は画像回復処理によって回復される。一方、入力画像のうち第1の画像領域より外側の画像領域であって画像回復フィルタの適用が不可能な第2の画像領域に含まれる処理対象画素は鮮鋭化処理によって鮮鋭化される。   Through the processing in steps S15 to S17, as shown in FIG. 1, the processing target pixel included in the first image region to which the image restoration filter can be applied is recovered from the input image by the image restoration processing. On the other hand, the pixel to be processed included in the second image area that is outside the first image area and cannot be applied with the image restoration filter in the input image is sharpened by the sharpening process.

鮮鋭化フィルタとしては、例えば図4(a)に示したように中心の処理対象画素の上下左右の4画素の画素データに有効なタップ値を適用するフィルタがある。また、図4(b)に示したように処理対象画素の周囲の8画素の画素データに有効なタップ値を適用するフィルタを用いてもよい。   As the sharpening filter, for example, as shown in FIG. 4A, there is a filter that applies an effective tap value to pixel data of four pixels on the upper, lower, left, and right of a central processing target pixel. Further, as shown in FIG. 4B, a filter that applies an effective tap value to pixel data of eight pixels around the processing target pixel may be used.

また、鮮鋭化フィルタとしては、図4(a),(b)に示したように3×3タップのフィルタであってもよいし、5×5タップや7×7タップ等、画像回復フィルタよりもタップ数が少ないフィルタであればよい。特に、画像回復フィルタの半分以下のタップ数を有する鮮鋭化フィルタを用いることが好ましい。鮮鋭化フィルタも最小でも3×3タップを有するため、画像端の処理対象画素については鮮鋭化フィルタをコンボリューションするための画素が不足するためにフィルタ処理を行うことができない。しかし、鮮鋭化フィルタは画像回復フィルタに比べてタップ数が少ないために、鮮鋭化フィルタを用いたフィルタ処理を行うことができない画像領域は小さくなる。このため、より画像端に近い画像領域まで高解像度なフィルタ処理画像を生成することができる。   The sharpening filter may be a 3 × 3 tap filter as shown in FIGS. 4A and 4B, or may be a 5 × 5 tap, 7 × 7 tap, or other image restoration filter. Also, any filter with a small number of taps may be used. In particular, it is preferable to use a sharpening filter having a tap number less than half that of the image restoration filter. Since the sharpening filter also has 3 × 3 taps at the minimum, the pixel to be processed at the edge of the image cannot be filtered because there are not enough pixels to convolve the sharpening filter. However, since the sharpening filter has a smaller number of taps than the image restoration filter, the image area where the filtering process using the sharpening filter cannot be performed becomes smaller. For this reason, it is possible to generate a high-resolution filtered image up to an image region closer to the image end.

ところで、画像回復フィルタが11×11タップを有する場合でも、11×11タップのすべてが0ではない有効なタップ値を有するとは限らない。一般には、撮像光学系の焦点距離や被写体距離等による収差の変動を考慮して多めのタップ数の画像回復フィルタを用いる。このため、図10に示すように、画像回復フィルタの端付近のタップが有効なタップ値を持たない場合がある。   By the way, even when the image restoration filter has 11 × 11 taps, not all 11 × 11 taps have a valid tap value other than 0. In general, an image restoration filter having a larger number of taps is used in consideration of aberration variations due to the focal length of the imaging optical system, the subject distance, and the like. For this reason, as shown in FIG. 10, a tap near the end of the image restoration filter may not have a valid tap value.

また図15に示すように、入力画像の処理対象画素に対して図14に示した画像回復フィルタをコンボリューションする場合において、フィルタの上部のタップに対応する画素が入力画像にはない。しかし、そのタップのタップ値は0であるため、対応画素の有無はコンボリューションに関係がない。このため、このような画素については0を返すことで処理対象画素のフィルタ処理(画像回復処理)を行うことができる。したがって、コンボリューションに必要な画素の有無を判定する場合は、画像回復フィルタ内において有効なタップ値を有するタップに対応する画素の有無を判定することで、より画像端の近い処理対象画素まで画像回復処理を行うことができる。   As shown in FIG. 15, when the image restoration filter shown in FIG. 14 is convolved with the processing target pixel of the input image, the pixel corresponding to the tap at the top of the filter is not in the input image. However, since the tap value of the tap is 0, the presence or absence of the corresponding pixel is not related to the convolution. For this reason, it is possible to perform the filtering process (image restoration process) of the processing target pixel by returning 0 for such a pixel. Therefore, when determining the presence / absence of pixels necessary for convolution, it is possible to determine the presence / absence of a pixel corresponding to a tap having a valid tap value in the image restoration filter, so that the processing target pixel closer to the image end is imaged. Recovery processing can be performed.

さらに、本実施例のように画像回復フィルタを適用する第1の画像領域と鮮鋭化フィルタを適用する第2の画像領域とを分ける場合には、これらフィルタの特性が異なるために画像領域の境界が不自然なフィルタ処理画像が得られるおそれがある。そこで、このような不自然さを解消するために、図12に示すように、第1の画像領域において、第2の画像領域に近づくほど画像回復処理の効果(回復量)が小さくなるように画像回復処理を行うようにすることが望ましい。また、第2の画像領域において、第1の画像領域に近づくほど鮮鋭化処理の効果(鮮鋭化量)が小さくなるように鮮鋭化処理を行うことが望ましい。   Further, when the first image area to which the image restoration filter is applied and the second image area to which the sharpening filter is applied as in the present embodiment, the boundary between the image areas is different because the characteristics of these filters are different. However, an unnatural filtered image may be obtained. Therefore, in order to eliminate such unnaturalness, as shown in FIG. 12, the effect (recovery amount) of the image restoration process becomes smaller in the first image area as it approaches the second image area. It is desirable to perform image restoration processing. Further, in the second image area, it is desirable to perform the sharpening process so that the effect (sharpening amount) of the sharpening process becomes smaller as it approaches the first image area.

具体的には、図13に示すように、画像回復フィルタによる回復量に対する重み付けを1から第2の画像領域に近づくほど減少させ、第2の画像領域における画像回復フィルタの適用が不可能な境界画素で0となるようにする。また、鮮鋭化フィルタによる鮮鋭化量に対する重み付けを1から第1の画像領域に近づくほど減少させ、第1の画像領域における画像回復フィルタの適用が可能な境界画素で0となるようにする。これにより、第1および第2の画像領域(つまりは適用するフィルタ)の切り替わりによる不自然さを低減したフィルタ処理画像を得ることができる。   Specifically, as shown in FIG. 13, the weight on the recovery amount by the image recovery filter is decreased from 1 to the second image region, and the boundary where the image recovery filter cannot be applied to the second image region. The pixel is set to 0. Further, the weighting for the sharpening amount by the sharpening filter is decreased from 1 toward the first image area so that it becomes 0 at the boundary pixel to which the image restoration filter can be applied in the first image area. Thereby, it is possible to obtain a filtered image in which unnaturalness due to switching between the first and second image regions (that is, the filter to be applied) is reduced.

このような処理を行う場合には、画像回復処理と鮮鋭化処理の両方の処理を受ける画素(以下、両処理対象画素という)が存在する。鮮鋭化処理の後に画像回復処理を行うと、収差によるぼけが鮮鋭化処理によって鮮鋭化されてしまうために、画像回復処理を正しく行うことができない。このため、両処理対象画素に対しては、画像回復処理を行ってから鮮鋭化処理を行うことが望ましい。   When such processing is performed, there are pixels that are subjected to both image restoration processing and sharpening processing (hereinafter referred to as both processing target pixels). When the image restoration process is performed after the sharpening process, the blur due to the aberration is sharpened by the sharpening process, and thus the image restoration process cannot be performed correctly. For this reason, it is desirable to perform the sharpening process after performing the image restoration process for both the processing target pixels.

最後にステップS18では、画像処理装置は入力画像におけるフィルタ処理が可能なすべての画素に対するフィルタ処理(画像回復処理または鮮鋭化処理)が完了したか否かを確認する。完了していれば、画像処理装置はステップS19に進んで出力画像としてのフィルタ処理画像を得る。一方、まだフィルタ処理が完了していない画素があれば、画像処理装置はステップS15に戻ってフィルタ処理が完了していない画素に対するステップS15以降の処理を行う。   Finally, in step S18, the image processing apparatus checks whether or not the filter processing (image restoration processing or sharpening processing) for all the pixels that can be filtered in the input image is completed. If completed, the image processing apparatus proceeds to step S19 to obtain a filtered image as an output image. On the other hand, if there is a pixel for which the filter processing has not been completed, the image processing apparatus returns to step S15 and performs the processing after step S15 on the pixel for which the filter processing has not been completed.

図14は、本発明の実施例2である画像処理システムの構成を示している。画像処理システムは、係数算出装置100、撮像装置としてのカメラ110および画像処理装置120を含む。   FIG. 14 shows the configuration of an image processing system that is Embodiment 2 of the present invention. The image processing system includes a coefficient calculation device 100, a camera 110 as an imaging device, and an image processing device 120.

係数算出装置100は、OTFを再構成するための係数を算出する。係数算出装置100は、まず撮像光学系を含む撮像レンズ112の設計値または測定値からOTFを算出する処理を行う。係数算出装置100は、OTFを係数に変換する処理を行い、その必要精度に応じて後にOTFの再構成に用いる係数の次数を決定する処理を行う。係数算出装置100は、PSFの空間的な分布の大きさから後にOTFを再現する際に必要な像高ごとのタップ数を決定する処理を行う。係数算出装置100は、様々な撮像レンズ(交換レンズ)とカメラ110に設けられた撮像素子111との組み合わせに対して、必要次数までの係数のデータとタップ値の情報を算出して出力する。   The coefficient calculation apparatus 100 calculates a coefficient for reconfiguring the OTF. The coefficient calculation apparatus 100 first performs a process of calculating the OTF from the design value or measurement value of the imaging lens 112 including the imaging optical system. The coefficient calculation apparatus 100 performs a process of converting the OTF into a coefficient, and performs a process of determining the order of the coefficient used later for OTF reconstruction according to the required accuracy. The coefficient calculation apparatus 100 performs a process of determining the number of taps for each image height required when the OTF is reproduced later from the size of the spatial distribution of the PSF. The coefficient calculation apparatus 100 calculates and outputs coefficient data and tap value information up to the required order for combinations of various imaging lenses (interchangeable lenses) and the image sensor 111 provided in the camera 110.

カメラ100は、撮像素子111と撮像レンズ112を有する。カメラ110は、撮像レンズ112を用いた撮像により取得された撮像画像に、撮像レンズ112のレンズID、撮像条件(絞り、焦点距離および撮像距離等)の情報および撮像素子111が表現可能は空間周波数のナイキスト周波数を付加して出力する。   The camera 100 includes an image sensor 111 and an imaging lens 112. The camera 110 can express information about the lens ID of the imaging lens 112, imaging conditions (aperture, focal length, imaging distance, etc.), and the imaging element 111 in a captured image acquired by imaging using the imaging lens 112, and a spatial frequency. Output with the Nyquist frequency.

画像処理装置120は、係数算出装置100およびカメラ110から出力されたデータや情報を保持し、該データおよび情報を用いて撮像レンズ112により劣化した入力画像に対するフィルタ処理を行う。   The image processing apparatus 120 holds data and information output from the coefficient calculation apparatus 100 and the camera 110, and performs filtering processing on an input image deteriorated by the imaging lens 112 using the data and information.

画像回復処理装置120は、画像回復情報保持部121、OTF再構成部122およびフィルタ処理部123を含む。画像回復情報保持部121は、係数算出装置100によって算出された様々な撮像レンズと撮像素子の組み合わせのそれぞれに対して、係数、タップ数、レンズID、撮像条件および撮像素子のナイキスト周波数を記録保持する。OTF再構成部122は、カメラ110から撮像素子111のナイキスト周波数、撮像レンズ112のレンズIDおよび撮像条件を取得する。そして、OTF再構成部122は、カメラ110において撮像が行われた際のレンズIDと撮像条件から、画像回復情報保持部121内に保存されている係数とタップ数をサーチする。OTF再構成部122は、撮像素子のナイキスト周波数までの空間周波数領域において、サーチした係数とタップ数を用いてフィルタ処理部123で用いるOTFを再構成する。以下の説明において、OTF再構成部122で作成したOTFを再構成OTFと称する。   The image restoration processing device 120 includes an image restoration information holding unit 121, an OTF reconstruction unit 122, and a filter processing unit 123. The image restoration information holding unit 121 records and holds the coefficient, the number of taps, the lens ID, the imaging condition, and the Nyquist frequency of the imaging element for each of various combinations of imaging lenses and imaging elements calculated by the coefficient calculation apparatus 100. To do. The OTF reconstruction unit 122 acquires the Nyquist frequency of the image sensor 111, the lens ID of the imaging lens 112, and the imaging conditions from the camera 110. Then, the OTF reconstruction unit 122 searches for the coefficient and the number of taps stored in the image recovery information holding unit 121 from the lens ID and the imaging conditions when the camera 110 performs imaging. The OTF reconstruction unit 122 reconstructs the OTF used by the filter processing unit 123 using the searched coefficient and the number of taps in the spatial frequency region up to the Nyquist frequency of the image sensor. In the following description, the OTF created by the OTF reconstruction unit 122 is referred to as a reconstruction OTF.

フィルタ処理部123は、OTF再構成部122で作成した再構成OTFを用いて、撮像画像の劣化を回復するための画像回復フィルタを作成し、該画像回復フィルタを用いて画像回復処理を行う、係数算出装置100で予め算出した係数やタップ数を画像回復情報保持部121に保持しておくことにより、係数算出装置100をユーザ(撮像者)に提供する必要は無い。また、ユーザはネットワークや各種の記憶媒体を通して係数のデータ等の画像回復処理に必要な情報をダウンロードして用いることもできる。   The filter processing unit 123 creates an image restoration filter for recovering the degradation of the captured image using the reconstruction OTF created by the OTF reconstruction unit 122, and performs image restoration processing using the image restoration filter. By holding the coefficient and the number of taps calculated in advance by the coefficient calculation apparatus 100 in the image restoration information holding unit 121, it is not necessary to provide the coefficient calculation apparatus 100 to the user (imager). The user can also download and use information necessary for image restoration processing such as coefficient data through a network or various storage media.

次に、係数算出処理装置100での係数算出方法について説明する。本実施例では、撮像光学系のOTFを関数へのフィッティングによって近似することで係数を作成する。ここではフィッティングに用いる関数をLegendre多項式として説明するが、これ以外にもChebushev多項式等を用いてもよい。Legendre多項式は、式(7)で与えられる。ここで、[x]はxを超えない最大の整数である。   Next, a coefficient calculation method in the coefficient calculation processing apparatus 100 will be described. In this embodiment, the coefficient is created by approximating the OTF of the imaging optical system by fitting to a function. Here, the function used for fitting is described as a Legendre polynomial, but other than this, a Chebushev polynomial or the like may be used. The Legendre polynomial is given by equation (7). Here, [x] is a maximum integer not exceeding x.

OTFはz=f(x,y)の形で表されるため、式(8)の係数aijを算出する。 Since OTF is expressed in the form of z = f (x, y), the coefficient a ij in equation (8) is calculated.

式(8)は直交関数であり、aijの値はフィッティング時の次数によらず決定される。直交関数の性質を利用することにより、OTFのフィッティングが低次数でも十分に高精度に行うことが可能な場合は低次数で算出を打ち切ることができ、装置内に保持すべき係数情報量を最小量に抑えることが可能となる。 Expression (8) is an orthogonal function, and the value of a ij is determined regardless of the order at the time of fitting. By utilizing the properties of the orthogonal function, if the OTF fitting can be performed with sufficiently high accuracy even at a low order, the calculation can be terminated at a low order, and the amount of coefficient information to be held in the apparatus is minimized. It becomes possible to reduce the amount.

図15は、式(7)と式(8)を用いてOTFをフィッティングする具体的な方法を示している。図15に示すfumおよびfvmはそれぞれ、OTFのメリディオナル方向およびサジタル方向でのナイキスト周波数である。また、NxおよびNyはそれぞれ、OTFのメリディオナル方向およびサジタル方向での奇数のタップ数である。係数算出装置100では、OTFの実部と虚部のそれぞれに対して、上記フィッティングにより係数を算出する処理を行う。   FIG. 15 shows a specific method for fitting the OTF using the equations (7) and (8). Fum and fvm shown in FIG. 15 are Nyquist frequencies in the meridional direction and sagittal direction of the OTF, respectively. Nx and Ny are odd tap numbers in the meridional direction and sagittal direction of the OTF, respectively. In the coefficient calculation apparatus 100, a process of calculating a coefficient by the above fitting is performed on each of the real part and the imaginary part of the OTF.

OTFの実部は、メリディオナル方向およびサジタル方向において対称であるという特徴を有している。OTFの虚部は、メリディオナル方向において正負逆になるものの対称であり、サジタル方向において対称である。   The real part of the OTF is characterized by being symmetric in the meridional direction and the sagittal direction. The imaginary part of the OTF is symmetric in the meridional direction, but is symmetric in the sagittal direction.

これらの対称性からフィッティング対象とするOTFのデータとして、定義域全体の1/4領域の情報があれば必要にして十分である。上記理由により、本実施例ではOTFを高精度にフィッティングするために、OTFから実部および虚部ともに定義域全体の1/4の領域をDC成分が含まれるように切り出してフィッティングを行う。   Due to these symmetries, it is necessary and sufficient if there is information on a quarter of the entire definition area as the OTF data to be fitted. For the above reason, in the present embodiment, in order to fit the OTF with high accuracy, fitting is performed by cutting out a quarter of the entire domain from the OTF so that the DC component is included in both the real part and the imaginary part.

本実施例では、OTFデータがNx(行)×Ny(列)タップの場合の例を示し、該OTFデータから、1〜[Nx/2]+1行および1〜[Ny/2]+1列のデータを切り出している。ただし、フィッティング方法がこれに限定されるものではない。   In the present embodiment, an example in which the OTF data is Nx (row) × Ny (column) tap is shown, and from the OTF data, 1 to [Nx / 2] +1 rows and 1 to [Ny / 2] +1 columns are shown. Extracting data. However, the fitting method is not limited to this.

図16に再構成OTFのナイキスト周波数とタップ数との関係をより詳しく示す。図16は再構成OTFの断面を示している。前述したように、ナイキスト周波数は撮像素子111の空間分解能から決定されるパラメータであり、タップ数は撮像レンズのPSFに依存するパラメータである。これら2つのパラメータと係数とから、所望の再構成OTFを作成する。   FIG. 16 shows the relationship between the Nyquist frequency of the reconstructed OTF and the number of taps in more detail. FIG. 16 shows a cross section of the reconstructed OTF. As described above, the Nyquist frequency is a parameter determined from the spatial resolution of the image sensor 111, and the number of taps is a parameter depending on the PSF of the imaging lens. A desired reconstructed OTF is created from these two parameters and coefficients.

図16において、ナイキスト周波数はf_nyq1>f_nyq2であり、タップ数はN>M1>M2である。図示のように、ナイキスト周波数とタップ数を所望の値に制御することが可能である。   In FIG. 16, the Nyquist frequency is f_nyq1> f_nyq2, and the number of taps is N> M1> M2. As shown, the Nyquist frequency and the number of taps can be controlled to desired values.

以上説明したように、撮像素子と撮像レンズとの組合せおよび撮像件に応じたOTFを係数データ化して画像処理装置120に記憶しておくことで、撮像条件に応じた画像回復処理が可能になる。   As described above, the combination of the imaging element and the imaging lens and the OTF corresponding to the imaging case are converted into coefficient data and stored in the image processing device 120, thereby enabling image restoration processing according to the imaging conditions. .

図17は、本発明の実施例3である撮像装置の基本構成を示している。撮像光学系201は、不図示の被写体からの光に被写体像を形成する。撮像素子202は、被写体像を電気信号に変換し、その出力はA/Dコンバータ203でデジタル信号(撮像信号)に変換されて画像処理部204に入力される。撮像光学系201と撮像素子202とにより撮像系が構成される。   FIG. 17 shows a basic configuration of an image pickup apparatus that is Embodiment 3 of the present invention. The imaging optical system 201 forms a subject image on light from a subject (not shown). The image sensor 202 converts the subject image into an electrical signal, and the output is converted into a digital signal (imaging signal) by the A / D converter 203 and input to the image processing unit 204. The imaging optical system 201 and the imaging element 202 constitute an imaging system.

画像処理部204は、撮像信号に対して所定の処理を行うとともに画像回復処理を行う。状態検知部207は、撮像条件の情報を画像処理部204に供給する。撮像条件は、先の実施例でも説明したように、絞り値、焦点距離および撮像距離等である。状態検知部207はシステムコントローラ210から直接、撮像条件の情報を得てもよいし、撮像光学系21に関する撮像条件については光学系制御部206から得ることもできる。画像処理部204は、実施例1において図5を用いて説明した処理と同様の処理を行う。また、再構成OTFを生成するための係数データは記憶部208に保持されている。   The image processing unit 204 performs predetermined processing on the imaging signal and performs image restoration processing. The state detection unit 207 supplies imaging condition information to the image processing unit 204. As described in the previous embodiment, the imaging conditions include an aperture value, a focal length, an imaging distance, and the like. The state detection unit 207 may obtain information on the imaging conditions directly from the system controller 210, and the imaging conditions related to the imaging optical system 21 may be obtained from the optical system control unit 206. The image processing unit 204 performs the same processing as that described in the first embodiment with reference to FIG. The coefficient data for generating the reconstructed OTF is held in the storage unit 208.

そして、画像処理部204により生成されたフィルタ処理画像としての出力画像は、画像記録媒体209に所定のフォーマットで保存される。また、表示部205は、フィルタ処理画像を表示する。   Then, the output image as the filtered image generated by the image processing unit 204 is stored in the image recording medium 209 in a predetermined format. The display unit 205 displays a filtered image.

本撮像装置における一連の制御はシステムコントローラ210が行い、撮像光学系206の機械的な駆動は、システムコントローラ210からの指示により光学系制御部206が行う。絞り201aは、絞り値(Fナンバー)を可変設定する。フォーカスレンズ201bは、被写体距離に応じてピント調整を行うために不図示のオートフォーカス(AF)機構やマニュアルフォーカス機構により位置が制御される。撮像光学系201にはローパスフィルタや赤外線カットフィルタ等の光学素子を入れてもよいが、ローパスフィルタ等の光学伝達関数(OTF)の特性に影響を与える素子を用いる場合には画像回復フィルタを作成する時点での考慮が必要になる場合がある。赤外カットフィルタにおいても、分光波長の点像分布関数(PSF)の積分値であるRGBチャンネルの各PSF、特にRチャンネルのPSFに影響するため、画像回復フィルタを作成する時点での考慮が必要になる場合がある。この場合、OTFを再構成した後に回転非対称な伝達関数を付加する。   A series of controls in the imaging apparatus is performed by the system controller 210, and mechanical driving of the imaging optical system 206 is performed by the optical system control unit 206 according to an instruction from the system controller 210. The aperture 201a variably sets the aperture value (F number). The position of the focus lens 201b is controlled by an auto focus (AF) mechanism or a manual focus mechanism (not shown) in order to adjust the focus according to the subject distance. The imaging optical system 201 may include an optical element such as a low-pass filter or an infrared cut filter, but an image restoration filter is created when an element that affects the characteristics of an optical transfer function (OTF) such as a low-pass filter is used. It may be necessary to consider at the point of time. The infrared cut filter also affects each PSF of the RGB channel, particularly the PSF of the R channel, which is the integral value of the point spread function (PSF) of the spectral wavelength, and therefore needs to be considered when creating the image restoration filter. It may become. In this case, a rotationally asymmetric transfer function is added after reconfiguring the OTF.

また、撮像光学系201は、撮像装置の一部として構成してもよいし、撮像素子202を有する撮像装置本体に対して取り外し(交換)可能であってもよい。   Further, the imaging optical system 201 may be configured as a part of the imaging device, or may be removable (replaceable) from the imaging device main body having the imaging element 202.

本発明の実施例4である画像処理システムについて図18を用いて説明する。画像処理フローについては、第一の実施例で説明したフローを適宜用いることができるため説明は省略する。   An image processing system that is Embodiment 4 of the present invention will be described with reference to FIG. The image processing flow is not described because the flow described in the first embodiment can be used as appropriate.

画像処理装置301は、実施例1にて説明した画像処理プログラムを含む画像処理ソフトウェア306を搭載したコンピュータ機器である。撮像機器302は、カメラ、顕微鏡、内視鏡、スキャナ等の撮像装置である。記憶媒体303は、半導体メモリー、ハードディスク、ネットワーク上のサーバー等、撮像画像を記憶する媒体である。   The image processing apparatus 301 is a computer device equipped with image processing software 306 including the image processing program described in the first embodiment. The imaging device 302 is an imaging device such as a camera, a microscope, an endoscope, or a scanner. The storage medium 303 is a medium that stores captured images, such as a semiconductor memory, a hard disk, and a server on a network.

画像処理装置301は、撮像機器302または記憶媒体303から撮像画像のデータを取得し、所定の画像処理を行った画像データを出力機器305、撮像機器302および記憶媒体303のうち少なくとも1つに出力する。また、出力先を画像処理装置301に内蔵された記憶部とすることもできる。出力機器305としては、例えばプリンタがある。画像処理装置301には、モニタである表示機器304が接続されており、ユーザはこの表示機器304を通して画像処理作業を行うとともに、画像処理された出力画像を観察(評価)することができる。画像処理ソフトウェア306は、実施例1で説明した画像処理を画像処理装置301に実行させる機能の他に、必要に応じて現像やその他の画像処理を実行させる機能を有する。   The image processing apparatus 301 acquires captured image data from the imaging device 302 or the storage medium 303, and outputs the image data subjected to predetermined image processing to at least one of the output device 305, the imaging device 302, and the storage medium 303. To do. Further, the output destination can be a storage unit built in the image processing apparatus 301. An example of the output device 305 is a printer. A display device 304 that is a monitor is connected to the image processing apparatus 301, and the user can perform image processing work through the display device 304 and observe (evaluate) the output image subjected to the image processing. The image processing software 306 has a function of causing the image processing apparatus 301 to execute the image processing described in the first embodiment, and a function of executing development and other image processing as necessary.

上記実施例では、光学系の光学伝達関数に関する情報に基づいて生成された第1のフィルタを用いた第1の鮮鋭化処理が画像回復処理である場合について説明したが、第1の鮮鋭化処理は画像回復処理に限られない。例えば、光学系の点像分布関数に関する情報に基づいて生成された第1のフィルタを用いたアンシャープマスク処理であってもよい。すなわち、第1の鮮鋭化処理は、元画像にアンシャープマスクを適用してぼかした画像と元画像との差分を、元画像に対して加算あるいは減算することで画像を鮮鋭化するアンシャープマスク処理を含む。以下、アンシャープマスク処理を用いた実施例5について説明する。   In the above embodiment, the case where the first sharpening process using the first filter generated based on the information related to the optical transfer function of the optical system is the image restoration process has been described. Is not limited to image restoration processing. For example, unsharp mask processing using a first filter generated based on information about the point spread function of the optical system may be used. That is, the first sharpening process is an unsharp mask that sharpens an image by adding or subtracting the difference between the original image and the image blurred by applying an unsharp mask to the original image. Includes processing. Hereinafter, Example 5 using unsharp mask processing will be described.

[アンシャープマスク処理]
図19は、アンシャープマスク処理(鮮鋭化処理)による鮮鋭化の模式図であり、図19(A)の実線は入力画像、破線は入力画像をアンシャープマスクでぼかした画像、点線は鮮鋭化後の画像を表し、図19(B)の実線は補正成分を表している。図19の横軸は座標であり、縦軸は画素値または輝度値である。図19は、画像の所定の方向(例えば、X方向)における断面に相当する。
[Unsharp mask processing]
FIG. 19 is a schematic diagram of sharpening by unsharp mask processing (sharpening processing). The solid line in FIG. 19A is an input image, the broken line is an image obtained by blurring the input image with an unsharp mask, and the dotted line is sharpened. The subsequent image is represented, and the solid line in FIG. 19B represents the correction component. In FIG. 19, the horizontal axis represents coordinates, and the vertical axis represents pixel values or luminance values. FIG. 19 corresponds to a cross section of the image in a predetermined direction (for example, the X direction).

元画像をg(x,y)、補正成分をc(x,y)とすると、鮮鋭化後の画像f(x,y)は次式(9)により表すことができる。
f(x,y)=g(x,y)+m×c(x,y) ・・・(9)
式(9)では、補正信号c(x,y)は定数倍されて入力画像であるg(x,y)に加算されている。式(9)において、mは定数であいる。mの値を変化させることにより、補正量を調整することができる。なお、mは入力画像の位置によらず一定の定数であってもよいし、入力画像の位置に応じて異ならせた調整係数m(x,y)を用いることにより入力画像の位置に応じて補正量を調整することもできる。また、定数mや調整係数m(x,y)は光学系の焦点距離や絞り値や被写体距離といった撮像条件に応じて異ならせることもできる。定数mの代わりに調整係数m(x,y)を用いることができることは以下の説明においても同様である。
If the original image is g (x, y) and the correction component is c (x, y), the sharpened image f (x, y) can be expressed by the following equation (9).
f (x, y) = g (x, y) + m × c (x, y) (9)
In Expression (9), the correction signal c (x, y) is multiplied by a constant and added to g (x, y) as an input image. In Expression (9), m is a constant. The amount of correction can be adjusted by changing the value of m. Note that m may be a constant regardless of the position of the input image, or may be adjusted according to the position of the input image by using an adjustment coefficient m (x, y) that varies depending on the position of the input image. The correction amount can also be adjusted. Further, the constant m and the adjustment coefficient m (x, y) can be varied according to the imaging conditions such as the focal length, aperture value, and subject distance of the optical system. The adjustment factor m (x, y) can be used instead of the constant m in the following description.

補正成分c(x,y)は、アンシャープマスクをUSMとすると、次式(10)のように表すことができる。USM(x,y)は、例えば、USMのある座標(x,y)におけるタップ値である。
c(x,y)=g(x,y)−g(x,y)*USM(x,y) ・・・(10)
*はコンボリューション(畳み込み積分、積和)であり、δはデルタ関数(理想点像)である。デルタ関数とは、USM(x,y)とタップ数が等しく中心の値が1でそれ以外が0で埋まっているデータである。
The correction component c (x, y) can be expressed as the following equation (10), where the unsharp mask is USM. USM (x, y) is, for example, a tap value at a certain coordinate (x, y) of USM.
c (x, y) = g (x, y) -g (x, y) * USM (x, y) (10)
* Is convolution (convolution integral, sum of products), and δ is a delta function (ideal point image). The delta function is data in which the number of taps is equal to USM (x, y) and the center value is 1 and the rest are filled with 0.

式(10)の右辺を変形すると、次式(11)で表すことができる。
c(x,y)=g(x,y)*(δ(x,y)−USM(x,y)) ・・・(11)
式(10)を変形することで数式(11)を表現できるため、式(10)と式(11)は等価である。よって、以下、式(10)を用いて補正成分の生成について説明する。
When the right side of Expression (10) is modified, it can be expressed by the following Expression (11).
c (x, y) = g (x, y) * (δ (x, y) −USM (x, y)) (11)
Since Expression (11) can be expressed by modifying Expression (10), Expression (10) and Expression (11) are equivalent. Therefore, the generation of the correction component will be described below using Equation (10).

式(10)では、撮像画像g(x,y)と該撮像画像g(x,y)をアンシャープマスクUSMでぼかした画像との差分をとり、この差分情報に基づいて補正成分c(x,y)を生成している。一般的なアンシャープマスク処理では、アンシャープマスクUSMにガウシアンフィルタ、メディアンフィルタ、移動平均フィルタ等の平滑化フィルタが使用される。   In Expression (10), the difference between the captured image g (x, y) and the image obtained by blurring the captured image g (x, y) with the unsharp mask USM is calculated, and the correction component c (x , Y). In general unsharp mask processing, a smoothing filter such as a Gaussian filter, a median filter, or a moving average filter is used for the unsharp mask USM.

例えば、図19(A)の実線で示す撮像画像g(x,y)に対して、アンシャープマスクUSMとしてガウシアンフィルタを使用した場合、撮像画像g(x,y)をぼかした画像は図19(A)の破線で示すようになる。補正成分c(x,y)は、式(10)に示すように、撮像画像g(x,y)とこれをぼかした画像の差分となるため、図19(A)の実線から図19(A)の破線を減算することで図19(B)の実線で表現される成分となる。このように算出された補正成分を用いて、式(9)の演算を行うことによって、図19(A)の実線に示す撮像画像f(x,y)を図19(A)の点線のように鮮鋭化することができる。   For example, when a Gaussian filter is used as the unsharp mask USM for the captured image g (x, y) shown by the solid line in FIG. 19A, an image obtained by blurring the captured image g (x, y) is shown in FIG. As indicated by the broken line in FIG. The correction component c (x, y) is a difference between the captured image g (x, y) and an image obtained by blurring the image, as shown in the equation (10). Therefore, the correction component c (x, y) is changed from the solid line in FIG. By subtracting the broken line in A), the component is represented by the solid line in FIG. By using the correction component calculated in this way and performing the calculation of Expression (9), the captured image f (x, y) shown by the solid line in FIG. 19A is represented by the dotted line in FIG. Can be sharpened.

次に、被写体の光学像を形成する撮像光学系により劣化した画像に対して、アンシャープマスク処理を適用することで画像を鮮鋭化する場合について説明する。撮像光学系を介して得られた撮像画像g(x,y)は撮像前の画像(被写体の像)をI(x,y)、撮像光学系の点光源に対する応答を表す関数であるPSFをpsf(x,y)とすると、次式(12)のように表すことができる。
g(x,y)=I(x,y)*psf(x,y) ・・・(12)
撮像光学系が回転対称な共軸光学系であれば、画像の中心部に対応するPSFは回転対称となる。そのため、画像の中心部については回転対称なUSMを適用することで撮像画像g(x,y)を元の画像I(x,y)に近づける鮮鋭化を行うことができる。補正量は撮像画像とこれをアンシャープマスクでぼかした画像との差分値となるため、精度良く補正するためにはアンシャープマスクUSMは単純な平滑化フィルタを使用するのではなく、よりpsf(x,y)に近い形状のマスクを使用した方がよい。例えば、球面収差の影響で撮像画像が劣化する場合は、球面収差であれば回転対称に影響を与えるものの、ガウシアンフィルタのような平滑化フィルタでは球面収差の影響によるPSFとは分布の形状が異なる。このため、回転対称にぼける影響を低減する場合であっても、撮像光学系の点像分布関数(PSF)を使用する方が精度良く補正することができる。
Next, a case where an image is sharpened by applying an unsharp mask process to an image deteriorated by an imaging optical system that forms an optical image of a subject will be described. A captured image g (x, y) obtained through the imaging optical system is an image (image of a subject) before imaging (I (x, y)), and a PSF that is a function representing a response to the point light source of the imaging optical system. When psf (x, y) is given, it can be expressed as the following equation (12).
g (x, y) = I (x, y) * psf (x, y) (12)
If the imaging optical system is a rotationally symmetric coaxial optical system, the PSF corresponding to the center of the image is rotationally symmetric. Therefore, it is possible to sharpen the captured image g (x, y) closer to the original image I (x, y) by applying a rotationally symmetric USM to the center of the image. Since the correction amount is a difference value between the captured image and an image obtained by blurring the image with an unsharp mask, the unsharp mask USM does not use a simple smoothing filter to correct with high accuracy. It is better to use a mask having a shape close to x, y). For example, when a captured image deteriorates due to the influence of spherical aberration, the spherical symmetry affects rotational symmetry, but a smoothing filter such as a Gaussian filter has a distribution shape different from that of PSF due to the influence of spherical aberration. . For this reason, even when the effect of blurring in rotational symmetry is reduced, it is possible to correct with higher accuracy by using the point spread function (PSF) of the imaging optical system.

なお、撮像光学系のPSFは、光学系を介して形成される像の像高、光学系の焦点距離、F値および被写体距離を含む撮像条件ごとに異なるため、撮像条件ごとに異なるPSFを用いてアンシャープマスク処理を実行するのがよい。   Note that the PSF of the imaging optical system differs depending on the imaging conditions including the image height of the image formed through the optical system, the focal length of the optical system, the F value, and the subject distance, and therefore a different PSF is used for each imaging condition. It is better to execute unsharp mask processing.

式(9)および(10)から導かれる以下の式(13)を用いてアンシャープマスク処理を実行することができる。
f(x,y)=g(x,y)+m×{g(x,y)−g(x,y)*USM(x,y)}
・・・(13)
また、式(13)を変形することにより導かれる式(14)、(15)および(16)を用いてアンシャープマスク処理を実行することができる。
Unsharp mask processing can be performed using the following equation (13) derived from equations (9) and (10).
f (x, y) = g (x, y) + m × {g (x, y) −g (x, y) * USM (x, y)}
(13)
Further, the unsharp mask process can be executed using the equations (14), (15), and (16) derived by transforming the equation (13).

f(x,y)=g(x,y)+m×g(x,y)*{δ(x,y)−USM(x,y)}
・・・(14)
f(x,y)=g(x,y)*{δ(x,y)+m×(δ(x,y)−USM(x,y))}
・・・(15)
f(x,y)=g(x,y)*{(1+m)×δ(x,y)−m×USM(x,y)}
・・・(16)
(他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
以上説明した各実施例は代表的な例にすぎず、本発明の実施に際しては、各実施例に対して種々の変形や変更が可能である。
f (x, y) = g (x, y) + m × g (x, y) * {δ (x, y) −USM (x, y)}
(14)
f (x, y) = g (x, y) * {δ (x, y) + m × (δ (x, y) −USM (x, y))}
... (15)
f (x, y) = g (x, y) * {(1 + m) × δ (x, y) −m × USM (x, y)}
... (16)
(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.
Each embodiment described above is only a representative example, and various modifications and changes can be made to each embodiment in carrying out the present invention.

201 撮像光学系
202 撮像素子
204 画像処理部
301 画像処理装置
DESCRIPTION OF SYMBOLS 201 Image pick-up optical system 202 Image pick-up element 204 Image processing part 301 Image processing apparatus

Claims (12)

光学系を用いた撮像により生成された入力画像を取得する画像取得手段と、
前記入力画像に対して画像処理を行う処理手段とを有し、
前記処理手段は、前記入力画像のうち、
第1の画像領域に対して、前記光学系の光学伝達関数または点像分布関数に関する情報に基づいて生成された第1のフィルタを用いて第1の鮮鋭化処理を行い、
前記第1の画像領域よりも画像端側の第2の画像領域に対して、前記第1のフィルタに比べてタップ数が少なく、前記光学系の光学伝達関数または点像分布関数に関する情報に基づくことなく生成された第2のフィルタを用いて第2の鮮鋭化処理を行うことを特徴とする画像処理装置。
Image acquisition means for acquiring an input image generated by imaging using an optical system;
Processing means for performing image processing on the input image;
The processing means includes the input image,
A first sharpening process is performed on the first image area using a first filter generated based on information related to the optical transfer function or point spread function of the optical system,
The second image area closer to the image end than the first image area has a smaller number of taps than the first filter, and is based on information related to the optical transfer function or point spread function of the optical system. An image processing apparatus that performs a second sharpening process using a second filter that is generated without any problem.
前記第1の鮮鋭化処理は、前記光学系の光学伝達関数に関する情報に基づいて生成された第1のフィルタを用いた画像回復処理であることを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the first sharpening process is an image restoration process using a first filter generated based on information related to an optical transfer function of the optical system. . 前記第1の鮮鋭化処理は、前記光学系の点像分布関数に関する情報に基づいて生成された第1のフィルタを用いたアンシャープマスク処理であることを特徴とする請求項2に記載の画像処理装置。   3. The image according to claim 2, wherein the first sharpening process is an unsharp mask process using a first filter generated based on information relating to a point spread function of the optical system. Processing equipment. 前記第2の画像領域は、処理対象画素の周囲に前記第1のフィルタを適用するために必要な数の画素を含まない領域であることを特徴とする請求項1から3のいずれか一項に記載の画像処理装置。   The said 2nd image area | region is an area | region which does not contain the number of pixels required in order to apply a said 1st filter around the process target pixel. An image processing apparatus according to 1. 前記第1のフィルタのタップ数と前記入力画像における前記処理対象画素から画像端までの画素数とを用いて、該処理対象画素に前記第1のフィルタを適用するか前記第2のフィルタを適用するかを判定する判定手段を有することを特徴とする請求項4に記載の画像処理装置。   Using the number of taps of the first filter and the number of pixels from the processing target pixel to the image end in the input image, the first filter or the second filter is applied to the processing target pixel The image processing apparatus according to claim 4, further comprising a determination unit configured to determine whether to perform the process. 前記第1のフィルタのタップ数は、0ではないタップ値を有するタップの数であることを特徴とする請求項5に記載の画像処理装置。   The image processing apparatus according to claim 5, wherein the number of taps of the first filter is the number of taps having a tap value that is not zero. 前記処理手段は、前記第1の画像領域において、前記第2の画像領域に近づくほど前記第1の鮮鋭化処理の効果が小さくなるように前記第1の鮮鋭化処理を行うことを特徴とする請求項1から6のいずれか一項に記載の画像処理装置。   The processing means performs the first sharpening process in the first image area so that the effect of the first sharpening process becomes smaller as it approaches the second image area. The image processing apparatus according to claim 1. 前記処理手段は、前記第2の画像領域において、前記第1の画像領域に近づくほど前記第2の鮮鋭化処理の効果が小さくなるように該第2の鮮鋭化処理を行うことを特徴とする請求項1から7のいずれか一項に記載の画像処理装置。   The processing means performs the second sharpening process in the second image area so that the effect of the second sharpening process becomes smaller as it approaches the first image area. The image processing apparatus according to claim 1. 前記処理手段は、
前記第1の画像領域と前記第2の画像領域との間に前記第1の鮮鋭化処理と前記第2の鮮鋭化処理の両方を行う第3の画像領域を設け、
該第3の画像領域において前記第1の鮮鋭化処理を行った後に前記第2の鮮鋭化処理を行うことを特徴とする請求項1から8のいずれか一項に記載の画像処理装置。
The processing means includes
Providing a third image area for performing both the first sharpening process and the second sharpening process between the first image area and the second image area;
The image processing apparatus according to claim 1, wherein the second sharpening process is performed after the first sharpening process is performed on the third image region.
光学系により形成された被写体像を撮像する撮像素子と、
請求項1から9のいずれか一項に記載の画像処理装置とを有することを特徴とする撮像装置。
An image sensor for imaging a subject image formed by an optical system;
An image pickup apparatus comprising: the image processing apparatus according to claim 1.
光学系を用いた撮像により生成された入力画像を取得するステップと、
前記入力画像に対して画像処理を行う処理ステップとを有し、
前記処理ステップにおいて、前記入力画像のうち、
第1の画像領域に対して、前記光学系の光学伝達関数または点像分布関数に関する情報に基づいて生成された第1のフィルタを用いて第1の鮮鋭化処理を行い、
前記第1の画像領域よりも画像端側の第2の画像領域に対して、前記第1のフィルタに比べてタップ数が少なく、前記光学系の光学伝達関数または点像分布関数に関する情報に基づくことなく生成された第2のフィルタを用いて第2の鮮鋭化処理を行うことを特徴とする画像処理方法。
Obtaining an input image generated by imaging using an optical system;
Processing steps for performing image processing on the input image,
In the processing step, of the input images,
A first sharpening process is performed on the first image area using a first filter generated based on information related to the optical transfer function or point spread function of the optical system,
The second image area closer to the image end than the first image area has a smaller number of taps than the first filter, and is based on information related to the optical transfer function or point spread function of the optical system. A second sharpening process is performed using a second filter generated without any other process.
コンピュータに、光学系を用いた撮像により生成された入力画像に対する画像処理を実行させるコンピュータプログラムであって、
前記コンピュータに、前記入力画像のうち、
第1の画像領域に対して、前記光学系の光学伝達関数または点像分布関数に関する情報に基づいて生成された第1のフィルタを用いて第1の鮮鋭化処理を行わせ、
前記第1の画像領域よりも画像端側の第2の画像領域に対して、前記第1のフィルタに比べてタップ数が少なく、前記光学系の光学伝達関数または点像分布関数に関する情報に基づくことなく生成された第2のフィルタを用いて第2の鮮鋭化処理を行わせることを特徴とする画像処理プログラム。
A computer program for causing a computer to execute image processing on an input image generated by imaging using an optical system,
Of the input images to the computer,
First sharpening processing is performed on the first image region using a first filter generated based on information related to the optical transfer function or point spread function of the optical system,
The second image area closer to the image end than the first image area has a smaller number of taps than the first filter, and is based on information related to the optical transfer function or point spread function of the optical system. An image processing program that causes a second sharpening process to be performed using a second filter that is generated without any problem.
JP2016250305A 2016-12-26 2016-12-26 Image processing apparatus, imaging device, image processing method, and image processing program Pending JP2018107541A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016250305A JP2018107541A (en) 2016-12-26 2016-12-26 Image processing apparatus, imaging device, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016250305A JP2018107541A (en) 2016-12-26 2016-12-26 Image processing apparatus, imaging device, image processing method, and image processing program

Publications (1)

Publication Number Publication Date
JP2018107541A true JP2018107541A (en) 2018-07-05

Family

ID=62785833

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016250305A Pending JP2018107541A (en) 2016-12-26 2016-12-26 Image processing apparatus, imaging device, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP2018107541A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112229603A (en) * 2020-09-07 2021-01-15 中国科学院上海光学精密机械研究所 Two-dimensional optical transfer function measuring device and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112229603A (en) * 2020-09-07 2021-01-15 中国科学院上海光学精密机械研究所 Two-dimensional optical transfer function measuring device and method

Similar Documents

Publication Publication Date Title
JP5409589B2 (en) Image processing method, image processing program, image processing apparatus, and imaging apparatus
EP2557536B1 (en) Optical transfer function based image restoration
US9747672B2 (en) Image processing apparatus, image pickup apparatus, image processing method, and non-transitory computer-readable storage medium
JP5868076B2 (en) Image processing apparatus and image processing method
JP5818586B2 (en) Image processing apparatus and image processing method
JP5959976B2 (en) Image processing method, image processing program, image processing apparatus, and imaging apparatus
JP2010087672A (en) Image processing method, image processing apparatus, and imaging device
JP2006519527A (en) Camera with image enhancement function
JP6347763B2 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program
JP2011215707A (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP6071860B2 (en) Image processing method, image processing apparatus, imaging apparatus, and image processing program
JP6821526B2 (en) Image processing method, image processing device, imaging device, and program
CN111988517B (en) Image processing apparatus, lens apparatus, and image processing method
JP6562650B2 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program
JP5425135B2 (en) Image processing method, image processing apparatus, imaging apparatus, and image processing program
JP2016062252A (en) Image processing method, imaging device using the same, image processor, and image processing program
JP2018107541A (en) Image processing apparatus, imaging device, image processing method, and image processing program
JP5425136B2 (en) Image processing method, image processing apparatus, imaging apparatus, and image processing program
JP5611439B2 (en) Image processing method, image processing apparatus, imaging apparatus, and image processing program
JP6552375B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, AND IMAGE PROCESSING PROGRAM