JP2012175500A - Image processing method, control program, and image processing device - Google Patents

Image processing method, control program, and image processing device Download PDF

Info

Publication number
JP2012175500A
JP2012175500A JP2011036804A JP2011036804A JP2012175500A JP 2012175500 A JP2012175500 A JP 2012175500A JP 2011036804 A JP2011036804 A JP 2011036804A JP 2011036804 A JP2011036804 A JP 2011036804A JP 2012175500 A JP2012175500 A JP 2012175500A
Authority
JP
Japan
Prior art keywords
face
color
area
image
correction
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.)
Withdrawn
Application number
JP2011036804A
Other languages
Japanese (ja)
Inventor
Masatoshi Matsudaira
正年 松平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2011036804A priority Critical patent/JP2012175500A/en
Publication of JP2012175500A publication Critical patent/JP2012175500A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To perform correction processing more efficiently and obtain a good image quality, in an image processing method and device detecting a region corresponding to a human face from an image data and performing image correction processing.SOLUTION: A method includes: a face information acquisition step of acquiring face information added to image data as information for specifying a face region corresponding to a human face in an image represented by the image data; determination step of determining a need for face color correction based on a color of the face region specified by the face information; and correction step of performing the face color correction to the face region in the image depending on a result of the determination step. In the determination step, in the case that the color of the face region belongs to a first skin color region R1 that is preliminarily set as a region corresponding to a skin color in a color space, and also belongs to a second skin color region R2 that is included in the first skin color region and smaller than the first skin color region, it is determined that the correction step is unnecessary. On the other hand, in the case that the color of the face region belongs to the first skin color region in the color space and does not belong to the second skin color region, it is determined that the correction step is needed.

Description

この発明は、画像処理方法および画像処理装置に関するものであり、特に画像から人の顔に相当する領域を検出して画像補正処理を施す技術に関する。   The present invention relates to an image processing method and an image processing apparatus, and more particularly to a technique for performing image correction processing by detecting an area corresponding to a human face from an image.

被写体を撮影して画像データを生成するデジタルカメラや、該画像データを表示または印刷するプリンターなどの出力装置では、画像内に含まれる人の顔に相当する領域を検出し、該領域の画像に適宜の補正処理を行う機能を持つものが実用化されている。例えば、特許文献1に記載の技術においては、デジタルカメラ等の撮像装置側では撮影時に必要に応じて顔検出や赤目補正等の画像処理を実行し、どのような処理が実行されたかを示す情報を画像のExif(Exchangeable Image File Format)ファイルのタグに記録する。一方、当該画像ファイルを受け取って画像を印刷する印刷装置側では、補正処理が重複するのを避けるために、画像ファイルに付されたタグ情報を読み出して補正処理の要否判断を行い、必要と判断したときのみ画像に対する補正処理を実行するように構成されている。   In an output device such as a digital camera that shoots a subject and generates image data, or a printer that displays or prints the image data, an area corresponding to a human face included in the image is detected. Those having a function of performing appropriate correction processing have been put into practical use. For example, in the technique described in Patent Document 1, information indicating what processing has been performed by performing image processing such as face detection and red-eye correction as necessary at the time of shooting on the imaging device side such as a digital camera. Is recorded in a tag of an image Exif (Exchangeable Image File Format) file. On the other hand, the printing apparatus that receives the image file and prints the image reads the tag information attached to the image file to determine whether the correction process is necessary in order to avoid duplication of the correction process. Only when the determination is made, the correction processing for the image is executed.

特開2008−282278号公報(例えば、図12)Japanese Patent Laying-Open No. 2008-282278 (for example, FIG. 12)

デジタルカメラのような撮像装置においては、フォーカスや露出等の撮影条件を自動調整するために被撮影画像から顔認識を行う機能は既に広く普及しており、顔認識の結果としての画像内における顔領域を特定するための情報(ここでは「顔情報」と称する)を画像ファイルに付加することは技術的にさほど困難ではない。一方、上記した特許文献1に記載のシステムを構築するためには、画像ファイルに記録されている画像がどのような画像処理を施されたものであるかを明示するタグ情報が付されていなければならない。しかしながら、画像処理の内容としては種々のものがあり、これらをどのようにタグ情報で管理するのか、さらなる検討が必要である。   In an imaging device such as a digital camera, a function for performing face recognition from a captured image in order to automatically adjust shooting conditions such as focus and exposure is already widely used, and a face in an image as a result of face recognition. It is not technically difficult to add information for specifying a region (herein referred to as “face information”) to an image file. On the other hand, in order to construct the system described in Patent Document 1 described above, tag information that clearly indicates what kind of image processing the image recorded in the image file has been subjected to is attached. I must. However, there are various contents of the image processing, and further examination is required on how to manage them with tag information.

このように、上記従来技術は、例えば顔認識の結果としての顔情報のみが付された画像ファイルに対しては適用することができず、必要な補正を行えなかったり、補正が重複して実施されるなど、処理が非効率的となったり、所望の画像品質を得ることができなくなるなどの問題が残されている。   As described above, the above-described conventional technique cannot be applied to, for example, an image file to which only face information as a result of face recognition is attached, and necessary correction cannot be performed or correction is performed in duplicate. However, there are still problems such as inefficiency in processing and inability to obtain desired image quality.

この発明にかかるいくつかの態様は、画像データから人の顔に相当する領域を検出して画像補正処理を施す画像処理方法および装置において、上記課題を解決し、補正処理をより効率よく行うとともに良好な画像品質を得ることのできる技術を提供するものである。   Some embodiments according to the present invention provide an image processing method and apparatus for performing image correction processing by detecting a region corresponding to a human face from image data and performing the correction processing more efficiently. The present invention provides a technique capable of obtaining good image quality.

この発明の一の態様は、画像データが表す画像内における人の顔に相当する顔領域を特定するための情報として当該画像データに付加された顔情報を取得する顔情報取得工程と、前記顔情報により特定される前記顔領域の色に基づいて顔色補正の要否を判断する判断工程と、前記判断工程の結果に応じて、前記画像内の顔領域に対して顔色補正を行う補正工程とを備え、前記判断工程では、前記顔領域の色が、色空間において肌色に対応する領域として予め設定された第1肌色領域に属し、かつ、前記第1肌色領域内に含まれ前記第1肌色領域よりも狭い第2肌色領域に属する場合には前記補正工程を不要と判断する一方、前記顔領域の色が、色空間において前記第1肌色領域に属し、かつ、前記第2肌色領域に属さない場合には前記補正工程を必要と判断することを特徴とする画像処理方法である。   One aspect of the present invention is a face information acquisition step of acquiring face information added to image data as information for specifying a face area corresponding to a human face in an image represented by the image data; A determination step of determining whether or not face color correction is necessary based on the color of the face area specified by the information; and a correction step of performing face color correction on the face area in the image according to a result of the determination step; In the determination step, the color of the face region belongs to a first skin color region set in advance as a region corresponding to a skin color in a color space, and is included in the first skin color region and the first skin color When it belongs to a second skin color area that is narrower than the area, it is determined that the correction step is unnecessary, while the color of the face area belongs to the first skin color area and belongs to the second skin color area in a color space. If there is no such correction work An image processing method characterized by determining require.

また、この発明の他の態様は、上記各工程をコンピューターに実行させることを特徴とする制御プログラムである。   Another aspect of the present invention is a control program that causes a computer to execute the above steps.

これらの発明では、画像データに付加された顔情報により特定される顔領域の色によって顔色補正の要否を判断する。その判断基準は次の通りである。まず、色空間において肌色に対応する領域である第1肌色領域と、該第1肌色領域内に含まれ第1肌色領域よりも狭い第2肌色領域とが設定される。そして、当該顔領域の色が第2肌色領域に属する場合には顔色補正を行わず、当該顔領域の色が第1肌色領域に属し第2肌色領域には属さない場合には顔色補正を行う。その意味するところは以下の通りである。   In these inventions, the necessity of face color correction is determined based on the color of the face area specified by the face information added to the image data. The judgment criteria are as follows. First, a first skin color area that is an area corresponding to a skin color in the color space and a second skin color area that is included in the first skin color area and narrower than the first skin color area are set. Then, face color correction is not performed when the face area color belongs to the second skin color area, and face color correction is performed when the face area color belongs to the first skin color area and does not belong to the second skin color area. . The meaning is as follows.

第1肌色領域は、色空間において「肌色に対応する領域」であり、その意味するところは、該領域内の色であれば「肌色」と呼べる範疇にある、ということである。一方、第2肌色領域は、第1肌色領域内の限られた一部領域であり、この意味において、第1肌色領域に属する色を広義の肌色、そのうち第2肌色領域に属する色を狭義の肌色と考えることができる。   The first skin color region is a “region corresponding to the skin color” in the color space, and the meaning thereof is that the color within the region is in a category that can be called “skin color”. On the other hand, the second skin color region is a limited partial region in the first skin color region. In this sense, the color belonging to the first skin color region is defined in a broad sense, and the color belonging to the second skin color region is defined in a narrow sense. It can be considered skin color.

画像データに付加された顔情報から特定される顔領域が「肌色」の範疇にあるとき、当該領域が人の顔に相当するものである蓋然性が高いが、当該領域に対して既に何らかの補正がなされたか否かが不明な場合がある。本発明は、このような場合でも必要な補正処理を行い、かつ無用な補正処理を行うことを回避することができるように、色空間における肌色の範疇を補正が必要な領域と不要な領域とに区分している。   When the face area specified from the face information added to the image data is in the “skin color” category, there is a high probability that the area corresponds to a human face, but some correction has already been made to the area. It may not be clear whether it has been made or not. The present invention performs the necessary correction processing even in such a case, and avoids performing unnecessary correction processing. It is divided into.

すなわち、この発明では、その色が広義の肌色と言える第1肌色領域に属する顔領域については原則として顔色補正を実行する一方、その中でも狭義の肌色と言える第2肌色領域に属するものについては、上記原則によらず顔色補正を行わない。このように、単に顔領域が肌色であるか否かで補正の要否を判断するのではなく、言わば「補正が必要な肌色」と「補正が不要な肌色」とを区別可能な判断基準を設け、顔領域の色に該判断基準を適用して補正の要否を判断する。そして、第1肌色領域および第2肌色領域を適宜に設定することにより、この発明では、必要な補正処理を漏れなく行い、かつ無用な補正処理が行われることを回避して、補正処理をより効率よく行うとともに良好な画像品質を得ることができる。   That is, according to the present invention, face color correction is performed in principle for face areas belonging to the first skin color area whose color can be said to be a broad skin color, while among those belonging to the second skin color area which can be said to be a narrow skin color, Face color correction is not performed regardless of the above principle. In this way, rather than simply determining whether or not correction is necessary based on whether or not the face area is a skin color, a judgment criterion that can distinguish between “skin color that needs correction” and “skin color that does not need correction” is used. And determining whether correction is necessary by applying the determination criterion to the color of the face area. Then, by appropriately setting the first skin color region and the second skin color region, the present invention performs the necessary correction processing without omission and avoids unnecessary correction processing, thereby further improving the correction processing. It can be performed efficiently and good image quality can be obtained.

ここで、例えば、色空間のうち色相が予め定められた肌色範囲内である領域を第1肌色領域とする一方、第1肌色領域のうち明度が予め定められた適正範囲内にある領域を第2肌色領域とするようにしてもよい。顔色補正が必要となる代表的なケースとしては、逆光や露出不足等の原因により、被写体の顔色が暗く写ってしまったケースが挙げられる。このような場合、肌色であるが明度が十分でない顔領域があれば補正が必要となる一方、顔領域が肌色でしかも十分な明度があれば補正は不要である。色相が所定範囲にある領域を第1肌色領域とし、そのうち明度が適正とみなせる領域を第2肌色領域とすることで、このようなケースに好適に対応することが可能となる。   Here, for example, an area having a hue within a predetermined skin color range in the color space is set as the first skin color area, and an area having a lightness within the predetermined appropriate range is set as the first skin color area. Two skin color regions may be used. A typical case in which face color correction is necessary is a case where the face color of a subject appears dark due to backlight or underexposure. In such a case, correction is necessary if there is a face area that is flesh-colored but has insufficient brightness, while correction is not required if the face area is flesh-colored and has sufficient brightness. It is possible to appropriately cope with such a case by setting a region in which the hue is in a predetermined range as a first skin color region and a region in which lightness is considered appropriate as a second skin color region.

また、例えば、判断工程において顔領域の色が第1肌色領域外であったときには、人の顔に対応する所定の適合条件に適合する領域を画像内で検索し、該領域を顔領域として認識する顔認識処理工程を実行するようにしてもよい。顔情報で特定される顔領域が肌色でないケースとしては、撮像時の顔認識後に被写体またはカメラ等が動いたケースが考えられる。このような場合、画像データに付加された顔情報の信憑性は低いので、上記のように新たに顔認識処理を行うことが好ましい。また、例えば、画像データに顔情報が付加されていないときも同様であり、このような場合にも、新たに顔認識処理を行うことが好ましい。この場合において、顔認識処理工程において少なくとも一つの顔領域が認識された場合には顔色補正を実行するようにしてもよい。   Further, for example, when the color of the face area is outside the first skin color area in the determination step, an area that matches a predetermined matching condition corresponding to a human face is searched in the image, and the area is recognized as the face area. The face recognition processing step to be performed may be executed. As a case where the face area specified by the face information is not flesh-colored, a case where the subject or the camera moves after the face recognition at the time of imaging can be considered. In such a case, since the credibility of the face information added to the image data is low, it is preferable to newly perform face recognition processing as described above. Further, for example, the same applies when face information is not added to the image data. In such a case, it is preferable to newly perform face recognition processing. In this case, face color correction may be executed when at least one face area is recognized in the face recognition processing step.

なお、顔情報により特定される顔領域が画像内に複数あるときには、例えば、該複数の顔領域の色の平均値に基づき判断工程を実行するようにしてもよい。顔色補正が必要となる状況は当該画像に共通して生じるものであるから、個別の顔領域について補正の要否を判断するよりも、複数の顔領域について画像全体として補正を行うか否かを判断する方が良好な結果を得ることができ、処理に要する時間も短縮することができる。   When there are a plurality of face areas specified by the face information in the image, for example, the determination step may be executed based on an average value of the colors of the plurality of face areas. Since the situation where face color correction is required commonly occurs in the image, whether or not to correct the entire image for a plurality of face areas is determined rather than determining whether or not correction is necessary for individual face areas. A better result can be obtained by the determination, and the time required for the processing can also be shortened.

また、この発明の他の態様は、画像データが表す画像内における人の顔に相当する顔領域を特定するための情報として当該画像データに付加された顔情報を取得する顔情報取得手段と、前記顔情報により特定される前記顔領域の色に基づいて顔色補正の要否を判断する判断手段と、前記判断手段の判断結果に応じて、前記画像内の顔領域に対して顔色補正を行う補正手段とを備え、前記判断手段は、前記顔領域の色が、色空間において肌色に対応する領域として予め設定された第1肌色領域に属し、かつ、前記第1肌色領域内に含まれ前記第1肌色領域よりも狭い第2肌色領域に属する場合には前記補正手段に顔色補正を実行させない一方、前記顔領域の色が、色空間において前記第1肌色領域に属し、かつ、前記第2肌色領域に属さない場合には前記補正手段に顔色補正を実行させることを特徴とする画像処理装置である。   According to another aspect of the present invention, there is provided face information acquisition means for acquiring face information added to the image data as information for specifying a face area corresponding to a human face in the image represented by the image data, A determination unit that determines whether or not face color correction is necessary based on the color of the face area specified by the face information, and a face color correction is performed on the face area in the image according to the determination result of the determination unit Correction means, wherein the determination means belongs to a first skin color area that is preset as an area corresponding to the skin color in a color space, and is included in the first skin color area When it belongs to the second skin color area narrower than the first skin color area, the correction means does not execute face color correction, while the color of the face area belongs to the first skin color area in the color space, and the second When it does not belong to the skin color area An image processing apparatus, characterized in that to execute the complexion correction on the correction means to.

このように構成された発明では、上記した画像処理方法の発明と同様に、顔情報から特定される顔領域の色に応じて補正の要否を判断し、必要な顔色補正を行うことができるので、必要な補正処理を漏れなく行い、かつ無用な補正処理が行われることを回避して、補正処理をより効率よく行うとともに良好な画像品質を得ることが可能である。   In the invention configured as described above, similar to the above-described invention of the image processing method, it is possible to determine whether correction is necessary according to the color of the face area specified from the face information, and to perform necessary face color correction. Therefore, it is possible to perform necessary correction processing without omission, avoid unnecessary processing, and perform correction processing more efficiently and obtain good image quality.

本発明にかかる画像処理装置の一実施形態を用いた印刷システムを示す図。1 is a diagram illustrating a printing system using an embodiment of an image processing apparatus according to the present invention. デジタルカメラで作成される画像ファイルの一例を示す図。The figure which shows an example of the image file produced with a digital camera. 図2の部分拡大図。The elements on larger scale of FIG. 顔認識処理により認識された顔の一例を示す図。The figure which shows an example of the face recognized by the face recognition process. この印刷装置で実行される画像処理および印刷動作を示すフローチャート。3 is a flowchart showing image processing and printing operation executed by the printing apparatus. 顔領域の色に基づく顔色補正の要否判断の原理を示す図。The figure which shows the principle of the necessity judgment of the face color correction based on the color of a face area. HSB色空間による色表現の例を模式的に示す図。The figure which shows the example of the color expression by HSB color space typically.

図1は、本発明にかかる画像処理装置の一実施形態を用いた印刷システムを示す図である。この印刷システムは、デジタルカメラ200の撮影により取得された画像データを、メモリカードM、USB(Universal Serial Bus)ケーブルや無線LAN(Local Area Network)等によって印刷装置100に転送し、印刷装置100で印刷するものである。すなわち、ここではユーザーがデジタルカメラ200で画像を撮影して画像データを生成し、その画像データをそのまま印刷装置100で読み込んで印刷する、いわゆるダイレクト印刷を想定しているが、本発明を適用可能な印刷システムはこれに限定されるものではない。つまり、デジタルカメラ200で生成した画像データをパーソナルコンピューターや携帯電話などに取り込み、パーソナルコンピューターから印刷装置100に画像データを送信して印刷する印刷システムにも本発明を適用することが可能である。さらに、このような印刷装置100を備えるシステムに限定されず、画像データに対して種々の処理を施す画像処理装置全般に対して、本発明を適用可能である。   FIG. 1 is a diagram showing a printing system using an embodiment of an image processing apparatus according to the present invention. In this printing system, image data acquired by photographing with the digital camera 200 is transferred to the printing apparatus 100 by a memory card M, a USB (Universal Serial Bus) cable, a wireless LAN (Local Area Network), or the like. It is something to print. That is, here, it is assumed that the user captures an image with the digital camera 200, generates image data, reads the image data as it is with the printing apparatus 100, and prints it, so-called direct printing, but the present invention is applicable. The printing system is not limited to this. That is, the present invention can also be applied to a printing system that captures image data generated by the digital camera 200 into a personal computer or a mobile phone, and transmits the image data from the personal computer to the printing apparatus 100 for printing. Further, the present invention is not limited to a system including such a printing apparatus 100, and the present invention can be applied to all image processing apparatuses that perform various processes on image data.

デジタルカメラ200では、同図に示すように、CPU(Central Processing Unit)201、ROM(Read Only Memory)202、RAM(Random Access Memory)203、CCD(Charge Coupled Device)204、グラフィックプロセッサー(Graphic Processor;GP)205およびインターフェース(Interface;I/F)206がバス207を介して相互に接続され、これらの間で情報の授受が可能となっている。そして、CPU201はROM202に格納されているプログラムに応じて各種演算処理を実行しながらデジタルカメラ200の制御を行う。このとき一時的に必要となるデータはRAM203に格納される。また、CCD204は、光学系208によって集光された被写体からの光学像を電気信号に変換して出力する。この光学系208は、複数のレンズおよびアクチュエータによって構成されており、アクチュエータによってフォーカス等を調整しながら被写体の光学像を複数のレンズによってCCD204の受光面に結像する。さらに、GP205は、CPU201から供給される表示命令に基づいて表示用の画像処理を実行し、得られた表示用画像データを液晶ディスプレイ(Liquid Crystal Display;LCD)209に供給して表示させる。   In the digital camera 200, as shown in the figure, a CPU (Central Processing Unit) 201, a ROM (Read Only Memory) 202, a RAM (Random Access Memory) 203, a CCD (Charge Coupled Device) 204, a graphic processor (Graphic Processor; GP) 205 and interface (I / F) 206 are connected to each other via a bus 207, and information can be exchanged between them. The CPU 201 controls the digital camera 200 while executing various arithmetic processes in accordance with programs stored in the ROM 202. At this time, temporarily required data is stored in the RAM 203. The CCD 204 converts the optical image from the subject collected by the optical system 208 into an electrical signal and outputs the electrical signal. The optical system 208 is composed of a plurality of lenses and actuators, and forms an optical image of the subject on the light receiving surface of the CCD 204 with the plurality of lenses while adjusting the focus and the like with the actuators. Further, the GP 205 executes display image processing based on a display command supplied from the CPU 201, and supplies the obtained display image data to a liquid crystal display (LCD) 209 for display.

I/F206はデジタルカメラ200の入出力機能を提供するものであり、操作ボタン210、ジャイロセンサー211およびカードI/F回路212の間で情報を授受する際に、データの表現形式を適宜変換する装置である。I/F206に接続される操作ボタン210には、電源、モード切替え、シャッターなどのボタンや、各種機能を設定できる入力手段があり、これらによってユーザーはデジタルカメラ200を任意に制御して動作させることが可能となっている。また、ジャイロセンサー211はデジタルカメラ200によって被写体を撮影した際のカメラ本体の角度(水平面に対する角度)を示す信号を生成して出力する。デジタルカメラ200は、上記したカメラ本体の角度を含め、撮影時における種々の情報(例えば、露光、被写体等に関する情報)を生成する。   The I / F 206 provides an input / output function of the digital camera 200, and appropriately converts the data representation format when information is exchanged between the operation button 210, the gyro sensor 211, and the card I / F circuit 212. Device. The operation button 210 connected to the I / F 206 includes buttons such as a power source, a mode switch, and a shutter, and input means that can set various functions. With these, the user can arbitrarily control and operate the digital camera 200. Is possible. The gyro sensor 211 generates and outputs a signal indicating an angle of the camera body (an angle with respect to a horizontal plane) when the subject is photographed by the digital camera 200. The digital camera 200 generates various information (for example, information on exposure, subject, etc.) at the time of shooting, including the angle of the camera body described above.

なお、本実施形態では、デジタルカメラ200は、撮影情報をExif(Exchangeable Image File Format)情報に記載し、画像データに付加した画像ファイルを生成することができる構造となっている。このExif画像ファイルの構造は、基本的には通常のJPEG(Joint Photographic Experts Group)画像形式そのものであり、その中にサムネイル画像や撮影関連データ等のデータをJPEGの規約に準拠した形で埋め込んだものである。   In this embodiment, the digital camera 200 has a structure in which shooting information is described in Exif (Exchangeable Image File Format) information and an image file added to the image data can be generated. The structure of this Exif image file is basically the usual JPEG (Joint Photographic Experts Group) image format itself, in which data such as thumbnail images and shooting-related data are embedded in a form complying with the JPEG conventions. Is.

また、カードI/F回路212はカードスロット213に挿入されたメモリカードMとの間で情報を読み書きするためのインタフェースである。さらに、I/F206は図示を省略するUSB、無線LANなどの外部機器との接続機能も有しており、有線または無線にて印刷装置100との間で画像ファイルの授受が可能となっている。なお、デジタルカメラ200で作成され、印刷装置100に与えられる画像ファイル(画像データ+Exif情報)については、後で詳述する。   The card I / F circuit 212 is an interface for reading / writing information from / to the memory card M inserted in the card slot 213. Further, the I / F 206 also has a connection function with an external device such as a USB or wireless LAN (not shown), and can exchange image files with the printing apparatus 100 by wire or wirelessly. . The image file (image data + Exif information) created by the digital camera 200 and given to the printing apparatus 100 will be described in detail later.

印刷装置100はデジタルカメラ200で撮像された画像を印刷する装置であり、次のように構成されている。印刷装置100では、CPU101、ROM102、RAM103、EEPROM(Electrically Erasable and Programmable ROM)104、GP105およびI/F106がバス107を介して相互に接続され、これらの間で情報の授受が可能となっている。CPU101はROM102およびEEPROM104に格納されているプログラムに応じて各種演算処理を実行するとともに印刷装置100の各部を制御する。また、CPU101が実行対象とするプログラムやデータについてはRAM103に一時的に格納される一方、印刷装置の電源が切断された後も保持しておくデータ等についてはEEPROM104に格納される。さらに、CPU101は必要に応じてGP105に対して表示命令を与え、この表示命令に応じてGP105が表示用の画像処理を実行し、その処理結果をLCD108に供給して表示させる。   The printing apparatus 100 is an apparatus that prints an image captured by the digital camera 200, and is configured as follows. In the printing apparatus 100, a CPU 101, a ROM 102, a RAM 103, an EEPROM (Electrically Erasable and Programmable ROM) 104, a GP 105, and an I / F 106 are connected to each other via a bus 107, and information can be exchanged between them. . The CPU 101 executes various arithmetic processes according to programs stored in the ROM 102 and the EEPROM 104 and controls each unit of the printing apparatus 100. Further, programs and data to be executed by the CPU 101 are temporarily stored in the RAM 103, while data and the like that are retained even after the printing apparatus is turned off are stored in the EEPROM 104. Further, the CPU 101 gives a display command to the GP 105 as necessary, and the GP 105 executes display image processing according to the display command, and supplies the processing result to the LCD 108 for display.

I/F106は、操作ボタン109、カードI/F回路110およびプリンターエンジンコントローラー111の間で情報を授受する際に、データの表現形式を適宜変換する装置である。印刷装置100では、操作ボタン109は印刷装置100のメニュー選択等を行う時に押されるように構成されている。また、カードI/F回路110は、カードスロット112と接続されており、このカードスロット112に挿入されたメモリカードMからデジタルカメラ200によって生成された画像ファイルを読み出す。なお、I/F106は、図示を省略するUSB、無線LANなどの外部機器との接続機能も有しており、有線通信または無線通信にてデジタルカメラ200との間で画像ファイルの授受が可能となっている。   The I / F 106 is a device that appropriately converts the data representation format when information is exchanged among the operation buttons 109, the card I / F circuit 110, and the printer engine controller 111. In the printing apparatus 100, the operation button 109 is configured to be pressed when performing menu selection or the like of the printing apparatus 100. The card I / F circuit 110 is connected to the card slot 112 and reads an image file generated by the digital camera 200 from the memory card M inserted into the card slot 112. The I / F 106 also has a function of connecting to an external device such as a USB or wireless LAN (not shown), and can exchange image files with the digital camera 200 by wired communication or wireless communication. It has become.

そして、印刷装置100は、メモリカードMを介して、あるいはデータ通信により画像データを受け取ると、CPU101により種々の処理を行うとともにプリンターエンジンコントローラー111によりプリンターエンジン113を制御し、これによって画像データに対応する画像を印刷する。以下、図2ないし図4に基づき画像ファイルの構成を説明した上で、本実施形態における画像処理動作および印刷動作について詳述する。   When the printing apparatus 100 receives the image data via the memory card M or through data communication, the printing apparatus 100 performs various processes by the CPU 101 and controls the printer engine 113 by the printer engine controller 111, thereby corresponding to the image data. Print the image to be printed. Hereinafter, the configuration of the image file will be described with reference to FIGS. 2 to 4, and the image processing operation and the printing operation in the present embodiment will be described in detail.

図2は上記のように構成されたデジタルカメラで作成される画像ファイルの一例を示す図である。また、図3は図2の部分拡大図、図4は顔認識処理により認識された顔の一例を示す図である。この実施形態では、デジタルカメラ200はCCD204で撮像された画像データをRAM203に格納する。また、デジタルカメラ200は、被写体に人物が含まれているときには顔認識処理を行う(なお、顔認識方式については従来より数多く提案されており、それらのうちいずれの方式を採用してもよい)。なお、本実施形態では、顔認識結果は、図4に示すような座標情報が顔位置の情報、つまり顔情報として表現される。すなわち、同図に示すように、画像データは所定の画像幅(Width)と画像高さ(Height)の画素で構成されており、Xが横軸、Yが縦軸を表しており、左上が原点(0,0)である。そして、画像データから顔が検出されると、その顔領域FRを左上(LT)、左下(LB)、右上(RT)、右下(RB)の4点の座標で囲まれる領域で表し、顔領域FRを示す座標、つまり顔座標(顔位置)を、認識した顔の個数(つまり顔個数)NcとともにRAM203に格納する。本明細書では、後で説明するように、印刷装置100においてもデジタルカメラ200での顔認識と同様に顔認識を行って顔座標を求めるため、デジタルカメラ200での顔認識により得られる顔座標を「カメラ顔座標」と称し、左上(LTc)、左下(LBc)、右上(RBc)、右下(RBc)で示す。また、顔認識処理により複数個の顔が検出される場合もあるため、図3では、第n番目のカメラ顔座標を左上(LTnc)、左下(LBnc)、右上(RTnc)、右下(RBnc)で示す。   FIG. 2 is a diagram showing an example of an image file created by the digital camera configured as described above. 3 is a partially enlarged view of FIG. 2, and FIG. 4 is a diagram showing an example of a face recognized by face recognition processing. In this embodiment, the digital camera 200 stores image data captured by the CCD 204 in the RAM 203. The digital camera 200 performs face recognition processing when a person is included in the subject (note that many face recognition methods have been proposed in the past, and any of these methods may be employed). . In the present embodiment, in the face recognition result, coordinate information as shown in FIG. 4 is expressed as face position information, that is, face information. That is, as shown in the figure, the image data is composed of pixels of a predetermined image width (Width) and image height (Height), X represents the horizontal axis, Y represents the vertical axis, and the upper left is The origin is (0, 0). When a face is detected from the image data, the face area FR is represented by an area surrounded by the coordinates of the four points of upper left (LT), lower left (LB), upper right (RT), and lower right (RB). The coordinates indicating the region FR, that is, the face coordinates (face position) are stored in the RAM 203 together with the number of recognized faces (that is, the number of faces) Nc. In the present specification, as will be described later, the face coordinates obtained by the face recognition by the digital camera 200 are obtained because the face recognition is performed by the printing apparatus 100 in the same manner as the face recognition by the digital camera 200. Are referred to as “camera face coordinates” and are indicated by upper left (LTc), lower left (LBc), upper right (RBc), and lower right (RBc). In addition, since a plurality of faces may be detected by the face recognition process, in FIG. 3, the nth camera face coordinates are represented by upper left (LTnc), lower left (LBnc), upper right (RTnc), and lower right (RBnc). ).

また、この実施形態では、上記のように画像データ、顔個数および顔座標などをRAM203に格納しているが、その記録方式としてディジタルスチルカメラ用画像ファイルフォーマット規格Exif Ver.2.2.1を使用している。このExif画像ファイルの構造は、基本的には通常のJPEG(Joint Photographic Experts Group)画像形式そのものであり、その中にサムネイル画像や撮影関連データ等のデータをJPEGの規約に準拠した形で埋め込んだものである。   In this embodiment, the image data, the number of faces, the face coordinates, and the like are stored in the RAM 203 as described above, but the digital still camera image file format standard Exif Ver. 2.2.1 is used as the recording method. ing. The structure of this Exif image file is basically the usual JPEG (Joint Photographic Experts Group) image format itself, in which data such as thumbnail images and shooting-related data are embedded in a form complying with the JPEG conventions. Is.

本実施形態で使用する画像ファイルは、図2の左側部分に示すように、最初にSOI(Start of image)301がある。その後に、APP1(アプリケーション・マーカーセグメント)302、DQT(Define Quantization Table)303、DHT(Define Huffman Table)304の順となっている。さらにその後に、SOF(Start of Frame)305、SOS(Start of Stream)マーカー306、圧縮データ(Compress Data)307の順となっている。最後にEOI(End of Image)308がある。これらのうちAPP1はアプリケーションプログラムで使用するためのデータ領域として図2の中央部分に示す構造を有している。APP1の構造は、先頭にAPP1 Marker領域302aがある。そして、その次にLength領域302bがある。   The image file used in the present embodiment has an SOI (Start of image) 301 first, as shown in the left part of FIG. Thereafter, APP1 (application marker segment) 302, DQT (Define Quantization Table) 303, and DHT (Define Huffman Table) 304 are arranged in this order. After that, SOF (Start of Frame) 305, SOS (Start of Stream) marker 306, and compressed data (Compress Data) 307 are arranged in this order. Finally, there is an EOI (End of Image) 308. Of these, APP1 has a structure shown in the center of FIG. 2 as a data area for use in an application program. The APP1 structure has an APP1 Marker area 302a at the top. Next, there is a Length area 302b.

Length領域302bに続くデータの最初の6バイトの領域302cでは、識別子としてASCII文字の“Exif"が、その次に2バイトの0x00が続く。そこからTIFF(Tagged Image File Format)形式でデータが格納されている。TIFF形式の最初の8バイトはTIFFヘッダー(Header)領域302dである。   In the first 6-byte area 302c of the data following the Length area 302b, the ASCII character “Exif” is followed as an identifier followed by 2 bytes of 0x00. From there, data is stored in the TIFF (Tagged Image File Format) format. The first 8 bytes of the TIFF format are a TIFF header area 302d.

また、TIFFヘッダー領域302dの次の0th IFD(IFD of main image)領域302eに、同図の右側部分に示すように、画像幅、画像高さ等の画像関連情報(あるいは、単に画像情報とも呼ぶ)が格納される。そして、0th IFDの次に0th IFD Value領域302fがある。さらに、その次にExif IFD領域302gが設けられ、露出時間、Fナンバー、撮影シーンタイプなどの撮影関連情報(あるいは、単に撮影情報とも呼ぶ)が格納される。また、Exif IFD領域302gにExif IFD Value領域302hがある。なお、現在のところ、顔認識処理が実行されたか否かや、それにより検出される顔個数NcとNc個の顔座標をExifタグに書き込む規格は規定されていないが、本実施形態では、デジタルカメラ200側で顔認識処理が実行されたか否かを示す顔検出実施状況、顔個数NcなどがExif IFD領域302gに書き込まれ、Nc個の顔座標がExif IFD Value領域302hに書き込まれるとともに該書込位置をポイントする情報がExif IFD領域302gに書き込まれると仮定して説明を続ける。もちろん、これらの情報をメーカーに依存する領域に書き込むように構成してもよい。このように、顔位置(顔座標)の情報である顔情報はExif情報に記載され、画像データに添付されている。   Further, in the 0th IFD (IFD of main image) area 302e next to the TIFF header area 302d, as shown on the right side of the figure, image related information such as image width and image height (or simply referred to as image information). ) Is stored. Then, after the 0th IFD, there is a 0th IFD Value area 302f. Further, an Exif IFD area 302g is provided next, and shooting-related information (or simply referred to as shooting information) such as an exposure time, an F number, and a shooting scene type is stored. In addition, the Exif IFD value area 302h is in the Exif IFD area 302g. At present, there is no standard that specifies whether or not face recognition processing has been executed, and the number of faces detected by the face recognition process and Nc face coordinates in the Exif tag. The face detection implementation status indicating whether or not face recognition processing has been executed on the camera 200 side, the number of faces Nc, and the like are written in the Exif IFD area 302g, and Nc face coordinates are written in the Exif IFD Value area 302h. The description will be continued on the assumption that information pointing to the insertion position is written in the Exif IFD area 302g. Of course, the information may be written in an area depending on the manufacturer. As described above, the face information, which is information on the face position (face coordinates), is described in the Exif information and attached to the image data.

次に、上記のようなデータ構造(図2)を有する画像ファイルがメモリカードMに保存されており、そのメモリカードMから画像ファイルを読み出し、印刷装置100により画像ファイルに含まれる各種情報に基づき所定の画像処理を実行して印刷する動作の2つの実施形態について順に説明する。   Next, an image file having the above-described data structure (FIG. 2) is stored in the memory card M, and the image file is read from the memory card M, and based on various information included in the image file by the printing apparatus 100. Two embodiments of the operation of executing predetermined image processing and printing will be described in order.

図5は図1の印刷装置で実行される画像処理および印刷動作を示すフローチャートである。ユーザーが印刷装置100のカードスロット112にメモリカードMを挿入し、操作ボタン109を操作して印刷指令を与えると、CPU101がROM102に格納されているプログラムにしたがって装置各部を制御して以下の画像処理および印刷動作を実行する。   FIG. 5 is a flowchart showing image processing and printing operations executed by the printing apparatus of FIG. When the user inserts the memory card M into the card slot 112 of the printing apparatus 100 and operates the operation button 109 to give a print command, the CPU 101 controls each part of the apparatus according to the program stored in the ROM 102 to display the following image. Perform processing and printing operations.

まず、CPU101は、印刷の対象となる画像ファイルをメモリカードMから取得し、ハフマン解凍処理を実行し、量子化DCT(Discrete Cosine Transform)係数を得る(ステップS10)。より具体的には、CPU101は、メモリカードMから取得した画像ファイルからエントロピー符号化テーブルを取得し、圧縮データに含まれているY(輝度)成分、Cr(色差成分)、および、Cb(色差成分)のそれぞれのブロックのDC係数と、AC係数とを復号する。なお、この際、最小符号化単位であるMCU(Minimum Coded Unit)単位で復号を行う。   First, the CPU 101 acquires an image file to be printed from the memory card M, executes a Huffman decompression process, and obtains a quantized DCT (Discrete Cosine Transform) coefficient (step S10). More specifically, the CPU 101 acquires an entropy coding table from the image file acquired from the memory card M, and includes Y (luminance) component, Cr (color difference component), and Cb (color difference) included in the compressed data. The DC coefficient and the AC coefficient of each block of the component) are decoded. At this time, decoding is performed in units of MCU (Minimum Coded Unit) which is a minimum coding unit.

また、CPU101は、ステップS10において得られた量子化DCT係数を逆量子化する(ステップS11)。具体的には、CPU101は、画像ファイルから量子化テーブルを取得し、ステップS10において得られた量子化DCT係数に乗じることにより(逆量子化することにより)、DCT係数を得る。   Further, the CPU 101 inversely quantizes the quantized DCT coefficient obtained in step S10 (step S11). Specifically, the CPU 101 obtains a DCT coefficient by acquiring a quantization table from an image file and multiplying the quantized DCT coefficient obtained in step S10 (by inverse quantization).

次に、CPU101は、画像を回転させるために必要な情報(ローテート情報)を、例えばRAM103にキャッシュする(ステップS12)。具体的には、JPEG方式によって圧縮された画像を回転させる場合、MCUのDC成分(直流成分)とAC成分(交流成分)のそれぞれを一度ハフマン展開しなければならない。ここで、DC成分については隣接するDC成分値の差分をハフマン符号化することから、隣接するMCUとの相関関係が問題となる。また、AC成分ではハフマン符号化処理によりそのデータ長が各MCUで一定にならず、JPEGデータのビットストリーム中のどのデータが求めるMCUのAC成分値であるかが不明となることが問題となる。そこで、ステップS12では、各MCUのDC成分値とAC成分のアドレスを求めてキャッシュしておくことにより、ローテート処理を可能とする。   Next, the CPU 101 caches information (rotate information) necessary for rotating the image, for example, in the RAM 103 (step S12). Specifically, when rotating an image compressed by the JPEG method, each of the DC component (direct current component) and AC component (alternating current component) of the MCU must be expanded once. Here, with respect to the DC component, the difference between adjacent DC component values is Huffman-encoded, so the correlation with the adjacent MCU becomes a problem. In addition, the AC component has a problem that the data length is not constant in each MCU due to the Huffman coding process, and it becomes unclear which data in the bit stream of JPEG data is the AC component value of the MCU to be obtained. . Therefore, in step S12, the rotation process is enabled by obtaining and caching the DC component value and the AC component address of each MCU.

そして、CPU101はステップS11で得られたDCT係数に対して逆DCT演算を施すことによりもとの画素値を得る(ステップS13)。また、CPU101は、ステップS13の処理によって得られたYCC空間の画像をRGB(Red Green Blue)空間の画像と、HSB(Hue Saturation Brightness)空間の画像に変換する(ステップS14)。   Then, the CPU 101 obtains the original pixel value by performing an inverse DCT operation on the DCT coefficient obtained in step S11 (step S13). Further, the CPU 101 converts the image in the YCC space obtained by the process in step S13 into an image in the RGB (Red Green Blue) space and an image in the HSB (Hue Saturation Brightness) space (step S14).

そして、CPU101はステップS13およびステップS14の処理において得られたYCC,RGB,HSBのそれぞれの画像をRAM103に格納して保持する。なお、このとき、データ量を削減するために画素を所定の割合で間引きし画像を縮小した後にRAM103に格納してもよい(ステップS15)。ここでは、元の画像サイズに関わらず、QVGA(Quarter Video Graphics Array)サイズに相当する(320×240)ピクセルの画像に正規化するものとする。   Then, the CPU 101 stores and holds each image of YCC, RGB, and HSB obtained in the processing of step S13 and step S14 in the RAM 103. At this time, in order to reduce the data amount, the pixels may be thinned out at a predetermined rate to reduce the image, and then stored in the RAM 103 (step S15). Here, it is assumed that the image is normalized to an image of (320 × 240) pixels corresponding to a QVGA (Quarter Video Graphics Array) size regardless of the original image size.

また、CPU101は、ステップS15においてRAM103に格納されたYCC,RGB,HSBそれぞれの画像の成分について、ヒストグラムを計算する(ステップS16)。具体的には、RGB画像については、R,G,Bそれぞれの画像についてヒストグラムを計算する。その結果、画像を構成する各成分の分布を得る。   In addition, the CPU 101 calculates a histogram for each of the YCC, RGB, and HSB image components stored in the RAM 103 in step S15 (step S16). Specifically, for RGB images, histograms are calculated for R, G, and B images. As a result, the distribution of each component constituting the image is obtained.

上記したように、本実施形態では、ステップS10〜16の処理はMCU単位で行われており、CPU101は、全てのMCUについての処理が終了したことを確認するまで、ステップS10に戻って処理を繰り返して実行する。一方、全てのMCUについての処理が終了した場合には、次のステップS17に進み、顔認識処理の主要部に相当する処理を実行する。   As described above, in the present embodiment, the processing in steps S10 to S16 is performed in units of MCUs, and the CPU 101 returns to step S10 to perform processing until it is confirmed that the processing for all the MCUs has been completed. Run repeatedly. On the other hand, when the processing for all the MCUs is completed, the process proceeds to the next step S17, and processing corresponding to the main part of the face recognition processing is executed.

ステップS17では、メモリカードMから取得した画像ファイルのExifタグからカメラ側での顔認識処理に関する情報を読み出す(ステップS17)。具体的には、顔検出状況を読み出してカメラ側で顔認識処理が実施されたかどうかを判断し(ステップS18)、未実施(ステップS18においてNO)の場合は後述する顔認識処理を印刷装置100側で実施する(ステップS30)。カメラ200側で顔認識処理が実施済みである場合には(ステップS18においてYES)、さらにExifタグから把握されるカメラ側での顔検出個数Ncが0より大きな値であるかどうかを判断する(ステップS19)。顔検出個数Ncが0であるとき(ステップS19においてNO)、カメラ側で顔認識処理は実施されたが顔領域が検出されなかったことを意味する。したがってこの場合も印刷装置100側で改めて顔認識処理(ステップS30)を実施する。   In step S17, information related to face recognition processing on the camera side is read from the Exif tag of the image file acquired from the memory card M (step S17). Specifically, the face detection status is read out and it is determined whether or not the face recognition process has been performed on the camera side (step S18). (Step S30). If face recognition processing has already been performed on the camera 200 side (YES in step S18), it is further determined whether or not the face detection number Nc on the camera side ascertained from the Exif tag is a value greater than zero ( Step S19). When the face detection number Nc is 0 (NO in step S19), it means that face recognition processing has been performed on the camera side, but no face area has been detected. Therefore, also in this case, the face recognition process (step S30) is performed again on the printing apparatus 100 side.

一方、ステップS19においてYES、つまりカメラ側での顔認識処理において少なくとも1つの顔領域(カメラ顔領域)が検出されている場合には、それらの顔領域を表す顔座標をQVGAサイズに正規化し、320×240ドットに縮小された画像内での座標に変換する(ステップS20)。そして、該座標で特定されるQVGAサイズ画像内の各顔領域の色の平均値、すなわち平均顔色を当該領域に対応する画像データに基づいて算出する(ステップS21)。   On the other hand, if YES in step S19, that is, if at least one face area (camera face area) is detected in the face recognition process on the camera side, the face coordinates representing these face areas are normalized to the QVGA size, The coordinates in the image reduced to 320 × 240 dots are converted (step S20). Then, the average value of the color of each face area in the QVGA size image specified by the coordinates, that is, the average face color is calculated based on the image data corresponding to the area (step S21).

こうして求めた平均顔色に基づき、この実施形態では、顔色補正処理の要否判定を行う。この顔色補正処理は、例えば撮像時の逆光や露出不足に起因して画像に含まれる人の顔色が不自然に暗く写っている場合などに、これをより自然な顔色に補正するための処理である。このような補正処理はデジタルカメラなどの撮像装置または画像加工装置で実施されることも考えられ、そのような場合に印刷装置側で重複して補正を行ってしまうと却って不自然な結果となってしまう。したがって、カメラ側で補正済みの場合には印刷装置100側では補正を行わないようにする必要がある。   In this embodiment, the necessity determination of the face color correction process is performed based on the average face color thus obtained. This face color correction process is a process for correcting the face color to a more natural face color when, for example, the face color of a person included in the image appears unnaturally dark due to backlight or insufficient exposure during imaging. is there. Such correction processing may be performed by an imaging device such as a digital camera or an image processing device. In such a case, if correction is performed repeatedly on the printing device side, an unnatural result is obtained. End up. Therefore, when correction has been performed on the camera side, it is necessary not to perform correction on the printing apparatus 100 side.

画像ファイルから取得したExifタグ情報で顔認識処理が実施済みであることが把握された場合にこのことが問題となる。そこで、この実施形態では、カメラ側で顔認識処理が実施され、しかもその結果として顔領域が少なくとも1つ検出されている場合には、当該顔領域の色に応じて顔色補正の要否を判断する。具体的には以下のようにする。   This becomes a problem when it is determined that the face recognition processing has been performed with the Exif tag information acquired from the image file. Therefore, in this embodiment, when face recognition processing is performed on the camera side and at least one face area is detected as a result, whether or not face color correction is necessary is determined according to the color of the face area. To do. Specifically:

図6は顔領域の色に基づく顔色補正の要否判断の原理を示す図である。図6(a)に示すように、カメラ顔座標により四隅を特定される顔領域FRは、肌以外に例えば目や髪、影の部分を含み得るため、その全体が均一な肌色をしているというわけではない。そこで、顔領域FRを多数のブロック、例えば画素単位に細分化し、各ブロックごとにその色を画像データに基づいて算出し、全ブロックのうち「肌色」に属すると言えるブロックが占める比率が所定の閾値以上である場合に、当該顔領域を「肌色」であると言うことができる。そして、前記した平均顔色については、顔領域が1つだけである場合には、当該顔領域内の各ブロックの色を平均した色、または、当該顔領域内の各ブロックのうち肌色に属するブロックの色を平均した色とすることができる。また、顔領域が複数の場合には、各顔領域に含まれる全ブロックの色を平均した色、または、各顔領域内の各ブロックのうち肌色に属するブロックの色のみを抽出して平均した色とすることができる。   FIG. 6 is a diagram showing the principle of determining whether face color correction is necessary based on the color of the face area. As shown in FIG. 6A, the face area FR whose four corners are specified by the camera face coordinates can include, for example, eyes, hair, and shadows in addition to the skin, so that the whole has a uniform skin color. Not that. Therefore, the face area FR is subdivided into a large number of blocks, for example, pixels, and the color of each block is calculated based on the image data, and the ratio of blocks that can be said to belong to “skin color” out of all the blocks is predetermined. If it is equal to or greater than the threshold, it can be said that the face area is “skin color”. As for the above average face color, when there is only one face area, a color obtained by averaging the colors of the blocks in the face area, or a block belonging to the skin color among the blocks in the face area The average color can be used. In addition, when there are a plurality of face areas, the color obtained by averaging the colors of all the blocks included in each face area, or only the color of the block belonging to the skin color among the blocks in each face area is extracted and averaged. Can be color.

次に、こうして求めた平均顔色に基づいて、顔色補正の要否が判断される。図6(b)に示すように、平均顔色の色合いとその明るさとの組み合わせによって、顔色補正が必要か不要かが判断される。より具体的には、平均顔色がその色合いにおいて所定の「肌色」範囲にあり、かつその明るさが所定の「適正明るさ」範囲である、斜線を付した領域R1に属するとき、顔色補正が不要であると判断する。前記したように、顔色補正処理は、例えば撮像時の逆光や露出不足による不自然な顔色をより自然な顔色に補正するための処理である。したがって、顔領域が肌色でしかも既に適正な明るさであればさらなる補正は不要である。これにより、カメラ側での補正に重複して印刷装置側でも補正がなされることが回避される。   Next, the necessity of face color correction is determined based on the average face color thus obtained. As shown in FIG. 6B, it is determined whether facial color correction is necessary or not based on the combination of the average facial color shade and its brightness. More specifically, when the average face color is in a predetermined “skin color” range in the hue and the brightness is in the predetermined “appropriate brightness” range, the face color correction is performed. Judge that it is unnecessary. As described above, the face color correction process is a process for correcting, for example, an unnatural face color due to backlight or underexposure during imaging to a more natural face color. Therefore, if the face area is flesh-colored and already has an appropriate brightness, no further correction is necessary. As a result, it is avoided that correction is made on the printing apparatus side in duplicate with correction on the camera side.

また、顔領域の平均顔色が、その色合いは「肌色」範囲にあるが明るさが「適正明るさ」範囲外である、ドットによるハッチングを付した領域R2に属するとき、顔色補正が必要であると判断される。さらに、そもそも色合いが「肌色」でない無地の領域R3に平均顔色が属する場合には、カメラ顔座標が顔の位置を正しく表していない可能性が高い。このような状況が生じるケースとしては、カメラでの顔認識処理が主としてフォーカスや露出調整などの撮影条件の調整に使われることから、該調整から撮影までの間にカメラまたは被写体が動いてしまったケースが考えられる。したがってこのような場合には、顔認識処理自体を印刷装置100側で改めて実行する。   Further, when the average face color of the face area belongs to the area R2 that is hatched with dots, the hue of which is in the “skin color” range but the brightness is outside the “appropriate brightness” range, face color correction is required. It is judged. Furthermore, when the average face color belongs to the plain region R3 whose hue is not “skin color” in the first place, there is a high possibility that the camera face coordinates do not correctly represent the face position. As a case where this situation occurs, the camera or subject moved between the adjustment and shooting because face recognition processing with the camera is mainly used to adjust shooting conditions such as focus and exposure adjustment. Cases are considered. Therefore, in such a case, the face recognition process itself is executed again on the printing apparatus 100 side.

ここで、色を定量的に表す表現方法としては種々のものが知られており、この実施形態における色判定も任意の色表現の下で行うことができるが、ここでは人間の色覚と関連付けて肌色を指定しやすいHSB色空間で判定を行う場合について説明する。   Here, there are various known representation methods for expressing colors quantitatively, and color determination in this embodiment can also be performed under any color representation, but here it is associated with human color vision. A case where the determination is performed in the HSB color space in which the skin color can be easily specified will be described.

図7はHSB色空間による色表現の例を模式的に示す図である。図7(a)に示すように、H(Hue angle;色相)、S(Saturation;彩度)、B(Brightness;明度)の3種のパラメータで表されるHSB色空間では、H値において0°が赤色、60°が黄色に対応している。肌色に対応する色相は赤色と黄色との中間であり、例えば図7(b)に示すように、0°より大きく60°より小さい2つのH値H1およびH2(>H1)を予め定めておき、値H1およびH2をそれぞれ下限および上限とする角度範囲RH内の色相を「肌色」であるとすることができる。図7(b)の例では、HSB色空間においてドットによるハッチングを付した空間領域Z1内に属する色を「肌色」であるとみなす。   FIG. 7 is a diagram schematically showing an example of color expression in the HSB color space. As shown in FIG. 7A, in the HSB color space represented by three parameters of H (Hue angle), S (Saturation), and B (Brightness), the H value is 0. ° corresponds to red and 60 ° corresponds to yellow. The hue corresponding to the skin color is intermediate between red and yellow. For example, as shown in FIG. 7B, two H values H1 and H2 (> H1) larger than 0 ° and smaller than 60 ° are determined in advance. The hue within the angle range RH with the values H1 and H2 as the lower limit and the upper limit, respectively, can be defined as “skin color”. In the example of FIG. 7B, the color belonging to the space area Z1 hatched with dots in the HSB color space is regarded as “skin color”.

さらに、色の明るさを示す明度B値によって、「適正明るさ範囲」を指定する。すなわち、明るさが顔色として適正とみなせる明度の下限値B1および上限値B2(>B1)を設定し、前記した肌色に対応する空間領域Z1内で明度B値がこの範囲にある斜線で示す空間領域Z2内に属する色を、適正な明るさを有する肌色とすることができる。そして、平均顔色がHSB色空間において空間領域Z2に属する場合には顔色補正不要、空間領域Z1に属するが空間領域Z2に属さない場合には顔色補正不要、空間領域Z1にも属さない場合には顔認識処理が必要であると判断する。   Further, the “appropriate brightness range” is designated by the brightness B value indicating the brightness of the color. That is, a lower limit value B1 and an upper limit value B2 (> B1) of brightness that allow brightness to be considered appropriate as a face color are set, and a space indicated by diagonal lines within which the brightness B value is within this range in the space area Z1 corresponding to the skin color. The color belonging to the area Z2 can be a skin color having appropriate brightness. When the average face color belongs to the spatial area Z2 in the HSB color space, the face color correction is unnecessary. When the average face color belongs to the spatial area Z1 but does not belong to the spatial area Z2, the face color correction is unnecessary. It is determined that face recognition processing is necessary.

また、図7(c)に斜線で示す領域Z3のように、H値、S値、B値の三者の組み合わせによって「肌色」および「明るさ」を定義してもよい。すなわち、平均顔色のH値、S値、B値の組み合わせが所定の条件を満たす色空間内の領域Z3に属するとき、平均顔色が補正不要な「適正な肌色」であると判断するようにしてもよい。肌色とみなす範囲および明るさが適正とみなす範囲については適宜定めることができる。他の色表現法を用いた場合においても同様にすることができる。   Further, as shown by a hatched area Z3 in FIG. 7C, “skin color” and “brightness” may be defined by a combination of the H value, the S value, and the B value. That is, when the combination of the H value, S value, and B value of the average face color belongs to the region Z3 in the color space that satisfies the predetermined condition, it is determined that the average face color is an “appropriate skin color” that does not require correction. Also good. The range regarded as skin color and the range regarded as appropriate in brightness can be appropriately determined. The same can be done when other color expression methods are used.

図5のフローチャートに即して説明すると、ステップS22において平均顔色の色合いが肌色であるか否かが判断され、肌色であるとき、さらにステップS23において適正な明るさを有しているか否かが判断される。これにより、顔色補正の要否が判断される。平均顔色が肌色かつ適正明るさ範囲内であれば(ステップS22、S23においてともにYES)、顔色補正が不要であるとして、後工程でのエンハンス処理を行わないこととする(ステップS24)。また、平均顔色が肌色であるが適正明るさ範囲内でなかった場合には(ステップS22においてYESかつステップS23においてNO)、顔色補正が必要であるとして、ステップS42に進む。平均顔色が肌色でなければ(ステップS22においてNO)、次の顔検出工程(ステップS30)に進む。   Referring to the flowchart of FIG. 5, it is determined in step S22 whether or not the average face color is a flesh color. To be judged. Thereby, the necessity of face color correction is determined. If the average face color is within the skin color and appropriate brightness range (both YES in steps S22 and S23), it is determined that face color correction is not necessary, and the enhancement process in the subsequent process is not performed (step S24). If the average face color is skin color but not within the appropriate brightness range (YES in step S22 and NO in step S23), it is determined that face color correction is necessary, and the process proceeds to step S42. If the average face color is not a skin color (NO in step S22), the process proceeds to the next face detection step (step S30).

ステップS30では、QVGAサイズに縮小保持した画像データを用いて、当該画像内から所定の条件を満たす顔領域の検出を行う。画像から顔とみなせる領域を検出する技術としては種々のものが公知であり、ここでの顔検出にも任意の技術を適用することができるので、ここでは詳しい説明を省略する。画像内で顔領域が検出されると、当該顔領域の4つの頂点座標を例えばRAM103に設けた顔登録リストに登録する。   In step S30, a face area satisfying a predetermined condition is detected from the image using the image data reduced and held in the QVGA size. Various techniques for detecting a region that can be regarded as a face from an image are known, and any technique can be applied to the face detection here, so a detailed description is omitted here. When a face area is detected in the image, the four vertex coordinates of the face area are registered in a face registration list provided in the RAM 103, for example.

こうして、印刷装置100による顔検出が行われると、次のステップS40では、CPU101は顔登録リストに顔情報が登録されている否かを判別する。そして、顔情報が登録されている場合(ステップS40で「YES」)には、CPU101は、顔登録リストに登録された顔情報に基づいて全ての顔位置を計算し、さらに顔の平均顔色を取得した(ステップS41)後、顔色が最適になるようにエンハンスパラメータを計算する(ステップS42)。なお、エンハンスパラメータ計算の詳細については省略するが、RAM103に記憶したRGBヒストグラムに基づきコントラスト、明度、彩度、シャープネスなどの各画質パラメータの特徴量を抽出し、抽出した特徴量が所定の画質パラメータの特徴量に近づくようエンハンスのパラメータを設定する。   When face detection is performed by the printing apparatus 100 in this way, in the next step S40, the CPU 101 determines whether face information is registered in the face registration list. If face information is registered (“YES” in step S40), the CPU 101 calculates all face positions based on the face information registered in the face registration list, and further calculates the average face color of the face. After the acquisition (step S41), enhancement parameters are calculated so that the face color is optimal (step S42). Although details of the enhancement parameter calculation are omitted, feature amounts of each image quality parameter such as contrast, brightness, saturation, and sharpness are extracted based on the RGB histogram stored in the RAM 103, and the extracted feature amount is a predetermined image quality parameter. Set the enhancement parameters to approach the feature amount.

また、ステップS23においてNOと判断された場合、つまり、カメラ側で検出された顔領域の平均顔色が肌色であるが適正明るさでない場合にもステップS42を実行する。これは、ステップS21において顔領域の平均顔色が既に算出されており、ステップS41を実行する必要がないからである。   Also, if NO is determined in step S23, that is, if the average face color of the face area detected on the camera side is a skin color but not an appropriate brightness, step S42 is also executed. This is because the average face color of the face area has already been calculated in step S21, and it is not necessary to execute step S41.

こうしてステップS42が実行されることにより、デジタルカメラ200で検出された顔領域、もしくは印刷装置100で検出された顔領域に対して、必要なエンハンスパラメータが算出される。このステップS42は、カメラ側で検出された顔領域が印刷装置100側で補正不要と判断された場合にはスキップされる。   By executing step S42 in this way, necessary enhancement parameters are calculated for the face area detected by the digital camera 200 or the face area detected by the printing apparatus 100. This step S42 is skipped when it is determined that the face area detected on the camera side does not require correction on the printing apparatus 100 side.

一方、顔登録リストに顔情報が登録されていない場合(ステップS40で「NO」)、つまり当該画像内で人の顔が検出されなかった場合には、CPU101は画像全体が最適になるようにエンハンスパラメータを計算する(ステップS43)。   On the other hand, when face information is not registered in the face registration list (“NO” in step S40), that is, when a human face is not detected in the image, the CPU 101 optimizes the entire image. An enhancement parameter is calculated (step S43).

続いて、CPU101は、印刷対象となる画像ファイルにおいて、解凍処理の対象となる位置を示すファイルポインタをリセットし(ステップS44)、処理位置を画像ファイルの先頭に復元する。そして、CPU101は、以下のステップS45〜S52を繰り返して画像データに基づいて画像を印刷する。   Subsequently, the CPU 101 resets the file pointer indicating the position to be decompressed in the image file to be printed (step S44), and restores the processing position to the top of the image file. The CPU 101 prints an image based on the image data by repeating the following steps S45 to S52.

CPU101は、RAM103にキャッシュされた1MCUライン分の画像データにハフマン解凍処理を施し、量子化DCT係数を得る(ステップS45)。ここで、1MCUラインとは、画像を回転させる場合には、画像を構成する列方向に1列のMCU群をいい、回転させない場合には、画像を構成する行方向に1列のMCU群をいう。そして、CPU101は、ステップS45の処理において得られた量子化DCT係数を逆量子化し(ステップS46)、さらにステップS45で得られたDCT係数に対して逆DCT演算を施すことによりもとのデータを得る(ステップS47)。   The CPU 101 performs Huffman decompression processing on the image data for one MCU line cached in the RAM 103 to obtain quantized DCT coefficients (step S45). Here, one MCU line means an MCU group of one column in the column direction constituting the image when rotating the image, and an MCU group of one column in the row direction constituting the image when not rotating. Say. Then, the CPU 101 inversely quantizes the quantized DCT coefficient obtained in the process of step S45 (step S46), and further performs an inverse DCT operation on the DCT coefficient obtained in step S45. Obtain (step S47).

こうして得られたYCC空間の画像を、CPU101はRGB空間の画像に変換する(ステップS48)。そして、CPU101は、RGB空間の画像を構成する各画素に対してステップS42またはS43において算出したエンハンスパラメータを適用することにより、印刷される画像を最適な色合いに補正し(ステップS49)、次のステップS50に進む。補正不要と判断されている場合にはエンハンスパラメータが設定されておらず当然に補正は行われない。   The CPU 101 converts the YCC space image thus obtained into an RGB space image (step S48). Then, the CPU 101 applies the enhancement parameter calculated in step S42 or S43 to each pixel constituting the RGB space image, thereby correcting the printed image to an optimum hue (step S49). Proceed to step S50. If it is determined that correction is not necessary, the enhancement parameter is not set and the correction is naturally not performed.

CPU101は、こうして必要に応じ補正された画像データに対して、リサイズ、回転などのレイアウト処理を施し(ステップS50)、プリンターエンジンコントローラー111の図示せぬバンドバッファに供給する。これを受けたプリンターエンジンコントローラー111は、プリンターエンジン113の各部を制御して画像データに対応する画像を印刷する(ステップS51)。そして、印刷処理が完了すると、CPU101はRAM103のキャッシュ状態を更新する(ステップS52)。そして、全MCUライン分について上記ステップS45〜S52が完了すると、一連の処理を終了する。   The CPU 101 performs layout processing such as resizing and rotation on the image data corrected as necessary in this way (step S50), and supplies it to a band buffer (not shown) of the printer engine controller 111. Receiving this, the printer engine controller 111 controls each part of the printer engine 113 to print an image corresponding to the image data (step S51). When the printing process is completed, the CPU 101 updates the cache state of the RAM 103 (step S52). Then, when the above steps S45 to S52 are completed for all the MCU lines, a series of processing is ended.

以上のように、本実施形態によれば、デジタルカメラ200で顔認識処理が行われた場合には、その旨を示す情報がExif画像ファイルのタグ情報として記録される。そして、印刷装置100では、画像ファイルに付されたタグ情報からカメラ側で顔検出が行われたか否かを判断し、顔検出が行われていた場合には、カメラ側で検出された顔領域の色に基づいて顔色補正の要否を判断する。具体的には、顔領域の色が適正な明るさの肌色である場合には顔色補正を行わず、肌色であるが明るさが適正範囲にないときには顔色補正を実行する。こうすることで、カメラ側で顔色補正が実行された画像に対し二重に補正を実行してしまうことが回避され、二重の補正に起因する画像の仕上がりの不自然さや不必要な処理が実行される無駄を解消して、効率よくしかも画像品質の良好な補正処理を行うことができる。   As described above, according to the present embodiment, when face recognition processing is performed by the digital camera 200, information indicating that fact is recorded as tag information of the Exif image file. Then, the printing apparatus 100 determines whether or not face detection has been performed on the camera side from the tag information attached to the image file. If face detection has been performed, the face area detected on the camera side is determined. The necessity of face color correction is determined based on the color. Specifically, face color correction is not performed when the color of the face area is a skin color having an appropriate brightness, and face color correction is executed when the color is the skin color but the brightness is not within an appropriate range. By doing so, it is possible to avoid performing double correction on the image on which the face color correction has been performed on the camera side, and unnatural or unnecessary processing of the image resulting from the double correction. It is possible to eliminate the waste that is performed and to perform correction processing efficiently and with good image quality.

さらに、カメラ側で顔検出が実施されていない、または、顔領域とされた領域が肌色でなかった場合には、印刷装置100側で顔検出を行い、顔領域が検出された場合には必要な顔色補正処理を実行する。こうすることで、カメラ側で顔検出がなされていない、もしくは顔領域が正しく特定されていなかった場合であっても、画像に対し適切な顔色補正を施すことができる。   Further, when face detection is not performed on the camera side, or the face area is not skin color, it is necessary when face detection is performed on the printing apparatus 100 side and the face area is detected. The correct face color correction process. In this way, even if face detection is not performed on the camera side or the face area is not correctly specified, appropriate face color correction can be performed on the image.

以上説明したように、上記実施形態の印刷システムにおいては、印刷装置100が本発明の「画像処理装置」として機能しており、CPU101が所定の制御プログラムを実行することにより、本発明の「判断手段」および「補正手段」としての機能を果たしている。また、この実施形態の画像処理動作(図5)においては、ステップS17が本発明の「顔情報取得工程」に相当し、ステップS18〜S23が本発明の「判断工程」に相当している。また、ステップS42、S43、S49が本発明の「補正工程」に相当し、ステップS30が本発明の「顔認識処理工程」に相当している。   As described above, in the printing system of the above-described embodiment, the printing apparatus 100 functions as the “image processing apparatus” of the present invention, and the CPU 101 executes a predetermined control program, so Means ”and“ correction means ”. In the image processing operation of this embodiment (FIG. 5), step S17 corresponds to the “face information acquisition process” of the present invention, and steps S18 to S23 correspond to the “judgment process” of the present invention. Steps S42, S43, and S49 correspond to the “correction step” of the present invention, and step S30 corresponds to the “face recognition processing step” of the present invention.

また、本実施形態では、図6(b)における領域R1および図7(b)における空間領域Z1が本発明の「第1肌色領域」に相当している一方、図6(b)における領域R2、図7(b)における空間領域Z2および図7(c)における空間領域Z3が、本発明の「第2肌色領域」に相当している。   In the present embodiment, the region R1 in FIG. 6B and the space region Z1 in FIG. 7B correspond to the “first skin color region” of the present invention, while the region R2 in FIG. 6B. The space region Z2 in FIG. 7B and the space region Z3 in FIG. 7C correspond to the “second skin color region” of the present invention.

なお、本発明は上記した実施形態に限定されるものではなく、その趣旨を逸脱しない限りにおいて上述したもの以外に種々の変更を行うことが可能である。例えば、上記実施形態では、画像データに方向座標などを付加した画像ファイルをメモリカードMに記録し、当該メモリカードMを介して印刷装置100に供給して印刷しているが、有線または無線通信により画像ファイルが印刷装置100に供給される場合も、本発明を適用することで上記した実施形態と同様の作用効果が得られる。   The present invention is not limited to the above-described embodiment, and various modifications other than those described above can be made without departing from the spirit of the present invention. For example, in the above-described embodiment, an image file in which direction coordinates or the like are added to image data is recorded on the memory card M, supplied to the printing apparatus 100 via the memory card M, and printed. Even when the image file is supplied to the printing apparatus 100 by the above, the same effect as the above-described embodiment can be obtained by applying the present invention.

また、上記実施形態では、顔領域の色を定量的に表し肌色か否かを判定するのにHSB色空間内の座標位置を用いているが、別の色表現法、例えばxy色度図上における座標位置やLab色空間内の座標位置によって色を表現し、それらの平面または空間において肌色を定義し色判定を行うようにしてもよい。   In the above embodiment, the coordinate position in the HSB color space is used to quantitatively represent the color of the face area and determine whether it is a skin color. However, another color expression method, for example, on the xy chromaticity diagram, is used. The color may be expressed by the coordinate position at or the coordinate position in the Lab color space, and the skin color may be defined in those planes or spaces to perform color determination.

また、上記実施形態の印刷装置100では、画像ファイルに含まれたExifタグ情報のうちカメラ側での顔検出実施状況を示す情報に基づいて、印刷装置側での顔色補正や顔検出の要否を判断している。しかしながら、本発明を実施するに際して画像ファイルにカメラ側での顔検出実施状況を示す情報が含まれていることは必須ではなく、このような情報がなくても、例えば画像ファイルに有効なカメラ顔情報があるか否かで顔色補正や顔検出の要否を判断するようにしてもよい。また、画像ファイルはカメラで作成されたものに限定されず、例えばカメラで撮像された画像をパーソナルコンピューター等で編集してなる画像ファイルであってもよい。   Further, in the printing apparatus 100 according to the above-described embodiment, necessity of face color correction or face detection on the printing apparatus side based on information indicating the face detection implementation state on the camera side among the Exif tag information included in the image file. Judging. However, when implementing the present invention, it is not essential that the image file includes information indicating the face detection implementation status on the camera side. Even if such information is not included, for example, an effective camera face for the image file Whether or not face color correction or face detection is necessary may be determined based on whether or not there is information. The image file is not limited to the one created by the camera, and may be an image file obtained by editing an image captured by the camera with a personal computer or the like.

また、上記実施形態では、本発明にかかる画像処理装置および方法を印刷装置100に適用しているが、複数の電子機器から構成される印刷システムにも、また印刷装置以外の1つの電子機器(例えば複合機、ファクシミリ装置など)にも適用可能である。   In the above-described embodiment, the image processing apparatus and method according to the present invention are applied to the printing apparatus 100. However, in the printing system including a plurality of electronic apparatuses, one electronic apparatus other than the printing apparatus ( For example, the present invention can also be applied to a multifunction machine, a facsimile machine, and the like.

また、上記実施形態にかかる画像処理方法を実行する制御プログラムを、CD−ROM、光ディスク、光磁気ディスク、不揮発性メモリカードなどの記憶媒体に記憶させ、この記憶媒体からプログラムをコードとして読み出し、コンピューターにおいて実行してもよい。つまり、上記プログラムを記憶した記憶媒体、制御プログラム自体も本発明の一実施形態に含まれる。例えば、デジタルカメラで撮像された画像をパーソナルコンピューターもしくはワークステーション上で編集処理するためのアプリケーションソフトウェアにも、本発明を適用することが可能である。   In addition, a control program for executing the image processing method according to the above embodiment is stored in a storage medium such as a CD-ROM, an optical disk, a magneto-optical disk, and a nonvolatile memory card, and the program is read as a code from the storage medium. You may perform in. That is, the storage medium storing the program and the control program itself are also included in one embodiment of the present invention. For example, the present invention can be applied to application software for editing an image captured by a digital camera on a personal computer or a workstation.

100…印刷装置(画像処理装置)、 101…CPU(判断手段、補正手段)、 102…ROM、 103…RAM、 104…EEPROM、 106…インターフェース(顔情報取得手段)、 200…デジタルカメラ、 M…メモリカード   DESCRIPTION OF SYMBOLS 100 ... Printing apparatus (image processing apparatus) 101 ... CPU (judgment means, correction means), 102 ... ROM, 103 ... RAM, 104 ... EEPROM, 106 ... Interface (face information acquisition means), 200 ... Digital camera, M ... Memory card

Claims (8)

画像データが表す画像内における人の顔に相当する顔領域を特定するための情報として当該画像データに付加された顔情報を取得する顔情報取得工程と、
前記顔情報により特定される前記顔領域の色に基づいて顔色補正の要否を判断する判断工程と、
前記判断工程の結果に応じて、前記画像内の顔領域に対して顔色補正を行う補正工程と
を備え、
前記判断工程では、
前記顔領域の色が、色空間において肌色に対応する領域として予め設定された第1肌色領域に属し、かつ、前記第1肌色領域内に含まれ前記第1肌色領域よりも狭い第2肌色領域に属する場合には前記補正工程を不要と判断する一方、
前記顔領域の色が、色空間において前記第1肌色領域に属し、かつ、前記第2肌色領域に属さない場合には前記補正工程を必要と判断する
ことを特徴とする画像処理方法。
A face information acquisition step of acquiring face information added to the image data as information for specifying a face region corresponding to a human face in the image represented by the image data;
A determination step of determining whether or not face color correction is necessary based on the color of the face area specified by the face information;
A correction step of performing face color correction on the face area in the image according to the result of the determination step,
In the determination step,
A color of the face area belongs to a first skin color area set in advance as an area corresponding to a skin color in a color space, and is included in the first skin color area and is narrower than the first skin color area In the case of belonging to, while determining that the correction step is unnecessary,
An image processing method comprising: determining that the correction step is necessary when a color of the face region belongs to the first skin color region and does not belong to the second skin color region in a color space.
色空間のうち色相が予め定められた肌色範囲内である領域を前記第1肌色領域とする一方、前記第1肌色領域のうち明度が予め定められた適正範囲内にある領域を前記第2肌色領域とする請求項1に記載の画像処理方法。   An area in the color space whose hue is within a predetermined skin color range is defined as the first skin color area, and an area of the first skin color area in which the lightness is within a predetermined appropriate range is defined as the second skin color. The image processing method according to claim 1, wherein the region is an area. 前記判断工程において前記顔領域の色が前記第1肌色領域外であったときには、人の顔に対応する所定の適合条件に適合する領域を前記画像内で検索し、該領域を顔領域として認識する顔認識処理工程を実行する請求項1または2に記載の画像処理方法。   When the color of the face area is outside the first skin color area in the determination step, an area that matches a predetermined matching condition corresponding to a human face is searched in the image, and the area is recognized as the face area. The image processing method according to claim 1, wherein a face recognition processing step is performed. 前記画像データに前記顔情報が付加されていないときには、人の顔に対応する所定の適合条件に適合する領域を前記画像内で検索し、該領域を顔領域として認識する顔認識処理工程を実行する請求項1ないし3のいずれかに記載の画像処理方法。   When the face information is not added to the image data, a region that matches a predetermined matching condition corresponding to a person's face is searched in the image, and a face recognition processing step that recognizes the region as a face region is executed. The image processing method according to claim 1. 前記顔認識処理工程において少なくとも一つの顔領域が認識されると、前記補正工程を実行する請求項3または4に記載の画像処理方法。   The image processing method according to claim 3 or 4, wherein the correction step is executed when at least one face region is recognized in the face recognition processing step. 前記顔情報により特定される前記顔領域が前記画像内に複数あるとき、該複数の顔領域の色の平均値に基づき前記判断工程を実行する請求項1ないし5のいずれかに記載の画像処理方法。   6. The image processing according to claim 1, wherein when there are a plurality of face regions specified by the face information in the image, the determination step is executed based on an average value of colors of the plurality of face regions. Method. 画像データが表す画像内における人の顔に相当する顔領域を特定するための情報として当該画像データに付加された顔情報を取得する顔情報取得工程と、
前記顔情報により特定される前記顔領域の色に基づいて顔色補正の要否を判断する判断工程と、
前記判断工程の結果に応じて、前記画像内の顔領域に対して顔色補正を行う補正工程と
をコンピューターに実行させるとともに、
前記判断工程では、
前記顔領域の色が、色空間において肌色に対応する領域として予め設定された第1肌色領域に属し、かつ、前記第1肌色領域内に含まれ前記第1肌色領域よりも狭い第2肌色領域に属する場合には前記補正工程を不要と前記コンピュータに判断させる一方、
前記顔領域の色が、色空間において前記第1肌色領域に属し、かつ、前記第2肌色領域に属さない場合には前記補正工程を必要と前記コンピュータに判断させる
ことを特徴とする制御プログラム。
A face information acquisition step of acquiring face information added to the image data as information for specifying a face region corresponding to a human face in the image represented by the image data;
A determination step of determining whether or not face color correction is necessary based on the color of the face area specified by the face information;
According to the result of the determination step, the computer executes a correction step for performing face color correction on the face area in the image, and
In the determination step,
A color of the face area belongs to a first skin color area set in advance as an area corresponding to a skin color in a color space, and is included in the first skin color area and is narrower than the first skin color area While the computer determines that the correction step is unnecessary,
A control program that causes the computer to determine that the correction step is necessary when the color of the face region belongs to the first skin color region and does not belong to the second skin color region in a color space.
画像データが表す画像内における人の顔に相当する顔領域を特定するための情報として当該画像データに付加された顔情報を取得する顔情報取得手段と、
前記顔情報により特定される前記顔領域の色に基づいて顔色補正の要否を判断する判断手段と、
前記判断手段の判断結果に応じて、前記画像内の顔領域に対して顔色補正を行う補正手段と
を備え、
前記判断手段は、
前記顔領域の色が、色空間において肌色に対応する領域として予め設定された第1肌色領域に属し、かつ、前記第1肌色領域内に含まれ前記第1肌色領域よりも狭い第2肌色領域に属する場合には前記補正手段に顔色補正を実行させない一方、
前記顔領域の色が、色空間において前記第1肌色領域に属し、かつ、前記第2肌色領域に属さない場合には前記補正手段に顔色補正を実行させる
ことを特徴とする画像処理装置。
Face information acquisition means for acquiring face information added to the image data as information for specifying a face area corresponding to a human face in the image represented by the image data;
Determining means for determining whether or not face color correction is necessary based on the color of the face area specified by the face information;
Correction means for performing face color correction on the face area in the image according to the determination result of the determination means,
The determination means includes
A color of the face area belongs to a first skin color area set in advance as an area corresponding to a skin color in a color space, and is included in the first skin color area and is narrower than the first skin color area While the correction means does not execute the face color correction,
An image processing apparatus, wherein when the color of the face area belongs to the first skin color area and does not belong to the second skin color area in a color space, the correction unit performs face color correction.
JP2011036804A 2011-02-23 2011-02-23 Image processing method, control program, and image processing device Withdrawn JP2012175500A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011036804A JP2012175500A (en) 2011-02-23 2011-02-23 Image processing method, control program, and image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011036804A JP2012175500A (en) 2011-02-23 2011-02-23 Image processing method, control program, and image processing device

Publications (1)

Publication Number Publication Date
JP2012175500A true JP2012175500A (en) 2012-09-10

Family

ID=46977951

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011036804A Withdrawn JP2012175500A (en) 2011-02-23 2011-02-23 Image processing method, control program, and image processing device

Country Status (1)

Country Link
JP (1) JP2012175500A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017037615A (en) * 2015-08-13 2017-02-16 辰巳電子工業株式会社 Game imaging device, image processing method and program
JP2018037041A (en) * 2016-09-02 2018-03-08 富士通株式会社 Organism image processor, organism image processing method, and organism image processing program
CN111275725A (en) * 2020-03-18 2020-06-12 展讯通信(上海)有限公司 Method and device for determining color temperature and tone of image, storage medium and terminal

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017037615A (en) * 2015-08-13 2017-02-16 辰巳電子工業株式会社 Game imaging device, image processing method and program
JP2018037041A (en) * 2016-09-02 2018-03-08 富士通株式会社 Organism image processor, organism image processing method, and organism image processing program
CN111275725A (en) * 2020-03-18 2020-06-12 展讯通信(上海)有限公司 Method and device for determining color temperature and tone of image, storage medium and terminal
CN111275725B (en) * 2020-03-18 2022-08-19 展讯通信(上海)有限公司 Method and device for determining color temperature and tone of image, storage medium and terminal

Similar Documents

Publication Publication Date Title
US6987535B1 (en) Image processing apparatus, image processing method, and storage medium
JP4487775B2 (en) Panorama composition processing of multiple image data
JP5886265B2 (en) Portable terminal device, program, and recording medium
US20040041920A1 (en) Image forming method, image processing apparatus, and image recording apparatus
JP2015076782A (en) Image processing device, control method therefor, and control program
JP2009027385A (en) Image processor, its method and computer program
JP2012175500A (en) Image processing method, control program, and image processing device
JP5609555B2 (en) Image processing apparatus, program, and image processing method
JP5830851B2 (en) Image processing apparatus, image processing program, and image processing method
JP2001292449A (en) Image processing unit, image processing method, and recording medium
WO2022151054A1 (en) Image processing method and apparatus, and storage medium
US7609425B2 (en) Image data processing apparatus, method, storage medium and program
JP5644578B2 (en) Image processing apparatus, image processing method, and computer program for image processing
JP2008061209A (en) Image processing method
JP2000216985A (en) Digital watermark embedding device and method and recording medium for storing digital watermark embedding program and digital camera and method for controlling the same
JP2006279460A (en) Image processor, printer, image processing method, and image processing program
JP5500048B2 (en) Image processing method and image processing apparatus
JP4040528B2 (en) Image processing apparatus, image processing method, image processing program, recording medium storing image processing program, and image forming apparatus including image processing apparatus
JP2012146164A (en) Image processing method, control program and image processing system
JP4235592B2 (en) Image processing method and image processing apparatus
JP5625832B2 (en) Image processing apparatus and image processing method
JP2004328534A (en) Image forming method, image processing apparatus and image recording apparatus
JP5195317B2 (en) Camera device, photographing method, and photographing control program
JP2012099897A (en) Image processing method and image processing device
JP2008060623A (en) Electronic camera

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20140513