JP2010004300A - Image processing method, image processing apparatus, image processing program, and printer - Google Patents

Image processing method, image processing apparatus, image processing program, and printer Download PDF

Info

Publication number
JP2010004300A
JP2010004300A JP2008161003A JP2008161003A JP2010004300A JP 2010004300 A JP2010004300 A JP 2010004300A JP 2008161003 A JP2008161003 A JP 2008161003A JP 2008161003 A JP2008161003 A JP 2008161003A JP 2010004300 A JP2010004300 A JP 2010004300A
Authority
JP
Japan
Prior art keywords
image processing
image
face
determination
detected
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.)
Pending
Application number
JP2008161003A
Other languages
Japanese (ja)
Inventor
Masatoshi Matsudaira
正年 松平
Tsunesuke Shinkai
恒扶 新開
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 JP2008161003A priority Critical patent/JP2010004300A/en
Publication of JP2010004300A publication Critical patent/JP2010004300A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To perform image processing suitable for a variety of objects. <P>SOLUTION: When the image processing is performed to an image indicated by image data 13b, a human face as a first object and an animal face or a doubtful face as a second object, etc. are detected from the image first. Then, first image processing (steps S270, S280) is executed to the whole of the image on the basis of the detected human face as the first object, and second image processing (steps S300, S310) is performed to a region where the second object is detected. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、画像処理方法、画像処理装置、画像処理プログラムおよび印刷装置に関する。   The present invention relates to an image processing method, an image processing apparatus, an image processing program, and a printing apparatus.

画像から人物の顔を検出し、その検出結果に応じて画像処理のパラメータを設定するものが提案されている(特許文献1、参照。)。当該文献においては、人物の顔が検出された場合には人物写真用の画像処理のパラメータを設定し、人物の顔が検出されなかった場合には被人物画像用の画像処理のパラメータを設定している。
特開2005−63406号公報
There has been proposed one that detects a human face from an image and sets image processing parameters in accordance with the detection result (see Patent Document 1). In this document, when a human face is detected, image processing parameters for portraits are set, and when no human face is detected, image processing parameters for person images are set. ing.
JP 2005-63406 A

しかしながら、デジタルスチルカメラで撮影した写真に含まれるオブジェクトは単一種のものには限られず、同時に複数の種類のオブジェクトが含まれることも考えられる。その場合、上述した文献の技術では、各オブジェクトの性質に応じて適切な画像処理を実行することができないという問題があった。特に、人物写真の場合、人物の顔に注目して撮影を行うが、背景等に意図しない被写体(オブジェクト)が写り込むことがある。多くの場合、ユーザーは、このような意図しないオブジェクトに対して目立たないように補正をしたいと望むが、人物の顔と同様の画像処理が意図しないオブジェクトに対しても行われてしまうという問題があった。
本発明は前記課題にかんがみてなされたもので、多種のオブジェクトに適した画像処理が可能な画像処理方法、画像処理装置、画像処理プログラムおよび印刷装置を提供することを目的とする。
However, an object included in a photograph taken with a digital still camera is not limited to a single type, and a plurality of types of objects may be included at the same time. In that case, the technique disclosed in the above-described literature has a problem that appropriate image processing cannot be executed according to the property of each object. In particular, in the case of a human photograph, shooting is performed while paying attention to a person's face, but an unintended subject (object) may appear in the background or the like. In many cases, the user wants to make corrections so as not to stand out for such unintended objects, but the problem is that image processing similar to that of a person's face is also performed on unintended objects. there were.
The present invention has been made in view of the above problems, and an object thereof is to provide an image processing method, an image processing apparatus, an image processing program, and a printing apparatus that can perform image processing suitable for various objects.

前記課題を解決するため請求項1にかかる発明では、画像データが示す画像に画像処理を実行するにあたり、まず前記画像から第1オブジェクトと第2オブジェクトを検出する。そして、検出された前記第1オブジェクトに基づき前記画像の全体に対する第1画像処理を実行する。例えば、前記第1オブジェクトの色や明るさに基づいて前記画像全体の色や明るさを補正する。一方、前記第2オブジェクトが検出された領域については、上記第1画像処理とは別途、第2画像処理を実行する。この第2画像処理は、前記第2オブジェクトが検出された領域について行われるため、局所的な画像処理効果を得ることができる。   In order to solve the above-mentioned problem, in the invention according to claim 1, when performing image processing on an image indicated by image data, first, a first object and a second object are detected from the image. Then, first image processing is executed on the entire image based on the detected first object. For example, the color and brightness of the entire image are corrected based on the color and brightness of the first object. On the other hand, for the area where the second object is detected, the second image processing is executed separately from the first image processing. Since the second image processing is performed on the area where the second object is detected, a local image processing effect can be obtained.

また、前記第1画像処理と前記第2画像処理の好適な例として、前記第1画像処理と前記第2画像処理を互いに種類の異なる画像処理とするようにしてもよい。例えば、前記第1画像処理として前記画像全体の色や明るさを補正し、前記第2画像処理としてシャープネス(強調)処理やぼかし処理等を行うようにしてもよい。このようにすることにより、全体の明るさや色合いを適正にしつつ、好ましい前記第2オブジェクトについては強調し、好ましくない前記第2オブジェクトについてはぼかすことができる。   Further, as a suitable example of the first image processing and the second image processing, the first image processing and the second image processing may be different types of image processing. For example, the color and brightness of the entire image may be corrected as the first image processing, and sharpness (enhancement) processing, blurring processing, and the like may be performed as the second image processing. By doing so, it is possible to emphasize the preferred second object and blur the undesirable second object while making the overall brightness and hue appropriate.

また、前記第2オブジェクトに対して局所的な前記第2画像処理を行うにあたり、その影響範囲を予めユーザーが確認できるようにするのが望ましい。そのため、前記画像において前記第2オブジェクトを指し示す表示を行うようにしてもよい。このようにすることにより、どのような領域に前記第2画像処理が行われるかを予め知ることができる。例えば、前記第2オブジェクトが検出された領域を枠で囲うようにしてもよい。このような表示を行った場合、さらに前記第2画像処理の指示を受け付けるようにしてもよい。これにより、どのような前記第2オブジェクトが検出されたかを知ることができ、例えば好ましい前記第2オブジェクトについては強調し、好ましくない前記第2オブジェクトについてはぼかすというような選択をすることができる。   In addition, when performing the second image processing locally on the second object, it is desirable that the user can confirm the influence range in advance. Therefore, display indicating the second object may be performed in the image. In this way, it is possible to know in advance in what area the second image processing is performed. For example, a region where the second object is detected may be surrounded by a frame. When such display is performed, an instruction for the second image processing may be received. Thus, it is possible to know what kind of the second object has been detected. For example, it is possible to select such that the preferable second object is emphasized and the unfavorable second object is blurred.

前記第1オブジェクトと前記第2オブジェクトの具体的な例として、前記第1オブジェクトは人の顔とし、前記第2オブジェクトを人の顔に類似するものとしてもよい。このようにすることにより、基本的に主たる被写体であると考えられる人の顔に基づいて全体の前記第1画像処理を実行することができる。   As a specific example of the first object and the second object, the first object may be a human face, and the second object may be similar to a human face. By doing in this way, the said 1st image process of the whole can be performed based on the face of a person considered to be a main subject fundamentally.

さらに、本発明の技術的思想は、具体的な画像処理方法にて具現化されるのみならず、当該方法を画像処理装置において具現化することもできる。すなわち、上述した画像処理方法が行う各工程に対応する手段を有する画像処理装置としても本発明を特定することができる。むろん、上述した画像処理装置がプログラムを読み込んで上述した各手段を実現する場合には、当該各手段に対応する機能を実行させるプログラムや当該プログラムを記録した各種記録媒体においても本発明の技術的思想が具現化できることは言うまでもない。なお、本発明の画像処理装置は、単一の装置のみならず、複数の装置によって分散して存在可能であることはいうまでもない。また、プリンタ等の印刷装置やデジタルスチルカメラ等の画像入力装置において本発明の画像処理方法を実現するようにしてもよい。   Furthermore, the technical idea of the present invention can be embodied not only in a specific image processing method but also in an image processing apparatus. That is, the present invention can be specified as an image processing apparatus having means corresponding to each step performed by the above-described image processing method. Of course, when the above-described image processing apparatus reads the program to realize each of the above-described means, the technical features of the present invention can be applied to a program for executing a function corresponding to each of the means and various recording media on which the program is recorded. Needless to say, the idea can be embodied. Needless to say, the image processing apparatus of the present invention can be distributed not only by a single apparatus but also by a plurality of apparatuses. Further, the image processing method of the present invention may be realized in a printing apparatus such as a printer or an image input apparatus such as a digital still camera.

ここでは、下記の順序に従って本発明の実施形態について説明する。
(1)コンピュータの構成:
(2)オブジェクト検出処理:
(3)画像処理・印刷処理:
(4)変形例:
Here, embodiments of the present invention will be described in the following order.
(1) Computer configuration:
(2) Object detection processing:
(3) Image processing / printing processing:
(4) Modification:

(1)コンピュータの構成:
図1は、本発明のオブジェクト検出装置を具体的に実現するコンピュータの概略構成を示している。同図において、コンピュータ10には、内部バス18によって接続されたCPU11とRAM12とHDD13とUSBインターフェイス(I/F)14と入力機器インターフェイス(I/F)15とビデオインターフェイス(I/F)16とが備えられており、HDD13には各種プログラムデータ13aと複数の画像データ13b,13b,13b・・・が記憶されている。CPU11は、このプログラムデータ13aを読み出して、同プログラムデータ13aに基づいた処理を、RAM12をワークエリアとして利用しながら実行する。USBI/F14にはプリンタ20とデジタルスチルカメラ30が接続されており、入力機器インターフェイス15にはマウス40およびキーボード50が接続されている。さらに、ビデオI/F16にはディスプレイ60が接続されている。
(1) Computer configuration:
FIG. 1 shows a schematic configuration of a computer that specifically realizes the object detection apparatus of the present invention. In FIG. 1, a computer 10 includes a CPU 11, a RAM 12, an HDD 13, a USB interface (I / F) 14, an input device interface (I / F) 15, and a video interface (I / F) 16 connected by an internal bus 18. The HDD 13 stores various program data 13a and a plurality of image data 13b, 13b, 13b. The CPU 11 reads the program data 13a and executes processing based on the program data 13a while using the RAM 12 as a work area. A printer 20 and a digital still camera 30 are connected to the USB I / F 14, and a mouse 40 and a keyboard 50 are connected to the input device interface 15. Further, a display 60 is connected to the video I / F 16.

図2は、コンピュータ10にて実行されるプログラムのソフトウェア構成を示している。コンピュータ10においては図示しないオペレーティングシステム(O/S)が実行されており、同O/S上にてプリンタドライバPが実行されている。プリンタドライバPは、概略、オブジェクト検出部P1と画像処理部P2と印刷実行部P3とから構成されている。オブジェクト検出部P1は、判定条件設定部P1aと検出窓設定部P1bと類似度算出部P1cと閾値判定部P1dと色判定部P1eとコントラスト判定部P1fとから構成されている。オブジェクト検出部P1は第1オブジェクトとしての人の顔と、第2オブジェクトとしての不審顔および動物の顔等を検出する。なお、不審顔とは、主としてデジタルスチルカメラ等によって撮影された本来は写るべきではない不審な顔であり、例えば被写体の周囲にある反射物によって反射されることにより意図せず写り込んだ顔や、撮影時における光学的/電気的な残像によって写り込んだ顔等が挙げられる。また、人の顔に起因せず、例えば木の葉や石などの偶然の配置によって顔のように見える場合も不審顔の範疇に含まれる。なお、不審顔および動物の顔は、第2オブジェクトとして検出されるものの一例であり、他のものが第2オブジェクトとして検出することも考えられる。   FIG. 2 shows a software configuration of a program executed on the computer 10. In the computer 10, an operating system (O / S) (not shown) is executed, and a printer driver P is executed on the O / S. The printer driver P generally includes an object detection unit P1, an image processing unit P2, and a print execution unit P3. The object detection unit P1 includes a determination condition setting unit P1a, a detection window setting unit P1b, a similarity calculation unit P1c, a threshold determination unit P1d, a color determination unit P1e, and a contrast determination unit P1f. The object detection unit P1 detects a human face as a first object, a suspicious face and an animal face as a second object, and the like. Note that a suspicious face is a suspicious face that should not be originally captured, mainly taken by a digital still camera, for example, a face that is unintentionally reflected by being reflected by a reflector around the subject. And a face reflected by an optical / electrical afterimage at the time of photographing. In addition, a case where the face looks like a face by accidental arrangement such as leaves or stones is not included in the category of a suspicious face. Note that the suspicious face and the animal's face are examples of what is detected as the second object, and other objects may be detected as the second object.

判定条件設定部P1aは、後述する検出窓設定部P1bと類似度算出部P1cと閾値判定部P1dと色判定部P1eとコントラスト判定部P1fに種々の判定パラメータを指定するものであり、検出対象が第1オブジェクトであるか第2オブジェクトであるかによって異なる判定パラメータを指定する。検出窓設定部P1bは、対象の画像データ13bからサイズ変換したQVGA(320×240)サイズの検出用画像データを生成し、当該検出用画像データに検出窓(検出領域)SWを設定する。この検出窓SWの大きさと位置と角度を順次シフトさせることにより、検出用画像データにおいてあらゆる大きさや位置や角度で存在する第1オブジェクトと第2オブジェクトを検出することができる。第1オブジェクトと第2オブジェクトを検出する際の検出窓SWの大きさの範囲が判定条件設定部P1aによって指定されており、当該指定に沿った範囲で検出窓SWの大きさをシフトさせる。なお、本実施形態において画像データ13bは、Exifフォーマットの画像データであり、処理時にデコードすることにより、各画素がRGB値の色情報を有するものとされる。同様に、検出用画像データの各画素もRGB値の色情報を有する。   The determination condition setting unit P1a designates various determination parameters to a detection window setting unit P1b, a similarity calculation unit P1c, a threshold determination unit P1d, a color determination unit P1e, and a contrast determination unit P1f, which will be described later. Different determination parameters are specified depending on whether the object is the first object or the second object. The detection window setting unit P1b generates QVGA (320 × 240) size detection image data whose size has been converted from the target image data 13b, and sets a detection window (detection region) SW in the detection image data. By sequentially shifting the size, position, and angle of the detection window SW, it is possible to detect the first object and the second object that exist in all sizes, positions, and angles in the detection image data. The range of the size of the detection window SW when detecting the first object and the second object is designated by the determination condition setting unit P1a, and the size of the detection window SW is shifted within the range according to the designation. In the present embodiment, the image data 13b is Exif format image data, and each pixel has color information of RGB values by decoding at the time of processing. Similarly, each pixel of the detection image data has color information of RGB values.

類似度算出部P1cは、順次シフトされる検出窓SWに含まれる画像を取得し、当該画像から複数の特徴量(検出窓SW内の種々の領域における色や輝度やコントラスト等)を取得する。そして、複数の特徴量をHDD13に記憶された類似度評価関数13cに入力し、その結果として類似度を算出する。本実施形態の類似度評価関数13cは、顔を含んだ多数のサンプル(テンプレート)から得られた複数の特徴量を学習データとして公知の学習方法によって学習を行ったニューラルネットワークであり、当該ニューラルネットワークの出力値が類似度を示している。この類似度は0〜1000の値となるように正規化されており、値が大きいほど顔を含んだサンプルとの類似性が高いと判断することができる。すなわち、類似度が1000に近い場合に検出窓SWに顔が含まれていると判定することができる。閾値判定部P1dは、判定条件設定部P1aから指定された閾値と、類似度とを比較し、その結果に応じて当該検出窓SWに第1オブジェクトと第2オブジェクトが存在するか否かを判定する。   The similarity calculation unit P1c acquires an image included in the detection window SW that is sequentially shifted, and acquires a plurality of feature amounts (color, brightness, contrast, and the like in various regions in the detection window SW) from the image. Then, a plurality of feature amounts are input to the similarity evaluation function 13c stored in the HDD 13, and the similarity is calculated as a result. The similarity evaluation function 13c according to the present embodiment is a neural network in which a plurality of feature amounts obtained from a large number of samples (templates) including faces are learned by a known learning method as learning data. The output value indicates the similarity. The similarity is normalized so as to have a value of 0 to 1000, and it can be determined that the larger the value is, the higher the similarity is with the sample including the face. That is, when the similarity is close to 1000, it can be determined that a face is included in the detection window SW. The threshold determination unit P1d compares the threshold specified by the determination condition setting unit P1a with the similarity, and determines whether the first object and the second object exist in the detection window SW according to the result. To do.

色判定部P1eは、検出窓SWに第1オブジェクトとしての顔が存在すると仮定したときに、顔の一部を構成する評価画素が妥当な肌色を示しているか否かを判定する。具体的には、評価画素のRGB値を公知の変換式によってHSB値に変換し、このHSB値が判定条件設定部P1aによって指定された所定の色域に属しているか否かによって当該検出窓SWに第1オブジェクト(人の顔)と第2オブジェクト(動物の顔と不審顔等)が存在するか否かを判定する。コントラスト判定部P1fは、検出窓SWにおけるコントラスト値を算出し、当該コントラスト値が判定条件設定部P1aによって指定された所定の閾値を満足するか否かによって当該検出窓SWに第1オブジェクト(人の顔)と第2オブジェクト(動物の顔と不審顔等)が存在するか否かを判定する。   When it is assumed that the face as the first object exists in the detection window SW, the color determination unit P1e determines whether or not the evaluation pixel that constitutes a part of the face shows an appropriate skin color. Specifically, the RGB value of the evaluation pixel is converted into an HSB value by a known conversion formula, and the detection window SW depends on whether the HSB value belongs to a predetermined color gamut designated by the determination condition setting unit P1a. It is determined whether there is a first object (human face) and a second object (animal face, suspicious face, etc.). The contrast determination unit P1f calculates a contrast value in the detection window SW, and determines whether the first object (person's human being) is in the detection window SW depending on whether or not the contrast value satisfies a predetermined threshold value specified by the determination condition setting unit P1a. Face) and the second object (animal face, suspicious face, etc.) are determined.

一方、画像処理部P2はUI部P2aと第1画像処理部P2bと第2画像処理部P2cとから構成されている。UI部P2aは対象の画像データ13bをディスプレイ60に表示するとともに、当該画像データ13bの表示において第2オブジェクトが検出された領域を指し示す枠を表示させる。そして、当該枠が表示された領域に対する画像処理の種類の指定をマウス40およびキーボード50によって受け付ける。本実施形態では、強調処理とぼかし処理と何もしない、のいずれかを各枠について指定することができる。第1画像処理部P2bは、画像データ13bから検出された第1オブジェクトとしての顔が示す色や明るさを解析し、当該画像データ13bの全体に対する色や明るさの補正処理を第1画像処理として実行する。第2画像処理部P2cは、UI部P2aが受け付けた種類の画像処理を画像データ13bにおいて第2オブジェクトが検出された部分のみに実行する。   On the other hand, the image processing unit P2 includes a UI unit P2a, a first image processing unit P2b, and a second image processing unit P2c. The UI unit P2a displays the target image data 13b on the display 60, and displays a frame indicating the area where the second object is detected in the display of the image data 13b. Then, designation of the type of image processing for the area where the frame is displayed is received by the mouse 40 and the keyboard 50. In the present embodiment, it is possible to specify, for each frame, either enhancement processing or blurring processing. The first image processing unit P2b analyzes the color and brightness indicated by the face as the first object detected from the image data 13b, and performs color and brightness correction processing on the entire image data 13b. Run as. The second image processing unit P2c executes the type of image processing accepted by the UI unit P2a only on the portion where the second object is detected in the image data 13b.

印刷実行部P3は、サイズ変換部P3aと色変換部P3bとハーフトーン処理部P3cとラスタライズ部P3dとから構成されている。サイズ変換部P3aは、上述した画像処理後の画像データ13bを印刷サイズに対応するようにサイズ変換する。色変換部P3bは、各画素の色がRGB値で表現された画像データ13bをプリンタ20が使用するインクの色で表現された画像データ13bに色変換する。例えば、プリンタ20がCMYKインクを吐出可能なインクジェットプリンタである場合には、各画素の色がCMYK値で表現された画像データ13bに変換される。ハーフトーン処理部P3cは、色変換後の画像データ13bに対して誤差拡散法やディザ法等のハーフトーン処理を行うことにより、各画素についてインクを吐出させるかさせないかを特定するハーフトーンデータに変換する。次に、ラスタライズ部P3dがハーフトーンデータを印刷順に並べ替え、印刷用紙や印刷解像度を指定するヘッダを添付することにより、プリンタ20にて出力可能な印刷データを生成する。印刷データはUSBI/F14を介してプリンタ20に出力され、同プリンタ20にて同印刷データに基づく印刷が行われる。   The print execution unit P3 includes a size conversion unit P3a, a color conversion unit P3b, a halftone processing unit P3c, and a rasterization unit P3d. The size converter P3a converts the size of the image data 13b after the image processing described above so as to correspond to the print size. The color conversion unit P3b converts the image data 13b in which the color of each pixel is expressed by RGB values into the image data 13b expressed by the color of ink used by the printer 20. For example, when the printer 20 is an inkjet printer capable of ejecting CMYK ink, the color of each pixel is converted into image data 13b expressed by CMYK values. The halftone processing unit P3c performs halftone processing such as an error diffusion method and a dither method on the color-converted image data 13b, thereby generating halftone data that specifies whether or not to eject ink for each pixel. Convert. Next, the rasterizing unit P3d rearranges the halftone data in the printing order, and attaches a header that specifies the printing paper and the printing resolution, thereby generating print data that can be output by the printer 20. The print data is output to the printer 20 via the USB I / F 14, and the printer 20 performs printing based on the print data.

(2)オブジェクト検出処理
図3はオブジェクト検出処理の流れを示している。ステップS100では、判定条件設定部P1aは、画像データ13bにおける被写体の実サイズが特定可能かを判定する。具体的には、HDD13から取得した対象の画像データ13bをデコードし、画像データ13bにおいてタグ情報として添付されている撮影情報を取得する。そして、撮影情報として、カメラ機種と被写体距離A[m]とレンズ焦点距離B[mm]とデジタルズーム倍率Dがすべて添付されている場合には、画像データ13bにおける被写体の実サイズが特定可能であると判定する。ここで、以上の情報に基づいて、画像データ13bにおける被写体の実サイズが特定できる理由を説明する。
(2) Object Detection Processing FIG. 3 shows the flow of object detection processing. In step S100, the determination condition setting unit P1a determines whether the actual size of the subject in the image data 13b can be specified. Specifically, the target image data 13b acquired from the HDD 13 is decoded, and shooting information attached as tag information in the image data 13b is acquired. When the camera model, subject distance A [m], lens focal length B [mm], and digital zoom magnification D are all attached as shooting information, the actual size of the subject in the image data 13b can be specified. Is determined. Here, the reason why the actual size of the subject in the image data 13b can be specified based on the above information will be described.

図4は、画像データ13bにおける被写体の実サイズを算出する様子を模式的に示している。同図において、ある被写体をデジタルスチルカメラによって撮影したときの光路断面を模式的に示しており、デジタルスチルカメラが備える画像センサ上に被写体の像がレンズを介して結像されている。まず、カメラ機種が特定可能であるため、画像センサの有効サイズS[mm]および撮像画素数P[ピクセル]を特定することができる。本実施形態では、撮像画素数Pと同じ画素数の画像データ13bが生成されるものとする。また、デジタルズームを行った場合には、最初の段階で撮像画素数Pの一部(P/D)の画素数の画像データが生成されることとなるが、その後、D倍の画素補間を行うことにより、最終的に撮像画素数Pと同じ画素数の画像データ13bが生成されるものとして以下説明する。   FIG. 4 schematically shows how to calculate the actual size of the subject in the image data 13b. In the figure, a cross section of an optical path when a certain subject is photographed by a digital still camera is schematically shown, and an image of the subject is formed on an image sensor provided in the digital still camera via a lens. First, since the camera model can be specified, the effective size S [mm] of the image sensor and the number of image pickup pixels P [pixel] can be specified. In the present embodiment, it is assumed that the image data 13b having the same number of pixels as the number of imaging pixels P is generated. In addition, when digital zoom is performed, image data having a number of pixels (P / D) that is a part of the number of pixels P (P / D) is generated in the first stage, and then D-times pixel interpolation is performed. Thus, the following description will be made assuming that the image data 13b having the same number of pixels as the number of imaging pixels P is finally generated.

まず、画像センサ上における各撮像画素の大きさはS/P[mm]によって表すことができ、画像データ13bにおいて画素数C[ピクセル]の被写体が画像センサ上に結像された大きさはC×S/P[mm]によって表すことができる。デジタルズームを行った場合には、像データ13bにおいて画素数C[ピクセル]の被写体が画像センサ上に結像された大きさはC×S/(P×D)[mm]によって表すことができる。以上のように画像センサの上被写体の大きさが特定できると、図4に示す被写体と画像センサとレンズの位置関係から実際の被写体の大きさX[mm]は、下記の(1)式によって表すことができる。
X=(A×1000)×C×S/(P×D×B) ・・・(1)
これにより、画像データ13b上の任意の画素数Cの被写体が検出された場合に、当該被写体の実際の大きさを特定することができる。ステップS100にて、被写体の実際の大きさを特定可能であると判定された場合には、ステップS110にて判定条件設定部P1aが検出窓設定部P1bと類似度算出部P1cと閾値判定部P1dと色判定部P1eとコントラスト判定部P1fに各種の判定パラメータを指定する。そして、ステップS120において判定処理(第1判定手段)を実行する。
First, the size of each image pickup pixel on the image sensor can be represented by S / P [mm], and the size of the subject having the number of pixels C [pixel] formed on the image sensor in the image data 13b is C. X S / P [mm]. When the digital zoom is performed, the size of the subject having the number of pixels C [pixels] formed on the image sensor in the image data 13b can be expressed by C × S / (P × D) [mm]. When the size of the upper subject of the image sensor can be specified as described above, the actual subject size X [mm] can be calculated by the following equation (1) from the positional relationship between the subject, the image sensor, and the lens shown in FIG. Can be represented.
X = (A × 1000) × C × S / (P × D × B) (1)
Thereby, when a subject having an arbitrary number of pixels C on the image data 13b is detected, the actual size of the subject can be specified. If it is determined in step S100 that the actual size of the subject can be specified, the determination condition setting unit P1a detects the detection window setting unit P1b, the similarity calculation unit P1c, and the threshold determination unit P1d in step S110. Various determination parameters are specified in the color determination unit P1e and the contrast determination unit P1f. In step S120, determination processing (first determination means) is executed.

図5は、検出窓設定部P1bと閾値判定部P1dと色判定部P1eとコントラスト判定部P1fが実行する一連の第1判定処理(ステップS120)のフローを模式的に示している。なお、本実施形態では、第1判定処理(ステップS120)と第1判定処理(ステップS150)と第3判定処理(ステップS180)が実行されるが、それぞれについて判定条件設定部P1aが異なる判定パラメータを指定することにより、性格の異なる判定結果を得ることができる。ここでは、まず第1判定処理(ステップS120)について説明する。ステップS110において、判定条件設定部P1は、検出窓設定部P1bに対してシフトさせる検出窓SWの大きさの範囲を10〜40cmに指定する。   FIG. 5 schematically shows a flow of a series of first determination processes (step S120) executed by the detection window setting unit P1b, the threshold determination unit P1d, the color determination unit P1e, and the contrast determination unit P1f. In this embodiment, the first determination process (step S120), the first determination process (step S150), and the third determination process (step S180) are executed, but the determination condition setting unit P1a is different for each determination parameter. By designating, it is possible to obtain determination results with different personalities. Here, the first determination process (step S120) will be described first. In step S110, the determination condition setting unit P1 specifies the range of the size of the detection window SW to be shifted with respect to the detection window setting unit P1b as 10 to 40 cm.

これにより、人の顔として妥当な大きさの範囲に検出窓SWを設定することができる。なお、検出窓SWの大きさを10〜40cmと設定するためには、上述した(1)式の関係を利用する。前記の(1)式の被写体の大きさX[mm]に10〜40cm(100〜400mm)を代入することにより、当該大きさに対応する画像データ13bの画素数Cを特定することができる。さらに、画素数CをQVGAサイズに換算することにより、検出用画像データにおいて設定すべき検出窓SWの大きさを特定することができる。   As a result, the detection window SW can be set in a range having a reasonable size as a human face. In addition, in order to set the size of the detection window SW to 10 to 40 cm, the relationship of the above-described formula (1) is used. By substituting 10 to 40 cm (100 to 400 mm) for the size X [mm] of the subject in the expression (1), the number C of pixels of the image data 13b corresponding to the size can be specified. Further, by converting the number of pixels C into the QVGA size, the size of the detection window SW to be set in the detection image data can be specified.

検出窓設定部P1bは、指定された範囲内で検出窓SWの大きさをシフトさせつつ、検出窓SWの位置や角度を順次シフトすることにより、画像データ13bを縮小した検出用画像データにおいて漏れのない顔の検出を行わせる。検出窓設定部P1bが検出窓SWをシフトさせるごとに、類似度算出部P1cが検出窓SWに属する画像を取得し、当該画像から類似度評価関数13cに入力する複数の特徴量を取得する。そして、類似度評価関数13cに特徴量を入力することにより、ニューラルネットワークの出力値としての類似度(0〜1000)を算出する。この類似度は、現在の検出窓SWに属する画像が人の顔とどれだけ類似しているかを示す指標値である。   The detection window setting unit P1b leaks in the detection image data in which the image data 13b is reduced by sequentially shifting the position and angle of the detection window SW while shifting the size of the detection window SW within the specified range. Detects a face without any noise. Each time the detection window setting unit P1b shifts the detection window SW, the similarity calculation unit P1c acquires an image belonging to the detection window SW, and acquires a plurality of feature amounts input to the similarity evaluation function 13c from the image. And the similarity (0-1000) as an output value of a neural network is calculated by inputting a feature-value into the similarity evaluation function 13c. This similarity is an index value indicating how similar an image belonging to the current detection window SW is to a human face.

ステップS110において、判定条件設定部P1は、閾値判定部P1dに対して類似度の閾値を300と指定する。閾値判定部P1dは類似度評価関数13cから類似度を取得し、当該類似度が閾値以上であれば、さらに色判定部P1eとコントラスト判定部P1fによって人の顔として妥当な色およびコントラストを有しているか否かが判定される。一方、類似度が閾値より小さければ、当該検出窓SWについての色およびコントラストの判定をスキップさせ、検出窓設定部P1bが次の検出窓SWを設定する。ステップS120において、色判定部P1eは、検出窓SWに属する画素のRGB値を取得し、当該RGB値が肌色として妥当なものであるか否かを判定する。具体的には、RGB値をHSV値に変換し、当該HSV値がHSV空間における所定の色域に含まれるか否かを判定する。この色域は、予め判定条件設定部P1によって指定される。   In step S110, the determination condition setting unit P1 designates the similarity threshold as 300 for the threshold determination unit P1d. The threshold determination unit P1d obtains the similarity from the similarity evaluation function 13c, and if the similarity is equal to or greater than the threshold, the color determination unit P1e and the contrast determination unit P1f have colors and contrasts that are appropriate for a human face. It is determined whether or not. On the other hand, if the similarity is smaller than the threshold, the determination of the color and contrast for the detection window SW is skipped, and the detection window setting unit P1b sets the next detection window SW. In step S120, the color determination unit P1e acquires the RGB values of the pixels belonging to the detection window SW, and determines whether or not the RGB values are appropriate as the skin color. Specifically, the RGB value is converted into an HSV value, and it is determined whether or not the HSV value is included in a predetermined color gamut in the HSV space. This color gamut is designated in advance by the determination condition setting unit P1.

図6は、色判定部P1eが判定を行う色域を示している。同図においては、HSV空間が示されており、HSV空間において所定の色相・彩度の範囲(色相面での楕円領域)を設定することにより、人の顔の肌色として妥当な色域を指定している。ステップS110においては判定条件設定部P1が肌色に対応した色域を指定しており、ステップS120の第1判定処理では検出窓SWに属する画素が厳密な肌色であるか否かが判定される。ここで、肌色と判定された場合には、当該検出窓SWについてコントラスト判定部P1fが引き続き判定を行う。一方、肌色と判定されなかった場合には、顔に類似しているが、顔色が正常でないとして、当該検出窓SWに第2オブジェクトとしての動物の顔または不審顔等が含まれると判定し、検出窓設定部P1bが次の検出窓SWを設定し、次の検出窓SWについての判定処理を行う。   FIG. 6 shows a color gamut in which the color determination unit P1e performs determination. In the figure, an HSV space is shown. By setting a predetermined hue / saturation range (an elliptical area on the hue plane) in the HSV space, a color gamut appropriate for a human skin color is designated. is doing. In step S110, the determination condition setting unit P1 designates a color gamut corresponding to the skin color, and in the first determination process in step S120, it is determined whether or not the pixel belonging to the detection window SW is a strict skin color. If the skin color is determined, the contrast determination unit P1f continues to determine the detection window SW. On the other hand, when the skin color is not determined, it is similar to the face, but it is determined that the face color is not normal and the detection window SW includes an animal face or a suspicious face as the second object, The detection window setting unit P1b sets the next detection window SW, and performs a determination process for the next detection window SW.

コントラスト判定部P1fは、検出窓SWに属する画素のRGB値を取得し、当該RGB値に基づいて各画素の輝度Y値を算出する。そして、検出窓SWに属する全画素のRGBY値の最大値Rmaxmaxmaxmaxを検出し、全画素のRGBY値の最小値Rminminminminを検出する。そして、Rmax/Rmin,Gmax/Gmin,Bmax/Bmin,Ymax/Yminのうち最大のものをコントラスト値とする。ステップS110において、判定条件設定部P1は予め色判定部P1eに対してコントラスト値の閾値を設定する。 The contrast determination unit P1f acquires the RGB values of the pixels belonging to the detection window SW, and calculates the luminance Y value of each pixel based on the RGB values. Then, the maximum RGBY value R max G max B max Y max of all pixels belonging to the detection window SW is detected, and the minimum RGBY value R min G min B min Y min of all pixels is detected. The maximum value among R max / R min , G max / G min , B max / B min , and Y max / Y min is set as the contrast value. In step S110, the determination condition setting unit P1 previously sets a threshold value for the contrast value for the color determination unit P1e.

そのため、ステップS120では、検出窓SWに属する画像が高いコントラスト値を有しているか否かが判定される。そして、検出窓SWに属する画像が高いコントラスト値を有している場合には、当該検出窓SWに第1オブジェクトとしての顔が含まれると判定し、検出窓設定部P1bが次の検出窓SWを設定し、次の検出窓SWについての判定処理を行う。一方、検出窓SWに属する画像が高いコントラスト値を有していない場合には、当該検出窓SWに第2オブジェクトとしての動物の顔または不審顔等が含まれると判定し、検出窓設定部P1bが次の検出窓SWを設定し、次の検出窓SWについての判定処理を行う。すべての指定された大きさの範囲で、すべての位置および角度の検出窓SWについての設定/判定が完了すると、第1判定処理が完了する。   Therefore, in step S120, it is determined whether or not an image belonging to the detection window SW has a high contrast value. When an image belonging to the detection window SW has a high contrast value, it is determined that the detection window SW includes a face as the first object, and the detection window setting unit P1b determines that the next detection window SW Is set, and determination processing for the next detection window SW is performed. On the other hand, when the image belonging to the detection window SW does not have a high contrast value, it is determined that the detection window SW includes an animal face or a suspicious face as the second object, and the detection window setting unit P1b Sets the next detection window SW and performs a determination process for the next detection window SW. When the setting / determination is completed for the detection windows SW for all positions and angles in all designated size ranges, the first determination process is completed.

以上の第1判定処理により、検出窓設定部P1bが検出窓SWを順次シフトさせるごとに、各検出窓SWについての一連の判定処理が実行され、各検出窓SWについて、第1オブジェクトとしての人の顔が存在するか、第2オブジェクトとしての動物の顔または不審顔等が存在するか、いずれも存在しないかが判定される。ここで、第1オブジェクトとしての人の顔が存在すると判定されるための条件として、人の顔との類似度が高く、かつ、色が肌色を示し、かつ、コントラストが大きい要求されることとなる。また、第2オブジェクトとしての動物の顔または不審顔等が存在すると判定されるための条件として、人の顔との類似度が高いが色が肌色ではない、または、人の顔との類似度が高いがコントラストが小さいことが要求されることとなる。例えば、犬や猫などの場合、顔器官の配置がある程度類似するが、肌色でないことが多い。また、残像や反射による不審顔の場合、顔の形状はある程度類似するが、コントラストが得られないことが多い。   Through the first determination process described above, each time the detection window setting unit P1b sequentially shifts the detection window SW, a series of determination processes for each detection window SW is executed. Whether or not there is an animal face or a suspicious face as the second object. Here, as a condition for determining that there is a human face as the first object, it is required that the similarity with the human face is high, the color indicates skin color, and the contrast is large. Become. In addition, as a condition for determining that there is an animal face or a suspicious face as the second object, the similarity to the human face is high but the color is not skin color, or the similarity to the human face However, it is required that the contrast is small. For example, in the case of a dog or a cat, the arrangement of facial organs is similar to some extent, but is often not a skin color. Further, in the case of a suspicious face due to an afterimage or reflection, the shape of the face is similar to some extent, but contrast is often not obtained.

以上の第1判定処理が完了すると、ステップS120で第1または第2オブジェクトが検出されたすべての検出窓SWについての判定結果を取得し、当該判定結果を記述したテーブルを検出データ13dとしてHDD13に記憶する(ステップS130)。ステップS140においては、ステップS110と同様に判定条件設定部P1aが検出窓設定部P1bと類似度算出部P1cと閾値判定部P1dと色判定部P1eとコントラスト判定部P1fに各種の判定パラメータを指定する。そして、ステップS150において第2判定処理(第2判定手段)を実行する。第2判定処理は、上述した第1判定処理と似た処理であるが、判定条件設定部P1aがステップS110とは異なる判定パラメータを設定するため、性質の異なる判定結果が得られることとなる。以下、ステップS150における第2判定処理について説明する。   When the first determination process described above is completed, determination results for all detection windows SW in which the first or second object is detected are acquired in step S120, and a table describing the determination results is stored in the HDD 13 as detection data 13d. Store (step S130). In step S140, as in step S110, the determination condition setting unit P1a designates various determination parameters to the detection window setting unit P1b, the similarity calculation unit P1c, the threshold determination unit P1d, the color determination unit P1e, and the contrast determination unit P1f. . In step S150, a second determination process (second determination unit) is executed. The second determination process is a process similar to the first determination process described above, but since the determination condition setting unit P1a sets a determination parameter different from that in step S110, a determination result having a different property is obtained. Hereinafter, the second determination process in step S150 will be described.

図7は、検出窓設定部P1bと閾値判定部P1dと色判定部P1eとコントラスト判定部P1fが実行する一連の第2判定処理(ステップS150)のフローを模式的に示している。判定条件設定部P1aは、検出窓設定部P1bに設定すべき検出窓SWの範囲を10cmより小さい、または、40cmより大きい範囲と指定する。すなわち、ステップS120の判定処理では検出を行わなかった大きさの検出窓SWを設定する。閾値判定部P1dに対しては、類似度の閾値を100と指定する。このようにすることにより、ステップS120よりも人の顔らしくないオブジェクトについても閾値判定部P1dを検出することができる。また、色判定部P1eとコントラスト判定部P1fに指定される色域の広さとコントラスト値の閾値は変わらないが、色判定部P1eとコントラスト判定部P1fの判定のいずれも否定的である場合に第2オブジェクトとしての動物の顔または不審顔等が存在すると判定する。   FIG. 7 schematically illustrates a flow of a series of second determination processes (step S150) executed by the detection window setting unit P1b, the threshold determination unit P1d, the color determination unit P1e, and the contrast determination unit P1f. The determination condition setting unit P1a specifies the range of the detection window SW to be set in the detection window setting unit P1b as a range smaller than 10 cm or larger than 40 cm. That is, a detection window SW having a size that is not detected in the determination process in step S120 is set. For the threshold determination unit P1d, the similarity threshold is designated as 100. By doing in this way, the threshold determination unit P1d can be detected even for an object that is less likely to be a human face than in step S120. In addition, the color gamut width and the contrast value threshold specified by the color determination unit P1e and the contrast determination unit P1f do not change, but the determination by the color determination unit P1e and the contrast determination unit P1f is negative. It is determined that there is an animal face or suspicious face as two objects.

すなわち、人の顔と明らかに大きさが異なっているものの人の顔と画像的に類似している場合において、コントラストが低く、かつ、肌色を示さない場合には、動物の顔または不審顔等であると判定する。動物の顔や不審顔等は人間の顔に大きくは類似しないものの若干類似すると考えることができるため、類似度の閾値を100に緩和することにより、動物の顔や不審顔等を検出することができる。さらに、コントラストが高いものや、肌色を示すものを動物の顔や不審顔等として検出しないことにより、背景やポスターや衣服等に存在する人の顔の絵や写真を動物の顔や不審顔等として検出することが防止できる。なお、ここにおける肌色の判定は第1オブジェクトとしての人間の顔を検出することを目的としていないため、肌色の色域をステップS120の場合よりも大きくするようにしてもよい。   In other words, if the face is clearly different in size from the human face but is similar in image to the human face, if the contrast is low and the skin color is not shown, the animal face or suspicious face, etc. It is determined that Animal faces, suspicious faces, etc. are not very similar to human faces but can be considered to be somewhat similar. Therefore, by relaxing the similarity threshold to 100, it is possible to detect animal faces, suspicious faces, etc. it can. In addition, by not detecting objects with high contrast or skin color as animal faces or suspicious faces, etc., images and photographs of human faces on backgrounds, posters, clothes, etc. can be used for animal faces or suspicious faces. Can be prevented as detected. The determination of the skin color here is not intended to detect the human face as the first object, so the skin color gamut may be made larger than in the case of step S120.

また、同様にコントラスト値の閾値をステップS120の場合よりも緩和するようにしてもよい。すべての位置および角度の検出窓SWの設定が完了すると第2判定処理(ステップS150)を完了させる。以上の第2判定処理が完了すると、ステップS150で第2オブジェクトが検出されたすべての検出窓SWについての判定結果を取得し、検出データ13dに判定結果を追記する(ステップS160)。   Similarly, the threshold value of the contrast value may be relaxed compared to the case of step S120. When the setting of the detection windows SW for all positions and angles is completed, the second determination process (step S150) is completed. When the above second determination process is completed, determination results for all detection windows SW in which the second object is detected in step S150 are acquired, and the determination results are added to the detection data 13d (step S160).

以上においては、被写体の実サイズに基づいて第1判定処理および第2判定処理を順次実行することにより、第1オブジェクトと第2オブジェクトを検出するようにしたが、ステップS100において被写体の実サイズが特定不可能であると判定された場合には、判定条件設定部P1aがステップS170において判定パラメータを設定し、第3判定処理(ステップS180)を実行する。第3判定処理は、上述した第1および第2判定処理と似た処理であるが、判定条件設定部P1aがステップS110,S140とは異なる判定パラメータを設定するため、性質の異なる判定結果が得られることとなる。以下、ステップS180における第3判定処理について説明する。   In the above, the first object and the second object are detected by sequentially executing the first determination process and the second determination process based on the actual size of the subject. However, in step S100, the actual size of the subject is determined. If it is determined that it cannot be specified, the determination condition setting unit P1a sets a determination parameter in step S170, and executes a third determination process (step S180). The third determination process is similar to the first and second determination processes described above. However, since the determination condition setting unit P1a sets determination parameters different from those in steps S110 and S140, determination results having different properties are obtained. Will be. Hereinafter, the third determination process in step S180 will be described.

図8は、検出窓設定部P1bと閾値判定部P1dと色判定部P1eとコントラスト判定部P1fが実行する一連の第3判定処理(ステップS180)のフローを模式的に示している。判定条件設定部P1aは、検出窓設定部P1bに設定すべき検出窓SWの範囲を全範囲と指定する。閾値判定部P1dに対しては、類似度の閾値を500と指定する。このように、最も大きい閾値を設定することにより、厳密に人の顔のみを検出することができる。また、類似度が閾値を満足した場合に、コントラスト判定部P1fによる判定を行わせず、色判定部P1eによる判定のみを行わせるようにする。そして、検出窓SWに属する画像は、500以上の類似度を有し、かつ、色が肌色を示す場合には、当該検出窓SWに第1オブジェクトとしての人の顔が存在すると判定する。これ以外の場合には、いずれのオブジェクトも存在しないと判定する。すべての位置および角度の検出窓SWの設定が完了すると第3判定処理(ステップS180)を完了させる。以上の第3判定処理が完了すると、ステップS180で第1オブジェクトが検出されたすべての検出窓SWについての判定結果を取得し、当該判定結果を記述したテーブルを検出データ13dとしてHDD13に記憶する(ステップS190)。   FIG. 8 schematically shows a flow of a series of third determination processes (step S180) executed by the detection window setting unit P1b, the threshold determination unit P1d, the color determination unit P1e, and the contrast determination unit P1f. The determination condition setting unit P1a designates the range of the detection window SW to be set in the detection window setting unit P1b as the entire range. For the threshold determination unit P1d, the similarity threshold is designated as 500. Thus, by setting the largest threshold value, it is possible to strictly detect only the human face. Further, when the similarity satisfies the threshold value, the determination by the contrast determination unit P1f is not performed, and only the determination by the color determination unit P1e is performed. If the image belonging to the detection window SW has a similarity of 500 or more and the color indicates skin color, it is determined that a human face as the first object exists in the detection window SW. In other cases, it is determined that no object exists. When the setting of the detection windows SW for all positions and angles is completed, the third determination process (step S180) is completed. When the third determination process described above is completed, determination results for all detection windows SW in which the first object is detected are acquired in step S180, and a table describing the determination results is stored in the HDD 13 as detection data 13d ( Step S190).

以上説明したように、本実施形態では、第1判定処理(ステップS120)と第2判定処理(ステップS150)と第3判定処理(ステップS180)において、類似度に対してそれぞれ異なる閾値を300,100,500に設定する。最も高い類似度を要求する第3判定処理においては、第1オブジェクトとしての人の顔のみを正確に検出することができる。次に高い類似度を要求する第1判定処理においては、第1オブジェクトとしての人の顔および第2オブジェクトとしての動物の顔と不審顔等を検出する。最も類似度が緩和される第2判定処理は、第2オブジェクトとしての動物の顔と不審顔等を検出するために利用される。このように、複数の閾値(300,100,500)を使い分けることにより、人の顔のサンプルを用いて学習させた類似度評価関数13cのみを使用して、人の顔のみならず動物の顔や不審顔等も検出することができる。従って、動物の顔や不審顔等を検出するための類似度評価関数13cの準備をしなくても済む。   As described above, in this embodiment, in the first determination process (step S120), the second determination process (step S150), and the third determination process (step S180), different threshold values are set to 300, Set to 100,500. In the third determination process that requires the highest degree of similarity, only the face of a person as the first object can be accurately detected. In the first determination process that requires the next highest similarity, a human face as the first object, an animal face and a suspicious face as the second object, and the like are detected. The second determination process in which the degree of similarity is most relaxed is used to detect an animal face, a suspicious face, or the like as the second object. In this way, by using a plurality of threshold values (300, 100, 500) properly, only the similarity evaluation function 13c learned using a human face sample is used, and not only a human face but also an animal face. And suspicious faces can also be detected. Therefore, it is not necessary to prepare the similarity evaluation function 13c for detecting an animal face, a suspicious face, or the like.

(3)画像処理・印刷処理
図9は、画像処理の流れを示している。まずステップS200において、UI部P2aがステップS130,S160,S190において記憶された検出データ13dを取得する。そして、ステップS210において、UI部P2aは、検出データ13dにおいて第2オブジェクトとしての動物の顔または不審顔等が存在すると判定されたと記述されている検出窓SWの位置と大きさと角度を検索する。そして、ステップS230では、プレビュー画面をディスプレイ60に表示させる。このプレビュー画面において、オブジェクト検出処理を行った画像データ13bが示す画像が所定の解像度で表示されるとともに、検索された検出窓SWの外縁を示す矩形枠を表示させる。
(3) Image Processing / Printing Processing FIG. 9 shows the flow of image processing. First, in step S200, the UI unit P2a acquires the detection data 13d stored in steps S130, S160, and S190. In step S210, the UI unit P2a searches for the position, size, and angle of the detection window SW that is described in the detection data 13d as having been determined that an animal face, a suspicious face, or the like as the second object exists. In step S230, a preview screen is displayed on the display 60. On this preview screen, the image indicated by the image data 13b subjected to the object detection process is displayed with a predetermined resolution, and a rectangular frame indicating the outer edge of the detected detection window SW is displayed.

図10は、プレビュー画面の一例を示している。同図において、画像データ13bが示す画像として人と犬が撮影された画像が表示されている。撮影された人の顔と比較すると、犬の顔は10〜40cmの範囲内に入っているが、肌色を示さないため、第1判定処理の結果、第2オブジェクトと判定されている。そのため、犬の顔を含むように枠が表示されている。プレビュー画面の下方においては、枠で表示された領域に対する画像処理(第2画像処理)の指示を受け付けるチェックボックスが設けられており、マウス40によって、そのまま印刷と、強調処理と、ぼかし処理のいずれかを選択することが可能となっている。なお、第2オブジェクトとしての動物の顔または不審顔等が一つも検出されなかった場合には、これらのチェックボックスを無効化する。全体の領域に対する画像処理の指示を受け付けるチェックボックスも設けられており、そのまま印刷と、自動補正処理のいずれかを選択することが可能となっている。そして、いずれかにチェックが入れられた状態で、印刷実行ボタンをクリックすることが可能となっている。   FIG. 10 shows an example of a preview screen. In the figure, an image in which a person and a dog are photographed is displayed as an image indicated by the image data 13b. Compared with the face of the photographed person, the face of the dog is within the range of 10 to 40 cm, but does not show skin color, and therefore is determined as the second object as a result of the first determination process. Therefore, a frame is displayed so as to include the dog's face. Below the preview screen, there is provided a check box for receiving an instruction for image processing (second image processing) with respect to the area displayed by the frame, and any of printing, enhancement processing, and blurring processing is directly performed by the mouse 40. It is possible to select. If no animal face or suspicious face is detected as the second object, these check boxes are invalidated. A check box for receiving an image processing instruction for the entire area is also provided, and it is possible to select either printing or automatic correction processing as it is. Then, it is possible to click the print execution button with any of the check boxes.

ステップS230では、UI部P2aが印刷実行ボタンのクリックを受け付け、各チェックボックスの選択状況を取得する。自動補正処理がチェックされているか否か判定し(ステップS240)、チェックされている場合には、第1画像処理部P2bがステップS250にて検出データ13dを参照して第1オブジェクトが検出されたか否かを判定する。第1オブジェクトとしての人の顔が検出されていない場合、第1画像処理部P2bは、画像データ13bが示す画像全体の画素から偏りなくサンプリングを行い、サンプリングした画素が示す色や明るさに基づいて全体の補正パラメータを設定する(ステップS260)。具体的には、全体に的に暗い/明るい場合には、全体的に輝度を上方/下方修正するような補正パラメータを設定するようにしてもよい。   In step S230, the UI unit P2a receives a click on the print execution button, and acquires the selection status of each check box. It is determined whether or not the automatic correction process is checked (step S240). If the automatic correction process is checked, the first image processing unit P2b refers to the detection data 13d in step S250 and has detected the first object. Determine whether or not. When the human face as the first object is not detected, the first image processing unit P2b performs sampling without deviation from the pixels of the entire image indicated by the image data 13b, and based on the color and brightness indicated by the sampled pixels. The entire correction parameters are set (step S260). Specifically, when the entire screen is dark / bright, a correction parameter may be set so that the overall brightness is corrected upward / downward.

また、RGB値の分布バランスが悪い場合に、カラーバランスを補正(色かぶり補正)するような補正パラメータを設定する。一方、第1オブジェクトとしての人の顔が検出されている場合、第1画像処理部P2bは、当該顔が検出された検出窓SWに属する画素からサンプリングを行い、サンプリングした画素が示す色や明るさに基づいて全体の補正パラメータを設定する(ステップS270)。ここでも、明るさやカラーバランスの補正パラメータが設定される。ただし、検出された顔の領域に注目して補正パラメータが設定されるため、例えば逆光撮影時のように全体に明るく人の顔が暗いような場合にも、適正な補正パラメータを設定することができる。以上のように、補正パラメータが設定できると、ステップS280において、第1画像処理部(第1画像処理手段)P2bが画像データ13bの各画素を取得し、各画素のRGB値を順次補正していく。なお、自動補正処理がチェックされていない場合には、ステップS260〜280はスキップされる。   Also, a correction parameter is set to correct the color balance (color fog correction) when the RGB value distribution balance is poor. On the other hand, when a human face as the first object is detected, the first image processing unit P2b performs sampling from pixels belonging to the detection window SW in which the face is detected, and the color or brightness indicated by the sampled pixels. Based on this, the entire correction parameter is set (step S270). Here too, correction parameters for brightness and color balance are set. However, since correction parameters are set by paying attention to the detected face area, it is possible to set appropriate correction parameters even when the face of a person is dark as a whole, for example, during backlight shooting. it can. As described above, when the correction parameter can be set, in step S280, the first image processing unit (first image processing means) P2b acquires each pixel of the image data 13b, and sequentially corrects the RGB value of each pixel. Go. If the automatic correction process is not checked, steps S260 to 280 are skipped.

例えば明るく補正すべき旨の補正パラメータが設定された場合、所定階調(例えば、64階調)の補正後のRGB値をもとのRGB値よりも大きくなるような補正値を設定し、スプライン曲線によって全体(最大値と最小値と当該補正値)を結ぶ補正曲線を生成する。このような補正前後の関係を記述した補正用のLUT(ルックアップテーブル)を作成し、当該LUTを参照して補正後のRGB値に変換することにより自動補正処理を行うことができる。人の顔が検出されている場合、ステップS270において顔の明るさに基づいて補正曲線が設定されるため、顔の明るさが適切な補正結果を得ることができる。ステップS280では、画像データ13bを構成するすべての画素を順次選択し、上述した補正曲線を適用する。それにより、画像データ13bが示す画像全体が補正される。   For example, when a correction parameter indicating that correction is to be performed brightly is set, a correction value is set such that the RGB value after correction of a predetermined gradation (for example, 64 gradations) is larger than the original RGB value, and the spline is set. A correction curve connecting the whole (maximum value, minimum value and the correction value) is generated by the curve. An automatic correction process can be performed by creating a correction LUT (lookup table) describing the relationship before and after such correction, and converting it to a corrected RGB value with reference to the LUT. When a human face is detected, a correction curve is set based on the brightness of the face in step S270, so that a correction result with an appropriate face brightness can be obtained. In step S280, all the pixels constituting the image data 13b are sequentially selected, and the above-described correction curve is applied. Thereby, the entire image indicated by the image data 13b is corrected.

次のステップS290においては、枠で表示された領域について、そのまま印刷と、強調処理と、ぼかし処理のいずれが選択されているかを第2画像処理部P2cが判定する。そのまま印刷が選択されている場合(またはチェックボックスを無効化した場合)には、画像処理は終了する。一方、強調処理とぼかし処理のいずれかが選択された場合には、ステップS300,310において、第2オブジェクトとしての動物の顔または不審顔等について指定された画像処理(第2画像処理手段)を実行する。例えば、アンシャープマスクを用いて、強調処理とぼかし処理を行ってもよい。ステップS300,310では、画像データ13bを構成する画素のうち第2オブジェクトとしての動物の顔または不審顔等が検出された検出窓SWに属する画素のみを順次補正する。これにより、画像のうち動物の顔または不審顔等が存在する部分のみを補正することができる。第2画像処理が完了すると、次の印刷処理へ移行する。   In the next step S290, the second image processing unit P2c determines whether printing, emphasis processing, or blurring processing is selected as it is for the area displayed by the frame. When printing is selected as it is (or when the check box is invalidated), the image processing ends. On the other hand, if either the enhancement process or the blurring process is selected, the image processing (second image processing means) designated for the animal's face or suspicious face as the second object in steps S300 and 310 is performed. Execute. For example, enhancement processing and blurring processing may be performed using an unsharp mask. In steps S300 and 310, only the pixels belonging to the detection window SW in which the face of the animal or the suspicious face as the second object is detected among the pixels constituting the image data 13b are sequentially corrected. Thereby, it is possible to correct only a part of the image where an animal face or a suspicious face exists. When the second image process is completed, the process proceeds to the next print process.

上述したように第2オブジェクトは、人の顔にはある程度類似しているが、大きさや色やコントラストが通常の人の顔とは異なるものであり、代表的な例として動物の顔または不審顔等が当てはまる。しかしながら、第2オブジェクトとして検出されたものが、具体的に何を示しているかは上述した第1および第2判定処理によって特定することができない。例えば、第2オブジェクトとして検出されたものがペット等の動物の顔である場合にはユーザーは強調することを望むと予想されるが、第2オブジェクトとして検出されたものが不審顔等の一見して得体の知れないものである場合には心霊写真等と誤解されるのを防止するためにユーザーはぼかすことを望むと予想される。むろん、何も補正をすることなく印刷することを望むことも考えられる。本実施形態のように、第2オブジェクトが存在すると判定された領域に枠を表示させつつ画像処理の指示をユーザーから受け付けることにより、実際の第2オブジェクトに適した第2画像処理を実行させることができる。   As described above, the second object is somewhat similar to a human face, but is different in size, color, and contrast from a normal human face. As a typical example, the second object is an animal face or a suspicious face. And so on. However, what is specifically detected as the second object cannot be specified by the first and second determination processes described above. For example, if the object detected as the second object is the face of an animal such as a pet, the user is expected to emphasize it, but the object detected as the second object looks like a suspicious face or the like. If it is something that is not known, the user is expected to blur it to prevent it being misunderstood as a psychic photograph. Of course, it may be desired to print without any correction. As in the present embodiment, the second image processing suitable for the actual second object is executed by receiving an image processing instruction from the user while displaying a frame in an area where it is determined that the second object exists. Can do.

図11は、印刷処理の流れを示している。ステップS400では、サイズ変換部P3aが画像処理後の画像データ13bを印刷サイズに対応するようにサイズ変換する。ステップS410において、色変換部P3bは、各画素の色がRGB値で表現された画像データ13bをプリンタ20が使用するCMYKインクのインク量の画像データ13bに色変換する。例えば、RGB色空間とCMYK色空間との対応関係を規定した色変換LUTを参照して色変換を行う。ステップS420では、ハーフトーン処理部P3cが画像データ13bに対して誤差拡散法やディザ法等のハーフトーン処理を行うことにより、各画素についてインクを吐出させるか否かを特定するハーフトーンデータに変換する。   FIG. 11 shows the flow of the printing process. In step S400, the size converter P3a converts the size of the image data 13b after image processing so as to correspond to the print size. In step S410, the color conversion unit P3b performs color conversion of the image data 13b in which the color of each pixel is expressed by RGB values into image data 13b of the amount of CMYK ink used by the printer 20. For example, color conversion is performed with reference to a color conversion LUT that defines the correspondence between the RGB color space and the CMYK color space. In step S420, the halftone processing unit P3c performs halftone processing such as an error diffusion method and a dither method on the image data 13b, thereby converting into halftone data that specifies whether or not to eject ink for each pixel. To do.

また、プリンタ20が複数の大きさのインク滴を吐出する場合には、その大きさも特定するようなハーフトーンデータに変換してもよい。ステップS430においては、ラスタライズ部P3dがハーフトーンデータを各主走査パスとインクを吐出するノズルに割り振るラスタライズ処理を行うことにより印刷データを生成する。さらに、印刷用紙や印刷解像度を指定するヘッダを印刷データに添付することにより、プリンタ20を制御可能な印刷データを生成する。ステップS440では、印刷データがUSBI/F14を介してプリンタ20に出力され、同プリンタ20にて同印刷データに基づく印刷が実際に行われる。   Further, when the printer 20 ejects ink droplets of a plurality of sizes, it may be converted into halftone data that also specifies the size. In step S430, the rasterization unit P3d generates print data by performing rasterization processing for allocating halftone data to each main scanning pass and nozzles that eject ink. Furthermore, print data that can control the printer 20 is generated by attaching a header that specifies print paper and print resolution to the print data. In step S440, the print data is output to the printer 20 via the USB I / F 14, and the printer 20 actually performs printing based on the print data.

(4)変形例
以上においては、コンピュータ10が本発明にかかるオブジェクト検出や画像処理を実行するものを例示したが、コンピュータ10の機能をプリンタ20が備えるハードウェア・ソフトウェア資源によって実行させるようにしてもよい。むろん、画像データ13bに対するオブジェクト検出や画像処理は画像入力した段階で行ってもよく、例えばデジタルスチルカメラやスキャナ等において上述した処理を実行するようにしてもよい。上述した実施形態では、被写体の大きさが特定可能であるか否かによって、第1判定処理,第2判定処理を実行させるか、第3判定処理を実行させるかを切り換えるようにしたが、ユーザーの選択によって切り換えるようにしてもよい。
(4) Modifications In the above, the computer 10 executes object detection and image processing according to the present invention, but the functions of the computer 10 are executed by hardware / software resources provided in the printer 20. Also good. Of course, object detection and image processing on the image data 13b may be performed at the stage of image input. For example, the above-described processing may be executed by a digital still camera, a scanner, or the like. In the embodiment described above, whether to execute the first determination process, the second determination process, or the third determination process is switched depending on whether or not the size of the subject can be specified. You may make it switch by selection of.

コンピュータのハードウェアブロック図である。It is a hardware block diagram of a computer. コンピュータのソフトウェアブロック図である。It is a software block diagram of a computer. オブジェクト検出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of an object detection process. 被写体の実サイズを算出する様子を示す模式図である。It is a schematic diagram which shows a mode that the real size of a to-be-photographed object is calculated. 第1判定処理の流れを示す模式図である。It is a schematic diagram which shows the flow of a 1st determination process. 色判定部が判定を行う色域を示す図である。It is a figure which shows the color gamut which a color determination part performs determination. 第2判定処理の流れを示す模式図である。It is a schematic diagram which shows the flow of a 2nd determination process. 第3判定処理の流れを示す模式図である。It is a schematic diagram which shows the flow of a 3rd determination process. 画像処理の流れを示すフローチャートである。It is a flowchart which shows the flow of an image process. プレビュー画面を示す図である。It is a figure which shows a preview screen. 印刷処理の流れを示すフローチャートである。6 is a flowchart illustrating a flow of printing processing.

符号の説明Explanation of symbols

10…コンピュータ,18…バス,11…CPU,12…RAM,13…HDD,13a…プログラムデータ,13b…画像データ,14…USBI/F,15…入力機器I/F,16…ビデオI/F,20…プリンタ,30…デジタルスチルカメラ,40…マウス,50…キーボード,60…ディスプレイ,P…プリンタドライバ,P1…オブジェクト検出部,P1a…判定条件設定部,P1b…検出窓設定部,P1c…類似度算出部,P1d…閾値判定部,P1e…色判定部,P1f…コントラスト判定部,P2…画像処理部,P2a…UI部,P2b…第1画像処理部,P2c…第2画像処理部,P3…印刷実行部,P3a…サイズ変換部,P3b…色変換部,P3c…ハーフトーン処理部,P3d…ラスタライズ部 DESCRIPTION OF SYMBOLS 10 ... Computer, 18 ... Bus, 11 ... CPU, 12 ... RAM, 13 ... HDD, 13a ... Program data, 13b ... Image data, 14 ... USB I / F, 15 ... Input device I / F, 16 ... Video I / F 20 ... printer, 30 ... digital still camera, 40 ... mouse, 50 ... keyboard, 60 ... display, P ... printer driver, P1 ... object detection unit, P1a ... judgment condition setting unit, P1b ... detection window setting unit, P1c ... Similarity calculation unit, P1d ... threshold judgment unit, P1e ... color judgment unit, P1f ... contrast judgment unit, P2 ... image processing unit, P2a ... UI unit, P2b ... first image processing unit, P2c ... second image processing unit, P3: Print execution unit, P3a: Size conversion unit, P3b: Color conversion unit, P3c: Halftone processing unit, P3d: Rasterization unit

Claims (8)

画像データが示す画像に画像処理を実行する画像処理方法であって、
前記画像から第1オブジェクトと第2オブジェクトを検出し、
検出された前記第1オブジェクトに基づき前記画像の全体に対して第1画像処理を実行し、
前記第2オブジェクトが検出された領域に対して第2画像処理を実行することを特徴とする画像処理方法。
An image processing method for performing image processing on an image indicated by image data,
Detecting a first object and a second object from the image;
Performing first image processing on the entire image based on the detected first object;
An image processing method, wherein second image processing is executed on an area where the second object is detected.
前記第1画像処理と前記第2画像処理は、互いに種類の異なる画像処理であることを特徴とする請求項1に記載の画像処理方法。   The image processing method according to claim 1, wherein the first image processing and the second image processing are different types of image processing. 前記画像において前記第2オブジェクトを指し示す表示を行うことを特徴とする請求項2に記載の画像処理方法。   The image processing method according to claim 2, wherein a display indicating the second object is performed in the image. 前記表示において前記第2画像処理の指示を受け付けることを特徴とする請求項3に記載の画像処理方法。   The image processing method according to claim 3, wherein an instruction for the second image processing is received in the display. 前記第1オブジェクトは人の顔であり、前記第2オブジェクトは人の顔に類似するオブジェクトであることを特徴とする請求項1から請求項4のいずれか一項に記載の画像処理方法。   The image processing method according to claim 1, wherein the first object is a human face, and the second object is an object similar to a human face. 画像データが示す画像に画像処理を実行する画像処理装置であって、
前記画像から第1オブジェクトと第2オブジェクトを検出する検出手段と、
検出された前記第1オブジェクトに基づき前記画像の全体に対して第1画像処理を実行する第1画像処理手段と、
検出された前記第2オブジェクトに対して第2画像処理を実行する第2画像処理手段とを具備することを特徴とする画像処理装置。
An image processing apparatus that performs image processing on an image indicated by image data,
Detecting means for detecting the first object and the second object from the image;
First image processing means for performing first image processing on the entire image based on the detected first object;
An image processing apparatus comprising: second image processing means for executing second image processing on the detected second object.
画像データが示す画像に画像処理を実行する機能をコンピュータに実行させるためのコンピュータ読み取り可能な画像処理プログラムであって、
前記画像から第1オブジェクトと第2オブジェクトを検出する検出機能と、
検出された前記第1オブジェクトに基づき前記画像の全体に対して第1画像処理を実行する第1画像処理機能と、
前記第2オブジェクトが検出された領域に対して第2画像処理を実行する第2画像処理機能とをコンピュータに実行させることを特徴とするコンピュータ読み取り可能な画像処理プログラム。
A computer-readable image processing program for causing a computer to execute a function of executing image processing on an image indicated by image data,
A detection function for detecting the first object and the second object from the image;
A first image processing function for performing first image processing on the entire image based on the detected first object;
A computer-readable image processing program causing a computer to execute a second image processing function for executing second image processing on an area where the second object is detected.
画像データが示す画像を印刷する印刷装置であって、
前記画像から第1オブジェクトと第2オブジェクトを検出する検出手段と、
検出された前記第1オブジェクトに基づき前記画像の全体に対して第1画像処理を実行する第1画像処理手段と、
前記第2オブジェクトが検出された領域に対して第2画像処理を実行する第2画像処理手段と、
前記画像データの印刷を実行する印刷実行手段とを具備することを特徴とする印刷装置。
A printing apparatus for printing an image indicated by image data,
Detecting means for detecting the first object and the second object from the image;
First image processing means for performing first image processing on the entire image based on the detected first object;
Second image processing means for performing second image processing on an area where the second object is detected;
A printing apparatus comprising: a printing execution unit that executes printing of the image data.
JP2008161003A 2008-06-19 2008-06-19 Image processing method, image processing apparatus, image processing program, and printer Pending JP2010004300A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008161003A JP2010004300A (en) 2008-06-19 2008-06-19 Image processing method, image processing apparatus, image processing program, and printer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008161003A JP2010004300A (en) 2008-06-19 2008-06-19 Image processing method, image processing apparatus, image processing program, and printer

Publications (1)

Publication Number Publication Date
JP2010004300A true JP2010004300A (en) 2010-01-07

Family

ID=41585626

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008161003A Pending JP2010004300A (en) 2008-06-19 2008-06-19 Image processing method, image processing apparatus, image processing program, and printer

Country Status (1)

Country Link
JP (1) JP2010004300A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011186874A (en) * 2010-03-10 2011-09-22 Fujifilm Corp Image processing apparatus for color image data and operation control method thereof
JP2014010788A (en) * 2012-07-03 2014-01-20 Dainippon Printing Co Ltd Image output reception terminal and image output reception method, and program
US9571697B2 (en) 2014-10-28 2017-02-14 Brother Kogyo Kabushiki Kaisha Image processing device setting sharpness adjustment degrees for object regions and performing unsharp masking process

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011186874A (en) * 2010-03-10 2011-09-22 Fujifilm Corp Image processing apparatus for color image data and operation control method thereof
JP2014010788A (en) * 2012-07-03 2014-01-20 Dainippon Printing Co Ltd Image output reception terminal and image output reception method, and program
US9571697B2 (en) 2014-10-28 2017-02-14 Brother Kogyo Kabushiki Kaisha Image processing device setting sharpness adjustment degrees for object regions and performing unsharp masking process

Similar Documents

Publication Publication Date Title
JP4118749B2 (en) Image processing apparatus, image processing program, and storage medium
JP4978378B2 (en) Image processing device
JP4529888B2 (en) Image processing apparatus, image processing method, and image processing program
US20090027732A1 (en) Image processing apparatus, image processing method, and computer program
JP2005293555A (en) Identification of skin area in image
JP2008011267A (en) Image processor, image processing method, image processing program, and memory medium
JP2005310068A (en) Method for correcting white of eye, and device for executing the method
US20090231628A1 (en) Image Processing Apparatus, Image Processing Method, Computer Program for Image Processing
JP2008113446A (en) Image processing device, image processing program and recording medium
KR102311367B1 (en) Image processing apparatus, image processing method, and storage medium
JP2010003118A (en) Image processing apparatus, image processing method and image processing program
EP1345413A2 (en) Image processor, host unit for image processing, image processing method, and computer products
JP2006343863A (en) Image processor and image processing method
JP4859938B2 (en) Image processing using subject information
JP2010004300A (en) Image processing method, image processing apparatus, image processing program, and printer
JP4492706B2 (en) Judgment of shooting scene and image processing according to shooting scene
JP3950551B2 (en) Image processing method, apparatus, and recording medium
JP2010003091A (en) Object detection device, object detection method, object detection program and printer
JP4581999B2 (en) Image processing apparatus and image processing method
JP5975945B2 (en) Image processing device
JP2007258923A (en) Image processing apparatus, image processing method, image processing program
JP2009070099A (en) Image-processing device, image-processing method, program and recording medium
JP4219577B2 (en) Image processing apparatus, image output apparatus, image processing method, and storage medium
JP2006262404A (en) Device and method for estimating light source, image processor, and method for image processing
JP4320225B2 (en) Image processing for image data