JP2007139535A - Face end detection device and method, and program - Google Patents

Face end detection device and method, and program Download PDF

Info

Publication number
JP2007139535A
JP2007139535A JP2005332404A JP2005332404A JP2007139535A JP 2007139535 A JP2007139535 A JP 2007139535A JP 2005332404 A JP2005332404 A JP 2005332404A JP 2005332404 A JP2005332404 A JP 2005332404A JP 2007139535 A JP2007139535 A JP 2007139535A
Authority
JP
Japan
Prior art keywords
face
contour
value
face image
candidate
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
JP2005332404A
Other languages
Japanese (ja)
Other versions
JP4664805B2 (en
Inventor
Junya Kasugai
純也 春日井
Takeshi Naito
剛 内藤
Hiroshi Ishiguro
博 石黒
Kenichi Ogami
健一 大上
Shigeyasu Uozumi
重康 魚住
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.)
Toyota Motor Corp
Aisin Corp
Original Assignee
Aisin Seiki Co Ltd
Toyota Motor 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 Aisin Seiki Co Ltd, Toyota Motor Corp filed Critical Aisin Seiki Co Ltd
Priority to JP2005332404A priority Critical patent/JP4664805B2/en
Publication of JP2007139535A publication Critical patent/JP2007139535A/en
Application granted granted Critical
Publication of JP4664805B2 publication Critical patent/JP4664805B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To detect both end positions of a face more accurately based on a face image having a possibility of wrongly detecting both end positions of a face, such as a face image photographed in the nighttime or a female face image, to the furthermore inside than actual. <P>SOLUTION: A face image acquired by photographing a driver's face in the nighttime by a camera 10 or a face image acquired by photographing a female driver's face or the like is stored in an image memory 22. A CPU 24 detects a temporary contour position in the right and left directions of the face based on pixel data of the face image. The CPU 24 determines a plurality of contour candidate positions which are candidates for the contour position based on pixel data positioned on the periphery of the detected temporary contour position, and uses a position extracted based on statistics from the plurality of determined contour candidate positions as the contour position. Hereby, both end positions of the face can be detected more accurately based on the face image photographed in the nighttime, the female face image or the like. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、顔画像から、より正確な顔の両端を検出することが可能な顔端検出装置、顔端検出方法、及び、プログラムに関する。   The present invention relates to a face edge detection apparatus, a face edge detection method, and a program capable of detecting both ends of a face more accurately from a face image.

顔画像に基づいて顔の両端、もしくは、輪郭を正確に検出することは、顔画像の画像処理において重要な課題である。   Accurate detection of both ends or contours of a face based on the face image is an important issue in the image processing of the face image.

特許文献1には、人の顔を撮影した画像を処理し、人の動きや背景に影響されること無く高精度に顔の位置を検出する手法が開示されている。   Patent Document 1 discloses a technique for processing an image obtained by photographing a human face and detecting the position of the face with high accuracy without being affected by the movement or background of the person.

また、特許文献2には、ドライバーが存在可能な領域を撮影して得られた画像を取り込み、取り込んだ画像から縦エッジ画像(顔の両側端)を検出し、検出した縦エッジ画像に基づいて、複数の顔中心候補線を設定すると共に各顔中心候補線各々に対して、該顔中心候補線が顔の中心線である確からしさを表す値に基づいて、顔の有無の判定精度を向上する技術が開示されている。
特開2004−310396号公報 特開2005−011097号公報
Patent Document 2 captures an image obtained by photographing an area where a driver can exist, detects a vertical edge image (both side edges of the face) from the captured image, and based on the detected vertical edge image. In addition to setting a plurality of face center candidate lines, for each face center candidate line, the accuracy of determining the presence or absence of a face is improved based on a value representing the likelihood that the face center candidate line is the face center line. Techniques to do this are disclosed.
JP 2004-310396 A JP 2005-011097 A

車両の走行環境は様々に変化し、カメラが捉えるドライバーの画像も様々に変化する。例えば、夜間では、顔の両端付近での輝度値の差がはっきりせずに、正確な顔の両端位置を検出することができないことが多い。また、例えば、ドライバーが女性の場合、髪型や化粧の影響により、顔の両端付近での輝度値の差がはっきりせずに、正確な顔の両端位置を検出することができないことが多い。
この顔の両端位置の検出に誤りが生ずると、以後の処理を正確に行うことができない。
The driving environment of the vehicle changes variously, and the driver's image captured by the camera also changes variously. For example, at night, the difference between the brightness values near the both ends of the face is not clear, and it is often impossible to detect the exact positions of both ends of the face. For example, when the driver is a woman, due to the influence of the hairstyle and makeup, the difference between the brightness values in the vicinity of both ends of the face is not clear, and it is often impossible to detect the exact positions of both ends of the face.
If an error occurs in the detection of both end positions of the face, the subsequent processing cannot be performed accurately.

本発明は上記の問題点に鑑みてなされたものであり、夜間に撮影された画像や女性の顔画像といった顔の両端位置を実際よりも内側に誤検出する虞のあった顔画像においても、顔の両端位置を検出することが可能とする顔端検出装置、顔端検出方法、及び、プログラムを提供することを目的とする。   The present invention has been made in view of the above problems, and even in a face image that may be erroneously detected on the inner side than the actual position of both ends of the face, such as an image photographed at night or a female face image, It is an object of the present invention to provide a face edge detection device, a face edge detection method, and a program capable of detecting both end positions of a face.

上記目的を達成するため、この発明の第1の観点に係る顔端検出装置は、顔を撮影して得られた顔画像を記憶する顔画像記憶手段と、前記顔画像記憶手段に記憶された顔画像の画素データを処理して、顔の左右方向の仮の輪郭位置を検出し、検出した仮の輪郭位置の周辺に位置する画素データに基づいて、輪郭位置の候補となる複数の輪郭候補位置を決定する輪郭候補位置決定手段と、前記輪郭候補位置決定手段により決定された前記複数の輪郭候補位置から抽出した位置を輪郭位置とする輪郭位置補正手段と、を備える、ことを特徴とする。   In order to achieve the above object, a face edge detection device according to a first aspect of the present invention stores a face image storage means for storing a face image obtained by photographing a face and the face image storage means. Process the pixel data of the face image to detect a temporary contour position in the left-right direction of the face, and based on the pixel data located around the detected temporary contour position, a plurality of contour candidates that are candidates for the contour position A contour candidate position determining unit that determines a position; and a contour position correcting unit that uses a position extracted from the plurality of contour candidate positions determined by the contour candidate position determining unit as a contour position. .

また、前記顔位置検出装置において、前記輪郭候補位置決定手段は、前記顔画像記憶手段に記憶された顔画像の画素データを処理して、顔の左右方向の仮の輪郭位置を検出する仮輪郭位置検出手段と、前記仮輪郭位置検出手段で検出した前記仮の輪郭位置の左右方向の隣りに位置する画素データと、前記隣りに位置する画素の上下に位置する二つの画素データに基づいて、前記仮の輪郭位置を前記隣に位置する画素の位置に変更するか否かを決定する決定手段と、前記決定手段で前記仮の輪郭位置を変更することを決定した場合に、前記仮の輪郭位置を変更する変更手段と、前記決定手段と、前記変更手段と、を繰り返し動作させて、前記決定手段が前記仮の輪郭位置を変更しないと決定したときの仮の輪郭位置を前記輪郭候補位置とする手段と、を備えることを特徴とするようにしてもよい。   Further, in the face position detection device, the contour candidate position determination unit processes the pixel data of the face image stored in the face image storage unit, and detects a temporary contour position in the horizontal direction of the face. Based on position detection means, pixel data located adjacent to the temporary contour position in the left-right direction detected by the temporary contour position detection means, and two pixel data located above and below the pixels located adjacent to each other, Determining means for determining whether or not to change the temporary contour position to the position of the pixel located next to the temporary contour position, and when the determination means determines to change the temporary contour position, The changing means for changing the position, the determining means, and the changing means are repeatedly operated so that the temporary contour position when the determining means determines not to change the temporary contour position is the contour candidate position. Hand When, may be characterized in that it comprises a.

さらに、前記顔位置検出装置において、前記輪郭位置補正手段は、前記輪郭候補位置決定手段により決定された前記複数の輪郭候補位置のヒストグラムを作成するヒストグラム作成手段と、前記ヒストグラム作成手段で作成したヒストグラムに基づいて、前記輪郭候補位置の標準偏差を算出する標準偏差算出手段と、前記標準偏差算出手段で算出した標準偏差内の輪郭候補位置の内、顔画像の最も外側に位置する輪郭候補位置を輪郭位置とする手段と、を備えることを特徴とするようにしてもよい。   Further, in the face position detecting device, the contour position correcting means creates a histogram of the plurality of contour candidate positions determined by the contour candidate position determining means, and a histogram created by the histogram creating means. A standard deviation calculating means for calculating a standard deviation of the contour candidate position, and a contour candidate position located on the outermost side of the face image among the contour candidate positions within the standard deviation calculated by the standard deviation calculating means. And means for setting the contour position.

また、この発明の第2の観点に係る顔端検出方法は、顔を撮影して得られた顔画像を記憶する顔画像記憶ステップと、前記顔画像記憶ステップで記憶された顔画像の画素データを処理して、顔の左右方向の仮の輪郭位置を検出し、検出した仮の輪郭位置の周辺に位置する画素データに基づいて、輪郭位置の候補となる複数の輪郭候補位置を決定する輪郭候補位置決定ステップと、前記輪郭候補位置決定ステップで決定された前記複数の輪郭候補位置から抽出した位置を輪郭位置とする輪郭位置補正ステップと、を備える、ことを特徴とする。   The face edge detection method according to the second aspect of the present invention includes a face image storage step for storing a face image obtained by photographing a face, and pixel data of the face image stored in the face image storage step. To detect a temporary contour position in the left-right direction of the face, and determine a plurality of contour candidate positions that are candidates for the contour position based on pixel data located around the detected temporary contour position A candidate position determining step; and a contour position correcting step using a position extracted from the plurality of contour candidate positions determined in the contour candidate position determining step as a contour position.

また、この発明の第3の観点に係るプログラムは、コンピュータに、顔を撮影して得られた顔画像を記憶する顔画像記憶手順と、前記顔画像記憶手順で記憶された顔画像の画素データを処理して、顔の左右方向の仮の輪郭位置を検出し、検出した仮の輪郭位置の周辺に位置する画素データに基づいて、輪郭位置の候補となる複数の輪郭候補位置を決定する輪郭候補位置決定手順と、前記輪郭候補位置決定手順で決定された前記複数の輪郭候補位置から抽出した位置を輪郭位置とする輪郭位置補正手順と、を実行させる。   According to a third aspect of the present invention, there is provided a program for storing a face image obtained by photographing a face in a computer, and pixel data of the face image stored in the face image storing procedure. To detect a temporary contour position in the left-right direction of the face, and determine a plurality of contour candidate positions that are candidates for the contour position based on pixel data located around the detected temporary contour position A candidate position determination procedure and a contour position correction procedure in which positions extracted from the plurality of contour candidate positions determined in the contour candidate position determination procedure are used as a contour position are executed.

この発明によれば、夜間に撮影した顔画像や女性の顔画像といった顔の両端位置を実際よりも内側に誤検出する虞のあった顔画像においても、顔の両端位置をより正確に検出することができる。   According to the present invention, both end positions of a face can be detected more accurately even in a face image such as a face image photographed at night or a face image of a woman that may misdetect both ends of the face inside. be able to.

以下、本発明の実施形態に係る顔端検出装置について説明する。   Hereinafter, a face edge detection device according to an embodiment of the present invention will be described.

本実施形態の顔端検出装置は、図1に示すように、ドライバーの顔を撮影して顔画像を生成するカメラ10と、ドライバーの顔を照明する照明光源12と、ドライバーの顔の両端位置等を検出するコンピュータ14と、コンピュータ14に接続された表示装置16とを備える。   As shown in FIG. 1, the face edge detection device of this embodiment includes a camera 10 that captures a driver's face and generates a face image, an illumination light source 12 that illuminates the driver's face, and both end positions of the driver's face. And a display device 16 connected to the computer 14.

カメラ10は例えばCCDカメラ等から構成され、ドライバーの顔の階調画像を取得する。カメラ10によって生成される顔画像は、ドライバーの顔だけでなく、その背景なども含まれている。   The camera 10 is composed of a CCD camera, for example, and acquires a gradation image of the driver's face. The face image generated by the camera 10 includes not only the driver's face but also its background.

表示装置16は、LCD(Liquid Crystal Display)又はCRT(Cathode Ray Tube)などから構成され、カメラ10で撮影された顔画像から生成された二値化画像などを表示する。   The display device 16 is composed of an LCD (Liquid Crystal Display), a CRT (Cathode Ray Tube), or the like, and displays a binarized image generated from a face image taken by the camera 10.

コンピュータ14は、カメラ10により取得された顔画像を処理して顔の左右の両端位置を検出する装置である。しかし、夜間に撮影された顔画像や女性の顔画像において最初に検出した顔の両端位置は、誤って顔の中央よりに検出されることが多い。そこで、コンピュータ14は、最初に検出した左右の両端位置に基づいて、誤って検出され得る部分に対して、顔の両端位置を補正してから、最終的な顔の左右の両端位置を求める。また、コンピュータ14は、図2に示すように、画像キャプチャ装置21と、画像メモリ22と、ROM23と、CPU24と、RAM25と、表示制御装置27と、光源制御装置28と、を備える。   The computer 14 is a device that processes the face image acquired by the camera 10 and detects the left and right end positions of the face. However, the positions of both ends of the face detected first in the face image taken at night or the face image of a woman are often erroneously detected from the center of the face. Therefore, the computer 14 corrects the both end positions of the face with respect to a portion that can be detected erroneously based on the left and right end positions detected first, and then obtains the final left and right end positions of the face. As shown in FIG. 2, the computer 14 includes an image capture device 21, an image memory 22, a ROM 23, a CPU 24, a RAM 25, a display control device 27, and a light source control device 28.

画像キャプチャ装置21は、カメラ10で撮影されたアナログ画像信号をディジタル信号に変換する。
画像メモリ22は、カメラ10により生成され、画像キャプチャ装置21でディジタル化された画像データを記憶する。
The image capture device 21 converts an analog image signal captured by the camera 10 into a digital signal.
The image memory 22 stores image data generated by the camera 10 and digitized by the image capture device 21.

ROM23は、CPU24の動作を制御するためのプログラムを記憶する。また、ROM23は、後述する画像処理を実行するための様々な固定データを記憶する。   The ROM 23 stores a program for controlling the operation of the CPU 24. Further, the ROM 23 stores various fixed data for executing image processing to be described later.

CPU24は、ROM23に格納されているプログラムを実行することにより、カメラ10により取得された顔画像を処理して顔の両端位置を検出する。そして、CPU24は、この検出した両端位置に基づいて、その両端位置を補正し、再度、顔の左右の両端位置を求める。   The CPU 24 executes a program stored in the ROM 23 to process the face image acquired by the camera 10 and detect both end positions of the face. Then, the CPU 24 corrects the both end positions based on the detected both end positions, and obtains the left and right end positions of the face again.

RAM25は、CPU24のワークエリアとして機能する。
表示制御装置27は、CPU24の制御下に、表示装置16を制御する。
光源制御装置28は、照明光源12の点灯・消灯を制御する。
The RAM 25 functions as a work area for the CPU 24.
The display control device 27 controls the display device 16 under the control of the CPU 24.
The light source control device 28 controls turning on / off of the illumination light source 12.

次に、ROM23に格納される固定データの例を図3を参照して説明する。まず、ROM23は、図3(a)、(b)、(c)に示すような、順・逆方向の縦エッジ検出用と横エッジ検出用ソーベルフィルタのオペレータを格納する。図3(a)、(b)、(c)に示す、順・逆方向の縦エッジ検出用ソーベルフィルタと横エッジ検出用のソーベルフィルタとは、それぞれ、図3(d)、(e)、(f)に示すような縦方向の濃淡差、横方向の濃淡差を強調するためのオペレータである。   Next, an example of fixed data stored in the ROM 23 will be described with reference to FIG. First, the ROM 23 stores operators of forward and reverse vertical edge detection and horizontal edge detection Sobel filters as shown in FIGS. 3 (a), 3 (b), and 3 (c). The forward / reverse vertical edge detection Sobel filter and horizontal edge detection Sobel filter shown in FIGS. 3A, 3B, and 3C are respectively shown in FIGS. ), An operator for emphasizing the vertical gray level difference and the horizontal gray level difference as shown in (f).

また、ROM23は、顔の両端位置を検出するプログラムや、顔の両端位置を補正するプログラムや、統計処理を行うプログラムといった各種プログラムが格納される。また、図3(g)に示すように、RAM25に格納される顔画像のうち、目や眉の画像が存在すると想定される位置を特定するデータ、及び、顔の両端位置が存在すると想定される位置を特定するデータ等を格納しておいてもよい。具体的には、顔の右端位置の座標値i、顔の左端位置の座標値j、目や眉の上の位置の座標値m、口の下の位置の座標値nが格納される。
さらに、ROM23は、図3(h)に示すような、固定値であるパラメータを格納しておく。具体的には、顔の両端位置を横方向に補正する最大移動画素数を5として記憶する。また、縦エッジ検出用のソーベルフィルタを用いて処理した各画素の輝度値から、縦エッジか否かを判別するための縦ソーベル閾値を8として記憶する。さらに、縦方向に並ぶ所定の画素数に対する補正候補の画素数の割合に応じて、補正するか否かを判別するための境界値データ数割合を40%として記憶する。
The ROM 23 stores various programs such as a program for detecting both end positions of the face, a program for correcting both end positions of the face, and a program for performing statistical processing. Further, as shown in FIG. 3G, it is assumed that, among the face images stored in the RAM 25, data for specifying positions where the images of the eyes and eyebrows are present, and both end positions of the face are present. Data for specifying the position to be stored may be stored. Specifically, the coordinate value i of the right end position of the face, the coordinate value j of the left end position of the face, the coordinate value m of the position above the eyes and eyebrows, and the coordinate value n of the position below the mouth are stored.
Furthermore, the ROM 23 stores parameters that are fixed values as shown in FIG. Specifically, the maximum number of moving pixels for correcting both end positions of the face in the horizontal direction is stored as 5. Further, a vertical Sobel threshold value for determining whether or not the pixel is a vertical edge is stored as 8 from the luminance value of each pixel processed using the Sobel filter for detecting the vertical edge. Further, the boundary value data number ratio for determining whether or not to correct is stored as 40% according to the ratio of the correction candidate pixel number to the predetermined number of pixels arranged in the vertical direction.

次に、上記構成を有する顔端検出装置の動作を説明する。
電源が投入されると、コンピュータ14内のCPU24は、図4に示す処理を繰り返して実行する。
Next, the operation of the face edge detection apparatus having the above configuration will be described.
When the power is turned on, the CPU 24 in the computer 14 repeatedly executes the process shown in FIG.

即ち、CPU24は、前処理(ステップS01)と顔位置検出処理(ステップS02)と補正処理(ステップS03)とから構成される処理を繰り返して実行する。   That is, the CPU 24 repeatedly executes a process composed of a preprocess (step S01), a face position detection process (step S02), and a correction process (step S03).

図4に示す処理を構成する前処理(ステップS01)と顔位置検出処理(ステップS02)とは、ドライバーの左右方向及び上下方向の顔の位置(座標値)を求めるための処理である。   The pre-processing (step S01) and face position detection processing (step S02) constituting the processing shown in FIG. 4 are processing for obtaining the position (coordinate values) of the driver in the horizontal direction and vertical direction.

補正処理(ステップS03)は、ステップS02で求めたドライバーの左右の顔両端位置を補正して、より正確な左右の顔両端位置を求めるための処理である。   The correction process (step S03) is a process for correcting the left and right face end positions of the driver obtained in step S02 to obtain more accurate left and right face end positions.

前処理(ステップS01)は、図5に示すように、キャプチャ処理(ステップS011)と、座標変換処理(ステップS012)と、ソーベルフィルタ処理(ステップS013)とから構成される。   As shown in FIG. 5, the preprocessing (step S01) includes a capture process (step S011), a coordinate conversion process (step S012), and a Sobel filter process (step S013).

キャプチャ処理(ステップS011)は、カメラ10の撮影したドライバーの1フレーム分の顔画像を画像キャプチャ装置21を介して取り込み、画像メモリ22に格納する処理である。   The capture process (step S011) is a process of capturing a face image for one frame of the driver photographed by the camera 10 through the image capture device 21 and storing it in the image memory 22.

座標変換処理(ステップS012)は、処理可能な程度に画素を間引く処理である。   The coordinate conversion process (step S012) is a process of thinning out pixels to the extent that they can be processed.

ソーベルフィルタ処理(ステップS013)は、ROM23に格納されている縦エッジ検出用オペレータ(図3(a))を用いて座標変換後の顔画像を処理して、顔画像内の縦エッジを強調する処理を行い、また、横エッジ検出用オペレータ(図3(b))を用いて座標変換後の顔画像を処理して、顔画像内の横エッジを強調する処理を行う処理である。   The Sobel filter process (step S013) emphasizes the vertical edges in the face image by processing the face image after coordinate conversion using the vertical edge detection operator (FIG. 3A) stored in the ROM 23. In addition, a process for performing a process for emphasizing the horizontal edge in the face image by processing the face image after the coordinate conversion using the horizontal edge detection operator (FIG. 3B).

図4の顔位置検出処理(ステップS02)は、前処理済みの顔画像を用いて顔の左右両端位置と上下位置を検出する処理であり、図6に示すように、顔両端検出処理(ステップS021)と顔上下位置検出処理(ステップS022)とから構成される。   The face position detection process (step S02) in FIG. 4 is a process for detecting the left and right end positions and the vertical position of the face using the preprocessed face image. As shown in FIG. S021) and face vertical position detection processing (step S022).

顔両端検出処理(ステップS021)は、顔画像を縦エッジ検出用のオペレータで操作した顔画像について、顔の両端を構成するラインを特定する処理であり、既知の任意の手法を採用することができる。   The face both ends detection process (step S021) is a process for identifying lines constituting both ends of the face of the face image operated by the operator for detecting the vertical edge, and any known method can be adopted. it can.

顔の両端を構成するラインを特定するために、例えば、図7に示すように、顔両端検出用のヒストグラム作成処理を行う(ステップS0211)。続いて、このヒストグラムのピーク値の高いものを所定数抽出して、これをソートし(ステップS0212)、ヒストグラム値に基づく、端点の抽出を行う(ステップS0213)。例えば、ヒストグラム値の上位1又は2つが他と比較して極端に値が大きい場合には、その点を端点とする。   In order to identify the lines constituting the both ends of the face, for example, as shown in FIG. 7, a histogram creation process for detecting both ends of the face is performed (step S0211). Subsequently, a predetermined number of high histogram peak values are extracted and sorted (step S0212), and end points are extracted based on the histogram values (step S0213). For example, if the top one or two of the histogram values are extremely large compared to the other, that point is set as the end point.

次に、端点が2つ(両端)抽出されたか否かを判別する(ステップS0214)。2つ抽出されていれば(ステップS0214;Yes)、処理をステップS0216に移行する。端点が2つ抽出できていなければ(ステップS0214;No)、2点の距離が、人の顔幅としてもっともらしい間隔を有する組み合わせを抽出することにより、端点を決定し(ステップS0215)、最終的に、顔面の両端(x座標値)を決定する処理を行う(ステップS0216)。   Next, it is determined whether or not two end points (both ends) have been extracted (step S0214). If two are extracted (step S0214; Yes), the process proceeds to step S0216. If two end points have not been extracted (step S0214; No), the end point is determined by extracting a combination in which the distance between the two points has a plausible interval as a human face width (step S0215). Then, a process for determining both ends (x coordinate values) of the face is performed (step S0216).

また、特許文献1に開示されているように、撮影画像の時間微分を算出し、さらに、この画素値時間微分画像の画素値を縦方向に投影してヒストグラムを作成し、エッジ部抽出画像のヒストグラムと画素値時間微分画像のヒストグラムとを合計して、ヒストグラムのピーク値の高いものを抽出すると共に人の顔幅としてもっともらしい点を決定し、顔端位置を検出するようにしてもよい。   Further, as disclosed in Patent Document 1, the time derivative of the captured image is calculated, and the pixel value of the pixel value time derivative image is projected in the vertical direction to create a histogram. The histogram and the histogram of the pixel value time-differential image may be summed to extract the one having a high peak value of the histogram, determine a plausible point as a human face width, and detect the face edge position.

次に、図6のステップS022の顔上下位置検出処理は、上述と同様の処理を横エッジについて行って、顔のほぼ眉の位置(上端)と口の位置(下端)を検出する処理であり、例えば、図8に示すように、ヒストグラム作成処理(ステップS0221)と、目下候補検出処理(ステップS0222)と、顔上下位置算出処理(ステップS0233)と、から構成される。   Next, the face vertical position detection process in step S022 of FIG. 6 is a process for detecting the position of the eyebrow (upper end) and the position of the mouth (lower end) by performing the same process as described above for the horizontal edge. For example, as shown in FIG. 8, the process includes a histogram creation process (step S 0221), a current candidate detection process (step S 0222), and a face vertical position calculation process (step S 0233).

ヒストグラム作成処理(ステップS0221)は、横エッジ検出用ソーベルフィルタを用いたソーベルフィルタ処理後の各画素の値を横方向に投影してヒストグラムを作成する処理である。   The histogram creation process (step S0221) is a process of creating a histogram by projecting the value of each pixel after the Sobel filter process using the horizontal edge detection Sobel filter in the horizontal direction.

目下候補検出処理(ステップS0222)は、ヒストグラム値に基づいて、目・眉、口などに対応するヒストグラム値の候補を選択する処理である。
顔上下位置算出処理(ステップS0223)は、選択した候補から、顔の上下端位置(y座標値)(例えば、目・眉の位置)を検出する処理である。なお、顔上端位置(y座標値)は、例えば、検出した眉から所定の画素数分(例えば、3画素分)上の位置とし、下端位置は検出した口から所定の画素数分(例えば、3画素分)下の位置(口と顎の間)などに設定される。
The current candidate detection process (step S0222) is a process of selecting a histogram value candidate corresponding to the eyes, eyebrows, mouth, and the like based on the histogram value.
The face vertical position calculation process (step S0223) is a process for detecting the upper and lower end positions (y coordinate values) (for example, the positions of eyes and eyebrows) from the selected candidates. The face upper end position (y coordinate value) is, for example, a position above a detected eyebrow by a predetermined number of pixels (for example, 3 pixels), and the lower end position is a predetermined number of pixels from the detected mouth (for example, for example, It is set to a lower position (between mouth and chin) or the like.

CPU24は、このようにしてステップS021とS022で求めた、顔の両端(左右側端)位置(x座標値)と、顔の上下位置(y座標値)をRAM25に記憶する。具体的には、図9に示すように、ステップS021で求めた顔の右端のx座標値を右端初期値aとし、ステップS022で求めた顔の左端のx座標値を左端初期値bとして記憶する。また、ステップS022で求めた顔の上下位置の上端のy座標値を下限値cとし、ステップS022で求めた顔の下端のy座標値を上限値dとして記憶する。この右端初期値a、左端初期値b、下限値c、上限値d、の位置を一例として女性の顔画像に示すと、図9に示す位置になる。
図9は、女性の顔画像に縦エッジ検出用オペレータを用いて処理し、二値化処理した後の図である。図3(a)に示した順方向の縦検出用オペレータを用いて処理した場合と、図3(b)に示した逆方向の縦検出用オペレータを用いて処理した場合とで、それぞれ濃い灰色と、薄い灰色とで区別し、重ね合わせた二値化画像である。
The CPU 24 stores the both end (left and right end) positions (x coordinate values) of the face and the vertical position (y coordinate values) of the face obtained in steps S021 and S022 in this manner in the RAM 25. Specifically, as shown in FIG. 9, the x coordinate value of the right end of the face obtained in step S021 is stored as the right end initial value a, and the x coordinate value of the left end of the face obtained in step S022 is stored as the left end initial value b. To do. Further, the y coordinate value of the upper end of the upper and lower position of the face obtained in step S022 is stored as the lower limit value c, and the y coordinate value of the lower end of the face obtained in step S022 is stored as the upper limit value d. When the positions of the right end initial value a, the left end initial value b, the lower limit value c, and the upper limit value d are shown as an example in a female face image, the positions shown in FIG. 9 are obtained.
FIG. 9 is a diagram after a female face image is processed using a vertical edge detection operator and binarized. The case where the processing is performed using the forward direction vertical detection operator shown in FIG. 3A and the case where the processing is performed using the reverse direction vertical detection operator shown in FIG. And binarized images that are distinguished from light gray and superimposed.

次に、図4の補正処理(ステップS03)は、例えば、図10の補正処理1、図11の補正処理2にそれぞれ示す構成を有する。補正処理は、夜間に撮影された顔画像や女性の顔画像等において、顔の両端の縦エッジが顔の内側に検出されることが多いため、その縦エッジの位置を補正する処理である。補正処理1は、顔画像の顔の右端位置に係る補正処理であり、補正処理2は、顔画像の顔の左端位置に係る補正処理である。補正処理1、補正処理2は、並列に処理してもよいし、逐次的に補正処理1の終了後に、補正処理2を開始してもよい。   Next, the correction process (step S03) in FIG. 4 has a configuration shown in, for example, the correction process 1 in FIG. 10 and the correction process 2 in FIG. The correction process is a process for correcting the position of the vertical edge of the face image taken at night or the face image of a woman because the vertical edges at both ends of the face are often detected inside the face. The correction process 1 is a correction process related to the right end position of the face of the face image, and the correction process 2 is a correction process related to the left end position of the face of the face image. The correction process 1 and the correction process 2 may be performed in parallel, or the correction process 2 may be started sequentially after the correction process 1 is completed.

顔の右端位置に係る補正処理1の動作を図10に示すフローチャートを参照して説明する。まず、CPU24は、顔画像における処理対象の画素のy座標値(以後、検索y座標値とよぶ)を0に設定して処理を開始する(ステップS031)。   The operation of the correction process 1 related to the right edge position of the face will be described with reference to the flowchart shown in FIG. First, the CPU 24 sets the y coordinate value (hereinafter referred to as the search y coordinate value) of the pixel to be processed in the face image to 0 and starts processing (step S031).

続いて、CPU24は、ステップS021で求めた顔の両端位置(x座標値)の右端初期値aをRAM25から読み出し、顔画像における処理対象の画素のx座標値(以後、検索x座標値とよぶ)をaに設定し、検索y座標値をインクリメントして、検索座標値を(a、1)とする(ステップS032)。   Subsequently, the CPU 24 reads, from the RAM 25, the right end initial value a of the face end position (x coordinate value) obtained in step S021, and the x coordinate value (hereinafter referred to as the search x coordinate value) of the pixel to be processed in the face image. ) Is set to a, the search y-coordinate value is incremented, and the search coordinate value is set to (a, 1) (step S032).

さらに、CPU24は、ステップS02で求めた顔の上下位置(y座標値)の下限値cをRAM25から読み出し、検索y座標値がこの下限値c以上か否かを判別する(ステップS033)。検索y座標値が下限値c以上でなければ(ステップS033;No)、ステップS032に処理を戻し、検索y座標値をインクリメントする。これにより、顔画像中で、図3(f)に示すy座標値が下限値c以上、上限値d以下の範囲である縦検索範囲外の画素での無駄な処理を省く。   Further, the CPU 24 reads the lower limit value c of the vertical position (y coordinate value) of the face obtained in step S02 from the RAM 25, and determines whether or not the search y coordinate value is equal to or greater than the lower limit value c (step S033). If the search y-coordinate value is not greater than or equal to the lower limit value c (step S033; No), the process returns to step S032, and the search y-coordinate value is incremented. Thereby, in the face image, useless processing in pixels outside the vertical search range where the y coordinate value shown in FIG. 3F is in the range of the lower limit value c or more and the upper limit value d or less is omitted.

一方、CPU24は、ステップS033で、検索y座標値が下限値c以上であると判別した場合(ステップS033;Yes)、次に、ステップS02で求めた顔の上下位置(y座標値)の上限値dをRAM25から読み出す。そして、CPU24は、検索y座標値がこの上限値d以上か否かを判別する(ステップS034)。   On the other hand, if the CPU 24 determines in step S033 that the search y-coordinate value is equal to or greater than the lower limit value c (step S033; Yes), then the upper limit of the vertical position (y-coordinate value) of the face obtained in step S02. The value d is read from the RAM 25. Then, the CPU 24 determines whether or not the search y coordinate value is greater than or equal to the upper limit value d (step S034).

ステップS034で検索y座標値がd以上であると判別した場合の処理は、後述する。ステップS034で検索y座標値がd以上でないと判別した場合(ステップS034;Yes)、CPU24は、検索x座標値が、RAM25から読み出した右端初期値aから5を減算した値以上か否かを判別する(ステップS035)。これは、ステップS021で求めた顔の両端位置の右端初期値aから補正する範囲(x座標方向)を、5ピクセル分に制限するためである。この制限範囲は、図3(h)に示すように、横検索範囲のパラメータとして予めROM25等に記憶する。なお、この制限範囲は5ピクセル分である必要はなく、任意の値でよい。   Processing in a case where it is determined in step S034 that the search y coordinate value is greater than or equal to d will be described later. If it is determined in step S034 that the search y-coordinate value is not greater than or equal to d (step S034; Yes), the CPU 24 determines whether or not the search x-coordinate value is greater than or equal to a value obtained by subtracting 5 from the right end initial value a read from the RAM 25. It discriminate | determines (step S035). This is because the range (x coordinate direction) to be corrected from the right end initial value a of the both end positions of the face obtained in step S021 is limited to 5 pixels. This limited range is stored in advance in the ROM 25 or the like as a parameter for the horizontal search range, as shown in FIG. Note that this limited range does not have to be 5 pixels and may be any value.

ステップS035で、CPU24は、検索x座標値が右端初期値aから5を減算した値(a−5)以上であると判別した場合(ステップS035;Yes)、検索座標値を(x,y)としたときの(x−1,y−1)、(x−1,y)、(x−1,y+1)の座標の画素における縦エッジ検出用オペレータで処理後の輝度値(以後、縦ソーベル値とよぶ)を参照する。この座標の位置関係を図12(A)に示す。そして、CPU24は、この3つの座標の全ての縦ソーベル値が、図3(h)に示すようなROM23に予め記憶された縦ソーベル閾値である8よりも大きいか否か判別する(ステップS036)。これは、この3つの座標の画素における縦ソーベル値が縦ソーベル閾値よりも大きければ、現在の検索座標位置よりも、(x−1,y)座標の位置が縦エッジである可能性が高いからである。   If the CPU 24 determines in step S035 that the search x coordinate value is equal to or greater than the value (a-5) obtained by subtracting 5 from the right end initial value a (step S035; Yes), the search coordinate value is set to (x, y). Luminance values after processing by the vertical edge detection operator at the pixels at the coordinates of (x-1, y-1), (x-1, y), (x-1, y + 1) Refer to the value). The positional relationship of these coordinates is shown in FIG. Then, the CPU 24 determines whether or not all the vertical sobel values of these three coordinates are larger than 8 which is a vertical sobel threshold value stored in advance in the ROM 23 as shown in FIG. 3 (h) (step S036). . This is because the position of the (x-1, y) coordinate is more likely to be the vertical edge than the current search coordinate position if the vertical Sobel value in the pixels of these three coordinates is larger than the vertical Sobel threshold value. It is.

ステップS036で、CPU24は、参照した3つの座標の縦ソーベル値が縦ソーベル閾値より大きいと判別した場合(ステップS036;Yes)、検索x座標値をx−1にし(ステップS037)、ステップS035の処理に戻る。   If the CPU 24 determines in step S036 that the vertical sobel values of the three coordinates referred to are larger than the vertical sobel threshold value (step S036; Yes), the search x coordinate value is set to x-1 (step S037). Return to processing.

以上のステップS035、ステップS036、ステップS037の処理を繰り返すことで、CPU24は、顔の両端位置(x座標値)を補正するべきか否か判別しながら、顔の外側に向かって画像を走査している。
顔の両端位置(x座標値)を補正すべきか否かの判断基準は、(x−1,y−1)、(x−1,y)、(x−1,y+1)の3つの座標に位置する画素の縦ソーベル値に基づく必要はなく、任意である。
By repeating the processes in steps S035, S036, and S037, the CPU 24 scans the image toward the outside of the face while determining whether or not the both end positions (x coordinate values) of the face should be corrected. ing.
The criteria for determining whether or not to correct both end positions (x coordinate values) of the face are three coordinates (x-1, y-1), (x-1, y), and (x-1, y + 1). It is not necessary to be based on the vertical Sobel value of the pixel located, and is arbitrary.

一方、ステップS035で、CPU24は、検索x座標値が右端初期値aから5を減算した値(a−5)以上であると判別した場合(ステップS035;No)、現在の検索x座標値を顔の右端位置(x座標値)の境界値データ(右端候補値)として、RAM25に記憶する(ステップS038)。ここで境界値データ(右端候補値)とは、顔の右端位置の候補となる座標値のことであり、これら境界値データ(右端候補値)の中から、最終的に顔の右端位置を決定する。   On the other hand, if the CPU 24 determines in step S035 that the search x-coordinate value is equal to or greater than the value (a-5) obtained by subtracting 5 from the right end initial value a (step S035; No), the CPU 24 sets the current search x-coordinate value. The boundary value data (right end candidate value) of the right end position (x coordinate value) of the face is stored in the RAM 25 (step S038). Here, the boundary value data (right end candidate value) is a coordinate value that becomes a candidate for the right end position of the face, and the right end position of the face is finally determined from the boundary value data (right end candidate value). To do.

また、ステップS036で、参照した3つの座標の縦ソーベル値が縦ソーベル閾値より大きくないと判別した場合にも(ステップS036;No)、現在の検索x座標値を顔の右端位置(x座標値)の境界値データ(右端候補値)として、RAM25に記憶する(ステップS038)。ステップS038での検索x座標値は、例えば図13(A)に示すような境界値記録配列A(以後、配列Aとよぶ)に記憶する。配列を検索y座標毎に用意し、検索x座標値を境界値データ(右端候補値)として記憶する。   Even when it is determined in step S036 that the vertical sobel values of the three coordinates referred to are not larger than the vertical sobel threshold value (step S036; No), the current search x-coordinate value is used as the right edge position of the face (x-coordinate value). ) Is stored in the RAM 25 (step S038). The retrieved x-coordinate values in step S038 are stored in a boundary value recording array A (hereinafter referred to as array A) as shown in FIG. An array is prepared for each search y coordinate, and the search x coordinate value is stored as boundary value data (right end candidate value).

CPU24は、ステップS038でRAM25に記憶した境界値データ(右端候補値)が、ステップS021で検出した顔の両端位置(x座標値)の右端初期値aであるか否かを判別する(ステップS039)。ここで、CPU24は、境界値データ(右端候補値)が、右端初期値aであると判別した場合(ステップS039;Yes)、顔の両端位置(x座標値)の右端初期値aは変更しなかったので、そのまま、処理をステップS032に移行させる。   The CPU 24 determines whether or not the boundary value data (right end candidate value) stored in the RAM 25 in step S038 is the right end initial value a of both face positions (x coordinate values) detected in step S021 (step S039). ). Here, if the CPU 24 determines that the boundary value data (right end candidate value) is the right end initial value a (step S039; Yes), the right end initial value a of the face end positions (x coordinate values) is changed. Since there was not, the process proceeds to step S032.

一方、ステップS039で、CPU24は、境界値データ(右端候補値)が、右端初期値aではないと判別した場合(ステップS039;No)、ステップS021で検出した顔の両端位置(x座標値)の右端初期値aから変更した境界値データ(右端候補値)の総数をカウントするための境界値データ数Nをインクリメントする(ステップS0310)。   On the other hand, when the CPU 24 determines in step S039 that the boundary value data (right end candidate value) is not the right end initial value a (step S039; No), both end positions (x coordinate values) of the face detected in step S021. The number N of boundary value data for counting the total number of boundary value data (right end candidate values) changed from the right end initial value a is incremented (step S0310).

CPU24は、以上のステップS032〜ステップS0310までの処理を繰り返し、検索y座標値が下限値c以上d以下の範囲で、顔の右端位置(x座標値)の境界値データ(右端候補値)をRAM25に記憶していく。   The CPU 24 repeats the above-described processing from step S032 to step S0310, and obtains boundary value data (right end candidate value) of the right end position (x coordinate value) of the face in the range where the search y coordinate value is not less than the lower limit value c and not more than d. The data is stored in the RAM 25.

そして、CPU24は、ステップS034で検索y座標値がd以上であると判別した時点で(ステップS034;Yes)、処理を、図14のフローチャートで説明する処理に移行させる。   Then, when the CPU 24 determines in step S034 that the search y coordinate value is greater than or equal to d (step S034; Yes), the CPU 24 shifts the processing to the processing described in the flowchart of FIG.

図14のフローチャートで説明する処理は、以上までの処理でRAM25に記憶してきた顔の右端位置(x座標値)の境界値データ(右端候補値)に基づいて、統計処理を行い、顔の右端位置を決定する処理である。   The processing described in the flowchart of FIG. 14 performs statistical processing based on the boundary value data (right end candidate value) of the right end position (x coordinate value) of the face stored in the RAM 25 by the above processing, and the right end of the face. This is a process for determining the position.

図10のステップS0310で加算してきた境界値データ数Nが少ない場合、その少ないデータに基づいて統計処理を行っても、その処理結果の信頼性は低い。そこで、CPU24は、まず、図3(h)に示すようなROM23に予め記憶しておいた境界値データ数割合(例えば、40%)を読み出す。CPU24は、その境界値データ数割合に、顔画像におけるy座標値がc以上d以下の範囲にある画素数(d−c+1)を乗算する。続いて、CPU24は、境界値データ数Nが、その乗算した結果の値以上であるか否かを判別する(ステップS051)。そこで、CPU24は、境界値データ数Nが、乗算した結果の値以上ではないと判別した場合は(ステップS051;No)、CPU24は、顔の両端位置(x座標値)の右端初期値aを変更せずに(ステップS057)、補正処理1を終了する。   When the number N of boundary value data added in step S0310 in FIG. 10 is small, the reliability of the processing result is low even if statistical processing is performed based on the small data. Therefore, the CPU 24 first reads the boundary value data number ratio (for example, 40%) stored in advance in the ROM 23 as shown in FIG. The CPU 24 multiplies the boundary value data number ratio by the number of pixels (d−c + 1) in which the y coordinate value in the face image is in the range of c to d. Subsequently, the CPU 24 determines whether or not the number N of boundary value data is equal to or greater than the value resulting from the multiplication (step S051). Therefore, when the CPU 24 determines that the number N of boundary value data is not equal to or greater than the result of multiplication (step S051; No), the CPU 24 sets the right end initial value a of the face end positions (x coordinate values). Without changing (step S057), the correction process 1 is terminated.

一方、CPU24は、境界値データ数Nが、乗算した結果の値以上であると判別した場合(ステップS051;Yes)、統計処理を行う。具体的には、CPU24は、RAM25に記憶してきた全ての境界値データ(右端候補値)のヒストグラムを作成し、その平均値及び標準偏差を求め(ステップS052)、この両値をRAM25に記憶する。   On the other hand, if the CPU 24 determines that the number N of boundary value data is equal to or greater than the value resulting from the multiplication (step S051; Yes), the CPU 24 performs statistical processing. Specifically, the CPU 24 creates a histogram of all boundary value data (right end candidate values) stored in the RAM 25, obtains an average value and a standard deviation (step S052), and stores both values in the RAM 25. .

続いて、CPU24は、以降の処理で、RAM25に記憶された境界値データ(右端候補値)の平均値及び標準偏差を参照して、図9に示す最終的な顔の右端位置(x座標値)αを決定するための最小境界値(最小の境界値データ(右端候補値))を求める。
この最小境界値を求める処理の終了条件は、整数値である境界値カウンタがRAM25に記憶された境界値データ数Nと等しくなったことを条件とする。
そこで、まず、CPU24は、この境界値カウンタの初期値を0として、この境界値カウンタが境界値データ数Nより小さいか否かを判別する(ステップS053)。
Subsequently, the CPU 24 refers to the average value and standard deviation of the boundary value data (right end candidate value) stored in the RAM 25 in the subsequent processing, and determines the final right end position (x coordinate value) of the face shown in FIG. ) Find the minimum boundary value (minimum boundary value data (right end candidate value)) for determining α.
An end condition for the process of obtaining the minimum boundary value is that the boundary value counter, which is an integer value, is equal to the number N of boundary value data stored in the RAM 25.
Therefore, first, the CPU 24 sets the initial value of the boundary value counter to 0, and determines whether or not the boundary value counter is smaller than the boundary value data number N (step S053).

CPU24は、境界値カウンタが境界値データ数Nより小さいと判別した場合(ステップS053;Yes)、図13(A)に示すような、境界値カウンタと一致する引数をもつ配列Aの境界値データ(右端候補値)をRAM25から読み出す。CPU24は、読み出した境界値データ(右端候補値)が、i)標準偏差以内であり、かつ、ii)最小境界値(初期値は右端初期値aとする)より小さいか否かを判別する(ステップS054)。   When the CPU 24 determines that the boundary value counter is smaller than the boundary value data number N (step S053; Yes), the boundary value data of the array A having an argument that matches the boundary value counter as shown in FIG. (Right end candidate value) is read from the RAM 25. The CPU 24 determines whether or not the read boundary value data (right end candidate value) is within i) the standard deviation and ii) smaller than the minimum boundary value (the initial value is the right end initial value a) ( Step S054).

CPU24は、ステップS054で、i)、ii)の条件を共に満たしていると判別した場合(ステップS054;Yes)、その配列Aの境界値データ(右端候補値)を最小境界値とし、その値をRAM25に更新して記憶する(ステップS055)。これにより、CPU24は、境界値データ(右端候補値)の中から、標準偏差を超えるようなはずれ値を除外し、その時点までの最小境界値より小さい値の境界値データ(右端候補値)を選択して、新たな最小境界値とする。   If the CPU 24 determines in step S054 that both conditions i) and ii) are satisfied (step S054; Yes), the boundary value data (right end candidate value) of the array A is set as the minimum boundary value, and the value Is updated and stored in the RAM 25 (step S055). As a result, the CPU 24 excludes outlier values that exceed the standard deviation from the boundary value data (right end candidate values), and obtains boundary value data (right end candidate values) having a value smaller than the minimum boundary value up to that point. Select a new minimum boundary value.

一方、CPU24は、ステップS054で、i)、ii)の条件のいずれか、或いは、共に満たしていないと判別した場合(ステップS054;No)、RAM25に記憶された最小境界値を更新せずに、次の処理に移行させる。   On the other hand, if the CPU 24 determines in step S054 that either or both of the conditions i) and ii) are not satisfied (step S054; No), the CPU 24 does not update the minimum boundary value stored in the RAM 25. And move to the next process.

続いて、CPU24は、境界値カウンタをインクリメントさせ(ステップS056)、処理を、ステップS053の処理に戻す。   Subsequently, the CPU 24 increments the boundary value counter (step S056), and returns the process to the process of step S053.

以上のステップS053〜ステップS056の処理を、CPU24は、境界値カウンタがRAM25に記憶された境界値データ数Nと等しくなるまで繰り返す。これにより、CPU24は、RAM25に記憶された顔の右端位置(x座標値)の全ての境界値データ(右端候補値)の中から、最小の最小境界値を抽出する。   The CPU 24 repeats the processes in steps S053 to S056 until the boundary value counter becomes equal to the number N of boundary value data stored in the RAM 25. Thereby, the CPU 24 extracts the minimum minimum boundary value from all the boundary value data (right end candidate values) of the right end position (x coordinate value) of the face stored in the RAM 25.

CPU24は、ステップS053で、境界値カウンタが境界値データ数Nと等しいと判別した場合(ステップS053;No)、最小境界値を求める処理を終了し、RAM25に記憶された最小境界値を参照する。そして、CPU24は、この最小境界値を、顔の右端位置(x座標値)αとして、RAM25に記憶し(ステップS058)、補正処理1を終了する。この顔の右端位置(x座標値)αを、一例として図9の顔画像に示す。   If the CPU 24 determines in step S053 that the boundary value counter is equal to the boundary value data number N (step S053; No), the CPU 24 ends the process of obtaining the minimum boundary value and refers to the minimum boundary value stored in the RAM 25. . Then, the CPU 24 stores the minimum boundary value in the RAM 25 as the right end position (x coordinate value) α of the face (step S058), and ends the correction process 1. The right end position (x coordinate value) α of this face is shown as an example in the face image of FIG.

以上の処理により、顔の右端位置に係る補正を行い、夜間に撮影された顔画像や女性の顔画像等においても、より正確な顔の右端位置を検出することができる。   Through the above processing, correction relating to the right end position of the face is performed, and a more accurate right end position of the face can be detected even in a face image photographed at night, a female face image, or the like.

次に、顔の左端位置に係る補正処理2の動作を図11に示すフローチャートを参照して説明する。まず、CPU24は、検索y座標値を0に設定して処理を開始する(ステップS041)。   Next, the operation of the correction process 2 related to the left end position of the face will be described with reference to the flowchart shown in FIG. First, the CPU 24 sets the search y coordinate value to 0 and starts processing (step S041).

続いて、CPU24は、ステップS02で求めた顔の両端位置(x座標値)の左端初期値bをRAM25から読み出し、顔画像における検索x座標値をbに設定し、検索y座標値をインクリメントして、検索座標値を(b、1)とする(ステップS042)。   Subsequently, the CPU 24 reads the left end initial value b of the both end positions (x coordinate values) of the face obtained in step S02 from the RAM 25, sets the search x coordinate value in the face image to b, and increments the search y coordinate value. The search coordinate value is set to (b, 1) (step S042).

さらに、CPU24は、ステップS02で求めた顔の上下位置(y座標値)の下限値cをRAM25から読み出し、検索y座標値がこの下限値c以上か否かを判別する(ステップS043)。検索y座標値が下限値c以上でなければ(ステップS043;No)、ステップS042に処理を戻し、検索y座標値をインクリメントする。これにより、顔画像中で、図3(f)に示すy座標値が下限値c以上、上限値d以下の範囲である縦検索範囲外の画素での無駄な処理を省く。   Further, the CPU 24 reads the lower limit value c of the vertical position (y coordinate value) of the face obtained in step S02 from the RAM 25, and determines whether or not the search y coordinate value is equal to or greater than the lower limit value c (step S043). If the search y-coordinate value is not greater than or equal to the lower limit value c (step S043; No), the process returns to step S042, and the search y-coordinate value is incremented. Thereby, in the face image, useless processing in pixels outside the vertical search range where the y coordinate value shown in FIG. 3F is in the range of the lower limit value c or more and the upper limit value d or less is omitted.

一方、CPU24は、ステップS043で、検索y座標値が下限値c以上であると判別した場合(ステップS043;Yes)、次に、ステップS02で求めた顔の上下位置(y座標値)の上限値dをRAM25から読み出す。そして、CPU24は、検索y座標値がこの上限値d以上か否かを判別する(ステップS044)。   On the other hand, if the CPU 24 determines in step S043 that the search y-coordinate value is equal to or greater than the lower limit value c (step S043; Yes), then the upper limit of the vertical position (y-coordinate value) of the face obtained in step S02. The value d is read from the RAM 25. Then, the CPU 24 determines whether or not the search y coordinate value is greater than or equal to the upper limit value d (step S044).

ステップS044で検索y座標値がd以上であると判別した場合(ステップS044;Yes)の処理は、後述する。ステップS044で検索y座標値がd以上でないと判別した場合(ステップS044;No)、CPU24は、検索x座標値が、RAM25から読み出した左端初期値bに5を加算した値以下か否かを判別する(ステップS045)。これは、ステップS021で求めた顔の両端位置の左端初期値bから補正する範囲(x座標方向)を、5ピクセル分に制限するためである。この制限範囲は、図3(h)に示すように、横検索範囲のパラメータとして予めROM25等に記憶する。なお、この制限範囲は5ピクセル分である必要はなく、任意の値でよい。   Processing in the case where it is determined in step S044 that the search y coordinate value is equal to or greater than d (step S044; Yes) will be described later. If it is determined in step S044 that the search y-coordinate value is not greater than or equal to d (step S044; No), the CPU 24 determines whether or not the search x-coordinate value is equal to or less than a value obtained by adding 5 to the left end initial value b read from the RAM 25. A determination is made (step S045). This is because the range (x coordinate direction) to be corrected from the left end initial value b of the both end positions of the face obtained in step S021 is limited to 5 pixels. This limited range is stored in advance in the ROM 25 or the like as a parameter for the horizontal search range, as shown in FIG. Note that this limited range does not have to be 5 pixels and may be any value.

ステップS045で、CPU24は、検索x座標値が左端初期値bに5を加算した値(b+5)以下であると判別した場合(ステップS045;Yes)、検索座標値が(x,y)としたときの(x+1,y−1)、(x+1,y)、(x+1,y+1)の座標の画素における縦ソーベル値を参照する。この座標の位置関係を図12(B)に示す。そして、CPU24は、この3つの座標の全ての縦ソーベル値が、図3(h)に示すようなROM23に予め記憶された縦ソーベル閾値である8よりも大きいか否か判別する(ステップS046)。これは、この3つの座標の画素における縦ソーベル値が縦ソーベル閾値よりも大きければ、現在の検索座標位置よりも、(x+1,y)座標の位置の方が縦エッジである可能性が高いからである。   In step S045, if the CPU 24 determines that the search x-coordinate value is equal to or less than the value (b + 5) obtained by adding 5 to the left end initial value b (step S045; Yes), the search coordinate value is set to (x, y). The vertical Sobel value in the pixel at the coordinates of (x + 1, y−1), (x + 1, y), (x + 1, y + 1) is referred to. The positional relationship of these coordinates is shown in FIG. Then, the CPU 24 determines whether or not all the vertical sobel values of these three coordinates are larger than 8 which is a vertical sobel threshold value stored in advance in the ROM 23 as shown in FIG. 3 (h) (step S046). . This is because, if the vertical Sobel value in the pixel of these three coordinates is larger than the vertical Sobel threshold, the position of the (x + 1, y) coordinate is more likely to be a vertical edge than the current search coordinate position. It is.

ステップS046で、CPU24は、参照した3つの座標の縦ソーベル値が縦ソーベル閾値より大きいと判別した場合(ステップS046;Yes)、検索x座標値をx+1にし(ステップS047)、ステップS045の処理に戻る。   In step S046, if the CPU 24 determines that the vertical sobel value of the referenced three coordinates is larger than the vertical sobel threshold value (step S046; Yes), the search x coordinate value is set to x + 1 (step S047), and the process of step S045 is performed. Return.

以上のステップS045、ステップS046、ステップS047の処理を繰り返すことで、CPU24は、顔の両端位置(x座標値)を補正するべきか否か判別しながら、顔の外側に向かって画像を走査している。
顔の両端位置(x座標値)を補正すべきか否かの判別は、(x+1,y−1)、(x+1,y)、(x+1,y+1)の3つの座標に位置する画素の縦ソーベル値に基づく必要はなく、任意である。
By repeating the processes in steps S045, S046, and S047 described above, the CPU 24 scans the image toward the outside of the face while determining whether or not both end positions (x coordinate values) of the face should be corrected. ing.
The determination as to whether or not the positions of both ends of the face (x coordinate value) should be corrected is based on the vertical Sobel values of the pixels located at the three coordinates (x + 1, y−1), (x + 1, y), and (x + 1, y + 1). It is not necessary to be based on and is arbitrary.

一方、ステップS045で、CPU24は、検索x座標値が左端初期値bに5を加算した値(b+5)より大きいと判別した場合(ステップS045;No)、現在の検索x座標値を顔の左端位置(x座標値)の境界値データ(左端候補値)として、RAM25に記憶する(ステップS048)。ここで境界値データ(左端候補値)とは、顔の左端位置の候補となる座標値のことであり、これら境界値データ(左端候補値)の中から、最終的に顔の左端位置を決定する。   On the other hand, if the CPU 24 determines in step S045 that the search x-coordinate value is greater than the left end initial value b plus 5 (b + 5) (step S045; No), the current search x-coordinate value is set to the left end of the face. The boundary value data (left end candidate value) of the position (x coordinate value) is stored in the RAM 25 (step S048). Here, the boundary value data (left end candidate value) is a coordinate value that is a candidate for the left end position of the face, and finally the left end position of the face is determined from these boundary value data (left end candidate value). To do.

また、ステップS046で、参照した3つの座標の縦ソーベル値が縦ソーベル閾値より大きくないと判別した場合にも(ステップS046;No)、現在の検索x座標値を顔の左端位置(x座標値)の境界値データ(左端候補値)として、RAM25に記憶する(ステップS048)。ステップS048での検索x座標値は、例えば図13(B)に示すような境界値記録配列B(以後、配列Bとよぶ)に記憶する。配列を検索y座標毎に用意し、検索x座標値を境界値データ(左端候補値)として記憶する。   Even when it is determined in step S046 that the vertical sobel values of the three coordinates referred to are not larger than the vertical sobel threshold value (step S046; No), the current search x-coordinate value is set to the left edge position (x-coordinate value) of the face. ) Is stored in the RAM 25 (step S048). The search x-coordinate value in step S048 is stored in a boundary value recording array B (hereinafter referred to as array B) as shown in FIG. An array is prepared for each search y-coordinate, and the search x-coordinate value is stored as boundary value data (left end candidate value).

CPU24は、ステップS048でRAM25に記憶した境界値データ(左端候補値)が、ステップS021で検出した顔の両端位置(x座標値)の左端初期値bであるか否かを判別する(ステップS049)。ここで、CPU24は、境界値データ(左端候補値)が、左端初期値bであると判別した場合(ステップS049;Yes)、顔の両端位置(x座標値)の左端初期値bは変更しなかったので、そのまま、処理をステップS042に移行させる。   The CPU 24 determines whether or not the boundary value data (left end candidate value) stored in the RAM 25 in step S048 is the left end initial value b of both face positions (x coordinate values) detected in step S021 (step S049). ). Here, when the CPU 24 determines that the boundary value data (left end candidate value) is the left end initial value b (step S049; Yes), the left end initial value b of the both end positions (x coordinate value) of the face is changed. Since there was not, the process proceeds to step S042 as it is.

一方、ステップS049で、CPU24は、左端候補値が、左端初期値bではないと判別した場合(ステップS049;No)、ステップS021で検出した顔の両端位置(x座標値)の左端初期値bから変更した境界値データ(左端候補値)の総数をカウントするための境界値データ数Mをインクリメントする(ステップS0410)。   On the other hand, if the CPU 24 determines in step S049 that the left end candidate value is not the left end initial value b (step S049; No), the left end initial value b of the both end positions (x coordinate values) of the face detected in step S021. The number M of boundary value data for counting the total number of boundary value data (left end candidate values) changed from 1 is incremented (step S0410).

CPU24は、以上のステップS042〜ステップS0410までの処理を繰り返し、検索y座標値が下限値c以上、上限値d以下の範囲で、顔の左端位置(x座標値)の境界値データ(左端候補値)をRAM25に記憶していく。   The CPU 24 repeats the above-described processing from step S042 to step S0410, and in the range where the search y coordinate value is not less than the lower limit value c and not more than the upper limit value d, the boundary value data (left candidate) of the left edge position (x coordinate value) of the face Value) is stored in the RAM 25.

そして、CPU24は、ステップS044で検索y座標値がd以上であると判別した時点で(ステップS044;Yes)、処理を、図14のフローチャートで説明する処理に移行させる。   When the CPU 24 determines in step S044 that the search y-coordinate value is greater than or equal to d (step S044; Yes), the process proceeds to the process described in the flowchart of FIG.

図14のフローチャートで説明する処理は、以上までの処理でRAM25に記憶してきた顔の左端端位置(x座標値)の境界値データ(左端候補値)に基づいて、統計処理を行い、顔の左端位置を決定する処理である。   The processing described in the flowchart of FIG. 14 performs statistical processing based on the boundary value data (left end candidate value) of the left end position (x coordinate value) of the face that has been stored in the RAM 25 by the above processing. This is a process for determining the left end position.

図11のステップS0410で加算してきた境界値データ数Mが少ない場合、その少ないデータに基づいて統計処理を行っても、その処理結果の信頼性は低い。そこで、CPU24は、まず、図3(h)に示すようなROM23に予め記憶しておいた境界値データ数割合(例えば、40%)を読み出す。CPU24は、その境界値データ数割合に、顔画像におけるy座標値がc以上d以下の範囲にある画素数(d−c+1)を乗算する。続いて、CPU24は、境界値データ数Mが、その乗算した結果の値以上であるか否かを判別する(ステップS051)。そこで、CPU24は、境界値データ数Mが、乗算した結果の値以上ではないと判別した場合は(ステップS051;No)、CPU24は、顔の両端位置(x座標値)の左端初期値bを変更せずに(ステップS057)、補正処理2を終了する。   When the number M of boundary value data added in step S0410 in FIG. 11 is small, the reliability of the processing result is low even if statistical processing is performed based on the small amount of data. Therefore, the CPU 24 first reads the boundary value data number ratio (for example, 40%) stored in advance in the ROM 23 as shown in FIG. The CPU 24 multiplies the boundary value data number ratio by the number of pixels (d−c + 1) in which the y coordinate value in the face image is in the range of c to d. Subsequently, the CPU 24 determines whether or not the number M of boundary value data is equal to or greater than the value resulting from the multiplication (step S051). Therefore, when the CPU 24 determines that the number M of boundary value data is not equal to or greater than the value obtained by the multiplication (step S051; No), the CPU 24 sets the left end initial value b of both end positions (x coordinate values) of the face. Without modification (step S057), the correction process 2 is terminated.

一方、CPU24は、境界値データ数Mが、乗算した結果の値以上であると判別した場合(ステップS051;Yes)、統計処理を行う。具体的には、CPU24は、RAM25に記憶してきた全ての境界値データ(左端候補値)のヒストグラムを作成し、その平均値及び標準偏差を求め(ステップS052)、この両値をRAM25に記憶する。   On the other hand, when the CPU 24 determines that the number M of boundary value data is equal to or greater than the value resulting from the multiplication (step S051; Yes), the CPU 24 performs statistical processing. Specifically, the CPU 24 creates a histogram of all boundary value data (leftmost candidate values) stored in the RAM 25, obtains an average value and a standard deviation (step S052), and stores both values in the RAM 25. .

続いて、CPU24は、以降の処理で、RAM25に記憶された境界値データ(左端候補値)の平均値及び標準偏差を参照して、図9に示す最終的な顔の左端位置(x座標値)βを決定するための最大境界値(最大の境界値データ(左端候補値)を求める。
この最大境界値を求める処理の終了条件は、整数値である境界値カウンタがRAM25に記憶された境界値データ数Mと等しくなったことを条件とする。
そこで、まず、CPU24は、この境界値カウンタの初期値を0として、この境界値カウンタが境界値データ数Mより小さいか否かを判別する(ステップS053)。
Subsequently, in the subsequent processing, the CPU 24 refers to the average value and standard deviation of the boundary value data (left end candidate value) stored in the RAM 25, and determines the final face left end position (x coordinate value) shown in FIG. ) Find the maximum boundary value (maximum boundary value data (leftmost candidate value)) for determining β.
The condition for ending the process of obtaining the maximum boundary value is that the boundary value counter, which is an integer value, is equal to the number M of boundary value data stored in the RAM 25.
Therefore, first, the CPU 24 sets the initial value of the boundary value counter to 0, and determines whether or not the boundary value counter is smaller than the boundary value data number M (step S053).

CPU24は、境界値カウンタが境界値データ数Mより小さいと判別した場合(ステップS053;Yes)、図13(B)に示すような、境界値カウンタと一致する引数をもつ配列Bの境界値データ(左端候補値)をRAM25から読み出す。CPU24は、読み出した境界値データ(左端候補値)が、i)標準偏差以内であり、かつ、ii)最大境界値(初期値は左端初期値bとする)より大きいか否かを判別する(ステップS054)。   When the CPU 24 determines that the boundary value counter is smaller than the boundary value data number M (step S053; Yes), the boundary value data of the array B having an argument that matches the boundary value counter as shown in FIG. (Left end candidate value) is read from the RAM 25. The CPU 24 determines whether or not the read boundary value data (left end candidate value) is within i) the standard deviation and ii) greater than the maximum boundary value (the initial value is the left end initial value b) ( Step S054).

CPU24は、ステップS054で、i)、ii)の条件を共に満たしていると判別した場合(ステップS054;Yes)、その配列Bの境界値データ(左端候補値)を最大境界値とし、その値をRAM25に更新して記憶する(ステップS055)。これにより、CPU24は、境界値データ(左端候補値)の中から、標準偏差を超えるようなはずれ値を除外し、その時点までの最大境界値より大きい値の境界値データ(左端候補値)を選択して、新たな最大境界値とする。   When the CPU 24 determines in step S054 that both the conditions i) and ii) are satisfied (step S054; Yes), the boundary value data (left end candidate value) of the array B is set as the maximum boundary value, and the value Is updated and stored in the RAM 25 (step S055). As a result, the CPU 24 excludes outlier values that exceed the standard deviation from the boundary value data (left end candidate values), and obtains boundary value data (left end candidate values) having a value larger than the maximum boundary value up to that point. Select a new maximum boundary value.

一方、CPU24は、ステップS054で、i)、ii)の条件のいずれか、或いは、共に満たしていないと判別した場合(ステップS054;No)、RAM25に記憶された最大境界値を更新せずに、次の処理に移行させる。   On the other hand, if the CPU 24 determines in step S054 that either or both of the conditions i) and ii) are not satisfied (step S054; No), the CPU 24 does not update the maximum boundary value stored in the RAM 25. And move to the next process.

続いて、CPU24は、境界値カウンタをインクリメントさせ(ステップS056)、処理を、ステップS053の処理に戻す。   Subsequently, the CPU 24 increments the boundary value counter (step S056), and returns the process to the process of step S053.

以上のステップS053〜ステップS056の処理を、CPU24は、境界値カウンタがRAM25に記憶された境界値データ数Mと等しくなるまで繰り返す。これにより、CPU24は、RAM25に記憶された顔の左端位置(x座標値)の全ての境界値データ(上点候補値)の中から、最大の最大境界値を抽出する。   The CPU 24 repeats the processes in steps S053 to S056 until the boundary value counter becomes equal to the boundary value data count M stored in the RAM 25. Thereby, the CPU 24 extracts the maximum maximum boundary value from all the boundary value data (upper point candidate values) of the left end position (x coordinate value) of the face stored in the RAM 25.

CPU24は、ステップS053で、境界値カウンタが境界値データ数Mと等しいと判別した場合(ステップS053;No)、最大境界値を求める処理を終了し、RAM25に記憶された最大境界値を参照する。そして、CPU24は、この最大境界値を、顔の左端位置(x座標値)βとして、RAM25に記憶し(ステップS058)、補正処理2を終了する。この顔の左端位置(x座標値)βを、一例として図9の顔画像に示す。   If the CPU 24 determines in step S053 that the boundary value counter is equal to the boundary value data count M (step S053; No), the CPU 24 ends the process of obtaining the maximum boundary value and refers to the maximum boundary value stored in the RAM 25. . Then, the CPU 24 stores the maximum boundary value in the RAM 25 as the left end position (x coordinate value) β of the face (step S058), and ends the correction process 2. The left end position (x coordinate value) β of this face is shown as an example in the face image of FIG.

以上の処理により、顔の左端位置に係る補正を行い、夜間及び女性の顔画像においても、より正確な顔の左端位置を検出することができる。   Through the above processing, correction related to the left end position of the face can be performed, and a more accurate left end position of the face can be detected at night and in a female face image.

図4に戻って、補正処理ステップS03を終了した後、CPU24は、図4の処理を繰り返し実行し、ドライバーの顔の両端位置(x座標値)を求め続ける。また、求めた顔の両端位置(x座標値)は、RAM25に記憶され、その後、所望の処理に利用することができる。
以上の処理により、本実施形態に係る顔端検出装置は、夜間に撮影された顔画像や女性の顔画像等においても、顔の両端位置をより正確に検出することができる。
Returning to FIG. 4, after completing the correction processing step S <b> 03, the CPU 24 repeatedly executes the processing of FIG. 4 and continues to obtain both end positions (x coordinate values) of the driver's face. Further, the obtained both end positions (x coordinate values) of the face are stored in the RAM 25 and can be used for desired processing thereafter.
Through the above processing, the face edge detection device according to the present embodiment can more accurately detect the positions of both ends of a face even in a face image photographed at night, a female face image, or the like.

なお、この発明は上記実施形態に限定されず、種々の変形及び応用が可能である。   In addition, this invention is not limited to the said embodiment, A various deformation | transformation and application are possible.

例えば、上記実施形態では、顔画像の横エッジ、縦エッジを検出するために、ソーベルフィルタを適用したが、これに限定されず、例えば、プレウィットフィルタや、ロバーツフィルタを適用して、横エッジ、縦エッジを検出してもよい。   For example, in the above embodiment, the Sobel filter is applied to detect the horizontal edge and the vertical edge of the face image. However, the present invention is not limited to this. For example, a pre-witt filter or a Roberts filter is applied to Edges and vertical edges may be detected.

また、上記実施形態では、眉(又は目)と、口の階調画像から顔の上下位置(下限値c、上限値d)を求めたが、上下位置の判別に使用する顔の部分(パーツ)は任意である。例えば、耳や、ほお、頭髪などを加えて、顔の上下位置を求めても良い。   In the above embodiment, the vertical position (lower limit c, upper limit d) of the face is obtained from the eyebrows (or eyes) and the tone image of the mouth, but the part of the face (parts) used to determine the vertical position ) Is optional. For example, the vertical position of the face may be obtained by adding ears, cheeks, hair, or the like.

また、顔の上下位置(y座標値)を求めるために、眉(又は目)と、口の階調画像を利用せずに、予めROM等に記憶しておいた目や眉の画像が存在すると想定される顔の上下位置(y座標値)を特定するデータを利用してもよい。   In addition, in order to obtain the vertical position (y coordinate value) of the face, there is an eye or eyebrow image stored in advance in a ROM or the like without using the eyebrow (or eyes) and the tone image of the mouth. Then, data for specifying the assumed vertical position (y coordinate value) of the face may be used.

図1、図2を参照して説明したシステム構成も一例であり、任意に変更可能である。例えば、カメラ10を近赤外線等で画像をとらえる赤外線カメラを使用すれば、人種や肌や髪の色に影響されず比較的正確に顔の各パーツの画像を取得することが可能となる。   The system configuration described with reference to FIGS. 1 and 2 is also an example, and can be arbitrarily changed. For example, if an infrared camera that captures an image with the near-infrared ray or the like is used for the camera 10, it is possible to acquire images of each part of the face relatively accurately without being influenced by race, skin, or hair color.

また、上述のフローチャートも同様の機能が実現できるならば、任意に変更可能である。
例えば、境界値データ数割合を50%へ変更したり、縦ソーベル閾値を10へ変更してもよい。
The above-described flowchart can be arbitrarily changed as long as the same function can be realized.
For example, the boundary value data number ratio may be changed to 50%, or the vertical Sobel threshold value may be changed to 10.

上記各実施形態においては、ドライバーを撮影して顔の両端位置を検出する場合にこの発明を適用したが、この発明はこれに限定されず、任意の場面で人間、動物、人形、ロボット等の輪郭を検出する処理に広く適用可能である。   In each of the above embodiments, the present invention is applied when detecting the positions of both ends of a face by photographing a driver. However, the present invention is not limited to this, and humans, animals, dolls, robots, etc. can be used in any scene. The present invention can be widely applied to processing for detecting a contour.

また、上記実施形態では、統計処理に平均値や標準偏差を用いていたが、この発明はこれに限定されず、顔の両端位置の補正に用いるデータとして信頼できるデータを選択できるのであれば、任意の方法でよい。   Further, in the above embodiment, the average value and the standard deviation are used for the statistical processing, but the present invention is not limited to this, as long as reliable data can be selected as data used for correction of both end positions of the face. Any method may be used.

本発明は、カメラで画像を取得しながら処理する場合に限定されず、例えば、他所で撮影した1又は複数の顔画像のそれぞれについて、顔の両端位置などを判別する為に使用可能である。   The present invention is not limited to processing while acquiring an image with a camera, and can be used, for example, to determine the positions of both ends of a face for each of one or a plurality of face images photographed elsewhere.

また、コンピュータに上述の処理を実行させるためのコンピュータプログラムを、任意の記録媒体やネットワークを介してROMに格納するようにしてもよい。   Further, a computer program for causing a computer to execute the above-described processing may be stored in the ROM via an arbitrary recording medium or a network.

本発明の実施形態に係る顔端検出装置のブロック図である。It is a block diagram of a face edge detection device concerning an embodiment of the present invention. 図1に示すコンピュータの構成を示すブロック図である。It is a block diagram which shows the structure of the computer shown in FIG. ROMに格納されている各種データを説明するための図である。It is a figure for demonstrating the various data stored in ROM. 図1に示す顔端検出装置の動作を説明するためのフローチャートである。3 is a flowchart for explaining the operation of the face edge detection device shown in FIG. 1. 図4の前処理の具体例を説明するためのフローチャートである。It is a flowchart for demonstrating the specific example of the pre-processing of FIG. 図4の顔位置検出処理の具体例を説明するためのフローチャートである。5 is a flowchart for explaining a specific example of the face position detection process of FIG. 4. 図6の顔両端検出処理の具体例を説明するためのフローチャートである。It is a flowchart for demonstrating the specific example of the face both ends detection process of FIG. 図6の顔上下位置検出処理の具体例を説明するためのフローチャートである。It is a flowchart for demonstrating the specific example of the face vertical position detection process of FIG. 女性の顔画像を縦エッジ検出用ソーベルフィルタでフィルタリングし、二値化処理した画像である。This is an image obtained by filtering a female face image using a Sobel filter for detecting a vertical edge and binarizing the image. 図4の補正処理1の具体例を説明するためのフローチャートである。It is a flowchart for demonstrating the specific example of the correction process 1 of FIG. 図4の補正処理2の具体例を説明するためのフローチャートである。It is a flowchart for demonstrating the specific example of the correction process 2 of FIG. 検索座標の画素と、顔の外側に向かって画像を走査するか否かを判別するために参照する座標の画素と、の位置関係を示す図である。It is a figure which shows the positional relationship of the pixel of a search coordinate, and the pixel of the coordinate referred to in order to discriminate | determine whether an image is scanned toward the outer side of a face. 境界値記録配列A、境界値記録配列Bに、それぞれ格納される境界値データの一例を示す図である。It is a figure which shows an example of the boundary value data stored in the boundary value recording array A and the boundary value recording array B, respectively. 図10、図11の補正処理1、2に続く処理の具体例を説明するためのフローチャートである。12 is a flowchart for explaining a specific example of processing following correction processing 1 and 2 in FIGS. 10 and 11.

符号の説明Explanation of symbols

10 カメラ
22 画像メモリ (顔画像記憶手段)
23 ROM (輪郭候補位置決定手段、輪郭位置補正手段)
24 CPU (輪郭候補位置決定手段、輪郭位置補正手段)
10 Camera 22 Image memory (Face image storage means)
23 ROM (contour candidate position determining means, contour position correcting means)
24 CPU (contour candidate position determining means, contour position correcting means)

Claims (5)

顔を撮影して得られた顔画像を記憶する顔画像記憶手段と、
前記顔画像記憶手段に記憶された顔画像の画素データを処理して、顔の左右方向の仮の輪郭位置を検出し、検出した仮の輪郭位置の周辺に位置する画素データに基づいて、輪郭位置の候補となる複数の輪郭候補位置を決定する輪郭候補位置決定手段と、
前記輪郭候補位置決定手段により決定された前記複数の輪郭候補位置から抽出した位置を輪郭位置とする輪郭位置補正手段と、
を備えることを特徴とする顔端検出装置。
Face image storage means for storing a face image obtained by photographing a face;
The face image pixel data stored in the face image storage means is processed to detect a temporary contour position in the horizontal direction of the face, and based on the pixel data located around the detected temporary contour position, Contour candidate position determining means for determining a plurality of candidate contour positions that are position candidates;
A contour position correcting unit that uses a position extracted from the plurality of contour candidate positions determined by the contour candidate position determining unit as a contour position;
A face edge detection device comprising:
前記輪郭候補位置決定手段は、前記顔画像記憶手段に記憶された顔画像の画素データを処理して、顔の左右方向の仮の輪郭位置を検出する仮輪郭位置検出手段と、
前記仮輪郭位置検出手段で検出した前記仮の輪郭位置の左右方向の隣りに位置する画素データと、前記隣りに位置する画素の上下に位置する二つの画素データに基づいて、前記仮の輪郭位置を前記隣に位置する画素の位置に変更するか否かを決定する決定手段と、
前記決定手段で前記仮の輪郭位置を変更することを決定した場合に、前記仮の輪郭位置を変更する変更手段と、
前記決定手段と、前記変更手段とを繰り返し動作させて、前記決定手段が前記仮の輪郭位置を変更しないと決定したときの仮の輪郭位置を前記輪郭候補位置とする手段と、
を備えることを特徴とする請求項1に記載の顔端検出装置。
The contour candidate position determining means processes the pixel data of the face image stored in the face image storage means, and detects a temporary contour position in the horizontal direction of the face;
The temporary contour position based on the pixel data located adjacent to the temporary contour position in the left-right direction detected by the temporary contour position detection means and the two pixel data located above and below the neighboring pixel. Determining means for determining whether or not to change to the position of the pixel located next to,
A changing means for changing the temporary contour position when the determining means determines to change the temporary contour position;
Means for repeatedly operating the determining means and the changing means, and setting the temporary contour position when the determining means determines not to change the temporary contour position as the contour candidate position;
The face edge detection device according to claim 1, further comprising:
前記輪郭位置補正手段は、前記輪郭候補位置決定手段により決定された前記複数の輪郭候補位置のヒストグラムを作成するヒストグラム作成手段と、
前記ヒストグラム作成手段で作成したヒストグラムに基づいて、前記輪郭候補位置の標準偏差を算出する標準偏差算出手段と、
前記標準偏差算出手段で算出した標準偏差内の輪郭候補位置の内、顔画像の最も外側に位置する輪郭候補位置を輪郭位置とする手段と、
を備えることを特徴とする請求項1に記載の顔端検出装置。
The contour position correcting means creates a histogram of the plurality of contour candidate positions determined by the contour candidate position determining means,
A standard deviation calculating means for calculating a standard deviation of the candidate contour position based on the histogram created by the histogram creating means;
Means for setting the contour candidate position located on the outermost side of the face image out of the contour candidate positions within the standard deviation calculated by the standard deviation calculating means;
The face edge detection device according to claim 1, further comprising:
顔を撮影して得られた顔画像を記憶する顔画像記憶ステップと、
前記顔画像記憶ステップで記憶された顔画像の画素データを処理して、顔の左右方向の仮の輪郭位置を検出し、検出した仮の輪郭位置の周辺に位置する画素データに基づいて、輪郭位置の候補となる複数の輪郭候補位置を決定する輪郭候補位置決定ステップと、
前記輪郭候補位置決定ステップで決定された前記複数の輪郭候補位置から抽出した位置を輪郭位置とする輪郭位置補正ステップと、
を備えることを特徴とする顔端検出方法。
A face image storing step for storing a face image obtained by photographing a face;
The face image pixel data stored in the face image storage step is processed to detect a temporary contour position in the horizontal direction of the face, and based on the pixel data located around the detected temporary contour position, A contour candidate position determining step for determining a plurality of contour candidate positions that are position candidates;
A contour position correcting step in which a position extracted from the plurality of contour candidate positions determined in the contour candidate position determining step is a contour position;
A method for detecting a face edge.
コンピュータに、
顔を撮影して得られた顔画像を記憶する顔画像記憶手順と、
前記顔画像記憶手順で記憶された顔画像の画素データを処理して、顔の左右方向の仮の輪郭位置を検出し、検出した仮の輪郭位置の周辺に位置する画素データに基づいて、輪郭位置の候補となる複数の輪郭候補位置を決定する輪郭候補位置決定手順と、
前記輪郭候補位置決定手順で決定された前記複数の輪郭候補位置から抽出した位置を輪郭位置とする輪郭位置補正手順と、
を実行させるプログラム。
On the computer,
A face image storing procedure for storing a face image obtained by photographing a face;
The face image pixel data stored in the face image storage procedure is processed to detect a temporary contour position in the left-right direction of the face, and based on the pixel data located around the detected temporary contour position, A contour candidate position determination procedure for determining a plurality of contour candidate positions to be position candidates;
A contour position correction procedure in which a position extracted from the plurality of contour candidate positions determined in the contour candidate position determination procedure is a contour position;
A program that executes
JP2005332404A 2005-11-17 2005-11-17 Face edge detection device, face edge detection method, and program Expired - Fee Related JP4664805B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005332404A JP4664805B2 (en) 2005-11-17 2005-11-17 Face edge detection device, face edge detection method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005332404A JP4664805B2 (en) 2005-11-17 2005-11-17 Face edge detection device, face edge detection method, and program

Publications (2)

Publication Number Publication Date
JP2007139535A true JP2007139535A (en) 2007-06-07
JP4664805B2 JP4664805B2 (en) 2011-04-06

Family

ID=38202599

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005332404A Expired - Fee Related JP4664805B2 (en) 2005-11-17 2005-11-17 Face edge detection device, face edge detection method, and program

Country Status (1)

Country Link
JP (1) JP4664805B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7898592B2 (en) 2007-09-05 2011-03-01 Seiko Epson Corporation Image processing apparatus, image processing method, and image processing system
US7961230B2 (en) 2007-08-30 2011-06-14 Seiko Epson Corporation Image processing device, image processing program, image processing system, and image processing method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07271989A (en) * 1994-03-31 1995-10-20 Toshiba Corp Boundary detecting method of background and object area, contour extracting method of object and object contour extracting device
JPH08272979A (en) * 1995-03-31 1996-10-18 Toshiba Corp Method and device for extracting face image outline
JPH09259284A (en) * 1996-03-22 1997-10-03 Nissan Motor Co Ltd Detecting device for face position and eye position of vehicle driver
JP2004310396A (en) * 2003-04-07 2004-11-04 Toyota Central Res & Dev Lab Inc Image processing apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07271989A (en) * 1994-03-31 1995-10-20 Toshiba Corp Boundary detecting method of background and object area, contour extracting method of object and object contour extracting device
JPH08272979A (en) * 1995-03-31 1996-10-18 Toshiba Corp Method and device for extracting face image outline
JPH09259284A (en) * 1996-03-22 1997-10-03 Nissan Motor Co Ltd Detecting device for face position and eye position of vehicle driver
JP2004310396A (en) * 2003-04-07 2004-11-04 Toyota Central Res & Dev Lab Inc Image processing apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7961230B2 (en) 2007-08-30 2011-06-14 Seiko Epson Corporation Image processing device, image processing program, image processing system, and image processing method
US7898592B2 (en) 2007-09-05 2011-03-01 Seiko Epson Corporation Image processing apparatus, image processing method, and image processing system

Also Published As

Publication number Publication date
JP4664805B2 (en) 2011-04-06

Similar Documents

Publication Publication Date Title
JP4307496B2 (en) Facial part detection device and program
JP6125188B2 (en) Video processing method and apparatus
CN107948517B (en) Preview picture blurring processing method, device and equipment
JP4445454B2 (en) Face center position detection device, face center position detection method, and program
JP5538909B2 (en) Detection apparatus and method
JP4317465B2 (en) Face identification device, face identification method, and face identification program
JP4597391B2 (en) Facial region detection apparatus and method, and computer-readable recording medium
JP4825473B2 (en) Face orientation discrimination device
CN107491744B (en) Human body identity recognition method and device, mobile terminal and storage medium
CN107016348B (en) Face detection method and device combined with depth information and electronic device
JP2007272435A (en) Face feature extraction device and face feature extraction method
KR20160115663A (en) Image processing apparatus and image processing method
CN112712059A (en) Living body face recognition method based on infrared thermal image and RGB image
JP2007312206A (en) Imaging apparatus and image reproducing apparatus
JP3952460B2 (en) Moving object detection apparatus, moving object detection method, and moving object detection program
KR101908785B1 (en) Tongue region extraction method and image processing apparatus for performing the method
JP4664805B2 (en) Face edge detection device, face edge detection method, and program
JP2010237976A (en) Light source information obtaining device, shading detection device, shading removal device, and those methods and programs
JP5203271B2 (en) Display information forming apparatus and system
JPH11306348A (en) Method and device for object detection
JP2008084109A (en) Eye opening/closing determination device and eye opening/closing determination method
JP5128454B2 (en) Wrinkle detection device, wrinkle detection method and program
JP3627249B2 (en) Image processing device
JP6350331B2 (en) TRACKING DEVICE, TRACKING METHOD, AND TRACKING PROGRAM
JP2005165983A (en) Method for detecting jaw of human face, jaw detection system, and jaw detection program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080313

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100709

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100720

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100921

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

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

R151 Written notification of patent or utility model registration

Ref document number: 4664805

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

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees