JP2004164276A - Red-eye correcting device, red-eye correcting method and its program - Google Patents

Red-eye correcting device, red-eye correcting method and its program Download PDF

Info

Publication number
JP2004164276A
JP2004164276A JP2002329253A JP2002329253A JP2004164276A JP 2004164276 A JP2004164276 A JP 2004164276A JP 2002329253 A JP2002329253 A JP 2002329253A JP 2002329253 A JP2002329253 A JP 2002329253A JP 2004164276 A JP2004164276 A JP 2004164276A
Authority
JP
Japan
Prior art keywords
image data
eye
color
red
correction area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2002329253A
Other languages
Japanese (ja)
Other versions
JP2004164276A5 (en
JP3994280B2 (en
Inventor
Clark Ian
クラーク イアン
Glick Brian
グリック ブライアン
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 JP2002329253A priority Critical patent/JP3994280B2/en
Publication of JP2004164276A publication Critical patent/JP2004164276A/en
Publication of JP2004164276A5 publication Critical patent/JP2004164276A5/ja
Application granted granted Critical
Publication of JP3994280B2 publication Critical patent/JP3994280B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Color Image Communication Systems (AREA)
  • Image Analysis (AREA)
  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)
  • Processing Of Color Television Signals (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a red-eye correcting device, a red-eye correcting method and a red-eye correcting program capable of much more surely correcting red-eyes for an image where red-eyes appear at the sections of the eyes without generating any sense of incompatibility. <P>SOLUTION: Correction area information indicating a correction area for correcting the red-eyes of a color image is acquired, and range information indicating a range being the color of the red-eyes in the color space of the image data is acquired, and when the image data are within the range corresponding to the range information with respect to the pixels of a correction area corresponding to the correction area information, the original image data are replaced with the image data indicating the color of the eyes, and when the pixels are the boundary section of the correction area, the replacement quantity of the image data is made correspond to the rate of the same pixels included in the same correction area. Thus, it is possible to much more surely correct the red-eyes without generating any sense of incompatibility. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、多数の画素別に多階調とされた画像データで表現されるカラーの画像に生じた赤目を修正する赤目修正装置、赤目修正方法および赤目修正プログラムに関する。
【0002】
【従来の技術】
従来より、夜間等暗い環境でストロボを発光させて人をデジタルカメラ等で撮影すると、人の目の部分に赤目が生じることがある。赤目は、いわゆる黒目の部分が赤色や金色になった現象をいう。このような赤目を修正する装置として、赤目修正を行う矩形領域を指定し、同矩形領域から色相が所定範囲で彩度が所定値以上となる部分を赤目領域として自動抽出し、黒、青、等の所定の色に変換する装置が知られている(例えば、特許文献1参照)。同装置は、赤目領域を自動抽出できなかった場合に、手動で赤目領域を指定することができるようにしてあり、赤目を修正する操作効率を向上させるようにしている。
また、目を含む領域から目の領域を自動的に抽出する技術も知られている(例えば、特許文献2参照)。
【0003】
【特許文献1】
特開2001−148780号公報(段落0019−0052、第1−7図)
【特許文献2】
特開平10−75374号公報(段落0015−0049、第1−3図)
【0004】
【発明が解決しようとする課題】
上述した従来の技術においては、赤目領域を所定の色に置き換えた画像を見ると違和感が感じられるという問題があった。特に、赤目でない領域も一律に所定の色に置き換えられるため、赤目修正を行った領域の内外間で色が急変する箇所が生じると違和感の大きな画像となってしまうことになる。そこで、赤目が生じた画像に対して違和感を感じさせないように赤目を修正したいという希望があった。
本発明は、上記課題にかんがみてなされたもので、目の部分に赤目が生じた画像に対して、より確実に違和感を感じさせないように赤目を修正することが可能な赤目修正装置、赤目修正方法および赤目修正プログラムの提供を目的とする。
【0005】
【課題を解決するための手段】
上記目的を達成するため、請求項1にかかる発明は、多数の画素別に多階調とされた画像データで表現されるカラーの画像のうち赤目を修正する修正領域を表す修正領域情報を取得する修正領域取得手段と、上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得手段と、上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから目の色を表す画像データに置換するとともに同画素が同修正領域の境界部分である場合には同画像データの置換量を同画素が同修正領域に含まれる度合に応じた量とする色置換手段とを具備する構成としてある。
【0006】
本赤目修正装置は、多数の画素別に多階調とされた画像データで表現されるカラーの画像に生じた赤目を修正する。ここで、修正領域取得手段にて画像のうち赤目を修正する修正領域を表す修正領域情報が取得され、赤目範囲取得手段にて画像データの色空間内において赤目の色とする範囲を表す範囲情報が取得される。取得された修正領域情報に対応する修正領域の画素について、画像データが上記取得された範囲情報に対応する範囲内であるとき、以下のようにして画像データが置換される。
すなわち、元の画像データから目の色を表す画像データに置換されるが、置換対象の画素が修正領域の境界部分である場合には、画像データの置換量は同画素が修正領域に含まれる度合に応じた量とされる。
従って、赤目を修正する領域の境界部分が赤目の色とする範囲内であるときに画像データは完全には目の色を表すデータに置き換えられないので、赤目を修正する領域の内外で色は急変せず、スムーズに変化する。その結果、目の部分に赤目が生じた画像に対して、より確実に違和感を感じさせないように赤目を修正することが可能となる。
【0007】
上記目の色は、黒、茶、青、等、様々な色が考えられる。また、置き換える目の色は、一様であってもよいし、模様があってもよいし、より高画質となるように虹彩部分と瞳孔部分とが別の色にされていてもよい。
【0008】
上述した各種手段により赤目修正装置を構成する場合、請求項2にかかる発明のように構成してもよい。本赤目修正装置は、ドットマトリクス状の多数の画素別に複数の要素色のそれぞれについて多階調とされた画像データで表現されるカラーの画像に生じた赤目を修正する。ここで、取得された修正領域情報に対応する修正領域の画素について、各画素の画像データが置換対象として順次対象画素が移動させられる。そして、対象画素の画像データが上記取得された範囲情報に対応する範囲内であるとき、以下のようにして画像データが置換される。
すなわち、対象画素が全て修正領域に含まれる場合には、対象画素について元の画像データから目の色を表す画像データに置換される。一方、対象画素が修正領域の境界部分である場合には、対象画素について元の画像データから目の色を表す画像データに置換されるにあたり、画像データの置換量は対象画素が修正領域に含まれる度合に応じた量とされる。従って、上記と同様の作用により、赤目を修正する領域の内外で色が急変せず、スムーズに変化する。
【0009】
上記複数の要素色は様々考えられ、例えば、レッド(R)とグリーン(G)とブルー(B)の3色から構成されてもよいし、輝度データとブルーの色差データとレッドの色差データから構成されてもよい。シアン(C)とマゼンタ(M)とイエロー(Y)の3色から構成されてもよいし、さらにブラック(K)を加えた4色から構成されてもよい。また、デバイスに依存しないLab空間の各成分のように明度データと二種類の色度データから構成されてもよい。
【0010】
ここで、上記色置換手段は、上記画素が上記修正領域の境界部分である場合には同画素について元の画像データから上記目の色を表す画像データに置換するにあたり同画像データの置換割合を同画素が同修正領域に含まれる割合とする構成としてもよい。すなわち、境界部分の画素において元の画像データから目の色を表す画像データに置換する割合は、同画素が修正領域に含まれる割合とされるので、簡易な構成ながら修正領域の境界部分を自然な感じにさせるように境界部分の画素の画像データを置換することができる。
【0011】
また、境界部分の画素の画像データを置換する一例として、上記色置換手段は、上記画素を所定数の区分領域に略等分割し、中心が上記修正領域の内部となる区分領域の同区分領域全ての数に対する割合を上記画像データの置換割合とする構成としてもよい。すなわち、画素を所定数の区分領域に略等分割し、境界部分の画素において元の画像データから目の色を表す画像データに置換する割合を中心が修正領域の内部となる区分領域の数の割合とすることにより、簡易に求めることができる。
【0012】
置換後の画像データの明るさを表す明るさ情報を取得する明るさ情報取得手段が設けられると、色置換手段は、取得された明るさ情報に対応した明るさを表す画像データに置換する構成としてもよい。すなわち、置換後の画像データは、明るさ情報に対応した明るさを表す画像データとなる。
ここで、上記明るさ情報取得手段は、上記色置換手段にて置換された後の画像データの輝度を設定する操作入力を受け付けて同輝度を表す情報とされた上記明るさ情報を取得し、上記色置換手段は、上記目の色を表す画像データに置換するにあたり、上記取得された明るさ情報に対応した輝度の画像にさせる画像データに置換する構成としてもよい。すなわち、置換後の画像データは、明るさ情報に対応した輝度の画像にさせる画像データとなる。従って、明るさ情報に応じて置換後の画像データの輝度を調整することができるので利便性が向上するとともに、さらに違和感なく赤目を修正することが可能となる。
【0013】
ところで、上記修正領域の一例として、修正領域を略円形の領域とし、修正領域情報を、略円形とされた修正領域の径を表す情報と、画像における修正領域の中心座標を表す情報とから構成してもよい。ここで、径を表す情報は、直径を表す情報であってもよいし、半径を表す情報であってもよい。
上記のような修正領域情報を取得する構成の一例として、上記修正領域取得手段は、上記略円形とされた修正領域の半径を設定する操作入力を受け付けて上記径を表す情報を取得するとともに、上記画像を表示して表示された画像の赤目の中心位置を指定する操作入力を受け付けて上記中心座標を表す情報を取得してもよい。すると、ユーザは簡易な構成で修正領域を設定することが可能となる。
むろん、修正領域は、上記のように円領域とする以外にも様々な形状が考えられ、例えば、楕円状の領域、矩形領域、多角形状の領域等であってもよい。
【0014】
赤目の色とする範囲を表す範囲情報も、様々な構成が考えられる。その一例として、上記範囲情報は、上記画像データの色空間内において赤目の色とする範囲が所定の赤目目標色からの距離として表された情報とされ、上記色置換手段は、上記色空間内における上記赤目目標色の座標と上記修正領域の画素の画像データとから同赤目目標色と同画素の色との距離を算出し、当該距離が上記取得された範囲情報に対応する距離内であるとき、上記画像データの置換を行う構成としてもよい。すなわち、赤目目標色と画素の色との距離が算出され、同距離が範囲情報に対応する距離内であるときに画像データの置換が行われる。
【0015】
画像データがRGBのそれぞれについて多階調とされたデータであるときの赤目目標色と画素の色との距離Distanceを算出するための好適な演算式の一例として、請求項8にかかる発明のように構成してもよい。ここで、NをN+1やN−1に変更したり、N+1をNに変更したり等、演算式の各係数の僅かな違いは距離Distanceの値にほとんど影響しないので、請求項8に記載した発明に含まれる。また、上記演算式の右辺に所定係数が乗じられた式であっても、赤目目標色と画素の色との距離を表すことになるので、請求項8に記載した発明に含まれる。
【0016】
上記演算式を使用して修正領域の画素の画像データが範囲情報に対応する距離内であるか否かを判断するための好適な構成の一例として、請求項9にかかる発明のように構成してもよい。画像データの色空間内で赤目目標色から最も長くなる距離に対する距離Distanceの比を基準として画像データが範囲情報に対応する範囲内であるか否かを判断すればよいので、範囲情報を0〜1の範囲とすることができる。
【0017】
なお、画像データを置換する目の色が複数設けられる場合、上記色置換手段は、上記複数の目の色からいずれかの色を選択する入力を受け付けて置換後の色を表す情報を取得し、当該情報に対応した色となるように上記画像データを置換する構成としてもよい。すると、赤目部分をより希望に沿った目の色に置換することができる。
また、どこの国または地域の人か等の選択入力を受け付け、入力された人に対応する目の色の画像データに置換するようにしてもよい。すると、その人に最適な目の色に修正することが可能となる。
【0018】
ところで、上記修正領域取得手段は、各画素の画像データに基づいて上記画像から目の領域を決定し、当該領域を表す情報を上記修正領域情報として取得する構成としてもよい。すなわち、各画素の画像データに基づいて画像から目の領域が修正領域として決定されるので、自動的に赤目を修正する領域が抽出されることになる。決定される目の領域は、白目を含めた領域であってもよいし、虹彩の領域であってもよい。
【0019】
また、上記色置換手段は、赤目が生じていない別の画像の画像データを取得し、当該画像データに基づいて同別の画像から虹彩の領域を決定し、当該領域の画像データに基づいて上記目の色を表す情報を取得するとともに、上記修正領域の画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから同目の色を表す情報に対応した画像データに置換するとともに同画素が同修正領域の境界部分である場合には同画像データの置換量を同画素が同修正領域に含まれる度合に応じた量とする構成としてもよい。赤目が生じていない別の画像から目の色を表す情報が取得され、赤目部分がこの目の色に修正される。
ここで、赤目を修正しようとする画像と別の画像との人が同一人物であるか否かを判定し、同一人物であるときに画像データを置換するようにしてもよい。
【0020】
このように、他の画像から目の色を表す情報を取得して赤目を修正すると、より確実に違和感を感じさせないようになるので、請求項13にかかる発明のように構成してもよい。すなわち、赤目が生じていない別の画像の画像データが取得され、取得された画像データに基づいて別の画像から虹彩の領域が決定され、決定された領域の画像データに基づいて目の色を表す情報が取得される。取得された修正領域情報に対応する修正領域の画素について、画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから別の画像からの目の色を表す情報に対応した画像データに置換される。言い換えると、赤目が生じていない別の画像から目の色を表す情報が取得され、赤目部分がこの目の色に修正される。
【0021】
また、上記明るさ情報取得手段が設けられていると、置換後の画像データは明るさ情報に対応した明るさを表す画像データとなり、さらに違和感なく赤目を修正することが可能となるので、請求項14にかかる発明のように構成してもよい。すなわち、取得された修正領域情報に対応する修正領域の画素について、画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから、目の色を表す画像データであって上記取得された明るさ情報に対応した明るさを表す画像データに置換される。
【0022】
ところで、上述した赤目修正装置は、単独で実施される場合もあるし、ある機器に組み込まれた状態で他の方法とともに実施されることもあるなど、発明の思想としては各種の態様を含むものであって、適宜、変更可能である。
また、上述した赤目を修正する際の手法は、所定の手順に従って処理を進めていくうえで、その根底にはその手順に発明が存在するということは当然である。従って、本発明は方法としても適用可能であり、請求項15〜請求項17にかかる発明においても、基本的には同様の作用となる。
【0023】
本発明を実施しようとする際に、赤目修正装置にて所定のプログラムを実行させる場合もある。そこで、そのプログラムとしても適用可能であり、請求項18〜請求項20にかかる発明においても、基本的には同様の作用となる。さらに、同プログラムを記録した媒体が流通し、同記録媒体からプログラムを適宜コンピュータに読み込むことが考えられる。すなわち、そのプログラムを記録したコンピュータ読み取り可能な記録媒体としても適用可能であり、基本的には同様の作用となる。
むろん、請求項2〜請求項12に記載された構成を上記方法やプログラムやプログラムを記録した媒体に対応させることも可能であることは言うまでもない。ここで、上記記録媒体は、磁気記録媒体や光磁気記録媒体の他、今後開発されるいかなる記録媒体であってもよい。一次複製品、二次複製品などの複製段階も問わない。一部がハードウェアで実現される場合や、一部を記録媒体上に記録しておいて必要に応じて適宜読み込む場合も本発明の思想に含まれる。
【0024】
【発明の効果】
以上説明したように、請求項1、請求項2、請求項13〜請求項20にかかる発明によれば、目の部分に赤目が生じた画像に対して、より確実に違和感を感じさせないように赤目を修正することが可能となる。
請求項3にかかる発明によれば、簡易な構成にて、修正領域の境界部分を自然な感じにさせることができる。
請求項4にかかる発明によれば、境界部分の画素の画像データを置換する処理の簡易な一例を提供することができる。
請求項5にかかる発明によれば、明るさ情報に応じて修正後の画像の明るさを調整することができるので利便性が向上するとともに、さらに違和感なく赤目を修正することが可能となる。
【0025】
請求項6にかかる発明によれば、簡易な構成にて修正領域を容易に特定することができる。
請求項7にかかる発明によれば、画素の色が赤目目標色から範囲情報に対応する距離内であるときに画像データが置換されるので、より確実に修正すべき赤目部分を目の色に修正することができる。
請求項8にかかる発明によれば、赤目目標色と画素の色との距離を算出するための好適な演算式を提供することができ、より確実に修正すべき赤目部分を目の色に修正して、良好な画質の修正画像を得ることが可能となる。
請求項9にかかる発明によれば、赤目とする範囲を0〜1の範囲で表現することができるので、構成を簡易にさせることができる。
【0026】
請求項10にかかる発明によれば、赤目部分をより希望に沿った目の色に置換することができ、利便性が向上するとともに、より確実に違和感を感じさせないように赤目を修正することが可能となる。
請求項11にかかる発明によれば、自動的に赤目を修正する領域が抽出されるので、赤目を修正する作業が軽減され、利便性が向上する。
請求項12にかかる発明によれば、赤目部分は赤目が生じていない別の画像の目の色に修正されるので、より確実に違和感を感じさせないように赤目を修正することが可能となる。
【0027】
【発明の実施の形態】
以下、下記の順序に従って本発明の実施形態を説明する。
(1)赤目修正装置を含むシステム構成:
(2)赤目修正装置の構成:
(3)赤目修正装置の動作:
(4)まとめ:
【0028】
(1)赤目修正装置を含むシステム構成:
図1は、本発明の一実施形態にかかる赤目修正装置と周辺装置とからなるシステムの概略構成を示している。本システムは、本発明にいう赤目修正装置となるパーソナルコンピュータ(PC)10、画像出力機器であるカラー印刷可能なインクジェットプリンタ20、デジタルカメラ30等から構成されている。本赤目修正装置は、デジタルカメラ等で人を撮影したときに目の部分に生じる赤目を目の色に修正する装置であり、ユーザが簡単に赤目を修正できるように構成されたものである。なお、本赤目修正装置のユーザは、コンピュータ画像修正についての素人であることを前提としており、プロの写真家等も含まれる。むろん、コンピュータ画像修正について熟知した人であっても、本装置により容易に赤目を修正することができる。
PC10は演算処理の中枢をなすCPU11を備えており、このCPU11はシステムバス10aを介してPC10全体の制御を行う。同バス10aには、ROM12、RAM13、CD−ROMドライブ15、フレキシブルディスク(FD)ドライブ16、各種インターフェイス(I/F)17a〜e等が接続されている。また、ハードディスクドライブを介してハードディスク(HD)14も接続されている。本実施形態のコンピュータにはいわゆるデスクトップ型PCを採用しているが、コンピュータとしては一般的な構成を有するものを採用可能である。
【0029】
HD14には、ソフトウェアとしてオペレーティングシステム(OS)やアプリケーションプログラム(APL)等が格納されている。実行時には、CPU11がこれらのソフトウェアを適宜RAM13に転送し、RAM13を一時的なワークエリアとして適宜アクセスしながらプログラムを実行する。なお、本実施形態の赤目修正プログラムはAPLとOSとが協同して各種機能を実現させるが、APL単体であってもよいし、OSに組み込まれていてもよい。
周辺機器I/F(PIF)17aには、デジタルカメラ30や、図示しないカラースキャナ等が接続されるようになっている。CRTI/F17bには画像データに基づく画像を表示する表示手段であるディスプレイ18aが接続され、入力I/F17cにはキーボード18bやマウス18cが操作用入力機器として接続されている。また、プリンタI/F17eには、例えばパラレルI/Fケーブルを介してプリンタ20が接続されている。
なお、HD14は本発明にいう赤目修正プログラムを記録した媒体となるが、同媒体は、例えば、CD−ROM、FD16a、光磁気ディスク、不揮発性メモリ、等であってもよい。むろん、モデム等の通信I/F17dをインターネット網に接続し、所定のサーバにアクセスして本赤目修正プログラムをダウンロードして実行させることも可能である。
【0030】
赤目修正が行われた画像を印刷するプリンタ20は、シアン(C)、マゼンタ(M)、イエロー(Y)、ブラック(K)のインクを使用して、メディアに対して印刷を行う。むろん、4色以外のインクを使用するプリンタや、インク通路内に泡を発生させてインクを吐出するバブル方式のプリンタや、レーザープリンタ等、種々の画像出力機器を採用可能である。
図2に示すように、プリンタ20では、CPU21、ROM22、RAM23、通信I/O24、コントロールIC25、ASIC26、I/F27、等がバス20aを介して接続されている。通信I/O24はPC10のプリンタI/F17eと接続されており、プリンタ20は通信I/O24を介してPC10から送信されるCMYKに変換されたデータやページ記述言語等からなる印刷ジョブを受信する。ASIC26は、CPU21と所定の信号を送受信しつつヘッド駆動部26aに対してCMYKデータに基づく印加電圧データを出力する。すると、ヘッド駆動部26aは、印刷ヘッドに内蔵されたピエゾ素子への印加電圧パターンを生成し、印刷ヘッドにインクを吐出させる。I/F27に接続されたキャリッジ機構27aや紙送り機構27bは、印刷ヘッドを主走査させたり、メディアを順次送り出して副走査を行ったりする。そして、CPU21が、ROM22に書き込まれたプログラムに従って各部を制御する。
【0031】
PC10では、以上のハードウェアを基礎としてバイオスが実行され、その上層にてOSとAPLとが実行される。OSには、プリンタI/F17eを制御するプリンタドライバ等の各種のドライバ類が組み込まれ、ハードウェアの制御を実行する。プリンタドライバは、プリンタI/F17eを介してプリンタ20と双方向の通信を行うことが可能であり、APLから印刷データを受け取って印刷ジョブを作成し、プリンタ20に送出する。
【0032】
(2)赤目修正装置の構成:
図3は、上記赤目修正プログラムの機能により実現される赤目修正装置の構成を模式的に示している。赤目修正プログラムは複数のモジュールから構成されており、各モジュールに対応して本発明にいう各種手段U1〜U4が構成されている。基本的には、手段U1〜U3が取得する情報に基づいて、色置換手段U4が画像データに対して赤目部分を目の色に置き換える処理を行う。
本実施形態では、sRGB色空間で定義されるRGBから構成された画像データに対して上記処理を行うことにしている。同画像データは、横m0×縦n0画素(m0,n0は2以上の整数)とされたドットマトリクス状の多数の画素別に複数の要素色RGBのそれぞれについて多階調(例えば、階調値0〜255の256階調)とされ、カラーの画像を表現するデータとされている。むろん、YUV表色系における輝度(Y成分)、Bの色差(U成分)、Rの色差(V成分)から構成された画像データ等に対して上記処理を行うことも可能である。また、画像データの各成分も様々な階調数とすることが可能であり、256階調以外にも、例えば1024階調等としてもよい。
【0033】
修正領域取得手段U1は、上記画像データで表現される画像のうち、目の部分に生じる赤目を修正する修正領域を表す修正領域情報を取得する。本実施形態では、修正領域を略円形の領域として、修正領域の半径Radius(径を表す情報)と、修正領域の中心座標を表す情報とを修正領域情報としている。これらの情報は、PC10への操作入力により取得されるようになっている。
また、各画素の画像データに基づいて画像から目の領域を決定し、当該目の領域を表す情報を修正領域情報として取得することも可能である。目の領域を決定する手法は様々考えられる。例えば、特開平10−75374号公報の段落0030に開示されているように、明度の低い画素の連結性等に基づいて目の領域の画像データだけを抽出することにより、画像から目の領域を決定することができる。また、目の色は肌色ではないことから、肌色の領域(例えば、画像データの各RGB値が所定範囲内に入る画素の領域)を抽出し、抽出した肌色の領域に囲まれた領域が所定の目の形状と略一致するときに、その囲まれた領域を目の領域と決定し、当該目の領域を表す情報を修正領域情報として取得してもよい。
【0034】
赤目範囲取得手段U2は、3要素色RGBのそれぞれを座標軸とする画像データの色空間内において、赤目の色とする範囲を表す範囲情報を取得する。本実施形態では、同色空間内において赤目の色とする範囲が所定の赤目目標色からの距離として表されている。そして、同距離の相対的な値が操作入力により受け付けられ、入力された値が赤目の色とする許容度Tolerance(範囲情報)として取得されるようになっている。
【0035】
明るさ情報取得手段U3は、色置換手段にて置換された後の画像データの明るさを表す明るさ情報を取得する。本実施形態では、明るさ情報を強度Intensityとして数値表現するとともに、同強度を輝度を表す情報としているが、他にも明度を表す情報を明るさ情報とすることも可能である。同強度は、数値として操作入力により受け付けられるようになっている。
【0036】
図4は、上記手段U1〜U3が各種情報の入力を受け付けるための設定入力画面の表示例を示している。同画面には、画像表示欄91a、十字ポインタ91b、目の色選択欄91c、半径入力欄91d、許容度入力欄91e、強度入力欄91f、各種ボタン91g〜jが設けられている。
画像表示欄91aでは、入力した画像データが表示されるようになっている。同表示欄91a中に十字ポインタ91bが表示されるようになっており、同ポインタ91bをマウスにて移動させることにより、修正領域の中心座標を設定入力することが可能となっている。
【0037】
目の色選択欄91cでは、修正後の目の色を選択可能となっている。目の色の選択肢としては、黒、茶、青等の他に、ユーザ設定や、日本人等の地域別の人や、別の画像等がある。ユーザ設定が選択入力された場合には、色パレットが表示され、所望の目の色を作成することが可能である。地域別の人が選択入力された場合には、入力された地域の人に対応する目の色が選択されるようになっている。別の画像が選択入力された場合には、別の画像から目の色を表す情報が取得されるようになっている。
半径入力欄91dでは、左右方向にスライド動可能なつまみが表示されるようになっている。同つまみをマウスにて移動させることにより、修正領域の半径の大きさを調節可能となっている。本実施形態では、つまみを左側に移動させると半径が小さくなり、右側に移動させると半径が大きくなるようになっている。
【0038】
許容度入力欄91eでも、左右方向にスライド動可能なつまみが表示されるようになっている。同つまみをマウスにて移動させることにより、赤目とする範囲を表す許容度Toleranceを調節可能となっている。本実施形態では、許容度は0〜1の値とされ、つまみを左側に移動させると許容度が小さくなり(左端が0)、右側に移動させると許容度が大きくなるようになっている(右端が1)。
強度入力欄91fでも、左右方向にスライド動可能なつまみが表示されるようになっている。同つまみをマウスにて移動させることにより、明るさを表す強度Intensityを調節可能となっている。本実施形態では、強度は0〜1の値とされ、つまみを左側に移動させると強度が小さくなり(左端が0)、右側に移動させると強度が大きくなるようになっている(右端が1)。
【0039】
領域抽出ボタン91gがマウスにてクリック操作されると、画像から目の領域が自動的に抽出されるようになっている。画像参照ボタン91hがクリック操作されると、赤目が生じていない別の画像から目の色を表す情報が自動的に取得されるようになっている。修正実行ボタン91iがクリック操作されると、設定された条件に応じて赤目部分が目の色に修正されるようになっている。
【0040】
図3に戻って、説明を続ける。色置換手段U4は、取得された修正領域情報に対応する修正領域の画素について、各画素の画像データを置換対象として順次対象画素を移動させながら、赤目部分すなわち対象画素の画像データが範囲情報に対応する範囲内であるときに同赤目部分の画像データから目の色を表す画像データに置換する。ディスプレイに表示する画像を表現する画像データの場合、ガンマ補正が行われているので、逆ガンマ補正を行った後、RGB色空間内における赤目目標色と修正領域の画素の色との距離を算出し、この距離が範囲情報に対応する範囲内であるか否かを判断する。例えば、γ=2.2のガンマ補正された画像データである場合、同画像データの各RGB値をR0,G0,B0(いずれも、0〜255の値)とすると、逆ガンマ補正後の画像データの各RGB値C2r,C2g,C2b(いずれも、0〜255の値)は、以下の演算式により算出することができる。
C2r=255×(R0/255)0.45 ・・・(1)
C2g=255×(G0/255)0.45 ・・・(2)
C2b=255×(B0/255)0.45 ・・・(3)
【0041】
上述した逆ガンマ補正の後に、赤目目標色と修正領域の画素の色との距離Distanceを算出する。ここで、算出式を変更しながら試験を繰り返し行った結果、Nを正の整数として、赤目目標色の座標値をRGBの順にC1r(0≦C1r≦N)、C1g(0≦C1g≦N)、C1b(0≦C1b≦N)、Ravg=(C1r+C2r)/2とするとき、距離Distanceを以下の演算式により算出すると、修正すべき赤目部分を確実に目の色に修正することができ、良好な画質の修正画像を得ることができた。
Distance=[{2+Ravg/(N+1)}×(C1r−C2r)+4×(C1g−C2g)+{2+(N−Ravg)/(N+1)}×(C1b−C2b)1/2・・・(4)
本実施形態では、N=255としているので、以下の演算式により算出することになる。
Distance=[(2+Ravg/256)×(C1r−C2r)+4×(C1g−C2g)+{2+(255−Ravg)/256}×(C1b−C2b)1/2・・・(5)
【0042】
ここで、NをN+1やN−1に変更したり、N+1をNに変更したり等、演算式の各係数の僅かな違いは距離Distanceの値にほとんど影響しない。従って、例えば以下の演算式により距離Distanceを算出してもよい。
Distance=[(2+Ravg/255)×(C1r−C2r)+4×(C1g−C2g)+{2+(255−Ravg)/255}×(C1b−C2b)1/2 ・・・(5’)
また、演算式(4),(5)の右辺に所定係数が乗じられた式であってもよい。この場合であっても、赤目目標色と画素の色との距離を表すことに変わりはない。
【0043】
上記演算式(4),(5)は、良好な修正画像を得ることができる点で良好であるものの、演算処理を簡素化させるために、以下の演算式により距離Distanceを算出してもよい。
Distance={(C1r−C2r)+(C1g−C2g)+(C1b−C2b)1/2・・・(6)
【0044】
距離Distanceが赤目の色とする範囲内であるか否かを判断するにあたり、距離Distanceを0〜1の値に変換している。RGB色空間内におけるRGBの座標を(R,G,B)で表すとき(0≦R≦N、0≦G≦N、0≦B≦N)、図5に示すように、8箇所の各座標(0,0,0)、(0,0,N)、(0,N,0)、(0,N,N)、(N,0,0)、(N,0,N)、(N,N,0)、(N,N,N)と赤目目標色の座標(C1r,C1g,C1b)との距離を上記式(5)によりそれぞれ求め、求めた距離の最大値MaxDistanceを算出し、最大値MaxDistanceに対する距離Distanceの比に基づいて赤目の色とする範囲内であるか否かを判断している。図の例では、N=255であり、座標(255,255,0)と赤目目標色の座標との距離が最も大きくなっている。すなわち、距離の最大値MaxDistanceは、以下の式により算出される値となる。
MaxDistance=[(2+C1r/256)×C1r+4×(C1g−255)+{2+(255−C1r)/256}×(C1b−255)1/2・・・(7)
【0045】
すると、距離の最大値MaxDistanceに対する距離Distanceの比は常に1以下となる。図4で示した設定入力画面から操作入力を受け付けることにより取得される許容度Toleranceは0〜1の値とされるので、Distance/MaxDistance≦Toleranceであるときに赤目の色とする範囲内であると判断し、画像データの置換を行う。このように、距離Distanceの比を基準として画像データが範囲情報に対応する範囲内であるか否かを判断すればよいので、範囲情報を0〜1の範囲で表現することができ、構成を簡易にさせることができる。
【0046】
再び図3に戻って、説明を続ける。距離Distanceの比が許容度Tolerance以下であるとき、対象画素が全て修正領域に含まれる場合には、同対象画素について元の画像データから目の色を表す画像データであって明るさ情報に対応した明るさを表す画像データに置換する。例えば、目の色として黒が選択されている場合、0〜1の値とされた強度Intensityを用いると、置換後の画像データの各RGB値C3r,C3g,C3b(いずれも、0〜255の値)は、置換前のRGB値C2r,C2g,C2bの最小値に強度Intensityを乗じることにより算出することができる。
C3r=C3g=C3b=Minimum(C2r,C2g,C2b)×Intensity ・・・(8)
すると、目の部分に赤目が生じた画像に対して赤目部分の彩度が小さくされ、赤目が目の色に修正されることになる。
【0047】
上記式(8)を用いて画像データを置換することにより、置換前の画像データの値が置換後の画像データの値に反映されるので、赤目修正後の画像の画質を高画質にさせることができる。むろん、画像データを置換する演算を簡素化させるために、以下の演算式のように、所定値に強度Intensityを乗じて置換後の画像データの値を求めてもよい。
C3r=C3g=C3b=255×Intensity ・・・(9)
ここで、強度Intensityは、概略輝度を表すことになり、上記式(8)を用いる場合には間接的に輝度を表すことになる。むろん、輝度を表す際にRGB各成分値に異なる重み付けをすることもあるため、C3r,C3g,C3b別に式(8),(9)の右辺に異なる所定係数を乗じることにより、C3r,C3g,C3bを異なる値にするようにしてもよい。
【0048】
一般的には、目の色の各RGB値をEr,Eg,Ebで表すと、以下の演算式により置換後の画像データのRGB値を算出することができる。
C3r=Er×{Minimum(C2r,C2g,C2b)/255}×Intensity ・・・(10)
C3g=Eg×{Minimum(C2r,C2g,C2b)/255}×Intensity ・・・(11)
C3b=Eg×{Minimum(C2r,C2g,C2b)/255}×Intensity ・・・(12)
または
C3r=Er×Intensity ・・・(13)
C3g=Eg×Intensity ・・・(14)
C3b=Eb×Intensity ・・・(15)
上記式(10)〜(12)では、元の画像データの値が置換後の画像データの値に反映されるので、赤目修正後の画像の画質を高画質にさせることができる。
このように、色置換手段U4は、目の色を表す画像データに置換するにあたり、取得された明るさ情報に対応した明るさを表す画像データに置換する。
【0049】
また、色置換手段U4は、対象画素が修正領域の境界部分である場合には、同対象画素について元の画像データから同目の色を表す画像データに置換するにあたり同画像データの置換量を同対象画素が同修正領域に含まれる度合に応じた量とする。
【0050】
図6は、修正領域の境界部分における画像データの置換処理を説明する図である。ここで、修正領域50は、中心座標51を中心とした略円形の領域とされている。修正領域内の画素52は、全ての部分が修正領域50に含まれる画素である。すなわち、画素52の画像データは、上述した演算式(8)〜(15)により求められる。一方、図中点線で示した修正領域外の画素54は、全ての部分が修正領域50から外れた画素である。従って、画素54の画像データは、置換されない。
境界部分の画素53は、内部が修正領域50の境界部分となる画素である。画素53については、画像データを置換するにあたり、画像データの置換割合を同画素53が修正領域50に含まれる割合とする。具体的には、以下のようにして置換割合を決定して画像データを置換する。
【0051】
まず、画素53を、横m1×縦n1(m1,n1は2以上の整数)の所定数の区分領域55に略等分割する。本実施形態では、m1=n1=4とし、画素53を16の区分領域55に等分割している。次に、画素53別に、区分領域55の中心が修正領域50の内部となる区分領域の数n2を求める。そして、画素53の全区分領域の数16に対する求めた区分領域の数n2の割合、すなわち、n2/16を画像データの置換割合Pとする。例えば、図に示す画素53a,bの場合、それぞれ中心が修正領域50の内部となる区分領域の数n2は8,13であるので、画像データの置換割合Pは8/16、13/16となる。
【0052】
ここで、一旦上記式(8)〜(15)により各RGB値C3r,C3g,C3bを算出するとともに、RGB色空間内の画像データとなるRGB値C3r,C3g,C3bをHIS色空間内の画像データの各成分値H3,I3,S3に変換し、元の画像データのRGB値C2r,C2g,C2bをHIS色空間内の画像データの各成分値H2,I2,S2に変換する。なお、H2,H3は色相(Hue)の成分値であり、I2,I3は輝度(Intensity)の成分値であり、S2,S3は彩度(Saturation)の成分値である。具体的には、A1を3×3の所定の行列として、以下の演算式により、H2,H3,I2,I3,S2,S3を算出することができる。
【数1】

Figure 2004164276
【0053】
そして、算出したH2,H3,I2,I3,S2,S3と、置換割合Pとを用いて、HIS色空間における置換後の画像データの各成分値H4,I4,S4を算出する。
H4=H2 ・・・(18)
I4=I2−(I2−I3)×P ・・・(19)
S4=S2−(S2−S3)×P ・・・(20)
その後、HIS色空間内の画像データの各成分値H4,I4,S4をRGB色空間内の画像データの各成分値C4r,C4g,C4bに戻す。
【数2】
Figure 2004164276
【0054】
このように、修正領域の境界部分である画素について元の画像データから目の色を表す画像データに置換するにあたり、画像データの置換割合は同画素が修正領域に含まれる割合とされる。
これにより、修正領域の境界部分が赤目の色とする範囲内であるときに画像データは完全には目の色に置き換えられないので、修正領域の内外で色は急変せず、スムーズに変化する。その結果、より確実に違和感を感じさせないように赤目を修正することが可能となる。
【0055】
さらに、色置換手段U4は、赤目が生じていない別の画像の画像データを取得し、取得した画像データに基づいて同別の画像から虹彩の領域を決定し、決定した領域の画像データに基づいて目の色を表す情報を取得することも可能である。これにより、赤目が生じていない別の画像から目の色を表す情報が取得され、修正領域のうち赤目部分がこの目の色に修正され、より確実に違和感を感じさせないように赤目を修正することが可能となる。
【0056】
なお、逆ガンマ補正を行った画像データに対して赤目部分を目の色を表す画像データに置換した場合、ガンマ補正が行われた画像データに戻す処理を行う。ガンマ補正後の画像データの各RGB値R1,G1,B1(いずれも、0〜255の値)は、以下の演算式により算出することができる。
R1=255×(C4r/255)2.2 ・・・(22)
G1=255×(C4g/255)2.2 ・・・(23)
B1=255×(C4b/255)2.2 ・・・(24)
【0057】
(3)赤目修正装置の動作:
図7は、各種手段U1〜U4が行う赤目修正処理をフローチャートにより示している。以下、同フローチャートに従って赤目修正装置が行う処理の詳細を説明する。
本実施形態にかかる赤目修正プログラムを起動させると、まず、修正前のカラーの画像を表現する画像データを入力し、図4で示した設定入力画面をディスプレイに表示する(ステップS105。以下、「ステップ」の記載を省略)。なお、十字ポインタ91bの位置、目の色選択欄91c、各種入力欄91d〜fについては、デフォルトの条件または前回入力された条件にて表示する。また、目の色選択欄91cで「別の画像」が選択入力された場合のみ、領域抽出ボタン91gをクリック操作可能とする。
【0058】
入力した画像データは、画像表示欄91aに表示される。入力する画像データは、デジタルカメラ30や図示しないスキャナやビデオカメラ等にて取り込まれた画像のデータであってもよいし、FD16a等に記録した画像データであってもよい。また、デジタルカメラ等から画像データを入力する場合、データ全体を一括して読み込む必要はなく、部分的に読み込むようにしてもよいし、他のAPLから呼び出されるような場合にはデータの受け渡しに利用されるバッファ領域を表すポインタの受け渡しだけであってもよい。
【0059】
設定入力画面を表示すると、目の色選択欄91cに目の色の選択入力が行われたか否かを判断する(S110)。目の色を選択する入力を受け付けていないときにはS130に進み、目の色を選択する入力を受け付けたときにはS115に進む。S115では、同選択欄91cから「別の画像」が選択入力されたか否かを判断する。「別の画像」を選択する入力を受け付けた場合には、目の色決定処理を行い(S120)、S130に進む。
【0060】
図8は目の色決定処理をフローチャートにより示しており、図9は目の色が決定される様子を模式的に示している。まず、画像参照ボタン91hがクリック操作されると、図示しない画像ファイル選択画面を表示し、赤目が生じていない画像の画素別とされた画像データを記憶した画像ファイルの選択入力を受け付けることにより画像ファイルの画像データをRAMに読み出し、赤目が生じていない別の画像61の画像データを取得する(S205)。次に、別の画像61の画像データに基づいて、白目を含む目の領域62を決定する(S210)。例えば、肌色の領域を抽出し、抽出した肌色の領域に囲まれた領域が所定の目の形状と略一致するときに、その囲まれた領域を白目を含む目の領域と決定する。
さらに、白目を含む目の領域62の画素の画像データに基づいて、別の画像61から虹彩の領域63を決定する(S215)。例えば、白目の領域(例えば、画像データの各RGB値が所定値以上となる画素の領域)を抽出し、抽出した白目の領域を除いた目の領域を虹彩の領域と決定する。
【0061】
そして、虹彩の領域63の画像データに基づいて、目の色を表す情報を取得し(S220)、本フローを終了する。ここで、目の色を表す情報は、様々考えられ、例えば、虹彩の領域の全画素について画像データの各RGB値をそれぞれ平均して一様にしたデータとしてもよいし、虹彩の模様を残すように虹彩の領域における画素別の画像データとしてもよい。
このように、各画素の画像データに基づいて画像から目の領域が修正領域として決定されるので、自動的に赤目を修正する領域が抽出され、赤目を修正する作業が軽減されて、便利である。また、赤目が生じていない別の画像から目の色を表す情報が取得され、赤目部分は赤目が生じていない別の画像の目の色に修正されるので、より確実に違和感を感じさせないように赤目を修正することが可能となる。
【0062】
S115にて、「別の画像」以外を選択する入力を受け付けた場合、S125に進んで目の色を表す情報を取得する。ここで、黒、茶、青等の複数の目の色からいずれかを選択する入力を受け付けた場合には、対応する目の色の各RGB値Er,Eg,Eb(置換後の色を表す情報)を取得する。ユーザ設定が選択入力された場合には、色パレットを表示し、色パレットへの操作入力を受け付けて対応する目の色のRGB値Er,Eg,Ebを取得する。地域別の人が選択入力された場合には、地域を表す情報とその地域の人の目の色を表すRGB値とを対応させた図示しない地域別目の色テーブルを参照して、選択入力された地域の人に対応する目の色を表すRGB値Er,Eg,Ebを取得する。
このように、目の色を選択することができるし、入力された地域の人に対応する目の色にも修正可能となるので、便利である。従って、赤目部分をより希望に沿った目の色に置換することができ、より確実に違和感を感じさせないように赤目を修正することが可能となる。
【0063】
その後、S130に進み、さらに各種パラメータを順次取得し、各種ボタン91g〜jへの操作に応じた処理を行っていく。S130では、十字ポインタ91bを移動させることにより赤目の中心位置を指定する操作入力を受け付けたとき、十字ポインタ91bを対応する位置に移動させて表示するとともに、画像表示欄91aに表示された画像における十字ポインタ91bの位置に対応する情報を赤目の中心座標を表す情報として取得する。
S135では、半径入力欄91dにて修正領域の半径を設定する操作入力を受け付けたとき、つまみの位置に対応する数値の半径Radiusを取得する。そして、十字ポインタ91bを同半径Radiusに略比例した大きさとして表示する。
赤目の中心座標を表す情報と半径Radiusとは、赤目を修正する修正領域を表す修正領域情報となる。すなわち、PC10が行うS105,S130〜S135の処理は、修正領域取得手段を構成する。
【0064】
S140では、許容度入力欄91eにて赤目とする範囲を設定する操作入力を受け付けたとき、つまみの位置に対応する数値の許容度Toleranceを取得する。許容度Toleranceは、RGB色空間内において赤目の色とする範囲が所定の赤目目標色からの距離として表された範囲情報である。すなわち、PC10が行うS105,S140の処理は、赤目範囲取得手段を構成する。
【0065】
S145では、強度入力欄91fにて画像データの明るさを設定する操作入力を受け付けたとき、つまみの位置に対応する数値の強度Intensityを取得する。強度Intensityは、置換後の画像データの明るさを表す明るさ情報である。すなわち、PC10が行うS105,S145の処理は、明るさ情報取得手段を構成する。
【0066】
目の色選択欄91cで「別の画像」が選択入力された場合、領域抽出ボタン91gをクリック操作可能とする。そして、S150にて、領域抽出ボタン91gがクリック操作されたか否かを判断する。同ボタン91gがクリック操作された場合には、S155の目の領域決定処理を行った後、S160に進む。同ボタン91gがクリック操作されていない場合は、S155の処理を行わずにS160に進む。
S155の目の領域決定処理では、各画素の画像データに基づいて画像から目の領域を決定し、当該領域を表す情報を修正領域情報として取得する。例えば、図9で示したように、肌色の領域を抽出し、抽出した肌色の領域に囲まれた領域が所定の目の形状と略一致するときに、その囲まれた領域を目の領域(白目を含む)と決定し、当該目の領域を表す情報を修正領域情報として取得する。すなわち、PCが行うS150,S155の処理は、別の意味での修正領域取得手段を構成する。
【0067】
S160では、修正実行ボタン91iがクリック操作されたか否かを判断する。同ボタン91iがクリック操作された場合には、S165の色置換処理を行った後、S170に進む。同ボタン91gがクリック操作されていない場合は、S165の処理を行わずにS170に進む。
図10は、S165で行う色置換処理をフローチャートにより示している。
まず、上記式(7)を用いて、各座標(0,0,0)、(0,0,255)、(0,255,0)、(0,255,255)、(255,0,0)、(255,0,255)、(255,255,0)、(255,255,255)と赤目目標色の座標(C1r,C1g,C1b)との距離を上記式(5)によりそれぞれ求め、求めた距離の最大値MaxDistanceを算出する(S305)。ここで、座標(C1r,C1g,C1b)は逆ガンマ補正を基準とする座標であるので、算出される最大値MaxDistanceは逆ガンマ補正が行われた画像データを基準とした値となる。
【0068】
次に、取得された修正領域情報に対応する修正領域内で、画像データの置換対象とする対象画素を設定する(S310)。修正領域情報が修正領域の半径を表す情報と修正領域の中心座標を表す情報とから構成されている場合、これらの情報に対応した円形の領域に少しでも含まれる画素を抽出して修正領域とし、同修正領域の中から対象画素を設定する。そして、順次対象画素を移動させながら、対象画素の画像データを置換する処理を行う。本実施形態では、多数の画素が上下左右方向に整然と並んでおり、画像データの置換処理の順序は、最も上の左端の画素から開始して順番に右端の画素までとし、その後一つずつ下の左端の画素から順番に右端の画素までとして、最後に最も下の右端の画素としている。むろん、置換処理の順序は、適宜変更可能である。
【0069】
入力される画像データ(RGB値R0,G0,B0)はガンマ補正が行われているので、対象画素を設定した後は、上記式(1)〜(3)を用いて逆ガンマ補正を行い、各RGB値C2r,C2g,C2bを算出する(S315)。その後、上記式(5)を用いて、赤目目標色(RGB値C1r,C1g,C1b)と修正領域の画素の色(RGB値C2r,C2g,C2b)との距離Distanceを算出する(S320)。そして、距離Distanceが範囲情報に対応する距離内であるか否か、すなわち最大値MaxDistanceに対する距離Distanceの比が許容度Tolerance以下であるかを判断する(S325)。同比が許容度Toleranceより大きければ、赤目部分ではないと判断して画像データの置換を行わず、S350に進む。一方、同比が許容度Tolerance以下であれば、赤目部分であると判断してS330に進み、画像データの置換を行う。このように、対象画素の色が赤目目標色から範囲情報に対応する距離内であるときに画像データが置換されるので、確実に修正すべき赤目部分を目の色に修正することが可能である。
【0070】
S330では、対象画素が修正領域の境界部分であるか否かを判断する。境界部分でなければS335に進み、境界部分であればS340に進んで境界色置換処理を行う。
対象画素が全て同修正領域に含まれる場合に行われるS335では、上記式(10)〜(12)を用いて、元の画像データ(RGB値C2r,C2g,C2b)を、強度Intensityに対応した明るさの目の色を表す画像データ(RGB値C3r,C3g,C3b)に置換し、S345に進む。すると、対象画素が全て修正領域に含まれる場合に対象画素について赤目部分であれば目の色に修正されることになる。また、強度Intensityの設定に応じて置換後の画像データに基づく画像の明るさを調整することができるので便利であるとともに、さらに違和感なく赤目を修正することが可能となる。さらに、選択入力を受け付けることにより置換後の色を表す情報を取得した場合には、置換後の色を表す情報に対応した色となるように画像データを置換するので、赤目部分を希望に沿った目の色に置換することができ、便利であるとともに、より確実に違和感を感じさせないように赤目を修正することが可能となる。
【0071】
一方、対象画素が修正領域の境界部分である場合、図11に示す境界色置換処理を行い(S340)、S345に進む。
まず、対象画素を4×4の区分領域に等分割し、中心が修正領域の内部となる区分領域の数n2を算出する(S405)。次に、区分領域全ての数である16に対する算出した数n2の割合を算出して画像データの置換割合Pとする(S410)。
さらに、上記式(10)〜(12)を用いて、元の画像データ(RGB値C2r,C2g,C2b)を、強度Intensityに対応した明るさの目の色を表す画像データ(RGB値C3r,C3g,C3b)に仮に置換する(S415)。
その後、置換前後のRGB色空間の画像データを、HIS色空間の画像データに変換する(S420)。すなわち、上記式(16),(17)を用いて、RGB値C2r,C2g,C2bをHIS色空間の画像データの各成分値H2,I2,S2に変換し、RGB値C3r,C3g,C3bをHIS色空間の画像データの各成分値H3,I3,S3に変換する。
【0072】
そして、上記式(18)〜(20)を用いて、画像データの置換割合を対象画素が修正領域に含まれる割合とするように置換後の画像データの各成分値H4,I4,S4を算出する(S425)。
その後、上記式(21)を用いて、HIS色空間の画像データの各成分値H4,I4,S4を各RGB値C4r,C4g,C4bに変換し、RGB色空間の画像データに戻して(S430)、本フローを終了する。
すると、対象画素が修正領域の境界部分である場合には、画像データの置換量は対象画素が修正領域に含まれる割合とされる。すなわち、簡易な構成ながら修正領域の境界部分を自然な感じにさせるように境界部分の画素の画像データを置換することができる。言い換えると、画像データは完全には目の色を表すデータに置き換えられないので、赤目を修正する領域の内外で色は急変せず、スムーズに変化することになる。
【0073】
図10に戻って、説明を続ける。置換後の画像データ(RGB値C3r,C3g,C3bまたはC4r,C4g,C4b)は、ガンマ補正が行われていないデータであるので、S345では、上記式(22)〜(24)を用いて、同画像データに対してガンマ補正を行い、ガンマ補正後の画像データ(RGB値R1,G1,B1)を算出する。
その後、修正領域内の画素全てについて、S310〜S345の処理を行ったか否かを判断する(S350)。同処理を修正領域内の全画素について行ったときには本フローを終了し、全画素について行っていないときには繰り返しS310〜S350の処理を行う。
このように、PC10が行う図7のS105〜S125,S165処理は、色置換手段を構成する。
【0074】
例えば図12に示すように、赤目の色とする範囲が修正領域50の内外にわたって存在するとき、全て修正領域50に含まれる画素52については元の画像データから目の色を表す画像データに置換され、赤目部分が目の色に修正される。一方、修正領域50から完全に外れた画素54については元の画像データのままとされ、目の色には修正されない。ここで、修正領域50の境界部分の画素53については、同画素53が修正領域50に含まれる割合で画像データが置換されるので、画像データは完全には目の色を表すデータに置き換えられない。従って、赤目を修正する領域の内外で色は急変せず、スムーズに変化する。その結果、目の部分に赤目が生じた画像に対して、より確実に違和感を感じさせないように赤目を修正することが可能となる。
【0075】
図7のS160またはS165終了後、保存ボタン91jがクリック操作されたか否かを判断する(S170)。同ボタン91jがクリック操作された場合には、S175に進み、HD14に画像データを記憶し、本フローを終了する。一方、同ボタン91jがクリック操作されていない場合は、S110に戻る。
【0076】
(4)まとめ:
以上説明したように、本赤目修正装置のユーザは、十字ポインタにより赤目の位置を指定するとともに半径、許容度、強度等を設定する入力を行うことにより、容易に赤目を修正することが可能である。そして、赤目を修正する領域の境界部分が赤目の色とする範囲内であるときに画像データは完全には目の色を表すデータに置き換えられないので色はスムーズに変化するし、置換後の画像データは明るさ情報に対応した明るさを表す画像データとなる。また、赤目部分を赤目が生じていない別の画像の目の色に修正することもできる。従って、確実に違和感を感じさせないように赤目を修正することができ、本赤目修正装置は利便性の大きな装置となっている。
【0077】
なお、本発明の赤目修正プログラムを実行可能な赤目修正装置と周辺装置は、様々な構成が可能である。
例えば、プリンタは、コンピュータと一体化されたものであってもよいし、単色画像のみを印刷する専用品であってもよい。上述したフローについては、PC内で実行する以外にも、一部または全部をプリンタあるいは専用の画像出力機器で実行するようにしてもよい。
本発明によると、赤目を修正するために有用な赤目修正装置および赤目修正プログラムを提供することができる。また、赤目修正方法としても適用可能である。
【図面の簡単な説明】
【図1】赤目修正装置と周辺装置とからなるシステムの概略構成を示すブロック図。
【図2】プリンタのブロック構成をPCとともに示す図。
【図3】赤目修正装置を構成する各種手段を模式的に示す図。
【図4】設定入力画面の表示例を示す図。
【図5】距離の最大値MaxDistanceを示す模式図。
【図6】修正領域の境界部分における画像データの置換処理を説明する図。
【図7】赤目修正処理を示すフローチャート。
【図8】目の色決定処理を示すフローチャート。
【図9】目の色が決定される様子を模式的に示す図。
【図10】色置換処理を示すフローチャート。
【図11】境界色置換処理を示すフローチャート。
【図12】赤目の色とする範囲が修正領域の内外にわたって存在する場合において、修正後の画像の様子を模式的に示す図。
【符号の説明】
10…パーソナルコンピュータ、11…CPU、12…ROM、13…RAM、14…ハードディスク、17a〜e…インターフェイス、18a…ディスプレイ、18b…キーボード、18c…マウス、20…インクジェットプリンタ、30…デジタルカメラ、50…修正領域、51…中心座標、52…修正領域内の画素、53…境界部分の画素、54…修正領域外の画素、55…区分領域、61…別の画像、62…白目を含む目の領域、63…虹彩の領域、U1…修正領域取得手段、U2…赤目範囲取得手段、U3…明るさ情報取得手段、U4…色置換手段[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a red-eye correction device, a red-eye correction method, and a red-eye correction program that correct red eye that has occurred in a color image represented by multi-gradation image data for a large number of pixels.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, when a person is photographed with a digital camera or the like by emitting a strobe light in a dark environment such as at night, red eyes may occur in a human eye. Red-eye refers to a phenomenon in which a so-called black-eye portion becomes red or gold. As a device for correcting such red-eye, a rectangular region to be subjected to red-eye correction is designated, and a portion where the hue is within a predetermined range and the saturation is equal to or more than a predetermined value is automatically extracted as a red-eye region from the rectangular region, and black, blue, There is known an apparatus for converting a color into a predetermined color such as (for example, see Patent Document 1). This apparatus allows a user to manually specify a red-eye area when a red-eye area cannot be automatically extracted, thereby improving the operation efficiency of red-eye correction.
A technique for automatically extracting an eye area from an area including the eye is also known (for example, see Patent Document 2).
[0003]
[Patent Document 1]
JP 2001-148780 A (paragraphs 0019-0052, FIG. 1-7)
[Patent Document 2]
JP-A-10-75374 (Paragraph 0015-0049, FIG. 1-3)
[0004]
[Problems to be solved by the invention]
In the above-described conventional technique, there is a problem that an uncomfortable feeling is felt when an image in which the red-eye region is replaced with a predetermined color is seen. In particular, since the non-red-eye area is also uniformly replaced with a predetermined color, an image with a great sense of incongruity will occur if a portion where the color changes abruptly between the inside and the outside of the red-eye corrected area. Therefore, there has been a desire to correct the red-eye so as not to make the image with the red-eye appear uncomfortable.
The present invention has been made in view of the above problems, and has a red-eye correction device and a red-eye correction device capable of correcting red-eye more reliably so as not to cause a sense of incongruity in an image in which red-eye occurs in an eye portion. The aim is to provide a method and a red-eye fix.
[0005]
[Means for Solving the Problems]
In order to achieve the above object, the invention according to claim 1 obtains correction area information representing a correction area for correcting red eye in a color image represented by image data in which multiple gradations are set for each of a large number of pixels. Correction area obtaining means, red eye range obtaining means for obtaining range information representing a range to be a red eye color in the color space of the image data, and the pixel of the correction area corresponding to the obtained correction area information. When the image data is within the range corresponding to the acquired range information, the original image data is replaced with image data representing the eye color. And a color replacement unit that sets the data replacement amount to an amount corresponding to the degree that the pixel is included in the correction area.
[0006]
The present red-eye correction apparatus corrects red-eye generated in a color image represented by image data in which multiple gradations are set for each of a large number of pixels. Here, correction area information indicating a correction area for correcting red eye in the image is obtained by the correction area obtaining means, and range information indicating a range to be a red eye color in the color space of the image data by the red eye range obtaining means. Is obtained. When the image data of the pixel in the correction area corresponding to the obtained correction area information is within the range corresponding to the obtained range information, the image data is replaced as follows.
In other words, the original image data is replaced with image data representing the color of the eyes. If the replacement target pixel is a boundary portion of the correction area, the replacement amount of the image data includes the pixel in the correction area. The amount depends on the degree.
Therefore, since the image data is not completely replaced with the data representing the eye color when the boundary portion of the red-eye correction area is within the range of the red-eye color, the color inside and outside the red-eye correction area is Does not change suddenly and changes smoothly. As a result, it is possible to more reliably correct red-eye in an image in which red-eye occurs in the eye portion so as not to make the user feel uncomfortable.
[0007]
Various colors such as black, brown, and blue can be considered as the eye color. The color of the eye to be replaced may be uniform, may have a pattern, or the iris portion and the pupil portion may be different colors so as to achieve higher image quality.
[0008]
When the red-eye correction device is configured by the various means described above, it may be configured as in the invention according to claim 2. The present red-eye correcting apparatus corrects red-eye generated in a color image represented by multi-gradation image data for each of a plurality of element colors for each of a large number of pixels in a dot matrix. Here, with respect to the pixels in the correction area corresponding to the obtained correction area information, the target pixels are sequentially moved with the image data of each pixel as a replacement target. Then, when the image data of the target pixel is within the range corresponding to the acquired range information, the image data is replaced as follows.
That is, when all the target pixels are included in the correction region, the target pixel is replaced with the image data representing the eye color from the original image data. On the other hand, when the target pixel is a boundary portion of the correction area, the replacement amount of the image data includes the target pixel in the correction area when the target pixel is replaced from the original image data to the image data representing the eye color. The amount depends on the degree to which the Therefore, by the same operation as described above, the color does not change abruptly inside and outside the area where the red-eye is corrected, but changes smoothly.
[0009]
The plurality of element colors can be variously considered. For example, the plurality of element colors may be composed of three colors of red (R), green (G), and blue (B), or may be obtained from luminance data, blue color difference data, and red color difference data. It may be configured. It may be composed of three colors of cyan (C), magenta (M) and yellow (Y), or may be composed of four colors including black (K). Further, it may be composed of lightness data and two kinds of chromaticity data like each component of the Lab space independent of the device.
[0010]
Here, when the pixel is a boundary portion of the correction area, the color replacement unit sets a replacement ratio of the same image data in replacing the original image data with the image data representing the eye color for the same pixel. The configuration may be such that the same pixel is included in the correction area. That is, the ratio of replacement of the original image data with image data representing the color of the eyes in the pixels at the boundary portion is the ratio of the pixel included in the correction region. The image data of the pixel at the boundary can be replaced so as to make the image look like this.
[0011]
Further, as an example of replacing the image data of the pixel at the boundary portion, the color replacing means substantially equally divides the pixel into a predetermined number of divided regions, and the same divided region whose center is inside the corrected region. It is also possible to adopt a configuration in which the ratio to all the numbers is set as the replacement ratio of the image data. That is, the pixel is divided substantially equally into a predetermined number of divided areas, and the ratio of replacement of the original image data with the image data representing the eye color in the pixels at the boundary portion is determined by the number of divided areas whose center is inside the correction area. The ratio can be easily obtained.
[0012]
When brightness information obtaining means for obtaining brightness information representing the brightness of the image data after replacement is provided, the color replacement means replaces the image data with image data representing brightness corresponding to the obtained brightness information. It may be. That is, the replaced image data is image data representing the brightness corresponding to the brightness information.
Here, the brightness information obtaining means receives an operation input for setting the brightness of the image data after replacement by the color replacement means, and obtains the brightness information as information representing the same brightness, The color replacement means may be configured to replace the image data with the image data representing the color of the eyes by using image data to be converted into an image having a luminance corresponding to the acquired brightness information. That is, the image data after the replacement is image data to be converted into an image having a brightness corresponding to the brightness information. Therefore, the brightness of the replaced image data can be adjusted according to the brightness information, so that the convenience is improved and the red-eye can be corrected without a sense of discomfort.
[0013]
By the way, as an example of the correction area, the correction area is a substantially circular area, and the correction area information is composed of information indicating the diameter of the correction area having a substantially circular shape and information indicating the center coordinates of the correction area in the image. May be. Here, the information indicating the diameter may be information indicating the diameter or information indicating the radius.
As an example of a configuration for obtaining the correction area information as described above, the correction area obtaining unit receives an operation input for setting a radius of the substantially circular correction area and obtains information indicating the diameter, Information representing the center coordinates may be obtained by receiving an operation input for displaying the image and specifying the center position of the red eye of the displayed image. Then, the user can set the correction area with a simple configuration.
Of course, the correction area may have various shapes other than the circular area as described above. For example, the correction area may be an elliptical area, a rectangular area, a polygonal area, or the like.
[0014]
Various configurations are also conceivable for the range information indicating the range for the red-eye color. As an example, the range information is information in which a range to be a red-eye color in the color space of the image data is represented as a distance from a predetermined red-eye target color, and the color replacement means includes: From the coordinates of the target red-eye color and the image data of the pixels in the correction area, calculate the distance between the target red-eye color and the color of the same pixel, and the distance is within the distance corresponding to the acquired range information. At this time, the image data may be replaced. That is, the distance between the target red-eye color and the color of the pixel is calculated, and the image data is replaced when the distance is within the distance corresponding to the range information.
[0015]
The invention according to claim 8, as an example of a preferred arithmetic expression for calculating the distance Distance between the target red-eye color and the color of the pixel when the image data is data with multiple gradations for each of RGB. May be configured. Here, since a slight difference in each coefficient of the arithmetic expression, such as changing N to N + 1 or N-1 or changing N + 1 to N, hardly affects the value of the distance Distance, it is described in claim 8. Included in the invention. Further, even an expression obtained by multiplying the right side of the above-mentioned arithmetic expression by a predetermined coefficient represents the distance between the target red-eye color and the color of the pixel, and is included in the invention described in claim 8.
[0016]
As an example of a preferred configuration for determining whether or not the image data of the pixel in the correction area is within the distance corresponding to the range information using the above arithmetic expression, a configuration as in the invention according to claim 9 is provided. You may. It is sufficient to determine whether or not the image data is within the range corresponding to the range information based on the ratio of the distance Distance to the longest distance from the red-eye target color in the color space of the image data. It can be in the range of 1.
[0017]
When a plurality of eye colors for replacing the image data are provided, the color replacement unit receives an input for selecting any one of the plurality of eye colors and acquires information representing the replaced color. Alternatively, the image data may be replaced so as to have a color corresponding to the information. Then, the red-eye portion can be replaced with a more desired eye color.
Alternatively, a selection input of a country or region of a person or the like may be received and replaced with image data of an eye color corresponding to the input person. Then, it is possible to correct the eye color to be optimal for the person.
[0018]
By the way, the correction area obtaining means may determine an eye area from the image based on the image data of each pixel, and obtain information representing the area as the correction area information. That is, since the eye region is determined as the correction region from the image based on the image data of each pixel, the region for correcting the red eye is automatically extracted. The determined eye region may be a region including the white eye or an iris region.
[0019]
Further, the color replacement means obtains image data of another image having no red-eye, determines an iris region from the another image based on the image data, and determines the iris region based on the image data of the region. Acquires information representing the color of the eye and, when the image data is within the range corresponding to the acquired range information for the pixels in the correction area, corresponds to the information representing the color of the same eye from the original image data. In the case where the image data is replaced with the image data and the pixel is a boundary portion of the correction area, the replacement amount of the image data may be set to an amount corresponding to the degree of the pixel included in the correction area. Information representing the eye color is obtained from another image free of red eye, and the red eye portion is corrected to this eye color.
Here, it may be determined whether or not the person in the image whose red eye is to be corrected and another image are the same person, and when the person is the same person, the image data may be replaced.
[0020]
As described above, when the information representing the eye color is acquired from another image to correct the red-eye, the user does not feel uncomfortable more reliably. That is, image data of another image without red eye is obtained, an iris region is determined from another image based on the obtained image data, and an eye color is determined based on the image data of the determined region. The information to represent is obtained. For the pixel of the correction area corresponding to the obtained correction area information, when the image data is within the range corresponding to the obtained range information, the image data is converted from the original image data to information representing the eye color from another image. Replaced with the corresponding image data. In other words, information representing the eye color is obtained from another image having no red eye, and the red eye portion is corrected to this eye color.
[0021]
Further, if the brightness information acquiring means is provided, the image data after replacement becomes image data representing the brightness corresponding to the brightness information, and the red-eye can be corrected without a sense of discomfort. You may comprise like the invention concerning item 14. That is, when the image data of the pixel of the correction area corresponding to the acquired correction area information is within the range corresponding to the acquired range information, the image data represents the eye color from the original image data. Is replaced with image data representing the brightness corresponding to the acquired brightness information.
[0022]
By the way, the above-described red-eye correction device may be implemented alone, or may be implemented together with another method while being incorporated in a certain device, and the concept of the invention includes various aspects. And can be changed as appropriate.
Further, in the above-described technique for correcting red-eye, processing proceeds according to a predetermined procedure, and it is natural that an invention exists in the procedure at the root. Therefore, the present invention can be applied as a method, and the invention according to claims 15 to 17 has basically the same operation.
[0023]
When implementing the present invention, a predetermined program may be executed by the red-eye correction device. Therefore, the present invention can be applied as the program, and the invention according to claims 18 to 20 has basically the same operation. Further, a medium on which the program is recorded may be distributed, and the program may be read from the recording medium into a computer as appropriate. That is, the present invention can be applied as a computer-readable recording medium on which the program is recorded, and basically has the same operation.
Of course, it is needless to say that the configurations described in claims 2 to 12 can be made to correspond to the method, the program, and the medium on which the program is recorded. Here, the recording medium may be any recording medium to be developed in the future, in addition to a magnetic recording medium and a magneto-optical recording medium. The duplication stage of the primary duplicated product, the secondary duplicated product, etc. does not matter. The scope of the present invention includes a case in which a part is realized by hardware, and a case in which a part is recorded on a recording medium and read as needed.
[0024]
【The invention's effect】
As described above, according to the first, second, and thirteenth to twentieth aspects of the present invention, it is possible to more reliably prevent a user from feeling uncomfortable with an image in which red-eye occurs in an eye portion. Red eyes can be corrected.
According to the invention according to claim 3, it is possible to make the boundary portion of the correction area look natural with a simple configuration.
According to the fourth aspect of the invention, it is possible to provide a simple example of a process of replacing image data of a pixel at a boundary portion.
According to the fifth aspect of the present invention, the brightness of the corrected image can be adjusted according to the brightness information, so that the convenience is improved and the red-eye can be corrected without a sense of discomfort.
[0025]
According to the invention according to claim 6, the correction area can be easily specified with a simple configuration.
According to the seventh aspect of the present invention, the image data is replaced when the pixel color is within the distance corresponding to the range information from the target red-eye color. Can be modified.
According to the invention according to claim 8, it is possible to provide a suitable arithmetic expression for calculating the distance between the target red-eye color and the color of the pixel, and correct the red-eye portion to be corrected more reliably with the eye color. As a result, it is possible to obtain a corrected image having good image quality.
According to the ninth aspect of the present invention, the red-eye range can be expressed in the range of 0 to 1, so that the configuration can be simplified.
[0026]
According to the tenth aspect of the present invention, the red-eye portion can be replaced with a more desired eye color, the convenience is improved, and the red-eye can be corrected so as not to make the user feel uncomfortable. It becomes possible.
According to the eleventh aspect of the present invention, the region for correcting the red eye is automatically extracted, so that the work for correcting the red eye is reduced, and the convenience is improved.
According to the twelfth aspect of the present invention, the red-eye portion is corrected to the eye color of another image in which the red-eye is not generated, so that the red-eye can be corrected more reliably so as not to make the user feel uncomfortable.
[0027]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in the following order.
(1) System configuration including red eye correction device:
(2) Configuration of red-eye correction device:
(3) Operation of the red-eye correction device:
(4) Summary:
[0028]
(1) System configuration including red eye correction device:
FIG. 1 shows a schematic configuration of a system including a red-eye correction device and peripheral devices according to an embodiment of the present invention. This system includes a personal computer (PC) 10 as a red-eye correction device according to the present invention, an inkjet printer 20 capable of color printing as an image output device, a digital camera 30, and the like. The present red-eye correction device is a device that corrects red eye that occurs in an eye portion when a person is photographed by a digital camera or the like into an eye color, and is configured so that a user can easily correct red eye. The user of the present red-eye correction device is assumed to be an amateur in computer image correction, and includes a professional photographer and the like. Of course, even a person who is familiar with computer image correction can easily correct red-eye with this apparatus.
The PC 10 includes a CPU 11 which is a center of arithmetic processing, and the CPU 11 controls the entire PC 10 via a system bus 10a. The bus 10a is connected to a ROM 12, a RAM 13, a CD-ROM drive 15, a flexible disk (FD) drive 16, various interfaces (I / F) 17a to 17e, and the like. A hard disk (HD) 14 is also connected via a hard disk drive. Although a so-called desktop PC is adopted as the computer of the present embodiment, a computer having a general configuration can be adopted as the computer.
[0029]
The HD 14 stores an operating system (OS), an application program (APL), and the like as software. At the time of execution, the CPU 11 transfers the software to the RAM 13 as appropriate, and executes the program while appropriately accessing the RAM 13 as a temporary work area. Note that the red eye correction program of the present embodiment realizes various functions in cooperation with the APL and the OS, but may be a single APL or may be incorporated in the OS.
A digital camera 30, a color scanner (not shown), and the like are connected to the peripheral device I / F (PIF) 17a. The CRTI / F 17b is connected to a display 18a which is a display means for displaying an image based on image data, and the input I / F 17c is connected to a keyboard 18b and a mouse 18c as operation input devices. The printer 20 is connected to the printer I / F 17e via, for example, a parallel I / F cable.
Note that the HD 14 is a medium on which the red-eye correction program according to the present invention is recorded, and the medium may be, for example, a CD-ROM, an FD 16a, a magneto-optical disk, a nonvolatile memory, or the like. Of course, it is also possible to connect the communication I / F 17d such as a modem to the Internet network and access a predetermined server to download and execute the red-eye correction program.
[0030]
The printer 20 that prints an image on which red-eye has been corrected prints on a medium using cyan (C), magenta (M), yellow (Y), and black (K) inks. Needless to say, various image output devices such as a printer using inks other than four colors, a bubble type printer that generates ink in an ink passage to discharge ink, and a laser printer can be adopted.
As shown in FIG. 2, in the printer 20, a CPU 21, a ROM 22, a RAM 23, a communication I / O 24, a control IC 25, an ASIC 26, an I / F 27, and the like are connected via a bus 20a. The communication I / O 24 is connected to the printer I / F 17e of the PC 10, and the printer 20 receives the CMYK-converted data transmitted from the PC 10 via the communication I / O 24 and a print job composed of a page description language or the like. . The ASIC 26 outputs applied voltage data based on the CMYK data to the head driving unit 26a while transmitting and receiving predetermined signals to and from the CPU 21. Then, the head driving unit 26a generates a voltage pattern applied to the piezo element incorporated in the print head, and causes the print head to eject ink. A carriage mechanism 27a and a paper feed mechanism 27b connected to the I / F 27 cause the print head to perform main scanning, and sequentially feed media to perform sub-scanning. Then, the CPU 21 controls each unit according to the program written in the ROM 22.
[0031]
In the PC 10, the BIOS is executed based on the above hardware, and the OS and the APL are executed on the BIOS. Various drivers such as a printer driver for controlling the printer I / F 17e are incorporated in the OS, and control the hardware. The printer driver can perform bidirectional communication with the printer 20 via the printer I / F 17e, receives print data from the APL, creates a print job, and sends it to the printer 20.
[0032]
(2) Configuration of red-eye correction device:
FIG. 3 schematically shows a configuration of a red-eye correction device realized by the function of the red-eye correction program. The red-eye correction program is composed of a plurality of modules, and various means U1 to U4 according to the present invention are configured corresponding to each module. Basically, based on the information obtained by the units U1 to U3, the color replacing unit U4 performs a process of replacing the red eye portion with the eye color in the image data.
In the present embodiment, the above process is performed on image data composed of RGB defined in the sRGB color space. The same image data has multiple gradations (for example, gradation value 0) for each of a plurality of element colors RGB for each of a large number of pixels in a dot matrix of m0 × n0 pixels (m0 and n0 are integers of 2 or more). 25255), which is data representing a color image. Of course, it is also possible to perform the above processing on image data composed of luminance (Y component), B color difference (U component), and R color difference (V component) in the YUV color system. Further, each component of the image data can also have various gradation numbers. For example, 1024 gradations may be used instead of 256 gradations.
[0033]
The correction area obtaining means U1 obtains correction area information representing a correction area for correcting a red eye occurring in an eye portion of an image represented by the image data. In the present embodiment, the correction area is a substantially circular area, and the radius Radius (information indicating the diameter) of the correction area and the information indicating the center coordinates of the correction area are used as the correction area information. These pieces of information are obtained by an operation input to the PC 10.
Further, it is also possible to determine an eye area from an image based on the image data of each pixel, and acquire information representing the eye area as correction area information. There are various methods for determining the eye area. For example, as disclosed in paragraph 0030 of JP-A-10-75374, by extracting only the image data of the eye region based on the connectivity of low brightness pixels, the eye region can be extracted from the image. Can be determined. Further, since the eye color is not a flesh color, a flesh color region (for example, a region of a pixel where each RGB value of the image data falls within a predetermined range) is extracted, and a region surrounded by the extracted flesh color region is determined to be a predetermined color. When the shape substantially matches the shape of the eye, the enclosed region may be determined as the eye region, and information representing the eye region may be acquired as the correction region information.
[0034]
The red-eye range obtaining means U2 obtains range information indicating a range to be a red-eye color in a color space of image data using each of the three component colors RGB as a coordinate axis. In the present embodiment, the range of the red eye color in the same color space is represented as a distance from a predetermined red eye target color. Then, a relative value of the same distance is received by an operation input, and the input value is acquired as a tolerance Tolerance (range information) for a red-eye color.
[0035]
The brightness information obtaining means U3 obtains brightness information representing the brightness of the image data after replacement by the color replacement means. In the present embodiment, the brightness information is numerically expressed as intensity Intensity, and the intensity is used as information indicating luminance. However, other information indicating brightness may be used as brightness information. The same intensity is received as a numerical value by an operation input.
[0036]
FIG. 4 shows a display example of a setting input screen for the means U1 to U3 to receive input of various information. The screen includes an image display field 91a, a cross pointer 91b, an eye color selection field 91c, a radius input field 91d, a tolerance input field 91e, an intensity input field 91f, and various buttons 91g to j.
In the image display field 91a, the input image data is displayed. A cross pointer 91b is displayed in the display field 91a. By moving the pointer 91b with a mouse, the center coordinates of the correction area can be set and input.
[0037]
In the eye color selection field 91c, the corrected eye color can be selected. In addition to black, brown, blue, and the like, there are user settings, local people such as Japanese, different images, and the like as eye color options. When a user setting is selected and input, a color palette is displayed, and a desired eye color can be created. When a person in each region is selected and input, an eye color corresponding to the person in the input region is selected. When another image is selected and input, information indicating the eye color is obtained from the other image.
In the radius input field 91d, a knob that can slide in the left-right direction is displayed. By moving the knob with a mouse, the radius of the correction area can be adjusted. In the present embodiment, moving the knob to the left decreases the radius, and moving the knob to the right increases the radius.
[0038]
A knob slidable in the left-right direction is also displayed in the tolerance input field 91e. By moving the knob with a mouse, the tolerance Tolerance indicating the range of red-eye can be adjusted. In the present embodiment, the tolerance is set to a value of 0 to 1, and when the knob is moved to the left, the tolerance decreases (the left end is 0), and when the knob is moved to the right, the tolerance increases. The right end is 1).
In the strength input field 91f, a knob that can slide in the left and right direction is also displayed. By moving the knob with a mouse, the intensity Intensity representing the brightness can be adjusted. In the present embodiment, the intensity is set to a value of 0 to 1, and the intensity decreases when the knob is moved to the left (0 at the left end), and increases when the knob is moved to the right (1 at the right end). ).
[0039]
When the region extraction button 91g is clicked with a mouse, an eye region is automatically extracted from the image. When the image reference button 91h is clicked, information indicating the eye color is automatically acquired from another image in which red eyes are not generated. When the correction execution button 91i is clicked, the red-eye portion is corrected to the eye color according to the set conditions.
[0040]
Returning to FIG. 3, the description will be continued. The color replacement unit U4 sequentially shifts the target pixel with respect to the pixel of the correction area corresponding to the obtained correction area information with the image data of each pixel as a replacement target, and converts the image data of the red-eye portion, that is, the target pixel into the range information. When it is within the corresponding range, the image data of the red eye portion is replaced with image data representing the color of the eye. In the case of image data representing an image to be displayed on the display, gamma correction has been performed. After performing inverse gamma correction, the distance between the red-eye target color in the RGB color space and the color of the pixel in the correction area is calculated. Then, it is determined whether or not this distance is within the range corresponding to the range information. For example, in the case of gamma-corrected image data of γ = 2.2, if the RGB values of the image data are R0, G0, and B0 (all 0 to 255), the image after inverse gamma correction Each of the RGB values C2r, C2g, and C2b of the data (all values of 0 to 255) can be calculated by the following equation.
C2r = 255 × (R0 / 255) 0.45 ... (1)
C2g = 255 × (G0 / 255) 0.45 ... (2)
C2b = 255 × (B0 / 255) 0.45 ... (3)
[0041]
After the inverse gamma correction described above, the distance Distance between the target red-eye color and the color of the pixel in the correction area is calculated. Here, as a result of repeating the test while changing the calculation formula, assuming that N is a positive integer, the coordinate values of the red-eye target color are C1r (0 ≦ C1r ≦ N) and C1g (0 ≦ C1g ≦ N) in the order of RGB. , C1b (0 ≦ C1b ≦ N), and Ravg = (C1r + C2r) / 2, if the distance Distance is calculated by the following equation, the red-eye portion to be corrected can be reliably corrected to the eye color. A corrected image with good image quality was obtained.
Distance = [{2 + Ravg / (N + 1)} × (C1r−C2r) 2 + 4 × (C1g-C2g) 2 + {2+ (N-Ravg) / (N + 1)} × (C1b-C2b) 2 ] 1/2 ... (4)
In this embodiment, since N = 255, it is calculated by the following equation.
Distance = [(2 + Ravg / 256) × (C1r−C2r) 2 + 4 × (C1g-C2g) 2 + {2+ (255-Ravg) / 256} × (C1b-C2b) 2 ] 1/2 ... (5)
[0042]
Here, a slight difference in each coefficient of the arithmetic expression, such as changing N to N + 1 or N-1, or changing N + 1 to N, hardly affects the value of the distance Distance. Therefore, for example, the distance Distance may be calculated by the following arithmetic expression.
Distance = [(2 + Ravg / 255) × (C1r−C2r) 2 + 4 × (C1g-C2g) 2 + {2+ (255-Ravg) / 255} × (C1b-C2b) 2 ] 1/2 ... (5 ')
Further, the expressions may be obtained by multiplying the right sides of the arithmetic expressions (4) and (5) by a predetermined coefficient. Even in this case, the distance between the target red-eye color and the pixel color remains unchanged.
[0043]
Although the above arithmetic expressions (4) and (5) are good in that a good corrected image can be obtained, the distance Distance may be calculated by the following arithmetic expression in order to simplify the arithmetic processing. .
Distance = {(C1r−C2r) 2 + (C1g-C2g) 2 + (C1b-C2b) 21/2 ... (6)
[0044]
In order to determine whether or not the distance Distance is within the range of red-eye color, the distance Distance is converted into a value of 0 to 1. When the coordinates of RGB in the RGB color space are represented by (R, G, B) (0 ≦ R ≦ N, 0 ≦ G ≦ N, 0 ≦ B ≦ N), as shown in FIG. Coordinates (0,0,0), (0,0, N), (0, N, 0), (0, N, N), (N, 0,0), (N, 0, N), ( The distances between (N, N, 0), (N, N, N) and the coordinates (C1r, C1g, C1b) of the target red-eye color are respectively obtained by the above equation (5), and the maximum value MaxDistance of the obtained distances is calculated. Is determined based on the ratio of the distance Distance to the maximum value MaxDistance. In the illustrated example, N = 255, and the distance between the coordinates (255, 255, 0) and the coordinates of the red-eye target color is the largest. That is, the maximum value MaxDistance of the distance is a value calculated by the following equation.
MaxDistance = [(2 + C1r / 256) × C1r 2 + 4 × (C1g-255) 2 + {2+ (255-C1r) / 256} × (C1b-255) 2 ] 1/2 ... (7)
[0045]
Then, the ratio of the distance Distance to the maximum value MaxDistance of the distance is always 1 or less. The tolerance Tolerance acquired by accepting an operation input from the setting input screen shown in FIG. 4 is a value of 0 to 1, and therefore, is within the range of red-eye color when Distance / MaxDistance ≦ Tolerance. And replace the image data. As described above, it is only necessary to determine whether or not the image data is within the range corresponding to the range information based on the ratio of the distance Distance, so that the range information can be expressed in a range of 0 to 1, and the configuration is improved. It can be simplified.
[0046]
Returning to FIG. 3 again, the description will be continued. When the ratio of the distance Distance is equal to or less than the tolerance Tolerance, if all target pixels are included in the correction area, the target pixel is image data representing the eye color from the original image data and corresponds to the brightness information. Is replaced with image data representing the brightness. For example, when black is selected as the eye color, the RGB values C3r, C3g, and C3b of the replaced image data (all of which are 0 to 255) are used by using the intensity Intensity having a value of 0 to 1. Value) can be calculated by multiplying the minimum value of the RGB values C2r, C2g, and C2b before replacement by the intensity Intensity.
C3r = C3g = C3b = Minimum (C2r, C2g, C2b) × Intensity (8)
Then, the saturation of the red-eye portion is reduced in an image in which red-eye occurs in the eye portion, and the red-eye is corrected to the eye color.
[0047]
By replacing the image data using the above equation (8), the value of the image data before the replacement is reflected on the value of the image data after the replacement, so that the image quality of the image after the red-eye correction is improved. Can be. Of course, in order to simplify the operation for replacing the image data, the value of the replaced image data may be obtained by multiplying the predetermined value by the intensity Intensity as in the following operation expression.
C3r = C3g = C3b = 255 × Intensity (9)
Here, the intensity Intensity represents the approximate luminance, and in the case of using the above equation (8), it represents the luminance indirectly. Needless to say, different weights may be given to the RGB component values when representing the luminance. Therefore, by multiplying the right sides of the equations (8) and (9) by C3r, C3g, and C3b by different predetermined coefficients, C3r, C3g, C3b may be set to a different value.
[0048]
Generally, if each of the RGB values of the eye color is represented by Er, Eg, and Eb, the RGB values of the replaced image data can be calculated by the following arithmetic expressions.
C3r = Er × {Minimum (C2r, C2g, C2b) / 255} × Intensity (10)
C3g = Eg × {Minimum (C2r, C2g, C2b) / 255} × Intensity (11)
C3b = Eg × {Minimum (C2r, C2g, C2b) / 255} × Intensity (12)
Or
C3r = Er × Intensity (13)
C3g = Eg × Intensity (14)
C3b = Eb × Intensity (15)
In the above equations (10) to (12), the value of the original image data is reflected on the value of the image data after the replacement, so that the image quality of the image after red-eye correction can be made high.
As described above, when replacing the image data with the image data representing the eye color, the color replacing unit U4 replaces the image data with the image data representing the brightness corresponding to the acquired brightness information.
[0049]
Further, when the target pixel is the boundary portion of the correction area, the color replacement unit U4 determines the replacement amount of the same image data when replacing the target pixel with the image data representing the same color from the original image data. The amount is set according to the degree to which the target pixel is included in the correction area.
[0050]
FIG. 6 is a diagram illustrating a process of replacing image data at a boundary portion of a correction area. Here, the correction area 50 is a substantially circular area centered on the center coordinate 51. The pixels 52 in the correction area are all pixels included in the correction area 50. That is, the image data of the pixel 52 is obtained by the above-described arithmetic expressions (8) to (15). On the other hand, the pixels 54 outside the correction area indicated by the dotted line in the drawing are pixels in which all portions are out of the correction area 50. Therefore, the image data of the pixel 54 is not replaced.
The pixel 53 at the boundary portion is a pixel whose inside is a boundary portion of the correction region 50. When replacing the image data with respect to the pixel 53, the replacement ratio of the image data is set as a ratio at which the pixel 53 is included in the correction area 50. Specifically, the replacement ratio is determined as follows, and the image data is replaced.
[0051]
First, the pixel 53 is substantially equally divided into a predetermined number of divided areas 55 of width m1 × length n1 (m1, n1 is an integer of 2 or more). In the present embodiment, m1 = n1 = 4, and the pixels 53 are equally divided into 16 divided areas 55. Next, the number n2 of the divided areas in which the center of the divided area 55 is inside the correction area 50 is obtained for each pixel 53. Then, the ratio of the calculated number n2 of the divided areas to the number 16 of all the divided areas of the pixels 53, that is, n2 / 16 is set as the image data replacement ratio P. For example, in the case of the pixels 53a and b shown in the figure, the number n2 of the divided areas whose centers are inside the correction area 50 is 8,13, and the replacement ratio P of the image data is 8/16, 13/16. Become.
[0052]
Here, the RGB values C3r, C3g, and C3b are once calculated by the above equations (8) to (15), and the RGB values C3r, C3g, and C3b, which are image data in the RGB color space, are converted into an image in the HIS color space. The data is converted into component values H3, I3, and S3, and the RGB values C2r, C2g, and C2b of the original image data are converted into component values H2, I2, and S2 of the image data in the HIS color space. Note that H2 and H3 are hue (Hue) component values, I2 and I3 are luminance (Intensity) component values, and S2 and S3 are saturation (Saturation) component values. More specifically, H2, H3, I2, I3, S2, and S3 can be calculated by the following arithmetic expressions using A1 as a predetermined 3 × 3 matrix.
(Equation 1)
Figure 2004164276
[0053]
Then, using the calculated H2, H3, I2, I3, S2, and S3 and the replacement ratio P, the component values H4, I4, and S4 of the image data after replacement in the HIS color space are calculated.
H4 = H2 (18)
I4 = I2- (I2-I3) × P (19)
S4 = S2− (S2−S3) × P (20)
After that, the component values H4, I4, and S4 of the image data in the HIS color space are returned to the component values C4r, C4g, and C4b of the image data in the RGB color space.
(Equation 2)
Figure 2004164276
[0054]
As described above, when the pixel at the boundary of the correction area is replaced from the original image data to the image data representing the eye color, the replacement ratio of the image data is set to a rate at which the pixel is included in the correction area.
As a result, the image data is not completely replaced with the eye color when the boundary portion of the correction area is within the range of the red eye color, so the color does not change suddenly inside and outside the correction area, but changes smoothly. . As a result, it is possible to correct the red-eye so that the user does not feel uncomfortable.
[0055]
Further, the color replacement unit U4 obtains image data of another image in which red-eye does not occur, determines an iris region from the another image based on the obtained image data, and based on the image data of the determined region. It is also possible to acquire information indicating the color of the eyes. As a result, information representing the eye color is obtained from another image having no red eye, and the red eye portion in the correction area is corrected to this eye color, and the red eye is corrected so as not to make the user feel uncomfortable. It becomes possible.
[0056]
When the red-eye portion is replaced with image data representing the color of the eyes in the image data on which the inverse gamma correction has been performed, processing is performed to restore the image data on which the gamma correction has been performed. The RGB values R1, G1, and B1 (all values of 0 to 255) of the image data after the gamma correction can be calculated by the following arithmetic expressions.
R1 = 255 × (C4r / 255) 2.2 ... (22)
G1 = 255 × (C4g / 255) 2.2 ... (23)
B1 = 255 × (C4b / 255) 2.2 ... (24)
[0057]
(3) Operation of the red-eye correction device:
FIG. 7 is a flowchart illustrating the red-eye correction process performed by the various units U1 to U4. Hereinafter, the processing performed by the red-eye correction device will be described in detail with reference to the flowchart.
When the red-eye correction program according to the present embodiment is activated, first, image data representing a color image before correction is input, and the setting input screen shown in FIG. 4 is displayed on the display (step S105; Step "). Note that the position of the cross pointer 91b, the eye color selection field 91c, and the various input fields 91d to 91f are displayed under default conditions or conditions previously input. Only when "another image" is selected and input in the eye color selection field 91c, the area extraction button 91g can be clicked.
[0058]
The input image data is displayed in the image display field 91a. The input image data may be image data captured by the digital camera 30, a scanner or a video camera (not shown), or image data recorded on the FD 16a or the like. Further, when inputting image data from a digital camera or the like, it is not necessary to read the entire data at once, and it may be possible to partially read the data, or to transfer data when called from another APL. Only the passing of the pointer indicating the buffer area to be used may be performed.
[0059]
When the setting input screen is displayed, it is determined whether or not an eye color selection input has been performed in the eye color selection field 91c (S110). When the input for selecting the eye color is not received, the process proceeds to S130, and when the input for selecting the eye color is received, the process proceeds to S115. In S115, it is determined whether or not “another image” is selected and input from the selection field 91c. When an input for selecting “another image” is received, an eye color determination process is performed (S120), and the process proceeds to S130.
[0060]
FIG. 8 is a flowchart showing the eye color determination process, and FIG. 9 schematically shows how the eye color is determined. First, when the image reference button 91h is clicked, an image file selection screen (not shown) is displayed, and a selection input of an image file storing image data classified by pixel of an image having no red-eye is received. The image data of the file is read into the RAM, and the image data of another image 61 having no red-eye is obtained (S205). Next, based on the image data of another image 61, an eye region 62 including a white eye is determined (S210). For example, a skin color region is extracted, and when a region surrounded by the extracted skin color region substantially matches a predetermined eye shape, the surrounded region is determined as an eye region including a white eye.
Further, an iris region 63 is determined from another image 61 based on the image data of the pixels of the eye region 62 including the white eye (S215). For example, a white eye region (for example, a region of a pixel where each RGB value of image data is equal to or more than a predetermined value) is extracted, and an eye region excluding the extracted white eye region is determined as an iris region.
[0061]
Then, based on the image data of the iris area 63, information representing the color of the eyes is obtained (S220), and the present flow ends. Here, the information representing the color of the eyes can be considered in various ways. For example, the RGB values of the image data may be averaged and uniform for all the pixels in the iris area, or the iris pattern may be left. Thus, image data for each pixel in the iris area may be used.
As described above, since the eye region is determined as the correction region from the image based on the image data of each pixel, the region for correcting the red eye is automatically extracted, and the work of correcting the red eye is reduced, which is convenient and convenient. is there. Also, information representing the eye color is obtained from another image having no red-eye, and the red-eye portion is corrected to the eye color of another image having no red-eye, so that the user does not feel uncomfortable. It is possible to correct red eyes.
[0062]
In S115, when an input for selecting a component other than “another image” is received, the process proceeds to S125, and information representing the eye color is acquired. Here, when an input for selecting one of a plurality of eye colors such as black, brown, and blue is received, the RGB values Er, Eg, and Eb of the corresponding eye color (representing the color after replacement) Information). When a user setting is selected and input, a color palette is displayed, and an operation input to the color palette is accepted to acquire RGB values Er, Eg, Eb of the corresponding eye color. When a person for each region is selected and input, a selection and input is performed with reference to a region-specific color table (not shown) in which information indicating the region and an RGB value indicating the eye color of the person in the region are associated. RGB values Er, Eg, Eb representing the color of the eyes corresponding to the person in the specified area are acquired.
As described above, the eye color can be selected, and the eye color corresponding to the person in the input area can be corrected, which is convenient. Therefore, the red-eye portion can be replaced with a more desired eye color, and the red-eye can be more reliably corrected so as not to make the user feel uncomfortable.
[0063]
After that, the process proceeds to S130, in which various parameters are sequentially acquired, and processing corresponding to the operation of the various buttons 91g to 91j is performed. In S130, when an operation input for designating the center position of the red eye by moving the cross pointer 91b is received, the cross pointer 91b is moved to the corresponding position and displayed, and the image displayed in the image display column 91a is displayed. Information corresponding to the position of the cross pointer 91b is acquired as information representing the center coordinates of the red eye.
In S135, when an operation input for setting the radius of the correction area in the radius input field 91d is received, a radius Radius corresponding to the position of the knob is acquired. Then, the cross pointer 91b is displayed as a size substantially proportional to the same radius Radius.
The information indicating the center coordinates of the red eye and the radius Radius are correction area information indicating a correction area for correcting the red eye. That is, the processes of S105 and S130 to S135 performed by the PC 10 constitute a correction area acquisition unit.
[0064]
In S140, when an operation input for setting a range to be red-eye in the tolerance input field 91e is received, a tolerance Tolerance of a numerical value corresponding to the position of the knob is acquired. The tolerance Tolerance is range information in which a range to be a red-eye color in the RGB color space is represented as a distance from a predetermined red-eye target color. That is, the processing of S105 and S140 performed by the PC 10 constitutes a red-eye range acquisition unit.
[0065]
In S145, when an operation input for setting the brightness of the image data is received in the intensity input field 91f, the numerical intensity Intensity corresponding to the position of the knob is acquired. The intensity Intensity is brightness information indicating the brightness of the image data after replacement. That is, the processing of S105 and S145 performed by the PC 10 constitutes brightness information acquisition means.
[0066]
When “another image” is selected and input in the eye color selection field 91c, the area extraction button 91g can be clicked. Then, in S150, it is determined whether or not region click button 91g has been clicked. If the button 91g has been clicked, the process proceeds to S160 after performing the eye area determination processing of S155. If the button 91g has not been clicked, the process proceeds to S160 without performing the process of S155.
In the eye region determination process in S155, an eye region is determined from an image based on the image data of each pixel, and information representing the region is acquired as correction region information. For example, as shown in FIG. 9, a skin color region is extracted, and when a region surrounded by the extracted skin color region substantially matches a predetermined eye shape, the surrounded region is defined as an eye region ( (Including the white eye), and acquires information representing the eye area as correction area information. That is, the processing of S150 and S155 performed by the PC constitutes a modified area acquisition unit in another sense.
[0067]
In S160, it is determined whether or not the correction execution button 91i has been clicked. If the button 91i is clicked, the process proceeds to S170 after performing the color replacement process of S165. If the button 91g has not been clicked, the process proceeds to S170 without performing the process of S165.
FIG. 10 is a flowchart illustrating the color replacement process performed in S165.
First, using the above equation (7), the coordinates (0, 0, 0), (0, 0, 255), (0, 255, 0), (0, 255, 255), (255, 0, 0), (255, 0, 255), (255, 255, 0), (255, 255, 255), and the coordinates (C1r, C1g, C1b) of the target red-eye color, respectively, by the above equation (5). The maximum value MaxDistance of the obtained distance is calculated (S305). Here, since the coordinates (C1r, C1g, C1b) are coordinates based on the inverse gamma correction, the calculated maximum value MaxDistance is a value based on the image data on which the inverse gamma correction has been performed.
[0068]
Next, a target pixel to be replaced with image data is set in the correction area corresponding to the obtained correction area information (S310). When the correction area information is composed of information indicating the radius of the correction area and information indicating the center coordinates of the correction area, pixels included in a circular area corresponding to these pieces of information are extracted as a correction area. , A target pixel is set from the correction area. Then, a process of replacing the image data of the target pixel is performed while sequentially moving the target pixel. In the present embodiment, a number of pixels are arranged in order in the up, down, left, and right directions, and the order of the image data replacement processing starts from the leftmost pixel on the top, proceeds to the rightmost pixel in order, and then goes down one by one. From the leftmost pixel to the rightmost pixel in order, and finally the lowest rightmost pixel. Of course, the order of the replacement process can be changed as appropriate.
[0069]
Since the input image data (RGB values R0, G0, B0) has been subjected to gamma correction, after setting the target pixel, inverse gamma correction is performed using the above equations (1) to (3). The respective RGB values C2r, C2g, C2b are calculated (S315). Thereafter, the distance Distance between the target red-eye color (RGB values C1r, C1g, C1b) and the colors of the pixels in the correction area (RGB values C2r, C2g, C2b) is calculated using the above equation (5) (S320). Then, it is determined whether or not the distance Distance is within the distance corresponding to the range information, that is, whether the ratio of the distance Distance to the maximum value MaxDistance is equal to or less than the tolerance Tolerance (S325). If the same ratio is greater than the tolerance Tolerance, it is determined that the image is not a red-eye portion, and the process proceeds to S350 without replacing the image data. On the other hand, if the ratio is equal to or less than the tolerance Tolerance, the image data is determined to be a red-eye portion, and the process advances to S330 to replace image data. As described above, since the image data is replaced when the color of the target pixel is within the distance corresponding to the range information from the target red-eye color, it is possible to reliably correct the red-eye portion to be corrected to the eye color. is there.
[0070]
In S330, it is determined whether or not the target pixel is at the boundary of the correction area. If it is not a boundary portion, the process proceeds to S335, and if it is a boundary portion, the process proceeds to S340 to perform a boundary color replacement process.
In S335 performed when all the target pixels are included in the same correction area, the original image data (RGB values C2r, C2g, C2b) are made to correspond to the intensity Intensity using the above equations (10) to (12). The image data (RGB values C3r, C3g, C3b) representing the color of the eyes of the brightness is replaced, and the process proceeds to S345. Then, if all the target pixels are included in the correction region, the color of the target pixel is corrected to the eye color if it is a red-eye portion. Further, the brightness of the image based on the image data after the replacement can be adjusted according to the setting of the intensity Intensity, which is convenient, and further, it is possible to correct the red-eye without discomfort. Further, when the information representing the color after replacement is obtained by accepting the selection input, the image data is replaced so as to have a color corresponding to the information representing the color after replacement. The color can be replaced with the color of the eyes, which is convenient and makes it possible to more reliably correct the red-eye so as not to make the user feel uncomfortable.
[0071]
On the other hand, if the target pixel is at the boundary of the correction area, a boundary color replacement process shown in FIG. 11 is performed (S340), and the process proceeds to S345.
First, the target pixel is equally divided into 4 × 4 divided areas, and the number n2 of divided areas whose center is inside the correction area is calculated (S405). Next, a ratio of the calculated number n2 to 16 which is the number of all the divided areas is calculated and set as a replacement ratio P of the image data (S410).
Further, using the above equations (10) to (12), the original image data (RGB values C2r, C2g, C2b) is converted into image data (RGB values C3r, RGB values C3r, C3g, C3b) (S415).
Thereafter, the image data in the RGB color space before and after the replacement is converted into image data in the HIS color space (S420). That is, using the above equations (16) and (17), the RGB values C2r, C2g, and C2b are converted into respective component values H2, I2, and S2 of the image data in the HIS color space, and the RGB values C3r, C3g, and C3b are converted. Each component value of image data in the HIS color space is converted into H3, I3, S3.
[0072]
Then, the respective component values H4, I4, and S4 of the replaced image data are calculated using the above equations (18) to (20) such that the replacement ratio of the image data is set to the ratio of the target pixel included in the correction area. (S425).
After that, using the above equation (21), the component values H4, I4, and S4 of the image data in the HIS color space are converted into the RGB values C4r, C4g, and C4b, and are returned to the image data in the RGB color space (S430). ), End this flow.
Then, when the target pixel is a boundary portion of the correction area, the replacement amount of the image data is set to a ratio of the target pixel included in the correction area. In other words, the image data of the pixels at the boundary can be replaced so that the boundary of the correction area looks natural with a simple configuration. In other words, since the image data is not completely replaced with the data representing the eye color, the color does not change abruptly inside and outside the red-eye correction area, but changes smoothly.
[0073]
Returning to FIG. 10, the description will be continued. The replaced image data (RGB values C3r, C3g, C3b or C4r, C4g, C4b) is data that has not been gamma-corrected. Gamma correction is performed on the image data to calculate image data (RGB values R1, G1, B1) after the gamma correction.
Thereafter, it is determined whether or not the processing of S310 to S345 has been performed for all the pixels in the correction area (S350). When this process has been performed for all pixels in the correction area, this flow ends, and when not performed for all pixels, the processes of S310 to S350 are repeatedly performed.
As described above, the processing of S105 to S125 and S165 in FIG. 7 performed by the PC 10 constitutes a color replacement unit.
[0074]
For example, as shown in FIG. 12, when a red eye color range exists inside and outside the correction area 50, all the pixels 52 included in the correction area 50 are replaced with the image data representing the eye color from the original image data. The red-eye part is corrected to the eye color. On the other hand, the pixels 54 completely deviating from the correction area 50 are left as the original image data and are not corrected to the eye color. Here, as for the pixel 53 at the boundary portion of the correction area 50, the image data is replaced at a rate such that the pixel 53 is included in the correction area 50, so that the image data is completely replaced with data representing the eye color. Absent. Therefore, the color does not change abruptly inside and outside the area where the red-eye is corrected, but changes smoothly. As a result, it is possible to more reliably correct red-eye in an image in which red-eye occurs in the eye portion so as not to make the user feel uncomfortable.
[0075]
After the end of S160 or S165 in FIG. 7, it is determined whether or not the save button 91j is clicked (S170). If the button 91j is clicked, the flow advances to S175 to store the image data in the HD 14, and the flow ends. On the other hand, when the button 91j has not been clicked, the process returns to S110.
[0076]
(4) Summary:
As described above, the user of the present red-eye correction apparatus can easily correct the red-eye by designating the position of the red-eye with the cross pointer and performing input for setting the radius, tolerance, intensity, and the like. is there. When the boundary of the red-eye correction area is within the range of the red-eye color, the image data is not completely replaced with the data representing the eye color, so the color changes smoothly. The image data is image data representing the brightness corresponding to the brightness information. Further, the red-eye portion can be corrected to the eye color of another image having no red-eye. Therefore, the red-eye can be corrected so as not to make the user feel uncomfortable, and the present red-eye correction device is a highly convenient device.
[0077]
Note that the red-eye correction device and the peripheral device capable of executing the red-eye correction program of the present invention can have various configurations.
For example, the printer may be integrated with the computer, or may be a dedicated product that prints only a single color image. The flow described above may be partially or entirely executed by a printer or a dedicated image output device in addition to being executed in the PC.
According to the present invention, it is possible to provide a red-eye correction device and a red-eye correction program that are useful for correcting red-eye. Also, the present invention can be applied as a red-eye correction method.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a schematic configuration of a system including a red-eye correction device and a peripheral device.
FIG. 2 is a diagram illustrating a block configuration of a printer together with a PC.
FIG. 3 is a diagram schematically showing various units constituting the red-eye correction device.
FIG. 4 is a diagram showing a display example of a setting input screen.
FIG. 5 is a schematic diagram showing a maximum value MaxDistance of a distance.
FIG. 6 is a view for explaining image data replacement processing at a boundary portion of a correction area.
FIG. 7 is a flowchart illustrating red-eye correction processing.
FIG. 8 is a flowchart illustrating eye color determination processing.
FIG. 9 is a diagram schematically showing how an eye color is determined.
FIG. 10 is a flowchart illustrating a color replacement process.
FIG. 11 is a flowchart illustrating boundary color replacement processing.
FIG. 12 is a diagram schematically showing a state of an image after correction in a case where a range to be a red-eye color exists inside and outside a correction area.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 10 ... Personal computer, 11 ... CPU, 12 ... ROM, 13 ... RAM, 14 ... Hard disk, 17a-e ... Interface, 18a ... Display, 18b ... Keyboard, 18c ... Mouse, 20 ... Inkjet printer, 30 ... Digital camera, 50 ... Correction area, 51. Center coordinates, 52. Pixels in the correction area, 53. Pixels in the boundary area, 54. Pixels outside the correction area, 55. Sectional area, 61. Another image, 62. Area, 63: iris area, U1: correction area acquisition means, U2: red-eye range acquisition means, U3: brightness information acquisition means, U4: color replacement means

Claims (20)

多数の画素別に多階調とされた画像データで表現されるカラーの画像のうち赤目を修正する修正領域を表す修正領域情報を取得する修正領域取得手段と、
上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得手段と、
上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから目の色を表す画像データに置換するとともに同画素が同修正領域の境界部分である場合には同画像データの置換量を同画素が同修正領域に含まれる度合に応じた量とする色置換手段とを具備することを特徴とする赤目修正装置。
Correction area obtaining means for obtaining correction area information representing a correction area for correcting red-eye in a color image represented by image data with multiple gradations for each of a large number of pixels;
Red-eye range obtaining means for obtaining range information representing a range to be a red-eye color in the color space of the image data;
When the image data of the pixel of the correction area corresponding to the obtained correction area information is within the range corresponding to the obtained range information, the original image data is replaced with image data representing the eye color. And color replacement means for setting the replacement amount of the same image data according to the degree of the pixel included in the correction area when the pixel is a boundary portion of the correction area. Red eye correction device.
ドットマトリクス状の多数の画素別に複数の要素色のそれぞれについて多階調とされた画像データで表現されるカラーの画像のうち、目の部分に生じる赤目を修正する修正領域を表す修正領域情報を取得する修正領域取得手段と、
上記複数の要素色のそれぞれを座標軸とする上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得手段と、
上記取得された修正領域情報に対応する修正領域の上記画素について各画素の画像データを置換対象として順次対象画素を移動させながら、同対象画素の画像データが上記取得された範囲情報に対応する範囲内であるとき、同対象画素が全て同修正領域に含まれる場合には同対象画素について元の画像データから目の色を表す画像データに置換するとともに同対象画素が同修正領域の境界部分である場合には同対象画素について元の画像データから同目の色を表す画像データに置換するにあたり同画像データの置換量を同対象画素が同修正領域に含まれる度合に応じた量とする色置換手段とを具備することを特徴とする赤目修正装置。
In a color image represented by multi-gradation image data for each of a plurality of element colors for each of a large number of pixels in a dot matrix, correction area information indicating a correction area for correcting a red eye occurring in an eye portion is described. Correction area acquisition means to acquire,
Red-eye range obtaining means for obtaining range information representing a range to be a red-eye color in the color space of the image data with each of the plurality of element colors as a coordinate axis,
For the pixels in the correction area corresponding to the acquired correction area information, the image data of the target pixels are sequentially moved while replacing the image data of each pixel with the image data of each pixel as a replacement target. When all the target pixels are included in the correction area, the target pixel is replaced from the original image data with the image data representing the eye color, and the target pixel is located at the boundary of the correction area. In some cases, when replacing the original image data with image data representing the same color for the same target pixel, the replacement amount of the same image data is set to an amount corresponding to the degree to which the same target pixel is included in the correction area. A red-eye correction device comprising: a replacement unit.
上記色置換手段は、上記画素が上記修正領域の境界部分である場合には同画素について元の画像データから上記目の色を表す画像データに置換するにあたり同画像データの置換割合を同画素が同修正領域に含まれる割合とすることを特徴とする請求項1または請求項2のいずれかに記載の赤目修正装置。When the pixel is a boundary portion of the correction area, the color replacement unit determines the replacement ratio of the same image data when replacing the original image data with the image data representing the eye color. 3. The red-eye correction device according to claim 1, wherein the ratio is included in the correction region. 上記色置換手段は、上記画素を所定数の区分領域に略等分割し、中心が上記修正領域の内部となる区分領域の同区分領域全ての数に対する割合を上記画像データの置換割合とすることを特徴とする請求項3に記載の赤目修正装置。The color replacement means divides the pixel substantially equally into a predetermined number of divided areas, and sets a ratio of the number of the divided areas whose center is inside the correction area to the number of all the same divided areas as a replacement ratio of the image data. The red-eye correction device according to claim 3, wherein: 上記色置換手段にて置換された後の画像データの明るさを表す明るさ情報を取得する明るさ情報取得手段が設けられ、
上記色置換手段は、上記目の色を表す画像データに置換するにあたり、上記取得された明るさ情報に対応した明るさを表す画像データに置換することを特徴とする請求項1〜請求項4のいずれかに記載の赤目修正装置。
Brightness information obtaining means for obtaining brightness information representing the brightness of the image data after replacement by the color replacement means is provided,
5. The image processing apparatus according to claim 1, wherein the color replacement unit replaces the image data with the image data representing the eye color, the image data representing brightness corresponding to the acquired brightness information. The red-eye correction device according to any one of the above.
上記修正領域は、略円形の領域であり、
上記修正領域情報は、上記略円形とされた修正領域の径を表す情報と、上記画像における同修正領域の中心座標を表す情報とから構成されていることを特徴とする請求項1〜請求項5のいずれかに記載の赤目修正装置。
The correction area is a substantially circular area,
The correction area information includes information representing a diameter of the substantially circular correction area and information representing center coordinates of the correction area in the image. 5. The red-eye correction device according to any one of 5.
上記範囲情報は、上記画像データの色空間内において赤目の色とする範囲が所定の赤目目標色からの距離として表された情報とされ、
上記色置換手段は、上記色空間内における上記赤目目標色の座標と上記修正領域の画素の画像データとから同赤目目標色と同画素の色との距離を算出し、当該距離が上記取得された範囲情報に対応する距離内であるとき、上記画像データの置換を行うことを特徴とする請求項1〜請求項6のいずれかに記載の赤目修正装置。
The range information is information in which a range to be a red-eye color in the color space of the image data is represented as a distance from a predetermined red-eye target color,
The color replacement means calculates a distance between the target red-eye color and the color of the same pixel from the coordinates of the target red-eye color in the color space and the image data of the pixel in the correction area, and the distance is obtained. The red-eye correction device according to any one of claims 1 to 6, wherein the image data is replaced when the distance is within a distance corresponding to the range information.
上記画像データは、レッド、グリーン、ブルーのそれぞれについて多階調とされたデータとされ、
上記色置換手段は、Nを正の整数として、上記赤目目標色の座標値をレッド、グリーン、ブルーの順にC1r(0≦C1r≦N)、C1g(0≦C1g≦N)、C1b(0≦C1b≦N)、上記画素の画像データをレッド、グリーン、ブルーの順にC2r(0≦C2r≦N)、C2g(0≦C2g≦N)、C2b(0≦C2b≦N)、Ravg=(C1r+C2r)/2とするとき、上記所定の赤目目標色の座標と同画素の画像データとの距離Distanceを概略Distance=[{2+Ravg/(N+1)}×(C1r−C2r)+4×(C1g−C2g)+{2+(N−Ravg)/(N+1)}×(C1b−C2b)1/2なる演算式により算出することを特徴とする請求項7に記載の赤目修正装置。
The image data is multi-gradation data for each of red, green, and blue.
The color replacing means sets the coordinate values of the target red-eye color in the order of red, green, and blue as C1r (0 ≦ C1r ≦ N), C1g (0 ≦ C1g ≦ N), and C1b (0 ≦ C1b ≦ N), the image data of the above pixels is C2r (0 ≦ C2r ≦ N), C2g (0 ≦ C2g ≦ N), C2b (0 ≦ C2b ≦ N), and Ravg = (C1r + C2r) in the order of red, green, and blue. / 2, the distance Distance between the coordinates of the predetermined red-eye target color and the image data of the same pixel is approximately Distance = [{2 + Ravg / (N + 1)} × (C1r−C2r) 2 + 4 × (C1g−C2g) 2 + {2+ (N-Ravg ) / (N + 1)} × (C1b-C2b) 2] red eye correction device according to claim 7, characterized in that calculated by 1/2 becomes arithmetic expression.
上記色置換手段は、上記画像データの色空間内における上記レッドの座標値をR(0≦R≦N)、グリーンの座標値をG(0≦G≦N)、ブルーの座標値をB(0≦B≦N)とし、同色空間内の座標を(R,G,B)で表すとき、各座標(0,0,0)、(0,0,N)、(0,N,0)、(0,N,N)、(N,0,0)、(N,0,N)、(N,N,0)、(N,N,N)と上記赤目目標色の座標との距離の最大値を算出し、当該最大値に対する上記距離Distanceの比が上記取得された範囲情報に対応する範囲内であるときに上記画像データの置換を行うことを特徴とする請求項8に記載の赤目修正装置。The color replacing means sets a coordinate value of the red in the color space of the image data to R (0 ≦ R ≦ N), a coordinate value of the green to G (0 ≦ G ≦ N), and a coordinate value of the blue to B ( 0 ≦ B ≦ N), and when coordinates in the same color space are represented by (R, G, B), respective coordinates (0, 0, 0), (0, 0, N), (0, N, 0) , (0, N, N), (N, 0,0), (N, 0, N), (N, N, 0), (N, N, N) and the distance between the coordinates of the red eye target color The maximum value of the image data is calculated, and the image data is replaced when the ratio of the distance Distance to the maximum value is within a range corresponding to the acquired range information. Red eye correction device. 上記画像データを置換する上記目の色は、複数設けられ、
上記色置換手段は、上記複数の目の色からいずれかの色を選択する入力を受け付けて置換後の色を表す情報を取得し、当該情報に対応した色となるように上記画像データを置換することを特徴とする請求項1〜請求項9のいずれかに記載の赤目修正装置。
A plurality of eye colors for replacing the image data are provided,
The color replacement means receives an input for selecting any one of the plurality of eye colors, acquires information representing a color after replacement, and replaces the image data so as to be a color corresponding to the information. The red-eye correction device according to any one of claims 1 to 9, wherein:
上記修正領域取得手段は、各画素の画像データに基づいて上記画像から目の領域を決定し、当該領域を表す情報を上記修正領域情報として取得することを特徴とする請求項1〜請求項10のいずれかに記載の赤目修正装置。The said correction area acquisition means determines the area | region of an eye from the said image based on the image data of each pixel, and acquires the information showing the said area | region as said correction area information. The red-eye correction device according to any one of the above. 上記色置換手段は、赤目が生じていない別の画像の画像データを取得し、当該画像データに基づいて同別の画像から虹彩の領域を決定し、当該領域の画像データに基づいて上記目の色を表す情報を取得するとともに、上記修正領域の画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから同目の色を表す情報に対応した画像データに置換するとともに同画素が同修正領域の境界部分である場合には同画像データの置換量を同画素が同修正領域に含まれる度合に応じた量とすることを特徴とする請求項11に記載の赤目修正装置。The color replacement means obtains image data of another image in which red-eye does not occur, determines an iris region from the another image based on the image data, and determines the iris region based on the image data of the region. When information representing a color is obtained and an image corresponding to information representing the same color from the original image data is obtained when the image data is within the range corresponding to the acquired range information for the pixels in the correction area. 12. The method according to claim 11, wherein when the pixel is replaced with data and the pixel is a boundary portion of the correction area, the replacement amount of the image data is set to an amount corresponding to the degree of the pixel included in the correction area. 2. The red-eye correction device according to 1. 多数の画素別に多階調とされた画像データで表現されるカラーの画像から各画素の画像データに基づいて目の領域を決定し、当該領域を表す修正領域情報を取得する修正領域取得手段と、
上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得手段と、
赤目が生じていない別の画像の画像データを取得し、当該画像データに基づいて同別の画像から虹彩の領域を決定し、当該領域の画像データに基づいて目の色を表す情報を取得するとともに、上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから同目の色を表す情報に対応した画像データに置換する色置換手段とを具備することを特徴とする赤目修正装置。
Correction area obtaining means for determining an eye area based on image data of each pixel from a color image represented by image data having multiple gradations for each of a large number of pixels, and obtaining correction area information representing the area; ,
Red-eye range obtaining means for obtaining range information representing a range to be a red-eye color in the color space of the image data;
Obtain image data of another image without red-eye, determine an iris region from the another image based on the image data, and obtain information representing an eye color based on the image data of the region. In addition, when the image data is within the range corresponding to the acquired range information for the pixel of the modified region corresponding to the acquired modified region information, the original image data is converted to information representing the same color. A red-eye correction device, comprising: color replacement means for replacing the image data with corresponding image data.
多数の画素別に多階調とされた画像データで表現されるカラーの画像のうち赤目を修正する修正領域を表す修正領域情報を取得する修正領域取得手段と、
上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得手段と、
上記画像データの置換後の明るさを表す明るさ情報を取得する明るさ情報取得手段と、
上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから、目の色を表す画像データであって上記取得された明るさ情報に対応した明るさを表す画像データに置換する色置換手段とを具備することを特徴とする赤目修正装置。
Correction area obtaining means for obtaining correction area information representing a correction area for correcting red-eye in a color image represented by image data with multiple gradations for each of a large number of pixels;
Red-eye range obtaining means for obtaining range information representing a range to be a red-eye color in the color space of the image data;
Brightness information obtaining means for obtaining brightness information representing the brightness after replacement of the image data,
When the image data of the pixel of the correction area corresponding to the obtained correction area information is within the range corresponding to the obtained range information, the image data represents the eye color from the original image data. And a color replacement unit for replacing image data representing brightness corresponding to the acquired brightness information.
多数の画素別に多階調とされた画像データで表現されるカラーの画像のうち赤目を修正する修正領域を表す修正領域情報を取得する修正領域取得工程と、
上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得工程と、
上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから目の色を表す画像データに置換するとともに同画素が同修正領域の境界部分である場合には同画像データの置換量を同画素が同修正領域に含まれる度合に応じた量とする色置換工程とを具備することを特徴とする赤目修正方法。
A correction area obtaining step of obtaining correction area information representing a correction area for correcting red eye in a color image represented by image data with multiple gradations for each of a large number of pixels;
A red-eye range obtaining step of obtaining range information representing a range to be a red-eye color in the color space of the image data;
When the image data of the pixel of the correction area corresponding to the obtained correction area information is within the range corresponding to the obtained range information, the original image data is replaced with image data representing the eye color. And when the pixel is a boundary portion of the correction area, a color replacement step of setting the replacement amount of the image data to an amount corresponding to the degree of the pixel included in the correction area. Red eye correction method.
多数の画素別に多階調とされた画像データで表現されるカラーの画像から各画素の画像データに基づいて目の領域を決定し、当該領域を表す修正領域情報を取得する修正領域取得工程と、
上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得工程と、
赤目が生じていない別の画像の画像データを取得し、当該画像データに基づいて同別の画像から虹彩の領域を決定し、当該領域の画像データに基づいて目の色を表す情報を取得するとともに、上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから同目の色を表す情報に対応した画像データに置換する色置換工程とを具備することを特徴とする赤目修正方法。
A correction area obtaining step of determining an eye area based on image data of each pixel from a color image represented by image data with multiple gradations for a large number of pixels, and obtaining correction area information representing the area; ,
A red-eye range obtaining step of obtaining range information representing a range to be a red-eye color in the color space of the image data;
Obtain image data of another image having no red-eye, determine an iris region from the other image based on the image data, and obtain information representing an eye color based on the image data of the region. In addition, when the image data is within the range corresponding to the acquired range information for the pixel of the modified region corresponding to the acquired modified region information, the original image data is converted to information representing the same color. A color replacement step of replacing the image with corresponding image data.
多数の画素別に多階調とされた画像データで表現されるカラーの画像のうち赤目を修正する修正領域を表す修正領域情報を取得する修正領域取得工程と、
上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得工程と、
上記画像データの置換後の明るさを表す明るさ情報を取得する明るさ情報取得工程と、
上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから、目の色を表す画像データであって上記取得された明るさ情報に対応した明るさを表す画像データに置換する色置換工程とを具備することを特徴とする赤目修正方法。
A correction area obtaining step of obtaining correction area information representing a correction area for correcting red eye in a color image represented by image data with multiple gradations for each of a large number of pixels;
A red-eye range obtaining step of obtaining range information representing a range to be a red-eye color in the color space of the image data;
Brightness information obtaining step of obtaining brightness information representing the brightness after replacement of the image data,
When the image data of the pixel of the correction area corresponding to the obtained correction area information is within the range corresponding to the obtained range information, the image data represents the eye color from the original image data. A color replacement step of replacing the image data with image data representing brightness corresponding to the acquired brightness information.
多数の画素別に多階調とされた画像データで表現されるカラーの画像のうち赤目を修正する修正領域を表す修正領域情報を取得する修正領域取得機能と、
上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得機能と、
上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから目の色を表す画像データに置換するとともに同画素が同修正領域の境界部分である場合には同画像データの置換量を同画素が同修正領域に含まれる度合に応じた量とする色置換機能とをコンピュータに実現させることを特徴とする赤目修正プログラム。
A correction area obtaining function for obtaining correction area information representing a correction area for correcting red eye in a color image represented by image data with multiple gradations for each of a large number of pixels;
A red-eye range acquisition function for acquiring range information representing a range to be a red-eye color in the color space of the image data;
When the image data of the pixel of the correction area corresponding to the obtained correction area information is within the range corresponding to the obtained range information, the original image data is replaced with image data representing the eye color. In addition, when the pixel is a boundary portion of the correction area, the computer realizes a color replacement function that sets the replacement amount of the same image data according to the degree of the pixel included in the correction area. And red eye fix.
多数の画素別に多階調とされた画像データで表現されるカラーの画像から各画素の画像データに基づいて目の領域を決定し、当該領域を表す修正領域情報を取得する修正領域取得機能と、
上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得機能と、
赤目が生じていない別の画像の画像データを取得し、当該画像データに基づいて同別の画像から虹彩の領域を決定し、当該領域の画像データに基づいて目の色を表す情報を取得するとともに、上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから同目の色を表す情報に対応した画像データに置換する色置換機能とをコンピュータに実現させることを特徴とする赤目修正プログラム。
A correction area obtaining function for determining an eye area based on image data of each pixel from a color image expressed by image data with multiple gradations for a large number of pixels, and obtaining correction area information representing the area; ,
A red-eye range acquisition function for acquiring range information representing a range to be a red-eye color in the color space of the image data;
Obtain image data of another image having no red-eye, determine an iris region from the other image based on the image data, and obtain information representing an eye color based on the image data of the region. In addition, when the image data is within the range corresponding to the acquired range information for the pixel of the modified region corresponding to the acquired modified region information, the original image data is converted to information representing the same color. A red-eye correction program for causing a computer to realize a color replacement function for replacing with a corresponding image data.
多数の画素別に多階調とされた画像データで表現されるカラーの画像のうち赤目を修正する修正領域を表す修正領域情報を取得する修正領域取得機能と、
上記画像データの色空間内において赤目の色とする範囲を表す範囲情報を取得する赤目範囲取得機能と、
上記画像データの置換後の明るさを表す明るさ情報を取得する明るさ情報取得機能と、
上記取得された修正領域情報に対応する修正領域の上記画素について上記画像データが上記取得された範囲情報に対応する範囲内であるとき、元の画像データから、目の色を表す画像データであって上記取得された明るさ情報に対応した明るさを表す画像データに置換する色置換機能とをコンピュータに実現させることを特徴とする赤目修正プログラム。
A correction area obtaining function for obtaining correction area information representing a correction area for correcting red eye in a color image represented by image data with multiple gradations for each of a large number of pixels;
A red-eye range acquisition function for acquiring range information representing a range to be a red-eye color in the color space of the image data;
A brightness information acquisition function for acquiring brightness information representing the brightness after replacement of the image data,
When the image data of the pixel of the correction area corresponding to the obtained correction area information is within the range corresponding to the obtained range information, the image data represents the eye color from the original image data. A color replacement function for replacing the image data with image data representing brightness corresponding to the acquired brightness information.
JP2002329253A 2002-11-13 2002-11-13 Red-eye correction device, red-eye correction method, and red-eye correction program Expired - Fee Related JP3994280B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002329253A JP3994280B2 (en) 2002-11-13 2002-11-13 Red-eye correction device, red-eye correction method, and red-eye correction program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002329253A JP3994280B2 (en) 2002-11-13 2002-11-13 Red-eye correction device, red-eye correction method, and red-eye correction program

Related Child Applications (3)

Application Number Title Priority Date Filing Date
JP2007146710A Division JP4492642B2 (en) 2007-06-01 2007-06-01 Red-eye correction device, red-eye correction method, and red-eye correction program
JP2007146711A Division JP4492643B2 (en) 2007-06-01 2007-06-01 Red-eye correction device, red-eye correction method, and red-eye correction program
JP2007146712A Division JP4492644B2 (en) 2007-06-01 2007-06-01 Red-eye correction device, red-eye correction method, and red-eye correction program

Publications (3)

Publication Number Publication Date
JP2004164276A true JP2004164276A (en) 2004-06-10
JP2004164276A5 JP2004164276A5 (en) 2005-07-07
JP3994280B2 JP3994280B2 (en) 2007-10-17

Family

ID=32807299

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002329253A Expired - Fee Related JP3994280B2 (en) 2002-11-13 2002-11-13 Red-eye correction device, red-eye correction method, and red-eye correction program

Country Status (1)

Country Link
JP (1) JP3994280B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006012062A (en) * 2004-06-29 2006-01-12 Canon Inc Image processor and its method, program and imaging device
CN100344150C (en) * 2004-06-14 2007-10-17 佳能株式会社 Image processing apparatus and image-taking apparatus
JP2008541509A (en) * 2005-04-28 2008-11-20 ヒューレット−パッカード デベロップメント カンパニー エル.ピー. Method and apparatus for incorporating iris color in red-eye correction
US8306320B2 (en) 2008-03-07 2012-11-06 Samsung Electro-Mechanics Co., Ltd. 2D image segmentation apparatus and method, and apparatus and method for removing red-eye in the image

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100344150C (en) * 2004-06-14 2007-10-17 佳能株式会社 Image processing apparatus and image-taking apparatus
JP2006012062A (en) * 2004-06-29 2006-01-12 Canon Inc Image processor and its method, program and imaging device
JP4574249B2 (en) * 2004-06-29 2010-11-04 キヤノン株式会社 Image processing apparatus and method, program, and imaging apparatus
JP2008541509A (en) * 2005-04-28 2008-11-20 ヒューレット−パッカード デベロップメント カンパニー エル.ピー. Method and apparatus for incorporating iris color in red-eye correction
JP4834725B2 (en) * 2005-04-28 2011-12-14 ヒューレット−パッカード デベロップメント カンパニー エル.ピー. Method and apparatus for incorporating iris color in red-eye correction
US8306320B2 (en) 2008-03-07 2012-11-06 Samsung Electro-Mechanics Co., Ltd. 2D image segmentation apparatus and method, and apparatus and method for removing red-eye in the image
US8515169B2 (en) 2008-03-07 2013-08-20 Samsung Electro-Mechanics Co., Ltd. Apparatus and method for removing red-eye in a two-dimensional (2D) image

Also Published As

Publication number Publication date
JP3994280B2 (en) 2007-10-17

Similar Documents

Publication Publication Date Title
JP4924264B2 (en) Image processing apparatus, image processing method, and computer program
EP0772116B1 (en) Computer calibration of a color print image using successive refinement
JP4345757B2 (en) Image data color correction
KR100374019B1 (en) Image processing method and apparatus, image processing system, and storage medium
JP4368513B2 (en) Image processing method and apparatus, and recording medium
JP2011018354A (en) Medium recording image modifying program, image modifying apparatus and method
JP2005108194A (en) Creation of image quality adjustment information and adjustment of image quality using this information
JP2004320624A (en) Lattice point determining method for preparing correspondence relation defining data, lattice point determining apparatus for preparing correspondence relation defining data, lattice point determining program for preparing correspondence relation defining data, print control apparatus, print control method, and print control program
JP4877074B2 (en) Image processing apparatus, image processing method, and computer program
JP2003264699A (en) Method for adjusting color, brightness and tone scale of rendered digital image
JP4146506B1 (en) Mosaic image generating apparatus, method and program
JP2001189862A (en) Image processing method and image processing device
JP3994280B2 (en) Red-eye correction device, red-eye correction method, and red-eye correction program
US6850341B1 (en) Method, system and recording medium for image processing
JP4492643B2 (en) Red-eye correction device, red-eye correction method, and red-eye correction program
JP4492642B2 (en) Red-eye correction device, red-eye correction method, and red-eye correction program
JP4492644B2 (en) Red-eye correction device, red-eye correction method, and red-eye correction program
US20060075918A1 (en) Image processing method, image processing device and image forming system
JP2009105951A (en) Correction of color of image data
JP3833170B2 (en) Gray line setting method, image processing apparatus and image processing method
JP2000285232A (en) Medium with picture sharpening program recorded and method and device for picture sharpening
JP2009031855A (en) Image processor, image processing method and computer program
JP2004259027A (en) Print control unit, print control method and print control program
JP2009081631A (en) Image processing apparatus, method and program
JP4375223B2 (en) Image processing apparatus, image processing method, and image processing program

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041105

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041105

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070404

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070601

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070704

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070717

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

Free format text: PAYMENT UNTIL: 20100810

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20100810

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110810

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120810

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees