JP4522229B2 - Image processing method and apparatus - Google Patents

Image processing method and apparatus Download PDF

Info

Publication number
JP4522229B2
JP4522229B2 JP2004319497A JP2004319497A JP4522229B2 JP 4522229 B2 JP4522229 B2 JP 4522229B2 JP 2004319497 A JP2004319497 A JP 2004319497A JP 2004319497 A JP2004319497 A JP 2004319497A JP 4522229 B2 JP4522229 B2 JP 4522229B2
Authority
JP
Japan
Prior art keywords
image
correction
area
color
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2004319497A
Other languages
Japanese (ja)
Other versions
JP2006133873A (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.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2004319497A priority Critical patent/JP4522229B2/en
Publication of JP2006133873A publication Critical patent/JP2006133873A/en
Application granted granted Critical
Publication of JP4522229B2 publication Critical patent/JP4522229B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

本発明は画像処理方法及びその装置に関し、特に、デジタルカメラ、ディスプレイ、スキャナ、プリンタなどのカラー画像機器、及び該カラー画像機器の画像処理ソフトウェアにおけるカラー画像の補正処理に関するものである。   The present invention relates to an image processing method and apparatus, and more particularly, to a color image device such as a digital camera, a display, a scanner, and a printer, and a color image correction process in image processing software of the color image device.

従来より、デジタル画像に対して、彩度、色調、コントラストや階調の調整等の様々な画像処理を施すことが行われてきている。従来これらの画像処理を行うに際しては、画像に関して専門的な知識を持ったオペレータが、専門的または専用のソフトウェアを用いるとともに経験的な知識を駆使することにより、コンピュータのモニタ画面上でその画像処理結果を確認するなどしながらの試行錯誤を行って、好適な画像を得るようにしているというのが一般的であった。   Conventionally, various image processing such as adjustment of saturation, color tone, contrast, and gradation has been performed on digital images. Conventionally, when performing such image processing, an operator who has specialized knowledge about the image uses specialized or dedicated software and makes full use of empirical knowledge so that the image processing can be performed on a computer monitor screen. In general, trial and error are performed while confirming the result to obtain a suitable image.

近年、インターネットの普及に牽引されるようにしてデジタルカメラの普及が進んでいる。これは、デジタルカメラで撮影して得られる結果(データ)が、コンピュータにとって読み取ることが容易なファイル形式のデータであるためである。例えば、デジタルカメラによって撮影した画像をWWW (World Wide Web)のサーバ上に保存して第三者に対して公開する、といったことを容易に行えるからである。このようなデジタルカメラの普及によって、これまで画像とあまり縁のなかったユーザの周囲にもデジタル画像データが増加しているのもまた事実である。   In recent years, the popularity of digital cameras has been increasing, driven by the popularity of the Internet. This is because the result (data) obtained by photographing with a digital camera is data in a file format that can be easily read by a computer. For example, it is possible to easily store an image photographed by a digital camera on a WWW (World Wide Web) server and open it to a third party. With the spread of such digital cameras, it is also true that digital image data has increased around users who have never had much connection with images.

しかし、デジタルカメラのユーザは、旧来のアナログカメラを自在に使いこなすようなカメラに関して知識が十分といえるユーザというよりも、むしろコンピュータの知識には詳しいものの、カメラに関しての知識が十分でないユーザが多いと考えられる。したがって、デジタルカメラで撮影された画像は、必ずしも好適な条件で撮影された画像ばかりであるとは限らない。だからと言って、好適でない条件で撮影された画像であってもその内容が撮影者にとって重要であった場合などには、必ずしも廃棄できるものではない。このため、好適でない条件で撮影された画像であっても、この画像から適切な画像を得ることができる画像補正方式が望まれている。その場合に、先に述べたように、カメラ、あるいは画像について必ずしも精通したユーザばかりではない点や、画像データが増加していくという点から考えると、画像補正方式は自動もしくは半自動によるものが好ましいと言える。   However, users of digital cameras are not users who have sufficient knowledge about cameras that can freely use conventional analog cameras, but rather users who are familiar with computers but do not have enough knowledge about cameras. It is done. Therefore, images taken with a digital camera are not necessarily only images taken under suitable conditions. That said, even if an image was taken under unfavorable conditions, it may not always be discarded if the content is important to the photographer. For this reason, there is a demand for an image correction method that can obtain an appropriate image from this image even if the image is taken under unfavorable conditions. In that case, as described above, the image correction method is preferably automatic or semi-automatic in view of the fact that it is not always the user who is familiar with the camera or the image or that the image data increases. It can be said.

例えば、カラーマッチング技術は、入出力機器の特性の影響を受けないように画像を補正するもので、実物に忠実な色補正が要求される。一方、デジタルカメラで撮影した写真画像を扱う場合、実物に忠実であるよりも人が好ましいと感じるような画像補正も重要である。人物写真の場合に主な注目領域は被写体となった人物の顔であって、その顔領域が適正な明るさ(肌色)となっているものが好ましいことから、適正な明るさで撮影されなかった場合には、良好な明るさ(肌色)に調整されるように補正されるのが好ましいと言える。更には、1枚の画像に男女が写っている場合は、男性に比べて女性を明るくした方が一般に好まれる傾向がある。   For example, the color matching technique corrects an image so as not to be affected by the characteristics of input / output devices, and requires color correction faithful to the actual product. On the other hand, when dealing with a photographic image taken with a digital camera, it is also important to perform image correction so that a person feels better than being true to the real thing. In the case of portraits, the main area of interest is the face of the person who is the subject, and it is preferable that the face area has the appropriate brightness (skin color). In such a case, it can be said that it is preferable that the correction is made so that the brightness (skin color) is adjusted. Furthermore, when men and women are shown in one image, it is generally preferred that a woman be brighter than a man.

上述した明るさ調整に関しては、たとえば、特許文献1にあるように、画像の明るさの分布状況を調べてその明るい側及び暗い側からそれぞれ数パーセントのレベルをハイライトポイント及びシャドウポイント等として設定する。そして、そのハイライトポイントが明るさのほぼ最大値となるように、また、シャドウポイントが明るさのほぼ最小値となるようにレベル伸長を行うという処理や、また画像全体の平均輝度などからγ補正を行っていた。   Regarding the brightness adjustment described above, for example, as disclosed in Patent Document 1, the brightness distribution state of an image is examined, and several percent levels are set as a highlight point and a shadow point, respectively, from the bright side and the dark side. To do. From the process of level expansion so that the highlight point becomes almost the maximum value of the brightness and the shadow point becomes the almost minimum value of the brightness, and the average luminance of the entire image, etc. Correction was performed.

また、別の公知例として特許文献2は、証明用写真のようなポーズや光源が限定された撮影条件において、自動的に検出した顔領域が予め設定した明度になるように明度を補正する。操作者によってばらつきが出ないように、男女別や目の色別ごとにプリセット値を用意して、操作者が性別や目の色を判別して基準明度データを設定し、補正を行っていた。   As another known example, Patent Document 2 corrects the lightness so that the automatically detected face area has a lightness set in advance under shooting conditions with limited poses and light sources such as a proof photograph. To avoid variations among operators, preset values were prepared for each gender and eye color, and the operator determined the gender and eye color, set the reference brightness data, and made corrections. .

また、補正方法が一意に定まらない場合に操作者が選択及び補正内容を調整する方法として、特許文献3のように、補正結果の画像全体を一覧表示または補正前後の比較表示を行って、補正方法や補正内容を調整していた。
特開2001−189862公報 特開2000−261650公報 特開平10−221773号公報
Further, as a method for the operator to select and correct the correction contents when the correction method is not uniquely determined, as shown in Patent Document 3, the entire correction result image is displayed as a list or a comparison display before and after correction. The method and correction details were adjusted.
JP 2001-189862 A JP 2000-261650 A Japanese Patent Laid-Open No. 10-221773

しかしながら、特許文献1による方法では、顔以外の領域まで補正の対象となってしまい、好ましい画像補正ができなかった。また、特許文献2においては、検出された顔の判別は操作者が行っていた。また、顔領域の輝度を、所定の輝度値に強制的に変換するため、照明写真のような限られた撮影条件で撮影された画像に限られており、一般のデジタルカメラで撮影したように様々な光源の元で撮影された写真に適用することは出来なかった。また、特許文献3においては、補正対象の領域が複数あって、さらに補正方法が複数ある場合にはその組み合わせは膨大となり、一覧表示による方法では操作性が著しく低下していた。   However, in the method according to Patent Document 1, a region other than the face is subject to correction, and preferable image correction cannot be performed. In Patent Document 2, the detected face is discriminated by the operator. In addition, because the brightness of the face area is forcibly converted to a predetermined brightness value, it is limited to images taken under limited shooting conditions such as lighting photos, as if taken with a general digital camera It could not be applied to photographs taken under various light sources. Further, in Patent Document 3, when there are a plurality of regions to be corrected and there are a plurality of correction methods, the number of combinations becomes enormous, and the operability is remarkably deteriorated by the list display method.

本発明は、上記従来の問題点に鑑み、入力画像中に異なる補正方法が求められる複数の対象領域がある場合も、簡単な操作で複数の対象領域に対し好ましい画像補正ができる画像処理方法及びその装置を提供する。   In view of the above-described conventional problems, the present invention provides an image processing method capable of performing preferable image correction on a plurality of target areas with a simple operation even when there are a plurality of target areas for which different correction methods are required in an input image. The device is provided.

上記目的を達成するために、本発明の画像処理装置は、画像情報を入力する画像入力手段と、該画像入力手段から入力された画像情報に予め設定した対象が含まれるかどうかを検出し、検出した領域を設定する領域設定手段と、該領域設定手段で設定された各領域について、領域の種別を判別し、該領域の種別とともに判別の確からしさを出力する領域判別手段と、前記領域判別手段で判別された種別に基づいて、設定された各領域に対して画像補正を行う画像補正手段とを有し、前記画像補正手段は、前記領域設定手段が設定したいずれかの領域において前記領域判別手段が出力する判別の確からしさが所定の閾値に満たない場合に、画像補正方法の候補を立案する画像補正方法立案手段と、補正する領域について補正方法を提示し、オペレータの指示を仰ぐ補正方法指示手段とを有し、前記補正方法指示手段による指示内容に従って画像を補正することを特徴とする。 In order to achieve the above object, an image processing apparatus according to the present invention detects image input means for inputting image information, and whether or not a preset target is included in the image information input from the image input means, an area setting means for setting a detected region, for each region set by the region setting means, to determine the type of the region, and the region discriminating means for outputting a likelihood of discrimination with the type of the region, the region discrimination based on the type discriminated by the section, have a image correcting means for performing image correction for each area set, the image correcting means, the area in any region where the region setting means has set When the probability of discrimination output by the discrimination means is less than a predetermined threshold, an image correction method planning means for planning image correction method candidates and a correction method for the area to be corrected are presented. And a correcting method instruction unit seek instruction over data, and correcting the image in accordance with an instruction content according to said correction method instruction unit.

ここで、前記予め設定した対象は人物の顔である。また、前記領域の種別は、前記領域内の人物の顔の性別、年齢、または、個人あるいは人類の生物学的分類のいずれかまたはその組み合わせである。また、記画像補正は、特定空間領域中のうち特定色域に含まれる画素に対する明度、色相、彩度、シャープネス、ぼかし、のいずれかまたはその組み合わせの補正である。また、前記補正方法指示手段は補正対象の画像を表示し、補正対象の領域の近辺に補正方法を指示するための操作釦を配置する。また、前記補正方法指示手段は補正対象の画像を表示し、補正対象の領域が確認可能な外接多角形を表示する。また、前記補正方法指示手段は補正のかかり具合を設定し、設定内容に従って表示中の補正対象画像へ反映させる。 Here, the preset target is a human face. In addition, the type of the region is any one or a combination of gender, age, and biological classification of an individual or a human being. The image correction is correction of any one or a combination of lightness, hue, saturation, sharpness, and blurring for pixels included in the specific color gamut in the specific space region . Also, the correction method instruction means displays the image to be corrected, to place the operation button for instructing the correction method in the vicinity of the correction target region. The correction method instructing unit displays an image to be corrected and displays a circumscribed polygon in which the correction target region can be confirmed. The correction method instruction means sets the degree of correction and reflects it on the correction target image being displayed in accordance with the set contents.

更に、本発明によれば、上記画像処理装置の画像処理に相当する画像処理方法、前記画像処理方法の各工程をコンピュータに実行させるためのプログラム、前記プログラムを記憶したコンピュータ読み取り可能な記録媒体が提供される。 Further, according to the present invention, the image the image processing method corresponding to the image processing apparatus, the image program order to execute the respective steps in a computer processing method, computer-readable recording medium storing the program Is provided.

以上説明したように、本発明によれば、 本発明は、上記従来の問題点に鑑み、入力画像中に異なる補正方法が求められる複数の対象領域がある場合も、簡単な操作で複数の対象領域に対し好ましい画像補正ができるという効果がある。   As described above, according to the present invention, in view of the above-described conventional problems, even when there are a plurality of target areas for which different correction methods are required in an input image, the present invention can be performed with a simple operation. There is an effect that preferable image correction can be performed on the region.

以下、添付図面に従って、本発明の実施形態の画像処理装置の構成及び動作を詳細に説明する。   Hereinafter, the configuration and operation of an image processing apparatus according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings.

<本実施形態の画像処理装置の概念的構成例>
図1は、本実施形態における画像処理装置の概念的構成を示す図である。
<Conceptual Configuration Example of Image Processing Apparatus of Present Embodiment>
FIG. 1 is a diagram illustrating a conceptual configuration of an image processing apparatus according to the present embodiment.

図1において、101は画像情報を入力する画像入力部である。本例の画像入力部101は、デジタルカメラやスキャナなどの画像入力機器やフロッピー(登録商標)ディスク、CD、メモリカードなどの画像記憶媒体からの入力、更にネットワークを介した受信を含む。   In FIG. 1, reference numeral 101 denotes an image input unit for inputting image information. The image input unit 101 of this example includes input from an image input device such as a digital camera or a scanner, an image storage medium such as a floppy (registered trademark) disk, CD, or memory card, and reception via a network.

102は画像入力部101から入力された画像情報に予め設定した対象が含まれるかどうかを検出し、検出した領域を設定する領域設定部である。本例では、予め設定した対象として人物の顔が設定される。人物の顔か否かは、例えば輪郭や構成要素(目や口など)の位置に基づいて検出する。103は領域設定部102で設定された各領域について種別を判別する領域判別部である。ここで、本例で判別する種別は、性別、年齢、人種などである。   Reference numeral 102 denotes an area setting unit that detects whether or not a preset target is included in the image information input from the image input unit 101 and sets the detected area. In this example, a human face is set as a preset target. Whether or not the face is a person is detected based on, for example, the position of a contour or a component (such as an eye or a mouth). Reference numeral 103 denotes an area determination unit that determines the type of each area set by the area setting unit 102. Here, the types determined in this example are sex, age, race, and the like.

104は領域設定部102が設定したいずれかの領域において、領域判別部103が出力する尤度が所定の閾値に満たない場合、画像補正方法の候補を立案する画像補正方法立案部である。105は補正する領域について補正方法を提示し、オペレータの指示を仰ぐ補正方法の選択部である。   Reference numeral 104 denotes an image correction method planning unit that plans image correction method candidates when the likelihood output by the region determination unit 103 is less than a predetermined threshold in any of the regions set by the region setting unit 102. A correction method selection unit 105 presents a correction method for a region to be corrected and asks for an instruction from the operator.

106は領域判別部103で判別された種別に基づいて、該領域に対して選択部105で選択された補正方法で画像補正を行う画像補正部である。尚、上記画像補正方法立案部104及び選択部105はオプショナルな構成要素であり、画像補正部106は領域判別部103で判別された種別に基づいて、予め決められたあるいは自分で決定した補正方法で画像補正を行う構成でも良い。   An image correction unit 106 performs image correction on the region by the correction method selected by the selection unit 105 based on the type determined by the region determination unit 103. The image correction method planning unit 104 and the selection unit 105 are optional components, and the image correction unit 106 is a correction method determined in advance or determined by the user based on the type determined by the region determination unit 103. A configuration in which image correction is performed in the above may be used.

107は補正された画像を出力する画像出力部である。例えば、画像出力部107はディスプレイやプリンタなどの出力機器への出力、あるいはフロッピー(登録商標)ディスク、CD、メモリカードなどの画像記憶媒体への出力、更にネットワークを介した送信を含む。   An image output unit 107 outputs the corrected image. For example, the image output unit 107 includes output to an output device such as a display or a printer, output to an image storage medium such as a floppy (registered trademark) disk, CD, or memory card, and further transmission via a network.

<本実施形態の画像処理装置の具体的構成例>
図2は、本実施形態における画像処理装置の具体的構成例を示すブロック図である。
<Specific Configuration Example of Image Processing Apparatus of Present Embodiment>
FIG. 2 is a block diagram illustrating a specific configuration example of the image processing apparatus according to the present embodiment.

画像処理装置は、ROM202やRAM203に格納されたプログラムに従って命令を実行する演算処理用のCPU201、本実施形態のプログラムやその他の制御に必要なプログラムやデータを格納したROM202、一時的なデータを格納するRAM203、IDEやSCSIなどの外部記憶装置とのインタフェースを実現するドライブI/F204、動画や動画検索のための特徴量やプログラムなどを記憶するHDD205、デジタルカメラやスキャナなどの装置から画像を入力する画像入力部206、一時的なデータを格納するバッファメモリ207、キーボードやマウスなどのオペレータからの入力を行う入力部208、ブラウン管や液晶ディスプレイなどの表示部209、インターネットやイントラネットなどのネットワークと接続を行うモデムやLANなどのネットワークI/F210、画像を印刷出力するプリンタ212などで構成され、これらを接続するバス213を介して相互にデータの入出力を行う。   The image processing apparatus stores an arithmetic processing CPU 201 that executes instructions according to programs stored in the ROM 202 and the RAM 203, a ROM 202 that stores programs and data necessary for the control according to the present embodiment and other controls, and temporary data. Input images from devices such as RAM 203, drive I / F 204 that realizes an interface with an external storage device such as IDE or SCSI, HDD 205 that stores moving image or feature amount or program for moving image search, digital camera or scanner, etc. An image input unit 206, a buffer memory 207 for storing temporary data, an input unit 208 for inputting from an operator such as a keyboard and a mouse, a display unit 209 such as a cathode ray tube or a liquid crystal display, and a network such as the Internet or an intranet. Network I / F210 such as a modem or LAN for performing connection, image is constituted by a printer 212 for printing out, and inputs and outputs data to each other via a bus 213 that connects these.

本画像処理装置はオペレーティングとしてマイクロソフト社のWINDOWS(登録商標)XPがインストールされ、その上で動作するアプリケーションとして実装されている。   In this image processing apparatus, WINDOWS (registered trademark) XP of Microsoft Corporation is installed as an operating system, and the image processing apparatus is mounted as an application that operates on the XP.

本実施形態のRAM203は、CPU201の演算処理中に一時使用されるデータ記憶領域と、CPU201が実行する本実施形態のアプリケーションプログラムをHDD205などからロードするプログラムロード領域とを有する。   The RAM 203 of the present embodiment has a data storage area that is temporarily used during the arithmetic processing of the CPU 201 and a program load area for loading the application program of the present embodiment executed by the CPU 201 from the HDD 205 or the like.

データ記憶領域は、入力された画像データを記憶する入力画像データ領域203aと、顔領域と検出された各検出領域iについて画像データ領域203b、種別フラグ領域203c、算出尤度領域203d、補正方法選択フラグ領域203e、及び補正データ領域203fと、尤度の閾値領域203gと、出力画像データ領域203hとを含む。   The data storage area includes an input image data area 203a for storing input image data, and an image data area 203b, a type flag area 203c, a calculation likelihood area 203d, and a correction method selection for each detection area i detected as a face area. It includes a flag area 203e, a correction data area 203f, a likelihood threshold area 203g, and an output image data area 203h.

又、プログラムロード領域には、画像処理プログラム203i(図3)、画像入力モジュール203k、顔領域検出モジュール(図4)、顔領域判別モジュール203m(図6)、画像補正方法立案モジュール203n(図7)、補正方法選択モジュール203p、画像補正モジュール203q(図11)、画像出力モジュール203rがロードされて、CPU201により実行される。   The program load area includes an image processing program 203i (FIG. 3), an image input module 203k, a face area detection module (FIG. 4), a face area determination module 203m (FIG. 6), and an image correction method planning module 203n (FIG. 7). ), The correction method selection module 203p, the image correction module 203q (FIG. 11), and the image output module 203r are loaded and executed by the CPU 201.

尚、本実施形態で使用される、性別、年齢、人類の生物学的分類に対応して、補正目標値を記憶するテーブルは、固定であればROM202に、可変であればRAM203に保持される。図2では、ROM202に補正目標値テーブル202aが図示されている。   A table for storing correction target values corresponding to the sex, age, and biological classification of human beings used in this embodiment is held in the ROM 202 if it is fixed, and in the RAM 203 if it is variable. . In FIG. 2, a correction target value table 202 a is illustrated in the ROM 202.

<本実施形態の画像処理装置の動作例>
次に、かかる構成の画像処理装置における画像補正処理の概要を、図3のフローチャートを用いて説明する。
<Example of Operation of Image Processing Apparatus of Present Embodiment>
Next, an outline of image correction processing in the image processing apparatus having such a configuration will be described with reference to the flowchart of FIG.

画像データの入力後、ステップS301において、補正対象の画像から顔領域を検出する。ステップS302において、領域が検出されたか否かによって分岐する。領域が検出された場合はステップS303に進み、そうでない場合は処理を終了する。   After inputting the image data, a face area is detected from the image to be corrected in step S301. Processing branches at step S302 depending on whether an area has been detected. If an area is detected, the process proceeds to step S303, and if not, the process ends.

ステップS303において、検出された各顔領域に対して顔領域の種別を判別する。ここでは、各顔領域について顔の種類とその尤度を出力する。顔の種類は本実施形態では、性別、年齢、人類の生物学的分類(いわゆる人種)の3項目について定義した。年齢は成長変化の大きい若い年齢をより細かく分割し、20代前半までを4段階、それ以降を2段階の計6段階に設定した。人類の生物学的分類方法としてはSaitou1995,HumanEvolution,vol.10,pp.17−33を参考にアフリカ人、西ユーラシア人、東ユーラシア人、サフール人、北アメリカ人、南アメリカ人の6種とした。この場合、2×6×6=72種類に分類できる。   In step S303, the type of the face area is determined for each detected face area. Here, the type of face and its likelihood are output for each face area. In this embodiment, three types of faces are defined: gender, age, and human biological classification (so-called race). Age was divided into younger age groups with large growth changes, and was set to 6 levels, 4 levels up to the early 20s and 2 levels thereafter. As a biological classification method of human beings, Saitou 1995, Human Evolution, vol. 10, pp. With reference to 17-33, 6 types were selected: African, West Eurasian, East Eurasian, Safur, North American, and South American. In this case, it can be classified into 2 × 6 × 6 = 72 types.

ステップS304において、検出された各顔領域に対して、顔の種別ごとに定義された補正方法に従って画像補正方法を立案する。ステップS305において、補正方法があるかを判断する。補正しないという選択肢もあるので、補正方法が1つでもある場合はステップS306に進み、無い場合はステップS307に進む。ステップS306において、補正方法を操作者に選択させる。なお、あらかじめ最も高い尤度の判別情報だけを利用して補正を実行するように設定することで、ステップS306におけるオペレータの選択作業を省略し、完全自動で補正処理を実行することも可能である。   In step S304, an image correction method is devised for each detected face area in accordance with a correction method defined for each type of face. In step S305, it is determined whether there is a correction method. Since there is an option of not correcting, if there is only one correction method, the process proceeds to step S306, and if not, the process proceeds to step S307. In step S306, the operator is made to select a correction method. It should be noted that it is possible to omit the operator's selection work in step S306 and execute the correction process completely automatically by setting the correction to be performed using only the discrimination information with the highest likelihood in advance. .

ステップS307において、選択した補正方法で入力した画像に対し補正を行う。この方法については、選択された補正方法を出力する画像に対して行う。補正の方法はステップS304の画像補正方法立案処理の詳細の説明として後述する。   In step S307, the image input by the selected correction method is corrected. This method is performed on the image to which the selected correction method is output. The correction method will be described later as a detailed description of the image correction method planning process in step S304.

尚、当然のことながら、画像全体の彩度強調や輝度分布の調整、入出力装置ごとに異なる色再現特性を補償するための画像補正を、本処理の前段または後段に実施することは何ら本発明の主旨に反するものではない。   Of course, it is not necessary to carry out image correction to compensate for color reproduction characteristics that differ for each input / output device before or after this processing, such as saturation enhancement of the entire image, adjustment of luminance distribution, and compensation for different color reproduction characteristics for each input / output device. This is not against the gist of the invention.

以下、先述した各処理について詳細に述べていく。   Hereinafter, each process described above will be described in detail.

(顔領域検出処理:S301)
以下に、図3のステップS301の顔領域検出処理の一例を詳細に示す。
(Face region detection processing: S301)
Hereinafter, an example of the face area detection process in step S301 of FIG. 3 will be described in detail.

図4のフローチャートを用いて、顔領域検出処理の詳細を説明する。図5は顔領域検出処理を説明する図である。   Details of the face area detection processing will be described with reference to the flowchart of FIG. FIG. 5 is a diagram for explaining face area detection processing.

まず、ステップS401において、入力された画像を元に局所的に輝度が低い領域をマークしていく。ステップS402において、ステップS401でマークされた領域を2つずつ組にして、領域の大きさの均等性、輝度の差、水平に対する角度などから、組にした2つが目かどうかを判定する(図5(a))。   First, in step S401, an area having a low brightness is marked based on the input image. In step S402, two regions marked in step S401 are grouped, and it is determined whether the two groups are eyes from the uniformity of the size of the regions, the difference in luminance, the angle with respect to the horizontal, etc. (FIG. 5 (a)).

ステップS403において、顔領域か否かを検証する。すなわち、目と判定された組について、その2つを中心にした矩形領域を設定する(図5(b))。そして、その領域の境界付近のエッジおよび領域内の色情報を判定する。エッジは、顔の輪郭であるかどうかを判定する。また、色情報は矩形領域内のRGB値の平均値が、あらかじめ設定した肌色領域内に入っているかどうかを判定する(図5の(c))。このように顔の位置、大きさを検出して顔領域を確定する。顔領域は前記矩形(水平/垂直方向に平行な長方形)領域で与えられる。   In step S403, it is verified whether or not the face region. That is, for the group determined to be an eye, a rectangular area centering on the two is set (FIG. 5B). Then, the edge near the boundary of the region and the color information in the region are determined. It is determined whether the edge is a face outline. Further, the color information determines whether or not the average value of the RGB values in the rectangular area falls within a preset skin color area ((c) in FIG. 5). In this way, the face area is determined by detecting the position and size of the face. The face area is given by the rectangular area (rectangle parallel to the horizontal / vertical direction).

ステップS404において、確定した顔の領域の領域情報を作成する。領域情報は、本実施形態では、検出した顔領域の外接矩形の頂点の位置データの集合であるが、両目の中心の位置データでもよい。また、多角形や楕円などで近似しても良い。   In step S404, area information of the determined face area is created. In this embodiment, the area information is a set of position data of the vertices of the circumscribed rectangle of the detected face area, but may be position data of the center of both eyes. Moreover, you may approximate by a polygon, an ellipse, etc.

(顔領域判別処理:S303)
以下に、図3のステップS303の顔領域判別処理の一例を詳細に示す。
(Face region discrimination processing: S303)
Hereinafter, an example of the face area determination process in step S303 of FIG. 3 will be described in detail.

図6のフローチャートを用いて顔領域判定処理の詳細を説明する。   Details of the face area determination processing will be described with reference to the flowchart of FIG.

まず、ステップS601において、横48画素、縦64画素の領域に、左右の目の中心が横方向でそれぞれ左右の端から16画素目、上から24画素目の位置なるように顔領域をアフィン変換する。また、輝度分布と顔の向きに関して正規化を行う。   First, in step S601, the face area is affine transformed into an area of 48 pixels horizontally and 64 pixels vertically so that the center of the left and right eyes is located in the horizontal direction at the 16th pixel from the left and right edges and the 24th pixel from the top. To do. Also, normalization is performed with respect to the luminance distribution and the face orientation.

次に、ステップS602において特徴量を抽出する。簡単な手法では、各画素の輝度値を用いても良い。この場合は、48×64=3072次元の特徴量となる。これを、予め主成分分析を行って得た基底ベクトルによって特定される部分空間に射影し、分散の少ない軸を無視することで次元数を削減し、特徴量とする。   Next, feature amounts are extracted in step S602. In a simple method, the luminance value of each pixel may be used. In this case, the feature amount is 48 × 64 = 3072 dimensions. This is projected onto a partial space specified by a basis vector obtained by performing principal component analysis in advance, and the number of dimensions is reduced by ignoring the axis with little variance, thereby obtaining a feature amount.

ステップS603において、各種別における代表的な特徴量とのユークリッド距離を射影された部分空間上で求める。部分空間は、特徴量の判別分析を行って予め基底ベクトルを求めておき、これによって特定される。なお、本実施形態では二者択一式の判別分析を行っているので、判別する種類が男女の様に二者の場合は、この基底ベクトルは1種でよい。3者以上の種別に分類する場合には、各種別ごとに含まれるか否かの判別分析を行い、種別ごとに予め基底ベクトルを求め、種別ごとに距離を求める。精度よりスピードを重視する実装が必要であれば、3者以上でも1種の基底ベクトルでもよい。   In step S603, the Euclidean distance from the representative feature amount in each type is obtained on the projected subspace. The partial space is specified by performing a discriminant analysis of the feature amount to obtain a base vector in advance. In the present embodiment, since an alternative set of discriminant analysis is performed, if there are two types of discrimination, such as men and women, this basis vector may be one. In the case of classification into three or more types, a discrimination analysis is performed to determine whether or not each type is included, a base vector is obtained in advance for each type, and a distance is obtained for each type. If implementation that emphasizes speed over accuracy is necessary, three or more or one kind of basis vector may be used.

ステップS604において、距離から尤度に正規化する。この変換関数は、予め多数のサンプルを使って得られた代表的な特徴量との距離と、それがある種別に実際に含まれるか否かの確率分布から決定する。   In step S604, the distance is normalized to the likelihood. This conversion function is determined from a distance from a representative feature amount obtained using a large number of samples in advance and a probability distribution as to whether or not it is actually included in a certain type.

判別分析の基底ベクトルを求める際のサンプルの分け方によって、性別、年齢、生物学的特徴に関する分類が可能である。また、判別する種類は本実施形態では3項目について行っているが、これに限定するものではない。所望の分類を定義して学習用サンプルを定義した分類に分けて判別分析を行えばよい。   Depending on how the samples are divided when obtaining basis vectors for discriminant analysis, classifications regarding gender, age, and biological characteristics are possible. In addition, in this embodiment, the type of discrimination is performed for three items, but is not limited to this. The discriminant analysis may be performed by defining the desired classification and classifying the learning sample into the defined classes.

(画像補正方法立案処理:S304)
以下に、図3のステップS304の画像補正方法立案処理の一例を詳細に示す。図7乃至図11は画像補正方法立案処理の動作を示したものである。ここでは、先述した画像から検出した各顔領域について、判別された領域種別のうち尤度の高いものについて、それぞれの肌補正処理を行う。
(Image correction method planning process: S304)
An example of the image correction method planning process in step S304 in FIG. 3 will be described in detail below. 7 to 11 show the operation of the image correction method planning process. Here, with respect to each face area detected from the above-described image, each skin correction process is performed on the identified area type having a high likelihood.

図7のフローチャートを用いて画像補正方法立案処理の詳細を説明する。   Details of the image correction method planning process will be described with reference to the flowchart of FIG.

画像補正方法立案処理を開始すると、ステップS701において、図3のステップS301で検出した未処理の顔領域情報を1つ取得する。ステップS702において、取得した領域から図3のステップS303で判別した未処理の顔の種別の候補を尤度の高いものから1つ取得する。ステップS703において尤度が所定の閾値以上であるかを判定し、閾値未満であった場合はステップS711に進んでその領域は無効として、補正対象としない。閾値以上であった場合にはステップS704に進む。   When the image correction method planning process is started, one unprocessed face area information detected in step S301 in FIG. 3 is acquired in step S701. In step S702, one candidate of the unprocessed face type determined in step S303 in FIG. In step S703, it is determined whether the likelihood is greater than or equal to a predetermined threshold value. If the likelihood is less than the threshold value, the process proceeds to step S711, and the region is invalid and is not subject to correction. If it is equal to or greater than the threshold, the process proceeds to step S704.

ステップS704において、RGB色空間の各値で表現されている前記入力画像を明度L、彩度C、色相Hの値に変換する。このLCHという色空間は、CIEL*a*b*色空間より、次の式(1)で算出される。   In step S704, the input image represented by each value in the RGB color space is converted into values of lightness L, saturation C, and hue H. This color space called LCH is calculated from the CIEL * a * b * color space by the following equation (1).

Figure 0004522229
Figure 0004522229

このLCHは明度、彩度、色相で色を表す色空間の一例で、この他、YCbCr、L*u*v*、HSV、HSL等々、他の色空間であっても良い。
(領域代表色抽出処理:S705)
ステップS705において、彩度C、色相Hで表された人肌領域内の画素について、各領域内の代表色を求める。
This LCH is an example of a color space that expresses a color in terms of brightness, saturation, and hue. In addition, other color spaces such as YCbCr, L * u * v *, HSV, and HSL may be used.
(Area representative color extraction processing: S705)
In step S705, a representative color in each region is obtained for pixels in the human skin region represented by saturation C and hue H.

ステップS705の処理について、図8のフローチャートを用いて詳しく説明する。   The process of step S705 will be described in detail with reference to the flowchart of FIG.

まず、ステップS801において、対象となる顔画像領域データを取得する。ステップS802からステップS805はこの領域内の各画素についての処理のループを構成している。   First, in step S801, target face image area data is acquired. Steps S802 to S805 constitute a processing loop for each pixel in this region.

ステップS802において、現在注目している画像領域に含まれる未処理の画素を決定する。次に、ステップS803において、画素の明度Lがある一定の値LTH以上であるかを判断する。もしステップS301で抽出された顔領域内に目、眉、髭、あるいは陰影が含まれていると、人肌領域から抽出した補正対象とする色の代表色が適切に得られない場合がある。前記人肌領域内の陰影、あるいは目、眉、髭といった領域は補正対象とする肌色などの所定色よりも明度が低いと考えられるので、前記条件を用いることにより、前記人肌領域内の陰影、あるいは目、眉、髭といった領域の画素を除外することできる。ステップS803の条件を満たした画素について、ステップS804にて同画素の彩度C及び色相Hの色データを集計する。この集計方法は補正対象の代表色として何を用いるかによって変わってくるが、例えば、補正対象の代表色を人肌領域内の画素の平均値とする場合には、ステップS804の集計は、彩度C及び色相Hの単純な加算を意味する。また、同時に画素数もカウントする。ステップS805で全画素について走査を終了したと判断されるまで、ステップS802からS805の前記集計処理を繰り返す。 In step S802, an unprocessed pixel included in the image area currently focused on is determined. Next, in step S803, it is determined whether the brightness L of the pixel is equal to or greater than a certain value L TH . If eyes, eyebrows, eyelids, or shadows are included in the face area extracted in step S301, the representative color of the color to be corrected extracted from the human skin area may not be obtained appropriately. Since the shadow in the human skin area or the area such as eyes, eyebrows, and eyelids is considered to have a lightness lower than a predetermined color such as a skin color to be corrected, the shadow in the human skin area is obtained by using the condition Alternatively, pixels in the area such as eyes, eyebrows, and eyelids can be excluded. For the pixel that satisfies the condition in step S803, the color data of the saturation C and hue H of the pixel are totaled in step S804. This aggregation method varies depending on what is used as the representative color to be corrected. For example, when the representative color to be corrected is the average value of the pixels in the human skin region, Mean simple addition of degree C and hue H. At the same time, the number of pixels is counted. The counting process in steps S802 to S805 is repeated until it is determined in step S805 that scanning has been completed for all pixels.

入力画像の全画素について走査が終了したと判断された場合、ステップS806で現在注目している画像領域について、補正対象とする色の領域代表色を算出する。補正対象の代表色を人肌領域内画素の彩度及び色相の平均値で表す場合、ステップS806では前記集計処理での集計結果を集計画素数で除算した値(CR(k,l),HR(k,l))を領域代表色として設定する。ただし、kは顔領域のインデックス番号、また、lは各顔領域の判別結果における種別候補のインデックス番号である。このようにして求められた領域代表色を利用して、以下のステップS707で色補正のための補正係数を設定する。 If it is determined that scanning has been completed for all the pixels of the input image, an area representative color of the color to be corrected is calculated for the image area currently focused on in step S806. When the representative color to be corrected is expressed by the average value of the saturation and hue of the pixels in the human skin region, in step S806, a value ( CR (k, l), H R (k, l)) is set as the region representative color. Here, k is the index number of the face area, and l is the index number of the type candidate in the discrimination result of each face area. Using the region representative color thus obtained, a correction coefficient for color correction is set in the following step S707.

図7に戻って、ステップS706において、補正目標値テーブル202aを参照して、補正対象の種別毎に予め設定した補正目標色を取得する。   Returning to FIG. 7, in step S <b> 706, the correction target color set in advance for each type of correction target is acquired with reference to the correction target value table 202 a.

この補正目標値テーブル202aは、年齢6段階、人類の生物学的分類を6種、性別2種の、2×6×6=72種類に対してそれぞれ肌色の目標色(本例では、色相と彩度)が定義されており、例えば、東ユーラシア人の19〜24歳の女性ならば、目標の色相が“0.7”、彩度が“27”、東ユーラシア人の19〜24歳の男性ならば、目標の色相が“0.75”、彩度が“44”などと定義されている。この目標色は、好ましい画像補正の主観評価実験を行って決定される。   This corrected target value table 202a has a skin color target color (in this example, hue and color) for 2 × 6 × 6 = 72 types of 6 stages of age, 6 types of biological classification of mankind, and 2 types of gender. Saturation) is defined, for example, if an Eurasian 19-24 year old woman has a target hue of “0.7”, a saturation of “27”, an East Eurasian 19-24 year old For a male, the target hue is defined as “0.75”, the saturation as “44”, and the like. This target color is determined by performing a subjective evaluation experiment of a preferable image correction.

(補正係数設定処理:S707)
次にステップS707において、先のステップS705で抽出した領域代表色とステップS706で取得した補正目標色を用いて、領域毎の補正量を制御する補正係数を求める。この補正係数設定処理では、前記領域代表色と目標色との差に応じて色補正量を制御する所定係数である。後述の色補正における補正量は色相と彩度毎に定めるため、補正係数も色相と彩度毎に設定する。本実施形態では、色相補性係数及び彩度補正係数は前記目標色を代表色の差が大きくなるとともに減少するように設定する。さらに、彩度補正係数は、彩度を下げるように補正する場合は、彩度を上げるように補正する場合に比べ、補正量が小さくなるように設定する。
(Correction coefficient setting process: S707)
In step S707, a correction coefficient for controlling the correction amount for each area is obtained using the area representative color extracted in the previous step S705 and the correction target color acquired in step S706. In the correction coefficient setting process, the correction coefficient is a predetermined coefficient for controlling the color correction amount according to the difference between the region representative color and the target color. Since a correction amount in color correction described later is determined for each hue and saturation, a correction coefficient is also set for each hue and saturation. In this embodiment, the color complementation coefficient and the saturation correction coefficient are set so that the target color decreases as the difference between the representative colors increases. Further, the saturation correction coefficient is set so that the correction amount is smaller when the saturation is corrected so as to decrease the saturation than when the saturation is corrected so as to increase the saturation.

ステップS707における補正係数設定処理について、以下より詳しく説明する。   The correction coefficient setting process in step S707 will be described in more detail below.

k,l番目(0≦k,l<N)の領域の色相補正係数PH(k,l)は前記補正目標色の色相HTと前記k番目の領域のl番目の判別候補に対する領域代表色の色相HRk,l)の差Hdist(k,l)が大きくなるとともに減少するように設定する。色相補正係数の設定方法の例として、式(2)ような式を用いる方法が示される。ただし、式(2)におけるK1およびt1は定数とする。 The hue correction coefficient P H (k, l) of the k, l-th (0 ≦ k, l <N) region is a region representative for the hue H T of the correction target color and the l-th discrimination candidate of the k-th region. The difference H dist (k, l) between the hues H R k, l) of the colors is set so as to decrease as it increases. As an example of a method for setting the hue correction coefficient, a method using an expression such as Expression (2) is shown. However, K 1 and t 1 in Equation (2) are constants.

Figure 0004522229
Figure 0004522229

つまり、補正対象とする色の代表色相が補正目標色相に近いほど代表色の色相を補正目標色の色相により近づけるような補正を行い、補正対象とする色の代表色相が補正目標色相から大きく離れている場合には、あまり補正を行わないように補正係数を設定する。このように補正係数の設定を行う理由として、補正対象とする色の代表色相が補正目標色相から大きく離れている場合に、代表色を補正目標色により近づけるような補正を行うと、入力画像全体のバランスが崩れてしまうということが挙げられる。
同様に、k番目の領域におけるl番目の判別候補の彩度補正係数PC(k,l)は前記補正目標色の彩度値CTと前記k番目の領域におけるl番目の判別候補の領域代表色の彩度値CR(k,l)の差Cdist(k,l)が大きくなるとともに減少するように設定する。つまり、補正対象とする色の代表彩度が補正目標彩度に近いほど代表色の彩度を補正目標色の彩度により近づけるような補正を行い、補正対象とする色の代表彩度が補正目標彩度から大きく離れている場合には、あまり補正を行わないように補正係数を設定する。ただし、彩度補正係数は彩度を下げるように補正する場合と彩度を上げるように補正をする場合で設定方法を異なるものとする。
That is, the closer the representative hue of the color to be corrected is to the correction target hue, the closer the hue of the representative color is closer to the hue of the correction target color, and the representative hue of the color to be corrected is far away from the correction target hue. If so, the correction coefficient is set so as not to make much correction. The reason for setting the correction coefficient in this way is that when the representative hue of the color to be corrected is far away from the correction target hue, the correction is performed so that the representative color is closer to the correction target color. Is unbalanced.
Similarly, the saturation correction coefficient l-th determination candidates in k-th region P C (k, l) is the region of l-th determination candidates in the k-th region and the chroma value C T of the correction target color The difference C dist (k, l) between the saturation values C R (k, l) of the representative colors is set so as to decrease as it increases. In other words, correction is performed so that the saturation of the representative color is closer to the saturation of the correction target color as the representative saturation of the color to be corrected is closer to the correction target saturation, and the representative saturation of the color to be corrected is corrected. When it is far from the target saturation, the correction coefficient is set so as not to make much correction. However, the method of setting the saturation correction coefficient is different depending on whether the correction is performed so as to decrease the saturation or the correction is performed so as to increase the saturation.

彩度を下げる補正をする場合は、補正をすることで画像の印象が地味になってしまうという現象を防ぐように補正係数を設定する方が望ましく、逆に彩度を上げる補正をする場合は、補正対象とする色の代表彩度が補正目標彩度から離れていても、目標彩度に近づけるような補正を行う方が、画像の印象が良くなるという効果が期待できるからである。このような彩度補正係数の設定方法の例として、彩度を下げる補正の場合は、式(3)ような設定式を、彩度を上げる補正の場合は式(4)を用いる方法が示される。式(3)のa1,b1および式(4)のK2,t2は定数とする。 When correcting to reduce saturation, it is desirable to set a correction coefficient so as to prevent the phenomenon that the impression of the image becomes plain by correcting, and conversely when correcting to increase saturation This is because, even if the representative saturation of the color to be corrected is far from the correction target saturation, the effect of improving the impression of the image can be expected by performing correction so as to approach the target saturation. As an example of a method for setting such a saturation correction coefficient, a method using a setting equation such as equation (3) in the case of correction for reducing saturation and a method using equation (4) in the case of correction for increasing saturation is shown. It is. It is assumed that a 1 and b 1 in equation (3) and K 2 and t 2 in equation (4) are constants.

Figure 0004522229
Figure 0004522229

Figure 0004522229
Figure 0004522229

図9に、式(3)、(4)を表したグラフを示す。図9において、横軸は前記補正目標色の彩度値CTと前記代表色の彩度値CR(k,l)の差Cdist(k,l)、縦軸は彩度補正係数PC(k,l)を示す。
前記補正目標彩度と前記代表色の彩度の差が等しい場合でも、彩度を下げる補正における彩度補正係数と彩度を上げる補正における彩度補正係数の値は異なり、彩度を下げる補正における補正係数がより小さくなっていることが、図9よりわかる。これは、彩度を下げるように補正する場合は彩度を上げるように補正をする場合に比べ、補正量が小さくなるようにすることを示している。
FIG. 9 shows a graph representing the expressions (3) and (4). In FIG. 9, the horizontal axis represents the difference C dist (k, l) between the saturation value C T of the correction target color and the saturation value C R (k, l) of the representative color, and the vertical axis represents the saturation correction coefficient P. C (k, l) is shown.
Even when the difference between the correction target saturation and the saturation of the representative color is equal, the saturation correction coefficient in the correction for decreasing the saturation is different from the saturation correction coefficient in the correction for increasing the saturation, and the correction for decreasing the saturation. It can be seen from FIG. 9 that the correction coefficient at is smaller. This indicates that when the correction is made to decrease the saturation, the correction amount is made smaller than when the correction is made to increase the saturation.

以上のように、ステップS707において算出した色相と彩度の補正係数を、後述する補正処理(ステップS710)において使用される色補正量を制御する係数として利用する。   As described above, the hue and saturation correction coefficients calculated in step S707 are used as coefficients for controlling the color correction amount used in the correction process (step S710) described later.

(色領域設定処理:S708)
図7に戻って、ステップS708では、領域代表色を含む補正処理の対象とする領域毎の色領域を求めるために、色領域設定処理をおこなう。ここでは前記人肌領域内の画素の色相に注目する。
(Color area setting processing: S708)
Returning to FIG. 7, in step S <b> 708, color area setting processing is performed to obtain a color area for each area to be subjected to correction processing including area representative colors. Here, attention is paid to the hue of the pixels in the human skin region.

本実施形態では、補正対象とする代表色を含む色領域を設定し、その領域について色補正を行う。なぜなら、例えば入力画像の全領域に対して、肌の色を好ましい肌色にする補正を行うと、元々好ましい色であった画像中の他領域の色が不自然になってしまうといった問題があるからである。ステップS707の補正係数処理において設定される補正対象とする色領域は特定色相で示され、前記特定色相で示される補正範囲と補正対象とする色の代表色によって、色領域重みを設定し、後述する色補正処理に用いる。   In the present embodiment, a color area including a representative color to be corrected is set, and color correction is performed for the area. This is because, for example, if correction is performed to make the skin color a preferable skin color for the entire area of the input image, there is a problem that the colors of other areas in the image that were originally preferable colors become unnatural. It is. The color area to be corrected set in the correction coefficient processing in step S707 is indicated by a specific hue, and color area weights are set according to the correction range indicated by the specific hue and the representative color of the color to be corrected, which will be described later. Used for color correction processing.

ステップS708の処理について、図10のフローチャートを用いて詳しく説明する。   The processing in step S708 will be described in detail using the flowchart in FIG.

まず、ステップS1001において、図7のステップS707で抽出されたk番目の画像領域に属する顔領域のデータを取得する。   First, in step S1001, face area data belonging to the k-th image area extracted in step S707 of FIG. 7 is acquired.

ステップS1002からステップS1006はこの領域内の各画素についての処理のループを構成している。   Steps S1002 to S1006 constitute a processing loop for each pixel in this region.

ステップS1002において、現在注目している画像領域に含まれる未処理の画素を決定する。次に、ステップS1003において、画素の明度Lが任意の明度を示すLTH以上であるかを判断する。もし図7のステップS707において抽出された人肌領域内に目、眉、髭、あるいは陰影が含まれていると、人肌領域から抽出した補正対象とする色の代表色が適切に得られない場合がある。前記人肌領域内の陰影、あるいは目、眉、髭といった領域は補正対象とする肌色などの所定色よりも明度が低いと考えられるので、前記条件を用いることにより、前記人肌領域内の陰影、あるいは目、眉、髭といった領域の画素を除外することできる。 In step S1002, an unprocessed pixel included in the currently focused image area is determined. Next, in step S1003, lightness L of the pixel to determine whether there are L TH than to indicate any brightness. If eyes, eyebrows, eyelids, or shadows are included in the human skin area extracted in step S707 of FIG. 7, the representative color of the correction target extracted from the human skin area cannot be obtained appropriately. There is a case. Since the shadow in the human skin area or the area such as eyes, eyebrows, and eyelids is considered to have a lightness lower than a predetermined color such as a skin color to be corrected, the shadow in the human skin area can be obtained by using the condition. Alternatively, pixels in the area such as the eyes, eyebrows, and eyelids can be excluded.

さらに、ステップS1004において、同画素の彩度Cが無彩色の彩度を示す所定の値CTH以上であるかを判断する。このとき同画素の彩度が前述の値CTH以下であるということは、同画素は無彩色に限りなく近いことを意味する。ここで無彩色領域の画素を除く理由は、無彩色領域においてはRGB値のわずかの差で色相が大きく変わり、人肌領域に対応する色相領域を高精度で求めることができなくなるためである。ステップS708における色領域設定処理では、色領域を人肌領域内画素の色相に注目し、特定色の色相によって設定する。 Further, in step S1004, the chroma C of the pixel is determined whether a predetermined value or more C T H indicating the saturation of the achromatic. At this time, the fact that the saturation of the pixel is equal to or less than the above-mentioned value C TH means that the pixel is close to an achromatic color. Here, the reason for excluding the pixels in the achromatic color region is that in the achromatic color region, the hue changes greatly due to a slight difference in RGB values, and the hue region corresponding to the human skin region cannot be obtained with high accuracy. In the color area setting process in step S708, the color area is set with the hue of a specific color, paying attention to the hue of the pixel in the human skin area.

ステップS1004の条件を満たした画素について、ステップS1005にて同画素の色相Hの値を集計する。この集計方法は色領域を示す特定色相として何を用いるかによって変わってくるが、例えば、前記人肌領域内に存在し、ステップS1003及びS1004の条件を満たした画素の色相分布を解析し、最大色相Hmax(k,l)および最小色相Hmin(k,l)によって補正対象とする色領域を示す方法が例示される。ステップS1006で全画素について走査を終了したと判断されるまで前記集計処理を繰り返す。 For the pixel that satisfies the condition of step S1004, the value of the hue H of the pixel is tabulated in step S1005. This aggregation method varies depending on what is used as a specific hue indicating a color area. For example, the hue distribution of pixels that exist in the human skin area and satisfy the conditions of steps S1003 and S1004 is analyzed, and the maximum A method of indicating a color area to be corrected by the hue H max (k, l) and the minimum hue H min (k, l) is exemplified. The counting process is repeated until it is determined in step S1006 that scanning has been completed for all pixels.

入力画像の全画素について走査が終了したと判断された場合、ステップS1007で補正対象とする色領域を設定する。前記最大色相Hmax(k,l)および前記最小色相Hmin(k,l)によって補正対象とする色領域を示す場合、ステップS1007では前記集計処理での集計結果である最大色相Hmax(k,l)および最小色相Hmin(k,l)を用い、補正対象とする色の前記代表色相との差から補正対象とする色領域を設定する(式(5))。ここで、式(5)のHR(k,l)はk番目の領域におけるl番目の判別候補の補正対象とする色の前記領域代表色相であり、ΔH(k,l)は補正対象とするk番目の画像領域における色領域の色相範囲を示したものである。 If it is determined that scanning has been completed for all pixels of the input image, a color region to be corrected is set in step S1007. When the maximum hue H max (k, l) and the minimum hue H min (k, l) indicate the color area to be corrected, in step S1007, the maximum hue H max (k , L) and the minimum hue H min (k, l), the color area to be corrected is set from the difference between the color to be corrected and the representative hue (formula (5)). Here, H R (k, l) in the equation (5) is the region representative hue of the color to be corrected of the l th discrimination candidate in the k th region, and ΔH (k, l) is the correction target. The hue range of the color area in the kth image area is shown.

Figure 0004522229
Figure 0004522229

また、ここに示した前記色領域設定処理に限定されるものではなく、例えば任意の特定色相を手動で設定する方法なども挙げられる。この場合には、補正対象とする色領域は、図3のステップS301において抽出された人肌領域を包含するような、色相範囲として設定することが望ましい。
以上のような方法で設定された前記色領域に対して、後述の色補正処理において使用する色領域重みを色相範囲と彩度範囲毎に定める。補正対象とする画素の色相Hにおける重みWH(k,l)は、補正対象とする代表色では1、補正対象領域外では0となるように補正対象とする色領域を示す前記色相範囲ΔH(k,l)および補正対象とする色の代表色の色相HR(k,l)により、以下のように定める(式6)。
Further, the present invention is not limited to the color area setting process shown here, and for example, a method for manually setting an arbitrary specific hue may be used. In this case, it is desirable to set the color area to be corrected as a hue range that includes the human skin area extracted in step S301 in FIG.
For the color area set by the method as described above, a color area weight to be used in color correction processing described later is determined for each hue range and saturation range. The hue range ΔH indicating the color area to be corrected so that the weight W H (k, l) in the hue H of the pixel to be corrected is 1 for the representative color to be corrected and 0 outside the correction target area. Based on (k, l) and the hue H R (k, l) of the representative color of the color to be corrected, it is determined as follows (Formula 6).

Figure 0004522229
Figure 0004522229

ただし、補正対象とする色相領域の重みを設定する方法は、式(6)で表されるような方法に限らず、例えば、補正対象とする色領域を示す前記色相範囲ΔH(k,l)および補正対象とする色の代表色HR(k,l)および任意の定数を用いて非線形に変化するように設定する方法などが例示される。
このように、ステップS1008において補正対象とする色領域の重みをつける理由として、後述する色補間を行う場合に、補正対象とする色相領域内外で色の連続性が破綻するのを防ぐことが挙げられる。
However, the method of setting the weight of the hue area to be corrected is not limited to the method represented by the equation (6), and for example, the hue range ΔH (k, l) indicating the color area to be corrected is used. Further, a method of setting the color to be changed nonlinearly using the representative color H R (k, l) of the color to be corrected and an arbitrary constant is exemplified.
As described above, the reason why the color region to be corrected is weighted in step S1008 is to prevent the color continuity from breaking inside and outside the hue region to be corrected when performing color interpolation described later. It is done.

また、補正対象とする画素の彩度Cにおける重みWC(k,l)は、前記補正対象目標彩度CTおよびステップS1004で使用した無彩色の彩度を示す所定の値CTHにより、以下のように定める(式7)。 Further, the weight W C (k, l) in the saturation C of the pixel to be corrected is represented by the correction target target saturation CT and a predetermined value C TH indicating the saturation of the achromatic color used in step S1004. (Expression 7).

Figure 0004522229
Figure 0004522229

ただし、補正対象とする彩度領域の重みを設定する方法は、式(7)で表されるような方法に限らず、例えば、補正対象とする色の代表色の彩度CRおよび前記人肌領域を包含するような彩度範囲ΔC(k,l)を前記色相領域設定方法と同様な方法により求め、補正対象とする彩度領域の重みを設定方法なども挙げられる。
図7に戻って、次に、ステップS709において、前記入力画像における前記人肌領域の位置情報から、後述の色補正処理に用いる画像領域重みを設定する。
However, the method of setting the weight of the saturation region to be corrected is not limited to the method represented by the equation (7), and for example, the saturation C R of the representative color of the color to be corrected and the person A saturation range ΔC (k, l) that includes the skin region is obtained by the same method as the hue region setting method, and the weight of the saturation region to be corrected is set.
Returning to FIG. 7, next, in step S <b> 709, image area weights used for color correction processing described later are set from the position information of the human skin area in the input image.

本実施形態では、後述する色補正処理において、ステップS708により設定した特定色領域に対しての重みを利用して肌色などの所定の色に対してのみ色補正を行うことで、元々好ましい色であった画像中の他領域の色が不自然になる現象を回避している。しかしながら、補正対象として色領域のみを設定した場合、例えば補正入力画像において、前記人肌領域外にステップS708において設定される色領域に含まれる人肌以外の画素が存在すると、同画素は色補間の対象となってしまう。このような問題を解決する方法として、ステップS709で設定する画像領域重みを利用する。   In the present embodiment, in a color correction process described later, color correction is performed only for a predetermined color such as a skin color using a weight for the specific color area set in step S708, so that an originally preferable color is obtained. This avoids the phenomenon of unnatural colors in other areas of the image. However, when only the color area is set as the correction target, for example, in the corrected input image, if a pixel other than the human skin included in the color area set in step S708 exists outside the human skin area, the pixel is color-interpolated. It becomes the target of. As a method for solving such a problem, the image area weight set in step S709 is used.

前記画像領域重みは、前記人肌領域内の画素を色補正対象とし、前記人肌領域に含まれない画素は色補正対象外となるように0以上、1以下の値をWP(k,l,x,y)として設定する。このとき後述の色補正処理により前記人肌領域の境界付近で色の連続性が破綻するのを防ぐように、前記画像領域重みを設定することが望ましい。
前記画像領域重み設定方法は限定されるものではないが、前記人肌領域における重心を求め、重心からの各画素の距離に応じて重みをつける方法などが例示される。この設定方法を用いると、後述の色補正処理において、前記人肌領域の境界付近の画素は前記人肌領域の中心付近の画素に比べ補正量が小さくなり、前記人肌領域の境界付近で色の連続性が破綻するのを防ぐことができる。また、前記人肌領域にガウシアンフィルタなどによりローパス処理を行い、前記人肌領域の境界付近をぼかすことで、前記人肌領域内外での色の連続性の破綻を和らげる方法なども挙げられる。
Wherein the image region weight, the skin and the color correction target pixels in the region, the human skin is not included in the region pixel color correction excluded to become as 0 above, the value of 1 or less W P (k, l, x, y). At this time, it is desirable to set the image area weight so as to prevent color continuity from breaking near the boundary of the human skin area by a color correction process described later.
The image area weight setting method is not limited, and examples include a method of obtaining a centroid in the human skin area and assigning a weight according to the distance of each pixel from the centroid. When this setting method is used, in the color correction processing described later, the correction amount of pixels near the boundary of the human skin region is smaller than that of the pixel near the center of the human skin region, and the color near the boundary of the human skin region Can be prevented from failing. In addition, there is a method in which the human skin area is subjected to low-pass processing using a Gaussian filter or the like, and the vicinity of the boundary of the human skin area is blurred, thereby relieving the failure of color continuity inside and outside the human skin area.

(補正処理:S710)
次に、ステップS710において、先に求めた各領域補正情報にしたがって画像補正を行う。この処理について図11のフローチャートを用いて詳しく説明する。
(Correction process: S710)
Next, in step S710, image correction is performed according to each area correction information obtained previously. This process will be described in detail with reference to the flowchart of FIG.

まず、ステップS1101において、ステップS707で抽出されたk番目の画像領域に属する顔領域のデータを取得する。   First, in step S1101, face area data belonging to the kth image area extracted in step S707 is acquired.

ステップS1102からステップS1106はこの領域内の各画素についての処理のループを構成している。   Steps S1102 to S1106 constitute a processing loop for each pixel in this region.

ステップS1103において、色相補正処理を行う。まず補正対象の代表色における色相補正量Dh(j)を算出する。補正対象とする色の代表色における色相補正量は補正対象目標色相HTと補正対象とする色の代表色相HR(j)の差およびステップS707の補正係数設定処理において設定された前記色相補正係数PH(j)の積で表される(式(9))。次に、前記色相補正量DhにステップS9の色領域設定処理において設定した色相領域の重みWH(j)、彩度領域の重みWC(j)とステップS709の画像領域設定処理において設定した画像領域重みWP(j)をかけた分だけ、入力画像内の画素の色相を補正する(式(8))。ただし、式(8)においてHは前記色補正処理前の補正対象画素の色相、H′は前記色補正処理後の補正対象画素の色相を示す。 In step S1103, hue correction processing is performed. First, the hue correction amount Dh (j) for the representative color to be corrected is calculated. The hue correction amount in the representative color of the color to be corrected is the difference between the target hue H T to be corrected and the representative hue H R (j) of the color to be corrected, and the hue correction set in the correction coefficient setting process in step S707. It is expressed by the product of the coefficient P H (j) (formula (9)). Next, the hue correction amount Dh is set in the hue region weight W H (j) and saturation region weight W C (j) set in the color region setting process in step S9 and in the image region setting process in step S709. The hue of the pixel in the input image is corrected by the amount multiplied by the image area weight W P (j) (formula (8)). In Equation (8), H represents the hue of the pixel to be corrected before the color correction process, and H ′ represents the hue of the pixel to be corrected after the color correction process.

Figure 0004522229
Figure 0004522229

Figure 0004522229
Figure 0004522229

Figure 0004522229
Figure 0004522229

同様に、ステップS1104では、ステップS707の補正係数設定処理で得られた彩度補正係数Pc(j)から代表色における彩度補正率Kc(j)を算出し、前記彩度補正率KcにステップS708の色領域設定処理において設定した色相領域の重みWH(j)、彩度領域の重みWC(j)とステップS709の画像領域設定処理において設定した画像領域重みWP(j)および前記色補正処理前の補正対象画素の彩度Cをかけた分だけ、入力画像内の画素の彩度を補正する(式(11))。
前記彩度補正率Kcは式(12)のように、前記補正目標彩度CTおよび補正対象の代表彩度CR(j)の差と前記補正代表彩度CR(j)の比と前記補正彩度係数Pc(j)の積で表される。ただし、式(11)でC′は前記色補正処理後の補正対象画素の彩度を示す。
Similarly, in step S1104, the saturation correction factor Kc (j) for the representative color is calculated from the saturation correction factor Pc (j) obtained in the correction factor setting process in step S707, and the saturation correction factor Kc is set in step S1104. The hue area weight W H (j), the saturation area weight W C (j) set in the color area setting process of S708, the image area weight W P (j) set in the image area setting process of step S709, and the above-mentioned The saturation of the pixels in the input image is corrected by the amount corresponding to the saturation C of the correction target pixel before the color correction processing (Formula (11)).
The saturation correction rate Kc is expressed by the ratio of the difference between the corrected target saturation C T and the correction target representative saturation C R (j) and the corrected representative saturation C R (j) as shown in Expression (12). It is represented by the product of the corrected saturation coefficient Pc (j). In Equation (11), C ′ represents the saturation of the correction target pixel after the color correction process.

Figure 0004522229
Figure 0004522229

Figure 0004522229
Figure 0004522229

Figure 0004522229
Figure 0004522229

次に、ステップS1105の判定により、全ての画素について上記処理が終了したかどうかを判定し、終了した場合には補正処理は終了し、そうでない場合は、処理はステップS1102に戻る。
なお、補正対象の種別の判別の尤度が低い場合には、複数の定義済みの補正目標色から尤度に基づいて重みをつけて、新たな目標色を合成し、この合成目標色をもって判別候補とするようにしても良い。
Next, it is determined whether or not the above process has been completed for all the pixels based on the determination in step S1105. If completed, the correction process is terminated. If not, the process returns to step S1102.
When the likelihood of determining the type of correction target is low, a new target color is synthesized based on the likelihood based on the likelihood from a plurality of defined correction target colors, and the determination is made using this combined target color. You may make it a candidate.

目標色の合成方法の一例として、女性の目標彩度をCF男性の目標彩度CM、女性らしさの尤度をT、性別判定の確度が低いと判断される尤度をTL、性別判定の信頼度が全くないと判断される尤度をTI(TI<TL)とすると、目標彩度CTは次の式(14)で表される。 As an example of a target color synthesis method, the female target saturation is C F male target saturation C M , the femininity likelihood is T, the gender determination likelihood is T L , If the likelihood that there is no determination reliability is T I (T I <T L ), the target saturation C T is expressed by the following equation (14).

Figure 0004522229
Figure 0004522229

図12は男女の判別の女性らしさの尤度Tを横軸とし、目標色の一部である目標彩度(CT)を縦軸とし、その関係の一例を示したグラフである。女性らしさの尤度がTのとき、男性らしさは(1−T)として求められる。
図12の1−TL≦T≦1−TIの区間については、男性用と合成された目標色を用いた2つの補正案について、選択肢として提示する。また、TI≦T≦TLの区間では女性用と合成された目標色を用いたの2つの補正案について、図3のステップS304以降の処理を行い、ステップS306において選択肢として提示する。これらのように2つの補正案がある場合、合成された目標色は第2の補正案候補となるようにすることが望ましい。また、1−TI<T<TIの区間では合成された目標色のみを用いて補正案を作成し、ステップS306において選択肢として提示する。
FIG. 12 is a graph showing an example of the relationship between the femininity likelihood T of discrimination between male and female on the horizontal axis and the target saturation (C T ), which is a part of the target color, on the vertical axis. When the likelihood of femininity is T, the masculinity is calculated as (1-T).
In the section of 1−T L ≦ T ≦ 1−T I in FIG. 12, two correction proposals using target colors synthesized for men are presented as options. Further, in the section of T I ≦ T ≦ T L , two correction plans using the target color combined with those for women are processed after step S304 in FIG. 3 and presented as options in step S306. In the case where there are two correction proposals as described above, it is desirable that the combined target color is a second correction proposal candidate. Further, in the section of 1−T I <T <T I , a correction plan is created using only the synthesized target color and presented as an option in step S306.

これによって、領域判別が困難な場合であっても顔領域として適切な補正処理を行うことを補償することが出来る。また、ここで行う補正処理は、各領域種別候補について行うが、表示部209上で補正効果を確認するためのものであり、印刷する画像のような高い解像度は不要である。そのため、解像度を落とした画像を対象に行えばよい。また、本実施形態では説明のため、ステップS701からS713のループで各領域の各領域判別毎にすべての組み合わせについて集計処理を行うように構成したが、ユーザの指示によって表示部209に描画が必要になった補正方法だけをユーザの指示の後で処理してもよい。   As a result, even when it is difficult to discriminate the region, it is possible to compensate for appropriate correction processing as a face region. The correction processing performed here is performed for each region type candidate, but is for confirming the correction effect on the display unit 209, and does not require a high resolution like an image to be printed. For this reason, an image with a reduced resolution may be used as a target. Further, in the present embodiment, for the sake of explanation, it is configured that the totalization processing is performed for all combinations for each area determination in each loop in the loop of steps S701 to S713, but drawing on the display unit 209 is required according to a user instruction Only the correction method that has become may be processed after the user's instruction.

(補正方法の選択処理:S306)
以下に、図3のステップS306における補正方法選択の一例を詳細に示す。
(Correction method selection process: S306)
Hereinafter, an example of the correction method selection in step S306 in FIG. 3 will be described in detail.

図12の(a)は、本処理において表示部209に表示する選択ウインドウの一例である。1201は補正処理対象の画像の一例である。1202、1203は、ステップS301で検出された顔領域を示す領域カーソルである。それぞれの顔領域はその領域を判別した結果、最も尤度が高い種別の補正方法に従って肌色補正処理が行われている。ここで、領域カーソルのうちの1つを入力部208によってクリックすると領域カーソルが注目状態になり、補正対象の領域の外接多角形を表示し、補正の効果がおよぶ領域を確認することが出来る。   FIG. 12A shows an example of a selection window displayed on the display unit 209 in this process. 1201 is an example of an image to be corrected. Reference numerals 1202 and 1203 denote area cursors indicating the face areas detected in step S301. As a result of discriminating each face area, skin color correction processing is performed according to the type of correction method having the highest likelihood. Here, when one of the area cursors is clicked by the input unit 208, the area cursor becomes a focused state, the circumscribed polygon of the area to be corrected is displayed, and the area where the correction effect is exerted can be confirmed.

また、同領域をダブルクリックすると、この領域における現在の補正方法を提示し、補正方法を変更するために、図12の(b)のようなダイアログウインドウ1204が表示される。このウインドウの各部について説明する。   Further, when the same area is double-clicked, a dialog window 1204 as shown in FIG. 12B is displayed in order to present the current correction method in this area and change the correction method. Each part of this window will be described.

1205は領域判別内容である、1206は領域判別内容を変更するためのボタンであり、この領域を入力装置208によってクリックすると、図示しない他の尤度が所定の値より高かった領域種類の一覧が表示され、所望の領域種別を選択することができる。1207は効果の度合いを表示、設定するものである。左端が補正をかけない状態である。また、中黒の四角は現在の設定内容である。最も尤度の高い領域判別結果における補正量の場合を中心に強弱2段階に設定できる。所望の箇所をクリックすることによって、効果の度合いを設定することが出来る。1208はOKボタンであり、設定した内容にしたがって補正方法を更新し、ダイアログを閉じ、1201の画像に対して、補正を適用する。また、1209はキャンセルボタンであり、設定した内容を破棄してウインドウを閉じる。1201の画像の背景領域に配置されたOKボタン1210をクリックすることによってステップS306の処理を終了する。   Reference numeral 1205 denotes the area determination content, and 1206 denotes a button for changing the area determination content. When this area is clicked by the input device 208, a list of other area types whose likelihood is higher than a predetermined value is displayed. The desired area type can be selected. 1207 displays and sets the degree of effect. The left end is in a state where no correction is applied. The squares in the middle black are the current settings. It can be set in two levels of strength, centering on the correction amount in the region determination result with the highest likelihood. By clicking on a desired location, the degree of effect can be set. Reference numeral 1208 denotes an OK button, which updates the correction method according to the set contents, closes the dialog, and applies correction to the 1201 image. A cancel button 1209 discards the set contents and closes the window. By clicking an OK button 1210 arranged in the background area of the image 1201, the processing in step S306 is terminated.

<本実施形態の画像処理装置の他の具体的構成例>
図14は、本実施形態における画像処理装置の他の具体的構成例を示すブロック図である。上記実施形態と共通する部分には同じ番号を付与している。
<Another Specific Configuration Example of the Image Processing Apparatus of the Present Embodiment>
FIG. 14 is a block diagram illustrating another specific configuration example of the image processing apparatus according to the present embodiment. The same number is given to the part which is common in the said embodiment.

ブロック構成としては、ドライブインタフェース214にCD/DVDドライブ1101が接続されて、本実施形態のプログラムを記録したDVDまたはCDのような光ディスク215を追加しているところが上記実施形態と異なる。   The block configuration is different from the above embodiment in that a CD / DVD drive 1101 is connected to the drive interface 214 and an optical disc 215 such as a DVD or CD in which the program of this embodiment is recorded is added.

本実施形態のプログラムを記録した光ディスク215をCD/DVDドライブに挿入するとCPU201は記録媒体からプログラムを読み取って、RAM203に展開することで、上記実施形態と同様の処理を実現することができる。   When the optical disc 215 in which the program of the present embodiment is recorded is inserted into the CD / DVD drive, the CPU 201 reads the program from the recording medium and develops it in the RAM 203, thereby realizing the same processing as in the above embodiment.

なお、本実施形態では、肌色補正処理に関して詳細に説明したが、その他の補正方法としてガウシアンフィルタを適用してぼかしたり、輪郭強調フィルタをなどを行っても良い。ガウシアンフィルタを首、頬や目の周辺の肌色領域に適用することにより、見かけの年齢を若くすることが可能である。この場合は、顔の種類ごとに効果の度合いを定義しておき、ステップS709と同様な画像領域重み設定を適切に行って、領域内の各画素について、ガウシアンフィルタをかけた画像を重みにしたがってオリジナルの画像のLHCの各チャンネルごとに加重平均を求めればよい。このような空間的な補正は動画や携帯性の高いカメラのような解像度が低い画像で特に有効である。   In the present embodiment, the skin color correction process has been described in detail. However, as another correction method, a Gaussian filter may be applied to perform blurring, an edge enhancement filter, or the like. By applying the Gaussian filter to the skin color area around the neck, cheeks and eyes, the apparent age can be made younger. In this case, the degree of effect is defined for each type of face, and image area weight setting similar to that in step S709 is appropriately performed, and an image on which a Gaussian filter is applied according to the weight for each pixel in the area. A weighted average may be obtained for each LHC channel of the original image. Such spatial correction is particularly effective for low resolution images such as moving images and highly portable cameras.

<その他の実施形態>
顔領域を判別する際、顔の特徴量抽出に関しては、第1実施形態で示した方法に限定するものではない。例えば、ISO/IEC15938−3に規定されている、顔識別の特徴記述子を用いてもよい。また、判別器として、判別分析のほかに、ブースト法、カーネルトリックと組み合わせたサポートベクターマシン、ニューラルネットワークなどの手法を用いても良い。いずれも領域種別にトレーニング用の画像を用意してトレーニングすることで、所望の領域種別への判別が可能である。また、本実施形態では人物の肌色を好ましく補正する場合について説明したが、他の記憶色である空の青、草木の緑などを好ましく補正する場合についても適用できることはいうまでもない。
<Other embodiments>
When discriminating the face area, the feature extraction of the face is not limited to the method shown in the first embodiment. For example, a face identification feature descriptor defined in ISO / IEC 15938-3 may be used. Further, as a discriminator, in addition to discriminant analysis, a boost method, a support vector machine combined with a kernel trick, a neural network, or the like may be used. In any case, by preparing a training image for each area type and performing training, it is possible to determine the desired area type. In the present embodiment, the case where the skin color of a person is preferably corrected has been described. However, it is needless to say that the present invention can also be applied to a case where other memory colors such as sky blue and green of plants are preferably corrected.

また、本実施形態のプログラムコードを供給するための記憶媒体としては、例えば、フロッピディスク,ハードディスク,光ディスク,光磁気ディスク,CD、DVD,磁気テープ,不揮発性のメモリカード,ROMなどを用いることができる。   Further, as a storage medium for supplying the program code of this embodiment, for example, a floppy disk, a hard disk, an optical disk, a magneto-optical disk, a CD, a DVD, a magnetic tape, a nonvolatile memory card, a ROM, or the like is used. it can.

また、コンピュータが読出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているOS(オペレーティングシステム)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。   Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an OS (operating system) operating on the computer based on the instruction of the program code. It goes without saying that a case where the function of the above-described embodiment is realized by performing part or all of the actual processing and the processing is included.

さらに、記憶媒体から読出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。   Further, after the program code read from the storage medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function expansion is performed based on the instruction of the program code. It goes without saying that the CPU or the like provided in the board or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.

さらに、カメラやスキャナなどの画像入力装置やプリンタなどの画像出力装置、またこれらが複合または接続された装置において、両方またはいずれかの装置に備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。   Furthermore, in an image input device such as a camera or scanner, an image output device such as a printer, or a device in which these are combined or connected, a CPU or the like provided in both or any of the devices performs part or all of the actual processing. Needless to say, the process includes the case where the functions of the above-described embodiments are realized.

本実施形態の画像処理装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the image processing apparatus of this embodiment. 本実施形態のハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of this embodiment. 本実施形態の動作手順の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the operation | movement procedure of this embodiment. 図3の顔領域検出処理(S301)の手順例を示すフローチャートである。It is a flowchart which shows the example of a procedure of the face area | region detection process (S301) of FIG. 図3の顔領域検出処理の処理例を説明する図である。It is a figure explaining the process example of the face area | region detection process of FIG. 図3の顔領域判定処理(S303)の手順例を示すフローチャートである。It is a flowchart which shows the example of a procedure of the face area determination process (S303) of FIG. 図3の画像補正方法立案処理(S304)の手順例を示すフローチャートである。It is a flowchart which shows the example of a procedure of the image correction method planning process (S304) of FIG. 図7の領域代表色抽出処理(S705)の手順例を示すフローチャートである。It is a flowchart which shows the example of a procedure of the area | region representative color extraction process (S705) of FIG. 図7の領域代表色抽出処理の処理例を説明する図である。It is a figure explaining the process example of the area | region representative color extraction process of FIG. 図7の色領域設定処理(S708)の手順例を示すフローチャートである。FIG. 8 is a flowchart illustrating an exemplary procedure of color area setting processing (S708) in FIG. 7. FIG. 図7の補正処理(S710)の手順例を示すフローチャートである。It is a flowchart which shows the example of a procedure of the correction process (S710) of FIG. 本実施形態における目標色の追加及び合成方法を説明する図である。It is a figure explaining the addition and the synthesis | combination method of the target color in this embodiment. 図3の補正方法選択における画面表示の一例を示す図である。It is a figure which shows an example of the screen display in the correction method selection of FIG. 本実施形態の画像処理装置の他のハードウェア構成例を示す図である。It is a figure which shows the other hardware structural example of the image processing apparatus of this embodiment.

Claims (10)

画像情報を入力する画像入力手段と、
該画像入力手段から入力された画像情報に予め設定した対象が含まれるかどうかを検出し、検出した領域を設定する領域設定手段と、
該領域設定手段で設定された各領域について、領域の種別を判別し、該領域の種別とともに判別の確からしさを出力する領域判別手段と、
前記領域判別手段で判別された種別に基づいて、設定された各領域に対して画像補正を行う画像補正手段とを有し、
前記画像補正手段は、
前記領域設定手段が設定したいずれかの領域において前記領域判別手段が出力する判別の確からしさが所定の閾値に満たない場合に、画像補正方法の候補を立案する画像補正方法立案手段と、
補正する領域について補正方法を提示し、オペレータの指示を仰ぐ補正方法指示手段とを有し、
前記補正方法指示手段による指示内容に従って画像を補正することを特徴とする画像処理装置。
Image input means for inputting image information;
An area setting means for detecting whether or not a preset object is included in the image information input from the image input means, and setting the detected area;
For each area set by the area setting means, an area determination means for determining the type of the area, and outputting the probability of determination together with the type of the area;
Based on the type is determined by the area discriminating means, have a image correcting means for performing image correction for each area set,
The image correcting means includes
Image correction method planning means for planning image correction method candidates when the probability of determination output by the region determination means in any region set by the region setting means is less than a predetermined threshold;
A correction method for the region to be corrected, and a correction method instruction means for seeking an operator's instruction;
An image processing apparatus, wherein an image is corrected in accordance with an instruction content by the correction method instruction means .
前記予め設定した対象は人物の顔であることを特徴とする請求項1記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the preset target is a human face. 前記領域の種別は、前記領域内の人物の顔の性別、年齢、または、個人あるいは人類の生物学的分類のいずれかまたはその組み合わせであることを特徴とする請求項2記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the type of the region is any one or a combination of gender and age of a person's face in the region, or a biological classification of an individual or a human being. 前記画像補正は、特定空間領域中のうち特定色域に含まれる画素に対する明度、色相、彩度、シャープネス、ぼかし、のいずれかまたはその組み合わせの補正であることを特徴とする請求項1記載の画像処理装置。   2. The image correction according to claim 1, wherein the image correction is correction of any one or a combination of lightness, hue, saturation, sharpness, and blurring for pixels included in the specific color gamut in the specific space region. Image processing device. 前記補正方法指示手段は補正対象の画像を表示し、補正対象の領域の近辺に補正方法を指示するための操作釦を配置することを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。 The correcting method instruction means displays the image to be corrected, according to any one of claims 1 to 4, characterized in that placing the operation button for instructing the correction method in the vicinity of the correction target region Image processing apparatus. 前記補正方法指示手段は補正対象の画像を表示し、補正対象の領域が確認可能な外接多角形を表示することを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。 The correcting method instruction means displays the image to be corrected, the image processing apparatus according to any one of claims 1 to 5 area to be corrected and displaying the identifiable circumscribed polygon. 前記補正方法指示手段は補正のかかり具合を設定し、設定内容に従って表示中の補正対象画像へ反映させることを特徴とする請求項1乃至6のいずれか1に記載の画像処理装置。 The correcting method instruction unit sets the depth of the correction, the image processing apparatus according to any one of claims 1 to 6, characterized in that is reflected to the correction object image being displayed according to the settings. 画像処理装置における画像処理方法であって、
画像入力手段が、画像情報を入力する画像入力工程と、
領域設定手段が、該画像入力工程で入力された画像情報に予め設定した対象が含まれるかどうかを検出し、検出した領域を設定する領域設定工程と、
領域判別手段が、該領域設定工程で設定された各領域について、領域の種別を判別し、該領域の種別とともに判別の確からしさを出力する領域判別工程と、
画像補正手段が、該領域判別工程で判別された種別に基づいて、設定された各領域に対して画像補正を行う画像補正工程とを有し、
前記画像補正工程は、
画像補正方法立案手段が、前記領域設定工程で設定したいずれかの領域において前記領域判別工程で出力する判別の確からしさが所定の閾値に満たない場合に、画像補正方法の候補を立案する画像補正方法立案工程と、
補正方法指示手段が、補正する領域について補正方法を提示し、オペレータの指示を仰ぐ補正方法指示工程とを有し、
前記補正方法指示工程での指示内容に従って画像を補正することを特徴とする画像処理方法。
An image processing method in an image processing apparatus,
An image input step in which the image input means inputs image information;
An area setting step for detecting whether or not the preset object is included in the image information input in the image input process, and setting the detected area;
An area determination unit that determines an area type for each area set in the area setting step, and outputs an accuracy of determination together with the type of the area; and
Image correction means, based on the type discriminated by the region discrimination step, have a image correction step of performing image correction for each area set,
The image correction step includes
An image correction method for planning an image correction method candidate when the image correction method planning means does not satisfy a predetermined threshold in any of the regions set in the region setting step. A method planning process;
A correction method instructing means that presents a correction method for a region to be corrected and requests an operator's instruction;
An image processing method, wherein an image is corrected in accordance with an instruction content in the correction method instruction step .
請求項記載の画像処理方法の各工程をコンピュータ実行させるためのプログラム。 Program for executing the respective steps of the image processing method according to claim 8, wherein the computer. 請求項に記載のプログラムを記憶したコンピュータ読み取り可能記憶媒体。 Computer readable storage medium storing a program according to claim 9.
JP2004319497A 2004-11-02 2004-11-02 Image processing method and apparatus Expired - Fee Related JP4522229B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004319497A JP4522229B2 (en) 2004-11-02 2004-11-02 Image processing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004319497A JP4522229B2 (en) 2004-11-02 2004-11-02 Image processing method and apparatus

Publications (2)

Publication Number Publication Date
JP2006133873A JP2006133873A (en) 2006-05-25
JP4522229B2 true JP4522229B2 (en) 2010-08-11

Family

ID=36727401

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004319497A Expired - Fee Related JP4522229B2 (en) 2004-11-02 2004-11-02 Image processing method and apparatus

Country Status (1)

Country Link
JP (1) JP4522229B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010272109A (en) * 2009-04-20 2010-12-02 Fujifilm Corp Image processing system, image processing method, and program
JP5669489B2 (en) * 2009-10-15 2015-02-12 オリンパス株式会社 Image processing apparatus, image processing method, and image processing program
KR101715853B1 (en) * 2010-11-19 2017-03-13 엘지디스플레이 주식회사 Color gamut expansion method and unit, and wide color gamut display apparatus using the same
KR101715854B1 (en) * 2010-11-26 2017-03-13 엘지디스플레이 주식회사 Method and unit converting color temperature for improving emotional image quality and digital display apparatus using the same
CN105850146A (en) * 2013-12-31 2016-08-10 宇龙计算机通信科技(深圳)有限公司 Display method and terminal
JP7443745B2 (en) * 2019-12-17 2024-03-06 コニカミノルタ株式会社 Color conversion device, color conversion method and program

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10221773A (en) * 1997-02-06 1998-08-21 Fuji Photo Film Co Ltd Photograph producing device
JP2000261650A (en) * 1999-03-05 2000-09-22 Toshiba Corp Image processing unit
JP2001189862A (en) * 1999-12-28 2001-07-10 Canon Inc Image processing method and image processing device
JP2002259987A (en) * 2001-03-06 2002-09-13 Sony Corp Image processing device and method, storage medium and computer program
JP2003281525A (en) * 2002-03-19 2003-10-03 Fuji Xerox Co Ltd Image processor, image processing method and image processing program
JP2004246456A (en) * 2003-02-12 2004-09-02 Omron Corp Apparatus and method for image editing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10221773A (en) * 1997-02-06 1998-08-21 Fuji Photo Film Co Ltd Photograph producing device
JP2000261650A (en) * 1999-03-05 2000-09-22 Toshiba Corp Image processing unit
JP2001189862A (en) * 1999-12-28 2001-07-10 Canon Inc Image processing method and image processing device
JP2002259987A (en) * 2001-03-06 2002-09-13 Sony Corp Image processing device and method, storage medium and computer program
JP2003281525A (en) * 2002-03-19 2003-10-03 Fuji Xerox Co Ltd Image processor, image processing method and image processing program
JP2004246456A (en) * 2003-02-12 2004-09-02 Omron Corp Apparatus and method for image editing

Also Published As

Publication number Publication date
JP2006133873A (en) 2006-05-25

Similar Documents

Publication Publication Date Title
JP5205968B2 (en) Gradation correction method, gradation correction apparatus, gradation correction program, and image device
US7756343B2 (en) Image processing method, image processing apparatus, and computer-readable recording medium storing image processing program
JP4549352B2 (en) Image processing apparatus and method, and image processing program
US7565073B2 (en) Photography apparatus, photography method, and photography program for obtaining an image of a subject
US7580169B2 (en) Image processing apparatus and its method
US7751640B2 (en) Image processing method, image processing apparatus, and computer-readable recording medium storing image processing program
US11064174B2 (en) White balance processing method and apparatus
US7468812B2 (en) Image processing apparatus and its method for color correction
US20200137369A1 (en) White balance processing method and apparatus
US8248431B2 (en) Image processing apparatus, image processing method, program, and recording medium
JP2006303899A (en) Image processor, image processing system, and image processing program
JP2004214756A (en) Image noise reduction
US20130208994A1 (en) Image processing apparatus, image processing method, and recording medium
CN101983507A (en) Automatic redeye detection
JP2008527852A (en) White balance correction of digital camera images
CN108965646A (en) Image processing apparatus, image processing method and storage medium
JP4522229B2 (en) Image processing method and apparatus
JP2006019928A (en) Image processing method and image processor
JP2006133874A (en) Method and apparatus for processing image
JP4515964B2 (en) Image correction apparatus and method, and image correction program
JP2006203431A (en) Image processing apparatus and method of processing image
JP4822690B2 (en) Image processing method and apparatus, and print service system
JP2008147714A (en) Image processor and image processing method
JP4332474B2 (en) Image processing apparatus and method
JP2001014455A (en) Picture processing method, picture processor to be used for this and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071102

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20071102

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100202

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100215

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100416

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

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

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4522229

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130604

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees