JP2005176261A - Color defective area correction method, color defective area correction processing program, color area specification method, color area specification processing program and image processing apparatus - Google Patents

Color defective area correction method, color defective area correction processing program, color area specification method, color area specification processing program and image processing apparatus Download PDF

Info

Publication number
JP2005176261A
JP2005176261A JP2003417132A JP2003417132A JP2005176261A JP 2005176261 A JP2005176261 A JP 2005176261A JP 2003417132 A JP2003417132 A JP 2003417132A JP 2003417132 A JP2003417132 A JP 2003417132A JP 2005176261 A JP2005176261 A JP 2005176261A
Authority
JP
Japan
Prior art keywords
color
region
area
correction
red
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
JP2003417132A
Other languages
Japanese (ja)
Other versions
JP4281541B2 (en
Inventor
Shigeru Tsuchiida
茂 土井田
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 JP2003417132A priority Critical patent/JP4281541B2/en
Publication of JP2005176261A publication Critical patent/JP2005176261A/en
Application granted granted Critical
Publication of JP4281541B2 publication Critical patent/JP4281541B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Control Of Exposure In Printing And Copying (AREA)
  • Image Processing (AREA)
  • Processing Of Color Television Signals (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a color defective area correction method and the like for more easily and surely correcting a color defective area in various images captured under various photographing conditions. <P>SOLUTION: Image data including a color defective area wherein a red-eye phenomenon occurs, are read to extract a red-eye area (step S1). The extracted red-eye area includes a defective part with regard to a color defective area to be corrected. Processing specifying an area is newly performed for interpolating the defective part of the red-eye area (step S2). Furthermore, coincidence of the new area with the color defective area to be corrected is evaluated (step S3) and on the basis of a result of the evaluation, the specified area is deformed to be coincident with the color defective area to be corrected (step S4). <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、画像処理において、色不良領域などの特定の色領域を特定する色領域特定方法、色領域特定処理プログラム、および、色領域特定方法を用い、色不良領域を補正する色不良領域補正方法、色不良領域補正処理プログラム、および、色領域特定処理プログラムまたは色不良領域補正処理プログラムのいずれか、またはその両方の実行が可能な画像処理装置に関する。特に、フラッシュ撮影時の赤目現象による色不良を改善する技術に関する。   The present invention relates to a color defect area correction method for correcting a color defect area by using a color area identification method, a color area identification processing program, and a color area identification method for identifying a specific color area such as a color defect area in image processing. The present invention relates to a method, a color defect area correction processing program, and an image processing apparatus capable of executing either a color area specifying process program or a color defect area correction processing program, or both. In particular, the present invention relates to a technique for improving color defects due to red-eye phenomenon during flash photography.

フラッシュ撮影をしたとき、人の目が赤くなったり金色になったりするいわゆる赤目現象が知られている。この赤目を修正する装置が開示されている(特許文献1)。この赤目修正装置では、色不良となった瞳を含むなるべく小さな矩形領域をユーザが指定する。そして、指定された領域内部全体において、色度の平均値等のパラメータからしきい値処理を行うことにより、赤目現象による色不良領域を抽出して修正するものである。   A so-called red-eye phenomenon is known in which a person's eyes turn red or become golden when flash photography is performed. An apparatus for correcting this red eye is disclosed (Patent Document 1). In this red-eye correction device, the user designates a rectangular area as small as possible including a pupil with a color defect. Then, by performing threshold processing based on parameters such as an average value of chromaticity in the entire designated area, a color defect area due to a red-eye phenomenon is extracted and corrected.

特開平7−13274号公報JP-A-7-13274

しかし、瞳の色不良を単純に赤目といっても、撮影環境や照明条件などの影響によって、普通の赤色をした赤目、明るい赤色をした金目と呼ばれるもの、またはグラデーションを持った赤目など、様々な種類のものが存在する。そのため、特許文献1に開示されているようにしきい値処理によって色不良領域を抽出する方法では、これらの様々な赤目現象による色不良領域の全てを正確に抽出することが実際上困難であり、抽出しきれずに補正できない色不良領域が残ることがある。   However, even if the color defect of the pupil is simply referred to as red-eye, there are various types of red eyes with normal red eyes, gold eyes with bright red colors, or red eyes with gradation depending on the shooting environment and lighting conditions. There are various kinds of things. Therefore, in the method of extracting the color defect area by threshold processing as disclosed in Patent Document 1, it is actually difficult to accurately extract all of the color defect areas due to these various red-eye phenomena. A defective color area that cannot be corrected without being extracted may remain.

請求項1の発明による色領域特定方法は、補正すべき色不良領域を含む画像より、その色不良領域に対して欠損部分を有する第1の領域を抽出する領域抽出ステップと、第1の領域の欠損部分を補間する第2の領域を特定する領域補間ステップとを有するものである。
請求項2の発明による色領域特定方法は、補正すべき色不良領域を含み、その色不良領域に対して欠損部分を有する第1の領域が抽出された画像を取得する画像取得ステップと、第1の領域の欠損部分を補間する第2の領域を特定する領域補間ステップとを有するものである。
請求項3の発明は、請求項1または2の色領域特定方法において、色不良領域は、赤目現象によって生じた赤目領域とするものである。
請求項4の発明は、請求項1〜3のいずれかの色領域特定方法において、第2の領域は、第1の領域よりも大きいこととするものである。
請求項5の発明は、請求項1〜4のいずれかの色領域特定方法において、領域補間ステップは、第1の領域を画像上に設定された所定の大きさの構造要素内で移動させたときの論理和の領域を求めるミンコフスキー和演算ステップと、ミンコフスキー和演算ステップにより求められた領域を構造要素内で移動させたときの論理差の領域を求めるミンコフスキー差演算ステップとを含み、ミンコフスキー差演算ステップにより求められた領域を第2の領域として特定するものである。
請求項6の発明は、請求項5の色領域特定方法において、構造要素の大きさを第1の領域の大きさに基づいて決定するものである。
請求項7の発明は、請求項1〜6のいずれかの色領域特定方法において、領域補間ステップにより特定された第2の領域を色不良領域に一致させるように変形する領域変形ステップをさらに有するものである。
請求項8の発明は、請求項7の色領域特定方法において、領域変形ステップは、第2の領域の色不良領域に対する一致性を評価する評価ステップと、評価ステップの結果に基づいてその第2の領域を変形する変形ステップとを含むものである。
請求項9の発明は、請求項8の色領域特定方法において、評価ステップは、第2の領域の境界から所定範囲内における色情報に基づいて、色不良領域に最も一致する境界位置を求めることにより一致性を評価するものである。
請求項10の発明は、請求項9の色領域特定方法において、変形ステップは、第2の領域の境界を評価ステップにより求められた境界位置とすることにより、その第2の領域を変形するものである。
請求項11の発明による色不良領域補正方法は、請求項1〜6のいずれかの色領域特定方法により特定された第2の領域の色情報を変更することにより、色不良領域の色補正を行う色補正ステップを有するものである。
請求項12の発明による色不良領域補正方法は、請求項7〜10のいずれかの色領域特定方法により特定され変形された第2の領域の色情報を変更することにより、色不良領域の色補正を行う色補正ステップを有するものである。
請求項13の発明は、請求項11または12の色不良領域補正方法において、色補正ステップは、画像の所定部分の色情報を取得して記憶する記憶ステップと、記憶ステップにより記憶された色情報に基づいて色不良領域に含まれる所定部分の色補正を行う部分色補正ステップとを含むものである。
請求項14の発明は、請求項13の色不良領域補正方法において、記憶ステップは、画像よりキャッチライトの部分を探索し、その部分の色情報を取得して記憶し、部分色補正ステップは、記憶ステップにより色情報を記憶されたキャッチライトの部分の色補正を行うものである。
請求項15の発明による色領域特定処理プログラムは、請求項1〜10いずれか1項に記載の色領域特定方法のステップをコンピュータに実行させるためのものである。
請求項16の発明による色不良領域補正処理プログラムは、請求項11〜14いずれか1項に記載の色不良領域補正方法のステップをコンピュータに実行させるためのものである。
請求項17の発明によるコンピュータ読みとり可能な記録媒体は、請求項15の色領域特定処理プログラムまたは請求項16の色不良領域補正処理プログラムのいずれか、またはその両方を記録したものである。
請求項18の発明による画像処理装置は、請求項15の色領域特定処理プログラムまたは請求項16の色不良領域補正処理プログラムのいずれか、またはその両方を搭載し、実行するものである。
According to a first aspect of the present invention, there is provided a color region specifying method for extracting, from an image including a color defect area to be corrected, a first area having a defective portion with respect to the color defect area; And a region interpolation step for specifying a second region for interpolating the missing portion.
According to a second aspect of the present invention, there is provided a color region specifying method for acquiring an image including a color defect region to be corrected and extracting a first region having a defective portion with respect to the color defect region; And a region interpolation step for specifying a second region for interpolating a missing portion of one region.
According to a third aspect of the present invention, in the color region specifying method of the first or second aspect, the color defect region is a red-eye region caused by a red-eye phenomenon.
According to a fourth aspect of the present invention, in the color region specifying method according to any one of the first to third aspects, the second region is larger than the first region.
According to a fifth aspect of the present invention, in the color region identification method according to any one of the first to fourth aspects, the region interpolation step moves the first region within a structural element having a predetermined size set on the image. A Minkowski difference calculation step including a Minkowski sum calculation step for obtaining a logical OR region, and a Minkowski difference calculation step for obtaining a logical difference region when the region obtained by the Minkowski sum calculation step is moved within the structural element. The area obtained by the step is specified as the second area.
According to a sixth aspect of the present invention, in the color region specifying method according to the fifth aspect, the size of the structural element is determined based on the size of the first region.
The invention according to claim 7 further includes a region modification step for deforming the second region identified by the region interpolation step so as to coincide with the color defect region in the color region identification method according to any one of claims 1 to 6. Is.
According to an eighth aspect of the present invention, in the color region specifying method according to the seventh aspect, the region deformation step includes an evaluation step for evaluating the coincidence of the second region with the color defect region, and a second step based on the result of the evaluation step. And a deformation step for deforming the region.
According to a ninth aspect of the present invention, in the color region specifying method according to the eighth aspect, the evaluation step obtains a boundary position that most closely matches the defective color region based on color information within a predetermined range from the boundary of the second region. Is used to evaluate the coincidence.
According to a tenth aspect of the present invention, in the color region specifying method according to the ninth aspect, the deformation step deforms the second region by setting the boundary of the second region as the boundary position obtained by the evaluation step. It is.
The color defect area correction method according to the invention of claim 11 corrects the color defect area by changing the color information of the second area specified by the color area specification method of any one of claims 1-6. It has a color correction step to be performed.
According to a twelfth aspect of the present invention, there is provided a method for correcting a defective color area by changing the color information of the second area specified and transformed by the color area specifying method according to any one of the seventh to tenth aspects. It has a color correction step for performing correction.
According to a thirteenth aspect of the present invention, in the color defect region correction method according to the eleventh or twelfth aspect, the color correction step acquires and stores color information of a predetermined portion of the image, and the color information stored by the storage step. And a partial color correction step for correcting the color of a predetermined portion included in the color defect area.
According to a fourteenth aspect of the present invention, in the color defect region correction method according to the thirteenth aspect, the storage step searches for a catchlight portion from the image, acquires and stores the color information of the portion, and the partial color correction step includes: The color correction is performed on the catch light portion in which the color information is stored in the storing step.
According to a fifteenth aspect of the present invention, there is provided a color region specifying processing program for causing a computer to execute the steps of the color region specifying method according to any one of the first to tenth aspects.
A color defect area correction processing program according to a sixteenth aspect of the invention is a program for causing a computer to execute the steps of the color defect area correction method according to any one of claims 11 to 14.
According to a seventeenth aspect of the present invention, a computer-readable recording medium records either or both of the color region specifying processing program according to the fifteenth aspect and the color defect region correcting processing program according to the sixteenth aspect.
An image processing apparatus according to an eighteenth aspect of the present invention has the color region specifying processing program of the fifteenth aspect and the defective color region correction processing program of the sixteenth aspect, or both, mounted and executed.

本発明によれば、抽出しきれずに欠損した色不良領域の欠損部分を補間するようにしたので、補正すべき色不良領域を、自然な色状態へ、容易に、短時間で、確実に補正することができる。   According to the present invention, since the defective portion of the color defect area that has been missing without being extracted is interpolated, the color defect area to be corrected can be easily and reliably corrected to a natural color state in a short time. can do.

−第1の実施の形態−
図1は、本発明の色不良領域補正方法を実施する一実施の形態を示す図である。符号1は、一般に市販されているパーソナルコンピュータ(以下パソコンと言う)である。パソコン1は、CPU、メモリ、ハードディスク、I/Oポート、各種のインターフェース等からなる制御装置2と、各種画像や情報を表示するモニタ3と、キーボード4と、マウス5と、CD−ROM駆動装置6とからなる。CD−ROM駆動装置6は、CD−ROMやDVDなどの記録媒体7が搭載され、各種のデジタルデータを読み込むことができる。制御装置2は、USB等のインターフェースを介してデジタルカメラ(電子カメラ)8と接続可能である。また、モデムやLANボード等を介してインターネット9とも接続可能である。
-First embodiment-
FIG. 1 is a diagram showing an embodiment for carrying out the color defect area correction method of the present invention. Reference numeral 1 denotes a commercially available personal computer (hereinafter referred to as a personal computer). A personal computer 1 includes a control device 2 including a CPU, a memory, a hard disk, an I / O port, various interfaces, a monitor 3 for displaying various images and information, a keyboard 4, a mouse 5, and a CD-ROM drive device. 6 and. The CD-ROM driving device 6 is equipped with a recording medium 7 such as a CD-ROM or DVD, and can read various digital data. The control device 2 can be connected to a digital camera (electronic camera) 8 via an interface such as a USB. It can also be connected to the Internet 9 via a modem, a LAN board, or the like.

本実施の形態のパソコン1は、記録媒体7、デジタルカメラ8、あるいはインターネット9を介した他のコンピュータ10等から、デジタルカメラ等で撮像して得られた画像データを取得することができる。パソコン1は、画像処理プログラムを実行することが可能であり、取得した画像データに各種の画像処理を加えることが可能である。本実施の形態では、画像処理の1つとして赤目現象を補正する処理を行うことができる。   The personal computer 1 according to the present embodiment can acquire image data obtained by imaging with a digital camera or the like from the recording medium 7, the digital camera 8, or another computer 10 via the Internet 9. The personal computer 1 can execute an image processing program, and can apply various types of image processing to the acquired image data. In the present embodiment, a process for correcting the red-eye phenomenon can be performed as one of the image processes.

画像処理プログラムは、制御装置2内部のハードディスクに格納され、制御装置2のメモリに読みこまれて、制御装置2により実行される。画像処理プログラムは、記録媒体7等に格納されて、あるいは、インターネット9などの電気通信回線を通じてデータ信号としてパソコン1に提供される。提供された画像処理プログラムは、制御装置2内部のハードディスクに格納される。インターネット9を通じて画像処理プログラムが提供される場合、インターネット9を介して接続されるサーバコンピュータから提供される。図1において、例えば、コンピュータ10がサーバコンピュータとなり得る。サーバコンピュータ10は、内部のハードディスク等の記録媒体に提供すべき画像処理プログラムを格納している。   The image processing program is stored in a hard disk inside the control device 2, read into the memory of the control device 2, and executed by the control device 2. The image processing program is stored in the recording medium 7 or the like, or provided to the personal computer 1 as a data signal through an electric communication line such as the Internet 9. The provided image processing program is stored in a hard disk inside the control device 2. When the image processing program is provided via the Internet 9, it is provided from a server computer connected via the Internet 9. In FIG. 1, for example, a computer 10 can be a server computer. The server computer 10 stores an image processing program to be provided on a recording medium such as an internal hard disk.

以下、本実施の形態における赤目現象の補正処理について説明する。赤目現象とは、カメラ等を使用して人物をフラッシュ撮影したとき、撮影された人物の目がウサギの目のように赤く写る現象をいう。目が赤くなるのは、目の網膜の毛細血管が写るためであり、正確には目の瞳孔部分が赤くなる。撮影条件によっては金色になる場合もあり、このような金目も、まとめて赤目現象と言う。すなわち、赤目現象とは、フラッシュ撮影などにより人物の目が違和感のある色になっている現象であり、言いかえれば瞳孔あたりの領域で色不良が生じている現象である。また、動物の目において赤目現象が生じる場合もある。   Hereinafter, red-eye phenomenon correction processing according to the present embodiment will be described. The red-eye phenomenon is a phenomenon in which when a person is flash-photographed using a camera or the like, the photographed person's eyes appear red like a rabbit's eye. The eyes turn red because the capillaries in the retina of the eye are reflected, and the pupil part of the eyes turns red. Depending on the shooting conditions, it may be gold, and these gold eyes are collectively referred to as the red-eye phenomenon. In other words, the red-eye phenomenon is a phenomenon in which a person's eyes have an uncomfortable color due to flash photography or the like, in other words, a phenomenon in which a color defect occurs in an area around the pupil. In addition, red-eye phenomenon may occur in animal eyes.

本実施形態において、赤目補正処理はパソコン1で実行される画像処理プログラムの一部として行われるものであり、制御装置2内部のメモリに読みこまれた画像データを対象として実行される。画像データがメモリに読み込まれると、パソコン1はその画像データを使用して画像をモニタ3に表示した後、ユーザによって選択された各種の画像処理コマンドに応じた様々な画像処理プログラムを、その画像に対して実行する。すなわち、図2に示す赤目補正処理は、画像処理コマンドの1つとして赤目補正が選択されたときに実行される。   In the present embodiment, the red-eye correction process is performed as part of an image processing program executed on the personal computer 1 and is executed on the image data read into the memory inside the control device 2. When the image data is read into the memory, the personal computer 1 displays the image on the monitor 3 using the image data, and then executes various image processing programs corresponding to various image processing commands selected by the user. Run against. That is, the red-eye correction process shown in FIG. 2 is executed when red-eye correction is selected as one of the image processing commands.

なお、メモリに読み込まれる前の画像データは、記録媒体7、デジタルカメラ8、あるいはインターネット9を介した他のコンピュータ10等から取得され、制御装置2内部のハードディスクに格納されている。その中からユーザによって選択された画像データがメモリに読み込まれ、赤目補正処理を始めとする各種の画像処理プログラムが実行される。ここで、前述したように赤目領域は色不良領域の一種であることから、赤目補正処理は色不良領域補正処理とも言える。   The image data before being read into the memory is acquired from the recording medium 7, the digital camera 8, or another computer 10 via the Internet 9, and stored in the hard disk inside the control device 2. The image data selected by the user is read into the memory, and various image processing programs including red-eye correction processing are executed. Here, as described above, since the red-eye area is a kind of defective color area, the red-eye correction process can be said to be a defective color area correction process.

本実施形態で扱う画像データは、格子状に配列された複数の画素から構成される。データ自体が格子状に並んでいるものではないが、撮像素子を構成する画素、あるいは、画像を表示する場合の表示画素が格子状に配列されている。画像データの各画素は、表色系で規定される色成分の色情報を有する。例えば、RGB表色系の場合、各画素は、R(赤)成分の色情報と、G(緑)成分の色情報と、B(青)成分の色情報を有する。   The image data handled in the present embodiment is composed of a plurality of pixels arranged in a grid pattern. Although the data itself is not arranged in a grid pattern, pixels constituting the image sensor or display pixels for displaying an image are arranged in a grid pattern. Each pixel of the image data has color information of color components defined by the color system. For example, in the case of the RGB color system, each pixel has R (red) component color information, G (green) component color information, and B (blue) component color information.

デジタルカメラ等で撮影する場合、例えば単板式RGBベイア配列の撮像素子で撮像された画像データは、各画素には1つの色成分の色情報しか有しない。このようにして得られた画像データに、各種の補間処理を施すことにより、各画素にRGBの色成分の色情報を有するようになる。本実施の形態で処理する画像データでは、各画素はすでにRGBの色成分の色情報を有している。すなわち、表色系で規定される複数の色成分の色情報を有している。また、ここでいう色情報とは、各色のフィルターを通して受光された光量に対応して撮像素子の各画素で蓄積された電荷に対応した値である。本実施の形態では、色情報の値を8ビットのデータとして表す。具体的には、0〜255の値で表すものとする。   When photographing with a digital camera or the like, for example, image data captured by an image sensor with a single-plate RGB Bayer array has color information of only one color component in each pixel. By applying various interpolation processes to the image data thus obtained, each pixel has color information of RGB color components. In the image data processed in this embodiment, each pixel already has color information of RGB color components. That is, it has color information of a plurality of color components defined by the color system. Further, the color information here is a value corresponding to the charge accumulated in each pixel of the image sensor corresponding to the amount of light received through the filter of each color. In this embodiment, the value of color information is expressed as 8-bit data. Specifically, it shall be represented by a value from 0 to 255.

図2は、本実施の形態における赤目補正処理のフローチャートを示す図である。ステップS1では、処理対象とする画像より赤目領域を抽出する処理を行う。この画像には、赤目現象による色不良領域が含まれているものとする。ここで、ステップS1における赤目領域の抽出処理には様々な方法を用いることができる。たとえば、特許文献1に開示される方法によって赤目領域を抽出してよい。この方法は、色不良となった瞳を含むなるべく小さな矩形領域をユーザが指定し、その領域内部の各画素について色度変換を行うことにより求められた色度に基づいて、所定の条件に当てはまる画素の領域を赤目領域として抽出するものである。あるいは違う方法、たとえば楕円形などの図形を当てはめることによって設定された領域を赤目領域として抽出してもよい。このように、本発明ではどのような赤目領域の抽出方法を用いてもよい。すなわち、これより説明するステップS2以降の方法は、ステップS1における赤目領域の抽出方法を問わずに適用することができる。   FIG. 2 is a diagram showing a flowchart of red-eye correction processing in the present embodiment. In step S1, a process for extracting a red-eye area from an image to be processed is performed. It is assumed that this image includes a color defect area due to a red-eye phenomenon. Here, various methods can be used for the red-eye region extraction process in step S1. For example, the red-eye region may be extracted by the method disclosed in Patent Document 1. This method applies to a predetermined condition based on chromaticity obtained by a user specifying a rectangular area as small as possible including a pupil with a color defect and performing chromaticity conversion on each pixel in the area. A pixel area is extracted as a red-eye area. Or you may extract the area | region set by applying different methods, for example, figures, such as an ellipse, as a red-eye area | region. Thus, any red-eye region extraction method may be used in the present invention. That is, the method after step S2 described below can be applied regardless of the red-eye region extraction method in step S1.

なお、これ以降の説明においては、ステップS1で抽出された赤目領域は、画像上の赤目現象が生じている領域、すなわち補正すべき色不良領域に対して欠損部分を有しているものとする。ここでいう欠損部分とは、ステップS1で抽出された赤目領域において内側に欠けている部分のことである。このような欠損部分の例を図3に示す。図3において、ハッチング部分に示す領域31は抽出された赤目領域を表している。この領域31は、補正すべき色不良領域である領域40に対して、符号32〜34に示すような欠損部分を有している。   In the following description, it is assumed that the red-eye area extracted in step S1 has a defective portion with respect to the area where the red-eye phenomenon occurs on the image, that is, the color defect area to be corrected. . The missing portion here is a portion lacking on the inner side in the red-eye region extracted in step S1. An example of such a defect is shown in FIG. In FIG. 3, a region 31 shown in the hatched portion represents the extracted red-eye region. This region 31 has a defective portion as indicated by reference numerals 32 to 34 with respect to the region 40 which is a color defect region to be corrected.

欠損部分32、33は、領域1の内部で欠損している部分であり、その周囲は領域31によって囲まれている。また、欠損部分34は領域31が内側に抉れるように欠損している部分であり、その周囲の大部分は領域31に囲まれている。この欠損部分の現れ方は、ステップS1においてどのような方法で赤目領域を抽出するかによって変化する。   The missing portions 32 and 33 are portions that are missing inside the region 1, and the periphery thereof is surrounded by the region 31. In addition, the missing portion 34 is a portion that is missing so that the region 31 falls inside, and most of the periphery is surrounded by the region 31. The appearance of this missing portion varies depending on the method used to extract the red-eye region in step S1.

図2のステップS2では、ステップS1で抽出した欠損部分を有する赤目領域に基づいて新たな領域を特定することにより、その欠損部分を補間する処理を行う。ここで新たに特定される領域は、ステップS1で抽出した赤目領域よりも大きくなるようにする。このステップS2を実行する目的は、ステップS1で抽出した赤目領域が有する欠損部分を補間することにある。具体的には、図3の欠損部分32〜34がステップS2で補間する対象となる。こうした目的のため、次に説明するような処理をステップS2で行い、これによってステップS1で抽出した赤目領域よりも大きな領域を新たに特定する。   In step S2 in FIG. 2, a new region is specified based on the red-eye region having the missing portion extracted in step S1, and the missing portion is interpolated. Here, the newly specified area is set to be larger than the red-eye area extracted in step S1. The purpose of executing step S2 is to interpolate the missing portion of the red-eye area extracted in step S1. Specifically, the missing portions 32 to 34 in FIG. 3 are to be interpolated in step S2. For this purpose, a process as described below is performed in step S2, thereby newly specifying a region larger than the red-eye region extracted in step S1.

ステップS2で行う領域補間処理のフローチャートを図4に示す。ステップS21では、構造要素の設定を行う。この構造要素は、後で説明するステップS22のミンコフスキー和演算処理およびステップS23のミンコフスキー差演算処理において、元の領域を移動させる範囲を決定するものである。なお、ここでいう領域の移動については、ステップS22およびS23において詳しく説明する。   FIG. 4 shows a flowchart of the area interpolation process performed in step S2. In step S21, a structural element is set. This structural element determines the range in which the original region is moved in the Minkowski sum calculation process in step S22 and the Minkowski difference calculation process in step S23, which will be described later. The movement of the area here will be described in detail in steps S22 and S23.

ステップS21では、構造要素として縦m画素、横n画素の四辺形を設定する。この画素数mおよびnは、ステップS1で抽出した赤目領域の大きさに基づいて決定する。たとえば、ステップS1で抽出した図3の赤目領域31において、図示するように縦方向の最大画素数がh、横方向の最大画素数がwであるときに、mおよびnの値を次の式(1)により決定する。
m=αh、n=αw ・・・・・・・・・・・・・・・・・・・(1)
ただし、αは定数
In step S21, a quadrilateral of m vertical pixels and n horizontal pixels is set as a structural element. The pixel numbers m and n are determined based on the size of the red-eye area extracted in step S1. For example, in the red-eye region 31 of FIG. 3 extracted in step S1, when the maximum number of pixels in the vertical direction is h and the maximum number of pixels in the horizontal direction is w as shown in the figure, the values of m and n are expressed by the following equations: Determine by (1).
m = αh, n = αw (1)
Where α is a constant

上記の式(1)における定数αの値をあらかじめ設定しておけば、ステップS1で抽出した赤目領域より求められるhとwの値に比例して、mおよびnの値をそれぞれ決定することができる。たとえばα=0.5とする。これにより、ステップS21において構造要素を設定することができる。なお、式(1)以外の関係を用いてhとwに基づいてmおよびnを決定することにより、構造要素を設定してもよい。   If the value of the constant α in the above equation (1) is set in advance, the values of m and n can be determined in proportion to the values of h and w obtained from the red-eye region extracted in step S1. it can. For example, α = 0.5. Thereby, a structural element can be set in step S21. In addition, you may set a structural element by determining m and n based on h and w using relationships other than Formula (1).

ステップS22では、ステップS21で決定した構造要素を用いて、ステップS1で抽出した赤目領域に対してミンコフスキー和演算処理を行う。ミンコフスキー和演算処理は、元の領域を構造要素内で移動させたときの論理和の領域を求める処理である。このミンコフスキー和演算処理の様子を図5を用いて説明する。なお図5では、説明を簡単にするため、構造要素の大きさを縦1画素、横3画素としている。   In step S22, Minkowski sum calculation processing is performed on the red-eye region extracted in step S1, using the structural element determined in step S21. The Minkowski sum calculation process is a process for obtaining a logical sum area when the original area is moved within the structural element. The state of the Minkowski sum calculation process will be described with reference to FIG. In FIG. 5, the size of the structural element is 1 pixel in the vertical direction and 3 pixels in the horizontal direction to simplify the description.

図5(a)は、ミンコフスキー和演算処理を行う前の元の領域を示している。この図において各マスのそれぞれは画素を表しており、斜線部分に示す複数の画素によって元の領域50が構成されている。この領域50は、内部にその領域内に含まれない欠損画素55を有している。また、符号60に示す太線で囲った縦1画素、横3画素の部分は、ミンコフスキー和演算処理に用いる構造要素を表している。この構造要素60は、領域50の中心部分に当たる画素を中心として設定される。   FIG. 5A shows the original area before performing the Minkowski sum calculation process. In this figure, each square represents a pixel, and the original region 50 is constituted by a plurality of pixels indicated by hatching. The region 50 has a defective pixel 55 that is not included in the region. Further, a portion of one vertical pixel and three horizontal pixels surrounded by a thick line denoted by reference numeral 60 represents a structural element used for Minkowski sum calculation processing. The structural element 60 is set around a pixel corresponding to the central portion of the region 50.

領域50に対してミンコフスキー和演算処理を実行すると、はじめに領域50を構造要素60内で移動させる。その様子を図5(b)および(c)に示す。(b)は、(a)に示す元の位置から右側に1画素分移動した状態を示しており、(c)は元の位置から左側に1画素分移動した状態を示している。このように、領域50の中心部分に当たる画素が構造要素60内の全てに位置するように、領域50を移動させる。なお、ここでは構造要素60が縦1画素、横3画素であるために、領域50の移動範囲は図5(b)、(c)に示す範囲に限定されている。しかし、構造要素の画素数に応じて移動する範囲は大きくなり、構造要素の縦方向の画素数が2以上になれば、縦方向にも移動することとなる。   When the Minkowski sum calculation process is executed on the region 50, the region 50 is first moved within the structural element 60. This is shown in FIGS. 5B and 5C. (B) shows a state where the original position shown in (a) is moved to the right by one pixel, and (c) shows a state where the original position is moved to the left by one pixel. In this manner, the region 50 is moved so that the pixels corresponding to the central portion of the region 50 are located in all the structural elements 60. Here, since the structural element 60 is one vertical pixel and three horizontal pixels, the moving range of the region 50 is limited to the ranges shown in FIGS. However, the range of movement increases according to the number of pixels of the structural element, and if the number of pixels of the structural element in the vertical direction becomes 2 or more, the range of movement also moves in the vertical direction.

次に、図5(a)、(b)および(c)のいずれかで領域50が位置している画素を全て合わせた領域を求めることにより、領域50を構造要素60内で移動させたときの論理和の領域を求める。図5(d)には、このようにして求められた論理和領域51を示している。この論理和領域51を求めることで、領域50に対してミンコフスキー和演算処理が実行されたことになる。以上説明したようにして、ステップS22のミンコフスキー和演算処理を実行する。   Next, when the region 50 is moved within the structural element 60 by obtaining a region in which all the pixels where the region 50 is located are obtained in any of FIGS. 5A, 5B, and 5C. Find the area of the logical sum of FIG. 5D shows the logical sum area 51 obtained in this way. By obtaining the logical sum area 51, Minkowski sum calculation processing is executed for the area 50. As described above, the Minkowski sum calculation process of step S22 is executed.

ステップS23では、ステップS21で決定した構造要素を用いて、ステップS22のミンコフスキー和演算処理で求められた領域に対してミンコフスキー差演算処理を行う。ミンコフスキー差演算処理とは、元の領域を構造要素内で移動させたときの論理差の領域を求める処理である。このミンコフスキー差演算処理の様子を図6を用いて説明する。   In step S23, the Minkowski difference calculation process is performed on the region obtained by the Minkowski sum calculation process in step S22 using the structural element determined in step S21. The Minkowski difference calculation process is a process for obtaining a logical difference area when the original area is moved within the structural element. The state of the Minkowski difference calculation process will be described with reference to FIG.

図6(a)は、ミンコフスキー差演算処理を行う前の領域、すなわちミンコフスキー和演算処理で求められた領域を示している。この領域51は、図5(d)に示したミンコフスキー和演算処理後の領域51と同じものであり、同様に構造要素60が設定されている。この領域51に対してミンコフスキー差演算処理を実行すると、前に説明したミンコフスキー和演算処理と同じように、領域51を構造要素60内で移動させる。その様子を図6(b)および(c)に示す。(b)は(a)の位置から右側に1画素分移動した状態であり、(c)は左側に1画素分移動した状態である。   FIG. 6A shows an area before the Minkowski difference calculation process, that is, an area obtained by the Minkowski sum calculation process. This area 51 is the same as the area 51 after the Minkowski sum calculation process shown in FIG. 5D, and the structural element 60 is set in the same manner. When the Minkowski difference calculation process is executed on the area 51, the area 51 is moved within the structural element 60 in the same manner as the Minkowski sum calculation process described above. This is shown in FIGS. 6B and 6C. (B) is a state where the pixel is moved to the right by one pixel from the position (a), and (c) is a state where the pixel is moved to the left by one pixel.

次に、領域51を構造要素60内で移動させたときの論理差の領域を求める。この論理差の領域には、図6(a)、(b)および(c)の全てにおいて領域51に含まれている画素が相当する。こうして求められた論理差領域52を図6(d)に示す。この論理差領域52を求めることで、領域51に対してミンコフスキー差演算処理が実行されたことになる。   Next, a logical difference region when the region 51 is moved within the structural element 60 is obtained. This logical difference region corresponds to the pixels included in the region 51 in all of FIGS. 6A, 6B, and 6C. The logical difference area 52 thus obtained is shown in FIG. By obtaining this logical difference area 52, Minkowski difference calculation processing is executed for the area 51.

ここで、図5(a)の元の領域50と図6(d)の論理差領域52とを比較すると、これらは互いに外形は等しいが、領域50が有していた欠損画素55は領域52には無いことが分かる。このように、ミンコフスキー和演算処理とミンコフスキー差演算処理を組み合わせて用いることで、ステップS1で抽出された赤目領域の欠損部分を補うことができる。以上説明したようにしてステップS23のミンコフスキー差演算処理を実行した後は、求められた論理差領域を新たな領域として特定し、図2のステップS3に進む。こうしてステップS2の領域補間処理が実行される。   Here, when the original region 50 in FIG. 5A and the logical difference region 52 in FIG. 6D are compared, they have the same outer shape, but the missing pixel 55 included in the region 50 is the region 52. It is understood that there is not. In this way, by using a combination of the Minkowski sum calculation process and the Minkowski difference calculation process, the missing portion of the red-eye region extracted in step S1 can be compensated. After executing the Minkowski difference calculation process in step S23 as described above, the obtained logical difference area is specified as a new area, and the process proceeds to step S3 in FIG. Thus, the region interpolation process in step S2 is executed.

以上説明したような領域補間処理を図2のステップS2で行うことにより、新たな領域が特定される。これにより、ステップS1で抽出された赤目領域が有する欠損部分を補うことができる。こうして図3の領域31に基づいてステップS2により特定された新たな領域を、図7の領域31Aに例示する。この領域31Aでは、図示するように図3の欠損部分32〜34が補われている。なお、このステップS2で行う処理は、画像処理において使用されるモルフォロジ演算と呼ばれる演算方法の一部を用いたものである。   By performing the region interpolation processing as described above in step S2 of FIG. 2, a new region is specified. Thereby, the missing part which the red-eye area | region extracted by step S1 has can be compensated. The new area specified in step S2 based on the area 31 in FIG. 3 is illustrated as an area 31A in FIG. In this region 31A, as shown in the figure, the missing portions 32-34 in FIG. 3 are supplemented. Note that the processing performed in step S2 uses a part of a calculation method called morphological calculation used in image processing.

ステップS3では、ステップS2で特定された領域を対象として、補正すべき色不良領域に対する一致性の評価を行う。このステップS3と後で説明するステップS4を実行する目的は、ステップS2により欠損部分が補間された赤目領域を、補正すべき色不良領域に一致させるように変形することにある。こうした目的のため、次に説明するような一致性の評価処理をステップS3で行い、さらに後で説明する変形処理をステップS4で行って、これにより補正すべき色不良領域に境界位置が最も一致するように領域を変形する。   In step S3, the consistency of the defective color area to be corrected is evaluated for the area specified in step S2. The purpose of executing step S3 and step S4, which will be described later, is to transform the red-eye region in which the missing portion is interpolated in step S2 so as to coincide with the color defect region to be corrected. For this purpose, a matching evaluation process as described below is performed in step S3, and a deformation process described later is performed in step S4, so that the boundary position most closely matches the color defect area to be corrected. The area is deformed as follows.

ステップS3における一致性の評価は、ステップS2で特定された領域の境界から縦または横方向の所定範囲内における各画素の色情報に基づいて行う。その様子を図8(a)に例示する。図8(a)は図7の領域31Aの一部分を拡大したものであり、領域31Aの境界37から横方向の所定範囲内について評価を行う様子を示している。ここで、図中に円形で図示する画素38に代表される各画素は、いずれも境界37の上にある。   The coincidence evaluation in step S3 is performed based on the color information of each pixel within a predetermined range in the vertical or horizontal direction from the boundary of the region specified in step S2. This is illustrated in FIG. FIG. 8A is an enlarged view of a part of the region 31A shown in FIG. 7, and shows a state where the evaluation is performed within a predetermined range in the horizontal direction from the boundary 37 of the region 31A. Here, each pixel represented by a pixel 38 shown in a circle in the drawing is on the boundary 37.

ステップS3では、画素38をはじめとする各画素を中心に、矢印39に示す所定範囲内の各画素について、下記の式(2)によって表される赤さレベルを求める。こうすることで、領域31Aの、補正すべき色不良領域(図7の領域40)に対する一致性を評価する。このとき、式(2)のR’の値を最小とする画素が形成する境界線を境界36とすると、この境界36が補正すべき色不良領域に最も一致していると評価される。なお、下記の式(2)におけるR,G,Bは、その画素におけるRGB値のそれぞれを表す。
R’=Cr・R/(R+G+B) ・・・・・・・・・・・・・・(2)
ただし
Cr=0.713(R−Y)
Y=0.587G+0.114B+0.299R
In step S3, a redness level represented by the following expression (2) is obtained for each pixel within a predetermined range indicated by an arrow 39 with each pixel including the pixel 38 as the center. In this way, the consistency of the area 31A with the color defect area to be corrected (area 40 in FIG. 7) is evaluated. At this time, if the boundary line formed by the pixel having the smallest value of R ′ in Expression (2) is defined as the boundary 36, it is evaluated that the boundary 36 most closely matches the color defect area to be corrected. Note that R, G, and B in the following equation (2) represent RGB values in the pixel.
R ′ = Cr · R / (R + G + B) (2)
However, Cr = 0.713 (R−Y)
Y = 0.587G + 0.114B + 0.299R

なお、上記の式(2)を用いて一致性の評価を行うとき、領域の境界が斜め45度よりも垂直に近い場合には、図8(a)のように、横方向の所定範囲内にある画素を評価の対象とすることが好ましい。一方、境界が45度より水平に近い場合は、式(2)の計算を縦方向の画素に対して行うのがよい。このとき、縦方向と横方向とで対象とする画素の数を変えるようにしてもよい。さらに、境界から斜め方向などにある画素を対象としてもよい。こうして式(2)のR’が最小となる画素の位置を求めることにより、ステップS3において補正すべき色不良領域に対する一致性の評価を行う。   When the consistency is evaluated using the above formula (2), if the boundary of the region is closer to the vertical than 45 degrees, the horizontal direction is within a predetermined range as shown in FIG. It is preferable that the pixel located in On the other hand, when the boundary is closer to the horizontal than 45 degrees, the calculation of Expression (2) is preferably performed on the pixels in the vertical direction. At this time, the number of target pixels may be changed between the vertical direction and the horizontal direction. Furthermore, a pixel in an oblique direction from the boundary may be targeted. In this way, by obtaining the pixel position where R ′ in Equation (2) is minimized, the consistency with the color defect area to be corrected is evaluated in step S3.

なお、上記の式(2)は最も一致性が高い境界位置を求めるための条件式の一例であって、他の条件式を用いることもできる。たとえば、輝度が最も低い画素によって表される境界位置を最も一致性が高いと評価してもよい。後で説明するステップS6において色を補正したときに、補正した部分が目立ちにくいように境界位置を設定できる条件式であれば、どのようなものを用いてもよい。   In addition, said Formula (2) is an example of the conditional expression for calculating | requiring the boundary position with the highest coincidence, and another conditional expression can also be used. For example, the boundary position represented by the pixel with the lowest luminance may be evaluated as having the highest coincidence. Any conditional expression may be used as long as the boundary position can be set so that the corrected portion is less noticeable when the color is corrected in step S6 described later.

ステップS4では、ステップS3の結果に基づいて、ステップS2で特定された領域を変形する処理を行う。具体的には、ステップS3において最も一致性が高いと認識された境界位置に、ステップS2で特定された領域の境界位置を移動させる。その様子を図8(b)に例示する。図中に矢印で示すように、領域31Aの境界位置をそれまでの境界37から、図8(a)のようにしてステップS3で求められた境界36の方向に移動する。これにより、領域31Aを補正すべき色不良領域に一致させるように変形することができる。こうして変形した領域の例を図9に示す。図9の領域31Bは、図7の領域31Aの境界位置を全体的に移動することにより、領域31Aを変形した結果を示したものである。この領域31Bは、補正すべき赤目領域40と一致している。   In step S4, based on the result of step S3, the process which deform | transforms the area | region specified by step S2 is performed. Specifically, the boundary position of the region identified in step S2 is moved to the boundary position recognized as having the highest coincidence in step S3. This is illustrated in FIG. As indicated by the arrows in the figure, the boundary position of the region 31A is moved from the previous boundary 37 in the direction of the boundary 36 obtained in step S3 as shown in FIG. 8A. Thereby, it can deform | transform so that the area | region 31A may correspond with the color defect area | region which should be correct | amended. An example of the region thus deformed is shown in FIG. A region 31B in FIG. 9 shows a result of deforming the region 31A by moving the boundary position of the region 31A in FIG. 7 as a whole. This area 31B coincides with the red-eye area 40 to be corrected.

ステップS5では、元の画像からキャッチライトの部分を探索し、その部分の色情報を取得する。ここでキャッチライトの色情報を取得する理由は、後で説明するステップS6において赤目領域の色を補正したときに、キャッチライトの部分を元に戻すことで見た目の自然さを失わないようにするためである。ここでは、色情報の値が次の式(3)を満たし、かつ所定の大きさ(たとえば、20画素四方の正方形)を超えない部分をキャッチライトとして判断する。こうしてキャッチライトの部分が求められたら、その部分に含まれる画素全ての色情報を取得し記憶しておく。
R>200 かつ G>200 かつ B>200 ・・・・・・(3)
In step S5, a catchlight portion is searched from the original image, and color information of the portion is acquired. The reason for obtaining the color information of the catchlight is that the naturalness of the appearance is not lost by returning the catchlight portion to the original when the color of the red-eye area is corrected in step S6 described later. Because. Here, a portion where the value of the color information satisfies the following expression (3) and does not exceed a predetermined size (for example, a square of 20 pixels) is determined as a catch light. When the catchlight portion is thus obtained, the color information of all the pixels included in that portion is acquired and stored.
R> 200 and G> 200 and B> 200 (3)

ステップS6では、ステップS4で求められた領域内の色を変えることにより、画像上の赤目領域の色補正を行う。たとえば、求められた領域内の全ての画素の色情報値を所定の値にすることで、色補正を行う。あるいは、明度、色相または彩度を変更することで色補正することもできる。さらに、境界部分の画素については、領域内と領域外の色情報の中間値を使用するようにしてもよい。このようにすると、色補正後にその境界部分を目立たなくすることができる。   In step S6, color correction of the red-eye region on the image is performed by changing the color in the region obtained in step S4. For example, the color correction is performed by setting the color information values of all the pixels in the obtained area to a predetermined value. Alternatively, color correction can be performed by changing lightness, hue, or saturation. Further, for the pixels at the boundary portion, an intermediate value of the color information inside and outside the area may be used. In this way, the boundary portion can be made inconspicuous after color correction.

ステップS6ではさらに、ステップS5で記憶されたキャッチライト部分の色情報に基づいて、ステップS4で求められた領域内のうちキャッチライト部分の色を補正前の状態に戻すことにより、キャッチライト部分の色補正を行う。このとき、キャッチライトにも赤目現象が生じている可能性があるので、白に近い無彩色となるように色情報を変換したものを用いることが好ましい。このようにすることで、赤目領域の色補正後にもキャッチライトを残して見た目の自然さを保つことができる。ステップS6によって赤目領域の色補正を行った後は、図2の処理フローを終了する。   In step S6, based on the color information of the catchlight portion stored in step S5, the color of the catchlight portion in the area obtained in step S4 is returned to the state before correction, thereby Perform color correction. At this time, since there is a possibility that the catch-light also has a red-eye phenomenon, it is preferable to use a color light that has been converted so that an achromatic color close to white is obtained. By doing so, it is possible to maintain the naturalness of the appearance by leaving the catch light even after the color correction of the red-eye region. After the color correction of the red eye area is performed in step S6, the processing flow of FIG.

以上説明した実施の形態によれば、次の作用効果を奏する。
(1)抽出しきれずに欠損した色不良領域の欠損部分を補間するようにしたので、補正すべき赤目領域などの色不良領域を、自然な色状態へ、容易に、短時間で、確実に補正することができる。
(2)欠損部分を有する赤目領域に対して、ミンコフスキー和演算処理とミンコフスキー差演算処理を行うことにより欠損部分を補間することとしたので、簡単な処理で確実に欠損部分を補間することができる。
(3)ミンコフスキー和演算処理とミンコフスキー差演算処理を行うときの構造要素の大きさを、処理対象である抽出された赤目領域の大きさに基づいて決定することとしたので、処理対象の領域の大きさに応じた的確な処理を実行できる。
(4)欠損部分を補間された赤目領域に対して補正すべき色不良領域に対する一致性を評価し、その評価結果に基づいて領域を変形することとした。このようにしたので、その赤目領域を補正すべき色不良領域に一致するように変形することができる。
(5)一致性評価の対象とする領域の境界から所定範囲内における色情報に基づいて、補正すべき色不良領域に最も一致する境界位置を求め、その領域の境界を求められた境界位置とすることにより領域を変形することとした。このようにしたので、色情報に基づいて領域を変形することができ、特に、白目との境目部分を抽出しづらく、領域が欠けて抽出されることの多い金目を補正するときに有効である。
(6)元の画像からキャッチライトの部分を探索してその部分の色情報を取得して記憶し、その記憶された色情報に基づいてキャッチライト部分の色補正を行うようにした。このようにしたので、赤目領域の色補正後にも、キャッチライトを残して見た目の自然さを保つことができる。
According to the embodiment described above, the following operational effects are obtained.
(1) Since the defective portion of the defective color area that cannot be extracted is interpolated, the defective color area such as the red-eye area to be corrected can be easily and quickly brought into a natural color state. It can be corrected.
(2) Since the missing part is interpolated by performing the Minkowski sum operation process and the Minkowski difference operation process for the red-eye region having the missing part, the missing part can be reliably interpolated by simple processing. .
(3) Since the size of the structural element when performing the Minkowski sum calculation process and the Minkowski difference calculation process is determined based on the size of the extracted red-eye area to be processed, Accurate processing according to the size can be executed.
(4) The consistency of the defective color area to be corrected with respect to the interpolated red-eye area is evaluated, and the area is deformed based on the evaluation result. Since it did in this way, it can deform | transform so that the red-eye area | region may correspond with the color defect area | region which should be correct | amended.
(5) Based on the color information within a predetermined range from the boundary of the area to be subjected to the consistency evaluation, the boundary position that most closely matches the color defect area to be corrected is obtained, and the boundary position of the area is obtained By doing so, the region was changed. Since it did in this way, an area | region can be deform | transformed based on color information, and it is especially effective when correcting the gold | metal | money which is hard to extract the boundary part with a white eye and is often extracted by lacking an area | region. .
(6) The catchlight portion is searched from the original image, the color information of the portion is acquired and stored, and the color correction of the catchlight portion is performed based on the stored color information. Since it did in this way, the naturalness of appearance can be maintained, leaving a catch light, even after color correction of the red-eye region.

上記の実施の形態では、パソコン1で赤目補正処理を行う例を説明したが、この内容に限定する必要はない。デジタルカメラ上でそのような処理プログラムを搭載し処理するようにしてもよい。また、カメラから直接画像データを取得してプリントするプリンタにおいて、そのような処理プログラムを搭載し処理するようにしてもよい。すなわち、画像データを処理するあらゆる画像処理装置に本発明を適用することができる。言いかえれば、取得した画像より赤目領域などの色不良領域を抽出し、その抽出した色不良領域の色補正を行うような画像処理方法を実行する画像処理装置において、本発明を適用できる。また、色不良領域の色補正だけに限られず、特定の色を示す領域を特定するだけでも本発明の適用範囲内である。特に、特定の色を表す領域のみを特定し、異なる画像を当てはめたりするような画像処理に対しても、本発明に開示された手法は有効である。具体的には、図2のフローチャートにおいて、S6のステップを実行する前で終わるものでも構わない。   In the above-described embodiment, the example in which the personal computer 1 performs the red-eye correction process has been described, but it is not necessary to limit to this content. Such a processing program may be installed and processed on a digital camera. Further, such a processing program may be installed and processed in a printer that acquires image data directly from the camera and prints it. That is, the present invention can be applied to any image processing apparatus that processes image data. In other words, the present invention can be applied to an image processing apparatus that executes an image processing method that extracts a color defect area such as a red-eye area from an acquired image and performs color correction of the extracted color defect area. Further, the present invention is not limited only to color correction of a color defect area, and it is within the scope of the present invention to specify an area showing a specific color. In particular, the method disclosed in the present invention is also effective for image processing in which only a region representing a specific color is specified and a different image is applied. Specifically, in the flowchart of FIG. 2, the process may be completed before executing step S6.

上記の実施の形態では、取得した画像より欠損部分を有する赤目領域を抽出し、その赤目領域の欠損部分を補間する例について説明したが、あらかじめ欠損部分を有する赤目領域が抽出された画像を取得するようにしてもよい。この場合は、図2のフローチャートにおいて、ステップS2から実行するようにすればよい。   In the above embodiment, the example of extracting the red-eye region having a defective portion from the acquired image and interpolating the defective portion of the red-eye region has been described, but an image from which the red-eye region having the defective portion has been extracted in advance is acquired. You may make it do. In this case, the process may be executed from step S2 in the flowchart of FIG.

上記の実施の形態では、図2のフローチャートのステップS2において、ミンコフスキー和演算処理とミンコフスキー差演算処理を用いることで新たな領域を特定することとしたが、他の方法を用いてこの領域特定処理を行ってもよい。たとえば、楕円形などの図形を近似させることによりステップS1で抽出された赤目領域よりも大きな領域を特定することでも、抽出された赤目領域の欠損部分を補間することができる。   In the above embodiment, the new region is specified by using the Minkowski sum calculation process and the Minkowski difference calculation process in step S2 of the flowchart of FIG. 2, but this region specifying process is performed using another method. May be performed. For example, the missing portion of the extracted red-eye area can also be interpolated by specifying an area larger than the red-eye area extracted in step S1 by approximating a figure such as an ellipse.

上記の実施の形態では、図2のフローチャートのステップS5において元の画像よりキャッチライトの部分の色情報を取得することとしたが、この処理はステップS5で実行しなくともよい。ステップS6においてキャッチライト部分を赤目補正前の状態に戻す前であれば、どのステップ位置で実行してもよい。また、上記の実施の形態ではキャッチライト部分を対象に、元の画像の色情報を取得し、赤目補正後にその部分を元に戻す例を説明したが、キャッチライト以外の部分を対象にしてもよい。   In the above embodiment, the color information of the catchlight portion is acquired from the original image in step S5 in the flowchart of FIG. 2, but this process may not be executed in step S5. As long as it is before returning a catchlight part to the state before red-eye correction in step S6, you may perform in any step position. In the above embodiment, the color information of the original image is acquired for the catchlight part, and the original part is restored after red-eye correction. However, the part other than the catchlight is also targeted. Good.

上記の実施の形態では、図2のフローチャートのステップS2において、抽出された赤目領域にある欠損部分を補間する処理を行い、ステップS3およびS4において、補正すべき色不良領域に一致するように赤目領域を変形する処理を行う例を説明した。しかし、これらの処理は順番を逆にして実行してもよい。あるいは、いずれか一方のみを実行してもよい。   In the above embodiment, in step S2 of the flowchart of FIG. 2, a process of interpolating the missing portion in the extracted red-eye region is performed, and in steps S3 and S4, the red-eye is matched with the color defect region to be corrected. The example of performing the process of deforming the region has been described. However, these processes may be executed in reverse order. Alternatively, only one of them may be executed.

上記の実施の形態では、RGB表色系の例で説明をしたが、この内容に限定する必要はない。その他の表色系の画像データであってもよい。   In the above embodiment, an example of the RGB color system has been described, but it is not necessary to limit to this content. Other color system image data may be used.

上記で説明した実施の形態および変形例はあくまで一例であり、本発明はこれらの内容に限定されるものではない。本発明の技術的思想の範囲内で考えられるその他の態様も本発明の範囲内に含まれる。   The embodiment and modification examples described above are merely examples, and the present invention is not limited to these contents. Other embodiments conceivable within the scope of the technical idea of the present invention are also included in the scope of the present invention.

本発明の色不良領域補正方法を実施する一実施の形態を示す図である。It is a figure which shows one Embodiment which implements the color defect area | region correction method of this invention. 本実施の形態における赤目補正処理のフローチャートを示す図である。It is a figure which shows the flowchart of the red-eye correction process in this Embodiment. 抽出された赤目領域と欠損部分の例を示す図である。It is a figure which shows the example of the extracted red-eye area | region and a missing part. 赤目補正処理において実行される領域補間処理のフローチャートを示す図である。It is a figure which shows the flowchart of the area | region interpolation process performed in a red eye correction process. ミンコフスキー和演算処理の様子を説明する図である。It is a figure explaining the mode of a Minkowski sum calculation process. ミンコフスキー差演算処理の様子を説明する図である。It is a figure explaining the mode of a Minkowski difference calculation process. 領域補間処理により特定された新たな領域を例示する図である。It is a figure which illustrates the new field specified by field interpolation processing. 領域の境界から所定範囲内について一致性の評価を行い、その結果に従って領域を変形する様子を示す図である。It is a figure which shows a mode that a consistency is evaluated about the predetermined range from the boundary of an area | region, and an area | region is deformed according to the result. 領域変形処理により変形された領域を例示する図である。It is a figure which illustrates the field changed by field change processing.

符号の説明Explanation of symbols

1 パーソナルコンピュータ
2 制御装置
3 モニタ
4 キーボード
5 マウス
6 CD−ROM駆動装置
7 記録媒体
8 デジタルカメラ
9 インターネット
10 コンピュータ
DESCRIPTION OF SYMBOLS 1 Personal computer 2 Control apparatus 3 Monitor 4 Keyboard 5 Mouse 6 CD-ROM drive device 7 Recording medium 8 Digital camera 9 Internet 10 Computer

Claims (18)

補正すべき色不良領域を含む画像より、その色不良領域に対して欠損部分を有する第1の領域を抽出する領域抽出ステップと、
前記第1の領域の欠損部分を補間する第2の領域を特定する領域補間ステップとを有することを特徴とする色領域特定方法。
An area extracting step of extracting a first area having a defective portion with respect to the color defect area from an image including the color defect area to be corrected;
A color region specifying method comprising: a region interpolation step for specifying a second region for interpolating a missing portion of the first region.
補正すべき色不良領域を含み、その色不良領域に対して欠損部分を有する第1の領域が抽出された画像を取得する画像取得ステップと、
前記第1の領域の欠損部分を補間する第2の領域を特定する領域補間ステップとを有することを特徴とする色領域特定方法。
An image acquisition step of acquiring an image including a color defect area to be corrected and extracting a first area having a defective portion with respect to the color defect area;
A color region specifying method comprising: a region interpolation step for specifying a second region for interpolating a missing portion of the first region.
請求項1または2の色領域特定方法において、
前記色不良領域は、赤目現象によって生じた赤目領域であることを特徴とする色領域特定方法。
In the color region specifying method according to claim 1 or 2,
The color region identification method, wherein the color defect region is a red eye region caused by a red eye phenomenon.
請求項1〜3のいずれかの色領域特定方法において、
前記第2の領域は、前記第1の領域よりも大きいことを特徴とする色領域特定方法。
In the color region specifying method according to any one of claims 1 to 3,
The color area specifying method, wherein the second area is larger than the first area.
請求項1〜4のいずれかの色領域特定方法において、
前記領域補間ステップは、前記第1の領域を前記画像上に設定された所定の大きさの構造要素内で移動させたときの論理和の領域を求めるミンコフスキー和演算ステップと、前記ミンコフスキー和演算ステップにより求められた領域を前記構造要素内で移動させたときの論理差の領域を求めるミンコフスキー差演算ステップとを含み、
前記ミンコフスキー差演算ステップにより求められた領域を前記第2の領域として特定することを特徴とする色領域特定方法。
In the color region specifying method according to any one of claims 1 to 4,
The region interpolation step includes a Minkowski sum operation step for obtaining a logical sum region when the first region is moved within a structural element having a predetermined size set on the image, and the Minkowski sum operation step. A Minkowski difference calculation step for obtaining a region of a logical difference when the region obtained by (2) is moved within the structural element,
A method of specifying a color region, wherein the region obtained by the Minkowski difference calculation step is specified as the second region.
請求項5の色領域特定方法において、
前記構造要素の大きさを前記第1の領域の大きさに基づいて決定することを特徴とする色領域特定方法。
The color region specifying method according to claim 5,
A color area specifying method, wherein the size of the structural element is determined based on the size of the first area.
請求項1〜6のいずれかの色領域特定方法において、
前記領域補間ステップにより特定された第2の領域を前記色不良領域に一致させるように変形する領域変形ステップをさらに有することを特徴とする色領域特定方法。
In the color region specifying method according to any one of claims 1 to 6,
A color region specifying method, further comprising a region deforming step of deforming the second region specified by the region interpolating step so as to coincide with the color defect region.
請求項7の色領域特定方法において、
前記領域変形ステップは、前記第2の領域の前記色不良領域に対する一致性を評価する評価ステップと、前記評価ステップの結果に基づいてその第2の領域を変形する変形ステップとを含むことを特徴とする色領域特定方法。
The color region specifying method according to claim 7,
The region deformation step includes an evaluation step for evaluating the coincidence of the second region with the color defect region, and a deformation step for deforming the second region based on a result of the evaluation step. Color area specifying method.
請求項8の色領域特定方法において、
前記評価ステップは、前記第2の領域の境界から所定範囲内における色情報に基づいて、前記色不良領域に最も一致する境界位置を求めることにより前記一致性を評価することを特徴とする色領域特定方法。
The color region specifying method according to claim 8,
The evaluation step evaluates the coincidence by obtaining a boundary position that most closely matches the color defect area based on color information within a predetermined range from the boundary of the second area. Identification method.
請求項9の色領域特定方法において、
前記変形ステップは、前記第2の領域の境界を前記評価ステップにより求められた境界位置とすることにより、その第2の領域を変形することを特徴とする色領域特定方法。
The color region specifying method according to claim 9,
The color region specifying method characterized in that the deforming step deforms the second region by setting the boundary of the second region as the boundary position obtained by the evaluation step.
請求項1〜6のいずれかの色領域特定方法により特定された第2の領域の色情報を変更することにより、前記色不良領域の色補正を行う色補正ステップを有することを特徴とする色不良領域補正方法。   7. A color comprising: a color correction step of performing color correction of the color defect area by changing color information of the second area specified by the color area specifying method according to claim 1. Defect area correction method. 請求項7〜10のいずれかの色領域特定方法により特定され変形された第2の領域の色情報を変更することにより、前記色不良領域の色補正を行う色補正ステップを有することを特徴とする色不良領域補正方法。   A color correction step of performing color correction of the color defect area by changing color information of the second area specified and deformed by the color area specifying method according to claim 7. Color defect area correction method. 請求項11または12の色不良領域補正方法において、
前記色補正ステップは、前記画像の所定部分の色情報を取得して記憶する記憶ステップと、前記記憶ステップにより記憶された色情報に基づいて前記色不良領域に含まれる前記所定部分の色補正を行う部分色補正ステップとを含むことを特徴とする色不良領域補正方法。
In the color defect area correction method according to claim 11 or 12,
The color correction step includes obtaining and storing color information of a predetermined portion of the image, and performing color correction of the predetermined portion included in the color defect area based on the color information stored by the storage step. And a partial color correction step to be performed.
請求項13の色不良領域補正方法において、
前記記憶ステップは、前記画像よりキャッチライトの部分を探索し、その部分の色情報を取得して記憶し、
前記部分色補正ステップは、前記記憶ステップにより色情報を記憶されたキャッチライトの部分の色補正を行うことを特徴とする色不良領域補正方法。
The color defect area correction method according to claim 13.
The storing step searches for a catchlight portion from the image, acquires and stores color information of the portion,
In the partial color correction step, the color correction is performed for the catchlight portion in which the color information is stored in the storage step.
請求項1〜10いずれか1項に記載の色領域特定方法のステップをコンピュータに実行させるための色領域特定処理プログラム。   A color area specifying processing program for causing a computer to execute the steps of the color area specifying method according to claim 1. 請求項11〜14いずれか1項に記載の色不良領域補正方法のステップをコンピュータに実行させるための色不良領域補正処理プログラム。   A color defect area correction processing program for causing a computer to execute the steps of the color defect area correction method according to claim 11. 請求項15の色領域特定処理プログラムまたは請求項16の色不良領域補正処理プログラムのいずれか、またはその両方を記録したコンピュータ読みとり可能な記録媒体。   A computer-readable recording medium on which either or both of the color region identification processing program of claim 15 and the color defect region correction processing program of claim 16 are recorded. 請求項15の色領域特定処理プログラムまたは請求項16の色不良領域補正処理プログラムのいずれか、またはその両方を搭載し、実行する画像処理装置。   An image processing apparatus that carries and executes either the color area specifying process program of claim 15 or the color defect area correction process program of claim 16 or both.
JP2003417132A 2003-12-15 2003-12-15 Color defect area correction method, color defect area correction processing program, color area identification method, color area identification processing program, and image processing apparatus Expired - Lifetime JP4281541B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003417132A JP4281541B2 (en) 2003-12-15 2003-12-15 Color defect area correction method, color defect area correction processing program, color area identification method, color area identification processing program, and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003417132A JP4281541B2 (en) 2003-12-15 2003-12-15 Color defect area correction method, color defect area correction processing program, color area identification method, color area identification processing program, and image processing apparatus

Publications (2)

Publication Number Publication Date
JP2005176261A true JP2005176261A (en) 2005-06-30
JP4281541B2 JP4281541B2 (en) 2009-06-17

Family

ID=34736131

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003417132A Expired - Lifetime JP4281541B2 (en) 2003-12-15 2003-12-15 Color defect area correction method, color defect area correction processing program, color area identification method, color area identification processing program, and image processing apparatus

Country Status (1)

Country Link
JP (1) JP4281541B2 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09218940A (en) * 1996-02-13 1997-08-19 Terumo Corp Picture processor
JPH1063836A (en) * 1996-08-16 1998-03-06 Fuji Photo Film Co Ltd Method and device for emphasizing image
JPH1075374A (en) * 1996-08-30 1998-03-17 Fuji Photo Film Co Ltd Image processing unit and its method
JPH11341279A (en) * 1998-05-29 1999-12-10 Fuji Photo Film Co Ltd Picture processing method
JP2001034777A (en) * 1999-07-19 2001-02-09 Hitachi Ltd Curved surface data interpolation device
JP2001069334A (en) * 1999-08-25 2001-03-16 Noritsu Koki Co Ltd Method and device for processing photograph and recording medium
JP2002281250A (en) * 2001-03-15 2002-09-27 Canon Inc Image signal processing apparatus and method therefor, image reading system, and program and medium
JP2002305667A (en) * 2001-01-31 2002-10-18 Gretag Imaging Trading Ag Method and device for automatically correcting color defect

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09218940A (en) * 1996-02-13 1997-08-19 Terumo Corp Picture processor
JPH1063836A (en) * 1996-08-16 1998-03-06 Fuji Photo Film Co Ltd Method and device for emphasizing image
JPH1075374A (en) * 1996-08-30 1998-03-17 Fuji Photo Film Co Ltd Image processing unit and its method
JPH11341279A (en) * 1998-05-29 1999-12-10 Fuji Photo Film Co Ltd Picture processing method
JP2001034777A (en) * 1999-07-19 2001-02-09 Hitachi Ltd Curved surface data interpolation device
JP2001069334A (en) * 1999-08-25 2001-03-16 Noritsu Koki Co Ltd Method and device for processing photograph and recording medium
JP2002305667A (en) * 2001-01-31 2002-10-18 Gretag Imaging Trading Ag Method and device for automatically correcting color defect
JP2002281250A (en) * 2001-03-15 2002-09-27 Canon Inc Image signal processing apparatus and method therefor, image reading system, and program and medium

Also Published As

Publication number Publication date
JP4281541B2 (en) 2009-06-17

Similar Documents

Publication Publication Date Title
JP4627557B2 (en) Method and apparatus for correcting hybrid flash artifacts in digital images
US8135184B2 (en) Method and apparatus for detection and correction of multiple image defects within digital images using preview or other reference images
US7536036B2 (en) Method and apparatus for red-eye detection in an acquired digital image
JP4856086B2 (en) Method and apparatus for detecting red eye in an acquired digital image
US8391595B2 (en) Image processing method and image processing apparatus
US8331666B2 (en) Automatic red eye artifact reduction for images
US20060204052A1 (en) Method, apparatus, and program for detecting red eye
US20080043121A1 (en) Optimized Performance and Performance for Red-Eye Filter Method and Apparatus
CN107563976A (en) U.S. face parameter acquiring method, device, readable storage medium storing program for executing and computer equipment
JP2015156615A (en) Image processing system, image processing method, control program, and recording medium
WO2015145917A1 (en) Image-correcting device, image correction method, and program-recording medium
CN106603896A (en) Camera module and method of manufacturing the same
CN108399617B (en) Method and device for detecting animal health condition
US8655102B2 (en) Method and system for identifying tokens in an image
EP1326209B1 (en) Method for contrast enhancement in colour digital image
CN108737797A (en) White balancing treatment method, device and electronic equipment
JP5070921B2 (en) Development processing apparatus for undeveloped image data, development processing method, and computer program for development processing
JP4457586B2 (en) Red-eye area correction method, red-eye area correction processing program, recording medium, and image processing apparatus
JP4281541B2 (en) Color defect area correction method, color defect area correction processing program, color area identification method, color area identification processing program, and image processing apparatus
JP4123954B2 (en) Red-eye area correction method, red-eye area correction processing program, and image processing apparatus
JP2004208132A (en) Method and processing program for color fault area correction, and image processing apparatus
JP4269808B2 (en) Color defect area correction method, color defect area correction processing program, color area identification method, color area identification processing program, and image processing apparatus
US20120086812A1 (en) Digital camera imaging evaluation module
JP6098227B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP2005159886A (en) Image brightness correction processing device and image brightness correction processing method as well as computer-readable recording medium on which program is recorded and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060622

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20081114

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20081125

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090122

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20090122

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 4281541

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120327

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120327

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20150327

Year of fee payment: 6

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

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

Free format text: PAYMENT UNTIL: 20150327

Year of fee payment: 6

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20150327

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term