JP2009064459A - Program for correcting red eye in image, recording medium and pink eye correction method - Google Patents

Program for correcting red eye in image, recording medium and pink eye correction method Download PDF

Info

Publication number
JP2009064459A
JP2009064459A JP2008274141A JP2008274141A JP2009064459A JP 2009064459 A JP2009064459 A JP 2009064459A JP 2008274141 A JP2008274141 A JP 2008274141A JP 2008274141 A JP2008274141 A JP 2008274141A JP 2009064459 A JP2009064459 A JP 2009064459A
Authority
JP
Japan
Prior art keywords
correction
feature
red
eye
value
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.)
Granted
Application number
JP2008274141A
Other languages
Japanese (ja)
Other versions
JP4640490B2 (en
Inventor
Hiroki Yoshida
宏樹 吉田
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.)
Konica Minolta Business Technologies Inc
Original Assignee
Konica Minolta Business Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Konica Minolta Business Technologies Inc filed Critical Konica Minolta Business Technologies Inc
Priority to JP2008274141A priority Critical patent/JP4640490B2/en
Publication of JP2009064459A publication Critical patent/JP2009064459A/en
Application granted granted Critical
Publication of JP4640490B2 publication Critical patent/JP4640490B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To appropriately correct red eyes in an image, while considering gradation. <P>SOLUTION: A plurality of feature areas requiring red eye correction are extracted from an image on the basis of saturation, lightness and hue that are feature quantities, and a histogram is generated for each of the feature quantities of the feature areas (a step S32). Parameters such as a minimum, a maximum, a mode, a variance, an average and so on of the feature quantities are derived from the histograms, and a correction curve for the feature quantities is generated on the basis of the parameters (steps S33, S34). The feature quantities are corrected according to the correction curve (a step S35). As a result of this, the feature quantities of the feature areas can be appropriately corrected by using the correction curve for each of the feature quantities according to the property of the feature areas, and red eyes occurring in various aspects can be appropriately corrected, while considering gradation. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像中の赤目を補正する技術に関する。   The present invention relates to a technique for correcting red eyes in an image.

フラッシュを用いて撮影を行うと画像中の人物の目が赤色あるいは黄金色に光って写る赤目現象が生じることがある。従来より、銀塩カメラにて取得された写真をスキャナにて取り込むことにより、あるいは、デジタルカメラにて撮影することにより取得された画像データに対して処理を施し、画像中の赤目を通常の目へと補正する技術が提案されている。   When shooting with a flash, there may be a red-eye phenomenon in which the eyes of a person in the image shine in red or golden. Conventionally, the image data acquired by taking a photograph acquired with a silver salt camera with a scanner or taking a picture with a digital camera is processed, and the red eyes in the image are A technique for correcting the error has been proposed.

赤目を補正する一般的な技術としては、画像中の赤目が存在する領域(以下、「赤目領域」という。)に対して赤色を他の色に置換したり、明度または彩度を下げるといった処理が知られている。赤目領域に対してこのような単純な処理を施した場合、目の中の彩度、明度および色相のグラデーションが失われてしまい、不自然な目となる。そこで、例えば、特許文献1や特許文献2では、瞳や赤目領域の周辺部から中央部にかけて明度または彩度を漸次減少させるようにしている。   As a general technique for correcting red-eye, a process of replacing red with another color in an area where red-eye exists in an image (hereinafter referred to as “red-eye area”), or reducing brightness or saturation. It has been known. When such a simple process is applied to the red-eye region, the saturation, lightness, and hue gradation in the eye are lost, resulting in an unnatural eye. Therefore, for example, in Patent Document 1 and Patent Document 2, brightness or saturation is gradually decreased from the peripheral part to the central part of the pupil or red-eye region.

特開2000−76427号公報JP 2000-76427 A 特開2000−134486号公報JP 2000-134486 A

ところで、赤目領域における明度や彩度を補正対象となる画素の位置に応じて修正する場合、補正対象の画素の位置と補正量とが適切に対応付けられる必要がある。したがって、例えば、瞳の中心が適切に検出できない場合や赤目領域の中心が瞳の中心と一致しないにも関わらず赤目領域の中心を瞳の中心とみなす場合等には、瞳の中心近傍のグラデーションが不自然なものとなってしまう。   By the way, when correcting the lightness and saturation in the red-eye region in accordance with the position of the pixel to be corrected, it is necessary to appropriately associate the position of the correction target pixel and the correction amount. Therefore, for example, when the center of the pupil cannot be detected properly, or when the center of the red-eye region is regarded as the center of the pupil even though the center of the red-eye region does not coincide with the center of the pupil, the gradation near the center of the pupil is used. Will be unnatural.

本発明は、上記課題に鑑みなされたものであり、様々な態様にて生じる赤目を適切に補正することを目的としている。   The present invention has been made in view of the above problems, and an object thereof is to appropriately correct red eyes generated in various modes.

請求項1に記載の発明は、画像中の赤目を補正するプログラムであって、前記プログラムのコンピュータによる実行は、前記コンピュータに、特徴量に基づいて画像から赤目領域として抽出された複数の特徴領域に対して赤目補正を行う工程と、前記赤目補正を行う工程の前または後に、前記複数の特徴領域のそれぞれに対して処理対象となる特徴領域に応じた平滑化を行う工程とを実行させる。   The invention according to claim 1 is a program for correcting red-eye in an image, and the execution of the program by a computer causes the computer to extract a plurality of feature regions extracted as red-eye regions from an image based on feature amounts. And a step of performing smoothing according to the feature region to be processed on each of the plurality of feature regions before or after the step of performing the red eye correction.

請求項2に記載の発明は、請求項1に記載のプログラムであって、前記プログラムの前記コンピュータによる実行は、前記コンピュータに、前記複数の特徴領域のそれぞれに関する特徴量のヒストグラムを生成する工程と、前記ヒストグラムから導かれるパラメータに基づいて前記平滑化の度合いを決定する工程とをさらに実行させる。   Invention of Claim 2 is a program of Claim 1, Comprising: Execution by the said computer of the said program produces | generates the histogram of the feature-value regarding each of these feature area in the said computer, And a step of determining the degree of smoothing based on a parameter derived from the histogram.

請求項3に記載の発明は、画像中の赤目を補正するプログラムであって、前記プログラムのコンピュータによる実行は、前記コンピュータに、画像中の補正対象領域を決定する工程と、前記補正対象領域の大きさと所定値とを比較する工程と、前記補正対象領域の大きさが前記所定値よりも小さい場合に、前記補正対象領域の解像度を増大させる工程と、前記補正対象領域に対して赤目補正を行う工程とを実行させる。   The invention according to claim 3 is a program for correcting red-eye in an image, and the execution of the program by a computer determines a correction target area in the image to the computer, and A step of comparing the size with a predetermined value, a step of increasing the resolution of the correction target region when the size of the correction target region is smaller than the predetermined value, and red-eye correction on the correction target region. And performing the process.

請求項4に記載の発明は、コンピュータ読み取り可能な記録媒体であって、請求項1ないし3のいずれかに記載のプログラムを記録している。   The invention according to claim 4 is a computer-readable recording medium in which the program according to any one of claims 1 to 3 is recorded.

請求項5に記載の発明は、画像中の赤目を補正する赤目補正方法であって、特徴量に基づいて画像から赤目領域として抽出された複数の特徴領域に対して赤目補正を行う工程と、前記赤目補正を行う工程の前または後に、前記複数の特徴領域のそれぞれに対して処理対象となる特徴領域に応じた平滑化を行う工程とを有する。   The invention according to claim 5 is a red-eye correction method for correcting red eyes in an image, the step of performing red-eye correction on a plurality of feature regions extracted as red-eye regions from an image based on feature amounts; Before or after the step of performing the red-eye correction, a step of performing smoothing according to the feature region to be processed on each of the plurality of feature regions.

請求項6に記載の発明は、画像中の赤目を補正する赤目補正方法であって、画像中の補正対象領域を決定する工程と、前記補正対象領域の大きさと所定値とを比較する工程と、前記補正対象領域の大きさが前記所定値よりも小さい場合に、前記補正対象領域の解像度を増大させる工程と、前記補正対象領域に対して赤目補正を行う工程とを有する。   The invention according to claim 6 is a red-eye correction method for correcting red-eye in an image, the step of determining a correction target region in the image, and the step of comparing the size of the correction target region with a predetermined value. When the size of the correction target area is smaller than the predetermined value, the method includes a step of increasing the resolution of the correction target area and a step of performing red-eye correction on the correction target area.

請求項1、請求項2および請求項5の発明によれば、特徴領域に応じた平滑化を行うことにより、赤目領域全体に対して適切な平滑化を行うことができる。   According to the first, second, and fifth aspects of the invention, it is possible to perform appropriate smoothing on the entire red-eye region by performing smoothing according to the feature region.

また、請求項2の発明によれば、平滑化の度合いを決定するパラメータを容易に準備することができる。   Further, according to the invention of claim 2, a parameter for determining the degree of smoothing can be easily prepared.

請求項3および請求項6の発明によれば、赤目補正の精度を向上することができる。   According to the third and sixth aspects of the invention, the accuracy of red-eye correction can be improved.

以下、本発明の実施形態について図面を参照して説明する。   Embodiments of the present invention will be described below with reference to the drawings.

<実施形態>
図1は、本発明の一の実施の形態に係る画像処理装置1の外観図である。画像処理装置1は、プログラムを実行することにより画像中の赤目領域を特定して補正を行うコンピュータである。画像処理装置1は、図1に示すように使用者からの入力を受け付けるキーボード111およびマウス112、並びに、使用者に対する指示メニューや取得した画像等の表示を行うディスプレイ12を備える。
<Embodiment>
FIG. 1 is an external view of an image processing apparatus 1 according to an embodiment of the present invention. The image processing apparatus 1 is a computer that performs correction by specifying a red-eye region in an image by executing a program. As shown in FIG. 1, the image processing apparatus 1 includes a keyboard 111 and a mouse 112 that receive input from the user, and a display 12 that displays an instruction menu for the user, an acquired image, and the like.

画像処理装置1は、内部に画像のデータ等を記憶する固定ディスク161を有しており、さらに、プログラムを格納した記録ディスク91や画像データを格納したメモリカード92が、コンピュータ読み取り可能な記録媒体としてそれぞれ読取装置162やカードスロット163に装填可能となっている。   The image processing apparatus 1 includes a fixed disk 161 that stores therein image data and the like. Further, a recording disk 91 that stores a program and a memory card 92 that stores image data are computer-readable recording media. Can be loaded into the reader 162 and the card slot 163, respectively.

図2は、画像処理装置1の構成を示すブロック図である。画像処理装置1は、CPU13、RAM14およびROM15をバスラインに接続した一般的なコンピュータシステムの構成となっている。バスラインにはさらに、ディスプレイ12、操作者からの入力を受け付けるキーボード111およびマウス112、データやプログラム等を保存する固定ディスク161、記録ディスク91(光ディスク、磁気ディスク、光磁気ディスク等)との間で情報の受け渡しを行う読取装置162、並びに、メモリカード92との間で情報の受け渡しを行うカードスロット163が、適宜、インターフェイス(I/F)を介する等して接続される。   FIG. 2 is a block diagram illustrating a configuration of the image processing apparatus 1. The image processing apparatus 1 has a general computer system configuration in which a CPU 13, a RAM 14, and a ROM 15 are connected to a bus line. The bus line further includes a display 12, a keyboard 111 and a mouse 112 for receiving input from an operator, a fixed disk 161 for storing data and programs, and a recording disk 91 (optical disk, magnetic disk, magneto-optical disk, etc.). And a card slot 163 for exchanging information with the memory card 92 are appropriately connected via an interface (I / F) or the like.

RAM14、固定ディスク161、読取装置162およびカードスロット163は互いにデータの受け渡しが可能とされており、CPU13の制御の下、ディスプレイ12には各種情報やRAM14、固定ディスク161、メモリカード92等に記憶されいてる画像の表示が可能とされる。   The RAM 14, the fixed disk 161, the reading device 162, and the card slot 163 can exchange data with each other. Under the control of the CPU 13, the display 12 stores various information and the RAM 14, the fixed disk 161, the memory card 92, and the like. The displayed image can be displayed.

図2に示すプログラム141は、記録ディスク91から読取装置162を介して固定ディスク161に記憶され、固定ディスク161からRAM14へと転送されたものであり、CPU13による実行が可能とされる。   The program 141 shown in FIG. 2 is stored in the fixed disk 161 from the recording disk 91 via the reading device 162, transferred from the fixed disk 161 to the RAM 14, and can be executed by the CPU 13.

図3は、CPU13がRAM14内のプログラム141に従って動作することにより実現される機能構成を他の構成とともに示す図である。図3に示す構成のうち、表示制御部201、対象領域決定部202、サイズ決定部203、特徴領域抽出部204、赤目領域特定部205および補正部206が、CPU13等により実現される機能を示す。   FIG. 3 is a diagram showing a functional configuration realized by the CPU 13 operating according to the program 141 in the RAM 14 together with other configurations. In the configuration illustrated in FIG. 3, the display control unit 201, the target region determination unit 202, the size determination unit 203, the feature region extraction unit 204, the red-eye region specification unit 205, and the correction unit 206 indicate functions realized by the CPU 13 and the like. .

表示制御部201は、画像データに基づいてディスプレイ12上による画像の表示を制御する。対象領域決定部202は、マウス112を介して画像データ301が示す画像中の処理対象となる対象領域の決定を使用者から受け付ける。サイズ決定部203は、対象領域について後述する処理を行う単位となる単位領域の大きさを決定する。   The display control unit 201 controls display of an image on the display 12 based on the image data. The target area determination unit 202 receives from the user the determination of the target area to be processed in the image indicated by the image data 301 via the mouse 112. The size determination unit 203 determines the size of a unit area that is a unit for performing processing to be described later on the target area.

特徴領域抽出部204は、対象領域に対して単位領域ごとの処理を行い、特徴量に応じて複数種類の特徴領域を抽出する。なお、特徴量としては彩度、明度および色相が用いられる。赤目領域特定部205は抽出された複数の特徴領域のうち赤目領域を構成する特徴領域を特定する。補正部206は特定された赤目領域に対して色変換を行い、画像中の赤目を正常な色の目へと補正する。補正後の画像のデータは補正済画像データ302としてRAM14に記憶される。   The feature region extraction unit 204 performs processing for each unit region on the target region, and extracts a plurality of types of feature regions according to the feature amount. Note that saturation, brightness, and hue are used as the feature amount. The red-eye area specifying unit 205 specifies a feature area constituting the red-eye area from among the extracted feature areas. The correction unit 206 performs color conversion on the specified red-eye region, and corrects red eyes in the image to normal color eyes. The corrected image data is stored in the RAM 14 as corrected image data 302.

図4は、補正部206の機能構成を示すブロック図である。補正部206は、赤目領域を構成する特徴領域における特徴量のヒストグラムを生成するヒストグラム生成部211、赤目を補正するための補正曲線を生成する補正曲線生成部212、補正曲線を用いて特徴量を変換する変換部213、平滑化用のフィルタを生成するフィルタ生成部214、および、補正後の赤目領域の平滑化を行う平滑化部215を有する。これらの機能の詳細については後述する。   FIG. 4 is a block diagram illustrating a functional configuration of the correction unit 206. The correction unit 206 includes a histogram generation unit 211 that generates a histogram of feature amounts in a feature region that constitutes a red-eye region, a correction curve generation unit 212 that generates a correction curve for correcting red eyes, and a feature amount using the correction curve. It has the conversion part 213 which converts, the filter production | generation part 214 which produces | generates the filter for smoothing, and the smoothing part 215 which smoothes the red eye area | region after correction | amendment. Details of these functions will be described later.

図5ないし図7は、画像処理装置1が赤目領域を特定して補正する際の動作の流れを示す図である。以下、図3ないし図7を参照して画像処理装置1が赤目に対する補正(以下、「赤目補正」という。)を行う動作について説明する。   5 to 7 are diagrams showing the flow of operations when the image processing apparatus 1 specifies and corrects the red-eye area. The operation of the image processing apparatus 1 for correcting the red eye (hereinafter referred to as “red-eye correction”) will be described below with reference to FIGS. 3 to 7.

まず、使用者がディスプレイ12を見ながらキーボード111やマウス112を用いてメモリカード92や固定ディスク161内の画像データのうち所望のものを選択すると、選択された画像データ301がRAM14に読み込まれるとともに表示制御部201が画像データ301に基づいて画像をディスプレイ12に表示する(ステップS11)。   First, when the user selects a desired image data in the memory card 92 or the fixed disk 161 using the keyboard 111 or the mouse 112 while looking at the display 12, the selected image data 301 is read into the RAM 14. The display control unit 201 displays an image on the display 12 based on the image data 301 (step S11).

使用者は赤目補正が必要な領域をマウス112を用いて指定することにより、対象領域決定部202が演算対象となる対象領域を決定する(ステップS12)。具体的には、図8に示すように使用者が画像401中の対象領域402の対角の2点を指定することにより、1つの目に対応する赤目領域を含む対象領域402が決定される。   The user uses the mouse 112 to specify an area that needs red-eye correction, so that the target area determination unit 202 determines a target area to be calculated (step S12). Specifically, as shown in FIG. 8, when the user designates two diagonal points of the target area 402 in the image 401, the target area 402 including the red-eye area corresponding to one eye is determined. .

対象領域402が決定されると、サイズ決定部203により、対象領域402の画素数N1とパラメータSとに基づいて、数1により単位領域の一辺の画素数(以下、「単位領域サイズ」という。)n(単位領域の大きさはn×nとされる。)が求められる(ステップS13)。   When the target region 402 is determined, the size determining unit 203 uses the number of pixels N1 of the target region 402 and the parameter S to determine the number of pixels on one side of the unit region (hereinafter referred to as “unit region size”). ) N (the size of the unit area is n × n) is obtained (step S13).

Figure 2009064459
Figure 2009064459

なお、パラメータSは画像401と対象領域402との画素数の比を示す値であり、画像401の画素数をN2とすると数2により定まるパラメータである。   The parameter S is a value indicating the ratio of the number of pixels between the image 401 and the target area 402, and is a parameter determined by the number 2 when the number of pixels of the image 401 is N2.

Figure 2009064459
Figure 2009064459

また、関数Fは、パラメータSが小さいほど出力する単位領域サイズnを小さくし、対象領域402の画素数N1が大きいほど出力する単位領域サイズnを大きくする関数であり、例えば数3ないし数5のような入出力関係を有する関数である。   The function F is a function that decreases the unit area size n to be output as the parameter S is small, and increases the unit area size n to be output as the number of pixels N1 of the target area 402 is large. Is a function having an input / output relationship such as

Figure 2009064459
Figure 2009064459

Figure 2009064459
Figure 2009064459

Figure 2009064459
Figure 2009064459

このような関数Fを用いて単位領域サイズを決定することにより、画像401に対する対象領域402の大きさの割合に応じた大きさの単位領域に対象領域402を分割でき、その後は単位領域を単位として演算を行うことにより、画素ごとに演算する場合に比べて高速で、かつノイズの影響を受けにくい精度のよい赤目領域の特定ができる。なお、nの最小値は1であり、その場合、1つの単位領域は1画素となり、対象領域402は画素ごとに処理されることとなる。   By determining the unit region size using such a function F, the target region 402 can be divided into unit regions having a size corresponding to the ratio of the size of the target region 402 to the image 401. Thereafter, the unit region is divided into units. As a result, it is possible to specify a red-eye region with high accuracy and high accuracy that is less susceptible to noise than in the case of calculating for each pixel. Note that the minimum value of n is 1, in which case one unit area is one pixel, and the target area 402 is processed for each pixel.

単位領域サイズnが決定されると、特徴領域抽出部204は、対象領域402の各単位領域のRGB値(平均のRGB値)をHSL表色系の色空間へと変換して各単位領域の色相、彩度および明度を特徴量として得る(ステップS14)。   When the unit region size n is determined, the feature region extraction unit 204 converts the RGB value (average RGB value) of each unit region of the target region 402 into the color space of the HSL color system, and Hue, saturation and lightness are obtained as feature quantities (step S14).

次に、特徴領域抽出部204により、単位領域の特徴量に基づいて瞳孔領域、虹彩領域および虹彩外領域がそれぞれ特徴領域として対象領域402から抽出される。具体的には、彩度および明度が一定の範囲にある領域(彩度、明度ともに低い範囲にある領域)が瞳孔領域として抽出され、色相および彩度が一定の範囲にある領域(色相は赤からやや黄色、彩度は高い範囲にある領域)が虹彩領域として抽出される。さらに、瞳孔領域と同じ明度範囲であり、虹彩領域と同じ色相範囲の領域が虹彩外領域として抽出される(ステップS15)。   Next, the feature region extraction unit 204 extracts the pupil region, the iris region, and the non-iris region from the target region 402 as feature regions based on the feature amount of the unit region. Specifically, an area where saturation and brightness are in a certain range (area where both saturation and brightness are low) is extracted as a pupil area, and an area where hue and saturation are in a certain range (hue is red) (A region that is slightly yellow and has a high saturation range) is extracted as an iris region. Further, a region having the same brightness range as the pupil region and the same hue range as the iris region is extracted as an out-iris region (step S15).

なお、特徴量に基づいて補正対象となる特徴領域を抽出することにより、後述の特徴量に基づく補正が特徴領域ごとに適切に行うことが実現される。   It should be noted that by extracting the feature region to be corrected based on the feature amount, it is realized that correction based on the feature amount described later is appropriately performed for each feature region.

図9は、特徴領域抽出部204により、対象領域402から抽出される特徴領域を例示する図である。符号501は瞳孔領域、符号502a,502bは虹彩領域、符号503は虹彩外領域を示す。赤目の状態によっては、各種特徴領域は抽出されない場合もあれば複数抽出される場合もある。   FIG. 9 is a diagram illustrating a feature region extracted from the target region 402 by the feature region extraction unit 204. Reference numeral 501 denotes a pupil area, reference numerals 502a and 502b denote iris areas, and reference numeral 503 denotes a non-iris area. Depending on the state of the red eye, various feature regions may not be extracted or a plurality of feature regions may be extracted.

各種特徴領域の抽出に用いられる特徴量の範囲は、赤目現象の生じていない正常時の特徴量から定められるものではなく、赤目現象が生じている場合の特徴量から統計的に定められる。したがって、このような特徴量に該当する各特徴領域は赤目現象の生じている可能性がある領域として抽出されていることを意味する。逆に、いずれの特徴領域としても抽出されなかった領域は赤目補正が必要でない領域と判定されたこととなる。   The range of the feature amount used for extracting various feature regions is not determined from the normal feature amount where the red-eye phenomenon does not occur, but is statistically determined from the feature amount when the red-eye phenomenon occurs. Therefore, it means that each feature region corresponding to such a feature amount is extracted as a region where the red-eye phenomenon may occur. Conversely, a region that is not extracted as any feature region is determined as a region that does not require red-eye correction.

次に、抽出された特徴領域から赤目補正に適さない不要な領域が除外される(ステップS16)。例えば、図9に示す特徴領域のうち、微小な虹彩領域502bは、誤って抽出された虹彩領域として補正対象から除外される。また、各特徴領域の包含関係や接触の度合いに基づいて、各特徴領域が補正対象となる領域として適切か否かが改めて判断される。   Next, unnecessary regions that are not suitable for red-eye correction are excluded from the extracted feature regions (step S16). For example, the minute iris region 502b in the feature region shown in FIG. 9 is excluded from the correction target as an erroneously extracted iris region. Further, based on the inclusion relationship of each feature region and the degree of contact, it is determined again whether each feature region is appropriate as a region to be corrected.

具体例としては、虹彩外領域が虹彩領域の周囲の大部分に接していない場合には虹彩外領域を補正すると不自然な目になってしまうことから虹彩外領域が補正すべきでない領域であると判定される。瞳孔領域と虹彩領域との間に特徴領域以外の領域が存在する場合は瞳孔領域周辺が赤目となっていない可能性があり、瞳孔領域が補正すべきでない領域であると判定される。瞳孔領域が虹彩領域に完全には含まれていない場合には適切な補正が困難な状態であることからいずれの特徴領域も補正すべきでないと判定される(この場合、赤目補正は実行されない)。   As a specific example, if the extra-iris area is not in contact with most of the periphery of the iris area, correcting the extra-iris area results in unnatural eyes, so the extra-iris area should not be corrected. It is determined. If there is a region other than the feature region between the pupil region and the iris region, the periphery of the pupil region may not be red-eye, and it is determined that the pupil region is a region that should not be corrected. When the pupil region is not completely included in the iris region, it is determined that it is difficult to perform appropriate correction, so that no feature region should be corrected (in this case, red-eye correction is not performed). .

赤目補正をすべき赤目領域を構成する少なくとも1つの特徴領域が決定されると、次に、赤目領域特定部205から特徴領域を示す情報および特徴量が補正部206に入力され、赤目領域を構成する特徴領域ごとに順次、赤目補正に係る処理が実行される。なお、以下の処理は特徴領域の種類に依存することなく実行される。   When at least one feature region constituting the red-eye region to be corrected for red-eye is determined, information indicating the feature region and feature amount are input to the correction unit 206 from the red-eye region specifying unit 205 to configure the red-eye region. Processing for red-eye correction is sequentially executed for each feature region. The following processing is executed without depending on the type of feature region.

まず、補正部206において赤目領域に含まれる一の特徴領域が処理対象(以下、「注目特徴領域」という。)として決定される(ステップS21)。そして、ヒストグラム生成部211(図4参照)が注目特徴領域を構成する単位領域の数をカウントし、注目特徴領域の大きさを単位領域のカウント数として求める。   First, the correction unit 206 determines one feature region included in the red-eye region as a processing target (hereinafter referred to as “target feature region”) (step S21). Then, the histogram generation unit 211 (see FIG. 4) counts the number of unit areas constituting the target feature area, and obtains the size of the target feature area as the count number of the unit area.

注目特徴領域の大きさが所定値以下の場合には(ステップS22)、ヒストグラム生成部211からサイズ決定部203にその旨が伝達され、サイズ決定部203が単位領域サイズをさらに小さく設定することにより解像度を増大させ、ステップS14に戻る(ステップS23)。これにより、再度抽出される特徴領域中の単位領域数が増大され、後述のヒストグラムから得られるパラメータの信頼性を向上することができる。その結果、赤目補正の精度を向上することができる。   When the size of the feature region of interest is equal to or smaller than the predetermined value (step S22), the fact is transmitted from the histogram generation unit 211 to the size determination unit 203, and the size determination unit 203 sets the unit region size to be smaller. The resolution is increased and the process returns to step S14 (step S23). As a result, the number of unit regions in the feature region extracted again is increased, and the reliability of parameters obtained from a histogram described later can be improved. As a result, the accuracy of red-eye correction can be improved.

なお、1つの単位領域が1画素である場合には、サイズ決定部203により解像度を増大する処理が対象領域402(または、注目特徴領域)に対して施される。解像度を向上する処理(すなわち、画像を拡大する処理)としては、直線補間法、キュービックコンボリューション補間法、Bスプライン補間法等が用いられる。これにより、再度抽出される特徴領域の画素数が増大される。   When one unit area is one pixel, the size determination unit 203 performs a process for increasing the resolution on the target area 402 (or the target feature area). As processing for improving the resolution (that is, processing for enlarging an image), linear interpolation, cubic convolution interpolation, B-spline interpolation, or the like is used. As a result, the number of pixels in the feature region extracted again is increased.

次に、ヒストグラム生成部211により注目特徴領域において処理対象となる特徴量(彩度、明度および色相のいずれかであり、以下、「注目特徴量」という。)が決定され(図6:ステップS31)、注目特徴量の補正(ステップS32〜S35)および注目特徴量に対する平滑化(ステップS42,S43)が実行される。   Next, the histogram generation unit 211 determines a feature amount (one of saturation, lightness, and hue, hereinafter referred to as “target feature amount”) to be processed in the target feature region (FIG. 6: step S31). ), Correction of the feature of interest (steps S32 to S35) and smoothing of the feature of interest (steps S42 and S43).

注目特徴量の補正では、ヒストグラム生成部211により注目特徴領域おける注目特徴量のヒストグラムが生成される(ステップS32)。すなわち、注目特徴量の値とその値を有する単位領域の数との関係を示すヒストグラムが生成される。   In the correction of the feature of interest, the histogram generator 211 generates a histogram of the feature of interest in the feature region of interest (step S32). That is, a histogram indicating the relationship between the value of the feature amount of interest and the number of unit regions having the value is generated.

単位領域を単位とする注目特徴量のヒストグラムが生成されると、補正曲線生成部212によりヒストグラムから導かれる統計学的値であるパラメータが求められ(ステップS33)、パラメータを用いて各単位領域の注目特徴量の補正前の値と補正後の値との関係を示す補正曲線が生成される(ステップS34)。その後、変換部213により補正曲線を用いて各単位領域の注目特徴量が変換される(ステップS35)。これにより、注目特徴領域における注目特徴量が補正される。   When the histogram of the feature amount of interest with the unit area as a unit is generated, a parameter that is a statistical value derived from the histogram is obtained by the correction curve generation unit 212 (step S33). A correction curve indicating the relationship between the value before correction of the feature value of interest and the value after correction is generated (step S34). Then, the attention feature amount of each unit region is converted by the conversion unit 213 using the correction curve (step S35). Thereby, the feature amount of interest in the feature region of interest is corrected.

補正後の注目特徴量に対する平滑化は、注目特徴量が彩度または明度の場合のみ実行され(ステップS41)、補正により強調された彩度や明度のばらつき(2次元空間におけるばらつき)が平滑化により緩和される。平滑化では、ヒストグラムから平滑化用の加重係数が求められ(ステップS42)、単位領域の注目特徴量が平滑化された値へと修正される(ステップS43)。これにより、特徴領域ごとに適切な度合いにて平滑化が行われる。   The smoothing of the attention feature amount after correction is executed only when the attention feature amount is saturation or lightness (step S41), and the variation in saturation and lightness emphasized by the correction (variation in the two-dimensional space) is smoothed. Is alleviated by In smoothing, a weighting coefficient for smoothing is obtained from the histogram (step S42), and the target feature amount of the unit area is corrected to a smoothed value (step S43). Thereby, smoothing is performed at an appropriate degree for each feature region.

一の注目特徴量について補正および平滑化が完了すると次の注目特徴量が決定され(ステップS44,S31)、再度、補正および平滑化が行われる。なお、本実施の形態では色相に対する平滑化は省略されるため、彩度および明度については補正および平滑化が行われ、色相については補正のみが行われる。ただし、色相に対して平滑化が行われるようにされてもよい。   When correction and smoothing are completed for one target feature amount, the next target feature amount is determined (steps S44 and S31), and correction and smoothing are performed again. In the present embodiment, since the smoothing for the hue is omitted, the saturation and the lightness are corrected and smoothed, and the hue is only corrected. However, the hue may be smoothed.

また、図6では補正の後に平滑化が行われるが、平滑化は補正の前に行われてもよい。この場合、ステップS41〜S43とステップS34,S35とが入れ替えられる。平滑化を補正の前に行う場合も補正により強調される彩度や明度のばらつきが緩和される。また、補正前に平滑化を行うことにより、補正前に特徴領域中のノイズを低減することができる。   Further, in FIG. 6, smoothing is performed after correction, but smoothing may be performed before correction. In this case, steps S41 to S43 and steps S34 and S35 are interchanged. Even when smoothing is performed before correction, variations in saturation and brightness emphasized by the correction are alleviated. Further, by performing smoothing before correction, noise in the feature region can be reduced before correction.

次に、補正に用いられる補正曲線および平滑化についてさらに詳細に説明する。   Next, the correction curve and smoothing used for correction will be described in more detail.

図10は彩度に関する補正曲線61を例示する図である。図10において横軸は補正前の彩度(すなわち、変換部213の入力)であり、縦軸は補正後の彩度(すなわち、変換部213の出力)である。値XS1は注目特徴領域における補正前の彩度の最小値であり、値XS3は補正前の彩度の最大値である。値XS2は彩度の最頻値(最も多くの単位領域が有する彩度)である。これらの値は彩度のヒストグラムから導出される。   FIG. 10 is a diagram illustrating a correction curve 61 relating to saturation. In FIG. 10, the horizontal axis represents the saturation before correction (that is, the input of the conversion unit 213), and the vertical axis represents the saturation after correction (that is, the output of the conversion unit 213). The value XS1 is the minimum saturation value before correction in the target feature region, and the value XS3 is the maximum saturation value before correction. The value XS2 is the mode of saturation (the saturation of the most unit areas). These values are derived from the saturation histogram.

図10において補正後の値YS1,YS2,YS3は、それぞれ値XS1,XS2,XS3に対応している。最小の彩度である値YS1は値XS1と等しくされる。これにより、補正後の画像において赤目領域の彩度が過度に減少してしまうことが防止される。   In FIG. 10, the corrected values YS1, YS2, and YS3 correspond to the values XS1, XS2, and XS3, respectively. The value YS1, which is the minimum saturation, is made equal to the value XS1. Thereby, it is possible to prevent the saturation of the red-eye area from being excessively reduced in the corrected image.

値YS3は数6にて示す関数FS3により求められる。   The value YS3 is obtained by the function FS3 expressed by Equation 6.

Figure 2009064459
Figure 2009064459

関数FS3は最大値XS3、および、彩度のヒストグラムから求められる彩度の分散VSをパラメータとし、分散VSが小さいほど値YS3を小さくする特性を有する。すなわち、関数FS3は分散VSが小さいほど最大値XS3から大きな値ZS3を減算して値YS3を求める。   The function FS3 uses the maximum value XS3 and the saturation variance VS obtained from the saturation histogram as parameters, and has a characteristic that the value YS3 decreases as the variance VS decreases. That is, the function FS3 obtains the value YS3 by subtracting the larger value ZS3 from the maximum value XS3 as the variance VS is smaller.

赤目補正において彩度の最大値はなるべく小さく抑えられることが好ましい。一方で、分散VSが大きい場合に彩度の最大値を小さくしてしまうと注目特徴領域の雰囲気が変化してしまうという問題が生じる。そこで、関数FS3により彩度の補正曲線61は彩度の分散が小さいほど彩度の最大値を減少させる特性を有するものとされる。   In red-eye correction, it is preferable that the maximum value of saturation is kept as small as possible. On the other hand, if the maximum value of saturation is reduced when the variance VS is large, there is a problem that the atmosphere of the feature region of interest changes. Therefore, the saturation correction curve 61 has a characteristic of decreasing the maximum value of saturation as the variance of saturation is smaller by the function FS3.

なお、値YS3は値YS1以下となることが許されないため、正確には関数FS3は値YS1(すなわち、最小値XS1)も補助的なパラメータとして利用する。   Since the value YS3 is not allowed to be less than or equal to the value YS1, the function FS3 uses the value YS1 (that is, the minimum value XS1) as an auxiliary parameter.

一方、値YS2は数7にて示す関数FS2により求められる。なお、彩度の中間値(彩度の範囲のおよそ中間の値をいう。以下同様)の減少の度合いが最頻値XS2を基準に決定されるのは、最頻値XS2近傍にて彩度を大きく減少させることにより、彩度を減少させるという赤目補正の目的を容易かつ的確に実現することができるからである。   On the other hand, the value YS2 is obtained by the function FS2 expressed by Equation 7. It should be noted that the degree of decrease in the intermediate value of saturation (which is an approximately intermediate value in the saturation range; the same applies hereinafter) is determined based on the mode value XS2 in the vicinity of the mode value XS2. This is because the purpose of red-eye correction, which reduces the saturation, can be easily and accurately realized by greatly reducing.

Figure 2009064459
Figure 2009064459

関数FS2は最頻値XS2、および、彩度のヒストグラムにおける最頻値近傍の分散VSMをパラメータとし、分散VSMが小さいほど値YS2は小さな値とされる。すなわち、関数FS2は分散VSMが小さいほど最頻値XS2から大きな値ZS2を減算して値YS2を求める。なお、値YS2は値YS3と値YS1との間の値である必要があるため、関数FS3では値YS3(または、値YS3を求めるための最大値XS3および分散VS)および値YS1(すなわち、最小値XS1)が補助的なパラメータとして利用される。   The function FS2 uses the mode value XS2 and the variance VSM in the vicinity of the mode value in the saturation histogram as parameters. The smaller the variance VSM, the smaller the value YS2. That is, the function FS2 obtains a value YS2 by subtracting a larger value ZS2 from the mode value XS2 as the variance VSM is smaller. Since the value YS2 needs to be a value between the value YS3 and the value YS1, the function FS3 uses the value YS3 (or the maximum value XS3 and the variance VS for obtaining the value YS3) and the value YS1 (that is, the minimum The value XS1) is used as an auxiliary parameter.

最頻値近傍の分散VSMが小さい場合、彩度のヒストグラムは最頻値XS2近傍に集中したものになっている。したがって、分散VSMが小さい場合に値YS2を小さな値とすることにより、彩度を減少させるという赤目補正の効果を適切に得ることができる。一方、分散VSMが大きい場合、彩度のヒストグラムは最頻値XS2にさほど偏っていないため、値YS2を小さな値としても効率よく彩度を下げるという効果が期待できない。むしろ、彩度のむらを目立たせてしまうこととなる。そこで、関数FS2では分散VSMが小さいほど値XS2から大きな値を減算して値YS2を求めるようにしている。   When the variance VSM in the vicinity of the mode value is small, the saturation histogram is concentrated in the vicinity of the mode value XS2. Therefore, by setting the value YS2 to a small value when the variance VSM is small, it is possible to appropriately obtain the red-eye correction effect of reducing the saturation. On the other hand, when the variance VSM is large, the saturation histogram is not so biased to the mode value XS2, and therefore the effect of efficiently reducing the saturation cannot be expected even if the value YS2 is small. Rather, it will make the saturation unevenness stand out. Therefore, in the function FS2, the value YS2 is obtained by subtracting a larger value from the value XS2 as the variance VSM is smaller.

なお、関数FS2により、最大値XS3と最頻値XS2との差に基づいて値YS2が調整されてもよい。例えば、最大値XS3と最頻値XS2との差が小さい場合には補正曲線61が過度に折れ曲がらないように値YS2が若干大きくされてもよい。   Note that the value YS2 may be adjusted based on the difference between the maximum value XS3 and the mode value XS2 by the function FS2. For example, when the difference between the maximum value XS3 and the mode value XS2 is small, the value YS2 may be slightly increased so that the correction curve 61 does not bend excessively.

以上のようにして値YS1,YS2,YS3が決定されると、座標(XS1,YS1)、(XS2,YS2)、(XS3,YS3)の3つの点を通る2次曲線が彩度に関する補正曲線61として生成される。なお、3つの点から他の手法により補正曲線61が求められてもよい。   When the values YS1, YS2, and YS3 are determined as described above, a quadratic curve that passes through the three points of coordinates (XS1, YS1), (XS2, YS2), and (XS3, YS3) is a correction curve related to saturation. 61 is generated. The correction curve 61 may be obtained from the three points by another method.

図11は明度に関する補正曲線62を例示する図である。図11において横軸は補正前の明度(すなわち、変換部213の入力)であり、縦軸は補正後の明度(すなわち、変換部213の出力)である。値XL1は補正前の明度の最小値であり、値XL3は補正前の明度の最大値である。値XL2は明度の最頻値である。これらの値は明度のヒストグラムから導出される。   FIG. 11 is a diagram illustrating a correction curve 62 relating to brightness. In FIG. 11, the horizontal axis represents the lightness before correction (that is, the input of the conversion unit 213), and the vertical axis represents the lightness after correction (that is, the output of the conversion unit 213). The value XL1 is the minimum value of brightness before correction, and the value XL3 is the maximum value of brightness before correction. The value XL2 is the mode value of brightness. These values are derived from the brightness histogram.

図11においても図10と同様に、補正後の値YL1,YL2,YL3は、それぞれ値XL1,XL2,XL3に対応している。補正後の最小の明度である値YL1は値XL1と等しくされ、最大の明度である値YL3は値XL3と等しくされる。値YL1が値XL1と等しくされるのは、補正後の画像において赤目領域が黒くつぶれて不自然な目になってしまうことを防止するためであり、値YL3と値XL3とが等しくされるのは、目の中に存在するいわゆるキャッチライト(照明が反射されて明るくなっている領域)の消失を防止して補正後の目を生き生きとしたものとするためである。   In FIG. 11, similarly to FIG. 10, the corrected values YL1, YL2, and YL3 correspond to the values XL1, XL2, and XL3, respectively. The value YL1 which is the minimum lightness after correction is made equal to the value XL1, and the value YL3 which is the maximum lightness is made equal to the value XL3. The reason why the value YL1 is made equal to the value XL1 is to prevent the red-eye region from being crushed black in the corrected image and resulting in an unnatural eye, and the value YL3 and the value XL3 are made equal. This is to make the corrected eye alive by preventing the disappearance of the so-called catchlight (the area where the illumination is reflected and brightened) existing in the eye.

値YL2は数8にて示す関数FL2により求められる。なお、明度の中間値の減少の度合いが最頻値XL2を基準に決定されるのは、彩度の場合と同様に、最頻値XL2近傍にて明度を大きく減少させることにより、明度を減少させるという赤目補正の目的を容易かつ的確に実現するためである。   The value YL2 is obtained by the function FL2 expressed by Equation 8. Note that the degree of decrease in the intermediate value of lightness is determined based on the mode value XL2, as in the case of saturation, the lightness is decreased by greatly reducing the lightness in the vicinity of the mode value XL2. This is to easily and accurately realize the purpose of red-eye correction.

Figure 2009064459
Figure 2009064459

関数FL2は最頻値XL2、および、明度のヒストグラムの分散VLをパラメータとし、分散VLが小さいほど値YS2は小さな値とされる。すなわち、関数FL2は分散VLが小さいほど最頻値XL2から大きな値ZL2を減算して値YL2を求める。なお、値YL2は値YL1以上である必要があるため、関数FL2は値YL1(すなわち、最小値XL1)も補助的なパラメータとして利用する。   The function FL2 uses the mode value XL2 and the variance VL of the brightness histogram as parameters. The smaller the variance VL, the smaller the value YS2. That is, the function FL2 obtains the value YL2 by subtracting the larger value ZL2 from the mode value XL2 as the variance VL is smaller. Since the value YL2 needs to be greater than or equal to the value YL1, the function FL2 also uses the value YL1 (that is, the minimum value XL1) as an auxiliary parameter.

分散VLが大きい場合、注目特徴領域において様々な明度が存在しており、明度に関する強いグラデーションが存在すると想定される。典型例としては、注目特徴領域に明度の異なる複数の小領域が存在している状態が考えられる。そして、このような場合に値YL2を小さな値としてしまうと、補正後の注目特徴領域内において明度の異なる小領域の境界が明瞭になってしまい、明度のむらが目立つことになる。   When the variance VL is large, various brightness values exist in the feature region of interest, and it is assumed that there is a strong gradation related to the brightness value. As a typical example, a state in which a plurality of small regions having different brightness values exist in the feature region of interest can be considered. In such a case, if the value YL2 is set to a small value, the boundary of the small areas with different brightness in the attention feature area after correction becomes clear, and the unevenness of brightness becomes conspicuous.

そこで、関数FL2は分散VLが小さい場合にのみ値YL2を小さくする関数とされる。これにより、赤目補正により特徴領域内に段差のような模様が生じることを防止しつつ可能な限り明度を小さくすることが実現される。   Therefore, the function FL2 is a function that decreases the value YL2 only when the variance VL is small. As a result, it is possible to reduce the brightness as much as possible while preventing a pattern such as a step in the feature region from being generated by red-eye correction.

なお、関数FL2においても彩度の場合と同様に、最大値XL3と最頻値XL2との差の大きさに基づいて値YL2が調整されてもよい。   In the function FL2, as in the case of saturation, the value YL2 may be adjusted based on the magnitude of the difference between the maximum value XL3 and the mode value XL2.

以上のようにして値YL1,YL2,YL3が決定されると、座標(XL1,YL1)、(XL2,YL2)、(XL3,YL3)の3つの点を通る2次曲線が明度に関する補正曲線62として生成される。これにより、明度の最小値および最大値を保持しつつ中間値を減少させる補正曲線62が得られる。もちろん、3つの点から他の手法により補正曲線62が求められてもよい。   When the values YL1, YL2, and YL3 are determined as described above, a quadratic curve that passes through the three points of coordinates (XL1, YL1), (XL2, YL2), and (XL3, YL3) is a correction curve 62 relating to brightness. Is generated as As a result, a correction curve 62 that decreases the intermediate value while maintaining the minimum value and the maximum value of the brightness is obtained. Of course, the correction curve 62 may be obtained from the three points by another method.

図12は色相に関する補正曲線63を例示する図である。図12において横軸は補正前の色相(すなわち、変換部213の入力)であり、縦軸は補正後の色相(すなわち、変換部213の出力)である。値XH2は色相のヒストグラムの最頻値であり、値XH1と値XH3との間の範囲は値XH2が示す色相と同色とみなすことができる色相範囲である。ただし、注目特徴領域内の色相は全て値XH1と値XH3との間の範囲に含まれるものとする。図12において補正後の値YH1,YH2,YH3はそれぞれ値XH1,XH2,XH3に対応している。   FIG. 12 is a diagram illustrating a correction curve 63 related to hue. In FIG. 12, the horizontal axis represents the hue before correction (that is, the input of the conversion unit 213), and the vertical axis represents the hue after correction (that is, the output of the conversion unit 213). The value XH2 is the mode value of the hue histogram, and the range between the value XH1 and the value XH3 is a hue range that can be regarded as the same color as the hue indicated by the value XH2. However, all the hues in the target feature area are included in the range between the value XH1 and the value XH3. In FIG. 12, the corrected values YH1, YH2, and YH3 correspond to the values XH1, XH2, and XH3, respectively.

なお、値XH1および値XH3は注目特徴領域における補正前の色相範囲の一端および他端の値として決定されてもよい。   Note that the value XH1 and the value XH3 may be determined as values at one end and the other end of the hue range before correction in the target feature region.

補正後の値YH1,YH2,YH3は予め設定されており、茶色の虹彩の場合には茶色の範囲、青色の虹彩の場合には青色の範囲に対応した値として設定される。そして、座標(XH1,YH1)、(XH2,YH2)、(XH3,YH3)の3つの点を通る2次曲線が色相に関する補正曲線63として生成される。もちろん、3つの点から他の手法により補正曲線63が求められてもよい。   The corrected values YH1, YH2, and YH3 are set in advance, and are set as values corresponding to the brown range in the case of a brown iris and to the blue range in the case of a blue iris. Then, a quadratic curve passing through the three points of coordinates (XH1, YH1), (XH2, YH2), and (XH3, YH3) is generated as a correction curve 63 related to hue. Of course, the correction curve 63 may be obtained from the three points by another method.

以上の手法で補正曲線63を生成することにより、補正前の最頻値XH2を予め指定された値YH2へと補正しつつ注目特徴領域の色相を適切な色相範囲内の値へと補正することが実現される。   By generating the correction curve 63 by the above method, the hue of the feature region of interest is corrected to a value within an appropriate hue range while correcting the mode value XH2 before correction to the value YH2 specified in advance. Is realized.

次に、彩度および明度に対して行われる平滑化用の加重係数の算出および平滑化について説明する。平滑化は処理対象となる単位領域の特徴量を周囲の8個の単位領域の特徴量とともに重み付け平均して得られる値へと変換する処理となっている。例えば、3×3(=9)個の単位領域のいずれかの特徴量をCp(pは単位領域の位置を示す。)とし、この単位領域に対する加重係数をapとした場合、平滑化後の特徴量Cは数9にて求められる。 Next, the calculation and smoothing of the weighting coefficient for smoothing performed on the saturation and the brightness will be described. Smoothing is a process of converting the feature quantity of the unit area to be processed into a value obtained by weighted averaging together with the feature quantities of the surrounding eight unit areas. For example, if any feature amount of 3 × 3 (= 9) unit areas is C p (p indicates the position of the unit area) and the weighting coefficient for this unit area is a p , smoothing is performed. The subsequent feature amount C is obtained by Equation 9.

Figure 2009064459
Figure 2009064459

図13は平滑化の際に用いられるフィルタの加重係数を示す図である。図13に示すように処理対象となる中央の単位領域の加重係数が1とされ、周囲の単位領域の加重係数は1/Wとされる。ただし、値Wは1以上の値であり、注目特徴量が彩度の場合には数10により、明度の場合には数11により求められる。   FIG. 13 is a diagram showing filter weighting coefficients used in smoothing. As shown in FIG. 13, the weighting coefficient of the central unit area to be processed is set to 1, and the weighting coefficient of the surrounding unit areas is set to 1 / W. However, the value W is a value of 1 or more, and is obtained from Equation 10 when the feature amount of interest is saturation and is obtained from Equation 11 when the feature value is lightness.

Figure 2009064459
Figure 2009064459

Figure 2009064459
Figure 2009064459

彩度用の関数FWSは彩度の最頻値XS2および分散VSをパラメータとし、これらのパラメータは彩度のヒストグラムから求められる。明度用の関数FWLも明度の最頻値XL2および分散VLをパラメータとし、これらのパラメータは明度のヒストグラムから求められる。   The saturation function FWS uses the saturation mode XS2 and the variance VS as parameters, and these parameters are obtained from the saturation histogram. The lightness function FWL also uses the lightness mode XL2 and the variance VL as parameters, and these parameters are obtained from the lightness histogram.

既述のように、特徴量の分散が大きい場合、注目特徴領域において特徴量の異なる複数の小領域が存在する可能性が高い。このような場合に赤目補正を行うと小領域ごとの彩度や明度の相違が大きくなってしまい、注目特徴領域内にむらが生じてしまう。そこで、関数FWS,FWLはそれぞれ分散VS,VLが大きいほど平滑化の度合いが大きくなるように値Wを決定する。なお、値Wが1に近いほど平滑化の度合いは大きくなる。   As described above, when the variance of the feature amount is large, there is a high possibility that a plurality of small regions having different feature amounts exist in the feature region of interest. When red-eye correction is performed in such a case, the difference in saturation and lightness for each small area becomes large, and unevenness occurs in the feature area of interest. Therefore, the functions WWS and FWL determine the value W so that the degree of smoothing increases as the variances VS and VL increase. Note that the degree of smoothing increases as the value W approaches 1.

また、注目特徴領域において特徴量の異なる複数の小領域が存在する場合、彩度や明度の最頻値XS2,XL2が大きいほど補正後の彩度や明度の偏りが顕著となることから、関数FWS,FWLはそれぞれ最頻値XS2,XL2が大きいほど平滑化の度合いが大きくなるように値Wを決定する。   Further, when there are a plurality of small regions having different feature amounts in the feature region of interest, the bias in saturation and lightness after correction becomes more prominent as the mode values XS2 and XL2 of saturation and lightness are larger. For FWS and FWL, the value W is determined so that the smoothing degree increases as the mode values XS2 and XL2 increase.

以上のように、分散および最頻値に基づいて平滑化の度合いを決定することにより、各特徴領域の特性に応じた適切な平滑化が実現される。   As described above, by determining the degree of smoothing based on the variance and the mode value, appropriate smoothing according to the characteristics of each feature region is realized.

注目特徴領域に対する補正および必要な平滑化が完了すると、未処理の特徴領域が存在するか否かが確認され(図7:ステップS51)、未処理の特徴領域が存在する場合には次の注目特徴領域が決定される(図5:ステップS21)。その後、注目特徴領域の各単位領域の彩度および明度に対して補正および平滑化が行われ、色相に対して補正が行われる。   When the correction for the target feature region and the necessary smoothing are completed, it is confirmed whether or not there is an unprocessed feature region (FIG. 7: Step S51). A feature region is determined (FIG. 5: step S21). Thereafter, correction and smoothing are performed on the saturation and lightness of each unit region of the target feature region, and the hue is corrected.

全ての特徴量領域に対して補正および平滑化が行われると、補正後の特徴領域を有する対象領域402がHSL色空間からRGB色空間へと戻され、さらに、画像データ301と合成されて補正済画像データ302としてRAM14に保存される(ステップS52)。補正済画像データ302は表示制御部201に転送され、ディスプレイ12に赤目補正が施された画像が表示される(ステップS53)。   When correction and smoothing are performed on all feature amount regions, the target region 402 having the corrected feature region is returned from the HSL color space to the RGB color space, and further combined with the image data 301 to be corrected. The image data 302 is stored in the RAM 14 (step S52). The corrected image data 302 is transferred to the display control unit 201, and an image subjected to red-eye correction is displayed on the display 12 (step S53).

以上、プログラム141に従って赤目補正を行う画像処理装置1について説明したが、画像処理装置1では補正対象である特徴領域における特徴量のヒストグラムを生成し、特徴量を補正するための補正曲線がヒストグラムに基づいて生成される。したがって、特徴領域に対して特徴領域の特性に応じた補正を行うことが実現される。また、補正前の特徴領域内の特徴量のグラデーションに応じて補正後の特徴領域内にグラデーションが生じるため、より自然な目へと補正を行うことができる。その結果、様々な態様にて生じる赤目を適切に補正することが実現される。   The image processing apparatus 1 that performs red-eye correction according to the program 141 has been described above. However, the image processing apparatus 1 generates a histogram of feature amounts in a feature region that is a correction target, and a correction curve for correcting the feature amounts is displayed in the histogram. Based on. Accordingly, it is possible to perform correction according to the characteristics of the feature region with respect to the feature region. In addition, since gradation is generated in the corrected feature area in accordance with the gradation of the feature amount in the feature area before correction, correction can be performed to more natural eyes. As a result, it is possible to appropriately correct red eyes generated in various modes.

なお、特徴量として彩度、明度および色相を利用することにより、補正曲線を求めるための関数の設定を人の感性に基づいて容易に行うことができ、より自然な補正済画像を得ることができる。   Note that by using the saturation, lightness, and hue as feature quantities, it is possible to easily set a function for obtaining a correction curve based on human sensitivity, and to obtain a more natural corrected image. it can.

また、特徴領域の補正の後(または前)に処理対象となる特徴領域に応じた平滑化を行うため、赤目領域全体に適切な平滑化を行うことができる。さらに、小さな特徴領域に対しては解像度を増大させた上で補正を行うため、小さな特徴領域に対しても適切に補正を行うことができる。   In addition, since the smoothing according to the feature area to be processed is performed after (or before) the correction of the feature area, the entire red-eye area can be appropriately smoothed. Furthermore, since correction is performed after increasing the resolution for a small feature region, it is possible to appropriately correct even for a small feature region.

<変形例>
以上、本発明の一の実施の形態について説明してきたが、本発明は上記実施の形態に限定されるものではなく様々な変形が可能である。
<Modification>
Although one embodiment of the present invention has been described above, the present invention is not limited to the above embodiment, and various modifications can be made.

上記実施の形態では特徴領域ごとに補正が行われるが、例えば、近接する2つの虹彩領域が抽出された場合にはこれらの虹彩領域が1つの特徴領域として扱われてもよい。他の種類の特徴領域についても同様である。   In the above embodiment, correction is performed for each feature region. For example, when two adjacent iris regions are extracted, these iris regions may be treated as one feature region. The same applies to other types of feature regions.

また、ヒストグラムからパラメータを導き出すと説明したが、特徴量の値と頻度との関係を示すヒストグラムという概念はプログラム中に任意の態様にて表現されてよい。例えば、複数の変数、配列、あるいは、オブジェクトとしてヒストグラムを表現することができる。   Further, although it has been described that the parameters are derived from the histogram, the concept of a histogram indicating the relationship between the feature value and the frequency may be expressed in an arbitrary manner in the program. For example, a histogram can be expressed as a plurality of variables, arrays, or objects.

色相については値YH1,YH2,YH3は予め定められるものとして説明したが、これらの値は関数を用いて求められてもよい。例えば、値YH1,YH2,YH3が、補正前の色相の範囲および最頻値、並びに、補正後の最頻値等をパラメータとする関数により求められてもよい。   Although the values YH1, YH2, and YH3 have been described as being predetermined for the hue, these values may be obtained using a function. For example, the values YH1, YH2, and YH3 may be obtained by a function having the hue range and mode value before correction, the mode value after correction, and the like as parameters.

上記実施の形態では補正曲線や平滑化用のフィルタの生成に用いられるパラメータとして注目特徴量の最大値、最頻値および分散が利用され、補助的に最小値が用いられる例について説明したが、その他のパラメータが利用されてもよい。例えば、最頻値に代えて平均値が利用されてもよく、中央値(メジアン)が利用されてもよい。このように、ヒストグラムから導かれる統計学的値を利用することにより、補正曲線および平滑化用のフィルタの生成に必要なパラメータを容易に準備することができる。   In the above-described embodiment, the example in which the maximum value, the mode value, and the variance of the feature amount of interest are used as the parameters used for generating the correction curve and the smoothing filter, and the minimum value is used supplementarily has been described. Other parameters may be used. For example, an average value may be used instead of the mode value, and a median value (median) may be used. As described above, by using the statistical value derived from the histogram, it is possible to easily prepare parameters necessary for generating the correction curve and the smoothing filter.

また、上記実施の形態では特徴量として色相、彩度および明度が用いられるが、L***、LUV、XYZ等の表色系(色空間)における値が特徴量として利用されてもよく、RGBの値がそのまま特徴量とされてもよい。なお、特徴量を補正することは最終的には画素値を補正することに相当する。 In the above embodiment, hue, saturation, and lightness are used as feature amounts. However, values in a color system (color space) such as L * a * b * , LUV, and XYZ may be used as feature amounts. Of course, RGB values may be used as feature values as they are. Note that correcting the feature amount ultimately corresponds to correcting the pixel value.

平滑化も上記実施の形態とは異なる他の手法が用いられてもよい。例えば、フィルタが5×5以上であってもよく加重平均も4方向の隣接単位領域のみに対して行われてもよい。   For smoothing, another method different from the above embodiment may be used. For example, the filter may be 5 × 5 or more, and the weighted average may be performed only on the adjacent unit regions in the four directions.

一方、画像処理装置1における画像データの取得は、上記実施の形態のようにメモリカード92から読み込まれるのではなく、例えば、ケーブル接続、通信回線または無線等により画像処理装置1と他の装置とが信号の送受信を行うことによって取得されてもよい。画像処理装置1に撮像部を設けて画像のデータが取得されてもよい。   On the other hand, the acquisition of image data in the image processing apparatus 1 is not read from the memory card 92 as in the above-described embodiment, but is performed between the image processing apparatus 1 and other apparatuses by, for example, cable connection, communication line, or radio. May be obtained by transmitting and receiving signals. The image processing device 1 may be provided with an imaging unit to acquire image data.

プログラム141はROM15に予め書き込まれていてもよい。また、画像処理装置1では、一連の画像処理が全てCPUによりソフトウェア的処理で実行されているが、それらの処理の一部または全部を専用の回路により実現することも可能である。特に、反復演算をロジック回路にて実行することにより、迅速な画像処理が実現される。   The program 141 may be written in the ROM 15 in advance. In the image processing apparatus 1, a series of image processing is all executed by software processing by the CPU, but part or all of these processing can be realized by a dedicated circuit. In particular, rapid image processing is realized by executing repetitive operations in a logic circuit.

上記実施の形態では、対象領域402の形状を長方形としたがこれに限られるものではない。例えば、楕円形状や使用者が任意に指定する形状等であってもよい。さらに、上記の実施の形態では、対象領域402は使用者によって指定されたが、画像認識または特徴量による判定等により自動的に対象領域402が決定されてもよい。   In the above embodiment, the shape of the target region 402 is a rectangle, but is not limited thereto. For example, an elliptical shape or a shape arbitrarily designated by the user may be used. Furthermore, in the above embodiment, the target area 402 is specified by the user, but the target area 402 may be automatically determined by image recognition or determination based on a feature amount.

画像処理装置の外観を示す図である。It is a figure which shows the external appearance of an image processing apparatus. 画像処理装置の構成を示すブロック図である。It is a block diagram which shows the structure of an image processing apparatus. 画像処理装置の機能構成を示すブロック図である。It is a block diagram which shows the function structure of an image processing apparatus. 補正部の機能構成を示すブロック図である。It is a block diagram which shows the function structure of a correction | amendment part. 画像処理装置の動作の流れを示す図である。It is a figure which shows the flow of operation | movement of an image processing apparatus. 画像処理装置の動作の流れを示す図である。It is a figure which shows the flow of operation | movement of an image processing apparatus. 画像処理装置の動作の流れを示す図である。It is a figure which shows the flow of operation | movement of an image processing apparatus. 対象領域が指定された画像を例示する図である。It is a figure which illustrates the image to which the object area was specified. 特徴領域を例示する図である。It is a figure which illustrates the characteristic area. 彩度に関する補正曲線を示す図である。It is a figure which shows the correction curve regarding saturation. 明度に関する補正曲線を示す図である。It is a figure which shows the correction curve regarding brightness. 色相に関する補正曲線を示す図である。It is a figure which shows the correction curve regarding a hue. 平滑化用のフィルタの加重係数を示す図である。It is a figure which shows the weighting coefficient of the filter for smoothing.

符号の説明Explanation of symbols

1 画像処理装置
61〜63 補正曲線
91 記録ディスク
141 プログラム
501 瞳孔領域
502a 虹彩領域
503 虹彩外領域
S15,S21〜S23,S32〜S35,S42,S43 ステップ
1 Image processing device 61-63 Correction curve 91 Recording disk 141 Program 501 Pupil area 502a Iris area 503 Non-iris area S15, S21-S23, S32-S35, S42, S43 Steps

Claims (6)

画像中の赤目を補正するプログラムであって、前記プログラムのコンピュータによる実行は、前記コンピュータに、
特徴量に基づいて画像から赤目領域として抽出された複数の特徴領域に対して赤目補正を行う工程と、
前記赤目補正を行う工程の前または後に、前記複数の特徴領域のそれぞれに対して処理対象となる特徴領域に応じた平滑化を行う工程と、
を実行させることを特徴とするプログラム。
A program for correcting red-eye in an image, the computer executing the program,
Performing red-eye correction on a plurality of feature regions extracted as red-eye regions from an image based on feature amounts;
Before or after the step of performing the red-eye correction, performing a smoothing according to the feature region to be processed for each of the plurality of feature regions;
A program characterized by having executed.
請求項1に記載のプログラムであって、前記プログラムの前記コンピュータによる実行は、前記コンピュータに、
前記複数の特徴領域のそれぞれに関する特徴量のヒストグラムを生成する工程と、
前記ヒストグラムから導かれるパラメータに基づいて前記平滑化の度合いを決定する工程と、
をさらに実行させることを特徴とするプログラム。
The program according to claim 1, wherein execution of the program by the computer is performed on the computer.
Generating a histogram of feature amounts for each of the plurality of feature regions;
Determining the degree of smoothing based on parameters derived from the histogram;
Is further executed.
画像中の赤目を補正するプログラムであって、前記プログラムのコンピュータによる実行は、前記コンピュータに、
画像中の補正対象領域を決定する工程と、
前記補正対象領域の大きさと所定値とを比較する工程と、
前記補正対象領域の大きさが前記所定値よりも小さい場合に、前記補正対象領域の解像度を増大させる工程と、
前記補正対象領域に対して赤目補正を行う工程と、
を実行させることを特徴とするプログラム。
A program for correcting red-eye in an image, the computer executing the program,
Determining a correction target area in the image;
Comparing the size of the correction target area with a predetermined value;
Increasing the resolution of the correction target area when the size of the correction target area is smaller than the predetermined value;
Performing red-eye correction on the correction target region;
A program characterized by having executed.
請求項1ないし3のいずれかに記載のプログラムを記録したことを特徴とするコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium, wherein the program according to claim 1 is recorded. 画像中の赤目を補正する赤目補正方法であって、
特徴量に基づいて画像から赤目領域として抽出された複数の特徴領域に対して赤目補正を行う工程と、
前記赤目補正を行う工程の前または後に、前記複数の特徴領域のそれぞれに対して処理対象となる特徴領域に応じた平滑化を行う工程と、
を有することを特徴とする赤目補正方法。
A red-eye correction method for correcting red-eye in an image,
Performing red-eye correction on a plurality of feature regions extracted as red-eye regions from an image based on feature amounts;
Before or after the step of performing the red-eye correction, performing a smoothing according to the feature region to be processed for each of the plurality of feature regions;
A red-eye correction method comprising:
画像中の赤目を補正する赤目補正方法であって、
画像中の補正対象領域を決定する工程と、
前記補正対象領域の大きさと所定値とを比較する工程と、
前記補正対象領域の大きさが前記所定値よりも小さい場合に、前記補正対象領域の解像度を増大させる工程と、
前記補正対象領域に対して赤目補正を行う工程と、
を有することを特徴とする赤目補正方法。
A red-eye correction method for correcting red-eye in an image,
Determining a correction target area in the image;
Comparing the size of the correction target area with a predetermined value;
Increasing the resolution of the correction target area when the size of the correction target area is smaller than the predetermined value;
Performing red-eye correction on the correction target region;
A red-eye correction method comprising:
JP2008274141A 2008-10-24 2008-10-24 Program for correcting red eye in image, recording medium, and red eye correction method Expired - Fee Related JP4640490B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008274141A JP4640490B2 (en) 2008-10-24 2008-10-24 Program for correcting red eye in image, recording medium, and red eye correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008274141A JP4640490B2 (en) 2008-10-24 2008-10-24 Program for correcting red eye in image, recording medium, and red eye correction method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2001070140A Division JP4232345B2 (en) 2001-03-13 2001-03-13 Program for correcting red eye in image, recording medium, and red eye correction method

Publications (2)

Publication Number Publication Date
JP2009064459A true JP2009064459A (en) 2009-03-26
JP4640490B2 JP4640490B2 (en) 2011-03-02

Family

ID=40558933

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008274141A Expired - Fee Related JP4640490B2 (en) 2008-10-24 2008-10-24 Program for correcting red eye in image, recording medium, and red eye correction method

Country Status (1)

Country Link
JP (1) JP4640490B2 (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0713274A (en) * 1993-06-25 1995-01-17 Olympus Optical Co Ltd Red-eye effect correcting device
JPH11136498A (en) * 1997-08-29 1999-05-21 Eastman Kodak Co Computer program matter for red eye detection
JP2000076427A (en) * 1998-06-15 2000-03-14 Fuji Photo Film Co Ltd Image processing method
JP2000102033A (en) * 1998-09-18 2000-04-07 Victor Co Of Japan Ltd Automatic gradation correction method
JP2000134486A (en) * 1998-10-22 2000-05-12 Canon Inc Image processing unit, image processing method and storage medium
JP2001036740A (en) * 1999-07-23 2001-02-09 Fuji Photo Film Co Ltd Image processor
JP2001061071A (en) * 2000-01-01 2001-03-06 Olympus Optical Co Ltd Image correction device and image correction method
WO2001071421A1 (en) * 2000-03-23 2001-09-27 Kent Ridge Digital Labs Red-eye correction by image processing
EP1229734A1 (en) * 2001-01-31 2002-08-07 GRETAG IMAGING Trading AG Automatic colour defect correction
JP4232345B2 (en) * 2001-03-13 2009-03-04 コニカミノルタビジネステクノロジーズ株式会社 Program for correcting red eye in image, recording medium, and red eye correction method

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0713274A (en) * 1993-06-25 1995-01-17 Olympus Optical Co Ltd Red-eye effect correcting device
JPH11136498A (en) * 1997-08-29 1999-05-21 Eastman Kodak Co Computer program matter for red eye detection
JP2000076427A (en) * 1998-06-15 2000-03-14 Fuji Photo Film Co Ltd Image processing method
JP2000102033A (en) * 1998-09-18 2000-04-07 Victor Co Of Japan Ltd Automatic gradation correction method
JP2000134486A (en) * 1998-10-22 2000-05-12 Canon Inc Image processing unit, image processing method and storage medium
JP2001036740A (en) * 1999-07-23 2001-02-09 Fuji Photo Film Co Ltd Image processor
JP2001061071A (en) * 2000-01-01 2001-03-06 Olympus Optical Co Ltd Image correction device and image correction method
WO2001071421A1 (en) * 2000-03-23 2001-09-27 Kent Ridge Digital Labs Red-eye correction by image processing
JP2004502212A (en) * 2000-03-23 2004-01-22 インスティチュート・フォー・インフォコム・リサーチ Red-eye correction by image processing
EP1229734A1 (en) * 2001-01-31 2002-08-07 GRETAG IMAGING Trading AG Automatic colour defect correction
JP2002305667A (en) * 2001-01-31 2002-10-18 Gretag Imaging Trading Ag Method and device for automatically correcting color defect
JP4232345B2 (en) * 2001-03-13 2009-03-04 コニカミノルタビジネステクノロジーズ株式会社 Program for correcting red eye in image, recording medium, and red eye correction method

Also Published As

Publication number Publication date
JP4640490B2 (en) 2011-03-02

Similar Documents

Publication Publication Date Title
JP4232345B2 (en) Program for correcting red eye in image, recording medium, and red eye correction method
US8929681B2 (en) Image processing apparatus and image processing method
JP4856086B2 (en) Method and apparatus for detecting red eye in an acquired digital image
US9055263B2 (en) Apparatus, method and computer program for correcting an image using lookup tables generated by inputted image analysis
US9979942B2 (en) Per pixel color correction filtering
US7683973B2 (en) Image processing method and apparatus performing color adjustment
US7580566B2 (en) Image processing device, image processing method, storage medium, and program
US20090034838A1 (en) Device adaptively switching color emphasis processing for image
US20060093238A1 (en) Method and apparatus for red-eye detection in an acquired digital image using face recognition
WO2018176925A1 (en) Hdr image generation method and apparatus
JP6663285B2 (en) Image generation method and image generation system
US9185265B2 (en) Image processing method and image processing apparatus for performing a tone correction to acquire a combined image
JP2007129535A (en) Image processor, image processing method, program thereof, and computer-readable recording medium recorded with same program
JP4262151B2 (en) Image processing method, image processing apparatus, computer program, and storage medium
JP6711396B2 (en) Image processing device, imaging device, image processing method, and program
US20100253852A1 (en) Image processing apparatus, image processing method, and computer program
JP2006343863A (en) Image processor and image processing method
US20060056722A1 (en) Edge preserving method and apparatus for image processing
JP4640490B2 (en) Program for correcting red eye in image, recording medium, and red eye correction method
JP2004023737A (en) Image processing apparatus and method thereof
JP2006268153A (en) Image processing device, image processing method, and program
KR102195279B1 (en) Method and system for image registering using regional warping
JP2008147714A (en) Image processor and image processing method
JP5600645B2 (en) Image processing program and image processing method
JP4586963B2 (en) Automatic pupil correction method

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100817

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101015

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: 20101102

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101115

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131210

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees