JP2009230557A - Object detection device, object detection method, object detection program, and printer - Google Patents
Object detection device, object detection method, object detection program, and printer Download PDFInfo
- Publication number
- JP2009230557A JP2009230557A JP2008076476A JP2008076476A JP2009230557A JP 2009230557 A JP2009230557 A JP 2009230557A JP 2008076476 A JP2008076476 A JP 2008076476A JP 2008076476 A JP2008076476 A JP 2008076476A JP 2009230557 A JP2009230557 A JP 2009230557A
- Authority
- JP
- Japan
- Prior art keywords
- detection window
- image
- area
- edge amount
- detection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、オブジェクト検出装置、オブジェクト検出方法、オブジェクト検出プログラムおよび印刷装置に関する。 The present invention relates to an object detection apparatus, an object detection method, an object detection program, and a printing apparatus.
入力画像の中からある目的画像(オブジェクト)を検出する技術が知られている。
また、赤目候補領域に対して周辺領域を設定し、設定した領域の各画素のエッジ(各画素にSobelフィルタを適用した際の出力値)の平均値を算出し、この平均値がしきい値よりも大きいか否かによって、赤目候補領域が赤目領域であるか否かを判定する画像処理装置が知られている(特許文献1参照。)。
Also, a peripheral region is set for the red-eye candidate region, and an average value of the edge of each pixel in the set region (an output value when the Sobel filter is applied to each pixel) is calculated, and this average value is a threshold value There is known an image processing apparatus that determines whether or not a red-eye candidate area is a red-eye area based on whether or not it is larger (see Patent Document 1).
従来、入力画像から顔画像等のオブジェクトの検出処理を実行する場合、入力画像中の全ての箇所を対象としてオブジェクトの検出を試みることにより、漏れのない検出結果の取得を目指していた。しかし上記検出処理においては、その検出の精度とともに、処理の軽減化および高速化が求められており、従来のように入力画像中の全ての箇所を同じようにオブジェクトの検出対象としていては、上記処理の軽減化および高速化という目的を十分に達成できない。なお上記文献1は、赤目候補領域が赤目領域であるか否か特定する際に、上記周辺領域の各画素のエッジの平均値を利用するものであるが、かかる赤目領域の特定以外でのエッジの利用手法を提示するものではなかった。
Conventionally, when executing detection processing of an object such as a face image from an input image, an attempt has been made to acquire a detection result without omission by attempting to detect the object for all locations in the input image. However, in the above detection processing, there is a demand for reduction and speeding up of the processing along with the accuracy of the detection, and all the locations in the input image are set as object detection targets in the same manner as in the past. The purpose of reducing processing and speeding up cannot be sufficiently achieved. Note that the
本発明は上記課題に鑑みてなされたもので、入力画像からオブジェクトを検出するに際して、高精度な検出を担保しつつ、従来に増して処理の軽減および高速化を実現可能なオブジェクト検出装置、オブジェクト検出方法、オブジェクト検出プログラムおよび印刷装置を提供することを目的とする。 The present invention has been made in view of the above problems, and an object detection device and an object capable of reducing processing and speeding up processing compared to conventional methods while ensuring high-precision detection when detecting an object from an input image. It is an object to provide a detection method, an object detection program, and a printing apparatus.
上記目的を達成するため、本発明は、入力画像から所定のオブジェクトを検出するオブジェクト検出装置であって、上記入力画像上に検出窓を設定するとともに、当該設定した検出窓内の複数の領域について各領域のエッジ量を取得するエッジ取得部と、上記取得された各領域のエッジ量を所定の領域間において比較し、当該比較の結果が所定の条件を満たす場合に、上記設定された検出窓内の画像を対象として上記オブジェクトの有無の判定を実行するオブジェクト判定部とを備える構成としてある。本発明によれば、入力画像に設定された検出窓内の所定の領域間におけるエッジ量の比較結果次第では、当該検出窓についてはオブジェクトの有無判定の実行が回避される。つまり、エッジ量の比較の結果、オブジェクトらしい画像が存在しないと推定される検出窓については上記有無判定が行なわれないため、入力画像からのオブジェクト検出の精度を落とすことなく、処理量および処理時間が軽減される。 In order to achieve the above object, the present invention provides an object detection device for detecting a predetermined object from an input image, wherein a detection window is set on the input image and a plurality of regions in the set detection window are set. An edge acquisition unit that acquires the edge amount of each region and the acquired edge amount of each region are compared between predetermined regions, and when the result of the comparison satisfies a predetermined condition, the set detection window And an object determination unit that executes the determination of the presence / absence of the object for the image inside. According to the present invention, depending on the comparison result of the edge amount between predetermined regions in the detection window set in the input image, execution of the presence / absence determination of the object is avoided for the detection window. That is, as a result of the edge amount comparison, the presence / absence determination is not performed for a detection window that is estimated to have no object-like image, so that the processing amount and the processing time can be reduced without degrading the accuracy of object detection from the input image. Is reduced.
上記エッジ取得部は、検出窓内に設定された領域であって検出窓が顔画像を含む場合に顔画像の所定の器官に対応する領域として設定された第一領域と、検出窓内に設定された領域であって検出窓が顔画像を含む場合に顔画像の上記器官以外の所定の皮膚部分に対応する領域として設定された第二領域との夫々についてエッジ量を取得し、上記オブジェクト判定部は、第一領域のエッジ量が第二領域のエッジ量より多い場合に、上記設定された検出窓内の画像を対象としてオブジェクトとしての顔画像の有無を判定するとしてもよい。当該構成によれば、第一領域と第二領域とのエッジ量の比較結果から、検出窓内に顔らしい画像が存在すると推定される場合にのみ、当該検出窓内の画像に対して顔画像の有無判定が行なわれる。そのため、一般的に処理量が多い顔画像の有無判定を無駄に行なってしまうことを防止できる。 The edge acquisition unit is an area set in the detection window, and when the detection window includes a face image, a first area set as an area corresponding to a predetermined organ of the face image, and set in the detection window When the detection window includes a face image, an edge amount is acquired for each of the second region set as a region corresponding to a predetermined skin portion other than the organ of the face image, and the object determination is performed When the edge amount of the first region is larger than the edge amount of the second region, the unit may determine the presence or absence of a face image as an object for the image in the set detection window. According to the configuration, the face image is compared with the image in the detection window only when it is estimated from the result of the edge amount comparison between the first area and the second area that a face-like image exists in the detection window. The presence / absence determination is performed. Therefore, it can be prevented that the presence / absence determination of a face image having a large amount of processing is performed in vain.
上記第一領域は、検出窓が顔画像を含む場合に顔画像の目に対応すると予め推定された領域および検出窓が顔画像を含む場合に顔画像の口に対応すると予め推定された領域を含むとしてもよい。顔画像における目や口はエッジ量が多い。そのため、当該構成によれば第一領域と第二領域とのエッジ量の比較結果に基づいて、顔画像の有無判定を実行すべきか否かを適切に判断できる。 The first area includes an area preliminarily estimated to correspond to the eyes of the face image when the detection window includes a face image and an area previously estimated to correspond to the mouth of the face image when the detection window includes the face image. It may be included. The eyes and mouth in the face image have a large amount of edges. Therefore, according to the said structure, it can be judged appropriately whether the presence or absence determination of a face image should be performed based on the comparison result of the edge amount of a 1st area | region and a 2nd area | region.
第一領域のエッジ量がある値以下である場合には、そもそも検出窓内の画像が全体的に輝度差の小さい画像であると考えられ、その場合、検出窓が実際に顔画像を含む状態であっても、第一領域のエッジ量>第二領域のエッジ量、が成り立たない場合がある。そこで上記オブジェクト判定部は、第一領域のエッジ量が所定のしきい値以下である場合には、第二領域のエッジ量に拘らず、上記設定された検出窓内の画像を対象として顔画像の有無を判定するとしてもよい。当該構成によれば、上記エッジ量の比較に基づく判断が実質的に機能しないことによるオブジェクトの検出漏れを防止することができる。 If the edge amount of the first region is less than a certain value, the image in the detection window is considered to be an image with a small luminance difference in the first place, and in this case, the detection window actually includes a face image. Even in such a case, the edge amount of the first region> the edge amount of the second region may not hold. Therefore, when the edge amount of the first region is equal to or smaller than the predetermined threshold value, the object determination unit sets the face image for the image in the set detection window regardless of the edge amount of the second region. It may be determined whether or not there is. According to this configuration, it is possible to prevent omission of object detection due to the fact that the determination based on the comparison of the edge amounts does not substantially function.
上記エッジ取得部は、検出窓に対する上記各領域の位置および大きさを保持した状態で、上記検出窓を設定した入力画像上の位置において検出窓を所定の角度ずつ複数回回転させ、回転させた夫々の状態毎に各領域のエッジ量を取得し、上記オブジェクト判定部は、上記検出窓が回転した状態毎に上記比較を行い、当該各比較の結果に基づいて、上記設定された検出窓内の画像を対象としたオブジェクトの有無の判定を実行するか否か決定するとしてもよい。当該構成によれば、入力画像上に様々な角度で存在し得るオブジェクトらしい画像についてその存在の可能性を推定し、オブジェクトらしい画像が存在すると推定される検出窓において、オブジェクトの有無判定を実行することができる。 The edge acquisition unit rotates the detection window a plurality of times by a predetermined angle at a position on the input image where the detection window is set while maintaining the position and size of each region with respect to the detection window. The edge amount of each region is acquired for each state, and the object determination unit performs the comparison for each state in which the detection window is rotated, and based on the result of each comparison, It may be determined whether or not to perform the determination of the presence / absence of an object for the image. According to this configuration, the possibility of existence of an image that seems to be an object that can exist at various angles on the input image is estimated, and the presence / absence determination of the object is performed in the detection window in which the image that seems to be an object exists. be able to.
上記エッジ取得部は、検出窓に対する上記各領域の位置および大きさを保持した状態で、上記入力画像における検出窓の位置と大きさとの少なくとも一方を変更しながら入力画像上に繰り返し検出窓の設定を行い、検出窓を設定する度に各領域のエッジ量を取得し、上記オブジェクト判定部は、設定された検出窓毎に上記比較を行なうとしてもよい。当該構成によれば、入力画像上の様々な位置において様々なサイズで存在し得るオブジェクトらしい画像についてその存在の可能性を推定し、オブジェクトらしい画像が存在すると推定される検出窓の位置および大きさに基づいて、オブジェクトの有無判定を実行することができる。 The edge acquisition unit repeatedly sets the detection window on the input image while changing at least one of the position and size of the detection window in the input image while maintaining the position and size of each region with respect to the detection window. The edge amount of each area is acquired every time a detection window is set, and the object determination unit may perform the comparison for each set detection window. According to this configuration, the possibility of existence of an image that seems to be an object that can exist at various sizes at various positions on the input image is estimated, and the position and size of the detection window that is presumed that an image that seems to be an object exists. The presence / absence determination of the object can be executed based on the above.
本発明の技術的思想は、上述したオブジェクト検出装置の発明以外にも、上述したオブジェクト検出装置が備える各部が行なう各処理工程を備えたオブジェクト検出方法の発明や、上述したオブジェクト検出装置が備える各部に対応した機能をコンピュータに実行させるオブジェクト検出プログラムの発明としても捉えることができる。また、入力画像から所定のオブジェクトを検出するとともに、入力画像に基づく印刷を実行する印刷装置であって、上記入力画像上に検出窓を設定するとともに、当該設定した検出窓内の複数の領域について各領域のエッジ量を取得するエッジ取得部と、上記取得された各領域のエッジ量を所定の領域間において比較し、当該比較の結果が所定の条件を満たす場合に、上記設定された検出窓内の画像を対象として上記オブジェクトの有無の判定を実行するオブジェクト判定部と、上記オブジェクト判定部によってオブジェクトが有ると判定された検出窓内の画像に基づいて決定した補正情報に応じて上記入力画像の少なくとも一部を補正し、当該補正後の入力画像に基づいて印刷を行なう印刷制御部とを備える構成も把握することが可能である。 The technical idea of the present invention is that, in addition to the above-described invention of the object detection device, the invention of the object detection method including each processing step performed by each unit included in the above-described object detection device, and each unit included in the above-described object detection device It can also be understood as an invention of an object detection program for causing a computer to execute a function corresponding to the above. A printing apparatus that detects a predetermined object from an input image and performs printing based on the input image, sets a detection window on the input image, and sets a plurality of regions in the set detection window An edge acquisition unit that acquires the edge amount of each region and the acquired edge amount of each region are compared between predetermined regions, and when the result of the comparison satisfies a predetermined condition, the set detection window An object determination unit that determines whether or not the object exists for an image in the image, and the input image according to correction information determined based on an image in the detection window determined by the object determination unit to have an object It is possible to grasp a configuration including a print control unit that corrects at least a part of the image and performs printing based on the corrected input image. .
下記の順序に従って本発明の実施形態を説明する。
1.プリンタの概略構成:
2.プリンタによる処理:
2‐1.オブジェクトの有無判定の要否判断:
2‐2.オブジェクトの有無判定から印刷まで:
3.変形例:
Embodiments of the present invention will be described in the following order.
1. General printer configuration:
2. Processing by printer:
2-1. Determining whether or not an object exists:
2-2. From object presence determination to printing:
3. Variations:
1.プリンタの概略構成:
図1は、本発明のオブジェクト検出装置および印刷装置の一例に該当するプリンタ10の構成を概略的に示している。プリンタ10は、記録メディア(例えば、メモリカードMC等)から取得した画像データに基づき画像を印刷する、いわゆるダイレクトプリントに対応したカラーインクジェットプリンタである。プリンタ10は、プリンタ10の各部を制御するCPU11と、例えばROMやRAMによって構成された内部メモリ12と、ボタンやタッチパネルにより構成された操作部14と、液晶ディスプレイにより構成された表示部15と、プリンタエンジン16と、カードインターフェース(カードI/F)17と、PCやサーバやデジタルスチルカメラ等の外部機器との情報のやり取りのためのI/F部13とを備えている。プリンタ10の各構成要素は、バスを介して互いに接続されている。
1. General printer configuration:
FIG. 1 schematically shows a configuration of a
プリンタエンジン16は、印刷データに基づき印刷を行う印刷機構である。カードI/F17は、カードスロット172に挿入されたメモリカードMCとの間でデータのやり取りを行うためのI/Fである。メモリカードMCには画像データが格納されており、プリンタ10は、カードI/F17を介してメモリカードMCに格納された画像データを取得することができる。画像データ提供のための記録メディアとしてはメモリカードMC以外にも種々の媒体を用いることができる。むろんプリンタ10は、記録メディア以外にも、I/F部13を介して接続した上記外部機器から画像データを入力することも可能である。プリンタ10は、コンシューマ向けの印刷装置であってもよいし、DPE向けの業務用印刷装置(いわゆるミニラボ機)であってもよい。操作部14や表示部15は、プリンタ10本体とは別体の入力操作部(マウスやキーボードなど)やディスプレイであってもよい。プリンタ10は、I/F部13を介して接続したPCやサーバ等から印刷データを入力することもできる。
The
内部メモリ12には、オブジェクト検出部20と、画像補正部30と、表示処理部40と、印刷処理部50とが格納されている。オブジェクト検出部20や、画像補正部30は、所定のオペレーティングシステムの下で、後述するオブジェクト検出処理や、画像補正処理等を実行するためのコンピュータプログラムである。表示処理部40は、表示部15を制御して、表示部15に処理メニューやメッセージを表示させるディスプレイドライバである。印刷処理部50は、画像データから印刷データを生成し、プリンタエンジン16を制御して、印刷データに基づく画像の印刷を実行するためのコンピュータプログラムである。CPU11は、内部メモリ12から、これらのプログラムを読み出して実行することにより、これら各部の機能を実現する。
The
オブジェクト検出部20は、プログラムモジュールとして、検出窓設定部21と、エッジ量算出部22と、要否判断部23と、検出実行部24とを含んでいる。画像補正部30は、プログラムモジュールとして、補正情報決定部31と、補正実行部32とを含んでいる。検出窓設定部21と、エッジ量算出部22とは、特許請求の範囲に言うエッジ取得部に該当する。要否判断部23と、検出実行部24とは、特許請求の範囲に言うオブジェクト判定部に該当する。画像補正部30と、印刷処理部50とは、特許請求の範囲に言う印刷制御部に該当する。これら各部の機能については後述する。さらに、内部メモリ12には、エッジ量算出領域定義フィルタ14bや、エッジ検出フィルタ14c,14dや、ニューラルネットワークNN等の各種データやプログラムが格納されている。プリンタ10は、印刷機能以外にも、コピー機能やスキャナ機能など多種の機能を備えたいわゆる複合機であってもよい。
The
2.プリンタによる処理:
2‐1.オブジェクトの有無判定の要否判断:
図2は、本実施形態においてプリンタ10が実行する処理をフローチャートにより示している。ステップS(以下、ステップの表記は省略。)100では、オブジェクト検出部20が、画像処理の対象となる画像(入力画像)を表した画像データDを、メモリカードMC等、所定の記録メディアから取得する。つまりオブジェクト検出部20は、入力画像を取得する。むろん、オブジェクト検出部20は、プリンタ10がハードディスクドライブ(HDD)を有していれば、当該HDDに保存されている画像データDを取得可能であるし、上述したようにI/F部13を介して接続した上記外部機器から画像データDを取得可能である。つまり、ユーザが表示部15に表示されたユーザインターフェース(UI)画面を参照しながら操作部14を操作して、入力画像としての画像データDを任意に選択するとともに当該選択した画像データDの印刷指示を行なった場合に、オブジェクト検出部20は上記選択にかかる画像データDを記録メディア等から取得する。
2. Processing by printer:
2-1. Determining whether or not an object exists:
FIG. 2 is a flowchart showing processing executed by the
画像データDは、複数の画素からなるビットマップデータであり、それぞれの画素は、RGB各チャネルの階調(例えば、0〜255の256階調)の組み合わせで表現されている。画像データDは、記録メディア等に記録されている段階で圧縮されていてもよいし、他の色空間で各画素の色が表現されていてもよい。これらの場合、オブジェクト検出部20は、画像データDの展開や色空間の変換を実行してRGBビットマップデータとしての画像データDを取得する。
The image data D is bitmap data composed of a plurality of pixels, and each pixel is expressed by a combination of gradations of RGB channels (for example, 256 gradations of 0 to 255). The image data D may be compressed when recorded on a recording medium or the like, or the color of each pixel may be expressed in another color space. In these cases, the
S200では、オブジェクト検出部20は、画像データDを縮小化する。オリジナルの画像サイズのままの画像データDを対象として、後述するオブジェクト検出処理を行なった場合には処理負担が大きい。そのため、オブジェクト検出部20は、画像データDについて画素数を減らすなどして画像サイズを縮小し、縮小後の画像データを取得する。オブジェクト検出部20は、例えば、画像データDをQVGA(Quarter Video Graphics Array)サイズ(320画素×240画素)に縮小した画像データDRを取得する。本実施形態では、画像データDRについても適宜、入力画像と呼ぶ。
In S200, the
S300では、オブジェクト検出部20は、画像データDRをグレー画像へ変換する。つまりオブジェクト検出部20は、画像データDRの各画素のRGBデータを輝度値Y(0〜255)に変換し、画素毎に1つの輝度値Yを有するモノクロ画像としての画像データDRを生成する。輝度値Yは一般的に、R,G,Bを所定の重み付けで加算することにより求めることができる。
なお本実施形態においては、S200は必須ではない。そのため、S200を実行しない場合には、オブジェクト検出部20は、画像データDを対象としてS300さらには後述のS400,S500を実行する。またS300(画像データDRまたは画像データDのグレー画像への変換)は、後述するオブジェクト検出処理の便宜を考慮して予め行なう処理であるが、かかるS300を前もって行なうことも必須と言うわけではなくスキップしてもよい。
In S300, the
In this embodiment, S200 is not essential. Therefore, when S200 is not executed, the
S400では、オブジェクト検出部20はオブジェクト検出処理を実行する。概略的には、オブジェクト検出部20は、画像データDR(または画像データD)において検出窓SWを設定するとともに、検出窓SW内の複数の領域についてそれぞれに領域内のエッジ量を取得し、領域間のエッジ量の比較結果が所定の条件を満たす場合に、検出窓SW内の画像を対象としてオブジェクトの有無を判定する処理を、検出窓SW毎に繰り返す。本実施形態では一例として、オブジェクトは人間の顔画像であるとして説明を行なう。ただし本発明の構成を用いて検出可能なオブジェクトは人間の顔画像に限られるものではなく、人工物や、生物や、自然物や、風景など、様々な対象をオブジェクトとして検出することが可能である。
In S400, the
図3は、S400の詳細をフローチャートにより示している。
S410では、オブジェクト検出部20の検出窓設定部21が、画像データDRにおいて検出窓SWを1つ設定する。検出窓SWの設定方法は特に限られないが、検出窓設定部21は一例として、以下のように検出窓SWを設定する。
図4は、画像データDRにおいて検出窓SWを設定する様子を示している。検出窓設定部21は、1回目のS410では、画像内の先頭位置(例えば、画像の左上の角位置)に複数の画素を含む所定の大きさの矩形状の検出窓SW(2点鎖線)を設定する。検出窓設定部21は、2回目以降のS410の度に、それまで検出窓SWを設定していた位置から検出窓SWを画像の左右方向およびまたは上下方向に所定距離(所定画素数分)移動させ、移動先の位置において検出窓SWを新たに1つ設定する。検出窓設定部21は、検出窓SWの大きさを維持した状態で画像データDRの最終位置(例えば、画像の右下の角位置)まで検出窓SWを移動させながら繰り返し検出窓SWを設定したら、先頭位置に戻って検出窓SWを設定する。
FIG. 3 is a flowchart showing details of S400.
In S410, the detection
FIG. 4 shows how the detection window SW is set in the image data DR. In the first S410, the detection
検出窓設定部21は、検出窓SWを先頭位置に戻した場合には、それまでよりも矩形の大きさを縮小した検出窓SWを設定する。その後、検出窓設定部21は上記と同様に、検出窓SWの大きさを維持した状態で画像データDRの最終位置まで検出窓SWを移動させつつ、各位置において検出窓SW設定する。検出窓設定部21は、検出窓SWの大きさを予め決められた回数だけ段階的に縮小しながら、このような検出窓SWの移動と設定を繰り返す。このようにS410において検出窓SWが1つ設定される度に、S420以降の処理が行なわれる。
When the detection window SW is returned to the head position, the detection
S420では、エッジ量算出部22が、直近のS410で設定された検出窓SW内の各領域(第一領域および第二領域)においてエッジ量を算出する。まずエッジ量算出部22は、内部メモリ12からエッジ量算出領域定義フィルタ14bを読み出し、エッジ量算出領域定義フィルタ14bを上記設定された検出窓SW内の画像データに対し適用する。エッジ量算出領域定義フィルタ14bは、検出窓SWと相似の矩形状のフィルタであり、エッジ量算出の対象となる第一領域および第二領域を定義している。
In S420, the edge
図5は、エッジ量算出領域定義フィルタ14bの一例を示している。図5に示すように、エッジ量算出領域定義フィルタ14bは、フィルタ内に第一領域A1および第二領域A2をそれぞれ定義している。第一領域A1は、検出窓SWにエッジ量算出領域定義フィルタ14bを適用した際に、仮に検出窓SWが顔画像を含んでいれば、顔画像の所定の器官を含むであろうと推定される位置および大きさに予め設定された領域である。本実施形態では、第一領域A1は、エッジ量算出領域定義フィルタ14bを適用した検出窓SWが顔画像を含んでいる場合に顔画像の左右の目(あるい左右の目および左右の眉)を含むと推定される目領域と、およびエッジ量算出領域定義フィルタ14bを適用した検出窓SWが顔画像を含んでいる場合に顔画像の口を含むと推定される口領域とからなる。一方、第二領域A2は、検出窓SWにエッジ量算出領域定義フィルタ14bを適用した際に、仮に検出窓SWが顔画像を含んでいれば、顔画像の上記器官以外の所定の皮膚部分を含むであろうと推定される位置および大きさに予め設定された領域である。本実施形態では、第二領域A2は、エッジ量算出領域定義フィルタ14bを適用した検出窓SWが顔画像を含んでいる場合に、顔画像の左右の頬に対応すると推定される左右の頬目領域からなる。
FIG. 5 shows an example of the edge amount calculation
第一領域A1および第二領域A2の定義態様は図5に示したものに限られず、第一領域A1における目領域は2つに分離された領域であってもよいし、第一領域A1は目領域と口領域とのどちらか一方からなるとしてもよい。第二領域A2は、左右の頬領域ではなく、例えば、顔画像の額の位置に対応すると推定される領域であってもよい。エッジ量算出領域定義フィルタ14bは、第一領域A1の総面積と第二領域A2の総面積とが等しくなるようにこれらの領域を定義している。また、エッジ量算出領域定義フィルタ14bの矩形に対する、第一領域A1および第二領域A2それぞれの位置関係および大きさは一定であり、そのため、エッジ量算出領域定義フィルタ14bが縮小または拡大されたときには、第一領域A1および第二領域A2も同様に縮小または拡大される。
The definition form of 1st area | region A1 and 2nd area | region A2 is not restricted to what was shown in FIG. 5, The eye area | region in 1st area | region A1 may be the area | region isolate | separated into two, 1st area | region A1 is It may consist of either the eye area or the mouth area. The second area A2 may be an area estimated to correspond to the position of the forehead of the face image, for example, instead of the left and right cheek areas. The edge amount calculation
エッジ量算出部22は、エッジ量算出領域定義フィルタ14bが、直近のS410で設定された検出窓SWの大きさに一致するように必要に応じてエッジ量算出領域定義フィルタ14bを拡大または縮小した上で、当該設定された検出窓SWにエッジ量算出領域定義フィルタ14bを重畳する。この結果、検出窓SW内に第一領域A1および第二領域A2が設定される。従って、第一領域A1、第二領域A2それぞれの検出窓SWに対する位置および大きさも、上記のように検出窓SWの移動、縮小が行なわれても常に一定となる。次に、エッジ量算出部22は、内部メモリ12からエッジ検出フィルタ14cを読み出し、エッジ検出フィルタ14cを第一領域A1に属する画像データDRの各画素に適用し、第一領域A1内の各画素のエッジ量を検出する。
The edge
図6は、第一領域A1に含まれる画像データDRの一部領域に対して、エッジ検出フィルタ14cを適用した様子を示している。エッジ検出フィルタ14cは、例えば3×3のマトリクス状のフィルタである。エッジ量算出部22は、エッジ検出フィルタ14cの中央の値を注目画素に適用し、当該フィルタ14cの各値と画像データDRの各画素値(輝度値Y)とを夫々乗算した結果を積算することにより、注目画素のエッジ量を検出する。第一領域A1内の全画素を順次、注目画素にしてエッジ検出フィルタ14cを適用することにより、第一領域A1に属する各画素のエッジ量が検出される。図6では、画像データDRの一部領域における中央の9画素についてのみエッジ量を示している。エッジ量算出部22は、第一領域A1の各画素のエッジ量の大きさ(絶対値)の総和を算出し、当該総和を第一領域A1のエッジ量として取得する。
FIG. 6 shows a state in which the
エッジ量算出部22は、第二領域A2に属する画像データDRの各画素に対しても同様にエッジフィルタ14cを適用して第二領域A2の各画素のエッジ量を検出し、第二領域A2の各画素のエッジ量の大きさ(絶対値)の総和を、第二領域A2のエッジ量として取得する。図6に示したエッジ検出フィルタ14cは、同図から明らかなように、画像の上下方向の輝度変化に応じたエッジ量を検出可能なフィルタである。ここで、人間の顔画像においては、目や眉毛や口の領域は、主に顔の横方向(顔の左右方向)を向く線によって形成されているため顔の上下方向における輝度変化に富んでおり、一方、頬などの皮膚部分の輝度変化は、目や眉毛や口の領域と比較すると乏しい。そのため、画像データDRに設定された検出窓SWに仮に顔画像が存在する場合には、その検出窓SWにおける第一領域A1からは多くのエッジ量が検出され、一方、第二領域A2からは少量のエッジ量しか検出されないと予想される。
The edge
そこでS430(図3)では、要否判断部23が、直近のS420で取得された第一領域A1のエッジ量と第二領域A2のエッジ量とを比較し、第一領域A1のエッジ量>第二領域A2のエッジ量、が成り立つ場合にS440に進む。すなわち、第一領域A1のエッジ量が第二領域A2のエッジ量より多ければ、検出窓SW内の画像の顔らしさが高く、顔画像の有無を判定する必要性があると言えるため、要否判断部23はS440に進む。一方、要否判断部23は、第一領域A1のエッジ量≦第二領域A2のエッジ量、である場合には、S440,S450をスキップしてS460に進む。すなわち、第一領域A1のエッジ量が第二領域A2のエッジ量より多いという条件が成立しない場合には、検出窓SW内の画像の顔らしさは低く、顔画像の有無を判定する必要性が無いと言えるため、要否判断部23はS460に進む。なお図6では、エッジ検出フィルタ14dも例示しているが、エッジ検出フィルタ14dの利用方法については後述する。
Therefore, in S430 (FIG. 3), the
2‐2.オブジェクトの有無判定から印刷まで:
S440では、検出実行部24が、直近のS410で設定された検出窓SW内の画像を対象として、顔画像の有無の判定(顔判定)を行なう。そして、顔画像が存在すると判定した場合にはS450に進み、顔画像が存在しないと判定した場合にはS450をスキップしてS460に進む。検出実行部24はS440において、顔画像が存在するか否かを判定可能な手法であればあらゆる手法を採用可能であるが、本実施形態では一例として、ニューラルネットワークNNを利用した判定を行なう。
2-2. From object presence determination to printing:
In S440, the
図7は、検出実行部24が実行するS440の詳細をフローチャートにより示している。検出実行部24は、S441において、直近のS410で設定された検出窓SW内の画素からなる画像データ(窓画像データ)XDを取得すると、S442において、窓画像データXDから複数の特徴量を算出する。これらの特徴量は、窓画像データXDに対して各種のフィルタを適用し、当該フィルタ内の輝度平均やコントラスト等の画像的特徴を示す特徴量(平均値や最大値や最小値や標準偏差等)を算出することにより得られる。
FIG. 7 is a flowchart showing details of S440 executed by the
図8は、窓画像データXDから特徴量を算出する様子を示している。同図において、画像データXDとの相対的な大きさおよび位置が異なる多数のフィルタFTが用意されており、各フィルタFTを順次窓画像データXDに適用し、各フィルタFT内の画像的特徴に基づいて、複数の特徴量CA,CA,CA…を算出する。図8では、窓画像データXD内の各矩形をフィルタFTと呼んでいる。特徴量CA,CA,CA…が算出できると、検出実行部24は、S443において、特徴量CA,CA,CA…を、予め用意したニューラルネットワークNNに入力し、その出力として顔画像が存在する/しないの判定結果を算出する。
FIG. 8 shows how the feature amount is calculated from the window image data XD. In the same figure, a number of filters FT having different relative sizes and positions with respect to the image data XD are prepared, and each filter FT is sequentially applied to the window image data XD, and image characteristics in each filter FT are obtained. Based on this, a plurality of feature amounts CA, CA, CA... Are calculated. In FIG. 8, each rectangle in the window image data XD is called a filter FT. If the feature quantities CA, CA, CA... Can be calculated, the
図9は、ニューラルネットワークNNの構造の一例を示している。ニューラルネットワークNNは、前段層のユニットUの値の線形結合(添え字iは前段層のユニットUの識別番号。)によって後段層のユニットUの値が決定される基本構造を有している。さらに、線形結合によって得られた値をそのまま次の層のユニットUの値としてもよいが、線形結合によって得られた値を例えばハイパボリックタンジェント関数のような非線形関数によって変換して次の層のユニットUの値を決定することにより、非線形特性を与えてもよい。ニューラルネットワークNNは、最外の入力層と出力層と、これらに挟まれた中間層から構成されている。各特徴量CA,CA,CA…がニューラルネットワークNNの入力層に入力可能となっており、出力層では出力値K(0〜1に正規化された値)を出力することが可能となっている。S444では、検出実行部24は、例えばニューラルネットワークNNの出力値Kが0.5以上であれば窓画像データXDに顔画像が存在することを示す値であると判定し、S450に進む。一方、検出実行部24は、出力値Kが0.5未満であれば窓画像データXDに顔画像が存在しないことを示す値であると判定し、S460に進む。
FIG. 9 shows an example of the structure of the neural network NN. The neural network NN has a basic structure in which the value of the unit U in the subsequent layer is determined by a linear combination of the values of the unit U in the previous layer (the suffix i is the identification number of the unit U in the previous layer). Further, the value obtained by the linear combination may be used as the value of the unit U of the next layer as it is, but the value obtained by the linear combination is converted by a non-linear function such as a hyperbolic tangent function, for example. By determining the value of U, non-linear characteristics may be provided. The neural network NN is composed of an outermost input layer and output layer, and an intermediate layer sandwiched between them. Each feature quantity CA, CA, CA... Can be input to the input layer of the neural network NN, and an output value K (value normalized to 0 to 1) can be output from the output layer. Yes. In S444, for example, if the output value K of the neural network NN is 0.5 or more, the
図10は、ニューラルネットワークNNを学習によって構築する様子を模式的に示している。本実施形態では、誤差逆伝搬(error back propagation)法によってニューラルネットワークNNの学習を行うことにより、各ユニットUの数や、各ユニットU間における線形結合の際の重みwの大きさやバイアスbの値が最適化される。誤差逆伝搬法による学習においては、まず各ユニットU間における線形結合の際の重みwの大きさやバイアスbの値を適当な値に初期設定する。そして、顔画像が存在しているか否かが既知の学習用画像データについてS442,S443と同様の手順で特徴量CA,CA,CA…を算出し、当該特徴量CA,CA,CA…を初期設定されたニューラルネットワークNNに入力し、その出力値Kを取得する。本実施形態では、顔画像が存在している学習用画像データについては出力値Kとして1が出力されるのが望ましく、顔画像が存在していない学習用画像データについて出力値Kとして0が出力されるのが望ましい。しかしながら、各ユニットU間における線形結合の際の重みwの大きさやバイアスbの値を適当な値に初期設定したに過ぎないため、実際の出力値Kと理想的な値との間には誤差が生じることとなる。このような誤差を極小化させる各ユニットUについての重みwやバイアスbを、勾配法等の数値最適化手法を用いて算出する。以上のような誤差は、後段の層から前段の層に伝搬され、後段のユニットUについて重みwやバイアスbが順に最適化されていく。 FIG. 10 schematically shows how the neural network NN is constructed by learning. In the present embodiment, by learning the neural network NN by the error back propagation method, the number of units U, the size of the weight w at the time of linear combination between the units U, and the bias b are determined. The value is optimized. In learning by the back propagation method, first, the magnitude of the weight w and the value of the bias b at the time of linear combination between the units U are initially set to appropriate values. Then, for learning image data for which it is known whether or not a face image exists, feature amounts CA, CA, CA... Are calculated in the same procedure as S442 and S443, and the feature amounts CA, CA, CA. Input to the set neural network NN and obtain the output value K. In this embodiment, it is desirable that 1 is output as the output value K for learning image data in which a face image exists, and 0 is output as the output value K for learning image data in which no face image exists. It is desirable to be done. However, since the weight w and the value of the bias b at the time of linear combination between the units U are merely set to appropriate values, there is an error between the actual output value K and the ideal value. Will occur. The weight w and the bias b for each unit U that minimizes such an error are calculated using a numerical optimization method such as a gradient method. The error as described above is propagated from the subsequent layer to the previous layer, and the weight w and the bias b are sequentially optimized for the subsequent unit U.
このような学習を複数の上記学習用画像データを用いて行なうことで最適化がなされたニューラルネットワークNNを、内部メモリ12に予め用意しておくことにより、顔画像が窓画像データXDに存在するか否かを特徴量CA,CA,CA…に基づいて判定することが可能となる。
S450(図3)では、検出実行部24は、直近のS440で顔画像が存在すると判定された検出窓SWの位置(例えば、画像データDR上における検出窓SWの中心位置)および当該検出窓SWの矩形の大きさを、内部メモリ12の所定領域に記録する。このように検出窓SWの位置や大きさを記録する行為が、顔画像の検出行為の一例に該当する。
A face image exists in the window image data XD by preparing in advance in the internal memory 12 a neural network NN that has been optimized by performing such learning using a plurality of learning image data. It can be determined based on the feature quantities CA, CA, CA.
In S450 (FIG. 3), the
S460では、検出窓設定部21が、図4を用いて説明した検出窓SWの設定方法の思想の下、検出窓SWを移動させ更にその大きさを縮小したりして未だ検出窓SWを設定する余地があれば、S410に戻り、新たに検出窓SWを画像データDR上に1つ設定する。一方、検出窓SWの縮小を上記予め決められた回数分重ね、可能な検出窓SWの設定を全て終えた場合には、オブジェクト検出部20は、S400の処理を終える。
In S460, the detection
S500(図2)では、画像補正部30の補正情報決定部31が、入力画像に対する補正に用いられる補正情報を決定する。入力画像に対する補正とは、例えば、明るさ補正や、コントラスト補正や、彩度補正や、特定の記憶色に対する補正などが該当する。本実施形態では、補正情報決定部31は、S400において顔画像が検出された場合には、少なくとも当該顔画像に基づいて補正情報を決定する。具体的には、補正情報決定部31は、内部メモリ12に、顔画像として検出された検出窓SWの位置および大きさの情報が記録されている場合には、画像データDRからこの検出窓SWの位置および大きさの情報が示す範囲の画像データ(顔画像データと呼ぶ。)を抽出する。顔画像データの抽出対象となる画像データDRは、グレー画像への変換後の画像データDRでもよいし、グレー画像への変換が行なわれる前のS200直後の画像データDRであってもよい。補正情報決定部31は、顔画像データに基づいて補正情報(補正パラメータ)を算出する。例えば、補正情報決定部31は、顔画像データ内の輝度の平均値を算出し、当該平均値と、所定の目標値との差分を算出し、当該算出した差分を補正情報とする。
In S500 (FIG. 2), the correction
S600では、補正実行部32が、S500で決定された補正情報に基づいて、S100で取得された画像データDの少なくとも一部を補正する。例えば、補正情報が上述したような顔画像データ内の輝度の平均値と目標値との差分であれば、当該差分に相当する輝度を、画像データD上の顔画像データに対応する領域(画像データDに対する位置および大きさが、画像データDRに対する顔画像データの位置および大きさの関係と等しい領域)の各画素に対して足す。その結果、画像データD上の顔画像の明るさを向上させることができる。また、上記差分の大きさに基づいてトーンカーブの湾曲度合いを決定し、当該トーンカーブを用いて画像データDの各画素値を補正するとしてもよい。むろん、S500で決定する補正情報の種類やS600で行なう補正の種類は上述したものに限られない。
In S600, the
S700では、印刷処理部50が、プリンタエンジン16を制御して、入力画像の印刷を行う。すなわち印刷処理部50は、補正が施された後の画像データDに、解像度変換処理や色変換処理やハーフトーン処理など必要な各処理を施して印刷データを生成する。生成された印刷データは、印刷処理部50からプリンタエンジン16に供給され、プリンタエンジン16は印刷データに基づいた印刷を実行する。これにより、入力画像の印刷が完了する。
In S700, the
このように本実施形態によれば、入力画像に対して検出窓SWを設定し検出窓SW毎にオブジェクト(顔画像)の有無を判定する際に、検出窓SWに顔画像が存在する場合には当該顔画像の目や口などの器官位置に対応すると推定される領域を第一領域A1として検出窓SW内に設定し、顔画像が存在する場合には当該顔画像の目や口などの器官以外の所定の皮膚部分に対応すると推定される領域を第二領域A2として検出窓SW内に設定する。そして、第一領域A1内のエッジ量と第二領域A2内のエッジ量とを比較する。そして、第一領域A1のエッジ量の方が第二領域A2のエッジ量より多いことを条件に、当該検出窓SW内の画像を対象として顔判定を行なう。一方、当該条件が満たされない場合には、当該検出窓SWについては顔判定を行なうことなく、入力画像上の他の位置に検出窓SWを新たに設定する。すなわち、入力画像上の各箇所のうちオブジェクトの有無を判定する必要性の無い箇所については、当該判定を行なう対象から外すようにした。そのため、オブジェクトの検出精度を落とすことなく、入力画像において検出窓SWの設定とオブジェクトの有無の判定とを繰り返す処理の全体量を大幅に減らすことができ、その結果、オブジェクト検出処理が非常に高速化される。 As described above, according to the present embodiment, when a detection window SW is set for an input image and the presence or absence of an object (face image) is determined for each detection window SW, a face image exists in the detection window SW. Sets the region estimated to correspond to the organ position such as eyes and mouth of the face image as the first region A1 in the detection window SW, and when a face image exists, the region such as the eyes and mouth of the face image exists. A region estimated to correspond to a predetermined skin portion other than the organ is set as a second region A2 in the detection window SW. Then, the edge amount in the first region A1 is compared with the edge amount in the second region A2. Then, face determination is performed on the image in the detection window SW on the condition that the edge amount of the first region A1 is larger than the edge amount of the second region A2. On the other hand, when the condition is not satisfied, the detection window SW is newly set at another position on the input image without performing face determination for the detection window SW. That is to say, of the locations on the input image, locations where there is no need to determine the presence or absence of an object are excluded from the subject of the determination. Therefore, it is possible to greatly reduce the overall amount of processing for repeating the setting of the detection window SW and the determination of the presence / absence of an object in the input image without degrading the object detection accuracy. As a result, the object detection processing is very fast. It becomes.
3.変形例:
図11は、オブジェクト検出部20が実行するS400(図2)の詳細を示したフローチャートであって、図3とは異なる例を示している。オブジェクト検出部20は、図3のフォローチャートに替わって図11のフローチャートの処理を行なうとしてもよい。図11のS810,S850〜S880は、図3のS410,S430〜S460と同じであるため説明は省略する。S820では、エッジ量算出部22が、直近のS810で設定された検出窓SW内における第一領域A1のエッジ量を取得する。S830では、要否判断部23が、直近のS820で取得された第一領域A1のエッジ量が所定のしきい値Thより大きいか否か判断し、当該エッジ量がしきい値Thより大きい場合にはS840に進み、一方、当該エッジ量がしきい値Th以下である場合にはS860に進む。S840では、エッジ量算出部22が、直近のS810で設定された検出窓SW内における第二領域A2のエッジ量を取得する。
3. Variations:
FIG. 11 is a flowchart showing details of S400 (FIG. 2) executed by the
このように図11の例では、第一領域A1のエッジ量と第二領域A2のエッジ量との比較を行なう前に、第一領域A1のエッジ量がしきい値Thより大きいか否かを判断し、第一領域A1のエッジ量がしきい値Th以下である場合には、第二領域A2のエッジ量に拘らず、顔判定(S860)を行なう。これは、第一領域A1のエッジ量がある程度の量に達していない場合には、例えば逆光画像のように、検出窓SW全体(あるいは入力画像全体)において輝度変化に乏しい画像であると考えられるからである。つまり、輝度変化が全体的に乏しい画像では、仮に顔画像が存在していても目や口などにおけるエッジ量も乏しく、そのため、第一領域A1のエッジ量と第二領域A2のエッジ量との比較結果に基づいて検出窓SW内の画像が顔らしいか否かを判断することが困難だからである。上記のように、第一領域A1のエッジ量がしきい値Th以下である場合には顔判定を行なうことで、逆光画像のように輝度変化に乏しい入力画像であっても顔判定の対象とし、顔画像の検出ができるようにしている。第一領域A1のエッジ量との比較に用いられるしきい値Thは、例えば内部メモリ12に予め記録されている。当該しきい値Thは、例えば、逆光状態で撮影された複数のサンプル用の顔画像における目部分や口部分から検出されるエッジ量に基づいて予め決定される。
In this way, in the example of FIG. 11, before comparing the edge amount of the first region A1 and the edge amount of the second region A2, whether or not the edge amount of the first region A1 is larger than the threshold value Th. If the edge amount of the first area A1 is equal to or less than the threshold value Th, the face determination (S860) is performed regardless of the edge amount of the second area A2. When the edge amount of the first region A1 does not reach a certain amount, this is considered to be an image with poor luminance change in the entire detection window SW (or the entire input image), for example, a backlight image. Because. That is, in an image with a generally small change in brightness, even if a face image exists, the amount of edges in the eyes, mouth, and the like is also small. Therefore, the edge amount of the first region A1 and the edge amount of the second region A2 This is because it is difficult to determine whether the image in the detection window SW is a face based on the comparison result. As described above, when the edge amount of the first area A1 is equal to or less than the threshold value Th, face determination is performed, and even an input image with poor luminance change such as a backlight image is a target for face determination. The face image can be detected. The threshold value Th used for comparison with the edge amount of the first area A1 is recorded in advance in the
S410(図3),S810(図11)における検出窓SWの設定は、画像データDRにおいて検出窓SWの移動やサイズ変更(縮小)を繰り返しながら複数回行うとした。
さらにエッジ量算出部22は、S420,S820において、直近のS410,S810で設定された検出窓SWにエッジ量算出領域定義フィルタ14bを適用(重畳)した状態で、当該検出窓SWを画像データDR上で所定角度ずつ複数回回転させ、回転させた夫々の状態(回転角0度の状態も含む。)毎に第一領域A1のエッジ量、第二領域A2のエッジ量を取得するとしてもよい。なおS820で第二領域A2のエッジ量も取得する場合にはS840の処理は実質的に不要となる。
The setting of the detection window SW in S410 (FIG. 3) and S810 (FIG. 11) is performed a plurality of times while repeating the movement and size change (reduction) of the detection window SW in the image data DR.
Further, in S420 and S820, the edge
図12は、エッジ量算出部22が画像データDRに設定された1つの検出窓SWを複数回回転させた様子を示している。図12においては、検出窓SWが中心位置を維持した状態で90度単位で回転した際の各状態を示している。かかる回転に伴ってエッジ量算出領域定義フィルタ14bも回転するため、検出窓SWとの第一領域A1および第二領域A2の相対的な位置関係および大きさは常に保たれる。エッジ量算出部22は、検出窓SWの回転角度(0度、90度、180度、270度)毎に第一領域A1のエッジ量および第二領域A2のエッジ量を取得する。なお、90度回転させた検出窓SWにおける第一領域A1および第二領域A2からエッジ量を取得する場合には、第一領域A1、第二領域A2夫々が含む画素からなる画像データを上記90度の回転を打ち消す方向に90度回転させた上で、第一領域A1の画像データ、第二領域A2の画像データそれぞれに上記エッジ検出フィルタ14cを適用し、各画素のエッジ量を検出する。同様に、180度回転させた検出窓SWの各領域からエッジ量を取得する場合には、各領域に含まれている画像データを上記180度の回転を打ち消すように回転させた上でエッジ検出フィルタ14cを適用し、270度回転させた検出窓SWの各領域からエッジ量を取得する場合には、各領域に含まれている画像データを上記270度の回転を打ち消すように回転させた上でエッジ検出フィルタ14cを適用し、夫々に各画素のエッジ量を検出する。
FIG. 12 shows a state where the edge
上記のように第一領域A1のエッジ量および第二領域A2のエッジ量が検出窓SWの回転角度毎に得られたら、S430,S850では、要否判断部23は、回転角度毎に第一領域A1のエッジ量と第二領域A2のエッジ量との比較を行なう。そして、かかる回転角度毎の比較のいずれかにおいて、第一領域A1のエッジ量>第二領域A2のエッジ量、が成り立つ場合にはS440,S860に進む。つまり、検出窓SWの回転状態(0度、90度、180度、270度)のいずれかにおいて、第一領域A1のエッジ量が第二領域A2のエッジ量より多ければ、検出窓SW内に顔画像らしきものがあると言え、その場合には顔判定を行なう必要性があると判断し、S440,S860の顔判定を行なう。なお、検出窓SWを回転させる際の1回あたりの角度は上述した90度以外にも、30度、45度、60度等、様々な角度が考えられる。
If the edge amount of the first region A1 and the edge amount of the second region A2 are obtained for each rotation angle of the detection window SW as described above, in S430 and S850, the
このように検出窓SWの回転角度毎に第一領域A1のエッジ量と第二領域A2のエッジ量とを比較して顔判定の要否を判断する構成を採ることにより、図13に示すように、顔画像の上下が画像データDRの左右を向いていたり、顔画像の上下が画像データDRの上下と逆であるというように、画像データDR上における顔画像の角度が様々であっても、かかる顔画像の存在の可能性を推定し、顔判定の実行に繋げることができる。なおS830では、要否判断部23は、上記のように回転角度毎に得られた各第一領域A1のエッジ量がいずれもしきい値Th以下である場合に“No”の判断をしてS860に進み、一方、回転角度毎に得られた各第一領域A1のエッジ量のいずれかがしきい値Thよりも大きければ“Yes”の判断をして(S840は実質的にスキップして)S850に進む。
As shown in FIG. 13, by adopting a configuration that determines the necessity of face determination by comparing the edge amount of the first region A1 and the edge amount of the second region A2 for each rotation angle of the detection window SW as described above. Even if the angle of the face image on the image data DR is various, such as when the top and bottom of the face image faces the left and right of the image data DR, or the top and bottom of the face image is opposite to the top and bottom of the image data DR. Thus, the possibility of the presence of such a face image can be estimated, which can lead to execution of face determination. In S830, the
検出窓SWの回転角度毎の上記エッジ量の比較結果に応じて、顔判定を実行する場合には、検出実行部24は、上記窓画像データXDから特徴量CAを算出するための上記各フィルタFTについても、窓画像データXDの中心位置を中心として適宜回転させる。そして検出実行部24は、各回転状態毎のフィルタFTから得られる特徴量CAに基づいて、各回転状態毎にニューラルネットワークNNを用いて顔画像の存在/不存在を判定する。この結果、検出窓SWに様々な角度で存在し得る顔画像を的確に検出することが可能となる。
When performing face determination according to the comparison result of the edge amount for each rotation angle of the detection window SW, the
図14は、エッジ量算出領域定義フィルタ14bの一例であって、図5に示した構成とは別の例を示している。図14のエッジ量算出領域定義フィルタ14bでは、目領域、口領域、左右の頬領域の他に、鼻領域ANを定義している。鼻領域ANは、検出窓SWにエッジ量算出領域定義フィルタ14bを適用した際に、仮に検出窓SWが顔画像を含んでいれば、顔画像の鼻を含むであろうと推定される位置および大きさに予め設定された領域である。エッジ量算出部22は、鼻領域NAを定義したエッジ量算出領域定義フィルタ14bを、図5に示したエッジ量算出領域定義フィルタ14bに替えて内部メモリ12から読み出し、画像データDR上の検出窓SWに適用することができる。この場合、エッジ量算出部22は、目領域、口領域、左右の頬領域の画像データに上述のようにエッジ検出フィルタ14cを適用してエッジ量を取得するとともに、鼻領域NA内の画像データからもエッジ量を取得する。
FIG. 14 shows an example of the edge amount calculation
エッジ量算出部22は、鼻領域ANに属する各画素に対してはエッジ検出フィルタ14d(図6参照。)を適用することによりエッジ量を検出し、鼻領域ANの各画素のエッジ量の大きさ(絶対値)の総和を、鼻領域ANのエッジ量として取得する。エッジ検出フィルタ14dは、図6から明らかなように、画像の左右方向の輝度変化に応じたエッジ量を検出可能なフィルタである。顔画像の鼻近辺においては、顔の上下方向に延びる鼻筋のエッジや、左右の小鼻の線などが存在するため、顔の左右方向における輝度変化も富んでいる。そのため、画像データDRに設定された検出窓SWに仮に顔画像が存在する場合には、その検出窓SWにおける鼻領域ANから多くのエッジ量が検出されると予測される。
The edge
このように、目領域、口領域、左右の頬領域および鼻領域ANからエッジ量が取得された場合、要否判断部23は、鼻領域ANのエッジ量も考慮して顔判定を行なうか否か判断する。例えば、要否判断部23は、第一領域A1(目領域+口領域)のエッジ量>第二領域A2(左右の頬領域)のエッジ量、かつ、鼻領域ANのエッジ量>所定のしきい値、が成り立つ場合に、顔判定を行なう(S440,S860に進む)と判断する。鼻領域ANのエッジ量との比較に用いられるしきい値のデータも、予め内部メモリ12等に記録されているとする。あるいは鼻領域ANも第一領域A1の一部であるとしてもよい。つまり、エッジ量算出部22によって目領域、口領域および鼻領域から取得されたエッジ量の総和を第一領域A1のエッジ量とし、要否判断部23は、第一領域A1のエッジ量>第二領域A2のエッジ量、が成り立つか否か判断する。あるいは、鼻領域ANを含むことで第一領域A1の面積=第二領域A2の面積、が成り立たなくなる場合には、要否判断部23は、鼻領域ANを含む第一領域A1のエッジ量の平均値と、第二領域A2のエッジ量の平均値とを比較し、第一領域A1にかかる平均値の方が大きい場合に顔判定を行なうと判断してもよい。このように、目領域や、口領域や、顔器官以外の皮膚領域のエッジ量に加え、鼻領域ANのエッジ量も考慮して、検出窓SWの画像の顔らしさを評価することにより、より顔らしさが高い画像を有する検出窓SWだけを顔判定の対象とすることができる。
As described above, when the edge amount is acquired from the eye region, the mouth region, the left and right cheek regions, and the nose region AN, the
S440,S860において検出実行部24が実行可能な顔判定であって、ニューラルネットワークNNを利用した手法以外の手法について説明する。
図15は、検出実行部24が行なう顔判定の手法の一例を模式的に示している。図15に示す例では、複数の判定器J,J…を複数段カスケード状に接続した判定手段を使用する。ここで言う複数の判定器Jからなる判定手段は、実体的な装置であってもよいし、複数の判定器Jに相当する以下の判定機能を有したプログラムであってもよい。各判定器J,J…は、顔判定の対象となった窓画像データXDから、それぞれ異なる種類(例えばフィルタFTが異なる)の単数または複数の特徴量CA,CA,CA…をそれぞれ入力し、それぞれ正または否の判定を出力する。各判定器J,J…は、それぞれ特徴量CA,CA,CA…の大小比較や閾値判定等の判定アルゴリズムを有しており、それぞれ窓画像データXDが顔らしい(正)か顔らしくない(否)かの独自の判定を実行する。次の段の各判定器J,J…は、前の段の判定器J,J…の正の出力に接続されており、前の段の判定器J,J…の出力が正であった場合のみ次の段の判定器J,J…が判定を実行する。いずれの段においても否の出力がなされた時点で顔判定を終了させ、顔画像が存在しない旨の判定を出力する(S440,S860において“No”)。一方、各段の判定器J,J…がすべて正の出力をした場合には、顔判定を終了させ、顔画像が存在する旨の判定を出力する(S440,S860において“Yes”)。
A method other than the method using the neural network NN, which is face determination that can be executed by the
FIG. 15 schematically illustrates an example of a face determination technique performed by the
図16は、上記判定手段における判定特性を示している。同図においては、上述した各判定器J,J…において使用される特徴量CA,CA,CA…の軸で定義される特徴量空間を示しており、最終的に顔画像が存在すると判定される窓画像データXDから得られる特徴量CA,CA,CA…の組み合わせで表される特徴量空間内の座標をプロットしている。顔画像が存在すると判定される窓画像データXDは一定の特徴を有しているため、特徴量空間における一定の領域に分布が見られると考えることができる。各判定器J,J…は、このような特徴量空間において境界平面を生成し、当該境界平面で区切られた空間のうち、前記分布が属する空間に判定対象の特徴量CA,CA,CA…の座標が存在している場合には、正を出力する。従って、各判定器J,J…をカスケード状に接続することにより、徐々に正と出力される空間を絞り込んでいくことができる。複数の境界平面によれば、複雑な形状の前記分布についても精度よく判定を行うことができる。 FIG. 16 shows the determination characteristics of the determination means. This figure shows a feature space defined by the axes of the feature values CA, CA, CA,... Used in each of the above-described determiners J, J ..., and finally determines that a face image exists. Coordinates in the feature amount space represented by a combination of feature amounts CA, CA, CA... Obtained from the window image data XD. Since the window image data XD determined that the face image exists has a certain feature, it can be considered that a distribution is seen in a certain region in the feature amount space. Each of the determiners J, J... Generates a boundary plane in such a feature amount space, and among the spaces partitioned by the boundary plane, the determination target feature amounts CA, CA, CA. If the coordinate of exists, positive is output. Therefore, by connecting the determination devices J, J... In a cascade, it is possible to gradually narrow down the space in which the positive output is made. According to the plurality of boundary planes, it is possible to accurately determine the distribution having a complicated shape.
なお、以上においては、本発明のオブジェクト検出装置およびオブジェクト検出方法がプリンタ10によって具現化される例を示したが、例えばオブジェクト検出装置およびオブジェクト検出方法は、コンピュータや、デジタルスチルカメラや、スキャナ等の画像機器において実現されてもよい。さらに、プリンタのように印刷用紙上に画像処理結果を出力するものに限らず、フォトビューワのようにディスプレイ上に画像処理結果を出力する装置においても本発明を実現することができる。さらに、人物認証を行うATM(Automated Teller Machine)等においても本発明を適用することができる。さらに、検出実行部24が実行する顔判定は、上述した特徴量の特徴量空間における種々の判別手法を用いることも可能である。例えば、サポートベクタマシンを利用してもよい。
In the above, an example in which the object detection device and the object detection method of the present invention are embodied by the
10…プリンタ、11…CPU、12…内部メモリ、14b…エッジ量算出領域定義フィルタ、14c,14d…エッジ検出フィルタ、16…プリンタエンジン、17…カードI/F、20…オブジェクト検出部、21…検出窓設定部、22…エッジ量算出部、23…要否判断部、24…検出実行部、30…画像補正部、31…補正情報決定部、32…補正実行部、50…印刷処理部、172…カードスロット
DESCRIPTION OF
Claims (9)
上記入力画像上に検出窓を設定するとともに、当該設定した検出窓内の複数の領域について各領域のエッジ量を取得するエッジ取得部と、
上記取得された各領域のエッジ量を所定の領域間において比較し、当該比較の結果が所定の条件を満たす場合に、上記設定された検出窓内の画像を対象として上記オブジェクトの有無の判定を実行するオブジェクト判定部とを備えることを特徴とするオブジェクト検出装置。 An object detection device for detecting a predetermined object from an input image,
An edge acquisition unit that sets a detection window on the input image and acquires an edge amount of each area for a plurality of areas in the set detection window;
The obtained edge amount of each area is compared between predetermined areas, and when the result of the comparison satisfies a predetermined condition, the presence / absence of the object is determined for the image in the set detection window. An object detection apparatus comprising: an object determination unit to be executed.
上記入力画像上に検出窓を設定するとともに、当該設定した検出窓内の複数の領域について各領域のエッジ量を取得するエッジ取得工程と、
上記取得された各領域のエッジ量を所定の領域間において比較し、当該比較の結果が所定の条件を満たす場合に、上記設定された検出窓内の画像を対象として上記オブジェクトの有無の判定を実行するオブジェクト判定工程とを備えることを特徴とするオブジェクト検出方法。 An object detection method for detecting a predetermined object from an input image,
An edge acquisition step of setting a detection window on the input image and acquiring an edge amount of each area for a plurality of areas in the set detection window;
The obtained edge amount of each area is compared between predetermined areas, and when the result of the comparison satisfies a predetermined condition, the presence / absence of the object is determined for the image in the set detection window. An object detection method comprising: an object determination step to be executed.
上記入力画像上に検出窓を設定するとともに、当該設定した検出窓内の複数の領域について各領域のエッジ量を取得するエッジ取得機能と、
上記取得された各領域のエッジ量を所定の領域間において比較し、当該比較の結果が所定の条件を満たす場合に、上記設定された検出窓内の画像を対象として上記オブジェクトの有無の判定を実行するオブジェクト判定機能とを実行させることを特徴とするオブジェクト検出プログラム。 An object detection program for causing a computer to execute processing for detecting a predetermined object from an input image,
An edge acquisition function for setting the detection window on the input image and acquiring the edge amount of each area for a plurality of areas in the set detection window;
The obtained edge amount of each area is compared between predetermined areas, and when the result of the comparison satisfies a predetermined condition, the presence / absence of the object is determined for the image in the set detection window. An object detection program for executing an object determination function to be executed.
上記入力画像上に検出窓を設定するとともに、当該設定した検出窓内の複数の領域について各領域のエッジ量を取得するエッジ取得部と、
上記取得された各領域のエッジ量を所定の領域間において比較し、当該比較の結果が所定の条件を満たす場合に、上記設定された検出窓内の画像を対象として上記オブジェクトの有無の判定を実行するオブジェクト判定部と、
上記オブジェクト判定部によってオブジェクトが有ると判定された検出窓内の画像に基づいて決定した補正情報に応じて上記入力画像の少なくとも一部を補正し、当該補正後の入力画像に基づいて印刷を行なう印刷制御部とを備えることを特徴とする印刷装置。 A printing apparatus that detects a predetermined object from an input image and executes printing based on the input image,
An edge acquisition unit that sets a detection window on the input image and acquires an edge amount of each area for a plurality of areas in the set detection window;
The obtained edge amount of each area is compared between predetermined areas, and when the result of the comparison satisfies a predetermined condition, the presence / absence of the object is determined for the image in the set detection window. An object determination unit to be executed;
At least a part of the input image is corrected according to the correction information determined based on the image in the detection window determined that the object is determined by the object determination unit, and printing is performed based on the corrected input image. A printing apparatus comprising: a printing control unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008076476A JP2009230557A (en) | 2008-03-24 | 2008-03-24 | Object detection device, object detection method, object detection program, and printer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008076476A JP2009230557A (en) | 2008-03-24 | 2008-03-24 | Object detection device, object detection method, object detection program, and printer |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009230557A true JP2009230557A (en) | 2009-10-08 |
Family
ID=41245850
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008076476A Withdrawn JP2009230557A (en) | 2008-03-24 | 2008-03-24 | Object detection device, object detection method, object detection program, and printer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009230557A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013069341A1 (en) * | 2011-11-09 | 2013-05-16 | 楽天株式会社 | Image processing device, method for controlling image processing device, program, and information storage medium |
JP2016189133A (en) * | 2015-03-30 | 2016-11-04 | パイオニア株式会社 | Feature amount extraction device, feature amount extraction method, and feature amount extraction program |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11283036A (en) * | 1998-03-30 | 1999-10-15 | Toshiba Tec Corp | Object detector and object detection method |
JP2000137788A (en) * | 1998-10-29 | 2000-05-16 | Fuji Photo Film Co Ltd | Image processing method, image processor, and record medium |
JP2007004313A (en) * | 2005-06-21 | 2007-01-11 | Sony Corp | Imaging system, processing method for the imaging system, and program for making computer execute the processing method |
-
2008
- 2008-03-24 JP JP2008076476A patent/JP2009230557A/en not_active Withdrawn
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11283036A (en) * | 1998-03-30 | 1999-10-15 | Toshiba Tec Corp | Object detector and object detection method |
JP2000137788A (en) * | 1998-10-29 | 2000-05-16 | Fuji Photo Film Co Ltd | Image processing method, image processor, and record medium |
JP2007004313A (en) * | 2005-06-21 | 2007-01-11 | Sony Corp | Imaging system, processing method for the imaging system, and program for making computer execute the processing method |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013069341A1 (en) * | 2011-11-09 | 2013-05-16 | 楽天株式会社 | Image processing device, method for controlling image processing device, program, and information storage medium |
KR101459268B1 (en) | 2011-11-09 | 2014-11-07 | 라쿠텐 인코포레이티드 | Image processing device, and method for controlling image processing device |
US9240064B2 (en) | 2011-11-09 | 2016-01-19 | Rakuten, Inc. | Image processing device, method for controlling image processing device, program, and information storage medium |
JP2016189133A (en) * | 2015-03-30 | 2016-11-04 | パイオニア株式会社 | Feature amount extraction device, feature amount extraction method, and feature amount extraction program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8218899B2 (en) | Image processing device, image processing method, and image processing program | |
US8224117B2 (en) | Image processing device, image processing method, and image processing program | |
US8781258B2 (en) | Image processing apparatus and image processing method | |
JP4983684B2 (en) | Image processing apparatus, image processing method, and computer program for image processing | |
JP2009237977A (en) | Image output control device, image output control method, image output control program, and printer | |
RU2469400C1 (en) | Method to convert bitmapped image into metafile | |
US20090285457A1 (en) | Detection of Organ Area Corresponding to Facial Organ Image in Image | |
JP4875470B2 (en) | Color correction apparatus and color correction program | |
JP2010003118A (en) | Image processing apparatus, image processing method and image processing program | |
US8031915B2 (en) | Image processing device and image processing method | |
US20090244570A1 (en) | Face image-output control device, method of controlling output of face image, program for controlling output of face image, and printing device | |
US7349558B2 (en) | Image processing method, image processing apparatus, storage medium and program | |
JP5018587B2 (en) | Object detection method, object detection apparatus, object detection program, and computer-readable recording medium recording object detection program | |
JP2009230557A (en) | Object detection device, object detection method, object detection program, and printer | |
JP5067224B2 (en) | Object detection apparatus, object detection method, object detection program, and printing apparatus | |
US20090067718A1 (en) | Designation of Image Area | |
JP4983682B2 (en) | Object detection method, object detection apparatus, object detection program, and printing apparatus | |
JP2009042989A (en) | Image processing apparatus | |
JP5484038B2 (en) | Image processing apparatus and control method thereof | |
JP2009237978A (en) | Image output control device, image output control method, image output control program, and printer | |
JP5609573B2 (en) | Driver program and printing system | |
JP2008147714A (en) | Image processor and image processing method | |
JP2006050559A (en) | Image correcting apparatus and method, and image correction program | |
JP2009237754A (en) | Object detecting method, object detecting device, printer, object detecting program, and recording media storing object detecting program | |
JP4983683B2 (en) | Object detection method, object detection apparatus, and object detection program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110221 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20111117 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20111122 |
|
A761 | Written withdrawal of application |
Free format text: JAPANESE INTERMEDIATE CODE: A761 Effective date: 20111214 |