JP6115183B2 - Image processing apparatus, imaging apparatus, and image processing program - Google Patents

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

Info

Publication number
JP6115183B2
JP6115183B2 JP2013037419A JP2013037419A JP6115183B2 JP 6115183 B2 JP6115183 B2 JP 6115183B2 JP 2013037419 A JP2013037419 A JP 2013037419A JP 2013037419 A JP2013037419 A JP 2013037419A JP 6115183 B2 JP6115183 B2 JP 6115183B2
Authority
JP
Japan
Prior art keywords
flare
color
processing
image
region
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.)
Active
Application number
JP2013037419A
Other languages
Japanese (ja)
Other versions
JP2014165833A (en
Inventor
健太郎 彦坂
健太郎 彦坂
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.)
Nikon Corp
Original Assignee
Nikon Corp
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 Nikon Corp filed Critical Nikon Corp
Priority to JP2013037419A priority Critical patent/JP6115183B2/en
Publication of JP2014165833A publication Critical patent/JP2014165833A/en
Application granted granted Critical
Publication of JP6115183B2 publication Critical patent/JP6115183B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Description

本発明は、撮影画像へフレア補正処理を施す画像処理装置、撮像装置、画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an imaging apparatus, and an image processing program that perform flare correction processing on a captured image.

回折光学素子(DOE:Diffractive Optical Element)を有する撮影光学系で撮影を行う際、極めて高輝度な物体(光源)が撮影画角内に存在していた場合には、撮影画像上の光源像の周辺に色滲みを伴うフレア(色フレア)が発生する。この色フレアは無色のフレアと比較すると著しく不自然である。   When photographing with a photographing optical system having a diffractive optical element (DOE), if an extremely bright object (light source) is present within the photographing angle of view, the light source image on the photographed image is displayed. Flare with color blur (color flare) is generated around. This color flare is significantly unnatural compared to the colorless flare.

因みに、特許文献1には、フレア補正処理として、フレア発生領域の色相を背景の色相に合わせるように変換し、さらに平滑化フィルタをかけることにより、色フレアを目立たなくする電子カメラが開示されている。   Incidentally, Patent Document 1 discloses an electronic camera that makes the color flare inconspicuous by converting the hue of the flare occurrence region to match the hue of the background and applying a smoothing filter as flare correction processing. Yes.

特許第4250506号公報Japanese Patent No. 4250506

しかしながら、色フレアの発生源である光源の中には、固有の色を有したものも存在しており、そのような光源に起因した色フレアへ前述したフレア補正処理を施すと、色フレアの色滲みと共に光源本来の色までもが消えてしまう虞がある。   However, some of the light sources that are the source of color flare have unique colors. If the flare correction processing described above is applied to the color flare caused by such a light source, There is a possibility that even the original color of the light source may disappear together with the color blur.

そこで本発明は、フレアの生源色に依らず適切なフレア補正処理を実行することのできる画像処理装置、撮像装置、及び画像処理プログラムを提供することを目的とする。   SUMMARY An advantage of some aspects of the invention is that it provides an image processing apparatus, an imaging apparatus, and an image processing program capable of executing an appropriate flare correction process regardless of the flare source color.

本発明の画像処理装置は、撮影光学系により取得された処理対象画像を入力する入力と、前記撮影光学系の種類に基づいて、前記処理対象画像におけるフレアの発生領域の前記フレアの光源色が特定の色か否かを判別する判別と、前記発生領域に対してフレア補正処理を施すフレア補正とを備え、前記フレア補正は、前記判別による前記判別の結果に応じて前記フレア補正処理の内容を切り換える。 The image processing apparatus of the present invention includes an input unit for inputting a processing target image obtained by the photographing optical system, based on the type of the photographing optical system, before Symbol flare generation region of the flare in the image to be processed a determination unit that the light source color is determined whether or not the specific color, and a flare correcting section for performing flare correction processing on the generated region, the flare correcting section depending on the determination result by the determination unit To switch the content of the flare correction process.

本発明の撮像装置は、撮影光学系が結像した被写体像を撮像するカラーの撮像素子と、前記撮像装置が生成した画像を前記処理対象画像として処理する本発明の画像処理装置とを備える。   The imaging device of the present invention includes a color imaging element that captures a subject image formed by a photographing optical system, and the image processing device of the present invention that processes an image generated by the imaging device as the processing target image.

本発明のコンピュータ実行可能な画像処理プログラムは、撮影光学系により取得された処理対象画像を入力する入力手順と、前記撮影光学系の種類に基づいて、前記処理対象像におけるフレアの発生領域の前記フレアの光源色が特定の色か否かを判別する判別手順と、前記発生領域に対してフレア補正処理を施すフレア補正手順とを含み、前記フレア補正手順では、前記判別手順による前記判別の結果に応じて前記フレア補正処理の内容を切り換える。 Computer-executable image processing program of the present invention includes an input procedure for entering the processing target image obtained by the photographing optical system, based on the type of the photographing optical system, generation region of the flare in the processed image image a determining procedure source color before Symbol flare it is determined whether or not the particular color, and a flare correction procedure for performing flare correction processing on the generated region, in the flare correction procedure, the by the determination procedure The content of the flare correction process is switched according to the determination result.

本発明によれば、フレアの光源色に依らず適切なフレア補正処理を実行することのできる画像処理装置、撮像装置、及び画像処理プログラムが実現する。   According to the present invention, an image processing device, an imaging device, and an image processing program capable of executing appropriate flare correction processing regardless of the flare light source color are realized.

第1実施形態の画像処理装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the image processing apparatus of 1st Embodiment. 現像処理の動作フローチャートである。It is an operation | movement flowchart of a development process. フレア補正処理の動作フローチャートである。It is an operation | movement flowchart of a flare correction process. フレア色成分抽出処理の動作フローチャートである。It is an operation | movement flowchart of a flare color component extraction process. 光源色判定処理の動作フローチャートである。It is an operation | movement flowchart of a light source color determination process. 光源色復元処理の動作フローチャートである。It is an operation | movement flowchart of a light source color restoration process. 入力画像の例である。It is an example of an input image. 検出された高輝度領域の例である。It is an example of the detected high-intensity area | region. フレアに起因した高輝度領域(飽和領域)の例である。It is an example of the high-intensity area | region (saturation area | region) resulting from a flare. ラベリングされた飽和領域の例である。It is an example of a labeled saturation region. 飽和領域Sの半径rと、フレア領域Aの半径との関係を示す模式図である。The radius r i of the saturation region S i, is a schematic diagram showing the relationship between the radius of the flared region A i. 飽和領域Sとフレア領域Aと処理領域A’との関係を説明する図である。It is a figure explaining the relationship between saturation area | region Si , flare area | region Ai, and process area | region Ai '. 二値のマスク画像を説明する図である。It is a figure explaining a binary mask image. グレースケールマスク画像を説明する図である。It is a figure explaining a gray scale mask image. 処理領域A’のR成分(フレア色成分有り)とG成分との関係を示す図である。It is a figure which shows the relationship between R component (with a flare color component) and G component of process area | region Ai '. フレア色成分の抽出手順を説明する模式図である。It is a schematic diagram explaining the extraction procedure of a flare color component. 処理領域A’のR成分(フレア色成分無し)とG成分との関係を示す図である。It is a figure which shows the relationship between R component (there is no flare color component) and G component of process area | region Ai '. (A)は、彩度強調前の或る処理領域A’の画素プロファイル(中心線上の画素プロファイル)であり、(B)は、彩度強調後の同じ処理領域A’の画素プロファイルである。(A) is a pixel profile (pixel profile on the center line) of a certain processing area A i ′ before saturation enhancement, and (B) is a pixel profile of the same processing area A i ′ after saturation enhancement. is there. 拡大前のグレースケールマスク画像を説明する図である。It is a figure explaining the gray scale mask image before expansion. 拡大後のグレースケールマスク画像を説明する図である。It is a figure explaining the grayscale mask image after expansion. 拡大前後のグレースケールマスク画像の画素プロファイル(中心線上の画素プロファイル)である。It is a pixel profile (pixel profile on the center line) of the grayscale mask image before and after enlargement. ステップS99を説明する図である。It is a figure explaining step S99. 第2実施形態の電子カメラの構成例を示すブロック図である。It is a block diagram which shows the structural example of the electronic camera of 2nd Embodiment.

[第1実施形態]
以下、本発明の第1実施形態を説明する。
[First Embodiment]
Hereinafter, a first embodiment of the present invention will be described.

図1は、本実施形態の画像処理装置の構成例を示すブロック図である。本実施形態の画像処理装置は、画像処理プログラムがインストールされたコンピュータ11で構成される。   FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus according to the present embodiment. The image processing apparatus according to this embodiment includes a computer 11 in which an image processing program is installed.

図1に示すコンピュータ11は、データ読込部12、記憶装置13、CPU14、メモリ15および入出力I/F16、バス17を有している。データ読込部12、記憶装置13、CPU14、メモリ15および入出力I/F16は、バス17を介して相互に接続されている。さらに、コンピュータ11には、入出力I/F16を介して、入力デバイス18(キーボード、ポインティングデバイスなど)とモニタ19とがそれぞれ接続されている。なお、入出力I/F16は、入力デバイス18からの各種入力を受け付けるとともに、モニタ19に対して表示用のデータを出力する。   A computer 11 illustrated in FIG. 1 includes a data reading unit 12, a storage device 13, a CPU 14, a memory 15, an input / output I / F 16, and a bus 17. The data reading unit 12, the storage device 13, the CPU 14, the memory 15, and the input / output I / F 16 are connected to each other via a bus 17. Further, an input device 18 (keyboard, pointing device, etc.) and a monitor 19 are connected to the computer 11 via an input / output I / F 16. The input / output I / F 16 receives various inputs from the input device 18 and outputs display data to the monitor 19.

データ読込部12は、画像処理対象となる画像データを外部から読み込むときに用いられる。例えば、データ読込部12は、データ読込部12に挿入された記憶媒体から画像データを取得する読込デバイス(光ディスクドライブ、磁気ディスクドライブ、光磁気ディスクドライブなど)や、公知の通信規格に準拠して外部の装置と通信を行う通信デバイス(USBインターフェース、LANモジュール、無線LANモジュールなど)で構成される。   The data reading unit 12 is used when reading image data to be subjected to image processing from the outside. For example, the data reading unit 12 conforms to a reading device (such as an optical disk drive, a magnetic disk drive, or a magneto-optical disk drive) that acquires image data from a storage medium inserted into the data reading unit 12 or a known communication standard. It is composed of communication devices (USB interface, LAN module, wireless LAN module, etc.) that communicate with external devices.

記憶装置13は、例えば、ハードディスクや、不揮発性の半導体メモリなどの記憶媒体で構成される。この記憶装置13には、画像処理プログラムが記録されている。なお、記憶装置13には、データ読込部12から読み込まれた画像データを記憶しておくこともできる。   The storage device 13 is configured by a storage medium such as a hard disk or a nonvolatile semiconductor memory. The storage device 13 stores an image processing program. The storage device 13 can also store image data read from the data reading unit 12.

CPU14は、記憶装置13に記憶された画像処理プログラムを実行し、コンピュータ11の各部を統括的に制御するプロセッサである。ここで、本実施形態の画像処理プログラムには、カメラで撮影されたRAW画像に対する現像処理の機能が搭載されており、この現像処理を実行する際、CPU14は、各部を制御する制御部として機能する他に、フレア補正処理部21としても機能する(フレア補正処理部21の動作は後述する)。   The CPU 14 is a processor that executes an image processing program stored in the storage device 13 and comprehensively controls each unit of the computer 11. Here, the image processing program of the present embodiment is equipped with a function of developing processing for a RAW image taken by a camera, and when executing this developing processing, the CPU 14 functions as a control unit that controls each unit. Besides, it also functions as a flare correction processing unit 21 (the operation of the flare correction processing unit 21 will be described later).

メモリ15は、画像処理プログラムでの各種演算結果を一時的に記憶する。このメモリ15は、例えば揮発性のSDRAMなどで構成される。   The memory 15 temporarily stores various calculation results in the image processing program. The memory 15 is composed of, for example, a volatile SDRAM.

図2は、現像処理の動作フローチャートである。以下、図2の各ステップを順に説明する。   FIG. 2 is an operation flowchart of the development process. Hereafter, each step of FIG. 2 is demonstrated in order.

ステップS1:CPU14は、ユーザが現像処理の対象として指定したカラー画像(RAW画像)の画像データを、メモリ15上に読み込む(以下、これを「入力画像」と称す。)。この入力画像は、例えば、データ読込部12の記憶媒体に書き込まれていた画像である。   Step S1: The CPU 14 reads image data of a color image (RAW image) designated by the user as an object of development processing onto the memory 15 (hereinafter referred to as “input image”). This input image is an image written in the storage medium of the data reading unit 12, for example.

ここで、入力画像には、色フレアの発生している可能性がある。色フレアの発生した画像は、DOEを含む撮影光学系で撮影された画像であって、例えば図7に示すとおりである(但し、図7はモノクロ画像なので、色フレアの色付きは現れていない。)。色フレアは通常、輪帯状又はそれに近いパターンをしているが、そのパターンは完全な輪帯状になるとは限らず、撮影条件(画像の撮影に使用された撮影光学系の結像特性、撮影時に画角内に存在していた光源の波長スペクトルなど)に依存する。また、色フレアの色づき分布(フレア色成分)も、撮影条件に依存する。   Here, there is a possibility that color flare has occurred in the input image. The image in which the color flare is generated is an image taken by the photographing optical system including the DOE, for example, as shown in FIG. 7 (however, since FIG. 7 is a monochrome image, the color flare is not colored. ). The color flare usually has a zonal pattern or a pattern close to it, but the pattern does not always form a complete zonal pattern, and the shooting conditions (imaging characteristics of the photographic optical system used to shoot the image, It depends on the wavelength spectrum of the light source existing within the angle of view. The color flare distribution (flare color component) also depends on the shooting conditions.

但し、本実施形態のフレア補正処理は、色フレアのパターン及び色付き分布が未知であっても実行可能であるので、入力画像には詳細な撮影条件データが付随していなくても構わない。よって、本実施形態では、撮影に使用された撮影光学系の種類情報が入力画像に付随していれば十分である。   However, since the flare correction process of the present embodiment can be executed even if the color flare pattern and the distribution with color are unknown, detailed imaging condition data may not be attached to the input image. Therefore, in this embodiment, it is sufficient if the type information of the photographing optical system used for photographing is attached to the input image.

ステップS2:CPU14は、メモリ15上の入力画像に対して、フレア補正処理以外の現像処理を施す。ここでは簡単のため、フレア補正処理以外の現像処理は、色補間処理、彩度強調処理(色補正処理の一種)のみと仮定する。これによって、メモリ15上の入力画像は、色補間後、かつ彩度強調後の状態となる。   Step S2: The CPU 14 performs development processing other than flare correction processing on the input image on the memory 15. Here, for simplicity, it is assumed that development processing other than flare correction processing is only color interpolation processing and saturation enhancement processing (a type of color correction processing). As a result, the input image on the memory 15 is in a state after color interpolation and after saturation enhancement.

ステップS3:CPU14は、入力画像に付随する、撮影光学系の種類情報に基づき、その撮影光学系にDOEが含まれていたか否かを判別し、含まれていなかった場合には、入力画像に色フレアの発生している可能性は無いとみなしてステップS10へ移行し、撮影光学系にDOEが含まれていた場合には、入力画像に色フレアの発生している可能性があるとみなしてステップS4へ移行する。   Step S3: The CPU 14 determines whether or not DOE is included in the photographing optical system based on the type information of the photographing optical system attached to the input image. Since it is considered that there is no possibility of occurrence of color flare, the process proceeds to step S10, and when DOE is included in the photographing optical system, it is assumed that there is a possibility of occurrence of color flare in the input image. To step S4.

ステップS4:CPU14は、入力画像のサイズ縮小版(縮小画像)を作成する。なお、縮小画像を作成するのは、後続するステップの演算負荷を軽減するためである。入力画像に対する縮小画像のサイズ比は、1/4、或いは、1/8などである。因みに、1/8よりもサイズ比を小さくすると、小さな光源を検出できなくなる虞があるので、サイズ比は1/8以上であることが望ましい。   Step S4: The CPU 14 creates a reduced size version (reduced image) of the input image. The reason why the reduced image is created is to reduce the calculation load of the subsequent steps. The size ratio of the reduced image to the input image is 1/4, 1/8, or the like. Incidentally, if the size ratio is made smaller than 1/8, a small light source may not be detected, so the size ratio is preferably 1/8 or more.

ステップS5:CPU14は、縮小画像の各画素の輝度を所定値(ここでは飽和レベルとする。)と比較することにより、輝度が所定値を超過するような明るい領域(高輝度領域)を縮小画像から検出する(図8参照)。図8に示すとおり、検出された高輝度領域の中には、フレアに起因した高輝度領域だけでなく、フレアとは無関係な高輝度領域も混在している可能性がある。   Step S5: The CPU 14 compares the brightness of each pixel of the reduced image with a predetermined value (here, a saturation level), thereby reducing a bright area (high brightness area) where the luminance exceeds the predetermined value. (See FIG. 8). As shown in FIG. 8, there is a possibility that not only the high brightness area caused by flare but also the high brightness area unrelated to flare are mixed in the detected high brightness area.

なお、本ステップでは演算負荷を軽減するため、各画素の輝度の指標として、各画素の輝度値(R、G、Bの重み付け和)を使用する代わりに、各画素の各色成分の和(R、G、Bの和)を使用してもよい。或いは、各画素の輝度の指標として、各画素を代表する色成分の値(G強度)を使用してもよい。また、このような演算負荷の軽減方法は、画素の輝度を扱う他のステップでも採用することができる。   In this step, in order to reduce the calculation load, instead of using the luminance value (R, G, B weighted sum) of each pixel as an index of the luminance of each pixel, the sum of each color component (R , G, B) may be used. Alternatively, a color component value (G intensity) representing each pixel may be used as an index of luminance of each pixel. Further, such a method of reducing the calculation load can be employed in other steps for handling the luminance of the pixel.

ステップS6:CPU14は、ステップS5で検出された高輝度領域の各々がフレアに起因したものであるか否かを判別し、フレアに起因したもの以外を排除する(図9参照。)。   Step S6: The CPU 14 determines whether or not each of the high luminance areas detected in step S5 is caused by flare, and excludes those other than those caused by flare (see FIG. 9).

なお、個々の高輝度領域がフレアに起因したものであるか否かの判定は、例えば次のとおり行われる。すなわち、CPU14は、高輝度領域と予め用意した円形パターンとを比較し、両者の相関度が一定以上である場合には、その高輝度領域をフレアに起因したものとみなし、相関度が一定未満である場合には、その高輝度領域をフレアに起因したものではないとみなす。なお、比較対象となる円形パターンとしては、フレアに起因した高輝度領域として平均的なものを使用すればよい。   For example, the determination as to whether or not each high-luminance region is caused by flare is performed as follows. That is, the CPU 14 compares the high luminance area with a circular pattern prepared in advance, and if the correlation between the two is greater than or equal to a certain level, the CPU 14 regards the high luminance area as being caused by flare and the correlation is less than a certain level If it is, the high brightness area is not considered to be caused by flare. As a circular pattern to be compared, an average pattern may be used as a high luminance area caused by flare.

或いは、個々の高輝度領域がフレアに起因したものであるか否かの判定は、次のとおり行われてもよい。すなわち、CPU14は、高輝度領域の中心から所定半径を有した円形領域を設定し、その円形領域の全域に高輝度領域が存在していた場合には、その高輝度領域をフレアに起因したものとみなし、円形領域の少なくとも1部が高輝度領域から外れていた場合には、その高輝度領域をフレアに起因したものではないとみなす。なお、円形領域の半径は、フレアに起因した高輝度領域として最も小さいものの半径と同程度に設定される。   Alternatively, the determination as to whether or not each high brightness area is caused by flare may be performed as follows. That is, the CPU 14 sets a circular area having a predetermined radius from the center of the high luminance area, and when there is a high luminance area in the entire circular area, the high luminance area is caused by the flare. If at least a part of the circular area is out of the high luminance area, the high luminance area is not attributed to flare. Note that the radius of the circular region is set to be approximately the same as the radius of the smallest high-luminance region caused by flare.

したがって、本ステップで除外されなかった高輝度領域は、フレアの中心部における飽和領域に相当する。以下、本ステップで除外されなかった高輝度領域を、単に「飽和領域」と称す。   Therefore, the high luminance area that is not excluded in this step corresponds to a saturated area in the center of the flare. Hereinafter, the high luminance area that is not excluded in this step is simply referred to as “saturated area”.

ステップS7:CPU14は、ステップS6で検出された1又は複数の飽和領域に対してラベリングを行い、通し番号(フレア番号i=1、2、…)を付与する(図10参照)。これによって、入力画像に発生しているフレアの総数(すなわち、フレア番号iの最終値)が確定する。   Step S7: The CPU 14 labels the one or more saturated regions detected in step S6 and assigns serial numbers (flare numbers i = 1, 2,...) (See FIG. 10). As a result, the total number of flares occurring in the input image (that is, the final value of the flare number i) is determined.

ステップS8:CPU14は、フレアの総数がゼロである場合には、フレア補正処理は不要であるとみなしてステップS10へ移行し、フレアの総数がゼロでない場合には、フレア補正処理を実行するべくステップS9へ移行する。   Step S8: If the total number of flares is zero, the CPU 14 considers that the flare correction process is unnecessary, and proceeds to step S10. If the total number of flares is not zero, the CPU 14 should execute the flare correction process. The process proceeds to step S9.

ステップS9:CPU14は、メモリ15上の入力画像に対してフレア補正処理を施す。フレア補正処理の詳細は、後述する。   Step S9: The CPU 14 performs flare correction processing on the input image on the memory 15. Details of the flare correction process will be described later.

ステップS10:CPU14は、メモリ15上の入力画像を、JPEGなどの所定の圧縮方式で圧縮してから、ユーザが指定した保存先(例えば、データ読込部12に挿入された記憶媒体)へ保存し、現像処理のフローを終了する。   Step S10: The CPU 14 compresses the input image on the memory 15 by a predetermined compression method such as JPEG, and then saves the input image in a storage destination designated by the user (for example, a storage medium inserted in the data reading unit 12). Then, the flow of the development process is terminated.

図3は、フレア補正処理の動作フローチャートである。以下、図3の各ステップを順に説明する。   FIG. 3 is an operation flowchart of the flare correction process. Hereafter, each step of FIG. 3 is demonstrated in order.

ステップS91:フレア補正処理部21は、フレア番号iを初期値(1)に設定する。   Step S91: The flare correction processing unit 21 sets the flare number i to an initial value (1).

ステップS92:フレア補正処理部21は、縮小画像上でフレア番号iに対応する飽和領域Sに着目すると、その飽和領域Sを包含する処理領域A’を縮小画像上に設定する。この処理領域A’は、飽和領域Sを中心としたフレアの発生領域(フレア領域)Aを包含している必要がある。 Step S92: When the flare correction processing unit 21 pays attention to the saturation region S i corresponding to the flare number i on the reduced image, the flare correction processing unit 21 sets the processing region A i ′ including the saturation region S i on the reduced image. This processing area A i ′ needs to include a flare generation area (flare area) A i centered on the saturation area S i .

ここで、図11に示すとおり、飽和領域Sが大きいときほど、フレア領域Aも大きくなる。但し、飽和領域Sの半径rが閾値a以下である場合(図11(a)、(b)、(c))は、フレア領域Aの半径は所定値βとなるが、飽和領域の半径rが閾値aを超過する場合(図11(d)、(e))は、フレア領域Aの半径は半径rに応じた値α×rとなる。なぜなら、飽和領域Sの半径rが閾値a以下である場合は、光源の明るさが一定未満であり、低次の回折光しか発生しないのに対して、飽和領域Sの半径rが閾値aを超過する場合は、光源の明るさが一定以上であり、低次の回折光に加えて高次の回折光も発生するからである。 Here, as shown in FIG. 11, the larger the saturation region S i , the larger the flare region A i . However, when the radius r i of the saturation region S i is equal to or less than the threshold a (FIG. 11 (a), (b) , (c)) is the radius of the flared region A i is a predetermined value beta, the saturation region If the radius r i of exceeds the threshold a (FIG. 11 (d), (e) ) , the radius of the flare area a i is the value alpha × r i in accordance with the radius r i. This is because, when the radius r i of the saturation region S i is equal to or less than the threshold a, the brightness of the light source is less than a predetermined low-order diffracted light only with respect to not occur, the radius r i of the saturation region S i This is because the brightness of the light source is not less than a certain value and the high-order diffracted light is generated in addition to the low-order diffracted light.

そこで、本ステップにおけるフレア補正処理部21は、処理領域Aの設定を以下の手順(A)〜(E)で行う。 Therefore, the flare correction processing unit 21 in this step sets the processing area A i according to the following procedures (A) to (E).

(A)フレア補正処理部21は、縮小画像上で飽和領域Sの輝度重心に相当する座標gを算出し、座標gから飽和領域Sの輪郭までの平均距離を、飽和領域Sの半径rとして算出する。 (A) The flare correction processing unit 21 calculates a coordinate g i corresponding to the luminance center of gravity of the saturation region S i on the reduced image, and calculates an average distance from the coordinate g i to the contour of the saturation region S i as the saturation region S. i is calculated as the radius r i of.

(B)フレア補正処理部21は、飽和領域Sの半径rが閾値a以下であるか否かを判別する。閾値a以下である場合は手順(C)へ移行し、そうでない場合は手順(D)へ移行する。 (B) The flare correction processing unit 21 determines whether or not the radius r i of the saturation region S i is equal to or less than the threshold value a. If it is equal to or less than the threshold value a, the procedure proceeds to procedure (C), and if not, the procedure proceeds to procedure (D).

(C)フレア補正処理部21は、図12(a)に示すとおり、縮小画像上で座標gを中心とし、かつ半径が所定値βである円形領域を、フレア番号iに対応したフレア領域Aに設定し(但しβ>r)、手順(E)へ移行する。 (C) As shown in FIG. 12A, the flare correction processing unit 21 defines a circular area centered on the coordinate g i on the reduced image and having a radius β as the flare area corresponding to the flare number i. Set to A i (where β> r i ) and proceed to step (E).

(D)フレア補正処理部21は、図12(b)に示すとおり、縮小画像上で座標gを中心とし、かつ半径が(α×r)である円形領域を、フレア番号iに対応したフレア領域Aに設定する(但しα>1)。 (D) As shown in FIG. 12B, the flare correction processing unit 21 corresponds to the flare number i in the circular area centered on the coordinate g i on the reduced image and having the radius (α × r i ). The flare area A i is set (where α> 1).

(E)フレア補正処理部21は、図12(a)又は図12(b)に示すとおり、縮小画像上でフレア領域Aの全体を包含し、かつ一定のマージンγを持った包含領域を、フレア番号iに対応した処理領域A’に設定する(但し、γ>0)。 (E) As shown in FIG. 12A or FIG. 12B, the flare correction processing unit 21 includes the entire flare area A i on the reduced image and an included area having a certain margin γ. , The processing area A i ′ corresponding to the flare number i is set (where γ> 0).

なお、本ステップでは、処理領域A’のサイズをフレア領域Aのサイズに応じて設定したが、処理領域A’がフレア領域Aを確実に包含できるのであれば、処理領域A’のサイズを予め決められたサイズ(十分に大きなサイズ)としてもよい。また、処理領域A’の形状は、円形でも矩形でも構わない。また、処理領域A’の中心は、フレア領域Aの中心から外れていても構わない。 In the present step, 'although the size of the set according to the size of the flare area A i, the processing area A i' processing area A i is as long as it can reliably include the flare region A i, the processing area A i The size of 'may be a predetermined size (a sufficiently large size). Further, the shape of the processing area A i ′ may be circular or rectangular. Further, the center of the processing area A i ′ may be deviated from the center of the flare area A i .

また、本ステップでは、飽和領域Sの輝度重心を座標gとしたが、演算負荷を軽減するために、飽和領域Sの中心を座標gとしてもよい。 Further, in this step, but the luminance center of the saturation region S i and a coordinate g i, in order to reduce the computational load, the center of the saturation region S i may coordinate g i.

また、本ステップでは、飽和領域Sのサイズとして飽和領域Sの半径rを算出したが、飽和領域Sのサイズとして飽和領域Sの画素数を使用してもよい。その場合は、半径の閾値aの代わりに画素数の閾値a’が使用される。 Further, in this step has been calculated radius r i of the saturation region S i as the size of the saturation region S i, may be used the number of pixels saturation region S i as the size of the saturation region S i. In that case, a threshold value a ′ for the number of pixels is used instead of the threshold value a for the radius.

また、飽和領域Sのサイズとフレア領域Aのサイズとの関係(図11参照)は、DOEの種類(すなわち撮影光学系の種類)によって異なるため、本ステップのフレア補正処理部21は、サイズの閾値を、撮影光学系の種類に応じて設定することが望ましい。 Further, since the relationship between the size of the saturation region S i and the size of the flare region A i (see FIG. 11) differs depending on the type of DOE (that is, the type of the photographing optical system), the flare correction processing unit 21 in this step is It is desirable to set the size threshold according to the type of the photographing optical system.

ステップS93:フレア補正処理部21は、フレア番号iに対応する処理領域A’に対してフレア色成分抽出処理を施し、処理領域A’に発生しているフレア色成分を抽出する。なお、本ステップで抽出されるフレア色成分は、2色のフレア色成分からなる。フレア色成分抽出処理の詳細は、後述する。 Step S93: flare correction processing unit 21 'performs flare color component extraction process on the processing area A i' processing area A i corresponding to the flare number i to extract the flare color component occurring in. The flare color component extracted in this step is composed of two flare color components. Details of the flare color component extraction processing will be described later.

ステップS94:フレア補正処理部21は、ステップS93で抽出されたフレア色成分(2色のフレア色成分)へサイズ拡大処理を施す。なお、前述したステップS4におけるサイズ比を1/Mとした場合、本ステップにおけるサイズ拡大処理ではフレア色成分(2色分のフレア色成分)のサイズをM倍にする。これによって、入力画像に対応するサイズのフレア色成分(2色のフレア色成分)が取得される。   Step S94: The flare correction processing unit 21 performs size enlargement processing on the flare color components (two flare color components) extracted in step S93. If the size ratio in step S4 is 1 / M, the size of flare color components (flare color components for two colors) is increased M times in the size enlargement process in this step. As a result, flare color components (two flare color components) having a size corresponding to the input image are acquired.

ステップS95:フレア補正処理部21は、サイズ拡大後のフレア色成分(2色のフレア色成分)を、入力画像上で処理領域A’に対応する領域から減算する。但し、減算に当たりCPU14は、縮小画像上の座標gと前述した倍率Mとに基づき、座標gに対応する入力画像上の座標g’を求め、その座標g’に対してフレア色成分(2色のフレア色成分)の中心を一致させておく。これによって、入力画像上で処理領域A’に対応する領域に発生していた色フレアのフレア色成分が除去される。つまり、その領域に発生していた色フレアは、無色のフレアとなる。 Step S95: The flare correction processing unit 21 subtracts the flare color component after the size enlargement (two flare color components) from the region corresponding to the processing region A i ′ on the input image. However, in the subtraction, the CPU 14 obtains the coordinate g i ′ on the input image corresponding to the coordinate g i based on the coordinate g i on the reduced image and the magnification M described above, and the flare color with respect to the coordinate g i ′. The centers of the components (two flare color components) are made to coincide. As a result, the flare color component of the color flare generated in the area corresponding to the processing area A i ′ on the input image is removed. That is, the color flare generated in the area is a colorless flare.

ステップS96:フレア補正処理部21は、縮小画像上のフレア領域Aに対して光源色判定処理を施し、フレア領域Aに発生しているフレアの光源色が白色であるか否かを判定する。光源色判定処理の詳細は、後述する。なお、ここでいう「白色」は、ヒトの目から見て白色に見える色のことであって、所謂白色光源の色(波長スペクトルがフラット)だけでなく、それに近い色をも含むものとする。 Step S96: The flare correction processing unit 21 performs a light source color determination process on the flare area A i on the reduced image, and determines whether or not the light source color of the flare generated in the flare area A i is white. To do. Details of the light source color determination processing will be described later. Here, “white” means a color that looks white when viewed from the human eye, and includes not only the color of a so-called white light source (wavelength spectrum is flat) but also a color close thereto.

ステップS97:フレア補正処理部21は、ステップS96で判定した光源色が白色であったか否かを判別し、非白色であった場合は、光源色復元処理を実行するべくステップS98へ移行し、白色であった場合は、光源色復元処理をスキップするべくステップS911へ移行する。   Step S97: The flare correction processing unit 21 determines whether or not the light source color determined in Step S96 is white. If the light source color is non-white, the flare correction processing unit 21 proceeds to Step S98 to execute the light source color restoration process, If YES, the process proceeds to step S911 to skip the light source color restoration process.

ステップS98:フレア補正処理部21は、縮小画像上の処理領域A’に関する光源色復元処理を実行することにより、復元後の処理領域A’(=復元画像imgC)を取得する。光源色復元処理の詳細は、後述する。 Step S98: The flare correction processing unit 21 acquires a restored processing area A i ′ (= restored image imgC) by executing a light source color restoration process for the processing area A i ′ on the reduced image. Details of the light source color restoration processing will be described later.

ステップS99:フレア補正処理部21は、復元画像imgCのサイズ拡大版(=復元画像IMGC)を作成する。復元画像IMGCの作成方法の詳細は、後述する。   Step S99: The flare correction processing unit 21 creates a size-enlarged version (= restored image IMGC) of the restored image imgC. Details of the method of creating the restored image IMGC will be described later.

ステップS910:フレア補正処理部21は、入力画像上で処理領域A’に対応する領域を復元画像IMGCに置換することにより、その領域における光源の色味を復元する。 Step S910: The flare correction processing unit 21 restores the color of the light source in the area by replacing the area corresponding to the processing area A i ′ on the input image with the restored image IMGC.

ステップS911:フレア補正処理部21は、フレア番号iが最終値に達したか否かを判別し、達していなかった場合はステップS912へ移行し、達していた場合はフレア補正処理のフローを終了する。   Step S911: The flare correction processing unit 21 determines whether or not the flare number i has reached the final value. If not, the process proceeds to step S912. If it has not, the flare correction processing flow ends. To do.

ステップS912:フレア補正処理部21は、フレア番号iをインクリメントしてからステップS92へ移行する。   Step S912: The flare correction processing unit 21 increments the flare number i, and then proceeds to step S92.

図4は、フレア色成分抽出処理のフローチャートである。以下、各ステップを順に説明する。   FIG. 4 is a flowchart of the flare color component extraction process. Hereinafter, each step will be described in order.

ステップS931:フレア補正処理部21は、フレア番号iに対応するフレア領域Aの平均値を色成分毎に(RGB別に)算出し、平均値が最小であった1つの色成分を、基準色成分に定める。以下、G成分が基準色成分に設定されたと仮定する。その場合、フレア色成分の推定は、G成分以外の色成分、すなわちR成分及びB成分の各々に関して行われる。 Step S931: The flare correction processing unit 21 calculates the average value of the flare area A i corresponding to the flare number i for each color component (for each RGB), and determines one color component having the minimum average value as the reference color. Determined by ingredients. Hereinafter, it is assumed that the G component is set as the reference color component. In this case, the flare color component is estimated for each color component other than the G component, that is, each of the R component and the B component.

ステップS932:フレア補正処理部21は、フレア番号iに対応した二値のマスク画像を作成する。二値のマスク画像は、図13に示すとおり、処理領域A’と同形同サイズのマスク画像であって、フレア領域Aに対応する領域に開口部を設けたものである。さらに、フレア補正処理部21は、その二値のマスク画像を、ガウシアンフィルタなどの平滑化フィルタで空間的に平滑化することにより、図14に示すようなグレースケールマスク画像を作成する。このグレースケールマスク画像は、二値のマスク画像において、開口部と非開口部との境界のコントラストを意図的に低下させたものに相当する。このグレースケールマスク画像の単位面積当たりの平均値は、処理領域A’の中央から周辺に向かって低下している。 Step S932: The flare correction processing unit 21 creates a binary mask image corresponding to the flare number i. As shown in FIG. 13, the binary mask image is a mask image having the same shape and size as the processing area A i ′, and an opening is provided in the area corresponding to the flare area A i . Further, the flare correction processing unit 21 creates a gray scale mask image as shown in FIG. 14 by spatially smoothing the binary mask image with a smoothing filter such as a Gaussian filter. This gray scale mask image corresponds to a binary mask image in which the contrast of the boundary between the opening and the non-opening is intentionally reduced. The average value per unit area of the gray scale mask image decreases from the center to the periphery of the processing area A i ′.

なお、本ステップで使用される平滑化フィルタのサイズ(フィルタ径)は、フレア領域Aのサイズが大きいときほど大きく設定されることが望ましい。 Note that the size of the smoothing filter (filter diameter) used in this step is desirably set larger as the flare area A i is larger.

ステップS933:フレア補正処理部21は、基準色成分(ここではG成分)以外の1つの色成分を着目色成分に設定する。以下、R成分が着目色成分に設定されたと仮定する。図15は、或る処理領域A’のR成分と、同じ処理領域A’のG成分との関係を示す図(画素プロファイル)である。図15に示すとおり、R成分においては、フレア領域Aの内側かつ飽和領域Sの外側の領域に、フレア色成分が重畳されている。つまり、その領域のR成分は、同じ領域のG成分と比較して著しく高い値となっている。 Step S933: The flare correction processing unit 21 sets one color component other than the reference color component (here, the G component) as the target color component. Hereinafter, it is assumed that the R component is set as the target color component. FIG. 15 is a diagram (pixel profile) showing the relationship between the R component of a certain processing area A i ′ and the G component of the same processing area A i ′. As shown in FIG. 15, in the R component, a flare color component is superimposed on a region inside the flare region A i and outside the saturation region S i . That is, the R component in that region is significantly higher than the G component in the same region.

本ステップのフレア補正処理部21は、処理領域A’のR成分を処理領域A’のG成分で画素毎に除算することにより、G成分を基準としたR成分の相関色分布画像IGRを作成する。図16(A)の左側に示すのは、相関色分布画像IGRの模式図である。 Flare correction processing section 21 of this step, the processing area A i by dividing each pixel in the G component of the 'R component processing area A i of' correlated color of R component based on the G component distribution image I Create a GR . A schematic diagram of the correlated color distribution image IGR is shown on the left side of FIG.

ここで、相関色分布画像IGRの中央領域aの多くの画素は、1に近い画素値を有しており、中央領域aの周辺に位置するリング状領域bの多くの画素は、1よりも高い画素値を有しており、リング状領域bの外側に位置する最周辺領域cの多くの画素は、リング状領域bよりも低い画素値を有している。このうち、中央領域aは、図15に示した飽和領域Sに対応しており、リング状領域bは、図15に示したフレア領域Aの内側かつ飽和領域Sの外側の領域、すなわち、フレア色成分の重畳された領域に対応している。 Here, many pixels in the central region a of the correlated color distribution image IGR have pixel values close to 1, and many pixels in the ring-shaped region b located around the central region a are more than 1. And many pixels in the outermost peripheral region c located outside the ring-shaped region b have lower pixel values than the ring-shaped region b. Among these, the central region a corresponds to the saturation region S i shown in FIG. 15, and the ring-shaped region b is a region inside the flare region A i and outside the saturation region S i shown in FIG. That is, it corresponds to a region where flare color components are superimposed.

ステップS934:フレア補正処理部21は、相関色分布画像IGRのうち、周辺と比較して値の低い領域(中央領域a及び最周辺領域c)のみを平滑化することにより、図16(B)に示すような相関色分布画像IGR”を取得する。なお、相関色分布画像IGR”の取得は、図16(A)→図16(B)に示す手順によって行うことができる。 Step S934: The flare correction processing unit 21 smoothes only the regions (the central region a and the most peripheral region c) whose values are lower than those of the surroundings in the correlated color distribution image IGR . "acquired. in addition, the correlated color distribution image I GR" correlated color distribution image I GR as shown in) acquisition of it can be carried out according to the procedure shown in FIG. 16 (a) → FIG 16 (B).

すなわち、フレア補正処理部21は、先ず、図16(A)の左側に示した相関色分布画像IGRの全体を、ガウシアンフィルタなどの平滑化フィルタで空間的に平滑化することにより、図16(A)の右側に示すような相関色分布画像IGR’を取得する。この平滑化によると、周辺と比較して値の低い領域の値は、平滑化前よりも高めになり、周辺と比較して値の高い領域の値は、平滑化前よりも低めになる。続いて、フレア補正処理部21は、平滑化前後の2つの相関色分布画像IGR、IGR’を画素毎に比較し、値の高かった方の画素を集めて1枚の合成画像を作成し、その合成画像を相関色分布画像IGR”とする(図16(B))。この相関色分布画像IGR”は、元の相関色分布画像IGRにおいて、フレア色成分の重畳されていなかった領域(点線枠部分)のみを平滑化したものに相当する。 That is, the flare correction processing unit 21 first spatially smoothes the entire correlated color distribution image IGR shown on the left side of FIG. 16A with a smoothing filter such as a Gaussian filter. A correlated color distribution image I GR ′ as shown on the right side of (A) is acquired. According to this smoothing, the value of the region having a low value compared to the surroundings is higher than that before the smoothing, and the value of the region having a high value compared to the surroundings is lower than that before the smoothing. Subsequently, the flare correction processing unit 21 compares the two correlated color distribution images I GR and I GR ′ before and after smoothing for each pixel, and collects the pixels with the higher value to create one composite image. Then, the synthesized image is set as a correlated color distribution image I GR ″ (FIG. 16B). This correlated color distribution image I GR ″ has a flare color component superimposed on the original correlated color distribution image I GR . This corresponds to a smoothed area (dotted line frame portion) that did not exist.

ステップS1835:フレア補正処理部21は、相関色分布画像IGR”に対して最小値フィルタ等による収縮処理を施すことにより、相関色分布画像IGR”において周辺と比較して値の高い領域の面積を収縮し、図16(C)に示すような相関色分布画像Iを取得する。さらに、フレア補正処理部21は、相関色分布画像Iをガウシアンフィルタなどの平滑化フィルタで空間的に平滑化することにより、図16(D)に示すような相関色分布画像I’を取得する。この相関色分布画像I’は、元の相関色分布画像IGRにおいてフレア色成分の重畳されていた領域を周辺の領域(点線枠部分)によって補間したものに相当する。 Step S1835: flare correction processing section 21 "by performing contraction processing by the minimum value filter or the like to the correlated color distribution image I GR" correlated color distribution image I GR values of a region of high compared to around the the area contracts, acquires the correlated color distribution image I H as shown in FIG. 16 (C). Furthermore, the flare correction processing unit 21 spatially smoothes the correlated color distribution image I H with a smoothing filter such as a Gaussian filter, thereby generating a correlated color distribution image I H ′ as shown in FIG. get. This correlated color distribution image I H ′ corresponds to an image obtained by interpolating the area where the flare color component is superimposed in the original correlated color distribution image I GR with the surrounding area (dotted line frame portion).

ステップS936:フレア補正処理部21は、処理領域A’の基準色成分(ここではG成分)に対して相関色分布画像I’を画素毎に乗算することにより、フレア色成分の除去されたR成分IRnewを算出する。これによって、処理領域A’からR成分に関するフレア色成分が除去されたことになる。なお、図17は、除去後の処理領域A’の画素プロファイルである。 Step S936: The flare correction processing unit 21 removes the flare color component by multiplying the reference color component (G component in this case) of the processing region A i ′ by the correlated color distribution image I H ′ for each pixel. R component I Rnew is calculated. As a result, the flare color component related to the R component is removed from the processing area A i ′. FIG. 17 is a pixel profile of the processing area A i ′ after removal.

この図17を図15と比較すれば明らかなとおり、除去後には、フレア色成分の重畳されていた領域(フレア領域Aの内側かつ飽和領域Sの外側の領域)のR強度は、同じ領域のG強度に近づけられているのがわかる。また、除去後には、フレア色成分の重畳されていた領域のR/G強度は、フレア領域Aの外側の領域のR/G強度と、飽和領域Sの内側のR/G強度とによって補間されているのがわかる。また、除去後には、フレア色成分の重畳されていた領域のR強度分布形状は、同じ領域のG強度分布形状に対応した形状となっているのがわかる。 As apparent from a comparison of FIG. 17 with FIG. 15, after removal, the R intensity of the region where the flare color component is superimposed (the region inside the flare region A i and outside the saturation region S i ) is the same. It can be seen that it is close to the G intensity of the region. After the removal, the R / G intensity of the area where the flare color component is superimposed is determined by the R / G intensity of the area outside the flare area A i and the R / G intensity inside the saturation area S i . You can see that it is interpolated. Further, after the removal, it can be seen that the R intensity distribution shape of the region where the flare color component is superimposed is a shape corresponding to the G intensity distribution shape of the same region.

なお、本ステップのフレア補正処理部21は、フレア色成分の除去されたR成分IRnewを、元のR成分から差し引くことにより、R成分に関するフレア色成分IFRを算出しておく(フレア色成分の除去されたR成分IRnewを、フレア色成分IFRに換算しておく。)。なぜなら、本実施形態では、最終画像を算出する前に、フレア色成分IFRに対して幾つかの処理(マスク処理やサイズ拡大処理など)を施す必要があるからである。 The flare correction processing unit 21 in this step calculates the flare color component I FR related to the R component by subtracting the R component I Rnew from which the flare color component has been removed from the original R component (flare color). The R component I Rnew from which the component has been removed is converted into a flare color component I FR .) This is because in this embodiment, it is necessary to perform some processing (mask processing, size enlargement processing, etc.) on the flare color component I FR before calculating the final image.

ステップS937:フレア補正処理部21は、ステップS936で取得したフレア色成分IFRに対してステップS932で作成したグレースケールマスクを適用することにより、フレア色成分IFRの周辺部をぼかす。このように周辺部をぼかしておけば、処理領域A’のR成分からフレア色成分IFRを除去(減算)した際に、処理領域A’に不自然な階調段差が発生することを防げるからである。また、上述したとおり、グレースケールマスクの作成時に使用された平滑化フィルタのサイズは、フレア領域Aのサイズに応じたサイズに設定されたので、マスク適用後のフレア色成分IFRの周辺部は、より自然なものとなる。これによって、R成分に関するフレア色成分IFRの推定は、完了である。 Step S937: The flare correction processing unit 21 blurs the peripheral portion of the flare color component I FR by applying the grayscale mask created in Step S932 to the flare color component I FR acquired in Step S936. If blurring in this way the peripheral portion, 'upon removal of the flare color component I FR from R components (subtraction) processing area A i' processing area A i an unnatural gradation level difference is generated in the It is because it can prevent. Further, as described above, the size of the smoothing filter used at the time of creating the grayscale mask is set to a size according to the size of the flare area A i , so that the peripheral portion of the flare color component I FR after applying the mask Will be more natural. Thereby, the estimation of the flare color component I FR regarding the R component is completed.

ステップS938:フレア補正処理部21は、基準色成分以外の全ての色成分(ここではR成分、B成分)に関する推定が完了したか否かを判別し、完了していなければ未推定である色成分の推定を行うべくステップS933へ移行し、完了していればフレア色成分抽出処理のフローを終了する。なお、ここでは、R成分に関する推定しか説明しなかったが、B成分に関する推定は、R成分に関する推定と同様なので、説明を省略する。   Step S938: The flare correction processing unit 21 determines whether or not the estimation for all the color components (here, the R component and the B component) other than the reference color component has been completed. The process proceeds to step S933 to estimate the components, and if completed, the flow of the flare color component extraction process is terminated. Here, only the estimation regarding the R component has been described, but the estimation regarding the B component is the same as the estimation regarding the R component, and thus the description thereof is omitted.

図5は、光源色判定処理のフローチャートである。以下、各ステップを順に説明する。   FIG. 5 is a flowchart of the light source color determination process. Hereinafter, each step will be described in order.

ステップS961:フレア補正処理部21は、縮小画像上のフレア領域Aに着目し、そのフレア領域Aから飽和領域Sを除外してなるリング状領域(図11の斜線部)を、参照領域Rに設定する。 Step S961: The flare correction processing unit 21 pays attention to the flare area A i on the reduced image, and refers to the ring-shaped area (hatched portion in FIG. 11) formed by excluding the saturation area S i from the flare area A i . Set to region R i .

ステップS962:フレア補正処理部21は、参照領域Rの平均色が無彩色(又は無彩色相当)であるか否かを判別し、無彩色(又は無彩色相当)でない場合には、ステップS963へ移行し、無彩色(又は無彩色相当)である場合には、ステップS966へ移行する。 Step S962: If the flare correction processing section 21, the average color of the reference area R i is determined whether or not the achromatic (or achromatic equivalent), non-achromatic (or achromatic equivalent), the step S963 If it is an achromatic color (or an achromatic color equivalent), the process proceeds to step S966.

ステップS963:フレア補正処理部21は、参照領域Rの平均色が撮影光学系の固有フレア色であるか否かを、所定の閾範囲内に収まるか否かによって判別し、固有フレア色である場合にはステップS964へ移行し、固有フレア色でない場合にはステップS963へ移行する。以下、固有フレア色を詳しく説明する。 Step S963: The flare correction processing unit 21 determines whether or not the average color of the reference region R i is a specific flare color of the photographing optical system depending on whether or not it falls within a predetermined threshold range. If there is, the process proceeds to step S964, and if it is not the intrinsic flare color, the process proceeds to step S963. Hereinafter, the specific flare color will be described in detail.

撮影光学系の中には、赤色のフレアを発生させ易いものや、青色のフレアを発生させ易いものや、紫色のフレアを発生させ易いものなどが存在するので、ここでは、或る撮影光学系が最も高頻度に発生させるフレアの色を、その撮影光学系の「固有フレア色」と称している。この固有フレア色は、撮影光学系に含まれるDOEの種類(つまり撮影光学系の種類)によって決まる。なぜなら、DOEの白色光に対する応答特性は、撮影画像上に発生するフレアの波長スペクトルが予め決められた波長域にピーク(高強度)を持つように設定されている。或いは、DOEの白色光に対する応答特性は、撮影画像上に発生するフレアの波長スペクトルが予め決められた波長域にピーク(高強度)を持ち易いように設定されている。   Among photographing optical systems, there are those that easily generate red flare, those that easily generate blue flare, and those that easily generate purple flare. The color of flare that occurs most frequently is called the “specific flare color” of the photographing optical system. This inherent flare color is determined by the type of DOE included in the photographing optical system (that is, the kind of photographing optical system). This is because the response characteristic of the DOE to white light is set so that the wavelength spectrum of the flare generated on the captured image has a peak (high intensity) in a predetermined wavelength range. Alternatively, the response characteristic of the DOE to white light is set so that the wavelength spectrum of the flare generated on the captured image easily has a peak (high intensity) in a predetermined wavelength range.

なお、固有フレア色は撮影光学系の種類によって異なるため、本ステップのフレア補正処理部21は、固有フレア色の閾値範囲を撮影光学系の種類に応じて設定する。   Since the inherent flare color varies depending on the type of the photographing optical system, the flare correction processing unit 21 in this step sets the threshold range of the inherent flare color according to the type of the photographing optical system.

ステップS964:フレア補正処理部21は、参照領域Rの平均色の彩度が閾値以上であるか否かを判別し、閾値以上である場合は、ステップS965へ移行し、閾値未満である場合は、ステップS966へ移行する。なお、本ステップのフレア補正処理部21は、本ステップの彩度の閾値をステップS2における彩度強調処理の強度に応じて設定する。 Step S964: The flare correction processing unit 21 determines whether or not the saturation of the average color of the reference region R i is equal to or greater than the threshold value. If the saturation is equal to or greater than the threshold value, the process proceeds to step S965. Proceeds to step S966. Note that the flare correction processing unit 21 in this step sets the saturation threshold value in this step according to the intensity of the saturation enhancement processing in step S2.

なお、本ステップにおけるフレア補正処理部21は、参照領域Rの平均色の彩度が閾値以上であるか否かを判別する代わりに、色補正済みの画素(色補正画素)が参照領域Rの中に存在するか否かを判別してもよい。以下、色補正画素を説明する。 Note that the flare correction processing unit 21 in this step does not determine whether the average color saturation of the reference region R i is equal to or greater than the threshold value, but the color-corrected pixel (color correction pixel) is the reference region R. It may be determined whether or not it exists in i . Hereinafter, the color correction pixel will be described.

図18(A)は、彩度強調前の或る処理領域A’の画素プロファイル(中心線上の画素プロファイル)であり、図18(B)は、彩度強調後の同じ処理領域A’の画素プロファイルである。この処理領域A’に施された彩度強調は、G成分及びB成分をR成分に比して相対的に強調するための彩度強調である。 18A shows a pixel profile (pixel profile on the center line) of a certain processing area A i ′ before saturation enhancement, and FIG. 18B shows the same processing area A i ′ after saturation enhancement. This is a pixel profile. The saturation enhancement applied to the processing area A i ′ is saturation enhancement for enhancing the G component and the B component relative to the R component.

図18(A)に示すとおり、彩度強調前の処理領域A’には、全色成分がノイズレベルT1以上となった画素しか存在していないのに対し、図18(B)に示すとおり、彩度強調後の処理領域A’には、R成分がノイズレベルT1未満となった画素が発生している。しかも、そのような画素の少なくとも一部の画素は、G成分とB成分との少なくとも一方が飽和レベルT2に達している。このように、少なくとも1つの色成分が飽和レベルT2に達しており、かつ他の少なくとも1つの色成分がノイズレベルT1未満となっているような画素が、色補正画素である。このような色補正画素が発生するのは、参照領域Rである。 As shown in FIG. 18A, in the processing area A i ′ before saturation enhancement, there are only pixels in which all color components are equal to or higher than the noise level T1, whereas FIG. As described above, pixels in which the R component is less than the noise level T1 are generated in the processing region A i ′ after saturation enhancement. In addition, in at least some of the pixels, at least one of the G component and the B component reaches the saturation level T2. Thus, a pixel in which at least one color component has reached the saturation level T2 and the other at least one color component is less than the noise level T1 is a color correction pixel. This kind of color correction pixel is generated, a reference area R i.

ステップS965:フレア補正処理部21は、処理領域A’に発生しているフレアの光源色は非白色であったと判定し、光源色判定処理のフローを終了する。 Step S965: The flare correction processing unit 21 determines that the light source color of the flare generated in the processing area A i ′ is non-white, and ends the flow of the light source color determination process.

ステップS966:フレア補正処理部21は、処理領域A’に発生しているフレアの光源色は白色であったと判定し、光源色判定処理のフローを終了する。 Step S966: The flare correction processing unit 21 determines that the light source color of the flare generated in the processing area A i ′ is white, and ends the light source color determination processing flow.

図6は、光源色復元処理のフローチャートである。以下、各ステップを順に説明する。   FIG. 6 is a flowchart of the light source color restoration process. Hereinafter, each step will be described in order.

ステップS981:フレア補正処理部21は、ステップS932で作成したものと同様のグレースケールマスク画像(図19参照)を取得する。   Step S981: The flare correction processing unit 21 acquires the same grayscale mask image (see FIG. 19) as that created in Step S932.

次に、フレア補正処理部21は、このグレースケールマスク画像に対して正の所定値を乗算することにより、グレースケールマスク画像の画素値を向上させる。但し、フレア補正処理部21は、乗算によって1を超過した画素値については1に置換することで、グレースケールマスク画像の画素値を0から1の範囲内に収める。その結果、グレースケールマスク画像の開口部の面積が拡大される(図20参照)。拡大前におけるグレースケールマスク画像のプロファイル(開口率分布)は、図21の点線で示すとおりであって、拡大後におけるグレースケールマスク画像のプロファイル(開口率分布)は、図21の実線で示すとおりである。図21に示すとおり、拡大後におけるグレースケールマスク画像の開口部は、フレア領域Aとほぼ一致している。以下、拡大後におけるグレースケールマスク画像を、「グレースケールマスク画像imgF」とおく。このグレースケールマスク画像imgFは、後述する重み付け合成(ステップS984)の重み分布として使用される。 Next, the flare correction processing unit 21 multiplies the grayscale mask image by a positive predetermined value to improve the pixel value of the grayscale mask image. However, the flare correction processing unit 21 replaces the pixel value exceeding 1 by multiplication with 1, thereby keeping the pixel value of the grayscale mask image within the range of 0 to 1. As a result, the area of the opening of the gray scale mask image is enlarged (see FIG. 20). The profile (aperture ratio distribution) of the grayscale mask image before enlargement is as shown by the dotted line in FIG. 21, and the profile (aperture ratio distribution) of the grayscale mask image after enlargement is as shown by the solid line in FIG. It is. As shown in FIG. 21, the openings of the gray scale mask image after enlargement is substantially coincident with the flare region A i. Hereinafter, the enlarged grayscale mask image is referred to as “grayscale mask image imgF”. This grayscale mask image imgF is used as a weight distribution of weighting synthesis (step S984) described later.

ステップS982:フレア補正処理部21は、フレア除去前の縮小画像imgAを用意する。フレア除去前の縮小画像imgAとは、縮小画像上の処理領域A’のことである。 Step S982: The flare correction processing unit 21 prepares a reduced image imgA before flare removal. The reduced image imgA before the flare removal is a processing area A i ′ on the reduced image.

ステップS983:フレア補正処理部21は、フレア除去前の縮小画像imgAからサイズ拡大前のフレア色成分を減算することにより、フレア除去後の縮小画像imgBを用意する(図22(a))。サイズ拡大前のフレア色成分とは、ステップS93において取得されたフレア色成分のことである。   Step S983: The flare correction processing unit 21 prepares a reduced image imgB after flare removal by subtracting the flare color component before size enlargement from the reduced image imgA before flare removal (FIG. 22A). The flare color component before size expansion is the flare color component acquired in step S93.

ステップS984:フレア補正処理部21は、フレア除去前の縮小画像imgAと、フレア除去後の縮小画像imgBとを重み付け合成することにより、光源の色味の復元された復元画像imgCを取得すると(図22(b))、光源色復元処理のフローを終了する。   Step S984: The flare correction processing unit 21 obtains a restored image imgC in which the color of the light source is restored by weighted synthesis of the reduced image imgA before flare removal and the reduced image imgB after flare removal (see FIG. 22 (b)), the flow of the light source color restoration process is terminated.

ここで、本ステップにおける重み付け合成の重みは、画像上の位置毎(画素毎)に設定される。そして、縮小画像imgAの重み分布は、ステップS981で作成されたグレースケールマスク画像imgFの画素値分布と同じに設定される。つまり、本ステップの重み付け合成は、以下の式によって行われる。   Here, the weight of the weighted synthesis in this step is set for each position (for each pixel) on the image. The weight distribution of the reduced image imgA is set to be the same as the pixel value distribution of the grayscale mask image imgF created in step S981. That is, the weighted synthesis in this step is performed by the following equation.

なお、式(1)における(x,y)は、画素座標であり、r,g,bは、画素値のR成分、G成分、B成分である。   In Expression (1), (x, y) is pixel coordinates, and r, g, and b are R, G, and B components of the pixel value.

したがって、本ステップで取得される復元画像imgCにおいて、フレア領域に対応する中央領域は、フレア除去前の縮小画像Aと同じ値を採り、フレア領域外に対応する周辺領域は、フレア除去後の縮小画像Bに近い値を採る。しかも、その周辺領域では、中央領域から離れるほど、フレア除去後の縮小画像Bが強く反映されている。   Therefore, in the restored image imgC acquired in this step, the central area corresponding to the flare area takes the same value as the reduced image A before flare removal, and the peripheral area corresponding to the outside of the flare area is reduced after flare removal. A value close to the image B is taken. Moreover, in the peripheral area, the reduced image B after flare removal is more strongly reflected as the distance from the central area increases.

すなわち、復元画像imgCの中央領域では、光源の色味が復元され、周辺領域では、フレアの色付きが除去されている。しかも、その周辺領域では、中央部領域から離れるほど除去の程度が高くなっている。   That is, the color of the light source is restored in the central area of the restored image imgC, and the flare coloring is removed in the peripheral area. In addition, in the peripheral area, the degree of removal increases as the distance from the central area increases.

但し、この復元画像imgCのサイズは小さいので、続くステップ99では、復元画像imgCのサイズ拡大版(=復元画像IMGC)を作成する必要がある。   However, since the size of the restored image imgC is small, it is necessary to create a size-enlarged version (= restored image IMGC) of the restored image imgC in the subsequent step 99.

以下、ステップS99を詳細に説明する。ステップS99は、以下の手順(i)〜(iv)からなる。   Hereinafter, step S99 will be described in detail. Step S99 includes the following procedures (i) to (iv).

(i)フレア補正処理部21は、図22(c)に示すとおり、フレア除去前の縮小画像imgAから、復元画像imgCを減算することにより、修正フレア色成分imgDを求める。この修正フレア色成分imgDは、真のフレア色成分を表す。すなわち、この修正フレア色成分imgDは、フレア色成分から光源の色味成分を除去したものを表す。   (I) The flare correction processing unit 21 obtains a corrected flare color component imgD by subtracting the restored image imgC from the reduced image imgA before flare removal, as shown in FIG. The corrected flare color component imgD represents a true flare color component. That is, the corrected flare color component imgD represents the flare color component obtained by removing the color component of the light source.

(ii)フレア補正処理部21は、図22(d)に示すとおり、修正フレア色成分imgDに対してサイズ拡大処理を施すことにより、サイズ拡大後の修正フレア色成分IMGDを作成する。なお、前述したステップS4におけるサイズ比を1/Mとした場合、本ステップにおけるサイズ拡大処理では修正フレア色成分imgDのサイズをM倍にする。   (Ii) The flare correction processing unit 21 creates a corrected flare color component IMGD after size expansion by performing size expansion processing on the corrected flare color component imgD as shown in FIG. If the size ratio in step S4 is 1 / M, the size of the corrected flare color component imgD is increased M times in the size enlargement process in this step.

(iii)フレア補正処理部21は、図22(e)に示すとおり、フレア除去前の非縮小画像IMGAを用意する。フレア除去前の非縮小画像IMGAは、入力画像上で処理領域A’に対応する領域と同じものである。 (Iii) The flare correction processing unit 21 prepares an unreduced image IMGA before flare removal, as shown in FIG. The unreduced image IMGA before flare removal is the same as the region corresponding to the processing region A i ′ on the input image.

(iv)フレア補正処理部21は、図22(f)に示すとおり、フレア除去前の非縮小画像IMGAから、サイズ拡大後の修正フレア色成分IMGDを減算することにより、サイズ拡大後の復元画像IMGCを取得する(以上、ステップS99の説明。)。   (Iv) The flare correction processing unit 21 subtracts the corrected flare color component IMGD after size enlargement from the non-reduced image IMGA before flare removal as shown in FIG. IMGC is acquired (the description of step S99 above).

[第1実施形態の効果]
以上、本実施形態の画像処理プログラムは、撮影光学系により取得されたカラーの処理対象画像を入力する入力手順(S1)と、処理対象画像におけるフレアの発生領域(A)の色に基づきフレアの光源色が白色であったか否かを判別する判別手順(S96、S97)と、発生領域に対してフレア補正処理を施すフレア補正手順(S93、S94、S95、S98、S99、S910)とを含み、フレア補正手順では、判別手順による判別の結果に応じてフレア補正処理の内容を切り換える。
[Effect of the first embodiment]
As described above, the image processing program according to the present embodiment performs the flare based on the input procedure (S1) for inputting the color processing target image acquired by the photographing optical system and the color of the flare occurrence area (A i ) in the processing target image. And a determination procedure (S96, S97) for determining whether or not the light source color is white, and a flare correction procedure (S93, S94, S95, S98, S99, S910) for performing a flare correction process on the generated region. In the flare correction procedure, the content of the flare correction process is switched in accordance with the result of determination by the determination procedure.

したがって、本実施形態の画像処理プログラムによれば、光源色が白色であるか否かに拘らず適切なフレア補正処理を実行することができる。   Therefore, according to the image processing program of the present embodiment, an appropriate flare correction process can be executed regardless of whether the light source color is white.

また、本実施形態の判別手順では、撮影光学系の種類、発生領域の彩度の少なくとも一方に基づき判別を行う(S963、S964)。また、本実施形態の判別手順では、処理対象画像が色補正後の画像である場合には、発生領域の彩度に基づく代わりに、発生領域に色補正画素が存在するか否かに基づき判別を行う(S964)。よって、判別の精度は高い。   In the determination procedure of the present embodiment, determination is performed based on at least one of the type of the photographing optical system and the saturation of the generated region (S963, S964). Further, in the determination procedure of the present embodiment, when the processing target image is an image after color correction, the determination is based on whether or not a color correction pixel exists in the generation area instead of based on the saturation of the generation area. Is performed (S964). Therefore, the discrimination accuracy is high.

また、本実施形態の判別手順では、処理対象画像上の飽和画素領域(S)を包含する円形領域を発生領域(A)とみなす(S92)。また、本実施形態の判別手段では、飽和画素領域のサイズに基づき発生領域のサイズを推定する(S92)。よって、フレアの発生領域は、高精度に検知される。 In the determination procedure of the present embodiment, a circular area including the saturated pixel area (S i ) on the processing target image is regarded as the generation area (A i ) (S 92). Further, the discrimination means of the present embodiment estimates the size of the generated area based on the size of the saturated pixel area (S92). Therefore, the flare generation area is detected with high accuracy.

また、本実施形態の判別手順では、発生領域から飽和画素領域を除外した領域(R)のみを判別に使用する(S961)。よって、判別の効率は高い。 In the determination procedure of the present embodiment, only the region (R i ) excluding the saturated pixel region from the generation region is used for determination (S961). Therefore, the discrimination efficiency is high.

また、本実施形態のフレア補正手順は、発生領域を包含する処理領域(A’)を処理対象画像上に設定する領域設定手順(S92)と、フレアの色付きを除去する除去処理を処理領域へ施す除去手順(S93、S94、S95)と、フレアの光源色が非白色であった場合には、フレアの光源に固有の色を発生領域に復元させる復元処理を、除去処理後の処理領域へ施す復元手順(S98、S99、S910)とを含む。よって、光源色が非白色であった場合には、フレアの光源の色味が復元される。 Further, the flare correction procedure of the present embodiment includes an area setting procedure (S92) for setting a processing area (A i ′) including an occurrence area on a processing target image, and a removal process for removing flare coloring. The removal procedure (S93, S94, S95) to be applied to and the restoration process for restoring the color unique to the flare light source to the generation area when the flare light source color is non-white, the processing area after the removal process Restoration procedure (S98, S99, S910). Therefore, when the light source color is non-white, the color of the flare light source is restored.

また、本実施形態の復元処理は、除去処理後の処理領域に対して除去処理前の処理領域を重み付け合成する処理である(S981、S982、S983、S984)。よって、光源固有の色を簡単に復元することができる。   In addition, the restoration process of the present embodiment is a process of weighting and combining the process area before the removal process with respect to the process area after the removal process (S981, S982, S983, S984). Therefore, the color unique to the light source can be easily restored.

また、本実施形態の画像処理プログラムでは、除去処理後の重みに対する除去処理後の重みの比は、処理領域の位置毎に設定される。よって、復元をきめ細かに行うことができる。   In the image processing program of this embodiment, the ratio of the weight after the removal process to the weight after the removal process is set for each position of the processing region. Therefore, the restoration can be performed finely.

また、本実施形態の画像処理プログラムでは、発生領域に近い位置の比よりも、発生領域から離れた位置の比の方が小さい。よって、復元後の処理領域に不自然な階調段差が現れるのを防ぐことができる。   In the image processing program according to the present embodiment, the ratio of the position away from the generation area is smaller than the ratio of the position close to the generation area. Therefore, it is possible to prevent an unnatural gradation step from appearing in the processing area after restoration.

また、本実施形態の除去手順は、発生領域の各色成分の中で基準となる基準色成分を設定する基準色設定手順(S931)と、処理領域における基準色成分と着目色成分との間の相関を示す相関情報を算出する相関算出手順(S933)と、フレアの色付き分布であるフレア色成分を、処理領域の相関情報と発生領域の基準色成分とに基づき推定するフレア色成分推定手順(S936)とを含む。よって、本実施形態の除去手順は、フレアの色付きを確実に除去するものの、フレアの光源の色味も一緒に除去する可能性がある。したがって、本実施形態の除去手順に本実施形態の復元手順を組み合わせることの効果は高い。   Further, the removal procedure of the present embodiment includes a reference color setting procedure (S931) for setting a reference color component as a reference among the color components in the generation region, and a reference color component between the reference color component and the target color component in the processing region. Correlation calculation procedure for calculating correlation information indicating correlation (S933), and flare color component estimation procedure for estimating the flare color component that is a colored distribution of flare based on the correlation information of the processing region and the reference color component of the generation region ( S936). Therefore, although the removal procedure of the present embodiment reliably removes the flare coloring, there is a possibility that the color of the light source of the flare is also removed. Therefore, the effect of combining the restoration procedure of this embodiment with the removal procedure of this embodiment is high.

[第1実施形態の補足]
なお、本実施形態では、フレア補正処理以外の現像処理として、色補間処理及び彩度強調処理を実行したが、彩度強調処理については省略しても構わない。但し、彩度強調処理を省略した場合は、ステップS964において、参照領域Rの彩度の高さを判別する代わりに色補正済みの画像(色補正画素)の有無を判別する、という代替手法を採用することはできない。
[Supplement to the first embodiment]
In the present embodiment, the color interpolation process and the saturation enhancement process are executed as the development process other than the flare correction process, but the saturation enhancement process may be omitted. However, if you omit the saturation enhancement processing, in step S 964, it is determined whether the color corrected image (color correction pixels), instead of determining the saturation of the height of the reference region R i, that alternate approaches Cannot be adopted.

また、本実施形態では、現像処理前の画像(RAW画像)を入力画像としたが、現像処理後の画像(JPEG画像等)を入力画像としても構わない。この場合、彩度強調処理等の色補正処理が入力画像に対して実行済みであったならば、ステップS964において、参照領域Rの彩度の高さを判別する代わりに色補正済みの画素(色補正画素)の有無を判別する、という代替手法を採用することができる。 In this embodiment, an image before development processing (RAW image) is an input image, but an image after development processing (JPEG image or the like) may be used as an input image. In this case, if color correction processing such as saturation enhancement processing has already been performed on the input image, in step S964, instead of determining the saturation level of the reference region R i , the color corrected pixel An alternative method of determining the presence or absence of (color correction pixels) can be employed.

また、上述したステップS92の手順(D)では、飽和領域Sの半径rに所定値αを乗算したものをフレア領域Aの半径とみなしたが、飽和領域Sの半径rに所定値σを加えたものをフレア領域Aの半径とみなしてもよい。 Further, in step (D) in step S92 described above, but those obtained by multiplying a predetermined value α to radius r i of the saturation region S i regarded as the radius of the flared region A i, the radius r i of the saturation region S i What added the predetermined value σ may be regarded as the radius of the flare area A i .

また、本実施形態のフレア補正処理部21は、フレア色成分の推定を基準色成分以外の2つの色成分の各々について行ったが、2つの色成分のうち一方の色成分に関する推定を省略してもよい。G成分が基準色成分であると仮定したならば、例えば、フレア領域AにおけるG成分の平均値とB成分の平均値との差が所定範囲内であった場合、つまり、G成分とB成分とに差異が無かった場合には、B成分に関する推定を省略してもよい。 In addition, the flare correction processing unit 21 of the present embodiment performs the estimation of the flare color component for each of the two color components other than the reference color component, but omits the estimation for one of the two color components. May be. Assuming that the G component is the reference color component, for example, when the difference between the average value of the G component and the average value of the B component in the flare area A i is within a predetermined range, that is, the G component and the B component. If there is no difference from the component, estimation regarding the B component may be omitted.

また、本実施形態のフレア補正処理部21は、基準色成分を自動的に設定したが、ユーザに指定させてもよい。   Further, although the flare correction processing unit 21 of the present embodiment automatically sets the reference color component, it may be specified by the user.

また、本実施形態の現像処理では、演算負荷を軽減するために、入力画像をそのまま使用する代わりに入力画像のサイズ縮小版(縮小画像)を使用したが、演算負荷の軽減よりも精度向上を優先させたい場合には、入力画像をそのまま使用してもよい。   In the development processing of this embodiment, in order to reduce the calculation load, a reduced size version of the input image (reduced image) is used instead of using the input image as it is. If priority is to be given, the input image may be used as it is.

また、本実施形態の現像処理では、入力画像におけるフレアの発生位置をCPU14が自動的に検出したが、ユーザに指定させてもよい。   In the development processing of the present embodiment, the CPU 14 automatically detects the flare occurrence position in the input image, but the user may designate it.

また、本実施形態の現像処理では、フレア領域AをCPU14が自動的に検出したが、ユーザに指定させてもよい。 Further, in the developing process of the present embodiment, although the flare region A i CPU 14 detects automatically, it may be specified by the user.

また、本実施形態の現像処理では、処理領域A’をCPU14が自動的に設定したが、ユーザに設定させてもよい。 In the development processing of this embodiment, the processing area A i ′ is automatically set by the CPU 14, but may be set by the user.

また、本実施形態のフレア補正処理部21は、フレア領域Aのフレア色成分を、処理領域Aにおける基準色成分と着目色成分との間の相関と、フレア領域Aの基準色成分とに基づき推定したが、フレア領域Aの色分布に基づく他の手法により推定しても構わない。 Also, flare correction processing unit 21 of the present embodiment, the correlation with the reference color component of the flare region A i between the flare color component of the flare area A i, a reference color component in the processing area A i and target color component However, it may be estimated by another method based on the color distribution of the flare area A i .

[第2実施形態]
以下、本実施形態の第2実施形態を説明する。
[Second Embodiment]
Hereinafter, a second embodiment of the present embodiment will be described.

図23は、電子カメラの概略構成を示すブロック図である。図23に示すとおり、電子カメラ111は、撮像光学系112と、レンズ駆動部113と、絞り114と、絞り駆動部115と、カラー撮像素子116と、AFE117と、画像処理エンジン118と、第1メモリ119と、第2メモリ120と、メディアI/F121と、通信I/F122と、モニタ123と、レリーズ釦124とを有しており、この中でレンズ駆動部113、絞り駆動部115、AFE117、第1メモリ119、第2メモリ120、メディアI/F121、通信I/F122、モニタ123、レリーズ釦124の各々は、画像処理エンジン118に接続されている。また、撮影光学系112は、例えば、DOEレンズを含んだ高機能な撮影光学系である。   FIG. 23 is a block diagram illustrating a schematic configuration of the electronic camera. As shown in FIG. 23, the electronic camera 111 includes an imaging optical system 112, a lens driving unit 113, a diaphragm 114, a diaphragm driving unit 115, a color imaging element 116, an AFE 117, an image processing engine 118, and a first. It has a memory 119, a second memory 120, a media I / F 121, a communication I / F 122, a monitor 123, and a release button 124. Among these, a lens driving unit 113, an aperture driving unit 115, and an AFE 117 are provided. The first memory 119, the second memory 120, the media I / F 121, the communication I / F 122, the monitor 123, and the release button 124 are each connected to the image processing engine 118. The photographing optical system 112 is a high-functional photographing optical system including a DOE lens, for example.

第1メモリ119は、揮発性の記憶媒体(SDRAMなど)で構成されており、画像処理エンジン118による画像処理の前工程や後工程で撮像画像を一時的に記憶する。一方、第2メモリ120は、フラッシュメモリ等の不揮発性の記憶媒体で構成されており、画像処理エンジン118によって実行されるプログラムを長期的に記憶する。   The first memory 119 is composed of a volatile storage medium (SDRAM or the like), and temporarily stores a captured image in a pre-process or post-process of image processing by the image processing engine 118. On the other hand, the second memory 120 is configured by a nonvolatile storage medium such as a flash memory, and stores a program executed by the image processing engine 118 for a long period of time.

この第1メモリ119には、画像処理エンジン118が実行すべき画像処理プログラムが格納されており、この画像処理プログラムには、第1実施形態と同様の現像処理の機能が搭載されている。現像処理を実行する際、画像処理エンジン118は、第1実施形態と同様、フレア補正処理部125として機能する。   The first memory 119 stores an image processing program to be executed by the image processing engine 118, and the image processing program has the same development processing function as that of the first embodiment. When executing the development processing, the image processing engine 118 functions as the flare correction processing unit 125 as in the first embodiment.

したがって、本実施形態の画像処理エンジン118は、電子カメラ111が撮影で取得したRAW画像や、メディアI/F121(又は通信I/F122)を介して読み込まれたRAW画像に対して、第1実施形態と同様の現像処理を施すことができる。   Therefore, the image processing engine 118 of the present embodiment performs the first implementation on the RAW image acquired by the electronic camera 111 by shooting or the RAW image read via the media I / F 121 (or communication I / F 122). Development processing similar to that of the embodiment can be performed.

なお、電子カメラ111が取得したRAW画像に対する現像処理のタイミングは、そのRAW画像が撮影された直後としてもよい。   Note that the development processing timing for the RAW image acquired by the electronic camera 111 may be immediately after the RAW image is captured.

また、図23において点線で示した部分(撮影光学系112を含むレンズユニット)は、電子カメラ111に対して交換可能であっても構わない。   In addition, a portion indicated by a dotted line in FIG. 23 (a lens unit including the photographing optical system 112) may be replaceable with the electronic camera 111.

また、交換可能なレンズユニットで撮影されたRAW画像に対して現像処理を施す場合は、撮影光学系112の種類情報を、画像処理エンジン118がレンズユニットから読み込めばよい。   In addition, in the case where development processing is performed on a RAW image shot with a replaceable lens unit, the image processing engine 118 may read the type information of the shooting optical system 112 from the lens unit.

また、本実施形態の現像処理も、第1実施形態の現像処理と同様に変形することが可能である。   Further, the development processing of the present embodiment can be modified similarly to the development processing of the first embodiment.

11…コンピュータ、12…データ読込部、13…記憶装置、14…CPU、15…メモリ、16…入出力I/F、17…バス   DESCRIPTION OF SYMBOLS 11 ... Computer, 12 ... Data reading part, 13 ... Memory | storage device, 14 ... CPU, 15 ... Memory, 16 ... Input-output I / F, 17 ... Bus

Claims (19)

撮影光学系により取得された処理対象画像を入力する入力と、
前記撮影光学系の種類に基づいて、前記処理対象画像におけるフレアの発生領域の前記フレアの光源色が特定の色か否かを判別する判別と、
前記発生領域に対してフレア補正処理を施すフレア補正とを備え、
前記フレア補正は、
前記判別による前記判別の結果に応じて前記フレア補正処理の内容を切り換える画像処理装置。
An input unit for inputting a processing target image obtained by the photographing optical system,
Based on the type of the photographing optical system, and a determination unit that the light source color before Symbol flare generation region of the flare in the processing target image, it is determined whether or not the specific color,
And a flare correcting section for performing flare correction processing on the generated region,
The flare correction unit is
The flare correction processing images processing device Ru switching contents according to the result of the determination by the determination unit.
撮影光学系により取得された処理対象画像を入力する入力部と、
前記処理対象画像におけるフレアの発生領域の彩度に基づいて、前記フレアの光源色が特定の色か否かを判別する判別部と、
前記発生領域に対してフレア補正処理を施すフレア補正部とを備え、
前記フレア補正部は、
前記判別部による前記判別の結果に応じて前記フレア補正処理の内容を切り換える画像処理装置。
An input unit for inputting a processing target image acquired by the photographing optical system;
And based on the saturation of the generation region of the flare in the process target image, and a determination unit that the light source color of the flare is determined whether or not the specific color,
A flare correction unit that performs a flare correction process on the occurrence region,
The flare correction unit is
An image processing apparatus that switches the content of the flare correction process in accordance with a result of the determination by the determination unit.
請求項に記載の画像処理装置において、
前記判別は、
前記処理対象画像が色補正後の画像である場合には、前記発生領域の彩度に基づく代わりに、前記発生領域に色補正画素が存在するか否かに基づき前記判別を行う画像処理装置。
The image processing apparatus according to claim 2 ,
The discrimination unit is
When the processing target image is an image after color correction, instead of based on the saturation of the generation region, the determined row planted image processing based on whether the color corrected pixel is present in the generation region apparatus.
撮影光学系により取得された処理対象画像を入力する入力部と、
前記処理対象画像におけるフレアの発生領域から飽和画素領域を除外した領域について前記フレアの光源色が特定の色か否かを判別する判別部と、
前記発生領域に対してフレア補正処理を施すフレア補正部とを備え、
前記フレア補正部は、
前記判別部による前記判別の結果に応じて前記フレア補正処理の内容を切り換える画像処理装置。
An input unit for inputting a processing target image acquired by the photographing optical system;
A discriminator for discriminating whether or not the light source color of the flare is a specific color for a region excluding a saturated pixel region from a flare generation region in the processing target image ;
A flare correction unit that performs a flare correction process on the occurrence region,
The flare correction unit is
An image processing apparatus that switches the content of the flare correction process in accordance with a result of the determination by the determination unit.
撮影光学系により取得された処理対象画像を入力する入力部と、
前記撮影光学系の種類に基づいて、前記処理対象画像におけるフレアの発生領域の前記フレアの光源色が特定の色か否かを判別する判別部と、
前記発生領域に対してフレア補正処理を施すフレア補正部とを備え、
前記フレア補正は、
前記発生領域を包含する処理領域を前記処理対象画像上に設定する領域設定と、
前記フレアの色付きを除去する除去処理を前記処理領域へ施す除去と、
前記フレアの光源色が前記特定の色でない場合には、前記フレアの光源に固有の色を前記発生領域に復元させる復元処理を、前記除去処理後の前記処理領域へ施す復元と、
を備える画像処理装置。
An input unit for inputting a processing target image acquired by the photographing optical system;
A determination unit that determines whether the light source color of the flare in the flare generation region in the processing target image is a specific color based on the type of the photographing optical system;
A flare correction unit that performs a flare correction process on the occurrence region,
The flare correction unit is
An area setting unit for setting a processing area including the generation area on the processing target image;
A removal unit that applies a removal process to the processing region to remove the flare coloring;
When the light source color of the flare is not the particular color, a restoring portion for restoring processing for restoring the inherent color in the generation region on the source of the flare, subjected to the processing area after the removal process,
Bei obtain image processing device.
請求項1〜請求項5の何れか一項に記載の画像処理装置において、  In the image processing apparatus according to any one of claims 1 to 5,
前記判別部は、  The discrimination unit
前記処理対象画像上の飽和画素領域を包含する円形領域を前記発生領域とみなす画像処理装置。  An image processing apparatus that regards a circular area including a saturated pixel area on the processing target image as the generation area.
請求項6に記載の画像処理装置において、  The image processing apparatus according to claim 6.
前記判別部は、  The discrimination unit
前記飽和画素領域のサイズに基づき前記発生領域のサイズを推定する画像処理装置。  An image processing apparatus that estimates a size of the generation region based on a size of the saturated pixel region.
請求項に記載の画像処理装置において、
前記復元処理は、
前記除去処理後の前記処理領域に対して前記除去処理前の前記処理領域を重み付け合成する処理である画像処理装置。
The image processing apparatus according to claim 5 .
The restoration process includes
The removal process the removal process prior to the treatment area weighted synthesis processing der Ru images processing device to said processing area after.
請求項に記載の画像処理装置において、
前記除去処理後の重みに対する前記除去処理前の重みの比は、
前記処理領域の位置毎に設定される画像処理装置。
The image processing apparatus according to claim 8 .
The ratio of the weight before the removal process to the weight after the removal process is:
Set Ru images processing device for each position of the processing area.
請求項に記載の画像処理装置において、
前記発生領域に近い位置の前記比よりも、前記発生領域から離れた位置の前記比の方が小さい画像処理装置。
The image processing apparatus according to claim 9 .
It said than the ratio of the position close to the generating region, is small bur image processing apparatus towards said ratio position away from the generating region.
請求項5,請求項8〜請求項10の何れか一項に記載の画像処理装置において、
前記除去は、
前記発生領域の各色成分の中で基準となる基準色成分を設定する基準色設定と、
前記処理領域における基準色成分と着目色成分との間の相関を示す相関情報を算出する相関算出と、
前記フレアの色付き分布であるフレア色成分を、前記処理領域の前記相関情報と前記発生領域の基準色成分とに基づき推定するフレア色成分推定と、を含む画像処理装置。
5. The image processing apparatus according to any one of claims 8 to claim 10,
The removing unit is
A reference color setting unit for setting a reference color component to be a reference among the color components of the generation region;
A correlation calculating unit that calculates correlation information indicating a correlation between a reference color component and a target color component in the processing region;
Flare color component is a colored distribution of the flare, the processing region of the correlation information and the generation region including images processing device and flare color component estimator, the estimated that based on the reference color component of.
撮影光学系が結像した被写体像を撮像するカラーの撮像素子と、
前記撮像素子が生成した画像を前記処理対象画像として処理する請求項1〜請求項11の何れか一項に記載の画像処理装置と、を備えた撮像装置。
A color imaging device for imaging a subject image formed by the imaging optical system;
IMAGING apparatus and an image processing apparatus according to any one of claims 1 to 11 for processing an image in which the imaging device is generated as the process target image.
請求項12に記載の撮像装置において、
回折光学素子を含む前記撮影光学系を備えた撮像装置。
The imaging apparatus according to claim 12 ,
Imaging device having the imaging optical system including a diffractive optical element.
請求項12に記載の撮像装置において、
回折光学素子を含む前記撮影光学系を装着可能である撮像装置。
The imaging apparatus according to claim 12 ,
Mountable der Ru imaging device of the photographing optical system including a diffractive optical element.
請求項13又は請求項14に記載の撮像装置において、
前記回折光学素子の白色光に対する応答特性は、
前記画像に発生するフレアの波長スペクトルが所定波長域にピークを持つように設定されている撮像装置。
In the imaging device according to claim 13 or 14 ,
The response characteristic of the diffractive optical element to white light is
Set have that imaging device to have a peak wavelength spectrum of flare generated in the image within a predetermined wavelength range.
撮影光学系により取得された処理対象画像を入力する入力手順と、
前記撮影光学系の種類に基づいて、前記処理対象像におけるフレアの発生領域の前記フレアの光源色が特定の色か否かを判別する判別手順と、
前記発生領域に対してフレア補正処理を施すフレア補正手順とを含み、
前記フレア補正手順では、
前記判別手順による前記判別の結果に応じて前記フレア補正処理の内容を切り換えるコンピュータ実行可能な画像処理プログラム。
An input procedure for entering the processing target image obtained by the photographing optical system,
Based on the type of the photographing optical system, a determination procedure in which the light source color before Symbol flare generation region of the flare in the processed image image it is determined whether or not the specific color,
A flare correction procedure for performing a flare correction process on the occurrence region,
In the flare correction procedure,
The flare correction processing benzalkonium computer executable image processing program switching contents according to the result of the determination by the determination step.
撮影光学系により取得された処理対象画像を入力する入力手順と、  An input procedure for inputting a processing target image acquired by the photographing optical system;
前記処理対象画像におけるフレアの発生領域の彩度に基づいて、前記フレアの光源色が特定の色か否かを判別する判別手順と、  A determination procedure for determining whether or not the light source color of the flare is a specific color based on the saturation of the flare occurrence region in the processing target image;
前記発生領域に対してフレア補正処理を施すフレア補正手順とを含み、  A flare correction procedure for performing a flare correction process on the occurrence region,
前記フレア補正手順では、  In the flare correction procedure,
前記判別手順による前記判別の結果に応じて前記フレア補正処理の内容を切り換えるコンピュータ実行可能な画像処理プログラム。  A computer-executable image processing program for switching the content of the flare correction processing in accordance with the result of the determination by the determination procedure.
撮影光学系により取得された処理対象画像を入力する入力手順と、  An input procedure for inputting a processing target image acquired by the photographing optical system;
前記処理対象画像におけるフレアの発生領域から飽和画素領域を除外した領域について前記フレアの光源色が特定の色か否かを判別する判別手順と、  A determination procedure for determining whether or not a light source color of the flare is a specific color for an area excluding a saturated pixel area from a flare occurrence area in the processing target image,
前記発生領域に対してフレア補正処理を施すフレア補正手順とを含み、  A flare correction procedure for performing a flare correction process on the occurrence region,
前記フレア補正手順では、  In the flare correction procedure,
前記判別手順による前記判別の結果に応じて前記フレア補正処理の内容を切り換えるコンピュータ実行可能な画像処理プログラム。  A computer-executable image processing program for switching the content of the flare correction processing in accordance with the result of the determination by the determination procedure.
撮影光学系により取得された処理対象画像を入力する入力手順と、  An input procedure for inputting a processing target image acquired by the photographing optical system;
前記撮影光学系の種類に基づいて、前記処理対象画像におけるフレアの発生領域の前記フレアの光源色が特定の色か否かを判別する判別手順と、  A determination procedure for determining whether the light source color of the flare in the flare generation area in the processing target image is a specific color based on the type of the photographing optical system,
前記発生領域に対してフレア補正処理を施すフレア補正手順とを含み、  A flare correction procedure for performing a flare correction process on the occurrence region,
前記フレア補正手順では、  In the flare correction procedure,
前記発生領域を包含する処理領域を前記処理対象画像上に設定する領域設定手順と、  An area setting procedure for setting a processing area including the generation area on the processing target image;
前記フレアの色付きを除去する除去処理を前記処理領域へ施す除去手順と、  A removal procedure for applying a removal process to the processing region to remove the flare coloring;
前記フレアの光源色が前記特定の色でない場合には、前記フレアの光源に固有の色を前記発生領域に復元させる復元処理を、前記除去処理後の前記処理領域へ施す復元手順と、  When the light source color of the flare is not the specific color, a restoration procedure for restoring the color specific to the light source of the flare to the generation area is performed on the processing area after the removal process;
を行うコンピュータ実行可能な画像処理プログラム。  A computer-executable image processing program.
JP2013037419A 2013-02-27 2013-02-27 Image processing apparatus, imaging apparatus, and image processing program Active JP6115183B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013037419A JP6115183B2 (en) 2013-02-27 2013-02-27 Image processing apparatus, imaging apparatus, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013037419A JP6115183B2 (en) 2013-02-27 2013-02-27 Image processing apparatus, imaging apparatus, and image processing program

Publications (2)

Publication Number Publication Date
JP2014165833A JP2014165833A (en) 2014-09-08
JP6115183B2 true JP6115183B2 (en) 2017-04-19

Family

ID=51616033

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013037419A Active JP6115183B2 (en) 2013-02-27 2013-02-27 Image processing apparatus, imaging apparatus, and image processing program

Country Status (1)

Country Link
JP (1) JP6115183B2 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4012592B2 (en) * 1996-12-11 2007-11-21 オリンパス株式会社 Imaging device
JP4004117B2 (en) * 1997-10-17 2007-11-07 オリンパス株式会社 Imaging device
JP4250513B2 (en) * 2003-12-01 2009-04-08 キヤノン株式会社 Image processing apparatus and image processing method
JP5423663B2 (en) * 2010-12-20 2014-02-19 株式会社ニコン Image processing method, image processing program, image processing apparatus, and imaging apparatus

Also Published As

Publication number Publication date
JP2014165833A (en) 2014-09-08

Similar Documents

Publication Publication Date Title
KR102175164B1 (en) Apparatus and method for improving image quality
US8989436B2 (en) Image processing method, computer-readable storage medium, image processing apparatus, and imaging apparatus
CN108668093B (en) HDR image generation method and device
JP5113514B2 (en) White balance control device and white balance control method
JP6469678B2 (en) System and method for correcting image artifacts
JP5089405B2 (en) Image processing apparatus, image processing method, and imaging apparatus
US8340417B2 (en) Image processing method and apparatus for correcting skin color
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
JP2015156615A (en) Image processing system, image processing method, control program, and recording medium
JP2009267690A (en) Image processing apparatus, imaging apparatus, image processing method and program
JP2018198029A (en) Image processing device, image processing method, and program
JP2015211325A (en) Purple fringe cancellation processing method and purple fringe cancellation processing device for implementing the processing
JP2011076302A (en) Device, contour extraction method program, and contour extraction
US11100620B2 (en) Hue preservation post processing for highlight recovery
JP5423663B2 (en) Image processing method, image processing program, image processing apparatus, and imaging apparatus
JP6115183B2 (en) Image processing apparatus, imaging apparatus, and image processing program
CN112837230B (en) Image processing apparatus, image processing method, and computer readable medium
JP5744945B2 (en) Image processing apparatus and method, and imaging apparatus
JP5163735B2 (en) Image processing method, image processing program, image processing apparatus, and imaging apparatus
JP6098227B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP5146223B2 (en) Program, camera, image processing apparatus, and image contour extraction method
JP5178421B2 (en) Image processing apparatus, image processing method, and imaging apparatus
JP5106311B2 (en) White balance control device, imaging device using the same, and white balance control method
JP2018198456A (en) Image processing program, image processing apparatus, and imaging apparatus
JP2008147714A (en) Image processor and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20161117

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161206

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170206

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170221

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170306

R150 Certificate of patent or registration of utility model

Ref document number: 6115183

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250