JP4875470B2 - Color correction apparatus and color correction program - Google Patents

Color correction apparatus and color correction program Download PDF

Info

Publication number
JP4875470B2
JP4875470B2 JP2006316733A JP2006316733A JP4875470B2 JP 4875470 B2 JP4875470 B2 JP 4875470B2 JP 2006316733 A JP2006316733 A JP 2006316733A JP 2006316733 A JP2006316733 A JP 2006316733A JP 4875470 B2 JP4875470 B2 JP 4875470B2
Authority
JP
Japan
Prior art keywords
color
image
correction
face
background
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.)
Active
Application number
JP2006316733A
Other languages
Japanese (ja)
Other versions
JP2008131542A (en
Inventor
康治 横内
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Corp
Original Assignee
Fujifilm 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 Fujifilm Corp filed Critical Fujifilm Corp
Priority to JP2006316733A priority Critical patent/JP4875470B2/en
Publication of JP2008131542A publication Critical patent/JP2008131542A/en
Application granted granted Critical
Publication of JP4875470B2 publication Critical patent/JP4875470B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像データで表される画像の色補正を行う色補正装置および色補正プログラムに関する。   The present invention relates to a color correction apparatus and a color correction program that perform color correction of an image represented by image data.

近年、デジタルカメラやスキャナといった、カラーの画像情報をデジタルの画像データとして取り込む技術が発展し、その発展と共に、得られた画像データの処理を行うためのソフトウェア技術も盛んに開発されている。   In recent years, techniques for capturing color image information as digital image data, such as digital cameras and scanners, have been developed, and software techniques for processing the obtained image data have been actively developed along with the development.

こうしたソフトウェア技術の一つに、画像の色補正を行うことで画像の見栄えを良くする技術が存在する(例えば、特許文献1参照)。一般に、デジタルカメラやスキャナで得られた画像データで表される画像は、色合いが、ユーザの所望するものとは、ずれていることがある。そこで、デジタルカメラやスキャナで得られた画像データに対し、上記の色補正処理を行うことによってユーザの所望する画像に近づけることができる。特に、人物の画像の場合には、画像中の人物の顔の見栄えによってその画像から受ける人物の印象がかなり異なるものとなるために、こうした色補正処理は重要なものとなる。   As one of such software technologies, there is a technology that improves the appearance of an image by performing color correction of the image (see, for example, Patent Document 1). In general, in an image represented by image data obtained by a digital camera or a scanner, a hue may deviate from that desired by a user. Therefore, the image data obtained by the digital camera or the scanner can be brought close to the image desired by the user by performing the above color correction processing. In particular, in the case of a person image, such a color correction process is important because the person's impression received from the image differs considerably depending on the appearance of the person's face in the image.

また、卒業アルバムを作成する場合のように、複数の人物それぞれが写った複数の画像を並べて編集する場合においては、背景色が画像ごとに異なっていると、統一感に欠けた見苦しい画像群となってしまいやすい。そこで最近では、画像中の主要被写体(例えば顔領域)の検出を行う技術(例えば、特許文献2参照)を用いて主要被写体の検出を行って主要被写体に応じた色補正を実行し、さらに主要被写体以外の画像領域を背景として背景色の統一を行う技術(例えば、特許文献3参照)や、特許文献3とは逆に背景を先に検出し、背景以外の画像領域を顔領域として、背景色の補正量と顔領域の色の補正量とを重み付け加算した補正量で画像全体を色補正する技術(例えば、特許文献4参照)が提案されている。
特開平7−210658号公報 特開2006−244385号公報 特開2006−92127号公報 特開2006−139368号公報
In addition, when editing multiple images of each person, such as when creating a graduation album, if the background color is different for each image, the unsightly image group lacking a sense of unity It is easy to become. Therefore, recently, a main subject is detected using a technique (for example, see Patent Document 2) that detects a main subject (for example, a face region) in an image, and color correction corresponding to the main subject is performed. A technique for unifying background colors with an image area other than the subject as the background (see, for example, Patent Document 3), or contrary to Patent Document 3, the background is detected first, and the image area other than the background is used as the face area. A technique has been proposed in which the entire image is color-corrected with a correction amount obtained by weighted addition of the color correction amount and the face region color correction amount (see, for example, Patent Document 4).
Japanese Patent Laid-Open No. 7-210658 JP 2006-244385 A JP 2006-92127 A JP 2006-139368 A

特許文献3記載の方法では、顔領域の識別に際し、顔の持つ一般的な特徴を反映する画像領域を見つけ出す顔検出技術が応用される。しかし、現在の顔検出技術では、顔の位置を輪郭まで含めて正確に検出することは困難であり、顔が存在すると思われる顔周辺の画像領域(典型的には矩形の領域)を特定する程度に留まっている。このため、現在の顔検出技術をそのまま適用しても、人物の顔と背景との両方について適度な色補正を行うのは困難である。   In the method described in Patent Document 3, a face detection technique for finding an image area that reflects a general feature of a face is applied when identifying a face area. However, with the current face detection technology, it is difficult to accurately detect the face position including the contour, and an image area (typically a rectangular area) around the face where the face is supposed to exist is specified. It remains to the extent. For this reason, even if the current face detection technology is applied as it is, it is difficult to perform appropriate color correction on both the face and background of a person.

特許文献4記載の方法では、参照となる背景色(例えば、青一色の背景色)があらかじめ登録されており、画像領域の色がその参照背景色に近ければ、その画像領域は背景領域
であると判定される。しかし、一般に、画像中には、人物の顔に加え、人物の服の一部も現れていることが多く、特許文献3記載の方法では、画像中の服の色が参照背景色と大きく異なる場合には、服の部分も顔領域とみなされて顔の色に合うように色補正されてしまうことになる。このため、特許文献4記載の方法でも、人物の顔と背景との両方について適度な色補正を行うのは困難である。
In the method described in Patent Document 4, a reference background color (for example, a blue background color) is registered in advance, and if the color of the image area is close to the reference background color, the image area is the background area. It is determined. However, in general, in addition to a person's face, a part of the person's clothes often appears in the image, and in the method described in Patent Document 3, the color of the clothes in the image is significantly different from the reference background color. In this case, the clothes portion is also regarded as a face region and color correction is performed so as to match the face color. For this reason, even with the method described in Patent Document 4, it is difficult to perform appropriate color correction on both the face and background of a person.

本発明は、上記事情に鑑み、画像中の顔と背景との両方について適度な色補正を行う色補正装置および色補正プログラムを提供することを目的とする。   In view of the above circumstances, an object of the present invention is to provide a color correction apparatus and a color correction program that perform appropriate color correction on both a face and a background in an image.

上記目的を達成するための本発明の色補正装置は、
各々に人物が写っている複数の画像それぞれについて人物の顔の領域を検出する顔領域検出部と、
上記複数の画像それぞれについて、上記顔領域検出部によって検出された顔の領域が所定の望ましい色となるような、各画像に応じた色補正を施す顔色補正部と、
上記顔領域検出部によって検出された顔の領域あるいは画像の全域に対して所定の位置関係に存在する背景領域を上記複数の画像それぞれについて求め、背景領域の色が該複数の画像間で統一されるような色補正を各画像に施す背景色統一部と、
画像中の各点が背景と顔とのどちらにどの程度帰属するかを表したマスクを、各点と上記背景領域との色の近さおよび各点と上記顔領域との位置の近さに基づいて、上記複数の画像それぞれについて作成するマスク作成部と、
上記マスク作成部によって作成されたマスクを用いて、上記顔色補正部で補正されて得られた第1の補正画像と上記背景色統一部で補正されて得られた第2の補正画像とを、顔に強く帰属する点は第1の補正画像の成分が強く、背景に強く帰属する点は第2の補正画像の成分が強くなるように合成する合成部とを備えたことを特徴とする。
In order to achieve the above object, the color correction apparatus of the present invention provides:
A face area detection unit for detecting a person's face area for each of a plurality of images each containing a person;
For each of the plurality of images, a face color correction unit that performs color correction according to each image such that the face region detected by the face region detection unit has a predetermined desired color;
For each of the plurality of images, a background region existing in a predetermined positional relationship with the face region or the entire image detected by the face region detection unit is obtained, and the color of the background region is unified among the plurality of images. A background color unification unit that applies color correction to each image,
A mask that indicates how much each point in the image belongs to the background or the face is determined based on the proximity of the color between each point and the background region and the proximity between each point and the face region. Based on each of the plurality of images, a mask creation unit,
Using the mask created by the mask creation unit, a first correction image obtained by correction by the face color correction unit and a second correction image obtained by correction by the background color unification unit, A point that strongly belongs to the face is provided with a combining unit that combines the components so that the component of the first corrected image is strong, and the point that strongly belongs to the background is that of the second corrected image.

本発明の色補正装置は、上記の第1の補正画像と第2の補正画像とを、顔に強く帰属する点は第1の補正画像の成分が強く、背景に強く帰属する点は第2の補正画像の成分が強くなるように合成するので、顔の領域の色が上記の所定の望ましい色に近く、しかも背景領域の色は上記の複数の画像間で統一されているような合成画像が作成される。このため、本発明の色補正装置では、画像中の顔と背景との両方について適度な色補正が行われることとなる。   In the color correction apparatus according to the present invention, the first correction image and the second correction image are strongly attributed to the face, the first correction image component is strong, and the background is strongly attributed to the second. Since the components of the corrected image are combined so as to be strong, the color of the face region is close to the predetermined desired color, and the color of the background region is unified among the plurality of images. Is created. For this reason, in the color correction apparatus of the present invention, appropriate color correction is performed for both the face and the background in the image.

また、本発明の色補正装置において、「上記背景色統一部が、上記顔色補正部で補正されて得られた第1の補正画像上の背景領域に基づいて、上記複数の画像間で統一されるべき統一背景色を求め、該複数の画像のそれぞれに対して、背景領域の色が該統一背景色となるような色補正を施すものである」という形態は好ましい形態である。   In the color correction apparatus of the present invention, “the background color unifying unit is unified among the plurality of images based on the background region on the first corrected image obtained by the correction by the face color correcting unit. A form in which a unified background color to be obtained is obtained and color correction is performed on each of the plurality of images so that the color of the background region becomes the unified background color is a preferable form.

このような形態によれば、顔の領域の色が補正された後の画像中の背景領域の色に基づいて統一背景色が求められるので、合成された画像において、顔の領域の色と背景領域の色とがバランスのとれたものとなる。   According to such a form, since the unified background color is obtained based on the color of the background region in the image after the color of the face region is corrected, the color of the face region and the background in the synthesized image The color of the area is balanced.

また、本発明の色補正装置において、「上記マスク作成部は、各点と上記背景領域との色の近さとして、背景領域の色と各点の色との所定の色空間上における距離を用いるものである」という形態も好ましい形態である。   Further, in the color correction apparatus of the present invention, “the mask creation unit determines the distance in the predetermined color space between the color of the background region and the color of each point as the closeness of the color between each point and the background region. The form “used” is also a preferred form.

このような形態によれば、画像中の各点が背景にどの程度帰属しているかを定量的に表すことが容易である。   According to such a form, it is easy to quantitatively represent how much each point in the image belongs to the background.

また、本発明の色補正装置において、「上記マスク作成部は、各点と上記顔領域との位置の近さとして、該顔領域の中心点と各点との画像上の距離を用いるものである」という形態も好ましい形態である。   In the color correction apparatus of the present invention, “the mask creating unit uses a distance on the image between the center point of each face area and each point as the proximity of the position between each point and the face area. The form “is” is also a preferable form.

このような形態によれば、画像中の各点が顔の領域にどの程度帰属しているかを定量的に表すことが容易である。   According to such a form, it is easy to quantitatively represent how much each point in the image belongs to the face region.

上記目的を達成するための本発明の色補正プログラムは、
コンピュータシステムに組み込まれ、そのコンピュータシステム上に、
各々に人物が写っている複数の画像それぞれについて人物の顔の領域を検出する顔領域検出部と、
上記複数の画像それぞれについて、上記顔領域検出部によって検出された顔の領域が所定の望ましい色となるような、各画像に応じた色補正を施す顔色補正部と、
上記顔領域検出部によって検出された顔の領域あるいは画像の全域に対して所定の位置関係に存在する背景領域を上記複数の画像それぞれについて求め、背景領域の色が該複数の画像間で統一されるような色補正を各画像に施す背景色統一部と、
画像中の各点が背景と顔とのどちらにどの程度帰属するかを表したマスクを、各点と上記背景領域との色の近さおよび各点と上記顔領域との位置の近さに基づいて、上記複数の画像それぞれについて作成するマスク作成部と、
上記マスク作成部によって作成されたマスクを用いて、上記顔色補正部で補正されて得られた第1の補正画像と上記背景色統一部で補正されて得られた第2の補正画像とを、顔に強く帰属する点は第1の補正画像の成分が強く、背景に強く帰属する点は第2の補正画像の成分が強くなるように合成する合成部とを構築することを特徴とする。
In order to achieve the above object, the color correction program of the present invention provides:
Built into a computer system, on that computer system,
A face area detection unit for detecting a person's face area for each of a plurality of images each containing a person;
For each of the plurality of images, a face color correction unit that performs color correction according to each image such that the face region detected by the face region detection unit has a predetermined desired color;
For each of the plurality of images, a background region existing in a predetermined positional relationship with the face region or the entire image detected by the face region detection unit is obtained, and the color of the background region is unified among the plurality of images. A background color unification unit that applies color correction to each image,
A mask that indicates how much each point in the image belongs to the background or the face is determined based on the proximity of the color between each point and the background region and the proximity between each point and the face region. Based on each of the plurality of images, a mask creation unit,
Using the mask created by the mask creation unit, a first correction image obtained by correction by the face color correction unit and a second correction image obtained by correction by the background color unification unit, A point that strongly belongs to the face has a strong component of the first correction image, and a point that strongly belongs to the background has a composition unit that composes so that the component of the second correction image becomes strong.

この本発明の色補正プログラムをコンピュータシステム内で実行することによって、本発明の色補正装置を容易に実現することができる。   By executing the color correction program of the present invention in a computer system, the color correction apparatus of the present invention can be easily realized.

なお、本発明にいう色補正プログラムについては、ここではその基本形態のみを示すにとどめるが、これは単に重複を避けるためであり、本発明にいう色補正プログラムには、上記の基本形態のみでなく、前述した色補正装置の各形態に対応する各種の形態が含まれる。   Note that the color correction program according to the present invention is shown only in its basic form here, but this is merely for avoiding duplication, and the color correction program according to the present invention includes only the above basic form. Instead, various forms corresponding to the respective forms of the color correction apparatus described above are included.

さらに、本発明の色補正プログラムがコンピュータシステム上に構築する合成部などといった要素は、1つの要素が1つのプログラム部品によって構築されるものであってもよく、1つの要素が複数のプログラム部品によって構築されるものであってもよく、複数の要素が1つのプログラム部品によって構築されるものであってもよい。また、これらの要素は、そのような作用を自分自身で実行するものとして構築されていてもよく、あるいは、コンピュータシステムに組み込まれている他のプログラムやプログラム部品に指示を与えて実行するものとして構築されていてもよい。   Further, the elements such as the synthesis unit that the color correction program of the present invention constructs on the computer system may be one element constructed by one program part, and one element by a plurality of program parts. It may be constructed, or a plurality of elements may be constructed by one program part. In addition, these elements may be constructed so as to execute such an action by themselves, or may be executed by giving instructions to other programs and program components incorporated in the computer system. It may be constructed.

本発明によれば、画像中の顔と背景との両方について適度な色補正を行うことができる。   According to the present invention, it is possible to perform appropriate color correction for both the face and the background in the image.

以下、本発明の実施形態について説明する。   Hereinafter, embodiments of the present invention will be described.

図1は、本発明の一実施形態が適用された画像処理システムの全体構成図である。
この画像処理システムは、コンピュータを使って印刷物を作成するDTP(DeskTop Publishing)が適用されたシステムであり、ユーザがパーソナルコンピュータ100で、複数の人物それぞれが写った複数の画像からなる画像群を並べて編集して、カラープリンタ2170で出力するシステムである。パーソナルコンピュータ100には、カラースキャナ(図示しない)で原稿画像が読み取られて生成された、カラーの人物の画像の読取画像データや、デジタルカメラ(図示しない)で撮影された人物を表すカラーの撮影画像データなどが画像編集の素材として入力される。パーソナルコンピュータ100に入力される画像からなる画像群210は、主にアルバム編集用の画像群であり、どの画像も、その中の人物が、ほぼ単色の背景をバックにして顔を正面に向けているカラー画像である。これらの画像群210は、パーソナルコンピュータ100において、各画像中の顔部分の色補正が行われるとともに、背景についても画像群全体で統一感が得られるように色補正が行われる。色補正後の画像群210Aを表す画像データは、パーソナルコンピュータ100中の不図示のRIP(Raster Image Processor)において、カラープリンタ2170で出力可能なラスターデータに変換される。変換後のラスターデータは、カラープリンタ2170に入力され、カラープリンタ2170では、その入力されたラスターデータに基づく出力画像210Bが作成される。
FIG. 1 is an overall configuration diagram of an image processing system to which an embodiment of the present invention is applied.
This image processing system is a system to which DTP (DeskTop Publishing) for creating a printed matter using a computer is applied. The user is a personal computer 100 and arranges an image group composed of a plurality of images in which a plurality of persons are captured. This is a system for editing and outputting with a color printer 2170. In the personal computer 100, read image data of a color person image generated by reading a document image with a color scanner (not shown), or color image representing a person shot with a digital camera (not shown). Image data or the like is input as image editing material. An image group 210 composed of images input to the personal computer 100 is an image group mainly for album editing. In any image, a person in the image faces a front with a substantially monochromatic background in the background. It is a color image. These image groups 210 are color-corrected so that the personal computer 100 can perform color correction of the face portion in each image and also obtain a sense of unity in the entire image group with respect to the background. Image data representing the image group 210A after color correction is converted into raster data that can be output by the color printer 2170 in a RIP (Raster Image Processor) (not shown) in the personal computer 100. The converted raster data is input to the color printer 2170, and the color printer 2170 creates an output image 210B based on the input raster data.

このように、図1に示す画像処理システムにおいては、パーソナルコンピュータ100によって画像の色補正処理が行われた上で最終的な出力画像群210Bが作成される。この画像処理システムにおける、本発明の一実施形態としての特徴は、このパーソナルコンピュータ100で実行される色補正処理の内容にあり、このパーソナルコンピュータ100が、本発明の色補正装置の一実施形態として動作する。以下では、このパーソナルコンピュータ100について詳しく説明する。   As described above, in the image processing system shown in FIG. 1, the final output image group 210 </ b> B is created after the color correction processing of the image is performed by the personal computer 100. A feature of the image processing system as an embodiment of the present invention lies in the content of color correction processing executed by the personal computer 100, and the personal computer 100 is an embodiment of the color correction apparatus of the present invention. Operate. Hereinafter, the personal computer 100 will be described in detail.

図2は、本発明の色補正装置の一実施形態として動作するパーソナルコンピュータの外観斜視図、図3は、そのハードウェア構成図である。   2 is an external perspective view of a personal computer that operates as an embodiment of the color correction apparatus of the present invention, and FIG. 3 is a hardware configuration diagram thereof.

このパーソナルコンピュータ100は、後述するCPU、RAMメモリ、ハードディスク等を内蔵した本体部110、本体部110からの指示により表示画面121に画面表示を行なう画像表示装置120、このパーソナルコンピュータ100内にユーザの指示や文字情報を入力するためのキーボード130、表示画面121上の任意の位置を指定することによりその位置に応じた指示を入力するマウス140を備えている。   The personal computer 100 includes a main body 110 incorporating a CPU, a RAM memory, a hard disk, and the like which will be described later, an image display device 120 that displays a screen on the display screen 121 according to an instruction from the main body 110, and a user's computer in the personal computer 100. A keyboard 130 for inputting instructions and character information and a mouse 140 for inputting an instruction corresponding to the position by designating an arbitrary position on the display screen 121 are provided.

本体部110は、さらにフレキシブルディスク(以下FDと略す)が装填されるFD装填口111、CD−ROMが装填されるCD−ROM装填口112を有しており、その内部には、装填されたFDやCD−ROMをドライブする、後述するFDドライブ、CD−ROMドライブも内蔵されている。   The main body 110 further has an FD loading slot 111 into which a flexible disk (hereinafter abbreviated as FD) is loaded, and a CD-ROM loading slot 112 into which a CD-ROM is loaded. An FD drive and a CD-ROM drive (to be described later) for driving an FD and a CD-ROM are also incorporated.

本体部110の内部には、図3に示すように、各種プログラムを実行するCPU211、ハードディスク装置213に格納されたプログラムが読み出されCPU211での実行のために展開される主メモリ212、各種プログラムやデータ等が保存されたハードディスク装置213、FD2140が装填され、その装填されたFD2140にアクセスするFDドライブ214、CD−ROM2150が装填され、その装填されたCD−ROM2150にアクセスするCD−ROMドライブ215が内蔵されている。これらの各種要素と、さらに、図2にも示す画像表示装置120、キーボード130、マウス140は、バス1200を介して相互に接続されている。また、パーソナルコンピュータ100の外部には、画像を出力するためのカラープリンタ2170が備えられており、カラープリンタ2170に向けてパーソナルコンピュータ100から出力データを送るために、パーソナルコンピュータ100には出力インタフェース217が内蔵されている。また、パーソナルコンピュータ100には、不図示のスキャナーなどの外部機器と接続して画像データを入力することができるI/Oインタフェース216も内蔵されている。接続された外部機器の制御も、このI/Oインタフェース216を介して行われる。これら出力インタフェース217およびI/Oインタフェース216も、パーソナルコンピュータ100内部のハードウェアを構成する上述の各種要素と、バス1200を介して相互に接続されている。   As shown in FIG. 3, the main body 110 includes a CPU 211 that executes various programs, a main memory 212 that reads programs stored in the hard disk device 213 and develops them for execution by the CPU 211, and various programs. And a hard disk device 213 and FD 2140 in which data and the like are stored are loaded, an FD drive 214 and a CD-ROM 2150 that access the loaded FD 2140 are loaded, and a CD-ROM drive 215 that accesses the loaded CD-ROM 2150 Is built-in. These various elements and the image display device 120, the keyboard 130, and the mouse 140 shown in FIG. 2 are also connected to each other via a bus 1200. Further, a color printer 2170 for outputting an image is provided outside the personal computer 100, and an output interface 217 is provided to the personal computer 100 in order to send output data from the personal computer 100 to the color printer 2170. Is built-in. The personal computer 100 also includes an I / O interface 216 that can be connected to an external device such as a scanner (not shown) to input image data. The connected external device is also controlled via the I / O interface 216. The output interface 217 and the I / O interface 216 are also connected to each other through the bus 1200 with the above-described various elements constituting the hardware inside the personal computer 100.

このパーソナルコンピュータ100では、パーソナルコンピュータ100のユーザは、処理対象となる画像データを、I/Oインタフェース216から入力してハードディスク装置213に保存することができ、また画像データが記録されているFD2140やCD−ROM2150から、それぞれFDドライブ214、CD−ROMドライブ215を介してハードディスク装置213に保存することもできる。   In this personal computer 100, the user of the personal computer 100 can input image data to be processed from the I / O interface 216 and save it in the hard disk device 213, and the FD 2140 in which the image data is recorded, The data can also be stored in the hard disk device 213 from the CD-ROM 2150 via the FD drive 214 and the CD-ROM drive 215, respectively.

次に本発明の色補正プログラムの一実施形態について説明する。   Next, an embodiment of the color correction program of the present invention will be described.

本発明の色補正プログラムの一実施形態が、例えばCD−ROM2150に記憶されている場合には、このCD−ROM2150がCD−ROM装填口112から本体110内に装填されると、そのCD−ROM2150に記憶された色補正プログラムがCD−ROMドライブ215によりこのパーソナルコンピュータ100のハードディスク装置213内にインストールされる。そして、このハードディスク装置213内にインストールされた色補正プログラムが起動されると、このパーソナルコンピュータ100は、本発明の色補正装置の一実施形態として動作する。   When one embodiment of the color correction program of the present invention is stored in, for example, the CD-ROM 2150, when the CD-ROM 2150 is loaded into the main body 110 from the CD-ROM loading slot 112, the CD-ROM 2150 is stored. The color correction program stored in the hard disk device 213 of the personal computer 100 is installed by the CD-ROM drive 215. When the color correction program installed in the hard disk device 213 is activated, the personal computer 100 operates as an embodiment of the color correction device of the present invention.

図4は、本発明の色補正プログラムの一実施形態を示す図である。   FIG. 4 is a diagram showing an embodiment of the color correction program of the present invention.

ここでは、この色補正プログラム900は、CD−ROM2150に記憶されている。なお、本発明にいう色補正プログラム900が記憶される記憶媒体としては、図4に示すCD−ROM2150のみならず、図3に示すハードディスク装置213やFD2140、図3および図4には不図示のDVDやMO等といった種々の記憶媒体が採用されうる。   Here, this color correction program 900 is stored in the CD-ROM 2150. The storage medium for storing the color correction program 900 according to the present invention is not limited to the CD-ROM 2150 shown in FIG. 4, but also the hard disk device 213 and FD 2140 shown in FIG. 3, not shown in FIGS. Various storage media such as DVD and MO can be employed.

この色補正プログラム900は、図2および図3に示すパーソナルコンピュータ100内で実行され、上述したように、そのパーソナルコンピュータ100を本発明の一実施形態として動作させるものであり、画像データ取得部20、顔検出部21、仮補正部22、目標背景色算出部23、背景統一画像作成部24、および画像合成部25を有している。   The color correction program 900 is executed in the personal computer 100 shown in FIGS. 2 and 3 and operates the personal computer 100 as one embodiment of the present invention as described above. A face detection unit 21, a temporary correction unit 22, a target background color calculation unit 23, a unified background image creation unit 24, and an image composition unit 25.

この色補正プログラム900の各要素の詳細な内容については後述する。   Detailed contents of each element of the color correction program 900 will be described later.

図5は、図2および図3に示すパーソナルコンピュータを本発明の色補正装置の一実施形態として動作させるためにこのパーソナルコンピュータ上に構築される要素と、それらの要素による作用の概略を表す図である。   FIG. 5 is a diagram showing an outline of elements constructed on the personal computer for operating the personal computer shown in FIGS. 2 and 3 as an embodiment of the color correction apparatus of the present invention, and actions by these elements. It is.

図4に示す色補正プログラム900が図2および図3に示すパーソナルコンピュータ100にインストールされると、図5に示す画像データ取得部10、顔検出部11、仮補正部12、目標背景色算出部13、背景統一画像作成部14、および画像合成部15の各要素がパーソナルコンピュータ100上に構築される。これらの要素によって、パーソナルコンピュータ100が本発明の色補正装置の一実施形態として動作する。画像データ取得部10、顔検出部11、仮補正部12、目標背景色算出部13、背景統一画像作成部14、および画像合成部15は、図4に示す色補正プログラム900における、画像データ取得部20、顔検出部21、仮補正部22、目標背景色算出部23、背景統一画像作成部24、および画像合成部25それぞれによってパーソナルコンピュータ100上に構築されるものである。従って図4の各要素は図5の各要素に対応するが、この図5の各要素は、図2および図3に示すパーソナルコンピュータ100のハードウェアとそのパーソナルコンピュータ100で実行されるOSやアプリケーションプログラムとの組合せで構成されているのに対し、図4に示す色補正プログラム900の各要素はそれらのうちのアプリケーションプログラムのみにより構成されている点が異なる。ここで、顔検出部21が、本発明にいう顔領域検出部の一例に相当し、仮補正部22が、本発明にいう顔色補正部の一例に相当する。また、目標背景色算出部23と背景統一画像作成部24を合わせたものが、本発明にいう背景色統一部の一例に相当し、画像合成部25が、本発明にいうマスク作成部と合成部とを兼ねた一例に相当する。以下では、図5に示す各要素と、各要素による作用の概略について説明する。   When the color correction program 900 shown in FIG. 4 is installed in the personal computer 100 shown in FIGS. 2 and 3, the image data acquisition unit 10, the face detection unit 11, the temporary correction unit 12, and the target background color calculation unit shown in FIG. 13, each element of the unified background image creation unit 14 and the image composition unit 15 is constructed on the personal computer 100. With these elements, the personal computer 100 operates as an embodiment of the color correction apparatus of the present invention. The image data acquisition unit 10, the face detection unit 11, the temporary correction unit 12, the target background color calculation unit 13, the background unified image creation unit 14, and the image synthesis unit 15 acquire image data in the color correction program 900 illustrated in FIG. 4. The unit 20, the face detection unit 21, the temporary correction unit 22, the target background color calculation unit 23, the background unified image creation unit 24, and the image composition unit 25 are each constructed on the personal computer 100. Therefore, each element in FIG. 4 corresponds to each element in FIG. 5, and each element in FIG. 5 includes the hardware of the personal computer 100 shown in FIGS. 2 and 3, and the OS and application executed on the personal computer 100. 4 is different from the first embodiment in that each element of the color correction program 900 shown in FIG. 4 is configured only by an application program. Here, the face detection unit 21 corresponds to an example of a face area detection unit according to the present invention, and the temporary correction unit 22 corresponds to an example of a face color correction unit according to the present invention. The combination of the target background color calculation unit 23 and the unified background image creation unit 24 corresponds to an example of the unified background color unit according to the present invention, and the image synthesis unit 25 combines with the mask creation unit according to the present invention. This corresponds to an example of serving as a part. Below, each element shown in FIG. 5 and the outline of the effect | action by each element are demonstrated.

図5に示す画像データ取得部10は、ユーザの指示に基づき、色補正処理の対象として、色補正前の人物の画像をそれぞれ表した一群の画像データからなる画像データ群を、図3に示すハードディスク装置213から取得する。以下では、色補正前の画像(画像データ)を、色補正後の画像と区別するために、原画像(原画像データ)と呼ぶ。顔検出部11は、画像データ取得部10により読み出された原画像データに基づき顔領域の検出を行い、仮補正部12は、検出された顔領域の色が適度な色となるような補正量で原画像上の全領域に対して色補正を施す。顔検出部11の後段の処理部である目標背景色算出部13は、仮補正部12によって色補正が施された後の画像データ群に基づき、画像群全体の統一的な背景色として目標となる目標背景色を算出する。背景統一画像作成部14は、算出された目標背景色を実現するように原画像に対し色補正処理を行う。仮補正部12および背景統一画像作成部14の双方の後段に位置する処理部である画像合成部15は、仮補正部12で色補正された画像と、背景統一画像作成部14で色補正された画像との合成を行う。この合成の際には、画像合成部15は、仮補正部12で色補正された画像中の顔部分が強調され、背景統一画像作成部14で色補正された画像中の背景が強調されるように、2つの画像の合成を行う。   The image data acquisition unit 10 shown in FIG. 5 shows, as shown in FIG. 3, an image data group made up of a group of image data each representing an image of a person before color correction as an object of color correction processing based on a user instruction. Obtained from the hard disk device 213. Hereinafter, an image (image data) before color correction is referred to as an original image (original image data) in order to distinguish it from an image after color correction. The face detection unit 11 detects a face area based on the original image data read by the image data acquisition unit 10, and the temporary correction unit 12 corrects the detected face area to have an appropriate color. Color correction is applied to the entire area on the original image by the amount. The target background color calculation unit 13, which is a subsequent processing unit of the face detection unit 11, uses the target background color as a unified background color for the entire image group based on the image data group after color correction is performed by the temporary correction unit 12. The target background color is calculated. The background unified image creation unit 14 performs color correction processing on the original image so as to realize the calculated target background color. The image compositing unit 15, which is a processing unit located downstream of both the temporary correction unit 12 and the background unified image creation unit 14, is color-corrected by the image corrected by the temporary correction unit 12 and the background unified image creation unit 14. Is combined with the selected image. At the time of this composition, the image composition unit 15 emphasizes the face portion in the image color-corrected by the temporary correction unit 12 and the background in the image color-corrected by the background unified image creation unit 14. Thus, two images are synthesized.

次にコンピュータ100による色補正処理の流れについてフローチャートを用いて説明する。   Next, the flow of color correction processing by the computer 100 will be described using a flowchart.

図6は、パーソナルコンピュータ100による色補正処理の動作を表すフローチャート図である。   FIG. 6 is a flowchart showing the operation of color correction processing by the personal computer 100.

色補正処理が行われる際には、色補正処理の対象としてユーザによって指定された原画像群をそれぞれ表した原画像データ群が、図5の画像データ取得部10により取得される(ステップS1)。こうした原画像データ群で表される原画像群とは、例えば、ユーザによって指定されたフォルダ中に存在する全ての原画像や、ユーザによって指定されたPDFのデータ形式のファイル中に存在する原画像群などである。以下ではこうした原画像群が全部でN個の原画像からなるものとして説明を行う。また、以下に説明するステップS2〜ステップS5の処理は、N個の原画像データについて、1番目の原画像データからN番目の原画像データまで順番に行われるものであるが、以下では、i番目の画像データの処理を例にとって説明する。   When color correction processing is performed, original image data groups each representing an original image group designated by the user as a target for color correction processing are acquired by the image data acquisition unit 10 of FIG. 5 (step S1). . The original image group represented by such an original image data group is, for example, all original images existing in a folder specified by the user, or an original image existing in a file having a PDF data format specified by the user. Such as a group. In the following description, it is assumed that such an original image group consists of N original images in total. In addition, the processes in steps S2 to S5 described below are performed in order from the first original image data to the Nth original image data for N pieces of original image data. The processing of the second image data will be described as an example.

顔検出部11により、N個の原画像データの中からi番目の原画像データが読み出され(ステップS2)、そのi番目の原画像データに基づき、その原画像データで表された人物の顔領域の検出が行われる(ステップS3)。この顔検出においては、上述の特許文献2に記載されている顔検出の技術が適用される。一般に、顔領域においては、右目は頬より暗い、左目は眉間より暗い、鼻孔は頬より暗いといった特徴がある。パーソナルコンピュータ100には、あらかじめ、そうした顔領域を特徴づける参照データが記憶されており、顔検出部11は、参照データを参照して、画像中の正方形の検出領域においてそうした顔領域の特徴が現れているかどうかを検出することで、検出領域が、顔領域か、あるいは非顔領域かを判定する。顔検出部11は、こうした判定を検出領域の位置を変えながら実行して画像中で顔領域の検出を行う。さらに、顔検出部11は、画像サイズを所定の割合で縮小しながら各縮小画像についてもこのような顔領域の検出を行う。このように縮小画像について顔領域の検出を行うことで、顔の大きさが検出領域の大きさと同程度にまで縮小されたときに顔領域を検出することができ、この検出により縮小前の画像における顔領域が求められる。このような顔領域の検出により、顔領域の大きさと位置(顔領域の中心位置)の情報が取得される。   The face detection unit 11 reads the i-th original image data from the N pieces of original image data (step S2). Based on the i-th original image data, the face detection unit 11 detects the person represented by the original image data. A face area is detected (step S3). In this face detection, the face detection technique described in Patent Document 2 is applied. In general, in the face area, the right eye is darker than the cheek, the left eye is darker than the eyebrows, and the nostril is darker than the cheek. In the personal computer 100, reference data characterizing such a face area is stored in advance, and the face detection unit 11 refers to the reference data, and the feature of the face area appears in the square detection area in the image. It is determined whether the detection area is a face area or a non-face area. The face detection unit 11 performs such determination while changing the position of the detection area, and detects the face area in the image. Further, the face detection unit 11 detects such a face region for each reduced image while reducing the image size at a predetermined rate. By detecting the face area of the reduced image in this way, the face area can be detected when the face size is reduced to the same extent as the size of the detection area. By this detection, the image before reduction is detected. The face area at is determined. By detecting the face area, information on the size and position of the face area (center position of the face area) is acquired.

ただし、このようにして検出される顔領域は、顔を含む正方形の領域であり、顔の輪郭を含めた顔の位置までを正確に求めるものではない。後述するように、このパーソナルコンピュータ100は、このような顔検出の機能を補う機能を備えており、この機能と顔検出の機能との両方を用いることで、画像中の顔と背景との両方について適度な色補正を行うことができる。   However, the face area detected in this way is a square area including the face, and the face position including the face outline is not accurately obtained. As will be described later, the personal computer 100 has a function for supplementing such a face detection function. By using both the function and the face detection function, both the face and the background in the image are used. Appropriate color correction can be performed.

顔検出部11により検出された顔領域の情報を有する顔領域データは、図5に示す仮補正部12、目標背景色算出部13、および画像合成部15にそれぞれ入力される。   Face area data having face area information detected by the face detection unit 11 is input to the temporary correction unit 12, the target background color calculation unit 13, and the image synthesis unit 15 shown in FIG.

仮補正部12は、顔領域データに基づき、i番目の原画像の顔領域の中心の色が、顔部分の色として望ましい色となるための補正量を求め、その補正量でi番目の原画像全体の色補正を行う。この色補正では、顔部分は適度に色補正されるが、この色補正では、原画像中の、顔部分以外の画像の色が適度になるかどうかは考慮されていない。後述の背景の色補正と区別するため、以下では、この仮補正部12の行う補正を仮補正と呼ぶ。この仮補正により、i番目の原画像データとに基づき、顔部分が適度に補正された仮補正画像が作成される(ステップS4)。そして、作成された仮補正画像を表す仮補正済画像データが、図5の目標背景色算出部13および画像合成部15にそれぞれ入力される。上述したように、目標背景色算出部13には、顔検出部11から顔領域データも入力されており、目標背景色算出部13は、顔領域データに基づき、仮補正画像の背景色の算出を行う(ステップS5)。ここで、この背景色の算出について具体的に説明する。   The temporary correction unit 12 obtains a correction amount for making the color of the center of the face area of the i-th original image a desirable color as the color of the face part based on the face area data, and the i-th original with the correction amount Perform color correction on the entire image. In this color correction, the face portion is moderately color-corrected, but this color correction does not consider whether the color of the image other than the face portion in the original image is appropriate. In order to distinguish from background color correction described later, the correction performed by the temporary correction unit 12 is hereinafter referred to as temporary correction. By this temporary correction, a temporary corrected image in which the face portion is appropriately corrected is created based on the i-th original image data (step S4). Then, provisionally corrected image data representing the created provisionally corrected image is input to the target background color calculation unit 13 and the image composition unit 15 shown in FIG. As described above, the target background color calculation unit 13 also receives the face area data from the face detection unit 11, and the target background color calculation unit 13 calculates the background color of the temporarily corrected image based on the face area data. (Step S5). Here, the calculation of the background color will be specifically described.

図7は、背景色の算出が行われる領域を表した図である。   FIG. 7 is a diagram showing an area where the background color is calculated.

図7には、縦幅2r、横幅2rの正方形の領域である顔領域70bが図示されている。目標背景色算出部13は、顔領域データで表された顔領域70bの位置と大きさの情報に基づき、顔領域70bの両側(左側および右側)に位置する、図7では斜線で示す縦幅3r、横幅3r/4の2つの矩形の背景色算出領域70cを求める。この縦幅3r、横幅3r/4の背景色算出領域70cの底辺は、図の上下方向について、顔領域70bの底辺と同じ高さにある。また、背景色算出領域70cそれぞれの、図の上下方向に延びた2本の辺のうち、顔領域70bから遠い方の辺は、図の水平方向について、顔領域70bの中心から2r離れている。目標背景色算出部13は、2つの背景色算出領域70cにおいて、R、G、Bの各色成分についての画素値の平均値を算出して、その平均値を保存する。この平均値がこの画像の背景色とみなされる。このように、顔領域70bの大きさを距離の基準として、顔領域70bから所定距離離れた位置にある背景色算出領域70cから背景色を求めることで、顔領域70bの色に影響されることなく平均的な背景色を求めることができる。なお、背景色を求める領域は、顔領域から十分に離れていればよく、その形も矩形以外の形状であってもよい。例えば、背景色を求める領域は、顔領域の両側の領域ではなく片側の領域であってもよく、また、顔領域の上側や斜め上に位置するものであってもよい。あるいは、顔領域を囲む周囲全体であってもよい。また、背景色を求める領域の位置は、必ずしも、顔領域に対して顔領域の大きさを基準とした所定の相対距離だけ離れた位置でなくてもよい。例えば、画像中の人物を表した画像部分と重なること通常はあり得ないような、画像の左上や右上に位置する小さな所定領域を上記の背景色算出領域としてもよいし、画像の4端(上下左右端)の画素群から上記の背景色を算出してもよい。   FIG. 7 shows a face area 70b which is a square area having a vertical width 2r and a horizontal width 2r. The target background color calculation unit 13 is located on both sides (left side and right side) of the face area 70b based on the position and size information of the face area 70b represented by the face area data. Two rectangular background color calculation areas 70c having a width of 3r and a width of 3r / 4 are obtained. The bottom side of the background color calculation area 70c having the vertical width 3r and the horizontal width 3r / 4 is at the same height as the bottom side of the face area 70b in the vertical direction in the figure. Of the two sides extending in the vertical direction in the figure in each of the background color calculation areas 70c, the side farther from the face area 70b is 2r away from the center of the face area 70b in the horizontal direction in the figure. . The target background color calculation unit 13 calculates the average value of the pixel values for the R, G, and B color components in the two background color calculation regions 70c, and stores the average value. This average value is regarded as the background color of this image. In this way, by obtaining the background color from the background color calculation area 70c located at a predetermined distance from the face area 70b using the size of the face area 70b as a reference of the distance, it is influenced by the color of the face area 70b. An average background color can be obtained. It should be noted that the area for which the background color is obtained needs only to be sufficiently away from the face area, and the shape thereof may be other than a rectangle. For example, the area for obtaining the background color may be an area on one side instead of an area on both sides of the face area, or may be located above or obliquely above the face area. Or the whole circumference | surroundings surrounding a face area | region may be sufficient. Further, the position of the area for obtaining the background color does not necessarily have to be a position separated from the face area by a predetermined relative distance based on the size of the face area. For example, a small predetermined area located in the upper left or upper right of the image that cannot normally overlap an image portion representing a person in the image may be used as the background color calculation area, or the four edges ( The background color may be calculated from a pixel group at the top, bottom, left, and right edges.

図6のフローチャートに戻り、パーソナルコンピュータ100による色補正処理の動作の説明を続ける。   Returning to the flowchart of FIG. 6, the description of the operation of the color correction processing by the personal computer 100 is continued.

ステップS5において仮補正画像の背景色の算出が行われた後、続いて、この仮補正画像の元になったi番目の原画像データが、仮補正処理が行われていない最後の原画像データ(すなわちN番目の原画像データ)であるか否かかが判定される(ステップS6)。i番目の原画像データが、N番目の原画像データでない場合(ステップS6;Yes)には、処理対象を(i+1)番目の画像データとして(ステップS7)、前述のステップS2〜ステップS5までの処理が(i+1)番目の原画像データに対して行われる。i番目の原画像データが、N番目の原画像データである場合(ステップS6;No)には、目標背景色算出部13は、N個の仮補正画像の背景色の画素値の平均値を算出する(ステップS8)。この平均値が、N個の画像の背景色を統一するための、目標となる背景色(目標背景色)の画素値である。目標背景色の画素値のデータは、N個の画像それぞれについての、ステップS5の背景色算出の際に用いられた図7の背景色算出領域70cの位置のデータと共に、図5の背景統一画像作成部14に入力される。図5では、目標背景色の画素値のデータと背景色算出領域70cの位置のデータとを合わせて目標背景色データとして示されている。ステップS8以降の、以下に説明するステップS9〜ステップS11の処理は、N個の原画像データについて、1番目の原画像データからN番目の原画像データまで順番に行われるものであるが、以下では、i番目の画像データの処理を例にとって説明する。   After the background color of the temporarily corrected image is calculated in step S5, the i-th original image data that is the source of the temporarily corrected image is the last original image data that has not been temporarily corrected. It is determined whether it is (that is, the Nth original image data) (step S6). When the i-th original image data is not the N-th original image data (step S6; Yes), the processing target is set to the (i + 1) -th image data (step S7), and the above-described steps S2 to S5 are performed. Processing is performed on the (i + 1) th original image data. When the i-th original image data is the N-th original image data (step S6; No), the target background color calculation unit 13 calculates the average value of the pixel values of the background colors of the N temporarily corrected images. Calculate (step S8). This average value is the pixel value of the target background color (target background color) for unifying the background colors of the N images. The pixel value data of the target background color is the background unified image of FIG. 5 together with the data of the position of the background color calculation area 70c of FIG. 7 used in the background color calculation of step S5 for each of the N images. Input to the creation unit 14. In FIG. 5, the pixel value data of the target background color and the data of the position of the background color calculation area 70c are shown together as target background color data. The processing of step S9 to step S11 described below after step S8 is performed in order from the first original image data to the Nth original image data for N pieces of original image data. Now, an i-th image data process will be described as an example.

背景統一画像作成部14により、N個の原画像データの中からi番目の原画像データが読み出され(ステップS9)、そのi番目の原画像データで表された原画像における、図7の背景色算出領域70cと同位置にある画像領域が求められる。そして、背景統一画像作成部14は、その画像領域の平均画素値が目標背景色の画素値となるための補正量を求め、その補正量でi番目の原画像全体の色補正を行う(ステップS10)。上述したように、入力される画像群は、主にアルバム編集用の画像群であり、どの画像についても背景の色は、ほぼ単色(例えば、人物のバックにある壁の色など)である。このため、背景色算出に用いられた背景色算出領域70cは背景全体の中の一部の領域にすぎないにもかかわらず、ステップS10の色補正により、背景全体がほぼ目標背景色に補正された背景統一画像が作成されることとなる。背景統一画像を表す背景統一済画像データは、図5に示す画像合成部15に入力される。ここで、画像合成部15には、i番目の原画像データや、仮補正画像を表す仮補正済画像データも入力されており、画像合成部15は、i番目の原画像に基づき合成マスクを作成し、この合成マスクを用いて仮補正画像の顔部分と、背景統一画像中の、顔部分を除いた画像部分との合成を行う(ステップS11)。以下、この画像合成について具体的に説明する。   The unified background image creation unit 14 reads out the i-th original image data from the N pieces of original image data (step S9), and the original image represented by the i-th original image data in FIG. An image area located at the same position as the background color calculation area 70c is obtained. Then, the background unified image creation unit 14 obtains a correction amount for the average pixel value of the image region to be the pixel value of the target background color, and performs color correction of the entire i-th original image with the correction amount (step) S10). As described above, the input image group is mainly an image group for album editing, and the background color of any image is almost a single color (for example, the color of the wall behind the person). For this reason, the background color calculation area 70c used for calculating the background color is only a partial area in the entire background, but the entire background is corrected to the target background color by the color correction in step S10. A unified background image will be created. The background unified image data representing the unified background image is input to the image composition unit 15 shown in FIG. Here, i-th original image data and provisionally corrected image data representing a provisionally corrected image are also input to the image composition unit 15, and the image composition unit 15 sets a composition mask based on the i-th original image. Using the composite mask, the face portion of the temporary correction image and the image portion excluding the face portion in the unified background image are combined (step S11). Hereinafter, this image composition will be specifically described.

上述したように、画像合成部15には、顔検出部11により作成された顔領域データが入力されている。画像合成部15は、まず、i番目の原画像の顔領域データに基づき、この原画像について、顔領域における、R、G、Bの各色成分についての画素値の平均である顔領域平均画素値(Rf,Gf,Bf)と、原画像における背景色の画素値(すなわち、原画像における背景色算出領域の平均画素値)とを求める。以下では、原画像における背景色の画素値を原画像背景画素値(Rb,Gb,Bb)と呼ぶ。次に、画像合成部15は、顔領域平均画素値(Rf,Gf,Bf)と原画像背景画素値(Rb,Gb,Bb)との領域平均色度距離dを求める。この領域平均色度距離dは、以下の式に従って、求められる。
=(Rf―Rb)/Rmax+(Gf―Gb)/Gmax
+(Bf―Bb)/Bmax ・・・・・・・・(1)
ここで、Rmaxは、RfとRbのうちの大きい方の値(等しい場合は、その値)を表しており、同様に、Gmax、Bmaxも、GfとGbのうちの大きい方の値(等しい場合は、その値)、BfとBbのうちの大きい方の値(等しい場合は、その値)をそれぞれ表している。
As described above, the face composition data created by the face detection unit 11 is input to the image composition unit 15. First, based on the face area data of the i-th original image, the image composition unit 15 determines the face area average pixel value that is the average of the pixel values for the R, G, and B color components in the face area for this original image. (Rf, Gf, Bf) and the pixel value of the background color in the original image (that is, the average pixel value of the background color calculation area in the original image) are obtained. Hereinafter, the pixel value of the background color in the original image is referred to as the original image background pixel value (Rb, Gb, Bb). Next, the image composition unit 15 obtains an area average chromaticity distance d 0 between the face area average pixel value (Rf, Gf, Bf) and the original image background pixel value (Rb, Gb, Bb). This area average chromaticity distance d 0 is obtained according to the following equation.
d 0 2 = (Rf−Rb) 2 / Rmax 2 + (Gf−Gb) 2 / Gmax 2
+ (Bf−Bb) 2 / Bmax 2 (1)
Here, Rmax represents the larger value of Rf and Rb (if it is equal, the value thereof). Similarly, Gmax and Bmax are also the larger value of Gf and Gb (if they are equal). Represents the larger value of Bf and Bb (or the value if equal).

次に、画像合成部15は、画像中の画素位置を2次元座標(x、y)で表したときの、座標点(x、y)に位置する画素の画素値(R(x、y),G(x、y),B(x、y))と、上述した原画像背景画素値(Rb,Gb,Bb)との色度距離d(x、y)を求める。この色度距離は、式(1)と同様にして求められる。この色度距離d(x、y)は、その定義から、背景色に近い画像領域ではほぼゼロに近い数値となり、色合いが背景色とは大きく異なるほど大きな値となる。ここで、色度距離d(x、y)が、領域平均色度距離dより大きくなっている画素が存在する場合は、さらに、その色度距離d(x、y)を、領域平均色度距離dに置き換える処理が施される。つまり、顔領域の色と背景の色の差の上限が決められている。 Next, the image composition unit 15 represents the pixel value (R (x, y) of the pixel located at the coordinate point (x, y) when the pixel position in the image is represented by two-dimensional coordinates (x, y). , G (x, y), B (x, y)) and the chromaticity distance d (x, y) between the original image background pixel values (Rb, Gb, Bb) described above. This chromaticity distance is obtained in the same manner as in equation (1). This chromaticity distance d (x, y) is, by definition, a numerical value that is substantially close to zero in an image region close to the background color, and becomes a larger value as the hue differs greatly from the background color. Here, when there is a pixel having a chromaticity distance d (x, y) larger than the area average chromaticity distance d 0 , the chromaticity distance d (x, y) is further set to the area average color. It is subjected to a process for replacing the time distance d 0. That is, the upper limit of the difference between the face area color and the background color is determined.

図8は、合成マスクが作成される様子を模式的に表した図である。   FIG. 8 is a diagram schematically showing how a composite mask is created.

図8のパート(a)は、色度距離d(x、y)の値が大きい画素ほど白い(すなわち、色度距離d(x、y)の値が小さい画素ほど黒い)という描画ルールで、色度距離d(x、y)の様子を模式的に表したものである。図8のパート(a)に示すように、顔部分301、服部分303においては色度距離d(x、y)の値が大きいために白っぽい領域となっており、一方、顔部分301、服部分303以外の画像領域である背景部分302は、横線で示す黒っぽい領域となっている。   Part (a) in FIG. 8 is a drawing rule in which a pixel having a larger value of chromaticity distance d (x, y) is whiter (that is, a pixel having a smaller value of chromaticity distance d (x, y) is blacker). This is a schematic representation of the chromaticity distance d (x, y). As shown in part (a) of FIG. 8, the face portion 301 and the clothing portion 303 are whitish because the value of the chromaticity distance d (x, y) is large. A background portion 302 that is an image region other than the portion 303 is a dark area indicated by a horizontal line.

次に、画像合成部15は、色度距離d(x、y)の値の変化が緩やかになるように、画像中において、色度距離d(x、y)の値の変化が大きい箇所の値をならす処理が行われる。さらに、画像合成部15は、上記の色度距離d(x、y)のならし後に、最小値フィルタを用いて色度距離d(x、y)の小さい値をカットする(値をゼロにする)処理を行う。これらの処理は、顔領域の大きさの1/8程度、すなわち図7では、r/4程度の大きさの空間フィルタを用いて画像上を走査することで行われる。これらの処理により、色度距離d(x、y)を表す図においては、境界線がぼやけたものとなる。   Next, the image synthesizing unit 15 selects a portion of the image where the change in the value of the chromaticity distance d (x, y) is large so that the change in the value of the chromaticity distance d (x, y) becomes gentle. Processing to level the value is performed. Further, the image composition unit 15 cuts a small value of the chromaticity distance d (x, y) using the minimum value filter after the above chromaticity distance d (x, y) (the value is set to zero). Process). These processes are performed by scanning the image using a spatial filter having a size of about 1/8 of the size of the face area, that is, about r / 4 in FIG. With these processes, the boundary line is blurred in the diagram representing the chromaticity distance d (x, y).

図8のパート(b)には、最小値フィルタが適用された後の色度距離d’(x、y)の様子が示されている。この図に示すように、図8のパート(b)では、境界が、図8のパート(a)と比べて曖昧なものとなっている。   Part (b) of FIG. 8 shows a state of the chromaticity distance d ′ (x, y) after the minimum value filter is applied. As shown in this figure, in part (b) of FIG. 8, the boundary is ambiguous compared to part (a) of FIG.

次に、画像合成部15は、顔領域データから顔領域の中心座標と顔領域の大きさを取得し、この情報と、あらかじめコンピュータ100内に保存されている、2次元平面上で定義された、距離についての単調減少関数とを組み合わせて、顔領域の中心座標付近が1であり、顔領域の中心座標から遠い位置ほど小さくなり、顔領域の外側ではほぼ0に近づいていくような重み関数α(x、y)を決定する。そしてこの重み関数α(x、y)を用い、画像中の位置を変数とする関数であって合成マスクを与える関数mask(x、y)を下記の式で定義する。
mask(x、y)=α(x、y)×d’(x、y)/d
ここで、領域平均色度距離dは、色度距離d(x、y)の規格化のために用いられており、規格化された色度距離d’(x、y)/dは、図8のパート(b)からもわかるように、顔部分や服部分において、大きな値(ほぼ1)となるが、この規格化されたd’(x、y)/dに対して、さらに重み関数α(x、y)がかかることで、主に顔部分だけが、大きな値をとる領域として残ることになる。
Next, the image composition unit 15 acquires the center coordinates of the face area and the size of the face area from the face area data, and defines this information and a two-dimensional plane previously stored in the computer 100. In combination with a monotonically decreasing function for distance, the weight function is such that the vicinity of the center coordinate of the face area is 1, the distance from the center coordinate of the face area becomes smaller, and it approaches 0 on the outside of the face area. α (x, y) is determined. Then, using this weight function α (x, y), a function mask (x, y) that uses a position in the image as a variable and gives a composite mask is defined by the following equation.
mask (x, y) = α (x, y) × d ′ (x, y) / d 0
Here, the region average chromaticity distance d 0 is used for normalization of the chromaticity distance d (x, y), and the normalized chromaticity distance d ′ (x, y) / d 0 is As can be seen from part (b) of FIG. 8, in the face part and clothes part, a large value (almost 1) is obtained, but for this normalized d ′ (x, y) / d 0 , Furthermore, by applying the weight function α (x, y), only the face portion mainly remains as a region having a large value.

図8のパート(c)は、関数mask(x、y)を、関数mask(x、y)の値が大きい画素ほど白い(すなわち、関数mask(x、y)の値が小さい画素ほど黒い)という描画ルールで表した図である。この図に示すように、重み関数α(x、y)で重み付けすることにより、主に顔部分だけが白っぽい領域として取り出されることになる。   Part (c) of FIG. 8 shows that the function mask (x, y) is whiter for pixels having a larger value of the function mask (x, y) (that is, a pixel having a smaller value of the function mask (x, y) is black). FIG. As shown in this figure, by weighting with a weighting function α (x, y), only the face portion is mainly extracted as a whitish region.

このように、本実施形態では、規格化された色度距離d’(x、y)/dを求めるために原画像データを用い、重み関数α(x、y)を決定するため(顔の中心位置を求めるため)に顔領域データを用いている。このように両方のデータを用いることで、単純に顔検出によって得られる顔領域データだけを用いて色補正を行ったときと比べて、画像中の顔と背景との両方についてより適切な色補正が施されることとなる。 As described above, in this embodiment, the original image data is used to obtain the normalized chromaticity distance d ′ (x, y) / d 0 and the weight function α (x, y) is determined (face Face area data is used to obtain the center position of the image. By using both data in this way, more appropriate color correction is performed for both the face and background in the image than when color correction is performed using only face area data obtained by face detection. Will be given.

画像合成部15は、顔部分の画像領域には、主に仮補正画像から取り出した顔部分が強調され、この顔部分以外の画像領域には、主に背景統一画像から取り出した、顔部分以外の画像部分が強調されるように画像の合成を行う。具体的には、合成画像における、座標(x、y)に位置する画素の画素値(RGBの各値)を、例えばR成分については、下記のように決定する。
{1−mask(x、y)}×RB(x、y)+mask(x、y)×RF(x、y)
ここで、上式においては、仮補正画像における座標(x、y)に位置する画素の画素値のR成分、および背景統一画像における座標(x、y)に位置する画素の画素値のR成分を、それぞれ、RF(x、y)およびRB(x、y)で表している。上式と同様の式で、G成分、B成分についても決定される。
The image composition unit 15 emphasizes the face portion extracted from the temporary correction image mainly in the image portion of the face portion, and the image region other than the face portion other than the face portion extracted mainly from the background unified image. The images are synthesized so that the image portion of the image is emphasized. Specifically, the pixel value (each RGB value) of the pixel located at the coordinates (x, y) in the composite image, for example, for the R component is determined as follows.
{1−mask (x, y)} × RB (x, y) + mask (x, y) × RF (x, y)
Here, in the above equation, the R component of the pixel value of the pixel located at the coordinate (x, y) in the temporary correction image and the R component of the pixel value of the pixel located at the coordinate (x, y) in the background unified image Are represented by RF (x, y) and RB (x, y), respectively. The G component and the B component are also determined by the same equation as the above equation.

このように、仮補正画像の顔部分と、背景統一画像の背景部分とを組み合わせることで、顔部分の色補正が行われるとともに、背景についても、画像群全体で統一感が得られるように色補正が行われることになる。   In this way, by combining the face part of the temporarily corrected image and the background part of the unified background image, the color of the face part is corrected, and the background is also colored so that a sense of unity can be obtained in the entire image group. Correction will be performed.

図6のフローチャートに戻り、パーソナルコンピュータ100による色補正処理の動作の説明を続ける。   Returning to the flowchart of FIG. 6, the description of the operation of the color correction processing by the personal computer 100 is continued.

ステップS11において仮補正画像と背景統一画像の合成が行われた後、続いて、合成された画像の元になったi番目の原画像データが、仮補正処理が行われていない最後の原画像データ(すなわちN番目の原画像データ)であるか否かかが判定される(ステップS12)。i番目の原画像データが、N番目の原画像データでない場合(ステップS12;Yes)には、処理対象を(i+1)番目の画像データとして(ステップS13)、上述のステップS9〜ステップS11までの処理が(i+1)番目の原画像データに対して行われる。i番目の原画像データが、N番目の原画像データである場合(ステップS12;No)には、画像群全ての色補正が完了することになる。   After the provisional correction image and the background unified image are combined in step S11, the i-th original image data that is the basis of the combined image is the last original image that has not been provisionally corrected. It is determined whether it is data (that is, the Nth original image data) (step S12). If the i-th original image data is not the N-th original image data (step S12; Yes), the processing target is set to the (i + 1) -th image data (step S13), and the above-described steps S9 to S11 are performed. Processing is performed on the (i + 1) th original image data. When the i-th original image data is the N-th original image data (step S12; No), the color correction of all the image groups is completed.

次に、色補正の処理の際にユーザに対して表示される画面について説明する。   Next, a screen displayed to the user during the color correction process will be described.

図9は、色補正が行われる際のウィンドウを表した図である。   FIG. 9 is a diagram showing a window when color correction is performed.

ユーザが、図2のコンピュータ100の色補正機能を起動させると、図9のパート(a)に示す色補正ウィンドウ400が立ち上がる。この色補正ウィンドウ400には、この図に示すように、処理対象となる画像群を指定するための画像群指定欄401が表示されている。ユーザは、この画像群指定欄401に、画像群が格納されているフォルダ名や、画像群を有するファイル名を書き込むことにより、色補正対象の画像群を指定することができる。この図9のパート(a)では、Cドライブのフォルダ「img」内に存在するフォルダ「org」に格納された画像群が指定されている様子が示されている。ここで、ユーザは、「開く」と書かれている画像表示ボタン402を図2のマウス140でクリックすることにより、それらの画像群を表示させることができる。   When the user activates the color correction function of the computer 100 of FIG. 2, a color correction window 400 shown in part (a) of FIG. 9 is launched. The color correction window 400 displays an image group designation field 401 for designating an image group to be processed as shown in this figure. The user can specify the image group to be color-corrected by writing the name of the folder in which the image group is stored or the name of the file having the image group in the image group specifying field 401. Part (a) of FIG. 9 shows a state where an image group stored in the folder “org” existing in the folder “img” of the C drive is designated. Here, the user can display the image group by clicking the image display button 402 written as “Open” with the mouse 140 in FIG. 2.

図9のパート(b)には、フォルダ「org」に格納された、画像501〜画像506からなる画像群が表示されている様子が示されている。これら画像群の右側には、補正ボタン408、再補正ボタン409、手動モードボタン410が設けられている。ユーザは、補正ボタン408をクリックすることにより、これらの画像群に対し、図6において説明した手順で色補正処理を実行させることができ、色補正ウィンドウ400内に表示される画像群は、色補正後の画像群に切り換わる。再補正ボタン409、手動モードボタン410については後述する。   Part (b) of FIG. 9 shows a state in which an image group made up of images 501 to 506 stored in the folder “org” is displayed. On the right side of these image groups, a correction button 408, a re-correction button 409, and a manual mode button 410 are provided. By clicking the correction button 408, the user can cause these image groups to perform color correction processing according to the procedure described with reference to FIG. 6, and the image group displayed in the color correction window 400 is a color group. Switch to the corrected image group. The recorrection button 409 and the manual mode button 410 will be described later.

以上の説明では、色補正の対象となる画像群は、フォルダに格納された画像の集合であったが、このコンピュータ100では、ファイル中の画像群に対しても色補正処理を施すことができる。この場合は、ユーザは、画像群指定欄401にファイル名を書き込みことでファイルの指定を行うことができる。さらに、ユーザは、マウス140のクリックにより、全ページラジオボタン403をクリックすることで、指定したファイル中の全ての画像群を、処理対象となる画像群とすることもできる。また、処理対象となる画像群を有するページをページ欄405に記入することにより、画像群の指定を行うこともできる。このようにページの指定が行われるときには、自動的にページ指定ラジオボタン404に黒い印が記入される。   In the above description, the image group to be subjected to color correction is a set of images stored in the folder. However, in this computer 100, color correction processing can also be performed on the image group in the file. . In this case, the user can designate a file by writing the file name in the image group designation field 401. Furthermore, the user can also click all page radio buttons 403 by clicking the mouse 140 to set all image groups in the specified file as image groups to be processed. In addition, an image group can be specified by entering a page having an image group to be processed in the page column 405. When a page is designated in this way, a black mark is automatically entered in the page designation radio button 404.

図10は、処理対象となる画像群として、ファイル中の全ての画像群が指定された際の色補正ウィンドウを表した図である。   FIG. 10 is a diagram showing a color correction window when all image groups in a file are designated as image groups to be processed.

この図では、画像群指定欄401において、Cドライブのフォルダ「img」内に存在するファイル「org.pdf」が指定されている様子が示されている。ここで、このファイル「org.pdf」は、複数のページを有するPDFファイルであり、各ページには、それぞれ複数の人物の画像が並んだ画像群が存在する。この図では、全ページラジオボタン403が選択されており(黒い印が入っており)、色補正ファイル「org.pdf」中の全ての画像群が色補正の対象として指定されていることが示されている。この状態で、画像表示ボタン402を図2のマウス140でクリックすると、ファイル「org.pdf」中の全ての画像群が、図9のパート(b)と同様に表示される。そして、ユーザは、上述したのと同様にして、表示された画像群に対して色補正を施すことができる。   This figure shows a state where the file “org.pdf” existing in the folder “img” of the C drive is designated in the image group designation column 401. Here, the file “org.pdf” is a PDF file having a plurality of pages, and each page includes an image group in which images of a plurality of persons are arranged. In this figure, the all page radio button 403 is selected (a black mark is entered), and all the image groups in the color correction file “org.pdf” are designated as color correction targets. Has been. When the image display button 402 is clicked with the mouse 140 in FIG. 2 in this state, all image groups in the file “org.pdf” are displayed in the same manner as in part (b) of FIG. Then, the user can perform color correction on the displayed image group in the same manner as described above.

図11は、処理対象となる画像群として、ファイルの2ページ目に存在する画像群が指定された際の色補正ウィンドウを表した図である。   FIG. 11 is a diagram showing a color correction window when an image group existing on the second page of a file is designated as an image group to be processed.

この図では、ページ指定ラジオボタン404が選択されており(黒い印が入っており)、ファイルの2ページ目を表す「2」がページ欄405に記入されている。この指定により、ユーザは、ファイルの2ページ目に存在する画像群を色補正対象の画像群に指定することができる。このページ指定の際には、ユーザは、直接ページ欄405に数字を記入してもよいし、あるいは、次ページボタン406をクリックすることにより、ページを目的のページまで1ページずつ増やしていってもよい。また、前ページボタン407をクリックすることにより、前のページまで戻ることもできる。全ページ指定の場合と同様にページ指定が行われた場合も、画像表示ボタン402を図2のマウス140のクリックによりそのページ中の画像群が、図9のパート(b)と同様に表示される。ユーザは、画像が表示された状態でも、ページを変えて画像表示ボタン402をクリックすることで、表示された画像群を切り替えることができ、色補正したい画像群を選択することができる。そして、補正ボタン408をクリックすることにより、指定されたページの画像群に対して色補正処理が行われる。   In this figure, the page designation radio button 404 is selected (a black mark is entered), and “2” representing the second page of the file is entered in the page column 405. By this designation, the user can designate the image group existing on the second page of the file as the color correction target image group. When this page is designated, the user may directly enter a number in the page field 405, or by clicking the next page button 406, the page is increased by one page to the target page. Also good. By clicking the previous page button 407, it is possible to return to the previous page. When page designation is performed as in the case of all page designation, the image display button 402 is clicked with the mouse 140 in FIG. 2, and the image group in the page is displayed in the same manner as part (b) in FIG. The Even when the image is displayed, the user can switch the displayed image group by changing the page and clicking the image display button 402, and can select the image group for which color correction is desired. Then, by clicking the correction button 408, color correction processing is performed on the specified page image group.

以上の説明してきた色補正では、ユーザは画像群を指定して補正ボタン408をクリックするだけで、指定された画像群を構成する全画像に対して色補正が行われる。ほとんどの場合は、このような全画像の色補正によって、画像それぞれについて、顔領域の色が最適なものとなり、しかも背景色が全画像について統一的となるように色補正が行われる。しかし、稀に、顔領域を誤って検出してしまった結果、ユーザが意図したようには色補正が行われない画像や、顔が検出できずに色補正が行われない画像が現れることがある。このコンピュータ100では、このような画像のために、ユーザが手動で顔領域や背景色算出領域の指定を行うことができる機能が備えられている。以下、この機能について説明する。以下では、今まで説明してきた、画像群全体に対する色補正のことを、後述の個別の画像の色補正と区別するために全画像色補正と呼ぶ。   In the color correction described above, the user simply specifies the image group and clicks the correction button 408, and color correction is performed on all the images constituting the specified image group. In most cases, the color correction is performed so that the color of the face region is optimized for each image and the background color is uniform for all images by color correction of all the images. However, rarely, as a result of erroneously detecting a face area, an image that is not subjected to color correction as intended by the user, or an image that cannot be detected and that is not subjected to color correction may appear. is there. The computer 100 has a function that allows the user to manually specify a face area and a background color calculation area for such an image. Hereinafter, this function will be described. Hereinafter, the color correction for the entire image group, which has been described so far, is referred to as “all image color correction” in order to distinguish it from the color correction of individual images described later.

まず、顔領域を誤って検出してしまった結果、ユーザが意図したようには顔の色の補正が行われなかった場合について説明する。以下では、ユーザが、図9のパート(b)において全画像色補正が行われて表示された画像群のうち、左上の画像501の顔の色補正が充分でないことを発見した場合を例として説明する。   First, a case will be described in which the face color is not corrected as intended by the user as a result of erroneously detecting the face area. In the following, as an example, the user finds that the color correction of the face of the upper left image 501 is not sufficient from the image group displayed by performing all image color correction in part (b) of FIG. explain.

左上の画像501の顔の色補正が充分でないことを発見したユーザは、図2のマウス140で、この画像501の傍に設けられた領域情報ラジオボタン501aがクリックされることで、領域指定モードに入ることができる。   The user who has found that the face color correction of the image 501 in the upper left is not sufficient, clicks the area information radio button 501a provided near the image 501 with the mouse 140 in FIG. Can enter.

図12は、領域指定モードに入った時の画像の様子を表した図である。
領域指定モードに入った画像501中には、全画像色補正の際に検出された、矩形(正方形)の顔領域501bと、顔領域501bの両側に位置する矩形の背景色算出領域501cとがデフォルトとして表示される。このとき、ユーザがこれら2種類の領域を識別しやすいように、これら2種類の矩形の枠は、色を変えて表示される。図では、顔領域501bと背景色算出領域501cとでは枠の色が異なることを示すために、顔領域501bの枠は点線で表されており、背景色算出領域501cの枠は実線で表示されている。ユーザは、図2のマウス140で、顔領域501bや背景色算出領域501cの位置と大きさを変えることができる。適切な位置および大きさの顔領域501bや背景色算出領域501cが指定された後、ユーザにより、図9のパート(b)に示す再補正ボタン409がクリックされることで、手動による領域指定が行われた画像に対してのみ再度の色補正が行われる。この再度の補正では、図6のステップS3における顔領域の検出や、ステップS5における背景色算出領域を求めて背景色を算出することは省略されて、手動指定された顔領域501bや背景色算出領域501cが代わりに用いられる。また、目標色算出色については、再度目標色算出色を算出し直すことなく、最初の全画像色補正の時の目標背景色に合わせるように背景の色補正が行われる。このように、手動による領域指定が行われた画像に対してのみ再度の色補正が行われるようにするのは、全画像色補正に失敗した数少ない画像のために画像群全体の色補正を行うのは処理効率が悪いためである。特に画像数が大きくなると、上記のように、全画像色補正に失敗した画像のみを補正する方が、画像群全体の色補正を行うのに比べ、より効率的となる。
FIG. 12 is a diagram showing a state of an image when the region designation mode is entered.
In the image 501 that has entered the area designation mode, a rectangular (square) face area 501b and a rectangular background color calculation area 501c located on both sides of the face area 501b, which are detected at the time of all image color correction, are included. Displayed as default. At this time, these two types of rectangular frames are displayed in different colors so that the user can easily identify these two types of regions. In the drawing, in order to show that the frame color is different between the face area 501b and the background color calculation area 501c, the frame of the face area 501b is represented by a dotted line, and the frame of the background color calculation area 501c is displayed by a solid line. ing. The user can change the position and size of the face area 501b and the background color calculation area 501c with the mouse 140 of FIG. After the face area 501b and the background color calculation area 501c having appropriate positions and sizes are designated, the user clicks on the recorrection button 409 shown in part (b) of FIG. The color correction is performed again only on the performed image. In this re-correction, detection of the face area in step S3 in FIG. 6 and calculation of the background color by obtaining the background color calculation area in step S5 are omitted, and the manually specified face area 501b and background color calculation are omitted. Region 501c is used instead. For the target color calculation color, the background color correction is performed so as to match the target background color at the time of the first all image color correction without calculating the target color calculation color again. As described above, the color correction is performed again only on the image for which the manual area designation has been performed, because the color correction of the entire image group is performed for the few images that have failed the overall image color correction. This is because the processing efficiency is poor. In particular, when the number of images increases, as described above, it is more efficient to correct only the images that have failed to be corrected for the entire image as compared to performing color correction for the entire image group.

次に、全画像色補正の際に顔が検出ができなかった場合について説明する。以下では、図9のパート(b)において、全画像色補正の際に、左上の画像501の顔検出が失敗した場合を例として説明する。   Next, a case where a face cannot be detected during the entire image color correction will be described. In the following, in the part (b) of FIG. 9, a case where face detection of the upper left image 501 has failed during all image color correction will be described as an example.

図13は、全画像色補正の際に、画像群中の一部の画像において、顔検出が失敗したときの色補正ウィンドウを表した図である。   FIG. 13 is a diagram showing a color correction window when face detection has failed in some images in the image group during the color correction of all images.

全画像色補正の際に顔検出が失敗した画像は、画像の周囲が赤い枠で囲われて表示される。図では、その赤い枠を表す、斜線の枠によって、顔検出が失敗した左上の画像501の周囲が囲まれている様子が示されている。また、顔検出が失敗したことをユーザに伝えるため、左上の画像501の上に図示されているように、「WARNING:赤枠の画像は顔検出できません」という警告メッセージも表示される。この顔検出が失敗した左上の画像501を除いた残りの画像については、これら残りの画像からなる画像群を色補正対象の画像群として、上述した全画像色補正が行われている。しかし、顔検出が失敗した左上の画像501については、顔検出の失敗により色補正が行われていない状態となっている。ユーザは、赤枠と警告メッセージの表示によって、左上の画像501について再度の色補正を行うことが必要であることを認識することになる。ここで、ユーザは、上述した顔領域の指定と同様にして、図2のマウス140で、この画像501の傍に設けられた領域情報ラジオボタン501aをクリックすることで、領域指定モードに入ることができる。   An image for which face detection has failed during color correction for all images is displayed with a red frame surrounding the image. In the figure, a state in which the periphery of the upper left image 501 in which face detection has failed is surrounded by a hatched frame representing the red frame. In order to notify the user that face detection has failed, a warning message “WARNING: face cannot be detected in red frame image” is displayed as shown in the upper left image 501. For the remaining images excluding the upper left image 501 for which face detection has failed, the above-described all-image color correction is performed using the image group including these remaining images as the image correction target image group. However, the upper left image 501 in which face detection has failed is in a state where color correction has not been performed due to face detection failure. The user recognizes that it is necessary to perform color correction again on the upper left image 501 by displaying the red frame and the warning message. Here, the user enters the area designation mode by clicking the area information radio button 501a provided near the image 501 with the mouse 140 of FIG. Can do.

図14は、顔検出が失敗した画像について領域指定モードに入った時の様子を表した図である。   FIG. 14 is a diagram illustrating a state when an area designation mode is entered for an image for which face detection has failed.

全画像色補正では、顔検出に失敗すると、顔領域および背景色算出領域の特定がなされないため、顔検出に失敗した画像について領域指定モードに入っても、その直後の状態では、図14のパート(a)に示すように、顔領域および背景色算出領域をそれぞれ表した矩形の領域はデフォルトとしては表示されない。この状態において、ユーザは、図2のマウス140を用いて、顔領域の指定を行うことができる。図14のパート(b)には、ユーザによって、顔領域の指定を行われた時の状態が示されている。この図に示すように、顔領域501b’の指定が行われると図14のパート(a)に示す赤枠が消え、一方、指定された顔領域に応じて背景色算出領域501c’が、図7において説明した位置関係で自動的に表示される。一旦背景色算出領域501c’が表示されると、ユーザは自分の好みで背景色算出領域501c’の位置や大きさを図2のマウス140で変更することができる。このようにして、最終的に、適切な位置および大きさの顔領域501b’や背景色算出領域501c’が指定されると、ユーザにより、図13に示す再補正ボタン409がクリックされることで、上述したのと同様に、手動による領域指定が行われた画像に対してのみ再度の色補正が行われる。   If the face detection fails in all image color correction, the face area and the background color calculation area are not specified. Therefore, even if the image for which face detection has failed is entered in the area designation mode, As shown in part (a), rectangular areas representing the face area and the background color calculation area are not displayed by default. In this state, the user can specify a face area using the mouse 140 of FIG. Part (b) of FIG. 14 shows a state when a user designates a face area. As shown in this figure, when the face area 501b ′ is designated, the red frame shown in part (a) of FIG. 14 disappears, while the background color calculation area 501c ′ is changed according to the designated face area. 7 is automatically displayed in the positional relationship described in FIG. Once the background color calculation area 501c 'is displayed, the user can change the position and size of the background color calculation area 501c' with his / her preference using the mouse 140 in FIG. Thus, when the face area 501b ′ and the background color calculation area 501c ′ having appropriate positions and sizes are finally designated, the user clicks on the recorrection button 409 shown in FIG. Similarly to the above, color correction is performed again only for an image for which manual region designation has been performed.

以上説明したように、顔領域の手動指定モードを設けることで、顔領域を誤って検出した場合や顔検出ができなかった場合であっても、再補正により適切な色補正が行われることになる。   As described above, by providing the manual designation mode for the face area, it is possible to perform appropriate color correction by re-correction even when the face area is erroneously detected or when face detection cannot be performed. Become.

このように、手動で顔領域や背景色算出領域の領域指定を行うための機能に加え、図2のコンピュータ100には、色補正がうまくいった画像に色を合わせるように、他の画像の色補正を行う手動色補正の機能も備えられている。以下では、この手動色補正の機能について説明する。   In this manner, in addition to the function for manually specifying the area of the face area and the background color calculation area, the computer 100 in FIG. A manual color correction function for performing color correction is also provided. Hereinafter, the manual color correction function will be described.

ユーザは、全画像色補正が行われた画像群のうち、一部の画像の色が他の画像と比べて違和感があると感じた場合には、図9のパート(b)に示す色補正ウィンドウ400内にある手動補正モードボタン410をクリックすることで、手動補正モードに入ることができる。以下では、図9のパート(b)において、ユーザが全画像色補正後の画像の色の具合を吟味した結果、下の段の真中の画像505の背景の色に合わせて、上の段の真中の画像502の背景の色と、下の段の右側の画像506の背景の色とを補正することが決定された場合を例として説明する。このように背景色がユーザの意図したように統一的にならなかった場合としては、例えば、1枚の画像中でも背景の色が一様でなかった場合などが考えられる。   When the user feels that the color of some of the images in the image group subjected to the entire image color correction is uncomfortable as compared with the other images, the color correction shown in part (b) of FIG. 9 is performed. By clicking the manual correction mode button 410 in the window 400, the manual correction mode can be entered. In the following, in part (b) of FIG. 9, as a result of the user examining the color condition of the image after all image color correction, the upper row is matched with the background color of the middle image 505 in the lower row. A case where it is determined to correct the background color of the middle image 502 and the background color of the lower right image 506 will be described as an example. As a case where the background color is not unified as intended by the user in this way, for example, a case where the background color is not uniform in one image can be considered.

図15は、図9のパート(b)に示す手動補正モードボタンがクリックされた時の色補正ウィンドウ400の様子を表した図である。   FIG. 15 is a diagram illustrating a state of the color correction window 400 when the manual correction mode button illustrated in part (b) of FIG. 9 is clicked.

手動色補正を行うにあたり、まず最初に、ユーザは、図2のマウス140で、色補正の目標となる背景色を有する画素Pを、下の段の真中の画像505中で選んでクリックする。次に、ユーザは、背景の色補正の対象となる、下の段の右側の画像506と上の段の真中の画像502とにおいて、上記の画素Pと色を合わせたい画素Q,画素Rを図2のマウス140でクリックする。このような操作によって、最初にクリックされた画素の画素値が色補正の目標画素値として指定され、その後にクリックされた画素の画素値は、その画素値を目標画素値に一致させるような色補正の補正量算出のために用いられる。色補正を実行するにあたっては、ユーザは、色補正の対象となる画像中の全ての画素に対して、算出された補正量で一律に色補正が行われる第1の色補正と、補正量算出のためにクリックされた画素の画素値に近い画素値の画素だけが、目標画素値との画素値の差に応じた補正量で色補正される第2の色補正との2種類の色補正のうちの一方を選択することができる。   In performing manual color correction, first, the user selects and clicks the pixel P having a background color as a color correction target in the middle image 505 in the lower row with the mouse 140 of FIG. Next, the user selects the pixel Q and the pixel R whose colors are to be matched with those of the pixel P in the lower right image 506 and the upper middle image 502, which are subject to background color correction. Click with the mouse 140 in FIG. By such an operation, the pixel value of the pixel clicked first is designated as the target pixel value for color correction, and the pixel value of the pixel clicked after that is a color that matches the pixel value with the target pixel value. Used to calculate the correction amount. In executing the color correction, the user performs the first color correction in which the color correction is uniformly performed with the calculated correction amount for all the pixels in the image to be subjected to the color correction, and the correction amount calculation. Two types of color correction, ie, a second color correction in which only a pixel having a pixel value close to the pixel value of the pixel clicked for is corrected by a correction amount corresponding to the difference in pixel value from the target pixel value One of these can be selected.

2種類の色補正のうち、第1の色補正は、図6のステップS4において仮補正画像を作成するのに用いられた色補正や、図6のステップS10において背景統一画像を作成するのに用いられた色補正と同じである。この第1の色補正は、図15中の「画素値をそろえる」と表示されている全体補正ボタン411がクリックされることで実行される。この全体補正ボタン411がクリックされると、下の段の右側の画像506は、この画像中の画素Qの画素値が目標画素値(すなわち下の段の真中の画像505中の背景の画素Pの画素値)となるような補正量で、画像全体が一律に色補正される。同時に、上の段の真中の画像502は、この画像中の画素Rの画素値が目標画素値となるような補正量で、画像全体が一律に色補正される。この第1の色補正には、画像全体が、バランスよく補正されるという利点があり、色のバランスに重点を置くユーザが選択する色補正である。   Of the two types of color correction, the first color correction is used for the color correction used to create the provisionally corrected image in step S4 in FIG. 6 and the background unified image in step S10 in FIG. Same as the color correction used. The first color correction is executed by clicking the overall correction button 411 displayed as “Align pixel values” in FIG. When the overall correction button 411 is clicked, the image 506 on the right side of the lower row indicates that the pixel value of the pixel Q in this image is the target pixel value (that is, the background pixel P in the middle image 505 in the lower row). The entire image is uniformly color-corrected with a correction amount such that the pixel value of At the same time, the image 502 in the middle of the upper stage is uniformly color-corrected with the correction amount so that the pixel value of the pixel R in the image becomes the target pixel value. This first color correction has an advantage that the entire image is corrected in a well-balanced manner, and is a color correction selected by a user who places emphasis on color balance.

2種類の色補正のうち、第2の色補正は、図15中の「近似色の画素値をそろえる」と表示されている局部補正ボタン412がクリックされることで実行される。この局部補正ボタン412がクリックされると、下の段の右側の画像506は、この画像中の画素Qの画素値に近い画素値を有する画素だけが、目標画素値との画素値の差に応じた補正量で色補正され、同時に、上の段の真中の画像502は、この画像中の画素Rの画素値に近い画素値を有する画素だけが、目標画素値との画素値の差に応じた補正量で色補正される。以下では、この第2の色補正の詳細について説明する。ここでは、下の段の右側の画像506についての補正を例にとって説明する。   Of the two types of color correction, the second color correction is executed by clicking a local correction button 412 displayed as “Align pixel values of approximate colors” in FIG. When this local correction button 412 is clicked, only the pixel having a pixel value close to the pixel value of the pixel Q in the image 506 on the right side of the lower stage is the difference in pixel value from the target pixel value. At the same time, only the pixel having a pixel value close to the pixel value of the pixel R in this image is the difference between the pixel value and the target pixel value. Color correction is performed with a corresponding correction amount. Details of the second color correction will be described below. Here, a description will be given taking correction of the right image 506 in the lower row as an example.

第2の色補正が選択される前の段階では、目標画素値(下の段の真中の画像505中の背景の画素Pの画素値)および下の段の右側の画像506中の各画素値は、画像データ中の数値としては、RGB色空間での座標値として表現されているが、この第2の色補正が行われる際には、これらRGB色空間で表現された画素値は、一旦HSL色空間(色相H、彩度S,明度Lの3自由度で記述される色空間)で表現された画素値に変換される。この第2の色補正では、色相、彩度,明度のそれぞれについて同じやり方で補正が行われるので、以下では、明度の補正を例にとって説明する。目標画素値の明度をLpとし、下の段の右側の画像506中の画素Qの明度をLqとすると、第2の色補正では、まず、目標画素値の明度Lpと画素Qの明度Lqとから、明度差の差ΔLq=Lp−Lqが取得される。次に、画像506中の画素のうち、下記の条件を満たす明度Lを有する画素が検出される。
|L−Lq|≦Δq
ここで、Δqは、あらかじめ、図2のコンピュータ100内に記憶されている所定値である。この検出により、画素Qの明度Lqに近い明度を有する画素だけが補正対象としてピックアップされることになる。そして、検出された画素の明度Lは、下記の式で決定される新たな明度L’に置き換えられる。
L’=L + ΔLq×f(|L−Lq|)
ここで、f(|L−Lq|)は、明度の差の絶対値|L−Lq|を引数とする所定の単調減少関数であり、この関数の値は、|L−Lq|がゼロとなるときに1となり、|L−Lq|がΔqとなるときに0となる。上記の補正の式は、画素Qの明度Lqに近い明度の画素ほど大きい補正を受けることを表しており、明度が、画素Qの明度Lqと等しい画素
では、最大の補正量であるLqで補正されることとなる。こうした所定の単調減少関数は、上記の性質を有する滑らかな単調減少関数であれば採用可能であり、例えば、下記のような関数が採用され得る。
f(x)=(Δq―x)1/2×(1/Δq)1/2
以上の明度の補正と同様の補正が、残りの色相、彩度についても実行される。補正が行われた、画像506中の各画素値は、RGB色空間での座標値に変換される。そして、その変換された画素値で構成された画像データに基づいて、色補正された画像506の表示が行われる。
Before the second color correction is selected, the target pixel value (the pixel value of the background pixel P in the middle image 505 in the lower row) and each pixel value in the right image 506 in the lower row Are expressed as coordinate values in the RGB color space as numerical values in the image data, but when the second color correction is performed, the pixel values expressed in the RGB color space are temporarily It is converted into a pixel value expressed in an HSL color space (a color space described with three degrees of freedom of hue H, saturation S, and lightness L). In the second color correction, the hue, saturation, and lightness are corrected in the same manner, and therefore, the lightness correction will be described below as an example. Assuming that the lightness of the target pixel value is Lp and the lightness of the pixel Q in the lower right image 506 is Lq, in the second color correction, first, the lightness Lp of the target pixel value and the lightness Lq of the pixel Q From this, the difference ΔLq = Lp−Lq of the brightness difference is acquired. Next, among the pixels in the image 506, a pixel having the lightness L that satisfies the following condition is detected.
| L−Lq | ≦ Δq
Here, Δq is a predetermined value stored in advance in the computer 100 of FIG. By this detection, only pixels having a brightness close to the brightness Lq of the pixel Q are picked up as correction targets. Then, the detected lightness L of the pixel is replaced with a new lightness L ′ determined by the following equation.
L ′ = L + ΔLq × f (| L−Lq |)
Here, f (| L−Lq |) is a predetermined monotonically decreasing function with the absolute value | L−Lq | of the brightness difference as an argument, and the value of this function is such that | L−Lq | Becomes 1, and when | L−Lq | becomes Δq, it becomes 0. The above correction expression indicates that a pixel having a lightness close to the lightness Lq of the pixel Q is subjected to a larger correction, and in a pixel having a lightness equal to the lightness Lq of the pixel Q, correction is performed with Lq which is the maximum correction amount. Will be. Such a predetermined monotone decreasing function can be adopted as long as it is a smooth monotonic decreasing function having the above-described properties. For example, the following functions can be adopted.
f (x) = (Δq−x) 1/2 × (1 / Δq) 1/2
The same correction as the brightness correction described above is executed for the remaining hue and saturation. The corrected pixel values in the image 506 are converted into coordinate values in the RGB color space. Based on the image data composed of the converted pixel values, the color-corrected image 506 is displayed.

上の段の真中の画像502についても、上記の図15の下の段の右側の画像506の色補正と同様にして、第2の色補正が実行され、補正された画像が表示される。以上の第2の色補正は、ユーザが、特定の色(上述の例では背景の色)にのみ補正を施したい時にとりわけ役に立つ補正である。   For the middle image 502 in the upper row, the second color correction is executed in the same manner as the color correction of the right image 506 in the lower row in FIG. 15, and the corrected image is displayed. The second color correction described above is particularly useful when the user wants to correct only a specific color (background color in the above example).

以上説明してきたように、図2のコンピュータ100では、第1の色補正と第2の色補正との2種類の手動による色補正手段を備えており、これらの色補正手段を備えることで、図6で説明した全画像色補正の結果を、ユーザの好みに合うように修正することができる。   As described above, the computer 100 in FIG. 2 includes two types of manual color correction means, that is, the first color correction and the second color correction. By including these color correction means, The result of all image color correction described with reference to FIG. 6 can be modified to suit the user's preference.

なお、以上説明してきた、手動による色補正では、画像群のうちの画像の1つが目標となる色を与えるものであったが、このような色補正の方式以外にも、予め用意されていた複数種類の色の中から目標色をユーザに選択させた上で、選択された色を目標色として色補正を行う方式も採用可能である。   In the manual color correction described above, one of the images in the image group gives the target color. However, other than such a color correction method, it has been prepared in advance. It is also possible to employ a method in which the user selects a target color from among a plurality of types of colors and performs color correction using the selected color as the target color.

本発明の一実施形態が適用された画像処理システムの全体構成図である。1 is an overall configuration diagram of an image processing system to which an embodiment of the present invention is applied. 本発明の色補正装置の一実施形態として動作するパーソナルコンピュータの外観斜視図である。1 is an external perspective view of a personal computer that operates as an embodiment of a color correction apparatus of the present invention. 図2に外観斜視図を示したパーソナルコンピュータのハードウェア構成図である。FIG. 3 is a hardware configuration diagram of the personal computer whose external perspective view is shown in FIG. 2. 本発明の色補正プログラムの一実施形態を示す図である。It is a figure which shows one Embodiment of the color correction program of this invention. 図2および図3に示すパーソナルコンピュータを本発明の色補正装置の一実施形態として動作させるためにこのパーソナルコンピュータ上に構築される要素と、それらの要素による作用の概略を表す図である。It is a figure showing the outline of the effect | action by those elements constructed | assembled on this personal computer in order to operate the personal computer shown in FIG. 2 and FIG. 3 as one Embodiment of the color correction apparatus of this invention. 図2および図3に示すパーソナルコンピュータによる色補正処理の動作を表すフローチャート図である。FIG. 4 is a flowchart showing an operation of color correction processing by the personal computer shown in FIGS. 2 and 3. 背景色の算出が行われる領域を表した図である。It is a figure showing the area | region where calculation of a background color is performed. 合成マスクが作成される様子を模式的に表した図である。It is the figure which represented a mode that the synthetic | combination mask was created. 色補正が行われる際のウィンドウを表した図である。It is a figure showing the window at the time of color correction being performed. 処理対象となる画像群として、ファイル中の全ての画像群が指定された際の色補正ウィンドウを表した図である。It is a figure showing the color correction window when all the image groups in a file are designated as an image group used as a candidate for processing. 処理対象となる画像群として、ファイルの2ページ目に存在する画像群が指定された際の色補正ウィンドウを表した図である。It is a figure showing the color correction window when the image group which exists in the 2nd page of a file is designated as an image group used as a process target. 領域指定モードに入った時の画像の様子を表した図である。It is a figure showing the mode of the image when it entered into area | region designation | designated mode. 全画像色補正の際に、画像群中の一部の画像において、顔検出が失敗したときの色補正ウィンドウを表した図である。FIG. 10 is a diagram illustrating a color correction window when face detection fails in some images in an image group during full image color correction. 顔検出が失敗した画像について領域指定モードに入った時の様子を表した図である。It is a figure showing a mode when it enters into area specification mode about an image in which face detection failed. 図9のパート(b)に示す手動補正モードボタンがクリックされた時の色補正ウィンドウ400の様子を表した図である。FIG. 10 is a diagram illustrating a state of a color correction window 400 when a manual correction mode button illustrated in part (b) of FIG. 9 is clicked.

符号の説明Explanation of symbols

10 画像データ取得部
11 顔検出部
12 仮補正部
13 目標背景色算出部
14 背景統一画像作成部
15 画像合成部
20 画像データ取得部
21 顔検出部
22 仮補正部
23 目標背景色算出部
24 背景統一画像作成部
25 画像合成部
70b,501b,501b’ 顔領域
70c,501c,501c’ 背景色算出領域
100 パーソナルコンピュータ
110 本体部
111 FD装填口
112 CD−ROM装填口
120 画像表示装置
121 表示画面
130 キーボード
140 マウス
1200 バス
210,210A,210B 画像群
211 CPU
212 主メモリ
213 ハードディスク装置
214 FDドライブ
2140 FD
215 CD−ROMドライブ
2150 CD−ROM
216 I/Oインタフェース
217 出力インタフェース
301 顔部分
302 背景部分
303 服部分
400 色補正ウィンドウ
401 画像群指定欄
402 画像表示ボタン
403 全ページラジオボタン
404 ページ指定ラジオボタン
405 ページ欄
406 次ページボタン
407 前ページボタン
408 補正ボタン
409 再補正ボタン
410 手動モードボタン
501,502,503,504,505,506 画像
501a,502a,503a,504a,505a,506a 領域情報ラジオボタン
2170 カラープリンタ
DESCRIPTION OF SYMBOLS 10 Image data acquisition part 11 Face detection part 12 Temporary correction part 13 Target background color calculation part 14 Background unified image creation part 15 Image composition part 20 Image data acquisition part 21 Face detection part 22 Temporary correction part 23 Target background color calculation part 24 Background Unified image creation unit 25 Image composition unit 70b, 501b, 501b 'Face region 70c, 501c, 501c' Background color calculation region 100 Personal computer 110 Main unit 111 FD loading port 112 CD-ROM loading port 120 Image display device 121 Display screen 130 Keyboard 140 Mouse 1200 Bus 210, 210A, 210B Image group 211 CPU
212 Main memory 213 Hard disk device 214 FD drive 2140 FD
215 CD-ROM drive 2150 CD-ROM
216 I / O interface 217 Output interface 301 Face portion 302 Background portion 303 Clothing portion 400 Color correction window 401 Image group designation column 402 Image display button 403 All page radio button 404 Page designation radio button 405 Page column 406 Next page button 407 Previous page Button 408 Correction button 409 Re-correction button 410 Manual mode buttons 501, 502, 503, 504, 505, 506 Image 501a, 502a, 503a, 504a, 505a, 506a Area information radio button 2170 Color printer

Claims (5)

各々に人物が写っている複数の画像それぞれについて人物の顔領域を検出する顔領域検出部と、
前記複数の画像それぞれについて、前記顔領域検出部によって検出された顔領域が所定の望ましい色となるような、各画像に応じた色補正を施す顔色補正部と、
前記顔領域検出部によって検出された顔領域あるいは画像の全域に対し所定の位置関係に存在する背景領域を前記複数の画像それぞれについて求め、背景領域の色が該複数の画像間で統一されるような色補正を各画像に施す背景色統一部と、
画像中の各点が背景と顔とのどちらにどの程度帰属するかを表したマスクを、各点と前記背景領域との色の近さおよび各点と前記顔領域との位置の近さに基づいて、前記複数の画像それぞれについて作成するマスク作成部と、
前記マスク作成部によって作成されたマスクを用いて、前記顔色補正部で補正されて得られた第1の補正画像と前記背景色統一部で補正されて得られた第2の補正画像とを、顔に強く帰属する点は第1の補正画像の成分が強く、背景に強く帰属する点は第2の補正画像の成分が強くなるように合成する合成部とを備えたことを特徴とする色補正装置。
A face region detector for detecting a face area of a person for each of the plurality of images that is reflected a person in each
For each of the plurality of images, the face-color correction unit that performs the like facial area detected by the face area detection unit becomes a predetermined desired color, the color correction according to each image,
To the entire area of the detected face area or the image by the face region detector, a background region present in a given positional relationship determined for each of the plurality of images, the color of the background region is uniform between the plurality of image A background color unification unit that applies color correction to each image,
A mask that indicates how much each point in the image belongs to the background or the face is determined based on the closeness of the color between each point and the background region and the closeness between the position of each point and the face region. Based on each of the plurality of images, a mask creation unit,
Using the mask created by the mask creation unit, a first correction image obtained by correction by the face color correction unit and a second correction image obtained by correction by the background color unification unit, A color characterized in that a point strongly belonging to the face has a first correction image component, and a point strongly belonging to the background has a composition unit for synthesizing the second correction image component to be strong. Correction device.
前記背景色統一部が、前記顔色補正部で補正されて得られた第1の補正画像上の背景領域に基づいて、前記複数の画像間で統一されるべき統一背景色を求め、該複数の画像のそれぞれに対して、背景領域の色が該統一背景色となるような色補正を施すものであることを特徴とする請求項1記載の色補正装置。   The background color unification unit obtains a unified background color to be unified among the plurality of images based on the background region on the first corrected image obtained by the correction by the face color correction unit, and 2. The color correction apparatus according to claim 1, wherein color correction is performed on each of the images so that the color of the background region becomes the unified background color. 前記マスク作成部は、各点と前記背景領域との色の近さとして、背景領域の色と各点の色との所定の色空間上における距離を用いるものであることを特徴とする請求項1記載の色補正装置。   The mask creation unit uses a distance in a predetermined color space between the color of the background region and the color of each point as the color closeness between each point and the background region. The color correction apparatus according to 1. 前記マスク作成部は、各点と前記顔領域との位置の近さとして、該顔領域の中心点と各点との画像上の距離を用いるものであることを特徴とする請求項1記載の色補正装置。   The mask generation unit uses a distance on the image between the center point of each face region and each point as the proximity of the position between each point and the face region. Color correction device. コンピュータシステムに組み込まれ、そのコンピュータシステム上に、
各々に人物が写っている複数の画像それぞれについて人物の顔領域を検出する顔領域検出部と、
前記複数の画像それぞれについて、前記顔領域検出部によって検出された顔領域が所定の望ましい色となるような、各画像に応じた色補正を施す顔色補正部と、
前記顔領域検出部によって検出された顔領域あるいは画像の全域に対し所定の位置関係に存在する背景領域を前記複数の画像それぞれについて求め、背景領域の色が該複数の画像間で統一されるような色補正を各画像に施す背景色統一部と、
画像中の各点が背景と顔とのどちらにどの程度帰属するかを表したマスクを、各点と前記背景領域との色の近さおよび各点と前記顔領域との位置の近さに基づいて、前記複数の画像それぞれについて作成するマスク作成部と、
前記マスク作成部によって作成されたマスクを用いて、前記顔色補正部で補正されて得られた第1の補正画像と前記背景色統一部で補正されて得られた第2の補正画像とを、顔に強く帰属する点は第1の補正画像の成分が強く、背景に強く帰属する点は第2の補正画像の成分が強くなるように合成する合成部とを構築することを特徴とする色補正プログラム。
Built into a computer system, on that computer system,
A face region detector for detecting a face area of a person for each of the plurality of images that is reflected a person in each
For each of the plurality of images, the face-color correction unit that performs the like facial area detected by the face area detection unit becomes a predetermined desired color, the color correction according to each image,
To the entire area of the detected face area or the image by the face region detector, a background region present in a given positional relationship determined for each of the plurality of images, the color of the background region is uniform between the plurality of image A background color unification unit that applies color correction to each image,
A mask that indicates how much each point in the image belongs to the background or the face is determined based on the closeness of the color between each point and the background region and the closeness between the position of each point and the face region. Based on each of the plurality of images, a mask creation unit,
Using the mask created by the mask creation unit, a first correction image obtained by correction by the face color correction unit and a second correction image obtained by correction by the background color unification unit, A color is characterized in that a point that strongly belongs to the face has a strong component of the first corrected image, and a point that strongly belongs to the background has a composition unit that combines so that the component of the second corrected image becomes strong Correction program.
JP2006316733A 2006-11-24 2006-11-24 Color correction apparatus and color correction program Active JP4875470B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006316733A JP4875470B2 (en) 2006-11-24 2006-11-24 Color correction apparatus and color correction program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006316733A JP4875470B2 (en) 2006-11-24 2006-11-24 Color correction apparatus and color correction program

Publications (2)

Publication Number Publication Date
JP2008131542A JP2008131542A (en) 2008-06-05
JP4875470B2 true JP4875470B2 (en) 2012-02-15

Family

ID=39556918

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006316733A Active JP4875470B2 (en) 2006-11-24 2006-11-24 Color correction apparatus and color correction program

Country Status (1)

Country Link
JP (1) JP4875470B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4798236B2 (en) 2009-03-06 2011-10-19 カシオ計算機株式会社 Imaging apparatus, image processing method, and program
JP5205358B2 (en) * 2009-10-28 2013-06-05 京セラドキュメントソリューションズ株式会社 Image processing apparatus, image forming apparatus, and image processing method
US9585810B2 (en) 2010-10-14 2017-03-07 Fresenius Medical Care Holdings, Inc. Systems and methods for delivery of peritoneal dialysis (PD) solutions with integrated inter-chamber diffuser
JP2011175663A (en) * 2011-04-22 2011-09-08 Casio Computer Co Ltd Imaging device, image processing method, and program
JP5647209B2 (en) * 2012-11-07 2014-12-24 オリンパスイメージング株式会社 Imaging apparatus and imaging method
JP6288816B2 (en) * 2013-09-20 2018-03-07 カシオ計算機株式会社 Image processing apparatus, image processing method, and program
EP4092403A1 (en) * 2016-06-24 2022-11-23 Beckman Coulter Inc. Image atlas systems and methods
JP2020112730A (en) * 2019-01-15 2020-07-27 キヤノン株式会社 Display device, control method, program, and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3059631B2 (en) * 1994-04-27 2000-07-04 松下電子工業株式会社 Image correction method
JP2001186323A (en) * 1999-12-24 2001-07-06 Fuji Photo Film Co Ltd Identification photograph system and picture on processing method
JP2002135587A (en) * 2000-10-25 2002-05-10 Canon Inc Image processing apparatus and its method
JP2005163803A (en) * 2001-12-28 2005-06-23 Mitsuba Corp Pressure control device
JP2005333519A (en) * 2004-05-21 2005-12-02 Konica Minolta Photo Imaging Inc Print forming system and print forming method
JP4527500B2 (en) * 2004-11-10 2010-08-18 富士フイルム株式会社 Image processing method, apparatus, and program

Also Published As

Publication number Publication date
JP2008131542A (en) 2008-06-05

Similar Documents

Publication Publication Date Title
JP4875470B2 (en) Color correction apparatus and color correction program
US9355486B2 (en) Image compositing device and image compositing method
US20070071319A1 (en) Method, apparatus, and program for dividing images
JP2008234342A (en) Image processor and image processing method
JP2007226655A (en) Image processing method, apparatus and program
US8406519B1 (en) Compositing head regions into target images
JP4821642B2 (en) Image processing method, image processing apparatus, digital camera, and image processing program
JP2007094623A (en) Image correcting method and device, and program
JP2010072934A (en) Album creation device and album creation method
JP2009237977A (en) Image output control device, image output control method, image output control program, and printer
US10262444B2 (en) Image processing apparatus, image processing method, and non-transitory computer-readable storage medium for creating a composite image by using a plurality of input images
JP2006350936A (en) Image forming device and image forming program
JP2007053543A (en) Image processor and image processing method
JP6020124B2 (en) Image processing apparatus, image processing method, and image processing program
US11798227B2 (en) Image processing apparatus and image processing method
JP2017123015A (en) Information processing apparatus, image processing method, and program
US8971636B2 (en) Image creating device, image creating method and recording medium
JP2006350769A (en) Image processing device, method and program
JP2009237627A (en) Image processing method, image processor, image processing program, and printer
JP2009231879A (en) Image processing unit and image processing method
JP2006350462A (en) Album image preparation device and album image preparation program
JP4323910B2 (en) Image composition apparatus and method
JP4148165B2 (en) Image composition to create a composite image by overlaying images
JP2004080100A (en) Method and apparatus for creating color conversion table, method and apparatus for converting colors, and imaging apparatus
JP4515964B2 (en) Image correction apparatus and method, and image correction program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090911

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110328

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110412

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110609

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110809

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111125

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

Free format text: PAYMENT UNTIL: 20141202

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4875470

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250