JP2017092800A - Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium - Google Patents

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

Info

Publication number
JP2017092800A
JP2017092800A JP2015222884A JP2015222884A JP2017092800A JP 2017092800 A JP2017092800 A JP 2017092800A JP 2015222884 A JP2015222884 A JP 2015222884A JP 2015222884 A JP2015222884 A JP 2015222884A JP 2017092800 A JP2017092800 A JP 2017092800A
Authority
JP
Japan
Prior art keywords
image
image processing
information
color
color blur
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
JP2015222884A
Other languages
Japanese (ja)
Inventor
弘至 畠山
Hiroyuki Hatakeyama
弘至 畠山
貴嘉 横山
Takayoshi Yokoyama
貴嘉 横山
崇 鬼木
Takashi Oniki
崇 鬼木
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 JP2015222884A priority Critical patent/JP2017092800A/en
Publication of JP2017092800A publication Critical patent/JP2017092800A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus capable of effectively reducing color blur in a color image in consideration of manufacturing error of an imaging optical system.SOLUTION: An image processing apparatus 100 includes: an acquiring unit 101 that acquires information on chromatic aberration of magnification of an image formed via an imaging optical system; and a determination unit 104 for determining whether to modify the image so as to reduce color blur by using optical information concerning color blur of the imaging optical system on the basis of the information regarding the chromatic aberration of magnification.SELECTED DRAWING: Figure 1B

Description

本発明は、カラー画像における色にじみを低減する画像処理装置に関する。   The present invention relates to an image processing apparatus that reduces color bleeding in a color image.

従来から、撮像光学系の色収差により、カラー画像の明るい部分の周囲に本来存在しない色が色にじみとして生じる場合がある。撮像光学系の色収差は、異なる分散を有する材料からなる複数のレンズを組み合わせることにより、ある程度光学的に低減することができる。しかし近年では、撮像装置の小型化が進み、撮像素子に用いられるセンサの高解像度化および撮像光学系の小型化が要求され、撮像光学系の構成により色収差を十分に抑制することは困難である。   Conventionally, a color that does not originally exist around a bright portion of a color image may occur as a color blur due to chromatic aberration of the imaging optical system. The chromatic aberration of the imaging optical system can be optically reduced to some extent by combining a plurality of lenses made of materials having different dispersions. However, in recent years, the downsizing of the image pickup apparatus has progressed, and it is required to increase the resolution of the sensor used for the image pickup element and the size of the image pickup optical system, and it is difficult to sufficiently suppress chromatic aberration by the configuration of the image pickup optical system. .

色収差は、横色収差(倍率色収差)と縦色収差(軸上色収差)に大別される。横色収差は、結像位置が波長により像面に沿う方向にずれる現象である。縦色収差は、結像位置が波長により光軸に沿う方向にずれる現象である。特許文献1には、R(赤)、G(緑)、B(青)の各色プレーンに対して幾何変換処理を行うことにより、横色収差を補正する方法が開示されている。このように横収差は、幾何変換処理により補正することができる。一方、縦色収差は、上記の幾何変換処理では補正できない。   Chromatic aberration is roughly classified into lateral chromatic aberration (magnification chromatic aberration) and longitudinal chromatic aberration (axial chromatic aberration). Lateral chromatic aberration is a phenomenon in which the image formation position shifts in the direction along the image plane depending on the wavelength. Longitudinal chromatic aberration is a phenomenon in which the imaging position shifts in the direction along the optical axis depending on the wavelength. Patent Document 1 discloses a method of correcting lateral chromatic aberration by performing geometric transformation processing on each color plane of R (red), G (green), and B (blue). Thus, the lateral aberration can be corrected by the geometric conversion process. On the other hand, longitudinal chromatic aberration cannot be corrected by the geometric conversion process.

特許文献2には、色にじみが主に白とび(予め設定した信号の飽和領域)周辺に生じる特性を利用して、G(緑)プレーンの飽和している領域を探索し、その周辺の領域の画素を積分して補正量を算出する方法が開示されている。特許文献3には、カラー画像における色プレーンの画素値が単調増加または単調減少している領域を色にじみ発生領域と判定し、色にじみを除去する方法が開示されている。   In Patent Document 2, a region in which a G (green) plane is saturated is searched using a characteristic in which color blur is mainly generated in the vicinity of a whiteout (a saturated region of a preset signal), and a region around the region is searched. A method of calculating a correction amount by integrating the pixels is disclosed. Patent Document 3 discloses a method of determining a region where a color plane pixel value in a color image monotonously increases or decreases as a color blur generation region and removing the color blur.

米国特許第6724702号US Pat. No. 6,724,702 特開2007−133592号公報JP 2007-133582 A 特開2009−268033号公報JP 2009-268033 A

しかしながら、特許文献2に開示されている方法では、白とびしていない領域にも観察者にとって違和感のある色にじみが生じるため、色にじみの補正は不十分である。また特許文献3に開示されている方法によれば、白とびしていない領域の色にじみも補正が可能である。しかしながら、色にじみは、撮像光学系の収差により発生するため、コマ収差などの非対称な収差を有する撮像光学系では、被写体に対して色にじみが発生する方向や発生しない方向が存在する。被写体の色が色にじみと同系色の場合、本来は色にじみが発生しない方向でも被写体の色を色にじみとして誤判定し、被写体の本来の色を除去してしまう可能性がある。また、色にじみに関する誤判定を更に低減するには、撮像光学系の製造ばらつき(製造誤差)を考慮する必要がある。   However, in the method disclosed in Patent Document 2, color blur that causes discomfort to the observer also occurs in a region that is not overexposed, and thus correction of color blur is insufficient. Further, according to the method disclosed in Patent Document 3, it is possible to correct the color blur of the region that is not overexposed. However, since color blur occurs due to aberration of the imaging optical system, there are directions where color blur occurs and does not occur with respect to the subject in an imaging optical system having asymmetric aberrations such as coma. When the color of the subject is similar to the color blur, there is a possibility that the subject color is erroneously determined as a color blur even in a direction where the color blur does not occur, and the original color of the subject is removed. Further, in order to further reduce erroneous determination regarding color blur, it is necessary to consider manufacturing variations (manufacturing errors) of the imaging optical system.

そこで本発明は、撮像光学系の製造誤差を考慮してカラー画像における色にじみを効果的に低減可能な画像処理装置、撮像装置、画像処理方法、画像処理プログラム、および、記憶媒体を提供する。   Therefore, the present invention provides an image processing apparatus, an imaging apparatus, an image processing method, an image processing program, and a storage medium that can effectively reduce color blur in a color image in consideration of a manufacturing error of the imaging optical system.

本発明の一側面としての画像処理装置は、撮像光学系を介して形成された画像の倍率色収差に関する情報を取得する取得部と、前記倍率色収差に関する情報に応じて、前記撮像光学系の色にじみに関する光学情報を用いて該色にじみを低減するように前記画像を修正するか否かを判定する判定部とを有する。   An image processing apparatus according to an aspect of the present invention includes an acquisition unit that acquires information about lateral chromatic aberration of an image formed through an imaging optical system, and color blurring of the imaging optical system according to the information about the lateral chromatic aberration. And a determination unit that determines whether or not to correct the image so as to reduce the color blur.

本発明の他の側面としての撮像装置は、撮像光学系を介して形成された光学像を光電変換して画像を出力する撮像素子と、前記画像の倍率色収差に関する情報を取得する取得部と、前記倍率色収差に関する情報に応じて、前記撮像光学系の色にじみに関する光学情報を用いて該色にじみを低減するように前記画像を修正するか否かを判定する判定部とを有する。   An imaging apparatus according to another aspect of the present invention includes an imaging element that photoelectrically converts an optical image formed via an imaging optical system and outputs an image, an acquisition unit that acquires information about the chromatic aberration of magnification of the image, A determination unit configured to determine whether to correct the image so as to reduce the color blur using the optical information regarding the color blur of the imaging optical system in accordance with the information regarding the chromatic aberration of magnification.

本発明の他の側面としての画像処理方法は、撮像光学系を介して形成された画像の倍率色収差に関する情報を取得するステップと、前記倍率色収差に関する情報に応じて、前記撮像光学系の色にじみに関する光学情報を用いて該色にじみを低減するように前記画像を修正するか否かを判定するステップとを有する。   According to another aspect of the present invention, there is provided an image processing method, the step of acquiring information on lateral chromatic aberration of an image formed through an imaging optical system, and color blurring of the imaging optical system according to the information on the lateral chromatic aberration. Determining whether to correct the image so as to reduce the color blur using the optical information on the image.

本発明の他の側面としての画像処理プログラムは、撮像光学系を介して形成された画像の倍率色収差に関する情報を取得するステップと、前記倍率色収差に関する情報に応じて、前記撮像光学系の色にじみに関する光学情報を用いて該色にじみを低減するように前記画像を修正するか否かを判定するステップと、をコンピュータに実行させるように構成されている。   According to another aspect of the present invention, there is provided an image processing program that obtains information on lateral chromatic aberration of an image formed through an imaging optical system, and that blurs the color of the imaging optical system according to the information on the lateral chromatic aberration. And determining whether to correct the image so as to reduce the color blur using the optical information on the computer, and causing the computer to execute.

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

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

本発明によれば、撮像光学系の製造誤差を考慮してカラー画像における色にじみを効果的に低減可能な画像処理装置、撮像装置、画像処理方法、画像処理プログラム、および、記憶媒体を提供することができる。   According to the present invention, there are provided an image processing device, an imaging device, an image processing method, an image processing program, and a storage medium capable of effectively reducing color blur in a color image in consideration of a manufacturing error of the imaging optical system. be able to.

本実施形態における画像処理装置のブロック図である。It is a block diagram of the image processing apparatus in this embodiment. 本実施形態における画像処理方法を示すフローチャートである。It is a flowchart which shows the image processing method in this embodiment. 倍率色収差(色ずれ)の説明図である。It is explanatory drawing of lateral chromatic aberration (color shift). 本実施形態における倍率色収差の補正処理を示すフローチャートである。It is a flowchart which shows the correction process of the magnification chromatic aberration in this embodiment. 本実施形態における倍率色収差の補正データの作成手順の説明図である。It is explanatory drawing of the preparation procedure of the correction data of the magnification chromatic aberration in this embodiment. 本実施形態における単調増減判定処理を示すフローチャートである。It is a flowchart which shows the monotonous increase / decrease determination process in this embodiment. 本実施形態において、単調増減判定対象の画素区間が単調増減特性を有する場合の一例を示す図である。In this embodiment, it is a figure which shows an example in case the pixel area of the monotonous increase / decrease determination object has a monotonous increase / decrease characteristic. 本実施形態において、単調増減判定対象の画素区間が単調増減特性を有しない場合の一例を示す図である。In this embodiment, it is a figure which shows an example in case the pixel area of the monotonous increase / decrease determination object does not have a monotonous increase / decrease characteristic. 本実施形態において、注目画素を中心とした単調増減判定用の画素区間を示す図である。In this embodiment, it is a figure which shows the pixel area for the monotone increase / decrease determination centering on an attention pixel. 本実施形態において、注目画素を端の点とした単調増減判定用の画素区間を示す図である。In this embodiment, it is a figure which shows the pixel area for the monotone increase / decrease determination which used the attention pixel as the end point. 本実施形態において、画像内の3×3画素の領域を示す図、および、各画素に対してローパスフィルタを適用した結果を示す図である。In this embodiment, it is a figure which shows the area | region of 3x3 pixel in an image, and a figure which shows the result of having applied the low-pass filter with respect to each pixel. 本実施形態において、各画素に対してローパスフィルタを適用した場合の入力信号の変化の例を示す図である。In this embodiment, it is a figure which shows the example of the change of an input signal at the time of applying a low-pass filter with respect to each pixel. 本実施形態において、対称な収差を有する撮像光学系の単調増減検出の例を示す図である。In this embodiment, it is a figure which shows the example of the monotone increase / decrease detection of the imaging optical system which has a symmetrical aberration. 本実施形態において、非対称な収差を有する撮像光学系の単調増減検出の例を示す図である。In this embodiment, it is a figure which shows the example of the monotone increase / decrease detection of the imaging optical system which has an asymmetrical aberration. 本実施形態における光学情報の説明図である。It is explanatory drawing of the optical information in this embodiment. 本実施形態において、光学情報および単調増減検出結果に基づいて色にじみ領域を判定する例を示す図である。In this embodiment, it is a figure which shows the example which determines a color bleeding area | region based on optical information and a monotonous increase / decrease detection result. 本実施形態における2次元の光学情報の説明図である。It is explanatory drawing of the two-dimensional optical information in this embodiment. 本実施形態において、光学情報を用いた色にじみ判定処理を示す図である。In this embodiment, it is a figure which shows the color blur determination process using optical information. 本実施形態における光学情報の算出方法の説明図である。It is explanatory drawing of the calculation method of the optical information in this embodiment. 本実施形態において、青色にじみの典型的な画素値変化を示す図である。In this embodiment, it is a figure which shows the typical pixel value change of a blue blur. 本実施形態において、Bプレーンの画素値に対する非線形変換の特性図である。In this embodiment, it is a characteristic view of the nonlinear conversion with respect to the pixel value of B plane. 本実施形態における色度座標ab面を示す図である。It is a figure which shows the chromaticity coordinate ab surface in this embodiment. 本実施形態において、単調増減判定結果によるBプレーン内の3×3画素の領域を示す図である。In this embodiment, it is a figure which shows the area | region of 3 * 3 pixel in B plane by a monotone increase / decrease determination result. 本実施形態における別の画像処理方法を示すフローチャートである。It is a flowchart which shows another image processing method in this embodiment. 本実施形態における色にじみ補正データ(色にじみに関する光学情報)の補正の説明図である。It is explanatory drawing of correction | amendment of the color blur correction data (optical information regarding a color blur) in this embodiment. 実施例1における撮像装置の構成図である。1 is a configuration diagram of an imaging apparatus in Embodiment 1. FIG. 実施例2における画像処理システムの構成図である。FIG. 6 is a configuration diagram of an image processing system in Embodiment 2.

以下、本発明の実施形態について、図面を参照しながら詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

まず、図1Aおよび図1Bを参照して、本実施形態における画像処理装置および画像処理方法について説明する。ここで説明される画像処理装置および画像処理方法は、後述の各実施例において適宜用いられる。図1Aは、本実施形態における画像処理装置100のブロック図である。図1Bは、本実施形態における画像処理方法(画像処理プログラム)のフローチャートである。図1Bの各ステップは、例えば、記憶部(メモリ)に記憶された画像処理プログラムを実行するコンピュータ(プロセッサ)の指令に基づいて、画像処理装置100の各手段により実現される。メモリまたはプロセッサは、画像処理装置100の内部または外部のいずれに設けられていてもよい。   First, an image processing apparatus and an image processing method in this embodiment will be described with reference to FIGS. 1A and 1B. The image processing apparatus and the image processing method described here are appropriately used in each embodiment described later. FIG. 1A is a block diagram of an image processing apparatus 100 in the present embodiment. FIG. 1B is a flowchart of an image processing method (image processing program) in the present embodiment. Each step in FIG. 1B is realized by each unit of the image processing apparatus 100 based on a command of a computer (processor) that executes an image processing program stored in a storage unit (memory), for example. The memory or the processor may be provided either inside or outside the image processing apparatus 100.

図1Aに示されるように、画像処理装置100は、取得部101、検出部102、修正部103、判定部104、決定部105、記憶部106、および、出力部107を備えている。まず、図1BのステップS101において、画像処理装置100(取得部101)は、撮影画像を入力画像として取得する。入力画像は、撮像光学系を介して撮像素子で受光することにより得られたデジタル画像(撮影画像)であり、レンズと各種の光学フィルタ類を含む撮像光学系の収差により劣化している。なお撮像光学系は、レンズだけでなく曲率を有するミラー(反射面)を用いて構成することもできる。   As illustrated in FIG. 1A, the image processing apparatus 100 includes an acquisition unit 101, a detection unit 102, a correction unit 103, a determination unit 104, a determination unit 105, a storage unit 106, and an output unit 107. First, in step S101 of FIG. 1B, the image processing apparatus 100 (acquisition unit 101) acquires a captured image as an input image. The input image is a digital image (captured image) obtained by receiving light with the image sensor via the imaging optical system, and is deteriorated by the aberration of the imaging optical system including the lens and various optical filters. Note that the imaging optical system can be configured using not only a lens but also a mirror (reflection surface) having a curvature.

入力画像の色成分は、例えばRGB色成分の情報を有する。色成分としては、これ以外にもLCHで表現される明度、色相、彩度や、YCbCrで表現される輝度、色差信号など一般に用いられている色空間を選択して用いることができる。その他の色空間として、XYZ、Lab、Yuv、JChを用いることが可能である。また、色温度を用いてもよい。撮影画像は、撮像装置と画像処理装置とを有線または無線で接続して取得することができる。また撮影画像は、記憶媒体を介して取得することもできる。   The color component of the input image has information on RGB color components, for example. As the color component, other commonly used color spaces such as brightness, hue, and saturation expressed in LCH, luminance expressed in YCbCr, and color difference signals can be selected and used. As other color spaces, XYZ, Lab, Yuv, and JCh can be used. Color temperature may also be used. The captured image can be acquired by connecting the imaging device and the image processing device by wire or wirelessly. The captured image can also be acquired via a storage medium.

続いてステップS102において、画像処理装置100(取得部101)は、撮像光学系の撮影条件(撮影条件情報)を取得する。撮影条件とは、焦点距離、絞り値、および、撮影距離(フォーカスレンズの位置)などの撮像光学系の状態である。撮影条件は、例えばExif情報のように画像に付加された情報から取得することができる。   Subsequently, in step S102, the image processing apparatus 100 (acquisition unit 101) acquires imaging conditions (imaging condition information) of the imaging optical system. The imaging conditions are the state of the imaging optical system such as the focal length, aperture value, and imaging distance (focus lens position). The shooting condition can be acquired from information added to the image such as Exif information.

続いてステップS103において、画像処理装置100(取得部101)は、撮影条件に対応する倍率色収差の補正データを取得する。倍率色収差の補正データは、撮像光学系の設計値や製造工程で測定したデータに基づいて、撮像装置や画像処理装置の記憶部(メモリ)が予め保持しているデータ(記憶部に記憶されている倍率色収差に関する情報)である。例えば、撮像装置が補正データを保持しており画像処理装置が補正データを保持していない場合、通信により撮像装置から画像処理装置へ伝送するか、または、補正データを画像データに付加することにより間接的に伝送することができる。   Subsequently, in step S103, the image processing apparatus 100 (acquisition unit 101) acquires magnification chromatic aberration correction data corresponding to the imaging conditions. The correction data for the chromatic aberration of magnification is data (stored in the storage unit) that is stored in advance in the storage unit (memory) of the imaging device or the image processing device based on the design value of the imaging optical system or the data measured in the manufacturing process. Information on chromatic aberration of magnification). For example, when the imaging device holds correction data and the image processing device does not hold correction data, it is transmitted from the imaging device to the image processing device by communication, or the correction data is added to the image data. It can be transmitted indirectly.

続いてステップS104において、画像処理装置100(検出部102)は、ステップS101にて取得した入力画像(撮影画像)から倍率色収差(色ずれ)に関する情報を検出する。そしてステップS105において、画像処理装置100(修正部103)は、ステップS104にて検出された倍率色収差に関する情報に基づいて、画像の倍率色収差を補正(修正)する。本実施形態において、この倍率色収差の補正は、ステップS104にて検出された倍率色収差に関する情報と、ステップS103にて取得した倍率色収差の補正データとを比較して修正することができる。画像から検出された倍率色収差と、予め保持されている補正データとを比較することにより、誤検出による誤った補正が行われないように制限することができる。なお、ステップS105の倍率色収差の補正は、後述するステップS111の色にじみ補正よりも前の工程で行われる。以下、その理由について説明する。   Subsequently, in step S104, the image processing apparatus 100 (detection unit 102) detects information relating to the chromatic aberration of magnification (color shift) from the input image (captured image) acquired in step S101. In step S105, the image processing apparatus 100 (correction unit 103) corrects (corrects) the lateral chromatic aberration of the image based on the information on the lateral chromatic aberration detected in step S104. In the present embodiment, the correction of the lateral chromatic aberration can be corrected by comparing the information on the lateral chromatic aberration detected in step S104 with the correction data of the lateral chromatic aberration acquired in step S103. By comparing the chromatic aberration of magnification detected from the image with the correction data held in advance, it is possible to limit erroneous correction due to erroneous detection. Note that the correction of the lateral chromatic aberration in step S105 is performed in a step prior to the color blur correction in step S111 described later. The reason will be described below.

図2は倍率色収差(色ずれ)の説明図であり、図2(a)は倍率色収差が残存する入力画像の模擬図、図2(b)は図2(a)の水平方向の断面図をそれぞれ示している。図2(a)中の横軸はx軸(水平方向の軸)、縦軸はy軸(垂直方向の軸)をそれぞれ示す。図2(b)中の横軸はx軸、縦軸は画素値をそれぞれ示す。なお、x軸とy軸の交点は画像の中心である。図2(a)、(b)において、実線はGプレーン、点線はRプレーン、一点鎖線はBプレーンをそれぞれ表している。また、図2において、撮像光学系は共軸系であり、倍率色収差以外の収差については補正されており、元の像の強度の形状はRGBにおいて互いに一致し、倍率色収差の分だけずれているものとする。   FIG. 2 is an explanatory diagram of chromatic aberration of magnification (color shift), FIG. 2A is a simulated view of an input image in which chromatic aberration of magnification remains, and FIG. 2B is a horizontal sectional view of FIG. Each is shown. In FIG. 2A, the horizontal axis indicates the x-axis (horizontal axis), and the vertical axis indicates the y-axis (vertical axis). In FIG. 2B, the horizontal axis indicates the x-axis, and the vertical axis indicates the pixel value. Note that the intersection of the x-axis and the y-axis is the center of the image. 2A and 2B, the solid line represents the G plane, the dotted line represents the R plane, and the alternate long and short dash line represents the B plane. In FIG. 2, the imaging optical system is a coaxial system, and aberrations other than lateral chromatic aberration have been corrected. The intensity shapes of the original images coincide with each other in RGB and are shifted by the amount of lateral chromatic aberration. Shall.

このような場合、図2に示されるように、低像高側(x軸とy軸の交点側)では、RプレーンやGプレーンよりもBプレーンの画素値が高くなる。このため、低像高側の領域は青くにじんで見える。一方、高像高側では、GプレーンやBプレーンよりもRプレーンの画素値が高くなる。このため、高像高側の領域は赤くにじんで見える。このような状態で色にじみ補正を行うと、図2に示されるように、倍率色収差で各色のプレーンがずれているだけの状態であっても色にじみが発生しているとして処理されるため、正しく補正することができず、本来の色に戻すことができない可能性がある。   In such a case, as shown in FIG. 2, the pixel value of the B plane is higher than that of the R plane or the G plane on the low image height side (the intersection side of the x axis and the y axis). For this reason, the area on the low image height side appears blurred in blue. On the other hand, on the high image height side, the pixel value of the R plane is higher than that of the G plane and B plane. For this reason, the area on the high image height side appears blurred in red. When color blur correction is performed in such a state, as shown in FIG. 2, even if the plane of each color is just shifted due to the chromatic aberration of magnification, the color blur is processed. There is a possibility that it cannot be corrected correctly and the original color cannot be restored.

例えば、図2のような場合、RGBの形状が揃うように色にじみ補正をしようとすると、RGBが重なっている部分は内側の一部であるため、元の像の形状よりもエッジ部が削られてしまうということある。または、エッジ部が削れないようGプレーンに合わせようとすると、低像高側ではRプレーンの画素値、高像高側ではBプレーンの画素値がそれぞれ低くなり、色抜けが発生するという問題も生じうる。そこで本実施形態では、先に倍率色収差を補正してから後述の色にじみ補正処理を行うことにより、このような弊害を発生させることなく、高精度に撮像光学系により発生する被写体の色にじみを適切に補正する。   For example, in the case shown in FIG. 2, when correcting the color blur so that the shapes of RGB are aligned, the portion where RGB overlaps is a part of the inside, so the edge portion is cut out from the shape of the original image. There is a thing that will be. Or, when trying to match the G plane so that the edge portion is not scraped, the pixel value of the R plane becomes low on the low image height side, and the pixel value of the B plane becomes low on the high image height side, which causes color loss. Can occur. Therefore, in the present embodiment, by correcting the lateral chromatic aberration first and then performing the color blur correction process described later, the color blur of the subject generated by the imaging optical system can be accurately performed without causing such a problem. Correct appropriately.

ここで、図3を参照して、本実施形態における倍率色収差の補正処理(図1BのステップS104、S105)について説明する。図3は、倍率色収差の補正処理を示すフローチャートである。   Here, with reference to FIG. 3, the chromatic aberration correction process (steps S104 and S105 in FIG. 1B) in the present embodiment will be described. FIG. 3 is a flowchart showing the correction process of the lateral chromatic aberration.

まず、ステップS201において、画像処理装置100(取得部101)は、撮影画像を入力画像として取得する。続いてステップS202において、画像処理装置100(検出部102)は、倍率色収差による色ずれが顕著に現れるエッジを画像(撮影画像)から検出する。エッジの検出には、Y(輝度)プレーンが用いられるが、これに限定されるものではない。ここで検出されるエッジは、光学中心からの動径方向に大きく画素値の変化するエッジに限定することにより、高精度な色ずれ量の取得が可能となる。また、Yプレーンにおいて、倍率色収差による色ずれは、一つに混じり合って現れる。このため、画素値が単調増加または単調減少が複数画素で続くような、ある程度幅のあるエッジを対象とすることが好ましい。   First, in step S201, the image processing apparatus 100 (acquisition unit 101) acquires a captured image as an input image. Subsequently, in step S202, the image processing apparatus 100 (detection unit 102) detects, from the image (captured image), an edge in which a color shift due to lateral chromatic aberration appears significantly. For detection of an edge, a Y (luminance) plane is used, but the present invention is not limited to this. The edge detected here is limited to the edge where the pixel value changes greatly in the radial direction from the optical center, so that a highly accurate color misregistration amount can be acquired. In the Y plane, the color shift due to the chromatic aberration of magnification appears mixed together. For this reason, it is preferable to target an edge having a certain width such that the pixel value monotonously increases or decreases monotonically for a plurality of pixels.

続いてステップS203において、画像処理装置100(取得部101)は、ステップS202にて検出された各エッジにおける色ずれ量を取得する。色ずれの方向として、光学中心と各エッジの位置関係により、上/下方向、左/右方向、右斜め上/左斜め下方向、左斜め上/右斜め下方向のいずれかを適用することにより、補正処理の簡略化が可能である。そして、各エッジにおける色ずれ量の取得には、色成分間の相関を用いる。例えば、色成分間の差分絶対値の和を判定して色ずれ量を取得することができる。Gプレーンに対しRプレーン(またはBプレーン)を色ずれ方向に移動させながら、検出されたエッジ付近の画素において、色成分間の差分絶対値和が最小となる場所を探索する。ここで検出された差分絶対値和が最小となる位置から、Gプレーンに対するRプレーン(またはBプレーン)の色ずれ量を判定することが可能である。ステップS203にて取得された色ずれ量は、例えば、Gプレーンに対してRプレーン(またはBプレーン)が光学中心方向へずれている場合に負の値とし、Gプレーンに対しRプレーン(またはBプレーン)が光学中心とは逆方向へずれている場合に正の値とする。   Subsequently, in step S203, the image processing apparatus 100 (acquisition unit 101) acquires the amount of color misregistration at each edge detected in step S202. Depending on the positional relationship between the optical center and each edge, one of up / down, left / right, right up / down left, down left / up right / down is applied as the color misregistration direction. Thus, the correction process can be simplified. The correlation between the color components is used to acquire the color misregistration amount at each edge. For example, the amount of color misregistration can be acquired by determining the sum of absolute differences between color components. While the R plane (or B plane) is moved in the color shift direction with respect to the G plane, a place where the sum of absolute differences between color components is minimized is searched for in the pixels near the detected edge. It is possible to determine the color misregistration amount of the R plane (or B plane) with respect to the G plane from the position where the sum of absolute differences detected here is minimized. The color misregistration amount acquired in step S203 is a negative value when, for example, the R plane (or B plane) is shifted in the optical center direction with respect to the G plane, and the R plane (or B plane with respect to the G plane). A positive value is obtained when the plane is displaced in the direction opposite to the optical center.

続いてステップS204において、画像処理装置100(修正部103)は、ステップS202にて検出された各エッジの像高と、ステップS203にて取得した各エッジの色ずれ量とに基づいて、像高と色ずれとの関係を求めて補正データを作成する。ここで像高とは、光学中心に相当する画素(以降、単に「光学中心」という)からの距離である。以下、図4を参照して、補正データの作成手順について具体的に説明する。図4は本実施形態における倍率色収差の補正データの作成手順の説明図であり、図4(a)は画像を像高ごとに領域h1〜h8に分割した図、図4(b)は像高と色ずれ率との関係をそれぞれ示している。   Subsequently, in step S204, the image processing apparatus 100 (correction unit 103) determines the image height based on the image height of each edge detected in step S202 and the color shift amount of each edge acquired in step S203. The correction data is created by obtaining the relationship between the color shift and the color shift. Here, the image height is a distance from a pixel corresponding to the optical center (hereinafter simply referred to as “optical center”). Hereinafter, the procedure for creating correction data will be described in detail with reference to FIG. FIG. 4 is an explanatory diagram of a procedure for creating correction data for chromatic aberration of magnification in the present embodiment. FIG. 4A is a diagram in which an image is divided into regions h1 to h8 for each image height, and FIG. And the relationship between the color misregistration ratios.

まず、図3のステップS202にて検出されたエッジの像高をL、ステップS203にて取得された色ずれ量をDとすると、像高に対する色ずれ率Mは、M=L/(L+D)のように表される。続いて、図4(a)に示されるように、画像を像高ごとに8つの領域h1〜h8に分割し、エッジが属する領域を選定する。続いて、画像内で検出された複数のエッジのそれぞれに関して、色ずれ率Mの算出およびエッジがぞくする領域の選定を行う。そして、像高に応じて分割した8つの領域ごとに色ずれ率Mを集計し、領域ごとに色ずれ率Mの平均値を求め、各領域の色ずれ率を決定する。   First, assuming that the image height of the edge detected in step S202 of FIG. 3 is L and the color shift amount acquired in step S203 is D, the color shift rate M with respect to the image height is M = L / (L + D). It is expressed as Subsequently, as shown in FIG. 4A, the image is divided into eight regions h1 to h8 for each image height, and the region to which the edge belongs is selected. Subsequently, with respect to each of the plurality of edges detected in the image, calculation of the color misregistration rate M and selection of an area to be removed by the edge are performed. Then, the color misregistration rates M are tabulated for each of the eight regions divided according to the image height, an average value of the color misregistration rates M is obtained for each region, and the color misregistration rate of each region is determined.

続いて、図4(b)に示されるように、像高と色ずれ率とを用いて、像高と色ずれ率との関係を表す近似曲線として高次の多項近似式F(L)を算出し、これを補正データとする。図4(b)は、三次の多項式により補正データを算出した例であるが、これに限定されるものではない。なお、エッジの検出および色ずれ量の取得は、画面内の全エッジに対して行ってもよい。ただし、像高に応じて分割した8つの領域ごとに、所定の閾値以上の数の色ずれ率が集計された段階でエッジ検出と色ずれ量取得を終了するなど、信頼度を保ちつつ処理の効率化を図ることが可能である。また、像高ごとに分割した8つの領域のうち、該当するエッジが見つかった領域のみを高次の多項近似式算出に使用することにより、該当するエッジが見つからない領域がある場合でも補正データの作成が可能となる。   Subsequently, as shown in FIG. 4B, using the image height and the color misregistration rate, a high-order polynomial approximate expression F (L) is expressed as an approximate curve representing the relationship between the image height and the color misregistration rate. This is calculated and used as correction data. FIG. 4B shows an example in which correction data is calculated using a cubic polynomial. However, the present invention is not limited to this. Note that edge detection and color shift amount acquisition may be performed for all edges in the screen. However, for each of the eight regions divided according to the image height, the edge detection and the color misregistration amount acquisition are completed when the number of color misregistration ratios equal to or greater than a predetermined threshold is aggregated. It is possible to improve efficiency. In addition, by using only the area where the corresponding edge is found among the eight areas divided for each image height for calculating the higher-order polynomial approximation, even if there is an area where the corresponding edge is not found, the correction data Can be created.

続いてステップS205において、画像処理装置100(修正部103)は、ステップS204にて作成された補正データを用いて、画像の色ずれを補正する。まず、補正対象となるプレーン(Rプレーン、Bプレーン)の画素(X,Y)において、M=F(L)の関係を用いて、画素(X,Y)の像高Lから色ずれ率Mを求める。なお、光学中心の位置が(0,0)の座標系とする。   Subsequently, in step S205, the image processing apparatus 100 (correction unit 103) corrects the color misregistration of the image using the correction data created in step S204. First, in the pixel (X, Y) of the plane to be corrected (R plane, B plane), the color misregistration rate M from the image height L of the pixel (X, Y) using the relationship of M = F (L). Ask for. It is assumed that the optical center position is a coordinate system of (0, 0).

続いて、画像処理装置100は、X1=M×X、Y1=M×Yの関係を用いて、色ずれ補正により生成する画素の座標(X1,Y1)を求める。補正対象となるプレーンにおいて、座標(X1,Y1)に相当する画素値を、一般的な補間処理により生成し、画素(X,Y)の画素値とする。これらを全画素について行うことにより色ずれ補正を行う。そして、ステップS206において、画像処理装置100は、補正画像を出力する。   Subsequently, the image processing apparatus 100 obtains the coordinates (X1, Y1) of the pixel generated by the color misregistration correction using the relationship of X1 = M × X and Y1 = M × Y. In the plane to be corrected, a pixel value corresponding to the coordinates (X1, Y1) is generated by a general interpolation process, and is set as the pixel value of the pixel (X, Y). Color misregistration correction is performed by performing these operations for all pixels. In step S206, the image processing apparatus 100 outputs a corrected image.

次に、図1に戻り、ステップS106において、画像処理装置100(判定部104)は、製造誤差判定を行う。本実施形態において、画像処理装置100は、ステップS103にて取得した倍率色収差の補正データと、ステップS104(S204)にて作成した補正データとを比較して、撮像光学系の製造誤差(の程度)を判定する。ここで、ステップS103にて取得した倍率色収差の補正データを第1の補正データ、ステップS204にて作成した補正データを第2の補正データと呼ぶ。第1の補正データは、撮像光学系の設計値または製造工程で測定したデータ(撮像光学系の設計値に基づく倍率色収差に関する情報、すなわち記憶部に記憶された倍率色収差に関する情報)である。一方、第2の補正データは、撮影時に発生した倍率色収差(撮影画像から検出された倍率色収差)の補正データ(画像の倍率色収差に関する情報)である。   Next, returning to FIG. 1, in step S106, the image processing apparatus 100 (determination unit 104) performs a manufacturing error determination. In this embodiment, the image processing apparatus 100 compares the correction data for the chromatic aberration of magnification acquired in step S103 with the correction data created in step S104 (S204), and the manufacturing error of the imaging optical system (the extent of the error). ). Here, the correction data of the lateral chromatic aberration acquired in step S103 is referred to as first correction data, and the correction data generated in step S204 is referred to as second correction data. The first correction data is a design value of the imaging optical system or data measured in the manufacturing process (information on lateral chromatic aberration based on the design value of the imaging optical system, that is, information on lateral chromatic aberration stored in the storage unit). On the other hand, the second correction data is correction data (information relating to the chromatic aberration of magnification of the image) of the chromatic aberration of magnification (a chromatic aberration of magnification detected from the captured image) that has occurred during shooting.

第1の補正データが撮像光学系の設計値に基づいて作成されており、第1の補正データと第2の補正データとが互いに一致する場合、撮像光学系の製造誤差は発生していない。逆に、第1の補正データと第2の補正データとが互いに一致しない場合、撮像光学系の製造誤差が発生している。本実施形態において、画像処理装置100(判定部104)は、第1の補正データと第2の補正データとが互いに一致するか否かを、第1の補正データと第2の補正データとの差が所定の範囲内であるか否かにより判定する。   When the first correction data is created based on the design value of the imaging optical system, and the first correction data and the second correction data match each other, no manufacturing error of the imaging optical system has occurred. Conversely, if the first correction data and the second correction data do not match each other, a manufacturing error of the imaging optical system has occurred. In the present embodiment, the image processing apparatus 100 (determination unit 104) determines whether or not the first correction data and the second correction data match each other based on the first correction data and the second correction data. Judgment is made based on whether or not the difference is within a predetermined range.

一方、第1の補正データが撮像光学系の製造工程での測定に基づいて作成されており、第1の補正データと第2の補正データとが互いに一致する場合、撮影時の誤差が製造工程での測定時と変化していないということになる。逆に、第1の補正データと第2の補正データとが互いに一致しない場合、製造工程での測定後に誤差が発生したということになる。このように画像処理装置100(判定部104)は、製造工程での測定後に誤差が発生していない場合、製造誤差がないと判定する。一方、画像処理装置100は、製造工程での測定後に誤差が発生した場合、製造誤差があると判定する。また、製造誤差は広義の誤差を意味し、例えば、防振レンズによる収差変動、撮像装置の姿勢差による収差変動、環境温度による収差変動などの撮影時の状態に依存する誤差を含む。   On the other hand, when the first correction data is created based on the measurement in the manufacturing process of the imaging optical system, and the first correction data and the second correction data match each other, an error at the time of photographing is a manufacturing process. It means that there is no change from the time of measurement at. Conversely, if the first correction data and the second correction data do not match each other, an error has occurred after measurement in the manufacturing process. In this manner, the image processing apparatus 100 (determination unit 104) determines that there is no manufacturing error when no error has occurred after measurement in the manufacturing process. On the other hand, if an error occurs after measurement in the manufacturing process, the image processing apparatus 100 determines that there is a manufacturing error. Further, the manufacturing error means an error in a broad sense, and includes, for example, errors depending on the state at the time of shooting such as aberration fluctuation due to an anti-vibration lens, aberration fluctuation due to an attitude difference of the imaging apparatus, and aberration fluctuation due to environmental temperature.

そして、画像処理装置100(記憶部106)は、ステップS106の製造誤差判定の結果を記憶する。例えば、製造誤差の有無の判定フラグとして、製造誤差がある場合には「1」、製造誤差がない場合には「0」を保持する。なお、ステップS106の製造誤差判定は、ステップS103にて取得した倍率色収差の補正データと、ステップS104にて作成した補正データとを比較して行われるため、ステップS105の倍率色収差補正の前に行ってもよい。   Then, the image processing apparatus 100 (storage unit 106) stores the result of the manufacturing error determination in step S106. For example, “1” is stored when there is a manufacturing error, and “0” is stored when there is no manufacturing error, as a determination flag for the presence or absence of manufacturing error. Note that the manufacturing error determination in step S106 is performed by comparing the correction data of the magnification chromatic aberration acquired in step S103 with the correction data created in step S104, and therefore is performed before the correction of magnification chromatic aberration in step S105. May be.

続いてステップS107において、画像処理装置100(検出部102)は、カラー画像を構成する複数の色プレーンのうちいずれかの色プレーンの画素値(信号レベル)が単調増加または単調減少している領域を検出する。そして画像処理装置100(検出部102)は、検出した領域を色にじみ発生領域と仮判定する(単調増減検出工程)。単調増減検出工程において色にじみ発生領域を判定する方法としては、いくつかの方法が考えられる。本実施形態では、一定の画素区間(所定の区間)の色にじみの画素値の変化特性に基づいて判定を行う。   Subsequently, in step S107, the image processing apparatus 100 (detection unit 102) is a region in which the pixel value (signal level) of any one of the plurality of color planes constituting the color image is monotonously increasing or monotonically decreasing. Is detected. Then, the image processing apparatus 100 (detection unit 102) tentatively determines the detected area as a color blur generation area (monotonic increase / decrease detection process). Several methods are conceivable as a method of determining the color blur generation region in the monotonous increase / decrease detection step. In the present embodiment, the determination is made based on the change characteristic of the pixel value that blurs in a certain pixel section (predetermined section).

色にじみは、結像位置が波長により光軸に沿う方向にずれることで発生するため、例えば青色のにじみの場合、青色プレーン(Bプレーン)の焦点が合わない(ピンボケしている)ことになる。ピンボケによる色にじみは、一定の画素区間に渡って存在し、その際の色にじみの画素値変化は、画像のハイライト部からシャドウ部にかけて緩やかに減少する特性を有する。従って、一定の画素区間の色にじみの画素値変化が単調増加または単調減少の特性を有する場合、色にじみが発生している可能性があるため、色にじみ発生領域として仮判定する。   Since color blur occurs when the imaging position shifts in the direction along the optical axis depending on the wavelength, for example, in the case of blue blur, the blue plane (B plane) is out of focus (out of focus). . The color blur due to the defocusing exists over a certain pixel section, and the pixel value change of the color blur at that time has a characteristic of gradually decreasing from the highlight portion to the shadow portion of the image. Therefore, when the pixel value change of color blur in a certain pixel section has a monotonous increase or monotonic decrease characteristic, there is a possibility that color blur has occurred, so that it is temporarily determined as a color blur generation region.

このように本実施形態において、撮像素子は、複数のカラーフィルタを備えている。そして検出部102は、撮像素子から得られた画像の少なくとも一つのカラーフィルタに対応する色プレーンの信号レベル(画素値)が、所定の区間においていずれかの方向(第1の方向)に単調増加または単調減少している領域(第1の領域)を検出する。ただし本実施形態はこれに限定されるものではなく、色プレーンの信号レベルに代えて、例えば、撮像素子から得られた画像から生成される輝度プレーン(Yプレーン)の信号レベルが単調増加または単調減少している領域を検出するように構成してもよい。   As described above, in the present embodiment, the image sensor includes a plurality of color filters. Then, the detection unit 102 monotonically increases the signal level (pixel value) of the color plane corresponding to at least one color filter of the image obtained from the image sensor in any direction (first direction) in a predetermined section. Alternatively, a monotonically decreasing area (first area) is detected. However, the present embodiment is not limited to this, and instead of the signal level of the color plane, for example, the signal level of the luminance plane (Y plane) generated from the image obtained from the image sensor increases monotonously or monotonically. You may comprise so that the area | region which is reducing may be detected.

ところで、実際には、撮像光学系がコマ収差などの光軸(中心軸)に関して非対称(回転非対称)な収差を有する場合、撮像光学系により発生する色にじみは、被写体に対して発生する方向と発生しない方向が存在する。このため、単調増減のみから色にじみ発生領域を判定すると、被写体が色にじみと同系色である場合、被写体の色を色にじみと誤判定する可能性がある。従って、単調増減検出のみでは色にじみ発生領域を正しく判定することができない。   Actually, when the imaging optical system has an asymmetric (rotationally asymmetric) aberration with respect to the optical axis (center axis) such as coma aberration, the color blur generated by the imaging optical system is the direction in which the subject is generated. There is a direction that does not occur. For this reason, if the color blur generation area is determined only from monotonous increase / decrease, if the subject has a color similar to the color blur, the subject color may be erroneously determined to be color blur. Accordingly, it is not possible to correctly determine the color blur generation area only by monotonic increase / decrease detection.

本実施形態において、単調増加または単調減少を検出する領域は、カラー画像の注目画素を中心とした水平方向、垂直方向、または、斜め方向の画素区間、注目画素を端の点とした水平方向、垂直方向、または、斜め方向の画素区間、のいずれかを含む。   In the present embodiment, the region for detecting monotonic increase or monotonic decrease is a horizontal, vertical or diagonal pixel section centered on the target pixel of the color image, a horizontal direction with the target pixel as an end point, It includes either a vertical or diagonal pixel section.

単調増減の検出は、まず、色プレーンの画素値傾斜を計算することにより行われる。入力画像が、例えば、Gプレーン、Bプレーン、Rプレーンの3色の色プレーンで構成されている場合、Bプレーンを色にじみ除去対象とし、基準プレーンとしてGプレーンを用いる。Bプレーン、Gプレーンに対するそれぞれの輝度傾斜Blea、Gleaは、以下の式(1)で表されるように算出される。   Detection of monotonic increase / decrease is performed by first calculating the pixel value gradient of the color plane. When the input image is composed of, for example, three color planes of the G plane, the B plane, and the R plane, the B plane is set as a color blur removal target, and the G plane is used as a reference plane. The respective luminance gradients Blea and Glea with respect to the B plane and the G plane are calculated as represented by the following expression (1).

式(1)において、G(x+1,y)、B(x+1,y)は、それぞれ、Gプレーン、Bプレーンにおける注目画素の右隣の画素値である。G(x−1,y)、B(x−1,y)は、それぞれ、Gプレーン、Bプレーンにおける注目画素の左隣の画素値である。G(x,y+1)、B(x,y+1)は、それぞれ、Gプレーン、Bプレーンにおける注目画素の下隣の画素値である。G(x,y−1)、B(x,y−1)は、それぞれ、Gプレーン、Bプレーンにおける注目画素の上隣の画素値である。本実施形態は、3色の色プレーンで説明するが、画像を構成する色プレーン数により任意の色プレーンで処理を行うことが可能である。   In Expression (1), G (x + 1, y) and B (x + 1, y) are pixel values on the right side of the target pixel in the G plane and B plane, respectively. G (x−1, y) and B (x−1, y) are pixel values on the left side of the target pixel in the G plane and the B plane, respectively. G (x, y + 1) and B (x, y + 1) are pixel values below the pixel of interest in the G plane and B plane, respectively. G (x, y-1) and B (x, y-1) are pixel values above and below the pixel of interest in the G plane and B plane, respectively. Although this embodiment will be described with three color planes, processing can be performed with any color plane depending on the number of color planes constituting the image.

次に、図5乃至図7を参照して、単調増減検出工程の色にじみ発生領域の判定方法について説明する。図5は、本実施形態における単調増減判定処理(単調増減検出工程:ステップS107)を示すフローチャートである。図5の各ステップは、主に、画像処理装置100(検出部102)により実行される。まずステップS1520において、画像処理装置100は、ISO感度が高いか否か(ISO感度が所定の感度よりも高いか否か)を判定する。ISO感度が高い場合、ステップS1521に移行する。一方、ISO感度が高くない場合、ステップS1522に移行する。   Next, with reference to FIGS. 5 to 7, a method for determining a color blur occurrence area in the monotonous increase / decrease detection process will be described. FIG. 5 is a flowchart showing a monotonous increase / decrease determination process (monotonic increase / decrease detection step: step S107) in the present embodiment. Each step in FIG. 5 is mainly executed by the image processing apparatus 100 (detection unit 102). First, in step S1520, the image processing apparatus 100 determines whether the ISO sensitivity is high (whether the ISO sensitivity is higher than a predetermined sensitivity). If the ISO sensitivity is high, the process proceeds to step S1521. On the other hand, if the ISO sensitivity is not high, the process proceeds to step S1522.

ステップS1522において、画像処理装置100は、入力画像の注目画素を中心とした時の縦・横・斜めの画素区間(所定の区間)に対して、入力信号の画素値変化を解析する。そしてステップS1523において、画像処理装置100は、上記画素区間の入力信号の画素値変化が単調増減の特性を有するか否かを判定(検出)する。その判定の結果、上記の画素区間の入力信号の画素値変化が単調増減の特性を有さない場合、ステップS1524において、画像処理装置100は、注目画素を端の点とした時の縦・横・斜めの画素区間に対して入力信号の画素値変化を解析する。そしてステップS1525において、画像処理装置100は、上記の画素区間の入力信号の画素値変化が単調増減の特性を有するか否かを判定する。   In step S1522, the image processing apparatus 100 analyzes a change in the pixel value of the input signal with respect to vertical, horizontal, and diagonal pixel sections (predetermined sections) when the pixel of interest of the input image is the center. In step S1523, the image processing apparatus 100 determines (detects) whether or not the change in the pixel value of the input signal in the pixel section has a monotonous increase / decrease characteristic. As a result of the determination, if the change in the pixel value of the input signal in the pixel section does not have a monotonous increase / decrease characteristic, in step S1524, the image processing apparatus 100 displays the vertical / horizontal when the target pixel is the end point.・ A pixel value change of an input signal is analyzed for an oblique pixel section. In step S1525, the image processing apparatus 100 determines whether the change in the pixel value of the input signal in the pixel section has a monotonous increase / decrease characteristic.

図6は、単調増減判定対象の画素区間が単調増減特性を有する場合の一例を示す図であり、縦軸は画素値、横軸は距離をそれぞれ示している。図7は、単調増減判定対象の画素区間が単調増減特性を有しない場合の一例を示す図であり、縦軸は画素値、横軸は距離をそれぞれ示している。図6および図7に示されるような画素値変化を有する入力信号に対して、画像処理装置100は単調増減判定を行う。図6および図7のそれぞれ示される白い四角は注目画素である。   FIG. 6 is a diagram illustrating an example of a case where a pixel section subject to monotonous increase / decrease determination has a monotonous increase / decrease characteristic, where the vertical axis indicates the pixel value and the horizontal axis indicates the distance. FIG. 7 is a diagram illustrating an example of a case where a pixel section that is a monotonous increase / decrease determination target does not have a monotonous increase / decrease characteristic, where the vertical axis indicates the pixel value, and the horizontal axis indicates the distance. The image processing apparatus 100 performs monotonous increase / decrease determination with respect to an input signal having a pixel value change as shown in FIGS. The white squares shown in FIGS. 6 and 7 are the target pixels.

図6に示されるように、入力信号の画素値変化が単調増減の特性を有する画像は、単調増減判定を行う画素区間内において単調増減の特性を有する。このためステップS1522またはS1524の解析の結果、ステップS1523またはS1525において、画像処理装置100は、画素区間内において単調増減の特性を有すると判定する。一方、図7に示されるような入力信号の画素値変化の特性を有する画像に対しては、単調増減の特性を有さないと判定する。   As shown in FIG. 6, an image in which a change in pixel value of an input signal has a monotonous increase / decrease characteristic has a monotonous increase / decrease characteristic in a pixel section in which a monotonous increase / decrease determination is performed. Therefore, as a result of the analysis in step S1522 or S1524, in step S1523 or S1525, the image processing apparatus 100 determines that the pixel section has a monotonous increase / decrease characteristic. On the other hand, it is determined that the image having the change characteristic of the pixel value of the input signal as shown in FIG. 7 does not have the monotonous increase / decrease characteristic.

上記の画素区間の入力信号の画素値変化が単調増減の特性(単調増加の特性または単調減少の特性)を有している場合、ステップS1527において、画像処理装置100は単調増減フラグを立てる。一方、上記の画素区間の入力信号の画素値変化が単調増減の特性(単調増加の特性または単調減少の特性)を有していない場合、ステップS1526において、画像処理装置100は単調増減フラグを立てない。   If the change in the pixel value of the input signal in the pixel section has a monotonous increase / decrease characteristic (monotonic increase characteristic or monotonic decrease characteristic), the image processing apparatus 100 sets a monotonous increase / decrease flag in step S1527. On the other hand, if the change in the pixel value of the input signal in the pixel section does not have a monotonous increase / decrease characteristic (monotonic increase characteristic or monotonic decrease characteristic), the image processing apparatus 100 sets a monotonous increase / decrease flag in step S1526. Absent.

上述した単調増減判定を、Bプレーンの各画素に対して適用する。その結果、各画素において単調増減フラグが立っていれば「1」、単調増減フラグが立っていなければ「0」をそれぞれ対応させ、単調増減判定結果プレーンとして生成して保持し、後述の色にじみ判定(図1BのステップS110)で利用する。単調増減判定結果プレーンの利用方法の詳細については後述する。   The monotonous increase / decrease determination described above is applied to each pixel of the B plane. As a result, each pixel is associated with “1” if the monotonous increase / decrease flag is set, and “0” if the monotone increase / decrease flag is not set, and is generated and held as a monotone increase / decrease determination result plane. Used in determination (step S110 in FIG. 1B). Details of the method of using the monotonous increase / decrease determination result plane will be described later.

次に、図8および図9を参照して、注目画素に対する単調増減判定を行う画素区間の設定方法について説明する。図8(a)〜(d)は、注目画素を中心とした単調増減判定用の画素区間を示す図である。図9(a)〜(h)は、注目画素を端の点とした単調増減判定用の画素区間を示す図である。注目画素を中心とした画素区間の設定方法および注目画素を端の点とした画素区間の設定方法のうち、注目画素を中心とした画素区間の設定方法としては、図8(a)、(b)のように注目画素を中心として水平方向および垂直方向に設定する方法が考えられる。   Next, with reference to FIG. 8 and FIG. 9, a method of setting a pixel section for performing monotonous increase / decrease determination on the target pixel will be described. FIGS. 8A to 8D are diagrams showing a monotonic increase / decrease pixel section centered on the target pixel. FIGS. 9A to 9H are diagrams illustrating a monotone increase / decrease pixel section with the target pixel as an end point. Of the method of setting the pixel section centered on the target pixel and the method of setting the pixel section centered on the target pixel, the method of setting the pixel section centered on the target pixel is shown in FIGS. A method of setting the horizontal direction and the vertical direction around the target pixel as in FIG.

また、注目画素を中心とした画素区間の設定方法としては、図8(c)、(d)に示されるように注目画素を中心として斜め方向に設定する方法が考えられる。すなわち、斜め方向についても水平方向または垂直方向と同程度の距離の画素区間を設定すれば、等方性を持たせることができる。この場合、斜め方向の角度は、図8(c)、(d)に示されるように水平方向または垂直方向に対して45度の設定に限定される。ただし本実施形態はこれに限定されるものではなく、45度以外の任意の角度を設定することができる。その際の画素区間の距離dは、以下の式(2)を用いて算出される。   Further, as a method of setting a pixel section centered on the target pixel, a method of setting the target pixel in an oblique direction as shown in FIGS. 8C and 8D can be considered. In other words, the isotropic property can be imparted to the diagonal direction by setting a pixel section having a distance similar to that in the horizontal direction or the vertical direction. In this case, the angle in the oblique direction is limited to a setting of 45 degrees with respect to the horizontal direction or the vertical direction as shown in FIGS. However, the present embodiment is not limited to this, and an arbitrary angle other than 45 degrees can be set. The distance d of the pixel section at that time is calculated using the following equation (2).

式(2)において、xは水平方向、θは水平からの角度をそれぞれ示す。 In Expression (2), x represents the horizontal direction, and θ represents the angle from the horizontal.

一方、画像におけるハイライト部周辺の色にじみやシャドウ部周辺の色にじみは、それぞれ、飽和やノイズの影響を受けることにより、色にじみが存在するにも関わらず、判定対象の画素区間内では単調増減の特性を持たず正しく判定できない場合がある。その場合、図9に示されるように、注目画素を端の点として画素区間を設定する方法が効果的である。以上のような方法で単調増減判定を行い、図8および図9に示される画素区間のいずれか1つでも単調増減の特性を有する画素区間が存在する場合、注目画素は単調増減の特性を有する画素であると判定される。   On the other hand, the color blur around the highlight area and the color blur around the shadow area in the image are affected by saturation and noise, respectively. There is a case where it cannot be judged correctly because it does not have an increase / decrease characteristic. In this case, as shown in FIG. 9, a method of setting a pixel section with the target pixel as an end point is effective. When the monotonous increase / decrease determination is performed by the method as described above, and any one of the pixel intervals illustrated in FIGS. 8 and 9 has a pixel interval having the monotonous increase / decrease characteristic, the target pixel has the monotonous increase / decrease characteristic. It is determined to be a pixel.

本実施形態では、単調増減判定を行う対象として入力信号の画素値を利用しているが、輝度傾斜を利用しても構わない。この場合、例えば、一定の画素区間において輝度傾斜の変化が1回だけ反転する特性を有する場合が色にじみであると判定する。画素区間の画素数の適正値は、撮像装置のある撮影条件にて発生する色にじみのうち、最小の色にじみのにじみ幅に合わせるのが効果的である。   In the present embodiment, the pixel value of the input signal is used as a target for monotonic increase / decrease determination, but luminance gradient may be used. In this case, for example, it is determined that the color blur is caused when the change in the luminance gradient is reversed only once in a certain pixel section. It is effective to set the appropriate value of the number of pixels in the pixel section to the minimum color blur width among the color blurs generated under certain shooting conditions of the imaging apparatus.

色にじみのにじみ幅は、撮像装置の撮影条件(絞り値、焦点距離、フォーカシング精度、画像面内におけるフォーカス位置、撮像素子上の座標など)により様々である。このため、画素区間の画素数の適正値を、各種の撮影条件により発生する様々な色にじみの最小幅の色にじみに合わせることで、最小幅の色にじみを検出することが可能となる。最大幅の色にじみに関しては、最小幅の色にじみ用に合わせた画素区間を利用しても検出は可能である。   The color blur width varies depending on the imaging conditions of the imaging apparatus (aperture value, focal length, focusing accuracy, focus position in the image plane, coordinates on the image sensor, etc.). For this reason, it is possible to detect the color blur of the minimum width by matching the appropriate value of the number of pixels in the pixel section with the color blur of the minimum width of various color blurs generated under various shooting conditions. The maximum width color blur can be detected even by using a pixel section adapted for the minimum width color blur.

以上のように単調増減判定を行うことにより、検出したい色にじみを抽出することが可能となる。ただし、高いISO感度などの撮影条件によっては、入力信号にノイズが含まれることによりS/N比が低下し、その結果、色にじみが単調増減の特性を有しなくなることが考えられる。その場合、図5のステップS1521において、入力信号に対してデジタルフィルタによるフィルタリング処理を行うことが有効である。本実施形態では、デジタルフィルタをローパスフィルタとした場合について説明するが、これに限定されるものではない。   By performing monotonous increase / decrease determination as described above, it is possible to extract a color blur to be detected. However, depending on the shooting conditions such as high ISO sensitivity, the S / N ratio may decrease due to noise included in the input signal, and as a result, the color blur may not have a monotonous increase / decrease characteristic. In that case, it is effective to perform a filtering process using a digital filter on the input signal in step S1521 in FIG. In the present embodiment, a case where the digital filter is a low-pass filter will be described, but the present invention is not limited to this.

入力信号にローパスフィルタを適用する方法としては、いくつかの方法が考えられる。例えば、注目画素の重み係数を隣接する画素の2倍の係数とする[1 2 1]のローパスフィルタを適用する場合について説明する。図10(a)は、画像内の3×3画素の領域を示す図である。図7に示されるように画像内の3×3画素のある領域においてpを注目画素としたとき、まず、[1 2 1]のローパスフィルタを水平方向に適用する。このとき、注目画素P’は以下の式(3)のように表される。   There are several methods for applying a low-pass filter to the input signal. For example, a case will be described in which a [1 2 1] low-pass filter in which the weighting coefficient of the pixel of interest is twice as large as that of adjacent pixels is applied. FIG. 10A is a diagram illustrating a 3 × 3 pixel region in an image. As shown in FIG. 7, when p is a target pixel in a certain region of 3 × 3 pixels in an image, first, a low-pass filter of [1 2 1] is applied in the horizontal direction. At this time, the target pixel P ′ is expressed as the following Expression (3).

隣接する画素も同様に計算すると、図10(b)に示されるようになる。図10(b)は、画像内の3×3画素の領域の各画素に対してローパスフィルタを適用した結果を示す図である。続いて、[1 2 1]のローパスフィルタを垂直方向に適用すると、注目画素P’’は以下の式(4)のように表される。 When the adjacent pixels are similarly calculated, the result is as shown in FIG. FIG. 10B is a diagram illustrating a result of applying a low-pass filter to each pixel in a 3 × 3 pixel region in the image. Subsequently, when the low-pass filter of [1 2 1] is applied in the vertical direction, the target pixel P ″ is expressed as the following Expression (4).

図11を参照して、ローパスフィルタを適用したときの入力信号の変化の一例について説明する。図11は、各画素に対してローパスフィルタを適用した場合の入力信号の変化の例を示す図である。図11において、横軸は距離(画像上の断面、すなわち注目画素からの画素区間)、縦軸はプレーンの画素値をそれぞれ示している。   With reference to FIG. 11, an example of a change in the input signal when the low-pass filter is applied will be described. FIG. 11 is a diagram illustrating an example of a change in the input signal when a low-pass filter is applied to each pixel. In FIG. 11, the horizontal axis indicates the distance (cross section on the image, that is, the pixel section from the target pixel), and the vertical axis indicates the pixel value of the plane.

図11中の実線はローパスフィルタを適用しない場合、細かい破線は[1 2 1]のローパスフィルタを適用した場合、粗い破線は[1 4 6 4 1]のローパスフィルタを適用した場合をそれぞれ示している。ここで、[1 4 6 4 1]は、注目画素と隣接する画素と更にもう1画素分離れた画素にも重み係数をかけてローパスフィルタを適用することを意味する。このようにローパスフィルタを適用して入力信号を滑らかにすることで、色にじみが本来持つ単調増減の特性を際立たせることが可能となる。なお本実施形態では、ローパスフィルタを水平方向、垂直方向の順番で適用しているが、これに限定されるものではない。ローパスフィルタを逆の順番、すなわち垂直方向、水平方向の順番で適用しても構わない。また、2次元のローパスフィルタ係数を算出してローパスフィルタを水平方向および垂直方向に同時に適用することもできる。   The solid line in FIG. 11 indicates the case where the low-pass filter is not applied, the fine broken line indicates the case where the low-pass filter [1 2 1] is applied, and the rough broken line indicates the case where the low-pass filter [1 4 6 4 1] is applied. Yes. Here, [1 4 6 4 1] means that a low-pass filter is applied by applying a weighting factor to a pixel adjacent to the target pixel and a pixel separated by another pixel. By smoothing the input signal by applying the low-pass filter in this way, it is possible to highlight the monotonous increase / decrease characteristics inherent in color fringing. In this embodiment, the low-pass filter is applied in the order of the horizontal direction and the vertical direction, but the present invention is not limited to this. The low-pass filter may be applied in the reverse order, that is, in the order of the vertical direction and the horizontal direction. It is also possible to calculate a two-dimensional low-pass filter coefficient and apply the low-pass filter simultaneously in the horizontal direction and the vertical direction.

続いて、図1のステップS108において、ステップS106の製造誤差判定の結果に応じて、以降の処理を分岐する。まず、ステップS106にて製造誤差がないと判定された場合について説明する。このときステップS109へ進み、画像処理装置100(取得部101)は、ステップS102にて取得した撮影条件に応じた色にじみ補正データ(撮像光学系の色にじみに関する光学情報)を取得する。   Subsequently, in step S108 of FIG. 1, the subsequent processing is branched according to the result of the manufacturing error determination in step S106. First, the case where it is determined in step S106 that there is no manufacturing error will be described. At this time, the process proceeds to step S109, and the image processing apparatus 100 (acquisition unit 101) acquires color blur correction data (optical information relating to color blur of the imaging optical system) corresponding to the imaging condition acquired in step S102.

続いてステップS110において、画像処理装置100(決定部105)は、ステップS107の単調増減検出結果とステップS109にて取得した色にじみ補正データとを比較して、色にじみ補正を行うか否かを判定する。すなわち画像処理装置100(決定部105)は、ステップS107にて検出部102により色にじみ発生領域と仮判定された領域(第1の領域)が、色にじみ発生領域(第2の領域)であるか否かを判定する(色にじみ判定工程)。換言すると、画像処理装置100(決定部105)は、撮像光学系の色にじみに関する光学情報と、第1の領域に関する情報とに基づいて、色にじみが発生している領域(第2の領域)を決定する。ここで光学情報は、撮像光学系の光学設計値に関する情報である。   Subsequently, in step S110, the image processing apparatus 100 (determination unit 105) compares the monotonic increase / decrease detection result in step S107 with the color blur correction data acquired in step S109, and determines whether or not to perform color blur correction. judge. That is, in the image processing apparatus 100 (determination unit 105), the region (first region) provisionally determined as the color blur generation region by the detection unit 102 in step S107 is the color blur generation region (second region). Whether or not (color blur determination step). In other words, the image processing apparatus 100 (decision unit 105) has an area (second area) in which color blur is generated based on the optical information on color blur of the imaging optical system and the information on the first area. To decide. Here, the optical information is information related to the optical design value of the imaging optical system.

本実施形態において、画像処理装置100(決定部105)は、第1の方向(信号レベルが単調増加または単調減少する方向)と第2の方向(撮像光学系の色にじみが発生する方向)とを比較することにより第2の領域を決定する。決定部105は、例えば第1の方向と第2の方向とが互いに一致する場合(または、略一致と評価される所定の範囲にある場合)、第1の領域(ステップS107にて検出された領域)が第2の領域(色にじみが発生している領域)であると決定する。   In the present embodiment, the image processing apparatus 100 (determination unit 105) includes a first direction (a direction in which the signal level monotonously increases or decreases monotonously) and a second direction (a direction in which color blur of the imaging optical system occurs). To determine the second region. For example, when the first direction and the second direction match each other (or when they are within a predetermined range that is evaluated as substantially matching), the determination unit 105 detects the first region (detected in step S107). It is determined that the (region) is the second region (region in which color blur occurs).

ここで、図12および図13を参照して、単調増減検出工程のみから色にじみ領域を判定した場合の弊害について説明する。デジタルカメラなどの撮像装置により被写体を撮像して得られた画像には、撮像光学系の球面収差、コマ収差、像面湾曲、非点収差などに起因する画像劣化成分としてのぼけ成分が含まれる。このようなぼけ成分は、無収差で回折の影響もない場合に被写体の一点から出た光束が撮像面上で再度一点に集まるべきものが、ある広がりをもって像を結ぶことで発生する。   Here, with reference to FIG. 12 and FIG. 13, an adverse effect in the case where the color blur area is determined only from the monotonous increase / decrease detection process will be described. An image obtained by imaging a subject with an imaging device such as a digital camera includes a blur component as an image degradation component caused by spherical aberration, coma aberration, field curvature, astigmatism, and the like of the imaging optical system. . 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 is optically represented by a point spread function (PSF), and is different from blur due to a focus shift. In addition, color blur 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, spherical spherical aberration, and color coma aberration of the optical system. Further, the lateral color misregistration can also be referred to as 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 TransferFunction:OTF)は、収差の周波数成分情報であり、複素数で表される。光学伝達関数(OTF)の絶対値、すなわち振幅成分を、MTF(Modulation Transfer Function)といい、位相成分をPTF(Phase Transfer Function)という。MTFおよびPTFはそれぞれ、収差による画像劣化の振幅成分および位相成分の周波数特性である。ここでは、位相成分を位相角として、以下の式(5)のように表される。   An optical transfer function (OTF) obtained by Fourier-transforming the 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 referred to as MTF (Modulation Transfer Function), and the phase component is referred to as 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 following equation (5) with the phase angle as the phase angle.

PTF=tan−1(Im(OTF)/Re(OTF)) … (5)
式(5)において、Re(OTF)およびIm(OTF)はそれぞれ、OTFの実部および虚部である。
PTF = tan −1 (Im (OTF) / Re (OTF)) (5)
In formula (5), Re (OTF) and Im (OTF) are the real part and the imaginary part of OTF, respectively.

このように、光学系の光学伝達関数(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 is asymmetrically blurred with respect to the optical axis like coma aberration. It becomes a state.

図12は、被写体の各点が球面収差のような光軸に関して対称(回転対称)にぼける光学特性の状態で撮影された画像に対し、単調増減検出を行う場合を説明した図である。図12(a)は被写体の画素値断面、図12(b)は撮像光学系のPSF断面、図12(c)は撮像光学系で撮影された被写体の画素値断面を示している。なお、図12はRプレーンまたはBプレーンを想定している。図12(b)に示されるように、撮像光学系が光軸に関して対称(回転対称)な収差特性を有しPSFが対称である場合、被写体の両側のエッジ断面は、両方とも劣化した画像として図12(c)の実線のように撮影される。図12(c)では、比較のため、図12(a)に示される被写体の輝度断面を点線で示している。図12(c)の白い四角を注目画素として、単調増減判定を行うとすると、両エッジとも単調増減領域として判定される。また、色のにじみも実際に発生するため、色にじみ発生領域の判定としては正しく判定される。   FIG. 12 is a diagram for explaining a case where monotonous increase / decrease detection is performed on an image photographed in a state of optical characteristics in which each point of a subject is symmetric (rotationally symmetric) with respect to the optical axis such as spherical aberration. 12A shows the pixel value section of the subject, FIG. 12B shows the PSF section of the imaging optical system, and FIG. 12C shows the pixel value section of the subject imaged by the imaging optical system. Note that FIG. 12 assumes an R plane or a B plane. As shown in FIG. 12B, when the imaging optical system has an aberration characteristic that is symmetric (rotationally symmetric) with respect to the optical axis and the PSF is symmetric, the edge cross sections on both sides of the subject are both degraded images. Photographed as shown by the solid line in FIG. In FIG. 12C, the luminance cross section of the subject shown in FIG. 12A is indicated by a dotted line for comparison. When the monotonous increase / decrease determination is performed using the white square in FIG. 12C as the target pixel, both edges are determined as the monotonous increase / decrease area. Further, since color blur actually occurs, the color blur generation region is correctly determined.

図13は、被写体の各点がコマ収差のような光軸に関して非対称(回転非対称)にぼける光学特性の状態で撮影された画像に対し、単調増減検出を行う場合を説明した図である。図13(a)は被写体の画素値断面、図13(b)は撮像光学系のPSF断面、図13(c)は撮像光学系で撮影された被写体の画素値断面である。図13(b)に示されるように、撮像光学系が光軸に関して非対称な収差特性を有しPSFが非対称な場合、特に片側のエッジのみ大きく劣化する光学特性では、被写体のエッジ断面は、片側のみ大きく劣化した画像として図13(c)の実線のように撮影される。このような撮影画像に対し単調増減検出を行うと、両エッジとも単調増減領域として判定されるが、実際に撮像光学系により発生する色にじみは片側のみであるため、被写体本来の色を色にじみとして判定してしまう弊害が発生する。単調増減のみで色にじみ補正を行うと被写体本来の色を除去することになり、不自然な画像となる場合がある。これを回避しようとすると補正が弱くなってしまう。   FIG. 13 is a diagram illustrating a case where monotonous increase / decrease detection is performed on an image captured with optical characteristics in which each point of the subject is asymmetric (rotationally asymmetric) with respect to the optical axis such as coma. 13A is a pixel value section of the subject, FIG. 13B is a PSF section of the imaging optical system, and FIG. 13C is a pixel value section of the subject imaged by the imaging optical system. As shown in FIG. 13B, when the imaging optical system has an asymmetric aberration characteristic with respect to the optical axis and the PSF is asymmetric, the edge cross section of the subject is one side particularly in the optical characteristic that greatly deteriorates only on one side edge. Only an image that is greatly degraded is taken as shown by the solid line in FIG. When monotonous increase / decrease detection is performed on such a captured image, both edges are determined as monotonous increase / decrease areas, but since the color blur actually generated by the imaging optical system is only on one side, the original color of the subject is blurred. As a result, an adverse effect occurs. If the color blur correction is performed only by monotonous increase / decrease, the original color of the subject is removed, which may result in an unnatural image. If you try to avoid this, the correction will be weak.

そこで本実施形態において、画像処理装置100は、図12(b)や図13(b)に示されるような撮像光学系の色にじみ発生方向に関する光学情報を保持または取得する。そして画像処理装置100は、単調増減検出の単調増減方向と色にじみ発生方向が一致した場合、色にじみ発生領域である判定する。ここで一致とは、厳密に一致する場合だけでなく実質的に一致である場合も含む意味である。   Therefore, in the present embodiment, the image processing apparatus 100 holds or acquires optical information related to the color blur generation direction of the imaging optical system as shown in FIGS. 12B and 13B. When the monotonous increase / decrease direction of the monotonic increase / decrease detection matches the color blur generation direction, the image processing apparatus 100 determines that the color blur generation region is present. Here, the term “matching” means not only the case of exact matching but also the case of substantial matching.

ここで図14を参照して、光学情報について説明する。図14は、本実施形態における光学情報の説明図であり、撮像光学系のPSF断面および光学情報を示している。図14(a)は、図12(b)に示される、撮像光学系のPSFが光軸に関して対称な場合の光学情報である。図14(b)は、図13(b)に示される、撮像光学系のPSFが光軸に関して非対称な場合の光学情報である。例えば、撮像光学系の収差により色にじみが発生する方向には1を持ち、発生しない場合は0を持つ。図14(a)は、色にじみが対称に両側で発生するため光学情報は両側とも1の値を持つ。図14(b)では、色にじみが非対称に発生しており、左側エッジでは色にじみが発生しないため0、右側エッジでは色にじみが発生するため1の値を持つ。   Here, the optical information will be described with reference to FIG. FIG. 14 is an explanatory diagram of the optical information in the present embodiment, and shows a PSF cross section and optical information of the imaging optical system. FIG. 14A shows optical information when the PSF of the imaging optical system shown in FIG. 12B is symmetric with respect to the optical axis. FIG. 14B shows optical information when the PSF of the imaging optical system shown in FIG. 13B is asymmetric with respect to the optical axis. For example, it has 1 in the direction in which color blur occurs due to the aberration of the imaging optical system, and 0 if it does not occur. In FIG. 14A, since color blur occurs symmetrically on both sides, the optical information has a value of 1 on both sides. In FIG. 14B, the color blur is generated asymmetrically, the color blur is not generated at the left edge, and 0 is generated at the right edge, and the value is 1 because the color blur is generated at the right edge.

図15は、光学情報および単調増減検出結果に基づいて色にじみ領域を判定する例を示す図である。図15(a)に示されるように、単調増減検出により、例えば、単調減少が検出された場合、その単調減少方向の光学情報を参照し、1を有していれば色にじみ補正領域と判定する。また、図15(b)に示されるように、単調減少方向の光学情報を参照し、0を有していれば被写体の色であると判定する。このように、撮像光学系の収差として色収差が発生する方向と、発生しない方向の情報を有することで、被写体の色と色にじみを正しく判定することができるため、色にじみ補正の精度を向上させることが可能となる。なお、色にじみの発生方向を1、発生しない方向を0としたが、発生の方向がわかればよく、0と1である必要はない。撮像光学系の収差は、像高により変化するため、複数の像高での光学情報を有しておくことで、高精度に補正を行うことが可能となる。補正値を持たない像高では、近傍の補正値より補間生成してもよい。また、撮像光学系の収差は、撮影条件(撮像光学系の焦点距離、被写体距離(撮影距離)、絞り値(Fno))でも変化するため、撮影条件ごとに光学情報を記憶または取得することにより、高精度に補正を行うことが可能となる。   FIG. 15 is a diagram illustrating an example of determining a color blur area based on optical information and a monotonous increase / decrease detection result. As shown in FIG. 15A, for example, when monotonic decrease is detected by monotonic increase / decrease detection, the optical information in the monotonic decrease direction is referred to, and if it has 1, it is determined as a color blur correction region. To do. Further, as shown in FIG. 15B, the optical information in the monotonously decreasing direction is referred to, and if it has 0, it is determined that the color of the subject. As described above, by having information on the direction in which chromatic aberration occurs and the direction in which it does not occur as the aberration of the imaging optical system, it is possible to correctly determine the color and color blur of the subject, thereby improving the accuracy of color blur correction. It becomes possible. Although the direction of occurrence of color blur is 1 and the direction of non-occurrence is 0, it is only necessary to know the direction of occurrence, and it is not necessary to be 0 and 1. Since the aberration of the imaging optical system changes depending on the image height, it is possible to correct with high accuracy by having optical information at a plurality of image heights. For image heights that do not have correction values, interpolation may be generated from nearby correction values. The aberration of the imaging optical system also changes depending on the shooting conditions (focal length of the imaging optical system, subject distance (shooting distance), aperture value (Fno)). Therefore, by storing or acquiring optical information for each shooting condition, It becomes possible to perform correction with high accuracy.

図14および図15では、光学情報を1次元の情報として説明したが、撮影画像が2次元配列のデータの場合、光学情報も2次元のデータとして保持してもよい。図16は、光学情報が2次元である場合の説明図である。図16(c)は、光学情報を画面上下左右、斜め45度、135度の8方向のデータとして保持する場合の例を示している。図16では、撮像光学系の色のコマ収差が画面上方向に発生しており、その発生方向に1の光学情報を保持する。色にじみの発生しない方向には0を保持する。単調増減検出を前記8方向で行い、単調減少が検出された方向に光学情報の1が保持されていた場合に色にじみと判定される。単調減少が検出されても、検出された方向に光学情報の1が保持されていなければ被写体の色と判定を行う。   14 and 15, the optical information has been described as one-dimensional information. However, when the photographed image is two-dimensional array data, the optical information may be held as two-dimensional data. FIG. 16 is an explanatory diagram when the optical information is two-dimensional. FIG. 16C shows an example in which optical information is held as data in eight directions of up, down, left and right, 45 degrees oblique and 135 degrees on the screen. In FIG. 16, the coma of the color of the imaging optical system is generated in the upward direction of the screen, and 1 optical information is held in the generation direction. 0 is maintained in the direction where no color blur occurs. Monotonic increase / decrease detection is performed in the above eight directions, and it is determined that the color is blurred when 1 of the optical information is held in the direction in which the monotonic decrease is detected. Even if a monotonic decrease is detected, if the optical information 1 is not held in the detected direction, it is determined as the color of the subject.

以上のように、画像処理装置100は、撮像光学系の色にじみが発生する方向に関する光学情報を保持または取得する。好ましくは、画像処理装置100は、光学情報を記憶する記憶部106を有する。より好ましくは、記憶部106は、撮影条件ごとに光学情報を記憶する。撮影条件は、撮像光学系の焦点距離、被写体距離(撮影距離)、および、絞り値の少なくとも一つを含む。なお、記憶部106は、画像処理装置100の外部に設けられていてもよい。例えば、後述の記憶部208に各光学情報を記憶させておくことができる。   As described above, the image processing apparatus 100 holds or acquires the optical information regarding the direction in which the color blur of the imaging optical system occurs. Preferably, the image processing apparatus 100 includes a storage unit 106 that stores optical information. More preferably, the storage unit 106 stores optical information for each shooting condition. The shooting conditions include at least one of a focal length of the imaging optical system, a subject distance (shooting distance), and an aperture value. Note that the storage unit 106 may be provided outside the image processing apparatus 100. For example, each optical information can be stored in the storage unit 208 described later.

そして、画像処理装置100は、単調増減検出時に検出方向と光学情報とを参照することにより、高精度に色にじみ領域を判定することが可能となる。なお本実施形態では、単調増減判定を単調減少方向で説明したが、単調増加方向を使用して色にじみ判定を行ってもよい。また、単調増減判定と光学情報の補正値を8方向で説明したが、8方向に限定されるものではない。精度を向上させるため、検出方向の数を増加させてもよい。または、光学情報に関するデータ量を削減するため、検出方向の数を減少させてもよい。   The image processing apparatus 100 can determine the color blur area with high accuracy by referring to the detection direction and the optical information when detecting monotonous increase / decrease. In the present embodiment, the monotonous increase / decrease determination has been described in the monotonic decrease direction. However, the color blur determination may be performed using the monotone increase direction. In addition, the monotonous increase / decrease determination and the correction value of the optical information have been described in eight directions, but are not limited to eight directions. In order to improve accuracy, the number of detection directions may be increased. Alternatively, the number of detection directions may be reduced in order to reduce the amount of data related to optical information.

また画像処理装置100は、光学情報として、色にじみ発生方向に加え、色にじみの強度に関する情報(色にじみの強度情報)を保持または取得するように構成してもよい。この場合、更に高精度に補正を行うことが可能となる。図16(b)に示されるように、一般に撮像光学系の収差による色にじみの発生量は方向により異なる。そこで、図16(d)に示されるように、色にじみの発生する方向に色にじみの発生量に関する色にじみの強度情報を追加してもよい。   Further, the image processing apparatus 100 may be configured to hold or acquire information regarding the color blur intensity (color blur intensity information) as optical information in addition to the color blur generation direction. In this case, correction can be performed with higher accuracy. As shown in FIG. 16B, generally, the amount of color blur due to the aberration of the imaging optical system differs depending on the direction. Therefore, as shown in FIG. 16D, the color blur intensity information regarding the color blur generation amount may be added in the direction in which the color blur occurs.

続いて、図17を参照して、色にじみ強度情報を用いた場合の色にじみ判定について説明する。図17は、光学情報を用いた色にじみ判定処理を示す図であり、光学情報に色にじみ発生方向のみを持つ場合の例を示している。図中の四角で囲まれた注目画素1について色にじみ発生領域の判定を行う場合、まず、注目画素を中心に上下左右、斜め45度、斜め135度の8方向について単調減少判定を行う。図17(a)の場合、高輝度被写体が注目画素の下側に位置するため、注目画素1の単調減少が検出される方向は、上と右上、左上の3箇所が判定される。その3方向の光学情報は色にじみ発生方向を示す「1」であるため、この注目画素1は色にじみ発生領域と判定される。また、同様に注目画素2についても検出を行うと、単調減少方向は上、右上、右、右下が判定される。しかしながら、光学情報の色にじみ発生方向は、右下に発生しない方向を表す「0」を保持しているため、単調減少と光学情報より、最終的な注目画素2の色にじみ検出方向は、上、右上、右の3方向となる。注目画素1、注目画素2共に色にじみ発生が素と判定されるが、図16(b)に示されるように、撮像光学系の色にじみ発生量は方向により異なるため、注目画素1と注目画素2では、色にじみの発生量が異なっている。光学情報に強度情報を持たない場合、色にじみ量を判定できないため、このあとの色にじみ補正工程において補正の強さを変えて補正を行うことができない。よって、注目画素1にあわせて色にじみ補正を強くすると注目画素2では過補正となり、注目画素2にあわせて色にじみ補正を弱くすると注目画素1では、補正不足となってしまう。   Next, with reference to FIG. 17, color blur determination when color blur intensity information is used will be described. FIG. 17 is a diagram showing a color blur determination process using optical information, and shows an example in which the optical information has only the color blur generation direction. When determining the color blur generation region for the pixel of interest 1 surrounded by the square in the figure, first, monotonic decrease determination is performed in eight directions, up and down, left and right, 45 degrees oblique, and 135 degrees oblique, with the pixel of interest at the center. In the case of FIG. 17A, since the high-luminance subject is located below the target pixel, three directions in which the monotonic decrease of the target pixel 1 is detected are determined as the upper, upper right, and upper left. Since the optical information in the three directions is “1” indicating the color blur generation direction, the target pixel 1 is determined to be a color blur generation region. Similarly, if the pixel of interest 2 is also detected, the monotone decreasing direction is determined to be upper, upper right, right, and lower right. However, since the color blur occurrence direction of the optical information holds “0” indicating a direction that does not occur in the lower right, the final color blur detection direction of the target pixel 2 is monotonically decreased and the optical information is higher than the optical information. , Upper right and right. Although the noticeable pixel 1 and the noticeable pixel 2 are determined to have no color bleed, the amount of color bleed in the imaging optical system varies depending on the direction as shown in FIG. In No. 2, the amount of color bleeding is different. If the optical information does not have intensity information, the amount of color blur cannot be determined, so that correction cannot be performed by changing the intensity of correction in the subsequent color blur correction process. Therefore, if the color blur correction is increased in accordance with the target pixel 1, the target pixel 2 is overcorrected, and if the color blur correction is decreased in accordance with the target pixel 2, the target pixel 1 is insufficiently corrected.

そこで、図16(d)のように、光学情報に色にじみの発生方向と、その方向の色にじみ強度情報を追加することが好ましい。図17(a)、(b)は、光学情報に色にじみ強度情報も付加した場合の色にじみ領域の判定方法を示している。図17(b)の注目画素3では、単調減少判定にて上、左上、右上の3方向が判定されるが、光学情報の色にじみ強度もそれぞれ2、3、2と強い色にじみ強度と検出することができる。図17(c)の注目画素4においては、上、右上、左下の3方向が判定されるが、その方向の光学情報の色にじみ強度はそれぞれ3、2、1と注目画素3に対して弱い色にじみ強度が検出される。よって、例えば、検出された方向の色にじみ強度の平均値により、この後の色にじみ補正処理の補正の強さ(画像を修正する強度)を変更することで、色にじみの発生量が方向で異なる場合でもより正確な補正が可能となる。   Therefore, as shown in FIG. 16D, it is preferable to add the color blur generation direction and the color blur intensity information in the direction to the optical information. FIGS. 17A and 17B show a method of determining a color blur area when color blur intensity information is also added to the optical information. In the target pixel 3 in FIG. 17B, the three directions of upper, upper left, and upper right are determined by monotonic decrease determination, but the color blur intensity of the optical information is also detected as strong color blur intensity of 2, 3, and 2, respectively. can do. In the pixel of interest 4 in FIG. 17C, the three directions of upper, upper right, and lower left are determined, but the color blur intensity of the optical information in that direction is 3, 2, 1 and weaker than the pixel of interest 3, respectively. A color blur intensity is detected. Therefore, for example, by changing the intensity of correction (image correction intensity) of the subsequent color blur correction process according to the average value of the color blur intensity in the detected direction, Even when different, more accurate correction is possible.

注目画素3では色にじみ強度の平均値が約2.3であり、また、注目画素4では色にじみ強度の平均値が2.0となり、この値を使って補正の強さを変えることが可能となる。なお本実施形態では、色にじみ強度の平均値を使用する説明を行ったが、これに限定されるものではない。例えば、色にじみ方向と検出された複数の方向の重心方向の色にじみ強度値を使用して色にじみ補正係数を変えてもよい。注目画素3では重心方向が上となるため色にじみ強度は3、注目画素4では重心方向が右上となるため色にじみ強度は2となり、この値を使って補正の強さを変えることが可能となる。重心方向を採用する場合、例えば上、右上、右、右下の4方向の重心を計算すると、重心方向に最も近い方向は右上、右の2方向となる場合がある。この場合、2方向の平均値、2方向のうち大きい方の色にじみ強度、または、2方向のうち小さいほうの色にじみ強度を用いるなどが考えられる。なお本実施形態において、平均値、重心方向を利用することについて説明したが、光学情報の色にじみ強度情報を任意に演算して色にじみ補正時の補正の強さを変えてもよい。   The target pixel 3 has an average color blur intensity value of about 2.3, and the target pixel 4 has an average color blur intensity value of 2.0, which can be used to change the correction strength. It becomes. In the present embodiment, the description has been made using the average value of the color blur intensity. However, the present invention is not limited to this. For example, the color blur correction coefficient may be changed using the color blur intensity value in the centroid direction of a plurality of detected directions as the color blur direction. At the target pixel 3, the direction of the center of gravity is upward, so the color blur intensity is 3, and at the target pixel 4, the direction of the center of gravity is upper right, so the color blur intensity is 2, and this value can be used to change the correction strength. Become. When the center of gravity direction is adopted, for example, when the center of gravity in the four directions of upper, upper right, right, and lower right is calculated, the direction closest to the center of gravity direction may be the two directions of upper right and right. In this case, it is conceivable to use an average value in two directions, a color blur intensity of the larger one of the two directions, or a color blur intensity of the smaller of the two directions. In the present embodiment, the use of the average value and the direction of the center of gravity has been described. However, the color blur intensity information of the optical information may be arbitrarily calculated to change the correction strength at the time of color blur correction.

好ましくは、修正部103は、第1の方向(信号レベルが単調増加または単調減少する方向)と第2の方向(色にじみが発生する方向)とが複数の方向において互いに一致する場合、複数の方向における色にじみの強度に関する情報を演算して画像を修正する。より好ましくは、修正部103は、第1の方向と第2の方向とが複数の方向において互いに一致する場合、複数の方向の重心方向における色にじみの強度に関する情報または平均値を用いて画像を修正する。   Preferably, when the first direction (the direction in which the signal level monotonously increases or decreases monotonically) and the second direction (the direction in which color blur occurs) match each other in a plurality of directions, the correcting unit 103 preferably The image is corrected by calculating information on the intensity of color blur in the direction. More preferably, when the first direction and the second direction match each other in a plurality of directions, the correcting unit 103 uses the information regarding the intensity of color blurring in the centroid direction in the plurality of directions or the average value as an image. Correct it.

続いて、図18を参照して、光学情報の算出方法について説明する。図18は、光学情報の算出方法の説明図であり、光学情報として保持する任意の方向での、撮像光学系のGプレーンのPSF断面(実線)とBプレーンのPSF断面(点線)を示している。ここでは、Gプレーンを基準プレーンとし、Bプレーンの色にじみに関して光学情報を算出する方法について説明する。   Next, a method for calculating optical information will be described with reference to FIG. FIG. 18 is an explanatory diagram of a method for calculating optical information, and shows the PSF cross section (solid line) of the G plane of the imaging optical system and the PSF cross section (dotted line) of the B plane in any direction held as optical information. Yes. Here, a method for calculating the optical information regarding the color blur of the B plane using the G plane as a reference plane will be described.

撮像光学系の色収差により、Gプレーン、Bプレーンは、それぞれの波長帯での収差により、異なったPSF形状となる。また、倍率色収差が残存する場合、Gプレーン、Bプレーンは、それぞれ、ずれた位置に結像するため、それぞれのPSFのピーク位置も図18(a)に示されるように、ずれた位置で算出される。倍率色収差による各色プレーンのずれは、従来から行われている、各色プレーンに対し異なる歪曲を加える幾何学変換により補正することができる。そのため、図18(b)に示されるように、Gプレーン、BプレーンのそれぞれのPSFのピーク位置を一致させて、図の斜線部にあたる基準であるGプレーンとBプレーンのPSF面積差を色にじみ強度として採用する方法が考えられる。   Due to the chromatic aberration of the imaging optical system, the G plane and the B plane have different PSF shapes depending on the aberration in each wavelength band. Further, when lateral chromatic aberration remains, the G plane and B plane are imaged at shifted positions, so the peak positions of the respective PSFs are also calculated at shifted positions as shown in FIG. Is done. The displacement of each color plane due to lateral chromatic aberration can be corrected by a conventional geometric transformation that applies different distortions to each color plane. Therefore, as shown in FIG. 18B, the PSF peak positions of the G plane and B plane are made to coincide with each other, and the PSF area difference between the G plane and the B plane, which is the hatched portion in the figure, is blurred. A method of adopting the strength can be considered.

図18(b)では、ピークよりも左側エッジの面積差よりも右側エッジの面積差が大きいため、右側エッジで大きく色にじみが発生することがわかる。この面積が小さければ色にじみは目立たないため、面積が小さい場合を色にじみが発生しない方向とすることができる。また、面積比より、色にじみ強度を決定することが可能となる。以上により、光学情報の色にじみが発生する方向や色にじみ強度を算出できるが、算出方法としてPSFの面積差を使用する方法に限定されるものではない。例えば、図18(b)において、GプレーンとBプレーンのエッジの傾き差を使用する方法が考えられる。色にじみが発生する場合、エッジの傾きは緩くなる傾向にあるため、傾き差などを利用することにより、光学情報を決定するなどしてもよい。   In FIG. 18B, since the area difference of the right edge is larger than the area difference of the left edge than the peak, it can be seen that the color fringing occurs greatly at the right edge. If this area is small, the color blur is inconspicuous, and therefore, when the area is small, the direction in which the color blur does not occur can be set. Further, the color blur intensity can be determined from the area ratio. As described above, the direction in which color blur occurs in the optical information and the color blur intensity can be calculated, but the calculation method is not limited to the method using the area difference of the PSF. For example, in FIG. 18B, a method using the difference in inclination between the edges of the G plane and the B plane can be considered. When color blurring occurs, the inclination of the edge tends to be gentle, and thus optical information may be determined by using a difference in inclination.

本実施例では、色にじみ強度を計算する際にピーク値を一致させる方法で説明しているが、ピーク値ではなくPSFの重心が一致をさせて色にじみ強度を算出してもよい。このように本実施形態によれば、光学情報の色にじみ発生方向と、色にじみ強度情報を算出することができる。また、単調増減判定を行う方向や、像高、撮影条件ごとに光学補正値を算出することができる。   In this embodiment, the method of matching the peak values when calculating the color blur intensity is described. However, the color blur intensity may be calculated by matching the centroids of the PSFs instead of the peak values. As described above, according to the present embodiment, it is possible to calculate the color blur generation direction and the color blur intensity information of the optical information. In addition, an optical correction value can be calculated for each direction in which monotonous increase / decrease determination, image height, and photographing conditions are performed.

図1Bに戻り、ステップS111において、画像処理装置100(修正部103)は、ステップS110にて判定部104により色にじみ領域と判定された領域(第2の領域)に対し、色にじみを補正する処理(画像を修正する処理)を行う(色にじみ補正工程)。すなわち修正部103は、色にじみを低減させるように画像を修正する。   Returning to FIG. 1B, in step S111, the image processing apparatus 100 (correction unit 103) corrects color blur for the region (second region) determined as the color blur region by the determination unit 104 in step S110. Processing (processing for correcting an image) is performed (color blur correction step). That is, the correction unit 103 corrects the image so as to reduce color blur.

図19は、青色にじみの典型的な画素値変化を示す図である。図19において、横軸は距離(画像上の断面)であり、縦軸はBプレーン及びGプレーンの画素値である。図19では、左端に飽和輝度を超える高輝度被写体が存在するものとする。そして、本来明るくない高輝度被写体の周囲も、収差やフレアにより、画素値変化の裾が黒レベルに漸近するように拡がる。基準プレーンであるGプレーンでもにじみは無いわけではなく、ある程度の拡がりが存在する。しかし、それは色にじみ除去対象のBプレーンに比べると小さい。また、撮像素子は一定の飽和レベル以上の画素値を測定することはできない。このような画素値変化において、色にじみ除去対象のBプレーンの強度が基準プレーンであるGプレーンの強度を上回ると、青色にじみとなる。   FIG. 19 is a diagram illustrating a typical pixel value change of blue blur. In FIG. 19, the horizontal axis is the distance (cross section on the image), and the vertical axis is the pixel value of the B plane and the G plane. In FIG. 19, it is assumed that there is a high-luminance subject that exceeds the saturation luminance at the left end. Then, the periphery of the high-brightness subject which is not originally bright also spreads so that the bottom of the pixel value change gradually approaches the black level due to aberration and flare. The G plane which is the reference plane is not free from bleeding, but has a certain extent. However, it is smaller than the B-plane that is subject to color blur removal. Further, the image sensor cannot measure pixel values above a certain saturation level. In such a pixel value change, if the intensity of the B-plane to be subjected to color bleeding removal exceeds the intensity of the G-plane that is the reference plane, blue bleeding occurs.

本実施形態では、画像処理装置100は、色にじみ除去対象のBプレーンの画素値変化の傾きによりBプレーンのにじみ量を推定する。そこで、Bプレーンの輝度傾斜Bleaの絶対値に係数k1を乗じることにより、以下の式(6)で表されるように第1の推定にじみ量E1とする。   In the present embodiment, the image processing apparatus 100 estimates the amount of blurring of the B plane based on the slope of the change in pixel value of the B plane that is subject to color blur removal. Therefore, by multiplying the absolute value of the brightness gradient Blea of the B plane by the coefficient k1, the first estimated blur amount E1 is obtained as expressed by the following equation (6).

E1=k1|Blea| … (6)
式(6)において、k1は正値である。ただし、Bプレーンが飽和している領域A1では画素値傾斜は0になってしまい飽和前の輝度傾斜が得られない。
E1 = k1 | Blea | (6)
In Expression (6), k1 is a positive value. However, in the area A1 where the B plane is saturated, the pixel value gradient becomes 0, and the luminance gradient before saturation cannot be obtained.

そこで、Bプレーンが飽和している領域A1に対する推定にじみ量E2を、以下の式(7)に示されるように、Gプレーンの画素値変化の輝度傾斜Gleaに基づいて推定する。   Therefore, the estimated bleeding amount E2 for the region A1 where the B plane is saturated is estimated based on the luminance gradient Glea of the pixel value change of the G plane, as shown in the following equation (7).

E2=k2|Glea| … (7)
式(7)において、k2は正値である。
E2 = k2 | Glea | (7)
In Expression (7), k2 is a positive value.

次に、Bプレーンの画素値に対する非線形変換を行い、飽和度Sを生成する。この非線形変換は、Bプレーンが飽和しているか否かを示すものであり、Bプレーンの強度が飽和している領域では飽和度Sが1となり、Bプレーンの強度が小さい領域では飽和度Sは0となる。飽和度Sは0、1の2値でもよいが、図20に示されるように、飽和度Sは0〜1にかけて連続的に変化する値としてもよい。図20は、Bプレーンの画素値に対する非線形変換の特性図である。   Next, nonlinear conversion is performed on the pixel values of the B plane to generate the saturation S. This non-linear transformation indicates whether or not the B plane is saturated. In the region where the intensity of the B plane is saturated, the saturation S is 1, and in the region where the intensity of the B plane is low, the saturation S is 0. The saturation S may be a binary value of 0 or 1. However, as shown in FIG. 20, the saturation S may be a value that continuously varies from 0 to 1. FIG. 20 is a characteristic diagram of nonlinear conversion with respect to the pixel value of the B plane.

そして、上記の生成した飽和度Sにより、上記のように算出した推定にじみ量E1または推定にじみ量E2を選択する。すなわち、飽和度Sが0、1の2値であれば新たな推定にじみ量Eを、
E=E1 (S=0の場合)
E=E2 (S=1の場合)
とする。また、飽和度Sが0〜1にかけて連続的に変化する値であれば、新たな推定にじみ量Eを、
E=(1−S)E1+SE2
とする。
Based on the generated saturation S, the estimated blur amount E1 or the estimated blur amount E2 calculated as described above is selected. That is, if the saturation S is a binary value of 0 and 1, a new estimated bleeding amount E is obtained.
E = E1 (when S = 0)
E = E2 (when S = 1)
And If the saturation S is a value that continuously changes from 0 to 1, a new estimated bleeding amount E is
E = (1-S) E1 + SE2
And

次に、上記の推定にじみ量Eを修正し、実際に除去する量E’を決定する。推定にじみ量(除去量)は、一定のモデルに沿ったものであり、実際のにじみ量とは必ずしも一致しない。例えば、同じBプレーンに検出される光であっても、波長450nmの光と波長400nmの光ではにじみ方が変化するが、ステップS110(色にじみ判定工程)では、これを考慮していない。推定にじみ量(除去量)が過小である場合、青色にじみの除去後も若干の青みが残る。一方、推定にじみ量(除去量)が過大である場合、灰色の背景に対してBプレーンを減らし過ぎ、黄緑色になる場合がある。   Next, the estimated blur amount E is corrected to determine the amount E ′ to be actually removed. The estimated bleeding amount (removal amount) is in line with a certain model and does not necessarily match the actual bleeding amount. For example, even in the case of light detected on the same B plane, the blurring method varies between light having a wavelength of 450 nm and light having a wavelength of 400 nm, but this is not taken into consideration in step S110 (color blur determination step). When the estimated amount of blurring (removal amount) is too small, a slight amount of blueness remains after the removal of blue blurring. On the other hand, if the estimated blurring amount (removal amount) is excessive, the B plane may be excessively reduced with respect to the gray background, resulting in a yellowish green color.

特に後者(黄緑色になる場合)は、不自然で観察者に大きな違和感を与える。そこで、ステップS111(色にじみ補正工程)では、一定の色相範囲内でのみ、にじみ除去が作用するよう制限する。このため、まずステップS111において、画素の色度を計算する。R、G、Bの各プレーンの強度に対し、以下の式(8)が成立する。   In particular, the latter (when it becomes yellowish green) is unnatural and gives the viewer a great sense of discomfort. Therefore, in step S111 (color blur correction process), the blur removal is limited to operate only within a certain hue range. For this reason, first, in step S111, the chromaticity of the pixel is calculated. The following equation (8) is established for the strengths of the R, G, and B planes.

図21は、式(8)のaを横軸とし、bを縦軸とする色度座標ab面である。図21に示されるように、青色は色度座標ab面の斜線で示す第4象限にある(尚、赤、黄、紫は第1象限、緑、白は第2象限、青緑は第3象限にある)。Bプレーンの強度から推定にじみ量Eを除去すると、B=B−Eとなり、色度座標ab面上では点線矢印のように左上方向へ移動する。矢印の始点が推定にじみ量Eの除去前の色度であり、終点が推定にじみ量Eの除去後の色度である。このことから、作用する色相範囲をa>0かつb<0に制限すると、以下の式(9)が成立する。   FIG. 21 is a chromaticity coordinate ab plane in which a in equation (8) is the horizontal axis and b is the vertical axis. As shown in FIG. 21, blue is in the fourth quadrant indicated by diagonal lines on the chromaticity coordinate ab plane (note that red, yellow and purple are the first quadrant, green and white are the second quadrant, and blue-green is the third quadrant. In the quadrant). When the estimated blur amount E is removed from the intensity of the B plane, B = B−E, and the chromaticity coordinate ab plane moves in the upper left direction as indicated by a dotted arrow. The starting point of the arrow is the chromaticity before the estimated blur amount E is removed, and the end point is the chromaticity after the estimated blur amount E is removed. Therefore, when the working hue range is limited to a> 0 and b <0, the following equation (9) is established.

B>0.22R+0.68G かつ B>−1.84R+3.30G … (9)
このため、式(9)を満たさない画素に対し、実際に除去する除去量E’=0とし、色にじみ除去対象から外す。これにより、式(9)を満たさない画素は、画素値が影響を受けることがない。図21では、斜線で示す第4象限の領域のみが除去対象となる。
B> 0.22R + 0.68G and B> −1.84R + 3.30G (9)
For this reason, the pixel E that does not satisfy Expression (9) is set to the removal amount E ′ = 0 that is actually removed, and is excluded from the color blur removal target. As a result, the pixel value of the pixel that does not satisfy Expression (9) is not affected. In FIG. 21, only the region in the fourth quadrant indicated by diagonal lines is the removal target.

更に、式(9)を満たす画素に対しても、除去量E’を、以下の式(10)を満たすように設定する。   Further, the removal amount E ′ is set so as to satisfy the following expression (10) even for a pixel satisfying the expression (9).

E’=min(E,B−(0.22R+0.68G),B−(−1.84R+3.30G)) … (10)
これにより、除去量E’の除去による色度変化は、図21中の実線矢印で示されるように、第4象限内に留まるようになる。
E ′ = min (E, B− (0.22R + 0.68G), B − (− 1.84R + 3.30G)) (10)
As a result, the change in chromaticity due to the removal of the removal amount E ′ remains in the fourth quadrant, as indicated by the solid line arrow in FIG.

なお本実施形態において、色度座標ab面の第4象限で制限したが、これに限定されるものではなく、任意の角度で制限してもよい。このとき、以下の式(11)を満たす必要がある。   In the present embodiment, the restriction is made in the fourth quadrant of the chromaticity coordinate ab plane. However, the present invention is not limited to this, and the restriction may be made at an arbitrary angle. At this time, it is necessary to satisfy the following formula (11).

B>r1・G+r2・R かつ B>r3・G+r4・R … (11)
式(11)において、r1〜r4は制限角θを用いて、以下の式(12)のように算出される。色相制限は、色度座標ab面の原点を通る2本の直線で定義され、θ1、θ2はその2本の直線を表す角度である。
B> r1 · G + r2 · R and B> r3 · G + r4 · R (11)
In the equation (11), r1 to r4 are calculated as the following equation (12) using the limit angle θ. The hue limit is defined by two straight lines passing through the origin of the chromaticity coordinate ab plane, and θ1 and θ2 are angles representing the two straight lines.

これにより、色相制限範囲を超えてBプレーンが減少するのを防ぐことができる。以上のようにして算出した、色にじみの除去対象とする色プレーンの除去量E’を除去量プレーンとして保持し、色にじみ補正処理を行う。除去量プレーンに対しては、上記のローパスフィルタを適用する。なお本実施形態では、色相制限に簡易的なa*b*平面を用いているが、これに限定されるものではなく、3×3のRGB→YUVマトリクスを用いてuv平面にて色相制限処理を行っても構わない。   As a result, it is possible to prevent the B plane from decreasing beyond the hue limit range. The color plane removal amount E ′ calculated as described above is retained as the removal amount plane, and color blur correction processing is performed. The above-described low-pass filter is applied to the removal amount plane. In this embodiment, a simple a * b * plane is used for hue restriction. However, the present invention is not limited to this, and hue restriction processing is performed on the uv plane using a 3 × 3 RGB → YUV matrix. You may do.

上記の除去量E’をBプレーンの強度から差し引くことにより、新たなBプレーンを作成する。色にじみ除去対象としては、色にじみ判定ステップS4にて色にじみ領域と判定された画素のみとする。従って、新たなBプレーンの強度は、単調増減判定フラグが「1」である場合、B=B−E’となる。一方、単調増減判定フラグが「0」である場合、B=Bとなる。このように、図1BのステップS112において、画像処理装置100(出力部107)は、Bプレーンを修正したカラー画像を出力画像として出力する。   A new B plane is created by subtracting the removal amount E 'from the strength of the B plane. Only the pixels that have been determined as the color blur area in the color blur determination step S4 are to be removed from the color blur. Therefore, the intensity of the new B plane is B = B−E ′ when the monotonous increase / decrease determination flag is “1”. On the other hand, when the monotonous increase / decrease determination flag is “0”, B = B. As described above, in step S112 of FIG. 1B, the image processing apparatus 100 (output unit 107) outputs a color image obtained by correcting the B plane as an output image.

ここで、図10(a)に示される画像内の3×3画素の領域における単調増減判定結果が、図22に示されるように隣接する画素で単調増減判定フラグの値が切り替わる場合を考える。このような場合、画素の境界部では除去量がばたつき(隣接する画素で除去される場合と除去されない場合が混在すること)、画素値の変化が急峻になり、不自然で観察者に違和感を与える場合がある。そこで、生成した除去量プレーンに対してローパスフィルタを適用する方法が有効である。   Here, consider a case where the monotonous increase / decrease determination result in the 3 × 3 pixel region in the image shown in FIG. 10A switches the value of the monotonous increase / decrease determination flag in adjacent pixels as shown in FIG. In such a case, the removal amount fluctuates in the boundary portion of the pixel (a case where the pixel is removed by a neighboring pixel and a case where the pixel is not removed is mixed), and the change of the pixel value becomes steep, unnatural and uncomfortable to the observer. May give. Therefore, a method of applying a low-pass filter to the generated removal amount plane is effective.

また、以下の式(13)により、単調増減判定結果プレーンを用いて色プレーンの各画素のゲインを算出し、除去量に乗算することで、境界部(単調増減判定結果プレーン)に対するスムージング処理を行ってもよい。   Also, the following equation (13) calculates the gain of each pixel of the color plane using the monotonic increase / decrease determination result plane, and multiplies the removal amount to perform smoothing processing on the boundary portion (monotonous increase / decrease determination result plane). You may go.

図22に示される例において、画素pの除去量E’’は、以下の式(14)のように表される。   In the example shown in FIG. 22, the removal amount E ″ of the pixel p is expressed as the following Expression (14).

以上の方法で、色にじみのみを違和感なく除去することが可能となる。   With the above method, it is possible to remove only the color blur without a sense of incongruity.

続いて、ステップS106の製造誤差判定で製造誤差がると判定された場合について説明する。この場合、画像処理装置100は、ステップS109、S110をスキップし、直接にステップS111を実行する。すなわち、ステップS111において、画像処理装置100(修正部103)は、ステップS107にて検出部102により色にじみ発生領域と仮判定された領域(第1の領域)に対して、色にじみを補正する処理(画像を修正する処理)を行う(色にじみ補正工程)。すなわち修正部103はステップS107の単調増減検出工程で検出された領域に対して、色にじみを低減させるように画像を修正する。   Subsequently, a case where it is determined that there is a manufacturing error in the manufacturing error determination in step S106 will be described. In this case, the image processing apparatus 100 skips steps S109 and S110 and directly executes step S111. That is, in step S111, the image processing apparatus 100 (correction unit 103) corrects color blur for the region (first region) that is temporarily determined as a color blur generation region by the detection unit 102 in step S107. Processing (processing for correcting an image) is performed (color blur correction step). In other words, the correction unit 103 corrects the image so as to reduce color blur in the region detected in the monotonous increase / decrease detection process in step S107.

これは、撮像光学系に製造誤差がある場合、ステップS109の色にじみ補正データ(撮像光学系の色にじみに関する光学情報、すなわち光学設計値)の信頼性が低下するためである。色にじみ補正データは、前述のように撮像光学系の収差情報であり、色フレアの方向や強度の情報である。製造誤差によりその方向や強度が変化した場合、ステップS107の単調増減検出工程で色収差による色にじみが検出されても、ステップS110の色にじみ判定で補正対象から外される可能性がある。逆に、被写体色であっても色にじみであると判定され誤補正が行われる可能性がある。   This is because if there is a manufacturing error in the imaging optical system, the reliability of the color blur correction data (optical information relating to the color blur of the imaging optical system, that is, the optical design value) in step S109 decreases. The color blur correction data is aberration information of the imaging optical system as described above, and is information on the direction and intensity of the color flare. If the direction or intensity changes due to a manufacturing error, even if color blur due to chromatic aberration is detected in the monotonic increase / decrease detection process in step S107, there is a possibility that the color blur determination in step S110 may be excluded from the correction target. On the other hand, even if the subject color is used, it is determined that the color is blurred and erroneous correction may be performed.

次に、図23を参照して、本実施形態における別の画像処理方法について説明する。図23は、本実施形態における別の画像処理方法を示すフローチャートである。図23のステップS301〜S307は、図1のステップS101〜S107とそれぞれ同様である。   Next, another image processing method in the present embodiment will be described with reference to FIG. FIG. 23 is a flowchart showing another image processing method according to this embodiment. Steps S301 to S307 in FIG. 23 are the same as steps S101 to S107 in FIG.

続いてステップS308において、画像処理装置100(取得部101)は、色にじみ補正データ(撮像光学系の色にじみに関する光学情報)を取得する。続いて、ステップS309において、ステップS306の製造誤差判定の結果に応じて、以降の処理を分岐する。ステップS306にて製造誤差があると判定された場合、ステップS313へ進み、画像処理装置100(修正部103)は、ステップS308にて取得した色にじみ補正データ(撮像光学系の色にじみに関する光学情報)を補正(修正)する。例えば、画像処理装置100(検出部102)は、ステップS104にて検出された倍率色収差と、ステップS103にて取得した倍率色収差の補正データとを比較する際に、倍率色収差が撮像光学系の製造誤差によりどのようにずれているかを検出する。そして画像処理装置100(修正部103)は、倍率色収差のずれ(ずれ量、ずれ方向)に基づいて、ステップS308にて取得した色にじみ補正データ(撮像光学系の色にじみに関する光学情報)を補正する。   Subsequently, in step S308, the image processing apparatus 100 (acquisition unit 101) acquires color blur correction data (optical information regarding color blur of the imaging optical system). Subsequently, in step S309, the subsequent processing is branched according to the result of the manufacturing error determination in step S306. If it is determined in step S306 that there is a manufacturing error, the process proceeds to step S313, and the image processing apparatus 100 (correction unit 103) acquires the color blur correction data (optical information relating to the color blur of the imaging optical system) acquired in step S308. ) Is corrected (corrected). For example, when the image processing apparatus 100 (detection unit 102) compares the lateral chromatic aberration detected in step S104 with the lateral chromatic aberration correction data acquired in step S103, the lateral chromatic aberration is a factor in manufacturing the imaging optical system. It detects how it is shifted due to an error. Then, the image processing apparatus 100 (correction unit 103) corrects the color blur correction data (optical information related to the color blur of the imaging optical system) acquired in step S308 based on the shift (shift amount, shift direction) of the chromatic aberration of magnification. To do.

図24は、ステップS308における色にじみ補正データ(色にじみに関する光学情報)の補正の説明図である。例えば、図24(b)に示される矢印の方向(下方向)に画面全体の倍率色収差がシフトしている(ずれている)場合、図24(a)に示される補正データ(光学情報)を、図24(c)に示される補正データ(光学情報)に補正する。すなわち、補正データ(光学情報)を倍率色収差のシフト方向(ずれ方向)へシフトさせる。補正データの補正(補正量、補正方向)は、撮像光学系に依存する。このため、予め計算された倍率色収差と色にじみとの関係をテーブルデータや関数として例えば記憶部106に保持しておくことが好ましい。   FIG. 24 is an explanatory diagram of correction of color blur correction data (optical information relating to color blur) in step S308. For example, when the chromatic aberration of magnification of the entire screen is shifted (shifted) in the direction of the arrow shown in FIG. 24B (downward), the correction data (optical information) shown in FIG. Then, the correction data (optical information) shown in FIG. That is, correction data (optical information) is shifted in the shift direction (shift direction) of lateral chromatic aberration. Correction of correction data (correction amount, correction direction) depends on the imaging optical system. For this reason, it is preferable to store the relationship between the lateral chromatic aberration and the color blur calculated in advance in the storage unit 106 as table data or a function, for example.

続いて、図23のステップS310において、画像処理装置100(判定部104)は、ステップS313にて補正された色にじみ補正データ(補正後の光学情報)を用いて色にじみ判定を行う。一方、ステップS306にて撮像光学系が製造誤差を有しない判定された場合、ステップS313は実行されない。   Subsequently, in step S310 of FIG. 23, the image processing apparatus 100 (determination unit 104) performs color blur determination using the color blur correction data (optical information after correction) corrected in step S313. On the other hand, when it is determined in step S306 that the imaging optical system has no manufacturing error, step S313 is not executed.

続いてステップS311において、画像処理装置100(修正部103)は、ステップS308で取得した色にじみ補正データまたはステップS311にて補正された色にじみ補正データを用いて、色にじみ補正を行う。そしてステップS312において、画像処理装置100(出力部107)は、色にじみを低減するように修正(補正)した画像を出力する。   Subsequently, in step S311, the image processing apparatus 100 (correction unit 103) performs color blur correction using the color blur correction data acquired in step S308 or the color blur correction data corrected in step S311. In step S312, the image processing apparatus 100 (output unit 107) outputs an image corrected (corrected) so as to reduce color blur.

このように本実施形態において、画像処理装置100は、撮像光学系の色にじみに関する光学情報と撮像光学系の倍率色収差に関する情報とを記憶する記憶部106を有する。修正部103は、画像(撮影画像)から取得された倍率色収差と記憶部106に記憶された倍率色収差との差異が所定の閾値を超えない場合、その光学情報を用いて画像を修正する。   As described above, in the present embodiment, the image processing apparatus 100 includes the storage unit 106 that stores the optical information related to the color blur of the imaging optical system and the information related to the chromatic aberration of magnification of the imaging optical system. When the difference between the lateral chromatic aberration acquired from the image (captured image) and the lateral chromatic aberration stored in the storage unit 106 does not exceed a predetermined threshold value, the correcting unit 103 corrects the image using the optical information.

なお製造誤差は、画像から検出した倍率色収差のみに基づいて判定することができる。すなわち、製造誤差がない場合、画面中心からの距離が同じで、画像の右上、左下のように方向の異なる位置での倍率色収差は画面中心に対して対称に同じ量で発生する。一方、製造誤差により偏芯の倍率色収差が発生すると、画面全体に1方向の色ズレが発生するため、倍率色収差の出方が非対称となる。このため、画面中心に対して対角方向の位置での倍率色収差の発生方向、発生量を比較すれば設計値が無くても製造誤差を見積もることが可能である。そこで画像処理装置100は、光学情報を記憶する記憶部106を有していてもよい。修正部103は、画像の中心に対して対称な位置における倍率色収差の差が所定の閾値を超えない場合、その光学情報を用いて画像を修正する。   The manufacturing error can be determined based only on the lateral chromatic aberration detected from the image. That is, when there is no manufacturing error, the distance from the center of the screen is the same, and lateral chromatic aberration at different positions such as the upper right and lower left of the image is generated in the same amount symmetrically with respect to the screen center. On the other hand, when eccentric chromatic aberration of magnification occurs due to a manufacturing error, a color shift in one direction occurs on the entire screen, and the appearance of the chromatic aberration of magnification becomes asymmetric. For this reason, it is possible to estimate a manufacturing error even if there is no design value by comparing the generation direction and generation amount of the lateral chromatic aberration at a position diagonal to the center of the screen. Therefore, the image processing apparatus 100 may include a storage unit 106 that stores optical information. The correction unit 103 corrects the image using the optical information when the difference in the chromatic aberration of magnification at a position symmetrical with respect to the center of the image does not exceed a predetermined threshold.

一方、修正部103は、その差異が所定の閾値を超えた場合、画像の第1の領域を修正する。また、変形例として、画像処理装置100(決定部105)は、差異が所定の閾値を超えた場合、画像から取得された倍率色収差に応じて光学情報を補正し、補正後の光学情報と第1の領域に関する情報とに基づいて、第2の領域を決定する。ただし本実施形態は、これらに限定されるものではない。例えば、修正部103は、差異が所定の閾値を超えた場合、画像を修正しない(すなわち、画像の色にじみ補正を行わない)ようにしてもよい。   On the other hand, the correction unit 103 corrects the first region of the image when the difference exceeds a predetermined threshold. As a modified example, when the difference exceeds a predetermined threshold, the image processing apparatus 100 (decision unit 105) corrects the optical information according to the chromatic aberration of magnification acquired from the image, and the corrected optical information and the first information are corrected. The second area is determined based on the information regarding the first area. However, this embodiment is not limited to these. For example, the correction unit 103 may not correct the image when the difference exceeds a predetermined threshold (that is, do not perform color blur correction of the image).

本実施形態の画像処理方法によれば、製造ばらつきやレンズの偏芯調整などによる製造誤差に応じて、撮像光学系の色にじみに関する光学情報を用いて色にじみ補正を行う否かを判定する。このため本実施形態によれば、撮像光学系の製造誤差を考慮してカラー画像における色にじみを効果的に低減可能な画像処理方法を提供することができる。   According to the image processing method of the present embodiment, it is determined whether or not to perform color blur correction using optical information related to color blur of the imaging optical system in accordance with manufacturing errors due to manufacturing variations and lens eccentricity adjustment. For this reason, according to the present embodiment, it is possible to provide an image processing method capable of effectively reducing color bleeding in a color image in consideration of a manufacturing error of the imaging optical system.

次に、図25を参照して、本発明の実施例1における撮像装置について説明する。図25は、本実施例における撮像装置200の構成図である。撮像装置200には、撮影画像の色にじみ補正処理(上述の画像処理方法)を行う画像処理プログラムがインストールされており、この色にじみ補正処理は撮像装置200の内部の画像処理部204(画像処理装置)により実行される。   Next, with reference to FIG. 25, an imaging apparatus according to Embodiment 1 of the present invention will be described. FIG. 25 is a configuration diagram of the imaging apparatus 200 in the present embodiment. The imaging apparatus 200 is installed with an image processing program for performing color blur correction processing (the above-described image processing method) of a captured image. This color blur correction processing is performed by an image processing unit 204 (image processing) in the imaging apparatus 200. Device).

撮像装置200は、撮像光学系201(レンズ)および撮像装置本体(カメラ本体)を備えて構成されている。撮像光学系201は、絞り201aおよびフォーカスレンズ201bを備え、撮像装置本体(カメラ本体)と一体的に構成されている。ただし本実施例はこれに限定されるものではなく、撮像光学系201が撮像装置本体に対して交換可能に装着される撮像装置にも適用可能である。   The imaging apparatus 200 includes an imaging optical system 201 (lens) and an imaging apparatus main body (camera main body). The imaging optical system 201 includes a diaphragm 201a and a focus lens 201b, and is configured integrally with an imaging apparatus main body (camera main body). However, the present embodiment is not limited to this, and can also be applied to an imaging apparatus in which the imaging optical system 201 is attached to the imaging apparatus body in a replaceable manner.

撮像素子202は、撮像光学系201を介して形成された被写体像(光学像)を光電変換して画像(撮影画像)を得る。すなわち被写体像は、撮像素子202により光電変換が行われてアナログ信号(電気信号)に変換される。そして、このアナログ信号はA/Dコンバータ203によりデジタル信号に変換され、このデジタル信号は画像処理部204に入力される。   The image sensor 202 photoelectrically converts a subject image (optical image) formed via the imaging optical system 201 to obtain an image (captured image). That is, the subject image is photoelectrically converted by the image sensor 202 and converted into an analog signal (electric signal). The analog signal is converted into a digital signal by the A / D converter 203, and the digital signal is input to the image processing unit 204.

画像処理部204(画像処理装置)は、このデジタル信号に対して所定の処理を行うとともに、上述の色にじみ補正処理を行う。まず画像処理部204(取得部101)は、状態検知部207から撮像装置200(撮像光学系201)の撮像条件情報を取得する。撮像条件情報とは、絞り値、撮影距離(被写体距離)、または、ズームレンズの焦点距離などに関する情報である。状態検知部207は、システムコントローラ210から直接に撮像条件情報を取得することができるが、これに限定されるものではない。例えば撮像光学系201に関する撮像条件情報は、光学系制御部206から取得することもできる。なお、本実施例の色にじみ補正処理(画像処理方法)は、図1Bを参照して説明したとおりである。   An image processing unit 204 (image processing apparatus) performs predetermined processing on the digital signal and performs the above-described color blur correction processing. First, the image processing unit 204 (acquisition unit 101) acquires imaging condition information of the imaging apparatus 200 (imaging optical system 201) from the state detection unit 207. The imaging condition information is information regarding an aperture value, a shooting distance (subject distance), a focal length of a zoom lens, and the like. The state detection unit 207 can acquire the imaging condition information directly from the system controller 210, but is not limited to this. For example, the imaging condition information regarding the imaging optical system 201 can be acquired from the optical system control unit 206. Note that the color blur correction process (image processing method) of this embodiment is as described with reference to FIG. 1B.

撮像光学系201の倍率色収差に関する補正データは、記憶部208に保持されている。倍率色収差に関する補正データは、撮像光学系の設計値や製造工程で測定したデータに基づいて、撮像装置や画像処理装置が予め保持しているデータである。画像処理部204は、記憶部208から、上記の撮影条件情報に対応する倍率色収差に関する補正データを取得する。そして画像処理部204は、この補正データと、画像から検出した倍率色収差(補正量)とを比較し、その比較結果に基づいて製造誤差判定を行う。画像処理部204は、製造誤差があると判定した場合、判定フラグ「1」を記憶部208に格納する。一方、製造誤差がないと判定した場合、判定フラグ「0」を記憶部208に格納する。   Correction data relating to chromatic aberration of magnification of the imaging optical system 201 is held in the storage unit 208. The correction data relating to the chromatic aberration of magnification is data held in advance by the imaging device and the image processing device based on the design value of the imaging optical system and data measured in the manufacturing process. The image processing unit 204 acquires correction data related to the chromatic aberration of magnification corresponding to the shooting condition information from the storage unit 208. The image processing unit 204 compares the correction data with the chromatic aberration of magnification (correction amount) detected from the image, and performs manufacturing error determination based on the comparison result. When it is determined that there is a manufacturing error, the image processing unit 204 stores a determination flag “1” in the storage unit 208. On the other hand, if it is determined that there is no manufacturing error, the determination flag “0” is stored in the storage unit 208.

また、撮像光学系201の色にじみに関する補正データも、記憶部208に保持されている。画像処理部204は、記憶部208から、上記の撮影条件情報に対応する色にじみに関する補正データを取得し、色にじみ補正処理を行う。補正後の出力画像は、画像記録媒体209に所定のフォーマットで保存される。表示部205には、本実施例の色にじみ補正処理を行った画像に表示用の所定の処理を行った画像が表示される。ただし本実施例はこれに限定されるものではなく、高速表示のために簡易処理を行った画像を表示部205に表示するように構成してもよい。   In addition, correction data relating to color bleeding of the imaging optical system 201 is also held in the storage unit 208. The image processing unit 204 acquires correction data related to color blur corresponding to the shooting condition information from the storage unit 208, and performs color blur correction processing. The corrected output image is stored in the image recording medium 209 in a predetermined format. The display unit 205 displays an image obtained by performing a predetermined display process on the image subjected to the color blur correction process of the present embodiment. However, the present embodiment is not limited to this, and an image subjected to simple processing for high-speed display may be displayed on the display unit 205.

本実施例における一連の制御はシステムコントローラ210により行われ、撮像光学系201の機械的な駆動はシステムコントローラ210の指示に基づいて光学系制御部206により行われる。光学系制御部206は、Fナンバーの撮影状態設定として、絞り201aの開口径を制御する。また光学系制御部206は、被写体距離に応じてピント調整を行うため、不図示のオートフォーカス(AF)機構や手動のマニュアルフォーカス機構により、フォーカスレンズ201bの位置を制御する。なお、絞り201aの開口径制御やマニュアルフォーカスなどの機能は、撮像装置200の仕様に応じて実行しなくてもよい。また、撮像光学系201には、ローパスフィルタや赤外線カットフィルタなどの光学素子を設けることができる。   A series of controls in this embodiment is performed by the system controller 210, and mechanical driving of the imaging optical system 201 is performed by the optical system controller 206 based on an instruction from the system controller 210. The optical system control unit 206 controls the aperture diameter of the aperture 201a as the F number shooting state setting. The optical system control unit 206 controls the position of the focus lens 201b by an unillustrated autofocus (AF) mechanism or a manual manual focus mechanism in order to perform focus adjustment according to the subject distance. Note that functions such as aperture diameter control and manual focus of the aperture 201a may not be executed according to the specifications of the imaging apparatus 200. The imaging optical system 201 can be provided with optical elements such as a low-pass filter and an infrared cut filter.

次に、図26を参照して、本発明の実施例2における画像処理システムについて説明する。図26は、本実施例における画像処理システム300の構成図である。なお、本実施例の色にじみ補正処理(画像処理方法)は、図1Bを参照して説明したとおりであるため、その説明は省略する。   Next, an image processing system according to the second embodiment of the present invention will be described with reference to FIG. FIG. 26 is a configuration diagram of an image processing system 300 in the present embodiment. Note that the color blur correction process (image processing method) of this embodiment is as described with reference to FIG.

図26において、画像処理装置301は、本実施例の画像処理方法をコンピュータに実行させるための画像処理ソフトウエア306を搭載したコンピュータ機器である。撮像機器302は、カメラ、顕微鏡、内視鏡、または、スキャナなどの撮像装置である。記憶媒体303は、半導体メモリ、ハードディスク、または、ネットワーク上のサーバなど、撮影画像を記憶した記憶手段である。   In FIG. 26, an image processing apparatus 301 is a computer device equipped with image processing software 306 for causing a computer to execute the image processing method of this 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 storage unit that stores captured images, such as a semiconductor memory, a hard disk, or a server on a network.

画像処理装置301は、撮像機器302または記憶媒体303から撮影画像データを取得し、所定の画像処理を行った画像データを出力機器305、撮像機器302、記憶媒体303のいずれか一つまたは複数に出力する。また、その出力先を画像処理装置301に内蔵された記憶部に保存することもできる。出力機器305は、例えばプリンタである。また、ネットワークまたはCD−ROM307などの記憶媒体から画像処理ソフトウエア306を画像処理装置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 one or more of the output device 305, the imaging device 302, and the storage medium 303. Output. Further, the output destination can be stored in a storage unit built in the image processing apparatus 301. The output device 305 is a printer, for example. Further, the image processing software 306 can be installed in the image processing apparatus 301 from a network or a storage medium such as a CD-ROM 307.

画像処理装置301には、モニタである表示機器304が接続されている。このため、ユーザは表示機器304を通して画像処理作業を行うとともに、補正された画像を評価することができる。画像処理ソフトウエア306は、本実施例の色にじみ補正処理(画像処理方法)を行うほか、必要に応じて現像やその他の画像処理を行う。   A display device 304 that is a monitor is connected to the image processing apparatus 301. Therefore, the user can perform the image processing work through the display device 304 and evaluate the corrected image. The image processing software 306 performs color blur correction processing (image processing method) of the present embodiment, and performs development and other image processing as necessary.

なお、本実施例における画像処理を行うためのデータの内容や機器間での受け渡しなどに関する情報(補正情報)については、個々の画像データに付帯させることが好ましい。必要な補正情報を画像データに付帯させることで、本実施例の画像処理装置を搭載した機器であれば、適切に本実施例の補正処理を行うことが可能である。   It should be noted that information (correction information) related to the contents of data for image processing and the transfer between devices in this embodiment is preferably attached to individual image data. By adding necessary correction information to the image data, the correction processing of the present embodiment can be appropriately performed as long as the device is equipped with the image processing apparatus of the present embodiment.

なお、撮像光学系の色にじみ発生方向に関する光学情報は、本実施例の画像処理装置を搭載した機器の記録部から読み出す方法だけでなく、ネットワークを介して取得してもよいし、PCやカメラ、レンズ等から情報を取得してもよい。   Note that the optical information related to the color blur generation direction of the imaging optical system may be acquired via a network as well as a method of reading from a recording unit of a device equipped with the image processing apparatus of the present embodiment, or may be a PC or camera Information may be acquired from a lens or the like.

(その他の実施例)
本発明は、上述の実施形態の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 the 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 effectively reduce color blur in a color image in consideration of manufacturing errors of the imaging optical system are provided. can do.

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

100 画像処理装置
101 取得部
104 判定部
100 Image processing apparatus 101 Acquisition unit 104 Determination unit

Claims (24)

撮像光学系を介して形成された画像の倍率色収差に関する情報を取得する取得部と、
前記倍率色収差に関する情報に応じて、前記撮像光学系の色にじみに関する光学情報を用いて該色にじみを低減するように前記画像を修正するか否かを判定する判定部と、を有することを特徴とする画像処理装置。
An acquisition unit for acquiring information on lateral chromatic aberration of an image formed via the imaging optical system;
A determination unit that determines whether to correct the image so as to reduce the color blur using the optical information regarding the color blur of the imaging optical system according to the information about the chromatic aberration of magnification. An image processing apparatus.
複数のカラーフィルタを備えた撮像素子から得られた前記画像の少なくとも一つのカラーフィルタに対応する色プレーンの信号レベル、または、該画像から生成される輝度プレーンの信号レベルが、所定の区間において第1の方向に単調増加または単調減少している第1の領域を検出する検出部と、
前記光学情報と前記第1の領域に関する情報とに基づいて、該色にじみが発生している第2の領域を決定する決定部と、
前記倍率色収差に関する情報に応じて、前記色にじみを低減するように前記画像を修正する修正部と、を更に有することを特徴とする請求項1に記載の画像処理装置。
A signal level of a color plane corresponding to at least one color filter of the image obtained from an image pickup device including a plurality of color filters or a signal level of a luminance plane generated from the image is set in a predetermined section. A detection unit for detecting a first region monotonously increasing or monotonically decreasing in the direction of 1;
A determination unit that determines a second region in which the color blur is generated based on the optical information and the information on the first region;
The image processing apparatus according to claim 1, further comprising: a correction unit that corrects the image so as to reduce the color blur according to information on the chromatic aberration of magnification.
前記光学情報と前記撮像光学系の倍率色収差に関する情報とを記憶する記憶部を更に有し、
前記修正部は、前記画像から取得された前記倍率色収差に関する情報と前記記憶部に記憶された前記倍率色収差に関する情報との差異が所定の閾値を超えない場合、前記光学情報を用いて前記画像を修正することを特徴とする請求項2に記載の画像処理装置。
A storage unit that stores the optical information and information about the chromatic aberration of magnification of the imaging optical system;
When the difference between the information about the lateral chromatic aberration acquired from the image and the information about the lateral chromatic aberration stored in the storage unit does not exceed a predetermined threshold, the correcting unit uses the optical information to display the image. The image processing apparatus according to claim 2, wherein the correction is performed.
前記修正部は、前記差異が前記所定の閾値を超えた場合、前記画像の前記第1の領域を修正することを特徴とする請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the correction unit corrects the first region of the image when the difference exceeds the predetermined threshold. 前記決定部は、前記差異が前記所定の閾値を超えた場合、前記画像から取得された前記倍率色収差に関する情報に応じて前記光学情報を補正し、補正後の光学情報と前記第1の領域に関する情報とに基づいて、前記第2の領域を決定することを特徴とする請求項3に記載の画像処理装置。   The determination unit corrects the optical information according to information on the lateral chromatic aberration acquired from the image when the difference exceeds the predetermined threshold, and relates to the corrected optical information and the first region. The image processing apparatus according to claim 3, wherein the second area is determined based on the information. 前記修正部は、前記差異が前記所定の閾値を超えた場合、前記画像を修正しないことを特徴とする請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the correction unit does not correct the image when the difference exceeds the predetermined threshold. 前記光学情報を記憶する記憶部を更に有し、
前記修正部は、前記画像の中心に対して対称な位置における倍率色収差の差が所定の閾値を超えない場合、前記光学情報を用いて前記画像を修正する、ことを特徴とする請求項2に記載の画像処理装置。
A storage unit for storing the optical information;
The correction unit corrects the image using the optical information when a difference in lateral chromatic aberration at a position symmetric with respect to the center of the image does not exceed a predetermined threshold. The image processing apparatus described.
前記修正部は、前記差が前記所定の閾値を超えた場合、前記画像の前記第1の領域を修正することを特徴とする請求項7に記載の画像処理装置。   The image processing apparatus according to claim 7, wherein the correction unit corrects the first region of the image when the difference exceeds the predetermined threshold. 前記決定部は、前記差が前記所定の閾値を超えた場合、前記画像から取得された前記倍率色収差に関する情報に応じて前記光学情報を補正し、補正後の光学情報と前記第1の領域に関する情報とに基づいて、前記第2の領域を決定することを特徴とする請求項7に記載の画像処理装置。   When the difference exceeds the predetermined threshold, the determination unit corrects the optical information according to information on the lateral chromatic aberration acquired from the image, and relates to the corrected optical information and the first region. The image processing apparatus according to claim 7, wherein the second area is determined based on the information. 前記修正部は、前記差が前記所定の閾値を超えた場合、前記画像を修正しないことを特徴とする請求項7に記載の画像処理装置。   The image processing apparatus according to claim 7, wherein the correction unit does not correct the image when the difference exceeds the predetermined threshold. 前記記憶部は、撮影条件ごとに前記光学情報を記憶していることを特徴とする請求項3乃至10のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the storage unit stores the optical information for each shooting condition. 前記撮影条件は、前記撮像光学系の焦点距離、被写体距離、および、絞り値の少なくとも一つを含むことを特徴とする請求項11に記載の画像処理装置。   The image processing apparatus according to claim 11, wherein the photographing condition includes at least one of a focal length, a subject distance, and an aperture value of the imaging optical system. 前記光学情報は、前記撮像光学系の前記色にじみが発生する第2の方向に関する情報であることを特徴とする請求項2乃至12のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the optical information is information related to a second direction in which the color blur of the imaging optical system occurs. 前記決定部は、前記第1の方向と前記第2の方向とを比較することにより前記第2の領域を決定することを特徴とする請求項13に記載の画像処理装置。   The image processing apparatus according to claim 13, wherein the determination unit determines the second region by comparing the first direction and the second direction. 前記決定部は、前記第1の方向と前記第2の方向とが互いに一致する場合、前記第1の領域が前記第2の領域であると決定することを特徴とする請求項14に記載の画像処理装置。   The said determination part determines that the said 1st area | region is the said 2nd area | region, when the said 1st direction and the said 2nd direction correspond mutually. Image processing device. 前記光学情報は、前記撮像光学系の前記色にじみの強度に関する情報であることを特徴とする請求項2乃至15のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the optical information is information relating to the intensity of the color blur of the imaging optical system. 前記修正部は、前記色にじみの前記強度に関する情報に基づいて、前記画像を修正する強度を変更することを特徴とする請求項16に記載の画像処理装置。   The image processing apparatus according to claim 16, wherein the correction unit changes a strength for correcting the image based on information on the strength of the color blur. 前記修正部は、前記第1の方向と前記第2の方向とが複数の方向において互いに一致する場合、該複数の方向における色にじみの強度に関する情報を演算して前記画像を修正することを特徴とする請求項15に記載の画像処理装置。   When the first direction and the second direction coincide with each other in a plurality of directions, the correction unit corrects the image by calculating information on the intensity of color blur in the plurality of directions. The image processing apparatus according to claim 15. 前記修正部は、前記第1の方向と前記第2の方向とが複数の方向において互いに一致する場合、該複数の方向の重心方向における色にじみの強度に関する情報を用いて前記画像を修正することを特徴とする請求項15に記載の画像処理装置。   When the first direction and the second direction coincide with each other in a plurality of directions, the correction unit corrects the image using information on the intensity of color blur in the centroid direction of the plurality of directions. The image processing apparatus according to claim 15. 前記光学情報は、前記撮像光学系の光学設計値に関する情報であることを特徴とする請求項1乃至19のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the optical information is information related to an optical design value of the imaging optical system. 撮像光学系を介して形成された光学像を光電変換して画像を出力する撮像素子と、
前記画像の倍率色収差に関する情報を取得する取得部と、
前記倍率色収差に関する情報に応じて、前記撮像光学系の色にじみに関する光学情報を用いて該色にじみを低減するように前記画像を修正するか否かを判定する判定部と、を有することを特徴とする撮像装置。
An image sensor that photoelectrically converts an optical image formed via the imaging optical system and outputs an image; and
An acquisition unit for acquiring information on lateral chromatic aberration of the image;
A determination unit that determines whether to correct the image so as to reduce the color blur using the optical information regarding the color blur of the imaging optical system according to the information about the chromatic aberration of magnification. An imaging device.
撮像光学系を介して形成された画像の倍率色収差に関する情報を取得するステップと、
前記倍率色収差に関する情報に応じて、前記撮像光学系の色にじみに関する光学情報を用いて該色にじみを低減するように前記画像を修正するか否かを判定するステップと、を有することを特徴とする画像処理方法。
Obtaining information on lateral chromatic aberration of an image formed via the imaging optical system;
Determining whether to correct the image so as to reduce the color blur using the optical information related to the color blur of the imaging optical system according to the information about the chromatic aberration of magnification. Image processing method.
撮像光学系を介して形成された画像の倍率色収差に関する情報を取得するステップと、
前記倍率色収差に関する情報に応じて、前記撮像光学系の色にじみに関する光学情報を用いて該色にじみを低減するように前記画像を修正するか否かを判定するステップと、をコンピュータに実行させるように構成されていることを特徴とする画像処理プログラム。
Obtaining information on lateral chromatic aberration of an image formed via the imaging optical system;
Determining whether to correct the image so as to reduce the color blur using the optical information related to the color blur of the imaging optical system according to the information about the chromatic aberration of magnification. An image processing program configured as described above.
請求項23に記載の画像処理プログラムを記憶していることを特徴とする記憶媒体。   24. A storage medium storing the image processing program according to claim 23.
JP2015222884A 2015-11-13 2015-11-13 Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium Pending JP2017092800A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015222884A JP2017092800A (en) 2015-11-13 2015-11-13 Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015222884A JP2017092800A (en) 2015-11-13 2015-11-13 Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium

Publications (1)

Publication Number Publication Date
JP2017092800A true JP2017092800A (en) 2017-05-25

Family

ID=58770912

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015222884A Pending JP2017092800A (en) 2015-11-13 2015-11-13 Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium

Country Status (1)

Country Link
JP (1) JP2017092800A (en)

Similar Documents

Publication Publication Date Title
US8692909B2 (en) Image processing device and image pickup device using the same
US8830351B2 (en) Image processing method and image processing apparatus for image restoration to reduce a detected color shift
JP5546229B2 (en) Image processing method, image processing apparatus, imaging apparatus, and image processing program
JP5959976B2 (en) Image processing method, image processing program, image processing apparatus, and imaging apparatus
US8849055B2 (en) Image processing apparatus and method
WO2011122283A1 (en) Image processing device and image capturing device using same
EP2566162A2 (en) Image processing apparatus and method
EP2860974B1 (en) Image processing apparatus, image pickup apparatus, image pickup system, image processing method, image processing program, and storage medium
JP2011123589A5 (en)
JP5619124B2 (en) Image processing apparatus, imaging apparatus, image processing program, and image processing method
WO2011121763A1 (en) Image processing apparatus and image capturing apparatus using same
JP5528139B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP5653464B2 (en) Imaging apparatus, image processing apparatus, image processing method, image processing program, and storage medium
JP2011160255A5 (en)
JP6415108B2 (en) Image processing method, image processing apparatus, imaging apparatus, image processing program, and storage medium
JP2012156715A (en) Image processing device, imaging device, image processing method, and program
JP6682184B2 (en) Image processing method, image processing program, image processing device, and imaging device
JP6436840B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP5645981B2 (en) Imaging apparatus, image processing apparatus, image processing method, image processing program, and storage medium
JP6238673B2 (en) Image processing apparatus, imaging apparatus, imaging system, image processing method, image processing program, and storage medium
JP6604737B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP2017118293A (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP2017092800A (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP6486076B2 (en) Image processing apparatus and image processing method
JP6452389B2 (en) Image processing apparatus and image processing method