JP2012109896A - Image processing device and image processing method - Google Patents

Image processing device and image processing method Download PDF

Info

Publication number
JP2012109896A
JP2012109896A JP2010258644A JP2010258644A JP2012109896A JP 2012109896 A JP2012109896 A JP 2012109896A JP 2010258644 A JP2010258644 A JP 2010258644A JP 2010258644 A JP2010258644 A JP 2010258644A JP 2012109896 A JP2012109896 A JP 2012109896A
Authority
JP
Japan
Prior art keywords
face
information
area
printer
image data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010258644A
Other languages
Japanese (ja)
Other versions
JP5830851B2 (en
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 JP2010258644A priority Critical patent/JP5830851B2/en
Publication of JP2012109896A publication Critical patent/JP2012109896A/en
Application granted granted Critical
Publication of JP5830851B2 publication Critical patent/JP5830851B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing device that corrects image data based on properly selected two pieces of face information, which are added to the image data and detected from the image data, as well as an image processing method.SOLUTION: An image processing device carries out face recognition processing for recognizing a face of a person from image data to detect printer face information, and obtains camera face information that is added to the image data. When a printer face area (printer face) that is specified by the printer face information is overlapped with a camera face area (camera face) that is specified by the camera face information, the image processing device corrects the image data based on the camera face information.

Description

この発明は、画像データに付加される顔情報および該画像データから検出した顔情報に基づいて画像データを補正する画像処理装置および画像処理方法に関するものである。   The present invention relates to an image processing apparatus and an image processing method for correcting image data based on face information added to image data and face information detected from the image data.

近年、デジタルカメラで撮影時に画像を解析して補正を行うことが多くなってきた。その補正処理の一つとして、顔認識処理がある。これは、被写体に人物が含まれている際に画像から人物の顔を認識し、その認識した顔に合わせてオートフォーカスや露出を制御する機能である。また、顔認識機能を有するデジタルカメラでは、顔認識処理により得られる顔情報(顔オブジェクト情報や顔検出結果などと称することもある)を画像データに付加することが提案されている(例えば特許文献1参照)。そして、この特許文献1に記載の印刷装置では、画像データに付加される顔情報に基づいて画像データに対して色補正が実行され、色補正済の画像が印刷される。このように、デジタルカメラによる顔認識結果を利用して印刷装置側で独自に補正をかける技術が知られている。   In recent years, digital images have been frequently analyzed and corrected during shooting. One of the correction processes is a face recognition process. This is a function for recognizing a person's face from an image when the subject includes a person and controlling autofocus and exposure according to the recognized face. Further, in a digital camera having a face recognition function, it has been proposed to add face information (sometimes referred to as face object information or a face detection result) obtained by face recognition processing to image data (for example, Patent Documents). 1). In the printing apparatus described in Patent Document 1, color correction is performed on image data based on face information added to the image data, and a color-corrected image is printed. As described above, a technique is known in which correction is performed independently on the printing apparatus side using a face recognition result obtained by a digital camera.

特開2007−213455号公報JP 2007-213455 A

ところで、デジタルカメラの顔認識によって被写体に含まれる人物の顔の全部が完全かつ正確に認識される保証はない。このため、デジタルカメラ側での顔認識の補佐あるいは再確認を行う意味で印刷装置側でも独自に顔認識を行うことは有効である。その一方で、デジタルカメラ側での顔認識処理により検出された顔領域(以下、「カメラ顔領域」という)と、印刷装置側での顔認識処理により検出された顔領域(以下「プリンター顔領域」という)とが重なり、同一人物の顔を検出しているにもかかわらず、2種類の顔情報(つまり、カメラ顔領域を特定するカメラ側顔情報と、プリンター顔領域を特定するプリンター側顔情報)が併存することがある。このような場合、これら2種類の顔情報をどのように取り扱うことで適正な補正を行うことができるか十分に検討されていなかった。   By the way, there is no guarantee that the whole face of a person included in the subject is completely and accurately recognized by the face recognition of the digital camera. For this reason, it is effective to perform face recognition independently on the printing apparatus side in the sense of assisting or reconfirming face recognition on the digital camera side. On the other hand, a face area detected by face recognition processing on the digital camera side (hereinafter referred to as “camera face area”) and a face area detected by face recognition processing on the printing apparatus side (hereinafter referred to as “printer face area”). ”) And two types of face information (that is, camera-side face information that identifies the camera face area and printer-side face that identifies the printer face area, even though the face of the same person is detected) Information) may coexist. In such a case, it has not been sufficiently studied how appropriate correction can be performed by handling these two types of face information.

この発明にかかるいくつかの態様は、画像データに付加される顔情報および該画像データから検出した顔情報に基づいて画像データを補正する画像処理装置および画像処理方法に、顔情報を適正に選択して画像データを補正することを目的とする。   According to some aspects of the present invention, face information is appropriately selected for an image processing apparatus and an image processing method for correcting image data based on face information added to image data and face information detected from the image data. The purpose is to correct the image data.

本発明の第1の態様は、画像データから人物の顔を認識する顔認識処理を実行して第1顔情報を検出する顔情報検出部と、画像データに付加される第2顔情報を取得する顔情報取得部と、顔情報を含む補正基礎情報に基づいて画像データを補正する補正部と、第1顔情報で特定される第1顔領域が第2顔情報で特定される第2顔領域と重なるときには、第1顔領域と重なる第2顔領域を特定する第2顔情報を補正基礎情報に含める情報選択部とを備えることを特徴としている。   According to a first aspect of the present invention, a face information detection unit that detects a first face information by executing face recognition processing for recognizing a human face from image data, and acquires second face information added to the image data. A face information acquisition unit that performs correction, a correction unit that corrects image data based on correction basic information including face information, and a second face in which the first face region specified by the first face information is specified by the second face information And an information selection unit that includes, in the correction basic information, second face information that identifies the second face area that overlaps the first face area.

また、本発明の第2の態様は、画像データから人物の顔を認識する顔認識処理を実行して第1顔情報を検出する第1工程と、画像データに付加される第2顔情報を取得する第2工程と、第1顔情報で特定される第1顔領域が第2顔情報で特定される第2顔領域と重なるときには第1顔領域が第2顔領域に重なる第2顔情報に基づいて画像データを補正する第3工程とを備えることを特徴としている。   According to a second aspect of the present invention, a first step of detecting face information by executing face recognition processing for recognizing a human face from image data, and second face information added to the image data are performed. The second step of acquiring and the second face information in which the first face area overlaps the second face area when the first face area specified by the first face information overlaps the second face area specified by the second face information And a third step of correcting the image data based on the above.

このように構成された発明(画像処理装置および画像処理方法)では、画像データから人物の顔を認識する顔認識処理を実行して第1顔情報を検出するとともに、画像データに付加される第2顔情報を取得している。このため、同一人物の顔に対して2種類の顔情報が存在し、第1顔情報で特定される第1顔領域が第2顔情報により特定される第2顔領域と重なることがある。この場合、両顔領域が完全に一致しているのであれば、いずれの顔情報を用いてもよいのであるが、次のような場合、第1顔領域が第2顔領域と不自然に重なることがある。例えば、第1顔情報の誤検出が発生したり、第2顔情報に対応する人物と異なる被写体の顔を検出してしまうことがあり、これらの要因により第2顔領域と不自然に重なるものをそのまま画像データを補正するための情報、つまり補正基礎情報として利用すると、既に実行された顔認識の補佐あるいは再確認を行う技術的意味が失われてしまう。そこで、本発明では、上記のように第1顔領域が第2顔領域と重なる場合には、第2顔領域を特定する第2顔情報に基づき画像データを補正している。   In the invention (image processing apparatus and image processing method) configured as described above, first face information is detected by executing face recognition processing for recognizing a person's face from image data, and is added to the image data. 2 Face information is acquired. For this reason, there are two types of face information for the face of the same person, and the first face area specified by the first face information may overlap the second face area specified by the second face information. In this case, any face information may be used as long as both face areas completely match, but in the following case, the first face area unnaturally overlaps with the second face area. Sometimes. For example, erroneous detection of the first face information may occur, or a face of a subject different from the person corresponding to the second face information may be detected, and these factors cause an unnatural overlap with the second face area Is used as information for correcting image data as it is, that is, as basic correction information, the technical meaning of assisting or reconfirming the face recognition that has already been performed is lost. Therefore, in the present invention, when the first face area overlaps the second face area as described above, the image data is corrected based on the second face information for specifying the second face area.

ここで、第1顔情報で特定される第1顔領域に第2顔領域と重ならない非重複領域が含まれるときには、非重複領域を特定する第1顔情報を補正基礎情報に加えてもよく、これにより既に実行された顔認識時点では認識されていなかった人物の顔も考慮して画像データを補正することができる。   Here, when the first face area specified by the first face information includes a non-overlapping area that does not overlap the second face area, the first face information specifying the non-overlapping area may be added to the correction basic information. Thus, the image data can be corrected in consideration of the face of a person who has not been recognized at the time of face recognition already performed.

また、非重複領域が適正なものでない場合(例えば非重複領域の顔明度が適正顔明度範囲を外れる、あるいは非重複領域の顔サイズが適正顔サイズ範囲を外れる等の場合)、非重複領域を特定する第1顔情報を補正基礎情報に加えると、画像データの補正に悪影響を及ぼすおそれがある。そこで、このような場合には、非重複領域を特定する第1顔情報を補正基礎情報を含めないことが望ましい。   In addition, when the non-overlapping area is not appropriate (for example, when the face brightness of the non-overlapping area is out of the appropriate face brightness range, or the face size of the non-overlapping area is out of the appropriate face size range) If the first face information to be specified is added to the correction basic information, there is a possibility that the correction of the image data is adversely affected. Therefore, in such a case, it is desirable not to include the correction basic information in the first face information that identifies the non-overlapping area.

また、人物の顔であるか否かの判別要素として顔領域の色相を用いることができる。例えばデジタルカメラで人物を撮像する際、ピント合わせを行った後で人物が動いてしまうと、第2顔情報よりも第1顔情報を補正基礎情報として用いるのが好ましい。そこで、第2顔領域と重なる第1顔領域の色相が肌色であるときには、第2顔領域と重なる第1顔領域を特定する顔情報を補正基礎情報に加えるのが好適となる。一方、第1顔領域と重なる第2顔領域の色相が肌色でないときには、第1顔領域と重なる第2顔領域を特定する顔情報を補正基礎情報から削除するのが好適となる。   Further, the hue of the face area can be used as a determination element for determining whether the face is a person. For example, if a person moves after focusing on a digital camera, it is preferable to use the first face information as the basic correction information rather than the second face information. Therefore, when the hue of the first face area that overlaps the second face area is skin color, it is preferable to add face information that specifies the first face area that overlaps the second face area to the correction basic information. On the other hand, when the hue of the second face area that overlaps the first face area is not skin color, it is preferable to delete the face information that specifies the second face area that overlaps the first face area from the correction basic information.

なお、第1顔領域と第2顔領域との重なりについては、例えば第1顔領域と、第2顔領域との重なり部分の面積によって求めることができる。より具体的には、重なり部分の面積が第2顔領域の面積の40%以上であるときに第1顔情報が第2顔情報に一致すると判別することができる。   Note that the overlap between the first face area and the second face area can be obtained by, for example, the area of the overlapping portion between the first face area and the second face area. More specifically, it can be determined that the first face information matches the second face information when the area of the overlapping portion is 40% or more of the area of the second face region.

本発明にかかる画像処理装置の第1実施形態を用いた印刷システムを示す図。1 is a diagram showing a printing system using a first embodiment of an image processing apparatus according to the present invention. FIG. デジタルカメラで作成される画像ファイルの一例を示す図。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. 図1の印刷装置で実行される画像処理および印刷動作を示すフローチャート。2 is a flowchart showing image processing and printing operations executed by the printing apparatus of FIG. 1. 図1の印刷装置で実行される画像処理および印刷動作を示すフローチャート。2 is a flowchart showing image processing and printing operations executed by the printing apparatus of FIG. 1. プリンター顔座標およびカメラ顔座標の座標リストへの登録例を示す図。The figure which shows the example of registration to the coordinate list of a printer face coordinate and a camera face coordinate. 本発明にかかる画像処理装置の第2実施形態の動作を示すフローチャート。9 is a flowchart showing the operation of the second embodiment of the image processing apparatus according to the present invention.

図1は、本発明にかかる画像処理装置の第1実施形態を用いた印刷システムを示す図である。この印刷システムは、デジタルカメラ200の撮影により取得された画像データを、メモリカードM、USB(Universal Serial Bus)ケーブルや無線LAN(Local Area Network)等によって印刷装置100に転送し、印刷装置100で印刷するものである。すなわち、ここではユーザーがデジタルカメラ200で画像を撮影して画像データを生成し、その画像データをそのまま印刷装置100で読み込んで印刷する、いわゆるダイレクト印刷を想定しているが、本発明を適用可能な印刷システムはこれに限定されるものではない。つまり、デジタルカメラ200で生成した画像データをパーソナルコンピューターや携帯電話などに取り込み、パーソナルコンピューターから印刷装置100に画像データを送信して印刷する印刷システムにも本発明を適用することは可能である。   FIG. 1 is a diagram showing a printing system using the first embodiment of the 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.

デジタルカメラ200では、同図に示すように、CPU(Central Processing Unit)201、ROM(Read Only Memory)202、RAM(Random Access Memory)203、CCD(Charge Coupled Device)204、GP(Graphic Processor)205およびI/F(Interface)206がバス207を介して相互に接続され、これらの間で情報の授受が可能となっている。そして、CPU201はROM202に格納されているプログラムに応じて各種演算処理を実行しながらデジタルカメラ200の制御を行う。このとき一時的に必要となるデータはRAM203に格納される。また、CCD204は、光学系208によって集光された被写体からの光学像を電気信号に変換して出力する。この光学系208は、複数のレンズおよびアクチュエータによって構成されており、アクチュエータによってフォーカス等を調整しながら被写体の光学像を複数のレンズによってCCD204の受光面に結像する。さらに、GP205は、CPU201から供給される表示命令に基づいて表示用の画像処理を実行し、得られた表示用画像データをLCD(Liquid Crystal Display)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 GP (Graphic Processor) 205. And an I / F (Interface) 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 an LCD (Liquid Crystal Display) 209 for display.

I/F206はデジタルカメラ200の入出力機能を提供するものであり、操作ボタン210、ジャイロセンサー211およびカードI/F回路212の間で情報を授受する際に、データの表現形式を適宜変換する装置である。I/F206に接続される操作ボタン210には、電源、モード切替え、シャッターなどのボタンや、各種機能を設定できる入力手段があり、これらによってユーザーはデジタルカメラ200を任意に制御して動作させることが可能となっている。また、ジャイロセンサー211はデジタルカメラ200によって被写体を撮影した際のカメラ本体の角度(水平面に対する角度)を示す信号を生成して出力する。デジタルカメラ200は、上記したカメラ本体の角度を含め、撮影時における種々の情報(例えば、露光、被写体等に関する情報)を、後述するExif(Exchangeable Image File Format)情報として画像データに付加した画像ファイルを生成することができる構造となっている。   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 is an image file in which various information (for example, information on exposure, subject, etc.) at the time of shooting including the angle of the camera body described above is added to image data as Exif (Exchangeable Image File Format) information described later. It is a structure that can generate.

また、カード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 in accordance with programs stored in the ROM 102 and the EEPROM 104 and controls each part of the printing apparatus 100, so that the “face information detection unit”, “face information acquisition unit”, “information selection” of the present invention Part "and" correction part ". 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に基づき画像ファイルの構成を説明した上で、本実施形態における画像処理動作および印刷動作について図4ないし図7を参照しつつ詳述する。   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 this embodiment will be described in detail with reference to FIGS. 4 to 7.

図2は上記のように構成されたデジタルカメラで作成される画像ファイルの一例を示す図である。また、図3は図2の部分拡大図である。この実施形態では、デジタルカメラ200はCCD204で撮像された画像データをRAM203に格納する。また、デジタルカメラ200は、被写体に人物が含まれているときには顔認識処理を行う(顔認識方式については従来より数多く提案されており、それらのうちいずれの方式を採用してもよい)。なお、本実施形態では、顔認識処理により検出される顔認識結果は、図4(a)に示すような座標情報が顔情報として表現される。すなわち、同図(a)に示すように、画像データは所定の画像幅(Width)と画像高さ(Height)の画素で構成されており、Xが横軸、Yが縦軸を表しており、左上が原点(0,0)である。そして、画像データから顔が検出されると、両目端が入る間隔(顔サイズ)を1辺とする正方形の顔領域(または顔矩形という)FRcを左上(LT)、左下(LB)、右上(RT)、右下(RB)の4点の座標で囲まれる領域で表し、顔領域FRcを示す座標、つまり顔座標を、認識した顔の個数(つまりカメラ顔個数)NcとともにRAM203に格納する。   FIG. 2 is a diagram showing an example of an image file created by the digital camera configured as described above. FIG. 3 is a partially enlarged view of FIG. 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 subject includes a person (a number of face recognition methods have been proposed in the past, and any of these methods may be employed). In the present embodiment, coordinate information as shown in FIG. 4A is expressed as face information in the face recognition result detected by the face recognition process. That is, as shown in FIG. 5A, the image data is composed of pixels having a predetermined image width (Width) and image height (Height), with X representing the horizontal axis and Y representing the vertical axis. The upper left is the origin (0, 0). When a face is detected from the image data, a square face area (or a face rectangle) FRc having an interval between both eye edges (face size) as one side (upper left (LT), lower left (LB), upper right ( (RT) and the lower right (RB) area surrounded by the coordinates of the four points, and the coordinates indicating the face area FRc, that is, the face coordinates, are stored in the RAM 203 together with the number of recognized faces (that is, the number of camera faces) Nc.

また、本明細書では、後で説明するように、印刷装置100においてもデジタルカメラ200での顔認識と同様に顔認識を行って顔座標を求めるため、デジタルカメラ200での顔認識により得られる顔座標を「カメラ顔座標」と称し、左上(LTc)、左下(LBc)、右上(RTc)、右下(RBc)で示す。また、顔認識処理により複数個の顔が検出される場合もあるため、第n番目のカメラ顔座標を左上(LTnc)、左下(LBnc)、右上(RTnc)、右下(RBnc)で示す。また、後述するように印刷装置100の顔認識処理により検出される顔座標については「プリンター顔座標」と称し、第n番目のプリンター顔座標については、左上(LTnp)、左下(LBnp)、右上(RTnp)、右下(RBnp)で示す。図4(a)では、デジタルカメラ200での顔認識結果の一例として、カメラ側での顔認識処理によって二人の人物の顔が検出され、各人物のカメラ顔座標(LT1c,LB1c,RT1c,RB1c)、(LT2c,LB2c,RT2c,RB2c)が図示されている。   In the present specification, as will be described later, the printing apparatus 100 also obtains face coordinates by performing face recognition in the same manner as face recognition with the digital camera 200, and thus is obtained by face recognition with the digital camera 200. The face coordinates are referred to as “camera face coordinates” and are indicated by upper left (LTc), lower left (LBc), upper right (RTc), and lower right (RBc). In addition, since a plurality of faces may be detected by face recognition processing, the nth camera face coordinate is indicated by upper left (LTnc), lower left (LBnc), upper right (RTnc), and lower right (RBnc). As will be described later, the face coordinates detected by the face recognition processing of the printing apparatus 100 are referred to as “printer face coordinates”, and the nth printer face coordinates are upper left (LTnp), lower left (LBnp), and upper right. (RTnp), lower right (RBnp). In FIG. 4A, as an example of the face recognition result of the digital camera 200, the faces of two persons are detected by face recognition processing on the camera side, and the camera face coordinates (LT1c, LB1c, RT1c, RB1c), (LT2c, LB2c, RT2c, RB2c) are shown.

また、この実施形態では、上記のように画像データ、顔個数および顔座標などを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. In the structure of APP1, there is 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, the 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タグに書き込む規格は規定されていないが、本実施形態では顔個数NcがExif IFD領域302gに書き込まれ、Nc個の顔座標がExif IFD Value領域302hに書き込まれるとともに該書込位置をポイントする情報がExif IFD領域302gに書き込まれると仮定して説明を続ける。もちろん、これらの情報をメーカーに依存する領域に書き込むように構成してもよい。このように、顔位置(顔座標)の情報である顔情報はExif情報に記載され、画像データに添付されている。したがって、Exif情報に顔情報が含まれる場合には、顔個数Ncやシーン情報などとともに画像データの補正に利用される。一方、Exif情報に顔情報が含まれていない場合、顔情報がないと判断される。   In addition, in the 0th IFD (IFD of main image) area 302e next to the Tiff header area 302d, image related information such as the image width and the image height is stored as shown in the right part of FIG. 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 such as exposure time and F number is stored. In addition, the Exif IFD value area 302h is in the Exif IFD area 302g. At present, the standard for writing the number of faces Nc detected by the face recognition processing and the face coordinates of Nc to the Exif tag is not stipulated, but in this embodiment, the number of faces Nc is written to the Exif IFD area 302g. The description will be continued assuming that Nc face coordinates are written in the Exif IFD Value area 302h and information pointing to the writing 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. Therefore, when face information is included in Exif information, it is used for correcting image data together with the number of faces Nc and scene information. On the other hand, if no face information is included in the Exif information, it is determined that there is no face information.

次に、上記のようなデータ構造(図2)を有する画像ファイルがメモリカードMに保存されており、そのメモリカードMから画像ファイルを読み出し、印刷装置100により画像ファイルに含まれる各種情報に基づき所定の画像処理を実行して印刷する動作について、図4ないし7を参照しつつ説明する。   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. An operation of executing predetermined image processing and printing will be described with reference to FIGS.

図5および図6は図1の印刷装置で実行される画像処理および印刷動作を示すフローチャートである。ユーザーが印刷装置100のカードスロット112にメモリカードMを挿入し、操作ボタン109を操作して印刷指令を与えると、CPU101がROM102に格納されているプログラムにしたがって装置各部を制御して以下の画像処理および印刷動作を実行する。   5 and 6 are flowcharts 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は、図2に示す画像ファイルからエントロピー符号化テーブルを取得し、圧縮データ307に含まれている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 shown in FIG. 2, and Y (luminance) component, Cr (color difference component), and Cb (color difference component) included in the compressed data 307. ) And the DC coefficient of each block 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は、図2に示す画像ファイルから量子化テーブルを取得し、ステップ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 the image file shown in FIG. 2 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 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)。   Next, the CPU 101 stores and holds the YCC, RGB, and HSB images obtained in the processes of steps S13 and S14 in the RAM 103. At this time, in order to reduce the amount of data, the pixels may be thinned out at a predetermined rate and then stored in the RAM 103 (step S15).

また、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.

このステップS17で、CPU101は、ステップS15でRAM103に格納した画像データを使って顔認識処理を行う。この顔認識方式についても、デジタルカメラ200と同様に従来より提案されている方式を採用することができ、デジタルカメラ200で採用した方式と同一のものを採用してもよいし、異なる方式であってもよい。また、印刷装置100の顔認識処理により検出されたプリンター顔座標についてはRAM103に記憶される。この実施形態では、図7(a)に示すように予め10個のプリンター顔座標を記憶するためのメモリ空間がRAM103に準備されており、このメモリ空間に検出されたプリンター顔座標が登録顔情報No.1、2、…の順序で記憶される。例えば図4(c)に示すように印刷装置(プリンター)100での顔認識処理によって三人の人物について、各人物のプリンター顔座標(LT1p,LB1p,RT1p,RB1p)、(LT2p,LB2p,RT2p,RB2p)、(LT3p,LB3p,RT3p,RB3p)が検出されると、図7(a)に示すようにそれぞれ登録顔情報No.1〜3に登録される。なお、該当するプリンター顔座標がない登録顔情報No.4以降のアドレスにはゼロを登録する。また、CPU101は、検出した顔の個数、つまりプリンター顔個数Npを設定する(上記した具体例では、Np=3と設定する)。   In step S17, the CPU 101 performs face recognition processing using the image data stored in the RAM 103 in step S15. As for the face recognition method, a method that has been conventionally proposed can be adopted in the same manner as the digital camera 200, and the same method as that adopted in the digital camera 200 may be adopted, or a different method may be adopted. May be. Further, printer face coordinates detected by the face recognition process of the printing apparatus 100 are stored in the RAM 103. In this embodiment, as shown in FIG. 7A, a memory space for storing 10 printer face coordinates is prepared in advance in the RAM 103, and the printer face coordinates detected in this memory space are registered face information. No. Stored in the order of 1, 2,. For example, as shown in FIG. 4 (c), the printer face coordinates (LT1p, LB1p, RT1p, RB1p), (LT2p, LB2p, RT2p) of each person for three persons by face recognition processing in the printing apparatus (printer) 100 , RB2p) and (LT3p, LB3p, RT3p, RB3p) are detected, as shown in FIG. 1 to 3 are registered. Note that registered face information No. having no corresponding printer face coordinates. Zero is registered in the addresses after 4. Further, the CPU 101 sets the number of detected faces, that is, the number of printer faces Np (in the above specific example, Np = 3 is set).

また、プリンター顔座標の検出・記憶に続いて、CPU101はステップS18およびS19を実行してカメラ顔座標を取得し、RAM103のカメラ顔座標用のメモリ空間に記憶するとともにカメラ顔個数Ncを記憶する。すなわち、CPU101は、図2の画像ファイル中のExifタグから顔個数Ncおよび顔座標を読み込み(ステップS18)、さらにカメラ顔座標についてはQVGA(Quarter Video Graphics Array)サイズに規格化し、それらをRAM103に格納する(ステップS19)。この実施形態では、カメラ顔座標についても、図7(b)に示すように予め10個を記憶するためのメモリ空間がRAM103に準備されており、このメモリ空間にカメラ顔座標が登録顔情報No.1、2、…の順序で記憶される。例えば図4(a)に示すようにデジタルカメラ200での顔認識処理によって二人の人物について、各人物のカメラ顔座標(LT1c,LB1c,RT1c,RB1c)、(LT2c,LB2c,RT2c,RB2c)が検出されて画像データに付加されているときには、印刷装置100において2つのカメラ顔座標は図7(b)に示すようにそれぞれ登録顔情報No.1、2に登録される。なお、該当するカメラ顔座標がない登録顔情報No.3以降のアドレスにはゼロを登録する。また、CPU101は、ステップS18で読み込んだ顔の個数、つまりカメラ顔個数Ncを設定する(上記した具体例では、Nc=2と設定する)。   Further, following the detection and storage of the printer face coordinates, the CPU 101 executes steps S18 and S19 to acquire the camera face coordinates, stores the camera face coordinates in the memory space for the camera face coordinates in the RAM 103, and stores the camera face number Nc. . That is, the CPU 101 reads the number of faces Nc and the face coordinates from the Exif tag in the image file of FIG. 2 (step S18), further normalizes the camera face coordinates to a QVGA (Quarter Video Graphics Array) size, and stores them in the RAM 103. Store (step S19). In this embodiment, a memory space for storing 10 camera face coordinates in advance as shown in FIG. 7B is prepared in the RAM 103, and the camera face coordinates are stored in this memory space as registered face information No. . Stored in the order of 1, 2,. For example, as shown in FIG. 4 (a), the camera face coordinates (LT1c, LB1c, RT1c, RB1c), (LT2c, LB2c, RT2c, RB2c) of each person for two persons by face recognition processing in the digital camera 200. Is detected and added to the image data, the two camera face coordinates in the printing apparatus 100 are registered face information No. 1 as shown in FIG. 1 and 2 are registered. Note that registered face information No. with no corresponding camera face coordinates. Zero is registered in the addresses after 3. Further, the CPU 101 sets the number of faces read in step S18, that is, the camera face number Nc (in the above specific example, Nc = 2 is set).

こうして、プリンター顔座標とカメラ顔座標とが得られると、CPU101は、印刷装置100で検出されたプリンター顔座標(第1顔情報)の各々がステップS19で取得されたカメラ顔座標(第2顔情報)のいずれかと一致するか否かを判別する(ステップS20〜S25)。すなわちステップS20で、CPU101は、カメラ顔個数Ncがゼロよりも大きいか否かを判別する。ここで、ステップS18で取得したカメラ顔個数Ncが元々ゼロである場合、あるいはステップS21〜S25の処理を全カメラ顔座標について完了した時点でカメラ顔個数Nc=0となるため、これらの場合には、CPU101はステップS20で「NO」と判別し、ステップS26に進む。   When the printer face coordinates and the camera face coordinates are thus obtained, the CPU 101 determines that the printer face coordinates (first face information) detected by the printing apparatus 100 are the camera face coordinates (second face) acquired in step S19. It is determined whether or not it matches any of (information) (steps S20 to S25). That is, in step S20, the CPU 101 determines whether the camera face number Nc is greater than zero. Here, when the camera face number Nc acquired in step S18 is originally zero, or when the processing of steps S21 to S25 is completed for all camera face coordinates, the camera face number Nc = 0, so in these cases The CPU 101 determines “NO” in step S20, and proceeds to step S26.

一方、ステップS20で「YES」のとき、つまりプリンター顔座標で特定されるプリンター顔領域との重なり判別が実施されていないカメラ顔座標が残っている間、ステップS21〜S25の処理を繰り返して行う。このステップS21で、CPU101は、プリンター顔個数Npがゼロよりも大きいか否かを判別する。そして、ステップS21で「YES」のとき、つまりNc番目のカメラ顔座標で特定されるカメラ顔領域との重なり判別が実施されていないプリンター顔座標が残っているときには、CPU101は、Nc番目のカメラ顔座標で特定されるカメラ顔領域FRcと、各プリンター顔座標で特定されるプリンター顔領域FRpとの重複率を算出する(ステップS22)。例えば図4(b)に示すように、カメラ顔座標(LT2c,LB2c,RT2c,RB2c)で特定されるカメラ顔領域FRcと、プリンター顔座標(LT2p,LB2p,RT2p,RB2p)で特定されるプリンター顔領域FRpとの重なっている重複領域(同図(b)中のハッチング領域)ORの面積を求めるとともに、顔領域FRc(またはFRp)に対する重複領域ORの面積率を上記重複率として求める。   On the other hand, when “YES” is determined in the step S20, that is, while the camera face coordinates that are not determined to overlap with the printer face area specified by the printer face coordinates remain, the processes of the steps S21 to S25 are repeated. . In step S21, the CPU 101 determines whether the printer face number Np is larger than zero. When “YES” is determined in the step S21, that is, when the printer face coordinates that are not subjected to the overlapping determination with the camera face area specified by the Nc-th camera face coordinates remain, the CPU 101 determines the Nc-th camera. An overlapping rate between the camera face area FRc specified by the face coordinates and the printer face area FRp specified by each printer face coordinates is calculated (step S22). For example, as shown in FIG. 4B, a camera face area FRc specified by camera face coordinates (LT2c, LB2c, RT2c, RB2c) and a printer specified by printer face coordinates (LT2p, LB2p, RT2p, RB2p). The area of the overlapping area (hatched area in FIG. 5B) OR overlapping with the face area FRp is determined, and the area ratio of the overlapping area OR with respect to the face area FRc (or FRp) is determined as the above-described overlapping ratio.

また、CPU101は、その他のプリンター顔領域FRpについても同様にして求めた後、重複率が40%以上となるプリンター顔領域FRpが存在する、つまりステップS17で検出したプリンター顔のなかにNc番目のカメラ顔と重なる(あるいは一致する)ものがあるか否かを判別する(ステップS23)。このステップS23でNc番目のカメラ顔と重なるプリンター顔、つまり重複顔領域が見つかった場合のみ、CPU101は、当該プリンター顔(重複顔領域)を特定するプリンター顔座標をRAM103から削除するとともに、プリンター顔個数Npを「1」だけデクリメントし(ステップS24)、ステップS25に進む。なお、Nc番目のカメラ顔と重なるプリンター顔がない場合には、ステップS24を実行することなく、ステップS25に進む。   Further, the CPU 101 obtains other printer face areas FRp in the same manner, and then there is a printer face area FRp having an overlap rate of 40% or more, that is, the Nc-th printer face detected in step S17. It is determined whether there is an object that overlaps (or matches) the camera face (step S23). Only when a printer face that overlaps with the Nc-th camera face in step S23, that is, an overlapping face area is found, the CPU 101 deletes the printer face coordinates that specify the printer face (overlapping face area) from the RAM 103 and The number Np is decremented by “1” (step S24), and the process proceeds to step S25. If there is no printer face that overlaps the Nc-th camera face, the process proceeds to step S25 without executing step S24.

このステップS25で、CPU101はNc番目のカメラ顔座標をRAM103の座標リストに登録する。この座標リストは、例えば図7(c)に示すように予め10個の顔座標を記憶するためのRAM103に設定されたメモリ空間であり、上記カメラ顔座標用およびプリンター顔座標用とは別個に設けられたものである。また、CPU101は、Nc番目カメラ顔座標の座標リストへの登録後に、カメラ顔個数Ncを「1」だけデクリメントし、ステップS20に戻る。   In step S <b> 25, the CPU 101 registers the Nc-th camera face coordinate in the coordinate list of the RAM 103. This coordinate list is a memory space set in advance in the RAM 103 for storing 10 face coordinates as shown in FIG. 7C, for example, and is separate from the camera face coordinates and the printer face coordinates. It is provided. Further, after registering the Nc-th camera face coordinate in the coordinate list, the CPU 101 decrements the camera face number Nc by “1” and returns to step S20.

このようにステップS20〜S25の実行により、ステップS19で取得されたカメラ顔座標の全部は座標リストに登録されるのに対し、ステップS17で検出されたプリンター顔座標のうちカメラ顔と重なるプリンター顔(重複顔領域)を特定するプリンター顔座標についてはRAM103から削除される。例えば図4および図7に示す具体例では、3つのうちプリンター顔座標(LT1p,LB1p,RT1p,RB1p)、(LT2p,LB2p,RT2p,RB2p)が重複顔領域と特定するものであり、RAM103から削除され、カメラ顔と重ならないプリンター顔(非重複顔領域)を特定するプリンター顔座標(LT3p,LB3p,RT3p,RB3p)のみがRAM103に残っている。このようにプリンター顔座標(LT3p,LB3p,RT3p,RB3p)は、ステップS17で検出されたプリンター顔座標で特定されるプリンター顔領域FRpのうちカメラ顔領域FRcと重ならず、しかもRAM103から削除されずに残ったものであり、これにより特定される顔領域FRp′が本発明の「非重複領域」に相当するものであり、以下のおいては「非重複領域」と称する。   As described above, by executing Steps S20 to S25, all the camera face coordinates acquired in Step S19 are registered in the coordinate list, whereas the printer face that overlaps the camera face among the printer face coordinates detected in Step S17. The printer face coordinates that specify (overlapping face area) are deleted from the RAM 103. For example, in the specific examples shown in FIG. 4 and FIG. 7, the printer face coordinates (LT1p, LB1p, RT1p, RB1p) and (LT2p, LB2p, RT2p, RB2p) among the three are specified as the overlapping face area. Only the printer face coordinates (LT3p, LB3p, RT3p, RB3p) that specify the printer face (non-overlapping face area) that is deleted and does not overlap the camera face remain in the RAM 103. Thus, the printer face coordinates (LT3p, LB3p, RT3p, RB3p) do not overlap with the camera face area FRc in the printer face area FRp specified by the printer face coordinates detected in step S17, and are deleted from the RAM 103. The face region FRp ′ specified by this is equivalent to the “non-overlapping region” of the present invention, and is hereinafter referred to as “non-overlapping region”.

次のステップS26で、CPU101は、座標リストに登録されたカメラ顔座標の有無を判別する。そして、例えば図7に示すように座標リストにカメラ顔座標が登録されている場合(ステップS26で「YES」)には、CPU101は以下に説明するステップS27〜S36を実行し、その時点で削除されずに残っているプリンター顔座標(つまり、非重複領域を特定するプリンター顔座標)のうち適正なものを登録済のカメラ顔座標を用いて選択し、座標リストに登録した後、ステップS38に進む。一方、座標リストにカメラ顔座標が登録されていない場合(ステップS26で「NO」)には、CPU101は、その時点で削除されずに残っているプリンター顔座標の全てを座標リストに登録した(ステップS37)後、ステップS38に進む。   In the next step S26, the CPU 101 determines whether there is a camera face coordinate registered in the coordinate list. For example, when the camera face coordinates are registered in the coordinate list as shown in FIG. 7 (“YES” in step S26), the CPU 101 executes steps S27 to S36 described below and deletes at that time. The printer face coordinates that remain without being selected (that is, the printer face coordinates that specify the non-overlapping area) are selected using the registered camera face coordinates and registered in the coordinate list, and the process goes to step S38. move on. On the other hand, when the camera face coordinates are not registered in the coordinate list (“NO” in step S26), the CPU 101 registers all the remaining printer face coordinates that are not deleted at that time in the coordinate list ( After step S37), the process proceeds to step S38.

ここで、ステップS38以降の処理内容を説明する前に、ステップS27〜S36に戻って処理内容について詳しく説明する。ステップS27で、CPU101は、プリンター顔個数Npがゼロより大きいか否かを判別することで、非重複領域(例えば図4中の顔領域FRp′)の有無を判断する。そして、非重複領域が存在する場合(ステップS27で「YES」)には、CPU101は座標リストに登録されたカメラ顔座標で特定される全カメラ顔領域の平均顔明度Yavrおよび平均顔サイズSavrを画像データに基づいて計算する(ステップS28)。すなわち、カメラ顔領域の各々について、各画素の明度YをRGB値により例えば次式、
Y=0.299*R+0.587*G+0.114*B
で計算し、それらの平均値を各カメラ顔領域の平均顔明度とし、さらにそれらの平均を平均顔明度Yavrとしている。また、平均顔サイズSavrは登録済カメラ顔領域FRcの顔サイズSの平均値である。
Here, before describing the processing contents after step S38, returning to steps S27 to S36, the processing contents will be described in detail. In step S27, the CPU 101 determines whether or not there is a non-overlapping area (for example, the face area FRp ′ in FIG. 4) by determining whether or not the printer face number Np is greater than zero. When there is a non-overlapping area (“YES” in step S27), the CPU 101 calculates the average facial brightness Yavr and average face size Savr of all camera face areas specified by the camera face coordinates registered in the coordinate list. Calculation is performed based on the image data (step S28). That is, for each of the camera face regions, the brightness Y of each pixel is expressed by an RGB value, for example,
Y = 0.299 * R + 0.587 * G + 0.114 * B
The average value thereof is used as the average facial brightness of each camera face area, and the average thereof is used as the average facial brightness Yavr. The average face size Savr is an average value of the face size S of the registered camera face area FRc.

また、CPU101は、上記平均顔明度Yavrおよび平均顔サイズSavrから次式にしたがって有効最大顔明度Ymax、有効最小顔明度Ymin、有効最大顔サイズSmax、有効最小顔サイズSminを算出する。
有効最大顔明度Ymax=Yavr+Yavr/2
有効最小顔明度Ymin=Yavr/2
有効最大顔サイズSmax=Savr+Savr/2
有効最小顔サイズSmin=Savr/2
これら有効最大顔明度Ymax、有効最小顔明度Ymin、有効最大顔サイズSmax、有効最小顔サイズSminは、印刷装置100での顔認識処理により認識された非重複領域が適正な顔である否かを判別するための基準値である。このような基準値を設定した理由は、画像データに例えば過剰に小さい顔(例えば、人形の顔)や、過剰に大きい顔(例えば、ポスターに写る顔)が含まれている場合や、過剰に暗い顔や過剰に明るい顔が含まれている場合に、印刷装置100での顔認識処理によりそれらを非重複領域として認識してしまう可能性があり、このような認定結果に基づくプリンター顔座標を排除するためである。
Further, the CPU 101 calculates the effective maximum face brightness Ymax, the effective minimum face brightness Ymin, the effective maximum face size Smax, and the effective minimum face size Smin from the average face brightness Yavr and the average face size Savr according to the following equations.
Effective maximum facial brightness Ymax = Yavr + Yavr / 2
Effective minimum facial brightness Ymin = Yavr / 2
Effective maximum face size Smax = Savr + Savr / 2
Effective minimum face size Smin = Savr / 2
These effective maximum face brightness Ymax, effective minimum face brightness Ymin, effective maximum face size Smax, and effective minimum face size Smin indicate whether or not the non-overlapping area recognized by the face recognition process in the printing apparatus 100 is an appropriate face. This is a reference value for discrimination. The reason for setting such a reference value is, for example, when the image data includes an excessively small face (for example, a doll's face) or an excessively large face (for example, a face that appears in a poster) or excessively. When a dark face or an excessively bright face is included, there is a possibility that the face recognition processing in the printing apparatus 100 may recognize them as non-overlapping areas. This is to eliminate it.

なお、本実施形態では、平均顔明度Yavrを含む適正顔明度範囲および平均顔サイズSavrを含む適正顔サイズ範囲をそれぞれ上記したように設定しているが、各範囲はこれに限定されるものではなく、実験結果や撮影条件などを考慮して有効最大顔明度Ymax、有効最小顔明度Ymin、有効最大顔サイズSmax、有効最小顔サイズSminをそれぞれ設定することができる。   In this embodiment, the appropriate face brightness range including the average face brightness Yavr and the appropriate face size range including the average face size Savr are set as described above, but each range is not limited to this. Instead, the effective maximum face brightness Ymax, the effective minimum face brightness Ymin, the effective maximum face size Smax, and the effective minimum face size Smin can be set in consideration of the experimental results and the photographing conditions.

そして、CPU101は、ステップS30〜S36を実行し、非重複領域の各々が適正な顔領域である場合にのみ、当該非重複領域を特定するプリンター顔座標を座標リストに登録する。すなわち、プリンター顔個数Npがゼロより大きいと判別する(ステップS30で「YES」)と、CPU101は、Np番目のプリンター顔座標で特定されるプリンター顔領域の平均顔明度Ypを計算し(ステップS31)、その計算結果が有効最大顔明度Ymaxと有効最小顔明度Yminとの間、つまり適正顔明度範囲内にあるか否かを判別する(ステップS32)。これによりカメラ顔領域から大きく離れた明度を有する非重複領域を排除することができる。   Then, the CPU 101 executes steps S30 to S36, and registers the printer face coordinates specifying the non-overlapping area in the coordinate list only when each non-overlapping area is an appropriate face area. That is, if it is determined that the printer face number Np is greater than zero (“YES” in step S30), the CPU 101 calculates the average face brightness Yp of the printer face area specified by the Np-th printer face coordinates (step S31). It is determined whether or not the calculation result is between the effective maximum facial brightness Ymax and the effective minimum facial brightness Ymin, that is, within the appropriate facial brightness range (step S32). As a result, non-overlapping areas having lightness far away from the camera face area can be eliminated.

また、ステップS32で「YES」と判別した場合、CPU101は、Np番目のプリンター顔座標で特定されるプリンター顔領域の顔サイズSpを計算し(ステップS33)、その計算結果が有効最大顔サイズSmaxと有効最小顔サイズSminとの間、つまり適正顔サイズ範囲内にあるか否かを判別する(ステップS34)。これによりカメラ顔領域から大きく離れた顔サイズを有する非重複領域を排除することができる。   If “YES” is determined in the step S32, the CPU 101 calculates the face size Sp of the printer face area specified by the Np-th printer face coordinates (step S33), and the calculation result is the effective maximum face size Smax. And the effective minimum face size Smin, that is, whether or not it is within the appropriate face size range is determined (step S34). As a result, a non-overlapping area having a face size far away from the camera face area can be eliminated.

そして、CPU101は、上記のようにしてNp番目のプリンター顔領域が適正な非重複領域であると判別するとき、当該プリンター顔領域を特定する顔座標を座標リストに登録した後、プリンター顔個数Npを「1」だけデクリメントし(ステップS35)、ステップS30に戻る。一方、Np番目のプリンター顔領域の明度Ypが適正顔明度範囲(Ymax〜Ymin)から外れたり(ステップS32で「NO」)、顔サイズSpが適正顔サイズ範囲(Smax〜Smin)から外れる(ステップS34で「NO」)場合、CPU101は当該非重複領域が不適正なものであると判別し、当該プリンター顔領域を特定する顔座標を座標リストに登録することなく、実質上削除する。さらに、CPU101は、プリンター顔個数Npを「1」だけデクリメント(ステップS36)し、ステップS30に戻る。   When the CPU 101 determines that the Np-th printer face area is an appropriate non-overlapping area as described above, after registering the face coordinates specifying the printer face area in the coordinate list, the number of printer faces Np Is decremented by "1" (step S35), and the process returns to step S30. On the other hand, the brightness Yp of the Np-th printer face area is out of the appropriate face brightness range (Ymax to Ymin) (“NO” in step S32), or the face size Sp is out of the appropriate face size range (Smax to Smin) (step). If “NO” in S34), the CPU 101 determines that the non-overlapping area is inappropriate, and substantially deletes the face coordinates specifying the printer face area without registering them in the coordinate list. Further, the CPU 101 decrements the printer face number Np by “1” (step S36), and returns to step S30.

そして、プリンター顔個数Npがゼロとなるまで、CPU101は、上記ステップS31〜S36を繰り返することによって非重複領域の全てについて適正か不適正かの判別および座標リストへの登録を実行し、ステップS38に進む。   Then, until the number of printer faces Np becomes zero, the CPU 101 repeats steps S31 to S36 to determine whether or not all non-overlapping areas are appropriate and to be registered in the coordinate list, step S38. Proceed to

次にステップS38以降の処理内容について説明する。このステップS38で、CPU101は座標リストにカメラ顔座標および/またはプリンター顔座標が登録されている否かを判別する。そして、カメラ顔座標かプリンター顔座標かを問わず、顔座標が登録されている場合(ステップS38で「YES」)には、CPU101は、座標リストに登録された顔座標に基づいて全ての顔位置を計算し、さらに顔の平均顔色を取得した(ステップS39)後、顔色が最適になるようにエンハンスパラメータを計算する(ステップS40)。なお、エンハンスパラメータ計算の詳細については省略するが、RAM103に記憶したRGBヒストグラムに基づきコントラスト、明度、彩度、シャープネスなどの各画質パラメータの特徴量を抽出し、抽出した特徴量が所定の画質パラメータの特徴量に近づくようエンハンスのパラメータを設定する。このように、座標リストに登録された顔座標に基づいて画像データの補正パラメータが設定されており、これらの顔座標が本発明の「補正基礎情報」に相当する。   Next, processing contents after step S38 will be described. In step S38, the CPU 101 determines whether camera face coordinates and / or printer face coordinates are registered in the coordinate list. If the face coordinates are registered (“YES” in step S38) regardless of whether the camera face coordinates or the printer face coordinates, the CPU 101 determines all the faces based on the face coordinates registered in the coordinate list. After the position is calculated and the average facial color of the face is acquired (step S39), the enhancement parameter is calculated so that the facial color is optimal (step S40). 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. In this way, correction parameters for image data are set based on face coordinates registered in the coordinate list, and these face coordinates correspond to “correction basic information” of the present invention.

一方、座標リストにカメラ顔座標もプリンター顔座標も登録されていない場合(ステップS38で「NO」)、CPU101は、画像全体が最適になるようにエンハンスパラメータを計算する(ステップS41)。   On the other hand, when neither camera face coordinates nor printer face coordinates are registered in the coordinate list (“NO” in step S38), the CPU 101 calculates enhancement parameters so that the entire image is optimized (step S41).

このようにエンハンスパラメータが設定された後、CPU101は、印刷対象となる画像ファイルにおいて、解凍処理の対象となる位置を示すファイルポインタをリセットし、処理位置を画像ファイルの先頭に復元する(ステップS42)。そして、CPU101は、以下のステップS43〜S50を繰り返して画像データに基づいて画像を印刷する。   After the enhancement parameters are set in this way, the CPU 101 resets the file pointer indicating the position to be decompressed in the image file to be printed, and restores the processing position to the top of the image file (step S42). ). The CPU 101 then repeats the following steps S43 to S50 to print an image based on the image data.

CPU101は、RAM103にキャッシュされた1MCUライン分の画像データにハフマン解凍処理を施し、量子化DCT係数を得る(ステップS43)。ここで、1MCUラインとは、画像を回転させる場合には、画像を構成する列方向に1列のMCU群をいい、回転させない場合には、画像を構成する行方向に1列のMCU群をいう。そして、CPU101は、ステップS29の処理において得られた量子化DCT係数を逆量子化し(ステップS44)、さらにステップS43で得られたDCT係数に対して逆DCT演算を施すことによりもとのデータを得る(ステップS45)。   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 S43). 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 S29 (step S44), and further performs an inverse DCT operation on the DCT coefficient obtained in step S43. Obtain (step S45).

こうして得られたYCC空間の画像を、CPU101はRGB空間の画像に変換する(ステップS46)。そして、CPU101は、エンハンスの実行が設定されている場合のみ、つまりステップS52で「YES」と判別した場合のみ、RGB空間の画像を構成する各画素に対してステップS40、S41において算出したエンハンスパラメータを適用することにより、印刷される画像を最適な色合いに補正し(ステップS47)、次のステップS48に進む。   The CPU 101 converts the YCC space image thus obtained into an RGB space image (step S46). The CPU 101 calculates the enhancement parameter calculated in steps S40 and S41 for each pixel constituting the RGB space image only when the execution of enhancement is set, that is, only when “YES” is determined in step S52. Is applied to correct the image to be printed to an optimum hue (step S47), and the process proceeds to the next step S48.

CPU101は、こうして補正された画像データに対して、リサイズ、回転などのレイアウト処理を施し(ステップS48)、プリンターエンジンコントローラー111の図示せぬバンドバッファに供給する。これを受けたプリンターエンジンコントローラー111は、プリンターエンジン113の各部を制御して画像データに対応する画像を印刷する(ステップS49)。そして、印刷処理が完了すると、CPU101はRAM103のキャッシュ状態を更新する(ステップS50)。そして、全MCUライン分について上記ステップS43〜S50が完了すると、一連の処理を終了する。   The CPU 101 performs layout processing such as resizing and rotation on the image data corrected in this way (step S48), 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 S49). When the printing process is completed, the CPU 101 updates the cache state of the RAM 103 (step S50). When the above steps S43 to S50 are completed for all the MCU lines, a series of processes is terminated.

以上のように、第1実施形態によれば、プリンター顔領域FRpがカメラ顔領域FRcと重なる場合には、そのカメラ顔領域FRcを特定するカメラ顔座標を補正基礎情報として座標リストに登録する一方、そのプリンター顔領域FRpを特定するプリンター顔座標を実質的に削除して補正基礎情報に含めていない。このように、当該カメラ顔座標を使用して画像データを補正しているので、印刷装置100側での誤検出などの影響を受けることなく、画像データを適正に補正することができる。また、プリンター顔領域FRpにカメラ顔領域FRcと重ならない非重複領域(例えば図4中のプリンター顔領域FRp′)が含まれるときには、非重複領域を特定するプリンター顔座標を補正基礎情報に含めてもよく、これによりデジタルカメラ200における顔認識時点では認識されていなかった人物の顔も考慮して画像データを補正することができる。   As described above, according to the first embodiment, when the printer face area FRp overlaps the camera face area FRc, the camera face coordinates specifying the camera face area FRc are registered in the coordinate list as correction basic information. The printer face coordinates that specify the printer face area FRp are substantially deleted and are not included in the correction basic information. In this way, since the image data is corrected using the camera face coordinates, the image data can be corrected appropriately without being affected by erroneous detection on the printing apparatus 100 side. When the printer face area FRp includes a non-overlapping area that does not overlap with the camera face area FRc (for example, the printer face area FRp ′ in FIG. 4), the printer face coordinates specifying the non-overlapping area are included in the correction basic information. As a result, the image data can be corrected in consideration of the face of a person who has not been recognized at the time of face recognition in the digital camera 200.

また、第1実施形態では、非重複領域が検出されるものの、その非重複領域の顔明度が適正顔明度範囲から外れる場合や非重複領域の顔サイズが適正顔サイズ範囲を外れるには、そのような不適正な非重複領域を特定するプリンター顔座標を補正基礎情報に含めていない。このため、画像データをより適正に補正することができる。   In the first embodiment, a non-overlapping area is detected, but the face brightness of the non-overlapping area is out of the appropriate face brightness range or the face size of the non-overlapping area is out of the appropriate face size range. Printer face coordinates that specify such inappropriate non-overlapping areas are not included in the basic correction information. For this reason, image data can be corrected more appropriately.

このように、第1実施形態では、エンハンス処理が本発明の「画像データの補正」に相当し、プリンター顔領域FRpおよびプリンター顔座標(LT1p,LB1p,RT1p,RB1p)等がそれぞれ本発明の「第1顔領域」および「第1顔情報」に相当し、カメラ顔領域FRcおよびカメラ顔座標(LT1c,LB1c,RT1c,RB1c)等がそれぞれ本発明の「第2顔領域」および「第2顔情報」に相当している。   As described above, in the first embodiment, the enhancement processing corresponds to “image data correction” according to the present invention, and the printer face area FRp, the printer face coordinates (LT1p, LB1p, RT1p, RB1p), etc. It corresponds to “first face area” and “first face information”, and the camera face area FRc, camera face coordinates (LT1c, LB1c, RT1c, RB1c) and the like are “second face area” and “second face” of the present invention, respectively. Corresponds to "information".

ところで、上記第1実施形態では、同一人物の顔に対してカメラ顔座標とプリンター顔座標とが検出された場合、常にカメラ顔座標を補正基礎情報としているが、次のような問題が発生することがある。例えばデジタルカメラ200で人物を撮像する際、ピント合わせを行った後で人物が動いてしまうと、カメラ顔座標よりもプリンター顔座標の方が人物位置をより正確に表しているため、これを補正基礎情報として用いるのが好ましい。以下、図8を参照しつつ、顔領域の色相が肌色か否かに基づいて補正基礎情報を設定する実施形態について説明する。   By the way, in the first embodiment, when camera face coordinates and printer face coordinates are detected for the face of the same person, the camera face coordinates are always used as basic correction information. However, the following problems occur. Sometimes. For example, if a person moves after focusing with the digital camera 200, the printer face coordinates represent the person position more accurately than the camera face coordinates, and this is corrected. It is preferably used as basic information. Hereinafter, an embodiment in which correction basic information is set based on whether or not the hue of the face area is skin color will be described with reference to FIG.

図8は、本発明にかかる画像処理装置の第2実施形態の動作を示すフローチャートである。この第2実施形態が第1実施形態と大きく相違する点は、カメラ顔領域とプリンター顔領域とが重なる場合に、プリンター顔およびカメラ顔の色相を考慮していずれの顔座標を補正基礎情報として座標リストに登録するかを決定している点であり、その他の構成は基本的に同一である。したがって、以下においては、相違点を中心に説明し、同一構成については同一符号を付して説明を省略する。   FIG. 8 is a flowchart showing the operation of the second embodiment of the image processing apparatus according to the present invention. The second embodiment differs greatly from the first embodiment in that when the camera face area and the printer face area overlap, any face coordinates are used as correction basic information in consideration of the hue of the printer face and the camera face. Whether to register in the coordinate list is determined, and other configurations are basically the same. Therefore, in the following, differences will be mainly described, and the same components will be denoted by the same reference numerals and description thereof will be omitted.

この第2実施形態では、第1実施形態と同様にして、CPU101は、ステップS15でRAM103に格納した画像データを使って顔認識処理を行ってプリンター顔座標を求めるとともに、顔個数Ncおよび顔座標を取得する。そして、CPU101は、ステップS17で検出したプリンター顔のなかにNc番目のカメラ顔と重なる(あるいは一致する)ものがあるか否かを判別する(ステップS23)。そして、このステップS23でNc番目のカメラ顔と重なるプリンター顔が見つかった場合、第1実施形態では当該プリンター顔を特定するプリンター顔座標をRAM103から削除する(ステップS24)のに対し、第2実施形態では次に説明するように第1実施形態と異なる処理を実行している(ステップS24a〜S24f)。   In the second embodiment, as in the first embodiment, the CPU 101 performs face recognition processing using the image data stored in the RAM 103 in step S15 to obtain the printer face coordinates, and the number of faces Nc and the face coordinates. To get. Then, the CPU 101 determines whether any of the printer faces detected in step S17 overlap (or match) the Nc-th camera face (step S23). If a printer face that overlaps with the Nc-th camera face is found in step S23, the printer face coordinates that specify the printer face are deleted from the RAM 103 in the first embodiment (step S24), whereas the second face is used. In the embodiment, processing different from that of the first embodiment is executed as described below (steps S24a to S24f).

この第2実施形態では、CPU101はNc番目のカメラ顔と重なるプリンター顔の色相を計算し(ステップS24a)、その計算結果からプリンター顔が肌色ではないか否かを判別する(ステップS24b)。ここで、肌色を判別する際、RGBでの認識よりも直感的に色域の指定がしやすいHSB色空間で判別するのが望ましく、本実施形態ではこれにより肌色か否かを判別している。この点に関しては、カメラ顔が肌色か否かを判別する際も同様である。   In the second embodiment, the CPU 101 calculates the hue of the printer face that overlaps with the Nc-th camera face (step S24a), and determines from the calculation result whether the printer face is not a skin color (step S24b). Here, when discriminating the skin color, it is desirable to discriminate in the HSB color space where it is easier to intuitively specify the color gamut than the recognition in RGB. In this embodiment, it is discriminated whether the color is skin color. . This is the same when determining whether or not the camera face is a skin color.

そして、CPU101は、プリンター顔が肌色ではないと判別した場合(ステップS24bで「YES」)には、第1実施形態と同様に、当該プリンター顔を特定するプリンター顔座標をRAM103から削除するとともに、プリンター顔個数Npを「1」だけデクリメントした(ステップS24c)後にステップS24dに進む。一方、プリンター顔が肌色であると判別した場合(ステップS24bで「NO」)には、そのままステップS24dに進む。このように、カメラ顔と重なっているにもかかわらず当該プリンター顔を残しておくことで、当該プリンター顔を特定するプリンター顔座標が補正基礎情報として座標リストに登録される可能性が残される。つまり、当該プリンター顔の平均顔明度が適正顔明度範囲内であり、しかも顔サイズが適正顔サイズ範囲内である場合には、当該プリンター顔を特定するプリンター顔座標が補正基礎情報として座標リストに登録される。   If the CPU 101 determines that the printer face is not a skin color (“YES” in step S24b), the CPU 101 deletes the printer face coordinates that identify the printer face from the RAM 103, as in the first embodiment, and After decrementing the printer face number Np by “1” (step S24c), the process proceeds to step S24d. On the other hand, if it is determined that the printer face is skin color (“NO” in step S24b), the process proceeds directly to step S24d. As described above, by leaving the printer face in spite of overlapping with the camera face, there remains a possibility that the printer face coordinates specifying the printer face are registered in the coordinate list as the correction basic information. That is, when the average face brightness of the printer face is within the appropriate face brightness range and the face size is within the appropriate face size range, the printer face coordinates that identify the printer face are included in the coordinate list as correction basic information. be registered.

次のステップS24dでは、CPU101は、Nc番目のカメラ顔の色相を計算する。そして、その計算結果からカメラ顔が肌色ではないか否かをCPU101は判別する(ステップS24e)。そして、CPU101は、カメラ顔が肌色であると判別した場合(ステップS24eで「NO」)には、第1実施形態と同様に、Nc番目のカメラ顔座標をRAM103の座標リストに登録し、さらにカメラ顔個数Ncを「1」だけデクリメントし(ステップS25)、ステップS20に戻る。一方、カメラ顔が肌色ではないと判別した場合(ステップS24eで「YES」)には、CPU101は座標リストへの登録を行うことなく、Nc番目のカメラ顔座標を実質的に削除するとともに、カメラ顔個数Ncを「1」だけデクリメントし(ステップS24f)、ステップS20に戻る。   In the next step S24d, the CPU 101 calculates the hue of the Nc-th camera face. Then, the CPU 101 determines whether the camera face is not a skin color from the calculation result (step S24e). If the CPU 101 determines that the camera face is skin color (“NO” in step S24e), the CPU 101 registers the Nc-th camera face coordinate in the coordinate list of the RAM 103, as in the first embodiment, and further The camera face number Nc is decremented by “1” (step S25), and the process returns to step S20. On the other hand, if it is determined that the camera face is not a skin color (“YES” in step S24e), the CPU 101 substantially deletes the Nc-th camera face coordinates without registering in the coordinate list, and The face number Nc is decremented by “1” (step S24f), and the process returns to step S20.

以上のように、第2実施形態によれば、カメラ顔およびプリンター顔の各々について顔色が肌色か否かを判別し、顔色が肌色でないと判別したときには、その顔を特定する顔座標は補正基礎情報として座標リストに登録されず、画像データの補正に用いられない。したがって、画像データをより適正に補正することができる。   As described above, according to the second embodiment, for each of the camera face and the printer face, it is determined whether or not the face color is a skin color, and when it is determined that the face color is not a skin color, the face coordinates that specify the face are the correction basis. It is not registered in the coordinate list as information and is not used for correcting image data. Therefore, the image data can be corrected more appropriately.

なお、本発明は上記した実施形態に限定されるものではなく、その趣旨を逸脱しない限りにおいて上述したもの以外に種々の変更を行うことが可能である。例えば、上記実施形態では、画像データに顔座標などを付加した画像ファイルをメモリカード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 face coordinates and 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.

また、上記実施形態では、顔領域を4点の座標で示しているが、顔領域の表現方式はこれに限定されるものではなく、例えば中心座標に大きさを組み合わせたもの、中心座標に幅および高さを組み合わせたもの等を用いることができ、これらの表現方式でカメラ顔領域やプリンター顔領域を特定した顔座標も本発明の「顔情報」に含まれる。   Further, in the above embodiment, the face area is indicated by the coordinates of the four points, but the expression method of the face area is not limited to this, for example, the combination of the size to the center coordinate, the width to the center coordinate A combination of height and the like can be used, and the face coordinates specifying the camera face area and the printer face area by these expression methods are also included in the “face information” of the present invention.

また、上記実施形態では、本発明にかかる画像処理装置および方法を印刷装置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、光ディスク、光磁気ディスク、不揮発性メモリカードなどの記憶媒体に記憶させ、この記憶媒体からプログラムをコードとして読み出し、コンピューターにおいて実行してもよい。つまり、上記プログラムを記憶した記憶媒体、コンピュータープログラム自体も本発明の一実施形態に含まれる。   A 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 from the storage medium as a code. May be executed. That is, the storage medium storing the above program and the computer program itself are also included in one embodiment of the present invention.

100…印刷装置、 101…CPU(顔情報検出部、顔情報取得部、情報選択部、補正部)、 102…ROM、 103…RAM、 104…EEPROM、 200…デジタルカメラ、 307…圧縮データ(画像データ)、 FRc…(第2)顔領域、 FRp…(第1)顔領域、FRp′…非重複領域   DESCRIPTION OF SYMBOLS 100 ... Printing apparatus 101 ... CPU (Face information detection part, Face information acquisition part, Information selection part, Correction | amendment part), 102 ... ROM, 103 ... RAM, 104 ... EEPROM, 200 ... Digital camera, 307 ... Compression data (image) (Data), FRc (second) face area, FRp (first) face area, FRp '... non-overlapping area

Claims (8)

画像データから人物の顔を認識する顔認識処理を実行して第1顔情報を検出する顔情報検出部と、
前記画像データに付加される第2顔情報を取得する顔情報取得部と、
顔情報を含む補正基礎情報に基づいて前記画像データを補正する補正部と、
前記第1顔情報で特定される第1顔領域が前記第2顔情報で特定される第2顔領域と重なるときには、前記第1顔領域と重なる前記第2顔領域を特定する第2顔情報を前記補正基礎情報に含める情報選択部と
を備えることを特徴とする画像処理装置。
A face information detection unit that executes face recognition processing for recognizing a person's face from image data and detects first face information;
A face information acquisition unit that acquires second face information added to the image data;
A correction unit that corrects the image data based on correction basic information including face information;
When the first face area specified by the first face information overlaps with the second face area specified by the second face information, second face information for specifying the second face area overlapping the first face area And an information selection unit including the correction basic information in the correction basic information.
前記情報選択部は、前記第1顔情報で特定される前記第1顔領域に前記第2顔領域と重ならない非重複領域が含まれるとき、前記非重複領域を特定する第1顔情報を前記補正基礎情報に含める請求項1に記載の画像処理装置。   The information selection unit, when the non-overlapping area that does not overlap the second face area is included in the first face area specified by the first face information, the first face information that specifies the non-overlapping area The image processing apparatus according to claim 1, which is included in the correction basic information. 前記情報選択部は、前記補正基礎情報に含まれる第2顔情報の各々により特定される第2顔領域の平均顔明度を算出するとともに前記平均顔明度を含む適正顔明度範囲を求め、前記非重複領域の顔明度が前記適正顔明度範囲から外れるときには前記非重複領域を特定する第1顔情報を前記補正基礎情報に含めない請求項2に記載の画像処理装置。   The information selecting unit calculates an average facial brightness of the second face area specified by each of the second facial information included in the correction basic information, obtains an appropriate facial brightness range including the average facial brightness, and The image processing apparatus according to claim 2, wherein the first basic face information that specifies the non-overlapping area is not included in the correction basic information when the facial brightness of the overlapping area is out of the appropriate facial brightness range. 前記情報選択部は、前記補正基礎情報に含まれる第2顔情報の各々により特定される第2顔領域の平均顔サイズを算出するとともに前記平均顔サイズを含む適正顔サイズ範囲を求め、前記非重複領域の顔サイズが前記適正顔サイズ範囲から外れるときには前記非重複領域を特定する第1顔情報を前記補正基礎情報に含めない請求項2または3に記載の画像処理装置。   The information selection unit calculates an average face size of a second face area specified by each of the second face information included in the correction basic information and obtains an appropriate face size range including the average face size, 4. The image processing apparatus according to claim 2, wherein when the face size of the overlapping area is out of the appropriate face size range, the first face information for specifying the non-overlapping area is not included in the correction basic information. 前記情報選択部は、前記第2顔領域と重なる前記第1顔領域の色相が肌色であるときには、前記第2顔領域と重なる前記第1顔領域を特定する第1顔情報を前記補正基礎情報に含める請求項1ないし4のいずれか一項に記載の画像処理装置。   When the hue of the first face area that overlaps the second face area is skin color, the information selection unit determines the first face information that identifies the first face area that overlaps the second face area as the correction basic information. The image processing apparatus according to claim 1, wherein the image processing apparatus is included in the image processing apparatus. 前記情報選択部は、前記第1顔領域と重なる前記第2顔領域の色相が肌色でないときには、前記第1顔領域と重なる前記第2顔領域を特定する第2顔情報を前記補正基礎情報に含めない請求項1ないし5のいずれか一項に記載の画像処理装置。   When the hue of the second face area that overlaps the first face area is not skin color, the information selection unit uses the second face information that specifies the second face area that overlaps the first face area as the correction basic information. The image processing apparatus according to claim 1, which is not included. 前記情報選択部は、前記第1顔領域と前記第2顔領域との重なり部分の面積が前記第2顔領域の面積の40%以上であるときに前記第1顔領域が前記第2顔領域に重なっていると判別する請求項1ないし6のいずれか一項に記載の画像処理装置。   The information selection unit is configured such that when the area of the overlapping portion between the first face area and the second face area is 40% or more of the area of the second face area, the first face area is the second face area. The image processing apparatus according to claim 1, wherein the image processing apparatus determines that the image is overlapped with the image processing apparatus. 画像データから人物の顔を認識する顔認識処理を実行して第1顔情報を検出する第1工程と、
前記画像データに付加される第2顔情報を取得する第2工程と、
前記第1顔情報で特定される第1顔領域が前記第2顔情報で特定される第2顔領域と重なるときには前記第1顔領域が前記第2顔領域に重なる第2顔情報に基づいて前記画像データを補正する第3工程と
を備えることを特徴とする画像処理方法。
A first step of detecting face information by performing face recognition processing for recognizing a person's face from image data;
A second step of acquiring second face information added to the image data;
When the first face area specified by the first face information overlaps the second face area specified by the second face information, the first face area is based on the second face information overlapping the second face area. And a third step of correcting the image data.
JP2010258644A 2010-11-19 2010-11-19 Image processing apparatus, image processing program, and image processing method Active JP5830851B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010258644A JP5830851B2 (en) 2010-11-19 2010-11-19 Image processing apparatus, image processing program, and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010258644A JP5830851B2 (en) 2010-11-19 2010-11-19 Image processing apparatus, image processing program, and image processing method

Publications (2)

Publication Number Publication Date
JP2012109896A true JP2012109896A (en) 2012-06-07
JP5830851B2 JP5830851B2 (en) 2015-12-09

Family

ID=46495015

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010258644A Active JP5830851B2 (en) 2010-11-19 2010-11-19 Image processing apparatus, image processing program, and image processing method

Country Status (1)

Country Link
JP (1) JP5830851B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021218325A1 (en) * 2020-04-27 2021-11-04 北京字节跳动网络技术有限公司 Video processing method and apparatus, and computer-readable medium and electronic device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008250444A (en) * 2007-03-29 2008-10-16 Omron Corp Face detection device, face detection method, and face detection program
JP2009094946A (en) * 2007-10-11 2009-04-30 Fujifilm Corp Image pickup device and portrait right protection method in the same device
JP2009110486A (en) * 2007-11-01 2009-05-21 Sony Corp Unit, method and program for image processing, imaging unit, and control method for imaging unit
JP2010009228A (en) * 2008-06-25 2010-01-14 Canon Inc Image processor, image processing method, computer program, and storage medium
JP2010010947A (en) * 2008-06-25 2010-01-14 Canon Inc Image processing apparatus, image processing method, program, and recording medium
JP2010010938A (en) * 2008-06-25 2010-01-14 Canon Inc Image processing apparatus, image processing method, program and computer-readable recording medium
JP2010160640A (en) * 2009-01-07 2010-07-22 Seiko Epson Corp Image processor, printer, image processing method and image processing program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008250444A (en) * 2007-03-29 2008-10-16 Omron Corp Face detection device, face detection method, and face detection program
JP2009094946A (en) * 2007-10-11 2009-04-30 Fujifilm Corp Image pickup device and portrait right protection method in the same device
JP2009110486A (en) * 2007-11-01 2009-05-21 Sony Corp Unit, method and program for image processing, imaging unit, and control method for imaging unit
JP2010009228A (en) * 2008-06-25 2010-01-14 Canon Inc Image processor, image processing method, computer program, and storage medium
JP2010010947A (en) * 2008-06-25 2010-01-14 Canon Inc Image processing apparatus, image processing method, program, and recording medium
JP2010010938A (en) * 2008-06-25 2010-01-14 Canon Inc Image processing apparatus, image processing method, program and computer-readable recording medium
JP2010160640A (en) * 2009-01-07 2010-07-22 Seiko Epson Corp Image processor, printer, image processing method and image processing program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021218325A1 (en) * 2020-04-27 2021-11-04 北京字节跳动网络技术有限公司 Video processing method and apparatus, and computer-readable medium and electronic device
US11800043B2 (en) 2020-04-27 2023-10-24 Beijing Bytedance Network Technology Co., Ltd. Video processing method and apparatus, and computer-readable medium and electronic device

Also Published As

Publication number Publication date
JP5830851B2 (en) 2015-12-09

Similar Documents

Publication Publication Date Title
JP4487775B2 (en) Panorama composition processing of multiple image data
JP5886265B2 (en) Portable terminal device, program, and recording medium
JP5127592B2 (en) Image processing apparatus, image processing method, program, and computer-readable recording medium
JP2000209425A (en) Device and method for processing image and storage medium
JP2000350077A (en) Digital camera and method for photographing and transferring document
JP2002199410A (en) Imaging device, compensating processing method for deteriorated image and storage medium
JP2010021921A (en) Electronic camera and image processing program
JP2004096506A (en) Image forming method, image processor and image recording device
JP5609555B2 (en) Image processing apparatus, program, and image processing method
JP2005260657A (en) Photographing apparatus, image processing method and program therefor
JP2014123881A (en) Information processing device, information processing method, and computer program
JP2012175500A (en) Image processing method, control program, and image processing device
JP5830851B2 (en) Image processing apparatus, image processing program, and image processing method
JP2008061209A (en) Image processing method
US8630503B2 (en) Image processing apparatus, image processing method, and computer program
JP5644578B2 (en) Image processing apparatus, image processing method, and computer program for image processing
JP2006279460A (en) Image processor, printer, image processing method, and image processing program
US7609425B2 (en) Image data processing apparatus, method, storage medium and program
JP5500048B2 (en) Image processing method and image processing apparatus
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
JP5625832B2 (en) Image processing apparatus and image processing method
JP5195317B2 (en) Camera device, photographing method, and photographing control program
JP2012146164A (en) Image processing method, control program and image processing system
JP2012099897A (en) Image processing method and image processing device
JP2004222078A (en) Image processor, image processing method, and program thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130722

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140327

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140430

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140626

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20150106

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150203

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150325

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151012

R150 Certificate of patent or registration of utility model

Ref document number: 5830851

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350