JP2009086705A - Method for detecting eye position - Google Patents

Method for detecting eye position Download PDF

Info

Publication number
JP2009086705A
JP2009086705A JP2007251663A JP2007251663A JP2009086705A JP 2009086705 A JP2009086705 A JP 2009086705A JP 2007251663 A JP2007251663 A JP 2007251663A JP 2007251663 A JP2007251663 A JP 2007251663A JP 2009086705 A JP2009086705 A JP 2009086705A
Authority
JP
Japan
Prior art keywords
image
eye
face area
eye position
face
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2007251663A
Other languages
Japanese (ja)
Other versions
JP4683236B2 (en
Inventor
Hiroshi Ikeda
浩 池田
Keiichi Moriya
圭一 森谷
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.)
Kao Corp
Original Assignee
Kao 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 Kao Corp filed Critical Kao Corp
Priority to JP2007251663A priority Critical patent/JP4683236B2/en
Publication of JP2009086705A publication Critical patent/JP2009086705A/en
Application granted granted Critical
Publication of JP4683236B2 publication Critical patent/JP4683236B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

<P>PROBLEM TO BE SOLVED: To automatically detect eye positions using a simple technique from an original image that includes a plurality of face images within one image. <P>SOLUTION: A method for detecting eye positions from the original image comprises: a process A including (A1) creating a blurred image obtained by blurring of the original image in two intersecting directions, and determining the position of an intersection of edges in the blurring directions, (A2) creating an image for face area detection where the gradation of the original image is broken, and (A3) in the image for face area detection, detecting face area candidates from a rectangular area one of the apexes of which is the intersection of the edges in the blurring directions; and a process B including (B1) creating a plurality of images for eye position detection with varying brightness for each of the face area candidates, (B2) as the images for eye position detection fade in from a faded-out condition, detecting the block areas of pixels that appear gradually in the images, (B3) selecting those of the detected block areas of pixels that have appeared in pairs as eye position candidates, and (B4) specifying the eye position candidates as eye positions based on their frequencies of appearance. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、顔画像を含む画像から目の位置を自動的に検出する方法および検出システムに関する。   The present invention relates to a method and a detection system for automatically detecting an eye position from an image including a face image.

顔画像における目の位置は、被験者の顔画像に髪型のモデル画像を重ねて髪型シミュレーション画像を形成する場合や、被験者の顔画像に唇、眉等の化粧画像を重ねてメイクアップシミュレーション画像を形成する場合に、画像の大きさの調整や位置合わせのために検出されている。また、目の位置の検出や顔領域の位置の検出は、顔画像の目隠し処理、顔画像のフレーム処理、個人認証用画像の作成等においてもなされている。   The position of the eye in the face image can be obtained by overlaying a hairstyle model image on the subject's face image to form a hairstyle simulation image, or by overlaying a makeup image such as lips or eyebrows on the subject's face image. In this case, the image is detected for adjusting the size of the image or aligning the image. The detection of the position of the eyes and the detection of the position of the face area are also performed in face image blindfolding processing, face image frame processing, creation of an image for personal authentication, and the like.

従来、顔画像から目の位置を検出する方法としては、肌色領域の抽出により顔を検出し、さらにパターンマッチング等により目を検出する方法等が使用されている(非特許文献1、特許文献1)。   Conventionally, as a method for detecting an eye position from a face image, a method of detecting a face by extracting a skin color region and further detecting an eye by pattern matching or the like has been used (Non-Patent Document 1, Patent Document 1). ).

2005年第5回LSI IPデザインアワード受賞論文「高速・高信頼な顔検出を可能とする顔候補点検出法」(日経BP社)2005 5th LSI IP Design Award Winning Paper “Face candidate point detection method that enables fast and reliable face detection” (Nikkei Business Publications) 特開2004−94917号公報JP 2004-94917 A

しかしながら、肌色領域の抽出は照明環境の影響を受ける。そのため、種々の照明環境で撮られた不特定多数の顔画像を対象とする場合には信頼性が問題となる。また、パターンマッチングの手法は、計算量が莫大となるという問題がある。   However, the extraction of the skin color area is affected by the lighting environment. Therefore, reliability becomes a problem when an unspecified number of face images taken in various lighting environments are targeted. Further, the pattern matching method has a problem that the amount of calculation becomes enormous.

これに対し、本発明は、顔画像を含む画像から目の位置や顔領域の位置を、簡便な手法で自動的に信頼性高く検出できるようにすることを目的とする。   In contrast, an object of the present invention is to enable automatic and highly reliable detection of the position of an eye or the position of a face region from an image including a face image.

本発明者らは、(1)元画像から水平・垂直等の交差する2方向のぼかし画像を作成し、そのぼかし画像のぼかし方向のエッジを算出し、さらにそれらの交点を求め、一方、(2)顔画像を含む元画像の階調をつぶすことにより、好ましくは、髪領域と顔領域は判別できるが顔の造作は判別できない画像を得、(3)この階調をつぶした画像上でぼかし方向のエッジの交点を考えると、この交点を頂点とする矩形領域であって、その左右及び上に隣接する領域に比して明度が高い領域に顔画像が存在する場合が多く、したがって、かかる矩形領域を顔領域候補とすることができること、(4)個々の顔領域候補について、明度が変化した複数の画像を作成すると、高明度側のフェードアウトした画像から低明度側の画像に順次フェードインするに伴い、最初に現れる画素が瞳領域のものであること、(5)この場合、瞳領域の画素は対になって現れ、これにより目の位置候補を定められること、そして、(6)対をなして現れた目の位置候補の全ての目の位置検出用画像にわたる出現度数の集積結果から目の位置候補を特定できることを見出した。   The inventors of the present invention (1) create a blurred image in two directions such as horizontal and vertical intersecting from the original image, calculate the edge of the blurred image in the blur direction, and further determine the intersection between them, 2) By crushing the gradation of the original image including the face image, it is preferable to obtain an image that can discriminate between the hair area and the face area but not the face structure, and (3) Considering the intersection of the edges in the blur direction, the face image often exists in a rectangular area having this intersection as a vertex and having a higher brightness than the areas adjacent to the left and right and above, and therefore This rectangular area can be used as a face area candidate. (4) For each face area candidate, when multiple images with varying brightness are created, fade-out images on the high brightness side are sequentially faded to images on the low brightness side. First, (5) In this case, the pixels in the pupil area appear in pairs, and thus the eye position candidates can be determined, and (6) appear in pairs. It has been found that eye position candidates can be identified from the accumulation results of appearance frequencies over all eye position detection images of eye position candidates.

即ち、顔画像を含む元画像から目の位置を検出する方法であって、
A.(A1)元画像から交差する2方向にぼかしたぼかし画像を作成し、該ぼかし画像におけるぼかし方向のエッジの交点の位置を求めると共に、
(A2)元画像の階調をつぶした顔領域検出用画像を作成し、
(A3)顔領域検出用画像において、ぼかし方向のエッジの交点を一つの頂点とする矩形領域であって、その左右及び上の隣接領域に比して明度が高い領域を顔領域候補として検出する工程、
B.(B1)顔領域候補ごとに、明度が変化した複数の目の位置検出用画像を作成し、
(B2)目の位置検出用画像が高明度でフェードアウトした状態から低明度へフェードインするのに伴い、目の位置検出用画像に漸次現れる画素の固まり領域を検出し、
(B3)検出した画素の固まり領域のうち対となって現れたものを目の位置候補として選択し、
(B4)各目の位置候補の全ての目の位置検出用画像にわたる出現度数に基づいて目の位置候補を目の位置として特定する工程、
を有する目の位置の検出方法を提供する。
That is, a method for detecting the position of an eye from an original image including a face image,
A. (A1) Create a blurred image blurred in two directions intersecting the original image, obtain the position of the intersection of the edges in the blurred direction in the blurred image,
(A2) Create a face area detection image with the gradation of the original image collapsed,
(A3) In a face area detection image, a rectangular area having an intersection of edges in the blur direction as one vertex and having a higher brightness than the left and right and upper adjacent areas is detected as a face area candidate. Process,
B. (B1) For each face area candidate, create a plurality of eye position detection images with varying brightness,
(B2) As the eye position detection image fades in from a state of fading out at a high brightness to a low brightness, a cluster area of pixels that gradually appears in the eye position detection image is detected,
(B3) Select the clustered areas of the detected pixels that appeared in pairs as eye position candidates,
(B4) specifying the eye position candidate as the eye position based on the appearance frequency over all eye position detection images of each eye position candidate;
A method for detecting the position of an eye having

また、上述の目の位置の検出方法で目の位置を特定した後、その目の位置に対応する顔領域候補に基づいて顔領域を特定する顔領域の位置の検出方法を提供する。   Further, the present invention provides a face area position detection method for specifying a face area based on a face area candidate corresponding to the eye position after the eye position is specified by the above-described eye position detection method.

さらに、本発明は、顔画像を含む元画像の取得手段、及び演算手段を備えた目の位置の検出システムであって、演算手段が、
元画像から交差する2方向にぼかしたぼかし画像を作成する機能、該ぼかし画像のぼかし方向のエッジを検出し、それらの交点の位置を求める機能、元画像の階調をつぶした顔領域検出用画像を作成する機能、顔領域検出用画像において、ぼかし方向のエッジの交点を一つの頂点とする矩形領域であって、その左右及び上の隣接領域に比して明度が高い領域を顔領域候補として検出する機能、顔領域候補ごとに、目の位置検出用画像として明度が変化した複数の画像を作成する機能、その画像が高明度でフェードアウトした状態から低明度へフェードインするのに伴い、目の位置検出用画像に漸次現れる画素の固まり領域を検出する機能、検出した画素の固まり領域のうち対となって現れたものを目の位置候補として選択する機能、及び各目の位置候補の全ての目の位置検出用画像にわたる出現度数に基づいて目の位置を特定する機能を備えている目の位置の検出システムを提供する。
Furthermore, the present invention is an eye position detection system including an acquisition unit for an original image including a face image and a calculation unit, and the calculation unit includes:
A function that creates a blurred image that is blurred in two directions intersecting with the original image, a function that detects edges in the blur direction of the blurred image and obtains the position of the intersection, and a face area detection in which the gradation of the original image is crushed Image creation function, a face area detection image is a rectangular area whose intersection is the intersection of edges in the blur direction and has a higher brightness than the adjacent areas on the left and right and above As a function to create a plurality of images whose brightness has changed as eye position detection images for each face area candidate, as the image fades out from a state of fading out with high brightness to low brightness, A function for detecting a cluster area of pixels that gradually appear in the eye position detection image, a function for selecting a pair of detected pixel cluster areas that appear as a pair, and each eye Providing a detection system of the position of the eye has a function of specifying the position of the eye based on the frequency of occurrence over all eye position detecting image position candidate.

また、本発明は、顔画像を含む元画像の取得手段及び演算手段を備えた顔領域の位置の検出システムであって、その演算手段が、上述の目の位置の検出システムの演算装置の機能に加えて、顔領域候補のうち目の位置が特定されたものを顔領域として特定する機能を有する顔領域の位置の検出システムを提供する。   Further, the present invention is a face area position detection system including an original image acquisition unit and a calculation unit including a face image, and the calculation unit functions as a calculation device of the above-described eye position detection system. In addition, the present invention provides a face area position detection system having a function of specifying, as a face area, a face area candidate whose face position is specified.

本発明の方法あるいはシステムによれば、顔画像を含む元画像において、顔画像が存在しそうな顔領域候補を自動的に検出し、その顔領域候補毎に、明度を変化させた画像を複数形成して目の位置を特定するので、照明環境、被験者の肌色、被験者の瞳の色、顔画像における顔の向き等にかかわらず、元画像に含まれる目の位置や、その目の位置に対応する顔領域を自動的に信頼性高く短時間で検出することができる。   According to the method or system of the present invention, a face area candidate that is likely to contain a face image is automatically detected in an original image including a face image, and a plurality of images with varying brightness are formed for each face area candidate. The eye position in the original image, regardless of the lighting environment, subject skin color, subject pupil color, face orientation in the face image, etc. The face area to be automatically detected can be detected automatically in a short time with high reliability.

さらに、本発明の方法あるいはシステムのうち、目の位置の検出方法あるいはシステムによれば、目の位置を基準にして種々のヘアスタイル画像を任意の顔画像にフィッティングさせる髪型シミュレーション画像の形成や、目の位置を基準にして化粧後の顔の部分画像を任意の顔画像にフィッティングさせる化粧シミュレーション画像の形成等のように、目の位置を基準にして複数の画像情報をフィッティングさせることによりシミュレーション画像を形成する場合に、自然さのあるシミュレーション画像を短時間で形成することが可能となる。   Furthermore, according to the eye position detection method or system of the method or system of the present invention, the formation of a hairstyle simulation image for fitting various hairstyle images to an arbitrary face image based on the eye position, Simulation image by fitting multiple pieces of image information based on eye position, such as forming a makeup simulation image that fits a partial facial image after makeup to an arbitrary face image based on eye position When forming the image, it is possible to form a natural simulation image in a short time.

また、個人情報保護のための目隠し処理のように、目及びその近傍領域を塗りつぶしたり、モザイクをかけたり、さらには、顔領域全体にモザイクをかける等の画像処理を行う場合にも、本発明の方法あるいはシステムを好適に用いることができる。   The present invention also applies to image processing such as painting the eye and its neighboring area, applying a mosaic, and applying a mosaic to the entire face area, such as a blindfold process for protecting personal information. The method or system can be suitably used.

以下、図面を参照しつつ本発明を詳細に説明する。   Hereinafter, the present invention will be described in detail with reference to the drawings.

図1は、顔画像を含む元画像において、個々の顔画像の目の位置を検出する本発明の目の位置の検出方法、及び、目の位置の検出の後、顔領域の位置を検出する本発明の顔領域の位置の検出方法の一実施例を示す流れ図であり、図2は、これらの方法を実施する目の位置及び顔領域の位置の検出システム10のブロック図である。   FIG. 1 shows an eye position detection method according to the present invention for detecting the eye position of each face image in the original image including the face image, and the face area position is detected after the eye position detection. FIG. 2 is a flowchart showing an embodiment of the method for detecting the position of the face area according to the present invention, and FIG. 2 is a block diagram of the detection system 10 for detecting the position of the eye and the position of the face area for implementing these methods.

このシステム10は、撮像装置1及びパソコン本体2からなっており、パソコン本体2には、ディスプレイ3、イメージスキャナ4、プリンタ5等が接続されている。   The system 10 includes an imaging apparatus 1 and a personal computer main body 2, and a display 3, an image scanner 4, a printer 5, and the like are connected to the personal computer main body 2.

撮像装置1は、顔画像を含む元画像の取得手段として設けられており、市販のデジタルカメラを使用することができる。   The imaging device 1 is provided as a means for acquiring an original image including a face image, and a commercially available digital camera can be used.

パソコン本体2は、演算手段として設けられており、概略、カラー画像のグレースケール化、階調の変更、明度補正、画像サイズの変更、全体的ぼかし、水平、垂直等の所定方向のぼかし、エッジ抽出、画像の重ね合わせ、図形の拡大・縮小機能等の画像処理機能や、これらを組み合わせて後述するように所定のフェードイン割合のフェードイン画像を作成する機能、明度の変化に伴ってコントラストを変化させる機能(例えば、明度を高くするにしたがいコントラストを下げ、また、明度を低くするにしたがいコントラストをあげる機能)等を備えている。これらの個々の画像処理機能は、例えば、アドビシステム社製フォトショップ等の市販のイメージ処理ソフトをパソコン本体2に搭載することにより得ることができる。   The personal computer main body 2 is provided as a calculation means, and roughly, gray scale of a color image, gradation change, brightness correction, image size change, overall blur, blur in a predetermined direction such as horizontal and vertical, edge Image processing functions such as extraction, image superposition, figure enlargement / reduction functions, etc., and a function to create a fade-in image with a predetermined fade-in ratio by combining these functions as described later. It has a function of changing (for example, a function of decreasing the contrast as the brightness is increased and increasing the contrast as the brightness is decreased). These individual image processing functions can be obtained by, for example, installing commercially available image processing software such as Photoshop manufactured by Adobe System Co. in the personal computer main body 2.

また、このパソコン本体2は、明度の異なる複数の画像を明度の低い又は高い順にリスト番号を付けて管理する機能、画像上で所定領域の明度を他の領域の明度と対比し、所定の抽出条件の下に選択する機能等を有しており、より具体的には、元画像から、交差する2方向にぼかしたぼかし画像として水平・垂直ぼかし画像を作成し、その水平・垂直ぼかし画像の水平エッジと垂直エッジを検出し、その交点の位置を求める機能、元画像の階調をつぶした目の位置検出対象領域設定用画像を作成する機能、目の位置検出対象領域設定用画像において、前記水平エッジと垂直エッジの交点を一つの頂点とする矩形領域を設定する機能、矩形領域のうち、左右及び上の隣接領域に比して明度が高い領域を顔領域候補として検出する機能、顔領域候補ごとに、目の位置検出用画像として明度が変化した複数の画像を作成する機能、その画像が高明度でフェードアウトした状態から低明度へフェードインするのに伴い、目の位置検出用画像に漸次現れる画素の固まり領域を検出する機能、検出した画素の固まり領域のうち対となって現れたものを目の位置候補として選択する機能、及び各目の位置候補の全ての目の位置検出用画像にわたる出現度数に基づいて目の位置を特定する機能等を有している。   The personal computer body 2 has a function of managing a plurality of images with different brightness by assigning a list number in order of increasing or decreasing brightness. The brightness of a predetermined area on the image is compared with the brightness of other areas to perform predetermined extraction. More specifically, a horizontal / vertical blurred image is created as a blurred image that is blurred in two intersecting directions from the original image, and the horizontal / vertical blurred image In the function of detecting the horizontal edge and the vertical edge and obtaining the position of the intersection, the function of creating the eye position detection target area setting image in which the gradation of the original image is crushed, the eye position detection target area setting image, A function for setting a rectangular area having an intersection of the horizontal edge and the vertical edge as one vertex; a function for detecting an area having a higher brightness as compared with the adjacent area on the left and right and above the rectangular area as a face area candidate; Area A function to create multiple images with varying brightness as eye position detection images for each eye, as the image fades in from a state that fades out at high brightness to a low brightness, the eye position detection image gradually A function for detecting a cluster area of appearing pixels, a function for selecting a pair of detected pixel cluster areas appearing as eye position candidates, and an image for detecting the position of all eyes of each eye position candidate The function of specifying the position of the eyes based on the appearance frequency over the entire range.

このシステム10を用いた目の位置の検出方法は、図1に示すように、概略、
A.顔画像を含む元画像から顔領域候補を検出する工程、
B.顔領域候補ごとに目の位置候補を検出し、それを特定する工程
の2つの工程からなる。
As shown in FIG. 1, the eye position detection method using the system 10 is roughly
A. Detecting a face area candidate from an original image including a face image;
B. It consists of two steps of detecting the eye position candidate for each face area candidate and specifying it.

工程Aでは、まず、目の位置の検出対象とする顔画像を有する元画像をパソコン本体2に取得する。元画像は、例えば、撮像装置1で顔画像を含む写真を撮り、それをパソコン本体2に取り込ませてもよく、イメージスキャナ4を用いて顔画像を含む写真を読み取ることによってもよく、インターネット等の通信回線を利用してそのような画像を取得してもよい。   In the process A, first, an original image having a face image as a detection target of the eye position is acquired in the personal computer main body 2. For example, the original image may be obtained by taking a photograph including a face image with the imaging device 1 and loading the photograph into the personal computer main body 2, or reading a photograph including the face image using the image scanner 4, such as the Internet. Such an image may be acquired using the communication line.

なお、元画像としては、1つの元画像中に含まれる顔画像の数は、単数でも複数でもよいが、本発明は複数の顔画像のとき、更に複数の顔画像のサイズが異なるときに特に効果を発揮するので、複数の方が好ましい。   As the original image, the number of face images included in one original image may be singular or plural, but the present invention is particularly suitable when there are a plurality of face images and when the sizes of the plurality of face images are different. Since the effect is exhibited, a plurality of directions are preferable.

次に、必要に応じて、元画像にグレースケール化、サイズ調整、ぼかし、明度補正等の前処理を行う。   Next, pre-processing such as gray scaling, size adjustment, blurring, and brightness correction is performed on the original image as necessary.

このうち、グレースケール化は、本発明の目の位置の検出方法では、カラー情報が不要であるため、取得した元画像がカラー画像の場合に、後の処理量を低減させるために行う。   Of these, gray scale conversion is performed in order to reduce the amount of subsequent processing when the acquired original image is a color image because the eye position detection method of the present invention does not require color information.

グレースケール化の方法としては、各画素において、(1)R、G、Bの各値の最大値と最小値の平均を利用する方法、(2)R、G、Bの各値の平均を利用する方法、(3)R、G、Bの各値に所定の重み付け係数(NTSC等)を掛けた後、それらの平均をとる方法等を使用することができる。例えば、(3)の方法においては、次式
Y(出力輝度)=0.298912×R+0.568811×G+0.114478×B
を利用すればよい。
As a gray scale method, for each pixel, (1) a method that uses the average of the maximum and minimum values of R, G, and B, and (2) the average of each value of R, G, and B A method to be used, (3) a method of multiplying each value of R, G, and B by a predetermined weighting coefficient (NTSC, etc.) and then averaging them can be used. For example, in the method (3), the following equation Y (output luminance) = 0.298912 × R + 0.568811 × G + 0.114478 × B
Can be used.

サイズ調整は、元画像を目の位置の検出処理に適した画像サイズに調整するもので、具体的には、検出精度の点から長辺を320ピクセル以上とすることが好ましく、汎用パソコンの演算速度の点から長辺を480以下のピクセル程度に画面サイズを変更することが好ましい。   The size adjustment is to adjust the original image to an image size suitable for the eye position detection process. Specifically, the long side is preferably 320 pixels or more from the viewpoint of detection accuracy. In view of speed, it is preferable to change the screen size so that the long side is about 480 pixels or less.

ぼかし処理は、元画像中の顔画像がシャープであると、後の画像処理で細かいエッジが多数現れ、目の位置候補の検出のノイズとなるので、必要に応じて行う。この場合、ぼかしの程度は、弱〜中とすることが好ましく、例えば、各画素について、注目点の画素とその周囲の25画素に対して1〜5の重み付ぼかしフィルタを使用して輝度の平均値を出力するぼかし処理を行う。このぼかし処理は、必要に応じて複数回行っても良い。   If the face image in the original image is sharp, a lot of fine edges appear in the subsequent image processing, and blurring processing is performed as necessary because it becomes noise for detecting eye position candidates. In this case, it is preferable that the degree of blurring is weak to medium. For example, for each pixel, the weighting blur filter of 1 to 5 is used for the pixel of interest and the surrounding 25 pixels. Performs blurring to output the average value. This blurring process may be performed a plurality of times as necessary.

明度補正は、顔領域検出用画像の作成に際し、元画像が極端に明るかったり暗かったりする場合に行うことが好ましい。明度補正の方法としては、例えば、図3A(a)のように明るすぎる元画像20について、あるいは図3B(a)のように暗すぎる元画像20について、それぞれ元画像20の明度ヒストグラムを作成し、最大カウント数の1.5%〜15%、好ましくは3%〜8%以下のカウント数である画素値のカウント数をゼロとした後、カウント数がゼロではない画素値のうち最大の画素値Xmaxおよび最小の画素値Xminを求める。次に、図3A(b)、図3B(b)のように、元画像の画素値Xiを次式に代入して明度補正後の画素値とすることにより元画像の明度補正を行う。   The brightness correction is preferably performed when the face image detection image is created when the original image is extremely bright or dark. As a lightness correction method, for example, a lightness histogram of the original image 20 is created for the original image 20 that is too bright as shown in FIG. 3A (a) or the original image 20 that is too dark as shown in FIG. 3B (a). After the count value of the pixel value which is 1.5% to 15% of the maximum count number, preferably 3% to 8% or less is set to zero, the largest pixel value among the pixel values whose count number is not zero A value Xmax and a minimum pixel value Xmin are obtained. Next, as shown in FIGS. 3A (b) and 3B (b), the original image brightness correction is performed by substituting the pixel value Xi of the original image into the following equation to obtain the pixel value after the brightness correction.

但し、Xi<Xminの場合、Xi=Xminとし、
Xi>Xmaxの場合、Xi=Xmaxとする。
However, if Xi <Xmin, Xi = Xmin,
If Xi> Xmax, Xi = Xmax.

明度補正の方法としては前述の方法に限らず、種々の方法が適用可能である。例えば、予め任意の画像を基準画像とし、その平均明度を測定すると共に、水平・垂直ぼかし画像の作成及び顔領域検出用画像の作成のための適正明度変化量を決定しておき、基準画像の平均明度に対する元画像の平均明度の比率を算出し、基準画像における適正明度変化量に平均明度の比率を乗じた量だけ元画像の明度を変化させて元画像の明度を補正する。   The brightness correction method is not limited to the above-described method, and various methods can be applied. For example, an arbitrary image is set as a reference image in advance, the average brightness is measured, and an appropriate brightness change amount for creating a horizontal / vertical blurred image and a face area detection image is determined. The ratio of the average brightness of the original image to the average brightness is calculated, and the brightness of the original image is corrected by changing the brightness of the original image by an amount obtained by multiplying the appropriate brightness change amount in the reference image by the average brightness ratio.

ここで、基準画像における適正明度変化量の決定は次のように行う。まず、基準画像の平均明度を明暗両方向に1階調ずつ変化させた画像を作成し、それぞれの画像に対して後述する目の位置の検出対象領域の検出を行い、その検出結果が実際に顔画像の存在する領域と整合しているかを目視で判断し、その検出の成功率を計算する。そしてその成功率が最大になる画像の平均明度を求め、これと基準画像の平均明度との差を適正明度変化量とする。   Here, the appropriate brightness change amount in the reference image is determined as follows. First, an image in which the average brightness of the reference image is changed by one gradation in both the light and dark directions is created, a detection target area of an eye position described later is detected for each image, and the detection result is actually a face. It is judged visually whether it matches with the area where the image exists, and the success rate of the detection is calculated. Then, the average brightness of the image with the highest success rate is obtained, and the difference between this and the average brightness of the reference image is set as the appropriate brightness change amount.

基準画像としては、5〜20人の顔画像が写っており、個々の顔画像の最大サイズと最小サイズの比が、顔の長さで1〜3倍以内であるものが好ましい。目の位置の検出対象領域の設定は次に示す方法によればよい。   As the reference image, face images of 5 to 20 persons are shown, and the ratio of the maximum size and the minimum size of each face image is preferably within 1 to 3 times the face length. The eye position detection target area may be set by the following method.

図4は、こうして元画像20に前処理として、グレースケール化、サイズ調整、ぼかし及び明度補正をしたときの、前処理前の元画像20と前処理後のぼかし画像21を示している。   FIG. 4 shows the original image 20 before the preprocessing and the blurred image 21 after the preprocessing when the gray scale, size adjustment, blurring, and brightness correction are performed on the original image 20 as preprocessing.

前処理をした後は、図1の工程(A1)で、交差する2方向にぼかしたぼかし画像として、図5(c)のような水平・垂直ぼかし画像24を作成する。この水平・垂直ぼかし画像24は、同図(a)のように作成した水平ぼかし画像22と同図(b)のように作成した垂直ぼかし画像23を合成したものである。なお、本発明において、このぼかし画像におけるぼかしの2方向は水平方向と垂直方向に限らず、例えば図7に示すように斜め2方向としてもよい。この場合、2方向の交差角は、鋭角側の角θを60°以上とすることが好ましい。ただし、その後の演算を簡単にするため、交差する2方向は水平方向と垂直方向とし、図5(c)に示したような水平・垂直ぼかし画像24を作成することが好ましい。   After pre-processing, in the step (A1) of FIG. 1, a horizontal / vertical blurred image 24 as shown in FIG. 5C is created as a blurred image blurred in two intersecting directions. The horizontal / vertical blurred image 24 is a combination of the horizontal blurred image 22 created as shown in FIG. 10A and the vertical blurred image 23 created as shown in FIG. In the present invention, the two blur directions in the blurred image are not limited to the horizontal direction and the vertical direction, and may be two oblique directions as shown in FIG. 7, for example. In this case, it is preferable that the angle θ on the acute angle side of the two directions is 60 ° or more. However, in order to simplify the subsequent calculation, it is preferable that the intersecting two directions are the horizontal direction and the vertical direction, and the horizontal / vertical blurred image 24 as shown in FIG. 5C is created.

ぼかし画像におけるぼかしの程度は、例えば、水平ぼかし画像22では、元画像20に対し、1画素ごとに、該画素を中心とする水平方向80〜120ピクセルの平均画素値を求め、その画素値を当該画素の画素値とするという操作を全画素について行うことにより得ることができ、同様に、垂直ぼかし画像23では、元画像20に対して、1画素ごとに、該画素を中心とする垂直方向80〜120ピクセルの平均画素値を求め、その画素値を当該画素の画素値とするという操作を全画素について行うことにより得ることができる。   For example, in the case of the horizontal blurred image 22, an average pixel value of 80 to 120 pixels in the horizontal direction centered on the pixel is obtained for each pixel in the horizontal blurred image 22, and the pixel value is calculated. It can be obtained by performing the operation of setting the pixel value of the pixel for all the pixels. Similarly, in the vertical blurred image 23, the vertical direction centering on the pixel for each pixel with respect to the original image 20 It can be obtained by calculating an average pixel value of 80 to 120 pixels and setting the pixel value as the pixel value of the pixel for all pixels.

この他、水平ぼかし画像22や垂直ぼかし画像23の作成方法としては、まず、水平ぼかし画像と垂直ぼかし画像を作成し、次にそれらを合成するという2段階の手法によらず、各画素について、該画素を中心とする水平方向80〜120ピクセルと垂直方向80〜120ピクセルの平均画素値を同時に演算する方法によってもよい。   In addition, as a method of creating the horizontal blurred image 22 and the vertical blurred image 23, first, a horizontal blurred image and a vertical blurred image are generated, and then, without combining the two steps of combining them, for each pixel, The average pixel value of the horizontal direction 80 to 120 pixels and the vertical direction 80 to 120 pixels centered on the pixel may be calculated simultaneously.

次に、図6に示す水平・垂直エッジ画像25のように、水平・垂直ぼかし画像24における水平エッジと垂直エッジを求め、それらのエッジの交点の位置を求める。水平エッジや垂直エッジの検出には、ぼかし機能も備えたエッジフィルタを使用することが好ましく、例えば、次式の水平エッジフィルタや、垂直エッジフィルタを使用することができる。   Next, as in the horizontal / vertical edge image 25 shown in FIG. 6, the horizontal edge and the vertical edge in the horizontal / vertical blurred image 24 are obtained, and the position of the intersection of these edges is obtained. For detection of a horizontal edge or a vertical edge, it is preferable to use an edge filter having a blurring function. For example, a horizontal edge filter or a vertical edge filter of the following formula can be used.

一方、図1の工程(A2)で、元画像の階調をつぶした顔領域検出用画像を作成する。   On the other hand, in step (A2) of FIG. 1, a face area detection image in which the gradation of the original image is crushed is created.

顔領域検出用画像としては、図8Aに示すように、元画像20の明度を変化させることにより、髪領域と顔領域は判別できるが顔の造作は判別できない状態、即ち、髪領域と顔領域はおおよそ判別できるが、顔内部は全く現れていないか、あるいは目・鼻・口はわかるが誰の顔だか判別しがたい状態に高階調側を多くつぶした画像を作成することが好ましい。   As the face area detection image, as shown in FIG. 8A, by changing the brightness of the original image 20, the hair area and the face area can be discriminated, but the face structure cannot be discriminated, that is, the hair area and the face area. However, it is preferable to create an image in which the high gradation side is crushed so that the inside of the face does not appear at all, or the face, eyes, nose, and mouth can be recognized but it is difficult to determine who the face is.

顔領域検出用画像26の作成方法は、元画像20の撮影条件にもよるが、基本的には元画像20から、フェードイン割合として25〜35%の画像を作成することが好ましい。   Although the method for creating the face area detection image 26 depends on the shooting conditions of the original image 20, it is basically preferable to create an image with a fade-in ratio of 25 to 35% from the original image 20.

ここで、所定のフェードイン割合の画像は、例えば、元画像が256階調の場合、以下の通りに作成することができる。   Here, for example, when the original image has 256 gradations, an image having a predetermined fade-in ratio can be created as follows.

まず、フェードイン0%の画像は、全ての画素の画素値を一律255とする。   First, in an image with 0% fade-in, the pixel values of all the pixels are uniformly set to 255.

また、フェードインx%の画像は、元画像において画素値が2.55x未満の画素は元画像の画素値を有し、画素値が2.55x以上の画素(但し、x>0)は一律画素値255を有するとする。   Further, in an image with fade-in x%, pixels having a pixel value of less than 2.55x in the original image have the pixel value of the original image, and pixels having a pixel value of 2.55x or more (provided that x> 0) are uniform. Suppose that it has a pixel value of 255.

例えば、フェードイン10%の画像は、元画像において、画素値が25.5(=255×0.1)未満の画素はその画素値のまま、画素値が25.5以上の画素は画素値を一律255にする。   For example, in a 10% fade-in image, pixels with a pixel value of less than 25.5 (= 255 × 0.1) remain the same in the original image, and pixels with a pixel value of 25.5 or more have a uniform pixel value. 255.

フェードイン20%の画像は、元画像において、画素値が51.0(=255×0.2)未満の画素はその画素値のまま、元画像の画素値が51.0以上の画素は画素値を一律255にする。   An image with 20% fade-in has a pixel value of less than 51.0 (= 255 × 0.2) in the original image, and a pixel value of 51.0 or higher in the original image remains the same. Set to 255.

フェードイン100%の画像は、全ての画素の画素値を元画像の画素値のままとする。   In an image with 100% fade-in, the pixel values of all the pixels remain the pixel values of the original image.

なお、顔領域検出用画像26は、図8Bに示すように、階調を反転させたネガ画像として形成し、以降の画像処理を、階調を反転させて行ってもよい。   As shown in FIG. 8B, the face area detection image 26 may be formed as a negative image with the gradation reversed, and the subsequent image processing may be performed with the gradation reversed.

また、顔領域検出用画像26の作成方法は、所定のフェードイン割合の画像を作成する方法に限らず、種々の2値化処理による方法が適用可能である。例えば、元画像20の明度ヒストグラムの中心明度値を閾値とする2値化処理など、元画像の特性に基づき閾値を決める種々の2値化処理(一般的に可変閾値処理と呼ばれている)により顔領域検出用画像26を作成することができる。   Further, the method of creating the face area detection image 26 is not limited to a method of creating an image having a predetermined fade-in ratio, and various binarization processing methods can be applied. For example, various binarization processes (generally referred to as variable threshold processes) for determining a threshold value based on the characteristics of the original image, such as a binarization process using the central brightness value of the brightness histogram of the original image 20 as a threshold value. Thus, the face area detection image 26 can be created.

次に、図1の工程(A3)に示すように、顔領域検出用画像26において、顔領域であることが期待される顔領域候補を検出する。この顔領域候補としては、顔領域検出用画像26と、水平・垂直ぼかし画像の水平エッジと垂直エッジの交点を一つの頂点とする矩形領域であって、その左右及び上の隣接領域に比して明度が高い領域を検出する。これは、グレースケール画像では、肌や髪の色が異なる人種を問わず、また、頭髪の有無も問わず、顔領域が、頭、帽子、衣服、その他の顔領域の周囲に比して明るいという本発明者の知見に基づくものである。   Next, as shown in step (A3) in FIG. 1, a face area candidate expected to be a face area is detected in the face area detection image 26. The face area candidate is a face area detection image 26 and a rectangular area having one vertex at the intersection of the horizontal edge and the vertical edge of the horizontal / vertical blurred image, compared to the left and right and upper adjacent areas. To detect areas with high brightness. This is because, in a grayscale image, the face area is compared to the periphery of the head, hat, clothing, and other face areas, regardless of race or hair color, and with or without hair. This is based on the inventor's knowledge that it is bright.

顔領域候補の具体的な検出方法としては、例えば、まず、図9に示すように、顔領域検出用画像26上に水平・垂直ぼかし画像の水平・垂直エッジ画像25を重ね、水平エッジと垂直エッジの各交点Pにおいて、その交点Pを一つの頂点とする微小な正方形30を想定し、交点Pを基点(即ち、相似形に拡大する場合の拡大中心)として正方形を次の(a)又は(b)の条件が満たされるまで右下方向、左下方向、右上方向及び左上方向にそれぞれ拡大する。   As a specific method of detecting a face area candidate, for example, as shown in FIG. 9, first, a horizontal / vertical blurred image 25 of a horizontal / vertical blurred image is superimposed on a face area detection image 26, and the horizontal edge and the vertical edge are vertically aligned. At each intersection point P of the edge, a small square 30 having the intersection point P as one vertex is assumed, and the square is defined as the following (a) or the following point with the intersection point P as a base point (that is, an expansion center when expanding to a similar shape). The image is expanded in the lower right direction, the lower left direction, the upper right direction, and the upper left direction until the condition (b) is satisfied.

(a)正方形内で画素値255のピクセルの割合が60%以上となった後に60%未満になったとき
(b)正方形の拡大方向の線幅1ピクセルの縦辺又は下辺をなすピクセルにおいて、画素値254以下のピクセルの割合が、1/3以下になった後に1/3以上になったとき
(a) When the ratio of pixels having a pixel value of 255 in the square becomes 60% or more and then becomes less than 60%
(b) When the ratio of the pixels having a pixel value of 254 or less becomes 1/3 or less after the ratio of the pixel value of 254 or less in the pixels forming the vertical side or the lower side of the line width of 1 pixel in the square expansion direction

次に、図10に示すように、拡大を停止した時点の正方形31の左右及び上に隣接する領域で、それぞれ正方形の一辺を長辺とし、正方形の一辺の1/3〜1/2の長さを短辺とする長方形32a、32b、32cを想定し、これらの長方形32a、32b、32cについて、次の(p)又は(q)の条件が満たされる場合に、その正方形31を顔領域候補とする。なお、正方形31が画像領域検出用画像26の隅に位置するために上述の3つの長方形が全ては描けない場合でも、描ける範囲で長方形を描き、次の(p)又は(q)の条件を判断する。   Next, as shown in FIG. 10, in a region adjacent to the left and right and above the square 31 at the time when the expansion is stopped, each side of the square is a long side, and the length is 1/3 to 1/2 of the side of the square. Assuming rectangles 32a, 32b, and 32c having short sides as short sides, if the following condition (p) or (q) is satisfied for these rectangles 32a, 32b, and 32c, the square 31 is selected as a face area candidate. And Even when all the above three rectangles cannot be drawn because the square 31 is positioned at the corner of the image area detection image 26, the rectangle is drawn within the drawable range, and the following conditions (p) or (q) are satisfied. to decide.

(p)長方形32a、32b、32cの全ピクセルの10%以上、好ましくは20%以上が画素値254以下である
(q)長方形32a、32b、32cの長辺のうち、正方形31側の長辺の長さの1/3以上、好ましくは2/5以上のピクセルが画素値254以下である
(p) 10% or more, preferably 20% or more of all the pixels of the rectangles 32a, 32b and 32c have a pixel value of 254 or less.
(q) Among the long sides of the rectangles 32a, 32b, and 32c, a pixel having a pixel value of 254 or less is 1/3 or more, preferably 2/5 or more of the length of the long side on the square 31 side.

この顔領域候補の検出方法は、交点Pが、額と髪の境に生じる水平エッジと、顔とその左右の髪領域の境に生じる垂直エッジとの交点であり、額の角隅部から斜め外側上方の頭髪領域内に入った点となるか、あるいは、耳たぶの下あたりの点となる場合が多いことから、交点Pから微小な正方形30を右下方向、左下方向、右上方向又は左上方向に拡大すると、その拡大した正方形31が顔領域である場合には、その正方形31は、それに近接する領域よりも明るくなり、上述の条件を満たすことによる。   In this face area candidate detection method, the intersection point P is an intersection point of a horizontal edge generated at the boundary between the forehead and the hair and a vertical edge generated at the boundary between the face and the right and left hair areas. Since it is often a point that falls within the outer upper hair region or a point around the bottom of the earlobe, the small square 30 from the intersection point P is moved to the lower right direction, the lower left direction, the upper right direction, or the upper left direction. When the enlarged square 31 is a face area, the square 31 becomes brighter than the area adjacent to it and satisfies the above-described condition.

なお、交点Pを基点にして拡大する図形は、正方形に限らず、長方形等であってもよく、拡大を停止したときの図形と、明度を対比する近傍領域も、上述のような3つの長方形32a、32b、32cに限らず、例えば、正方形31をその左右及び上から囲むコ字状の領域を想定してもよい。顔領域候補の検索工程を、演算手段により完全に自動化できるようにする限り、適宜設定することができる。   The figure to be enlarged with the intersection point P as the base point is not limited to a square, but may be a rectangle or the like. The figure when the enlargement is stopped and the neighboring area for comparing the brightness are also the three rectangles as described above. Not limited to 32a, 32b, and 32c, for example, a U-shaped region surrounding the square 31 from the left and right sides and from above may be assumed. As long as the face area candidate search process can be completely automated by the calculation means, it can be set as appropriate.

こうして、図11に示すように、顔領域検出用画像26中に、複数の顔領域候補33を検出することができる。なお、同図に示したように、顔領域候補33の複数が一つの領域で重なっていてもよい。   Thus, as shown in FIG. 11, a plurality of face area candidates 33 can be detected in the face area detection image 26. As shown in the figure, a plurality of face area candidates 33 may overlap in one area.

顔領域候補33を検出した後は、個々の顔領域候補33ごとに目の位置を検出する工程Bを行う。   After the face area candidate 33 is detected, a process B for detecting the position of the eyes for each individual face area candidate 33 is performed.

工程Bでは、まず、工程(B1)において、目の位置候補の検出のため、顔領域候補ごとに、目の位置検出用画像として、明度が変化した複数の目の位置検出用画像を形成する。より具体的には、例えば図12に示すように、前述した所定のフェードイン割合の画像の形成方法に従ってフェードイン0%から漸次明度を低下させたフェードイン画像を、10〜80%まで1%刻みに70階層程度作成する。   In step B, first, in step (B1), in order to detect eye position candidates, a plurality of eye position detection images with varying brightness are formed as eye position detection images for each face region candidate. . More specifically, for example, as shown in FIG. 12, a fade-in image in which the brightness is gradually decreased from 0% fade-in according to the above-described image forming method with a predetermined fade-in ratio is reduced from 10% to 80% by 1%. Create about 70 levels in increments.

なお、このフェードイン画像の階層の作成に際しては、検出精度を保ちつつ処理速度を高くするため、予め、顔領域候補33のうち、一辺の大きさが80〜120ピクセルより大きなものは、一辺の大きさが80〜120ピクセルとなるように、各顔領域候補33の画像サイズを調整することが好ましく、また、ノイズを低下させるため、必要に応じてぼかし処理を行うことが好ましい。   In creating the fade-in image hierarchy, in order to increase the processing speed while maintaining the detection accuracy, a face area candidate 33 having a side larger than 80-120 pixels in advance is It is preferable to adjust the image size of each face region candidate 33 so that the size is 80 to 120 pixels, and it is preferable to perform blurring processing as necessary to reduce noise.

また、フェードイン画像の形成に際しては、明度を上げるにつれてコントラストを下げ、明度を下げるにつれてコントラストをあげると、フェードイン画像中に目の部分がより鮮明に現れるので好ましい。   In forming a fade-in image, it is preferable to lower the contrast as the lightness is increased and raise the contrast as the lightness is lowered because the eye part appears more clearly in the fade-in image.

この他、目の位置検出用画像として、例えば、γ値を漸次変化させることにより図12に示すように明度が変化した画像を複数形成してもよく、これ以外にも種々の一般的方法を用いることが可能である。   In addition, as the eye position detection image, for example, by gradually changing the γ value, a plurality of images whose brightness is changed as shown in FIG. 12 may be formed. It is possible to use.

図12からわかるように、検出対象領域の明度をあげて完全にフェードアウトさせた画像から明度を低下させてフェードイン画像の階層を形成していくと、通常、まず最初に瞳に画素の固まりが検出され、次に鼻や口に画素の固まりが検出される。また、瞳領域の画素の固まりは左右一対として現れる。   As can be seen from FIG. 12, when the brightness of a detection target region is increased and the brightness is reduced from an image that is completely faded out to form a fade-in image hierarchy, normally, first, a cluster of pixels is first formed in the pupil. Then, a block of pixels is detected in the nose and mouth. The cluster of pixels in the pupil region appears as a pair of left and right.

そこで、工程(B2)で、顔領域候補33から形成した目の位置検出用画像を高明度でフェードアウトした状態から低明度へフェードインするのに伴い、目の位置検出用画像に漸次現れる画素の固まり領域を検出する。そして、工程(B3)で目の位置候補として、左右一対の画素の固まりを選択する。階層によっては、瞳の他に口元、眉、額等の領域にも、画素の固まり領域が対になって現れるが、この段階では、これらの画素の固まり領域も目の位置候補として選択する。   Therefore, in the step (B2), as the eye position detection image formed from the face area candidate 33 fades in from the state of fading out with high lightness to the low lightness, the pixels that gradually appear in the eye position detection image are displayed. Detect mass area. In step (B3), a cluster of a pair of left and right pixels is selected as an eye position candidate. Depending on the hierarchy, pixel cluster areas appear in pairs in areas such as the mouth, eyebrows, and forehead in addition to the pupils. At this stage, these pixel cluster areas are also selected as eye position candidates.

この場合、対をなしている画素の固まり領域のうち、目の位置候補として選択するものの条件として、予め次の(1)、(2)を設定しておくことが好ましい。
(1)左右一対の画素の固まり領域の横方向の距離が一定の範囲にあること
(2)左右一対の画素の固まり領域の縦方向の距離が一定の範囲にあること
In this case, it is preferable that the following (1) and (2) are set in advance as a condition for selecting a candidate eye position among the clustered regions of the paired pixels.
(1) The lateral distance of the cluster area of a pair of left and right pixels is within a certain range.
(2) The vertical distance between the left and right pixel clusters is within a certain range.

図13は、顔領域候補33のある階層のフェードイン画像において、顔領域中に現れた画素の固まり領域を矩形で示し、さらにこれらのうち対をなしているものを直線で結んだものである。   FIG. 13 shows a block area of pixels appearing in a face area in a fade-in image in a hierarchy with a face area candidate 33 as a rectangle, and a pair of these areas connected by a straight line. .

次に、工程(B4)で各目の位置候補の全ての目の位置検出用画像にわたる出現度数に基づいて目の位置候補を目の位置として特定する。より具体的には、図14に示すように、各フェードイン画像毎に現れた一対の目の位置候補を、目の位置検出用画像の全階層にわたって集積し、その出現度数をカウントし、このカウント数の多い順にランキングリストを作成する。このカウントでは、フェードアウトした顔画像から段階的に明度を下げていった場合に最初に現れ、最終段階まで現れ続ける瞳領域の目の位置候補が通常、最大カウント(ランキング第1位)となる。そこで、カウント値が2以下のものは目の位置候補から外し、また、原則的に最大カウントの目の位置候補の位置を目の位置候補として絞り込む。   Next, in step (B4), eye position candidates are specified as eye positions based on the appearance frequencies of all eye position candidates over all eye position detection images. More specifically, as shown in FIG. 14, a pair of eye position candidates appearing for each fade-in image is accumulated over all layers of the eye position detection image, and the appearance frequency is counted. Create a ranking list in descending order of count. In this count, the eye position candidate that appears first when the brightness is gradually reduced from the faded-out face image and continues to appear until the final stage is normally the maximum count (ranking first). Therefore, those with a count value of 2 or less are excluded from eye position candidates, and in principle, the position of the eye position candidate with the maximum count is narrowed down as an eye position candidate.

ただし、次の(a)〜(c)の条件を全て満たした場合、あるいは(d)の条件を満たした場合には、カウント数が2番目に多かった目の位置候補の位置を目の位置として特定する。
(a)ランキング第2位の目の位置候補が、ランキング第1位の目の位置候補より上方にある場合
(b)ランキング第2位の目の位置候補の目と目の中心間距離が、ランキング第1位の目の位置候補の中心間距離より長い場合
(c)ランキング第2位の目の位置候補の左右の瞳にあたる領域が、共にランキング第1位の目候補の左右の瞳にあたる位置よりも外側にある場合
(d)ランキング第1位の目の位置候補とランキング第2位の目の位置候補の縦方向の距離が、目と眉の距離程度に離れ、ランキング第1位の目の位置候補がランキング第2位の目の位置候補よりも上にある場合
However, if the following conditions (a) to (c) are all satisfied, or if the condition (d) is satisfied, the position of the eye position candidate with the second largest count is set as the eye position. As specified.
(a) When the second position candidate for the ranking is higher than the first position candidate for the ranking
(b) When the distance between the center of the eye position candidate of the 2nd ranked eye is longer than the distance between the centers of the position candidate of the 1st ranked eye
(c) When the left and right pupil regions of the second ranking eye position candidate are both outside the positions corresponding to the left and right pupils of the first ranking eye candidate
(d) The vertical distance between the first position candidate of the ranking and the second position candidate of the ranking is about the distance between the eyes and the eyebrows, and the first position candidate of the ranking is ranked first. When the position is above the second position candidate

このうち、(a)〜(c)は、ランキング第1位がまれに口領域になることがあるのに対し、口の位置を目の位置であると誤判定しないためのものであり、(d)は、目の周りの眉等を目の位置であると誤判定しないためのものである。   Of these, (a) to (c) are intended to prevent erroneous determination of the position of the mouth as the position of the eye, while the first ranking in the ranking may rarely be the mouth area. d) is for preventing erroneous determination that the eyebrows around the eyes are the positions of the eyes.

以上により、図15に示すように、個々の目の位置の検出対象領域において、目の位置
候補(より正確には瞳の位置)を正確に検出することが可能となる。
As described above, as shown in FIG. 15, it is possible to accurately detect eye position candidates (more precisely, the position of the pupil) in the detection target area of each eye position.

以上の目の位置候補の特定方法は、工程Aで設定した全ての顔領域候補についてそれぞれ行う。また、いずれかの顔領域候補において、目の位置を特定できなかった場合には、その領域には目が存在しないとして扱う。   The eye position candidate specifying method described above is performed for all face area candidates set in step A. Further, when the position of the eye cannot be specified in any face area candidate, it is handled that there is no eye in that area.

こうして個々の目の位置の検出対象領域で特定された目の位置を、最終的に図16に示すように元画像の対応する位置に重ね、元画像における個々の顔画像の目の位置とすることが可能となる。   In this way, the eye positions specified in the detection target areas of the individual eye positions are finally superimposed on the corresponding positions of the original image as shown in FIG. 16, and set as the eye positions of the individual face images in the original image. It becomes possible.

また、工程(B4)で目の位置を特定した後、工程(B5)でその目の位置に対応する顔領域候補に基づいて顔領域を特定することにより、元画像中の顔領域の位置も検出することができる。この場合、特定した目の位置に対応する顔領域候補の矩形領域をそのまま顔領域とする必要はなく、元画像において顔領域を特定する目的に応じて、検出した目の位置を含む多角形領域としてもよく、円形領域としてもよく、肌色領域としてもよい。ここで、顔領域の大きさは、検出した両目の間隔や顔領域候補の大きさ等に応じて、適宜設定しておくことができる。また、各顔領域候補において目の位置の検出に加え、フェードイン法を用いて口や鼻の位置も検出し(画像の認識・理解シンポジウム(MIRU2006),論文集CD-ROM,IS1-18「顔パーツ(髪・眉・目・鼻・口)検出の高精度化と実用化」,2006.7.19.発行)、少なくとも、目の他に鼻又は口が含まれる領域を顔領域としてもよい。   In addition, after specifying the position of the eye in step (B4), the position of the face area in the original image is determined by specifying the face area based on the face area candidate corresponding to the position of the eye in step (B5). Can be detected. In this case, the rectangular area of the face area candidate corresponding to the specified eye position does not need to be used as the face area as it is, but a polygon area including the detected eye position according to the purpose of specifying the face area in the original image. Or a circular region or a flesh-colored region. Here, the size of the face region can be appropriately set according to the detected distance between both eyes, the size of the face region candidate, and the like. In addition to detecting the position of eyes in each face region candidate, the position of the mouth and nose is also detected using the fade-in method (Image Recognition and Understanding Symposium (MIRU2006), Proceedings CD-ROM, IS1-18 “ Face parts (hair, eyebrows, eyes, nose, mouth) are highly accurate and put into practical use ", published 2006.7.19), and at least an area that includes the nose or mouth in addition to the eyes may be used as the face area.

また、目の位置に対応する顔領域であって、大きさあるいは位置のずれているものが複数重なり合っている場合には、これらの和領域に基づいて顔領域を定めてもよい。例えば、元画像において顔領域のモザイク処理を目的とする場合には、本来の顔領域に確実にモザイク処理を施すため、和領域に基づくことが好ましい。   In addition, when a plurality of face areas corresponding to the position of the eye and having different sizes or positions are overlapped, the face area may be determined based on these sum areas. For example, when the purpose is to perform mosaic processing of the face area in the original image, it is preferable to use the sum area in order to reliably perform mosaic processing on the original face area.

本発明の目の位置の検出方法及び顔領域の位置の検出方法は、複数顔画像において、目の位置の検出対象とする個々の被写体の肌の色、瞳の色、顔の向き、照明環境の変化によらず、精度よく、簡便な演算方法で、高い処理速度で目の位置を検出することができる。したがって、白人、黒人を問わず、複数顔画像から目の位置を検出することができる。   The eye position detection method and face region position detection method according to the present invention are based on the skin color, pupil color, face orientation, and illumination environment of each subject to be detected as the eye position in a plurality of face images. Regardless of the change in position, the eye position can be detected at a high processing speed with a simple and accurate calculation method. Therefore, it is possible to detect the position of the eyes from a plurality of face images regardless of whites or blacks.

本発明により検出された目の位置は、髪型シミュレーション画像を形成する場合、化粧シミュレーション画像を形成する場合、顔画像の目隠し処理をする場合、顔画像のフレーム処理をする場合、個人認証用画像を作成する場合など、目の位置の検出が必要とされる種々の場面で利用することができる。   The positions of the eyes detected by the present invention are the following: when forming a hairstyle simulation image, when forming a makeup simulation image, when performing face image blindfold processing, when performing face image frame processing, It can be used in various scenes where the detection of the eye position is required, such as when creating.

また、本発明により検出された顔領域の位置も、顔画像の目隠し処理をする場合、デジタルカメラ撮影時の顔色補正又は撮影画像の顔色補正をする場合、プリンタ印刷時の顔色補正をする場合等で利用することができる。   In addition, the position of the face area detected by the present invention is also applied to the case where the face image is blindfolded, the face color correction at the time of digital camera shooting or the face color correction of the shot image, the face color correction at the time of printer printing, etc. Can be used.

本発明の目の位置の検出方法及び顔領域の位置の検出方法の流れ図である。3 is a flowchart of an eye position detection method and a face region position detection method according to the present invention. 目の位置及び顔領域の位置の検出システムのブロック図である。It is a block diagram of the detection system of the position of an eye position and a face area. 明度補正の説明図である。It is explanatory drawing of brightness correction. 明度補正の説明図である。It is explanatory drawing of brightness correction. 前処理前の元画像と前処理後のぼかし画像である。An original image before preprocessing and a blurred image after preprocessing. 水平ぼかし画像、垂直ぼかし画像、水平・垂直ぼかし画像である。They are a horizontal blur image, a vertical blur image, and a horizontal / vertical blur image. 水平・垂直ぼかし画像から検出した水平エッジと垂直エッジの画像である。It is an image of a horizontal edge and a vertical edge detected from a horizontal / vertical blurred image. 斜め2方向のぼかし画像である。It is a blurred image in two diagonal directions. 顔領域検出用画像(ポジ画像)である。It is a face area detection image (positive image). 顔領域検出用画像(ネガ画像)である。It is a face area detection image (negative image). 顔領域候補の検出のための、水平エッジと垂直エッジの交点を基点とする正方形の説明図である。It is explanatory drawing of the square which makes the base point the intersection of a horizontal edge and a vertical edge for the detection of a face area candidate. 顔領域候補の検出条件の説明図である。It is explanatory drawing of the detection conditions of a face area | region candidate. 顔領域検出用画像中に顔領域候補を示した図である。It is the figure which showed the face area candidate in the image for face area detection. 顔領域候補の明度を変化させた目の位置検出用画像である。It is an eye position detection image in which the brightness of a face area candidate is changed. ある階層のフェードイン画像に、目の位置候補を示した図である。It is the figure which showed the position candidate of the eye to the fade-in image of a certain hierarchy. ある階層の目の位置検出用画像において、全階層にわたる目の位置候補を集積して表示した図である。It is the figure which accumulated and displayed the eye position candidate over all the hierarchies in the eye position detection image of a certain hierarchy. 特定した目の位置を顔領域候補に表示した図である。It is the figure which displayed the position of the specified eye on the face area candidate. 検出した目の位置と顔領域の位置を元画像に重ねた図である。It is the figure which superimposed the position of the detected eye and the position of the face area on the original image.

符号の説明Explanation of symbols

1 撮像装置
2 パソコン本体
3 ディスプレイ
4 イメージスキャナ
5 プリンタ
10 目及び顔領域の位置の検出システム
20 元画像
21 前処理後のぼかし画像
22 水平ぼかし画像
23 垂直ぼかし画像
24 水平・垂直ぼかし画像
25 水平・垂直エッジ画像
26 顔領域検出用画像
30 微小な正方形
31 拡大を停止した正方形
32a、32b、32c 長方形
33 顔領域候補
P 水平・垂直ぼかし画像における水平エッジと垂直エッジの交点
DESCRIPTION OF SYMBOLS 1 Imaging device 2 Personal computer body 3 Display 4 Image scanner 5 Printer 10 Eye and face area position detection system 20 Original image 21 Pre-processed blurred image 22 Horizontal blurred image 23 Vertical blurred image 24 Horizontal / vertical blurred image 25 Vertical edge image 26 Face area detection image 30 Small square 31 Squares 32a, 32b, and 32c that have stopped expanding Rectangle 33 Face area candidate P Intersection of horizontal edge and vertical edge in horizontal / vertical blurred image

Claims (9)

顔画像を含む元画像から目の位置を検出する方法であって、
A.(A1)元画像から交差する2方向にぼかしたぼかし画像を作成し、該ぼかし画像におけるぼかし方向のエッジの交点の位置を求めると共に、
(A2)元画像の階調をつぶした顔領域検出用画像を作成し、
(A3)顔領域検出用画像において、ぼかし方向のエッジの交点を一つの頂点とする矩形領域であって、その左右及び上の隣接領域に比して明度が高い領域を、顔領域候補として検出する工程、
B.(B1)顔領域候補ごとに、明度が変化した複数の目の位置検出用画像を作成し、
(B2)目の位置検出用画像が高明度でフェードアウトした状態から低明度へフェードインするのに伴い、目の位置検出用画像に漸次現れる画素の固まり領域を検出し、
(B3)検出した画素の固まり領域のうち対となって現れたものを目の位置候補として選択し、
(B4)各目の位置候補の全ての目の位置検出用画像にわたる出現度数に基づいて目の位置候補を目の位置として特定する工程、
を有する目の位置の検出方法。
A method for detecting an eye position from an original image including a face image,
A. (A1) Create a blurred image blurred in two directions intersecting the original image, obtain the position of the intersection of the edges in the blurred direction in the blurred image,
(A2) Create a face area detection image with the gradation of the original image collapsed,
(A3) In the face area detection image, a rectangular area having an intersection of edges in the blur direction as one vertex and having a higher brightness than the left and right and upper adjacent areas is detected as a face area candidate. The process of
B. (B1) For each face area candidate, create a plurality of eye position detection images with varying brightness,
(B2) As the eye position detection image fades in from a state of fading out at a high brightness to a low brightness, a cluster area of pixels that gradually appears in the eye position detection image is detected,
(B3) Select the clustered areas of the detected pixels that appeared in pairs as eye position candidates,
(B4) specifying the eye position candidate as the eye position based on the appearance frequency over all eye position detection images of each eye position candidate;
A method for detecting the position of an eye.
工程A(A2)において、明度補正をした元画像から顔領域検出用画像を作成する請求項1記載の目の位置の検出方法。   The method of detecting an eye position according to claim 1, wherein in step A (A2), an image for face area detection is created from the original image whose brightness has been corrected. 工程A(A2)において、元画像が256階調の場合に、フェードイン0%の画像は全ての画素が画素値255を有し、フェードインx%の画像(但し、x>0)は、元画像において画素値が2.55x未満の画素は元画像の画素値を有し、画素値が2.55x以上の画素は一律画素値255を有するとしたときに、顔領域検出用画像として、元画像に対してフェードイン25〜35%の画像を形成する請求項1又は2記載の目の位置の検出方法。   In step A (A2), when the original image has 256 gradations, an image with 0% fade-in has all pixels having a pixel value of 255, and an image with fade-in x% (where x> 0) A pixel having a pixel value less than 2.55x in the original image has a pixel value of the original image, and a pixel having a pixel value of 2.55x or more has a uniform pixel value 255. The eye position detection method according to claim 1 or 2, wherein an image having a fade-in of 25 to 35% is formed with respect to the original image. 交差する2方向を水平方向と垂直方向とする請求項1〜3のいずれかに記載の目の位置の検出方法。   The method for detecting an eye position according to claim 1, wherein two intersecting directions are a horizontal direction and a vertical direction. 工程A(A3)において、水平エッジと垂直エッジの交点を一つの頂点とする微小な正方形を想定し、その交点を基点として正方形を次の(a)又は(b)の条件が満たされるまで右下方向、左下方向、右上方向及び左上方向にそれぞれ拡大し、
(a)正方形内で画素値255のピクセルの割合が60%以上となった後に60%未満になったとき
(b)正方形の拡大方向の線幅1ピクセルの縦辺又は下辺において、画素値254以下のピクセルの割合が、1/3以下になった後に1/3以上になったとき

拡大を停止した時点の正方形の左右及び上に隣接する領域で、それぞれ正方形の一辺を長辺とし、正方形の一辺の1/3〜1/2の長さを短辺とする長方形を想定し、これらの長方形について、次の(p)又は(q)の条件が満たされるものを顔領域候補とする請求項4記載の目の位置の検出方法。
(p)全ピクセルの10%以上が画素値254以下である
(q)長方形の正方形側の長辺の長さの1/3以上のピクセルが画素値254以下である
In step A (A3), assume a small square with the intersection of the horizontal edge and the vertical edge as one vertex, and use the intersection as a base point until the next condition (a) or (b) is satisfied. Expand downward, lower left, upper right and upper left,
(a) When the proportion of pixels having a pixel value of 255 in the square becomes 60% or more and then becomes less than 60%
(b) When the ratio of pixels with a pixel value of 254 or less becomes 1/3 or less after the ratio of the pixel value of 254 or less in the vertical or lower side of the line width of 1 pixel in the square expansion direction

In a region adjacent to the left and right and above the square at the time when the expansion is stopped, a rectangle with one side of the square as a long side and a length of 1/3 to 1/2 of one side of the square as a short side is assumed. The eye position detection method according to claim 4, wherein those rectangles satisfying the following condition (p) or (q) are set as face area candidates.
(p) 10% or more of all pixels have a pixel value of 254 or less
(q) Pixels having a length equal to or more than 1/3 of the long side of the rectangular square have a pixel value of 254 or less
請求項1〜5のいずれかに記載の方法で目の位置を特定した後、その目の位置に対応する顔領域候補に基づいて顔領域を特定する顔領域の位置の検出方法。   A method for detecting the position of a face area, which specifies a face area based on a face area candidate corresponding to the eye position after the eye position is specified by the method according to claim 1. 顔画像を含む元画像の取得手段、及び演算手段を備えた目の位置の検出システムであっ
て、演算手段が、
元画像から交差する2方向にぼかしたぼかし画像を作成する機能、該ぼかし画像のぼかし方向のエッジを検出し、それらの交点の位置を求める機能、元画像の階調をつぶした顔領域検出用画像を作成する機能、顔領域検出用画像において、ぼかし方向のエッジの交点を一つの頂点とする矩形領域であって、その左右及び上の隣接領域に比して明度が高い領域を顔領域候補として検出する機能、顔領域候補ごとに、目の位置検出用画像として明度が変化した複数の画像を作成する機能、その画像が高明度でフェードアウトした状態から低明度へフェードインするのに伴い、目の位置検出用画像に漸次現れる画素の固まり領域を検出する機能、検出した画素の固まり領域のうち対となって現れたものを目の位置候補として選択する機能、及び各目の位置候補の全ての目の位置検出用画像にわたる出現度数に基づいて目の位置を特定する機能を備えている目の位置の検出システム。
An eye position detection system including an original image acquisition unit including a face image and a calculation unit, wherein the calculation unit includes:
A function that creates a blurred image that is blurred in two directions intersecting with the original image, a function that detects edges in the blur direction of the blurred image and obtains the position of the intersection, and a face area detection in which the gradation of the original image is crushed Image creation function, a face area detection image is a rectangular area whose intersection is the intersection of edges in the blur direction and has a higher brightness than the adjacent areas on the left and right and above As a function to create a plurality of images whose brightness has changed as eye position detection images for each face area candidate, as the image fades out from a state of fading out with high brightness to low brightness, A function for detecting a cluster area of pixels that gradually appear in the eye position detection image, a function for selecting a pair of detected pixel cluster areas that appear as a pair, and each eye The position detection system of the position of the eye has a function of specifying the position of the eye based on the occurrence frequency over position detecting images of all eye candidates.
交差する2方向を水平方向と垂直方向とする請求項7記載の目の位置の検出システム。   The eye position detection system according to claim 7, wherein two intersecting directions are a horizontal direction and a vertical direction. 顔画像を含む元画像の取得手段、及び演算手段を備えた顔領域の位置の検出システムであって、演算手段が、請求項7又は8記載の演算手段の機能、及び顔領域候補のうち目の位置が特定されたものに基づいて顔領域を特定する機能を有する顔領域の位置の検出システム。   9. A system for detecting a position of a face area including an original image acquisition unit including a face image and a calculation unit, wherein the calculation unit is a function of the calculation unit according to claim 7 or 8, and an eye among face area candidates. A face area position detection system having a function of specifying a face area based on the position of the face.
JP2007251663A 2007-09-27 2007-09-27 Eye position detection method Expired - Fee Related JP4683236B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007251663A JP4683236B2 (en) 2007-09-27 2007-09-27 Eye position detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007251663A JP4683236B2 (en) 2007-09-27 2007-09-27 Eye position detection method

Publications (2)

Publication Number Publication Date
JP2009086705A true JP2009086705A (en) 2009-04-23
JP4683236B2 JP4683236B2 (en) 2011-05-18

Family

ID=40660105

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007251663A Expired - Fee Related JP4683236B2 (en) 2007-09-27 2007-09-27 Eye position detection method

Country Status (1)

Country Link
JP (1) JP4683236B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2470614A (en) * 2008-07-23 2010-12-01 Samsung Digital Imaging Co Ltd Image processing method featuring facial blurring
CN110477858A (en) * 2018-05-15 2019-11-22 深圳市斯尔顿科技有限公司 Tested eye alignment methods, device and Ophthalmologic apparatus

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007200289A (en) * 2005-12-28 2007-08-09 Kao Corp Method for detection of location of eye

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007200289A (en) * 2005-12-28 2007-08-09 Kao Corp Method for detection of location of eye

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2470614A (en) * 2008-07-23 2010-12-01 Samsung Digital Imaging Co Ltd Image processing method featuring facial blurring
GB2470614B (en) * 2008-07-23 2012-03-07 Samsung Electronics Co Ltd Image processing method and apparatus, and digital photographing apparatus using the same
US8260083B2 (en) 2008-07-23 2012-09-04 Samsung Electronics Co., Ltd. Image processing method and apparatus, and digital photographing apparatus using the same
CN110477858A (en) * 2018-05-15 2019-11-22 深圳市斯尔顿科技有限公司 Tested eye alignment methods, device and Ophthalmologic apparatus
CN110477858B (en) * 2018-05-15 2023-11-28 深圳莫廷医疗科技有限公司 Eye to be inspected alignment method, device and ophthalmic equipment

Also Published As

Publication number Publication date
JP4683236B2 (en) 2011-05-18

Similar Documents

Publication Publication Date Title
EP3338217B1 (en) Feature detection and masking in images based on color distributions
EP1970859B1 (en) Detecting method and detecting system for positions of face parts
US8331619B2 (en) Image processing apparatus and image processing method
KR101446975B1 (en) Automatic face and skin beautification using face detection
US9053537B2 (en) Classifier for use in generating a diffuse image
US8094964B2 (en) Methods and systems for estimating illumination source characteristics from a single image
US8483480B2 (en) Method and system for factoring an illumination image
CN107767325A (en) Method for processing video frequency and device
US9396411B2 (en) Method and system for generating intrinsic images using a single reflectance technique
JP2008234208A (en) Facial region detection apparatus and program
JP2004005384A (en) Image processing method, image processing device, program, recording medium, automatic trimming device and picture-taking arrangement
JP2004030007A (en) Makeup simulation apparatus, makeup simulation method, makeup simulation program and recording medium with program recorded thereon
CN109716355A (en) Grain boundaries identification
US9754155B2 (en) Method and system for generating intrinsic images using a single reflectance technique
JP4775599B2 (en) Eye position detection method
JP4683236B2 (en) Eye position detection method
JP4530173B2 (en) Method and system for detecting the position of a facial part
JP4831344B2 (en) Eye position detection method
JP5093540B2 (en) Eye position detection method and detection system
JP4831361B2 (en) Eye position detection method and detection system
JP2007048108A (en) Image evaluation system, image evaluation method and image evaluation program
JP2008167458A (en) Imaging apparatus and method, and program
JP2009171569A (en) Image capturing apparatus, method, and program
JP2005202567A (en) Image processing method, image processor and image processing program

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100921

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100929

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101129

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110112

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110125

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

Free format text: PAYMENT UNTIL: 20140218

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 4683236

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20140218

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees