JPH0632154A - Driver's condition detector - Google Patents

Driver's condition detector

Info

Publication number
JPH0632154A
JPH0632154A JP21378092A JP21378092A JPH0632154A JP H0632154 A JPH0632154 A JP H0632154A JP 21378092 A JP21378092 A JP 21378092A JP 21378092 A JP21378092 A JP 21378092A JP H0632154 A JPH0632154 A JP H0632154A
Authority
JP
Japan
Prior art keywords
eyeball
driver
open
black
continuous
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
JP21378092A
Other languages
Japanese (ja)
Other versions
JP2822799B2 (en
Inventor
Masayuki Kaneda
雅之 金田
Junichi Kasai
純一 笠井
Masataka Tsukino
正隆 月野
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.)
Nissan Motor Co Ltd
Original Assignee
Nissan Motor Co Ltd
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 Nissan Motor Co Ltd filed Critical Nissan Motor Co Ltd
Priority to JP21378092A priority Critical patent/JP2822799B2/en
Publication of JPH0632154A publication Critical patent/JPH0632154A/en
Application granted granted Critical
Publication of JP2822799B2 publication Critical patent/JP2822799B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Geophysics And Detection Of Objects (AREA)
  • Auxiliary Drives, Propulsion Controls, And Safety Devices (AREA)
  • Image Processing (AREA)
  • Emergency Alarm Devices (AREA)

Abstract

PURPOSE:To surely detect an eyeball whether it is in open eye condition or close eye condition and shorten the processing time for judgment of an open or close eye by providing a driver's condition judging means for judging the condition of the driver, based on the pattern of an open/close eye detected by an open/close eye detecting means. CONSTITUTION:This detector is provided with an image input means CL1 for inputting the face image of a driver, a binarizing means CL2 for binarizing the face image being inputted from the image input means, an eyeball existence area setting means CL3 for seeking the eyeball existence area within the binarized image, and an eyeball detecting means CL4 for detecting the eyeball, based on the continuous black picture element in longitudinal direction within the eyeball existence area. Furthermore, it is provided with an open/close eye detecting means CL5 for detecting the open/close eye of a driver, based on the number of continuous black picture elements of an eyeball being detected, and a driver's condition judging means CL6 judges the condition of a driver, based on the pattern of the open/close eye being detected by this open/close eye detecting means CL5.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、運転者の眼の開閉状況
から居眠り状態などを検出する運転者の状態検出装置に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a driver's state detecting device for detecting a dozing state or the like from the state of the driver's eyes opening and closing.

【0002】[0002]

【従来の技術】従来の車両運転者の状態検出装置として
は、例えば特開平3−194661号公報に記載された
ようなものがある。これは2値化した運転者の顔画像を
用いて、運転者の眼がある範囲を検出領域としてその領
域内で眼の虹彩部を検出することによって、虹彩部の検
出結果から運転者の開閉眼を判定し、運転者の状態を検
出する構成となっており、運転者の居眠りやわき見の検
出に利用可能であるとしている。
2. Description of the Related Art As a conventional vehicle driver state detecting device, there is one disclosed in, for example, Japanese Unexamined Patent Publication No. 3-194661. This is to detect the iris part of the eye in a certain range of the driver's eye using the binarized face image of the driver as a detection region, and open and close the driver from the detection result of the iris part. It is configured to detect the eyes and detect the driver's state, and it can be used to detect the driver's dozing or aside.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上記従
来の車両運転者の状態検出装置では、運転者の開閉眼を
判別するに際して、検出領域の中で黒い円形領域を検出
しこれを眼の虹彩と判断したうえで、その面積の大小に
より開眼状態、閉眼状態を判定するようにしているた
め、2値化された画像が、図20の例Aの開眼時に示さ
れるように、円形領域が明確に識別検出されるときには
精度良く判定できるが、同図の例B〜例Dのように2値
化した画像上で黒い円形領域の識別が困難なときには、
これが眉などと誤判定される恐れがある。
However, in the above-described conventional vehicle driver state detection device, when determining the open / closed eyes of the driver, a black circular region is detected in the detection region, and this is designated as the iris of the eye. Since the eye open state and the eye closed state are determined based on the size of the area after the determination, the binarized image clearly shows that the circular area is clear as shown in the eye open state of Example A of FIG. When the identification and detection are performed, the determination can be performed accurately, but when it is difficult to identify the black circular area on the binarized image as in Examples B to D in FIG.
This may be erroneously determined as eyebrows or the like.

【0004】さらに、虹彩部の検出にあたって、放射状
の矩形フィルタで明度差のMAX値を求め、そのMAX
値をとる点の座標を虹彩中心部と決定して、虹彩中心部
の回りの黒色画素の面積から開閉眼を判定するため、判
定のための演算処理時間も長くかかるという問題があっ
た。したがって本発明は、このような従来の問題点に鑑
み、画像状態が不良の場合でも精度よく開閉眼の状況を
検出でき、迅速に居眠り状態などの運転者の状態を判定
することができる運転者の状態検出装置を提供すること
を目的とする。
Further, when detecting the iris portion, the MAX value of the brightness difference is obtained by a radial rectangular filter, and the MAX value is calculated.
Since the coordinate of the point that takes a value is determined as the iris center and the open / closed eye is determined from the area of the black pixels around the iris center, there is a problem that the calculation processing time for the determination also takes a long time. Therefore, in view of such conventional problems, the present invention can accurately detect the open / closed eye situation even when the image state is poor, and can quickly determine the driver's state such as the dozing state. An object of the present invention is to provide a state detection device.

【0005】[0005]

【課題を解決するための手段】上記課題を解決するため
に本発明は、図1に示されるように、運転者の顔画像を
入力する画像入力手段CL1と、該画像入力手段から入
力された顔画像を2値化する2値化手段CL2と、2値
化された画像内で眼球存在領域を定める眼球存在領域設
定手段CL3と、前記眼球存在領域内で縦方向の連続黒
色画素に基づいて眼球を検出する眼球検出手段CL4
と、検出された眼球の前記連続黒色画素の数に基づいて
運転者の開閉眼を検出する開閉眼検出手段CL5と、該
開閉眼検出手段で検出された開閉眼のパターンに基づい
て運転者の状態を判定する運転者状態判定手段CL6と
を備えるものとした。
In order to solve the above-mentioned problems, according to the present invention, as shown in FIG. 1, an image input means CL1 for inputting a face image of a driver, and an image input means CL1 are inputted. Based on the binarizing means CL2 for binarizing the face image, the eyeball existing area setting means CL3 for defining the eyeball existing area in the binarized image, and the continuous black pixels in the vertical direction within the eyeball existing area. Eyeball detecting means CL4 for detecting an eyeball
And an open / closed eye detection means CL5 for detecting the open / closed eyes of the driver based on the number of the continuous black pixels of the detected eyeballs, and the driver's open / closed eye pattern detected by the open / closed eye detection means. The driver state determination means CL6 for determining the state is provided.

【0006】[0006]

【作用】2値化画像の眼球存在領域内を縦方向に走査し
て、連続黒色画素を検索することによって眼球を検出す
るから、開眼状態か閉眼状態かにかかわらず確実に眼球
が検出される。眼球の上記連続黒色画素数によって開閉
眼が判別されるから、短時間に状態検出が行なわれる。
Since the eyeball is detected by vertically scanning the eyeball existing region of the binarized image and searching for continuous black pixels, the eyeball is surely detected regardless of whether the eye is open or closed. . Since the open / closed eye is discriminated by the number of continuous black pixels of the eyeball, the state is detected in a short time.

【0007】[0007]

【実施例】以下、本発明を図面に基づいて説明する。図
2は、本発明の実施例の構成を示すブロック図である。
運転者の顔面に向けて照射する赤外線ストロボ1と、こ
の赤外線ストロボ1の赤外線で照射される顔部分を撮影
する画像入力手段CL1としてのCCDTVカメラ3
が、車両の図示しないインストルメントパネルに設置さ
れている。前記赤外線ストロボ1とTVカメラ3はタイ
ミング指令回路5に接続され、ストロボ発光とTVカメ
ラの画像入力とのタイミング合わせが制御される。すな
わち、赤外線ストロボ1にタイミング指令回路5からス
トロボ発光指令が出力されると、赤外線ストロボ1が発
光して運転者の顔部分を照射し、これと同時にTVカメ
ラ3へ画像入力指令が出力され、赤外線で照射された顔
部分を撮影するようになっている。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings. FIG. 2 is a block diagram showing the configuration of the embodiment of the present invention.
An infrared strobe 1 for irradiating the driver's face and a CCD TV camera 3 as an image input means CL1 for photographing a face portion irradiated by infrared rays of the infrared strobe 1
Is installed on an instrument panel (not shown) of the vehicle. The infrared strobe 1 and the TV camera 3 are connected to a timing command circuit 5, and the timing matching between strobe emission and image input of the TV camera is controlled. That is, when the timing command circuit 5 outputs a strobe light emission command to the infrared strobe 1, the infrared strobe 1 emits light to illuminate the driver's face portion, and at the same time, an image input command is output to the TV camera 3. It is designed to photograph the face area illuminated by infrared rays.

【0008】TVカメラ3の入力画像は図3に示される
ように、横(X)方向520画素、縦(Y)方向500
画素からなり、縦方向に顔部分がほぼいっぱいになるよ
うに画角が調整されている。 TVカメラ3には、撮影
した入力画像をデジタル量に変換するA/D変換器7を
介して画像メモリ9が接続され、入力画像データが格納
される。画像メモリ9には、眼球存在位置規定回路11
が接続され、画像メモリ9に格納された入力画像データ
に基づいて眼球の存在位置領域を規定する。さらに、こ
の眼球存在位置規定回路11に接続されて、眼球検出回
路13が、画像メモリ9の画像データのうち上記の眼球
存在位置領域内にあるデータを処理して、眼球を検出す
る。次の開閉眼判別回路15において、上に検出された
眼球データから開眼状態か閉眼状態かが判断される。こ
の開閉眼の状況から居眠り判定回路17において運転者
の居眠り状態の有無が判定される。判定結果は警報回路
17などに出力されて報知される。
The input image of the TV camera 3 is, as shown in FIG. 3, 520 pixels in the horizontal (X) direction and 500 in the vertical (Y) direction.
It is composed of pixels, and the angle of view is adjusted so that the face part is almost full in the vertical direction. An image memory 9 is connected to the TV camera 3 via an A / D converter 7 which converts a captured input image into a digital amount, and stores input image data. The image memory 9 includes an eyeball presence position defining circuit 11
Are connected, and the existence position area of the eyeball is defined based on the input image data stored in the image memory 9. Further, connected to the eyeball existing position defining circuit 11, the eyeball detection circuit 13 processes the data in the eyeball existing position region of the image data of the image memory 9 to detect the eyeball. In the next opening / closing eye determination circuit 15, it is determined from the eyeball data detected above whether the eye is open or closed. The presence / absence of the driver's dozing state is determined by the dozing determination circuit 17 based on the state of the open / closed eyes. The determination result is output to the alarm circuit 17 or the like for notification.

【0009】上記構成における全体の動作のメインフロ
ーを図4により説明する。まず、車両のイグニッション
スイッチがオンされて、運転者が運転席についたことが
確認され全体システムが起動すると、ステップS1でタ
イマがスタートされる。そしてステップS2で赤外線ス
トロボ1の発光と同期してTVカメラ3によって運転者
の顔部分が撮影されると、この画像がA/D変換回路7
でデジタル信号に変換されて、1フレーム分の入力画像
データとしてステップS3で画像メモリ9に格納され
る。ここでは、ビデオ信号が0〜255の256階調の
デジタルデータに変換され、白い部分が「255」、黒
い部分が「0」とされている。ステップS2、S3が発
明の画像入力手段CL1を構成している。
The main flow of the overall operation in the above configuration will be described with reference to FIG. First, when the ignition switch of the vehicle is turned on, it is confirmed that the driver is on the driver's seat, and the entire system is activated, the timer is started in step S1. Then, in step S2, when the face portion of the driver is photographed by the TV camera 3 in synchronization with the emission of the infrared strobe 1, this image is A / D conversion circuit 7
Is converted into a digital signal and stored in the image memory 9 as input image data for one frame in step S3. Here, the video signal is converted into digital data of 256 gradations of 0 to 255, and the white portion is "255" and the black portion is "0". Steps S2 and S3 form the image input means CL1 of the invention.

【0010】画像メモリ9に格納された入力画像データ
は、眼球存在位置規定回路11に取り込まれ、ステップ
S4において、顔部分の明暗をはっきりさせ眼球を抽出
できるよう、所定のしきい値で2値化されて、2値化画
像J(X,Y)が求められる。2値化画像J(X,Y)
を基に、次のステップS5およびステップS6におい
て、あるいはステップS5’およびステップS6’にお
いて、図3に破線で示される左右の眼球存在領域の横方
向(X方向)の幅および縦方向(Y方向)の幅が決定さ
れる。ステップS4が発明の2値化手段CL2を構成し
ている。また、ステップS5、S5’が横幅設定手段
を、S6、S6’が縦幅設定手段を構成し、両者で眼球
存在領域設定手段CL3を構成している。
The input image data stored in the image memory 9 is fetched by the eyeball existing position defining circuit 11 and, in step S4, a binary value is set at a predetermined threshold so that the lightness and darkness of the face portion can be made clear and the eyeball can be extracted. Then, the binarized image J (X, Y) is obtained. Binary image J (X, Y)
Based on the above, in the next step S5 and step S6, or in step S5 ′ and step S6 ′, the lateral (X direction) width and the vertical direction (Y direction) of the left and right eyeball existence regions shown by the broken lines in FIG. ) Width is determined. Step S4 constitutes the binarizing means CL2 of the invention. Further, steps S5 and S5 'constitute lateral width setting means, and S6 and S6' constitute vertical width setting means, and both constitute eyeball existing area setting means CL3.

【0011】眼球存在位置規定回路11で眼球存在領域
が決定されると、次にステップS7において、眼球検出
回路13により、眼球存在領域内での縦方向の連続黒色
画素の計数が行われて眼球が検出決定される。この後ス
テップ8で、開閉眼判別回路15においてしきい値が設
定され、上に検出された眼球のデータがしきい値と比較
されて開閉眼が検出される。先のステップS1でスター
トされたタイマのカウントは、後述するように、ここで
のしきい値設定に用いられる。
When the eyeball existing area is determined by the eyeball existing position defining circuit 11, then in step S7, the eyeball detecting circuit 13 counts the continuous black pixels in the vertical direction within the eyeball existing area, and the eyeball is detected. Is detected and determined. Thereafter, in step 8, a threshold value is set in the open / closed eye determination circuit 15, and the eyeball data detected above is compared with the threshold value to detect the open / closed eye. The count of the timer started in step S1 is used for threshold setting here, as described later.

【0012】開閉眼の判断にあたっては、まず左側の眼
球存在領域の眼球データに開閉眼に伴なって所定の大き
な変化があるときは、この左側の眼球存在領域の眼球デ
ータに基づいてしきい値設定と開閉眼判断が行なわれ
て、ステップS9に移る。左側の眼球存在領域の眼球デ
ータの変化が小さいときは、次に右側の眼球存在領域の
眼球データと比較され、上記変化の大きいほうの眼球存
在領域のデータが用いられてしきい値設定と開閉眼判断
が行なわれる。そしてステップS9において、上に検出
された開閉眼のパターンから居眠り判定回路17で運転
者の居眠り判定が行われる。ステップS7が発明の眼球
検出手段CL4を、ステップS1、S8が開閉眼検出手
段CL5を、そしてステップS8が運転者状態判定手段
CL6を構成している。
When the eyeball data of the left eyeball existing area has a predetermined large change with the open / closed eye, the threshold value is determined based on the eyeball data of the left eyeball existing area. After the setting and the open / closed eye determination, the process proceeds to step S9. When the change in the eyeball data in the left eyeball area is small, it is then compared with the eyeball data in the right eyeball area, and the threshold value setting and opening / closing is performed using the data in the eyeball area with the larger change. An eye judgment is made. Then, in step S9, the driver's dozing judgment is made by the dozing judgment circuit 17 based on the pattern of the open / closed eyes detected above. Step S7 constitutes the eyeball detection means CL4 of the invention, steps S1 and S8 constitute the open / closed eye detection means CL5, and step S8 constitutes the driver state determination means CL6.

【0013】次にステップS5、S5’の詳細が図5、
図6のフローチャートに示される。まずステップS10
0で、検索開始点の初期設定が行なわれ、高さ方向の走
査Y座標が40にセットされる。これはY=0〜40の
範囲内に顔面の最大幅は存在しないことを前提として処
理時間を短縮するものである。ステップS101におい
て、図7に示すように、画像の中央(X座標=250)
が検索開始ラインとされて、Y座標上の横方向走査ライ
ン上を左右別個に連続白色画素数WXCLおよびWXC
Rがカウントされ、ステップS102で、連続白色画素
数が最大のときの左右端X座標XLMおよびXRMが記
憶される。ステップS100〜S102が発明の連続白
色画素数計数手段を構成しており、この処理のさらに詳
細な説明は図8、図9により後述する。
Details of steps S5 and S5 'are shown in FIG.
This is shown in the flow chart of FIG. First, step S10
At 0, the search start point is initialized and the scanning Y coordinate in the height direction is set to 40. This shortens the processing time on the assumption that the maximum width of the face does not exist within the range of Y = 0 to 40. In step S101, as shown in FIG. 7, the center of the image (X coordinate = 250)
Is set as the search start line, and the number of continuous white pixels WXCL and WXC is separately set on the horizontal scanning line on the Y coordinate.
R is counted, and in step S102, the left and right X coordinates XLM and XRM when the number of continuous white pixels is maximum are stored. Steps S100 to S102 constitute the continuous white pixel number counting means of the invention, and a more detailed description of this processing will be given later with reference to FIGS. 8 and 9.

【0014】続いてステップS103で、左右の連続白
色画素数の和が200より大きいか否かがチェックされ
る。頭髪や眉、眼球部などの存在により白色データの連
続が遮断されて上記の和が200以下である場合には、
ステップS104で、左安定カウンタWLCONおよび
右安定カウンタWRCON、左安定フラグSTFLGL
および右安定フラグSTFLGRがクリアされて、ステ
ップS101へ戻り次のラインが走査される。
Subsequently, in step S103, it is checked whether or not the sum of the numbers of continuous white pixels on the left and right is larger than 200. When the continuation of the white data is interrupted by the presence of hair, eyebrows, eyeballs, etc., and the above sum is 200 or less,
In step S104, the left stability counter WLCON, the right stability counter WRCON, and the left stability flag STFLGL.
Then, the right stability flag STFLGR is cleared, the process returns to step S101, and the next line is scanned.

【0015】左右の連続白色画素数の和が200より大
きい場合には、ステップS105に進んで、左側端点検
出フラグOKFGLがセットされているか否かがチェッ
クされ、セットされている場合はステップS120以降
の右端検索処理へ移る。左側端点検出フラグOKFGL
が0の場合には、ステップS106に進み、WXCLと
直前の走査ラインにおける連続数MAELとの差が10
未満であるかチェックされ、10未満ならばステップ1
07で左安定カウンタWLCONがカウントアップされ
る。このときには、現走査ラインは直前走査ラインの連
続数との差が小さい安定候補部とみなされ、ステップ1
08、109でこの中での連続白色画素数WXCLが最
大のときのXLをX1 、最小のときのXLをX2 として
記憶される。
If the sum of the numbers of continuous white pixels on the left and right is greater than 200, the process proceeds to step S105, and it is checked whether or not the left end point detection flag OKFGL is set. Move to the right end search process of. Left end point detection flag OKFGL
Is 0, the process proceeds to step S106, where the difference between WXCL and the number MAEL of consecutive scan lines immediately before is 10
It is checked whether it is less than 10 and if it is less than 10, step 1
At 07, the left stability counter WLCON is incremented. At this time, the current scan line is regarded as a stable candidate part having a small difference from the number of consecutive previous scan lines, and the step 1
At 08 and 109, XL when the number WXCL of continuous white pixels is maximum is stored as X1, and XL when the number WXCL is minimum is stored as X2.

【0016】ステップS110では、左安定カウンタW
LCONが10を越え、且つX1 とX2 の差が30未満
か否かが調べられ、この条件を満足していればステップ
111で左安定フラグのSTFGLがセットされ、ステ
ップ112で、左の連続白色画素数WXCLが新たにM
AELとされる。
In step S110, the left stability counter W
It is checked whether LCON exceeds 10 and the difference between X1 and X2 is less than 30. If this condition is satisfied, the left stability flag STFGL is set in step 111, and the left continuous white color is detected in step 112. The number of pixels WXCL is newly M
AEL.

【0017】ステップS106で連続白色画素数WXC
Lと前の走査での連続数MAELの差が10以上であっ
たときには、画像輪郭線の連続性が失われた可能性があ
ると判断され、ステップS113〜S119の処理へ移
る。ここでは、連続画素数が大きく変化したのが眉など
の存在によるためか、輪郭線の途切れなのかが連続画素
数の変化と安定部分の存在とによって判断される。
In step S106, the number of continuous white pixels WXC
When the difference between L and the number of consecutive MAELs in the previous scan is 10 or more, it is determined that the continuity of the image contour line may have been lost, and the process proceeds to steps S113 to S119. Here, it is determined whether the continuous line number has changed significantly due to the presence of the eyebrows or the like, and whether the contour line is interrupted or not is determined by the change in the continuous pixel number and the presence of the stable portion.

【0018】まずステップS113で、左安定フラグS
TFLGLがチェックされ、この連続白色画素数が大き
く変化する前に安定部分が存在し、STFLGLがセッ
トされていた場合は、ステップS114で連続画素数が
増加したか否かが調べられる。 連続画素数が増加して
いる場合には、輪郭線が途切れたと判断され、ステップ
S115に進んで、前回フローのステップS108で記
憶されたX座標X1 を顔の左端と定める。
First, in step S113, the left stability flag S
TFLGL is checked, and if there is a stable portion before the number of continuous white pixels changes significantly and STFLGL is set, it is checked in step S114 whether the number of continuous pixels has increased. If the number of consecutive pixels is increasing, it is determined that the contour line is interrupted, the process proceeds to step S115, and the X coordinate X1 stored in step S108 of the previous flow is set as the left edge of the face.

【0019】ステップ113で連続白色画素数が大きく
変化する前に安定部分が存在しない場合や、安定部分が
存在してもステップ114で連続画素数が減少している
場合は、輪郭線が途切れた部分から輪郭線のある部分の
走査に移ったか、あるいは眉や眼、眼鏡部分などを走査
したものであることが考えられる。そこでこのときには
ステップS116において、今回の走査の連続白色画素
数が前回の走査の連続白色画素数より50以上減少して
いるかどうかがチェックされる。
If there is no stable portion before the number of continuous white pixels greatly changes in step 113, or if there is a stable portion and the number of continuous pixels decreases in step 114, the contour line is interrupted. It is conceivable that the scanning has shifted from the portion to the portion having the contour line, or the scanning of the eyebrows, eyes, spectacles, or the like. Therefore, at this time, in step S116, it is checked whether or not the number of continuous white pixels of the current scan is reduced by 50 or more from the number of continuous white pixels of the previous scan.

【0020】50以上減少の場合は、輪郭線が途切れた
部分から輪郭線のある部分の走査に移ったものとして、
ステップ118に進んで今回の走査の左端点XLを顔の
左端と定める。こうしてステップS115、またはステ
ップS118で顔の左端が決定されたときは、次のステ
ップS119で左側端点検出フラグOKFGLがセット
された上でステップS120へ進む。ステップ116で
今回の連続白色画素数が前回の連続画素数より大きく減
少していない場合は、眉や眼、眼鏡部分、その他大きな
陰影のある部分と考えられ、ステップS117に進ん
で、X1 ,X2 ,WLCON,STFLGLがクリアさ
れた後ステップS112へ進む。
In the case of a decrease of 50 or more, it is assumed that the portion where the contour line is interrupted is moved to the scanning of the portion where the contour line is present,
Proceeding to step 118, the left end point XL of this scan is set as the left end of the face. When the left edge of the face is thus determined in step S115 or step S118, the left edge detection flag OKFGL is set in the next step S119, and then the process proceeds to step S120. If the number of consecutive white pixels of this time is not significantly smaller than the number of consecutive pixels of the previous time in step 116, it is considered to be an eyebrow, an eye, a spectacle portion, or a portion having a large shadow, and the process proceeds to step S117, where X1, X2 , WLCON, and STFLGL are cleared, the process proceeds to step S112.

【0021】ステップS120からS121では、画像
の左側についてのステップS105〜S119と同様に
して、画像の右側について輪郭線途切れの判断および輪
郭線が途切れた際の顔の右端決定が行なわれる。
In steps S120 to S121, similarly to steps S105 to S119 for the left side of the image, it is determined whether the contour line is broken or the right edge of the face is determined for the right side of the image.

【0022】以上の処理がステップS122およびS1
23により、顔面の左右の端点検出フラグOKFGL、
OKFGRの両方ともセットされるか、さもなければ予
め設定された縦方向(Y方向)の検索範囲の走査が終了
するまで繰り返される。端点検出フラグがセットされた
場合は、左側ではX1 、X2 を端点として、同様に右側
ではXX1 、XX2 を端点として眼球存在領域の横幅設
定が終了する。
The above processes are steps S122 and S1.
23, the left and right end point detection flags OKFGL,
Both OKFGR are set, or otherwise repeated until the scanning of the preset search range in the vertical direction (Y direction) is completed. When the end point detection flag is set, the lateral width setting of the eyeball existing region is completed with X1 and X2 as the end points on the left side and XX1 and XX2 as the end points on the right side.

【0023】また、Y方向の検索範囲の走査が終了した
ときは、ステップS124並びにS126でそれぞれ左
右の端点検出フラグがセットされているか否かが調べら
れ、セットされていない場合はそれぞれステップS12
5、S127において、先のステップS102で記憶さ
れた全走査の中での連続白色画素数が最大のときの左右
端X座標XLM,XRMを顔の左右端と定める。顔の左
右端が定められると、次式により眼球存在領域の横方向
の端点が決定される。 X軸センター=XC =XLM+((XRM−XLM)/
2) 左眼眼球存在領域の左側X座標=X1 =XLM 左眼眼球存在領域の右側X座標=X2 =XC −25 右眼眼球存在領域の左側X座標=XX1 =XC +25 右眼眼球存在領域の右側X座標=XX2 =XRM ステップS103〜S112が発明の安定部検出手段
を、ステップS106、S113、S114が輪郭線連
続性判断手段を、そしてステップS115〜S127が
顔端特定手段を構成している。ただし、ステップS12
1は右側についての安定部検出手段および輪郭線連続性
判断手段を含む。
When the scanning of the search range in the Y direction is completed, it is checked in steps S124 and S126 whether or not the left and right end point detection flags are set, and if they are not set, in step S12.
5. In S127, the left and right X coordinates XLM, XRM when the number of continuous white pixels in the entire scan stored in the previous step S102 is the maximum are determined as the left and right ends of the face. When the left and right edges of the face are determined, the lateral end points of the eyeball existing area are determined by the following equation. X-axis center = XC = XLM + ((XRM-XLM) /
2) Left-side X coordinate of the left-eye-eye-ball-existing region = X1 = XLM Right-side X-coordinate of the left-eye-eye-ball-existing region = X2 = XC-25 Left-side X-coordinate of the right-eye-eye-ball-existing region = XX1 = XC + 25 Right X coordinate = XX2 = XRM Steps S103 to S112 constitute the stable portion detecting means of the invention, steps S106, S113 and S114 constitute the contour line continuity determining means, and steps S115 to S127 constitute the face edge specifying means. . However, step S12
1 includes a stable part detecting means and a contour line continuity judging means for the right side.

【0024】前記のステップS101、S102におけ
る連続白色画素数のカウントと左右端X座標XLMとX
RMの記憶は図8、図9に示す流れで行なわれる。前述
のようにステップS100で、縦方向の走査Y座標が4
0にセットされると、次にステップS202で、左検索
X座標XLと右検索X座標XRに横方向の検索走査開始
ラインのX座標値250がそれぞれセットされる。この
X座標値(=250)は、図7に示されるように、車両
運転者がTVカメラの撮影画角内に存在すれば、確実に
顔面部の中に存在するラインを表わしている。
Counting the number of continuous white pixels and the left and right X coordinates XLM and X in steps S101 and S102.
The RM storage is performed according to the flow shown in FIGS. As described above, in step S100, the vertical scanning Y coordinate is 4
If it is set to 0, then in step S202, the X coordinate value 250 of the horizontal search scan start line is set to the left search X coordinate XL and the right search X coordinate XR. This X coordinate value (= 250), as shown in FIG. 7, represents a line that is surely present in the face portion if the vehicle driver is present within the photographing angle of view of the TV camera.

【0025】次に、ステップS203で右側走査終了フ
ラグOKRがセットされているか否かが調べられ、セッ
トされていればステップS211以降の顔面左端検索に
進む。OKRがセットされていない場合は、ステップS
204で、画素J(XR,Y)が白か否かが調べられ、
白のときはステップS205およびS206で右側連続
白色画素カウンタWXCR、検索X座標XRがそれぞれ
カウントアップされる。ステップS204のチェックで
画素J(XR,Y)が白でないときには、ステップS2
07に進んで右側走査終了フラグOKRがセットされた
後、ステップS208で、今まで記憶していた右側端点
の最大値XRMと今回の端点XRが比較される。ここで
XRの方が大きいとき、すなわちより右側にある場合は
ステップS209においてXRが新たな右端点XRMと
される。
Next, in step S203, it is checked whether or not the right scanning end flag OKR is set. If the right scanning end flag OKR is set, the process proceeds to step S211 and the subsequent search for the left edge of the face. If OKR is not set, step S
At 204, it is checked if pixel J (XR, Y) is white,
When it is white, the right continuous white pixel counter WXCR and the search X coordinate XR are respectively incremented in steps S205 and S206. If the pixel J (XR, Y) is not white in the check in step S204, step S2
After the routine proceeds to 07 and the right side scanning end flag OKR is set, in step S208, the maximum value XRM of the right side end point which has been stored so far is compared with the present end point XR. When XR is larger, that is, on the right side, XR is set as a new right end point XRM in step S209.

【0026】次にステップS211〜S217で、上記
ステップS203〜S209と同様の処理が顔面左側に
ついて行なわれる。右側における処理と相異するのは、
ステップS214で検索X座標XLがカウントダウンさ
れること、ステップS217で左側記憶端点のXLMと
今回の端点XLの小さい方、すなわちより左側にある方
が新たな左端点XLMとされる点である。
Next, in steps S211 to S217, the same processing as steps S203 to S209 is performed on the left side of the face. The difference with the processing on the right side is that
In step S214, the search X coordinate XL is counted down, and in step S217, the left-side storage endpoint XLM and the current endpoint XL, whichever is smaller, that is, the one on the left side is the new left-end point XLM.

【0027】一つの走査ラインで左右端が検出され、ス
テップS221で走査終了フラグOKL、OKRの両方
がセットされたと判断された場合は、ステップS222
でこのフラグがクリアされた後、ステップS223で走
査ラインのY座標値がインクリメントされて、この処理
を終了する。
If the left and right ends of one scanning line are detected and it is determined in step S221 that both scanning end flags OKL and OKR have been set, step S222 is performed.
After this flag is cleared at, the Y coordinate value of the scanning line is incremented at step S223, and this processing ends.

【0028】以上により、顔面の片側から外光が射し込
んだりして顔画像の輪郭線に連続性がなくなったときに
も、安定部の有無と連続画素数の変化状況から、顔輪郭
線の連続性を確認して顔の左右端が特定される。また、
2値化画像において画像の中央から左右へ走査して白色
画素の連続により顔の左右端を検出するので、背景が白
でなくても必ず顔面をとらえることができ、適格な検出
を行なうことができる。
As described above, even when external light is radiated from one side of the face and the continuity of the contour line of the face image is lost, the face contour line is determined from the presence or absence of the stable portion and the change in the number of continuous pixels. The left and right edges of the face are identified by confirming the continuity of. Also,
In the binarized image, the left and right edges of the face are detected by scanning from the center of the image to the left and right and the white pixels are continuous, so the face can be captured without fail even if the background is not white, and proper detection can be performed. it can.

【0029】メインフローのステップS6およびS6’
における眼球存在領域縦幅の設定過程は黒領域2点の検
索処理と、眼鏡の有無検索処理との二つに分かれる。黒
領域2点の検索処理では、左眼に関して、図10のよう
に、鼻の穴の黒い部分の検出を避けるため左側眼球存在
領域の右側X座標X2 から10ドット左側、すなわちX
2 −10を始点とし、この位置から横方向(X方向)に
X2 −90までの範囲について、検索開始のY座標YL
から0の間を縦方向上方へ走査され、これが横方向4ド
ットの間隔で実行される。Y座標YLは顔の左右端を決
定した走査ラインの下方に設定される。また、右眼に関
しても同様に右側眼球存在領域の左側X座標XX1 から
10ドット右側、すなわちXX1 +10を始点とし、こ
の位置から横方向(X方向)にXX1 +90までの範囲
について、Y座標YLから0の間を縦方向上方へ走査さ
れ、これが横方向4ドットの間隔で実行される。
Steps S6 and S6 'of the main flow
The process of setting the vertical width of the eyeball existence region in 2 is divided into two processes, a search process for two black regions and a process for searching for the presence or absence of glasses. In the search processing of two black regions, as to the left eye, as shown in FIG. 10, in order to avoid detection of the black portion of the nostril, from the right X coordinate X2 of the left eyeball existing region to the left side of 10 dots, that is, X.
Starting from 2-10, the Y coordinate YL of the search start in the range from this position to X2-90 in the lateral direction (X direction)
From 0 to 0 is scanned vertically upward, and this is executed at intervals of 4 dots in the horizontal direction. The Y coordinate YL is set below the scan line that determines the left and right edges of the face. Also for the right eye, similarly, 10 dots to the right of the left X coordinate XX1 of the right eyeball existence area, that is, XX1 +10 is the starting point, and the range from this position to the lateral direction (X direction) XX1 +90 is from the Y coordinate YL. Scanning is performed vertically between 0, and this is executed at intervals of 4 dots in the horizontal direction.

【0030】この眼球存在領域縦幅の設定過程の詳細な
流れが図11、図12、図13に示される。まず、ステ
ップS301において、1番目と2番目の黒領域のぞれ
ぞれ最高点を示すY座標の最大値のメモリ変数BY1M
AXおよびBY2MAXの値が0にクリアされ、X方向
の検出範囲規定カウンタXCHECKがX2 −10に、
またY方向の検索範囲規定カウンタYCHECKがYL
に初期化される。
The detailed flow of the process of setting the vertical width of the eyeball existing region is shown in FIGS. 11, 12 and 13. First, in step S301, the memory variable BY1M of the maximum value of the Y coordinate indicating the highest point of each of the first and second black areas.
The values of AX and BY2MAX are cleared to 0, and the X-direction detection range defining counter XCHECK is set to X2-10,
Also, the Y-direction search range defining counter YCHECK is set to YL.
Is initialized to.

【0031】そして、ステップS302で、X方向の検
索範囲規定カウンタXCHECKがX2 −90以下か否
かが調べられる。これはX方向へすべて検索したか否か
を判別するものである。まだX方向全ての検索を終了し
ていない間はステップS303に進み、1番目の黒領域
を検出したことを示すフラグFL1、連続黒色画素カウ
ンタBLACK、連続白色画素カウンタWHITE、1
番目の黒領域と2番目の黒領域との間隔が10ドット以
上あることを示すフラグWHITEFLおよび1番目の
黒領域と2番目の黒領域のそれぞれの最大値記憶バッフ
ァBY1およびBY2がクリアされる。
Then, in step S302, it is checked whether or not the search range defining counter XCHECK in the X direction is X2 -90 or less. This is to determine whether or not all searches have been performed in the X direction. While the search in all X directions has not been completed, the process proceeds to step S303, and a flag FL1 indicating that the first black area is detected, a continuous black pixel counter BLACK, a continuous white pixel counter WHITE, 1
A flag WHITEFL indicating that the interval between the second black area and the second black area is 10 dots or more and the maximum value storage buffers BY1 and BY2 of the first black area and the second black area are cleared.

【0032】つぎに、ステップS304で検索画素が黒
か否かがチェックされ、黒の場合はステップS305で
連続白色画素カウンタWHITEがクリアされ、ステッ
プS306で連続黒色画素カウンタBLACKがカウン
トアップされる。そして、ステップS307において、
連続黒色画素カウンタBLACKのカウント値が1であ
るか否かがチェックされる。ここでは黒画素の検出が初
めてかを判断している。カウント値が1のときは、ステ
ップS308で、Y方向の検索範囲規定カウンタYCH
ECKでカウントされた現Y座標が、黒領域の最下点Y
座標候補として、SETYに記憶される。すなわち、図
10中に「1」で示されるY座標が記憶されることにな
る。
Then, in step S304, it is checked whether or not the search pixel is black. If black, the continuous white pixel counter WHITE is cleared in step S305, and the continuous black pixel counter BLACK is counted up in step S306. Then, in step S307,
It is checked whether or not the count value of the continuous black pixel counter BLACK is 1. Here, it is determined whether or not the black pixel has been detected for the first time. When the count value is 1, in step S308, the search range defining counter YCH in the Y direction
The current Y coordinate counted by ECK is the lowest point Y of the black area.
It is stored in SETY as a coordinate candidate. That is, the Y coordinate indicated by "1" in FIG. 10 is stored.

【0033】つぎに、ステップS309で、連続黒色画
素カウンタBLACKのカウント値が2以上か否かがチ
ェックされる。カウント値が2以上のときは、ステップ
S310に進んで1番目の黒領域検出フラグFL1がセ
ットされているか否かが調べられる。フラグFL1がセ
ットされていないときは、ステップS311へ進み、1
番目の黒領域の最大値記憶バッファBY1にSETYの
値が代入されて保管され、フラグFL1がセットされ
る。それからステップS328においてY座標YCがカ
ウントダウンされ、走査ライン上一つ上の画素の検索に
移る。
Next, in step S309, it is checked whether the count value of the continuous black pixel counter BLACK is 2 or more. When the count value is 2 or more, the routine proceeds to step S310, where it is checked whether or not the first black area detection flag FL1 is set. If the flag FL1 is not set, the process proceeds to step S311 and 1
The value of SETY is substituted and stored in the maximum value storage buffer BY1 of the th black area, and the flag FL1 is set. Then, in step S328, the Y coordinate YC is counted down, and the process moves to the search for the pixel immediately above on the scanning line.

【0034】ステップS310でフラグFL1がセット
されている場合には、ステップS312へ進んで、フラ
グWHITEFLがセットされているか否かがチェック
され、1番目の黒領域と2番目の黒領域との間隔が10
ドット以上あるかどうかが調べられる。そして、フラグ
WHITEFLがセットされているときは2番目の黒領
域を検出したことになるので、ステップS313におい
て2番目の黒領域の最大値記憶バッファBY2にSET
Yの値が代入されて保管される。すなわち、図10中に
「2」で示されるY座標が保管されることになる。
If the flag FL1 is set in step S310, the flow advances to step S312 to check whether the flag WHITEFL is set or not, and check the interval between the first black area and the second black area. Is 10
It is checked whether there are more dots. Then, when the flag WHITEFL is set, it means that the second black area has been detected. Therefore, in step S313, SET is set in the maximum value storage buffer BY2 of the second black area.
The value of Y is substituted and stored. That is, the Y coordinate indicated by "2" in FIG. 10 is stored.

【0035】ステップS312でフラグWHITEFL
がセットされていない場合には、1番目の黒領域と2番
目の黒領域の間隔が狭く両者の差が明確でないとして、
ステップS314へ進み、黒画素の連続数が50ドット
を越えるか否かが調べられる。連続黒色画素カウンタB
LACKのカウント値が50を越えているときは、頭髪
を検出したものとして、ステップS315においてバッ
ファBY2がクリアされる。50ドットを越えていない
場合はステップS328へ進んで、Y座標YCのカウン
トダウンにより一つ上の画素の検索に移る。
In step S312, the flag WHITEFL is set.
If is not set, the gap between the first black area and the second black area is narrow and the difference between the two is not clear,
In step S314, it is checked whether the number of consecutive black pixels exceeds 50 dots. Continuous black pixel counter B
When the ACK count value exceeds 50, it is determined that the hair is detected, and the buffer BY2 is cleared in step S315. If the number of dots does not exceed 50 dots, the process advances to step S328 to count down the Y-coordinate YC and search for a pixel one level above.

【0036】前記ステップS304において検索画素が
白であるときには、ステップS316へ進んで連続黒色
画素カウンタBLACKがクリアされた後、ステップS
317で1番目の黒領域検出フラグFL1がセットされ
ているか否かがチェックされる。そして、フラグFL1
がセットされていないときは、未だ黒領域が一つも検出
されていないため、ステップS328を経て、一つ上の
画素の検索に移る。フラグFL1がセットされている場
合にはステップS318へ進み、連続白色画素カウンタ
WHITEがカウントアップされる。
If the search pixel is white in step S304, the process advances to step S316 to clear the continuous black pixel counter BLACK, and then to step S304.
At 317, it is checked whether the first black area detection flag FL1 is set. Then, the flag FL1
When is not set, no black area has been detected yet, and therefore, the process moves to step S328 to search for the pixel one level above. If the flag FL1 is set, the process proceeds to step S318, and the continuous white pixel counter WHITE is incremented.

【0037】次のステップS319では白色画素が10
ドット以上連続したか否かが調べられ、10ドット以上
連続しているときは眼と眉の間か、あるいは眼鏡フレー
ムと目の間を検出したものとして、ステップS320で
フラグWHITEFLがセットされる。さらに次のステ
ップS321で、白色画素が80ドット以上連続したか
否かが調べられ、80ドット以上連続した場合は、眉毛
が検出されず額を検出したものとして、ステップS32
2で2番目の黒領域の最大値記憶バッファBY2がクリ
アされる。
In the next step S319, the number of white pixels is 10
It is checked whether or not dots are consecutive, and if 10 dots or more are consecutive, it is determined that the area between the eye and the eyebrow or the area between the eyeglass frame and the eye is detected, and the flag WHITEFL is set in step S320. Further, in the next step S321, it is checked whether or not the white pixels are continuous for 80 dots or more. If the white pixels are continuous for 80 dots or more, it is determined that the eyebrows are not detected and the forehead is detected, and step S32 is performed.
At 2, the maximum value storage buffer BY2 of the second black area is cleared.

【0038】白色画素が80ドット以上連続していない
場合、あるいはステップS319で白色画素が10ドッ
ト以上連続していない場合には、ステップS328へ進
んでY座標YCのカウントダウンにより走査ライン上一
つ上の画素の検索に移る。
When the white pixels are not continuous for 80 dots or more, or when the white pixels are not continuous for 10 dots or more in step S319, the process proceeds to step S328, and the Y coordinate YC is counted down to move up one line on the scanning line. Move to search for pixel.

【0039】一方、1番目と2番目の黒領域の候補点と
してそれぞれのバッファBY1およびBY2の値が得ら
れると、ステップS323、S324において、バッフ
ァBY1の値と今までに記憶された1番目の黒領域の最
下点を示す最大値BY1MAXとが比較され、より大き
い方の値がBY1MAXとして記憶される。続いてステ
ップS325、S326において、バッファBY2の値
と今までに記憶された2番目の黒領域の最大値BY2M
AXとが比較され、より大きい方の値がBY2MAXと
して記憶される。例えば、図10においては中央部の
「1」のY座標がBY1MAXとして記憶され、右側の
「2」のY座標がBY2MAXとして記憶されることに
なる。このようにして、1番目の黒領域の最下点BY1
MAXと2番目の黒領域の最下点BY2MAXが決定さ
れる。ステップS301〜S326が発明の黒領域検出
手段を構成している。
On the other hand, when the values of the buffers BY1 and BY2 are obtained as the candidate points of the first and second black areas, respectively, in steps S323 and S324, the value of the buffer BY1 and the first value stored so far are stored. The maximum value BY1MAX indicating the lowest point of the black area is compared, and the larger value is stored as BY1MAX. Then, in steps S325 and S326, the value of the buffer BY2 and the maximum value BY2M of the second black area stored so far are stored.
AX is compared and the larger value is stored as BY2MAX. For example, in FIG. 10, the Y coordinate of "1" at the center is stored as BY1MAX, and the Y coordinate of "2" on the right side is stored as BY2MAX. In this way, the lowest point BY1 of the first black area
MAX and the lowest point BY2MAX of the second black area are determined. Steps S301 to S326 form the black area detecting means of the invention.

【0040】つぎに、眼鏡の有無の検索処理の過程に移
る。ここでは、上記の黒領域の検索において少なくも1
番目の黒領域が検出された走査ラインが発生すると、そ
の走査ラインすなわち縦方向の検索が終了する毎に、今
度は画面中央部の鼻部分をカバーする領域について横方
向に延びる走査ラインが設定されて、眼鏡を表わす黒領
域の存否が検索される。
Next, the process of searching for the presence / absence of glasses will be described. Here, in the above black area search, at least 1
When the scan line in which the th black area is detected occurs, a scan line extending in the horizontal direction is set for the area covering the nose portion in the center of the screen each time the scan line, that is, the vertical search is completed. Then, the presence or absence of the black area representing the glasses is searched.

【0041】まずステップS329において、2番目の
黒領域の最大値記憶バッファBY2に値が入っているか
否かがチェックされ、その状況に応じて眼鏡検出のY座
標BYHが求められる。すなわち、2番目の黒領域の最
大値記憶バッファBY2に値がなく、1番目の黒領域の
最大値記憶バッファBY1のみが値を持っている場合
は、ステップ330で、 BYH=BY1+10 とされる。2番目の黒領域の最大値記憶バッファBY2
に値があるときは、ステップS331で、 BYH=
(BY1+BY2)/2 とされる。なおこの式では、BYHをBY1とBY2の
中間点としているが、BY1とBY2の間に位置する点
であれば任意である。
First, in step S329, it is checked whether or not a value is stored in the maximum value storage buffer BY2 of the second black area, and the Y coordinate BYH for spectacles detection is obtained according to the situation. That is, when the maximum value storage buffer BY2 of the second black area has no value and only the maximum value storage buffer BY1 of the first black area has a value, BYH = BY1 + 10 is set in step 330. Maximum value storage buffer BY2 of the second black area
If there is a value in step S331, BYH =
(BY1 + BY2) / 2. In this equation, BYH is the midpoint between BY1 and BY2, but it is arbitrary as long as it is a point located between BY1 and BY2.

【0042】この後、ステップS332において、黒色
画素の数をカウントする黒色画素カウンタBLACKX
がクリアされ、ステップS333、S334で画素座標
に初期値XC=X2 、YC=BYHが設定される。次に
ステップS335で、画素J(XC,YC)が黒である
か否かが調べられる。黒の場合はステップ336で黒色
画素カウンタBLACKXがカウントアップされた後、
また黒でないときはそのまま、ステップ337に進む。
ステップ337では、画素座標が左側眼球存在領域にお
いてはXC=X2 からカウントアップされる。ステップ
S338で、図14のように、画素Jが横方向(X方
向)にXX1 を越えるまで検索したかがチェックされ、
XCがXX1 を越えるまで横方向走査ライン上の画素検
索が繰り返される。
Thereafter, in step S332, a black pixel counter BLACKX for counting the number of black pixels.
Is cleared, and initial values XC = X2 and YC = BYH are set to the pixel coordinates in steps S333 and S334. Next, in step S335, it is checked whether the pixel J (XC, YC) is black. In the case of black, after the black pixel counter BLACKX is counted up in step 336,
If it is not black, the process proceeds to step 337 as it is.
In step 337, the pixel coordinates are counted up from XC = X2 in the left eyeball existing area. In step S338, as shown in FIG. 14, it is checked whether or not the pixel J has been searched until it exceeds XX1 in the horizontal direction (X direction).
The pixel search on the horizontal scan line is repeated until XC exceeds XX1.

【0043】1本の走査ラインの検索が終了すると、ス
テップS339において、黒色画素カウンタBLACK
Xの値が3より小さいか否かがチェックされ、黒色画素
カウンタBLACKXの値が3未満のときは、眼鏡中央
部のフレームが検出されたものとして、ステップS34
0において眼鏡無しカウンタMEGOFFがカウントア
ップされる。
When the search for one scanning line is completed, in step S339, the black pixel counter BLACK.
It is checked whether the value of X is less than 3, and if the value of the black pixel counter BLACKX is less than 3, it is determined that the frame of the central portion of the glasses has been detected, and step S34
At 0, the glassesless counter MEGOFF is incremented.

【0044】これが、X軸方向検索範囲内のすべての縦
方向走査ラインの検索が終わることに伴なって終了する
と、ステップS341において、眼鏡無しカウンタME
GOFFの値が5を越えているか否かが調べられる。眼
鏡無しカウンタMEGOFFの値が5より大きいとき
は、眼鏡をかけていないものとして、ステップS342
に進む。ステップS342では、1番目に検出した黒領
域のY座標の最下点BY1MAXを基準にして、眼球存
在領域の縦幅を規定する上下のY座標YT、YBが、 YT=BY1MAX−40 YB=BY1MAX+10 に設定される。
When this ends with the end of the search for all the vertical scanning lines within the X-axis direction search range, in step S341, the glasses-free counter ME.
It is checked whether the value of GOFF exceeds 5. If the value of the glasses-free counter MEGOFF is greater than 5, it is determined that the glasses are not worn, and step S342 is performed.
Proceed to. In step S342, the upper and lower Y coordinates YT and YB defining the vertical width of the eyeball existing region are YT = BY1MAX-40 YB = BY1MAX + 10 with reference to the lowest point BY1MAX of the Y coordinate of the first detected black region. Is set to.

【0045】また、眼鏡無しカウンタMEGOFFの値
が5より小さい場合には、眼鏡をかけているものとし
て、ステップS343に進む。ここでは2番目に検出し
た黒領域のY座標の最下点BY2MAXを基準にして、
眼球存在領域のY座標が、 YT=BY2MAX−40 YB=BY2MAX+10 に設定される。
If the value of the glasses-free counter MEGOFF is smaller than 5, it is determined that glasses are worn, and the process proceeds to step S343. Here, based on the lowest point BY2MAX of the Y coordinate of the second detected black region,
The Y coordinate of the eyeball existing region is set to YT = BY2MAX-40 YB = BY2MAX + 10.

【0046】以上の処理が右側眼球存在領域の縦幅設定
においても同様に行なわれる。その際、眼鏡の有無の検
索処理では検索開始の初期値がXC=XX1 とされ、ス
テップ337ではXC=XX1 からカウントダウンさ
れ、逆方向にXCがX2 を下回るまで画素検索が繰り返
されることになる。
The above processing is similarly performed when setting the vertical width of the right eyeball existing region. At that time, in the search process for the presence / absence of glasses, the initial value of the search start is set to XC = XX1, and in step 337, the count down from XC = XX1 is performed, and the pixel search is repeated in the opposite direction until XC falls below X2.

【0047】以上のように、縦幅設定では、2点の黒領
域を有する範囲を探索することとし、横に4ドット毎に
僅か20回の縦方向走査を行なうだけで済むから眼球存
在領域の設定が短時間になされる。さらに、髪その他か
ら影響を受けず画像変化のほとんどない眉から下の部分
に絞って検索を行うようにしたから、帽子を被っている
ような場合でも眼球存在領域の特定が正確にできる。
As described above, in the vertical width setting, a range having two black areas is searched for, and it is only necessary to perform vertical scanning every four dots horizontally 20 times. Settings are made in a short time. Furthermore, since the search is focused on the lower part of the eyebrow that is not affected by hair or the like and has little image change, the eyeball existing region can be accurately specified even when the user wears a hat.

【0048】次に、このようにして設定された眼球存在
領域におけるステップS7の眼球検出の詳細について説
明する。ここでは、左側の眼球存在領域については、眼
球存在領域の右側X座標X2 から横方向(X方向)にX
1 までを範囲として、検索開始のY座標YBから縦方向
上方(Y方向)にYB−50まで検索され、これが横方
向1ドット毎に繰り返される。また、右側眼球存在領域
についても、眼球存在領域左側X座標XX1 からXX2
までを範囲として、同様に検索される。この流れの過程
が図15、図16に示される。
Next, the details of the eyeball detection in step S7 in the eyeball existing area thus set will be described. Here, for the eyeball existing area on the left side, X is set in the lateral direction (X direction) from the right side X coordinate X2 of the eyeball existing area.
Within the range of 1 up to YB-50 in the vertical direction (Y direction) from the Y coordinate YB at the start of the search, this is repeated for each dot in the horizontal direction. As for the right eyeball existence area, the left X coordinates XX1 to XX2 of the eyeball existence area are also included.
The range is up to and the same search is performed. The process of this flow is shown in FIGS.

【0049】まず、ステップS401において、X方向
の検索範囲の規定カウンタXECHECKがX2 に、Y
方向の検索範囲規定カウンタYECHECKがYBに初
期化され、最大連続黒色画素数BLACKEMAXがク
リアされる。次に、ステップS402でX方向の検索範
囲規定カウンタXECHECKがX1 より小さいか否か
がチェックされる。これはX方向についてすべて検索が
終了したか否かを判別するものである。X方向全ての検
索が終了していない間は、ステップS403に進んで、
新たなX軸の検索の前に連続黒色画素を検出したことを
示すフラグEBFL、連続白色画素を検出したことを示
すフラグEWFL、連続黒色画素カウンタBLACK
E、連続白色画素カウンタWHITEEがクリアされ
る。
First, in step S401, the prescribed counter XECHECK of the search range in the X direction is set to X2, and Y is set to Y.
The direction search range defining counter YECHECK is initialized to YB, and the maximum continuous black pixel number BLACKEMAX is cleared. Next, in step S402, it is checked whether or not the X range search range defining counter XECHECK is smaller than X1. This is to determine whether or not the search has been completed for all X directions. While the search in all X directions is not completed, the process proceeds to step S403,
A flag EBFL indicating that a continuous black pixel has been detected before a new X-axis search, a flag EWFL indicating that a continuous white pixel has been detected, and a continuous black pixel counter BLACK.
E, the continuous white pixel counter WHITE is cleared.

【0050】次のステップS421で、Y軸の検索初期
画素が白色か否かがチェックされる。ここで画素が黒色
の場合は、髪などが眼球存在領域内に入っているものと
し、そのライン上でのY方向検索が中止され、ステップ
S418を経て、次のX軸の検索に移る。検索初期画素
が白色のときはステップ404に進んで、連続白色画素
のフラグがセットされているかどうか調べられる。いま
初期設定でフラグEWFLがセットされていないとき
は、該当するドットが黒色画素か白色画素かのチェック
ステップS405を経て、ステップ412に進み、連続
黒色画素のフラグEBFLのセットの有無がチェックさ
れる。
In the next step S421, it is checked whether the search initial pixel on the Y-axis is white. If the pixel is black, it is assumed that hair or the like is inside the eyeball existing area, the Y-direction search on that line is stopped, and the process proceeds to the next X-axis search via step S418. When the search initial pixel is white, the routine proceeds to step 404, where it is checked whether the continuous white pixel flag is set. If the flag EWFL is not set in the initial setting, the process proceeds to step 412 through a check step S405 of whether the corresponding dot is a black pixel or a white pixel, and it is checked whether or not the flag EBFL of continuous black pixels is set. .

【0051】フラグEBFLがセットされていないと
き、ステップS416で連続白色画素カウンタWHIT
EEがカウントアップされる。そして、このカウント値
により連続白色画素数が30を越えるまでは毎回連続黒
色画素カウンタBLACKEをクリアしながらステップ
S417、S420、S419でY方向上方のドットへ
走査が継続された後、ステップ418を経て次のX軸方
向のライン、すなわち横隣りのラインの検索に移る。
When the flag EBFL is not set, the continuous white pixel counter WHIT is determined in step S416.
EE is counted up. Then, until the number of continuous white pixels exceeds 30 by this count value, the continuous black pixel counter BLACK is cleared every time while scanning is continued to the dots in the upper Y direction in steps S417, S420, and S419, and then step 418 is performed. The process moves to the search for the next line in the X-axis direction, that is, the horizontally adjacent line.

【0052】新しいラインに移って、ステップS405
でドットが黒色画素のときには、ステップS406に進
んで連続白色画素カウンタWHITEEがクリアされ、
また、ステップS407で連続黒色画素カウンタBLA
CKEがカウントアップされる。この後、ステップS4
08、S409において、BLACKEのカウント値が
2を越していればフラグEBFLがセットされて、1つ
上の画素に移る。これは2ドット以下の黒色画素のノイ
ズを除こうとするものである。
Moving to a new line, step S405
If the dot is a black pixel, the process advances to step S406 to clear the continuous white pixel counter WHITE,
Further, in step S407, the continuous black pixel counter BLA
CKE is counted up. After this, step S4
In S08 and S409, if the count value of BLACK exceeds 2, the flag EBFL is set and the pixel moves up one pixel. This is intended to remove noise from black pixels of 2 dots or less.

【0053】ステップS412でフラグEBFLがセッ
トされているときには、ステップS413で連続白色画
素カウンタWHITEEがカウントアップされる。この
後、ステップS414、S415において、WHITE
Eのカウント値が5以上になったときはフラグEWFL
がセットされ、5未満の場合はセットされないままでス
テップS419に進む。
When the flag EBFL is set in step S412, the continuous white pixel counter WHITEE is incremented in step S413. After that, in steps S414 and S415, the WHITE
When the count value of E becomes 5 or more, the flag EWFL
Is set, and if it is less than 5, the process proceeds to step S419 without being set.

【0054】ステップ404でフラグEWFLがセット
されている場合は、ステップS410に進んで、連続黒
色画素カウンタBLACKEのカウント値と最大連続黒
色画素数BLACKEMAXとが比較される。ここでX
軸の現在のライン上でカウントされたBLACKEがB
LACKEMAXより多いときには、ステップS411
でBLACKEMAXにBLACKEの値が入れられ、
またBLACKEがBLACKEMAXより少ない場合
にはBLACKEMAXはそのままで、次の横隣りの検
索に移る。
If the flag EWFL is set in step 404, the process proceeds to step S410, and the count value of the continuous black pixel counter BLACKE is compared with the maximum continuous black pixel number BLACKEMAX. Where X
BLACK counted on the current line of the axis is B
When it is larger than LACKEMAX, step S411
Then the value of BLACKE is put into BLACKEMAX,
If BLACK is less than BLACKEMAX, BLACKEMAX is left as it is and the process moves to the next horizontal search.

【0055】次に上記の流れにおけるとくにステップS
404以降の動作を、図17に例示した眼球存在領域内
の走査線イ〜ヘの場合について説明する。 (1)走査線「イ」の場合 走査線「イ」が眼球存在領域における最初の走査線であ
るとして、連続白色画素のフラグEWFLはセットされ
ていないから、ステップS404からステップS405
に進み、ここで該当するドットが黒色画素か白色画素か
が調べられる。ここで画素が白色であるから、ステップ
S412へ進む。さらに、連続黒色画素のフラグEBF
Lもセットされていないため、ステップS412からス
テップS416に進んで、連続白色画素カウンタWHI
TEEがスタートされる。
Next, particularly step S in the above flow.
The operation after 404 will be described for the case of scanning lines a to f in the eyeball existing region illustrated in FIG. (1) In the case of the scanning line “a” Since the scanning line “a” is the first scanning line in the eyeball existing region, the flag EWFL of the continuous white pixels is not set, and thus steps S404 to S405.
Then, it is checked whether the corresponding dot is a black pixel or a white pixel. Since the pixel is white here, the process proceeds to step S412. Furthermore, the flag EBF of continuous black pixels
Since L is not set either, the flow advances from step S412 to step S416 to set the continuous white pixel counter WHI.
TEE is started.

【0056】次に、連続白色画素数が30個を越えるま
で、ステップS417からステップS419経由ステッ
プ404へ戻りY座標を上方へカウントダウンが繰り返
される。連続白色画素数が30個を越えると、眼球存在
領域の上縁までY座標が走査されていなくても、ステッ
プ417からステップS418へ進んでX軸上次のライ
ンの検索に移る。ステップS417では白色画素が相当
数以上連続した後に現れる黒色画素は眼である可能性が
低く、眉や髪などになるため、これをカウントしないよ
うにするため30個を上限としたものである。なお、
「イ」の走査線の検索では最大連続黒色画素数はBLA
CKEMAX=0のままで、この数値が更新されること
はない。
Next, the process returns from step S417 to step S419 to step 404 until the number of continuous white pixels exceeds 30, and the Y coordinate is repeatedly counted down. When the number of continuous white pixels exceeds 30, even if the Y coordinate is not scanned up to the upper edge of the eyeball existing region, the process proceeds from step 417 to step S418 to search for the next line on the X axis. In step S417, black pixels that appear after a considerable number of consecutive white pixels are unlikely to be eyes, and may be eyebrows or hair. Therefore, 30 pixels are set as the upper limit so as not to be counted. In addition,
The maximum number of continuous black pixels is BLA in the scan line search for "a".
This value is never updated while CKEMAX = 0 remains unchanged.

【0057】(2)走査線「ロ」の場合 新たなX軸のラインとして走査線「ロ」の検索に移る
と、ステップS403でフラグEBFL、EWFL、お
よびカウンタBLACKE、WHITEEがクリアされ
てから、ステップS404に進む。このため走査線
「イ」のときと同じくステップS405、ステップS4
12、ステップS416を経てステップS417に進
み、WHITEEをカウントアップしながら走査線を上
方へ検索が繰り返される。
(2) Case of scanning line "B" When the scanning line "B" is searched for as a new X-axis line, the flags EBFL and EWFL and the counters BLACKE and WHITEE are cleared in step S403. It proceeds to step S404. Therefore, as in the case of the scanning line "a", steps S405 and S4 are performed.
12. After step S416, the process proceeds to step S417, and the search for the scanning line is repeated while counting up WHITE.

【0058】この走査線上では、連続白色画素数が30
を越える前に黒色画素が現われ、これに対応して、ステ
ップ405からステップS406に移り、ここで連続白
色画素カウンタWHITEEがクリアされる。次のステ
ップS407で連続黒色画素カウンタBLACKEのカ
ウントアップがスタートされ、黒色画素が連続する限り
このカウントアップが継続される。この間ステップS4
08、S409で、3ドット以上の黒色画素が連続した
場合、ノイズではないとしてフラグEBFLがセットさ
れる。
On this scanning line, the number of continuous white pixels is 30.
A black pixel appears before exceeding, and correspondingly, the process moves from step 405 to step S406, where the continuous white pixel counter WHITEE is cleared. In the next step S407, the count-up of the continuous black pixel counter BLACKE is started, and this count-up is continued as long as the black pixels are continuous. During this period, step S4
In S08 and S409, when three or more black pixels are consecutive, the flag EBFL is set because it is not noise.

【0059】黒色画素の連続が途切れたとき、ステップ
S405からまたステップS412へ移る。ここではフ
ラグEBFLがセットされているため、ステップS41
3に進んで連続白色画素カウンタWHITEEがスター
トされ、S419でY座標をカウントダウンしつつすな
わち走査線上方へ、白色画素が連続する間WHITEE
のカウントアップが繰り返される。そして、白色画素の
連続数が5個以上になると、ステップS414、S41
5でフラグEWFLがセットされる。
When the continuity of black pixels is interrupted, the process moves from step S405 to step S412. Since the flag EBFL is set here, step S41
3, the continuous white pixel counter WHITEE is started, and while counting down the Y coordinate in S419, that is, above the scanning line, while the white pixels continue, WHITEEE
The count-up is repeated. Then, when the number of consecutive white pixels becomes 5 or more, steps S414 and S41.
At 5, the flag EWFL is set.

【0060】以上により、眼球存在領域における縦方向
(Y方向)走査線のスタートから白色画素連続のあと、
眼の部分にあたる黒色画素の連続が認められ、その後、
眼の上に所定数の白色画素連続を確認することで、連続
黒色画素数が眼の縦方向の大きさとして求められる。フ
ラグEWFLがセットされた後は、ステップS419を
経て次のY座標に移ったとき今度はステップS404か
らステップS410に進む。ステップS410ではステ
ップS407で先にカウントされたBLACKEの連続
黒色画素数と最大連続黒色画素数BLACKEMAXと
が比較される。
As described above, after the start of the scanning line in the vertical direction (Y direction) in the eyeball presence region, after the continuation of white pixels,
A series of black pixels corresponding to the eye area was observed, and then
By confirming a predetermined number of continuous white pixels on the eye, the number of continuous black pixels is obtained as the size of the eye in the vertical direction. After the flag EWFL is set, when the process moves to the next Y coordinate through step S419, this time the process proceeds from step S404 to step S410. In step S410, the number of consecutive black pixels of BLACK counted in step S407 and the maximum number of consecutive black pixels BLACKEMAX are compared.

【0061】走査線「ロ」ではじめて連続黒色画素が現
われたとすれば、BLACKEMAX=0であったか
ら、ステップS411に進んでBLACKEのカウント
値がBLACKEMAXに入れられる。
If continuous black pixels appear for the first time on the scanning line "B", since BLACKEMAX = 0, the process advances to step S411, and the count value of BLACKE is put into BLACKEMAX.

【0062】(3)走査線「ハ」の場合 走査線「ハ」は、夜間やトンネル内など環境光線がスト
ロボの赤外線のみのときの画像を2値化したときによく
見られる現象で、虹彩部が白くなった部分を通るライン
である。基本的な流れは走査線「ロ」の場合と同様であ
るが、ここでは連続黒色画素が確認され、連続黒色画素
カウンタBLACKEのカウントアップ中に、眼の部分
の黒色画素がまだ続くにも係わらず、虹彩部の白色画素
によりBLACKEのカウントが中断され、ステップS
405からS412、S413へ進む。
(3) In the case of the scanning line "C" The scanning line "C" is a phenomenon that is often seen when binarizing an image when the ambient light is only infrared rays of the strobe, such as at night or in a tunnel, and is an iris. It is a line that passes through the white part. The basic flow is the same as in the case of the scanning line "b", but here, continuous black pixels are confirmed, and during the count-up of the continuous black pixel counter BLACKE, the black pixels in the eye part still continue. The count of BLACKE is interrupted by the white pixels in the iris,
From 405, the process proceeds to S412 and S413.

【0063】ここで虹彩部の白色画素について連続白色
画素カウンタWHITEEのカウントアップが開始され
るが、虹彩部では白色画素が5個を越える前に再び黒色
画素に変わるので、フラグEWFLがセットされること
なく、ステップS419からステップS405〜S40
7に戻って、中断されていた連続黒色画素のカウントア
ップが再開される。この後、眼の上に至って白色画素が
確認されたあとは走査線「ロ」のときと同一の処理とな
る。
Here, the continuous white pixel counter WHITEE starts counting up for the white pixels in the iris portion, but since the number of white pixels in the iris portion is changed to black pixels before the number of white pixels exceeds 5, the flag EWFL is set. Without steps S419 to S405 to S40
Returning to 7, the counting up of the interrupted continuous black pixels is restarted. After that, after the white pixel is confirmed on the eye and the white pixel is confirmed, the same processing as that for the scanning line "b" is performed.

【0064】(4)走査線「ニ」の場合 走査線「ロ」のときと流れは全く同一であるが、黒色画
素の連続数がより多くなってステップS407における
BLACKEのカウント値が大きい。これにより、眼の
上の連続白色画素の確認後ステップS410、S411
において、BLACKEの値が最大連続黒色画素数BL
ACKEMAXの値としてメモリされる。
(4) In the case of scanning line "d" The flow is exactly the same as in the case of scanning line "b", but the number of consecutive black pixels increases and the count value of BLACKE in step S407 is large. As a result, after the continuous white pixels on the eyes are confirmed, steps S410 and S411 are performed.
In, the value of BLACK is the maximum number of consecutive black pixels BL
It is stored as the value of ACKEMAX.

【0065】(5)走査線「ホ」の場合 走査線「ホ」は、眼部分を通らず、眉や髪などの黒色部
分を切るラインである。眉や髪などの黒色画素は少なく
とも眼の下にあることはなく、走査線上の検索が開始さ
れると、白色画素が繰り返し検出される。この結果、ス
テップS417で連続白色画素数が30個を越えてしま
うから、この走査線上での検索は中止され、次の横隣り
の走査線の検索に移る。
(5) In the case of scanning line "e" The scanning line "e" is a line that does not pass through the eye part and cuts the black part such as eyebrows and hair. Black pixels such as eyebrows and hair are not at least under the eyes, and when the search on the scanning line is started, white pixels are repeatedly detected. As a result, since the number of continuous white pixels exceeds 30 in step S417, the search on this scan line is stopped and the process moves to the search for the next horizontally adjacent scan line.

【0066】(6)走査線「ヘ」の場合 この走査線は眼球存在領域の左端部の髪部分を通る。こ
こでは連続黒色画素数が非常に多くなり、この連続黒色
画素の上方に連続白色画素は現れない。したがって、フ
ラグEBFLがセットされた後ステップS405からS
412へ分岐することがないから、フラグEWFLがセ
ットされることもない。この結果、髪による連続黒色画
素数が多くなっても、ステップS404からS410へ
進むことがなく、最大連続黒色画素数BLACKEMA
Xの数値の置き換えは行なわれない。このため、走査線
ヘ上の連続黒色画素が眼球と誤認識されることはない。
(6) In the case of the scanning line "F": This scanning line passes through the hair portion at the left end of the eyeball existing region. Here, the number of continuous black pixels is very large, and continuous white pixels do not appear above the continuous black pixels. Therefore, after the flag EBFL is set, steps S405 to S405 are performed.
Since there is no branch to 412, the flag EWFL is not set either. As a result, even if the number of continuous black pixels due to hair increases, the process does not proceed from step S404 to S410, and the maximum number of continuous black pixels BLACKEMA
The value of X is not replaced. Therefore, continuous black pixels on the scanning line are not erroneously recognized as an eyeball.

【0067】以上のようにして、眼球存在領域の横幅の
全域にわたって全ての走査線の検索を終了すると、最大
連続黒色画素数BLACKEMAXが眼球の縦方向(Y
方向)の大きさとして求められる。上記のフローではB
LACKEMAXが開眼、閉眼に係わらず検出される。
As described above, when the search for all the scanning lines is completed over the entire width of the eyeball existing region, the maximum number of black pixels BLACKEMAX becomes the vertical direction of the eyeball (Y
Direction). B in the above flow
LACKEMAX is detected regardless of whether the eyes are open or closed.

【0068】次に、前記の処理で検出された眼球データ
を用いた居眠り検出のフローが図18に示される。これ
はメインフローのステップS8およびS9に該当する。
前述のようにステップS1でタイマがスタートされたあ
と、画像の1フレーム毎に先のステップS7とくにその
なかのステップS411で、眼球データとして最大連続
黒色画素数BLACKEMAXが求められる。これを受
けて、ステップS501で、新たなフレームのデータを
得る毎にBLACKEMAXの最大値MAXと最小値M
INが更新記憶される。ステップS502でタイマスタ
ート後5分が経過したことが確認された後、ステップS
503で、最大連続黒色画素数のMAX値とMIN値を
基に、開閉眼のしきい値が設定される。なお、上記の時
間5分は、顔画像撮影のタイミングも考慮しまばたきに
よる閉眼状態の画像を確実に取り込むための時間として
設定されている。そして上記しきい値との比較により、
ステップS504において開閉眼の別が検出され、この
開閉眼のパターンによってステップS505で居眠り状
態の判定が行なわれる。
Next, FIG. 18 shows a flow of drowsiness detection using the eyeball data detected by the above processing. This corresponds to steps S8 and S9 of the main flow.
As described above, after the timer is started in step S1, the maximum continuous black pixel number BLACKEMAX is obtained as eyeball data for each frame of the image in step S7, particularly step S411 among them. In response to this, in step S501, the maximum value MAX and the minimum value M of BLACKEMAX are obtained each time new frame data is obtained.
IN is updated and stored. After confirming that 5 minutes have elapsed after the timer was started in step S502,
At 503, the threshold value of the open / closed eye is set based on the MAX value and the MIN value of the maximum number of continuous black pixels. Note that the above-mentioned time of 5 minutes is set as a time for surely capturing an image in an eye-closed state by blinking in consideration of the timing of capturing a face image. And by comparison with the above threshold,
Whether the eye is open or closed is detected in step S504, and the dozing state is determined in step S505 based on the pattern of the open / closed eye.

【0069】開閉眼検出処理は車両の運転中繰り返し実
行され、ステップS505では所定時間以上連続して閉
眼が検出されたとき居眠り状態にあると判定される。す
なわち図19に示されるように、時間軸上黒点で示され
る間隔で1フレームの顔画像が撮影入力され、各フレー
ムについての開閉眼検出の結果、閉眼状態が継続して所
定個数、例えば3フレーム以上続いているときに、運転
者は居眠り状態にあると判定される。
The open / closed eye detection process is repeatedly executed during the driving of the vehicle. In step S505, it is determined that the subject is in a dozing state when the closed eyes are continuously detected for a predetermined time or more. That is, as shown in FIG. 19, a face image of one frame is photographed and input at intervals indicated by black dots on the time axis, and as a result of eye open / closed detection for each frame, the eye closed state continues for a predetermined number, for example, 3 frames. When the above continues, it is determined that the driver is in a dozing state.

【0070】本実施例によれば、眼球存在領域内を縦方
向に走査して連続黒色画素を検索することによって眼球
を検出するようにしたから、開眼状態か閉眼状態かにか
かわらず確実に眼球が検出される。そして、上記眼球存
在領域を設定するに際して、その横幅については顔の左
右別個にその端点を求めるようにしたので、運転者の顔
の向きによって赤外線ストロボの照射画像に影ができる
場合でも、左右いずれかに眼球存在領域が確実に設定さ
れその影響が排除される。また、縦幅設定の際も、2点
の黒領域を有する範囲を探索することとし、しかも横に
は数ドット間隔で縦方向走査を行なうようにしたから、
僅かな走査で済み眼球存在領域の設定が短時間になされ
る。 さらに、髪その他から影響を受けず画像変化のほ
とんどない眉から下の部分に絞って検索を行うから、帽
子を被っているような場合でも眼球存在領域の特定が正
確にでき、居眠りの判定精度が高い。しかも上述のとお
り、顔面の左右を各々独立に検索するから、顔面の片側
の端が外光の影響で検出されないときでも、反対側の端
は検出される。したがって左右いずれかの眼球存在領域
が確実に設定される。
According to the present embodiment, the eyeball is detected by scanning the inside of the eyeball region in the vertical direction and searching for continuous black pixels. Therefore, the eyeball can be reliably detected regardless of whether the eyeball is open or closed. Is detected. Then, when setting the eyeball presence area, since the end points of the lateral width of the face are determined separately for the lateral width, even if a shadow is formed in the infrared strobe irradiation image depending on the driver's face orientation, either the left or right The region where the eyeball is present is reliably set and its influence is eliminated. Also, when setting the vertical width, the range having two black areas is searched, and the vertical scanning is performed at intervals of several dots in the horizontal direction.
The setting of the eyeball existing area can be made in a short time with a slight scan. Furthermore, since the search is narrowed down to the lower part of the eyebrow that is not affected by hair and other factors and has little image change, the eyeball presence area can be accurately identified even when the person is wearing a hat, and the accuracy of drowsiness determination can be determined. Is high. Moreover, as described above, since the right and left sides of the face are independently searched, even when the edge on one side of the face is not detected due to the influence of outside light, the edge on the opposite side is detected. Therefore, one of the left and right eyeball existence regions is surely set.

【0071】[0071]

【発明の効果】以上のとおり、本発明は2値化された画
像の眼球存在領域内を縦方向に走査して連続黒色画素を
検索することによって眼球を検出する眼球検出手段を設
け、開閉眼検出手段では検出された眼球の連続黒色画素
の数に基づいて運転者の開閉眼を判別するようにしたか
ら、開眼状態か閉眼状態かにかかわらず確実に眼球が検
出される効果を有する。しかも開閉眼の判別のための処
理時間が、虹彩円形部を求めその面積から判断するもの
に比べて大幅に短縮される。
As described above, according to the present invention, the eyeball detecting means for detecting the eyeball by scanning the inside of the eyeball existing region of the binarized image in the vertical direction to search for continuous black pixels is provided. Since the detection means discriminates the open / closed eyes of the driver based on the number of consecutive black pixels of the detected eyeball, it has an effect of surely detecting the eyeball regardless of whether the eyeball is open or closed. Moreover, the processing time for discriminating the open / closed eye is significantly shortened as compared with the case where the iris circular portion is obtained and the area is discriminated.

【0072】またとくに、眼球存在領域の横方向位置
を、横方向走査する連続白色画素数計数手段、安定部検
出手段、輪郭線連続性判断手段および顔端特定手段とを
有する横幅設定手段により顔の横方向端とするもので
は、確実に眼部分を含むことができる。そして、縦幅
を、黒領域検出手段で検出した2点の黒領域を基準とす
る縦幅設定手段により設定するときには、この黒領域検
出が僅かな走査で済むから眼球存在領域の設定が短時間
になされる。さらにその過程で髪部分などを除外するこ
とができるから、眼球存在領域の特定が正確にできると
いう利点がある。また開閉眼検出手段が眼球存在領域の
縦方向連続黒色画素の最大数の、複数の画像における最
大値と最小値をもとにしきい値を設定すると、環境光線
の状況や運転者毎の眼の大きさにばらつきがあっても、
常に開閉眼が容易に識別できるという効果がある。
Further, in particular, the lateral position of the eyeball existing region is laterally scanned by the lateral width setting means having a continuous white pixel number counting means, a stable part detecting means, a contour line continuity determining means and a face edge specifying means. With the lateral end of, the eye part can be surely included. Then, when the vertical width is set by the vertical width setting means based on the two black areas detected by the black area detecting means, the black area detection can be performed with a slight scan, so that the setting of the eyeball existing area is short. Done Furthermore, since the hair part and the like can be excluded in the process, there is an advantage that the eyeball existing region can be accurately specified. Further, if the open / closed eye detection means sets the threshold value based on the maximum value and the minimum value in the plurality of images in the maximum number of vertical continuous black pixels in the eyeball existing region, the situation of the environmental light ray and the eyes of each driver Even if there are variations in size,
There is an effect that the open / closed eye can always be easily identified.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of the present invention.

【図2】実施例の構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of an example.

【図3】入力画像の座標系を示す説明図である。FIG. 3 is an explanatory diagram showing a coordinate system of an input image.

【図4】実施例の全体の動作のメインフローを示すフロ
ーチャートである。
FIG. 4 is a flowchart showing a main flow of the overall operation of the embodiment.

【図5】眼球存在領域の横幅設定の流れを示すフローチ
ャートである。
FIG. 5 is a flowchart showing a flow of setting a width of an eyeball existing region.

【図6】眼球存在領域の横幅設定の流れを示すフローチ
ャートである。
FIG. 6 is a flowchart showing a flow of setting a lateral width of an eyeball existing region.

【図7】横幅設定における画像走査の説明図である。FIG. 7 is an explanatory diagram of image scanning in horizontal width setting.

【図8】横幅設定時の連続白色画素数計数の流れを示す
フローチャートである。
FIG. 8 is a flowchart showing the flow of counting the number of continuous white pixels when setting the width.

【図9】横幅設定時の連続白色画素数計数の流れを示す
フローチャートである。
FIG. 9 is a flowchart showing the flow of counting the number of continuous white pixels when setting the width.

【図10】眼球存在領域の縦幅設定における画像走査の
説明図である。
FIG. 10 is an explanatory diagram of image scanning in setting the vertical width of the eyeball existing region.

【図11】横幅設定の流れを示すフローチャートであ
る。
FIG. 11 is a flowchart showing a flow of width setting.

【図12】横幅設定の流れを示すフローチャートであ
る。
FIG. 12 is a flowchart showing a flow of width setting.

【図13】横幅設定の流れを示すフローチャートであ
る。
FIG. 13 is a flowchart showing a flow of width setting.

【図14】眼鏡の有無検索における画像走査の説明図で
ある。
FIG. 14 is an explanatory diagram of image scanning in the presence / absence search of glasses.

【図15】眼球検出の流れを示すフローチャートであ
る。
FIG. 15 is a flowchart showing a flow of eyeball detection.

【図16】眼球検出の流れを示すフローチャートであ
る。
FIG. 16 is a flowchart showing a flow of eyeball detection.

【図17】眼球存在領域内走査線の説明図である。FIG. 17 is an explanatory diagram of scanning lines in an eyeball existing area.

【図18】開閉眼検出の処理を示すフローチャートであ
る。
FIG. 18 is a flowchart showing the processing of opening / closing eye detection.

【図19】居眠り判定の説明図である。FIG. 19 is an explanatory diagram of a doze determination.

【図20】入力画像の例を示す図である。FIG. 20 is a diagram showing an example of an input image.

【符号の説明】[Explanation of symbols]

CL1 画像入力手段 CL2 2値化手段 CL3 眼球存在領域設定手段 CL4 眼球検出手段 CL5 開閉眼検出手段 CL6 運転者状態判定手段 1 赤外ストロボ 3 TVカメラ 5 タイミング指令回路 7 A/D変換器 9 画像メモリ 11 眼球存在位置規定回路 13 眼球検出回路 15 開閉眼判別回路 17 居眠り判定回路 19 警報回路 CL1 image input means CL2 binarization means CL3 eyeball area setting means CL4 eyeball detection means CL5 open / closed eye detection means CL6 driver state determination means 1 infrared strobe 3 TV camera 5 timing command circuit 7 A / D converter 9 image memory 11 eyeball existence position regulation circuit 13 eyeball detection circuit 15 open / closed eye determination circuit 17 dozing determination circuit 19 alarm circuit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 運転者の顔画像を入力する画像入力手段
と、該画像入力手段から入力された顔画像を2値化する
2値化手段と、2値化された画像内で眼球存在領域を定
める眼球存在領域設定手段と、前記眼球存在領域内で縦
方向の連続黒色画素に基づいて眼球を検出する眼球検出
手段と、検出された眼球の前記連続黒色画素の数に基づ
いて運転者の開閉眼を検出する開閉眼検出手段と、該開
閉眼検出手段で検出された開閉眼のパターンに基づいて
運転者の状態を判定する運転者状態判定手段とを備えた
ことを特徴とする運転者の状態検出装置。
1. An image input means for inputting a face image of a driver, a binarizing means for binarizing the face image input from the image input means, and an eyeball existence region in the binarized image. The eyeball existing area setting means for defining, eyeball detecting means for detecting the eyeball based on the continuous black pixels in the vertical direction in the eyeball existing area, and the driver based on the number of the continuous black pixels of the detected eyeball. A driver comprising: an open / closed eye detecting means for detecting the open / closed eye; and a driver state determining means for determining the driver's state based on the pattern of the open / closed eye detected by the open / closed eye detecting means. State detection device.
【請求項2】 前記眼球存在領域設定手段は、横幅設定
手段と縦幅設定手段とからなり、横幅設定手段は、前記
画像を横方向へ走査し連続白色画素数を計数する連続白
色画素数計数手段と、前記連続白色画素数の変化量から
前記画像の横方向端の安定部を検出する安定部検出手段
と、該安定部の有無および前記連続白色画素数の変化量
とから顔の輪郭線の連続性を判断する輪郭線連続性判断
手段と、前記連続性判断に基づいて顔の横方向端を特定
する顔端特定手段とを有して、特定された前記顔の横方
向端を眼球存在領域の横幅を規定する端点とし、縦幅設
定手段は、前記横幅設定手段で設定された横幅内で、前
記画像を下方位置から縦方向に走査し2点の黒領域を検
出する黒領域検出手段を有して、検出された黒領域を基
準にして眼球存在領域の縦方向の位置を設定するもので
あることを特徴とする請求項1記載の運転者の状態検出
装置。
2. The eyeball existing area setting means comprises a width setting means and a height setting means, and the width setting means scans the image in the horizontal direction to count the number of continuous white pixels. Means, a stable portion detecting means for detecting a stable portion at the lateral edge of the image from the change amount of the continuous white pixel number, a presence / absence of the stable portion, and a change amount of the continuous white pixel number, and a contour line of the face. The contour edge continuity determining means for determining the continuity of the face and the face edge identifying means for identifying the lateral edge of the face based on the continuity determination, and the lateral edge of the identified face is detected by the eyeball. With the end point defining the horizontal width of the existing area, the vertical width setting means scans the image vertically from the lower position within the horizontal width set by the horizontal width setting means to detect two black areas. Means for controlling the presence of the eyeball based on the detected black area. 2. The driver's state detection device according to claim 1, wherein the vertical position of the zone is set.
【請求項3】前記開閉眼検出手段は、前記連続黒色画素
の最大数の、複数の画像における最大値と最小値をもと
に設定されるしきい値を基準にして、画像ごとの前記連
続黒色画素の最大数を比較して開閉眼を検出することを
特徴とする請求項1または2記載の運転者の状態検出装
置。
3. The open / closed eye detection means uses the maximum number of the continuous black pixels as a reference to set a threshold value based on a maximum value and a minimum value in a plurality of images, and the continuous image for each image. The driver's state detection device according to claim 1 or 2, wherein the open / closed eyes are detected by comparing the maximum number of black pixels.
【請求項4】 前記運転者状態判定手段は、前記開閉眼
検出手段で検出された閉眼状態が所定時間以上継続した
とき運転者が異常状態にあると判定するものであること
を特徴とする請求項1、2または3記載の運転者の状態
検出装置。
4. The driver state determination means determines that the driver is in an abnormal state when the eye closed state detected by the open / closed eye detection means continues for a predetermined time or more. Item 1. The driver state detection device according to item 1 or 2.
JP21378092A 1992-07-18 1992-07-18 Driver status detection device Expired - Fee Related JP2822799B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21378092A JP2822799B2 (en) 1992-07-18 1992-07-18 Driver status detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21378092A JP2822799B2 (en) 1992-07-18 1992-07-18 Driver status detection device

Publications (2)

Publication Number Publication Date
JPH0632154A true JPH0632154A (en) 1994-02-08
JP2822799B2 JP2822799B2 (en) 1998-11-11

Family

ID=16644921

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21378092A Expired - Fee Related JP2822799B2 (en) 1992-07-18 1992-07-18 Driver status detection device

Country Status (1)

Country Link
JP (1) JP2822799B2 (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19613614A1 (en) * 1995-05-10 1996-11-14 Mitsubishi Electric Corp Image of face processing apparatus
DE19603287A1 (en) * 1995-07-06 1997-01-09 Mitsubishi Electric Corp Face imaging device
DE19614975A1 (en) * 1995-07-28 1997-01-30 Mitsubishi Electric Corp Facial image processing system
US5788795A (en) * 1992-05-27 1998-08-04 Plastisign Limited Of Unit 6 Apparatus for cold laminating rigid plastics and stationery
JPH1166304A (en) * 1997-08-12 1999-03-09 Mitsubishi Electric Corp Face image processor
US5926251A (en) * 1997-08-12 1999-07-20 Mitsubishi Denki Kabushiki Kaisha Eye image tracking apparatus
JP2000105830A (en) * 1998-09-29 2000-04-11 Oki Electric Ind Co Ltd Individual identifying device
KR100295849B1 (en) * 1997-12-17 2001-11-22 이계안 Device and method for preventing sleep driving
KR100575713B1 (en) * 2002-11-18 2006-05-03 엘지전자 주식회사 Sleepiness detection method using mobile communication device having camera
US7209574B2 (en) 2003-01-31 2007-04-24 Fujitsu Limited Eye tracking apparatus, eye tracking method, eye state judging apparatus, eye state judging method and computer memory product
KR100716370B1 (en) * 2005-09-15 2007-05-11 현대자동차주식회사 Driver eye detecting method
JP2008129901A (en) * 2006-11-22 2008-06-05 Aisin Seiki Co Ltd Glasses detection device, image processor, glasses detection method and computer program
US7466847B2 (en) 2004-04-13 2008-12-16 Denso Corporation Driver's appearance recognition system
EP2009577A1 (en) 2007-06-29 2008-12-31 Canon Kabushiki Kaisha Image-processing apparatus and method, program, and storage medium
US8208035B2 (en) 2008-08-07 2012-06-26 Canon Kabushiki Kaisha Image sensing apparatus, image capturing method, and program related to face detection
US8350918B2 (en) 2008-08-05 2013-01-08 Canon Kabushiki Kaisha Image capturing apparatus and control method therefor
US8879802B2 (en) 2010-12-01 2014-11-04 Canon Kabushiki Kaisha Image processing apparatus and image processing method

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5788795A (en) * 1992-05-27 1998-08-04 Plastisign Limited Of Unit 6 Apparatus for cold laminating rigid plastics and stationery
JPH08300978A (en) * 1995-05-10 1996-11-19 Mitsubishi Electric Corp Face image processor
DE19613614A1 (en) * 1995-05-10 1996-11-14 Mitsubishi Electric Corp Image of face processing apparatus
DE19613614C2 (en) * 1995-05-10 1999-10-21 Mitsubishi Electric Corp Device for processing an image of a face
DE19603287C2 (en) * 1995-07-06 1999-07-01 Mitsubishi Electric Corp Face imaging device
DE19603287A1 (en) * 1995-07-06 1997-01-09 Mitsubishi Electric Corp Face imaging device
US5801763A (en) * 1995-07-06 1998-09-01 Mitsubishi Denki Kabushiki Kaisha Face image taking device
US5805720A (en) * 1995-07-28 1998-09-08 Mitsubishi Denki Kabushiki Kaisha Facial image processing system
DE19614975C2 (en) * 1995-07-28 2000-01-13 Mitsubishi Electric Corp Facial image processing system
DE19614975A1 (en) * 1995-07-28 1997-01-30 Mitsubishi Electric Corp Facial image processing system
JPH1166304A (en) * 1997-08-12 1999-03-09 Mitsubishi Electric Corp Face image processor
US5926251A (en) * 1997-08-12 1999-07-20 Mitsubishi Denki Kabushiki Kaisha Eye image tracking apparatus
KR100295849B1 (en) * 1997-12-17 2001-11-22 이계안 Device and method for preventing sleep driving
JP2000105830A (en) * 1998-09-29 2000-04-11 Oki Electric Ind Co Ltd Individual identifying device
KR100575713B1 (en) * 2002-11-18 2006-05-03 엘지전자 주식회사 Sleepiness detection method using mobile communication device having camera
US7209574B2 (en) 2003-01-31 2007-04-24 Fujitsu Limited Eye tracking apparatus, eye tracking method, eye state judging apparatus, eye state judging method and computer memory product
US7466847B2 (en) 2004-04-13 2008-12-16 Denso Corporation Driver's appearance recognition system
KR100716370B1 (en) * 2005-09-15 2007-05-11 현대자동차주식회사 Driver eye detecting method
JP2008129901A (en) * 2006-11-22 2008-06-05 Aisin Seiki Co Ltd Glasses detection device, image processor, glasses detection method and computer program
EP2009577A1 (en) 2007-06-29 2008-12-31 Canon Kabushiki Kaisha Image-processing apparatus and method, program, and storage medium
US8538091B2 (en) 2007-06-29 2013-09-17 Canon Kabushiki Kaisha Image processing apparatus and method, and storage medium
US8350918B2 (en) 2008-08-05 2013-01-08 Canon Kabushiki Kaisha Image capturing apparatus and control method therefor
US8208035B2 (en) 2008-08-07 2012-06-26 Canon Kabushiki Kaisha Image sensing apparatus, image capturing method, and program related to face detection
US8879802B2 (en) 2010-12-01 2014-11-04 Canon Kabushiki Kaisha Image processing apparatus and image processing method

Also Published As

Publication number Publication date
JP2822799B2 (en) 1998-11-11

Similar Documents

Publication Publication Date Title
JP2522859B2 (en) Eye position detection device
JP2541688B2 (en) Eye position detection device
JP2822799B2 (en) Driver status detection device
JP2500726B2 (en) Method and apparatus for detecting upper eyelid region, inner corner of eye, outer corner of eye, upper eyelid region and eye structure
US20020181774A1 (en) Face portion detecting apparatus
JP3143819B2 (en) Eyelid opening detector
JPH0944685A (en) Face image processor
KR100617777B1 (en) Apparatus and method for detecting driver's eye image in drowsy driving warning apparatus
US20070291983A1 (en) Method of tracking a human eye in a video image
JP2000137792A (en) Eye part detecting device
JP2003150942A (en) Eye position tracing method
JP6320661B2 (en) Passenger detection device, passenger detection system, and passenger detection method
JP3395344B2 (en) Image processing device and doze alarm device using the same
JP2001043382A (en) Eye tracking device
JP2936943B2 (en) Driver status detection device
JP2836238B2 (en) Driving car eye position detection device and state detection device
JP2705388B2 (en) Driver's eye position detection device
WO2002035452A1 (en) Eye image obtaining method, iris recognizing method, and system using the same
JP2677010B2 (en) Eye position detection device
JP2932551B2 (en) Iris position detecting device and driver state detecting device
KR20110006062A (en) System and method for face recognition
JP3116674B2 (en) Driver status detection device
JP2541689B2 (en) Eye position detection device and subject state detection device
JPH04216403A (en) Detecting apparatus of position of eye
JPH03194661A (en) Device for detecting driver's state

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980804

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

Free format text: PAYMENT UNTIL: 20080904

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20090904

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20100904

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees