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

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

Info

Publication number
JP2018198456A
JP2018198456A JP2018156623A JP2018156623A JP2018198456A JP 2018198456 A JP2018198456 A JP 2018198456A JP 2018156623 A JP2018156623 A JP 2018156623A JP 2018156623 A JP2018156623 A JP 2018156623A JP 2018198456 A JP2018198456 A JP 2018198456A
Authority
JP
Japan
Prior art keywords
image
flare
image processing
unit
processing program
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
JP2018156623A
Other languages
Japanese (ja)
Inventor
健太郎 彦坂
Kentaro Hikosaka
健太郎 彦坂
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 JP2018156623A priority Critical patent/JP2018198456A/en
Publication of JP2018198456A publication Critical patent/JP2018198456A/en
Pending legal-status Critical Current

Links

Landscapes

  • Studio Devices (AREA)

Abstract

To prevent unnecessary correction of flare to a saturated region where the flare does not occur.SOLUTION: An image processing program causes a computer to perform steps of: acquiring an input image generated by capturing an image; generating a processed image by threshold processing of the input image in a range between a threshold upper limit and a threshold lower limit; and detecting flare on the basis of the processed image.SELECTED DRAWING: Figure 1

Description

本発明は、画像処理プログラム、画像処理装置および撮像装置に関する。   The present invention relates to an image processing program, an image processing apparatus, and an imaging apparatus.

電子カメラで撮影を行う際に、撮影範囲内に極めて高輝度な物体(輝点)が存在していると、撮影画像上の輝点像の周辺にはフレアが発生することがある。例えば、予め記憶されている撮影光学系の結像特性データと、撮影画像上の輝点の位置とに基づいてフレア成分を推定し、推定したフレア成分を撮影画像から除去する技術も従来から知られている。   When shooting with an electronic camera, if an extremely bright object (bright spot) is present in the shooting range, flare may occur around the bright spot image on the shot image. For example, a technique for estimating a flare component based on pre-stored imaging characteristic data of a photographing optical system and the position of a bright spot on the photographed image and removing the estimated flare component from the photographed image has been conventionally known. It has been.

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

従来の技術では、撮影画像上の飽和領域をフレアの発生している光源とみなして補正を行っている。そのため、従来技術では、実際にはフレアの発生していない飽和領域に対しても不必要な補正が行われることで、補正後の画像に違和感が生じるおそれがある。   In the conventional technique, correction is performed by regarding a saturated region on a photographed image as a light source in which flare occurs. For this reason, in the related art, unnecessary correction is performed even in a saturated region where flare does not actually occur, and thus there is a possibility that a sense of incongruity may occur in the corrected image.

一つの観点による画像処理プログラムは、撮像により生成された入力画像を取得する手順と、前記入力画像を閾値上限及び閾値下限の範囲で閾値処理して処理画像を生成する手順と、前記処理画像に基づいてフレアを検出する手順と、をコンピュータに実行させる。   An image processing program according to one aspect includes: a procedure for acquiring an input image generated by imaging; a procedure for generating a processed image by performing threshold processing on the input image within a range of a threshold upper limit and a threshold lower limit; and And causing the computer to execute a procedure for detecting the flare based on the information.

一つの観点による画像処理装置は、撮像により生成された入力画像を取得する取得部と、前記入力画像を閾値上限及び閾値下限の範囲で閾値処理して処理画像を生成する生成部と、前記処理画像に基づいてフレアを検出する検出部と、を備える。   An image processing apparatus according to one aspect includes an acquisition unit that acquires an input image generated by imaging, a generation unit that generates a processed image by performing threshold processing on the input image in a range of a threshold upper limit and a threshold lower limit, and the processing A detection unit that detects flare based on the image.

一つの観点による撮像装置は、撮影光学系の結像を撮像する撮像部と、上記に記載の画像処理装置と、を備える。   An imaging apparatus according to one aspect includes an imaging unit that captures an image of an imaging optical system, and the image processing apparatus described above.

本件開示の画像処理プログラム、画像処理装置および撮像装置によれば、フレアの発生していない飽和領域に対する不要なフレアの補正を防ぐことができる。   According to the image processing program, the image processing apparatus, and the imaging apparatus of the present disclosure, it is possible to prevent unnecessary flare correction for a saturated region where no flare occurs.

第1実施形態のコンピュータの構成例を示す図The figure which shows the structural example of the computer of 1st Embodiment. 第1実施形態でのコンピュータの動作例を示す流れ図A flow chart showing an example of operation of a computer in a 1st embodiment 入力画像の一例を示す図Diagram showing an example of an input image 図3から飽和領域を抽出した状態を示す図The figure which shows the state which extracted the saturation area | region from FIG. (a)〜(f):図3に対応する二値化画像の例を示す図(A)-(f): The figure which shows the example of the binarized image corresponding to FIG. (a)〜(f):図3に対応する第1の二値化画像から第6の二値化画像の例を示す図(A)-(f): The figure which shows the example of the 6th binarized image from the 1st binarized image corresponding to FIG. フレアが発生している光源に対応する度数分布の一例を示す図The figure which shows an example of the frequency distribution corresponding to the light source which the flare has generate | occur | produced フレアが発生していない光源に対応する度数分布の一例を示す図The figure which shows an example of the frequency distribution corresponding to the light source which flare does not generate | occur | produce 度数分布のシャープ度合いの求め方を示す図Diagram showing how to determine the sharpness of frequency distribution 第2実施形態の電子カメラの構成例を示す図The figure which shows the structural example of the electronic camera of 2nd Embodiment. 第2実施形態での電子カメラの動作例を示す流れ図Flow chart showing an operation example of the electronic camera in the second embodiment

<第1実施形態の説明>
図1は、第1実施形態のコンピュータの構成例を示す図である。第1実施形態のコンピュータは、画像処理プログラムを実行することで、撮影光学系の結像を撮像した撮影画像に対してフレア補正処理を施す。
<Description of First Embodiment>
FIG. 1 is a diagram illustrating a configuration example of a computer according to the first embodiment. The computer according to the first embodiment executes flare correction processing on a captured image obtained by capturing an image of the imaging optical system by executing an image processing program.

図1に示すコンピュータ101は、データ読込部102、記憶装置103、CPU(Central Processing Unit)104、メモリ105および入出力インターフェース(I/F)106、バス107を有している。データ読込部102、記憶装置103、CPU104、メモリ105および入出力I/F106は、バス107を介して相互に接続されている。さらに、コンピュータ101には、入出力I/F106を介して、入力デバイス108(キーボード、ポインティングデバイスなど)とモニタ109とがそれぞれ接続されている。なお、入出力I/F106は、入力デバイス108からの各種入力を受け付けるとともに、モニタ109に対して表示用のデータを出力する。   A computer 101 illustrated in FIG. 1 includes a data reading unit 102, a storage device 103, a CPU (Central Processing Unit) 104, a memory 105, an input / output interface (I / F) 106, and a bus 107. The data reading unit 102, the storage device 103, the CPU 104, the memory 105, and the input / output I / F 106 are connected to each other via a bus 107. Furthermore, an input device 108 (keyboard, pointing device, etc.) and a monitor 109 are connected to the computer 101 via an input / output I / F 106. The input / output I / F 106 receives various inputs from the input device 108 and outputs display data to the monitor 109.

データ読込部102は、取得部の一例であって、撮影画像のデータや、画像処理プログラムを外部から取得する。データ読込部102は、例えば、着脱可能な記憶媒体からデータを取得する読込デバイス(光ディスク、磁気ディスク、光磁気ディスクの読込装置など)や、公知の通信規格に準拠して外部の装置と通信を行う通信デバイス(USBインターフェース、LANモジュール、無線LANモジュールなど)である。   The data reading unit 102 is an example of an acquisition unit, and acquires captured image data and an image processing program from the outside. The data reading unit 102 communicates with, for example, a reading device that acquires data from a removable storage medium (such as an optical disk, a magnetic disk, or a magneto-optical disk reading device) or an external device in accordance with a known communication standard. A communication device to perform (USB interface, LAN module, wireless LAN module, etc.).

記憶装置103は、例えば、ハードディスクや、不揮発性の半導体メモリなどの記憶媒体である。記憶装置103には、上記の画像処理プログラムや、画像処理プログラムの実行に必要となる各種の情報が記憶されている。なお、記憶装置103には、データ読込部102から読み込んだ撮影画像のデータなどを記憶しておくこともできる。   The storage device 103 is a storage medium such as a hard disk or a nonvolatile semiconductor memory. The storage device 103 stores the above-described image processing program and various types of information necessary for executing the image processing program. Note that the storage device 103 can store data of a captured image read from the data reading unit 102.

CPU104は、コンピュータ101の各部を統括的に制御するプロセッサである。CPU104は、画像処理プログラムの実行によって、本件開示の画像処理装置の一例である画像処理部200として機能する。画像処理部200は、画像生成部201、輪帯検出部202、光源推定部203、フレア補正部204をそれぞれ有している。なお、画像処理部200、画像生成部201、輪帯検出部202、光源推定部203、フレア補正部204の動作についてはそれぞれ後述する。   The CPU 104 is a processor that comprehensively controls each unit of the computer 101. The CPU 104 functions as the image processing unit 200 that is an example of the image processing apparatus disclosed herein by executing the image processing program. The image processing unit 200 includes an image generation unit 201, an annular zone detection unit 202, a light source estimation unit 203, and a flare correction unit 204. The operations of the image processing unit 200, the image generation unit 201, the annular zone detection unit 202, the light source estimation unit 203, and the flare correction unit 204 will be described later.

なお、図1に示す画像処理部200の各機能ブロック(201〜204)は、ソフトウェア的にはメモリにロードされたプログラムによって実現される。しかし、画像処理部200の各機能ブロックの一部または全部は、プロセッサ、メモリ、電子回路の組み合わせによりハードウェア的に実現してもよい。   Note that each functional block (201 to 204) of the image processing unit 200 shown in FIG. 1 is realized by a program loaded in a memory in terms of software. However, some or all of the functional blocks of the image processing unit 200 may be realized in hardware by a combination of a processor, a memory, and an electronic circuit.

メモリ105は、画像処理プログラムでの演算結果等を一時的に記憶する。メモリ105は、例えば揮発性の半導体メモリである。   The memory 105 temporarily stores calculation results and the like in the image processing program. The memory 105 is a volatile semiconductor memory, for example.

以下、図2の流れ図を参照しつつ、第1実施形態でのコンピュータの動作例を説明する。図2の処理は、ユーザによるプログラム実行指示に応じて、CPU104が画像処理プログラムを実行することで開始される。   Hereinafter, an exemplary operation of the computer according to the first embodiment will be described with reference to the flowchart of FIG. The processing in FIG. 2 is started when the CPU 104 executes the image processing program in response to a program execution instruction from the user.

ステップS11において、画像処理部200は、処理対象となる撮影画像(以下、入力画像とも称する)のデータを、データ読込部102を介して外部から取得する。ステップS11で取得された入力画像のデータは、画像処理部200の制御によって、記憶装置103またはメモリ105に記録される。なお、画像処理部200は、入力画像のデータが予め記憶装置13に記憶されている場合には、ステップS11の処理を省略してもよい。なお、図3に入力画像の一例を示す。   In step S <b> 11, the image processing unit 200 acquires data of a captured image (hereinafter also referred to as an input image) to be processed from the outside via the data reading unit 102. The input image data acquired in step S <b> 11 is recorded in the storage device 103 or the memory 105 under the control of the image processing unit 200. Note that the image processing unit 200 may omit the process of step S11 when the data of the input image is stored in the storage device 13 in advance. FIG. 3 shows an example of the input image.

一例として、第1実施形態の入力画像は、撮影光学系の被写体像を電子カメラで撮影(撮像)したRGB色空間のカラー画像である。また、第1実施形態の入力画像は、回折光学素子(DOE:Diffractive Optical Element)を有する撮影光学系による撮影画像である。回折光学素子を有する撮影光学系で撮影を行う際、極めて高輝度な物体(輝点)が撮影範囲内に存在すると、撮影画像上の輝点像の周辺に色滲みを伴うフレア(色フレア)が発生する。回折光学素子に由来する色フレアは、無色のフレアと比較すると著しく不自然であるため、フレア補正処理で補正されることが望まれる。   As an example, the input image of the first embodiment is a color image in an RGB color space obtained by photographing (capturing) a subject image of the photographing optical system with an electronic camera. Further, the input image of the first embodiment is a photographed image by a photographing optical system having a diffractive optical element (DOE: Diffractive Optical Element). When photographing with a photographing optical system having a diffractive optical element, if an extremely bright object (bright spot) exists in the photographing range, a flare (color flare) with color blur around the bright spot image on the photographed image Will occur. The color flare derived from the diffractive optical element is remarkably unnatural as compared with the colorless flare, and thus it is desired to be corrected by the flare correction process.

ステップS12において、画像処理部200は、入力画像にフレア補正処理を施すフレア補正モードであるか否かを判定する。一例として、画像処理部200は、ユーザがフレア補正モードの設定をオンにしている場合に、フレア補正モードであると判定する。また、画像処理部200は、入力画像のヘッダ領域に付加されている撮影情報を参照し、入力画像が回折光学素子を含む撮影光学系で撮影されている場合に、フレア補正モードであると判定する。   In step S12, the image processing unit 200 determines whether or not it is a flare correction mode in which a flare correction process is performed on the input image. As an example, the image processing unit 200 determines that the flare correction mode is set when the user turns on the setting of the flare correction mode. Further, the image processing unit 200 refers to the shooting information added to the header area of the input image, and determines that the flare correction mode is set when the input image is shot with a shooting optical system including a diffractive optical element. To do.

フレア補正モードである場合(ステップS12の肯定判定)には、ステップS13に処理が移行する。一方、フレア補正モードではない場合(ステップS12の否定判定)には、ステップS24に処理が移行する。   If it is the flare correction mode (affirmative determination in step S12), the process proceeds to step S13. On the other hand, when the mode is not the flare correction mode (negative determination in step S12), the process proceeds to step S24.

ステップS13において、画像処理部200は、入力画像の輝度成分を示す輝度画像を生成する。例えば、画像処理部200は、入力画像をYCbCr色空間に変換し、入力画像のYチャネルを輝度画像としてもよい。あるいは、画像処理部200は、入力画像の各画素でRGB値の平均((R+G+B)/3)を求めることにより、輝度画像を生成してもよい。   In step S13, the image processing unit 200 generates a luminance image indicating the luminance component of the input image. For example, the image processing unit 200 may convert the input image into a YCbCr color space and use the Y channel of the input image as a luminance image. Alternatively, the image processing unit 200 may generate a luminance image by obtaining an average ((R + G + B) / 3) of RGB values for each pixel of the input image.

ステップS14において、画像処理部200は、輝度画像のうちで画素値が飽和レベルに達した飽和画素を検出する。そして、画像処理部200は、検出した飽和画素のまとまりを求めるラベリング処理を行う。以下、ラベリング処理後の飽和画素のまとまりを飽和領域と称することもある。なお、飽和領域には、フレアが発生している光源だけでなく、フレアとは無関係な光源も混在している可能性がある。また、図4は、図3から飽和領域を抽出した状態を示す。   In step S <b> 14, the image processing unit 200 detects a saturated pixel whose pixel value has reached a saturation level in the luminance image. Then, the image processing unit 200 performs a labeling process for obtaining a group of detected saturated pixels. Hereinafter, a group of saturated pixels after the labeling process may be referred to as a saturated region. In the saturation region, there is a possibility that not only the light source in which the flare is generated but also the light source unrelated to the flare is mixed. FIG. 4 shows a state where the saturation region is extracted from FIG.

ステップS15において、画像処理部200は、輝度画像内に存在する各々の飽和領域にゼロ値から順にナンバリングする。以下、飽和領域の番号を示す変数をi(但し、iは0を含む正の整数)とする。上記のナンバリングにより、画像処理部200は、輝度画像内の飽和領域の総数imaxを取得する。また、画像処理部200は、各々の飽和領域iにつき、輝度画像内での位置を示す座標(Xi,Yi)をそれぞれ取得する。例えば、画像処理部200は、上記の座標として飽和領域iの重心の座標を取得する。   In step S15, the image processing unit 200 numbers each saturated region existing in the luminance image in order from the zero value. Hereinafter, the variable indicating the saturation region number is i (where i is a positive integer including 0). By the above numbering, the image processing unit 200 acquires the total number imax of saturated regions in the luminance image. Further, the image processing unit 200 acquires coordinates (Xi, Yi) indicating the position in the luminance image for each saturated region i. For example, the image processing unit 200 acquires the coordinates of the center of gravity of the saturated region i as the above coordinates.

ステップS16において、画像生成部201は、輝度画像をそれぞれ異なる閾値で二値化して複数の二値化画像を生成する。このとき、画像生成部201は、閾値上限および閾値下限の組み合わせを変化させて複数種類の画素値の範囲を抽出することで、複数の二値化画像を生成する。   In step S16, the image generation unit 201 binarizes the luminance image with different threshold values, and generates a plurality of binarized images. At this time, the image generation unit 201 generates a plurality of binarized images by extracting a plurality of types of pixel value ranges by changing the combination of the threshold upper limit and the threshold lower limit.

一例として、輝度画像の階調が8ビット(0〜255)のときに、画像生成部201は、以下の設定で6枚の2値化画像を生成する。   As an example, when the gradation of the luminance image is 8 bits (0 to 255), the image generation unit 201 generates six binarized images with the following settings.

まず、画像生成部201は、画素値210〜250の範囲に含まれる画素か否かで輝度画像を二値化して、第1の二値化画像を生成する。また、画像生成部201は、画素値170〜210の範囲に含まれる画素か否かで輝度画像を二値化して、第2の二値化画像を生成する。また、画像生成部201は、画素値130〜170の範囲に含まれる画素か否かで輝度画像を二値化して、第3の二値化画像を生成する。また、画像生成部201は、画素値90〜130の範囲に含まれる画素か否かで輝度画像を二値化して、第4の二値化画像を生成する。また、画像生成部201は、画素値50〜90の範囲に含まれる画素か否かで輝度画像を二値化して、第5の二値化画像を生成する。また、画像生成部201は、画素値30〜50の範囲に含まれる画素か否かで輝度画像を二値化して、第6の二値化画像を生成する。なお、二値化画像の生成数や、上記の閾値の範囲は適宜変更してもよい。   First, the image generation unit 201 binarizes the luminance image depending on whether or not the pixel value falls within the range of pixel values 210 to 250, and generates a first binarized image. In addition, the image generation unit 201 binarizes the luminance image depending on whether or not the pixel is within the range of the pixel values 170 to 210, and generates a second binarized image. In addition, the image generation unit 201 binarizes the luminance image depending on whether or not the pixel is within the range of the pixel values 130 to 170, and generates a third binarized image. In addition, the image generation unit 201 binarizes the luminance image depending on whether or not the pixel is in the range of the pixel values 90 to 130, and generates a fourth binarized image. Further, the image generation unit 201 binarizes the luminance image depending on whether or not it is a pixel included in the range of the pixel values 50 to 90, and generates a fifth binarized image. Further, the image generation unit 201 binarizes the luminance image depending on whether or not the pixel is in the range of the pixel values 30 to 50, and generates a sixth binarized image. Note that the number of binarized images generated and the above-described threshold range may be changed as appropriate.

図5(a)〜(f)は、図3に対応する二値化画像の例を示している。図5(a)は、画素値250を閾値とする二値化画像であり、図5(b)は画素値210を閾値とする二値化画像である。図5(c)は画素値170を閾値とする二値化画像であり、図5(d)は画素値130を閾値とする二値化画像である。図5(e)は画素値90を閾値とする二値化画像であり、図5(f)は画素値50を閾値とする二値化画像である。図5(a)〜(f)では、画素値が閾値以上の部分は白画素で示し、画素値が閾値未満の部分は黒画素で示している。   FIGS. 5A to 5F show examples of binarized images corresponding to FIG. FIG. 5A is a binarized image with the pixel value 250 as a threshold, and FIG. 5B is a binarized image with the pixel value 210 as a threshold. FIG. 5C shows a binarized image with the pixel value 170 as a threshold, and FIG. 5D shows a binarized image with the pixel value 130 as a threshold. FIG. 5E shows a binarized image with a pixel value 90 as a threshold, and FIG. 5F shows a binarized image with a pixel value 50 as a threshold. In FIGS. 5A to 5F, portions where the pixel value is greater than or equal to the threshold value are indicated by white pixels, and portions where the pixel value is less than the threshold value are indicated by black pixels.

図5(a)〜(f)を比較すると、フレアが発生している光源の周囲には、二値化画像において円形模様が生じていることが分かる。上記の円形模様は、光源を中心として輝度値を徐々に低下させながら外側に広がってゆく画像構造を有している。ここで、異なる2枚の2値化画像の差分をとると、上記のフレアによる画像構造は、光源を中心とした同心円状の画像構造(輪帯)として表現される。つまり、閾値上限および閾値下限で定義される画素値の或る帯域を抽出して二値化画像を生成すると、上記の輪帯を利用してフレアの発生を判定することができる。そのため、画素値の或る帯域を抽出した二値化画像を用いると、フレアが発生している光源の推定が容易になる。   5A to 5F, it can be seen that a circular pattern is generated in the binarized image around the light source where the flare is generated. The circular pattern has an image structure that spreads outward while gradually decreasing the luminance value around the light source. Here, when a difference between two different binarized images is taken, the image structure by the flare is expressed as a concentric image structure (annular zone) centered on the light source. In other words, if a binarized image is generated by extracting a certain band of pixel values defined by the threshold upper limit and the threshold lower limit, the occurrence of flare can be determined using the above-described annular zone. Therefore, when a binarized image obtained by extracting a certain band of pixel values is used, it is easy to estimate a light source in which flare occurs.

図6(a)〜(f)は、図3に対応する第1の二値化画像から第6の二値化画像の例をそれぞれ示している。図6(a)〜(f)では、画素値が閾値の範囲内の部分は白画素で示し、画素値が閾値の範囲外の部分は黒画素で示している。図6(a)に示す第1の二値化画像は、図5(a)と図5(b)との差分に相当する。図6(b)に示す第2の二値化画像は、図5(b)と図5(c)との差分に相当する。図6(c)に示す第3の二値化画像は、図5(c)と図5(d)との差分に相当する。図6(d)に示す第4の二値化画像は、図5(d)と図5(e)の差分に相当する。図6(e)に示す第5の二値化画像は、図5(e)と図5(f)の差分に相当する。図6(f)に示す第6の二値化画像は、図5(f)と画素値30を閾値とする二値化画像との差分に相当する。図6(a)〜(f)によれば、フレアが発生している光源の周囲に輪帯が形成されていることが分かる。   FIGS. 6A to 6F show examples of the first to sixth binarized images corresponding to FIG. 3, respectively. In FIGS. 6A to 6F, a portion where the pixel value is within the threshold value range is indicated by a white pixel, and a portion where the pixel value is outside the threshold value range is indicated by a black pixel. The first binarized image shown in FIG. 6 (a) corresponds to the difference between FIG. 5 (a) and FIG. 5 (b). The second binarized image shown in FIG. 6 (b) corresponds to the difference between FIG. 5 (b) and FIG. 5 (c). The third binarized image shown in FIG. 6 (c) corresponds to the difference between FIG. 5 (c) and FIG. 5 (d). The fourth binarized image shown in FIG. 6 (d) corresponds to the difference between FIG. 5 (d) and FIG. 5 (e). The fifth binarized image shown in FIG. 6 (e) corresponds to the difference between FIG. 5 (e) and FIG. 5 (f). The sixth binarized image shown in FIG. 6 (f) corresponds to the difference between FIG. 5 (f) and the binarized image with the pixel value 30 as a threshold value. According to FIGS. 6A to 6F, it can be seen that an annular zone is formed around the light source where the flare is generated.

ステップS17において、画像処理部200は、フレアの発生を判定している光源の番号を示すカウンタkをゼロ値に初期化する(k=0)。なお、例えばk=iのときには、画像処理部200は、ステップS15で番号iを付与された飽和領域についてフレアの発生を判定する。   In step S <b> 17, the image processing unit 200 initializes a counter k indicating the number of the light source for which the occurrence of flare is determined to a zero value (k = 0). For example, when k = i, the image processing unit 200 determines the occurrence of flare for the saturated region to which the number i is assigned in step S15.

ステップS18において、輪帯検出部202は、カウンタkの値に対応する飽和領域kを判定対象として、複数の二値化画像から輪帯を検出する。一例として、輪帯検出部202は、以下の手順(A)、(B)により、第1の二値化画像から第6の二値化画像のそれぞれで輪帯を検出する。   In step S <b> 18, the annular zone detection unit 202 detects an annular zone from a plurality of binarized images with the saturated region k corresponding to the value of the counter k as a determination target. As an example, the annular zone detection unit 202 detects an annular zone in each of the first binarized image to the sixth binarized image by the following procedures (A) and (B).

(A)まず、輪帯検出部202は、各々の二値化画像において、判定対象の飽和領域kからの距離と、二値化画像で抽出される抽出画素数との相関を示す度数分布を求める。   (A) First, the annular zone detection unit 202 calculates a frequency distribution indicating the correlation between the distance from the saturation region k to be determined and the number of extracted pixels extracted from the binarized image in each binarized image. Ask.

例えば、輪帯検出部202は、判定対象の飽和領域kについて、ステップS15で取得した飽和領域の座標を基準点(Xk,Yk)とする。そして、輪帯検出部202は、上記の基準点からの距離に対応付けて二値化画像の白画素をカウントする。これにより、輪帯検出部202は、基準点からの距離と、白画素の数との相関を示す度数分布を得ることができる。なお、輪帯検出部202は、1つの飽和領域につき、第1の二値化画像から第6の二値化画像のそれぞれで上記の度数分布を求めることとなる。   For example, the annular zone detection unit 202 sets the coordinates of the saturation region acquired in step S15 as the reference point (Xk, Yk) for the saturation region k to be determined. Then, the annular zone detection unit 202 counts the white pixels of the binarized image in association with the distance from the reference point. Thereby, the annular zone detection unit 202 can obtain a frequency distribution indicating a correlation between the distance from the reference point and the number of white pixels. Note that the annular zone detection unit 202 obtains the above-described frequency distribution for each of the first binarized image to the sixth binarized image for one saturation region.

図7は、フレアが発生している光源に対応する度数分布の一例である。また、図8は、フレアが発生していない光源に対応する度数分布の一例である。図7、図8の縦軸は白画素の数を示し、図7、図8の横軸は飽和領域の基準点からの距離を示す。なお、図7、図8では、同じ光源について異なる二値化画像から求めた6つの度数分布をまとめて示している。   FIG. 7 is an example of a frequency distribution corresponding to a light source in which flare occurs. FIG. 8 is an example of a frequency distribution corresponding to a light source in which no flare occurs. The vertical axis in FIGS. 7 and 8 indicates the number of white pixels, and the horizontal axis in FIGS. 7 and 8 indicates the distance from the reference point in the saturation region. 7 and 8 collectively show six frequency distributions obtained from different binarized images for the same light source.

フレアが発生している光源の場合、各二値化画像での光源の周囲には、上記のようにそれぞれ輪帯が現れる。これにより、フレアが発生している光源の度数分布図(図7)では、輪帯の位置に応じて白画素のピークがグラフ上に明確に現れる。   In the case of a light source in which flare occurs, an annular zone appears around the light source in each binarized image as described above. Thereby, in the frequency distribution diagram (FIG. 7) of the light source in which the flare is generated, the peak of the white pixel appears clearly on the graph according to the position of the annular zone.

上記のように、フレアの画像構造は光源を中心として輝度値を徐々に低下させながら外側に広がってゆく。したがって、相対的に画素値の高い範囲を抽出した二値化画像では輪帯の位置が光源に近付くため、度数分布のグラフ上で白画素のピークが現れる距離が基準点に近くなる。逆に、相対的に画素値の低い範囲を抽出した二値化画像では輪帯の位置が光源から遠ざかるため、相対的に画素値の高い範囲を抽出した二値化画像の場合と比べて、度数分布のグラフ上で白画素のピークが現れる距離が基準点から離れる。   As described above, the flare image structure spreads outward while gradually decreasing the luminance value around the light source. Therefore, in a binarized image in which a range having a relatively high pixel value is extracted, the position of the annular zone approaches the light source, and thus the distance at which the white pixel peak appears on the frequency distribution graph is close to the reference point. On the contrary, in the binarized image in which the range having a relatively low pixel value is extracted, the position of the annular zone is far from the light source, so compared to the binarized image in which the range having a relatively high pixel value is extracted, The distance at which the white pixel peak appears on the frequency distribution graph is separated from the reference point.

なお、図7の比較例として、フレアが発生していない光源の度数分布図(図8)では、複数の二値化画像のいずれでも白画素の数に明確なピークが現れず、各度数分布のグラフは平坦なものとなることが分かる。   As a comparative example of FIG. 7, in the frequency distribution diagram of the light source in which no flare occurs (FIG. 8), no clear peak appears in the number of white pixels in any of the plurality of binarized images, and each frequency distribution It can be seen that this graph is flat.

(B)次に、輪帯検出部202は、上記の手順(A)で求めた度数分布での抽出画素数のピークと、抽出画素のピーク区間の幅とに基づいて輪帯を検出する。   (B) Next, the annular zone detection unit 202 detects the annular zone based on the peak of the number of extracted pixels in the frequency distribution obtained in the procedure (A) and the width of the peak section of the extracted pixel.

例えば、輪帯検出部202は、各々の度数分布について、グラフのシャープ度合いを示す評価値EVを以下の式(1)により求める。そして、輪帯検出部202は、評価値EVの高さが所定の閾値を超えるときに、二値化画像から輪帯を検出できたと判定する。
EV=peak/width% …(1)
上記の「peak」は、度数分布でのピーク強度(例えば、度数分布での白画素の最大値や、最大値近傍で重心をとった位置での白画素の数)を示す値である(図9参照)。peakの値は、ピーク位置で白画素の数が増えるほど高くなる。
For example, the annular zone detection unit 202 obtains an evaluation value EV indicating the degree of sharpness of the graph for each frequency distribution by the following equation (1). The annular zone detection unit 202 determines that the annular zone has been detected from the binarized image when the height of the evaluation value EV exceeds a predetermined threshold value.
EV = peak / width% (1)
The above “peak” is a value indicating the peak intensity in the frequency distribution (for example, the maximum value of white pixels in the frequency distribution or the number of white pixels at the position where the center of gravity is near the maximum value) (FIG. 9). The value of peak increases as the number of white pixels increases at the peak position.

また、「width%」は、度数分布の区間全体(図9では「α」で示す)に対して、白画素のピーク区間(図9では「β」で示す)が占める割合(β/α)を示す値である。上記のピーク区間は、白画素のピークを隔てて白画素の数が所定値をとる2点を結んだ幅である(図9参照)。例えば、ピーク区間としてピークの半値幅などを用いてもよい。ピークの高さが同じ条件下では、ピーク区間でのグラフの傾きが急峻であればピーク区間は狭くなるのでwidth%の値は低くなり、ピーク区間でのグラフの傾きが緩やかであればピーク区間は広くなるのでwidth%の値は高くなる。   Further, “width%” is a ratio (β / α) occupied by the peak section of white pixels (indicated by “β” in FIG. 9) to the entire frequency distribution section (indicated by “α” in FIG. 9). Is a value indicating The above-described peak interval is a width connecting two points where the number of white pixels takes a predetermined value across the peak of white pixels (see FIG. 9). For example, the half width of the peak may be used as the peak section. Under the same peak height, if the slope of the graph in the peak section is steep, the peak section becomes narrow, so the width% value is low. If the slope of the graph in the peak section is gentle, the peak section Since the width becomes wider, the width% value becomes higher.

なお、上記の式(1)では、peakの値が高くなるほど評価値EVの値は高くなり、width%の値が低くなるほど評価値EVの値は高くなる。   In the above equation (1), the evaluation value EV increases as the peak value increases, and the evaluation value EV increases as the width% value decreases.

ところで、輪帯検出部202は、各々の二値化画像での輪帯の検出位置(白画素のピーク)が、白画素として抽出される画素値の高さの順に並んでいない場合には、輪帯を検出できていないと判定してもよい。例えば、輪帯検出部202は、第1の二値化画像での白画素のピークが、第2の二値化画像での白画素のピークと比べて基準点から離れている場合には、輪帯を検出できていないと判定する。上記の場合には、白画素がフレアと無関係である可能性が高いからである。   By the way, the annular zone detection unit 202, when the annular zone detection positions (white pixel peaks) in each binarized image are not arranged in the order of the pixel values extracted as white pixels, It may be determined that the annular zone has not been detected. For example, the annular zone detection unit 202, when the white pixel peak in the first binarized image is far from the reference point compared to the white pixel peak in the second binarized image, It is determined that the ring zone is not detected. This is because in the above case, there is a high possibility that white pixels are unrelated to flare.

また、上記の例では、ステップS15で取得した飽和領域の座標を基準点(Xk,Yk)とする場合を説明した。しかし、実際には飽和領域の重心と輪帯の中心とは必ずしも一致しない。そのため、輪帯検出部202は、ステップS15で取得した飽和領域の座標から基準点を平面方向にずらしてもよい。そして、輪帯検出部202は、複数の基準点でそれぞれ評価値EVを求め、評価値EVが最大値をとる位置を最終的に基準点として決定してもよい。   In the above example, the case where the coordinates of the saturation region acquired in step S15 are set as the reference point (Xk, Yk) has been described. However, in reality, the center of gravity of the saturation region and the center of the annular zone do not always coincide. Therefore, the annular zone detection unit 202 may shift the reference point in the plane direction from the coordinates of the saturation region acquired in step S15. Then, the annular zone detection unit 202 may obtain an evaluation value EV at each of a plurality of reference points, and finally determine a position where the evaluation value EV has a maximum value as a reference point.

ステップS19において、輪帯検出部202は、ステップS18で輪帯が検出できたか否かを判定する。輪帯が検出できた場合(ステップS19の肯定判定)には、ステップS20に処理が移行する。一方、輪帯が検出できない場合(ステップS19の否定判定)には、ステップS21に処理が移行する。   In step S19, the annular zone detection unit 202 determines whether or not the annular zone has been detected in step S18. If an annular zone has been detected (Yes determination in step S19), the process proceeds to step S20. On the other hand, when the annular zone cannot be detected (No in step S19), the process proceeds to step S21.

ステップS20において、光源推定部203は、判定対象の飽和領域kがフレアを生じさせる光源であると推定する。そして、光源推定部203は、輪帯の中心に位置する飽和領域kの基準点を光源位置として保存する。このとき、光源推定部203は、飽和領域kのサイズを示す情報や、飽和領域kに対応する輪帯のサイズ(フレアの大きさ)の情報も保存する。なお、光源推定部203は、例えば、ステップS18における白画素のピークを示す距離から輪帯のサイズを算出すればよい。   In step S20, the light source estimation unit 203 estimates that the saturation region k to be determined is a light source that causes flare. And the light source estimation part 203 preserve | saves the reference point of the saturation area | region k located in the center of an annular zone as a light source position. At this time, the light source estimation unit 203 also stores information indicating the size of the saturation region k and information on the size of the annular zone (flare size) corresponding to the saturation region k. For example, the light source estimation unit 203 may calculate the size of the annular zone from the distance indicating the peak of the white pixel in step S18.

なお、ステップS18で評価値EVが最大値をとる位置を探索して基準点を決定した場合、ステップS20での輪帯検出部202は、上記の探索により決定された基準点を光源位置として保存する。   When the reference point is determined by searching for the position where the evaluation value EV has the maximum value in step S18, the annular zone detection unit 202 in step S20 stores the reference point determined by the search as a light source position. To do.

ステップS21において、画像処理部200は、全ての飽和領域を判定対象としたか(k=imaxであるか)否かを判定する。k=imaxである場合(ステップS21の肯定判定)には、ステップS23に処理が移行する。一方、k=imaxでない場合(ステップS21の否定判定)には、ステップS22に処理が移行する。   In step S <b> 21, the image processing unit 200 determines whether or not all saturated regions are to be determined (k = imax). If k = imax (Yes determination in step S21), the process proceeds to step S23. On the other hand, if k = imax is not satisfied (No in step S21), the process proceeds to step S22.

ステップS22において、画像処理部200は、カウンタkの値をインクリメントし(k=k+1)、ステップS18に処理を移行させる。ステップS22でkの値が更新されることにより、ループ後のS18以降の処理では、異なる飽和領域を判定対象として上記の動作が繰り返されることとなる。   In step S22, the image processing unit 200 increments the value of the counter k (k = k + 1), and shifts the processing to step S18. By updating the value of k in step S22, in the processing after S18 after the loop, the above operation is repeated with different saturated regions as determination targets.

なお、上記のステップS14〜ステップS22の例では、輝度画像で輪帯を抽出する場合を説明した。しかし、画像処理部200は、さらにRGBの各チャネルを対象としてそれぞれステップS14〜ステップS22と同様の処理を行ってもよい。   In the example of steps S14 to S22 described above, the case where the annular zone is extracted from the luminance image has been described. However, the image processing unit 200 may further perform the same processing as in steps S14 to S22 for each of the RGB channels.

ステップS23において、フレア補正部204は、入力画像のうち、フレアが発生していると推定された光源の周囲にフレアを抑制する補正処理(フレア補正処理)を施す。例えば、フレア補正部204は、特開2012−134630号公報に開示の手法を適用してフレア補正処理を施せばよい。   In step S <b> 23, the flare correction unit 204 performs correction processing (flare correction processing) for suppressing flare around the light source that is estimated to have flare in the input image. For example, the flare correction unit 204 may perform flare correction processing by applying the method disclosed in Japanese Patent Application Laid-Open No. 2012-134630.

上記のフレア補正処理の概要を説明すると、フレア補正部204は、以下の手順(C)〜(E)により、フレアが発生していると推定された各々の光源を基準として、それぞれフレア補正処理を施せばよい。   The outline of the flare correction process will be described. The flare correction unit 204 performs the flare correction process on the basis of each light source in which flare is estimated to occur by the following procedures (C) to (E). Can be applied.

(C)第1に、フレア補正部204は、入力画像のうち、フレア補正処理を施すフレア補正範囲を設定する。例えば、フレア補正部204は、ステップS20で保存された光源位置の情報を用いて、フレア補正範囲の中心を決定する。そして、フレア補正部204は、ステップS20で保存された輪帯のサイズの情報を用いて、光源位置を中心としてフレア補正範囲の位置を設定する。上記のフレア補正範囲の形状は、円形に限定されず、例えば矩形や輪帯の相似形であってもよい。なお、フレア補正範囲は、フレアが発生していると推定された各々の光源にそれぞれ設定される。   (C) First, the flare correction unit 204 sets a flare correction range for performing flare correction processing in the input image. For example, the flare correction unit 204 determines the center of the flare correction range using the information on the light source position stored in step S20. And the flare correction | amendment part 204 sets the position of the flare correction range centering | focusing on a light source position using the information on the size of the annular zone preserve | saved at step S20. The shape of the flare correction range is not limited to a circle, and may be, for example, a rectangle or a similar shape of an annular zone. The flare correction range is set for each light source that is estimated to have flare.

(D)第2に、フレア補正部204は、フレア補正範囲にフレアでの色にじみ(色フレア)が発生しているか否かを判定する。例えば、フレア補正部204は、フレア補正範囲での入力画像の平均値を色成分(RGB)毎に算出する。そして、上記の平均値の色成分間でのばらつきが所定範囲を超えている場合、フレア補正部204は、フレア補正範囲に色フレアが発生していると判定する。色フレアが発生しているフレア補正範囲には、フレア補正部204が後述の(E)の処理を行う。   (D) Secondly, the flare correction unit 204 determines whether or not color flare (color flare) occurs in the flare correction range. For example, the flare correction unit 204 calculates the average value of the input image in the flare correction range for each color component (RGB). When the variation between the color components of the average value exceeds the predetermined range, the flare correction unit 204 determines that a color flare has occurred in the flare correction range. In the flare correction range where the color flare occurs, the flare correction unit 204 performs the process (E) described later.

一方、上記の平均値の色成分間でのばらつきが所定範囲を超えていない場合、フレア補正部204は、フレア補正範囲に色フレアが発生していない(無色のフレアである)と判定する。なお、色フレアが発生していないフレア補正範囲には、フレア補正部204は後述の(E)の処理を行わない。なお、フレア補正部204は、色フレアが発生していないフレア補正範囲に無色の輝度フレアに対する一般的な補正処理を施してもよい。   On the other hand, when the variation between the color components of the average value does not exceed the predetermined range, the flare correction unit 204 determines that no color flare is generated in the flare correction range (a colorless flare). Note that the flare correction unit 204 does not perform the process (E) described later in a flare correction range in which no color flare occurs. Note that the flare correction unit 204 may perform a general correction process for a colorless luminance flare in a flare correction range in which no color flare occurs.

(E)第3に、フレア補正部204は、フレア補正範囲の各画素につき、補正すべき色成分(例えばR成分またはB成分)を他の基準色成分(例えばG成分)で除算する。これにより、フレア補正範囲内の相関色分布が生成される。そして、フレア補正部204は、フレア補正範囲の各画素において、基準色成分に相関色分布の値を乗算する。これにより、フレア補正部204は、フレア補正範囲での補正すべき色成分の補正画素値を取得できる。上記のフレア補正範囲での色成分の補正は、1つの色成分のみを対象としてもよく、2つの色成分を対象としてもよい。以上の処理によって、入力画像上で飽和領域の周囲に発生していた色フレアが抑制される。   (E) Third, the flare correction unit 204 divides the color component (for example, R component or B component) to be corrected by another reference color component (for example, G component) for each pixel in the flare correction range. Thereby, a correlated color distribution within the flare correction range is generated. Then, the flare correction unit 204 multiplies the reference color component by the value of the correlated color distribution in each pixel in the flare correction range. Thereby, the flare correction unit 204 can acquire the correction pixel value of the color component to be corrected in the flare correction range. The correction of the color components in the flare correction range described above may target only one color component or two color components. Through the above processing, color flare that has occurred around the saturation region on the input image is suppressed.

なお、フレア補正部204は、フレア補正範囲に対応するマスク画像にガウシアンフィルタをかけてグレースケールマスク画像を生成し、色フレアを補正した色成分についてグレースケールマスク画像との論理積をとって平滑化処理を施してもよい。上記のグレースケールマスクの適用により、フレア補正範囲の境界部分での階調変化を目立ちにくくすることができる。   The flare correction unit 204 generates a grayscale mask image by applying a Gaussian filter to the mask image corresponding to the flare correction range, and smoothes the color component obtained by correcting the color flare with the grayscale mask image. The treatment may be performed. By applying the above gray scale mask, it is possible to make the change in gradation at the boundary of the flare correction range less noticeable.

ステップS24において、画像処理部200は、入力画像をモニタ109へ再生表示させる。画像処理部200による補正が行われている場合、モニタ109には補正後の入力画像が表示される。なお、ステップS24において、ユーザから保存指示が入力された場合、画像処理部200は、補正後の画像をユーザが指示した保存先(例えば記憶装置103など)に記録する。   In step S24, the image processing unit 200 reproduces and displays the input image on the monitor 109. When correction by the image processing unit 200 is performed, the corrected input image is displayed on the monitor 109. In step S24, when a save instruction is input from the user, the image processing unit 200 records the corrected image in a save destination (for example, the storage device 103) designated by the user.

ステップS25において、画像処理部200は、例えば、階調変換、ノイズ除去、輪郭強調、明度補正、彩度補正などの画像処理を含むレタッチ処理の指示をユーザから受け付けたか否か判定する。レタッチ処理の指示を受け付けた場合(ステップS25の肯定判定)には、ステップS26に処理が移行する。一方、レタッチ処理の指示を受け付けていない場合(ステップS25の否定判定)には、ステップS27に処理が移行する。   In step S <b> 25, the image processing unit 200 determines whether or not an instruction for retouching processing including image processing such as gradation conversion, noise removal, edge enhancement, brightness correction, and saturation correction has been received from the user. If an instruction for retouching processing has been received (affirmative determination in step S25), the process proceeds to step S26. On the other hand, when the instruction for the retouching process is not received (No at Step S25), the process proceeds to Step S27.

ステップS26において、画像処理部200は、入力画像に対してユーザから指示された内容の画像処理(レタッチ処理)を施し、ステップS24に処理を移行させる。   In step S <b> 26, the image processing unit 200 performs image processing (retouch processing) of the content instructed by the user on the input image, and shifts the processing to step S <b> 24.

ステップS27において、画像処理部200は、終了指示を受け付けたか否かを判定する。終了指示を受け付けた場合(ステップS27の肯定判定)には、画像処理部200は処理を終了させる。一方、終了指示を受け付けていない場合(ステップS27の否定判定)には、ステップS24に処理が移行する。以上で、図2の流れ図の説明を終了する。   In step S27, the image processing unit 200 determines whether an end instruction has been received. If an end instruction has been received (affirmative determination in step S27), the image processing unit 200 ends the process. On the other hand, when the termination instruction has not been received (No at Step S27), the process proceeds to Step S24. Above, description of the flowchart of FIG. 2 is complete | finished.

以下、第1実施形態での作用効果を述べる。   Hereinafter, the operational effects of the first embodiment will be described.

第1実施形態の画像処理部200は、複数の二値化画像を用いて、入力画像に含まれる輪帯を検出する(S16〜S18)。そして、画像処理部200は、検出された輪帯の位置からフレアを生じさせる光源位置を推定し(S20)、推定された光源位置を基準として設定されたフレア補正範囲にフレア補正処理を行う(S23)。これにより、画像処理部200は、輪帯がなくフレアの発生していない飽和領域に対して不要なフレア補正が行われることを防止できる。また、画像処理部200は、入力画像の画素値の情報からフレアの発生箇所を特定できるので、撮影光学系の結像特性を示す情報が利用できない環境でも、フレアの補正を精度よく行うことが可能となる。   The image processing unit 200 of the first embodiment detects an annular zone included in the input image using a plurality of binarized images (S16 to S18). Then, the image processing unit 200 estimates a light source position that causes flare from the detected position of the annular zone (S20), and performs a flare correction process on the flare correction range set with the estimated light source position as a reference ( S23). Thereby, the image processing unit 200 can prevent unnecessary flare correction from being performed on a saturated region where there is no ring zone and flare is not generated. In addition, since the image processing unit 200 can identify the flare occurrence location from the pixel value information of the input image, the flare can be corrected accurately even in an environment where information indicating the imaging characteristics of the imaging optical system is not available. It becomes possible.

また、画像処理部200は、二値化画像を生成するときに閾値上限および閾値下限の組み合わせを変化させて、それぞれ抽出する白画素の範囲が異なる複数の二値化画像(図6)を用いて輪帯を検出する(S16〜S18)。これにより、画像処理部200は、入力画像に含まれる輪帯の形状を明確に抽出できるので、フレアが発生している光源を容易に推定できる。   Further, the image processing unit 200 uses a plurality of binarized images (FIG. 6) in which the combination of the threshold upper limit and the threshold lower limit is changed when the binarized image is generated, and the range of white pixels to be extracted is different. The ring zone is detected (S16 to S18). Thereby, the image processing unit 200 can clearly extract the shape of the annular zone included in the input image, and thus can easily estimate the light source in which the flare is generated.

また、画像処理部200は、二値化画像での飽和領域からの距離と、二値化画像の白画素数との相関を示す度数分布を求め、度数分布での白画素のピークの高さと、ピークの幅とに基づいて輪帯を検出する(S18)。これにより、画像処理部200は、各々の二値化画像で輪帯の位置を明確に抽出できる。   In addition, the image processing unit 200 obtains a frequency distribution indicating a correlation between the distance from the saturated region in the binarized image and the number of white pixels in the binarized image, and calculates the peak height of the white pixel in the frequency distribution. The ring zone is detected based on the peak width (S18). Thereby, the image processing unit 200 can clearly extract the position of the annular zone from each binarized image.

また、画像処理部200は、フレア補正処理(S23)により、入力画像の光源の周囲に生じる色フレアを補正する。上記の処理により、例えば、回折光学素子を含む撮影光学系で撮影された画像では、回折光学素子による不自然な色フレアを除去できるので、画像の見栄えを向上させることができる。   Further, the image processing unit 200 corrects color flare generated around the light source of the input image by flare correction processing (S23). By the above processing, for example, in an image photographed by a photographing optical system including a diffractive optical element, unnatural color flare due to the diffractive optical element can be removed, so that the appearance of the image can be improved.

<第2実施形態の説明>
図10は、本件開示の撮像装置の一例である第2実施形態の電子カメラの構成例を示す図である。なお、第2実施形態において、第1実施形態と同一または同様の構成には同じ符号を付して説明を省略する。
<Description of Second Embodiment>
FIG. 10 is a diagram illustrating a configuration example of the electronic camera according to the second embodiment which is an example of the imaging device disclosed herein. Note that in the second embodiment, the same or similar components as those in the first embodiment are denoted by the same reference numerals and description thereof is omitted.

電子カメラ300は、レンズユニット301と、撮像部302と、カメラマイコン303と、第1メモリ304と、第2メモリ305と、各種の画像を表示する表示デバイスを含む表示部306と、メディアI/F307と、ユーザからの操作を受け付ける操作部308とを有する。ここで、撮像部302、第1メモリ304、第2メモリ305、表示部306、メディアI/F307、操作部308は、それぞれカメラマイコン303に接続されている。   The electronic camera 300 includes a lens unit 301, an imaging unit 302, a camera microcomputer 303, a first memory 304, a second memory 305, a display unit 306 including a display device that displays various images, a media I / O F307 and an operation unit 308 that receives an operation from the user. Here, the imaging unit 302, the first memory 304, the second memory 305, the display unit 306, the media I / F 307, and the operation unit 308 are each connected to the camera microcomputer 303.

レンズユニット301は、電子カメラ300に着脱可能であり、例えば、回折光学素子などの複数のレンズを含む撮影光学系309を有している。撮影光学系309のレンズ構成等を示すレンズ情報は、電子カメラ300とレンズユニット301とのマウント(不図示)を介してカメラマイコン303に入力される。なお、図10では、撮影光学系309を1枚のレンズで示している。   The lens unit 301 can be attached to and detached from the electronic camera 300, and includes, for example, a photographing optical system 309 including a plurality of lenses such as a diffractive optical element. Lens information indicating the lens configuration and the like of the photographing optical system 309 is input to the camera microcomputer 303 via a mount (not shown) between the electronic camera 300 and the lens unit 301. In FIG. 10, the photographing optical system 309 is shown as a single lens.

撮像部302は、撮影光学系309を介して入射された光束による被写体の結像を撮像(撮影)するモジュールである。例えば、撮像部302は、光電変換を行う撮像素子と、撮像素子の出力にアナログ信号処理やA/D変換処理などを施す信号処理回路とを含んでいる。なお、上記の撮像素子の画素には、例えば公知のベイヤ配列に従ってRGBのカラーフィルタが配置されており、カラーフィルタでの色分解によって各色に対応する画像信号を出力する。これにより、撮像部302は、撮影時に例えばRGBのカラー画像を取得できる。   The imaging unit 302 is a module that captures (captures) an image of a subject by a light beam incident via the imaging optical system 309. For example, the imaging unit 302 includes an imaging device that performs photoelectric conversion, and a signal processing circuit that performs analog signal processing, A / D conversion processing, and the like on the output of the imaging device. Note that, for example, RGB color filters are arranged in the pixels of the image sensor according to a known Bayer array, and image signals corresponding to the respective colors are output by color separation in the color filters. Thereby, the imaging unit 302 can acquire, for example, an RGB color image at the time of shooting.

カメラマイコン303は、電子カメラ300の動作を統括的に制御するプロセッサである。例えば、カメラマイコン303は、撮像部302での撮影制御、自動露出制御、表示部306での画像の表示制御、メディアI/F307での画像の記録制御を行う。また、第2実施形態でのカメラマイコン303は、本件開示の画像処理装置の一例である画像処理部200を有している。第2実施形態においても、画像処理部200は、画像生成部201、輪帯検出部202、光源推定部203、フレア補正部204をそれぞれ有している。なお、図10に示す画像処理部200は、メモリにロードされた画像処理プログラムによって実現されてもよく、任意のプロセッサ、メモリ、電子回路によってハードウェア的に実現されてもよい。   The camera microcomputer 303 is a processor that comprehensively controls the operation of the electronic camera 300. For example, the camera microcomputer 303 performs shooting control in the imaging unit 302, automatic exposure control, image display control in the display unit 306, and image recording control in the media I / F 307. In addition, the camera microcomputer 303 in the second embodiment includes an image processing unit 200 that is an example of an image processing apparatus disclosed herein. Also in the second embodiment, the image processing unit 200 includes an image generation unit 201, an annular zone detection unit 202, a light source estimation unit 203, and a flare correction unit 204. Note that the image processing unit 200 illustrated in FIG. 10 may be realized by an image processing program loaded in a memory, or may be realized in hardware by an arbitrary processor, memory, or electronic circuit.

第1メモリ304は、画像処理の前工程や後工程で撮像した画像のデータを一時的に記憶するバッファメモリである。例えば、第1メモリ304は、揮発性の半導体メモリである。第2メモリ305は、カメラマイコン303で処理されるプログラムや、プログラムで使用される各種データを記憶するメモリである。例えば、第2メモリ305は、フラッシュメモリ等の不揮発性メモリである。   The first memory 304 is a buffer memory that temporarily stores image data captured in the pre-process and post-process of image processing. For example, the first memory 304 is a volatile semiconductor memory. The second memory 305 is a memory that stores programs processed by the camera microcomputer 303 and various data used in the programs. For example, the second memory 305 is a nonvolatile memory such as a flash memory.

メディアI/F307は、不揮発性の記憶媒体310を接続するためのコネクタを有している。そして、メディアI/F307は、コネクタに接続された記憶媒体310に対してデータ(記録用画像)の書き込み/読み込みを実行する。記憶媒体310は、例えば、ハードディスクや、半導体メモリを内蔵したメモリカードである。   The media I / F 307 has a connector for connecting a nonvolatile storage medium 310. The media I / F 307 executes writing / reading of data (recording image) with respect to the storage medium 310 connected to the connector. The storage medium 310 is, for example, a hard disk or a memory card incorporating a semiconductor memory.

図11は、第2実施形態での電子カメラの動作例を示す流れ図である。図11の例では、電子カメラ300が撮影直後に画像にフレア補正処理を施す場合を説明する。図11の例では、図2に示すステップS11、S12がそれぞれステップS11’、S12’に置き換わる。また、図11の例では、図2に示すステップS24以降の処理がステップS31に置き換わる。なお、図11のステップS13〜S23の処理は、図2の場合と同様であるので重複説明を省略する。   FIG. 11 is a flowchart illustrating an operation example of the electronic camera according to the second embodiment. In the example of FIG. 11, a case where the electronic camera 300 performs flare correction processing on an image immediately after shooting will be described. In the example of FIG. 11, steps S11 and S12 shown in FIG. 2 are replaced with steps S11 'and S12', respectively. Further, in the example of FIG. 11, the processing after step S24 shown in FIG. 2 is replaced with step S31. Note that the processing in steps S13 to S23 in FIG. 11 is the same as that in FIG.

ステップS11’において、カメラマイコン303は、撮像部302を駆動させて被写体の像を撮影する。撮像部302で撮影された撮影画像のデータは、カメラマイコン303に入力される。これにより、カメラマイコン303は、フレア補正処理の対象となる入力画像を撮像部302から取得する。   In step S <b> 11 ′, the camera microcomputer 303 drives the imaging unit 302 to capture an image of the subject. Data of the captured image captured by the imaging unit 302 is input to the camera microcomputer 303. As a result, the camera microcomputer 303 acquires an input image to be subjected to flare correction processing from the imaging unit 302.

ステップS12’において、画像処理部200は、入力画像にフレア補正処理を施すフレア補正モードであるか否かを判定する。一例として、ユーザがフレア補正モードの設定をオンにしている場合や、レンズユニット301のレンズ情報を参照して、装着中のレンズユニット301が回折光学素子を有している場合に、画像処理部200は、フレア補正モードであると判定する。   In step S12 ', the image processing unit 200 determines whether or not it is a flare correction mode in which flare correction processing is performed on the input image. As an example, when the user turns on the setting of the flare correction mode, or when the lens unit 301 being mounted has a diffractive optical element with reference to the lens information of the lens unit 301, the image processing unit 200 is determined to be the flare correction mode.

フレア補正モードである場合(ステップS12’の肯定判定)には、図11のステップS13に処理が移行する。一方、フレア補正モードではない場合(ステップS12’の否定判定)には、図11のステップS31に処理が移行する。   If it is the flare correction mode (Yes determination in step S12 '), the process proceeds to step S13 in FIG. On the other hand, when the mode is not the flare correction mode (negative determination in step S12 '), the process proceeds to step S31 in FIG.

ステップS31において、カメラマイコン303は、メディアI/F307を介して撮影画像のデータを記憶媒体310に記録する。以上で、図11の流れ図の説明を終了する。   In step S <b> 31, the camera microcomputer 303 records captured image data in the storage medium 310 via the media I / F 307. Above, description of the flowchart of FIG. 11 is complete | finished.

なお、第2実施形態において、メディアI/F307を介して取得した撮影画像のデータを対象として、画像処理部200が後処理工程でフレア補正処理を行うこともできる。上記の場合の処理は、第1実施形態で説明した図2の処理と同様となるので説明は省略する。   Note that in the second embodiment, the image processing unit 200 can also perform flare correction processing in a post-processing step on the captured image data acquired via the media I / F 307. Since the process in the above case is the same as the process of FIG. 2 described in the first embodiment, the description thereof is omitted.

以上のように、第2実施形態の電子カメラにおいても、第1実施形態の構成と同様の効果を得ることができる。   As described above, also in the electronic camera of the second embodiment, the same effect as the configuration of the first embodiment can be obtained.

<実施形態の補足事項>
(1)上記の実施形態では、入力画像から二値化画像を生成する例を説明した。しかし、本件開示の構成では、入力画像の代わりに、入力画像を間引きまたは低解像度化した縮小画像を用いてもよい。縮小画像を用いる場合には、演算処理を行う画素数が少なくなるので、演算負荷を低下させることができる。
<Supplementary items of the embodiment>
(1) In the above embodiment, an example in which a binarized image is generated from an input image has been described. However, in the configuration of the present disclosure, a reduced image obtained by thinning or reducing the resolution of the input image may be used instead of the input image. In the case of using a reduced image, the number of pixels to be subjected to calculation processing is reduced, so that the calculation load can be reduced.

また、本件開示の構成では、入力画像の代わりに、入力画像を平滑化した平滑化画像を用いてもよい。平滑化画像を用いる場合には、例えば、細かい輝点やノイズによる白点が除去されるので、フレアを生じさせる光源の推定をより精度よく行うことができる。   In the configuration of the present disclosure, a smoothed image obtained by smoothing the input image may be used instead of the input image. In the case of using a smoothed image, for example, fine bright spots and white spots due to noise are removed, so that it is possible to more accurately estimate the light source that causes flare.

なお、本件開示の構成では、入力画像の代わりに、平滑化処理を施した縮小画像を用いてもよい。上記の場合、平滑化処理と縮小画像を生成する処理の順番は適宜入れ替えることができる。   In the configuration of the present disclosure, a reduced image subjected to smoothing processing may be used instead of the input image. In the above case, the order of the smoothing process and the process of generating the reduced image can be changed as appropriate.

(2)上記の実施形態ではカラー画像の輝度成分を用いて輪帯を検出する例を説明した。しかし、本件開示の構成では、入力画像のG成分を輝度成分とみなして、G成分の二値化画像から輪帯を検出してもよい。   (2) In the above embodiment, the example in which the annular zone is detected using the luminance component of the color image has been described. However, in the configuration disclosed herein, the G component of the input image may be regarded as the luminance component, and the annular zone may be detected from the binary image of the G component.

(3)上記の実施形態で説明したフレア補正処理はあくまで一例にすぎず、本件開示の構成が他の手法によりフレアの補正を行うものであってもよい。例えば、色フレアの補正のときに、フレア補正範囲の彩度を低下させる処理を行ってもよい。なお、本件開示の構成によるフレアの光源位置の推定は、回折光学素子による色フレアに限定されず、他のフレアの光源位置の推定にも適用できる。   (3) The flare correction processing described in the above embodiment is merely an example, and the configuration disclosed herein may correct flare by other methods. For example, when correcting the color flare, a process of reducing the saturation of the flare correction range may be performed. Note that the estimation of the light source position of the flare according to the configuration of the present disclosure is not limited to the color flare by the diffractive optical element, but can also be applied to the estimation of the light source position of another flare.

(4)上記の第2実施形態ではレンズ交換式の電子カメラの構成例を説明した。しかし、本件開示の撮像装置は、レンズ一体型の電子カメラであってもよい。また、本件開示の撮像装置は、例えば、携帯電子機器(スマートフォン、携帯電話、タブレットコンピュータ等)に組み込まれるカメラモジュールであってもよい。   (4) In the second embodiment, the configuration example of the interchangeable lens type electronic camera has been described. However, the imaging device disclosed herein may be a lens-integrated electronic camera. In addition, the imaging device disclosed herein may be a camera module incorporated in a portable electronic device (smart phone, mobile phone, tablet computer, or the like), for example.

以上の詳細な説明により、実施形態の特徴点および利点は明らかになるであろう。これは、特許請求の範囲が、その精神および権利範囲を逸脱しない範囲で前述のような実施形態の特徴点および利点にまで及ぶことを意図するものである。また、当該技術分野において通常の知識を有する者であれば、あらゆる改良および変更に容易に想到できるはずである。したがって、発明性を有する実施形態の範囲を前述したものに限定する意図はなく、実施形態に開示された範囲に含まれる適当な改良物および均等物に拠ることも可能である。   From the above detailed description, features and advantages of the embodiments will become apparent. It is intended that the scope of the claims extend to the features and advantages of the embodiments as described above without departing from the spirit and scope of the right. Also, any improvement and modification should be readily conceivable by those having ordinary knowledge in the art. Therefore, there is no intention to limit the scope of the inventive embodiments to those described above, and appropriate modifications and equivalents included in the scope disclosed in the embodiments can be used.

101…コンピュータ、102…データ読込部、103…記憶装置、104…CPU、105…メモリ、106…入出力I/F、107…バス、108…入力デバイス、109…モニタ、200…画像処理部、201…画像生成部、202…輪帯検出部、203…光源推定部、204…フレア補正部、300…電子カメラ、301…レンズユニット、302…撮像部、303…カメラマイコン、304…第1メモリ、305…第2メモリ、306…表示部、307…メディアI/F、308…操作部、309…撮影光学系、310…記憶媒体 DESCRIPTION OF SYMBOLS 101 ... Computer, 102 ... Data reading part, 103 ... Memory | storage device, 104 ... CPU, 105 ... Memory, 106 ... Input / output I / F, 107 ... Bus, 108 ... Input device, 109 ... Monitor, 200 ... Image processing part, DESCRIPTION OF SYMBOLS 201 ... Image generation part, 202 ... Ring zone detection part, 203 ... Light source estimation part, 204 ... Flare correction part, 300 ... Electronic camera, 301 ... Lens unit, 302 ... Imaging part, 303 ... Camera microcomputer, 304 ... 1st memory 305 ... second memory, 306 ... display unit, 307 ... media I / F, 308 ... operation unit, 309 ... shooting optical system, 310 ... storage medium

Claims (9)

撮像により生成された入力画像を取得する手順と、
前記入力画像を閾値上限及び閾値下限の範囲で閾値処理して処理画像を生成する手順と、
前記処理画像に基づいてフレアを検出する手順と、
をコンピュータに実行させる画像処理プログラム。
A procedure for acquiring an input image generated by imaging;
A procedure for generating a processed image by performing threshold processing on the input image in a range of a threshold upper limit and a threshold lower limit;
Detecting a flare based on the processed image;
An image processing program for causing a computer to execute.
請求項1に記載の画像処理プログラムにおいて、
前記処理画像を生成する手順では、
前記閾値上限及び前記閾値下限の組み合わせが異なる複数種類の範囲の閾値で閾値処理して複数の前記処理画像を生成する画像処理プログラム。
In the image processing program according to claim 1,
In the procedure for generating the processed image,
An image processing program for generating a plurality of processed images by performing threshold processing with a plurality of types of thresholds having different combinations of the upper threshold and lower threshold.
請求項1又は請求項2に記載の画像処理プログラムにおいて、
さらに、前記フレアを検出する手順により検出されたフレアを、前記処理画像に基づいて補正する手順をコンピュータに実行させる画像処理プログラム。
In the image processing program according to claim 1 or 2,
An image processing program for causing a computer to execute a procedure for correcting the flare detected by the procedure for detecting the flare based on the processed image.
請求項3に記載の画像処理プログラムにおいて、
複数の前記処理画像を用いて所定の分布を求める手順を実行させ、
前記補正する手順では、前記分布に基づいて前記フレアを抑制する画像処理プログラム。
The image processing program according to claim 3.
A procedure for obtaining a predetermined distribution using a plurality of the processed images is executed,
An image processing program that suppresses the flare based on the distribution in the correction procedure.
請求項3又は請求項4に記載の画像処理プログラムにおいて、
前記入力画像を取得する手順では、回折光学素子を含む撮影光学系で結像された像を撮像した入力画像を取得し、
前記補正する手順では、前記回折光学素子に由来する前記フレアでの色にじみを補正することを特徴とする画像処理プログラム。
In the image processing program according to claim 3 or 4,
In the procedure of acquiring the input image, an input image obtained by capturing an image formed by a photographing optical system including a diffractive optical element is acquired,
An image processing program characterized in that, in the correcting step, color blur in the flare derived from the diffractive optical element is corrected.
請求項1から請求項5のいずれか1項に記載の画像処理プログラムにおいて、
前記処理画像を生成する手順では、前記入力画像の輝度成分について前記処理画像を生成する画像処理プログラム。
In the image processing program according to any one of claims 1 to 5,
In the procedure for generating the processed image, an image processing program for generating the processed image for a luminance component of the input image.
撮像により生成された入力画像を取得する取得部と、
前記入力画像を閾値上限及び閾値下限の範囲で閾値処理して処理画像を生成する生成部と、
前記処理画像に基づいてフレアを検出する検出部と、
を備える画像処理装置。
An acquisition unit for acquiring an input image generated by imaging;
A generating unit that generates a processed image by performing threshold processing on the input image in a range of a threshold upper limit and a threshold lower limit;
A detection unit for detecting flare based on the processed image;
An image processing apparatus comprising:
撮影光学系の結像を撮像する撮像部と、
請求項7に記載の画像処理装置と、
を備える撮像装置。
An imaging unit for imaging the imaging optical system;
An image processing apparatus according to claim 7;
An imaging apparatus comprising:
請求項8に記載の撮像装置において、
前記撮影光学系は、回折光学素子を含む撮像装置。
The imaging device according to claim 8,
The imaging optical system is an imaging apparatus including a diffractive optical element.
JP2018156623A 2018-08-23 2018-08-23 Image processing program, image processing apparatus, and imaging apparatus Pending JP2018198456A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018156623A JP2018198456A (en) 2018-08-23 2018-08-23 Image processing program, image processing apparatus, and imaging apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018156623A JP2018198456A (en) 2018-08-23 2018-08-23 Image processing program, image processing apparatus, and imaging apparatus

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2017207336A Division JP6390779B2 (en) 2017-10-26 2017-10-26 Image processing program, image processing apparatus, and imaging apparatus

Publications (1)

Publication Number Publication Date
JP2018198456A true JP2018198456A (en) 2018-12-13

Family

ID=64662456

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018156623A Pending JP2018198456A (en) 2018-08-23 2018-08-23 Image processing program, image processing apparatus, and imaging apparatus

Country Status (1)

Country Link
JP (1) JP2018198456A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111862195A (en) * 2020-08-26 2020-10-30 Oppo广东移动通信有限公司 Light spot detection method and device, terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005198890A (en) * 2004-01-16 2005-07-28 Fuji Photo Film Co Ltd Abnormal shadow detecting method, abnormal shadow detecting apparatus and program for the same
JP2008289034A (en) * 2007-05-21 2008-11-27 Canon Inc Image processor and image processing program
JP2010096668A (en) * 2008-10-17 2010-04-30 Denso Corp Light source identifying device, light source identifying program, vehicle detecting device, and light control device
JP2011103070A (en) * 2009-11-11 2011-05-26 Toyota Motor Corp Nighttime vehicle detector
JP2012133462A (en) * 2010-12-20 2012-07-12 Nikon Corp Image processing method, image processing program, image processing apparatus and imaging apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005198890A (en) * 2004-01-16 2005-07-28 Fuji Photo Film Co Ltd Abnormal shadow detecting method, abnormal shadow detecting apparatus and program for the same
JP2008289034A (en) * 2007-05-21 2008-11-27 Canon Inc Image processor and image processing program
JP2010096668A (en) * 2008-10-17 2010-04-30 Denso Corp Light source identifying device, light source identifying program, vehicle detecting device, and light control device
JP2011103070A (en) * 2009-11-11 2011-05-26 Toyota Motor Corp Nighttime vehicle detector
JP2012133462A (en) * 2010-12-20 2012-07-12 Nikon Corp Image processing method, image processing program, image processing apparatus and imaging apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111862195A (en) * 2020-08-26 2020-10-30 Oppo广东移动通信有限公司 Light spot detection method and device, terminal and storage medium
CN111862195B (en) * 2020-08-26 2024-04-09 Oppo广东移动通信有限公司 Light spot detection method and device, terminal and storage medium

Similar Documents

Publication Publication Date Title
JP4534756B2 (en) Image processing apparatus, image processing method, imaging apparatus, program, and recording medium
JP5047048B2 (en) Image processing apparatus, imaging apparatus, control method, program, and storage medium
US8472747B2 (en) Image composition device, image composition method, and storage medium storing program
US20140185870A1 (en) Image processing apparatus and image processing method
WO2020205008A1 (en) Image fusion processing module
JP2015156615A (en) Image processing system, image processing method, control program, and recording medium
CN114418879A (en) Image processing method, image processing device, electronic equipment and storage medium
US8866942B2 (en) Auto focus adjusting device and method and recording medium of the same method
US11080873B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
US10217194B2 (en) Image shooting apparatus that extends depth of field by recovering blurred image and an image shooting method thereof
US10235742B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and non-transitory computer-readable storage medium for adjustment of intensity of edge signal
JP2008167280A (en) Image processing device and method, and imaging apparatus
JP2018198456A (en) Image processing program, image processing apparatus, and imaging apparatus
JP6232808B2 (en) Image processing program, image processing apparatus, and imaging apparatus
JP6390779B2 (en) Image processing program, image processing apparatus, and imaging apparatus
US9661302B2 (en) Depth information acquisition apparatus, imaging apparatus, depth information acquisition method and program
JP5274697B2 (en) Image processing apparatus and image processing method
JP5423663B2 (en) Image processing method, image processing program, image processing apparatus, and imaging apparatus
US11115582B2 (en) Imaging control apparatus, imaging apparatus, and recording medium
JP4877402B2 (en) Image processing apparatus, image processing method, imaging apparatus, program, and recording medium
JP6436840B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP5744945B2 (en) Image processing apparatus and method, and imaging apparatus
JP6331363B2 (en) Subject identification device, imaging device, and program
JP5163735B2 (en) Image processing method, image processing program, image processing apparatus, and imaging apparatus
JP6029464B2 (en) Imaging device, control method thereof, and control program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180827

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190610

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190618

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20190816

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20191210