JP5633172B2 - Image processing apparatus and image processing program - Google Patents

Image processing apparatus and image processing program Download PDF

Info

Publication number
JP5633172B2
JP5633172B2 JP2010085813A JP2010085813A JP5633172B2 JP 5633172 B2 JP5633172 B2 JP 5633172B2 JP 2010085813 A JP2010085813 A JP 2010085813A JP 2010085813 A JP2010085813 A JP 2010085813A JP 5633172 B2 JP5633172 B2 JP 5633172B2
Authority
JP
Japan
Prior art keywords
red
pixel
ellipsoid
value
eye
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.)
Expired - Fee Related
Application number
JP2010085813A
Other languages
Japanese (ja)
Other versions
JP2011216044A (en
Inventor
陽 廣重
陽 廣重
聰 西尾
聰 西尾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2010085813A priority Critical patent/JP5633172B2/en
Publication of JP2011216044A publication Critical patent/JP2011216044A/en
Application granted granted Critical
Publication of JP5633172B2 publication Critical patent/JP5633172B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Description

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

フラッシュを使用して人物を撮影した場合、目の色が赤色や金色に撮影される赤目現象が発生する。デジタルカメラ、コンピューター、またはプリンター等の画像処理機能を有する装置には、この赤目現象が発生した画像を画像処理によって補正できるものがある(特許文献1参照)。   When a person is photographed using a flash, a red-eye phenomenon occurs in which the eye color is photographed in red or gold. Some apparatuses having an image processing function such as a digital camera, a computer, or a printer can correct an image in which the red-eye phenomenon occurs by image processing (see Patent Document 1).

特開平10−233929号JP-A-10-233929

しかしながら、従来の方法では、赤目現象が発生している領域を精度よく特定することができず、その結果、赤目補正を適切に行うことができない場合があった。   However, in the conventional method, the region where the red-eye phenomenon occurs cannot be accurately identified, and as a result, there are cases where the red-eye correction cannot be performed appropriately.

本発明は、このような状況に鑑みてなされたものであり、赤目現象が発生している領域を適切に特定することができる画像処理装置、画像処理プログラムを提供することにある。   The present invention has been made in view of such circumstances, and it is an object of the present invention to provide an image processing apparatus and an image processing program that can appropriately specify a region where a red-eye phenomenon occurs.

上記の目的を達成するために、本発明の第1の側面によれば、カラー画像における赤目現象の発生している赤目を含む赤目候補領域から赤目画素を特定する画像処理装置であって、赤目画素を特定するカラー画像を対象として、色の要素を軸とし少なくとも1つの色の要素が赤度値である3軸空間において、前記赤目候補領域内の画素群の前記色の要素の値に基づいて、前記赤目画素と非赤目画素とを分離する楕円体を定義する楕円体定義手段と、前記赤目候補領域内の各画素について、前記画素の色が前記楕円体の内側に位置する場合に、当該画素を赤目画素として特定する赤目画素特定手段と、を有する。
To achieve the above object, a first According to one aspect, an image processing apparatus for identifying redeye pixels from the red-eye candidate region including a red eye that occurrence of the red-eye effect in the color image of the present invention, red Based on the value of the color element of the pixel group in the red-eye candidate region in a three-axis space in which at least one color element is a redness value with a color element as an axis for a color image specifying a pixel An ellipsoid defining means for defining an ellipsoid that separates the red-eye pixel and the non-red-eye pixel, and, for each pixel in the red-eye candidate region, the color of the pixel is located inside the ellipsoid, Red-eye pixel specifying means for specifying the pixel as a red-eye pixel.

これにより、画像処理装置は、赤目現象が発生している赤目画素を高精度に検出することができる。   Thereby, the image processing apparatus can detect the red-eye pixel in which the red-eye phenomenon occurs with high accuracy.

上記の第1の側面において好ましい態様によれば、さらに、前記楕円体定義手段は、前記赤目候補領域内の画素群のうちその前記赤度値が上位所定割合に該当する定義画素群の前記色の要素の値に基づいて前記楕円体を定義する。   According to a preferable aspect in the first aspect, the ellipsoid defining means further includes the color of the definition pixel group in which the redness value corresponds to the upper predetermined ratio among the pixel group in the red-eye candidate region. The ellipsoid is defined based on the values of the elements.

この態様によれば、画像処理装置は、赤目現象が発生している赤目画素をさらに高精度に検出することができる。   According to this aspect, the image processing apparatus can detect the red-eye pixel in which the red-eye phenomenon has occurred with higher accuracy.

上記の第1の側面において好ましい態様によれば、さらに、前記要素のうち第1、第2の要素は前記画素の色に基づいた算出方法の異なる2種の赤度値であり、第3の要素は前記画素の色の明度、輝度、赤値のいずれかである。   According to a preferred embodiment in the first aspect, the first and second elements of the elements are two redness values having different calculation methods based on the color of the pixel, The element is one of the brightness, luminance, and red value of the color of the pixel.

この態様によれば、画像処理装置は、3軸空間において赤目現象が発生している赤目画素の分布を集中させることができ、赤目画素を高精度に検出することができる。   According to this aspect, the image processing apparatus can concentrate the distribution of red-eye pixels in which the red-eye phenomenon occurs in the three-axis space, and can detect the red-eye pixels with high accuracy.

上記の第1の側面において好ましい態様によれば、さらに、前記楕円体定義手段は、前記定義画素群の各要素の値の平均値に基づいて前記楕円体の中心点を定義し、前記定義画素群の各要素の値の標準偏差値に基づいて前記楕円体の3つの径を定義する。   According to a preferable aspect in the first aspect, the ellipsoid defining means further defines a center point of the ellipsoid based on an average value of values of the elements of the definition pixel group, and the definition pixel Three diameters of the ellipsoid are defined based on the standard deviation value of the values of each element of the group.

この態様によれば、画像処理装置は、3軸空間において赤目画素と非赤目画素を高精度に分離する楕円体を定義することができる。   According to this aspect, the image processing apparatus can define an ellipsoid that separates red-eye pixels and non-red-eye pixels with high accuracy in a three-axis space.

上記の第1の側面において好ましい態様によれば、さらに、前記楕円体定義手段は、さらに、前記楕円体の中心点を回転中心とし前記第3の要素が前記明度または赤値である軸を回転軸とする前記楕円体の回転角度を、前記定義画素群の前記第1、第2の赤度値の平均値の比率に基づいて定義する。   According to a preferable aspect in the first aspect, the ellipsoid defining means further rotates an axis whose center is the center point of the ellipsoid and the third element is the lightness or red value. A rotation angle of the ellipsoid serving as an axis is defined based on a ratio of average values of the first and second redness values of the definition pixel group.

この態様によれば、画像処理装置は、3軸空間において赤目画素と非赤目画素をさらに高精度に分離する楕円体を定義することができる。   According to this aspect, the image processing apparatus can define an ellipsoid that separates red-eye pixels and non-red-eye pixels with higher accuracy in the three-axis space.

上記の第1の側面において好ましい態様によれば、さらに、前記楕円体定義手段は、デフォルトの前記楕円体を定義する第1の楕円体パラメーターを有し、当該第1の楕円体パラメーターを前記定義画素群の各要素の値の平均値及び標準偏差値に基づいて変更し第2の楕円体パラメーターを取得する。   According to a preferred embodiment in the first aspect, the ellipsoid defining means further has a first ellipsoid parameter defining the default ellipsoid, and the first ellipsoid parameter is defined as the definition. The second ellipsoid parameter is obtained by changing the value based on the average value and standard deviation value of each element of the pixel group.

この態様によれば、画像処理装置は、変更が必要なパラメーターのみ変更すればよいため、効率的に赤目画素と非赤目画素を分離する楕円体を定義することができる。   According to this aspect, the image processing apparatus only needs to change the parameters that need to be changed, and thus can define an ellipsoid that efficiently separates red-eye and non-red-eye pixels.

上記の第1の側面において好ましい態様によれば、さらに、前記楕円体定義手段は、前記第1、第2の要素の各軸を回転軸とする前記楕円体の各回転角度を0°から変更しない。   According to a preferable aspect in the first aspect, the ellipsoid defining means further changes each rotation angle of the ellipsoid from 0 ° with each axis of the first and second elements as a rotation axis. do not do.

この態様によれば、画像処理装置は、2つの軸に対応する回転角度パラメーターを0°とすることによって、変更対象のパラメーターを省略することができ、また処理の負荷を抑えることができる。   According to this aspect, by setting the rotation angle parameter corresponding to the two axes to 0 °, the image processing apparatus can omit the parameter to be changed and can suppress the processing load.

上記の第1の側面において好ましい態様によれば、さらに、前記画像処理装置は、さらに、前記赤目画素特定手段によって特定された画素について、前記画素の彩度を抑える補正を行う補正手段を有し、前記赤目画素特定手段は、さらに、前記各画素について補正度合いを表す補正係数情報を生成し、前記楕円体の内側に位置する前記画素の前記補正係数を最大の補正度合いを表す第1の補正係数とし、前記楕円体の外側に位置する前記画素の前記補正係数を前記第1の補正係数より小さく0を含む第2の補正係数とし、前記補正手段は、前記画素の前記補正係数に基づいて前記彩度を抑える補正を行う。   According to a preferable aspect in the first aspect, the image processing apparatus further includes a correction unit that performs correction for suppressing saturation of the pixel for the pixel specified by the red-eye pixel specifying unit. The red-eye pixel specifying unit further generates correction coefficient information indicating a correction degree for each pixel, and the correction coefficient of the pixel located inside the ellipsoid is a first correction indicating the maximum correction degree. The correction coefficient of the pixel located outside the ellipsoid is a second correction coefficient that is smaller than the first correction coefficient and includes 0, and the correction means is based on the correction coefficient of the pixel. Correction for suppressing the saturation is performed.

この態様によれば、画像処理装置は、楕円体の内側に位置する画素を赤目画素として特定し補正を行うことができる。   According to this aspect, the image processing apparatus can specify and correct a pixel located inside the ellipsoid as a red-eye pixel.

上記の第1の側面において好ましい態様によれば、さらに、前記赤目画素特定手段は、前記楕円体の境界から距離が所定範囲内であって、前記楕円体の内側に位置する前記画素の前記補正係数を前記距離に応じて前記第1の補正係数から前記第2の補正係数に逓減させた第3の補正係数とし、前記楕円体の外側に位置する前記画素の前記補正係数を前記距離に応じて前記第2の補正係数から前記第1の補正係数に逓増させた第4の補正係数とする。   According to a preferred aspect of the first aspect, the red-eye pixel specifying unit further corrects the pixel located within the ellipsoid and having a distance within a predetermined range from a boundary of the ellipsoid. A coefficient is set as a third correction coefficient that is gradually decreased from the first correction coefficient to the second correction coefficient according to the distance, and the correction coefficient of the pixel located outside the ellipsoid is determined according to the distance. The fourth correction coefficient is gradually increased from the second correction coefficient to the first correction coefficient.

この態様によれば、画像処理装置は、楕円体の境界からの距離が所定範囲内の画素であって、楕円体の内側に位置する画素の補正度合いを抑え、楕円体の外側に位置する画素を補正度合いは小さいものの補正の対象にすることができる。   According to this aspect, the image processing apparatus is a pixel whose distance from the boundary of the ellipsoid is within a predetermined range, the pixel positioned outside the ellipsoid while suppressing the correction degree of the pixel positioned inside the ellipsoid. Although the degree of correction is small, it can be the target of correction.

上記の目的を達成するために、本発明の第2の側面によれば、カラー画像における赤目現象の発生している赤目を含む赤目候補領域から赤目画素を特定する画像処理をコンピューターに実行させるコンピューター読み取り可能な画像処理プログラムにおいて、赤目画素を特定するカラー画像を対象として、色の要素を軸とし少なくとも1つの色の要素が赤度値である3軸空間において、前記赤目候補領域内の画素群の前記色の要素の値に基づいて、前記赤目画素と非赤目画素とを分離する楕円体を定義する楕円体定義工程と、前記赤目候補領域内の各画素について、前記画素の色が前記楕円体の内側に位置する場合に、当該画素を赤目画素として特定する赤目画素特定工程と、を実行させる。 In order to achieve the above object, according to the second aspect of the present invention, a computer that causes a computer to execute image processing for identifying a red-eye pixel from a red-eye candidate region including a red-eye in which a red-eye phenomenon occurs in a color image. In a readable image processing program, for a color image that identifies a red-eye pixel , a pixel group in the red-eye candidate region in a three-axis space in which at least one color element is a redness value with a color element as an axis An ellipsoid defining step for defining an ellipsoid separating the red-eye pixel and the non-red-eye pixel based on the value of the color element; and for each pixel in the red-eye candidate region, the color of the pixel is the ellipse When located inside the body, a red-eye pixel specifying step of specifying the pixel as a red-eye pixel is executed.

本発明の実施の形態に係るプリンター1の構成を示す斜視図である。1 is a perspective view illustrating a configuration of a printer 1 according to an embodiment of the present invention. 図1のプリンター1の機能構成例を示すブロック図である。FIG. 2 is a block diagram illustrating a functional configuration example of the printer 1 in FIG. 1. 印刷処理対象画像TIを模式的に示した図である。It is the figure which showed typically the printing process target image TI. 赤目候補領域Pe1を表す図である。It is a figure showing red-eye candidate area | region Pe1. 3軸空間のXY軸平面における赤目候補領域の画素分布を表す図である。It is a figure showing the pixel distribution of the red-eye candidate area | region in the XY-axis plane of triaxial space. 3軸空間のXZ軸平面における赤目候補領域の画素分布を表す図である。It is a figure showing the pixel distribution of the red-eye candidate area | region in the XZ-axis plane of triaxial space. 3軸空間のYZ軸平面における赤目候補領域の画素分布を表す図である。It is a figure showing the pixel distribution of the red-eye candidate area | region in the YZ-axis plane of triaxial space. 3軸空間における赤目画素の分布を内包する楕円体を表す図である。It is a figure showing the ellipsoid which contains distribution of the red-eye pixel in 3-axis space. 自動赤目補正処理の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of an automatic red eye correction process. 楕円体を定義するための楕円体パラメーターを表す図である。It is a figure showing the ellipsoid parameter for defining an ellipsoid. 楕円体定義処理の詳細を表すフローチャート図である。It is a flowchart figure showing the detail of an ellipsoid definition process. 3軸空間における直線L1と直線L2とを表す例図である。It is an example figure showing the straight line L1 and the straight line L2 in triaxial space. 楕円体パラメーターの例とその楕円体を表す図である。It is a figure showing the example of an ellipsoid parameter, and its ellipsoid. 赤目画素特定処理Z2の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of the red-eye pixel specific process Z2. 楕円体からの距離と補正係数との関係を表した図である。It is a figure showing the relationship between the distance from an ellipsoid, and a correction coefficient. 赤目候補領域における補正係数を表す図である。It is a figure showing the correction coefficient in a red-eye candidate area | region. 補正処理Z3の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of the correction process Z3.

以下、図面にしたがって本発明の実施の形態について説明する。ただし、本発明の技術的範囲はこれらの実施の形態に限定されず、特許請求の範囲に記載された事項とその均等物まで及ぶものである。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the technical scope of the present invention is not limited to these embodiments, but extends to the matters described in the claims and equivalents thereof.

本実施の形態例に係る画像処理装置は、色の要素を軸とし少なくとも要素として赤度値を含む3軸空間において、赤目画素を有する赤目候補領域内の画素群の要素値に基づいて、赤目画素と非赤目画素とを分離する楕円体を定義し、当該楕円体の内側に位置する画素を赤目画素として特定するものである。   The image processing apparatus according to the present embodiment uses a red-eye based on the element value of a pixel group in a red-eye candidate area having a red-eye pixel in a three-axis space including a color element as an axis and at least a redness value as an element. An ellipsoid that separates pixels and non-red-eye pixels is defined, and a pixel located inside the ellipsoid is specified as a red-eye pixel.

[プリンター1の構成の説明]
図1は、本発明の実施の形態としてのプリンター1のハードウェアの構成例を示すブロック図である。このプリンター1は、メモリーカード18等から取得した画像データに基づき画像を印刷する、いわゆるダイレクトプリントに対応したカラーインクジェットプリンター、またはカラーレーザープリンターである。また、プリンター1は、印刷するカラー画像に対して、自動的に、赤目部分を検出し、その部分を自然な色(たとえば、黒色等)に補正する機能(以下、自動赤目補正機能と称する)を有している。
[Description of Printer 1 Configuration]
FIG. 1 is a block diagram illustrating a hardware configuration example of a printer 1 according to an embodiment of the present invention. The printer 1 is a color ink jet printer or color laser printer compatible with so-called direct printing, in which an image is printed based on image data acquired from the memory card 18 or the like. The printer 1 automatically detects a red-eye portion of a color image to be printed, and corrects the portion to a natural color (for example, black) (hereinafter referred to as an automatic red-eye correction function). have.

プリンター1は、CPU11、内部メモリー12、操作部13、表示部14、プリンターエンジン15、およびカードインターフェイス(カードI/F)16を備えている。   The printer 1 includes a CPU 11, an internal memory 12, an operation unit 13, a display unit 14, a printer engine 15, and a card interface (card I / F) 16.

CPU(central processing unit)11は、各部を制御して、内部メモリー12に格納されているプログラムに応じて各種の処理等を実行する。   A CPU (central processing unit) 11 controls each unit and executes various processes according to a program stored in the internal memory 12.

たとえばCPU11は、自動赤目補正モードが設定されている場合、印刷に先立って、印刷されるカラー画像(以下、印刷処理対象画像TIと称する)の中から、人物、犬などのペット等の目の画像を含む領域、またはユーザーが指定した点の周囲の領域等を検出する処理(以下、検出処理Z0と称する)を実行する。また、CPU11は、検出した領域(以下、赤目候補領域Pe1と称する)に基づいて、3軸空間において赤目画素を内包する楕円体を定義する処理(以下、楕円体定義処理Z1と称する)を実行する。そして、CPU11は、各画素について、3軸空間上の楕円体の内側に位置する画素を赤目画素として特定し(以下、赤目画素特定処理Z2と称する)、特定された赤目画素の色を自然な色(たとえば、黒色等)に置き換える処理(以下、補正処理Z3と称する)を実行する。   For example, when the automatic red-eye correction mode is set, the CPU 11 selects an eye such as a person, a dog or other pet from a color image to be printed (hereinafter referred to as a print processing target image TI) prior to printing. A process for detecting an area including an image or an area around a point designated by the user (hereinafter referred to as a detection process Z0) is executed. Further, the CPU 11 executes a process (hereinafter referred to as an ellipsoid definition process Z1) that defines an ellipsoid that includes red-eye pixels in the triaxial space based on the detected area (hereinafter referred to as a red-eye candidate area Pe1). To do. Then, the CPU 11 specifies a pixel located inside the ellipsoid in the three-axis space as a red-eye pixel (hereinafter referred to as a red-eye pixel specifying process Z2), and sets the color of the specified red-eye pixel to natural. A process of replacing with a color (for example, black) (hereinafter referred to as correction process Z3) is executed.

内部メモリー12は、CPU11が実行する各種プログラムや各種データを格納しているROM(Read Only Memory)、およびCPU11が実行対象とするプログラムやデータを一時的に格納するRAM(Random Access Memory)によって構成されている。   The internal memory 12 includes a ROM (Read Only Memory) that stores various programs executed by the CPU 11 and various data, and a RAM (Random Access Memory) that temporarily stores programs and data to be executed by the CPU 11. Has been.

操作部13は、ボタンやタッチパネルの1つまたは複数により構成され、ユーザーによる操作内容をCPU11に通知する。   The operation unit 13 includes one or a plurality of buttons and a touch panel, and notifies the CPU 11 of the operation content by the user.

表示部14は、液晶ディスプレイ等により構成され、CPU11から供給された表示データに対応する画像を表示する。   The display unit 14 includes a liquid crystal display and displays an image corresponding to the display data supplied from the CPU 11.

プリンターエンジン15は、CPU11から供給された印刷データに基づき印刷を行う印刷機構である。   The printer engine 15 is a printing mechanism that performs printing based on print data supplied from the CPU 11.

カードインターフェイス(I/F)16は、カードスロット17に挿入されたメモリーカード18との間でデータのやり取りを行うためのインターフェイスである。なお、この例では、メモリーカード18にRGBデータとしての画像データが格納されており、プリンター1は、カードインターフェイス16を介してメモリーカード18に格納された画像データの取得を行う。   The card interface (I / F) 16 is an interface for exchanging data with the memory card 18 inserted in the card slot 17. In this example, image data as RGB data is stored in the memory card 18, and the printer 1 acquires the image data stored in the memory card 18 via the card interface 16.

プリンター1の各構成要素は、バス19を介して互いに接続されている。   The components of the printer 1 are connected to each other via a bus 19.

なおプリンター1は、さらに、他の機器(例えばデジタルスチルカメラやコンピューター)とのデータ通信を行うためのインターフェイスを備えていてもよい。   The printer 1 may further include an interface for performing data communication with other devices (for example, a digital still camera or a computer).

[プリンター1の機能構成例の説明]
図2は、検出処理Z0、楕円体定義処理Z1、及び赤目画素特定処理Z2、補正処理Z3を実行するためのプリンター1の機能構成例を示すブロック図である。この機能は、CPU11が内部メモリー12に記憶されている所定のプログラムを実行することより実現可能となる。
[Description of Functional Configuration Example of Printer 1]
FIG. 2 is a block diagram illustrating a functional configuration example of the printer 1 for executing the detection process Z0, the ellipsoid definition process Z1, the red-eye pixel specifying process Z2, and the correction process Z3. This function can be realized by the CPU 11 executing a predetermined program stored in the internal memory 12.

画像読取部21は、印刷処理対象画像TIを、たとえばメモリーカード18から、カードI/F16を介して読み取る。   The image reading unit 21 reads the print processing target image TI from, for example, the memory card 18 via the card I / F 16.

図3は、印刷処理対象画像TIを模式的に示した図である。ここではこの印刷処理対象
画像TIの中央の人物の左目部分31に生じている赤目現象を処理対象とするものとする。
FIG. 3 is a diagram schematically showing the print processing target image TI. Here, it is assumed that the red eye phenomenon occurring in the left eye portion 31 of the person at the center of the print processing target image TI is the processing target.

赤目候補領域取得部22は、画像読取部21により読み取られた印刷処理対象画像TIのレプリカ(以下、単に、印刷処理対象画像TIとも称する)に対して、検出処理Z0を実行する。具体的には、たとえば人物の目の基本的な形状を表すテンプレートを利用したパターンマッチングによる方法(たとえば、特開2006−279460号公報)といった公知の検出方法を用いて、瞳孔、虹彩、白目、目頭、目尻等の部位を含む領域を取得する処理を実行する。赤目候補領域取得部22は、さらに、公知の検出方法によって取得された領域から、赤みがかった瞳孔や虹彩を含む領域を検出する処理を実行して、左目部分を赤目候補領域Pe1として取得する。   The red-eye candidate area acquisition unit 22 performs a detection process Z0 on a replica of the print processing target image TI read by the image reading unit 21 (hereinafter also simply referred to as a print processing target image TI). Specifically, for example, a known detection method such as a pattern matching method using a template representing a basic shape of a person's eyes (for example, Japanese Patent Application Laid-Open No. 2006-279460) can be used to detect pupils, irises, white eyes, A process of acquiring a region including a part such as the eyes and the corners of the eyes is executed. Further, the red-eye candidate area acquisition unit 22 executes a process of detecting an area including a reddish pupil and iris from the area acquired by a known detection method, and acquires the left-eye part as the red-eye candidate area Pe1.

図4は、赤目候補領域Pe1を表す図である。同図の赤目候補領域Pe1は、図3の印刷処理対象画像TIにおける赤目現象が発生している瞳孔及び虹彩と、その周辺の白目、目頭、目尻等の部位とを含む矩形領域である。   FIG. 4 is a diagram illustrating the red-eye candidate region Pe1. The red-eye candidate region Pe1 in the figure is a rectangular region including the pupil and iris in which the red-eye phenomenon occurs in the print processing target image TI in FIG. 3 and the surrounding white eyes, eyes, and eye corners.

図5、図6、及び図7は、RGB色空間に基づく「R値−B値(X軸)」、「R値−G値(Y軸)」、「G値(Z軸)」を要素値とする3軸空間の平面における赤目候補領域Pe1内の画素群の分布を表す例図である。「R値−B値」、「R値−G値」は共に赤度値であり、算出方法の異なる赤度値である。また、「G値」はRGB色空間のG成分の値である。同図において、黒塗りの四角印(◆印)は赤目現象が生じている画素を示し、白抜きの四角印(□印)はそれ以外の画素を示す。   5, 6, and 7 are elements of “R value−B value (X axis)”, “R value−G value (Y axis)”, and “G value (Z axis)” based on the RGB color space. It is an example figure showing distribution of a pixel group in red eye candidate field Pe1 in a plane of 3 axis space used as a value. Both “R value−B value” and “R value−G value” are redness values, and are redness values with different calculation methods. The “G value” is the value of the G component in the RGB color space. In the figure, a black square mark (♦ mark) indicates a pixel in which a red-eye phenomenon occurs, and a white square mark (□ mark) indicates other pixels.

図5は、3軸空間における「R値−B値(X軸)」「R値−G値(Y軸)」平面上の赤目候補領域Pe1内の画素の分布を表す例図である。同図の平面において、非赤目画素(□印)は平面の左下部分に集中して分布している。それに対して、赤目画素(◆印)は、平面の中央付近を中心とする楕円51の形状に分布している。赤目画素は赤度値の高い画素であることから、算出方法の異なる2種の赤度値を軸とする平面において、非赤目画素と比べて両軸の値(赤度値)が高い部分に集中して分布する。   FIG. 5 is an example showing a distribution of pixels in the red-eye candidate region Pe1 on the “R value−B value (X axis)” and “R value−G value (Y axis)” plane in the triaxial space. In the plane of the figure, non-red-eye pixels (□) are concentrated in the lower left part of the plane. On the other hand, the red-eye pixels (♦ marks) are distributed in the shape of an ellipse 51 centered around the center of the plane. Since the red-eye pixel is a pixel with a high redness value, the two-axis values (redness values) are higher than the non-red-eye pixel on a plane centered on two different redness values. Concentrated and distributed.

図6は、3軸空間における「R値−B値(X軸)」「G値(Z軸)」平面上の赤目候補領域Pe1内の画素群の分布を表す例図である。同図の平面において、非赤目画素(□印)は、赤度値「R値−B値」が低い部分であって、「G値」が20〜150の範囲に分布している。それに対して、赤目画素(◆印)は、赤度値「R値−B値」が高く、「G値」が0〜80の範囲に分布している。つまり、赤目画素は、「R値−B値」「G値」平面において、非赤目画素と比べて、赤度値「R値−B値」の値が高く、明度を表す「G値」の値がより低く狭い範囲51に分布している。   FIG. 6 is an example showing the distribution of the pixel group in the red-eye candidate region Pe1 on the “R value−B value (X axis)” and “G value (Z axis)” plane in the triaxial space. In the plane of the figure, the non-red-eye pixels (□) are portions where the redness value “R value−B value” is low and the “G value” is distributed in the range of 20 to 150. In contrast, the red-eye pixels (♦ marks) have a high redness value “R value−B value” and a “G value” distributed in the range of 0-80. That is, the red-eye pixel has a higher redness value “R value-B value” in the “R value-B value” “G value” plane than the non-red-eye pixel, and has a “G value” representing brightness. The values are distributed in a lower and narrower range 51.

図7は、3軸空間における「R値−G値(Y軸)」「G値(Z軸)」平面上の赤目候補領域Pe1内の画素群の分布を表す例図である。同図の平面において、非赤目画素(□印)は、赤度値「R値−G値」が低い部分であって、「G値」が20〜150の範囲に分布している。それに対して、赤目画素(◆印)は、赤度値「R値−G値」が高く、「G値」が0〜80の範囲に分布している。つまり、赤目画素は、「R値−G値」「G値」平面において、非赤目画素と比べて、赤度値「R値−G値」の値が高く、明度を表す「G値」の値がより低く狭い範囲51に分布している。   FIG. 7 is an example showing the distribution of the pixel group in the red-eye candidate region Pe1 on the “R value−G value (Y axis)” and “G value (Z axis)” plane in the triaxial space. In the plane of the figure, the non-red-eye pixels (□) are portions where the redness value “R value−G value” is low, and the “G value” is distributed in the range of 20 to 150. On the other hand, the red-eye pixels (♦ marks) have a high redness value “R value−G value” and are distributed in a range of “G value” from 0 to 80. That is, the red-eye pixel has a higher redness value “R value-G value” in the “R value-G value” “G value” plane than the non-red-eye pixel, and has a “G value” representing brightness. The values are distributed in a lower and narrower range 51.

図5〜図7によると、X軸−Y軸平面において赤目画素は楕円形51に分布しており、図6のX軸−Z軸、図7のY軸−Z軸平面において、当該楕円形51の赤目画素がZ軸上の一定の値範囲に分布している。つまり、赤目候補領域Pe1における赤目画素は、図5〜図7の3軸空間において楕円体51の形状の範囲に分布していることがわかる。   5 to 7, the red-eye pixels are distributed in an ellipse 51 in the X-axis-Y-axis plane, and the ellipse is in the X-axis-Z axis in FIG. 6 and the Y-axis-Z axis plane in FIG. 51 red-eye pixels are distributed in a certain value range on the Z-axis. That is, it can be seen that the red-eye pixels in the red-eye candidate region Pe1 are distributed in the range of the shape of the ellipsoid 51 in the three-axis space of FIGS.

図8は、図5〜図7の各平面における赤目画素の分布を内包する楕円体81を3軸空間上に表した図である。各軸の要素は、図5〜7と同様である。図8のように、例えば、「R値−B値」「R値−G値」「G値」を軸の要素とする3軸空間において、赤目画素は図8のように楕円体81の空間内に集中して分布する傾向にある。   FIG. 8 is a diagram showing an ellipsoid 81 containing the distribution of red-eye pixels in each plane of FIGS. 5 to 7 on a triaxial space. The elements of each axis are the same as in FIGS. As shown in FIG. 8, for example, in a three-axis space having “R value-B value”, “R value-G value”, and “G value” as elements of the axes, the red-eye pixel is a space of an ellipsoid 81 as shown in FIG. It tends to be concentrated in the inside.

従って、本実施の形態例における画像処理装置は、色の要素を軸とする3軸空間上において赤目画素が分布する楕円体を基準にして、赤目候補領域Pe1内の画素を赤目画素と非赤目画素とに区分する。さらに、画像処理装置は赤目画素を、楕円体との位置関係、例えば、3軸空間上における楕円体の境界と画素との距離に基づいて赤目補正を行う。   Therefore, the image processing apparatus according to the present embodiment uses the ellipsoid in which the red-eye pixels are distributed in a three-axis space with the color element as an axis as a reference for the pixels in the red-eye candidate region Pe1 as red-eye pixels and non-red-eye pixels. Divided into pixels. Further, the image processing apparatus performs red-eye correction on the red-eye pixel based on the positional relationship with the ellipsoid, for example, the distance between the boundary of the ellipsoid on the three-axis space and the pixel.

なお、3軸空間上の赤目画素の分布を表す楕円体の形状や位置は、赤目候補領域Pe1の含む赤目画素群の色の特徴によって異なる。そこで、本実施の形態例における画像処理装置は、色の要素を軸とし少なくとも1つの色の要素が赤度値である3軸空間において赤目画素と非赤目画素とを分離する楕円体を、赤目候補領域Pe1内の画素群の色の要素値に基づいて定義する。   Note that the shape and position of an ellipsoid representing the distribution of red-eye pixels in the three-axis space vary depending on the color characteristics of the red-eye pixel group included in the red-eye candidate region Pe1. Therefore, the image processing apparatus according to the present embodiment uses an ellipsoid that separates red-eye pixels and non-red-eye pixels in a three-axis space in which at least one color element is a redness value with a color element as an axis. This is defined based on the element value of the color of the pixel group in the candidate area Pe1.

図2に戻り、楕円体定義部23は、赤目候補領域取得部22によって取得された赤目候補領域Pe1の色の要素に基づいて、その要素を軸とする3軸空間上に楕円体を定義する。楕円体定義部23は、赤目候補領域Pe1の色の要素値を取得し、取得した要素値に基づいて楕円体を定義する楕円体パラメーターを取得する。そして、楕円体定義部23は、算出した楕円体パラメーターに基づいて3軸空間上に楕円体を定義する。楕円体を定義する処理の詳細については、楕円体定義処理Z1として後述する。   Returning to FIG. 2, the ellipsoid defining unit 23 defines an ellipsoid in a three-axis space with the element as an axis based on the color element of the red-eye candidate area Pe <b> 1 acquired by the red-eye candidate area acquiring unit 22. . The ellipsoidal definition unit 23 acquires the element value of the color of the red-eye candidate area Pe1, and acquires an ellipsoid parameter that defines the ellipsoid based on the acquired element value. Then, the ellipsoid definition unit 23 defines an ellipsoid in the three-axis space based on the calculated ellipsoid parameters. Details of the process of defining an ellipsoid will be described later as ellipsoid definition process Z1.

そして、赤目画素特定部24は、楕円体定義部23によって生成された3軸空間上の楕円体に基づいて赤目画素を特定する赤目画素特定処理Z2を行う。赤目画素特定部24は、赤目候補領域Pe1内の各画素について、3軸空間の楕円体の内側の座標に位置する画素を赤目画素として特定する。具体的には、赤目画素特定部24は、各画素と楕円体内との位置関係に基づいて補正係数情報を生成し、補正係数マップMaに格納する。補正係数は、赤目補正の度合いを表す値である。   Then, the red-eye pixel specifying unit 24 performs a red-eye pixel specifying process Z2 that specifies a red-eye pixel based on the ellipsoid in the three-axis space generated by the ellipsoid defining unit 23. The red-eye pixel specifying unit 24 specifies a pixel located at the coordinates inside the ellipsoid of the triaxial space as a red-eye pixel for each pixel in the red-eye candidate region Pe1. Specifically, the red-eye pixel specifying unit 24 generates correction coefficient information based on the positional relationship between each pixel and the ellipsoid, and stores the correction coefficient information in the correction coefficient map Ma. The correction coefficient is a value representing the degree of red-eye correction.

補正部25は、赤目画素特定部24により生成された補正係数マップMaに格納されている補正係数情報に基づいて、赤目候補領域Pe1の画素の色の彩度を抑える(赤目を修正する)補正処理Z3を実行して印刷データを生成する。   The correction unit 25 corrects the color saturation of the pixel in the red-eye candidate region Pe1 based on the correction coefficient information stored in the correction coefficient map Ma generated by the red-eye pixel specifying unit 24 (corrects the red eye). Processing Z3 is executed to generate print data.

以下、検出処理Z0、楕円体定義処理Z1、及び、赤目画素特定処理Z2、補正処理Z3の詳細について、以下に説明する。   Details of the detection process Z0, ellipsoid definition process Z1, red-eye pixel specifying process Z2, and correction process Z3 will be described below.

図9は、自動赤目補正処理の流れを示すフローチャート図である。ステップS11において、赤目候補領域取得部22は、画像読取部21によって読み取られた印刷処理対象画像TIに対して検出処理Z0を実行し、赤目候補領域Pe1を取得する。赤目候補領域Pe1は、図4のように、赤目現象が発生している画素を含む領域である。ただし、赤目候補領域Pe1は、必ずしも、図4のように矩形領域である必要はなく、目全体を含んでいる必要もない。赤目候補領域Pe1は、赤目現象が発生している領域を含んでいればよい。   FIG. 9 is a flowchart showing the flow of automatic red-eye correction processing. In step S11, the red-eye candidate area acquisition unit 22 executes the detection process Z0 on the print processing target image TI read by the image reading unit 21, and acquires the red-eye candidate area Pe1. The red-eye candidate region Pe1 is a region including pixels in which the red-eye phenomenon occurs as shown in FIG. However, the red-eye candidate region Pe1 does not necessarily need to be a rectangular region as shown in FIG. 4, and does not need to include the entire eye. The red-eye candidate region Pe1 only needs to include a region where the red-eye phenomenon occurs.

続いて、ステップS12において、楕円体定義処理Z1が行われる。   Subsequently, in step S12, an ellipsoid definition process Z1 is performed.

[楕円体定義処理Z1:楕円体定義処理の説明]
楕円体定義部23は、楕円体定義処理Z1として、赤目候補領域取得部22によって取
得された赤目候補領域Pe1の色の要素値に基づいて、3軸空間上において赤目画素と非赤目画素とを分離する楕円体を定義する(S12)。
[Ellipsoid Definition Process Z1: Explanation of Ellipsoid Definition Process]
The ellipsoidal definition unit 23 calculates the redeye pixel and the non-redeye pixel in the three-axis space based on the element value of the color of the redeye candidate region Pe1 acquired by the redeye candidate region acquisition unit 22 as the ellipsoid definition process Z1. An ellipsoid to be separated is defined (S12).

また、本実施の形態例における3軸空間の各色の要素値は、図5〜図7と同様に、算出方法の異なる2種の赤度値「R値−B値(X軸)」「R値−G値(Y軸)」と、明度を示す「G値(Z軸)」であるものとする。ただし、3軸空間の各色の要素値は上記の例に限定されるものではない。具体的には後述する。   In addition, the element values of the respective colors in the triaxial space in the present embodiment are two redness values “R value−B value (X axis)” “R” with different calculation methods, as in FIGS. Value-G value (Y axis) "and" G value (Z axis) "indicating the brightness. However, the element value of each color in the triaxial space is not limited to the above example. Details will be described later.

図10は、楕円体を定義するための楕円体パラメーターを表す図である。楕円体パラメーターには、楕円体の中心点(x,y,z)101、楕円体の3つの径(X径、Y径、Z径)、及び、各軸の回転角度(θx、θy、θz)がある。 FIG. 10 is a diagram illustrating ellipsoid parameters for defining an ellipsoid. The ellipsoid parameters include an ellipsoid center point (x 0 , y 0 , z 0 ) 101, three diameters of the ellipsoid (X diameter, Y diameter, Z diameter), and rotation angles (θx, θy, θz).

まず、中心点(x,y,z)101は、楕円体の中心の座標である。そして、X径102は楕円体のX軸方向の辺の半分の長さ、Y径103は楕円体のY軸方向の辺の半分の長さ、Z径104は楕円体のZ軸方向の辺の半分の長さである。また、θz105は、楕円体の中心点(x,y,z)101を回転中心とし、Z軸を回転軸とする楕円体の回転角度である。同様にして、θxは、楕円体の中心点(x,y,z)を回転中心としX軸を回転軸とする楕円体の回転角度、θyはY軸を回転軸とする楕円体の回転角度である。 First, the center point (x 0 , y 0 , z 0 ) 101 is the coordinates of the center of the ellipsoid. The X diameter 102 is half the length of the ellipsoid in the X axis direction, the Y diameter 103 is half the length of the ellipsoid in the Y axis direction, and the Z diameter 104 is the ellipsoid in the Z axis direction. Half the length. Θz105 is the rotation angle of the ellipsoid having the center point (x 0 , y 0 , z 0 ) 101 of the ellipsoid as the rotation center and the Z axis as the rotation axis. Similarly, θx is the rotation angle of the ellipsoid with the center point (x 0 , y 0 , z 0 ) of the ellipsoid as the rotation center and the X axis as the rotation axis, and θy is the ellipsoid with the Y axis as the rotation axis. Rotation angle.

図11は、楕円体定義処理の詳細を表すフローチャート図である。楕円体定義部23は、図10で挙げた楕円体パラメーターを取得し、そのパラメーターに基づいて楕円体を生成する。   FIG. 11 is a flowchart showing details of the ellipsoid definition process. The ellipsoid definition unit 23 acquires the ellipsoid parameters shown in FIG. 10 and generates an ellipsoid based on the parameters.

楕円体定義部23は、まず、赤目候補領域Pe1内の画素群のうちその赤度値が上位所定割合に該当する定義画素群を検出する(S21)。具体的には、楕円体定義部23は、赤目候補領域Pe1内の画素の赤度値「R値−B値」「R値−G値」を取得し、赤度値「R値−B値」が赤目候補領域Pe1の上位約10%に該当する画素群(以下、定義画素群R−B)、及び、赤度値「R値−G値」が赤目候補領域Pe1の上位所定割合に該当する画素群(以下、定義画素群R−G)をそれぞれ検出する。つまり、楕円体定義部23は、赤目候補領域Pe1内の画素のうち、赤度値が高く赤目現象が発生していると推定される画素群(定義画素群R−B、R−G)を各赤度値に基づいて検出する。   First, the ellipsoidal definition unit 23 detects a definition pixel group whose redness value corresponds to the upper predetermined ratio among the pixel groups in the red-eye candidate region Pe1 (S21). Specifically, the ellipsoidal definition unit 23 acquires the redness values “R value−B value” and “R value−G value” of the pixels in the red eye candidate region Pe1, and the redness value “R value−B value”. ”Corresponds to the upper 10% of the red eye candidate area Pe1 (hereinafter, the definition pixel group RB), and the redness value“ R value−G value ”corresponds to the upper predetermined ratio of the red eye candidate area Pe1. Each pixel group to be detected (hereinafter, defined pixel group RG) is detected. In other words, the ellipsoidal definition unit 23 selects pixel groups (definition pixel groups RB and RG) that have a high redness value and are estimated to have a redeye phenomenon among the pixels in the redeye candidate region Pe1. Detect based on each redness value.

なお、本実施の形態例における楕円体定義部23は、定義画素群の赤目候補領域Pe1における割合を約10%としているが、所定割合は上記の10%に限定されるものではない。所定割合は、例えば、赤目候補領域Pe1とその瞳孔及び虹彩の面積比、即ち、赤目候補領域Pe1と赤目現象が発生していると推定される領域(赤目推定領域)との面積比に応じて調整されることが望ましい。例えば、赤目候補領域Pe1における赤目推定領域の面積が赤目候補領域の面積の約1/20程度である場合、楕円体定義部23は所定割合を約5%に調整する。   In the ellipsoidal definition unit 23 in the present embodiment, the ratio of the definition pixel group in the red-eye candidate area Pe1 is about 10%, but the predetermined ratio is not limited to the above 10%. The predetermined ratio depends on, for example, the area ratio between the red-eye candidate area Pe1 and its pupils and irises, that is, the area ratio between the red-eye candidate area Pe1 and the area where the red-eye phenomenon is estimated to occur (red-eye estimation area). It is desirable to be adjusted. For example, when the area of the red-eye estimation region in the red-eye candidate region Pe1 is about 1/20 of the area of the red-eye candidate region, the ellipsoid definition unit 23 adjusts the predetermined ratio to about 5%.

また、楕円体定義部23は、赤目候補領域Pe1における赤度値の標準偏差値と平均値とを取得し、例えば、赤度値の「平均値+標準偏差値×2」以上の値を赤度値として有する画素を定義画素群として検出してもよい。   In addition, the ellipsoidal definition unit 23 acquires the standard deviation value and the average value of the redness value in the red-eye candidate region Pe1, and, for example, sets the redness value “average value + standard deviation value × 2” or more to the red value. You may detect the pixel which has as a degree value as a definition pixel group.

続いて、楕円体定義部23は、定義画素群R−B、R−Gの色の要素値の平均値に基づいて、楕円体の中心点パラメーター(x,y,z)を取得する(S22)。具体的には、楕円体定義部23は、定義画素群R−Bの「R値−B値(X軸)」の平均値をX軸上の中心点「x」とし、定義画素群R−Gの「R値−G値(Y軸)」の平均値をY軸上の中心点「y」とする。また、楕円体定義部23は、定義画素群R−B、R−Gの「G
値(Z軸)」の平均値をZ軸上の中心点「z」とする。
Subsequently, the ellipsoid definition unit 23 acquires the center point parameters (x 0 , y 0 , z 0 ) of the ellipsoid based on the average value of the color element values of the definition pixel groups RB and RG. (S22). Specifically, the ellipsoidal definition unit 23 sets the average value of “R value−B value (X axis)” of the definition pixel group RB as the center point “x 0 ” on the X axis, and defines the definition pixel group R. An average value of “R value−G value (Y axis)” of −G is set as a center point “y 0 ” on the Y axis. In addition, the ellipsoidal definition unit 23 displays “G” of the definition pixel groups RB and RG.
The average value of “value (Z axis)” is defined as a center point “z 0 ” on the Z axis.

このようにして、楕円体定義部23は、赤目画素であると推定される定義画素群R−B、R−Gの色の要素値の平均値を、楕円体の中心点(x,y,z)の対応する要素の値とする。 In this way, the ellipsoidal definition unit 23 calculates the average value of the color element values of the definition pixel groups RB and RG that are estimated to be red-eye pixels as the center point (x 0 , y of the ellipsoid). The value of the corresponding element of 0 , z 0 ).

次に、楕円体定義部23は、定義画素群R−B、R−Gの色の要素値の分散度合い(標準偏差値)に基づいて、楕円体の径パラメーター(X径、Y径、Z径)を取得する(S23)。まず、図12について説明する。   Next, the ellipsoid definition unit 23 determines the ellipsoid diameter parameters (X diameter, Y diameter, Z) based on the dispersion degree (standard deviation value) of the element values of the colors of the definition pixel groups RB and RG. (Diameter) is acquired (S23). First, FIG. 12 will be described.

図12は、3軸空間における直線L1と直線L2とを表す例図である。同図において、ステップ22で取得した中心点(x,y,z)をもつ仮の楕円体70が点線で表されている。同図の直線L1は楕円体70の中心点(x,y,z)101と3軸空間の原点100とを結ぶ線であり、直線L2は楕円体の中心点(x,y,z)101を通りL1と直行する線である。また、画素aは定義座標群R−B、画素bは定義座標群R−Gの画素の一例である。そして、L1aは画素aと直線L1との距離を、L2aは画素aと直線L2との距離を表す。同様にして、L1bは画素bと直線L1との距離を、L2bは画素bと直線L2との距離を表す。 FIG. 12 is an example showing a straight line L1 and a straight line L2 in the triaxial space. In the figure, a temporary ellipsoid 70 having the center point (x 0 , y 0 , z 0 ) acquired in step 22 is represented by a dotted line. The straight line L1 in the figure is a line connecting the center point (x 0 , y 0 , z 0 ) 101 of the ellipsoid 70 and the origin 100 of the triaxial space, and the straight line L2 is the center point (x 0 , y of the ellipsoid). 0 , z 0 ) 101 and a line perpendicular to L1. The pixel a is an example of the definition coordinate group RB, and the pixel b is an example of the definition coordinate group RG. L1a represents the distance between the pixel a and the straight line L1, and L2a represents the distance between the pixel a and the straight line L2. Similarly, L1b represents the distance between the pixel b and the straight line L1, and L2b represents the distance between the pixel b and the straight line L2.

楕円体定義部23は、具体的には、例えば図12の直線L1と、定義画素群R−B、R−G内の画素(例えば、画素a画素b)との距離の値(例えば、L1a、L1b)の標準偏差値に所定係数α(1≦α≦6)を乗じた値をX径とする。同様にして、楕円体定義部23は、図12の直線L2と、定義画素群R−B、R−G内の画素(例えば、画素a画素b)との距離の値(例えば、L2a、L2b)の標準偏差値に所定係数β(1≦β≦6)を乗じた値をY径とする。そして、楕円体定義部23は、定義画素群R−B、R−G内の画素(例えば、画素a画素b)の「G値」の標準偏差値に所定係数γ(1≦γ≦6)を乗じた値をZ径とする。各所定係数の値は、予め調整済みであるものとする。   Specifically, the ellipsoidal definition unit 23, for example, a distance value (for example, L1a) between the straight line L1 in FIG. 12 and the pixels (for example, the pixel a pixel b) in the definition pixel groups RB and RG. , L1b) is multiplied by a predetermined coefficient α (1 ≦ α ≦ 6) and the value obtained by multiplying the standard deviation value of L1b) by the X diameter. Similarly, the ellipsoidal definition unit 23 determines the distance values (for example, L2a and L2b) between the straight line L2 in FIG. 12 and the pixels (for example, the pixel a pixel b) in the definition pixel groups RB and RG. ) Is multiplied by a predetermined coefficient β (1 ≦ β ≦ 6) as the Y diameter. The ellipsoid defining unit 23 then adds a predetermined coefficient γ (1 ≦ γ ≦ 6) to the standard deviation value of the “G value” of the pixels in the definition pixel groups RB and RG (for example, the pixel a pixel b). The value obtained by multiplying is taken as the Z diameter. It is assumed that the value of each predetermined coefficient has been adjusted in advance.

このようにして、楕円体定義部23は、赤目画素であると推定される定義画素群内の画素と楕円体の中心点(x,y,z)を通り直行関係にある各直線L1、L2との距離の標準偏差値(分散度合い)、または、定義画素群の色の要素値の標準偏差値(分散度合い)に基づいて、楕円体の各径を取得する。従って、直線L1、L2と定義画素群内の画素との距離(例えば、L1a、L1b、L2a、L2b)の分散度合いが大きい程、大きい楕円体が定義され、反対に分散度合いが小さい程、小さい楕円体が定義される。定義画素群の「G値」の分散度合いについても同様である。 In this manner, the ellipsoidal definition unit 23, the center point of the pixel and ellipsoid definition pixel group is assumed to be red pixel (x 0, y 0, z 0) the straight line in the street perpendicular relationship Each diameter of the ellipsoid is acquired based on the standard deviation value (dispersion degree) of the distance from L1 and L2 or the standard deviation value (dispersion degree) of the element value of the color of the definition pixel group. Therefore, the larger the degree of dispersion of the distances between the straight lines L1 and L2 and the pixels in the definition pixel group (for example, L1a, L1b, L2a, and L2b), the larger ellipsoid is defined. An ellipsoid is defined. The same applies to the degree of dispersion of the “G value” of the definition pixel group.

続いて、楕円体定義部23は、楕円体の回転角度パラメーター(θx、θy、θz)を取得する(S24)。楕円体定義部23は、楕円体のZ軸の回転角度θzを、例えば、定義画素群R−Bの「R値−B値」の平均値と、定義画素群R−Gの「R値−G値」の平均値との比率に基づいて算出する。具体的には、本実施の形態例における楕円体定義部23は、Arctan(定義画素群R−Gの「R値−G値」の平均値/定義画素群R−Bの「R値−B値」の平均値)によってθzを算出する。R値−B値(X軸)R値−G値(Y軸)平面において、算出したθzに基づいて楕円体がZ軸方向に回転されることにより、定義画素群の分布をより高精度に包括する楕円体が定義される。   Subsequently, the ellipsoidal definition unit 23 acquires the rotation angle parameters (θx, θy, θz) of the ellipsoid (S24). The ellipsoidal definition unit 23 determines the Z axis rotation angle θz of the ellipsoid, for example, an average value of “R value−B value” of the definition pixel group RB and “R value−” of the definition pixel group RG. Calculation is based on the ratio of the “G value” to the average value. Specifically, the ellipsoidal definition unit 23 in the present embodiment is Arctan (an average value of “R value−G value” of the definition pixel group RG / “R value−B of the definition pixel group RB”). Θz is calculated from the average value of “value”. In the R value-B value (X axis) R value-G value (Y axis) plane, the ellipsoid is rotated in the Z-axis direction based on the calculated θz, so that the distribution of the definition pixel group is made more accurate. An inclusive ellipsoid is defined.

そして、楕円体定義部23は、X軸の回転角度θx、Y軸の回転角度θyを、例えば、次のように求める。楕円体定義部23は、図7の「R値−G値(Y軸)」「G値(Z軸)」平面における、定義画素群R−Gの画素の近似直線とY軸との相対角度をθxとして取得する。同様にして、図6の「R値−B値(X軸)」「G値(Z軸)」平面における、定義画素群R−Bの画素の近似直線とX軸との相対角度をθyとして取得する。   Then, the ellipsoid definition unit 23 obtains the X-axis rotation angle θx and the Y-axis rotation angle θy as follows, for example. The ellipsoidal definition unit 23 calculates the relative angle between the approximate straight line of the pixels of the definition pixel group RG and the Y axis in the “R value−G value (Y axis)” and “G value (Z axis)” planes of FIG. 7. Is obtained as θx. Similarly, the relative angle between the approximate straight line of the pixels of the definition pixel group RB and the X axis in the “R value−B value (X axis)” and “G value (Z axis)” planes of FIG. get.

ただし、本実施の形態例において、図7の「R値−G値(Y軸)」「G値(Z軸)」平面における定義画素群R−Gの近似直線とY軸、及び、図6の「R値−B値(X軸)」「G値(Z軸)」平面における定義画素群R−Bの近似直線とX軸はほぼ平行関係にある。従って、本実施の形態例における回転角度θx、回転角度θyは0°となる。   However, in the present embodiment, the approximate straight line and the Y axis of the definition pixel group RG in the “R value−G value (Y axis)” and “G value (Z axis)” planes of FIG. The approximate straight line of the definition pixel group RB and the X axis in the “R value−B value (X axis)” and “G value (Z axis)” planes of FIG. Accordingly, the rotation angle θx and the rotation angle θy in this embodiment are 0 °.

このようにして、楕円体定義部23は、赤目画素であると推定される定義画素群R−B、R−Gの色の要素値の平均値の比率、及び、各平面における定義画素群R−B、R−G内の画素の近似直線と対応する軸との相対角度に基づいて楕円体の回転角度パラメーターを取得する。   In this way, the ellipsoidal definition unit 23 determines the ratio of the average values of the element values of the definition pixel groups RB and RG estimated to be red-eye pixels, and the definition pixel group R in each plane. The rotation angle parameter of the ellipsoid is acquired based on the relative angle between the approximate line of the pixels in -B and RG and the corresponding axis.

なお、上述したように、本実施の形態例のθx、θyは0°である。このように、3軸のうち回転しない軸があることにより、楕円体定義部23は、後述する赤目画素特定処理Z2における計算処理の負荷を抑えることができる。これにより、楕円体定義部23は、より効率的に赤目画素を特定することができる。   As described above, θx and θy in this embodiment are 0 °. As described above, since there is an axis that does not rotate among the three axes, the ellipsoidal definition unit 23 can reduce the load of the calculation process in the red-eye pixel specifying process Z2 described later. Thereby, the ellipsoidal definition part 23 can specify a red-eye pixel more efficiently.

また、楕円体定義部23は、例えば、本実施の形態例のように、3軸空間の各軸に対応する要素のうち、2つの要素を赤度値や赤値等の色味の要素とし(例えば、X軸、Y軸)、1つの要素を明度や輝度を表す要素とすることによって(例えば、Z軸)、画像処理装置は、色味の要素の2軸(X軸、Y軸)の回転角度を0°にすることができる。これにより、回転角度θx、θyの取得処理を省略できると共に、前述した赤目画素特定処理Z2における計算処理の負荷を抑えることができる。   In addition, the ellipsoidal definition unit 23 uses two elements among elements corresponding to the respective axes of the triaxial space as color elements such as a redness value and a red value, as in the present embodiment. (For example, X-axis, Y-axis) By using one element as an element representing brightness or luminance (for example, Z-axis), the image processing apparatus has two axes of color elements (X-axis, Y-axis). Can be set to 0 °. Thereby, the acquisition processing of the rotation angles θx and θy can be omitted, and the load of calculation processing in the above-described red-eye pixel specifying processing Z2 can be suppressed.

図13は、楕円体パラメーターの一例とその楕円体を表す図である。楕円体定義部23は、取得した楕円体パラメーターに基づいて、図12のような楕円体を定義する。図12の楕円体は、中心点101を(x,y,z)=(110,120,0)とし、X径102を「100」、Y径103を「30」、Z径104を「50」とする楕円体である。また、楕円体の回転角度θx、θyは「0°」であり、θz105は「45°」である。なお、同図の楕円体は各径の長さが異なっているが、楕円体は3径のうち2つの径が等しい回転楕円体や、全ての径が等しい球体であってもよい。 FIG. 13 is a diagram illustrating an example of an ellipsoid parameter and the ellipsoid. The ellipsoid definition unit 23 defines an ellipsoid as shown in FIG. 12 based on the acquired ellipsoid parameters. In the ellipsoid of FIG. 12, the center point 101 is (x 0 , y 0 , z 0 ) = (110, 120, 0 ), the X diameter 102 is “100”, the Y diameter 103 is “30”, and the Z diameter 104 Is an ellipsoid with "50". Further, the rotation angles θx and θy of the ellipsoid are “0 °”, and θz105 is “45 °”. In addition, although the length of each diameter differs in the ellipsoid of the figure, the ellipsoid may be a spheroid having two equal diameters among three diameters or a sphere having all equal diameters.

以上のようにして、本実施の形態例のおける楕円体定義部23は、赤目候補領域Pe1内の赤目画素であると推定される定義画素群の色の要素値に基づいて、楕円体パラメーターを取得し3軸空間上に楕円体を定義する。これにより、楕円体定義部23は、赤目候補領域Pe1内の定義画素群の色の特徴に基づいて、当該赤目候補領域Pe1内の赤目画素と非赤目画素とを分離する3軸空間上の楕円体を定義することができる。   As described above, the ellipsoidal definition unit 23 according to the present embodiment determines the ellipsoidal parameter based on the element value of the color of the definition pixel group that is estimated to be the redeye pixel in the redeye candidate area Pe1. Acquire and define an ellipsoid in the 3-axis space. As a result, the ellipsoidal definition unit 23 separates the red-eye pixels and the non-red-eye pixels in the red-eye candidate region Pe1 based on the color characteristics of the definition pixel group in the red-eye candidate region Pe1. A body can be defined.

また、本実施の形態例における楕円体定義部23は、ステップS21において、3軸空間における赤度値「R値−B値」「R値−G値」が赤目候補領域Pe1の上位10%以内である画素をそれぞれ定義画素群として検出している。しかし、楕円体定義部23は、3軸空間の要素の赤度値(「R値−B値」「R値−G値」)とは別の赤度値(例えば、「R×R−(B+G)」)が赤目候補領域Pe1の上位所定割合である画素群を定義画素群(以下、定義画素群R×R−(B+G)と称する)として検出してもよい。   In addition, in step S21, the ellipsoid defining unit 23 in the present embodiment has the redness values “R value−B value” and “R value−G value” in the upper 10% of the red eye candidate region Pe1 in the triaxial space. Are detected as a definition pixel group. However, the ellipsoidal definition unit 23 has a redness value different from the redness value (“R value−B value” “R value−G value”) of the element in the triaxial space (for example, “R × R− ( B + G) ”) may be detected as a definition pixel group (hereinafter referred to as a definition pixel group R × R− (B + G)), which is the upper predetermined ratio of the red-eye candidate region Pe1.

その場合、楕円体定義部23は、定義画素群R×R−(B+G)の各軸に対応する要素値(「R値−B値」「R値−G値」「G値」)の平均値を楕円体の中心点(x,y,z)とし(S22)、定義画素群R×R−(B+G)内の画素と直線L1、L2の距離の標準偏差値、及び、「G値」の標準偏差値に基づいて楕円体の各径を取得する(S23)。そして、楕円体定義部23は、定義画素群R×R−(B+G)の「R値−B値」「R値−G値」の平均値の比率、または、各平面における定義画素群R×R−(B+G)の近
似直線と対応する軸の相対角度に基づいて回転角度を取得する(S24)。
In that case, the ellipsoidal definition unit 23 averages the element values (“R value−B value”, “R value−G value”, “G value”) corresponding to each axis of the definition pixel group R × R− (B + G). The value is the center point (x 0 , y 0 , z 0 ) of the ellipsoid (S22), the standard deviation value of the distance between the pixels in the definition pixel group R × R− (B + G) and the straight lines L1, L2, and “ Each diameter of the ellipsoid is acquired based on the standard deviation value of “G value” (S23). Then, the ellipsoidal definition unit 23 determines the ratio of the average values of “R value−B value” and “R value−G value” of the definition pixel group R × R− (B + G), or the definition pixel group R × in each plane. A rotation angle is acquired based on the relative angle of the axis corresponding to the approximate straight line of R− (B + G) (S24).

また、楕円体定義部23は、多数の赤目候補領域Pe1に基づいて、デフォルトの楕円体を定義する楕円体パラメーターを用意しておき、変更が必要なパラメーターのみを各赤目候補領域Pe1の色の要素値に基づいて取得してもよい。これにより、楕円体定義部23は、変更不要なパラメーターについてはその取得処理を省略することができ、より効率的に赤目画素を特定することができる。   The ellipsoid defining unit 23 prepares ellipsoid parameters for defining a default ellipsoid based on a large number of red eye candidate areas Pe1, and sets only the parameters that need to be changed to the color of each red eye candidate area Pe1. You may acquire based on an element value. Thereby, the ellipsoidal definition part 23 can omit the acquisition process for parameters that do not need to be changed, and can more efficiently identify the red-eye pixel.

図12における楕円体の中心点101(x,y,z)=(110,120,0)のZ軸の値は「0」であり、例えば、デフォルトの楕円体における中心点のZ軸の値も「0」であるものとする。このように、楕円体パラメーターの一部が変更不要となるようにデフォルトの楕円体パラメーター、及び、軸の要素を設定することによって、楕円体定義部23は、楕円体パラメーターの変更処理を一部省略することができ、効率的に楕円体を定義することができる。 The value of the center point 101 (x 0 , y 0 , z 0 ) = (110, 120, 0 ) of the ellipsoid in FIG. 12 is “0”. It is assumed that the value of the axis is also “0”. In this way, by setting the default ellipsoid parameters and the elements of the axes so that some of the ellipsoid parameters do not need to be changed, the ellipsoid definition unit 23 performs part of the ellipsoid parameter change processing. It can be omitted and an ellipsoid can be defined efficiently.

[赤目画素特定処理Z2:赤目画素特定処理の説明]
楕円体定義後(図9のS12)、赤目画素特定部24は、続いて、図9のステップS13において赤目画素特定処理Z2を実行する。
[Red-eye pixel specifying process Z2: Description of red-eye pixel specifying process]
After defining the ellipsoid (S12 in FIG. 9), the red-eye pixel specifying unit 24 subsequently executes a red-eye pixel specifying process Z2 in step S13 in FIG.

本実施の形態例における赤目画素特定部24は、赤目画素の特定結果を示す情報として補正係数マップMaを生成する。補正係数マップMaは、赤目候補領域Pe1の各画素に対応する格納部を有する。格納部を画素と仮定すると、補正係数マップMaは、少なくとも赤目候補領域Pe1と同じ画素サイズを有している。本実施の形態例における赤目画素特定部24は、赤目補正の対象画素については「補正係数>0」を、赤目補正の対象外の画素については「補正係数=0」を、対応する補正係数マップMaの各格納部(すなわち各画素)に格納する。   The red-eye pixel specifying unit 24 in the present embodiment generates a correction coefficient map Ma as information indicating a red-eye pixel specifying result. The correction coefficient map Ma has a storage unit corresponding to each pixel of the red-eye candidate region Pe1. Assuming that the storage unit is a pixel, the correction coefficient map Ma has at least the same pixel size as the red-eye candidate region Pe1. In the present embodiment, the red-eye pixel specifying unit 24 sets “correction coefficient> 0” for a target pixel for red-eye correction, “correction coefficient = 0” for a pixel that is not a target for red-eye correction, and a corresponding correction coefficient map. The data is stored in each storage unit (that is, each pixel) of Ma.

図14は、赤目画素特定処理Z2の流れを示すフローチャート図である。まず、赤目画素特定部24は、赤目候補領域Pe1から注目する1つの画素(以下、注目画素と称する)を選択し(S31)、注目画素の補正係数を取得して補正係数マップMaに格納する(S32)。具体的には、本実施の形態例における赤目画素特定部24は、次の数式(1)に注目画素の座標(x,y,z)を代入して、当該画素が楕円体の内側に位置するか否かを判定する。   FIG. 14 is a flowchart showing the flow of the red-eye pixel specifying process Z2. First, the red-eye pixel specifying unit 24 selects one pixel of interest (hereinafter referred to as a pixel of interest) from the red-eye candidate region Pe1 (S31), acquires a correction coefficient of the pixel of interest, and stores it in the correction coefficient map Ma. (S32). Specifically, the red-eye pixel specifying unit 24 in the present embodiment substitutes the coordinates (x, y, z) of the target pixel in the following formula (1), and the pixel is positioned inside the ellipsoid. It is determined whether or not to do.

上記の式(1)において、(x,y,z)は楕円体の中心点を、aは楕円体のX
径、bは楕円体のY径、cは楕円体のZ径を、θx、θy、θzは各軸に対応する回転角度を表す。上記の式(1)に対して、注目画素の座標(x,y,z)を代入すると、楕円体の中心点からの距離「E値」が得られる。注目画素のE値が「E値=1」の場合、3軸空間において注目画素が楕円体の境界上に位置することを意味する。また、注目画素のE値が「E値<1」である場合、楕円体の内部に位置することを表し、「E値>1」である場合、楕円体の外側に位置することを表す。
In the above formula (1), (x 0 , y 0 , z 0 ) is the center point of the ellipsoid, and a is the X of the ellipsoid.
The diameter, b is the Y diameter of the ellipsoid, c is the Z diameter of the ellipsoid, and θx, θy, and θz represent the rotation angles corresponding to the respective axes. If the coordinates (x, y, z) of the target pixel are substituted into the above equation (1), the distance “E value” from the center point of the ellipsoid is obtained. When the E value of the target pixel is “E value = 1”, it means that the target pixel is located on the boundary of the ellipsoid in the three-axis space. Further, when the E value of the target pixel is “E value <1”, it indicates that it is located inside the ellipsoid, and when “E value> 1”, it indicates that it is located outside the ellipsoid.

式(1)は、その計算量が多く処理の負荷が高い。そのため、3つの回転角度のうちが0°の回転角度があることにより、計算処理の負荷を抑えることができる。従って、本実施の形態例においてθxとθyが0°であることにより、赤目画素特定部24は、処理の負荷を抑えより効率的に赤目画素を特定することができる。続いて、赤目画素特定部24は、E値に基づいて補正係数を取得する。   Formula (1) has a large calculation amount and a high processing load. Therefore, the calculation processing load can be suppressed by having a rotation angle of 0 ° among the three rotation angles. Therefore, when θx and θy are 0 ° in the present embodiment, the red-eye pixel specifying unit 24 can specify the red-eye pixel more efficiently while suppressing the processing load. Subsequently, the red-eye pixel specifying unit 24 acquires a correction coefficient based on the E value.

図15は、式(1)の出力値「E値」と補正係数との関係を表した図である。同図において、横軸は入力値「E値」を、縦軸は補正係数を表している。赤目画素特定部24は、破線151に基づいて、「E値≦1」である画素については補正係数「1」を、「E値>1」である画素については補正係数「0」を割り当てる。   FIG. 15 is a diagram illustrating the relationship between the output value “E value” of Expression (1) and the correction coefficient. In the figure, the horizontal axis represents the input value “E value” and the vertical axis represents the correction coefficient. Based on the broken line 151, the red-eye pixel specifying unit 24 assigns a correction coefficient “1” for pixels with “E value ≦ 1” and a correction coefficient “0” for pixels with “E value> 1”.

ところで、赤目画素特定部24は、楕円体の境界面から所定の距離範囲内に位置する画素、即ち、楕円体の境界付近に位置する画素の補正係数をその距離に応じて調整してもよい。例えば、画素が楕円体の内側に位置していても(「E値≦1」)、楕円体の境界面から所定距離範囲内に位置する場合、当該画素は赤目画素ではない可能性を有する。また、画素が楕円体の外側に位置していても(「E値>1」)、楕円体の境界面から所定距離範囲内に位置する場合、当該画素は赤目画素である可能性を有する。そこで、赤目画素特定部24は、楕円体の境界面からの距離が所定範囲内である画素の補正係数をその距離に応じて調整する。   By the way, the red-eye pixel specifying unit 24 may adjust the correction coefficient of a pixel located within a predetermined distance range from the boundary surface of the ellipsoid, that is, a pixel located near the boundary of the ellipsoid according to the distance. . For example, even if the pixel is located inside the ellipsoid (“E value ≦ 1”), if the pixel is located within a predetermined distance range from the boundary surface of the ellipsoid, the pixel may not be a red-eye pixel. Even if the pixel is located outside the ellipsoid (“E value> 1”), if the pixel is located within a predetermined distance range from the boundary surface of the ellipsoid, the pixel may be a red-eye pixel. Therefore, the red-eye pixel specifying unit 24 adjusts a correction coefficient of a pixel whose distance from the boundary surface of the ellipsoid is within a predetermined range according to the distance.

具体的に、赤目画素特定部24は、数式(1)によって算出された「E値」を、例えば、下記の数式(2)に代入して補正係数「S値」を取得する。下記の式(2)において、「E」は式(1)によって得られた値であり、「e」は自然対数の底の値を示す。「a(ゲイン)」については、下記に後述する。なお、楕円体付近に位置する画素の補正係数の変更方法は、式(2)の方法に限定されるものではない。   Specifically, the red-eye pixel specifying unit 24 acquires the correction coefficient “S value” by substituting the “E value” calculated by Expression (1) into, for example, Expression (2) below. In the following formula (2), “E” is a value obtained by the formula (1), and “e” indicates a base value of the natural logarithm. “A (gain)” will be described later. Note that the method of changing the correction coefficient of the pixel located near the ellipsoid is not limited to the method of Expression (2).

図15の曲線152は、式(2)に基づいた入力値「E値」と出力値である補正係数「S値」の対応関係を表す。同図において、横軸は入力値「E値」を、縦軸は出力値である補正係数「S値」を表す。式(2)の「a(ゲイン)」は、同図の「E値=1」(画素が楕円体の境界面上に位置する)の場合の曲線151の傾き度合いを表す。本実施の形態例における赤目画素特定部24は、aの値を「20」とする。   A curve 152 in FIG. 15 represents a correspondence relationship between the input value “E value” and the correction coefficient “S value” that is an output value based on Expression (2). In the figure, the horizontal axis represents the input value “E value” and the vertical axis represents the correction coefficient “S value” which is the output value. “A (gain)” in Expression (2) represents the degree of inclination of the curve 151 in the case of “E value = 1” (pixels are located on the boundary surface of the ellipsoid) in FIG. The red-eye pixel specifying unit 24 in the present embodiment sets the value of a to “20”.

式(2)によると、楕円体の内側に位置し、楕円体の境界面との距離が所定範囲内である画素(約0.8≦E値<1)については、補正係数「0.5<S値<1」が割り当てられる。一方、楕円体の外側に位置し、楕円体の境界面との距離が所定範囲内である画素(1<E値≦約1.2)については、補正係数「0<S値<0.5」が割り当てられる。   According to Equation (2), for a pixel (about 0.8 ≦ E value <1) that is located inside the ellipsoid and whose distance from the boundary surface of the ellipsoid is within a predetermined range, the correction coefficient “0.5 <S value <1 "is assigned. On the other hand, the correction coefficient “0 <S value <0.5” is set for a pixel (1 <E value ≦ about 1.2) that is located outside the ellipsoid and whose distance from the boundary surface of the ellipsoid is within a predetermined range. Is assigned.

このようにして、赤目画素特定部24は、楕円体の境界面からの距離が所定範囲内であって楕円体の内側に位置する画素については、その距離が短くなるに連れて「1」から逓減させた補正係数を割り当てる。一方、赤目画素特定部24は、楕円体の境界面からの距離が所定範囲内であって楕円体の外側に位置する画素については、その距離が短くなるに連れて「0」から逓増させた補正係数を割り当てる。   In this way, the red-eye pixel specifying unit 24 starts from “1” as the distance of the pixel located within the ellipsoid within the predetermined range and the distance from the boundary surface of the ellipsoid decreases. Assign a decreasing correction factor. On the other hand, the red-eye pixel specifying unit 24 increases the pixel from the boundary of the ellipsoid from “0” as the distance becomes shorter with respect to a pixel located outside the ellipsoid within a predetermined range. Assign a correction factor.

これにより、楕円体の外側に位置していても赤目画素の可能性がある画素は、補正の度合いは小さいものの補正対象とされ、楕円体の内側に位置していても非赤目画素の可能性がある画素は、その補正の度合いが小さく抑えられる。   As a result, pixels that may be red-eye pixels even if they are located outside the ellipsoid are subject to correction, although the degree of correction is small, and may be non-red-eye pixels even if they are located inside the ellipsoid A certain pixel has a small degree of correction.

図16は、赤目候補領域Pe1における補正係数を表す例図である。同図の161は楕円体の境界面付近に位置する画素の補正係数を調整しない場合(図15の151)における補正係数を、162は楕円体の境界面付近に位置する画素の補正係数の調整する場合(図15の152)における補正係数を表す例図である。同図において、黒塗りの部分は「補正係数=1」である画素を、白い部分は「補正係数=0」である画素を表す。また、斜線の部分は「0<補正係数<1」である画素を表す。   FIG. 16 is an example showing a correction coefficient in the red-eye candidate region Pe1. 161 in the figure is the correction coefficient when the correction coefficient of the pixel located near the boundary surface of the ellipsoid is not adjusted (151 in FIG. 15), and 162 is the adjustment of the correction coefficient of the pixel located near the boundary surface of the ellipsoid. It is an example figure showing the correction coefficient in the case of doing (152 of Drawing 15). In the drawing, a black portion represents a pixel having “correction coefficient = 1”, and a white portion represents a pixel having “correction coefficient = 0”. The shaded portion represents a pixel where “0 <correction coefficient <1”.

図16の162は補正対象の画素と非補正対象の画素に分離することなく、補正係数が緩やかに変移している。これにより、本実施の形態例における画像処理装置は、楕円体の境界面付近に位置する画素を多く含む赤目候補領域Pe1が、赤目の補正処理によって、補正対象の画素と非補正対象の画素との相違が顕著に表れる不自然な画像に変換されることを防ぐことができる。また、同様に、赤目候補領域Pe1内の瞳孔や虹彩でなくても赤目現象の影響を受けている画素についても、ある程度の赤目補正が行われることになる。   In FIG. 16, the correction coefficient gradually changes without being separated into a correction target pixel and a non-correction target pixel. As a result, the image processing apparatus according to the present embodiment allows the red-eye candidate region Pe1 including many pixels located near the boundary surface of the ellipsoid to be corrected and non-corrected by the red-eye correction process. It is possible to prevent the image from being converted into an unnatural image in which the difference is noticeable. Similarly, a certain amount of red-eye correction is performed on a pixel that is not affected by the red-eye phenomenon even if it is not the pupil or iris in the red-eye candidate region Pe1.

ところで、赤目画素特定部24は、補正係数を調整する対象の楕円体の境界面からの距離範囲を、例えば楕円体の径の長さ等に基づいて変更してもよい。例えば、赤目画素特定部24は、楕円体の径が所定値より短い場合は、楕円体は小さく赤目画素の分布が集中しているとみなし距離範囲を縮小し、反対に楕円体の径が所定値より長い場合は、楕円体は大きく赤目画素の分布の分散度合いも大きいとみなし距離範囲を拡張する。   Incidentally, the red-eye pixel specifying unit 24 may change the distance range from the boundary surface of the ellipsoid whose adjustment coefficient is to be adjusted based on, for example, the length of the diameter of the ellipsoid. For example, when the diameter of the ellipsoid is shorter than a predetermined value, the red-eye pixel specifying unit 24 considers that the ellipsoid is small and the distribution of red-eye pixels is concentrated, and conversely reduces the distance range. When the value is longer than the value, the ellipsoid is considered to be large and the degree of dispersion of the distribution of red-eye pixels is regarded as large, and the distance range is expanded.

具体的には、赤目画素特定部24は、距離範囲を縮小する場合、例えば、式(2)の「a」の値を「20」から「30」に変更することによって曲線(図15の152)の傾きを急にする。一方、赤目画素特定部24は、距離範囲を拡張する場合、例えば、式(2)の「a」の値を「20」から「10」に変更することによって曲線(図15の152)の傾きを緩やかにする。図15の点線の曲線153は、「a」の値が「10」である場合の曲線を表す。同図の曲線153は、曲線152(a=20)に比べてその傾きを緩やかであり、補正係数が「0<S値<1」であるのE値の範囲が広い。   Specifically, when reducing the distance range, the red-eye pixel specifying unit 24 changes the value of “a” in Expression (2) from “20” to “30”, for example, by changing the curve (152 in FIG. 15). ) Make the slope of steep. On the other hand, when expanding the distance range, the red-eye pixel specifying unit 24 changes the slope of the curve (152 in FIG. 15) by changing the value of “a” in Expression (2) from “20” to “10”, for example. To loosen. A dotted curve 153 in FIG. 15 represents a curve when the value of “a” is “10”. The curve 153 in the figure has a gentler slope than the curve 152 (a = 20), and has a wide E value range where the correction coefficient is “0 <S value <1”.

赤目画素特定部24は補正係数を取得すると、注目画素に対応する補正係数マップMaの格納部に格納する。続いて、赤目画素特定部24は、赤目候補領域Pe1内のすべての画素を注目画素として選択したか否かを判定する(S33)。まだ注目画素として選択されていない画素が存在する場合(S33のNO)、赤目画素特定部24は、ステップS31に戻り、他の画素を注目画素として選択し、ステップS32以降の処理を同様に実行する。   When the red-eye pixel specifying unit 24 acquires the correction coefficient, the red-eye pixel specifying unit 24 stores the correction coefficient in the storage unit of the correction coefficient map Ma corresponding to the target pixel. Subsequently, the red-eye pixel specifying unit 24 determines whether or not all the pixels in the red-eye candidate region Pe1 have been selected as the target pixel (S33). If there is a pixel that has not yet been selected as the target pixel (NO in S33), the red-eye pixel specifying unit 24 returns to step S31, selects another pixel as the target pixel, and similarly executes the processing from step S32 onward. To do.

そして、赤目候補領域Pe1内のすべての画素が注目画素として選択されると(S33のYES)、補正係数マップMaが生成される。本実施の形態例における補正係数マップMaには、補正対象の画素については「0<S値≦1」の補正係数が、非補正対象の画素については「0」の補正係数が格納される。   When all the pixels in the red-eye candidate region Pe1 are selected as the target pixel (YES in S33), the correction coefficient map Ma is generated. In the correction coefficient map Ma in the present embodiment, a correction coefficient “0 <S value ≦ 1” is stored for the correction target pixel, and a correction coefficient “0” is stored for the non-correction target pixel.

以上のようにして、赤目画素特定部24は、分離曲線に基づいて赤目候補領域Pe1の各画素に対応する補正係数マップMaを生成する(図9のS13)。   As described above, the red-eye pixel specifying unit 24 generates the correction coefficient map Ma corresponding to each pixel of the red-eye candidate region Pe1 based on the separation curve (S13 in FIG. 9).

[補正処理Z3の説明]
続いて、補正部25は、図9のステップS14において、補正係数マップMaに基づいて補正処理Z3を実行する。
[Description of Correction Process Z3]
Subsequently, the correction unit 25 executes the correction process Z3 based on the correction coefficient map Ma in step S14 of FIG.

図17は、補正処理Z3の流れを示すフローチャート図である。まず、補正部25は、赤目候補領域Pe1から注目する画素を選択し(S41)、補正係数マップMaから、注目画素に相当する格納部に格納されている補正係数を読み取る(S42)。   FIG. 17 is a flowchart showing the flow of the correction process Z3. First, the correction unit 25 selects a pixel of interest from the red-eye candidate region Pe1 (S41), and reads a correction coefficient stored in the storage unit corresponding to the pixel of interest from the correction coefficient map Ma (S42).

続いて、補正部25は、読み取った補正係数に応じて、注目画素の色の彩度を抑える赤目補正処理を行う(S43)。具体的には、注目画素の補正係数が例えば「0.5」である場合、補正部25は、補正係数が「1」である場合の彩度の変更量の半分の度合いで、当該画素の彩度を抑える補正を行う。   Subsequently, the correction unit 25 performs a red-eye correction process for suppressing the saturation of the color of the target pixel according to the read correction coefficient (S43). Specifically, when the correction coefficient of the pixel of interest is “0.5”, for example, the correction unit 25 has a degree of half of the amount of change in saturation when the correction coefficient is “1”. Make corrections to reduce saturation.

そして、補正部25は、赤目候補領域Pe1内のすべての画素を注目画素として選択したか否かを判定する(S44)。まだ、注目画素として選択されていない画素が存在する場合(S44のNO)、ステップS41に戻り、補正部25は、他の画素を注目画素として選択し、ステップS42以降の処理を同様に実行する。一方、赤目候補領域Pe1内のすべての画素を選択した場合(S44のYES)、補正部25は補正処理を終了する。   Then, the correction unit 25 determines whether or not all the pixels in the red-eye candidate region Pe1 have been selected as the target pixel (S44). If there is still a pixel that has not been selected as the target pixel (NO in S44), the process returns to step S41, and the correction unit 25 selects another pixel as the target pixel, and similarly executes the processing from step S42 onward. . On the other hand, when all the pixels in the red-eye candidate area Pe1 are selected (YES in S44), the correction unit 25 ends the correction process.

以上のようにして、本実施の形態例における画像処理装置は、赤目候補領域内の画素群の色の要素値に基づいて、赤目画素と非赤目画素とを分離する3軸空間における楕円体を定義し、赤目候補領域内の各画素について、画素が楕円体の内側に位置する場合に赤目画素として特定する。本実施の形態例における画像処理装置は、印刷処理対象画像TIにおけるすべての赤目候補領域Pe1に対して、上記の自動赤目補正処理(図9のS11〜S14)を行う。   As described above, the image processing apparatus according to the present exemplary embodiment uses the ellipsoid in the three-axis space that separates the red-eye pixel and the non-red-eye pixel based on the color element value of the pixel group in the red-eye candidate region. Define and identify each pixel in the red-eye candidate region as a red-eye pixel when the pixel is located inside the ellipsoid. The image processing apparatus according to the present embodiment performs the automatic red-eye correction process (S11 to S14 in FIG. 9) on all red-eye candidate areas Pe1 in the print processing target image TI.

このようにして3軸空間において赤目画素と非赤目画素との分布を分離する楕円体を定義することによって、画像処理装置は、2軸平面の楕円形に基づいて赤目画素と非赤目画素とを分離する場合に比べ、より多面的に赤目画素の分布を定義することができる。従って、画像処理装置は、より高精度に赤目画素を特定することができる。   In this way, by defining an ellipsoid that separates the distribution of red-eye pixels and non-red-eye pixels in the three-axis space, the image processing apparatus determines red-eye pixels and non-red-eye pixels based on an ellipse on a biaxial plane. Compared to the case of separation, the distribution of red-eye pixels can be defined in a multifaceted manner. Therefore, the image processing apparatus can specify the red-eye pixel with higher accuracy.

また、本実施の形態例における画像処理装置は、赤目候補領域Pe1内の色の要素値に基づいて楕円体を定義するため、赤目候補領域Pe1内の色の特徴に基づいた楕円体の位置と形状を定義することができ、高精度に赤目画素を特定することができる。   In addition, since the image processing apparatus in the present embodiment defines an ellipsoid based on the color element values in the red-eye candidate area Pe1, the position of the ellipsoid based on the color features in the red-eye candidate area Pe1 and The shape can be defined, and the red-eye pixel can be specified with high accuracy.

さらに、本実施の形態例における画像処理装置は、赤目候補領域Pe1内の画素であって赤度値が上位割合である定義画素群の色の要素値に基づいて楕円体を定義する。これにより、画像処理装置は、赤目候補領域Pe1における赤目画素であると推定される画素群の色の特徴に基づいて楕円体を定義するため、さらに高精度に赤目画素を特定することができる。   Furthermore, the image processing apparatus according to the present embodiment defines an ellipsoid based on the element value of the color of the definition pixel group which is a pixel in the red-eye candidate region Pe1 and whose redness value is a higher ratio. As a result, the image processing apparatus defines the ellipsoid based on the color characteristics of the pixel group estimated to be the red-eye pixel in the red-eye candidate region Pe1, and thus can identify the red-eye pixel with higher accuracy.

なお、本実施の形態例の画像処理装置は、3軸空間の各要素値を「R値−B値」「R値−G値」「G値」としているが、この例に限定されるものではない。画像処理装置は、3軸空間の要素値に、例えば、以下のような値を割り当ててもよい。   In the image processing apparatus according to the present embodiment, the element values in the three-axis space are “R value−B value”, “R value−G value”, and “G value”, but the present invention is not limited to this example. is not. For example, the image processing apparatus may assign the following values to the element values in the three-axis space.

画像処理装置は、例えば、本実施の形態例における3軸の要素「R値−B値」「R値−G値」「G値」のうち、「G値」を他の要素値に変更してもよい。例えば、画像処理装置
は、明度を表す「G値」の代わりに、YCbCr色空間の輝度を表す「Y値」、または、L*a*b色空間の明度を表す「L値」を用いる。
For example, the image processing apparatus changes “G value” to another element value among the three-axis elements “R value−B value”, “R value−G value”, and “G value” in the present embodiment. May be. For example, the image processing apparatus uses “Y value” representing the luminance in the YCbCr color space or “L value” representing the lightness in the L * a * b color space instead of the “G value” representing the lightness.

この場合、画像処理装置は、本実施の形態例と同様に、赤度値が高い特性を有する赤目画素を算出方法の異なる2種の赤度値(「R値−B値」「R値−G値」)によって分離し、さらに、一定範囲の明度または輝度を有する赤目画素を「Y値」または「L値」によって分離する。これにより、画像処理装置は、上記の3軸空間においても赤目画素を分離する楕円体を定義することができる。   In this case, as in the present embodiment, the image processing apparatus uses two redness values (“R value-B value”, “R value— G-value ") and red-eye pixels having a certain range of brightness or luminance are separated by" Y value "or" L value ". Accordingly, the image processing apparatus can define an ellipsoid that separates red-eye pixels even in the above-described three-axis space.

また、画像処理装置は、「G値」の代わりにRGB色空間の「R値」(赤値)を用いてもよい。この場合、画像処理装置は、赤度値が高い特性を有する赤目画素を算出方法の異なる2種の赤度値(「R値−B値」「R値−G値」)によって分離し、さらに、一定範囲の赤値を有する赤目画素を「R値」によって分離する。これにより、画像処理装置は、同様にして、「G値」の代わりに赤値を表す「R値」を用いた3軸空間においても赤目画素を分離する楕円体を定義することができる。   The image processing apparatus may use an “R value” (red value) in the RGB color space instead of the “G value”. In this case, the image processing apparatus separates the red-eye pixel having a characteristic with a high redness value by two types of redness values (“R value−B value” and “R value−G value”) having different calculation methods, and further The red-eye pixels having a certain range of red values are separated by “R value”. Accordingly, the image processing apparatus can similarly define an ellipsoid that separates red-eye pixels in a three-axis space that uses an “R value” representing a red value instead of a “G value”.

また、画像処理装置は、赤度値「R値−B値」「R値−G値」の代わりに、例えば、「R値/G値」「R値/B値」、「G値/R値」「B値/R値」等の別の赤度値を用いてもよい。ただし、赤度値として「R値/G値」「R値/B値」を用いる場合、赤目画素はG値、B値に対してR値が大きいことにより赤度値の値範囲が広くなり過ぎてしまい楕円体が大きくなってしまう。その場合、画像処理装置は、赤度値として「G値/R値」「B値/R値」を用いることにより赤目画素の赤度値の値範囲を一定範囲内に収め、赤目画素を内包する楕円体を定義することができる。   Further, the image processing apparatus, for example, “R value / G value”, “R value / B value”, “G value / R value” instead of the redness values “R value−B value” and “R value−G value”. Another redness value such as “value” “B value / R value” may be used. However, when “R value / G value” or “R value / B value” is used as the redness value, the red eye pixel has a larger R value than the G value and the B value, so the range of the redness value is widened. It will pass and the ellipsoid will become larger. In this case, the image processing apparatus uses the “G value / R value” and the “B value / R value” as the redness value, so that the range of the redness value of the redeye pixel falls within a certain range, and the redeye pixel is included. An ellipsoid can be defined.

また、画像処理装置は、3軸空間の要素として2種の赤度値と、明度、輝度、及び赤値のいずれかを用いる例を述べてきたが、赤度値と赤値、及び明度(輝度)を3軸の要素としてもよい。この場合、画像処理装置は、一定範囲の赤値と高い赤度値を有する赤目画素を、赤度値と赤値によって分離し、さらに、一定範囲の明度または輝度を有する赤目画素を明度または輝度によって分離する。これにより、画像処理装置は、同様にして、上記の3軸空間においても赤目画素を分離する楕円体を定義することができる。   In addition, the image processing apparatus has been described using an example of using two types of redness values, brightness, luminance, and red value as elements of the three-axis space, but the redness value, red value, and brightness ( (Luminance) may be a triaxial element. In this case, the image processing apparatus separates red-eye pixels having a certain range of red values and high redness values by the redness value and the red value, and further selects red-eye pixels having a certain range of brightness or luminance from the brightness or luminance. Separate by. Accordingly, the image processing apparatus can similarly define an ellipsoid that separates red-eye pixels in the above-described three-axis space.

なお、画像処理装置は、赤度値としてその赤度がより強調される「R値×R値/G値×B値」「2×R値−G値−B値」等を用いてもよい。画像処理装置は、より赤度が強調される要素値を用いることによって、3軸空間において赤目画素と非赤目画素とをより明確に分離することができる。   The image processing apparatus may use “R value × R value / G value × B value”, “2 × R value−G value−B value”, or the like in which the redness is more emphasized as the redness value. . The image processing apparatus can more clearly separate the red-eye pixel and the non-red-eye pixel in the three-axis space by using the element value that enhances the redness.

さらに、画像処理装置は、3軸空間の3つの要素値を、色空間YCbCrの「Y値、Cb値、Cr値」、または、色空間L*a*bの「L値、a値、b値」、色空間L*u*vの「L値、u値、v値」としてもよい。この場合、画像処理装置は、色空間YCbCrの「Cb値、Cr値」、色空間L*a*bの「a値、b値」、色空間L*u*vの「u値、v値」の色味を表す要素値に基づいて、赤目画素の色味をもつ画素を分離し、さらに、一定範囲の明度または輝度を有する赤目画素を色空間YCbCrの「Y値」、色空間L*a*b、L*u*vの「L値」によって分離する。これにより、画像処理装置は、上記の3軸空間においても同様にして赤目画素と非赤目画素とを分離する楕円体を定義することができる。   Further, the image processing apparatus converts the three element values in the triaxial space into “Y value, Cb value, Cr value” in the color space YCbCr, or “L value, a value, b in the color space L * a * b”. Value ”or“ L value, u value, v value ”of the color space L * u * v. In this case, the image processing apparatus performs “Cb value, Cr value” in the color space YCbCr, “a value, b value” in the color space L * a * b, and “u value, v value in the color space L * u * v. ”Are separated from each other based on the element value representing the color tone of the red-eye pixel, and the red-eye pixel having a certain range of lightness or luminance is converted into the“ Y value ”of the color space YCbCr, the color space L * Separation is based on the “L value” of a * b and L * u * v. Thereby, the image processing apparatus can define an ellipsoid that separates red-eye pixels and non-red-eye pixels in the same manner in the three-axis space.

このように、本実施の形態例における画像処理装置は、少なくとも赤度値を要素のひとつとする3軸空間において赤目画素と非赤目画素とを分離する楕円体を定義することができる。また、さらに、画像処理装置は、算出方法の異なる2種類の赤度値と、明度、輝度、及び赤値のいずれかを軸とする3軸空間上に楕円体を定義することによって、赤目画素の分布をより集中させることができ、より高精度に赤目画素と非赤目画素とを分離する楕
円体を定義することができる。
As described above, the image processing apparatus according to the present embodiment can define an ellipsoid that separates red-eye pixels and non-red-eye pixels in a triaxial space having at least a redness value as one of the elements. Further, the image processing apparatus defines a red-eye pixel by defining an ellipsoid in a three-axis space having two types of redness values having different calculation methods and one of brightness, luminance, and red value as axes. The ellipsoid that separates the red-eye pixels and the non-red-eye pixels can be defined with higher accuracy.

なお、赤目現象には、瞳孔や虹彩が赤色になる場合以外に、瞳孔や虹彩が金色になる現象(いわゆる金目)がある。画像処理装置は、3軸空間の赤度値の要素値に「R値−B値」「R値/B値」「B値/R値」等を用いることによって、金目現象が発生している赤目画素の分布を表す楕円体を定義し、金目の赤目画素を特定することができる。例えば、本実施の形態例の画像処理装置は、3軸空間の要素に「R値−G値」と「R値−B値」を用いることにより、赤目現象が発生している画素に加え、金目現象が発生している画素も特定することができる。   Note that the red-eye phenomenon includes a phenomenon in which the pupil and iris become gold (so-called gold eye) other than when the pupil and iris become red. The image processing apparatus uses the “R value−B value”, “R value / B value”, “B value / R value”, and the like as the element values of the redness value in the three-axis space, thereby causing the gold phenomenon. An ellipsoid representing the distribution of red-eye pixels can be defined to identify the red-eye pixels of the gold. For example, the image processing apparatus according to the present embodiment uses “R value-G value” and “R value-B value” as elements of the three-axis space, so that the red-eye phenomenon occurs, It is also possible to identify a pixel in which the gold phenomenon has occurred.

また、本実施の形態例における画像処理装置は、例えば、3軸空間の要素値の2種の赤度値をX軸、Y軸の要素値に割り当てる場合、2種の赤度値の平均値の比率に基づいてZ軸の回転角度を算出し楕円体を回転させることにより、赤目画素の分布により忠実な楕円体を定義することができる。   Further, the image processing apparatus according to the present embodiment, for example, assigns two types of redness values of the element values in the three-axis space to the X-axis and Y-axis element values, and averages the two types of redness values. By calculating the rotation angle of the Z axis based on the ratio and rotating the ellipsoid, it is possible to define an ellipsoid that is more faithful to the distribution of red-eye pixels.

また、本実施の形態例における画像処理装置は、楕円体の外側に位置する画素であっても、楕円体の境界からの距離が所定範囲内である場合、補正度合いは小さいもののある程度の大きさの補正係数を付与する。この結果、画像処理装置は、赤目現象に関与している可能性がある画素を多少補正することができ、より適切に赤目を補正することができる。   Further, the image processing apparatus according to the present embodiment has a certain degree of correction although the degree of correction is small even if the pixel is located outside the ellipsoid and the distance from the boundary of the ellipsoid is within a predetermined range. The correction coefficient is given. As a result, the image processing apparatus can slightly correct pixels that may be involved in the red-eye phenomenon, and can correct red eyes more appropriately.

また、本実施の形態例における画像処理装置は、楕円体の内側に位置する画素であっても、楕円体の境界からの距離が所定範囲内である場合はその補正係数を抑える。これにより、画像処理装置は、非赤目画素の可能性がある画素の補正の度合いを抑えることができ、より適切に赤目を補正することができる。   Further, the image processing apparatus according to the present embodiment suppresses the correction coefficient even when the pixel is located inside the ellipsoid when the distance from the boundary of the ellipsoid is within a predetermined range. Thereby, the image processing apparatus can suppress the degree of correction of pixels that may be non-red-eye pixels, and can correct red eyes more appropriately.

なお、本実施の形態例における画像処理装置は、3軸空間上において赤目画素を内包する楕円体を定義している。しかしながら、画像処理装置は、反対に、3軸空間上において、非赤目画素を内包する楕円体を定義してもよい。この場合、画像処理装置は、例えば、同様にして2種の赤度値と、明度、輝度、及び赤値のいずれかを3軸の要素として、3軸空間上に非赤目画素の分布を表す楕円体を定義する。そして、画像処理装置は、3軸空間において楕円体の外側に位置する画素を赤目画素として特定する。   Note that the image processing apparatus according to the present embodiment defines an ellipsoid that contains red-eye pixels in a three-axis space. However, the image processing apparatus may define an ellipsoid including non-red-eye pixels on the three-axis space. In this case, for example, the image processing apparatus similarly expresses the distribution of non-red-eye pixels in the three-axis space, using two types of redness values, brightness, luminance, and red value as three-axis elements. Define an ellipsoid. Then, the image processing apparatus specifies a pixel located outside the ellipsoid in the triaxial space as a red-eye pixel.

[変形例]
また以上においては、プリンター1を利用した場合を例として説明したが、コンピューター、デジタルビデオカメラ、またはデジタルスチルカメラ等の他の画像処理装置に適用することができる。すなわち画像処理装置にインストールされる赤目補正ソフトウェア等に実装することができる。この場合、補正係数マップMaを生成する機能が画像処理装置に実装され、画像処理装置からプリンターや表示側に補正係数マップMaが提供され、プリンターや表示側で色補正が実行されるようにすることもできる。
[Modification]
In the above description, the case where the printer 1 is used has been described as an example. However, the present invention can be applied to other image processing apparatuses such as a computer, a digital video camera, or a digital still camera. That is, it can be implemented in red-eye correction software or the like installed in the image processing apparatus. In this case, a function for generating the correction coefficient map Ma is implemented in the image processing apparatus, the correction coefficient map Ma is provided from the image processing apparatus to the printer or display side, and color correction is executed on the printer or display side. You can also.

また、上述した機能は、コンピューター等によって実現される場合、上述した機能の処理内容を記述したプログラムが提供される。そのプログラムをコンピューターで実行することにより、処理機能がコンピューター上で実現される。処理内容を記述したプログラムは、コンピューターで読み取り可能な記録媒体に記録しておくことができる。コンピューターで読み取り可能な記録媒体としては、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリーなどがある。磁気記録装置には、ハードディスク装置(HDD)、フレキシブルディスク(FD)、磁気テープなどがある。光ディスクには、DVD(Digital Versatile Disk)、DVD−RAM、CD−ROM(Compact Disk ROM)、CD−R(Recordable)/RW(ReWritable)などがある。光磁気記録媒体には、MO(Magneto-Optical disk)などがある。   Further, when the functions described above are realized by a computer or the like, a program describing the processing contents of the functions described above is provided. The processing function is realized on the computer by executing the program on the computer. The program describing the processing contents can be recorded on a computer-readable recording medium. Examples of the computer-readable recording medium include a magnetic recording device, an optical disk, a magneto-optical recording medium, and a semiconductor memory. Examples of the magnetic recording device include a hard disk device (HDD), a flexible disk (FD), and a magnetic tape. Examples of the optical disc include a DVD (Digital Versatile Disk), a DVD-RAM, a CD-ROM (Compact Disk ROM), and a CD-R (Recordable) / RW (ReWritable). Magneto-optical recording media include MO (Magneto-Optical disk).

プログラムを流通させる場合には、たとえば、そのプログラムが記録されたDVD、CD−ROMなどの可搬型記録媒体が販売される。また、プログラムをサーバーコンピューターの記憶装置に格納しておき、ネットワークを介して、サーバーコンピューターから他のコンピューターにそのプログラムを転送することもできる。   When distributing the program, for example, portable recording media such as a DVD and a CD-ROM in which the program is recorded are sold. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.

プログラムを実行するコンピューターは、たとえば、可搬型記録媒体に記録されたプログラム若しくはサーバーコンピューターから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピューターは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピューターは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピューターは、サーバーコンピューターからプログラムが転送される毎に、逐次、受け取ったプログラムに従った処理を実行することもできる。   The computer that executes the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read a program directly from a portable recording medium and execute processing according to the program. Further, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.

なお上記実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部をハードウェアに置き換えるようにしてもよい。   In the above embodiment, a part of the configuration realized by hardware may be replaced with software, and conversely, a part of the configuration realized by software may be replaced by hardware. .

またフローチャートにその流れを示した処理は、各ステップが、記載された順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくても、並列的あるいは個別に実行される処理を含むものである。また適宜処理を省略することもできる。   The process shown in the flowchart is executed in parallel or individually even if the steps are not necessarily processed in time series, as well as processes performed in time series in the order described. It includes processing that. Further, the processing can be omitted as appropriate.

1 プリンター, 11 CPU , 12 内部メモリー, 13 操作部, 14
表示部, 15 プリンターエンジン, 16 カードI/F, 17 カードスロット, 18 メモリーカード, 21 画像読取部, 22 赤目候補領域取得部, 23 楕円体定義部, 24 赤目画素特定部, 25 補正部
1 Printer, 11 CPU, 12 Internal memory, 13 Operation unit, 14
Display unit, 15 printer engine, 16 card I / F, 17 card slot, 18 memory card, 21 image reading unit, 22 red eye candidate area acquisition unit, 23 ellipsoidal definition unit, 24 red eye pixel specifying unit, 25 correction unit

Claims (9)

カラー画像における赤目現象の発生している赤目を含む赤目候補領域から赤目画素を特定する画像処理装置であって、
赤目画素を特定するカラー画像を対象として、色の要素を軸とし少なくとも1つの色の要素が赤度値である3軸空間において、前記赤目候補領域内の画素群の前記色の要素の値に基づいて、前記赤目画素と非赤目画素とを分離する楕円体を定義する楕円体定義手段と、
前記赤目候補領域内の各画素について、前記画素の色が前記楕円体の内側に位置する場合に、当該画素を赤目画素として特定する赤目画素特定手段と、
を有し、
前記楕円体定義手段は、前記赤目候補領域内の画素群のうちその前記赤度値が上位所定割合に該当する定義画素群の前記色の要素の値に基づいて前記楕円体を定義することを特徴とする画像処理装置。
An image processing device for identifying a red-eye pixel from a red-eye candidate region including a red-eye in which a red-eye phenomenon occurs in a color image,
In a three-axis space where a color element is an axis and at least one color element is a redness value for a color image that identifies a red-eye pixel, the value of the color element of the pixel group in the red-eye candidate region An ellipsoid defining means for defining an ellipsoid separating the red-eye pixel and the non-red-eye pixel,
For each pixel in the red-eye candidate region, when the color of the pixel is located inside the ellipsoid, a red-eye pixel specifying unit that specifies the pixel as a red-eye pixel;
Have
The ellipsoid defining means defines the ellipsoid based on a value of the color element of a definition pixel group in which the redness value of the pixel group in the red-eye candidate region corresponds to an upper predetermined ratio. A featured image processing apparatus.
請求項1において、
前記要素のうち第1、第2の要素は前記画素の色に基づいた算出方法の異なる2種の赤度値であり、第3の要素は前記画素の色の明度、輝度、赤値のいずれかであることを特徴とする画像処理装置。
In claim 1,
Among the elements, the first and second elements are two kinds of redness values having different calculation methods based on the color of the pixel, and the third element is any one of brightness, luminance, and red value of the color of the pixel. An image processing apparatus characterized by the above.
請求項2において、
前記楕円体定義手段は、前記定義画素群の各要素の値の平均値に基づいて前記楕円体の中心点を定義し、前記定義画素群の各要素の値の標準偏差値に基づいて前記楕円体の3つの径を定義することを特徴とする画像処理装置。
In claim 2,
The ellipsoid defining means defines a center point of the ellipsoid based on an average value of each element of the definition pixel group, and the ellipsoid is defined based on a standard deviation value of each element of the definition pixel group. An image processing apparatus that defines three diameters of a body.
請求項3において、
前記楕円体定義手段は、さらに、前記楕円体の中心点を回転中心とし前記第3の要素が前記明度または赤値である軸を回転軸とする前記楕円体の回転角度を、前記定義画素群の前記第1、第2の赤度値の平均値の比率に基づいて定義することを特徴とする画像処理装置。
In claim 3,
The ellipsoid defining means is further configured to determine a rotation angle of the ellipsoid having a center point of the ellipsoid as a rotation center and an axis whose third element is the lightness or red value as a rotation axis. The image processing apparatus is defined based on a ratio of an average value of the first and second redness values.
請求項1乃至4のいずれかにおいて、
前記楕円体定義手段は、デフォルトの前記楕円体を定義する第1の楕円体パラメーターを有し、当該第1の楕円体パラメーターを前記定義画素群の各要素の値の平均値及び標準偏差値に基づいて変更し第2の楕円体パラメーターを取得することを特徴とする画像処理装置。
In any one of Claims 1 thru | or 4,
The ellipsoid defining means includes a first ellipsoid parameter that defines the default ellipsoid, and the first ellipsoid parameter is set to an average value and a standard deviation value of each element of the definition pixel group. An image processing apparatus characterized in that the second ellipsoid parameter is changed based on the second ellipsoid parameter.
請求項4または5において、
前記楕円体定義手段は、前記第1、第2の要素の各軸を回転軸とする前記楕円体の各回転角度を0°から変更しないことを特徴とする画像処理装置。
In claim 4 or 5,
The image processing apparatus according to claim 1, wherein the ellipsoid defining means does not change each rotation angle of the ellipsoid having each axis of the first and second elements as a rotation axis from 0 °.
請求項1乃至4のいずれかにおいて、
前記画像処理装置は、さらに、
前記赤目画素特定手段によって特定された画素について、前記画素の彩度を抑える補正を行う補正手段を有し、
前記赤目画素特定手段は、さらに、前記各画素について補正度合いを表す補正係数情報を生成し、前記楕円体の内側に位置する前記画素の前記補正係数を最大の補正度合いを表す第1の補正係数とし、前記楕円体の外側に位置する前記画素の前記補正係数を前記第1の補正係数より小さく0を含む第2の補正係数とし、
前記補正手段は、前記画素の前記補正係数に基づいて前記彩度を抑える補正を行うことを特徴とする画像処理装置。
In any one of Claims 1 thru | or 4,
The image processing apparatus further includes:
Correction means for performing correction for suppressing the saturation of the pixel for the pixel specified by the red-eye pixel specifying means;
The red-eye pixel specifying unit further generates correction coefficient information indicating a correction degree for each pixel, and the correction coefficient information of the pixel located inside the ellipsoid is a first correction coefficient indicating a maximum correction degree. And the correction coefficient of the pixel located outside the ellipsoid is a second correction coefficient that is smaller than the first correction coefficient and includes 0,
The image processing apparatus according to claim 1, wherein the correction unit performs correction to suppress the saturation based on the correction coefficient of the pixel.
請求項7において、
前記赤目画素特定手段は、前記楕円体の境界から距離が所定範囲内であって、前記楕円体の内側に位置する前記画素の前記補正係数を前記距離に応じて前記第1の補正係数から前記第2の補正係数に逓減させた第3の補正係数とし、前記楕円体の外側に位置する前記画素の前記補正係数を前記距離に応じて前記第2の補正係数から前記第1の補正係数に逓増させた第4の補正係数とすることを特徴とする画像処理装置。
In claim 7,
The red-eye pixel specifying means has a distance within a predetermined range from a boundary of the ellipsoid, and the correction coefficient of the pixel located inside the ellipsoid is determined from the first correction coefficient according to the distance. The third correction coefficient is gradually reduced to the second correction coefficient, and the correction coefficient of the pixel located outside the ellipsoid is changed from the second correction coefficient to the first correction coefficient according to the distance. An image processing apparatus characterized in that the fourth correction coefficient is increased.
カラー画像における赤目現象の発生している赤目を含む赤目候補領域から赤目画素を特定する画像処理をコンピューターに実行させるコンピューター読み取り可能な画像処理プログラムにおいて、
赤目画素を特定するカラー画像を対象として、色の要素を軸とし少なくとも1つの色の要素が赤度値である3軸空間において、前記赤目候補領域内の画素群の前記色の要素の値に基づいて、前記赤目画素と非赤目画素とを分離する楕円体を定義する楕円体定義工程と、
前記赤目候補領域内の各画素について、前記画素の色が前記楕円体の内側に位置する場合に、当該画素を赤目画素として特定する赤目画素特定工程と、
を実行し、
前記楕円体定義工程は、前記赤目候補領域内の画素群のうちその前記赤度値が上位所定割合に該当する定義画素群の前記色の要素の値に基づいて前記楕円体を定義することを特徴とする画像処置プログラム。
In a computer-readable image processing program for causing a computer to execute image processing for identifying a red-eye pixel from a red-eye candidate region including a red-eye in which a red-eye phenomenon occurs in a color image,
In a three-axis space where a color element is an axis and at least one color element is a redness value for a color image that identifies a red-eye pixel, the value of the color element of the pixel group in the red-eye candidate region An ellipsoid defining step defining an ellipsoid separating the red-eye and non-red-eye pixels,
For each pixel in the red-eye candidate region, when the color of the pixel is located inside the ellipsoid, a red-eye pixel specifying step of specifying the pixel as a red-eye pixel;
Run
The ellipsoid defining step defines the ellipsoid based on the value of the color element of the definition pixel group in which the redness value corresponds to the upper predetermined ratio among the pixel group in the red-eye candidate region. A featured image treatment program.
JP2010085813A 2010-04-02 2010-04-02 Image processing apparatus and image processing program Expired - Fee Related JP5633172B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010085813A JP5633172B2 (en) 2010-04-02 2010-04-02 Image processing apparatus and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010085813A JP5633172B2 (en) 2010-04-02 2010-04-02 Image processing apparatus and image processing program

Publications (2)

Publication Number Publication Date
JP2011216044A JP2011216044A (en) 2011-10-27
JP5633172B2 true JP5633172B2 (en) 2014-12-03

Family

ID=44945668

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010085813A Expired - Fee Related JP5633172B2 (en) 2010-04-02 2010-04-02 Image processing apparatus and image processing program

Country Status (1)

Country Link
JP (1) JP5633172B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5130789A (en) * 1989-12-13 1992-07-14 Eastman Kodak Company Localized image recoloring using ellipsoid boundary function
JP4492643B2 (en) * 2007-06-01 2010-06-30 セイコーエプソン株式会社 Red-eye correction device, red-eye correction method, and red-eye correction program
JP2009070103A (en) * 2007-09-12 2009-04-02 Canon Inc Image processor and image processing method

Also Published As

Publication number Publication date
JP2011216044A (en) 2011-10-27

Similar Documents

Publication Publication Date Title
US8391595B2 (en) Image processing method and image processing apparatus
US9251589B2 (en) Depth measurement apparatus, image pickup apparatus, and depth measurement program
WO2018176925A1 (en) Hdr image generation method and apparatus
US7936919B2 (en) Correction of color balance of face images depending upon whether image is color or monochrome
US9846826B2 (en) Image processing to generate a tone curve for processing an image by associating a model parameter of the image with another model parameter of a reference image
US8861849B2 (en) Image processing
JP2008527852A (en) White balance correction of digital camera images
JP2009044681A (en) Image processing method, and image processing device
JP2009267690A (en) Image processing apparatus, imaging apparatus, image processing method and program
US8737730B2 (en) Vector-based color difference metric for color mapping
US10685490B2 (en) Information processing apparatus, information processing method, and storage medium
JP3950551B2 (en) Image processing method, apparatus, and recording medium
JP2009251634A (en) Image processor, image processing method, and program
JP5633172B2 (en) Image processing apparatus and image processing program
JP2009141975A (en) Image processing using object information
US20130004019A1 (en) Image recognition device, image recognition method and recording medium for image recognition program
JP4515964B2 (en) Image correction apparatus and method, and image correction program
JP2011198116A (en) Apparatus and program for processing image
JP2006031682A (en) Lookup table creation device, method and program
JP2015142161A (en) Image processing apparatus and control method therefor
JP2012181618A (en) Image processing program and image processing device
JP4208889B2 (en) Image processing method, apparatus, and recording medium
JP2008147714A (en) Image processor and image processing method
JP4594225B2 (en) Image correction apparatus and method, and image correction program
JP2011090431A (en) Image processor, printing system, image processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130305

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131205

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131210

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140206

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140304

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140501

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140603

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140729

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140916

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140929

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees