CN109934199A - A method and system for driver fatigue detection based on computer vision - Google Patents
A method and system for driver fatigue detection based on computer vision Download PDFInfo
- Publication number
- CN109934199A CN109934199A CN201910221692.5A CN201910221692A CN109934199A CN 109934199 A CN109934199 A CN 109934199A CN 201910221692 A CN201910221692 A CN 201910221692A CN 109934199 A CN109934199 A CN 109934199A
- Authority
- CN
- China
- Prior art keywords
- driver
- fatigue
- detection
- face
- yawning
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 158
- 238000000034 method Methods 0.000 title claims abstract description 26
- 206010048232 Yawning Diseases 0.000 claims abstract description 103
- 241001282135 Poromitra oscitans Species 0.000 claims abstract description 75
- 238000000605 extraction Methods 0.000 claims abstract description 5
- 210000001508 eye Anatomy 0.000 claims description 154
- 108010001267 Protein Subunits Proteins 0.000 claims 1
- 238000007689 inspection Methods 0.000 claims 1
- 230000009466 transformation Effects 0.000 claims 1
- 230000004397 blinking Effects 0.000 abstract description 19
- 238000007781 pre-processing Methods 0.000 abstract description 5
- 206010016256 fatigue Diseases 0.000 description 131
- 238000004364 calculation method Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 11
- 210000001747 pupil Anatomy 0.000 description 7
- 230000001815 facial effect Effects 0.000 description 6
- 230000004399 eye closure Effects 0.000 description 4
- 230000006399 behavior Effects 0.000 description 3
- 206010039203 Road traffic accident Diseases 0.000 description 2
- 230000003542 behavioural effect Effects 0.000 description 2
- 238000003708 edge detection Methods 0.000 description 2
- 210000005252 bulbus oculi Anatomy 0.000 description 1
- 230000034994 death Effects 0.000 description 1
- 231100000517 death Toxicity 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 210000000744 eyelid Anatomy 0.000 description 1
- 230000008921 facial expression Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Landscapes
- Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)
Abstract
本发明公开了一种基于计算机视觉的驾驶员疲劳检测方法及系统。首先调用摄像头采集驾驶员脸部视频;之后通过类Harr特征的AdaBoost分类器算法定位人脸;然后利用landmark进行眨眼和打哈欠的检测提示疲劳;最后通过图片预处理定位人眼并依据PERCLOS算法准则判断疲劳进行预警。本发明结合PERCLOS人眼检测算法和人脸关键点提取算法对驾驶员进行疲劳预警,具有非接触性和实时性,不会对驾驶员正常驾驶产生干扰,使疲劳检测更加准确、高效、快捷。
The invention discloses a method and system for detecting driver fatigue based on computer vision. First, the camera is called to collect the driver's face video; then the face is located through the AdaBoost classifier algorithm of Harr-like features; then the landmark is used to detect blinking and yawning to indicate fatigue; finally, the human eye is located through image preprocessing and according to the PERCLOS algorithm criteria Judging fatigue for early warning. The invention combines the PERCLOS human eye detection algorithm and the face key point extraction algorithm to perform fatigue warning for the driver, has non-contact and real-time performance, does not interfere with the normal driving of the driver, and makes the fatigue detection more accurate, efficient and fast.
Description
技术领域technical field
本发明涉及图像检测技术领域,特别是涉及一种基于计算机视觉的驾驶员疲劳检测方法及系统。The invention relates to the technical field of image detection, in particular to a method and system for detecting driver fatigue based on computer vision.
背景技术Background technique
据交通部门统计,近年来因道路交通事故死亡人数持续增高,机动车司机疲劳驾驶是引发交通事故的一个重要原因,不少专家学者正积极研究检测疲劳驾驶的方法,如何有效预防疲劳驾驶成为国内外研究的热点。According to the statistics of the traffic department, the number of deaths due to road traffic accidents has continued to increase in recent years. Fatigue driving of motor vehicle drivers is an important cause of traffic accidents. Many experts and scholars are actively studying the methods of detecting fatigue driving, and how to effectively prevent fatigue driving has become a domestic issue. hotspots of foreign research.
传统的基于生理信号和行为特征的驾驶员行为检测算法都有其优势及缺陷。其中基于生理信号特征的检测算法具有较高的精度,但由于传感器与驾驶员接触,影响驾驶;基于行为特征的检测算法不需要驾驶人直接接触检测装置,并且在汽车现有装置的基础上对设备需求较低,实用性很强,但检测精度不高。Traditional driver behavior detection algorithms based on physiological signals and behavioral characteristics have their advantages and disadvantages. Among them, the detection algorithm based on physiological signal features has high accuracy, but it affects driving due to the contact between the sensor and the driver; the detection algorithm based on behavioral features does not require the driver to directly contact the detection device, and based on the existing device of the car, The equipment requirements are low and the practicability is strong, but the detection accuracy is not high.
发明内容SUMMARY OF THE INVENTION
本发明的目的是提供一种基于计算机视觉的驾驶员疲劳检测方法及系统,以解决现有驶员疲劳检测方法无法兼顾非接触性和检测精度的问题。The purpose of the present invention is to provide a method and system for detecting driver fatigue based on computer vision, so as to solve the problem that the existing method for detecting driver fatigue cannot take into account both non-contact and detection accuracy.
为实现上述目的,本发明提供了如下方案:For achieving the above object, the present invention provides the following scheme:
一种基于计算机视觉的驾驶员疲劳检测方法,所述方法包括:A method for detecting driver fatigue based on computer vision, the method comprising:
获取预设时间段内驾驶员的脸部视频;Get the driver's face video within a preset time period;
采用人脸检测分类器训练所述脸部视频,生成多帧人脸图片;Use a face detection classifier to train the face video to generate multiple frames of face pictures;
根据所述人脸图片进行眨眼和打哈欠的检测,生成疲劳危险提示信息;Perform blinking and yawning detection according to the face picture, and generate fatigue danger prompt information;
根据所述人脸图片和所述疲劳危险提示信息,采用PERCLOS算法检测驾驶员的疲劳状态,生成疲劳状态判断结果;According to the face picture and the fatigue danger prompt information, the PERCLOS algorithm is used to detect the fatigue state of the driver, and the fatigue state judgment result is generated;
若所述疲劳状态判断结果为驾驶员处于疲劳状态,生成疲劳驾驶报警信息进行报警;If the fatigue state judgment result is that the driver is in a fatigue state, generating fatigue driving alarm information to give an alarm;
若所述疲劳状态判断结果为驾驶员未处于疲劳状态,返回所述获取预设时间段内驾驶员的脸部视频的步骤。If the fatigue state determination result is that the driver is not in the fatigue state, returning to the step of acquiring the driver's face video within the preset time period.
可选的,所述根据所述人脸图片进行眨眼和打哈欠的检测,生成疲劳危险提示信息,具体包括:Optionally, the detection of blinking and yawning is performed according to the face picture, and the fatigue danger prompt information is generated, which specifically includes:
采用人脸识别预测器提取所述人脸图片上的68个人脸特征点;所述68个人脸特征点包括对应眼部轮廓的眼部特征点和对应嘴巴轮廓的嘴部特征点;The face recognition predictor is used to extract 68 face feature points on the face picture; the 68 face feature points include eye feature points corresponding to eye contours and mouth feature points corresponding to mouth contours;
根据所述眼部特征点进行眨眼检测,生成眨眼检测结果;Blink detection is performed according to the eye feature points to generate a blink detection result;
根据所述嘴部特征点进行打哈欠检测,生成打哈欠检测结果;Perform yawn detection according to the mouth feature points to generate a yawn detection result;
根据所述眨眼检测结果和所述打哈欠检测结果生成疲劳危险提示信息。Fatigue danger prompt information is generated according to the blink detection result and the yawn detection result.
可选的,所述根据所述眼部特征点进行眨眼检测,生成眨眼检测结果,具体包括:Optionally, performing blink detection according to the eye feature points to generate a blink detection result specifically includes:
根据所述眼部特征点计算每帧人脸图片中人眼的眼睛睁开度;Calculate the eye opening degree of the human eye in each frame of the human face picture according to the eye feature points;
若连续两帧所述人脸图片中所述眼睛睁开度均小于睁开度阈值,将眨眼次数加1;If the eye opening degrees in the face pictures in two consecutive frames are both less than the opening degree threshold, add 1 to the number of blinks;
若一分钟内所述眨眼次数超过20次,确定所述眨眼检测结果为眨眼次数超过眨眼预警值。If the number of blinks in one minute exceeds 20 times, it is determined that the blink detection result is that the number of blinks exceeds the blink warning value.
可选的,所述根据所述嘴部特征点进行打哈欠检测,生成打哈欠检测结果,具体包括:Optionally, the yawning detection is performed according to the mouth feature points to generate a yawning detection result, which specifically includes:
根据所述嘴部特征点计算每帧人脸图片中嘴巴的张口度;Calculate the mouth opening degree of the mouth in each frame of the face picture according to the mouth feature points;
判断多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数是否超过帧数阈值,获得打哈欠检测结果;Judging whether the number of consecutive frames in which the mouth opening degree is greater than the threshold of the mouth opening degree in the multiple frames of the face pictures exceeds the threshold of the number of frames, and obtains a yawn detection result;
若多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数超过帧数阈值,确定所述打哈欠检测结果为驾驶员存在打哈欠动作;If the number of consecutive frames in which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face pictures exceeds the frame number threshold, it is determined that the yawning detection result is that the driver has a yawning action;
若多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数未超过帧数阈值,确定所述打哈欠检测结果为驾驶员不存在打哈欠动作。If the number of consecutive frames in which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face picture does not exceed the frame number threshold, it is determined that the yawning detection result is that the driver does not yawn.
可选的,所述根据所述眨眼检测结果和所述打哈欠检测结果生成疲劳危险提示信息,具体包括:Optionally, generating fatigue danger prompt information according to the blink detection result and the yawn detection result specifically includes:
若所述眨眼检测结果为眨眼次数超过眨眼预警值,或者所述打哈欠检测结果为驾驶员存在打哈欠动作,则生成疲劳危险提示信息;If the blink detection result is that the number of blinks exceeds the blink warning value, or the yawn detection result is that the driver has a yawning action, generating fatigue danger prompt information;
根据所述疲劳危险提示信息对驾驶员进行疲劳危险提示。According to the fatigue risk prompt information, a fatigue risk prompt is performed to the driver.
可选的,所述根据所述人脸图片和所述疲劳危险提示信息,采用PERCLOS算法检测驾驶员的疲劳状态,生成疲劳状态判断结果,具体包括:Optionally, the PERCLOS algorithm is used to detect the fatigue state of the driver according to the face picture and the fatigue danger prompt information, and generate a fatigue state judgment result, which specifically includes:
采用模式匹配算法对所述人脸图片中的人眼进行粗定位,得到左眼和右眼的眼部图片;Use a pattern matching algorithm to roughly locate the human eyes in the face picture, and obtain the eye pictures of the left eye and the right eye;
对所述眼部图片进行预处理,生成预处理后的眼部图像;Preprocessing the eye image to generate a preprocessed eye image;
采用霍夫变换圆检测算法对所述预处理后的眼部图像中的人眼进行精确定位,生成人眼精确位置图像;The Hough transform circle detection algorithm is used to accurately locate the human eye in the preprocessed eye image to generate an image of the precise position of the human eye;
根据所述人眼精确位置图像计算单位时间内眼睛闭合的百分比PERCLOS;Calculate the percentage of eye closure PERCLOS per unit time according to the image of the precise position of the human eye;
若所述PERCLOS超过80%,确定所述疲劳状态判断结果为驾驶员处于疲劳状态;If the PERCLOS exceeds 80%, determine that the fatigue state judgment result is that the driver is in a fatigue state;
若所述PERCLOS未超过80%,确定所述疲劳状态判断结果为驾驶员未处于疲劳状态。If the PERCLOS does not exceed 80%, it is determined that the fatigue state judgment result is that the driver is not in a fatigue state.
一种基于计算机视觉的驾驶员疲劳检测系统,所述系统包括:A computer vision-based driver fatigue detection system, the system includes:
脸部视频获取模块,用于获取预设时间段内驾驶员的脸部视频;A face video acquisition module, used to acquire the driver's face video within a preset time period;
人脸图片生成模块,用于采用人脸检测分类器训练所述脸部视频,生成多帧人脸图片;a face picture generation module, used for training the face video by using a face detection classifier to generate multiple frames of face pictures;
眨眼及打哈欠检测模块,用于根据所述人脸图片进行眨眼和打哈欠的检测,生成疲劳危险提示信息;A blinking and yawning detection module is used to detect blinking and yawning according to the face picture, and generate fatigue danger prompt information;
疲劳状态检测模块,用于根据所述人脸图片和所述疲劳危险提示信息,采用PERCLOS算法检测驾驶员的疲劳状态,生成疲劳状态判断结果;The fatigue state detection module is used for detecting the fatigue state of the driver by using the PERCLOS algorithm according to the face picture and the fatigue danger prompt information, and generating a fatigue state judgment result;
疲劳报警模块,用于若所述疲劳状态判断结果为驾驶员处于疲劳状态,生成疲劳驾驶报警信息进行报警;A fatigue alarm module, configured to generate fatigue driving alarm information for alarming if the fatigue state judgment result is that the driver is in a fatigue state;
循环检测模块,用于若所述疲劳状态判断结果为驾驶员未处于疲劳状态,返回所述获取预设时间段内驾驶员的脸部视频的步骤。The loop detection module is configured to return to the step of obtaining the driver's face video within a preset time period if the fatigue state judgment result is that the driver is not in the fatigue state.
可选的,所述眨眼及打哈欠检测模块具体包括:Optionally, the blinking and yawning detection module specifically includes:
人脸特征点提取单元,用于采用人脸识别预测器提取所述人脸图片上的68个人脸特征点;所述68个人脸特征点包括对应眼部轮廓的眼部特征点和对应嘴巴轮廓的嘴部特征点;A face feature point extraction unit, used for extracting 68 face feature points on the face picture by using a face recognition predictor; the 68 face feature points include eye feature points corresponding to eye contours and corresponding mouth contours mouth feature points;
眨眼检测单元,用于根据所述眼部特征点进行眨眼检测,生成眨眼检测结果;a blink detection unit, configured to perform blink detection according to the eye feature points, and generate a blink detection result;
打哈欠检测单元,用于根据所述嘴部特征点进行打哈欠检测,生成打哈欠检测结果;a yawn detection unit, configured to perform yawn detection according to the mouth feature points, and generate a yawn detection result;
疲劳危险提示信息生成单元,用于根据所述眨眼检测结果和所述打哈欠检测结果生成疲劳危险提示信息。A fatigue risk prompt information generating unit, configured to generate fatigue risk prompt information according to the blink detection result and the yawn detection result.
可选的,所述眨眼检测单元具体包括:Optionally, the blink detection unit specifically includes:
眼睛睁开度计算子单元,用于根据所述眼部特征点计算每帧人脸图片中人眼的眼睛睁开度;an eye opening degree calculation subunit, used for calculating the eye opening degree of the human eye in each frame of the face picture according to the eye feature points;
眨眼次数计算子单元,用于若连续两帧所述人脸图片中所述眼睛睁开度均小于睁开度阈值,将眨眼次数加1;A subunit for calculating the number of blinks, for adding 1 to the number of blinks if the degree of eye opening in the face pictures in two consecutive frames is less than the threshold of the opening degree;
眨眼检测结果确定子单元,用于若一分钟内所述眨眼次数超过20次,确定所述眨眼检测结果为眨眼次数超过眨眼预警值。The blink detection result determination subunit is configured to determine that the blink detection result is that the blink count exceeds the blink warning value if the blink count exceeds 20 times in one minute.
可选的,所述打哈欠检测单元具体包括:Optionally, the yawning detection unit specifically includes:
张口度计算子单元,用于根据所述嘴部特征点计算每帧人脸图片中嘴巴的张口度;The mouth opening degree calculation subunit is used to calculate the mouth opening degree of the mouth in each frame of the face picture according to the mouth feature points;
打哈欠判断子单元,用于判断多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数是否超过帧数阈值,获得打哈欠检测结果;A yawning judging subunit, configured to judge whether the number of consecutive frames in which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face pictures exceeds the frame number threshold, and obtain a yawn detection result;
打哈欠动作确定子单元,用于若多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数超过帧数阈值,确定所述打哈欠检测结果为驾驶员存在打哈欠动作;The yawning action determination subunit is used to determine that the yawning detection result is that the driver has a yawning action if the continuous frame number of which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face pictures exceeds the frame number threshold;
无打哈欠动作确定子单元,用于若多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数未超过帧数阈值,确定所述打哈欠检测结果为驾驶员不存在打哈欠动作。No yawning action determination subunit, for if the number of consecutive frames in which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face picture does not exceed the frame number threshold, it is determined that the yawning detection result is that the driver does not have a yawn. Yawning action.
根据本发明提供的具体实施例,本发明公开了以下技术效果:According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
本发明提供一种基于计算机视觉的驾驶员疲劳检测方法及系统,所述方法根据摄像机采集的驾驶员脸部视频生成多帧人脸图片,基于计算机视觉检测疲劳,具有非接触性和实时性的特点,不会对驾驶员正常驾驶产生干扰,使疲劳检测更加方便快捷;疲劳检测过程中,在准确判定驾驶员疲劳之前,先根据人脸图片进行眨眼和打哈欠的检测,根据眨眼及打哈欠检测结果对驾驶员进行疲劳危险提示,能够在驾驶员疲劳之前进行预警,有效预防危险事故发生,降低事故发生率。根据人脸图片进行疲劳危险提示后,本发明进一步采用PERCLOS算法检测驾驶员的疲劳状态,能够准确判断驾驶员是否存在疲劳驾驶行为,提高了疲劳驾驶检测精度。The invention provides a computer vision-based driver fatigue detection method and system. The method generates multiple frames of face pictures according to the driver's face video collected by the camera, detects fatigue based on computer vision, and has non-contact and real-time features. It will not interfere with the normal driving of the driver, making the fatigue detection more convenient and quick; in the fatigue detection process, before accurately determining the driver's fatigue, the blinking and yawning detection is performed according to the face picture. The detection results can prompt the driver of the danger of fatigue, which can give an early warning before the driver is fatigued, effectively prevent the occurrence of dangerous accidents, and reduce the accident rate. After the fatigue danger is prompted according to the face picture, the present invention further adopts the PERCLOS algorithm to detect the fatigue state of the driver, which can accurately determine whether the driver has fatigue driving behavior, and improves the detection accuracy of fatigue driving.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings required in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the present invention. In the embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative labor.
图1为本发明提供的基于计算机视觉的驾驶员疲劳检测方法的方法流程图;Fig. 1 is the method flow chart of the driver fatigue detection method based on computer vision provided by the present invention;
图2为本发明提供的基于计算机视觉的驾驶员疲劳检测方法的基本原理图;Fig. 2 is the basic principle diagram of the driver fatigue detection method based on computer vision provided by the present invention;
图3为本发明提供的通过landmark检测眨眼和打哈欠的原理示意图;3 is a schematic diagram of the principle of detecting blinking and yawning by landmark provided by the present invention;
图4为本发明提供的68个人脸特征点位置示意图;4 is a schematic diagram of the positions of 68 facial feature points provided by the present invention;
图5为本发明提供的对眼部图片做进一步处理的原理示意图;5 is a schematic diagram of the principle of further processing an eye picture provided by the present invention;
图6为本发明提供的通过变换圆算法对人眼进行精确查找的原理示意图;Fig. 6 is the principle schematic diagram that the human eye is accurately searched by the transform circle algorithm provided by the present invention;
图7为本发明提供的基于计算机视觉的驾驶员疲劳检测系统的系统结构图。FIG. 7 is a system structure diagram of a computer vision-based driver fatigue detection system provided by the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明的目的是提供一种基于计算机视觉的驾驶员疲劳检测方法及系统,依据人的疲劳表情机理来判定疲劳状态,采用基于landmark对驾驶员眨眼及哈欠的检测算法解决了传感器与驾驶员接触的缺陷,具有实时性和高精确度,有较高的实用性。The purpose of the present invention is to provide a computer vision-based driver fatigue detection method and system, which determines the fatigue state according to the mechanism of human fatigue expression, and adopts the landmark-based detection algorithm for the driver's blinking and yawning to solve the problem of the contact between the sensor and the driver. It has real-time and high accuracy, and has high practicability.
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.
图1为本发明提供的基于计算机视觉的驾驶员疲劳检测方法的方法流程图。图2为本发明提供的基于计算机视觉的驾驶员疲劳检测方法的基本原理图。参见图1和图2,本发明提供的基于计算机视觉的驾驶员疲劳检测方法具体包括:FIG. 1 is a method flowchart of a computer vision-based driver fatigue detection method provided by the present invention. FIG. 2 is a basic schematic diagram of a computer vision-based driver fatigue detection method provided by the present invention. 1 and 2, the computer vision-based driver fatigue detection method provided by the present invention specifically includes:
步骤101:获取预设时间段内驾驶员的脸部视频。Step 101: Acquire a face video of a driver within a preset time period.
调用摄像头,采集一段时间内驾驶员的脸部视频;所述摄像头安装在驾驶员正前方的挡风玻璃上。A camera is called to collect a video of the driver's face for a period of time; the camera is installed on the windshield directly in front of the driver.
计算机获取预设时间段内摄像头采集的驾驶员的脸部视频,基于所述脸部视频,采用基于计算机视觉的疲劳检测方法进行驾驶员疲劳检测,具有非接触性和实时性的特点,不会对驾驶员正常驾驶产生干扰,使疲劳检测更加方便快捷。The computer obtains the driver's face video collected by the camera within the preset time period, and based on the face video, the fatigue detection method based on computer vision is used to detect the driver's fatigue, which has the characteristics of non-contact and real-time, and will not It interferes with the normal driving of the driver and makes the fatigue detection more convenient and fast.
步骤102:采用人脸检测分类器训练所述脸部视频,生成多帧人脸图片。Step 102: Using a face detection classifier to train the face video to generate multiple frames of face pictures.
采用类Harr特征的AdaBoost人脸检测分类器算法,通过人脸检测分类器进行多个人脸特征训练、人脸区域识别及人脸定位,获得人脸图片。The AdaBoost face detection classifier algorithm with Harr-like features is used, and the face images are obtained by performing multiple face feature training, face region recognition and face localization through the face detection classifier.
将摄像头采集的驾驶员脸部图像输入训练好的基于Haar特征的Adaboost人脸检测分类器中,即可输出多帧人脸图片。The driver's face image collected by the camera is input into the trained Adaboost face detection classifier based on Haar feature, and then multiple frames of face pictures can be output.
步骤103:根据所述人脸图片进行眨眼和打哈欠的检测,生成疲劳危险提示信息。Step 103: Perform blinking and yawning detection according to the face picture, and generate fatigue danger prompt information.
本发明针对获得的多帧人脸图片,利用landmark进行眨眼和打哈欠的检测,图3为本发明提供的通过landmark检测眨眼和打哈欠的原理示意图。参见图3,所述步骤103具体包括:The present invention uses landmarks to detect blinking and yawning for the obtained multi-frame face pictures. FIG. 3 is a schematic diagram of the principle of detecting blinking and yawning through landmarks provided by the present invention. Referring to FIG. 3, the step 103 specifically includes:
步骤3-1、采用人脸识别预测器提取所述人脸图片上的68个人脸特征点;所述68个人脸特征点包括对应眼部轮廓的眼部特征点和对应嘴巴轮廓的嘴部特征点。Step 3-1, using a face recognition predictor to extract 68 face feature points on the face picture; the 68 face feature points include the eye feature points corresponding to the eye contour and the mouth feature corresponding to the mouth contour point.
通过调用dlib官方人脸识别预测器shape_predictor_68_face_landmarks.dat进行人脸68个特征点的标注。通过所述人脸识别预测器可以提取所述人脸图片上的68个人脸特征点,landmark就是人脸特征点。所述68个人脸特征点位置如图4所示,将68个人脸特征点按顺序标出来,得到标号为0-68的68个人脸特征点。所述68个人脸特征点中包括对应眼部轮廓的眼部特征点和对应嘴巴轮廓的嘴部特征点,如图4所示,标号36-41的6个特征点为对应右眼轮廓的眼部特征点,标号42-47的6个特征点为对应左眼轮廓的眼部特征点。标号48-57的特征点为对应嘴巴轮廓的嘴部特征点,其中标号为60-67的8个特征点为嘴巴内轮廓的特征点。By calling the dlib official face recognition predictor shape_predictor_68_face_landmarks.dat to mark the 68 feature points of the face. Through the face recognition predictor, 68 face feature points on the face picture can be extracted, and landmark is the face feature point. The positions of the 68 facial feature points are shown in Figure 4. The 68 facial feature points are marked in order to obtain 68 facial feature points labeled 0-68. The 68 face feature points include eye feature points corresponding to the contour of the eye and mouth feature points corresponding to the contour of the mouth. As shown in FIG. 4 , the six feature points labeled 36-41 are the eyes corresponding to the contour of the right eye. The six feature points marked 42-47 are the eye feature points corresponding to the left eye contour. The feature points numbered 48-57 are the feature points of the mouth corresponding to the outline of the mouth, and the 8 feature points numbered 60-67 are the feature points of the inner contour of the mouth.
步骤3-2、根据所述眼部特征点进行眨眼检测,生成眨眼检测结果。Step 3-2, performing blink detection according to the eye feature points to generate a blink detection result.
本发明利用68个landmark提取眼睛区域轮廓进行眨眼检测和眨眼次数的计算,所述步骤3-2具体包括:The present invention utilizes 68 landmarks to extract the outline of the eye region to perform blink detection and calculation of blink times. The step 3-2 specifically includes:
步骤3-2-1、设定人眼标定点,左眼开始到左眼结束,右眼开始到右眼结束,得到人脸特征点中对应眼睛的6个特征点d1,d2,d3,d4,d5,d6。例如将图3中标号为36-41的6个特征点或标号为42-47的6个特征点作为检测计算使用的6个特征点d1,d2,d3,d4,d5,d6。Step 3-2-1, set the human eye calibration point, the left eye starts to the left eye, the right eye starts to the right eye, and the six feature points d1, d2, d3, d4 corresponding to the eyes in the face feature points are obtained. ,d5,d6. For example, the six feature points labeled 36-41 in FIG. 3 or the six feature points labeled 42-47 are used as the six feature points d1, d2, d3, d4, d5, and d6 used for the detection calculation.
步骤3-2-2、根据所述眼部特征点计算每帧人脸图片中人眼的眼睛睁开度。Step 3-2-2: Calculate the eye opening degree of the human eyes in each frame of the face picture according to the eye feature points.
计算眼睛纵横比作为眼睛睁开度,计算公式为:Calculate the eye aspect ratio as the eye opening, and the calculation formula is:
式(1)中,f为眼睛睁开度,d1,d2,d3,d4,d5,d6是人脸特征点中对应眼睛的6个特征点(对应图4中标号为36-41的特征点),其中,|d2-d6|、|d3-d5|是眼睛特征点在垂直方向上的距离;|d1-d4|是眼睛特征点在水平方向上的距离,乘2以保证两组特征点的权重相同。In formula (1), f is the eye opening degree, d1, d2, d3, d4, d5, d6 are the six feature points corresponding to the eyes in the face feature points (corresponding to the feature points labeled 36-41 in Figure 4). ), where |d2-d6|, |d3-d5| are the distances of the eye feature points in the vertical direction; |d1-d4| are the distances of the eye feature points in the horizontal direction, multiplied by 2 to ensure two sets of feature points weights are the same.
当眼睛纵横比f小于睁开度阈值Radio=0.2时,连续2帧一定发生眨眼动作。本发明实施例以两种眼部状态数据为例描述睁闭眼的判断过程,如下表1所示:When the eye aspect ratio f is smaller than the opening degree threshold Radio=0.2, the blinking action must occur in two consecutive frames. This embodiment of the present invention takes two kinds of eye state data as examples to describe the process of judging whether to open or close the eyes, as shown in Table 1 below:
表1 睁闭眼时的眼睛横纵比数据Table 1 Eye aspect ratio data when eyes are opened and closed
步骤3-2-3、若连续两帧所述人脸图片中所述眼睛睁开度均小于睁开度阈值,将眨眼次数加1;Step 3-2-3, if the eye opening degrees in the face pictures in two consecutive frames are both less than the opening degree threshold, add 1 to the number of blinks;
当小于睁开度阈值的图片帧数超过两帧时,即发生了眨眼动作;每眨眼一次计数值加1,从而出计算眨眼次数,由此作为疲劳危险提示指标。When the number of picture frames less than the threshold of opening degree exceeds two frames, the blinking action occurs; the count value of each blink is incremented by 1, so as to calculate the number of blinks, which is used as the indicator of fatigue danger.
步骤3-2-4、统计一分钟内的眨眼次数,若一分钟内所述眨眼次数超过20次,确定所述眨眼检测结果为眨眼次数超过眨眼预警值,此时对驾驶员进行疲劳危险提示。Step 3-2-4. Count the number of blinks in one minute. If the number of blinks in one minute exceeds 20, it is determined that the blink detection result is that the number of blinks exceeds the blink warning value, and the driver is alerted to the danger of fatigue. .
步骤3-3、根据所述嘴部特征点进行打哈欠检测,生成打哈欠检测结果;具体包括:Step 3-3, performing yawning detection according to the mouth feature points, and generating a yawning detection result; specifically including:
步骤3-3-1、根据所述嘴部特征点计算每帧人脸图片中嘴巴的张口度。Step 3-3-1: Calculate the mouth opening degree of the mouth in each frame of the face picture according to the mouth feature points.
通过landmark提取嘴巴区域轮廓进行哈欠检测,计算张口度判定是否打哈欠,张口度计算公式为:The outline of the mouth area is extracted by landmark for yawn detection, and the mouth opening is calculated to determine whether to yawn. The calculation formula of the mouth opening is:
式(2)中α为张口度,H为嘴巴内轮廓张开的最大高度,L为嘴巴内轮廓的宽度,计算公式为:In formula (2), α is the mouth opening degree, H is the maximum height of the inner contour of the mouth, L is the width of the inner contour of the mouth, and the calculation formula is:
H=max(|p2-p8|,|p3-p7|,|p4-p6|) (3)H=max(|p2-p8|,|p3-p7|,|p4-p6|) (3)
L=|p1-p5| (4)L=|p1-p5| (4)
其中,p1,p2,p3,p4,p5,p6,p7,p8是人脸特征点中对应嘴巴内轮廓特征点(对应图4中标号为60-67的特征点),|p2-p8|、|p3-p7|、|p4-p6|为嘴巴内轮廓垂直方向上的距离,|p1-p5|为嘴巴内轮廓水平方向上的距离。Among them, p1, p2, p3, p4, p5, p6, p7, p8 are the facial feature points corresponding to the inner contour feature points of the mouth (corresponding to the feature points labeled 60-67 in Figure 4), |p2-p8|, |p3-p7|, |p4-p6| are the distances in the vertical direction of the inner contour of the mouth, and |p1-p5| are the distances in the horizontal direction of the inner contour of the mouth.
步骤3-3-2、判断多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数是否超过帧数阈值,获得打哈欠检测结果。Step 3-3-2: Determine whether the number of consecutive frames in which the mouth opening degree is greater than the threshold of the mouth opening degree in the multiple frames of the face pictures exceeds the threshold of the number of frames, and obtain a yawn detection result.
本发明采用双阈值法判定打哈欠行为,当张口度α大于张口度阈值Z=0.65,且张口时间超过连续帧数阈值125帧时,检测为打哈欠,由此作为危险疲劳提示指标。The invention adopts the double threshold method to determine the yawning behavior. When the mouth opening degree α is greater than the mouth opening degree threshold Z=0.65, and the mouth opening time exceeds the continuous frame number threshold of 125 frames, it is detected as yawning, which is used as a dangerous fatigue prompt indicator.
本发明实施例中以两种嘴巴状态的数据为例描述检测打哈欠的判断过程,如下表2所示:In the embodiment of the present invention, the data of two kinds of mouth states are used as examples to describe the judgment process of detecting yawning, as shown in Table 2 below:
表2 正常和哈欠时的张口度数据Table 2 Mouth opening data for normal and yawning
步骤3-3-3、若多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数超过帧数阈值,确定所述打哈欠检测结果为驾驶员存在打哈欠动作;Step 3-3-3, if the number of consecutive frames in which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face pictures exceeds the frame number threshold, determine that the yawn detection result is that the driver has yawning action;
步骤3-3-4、若多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数未超过帧数阈值,确定所述打哈欠检测结果为驾驶员不存在打哈欠动作。Step 3-3-4. If the number of consecutive frames in which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face picture does not exceed the frame number threshold, it is determined that the yawning detection result is that the driver does not have a yawning action.
步骤3-4、根据所述眨眼检测结果和所述打哈欠检测结果生成疲劳危险提示信息,具体包括:Step 3-4, generating fatigue danger prompt information according to the blink detection result and the yawn detection result, which specifically includes:
若所述眨眼检测结果为眨眼次数超过眨眼预警值,或者所述打哈欠检测结果为驾驶员存在打哈欠动作,则生成疲劳危险提示信息;If the blink detection result is that the number of blinks exceeds the blink warning value, or the yawn detection result is that the driver has a yawning action, generating fatigue danger prompt information;
根据所述疲劳危险提示信息对驾驶员进行疲劳危险提示,提示方法可以为语音提示或跳出预警图片并同时发出声音提示。According to the fatigue risk prompt information, the driver is prompted for the fatigue risk, and the prompt method can be a voice prompt or a warning image jumping out and a sound prompt at the same time.
步骤104:根据所述人脸图片和所述疲劳危险提示信息,采用PERCLOS算法检测驾驶员的疲劳状态,生成疲劳状态判断结果。Step 104: According to the face picture and the fatigue danger prompt information, use the PERCLOS algorithm to detect the driver's fatigue state, and generate a fatigue state judgment result.
对所述步骤2获得的人脸图片,进行图片预处理定位人眼,并利用PERCLOS算法判定疲劳状态,具体包括:For the face picture obtained in the step 2, carry out picture preprocessing to locate the human eye, and use the PERCLOS algorithm to determine the fatigue state, which specifically includes:
步骤4-1、采用模式匹配算法对所述人脸图片中的人眼进行粗定位,得到左眼和右眼的眼部图片。Step 4-1, using a pattern matching algorithm to roughly locate the human eyes in the face picture, and obtain the eye pictures of the left eye and the right eye.
经过人眼粗定位可以得到人左、右眼的一个简单轮廓区域,将左、右眼的外部轮廓分别设为形状为矩形的L和R两个区域,提取两个矩形区域的图像作为左眼和右眼的眼部图片。A simple contour area of the left and right eyes can be obtained through the coarse positioning of the human eye. The outer contours of the left and right eyes are set as two rectangular areas, L and R, respectively, and the images of the two rectangular areas are extracted as the left eye. and an eye picture of the right eye.
步骤4-2、对所述眼部图片进行预处理,生成预处理后的眼部图像。Step 4-2: Preprocess the eye image to generate a preprocessed eye image.
图5为本发明提供的对眼部图片做进一步处理的原理示意图。参见图5,对所述眼部图片做进一步预处理,包括灰度处理、利用Gauss滤波器平滑图像、以及利用Canny算子对瞳孔进行边缘检测,生成预处理后的眼部图像。FIG. 5 is a schematic diagram of the principle of further processing an eye image provided by the present invention. Referring to FIG. 5 , further preprocessing is performed on the eye image, including grayscale processing, smoothing the image using Gauss filter, and performing edge detection on the pupil using the Canny operator to generate a preprocessed eye image.
步骤4-3、采用霍夫变换圆检测算法对所述预处理后的眼部图像中的人眼进行精确定位,生成人眼精确位置图像。Step 4-3, using the Hough transform circle detection algorithm to precisely locate the human eye in the preprocessed eye image to generate an image of the precise position of the human eye.
图6为本发明提供的通过变换圆算法对人眼进行精确查找的原理示意图。参见图6,本发明在Hough(霍夫)变换基础上,通过变换圆算法对人眼进行精确定位和开合状态的识别。所述步骤4-3具体包括:FIG. 6 is a schematic diagram of the principle of accurately searching the human eye through the transform circle algorithm provided by the present invention. Referring to FIG. 6 , the present invention performs precise positioning of the human eye and identification of the opening and closing states through the transform circle algorithm on the basis of Hough transform. The steps 4-3 specifically include:
步骤4-3-1、在得到人的左眼和右眼的矩形范围L和R后,利用Canny算子在这两个范围里(即对左眼和右眼的眼部图片)进行边缘检测,检测到人眼的大致轮廓。Step 4-3-1. After obtaining the rectangular ranges L and R of the left and right eyes, use the Canny operator to perform edge detection in these two ranges (ie, the eye images of the left and right eyes). , the rough outline of the human eye is detected.
步骤4-3-2、对通过步骤4-3-1得到的边缘检测过的图像进行二值化处理,得到瞳孔所在的半径区域。Step 4-3-2: Binarize the edge-detected image obtained in step 4-3-1 to obtain the radius area where the pupil is located.
步骤4-3-3、对Hough矩阵进行初始化,初始化累加器数组M,数组M代表笛卡尔坐标系参数空间中每个像素点的坐标。Step 4-3-3, initialize the Hough matrix, initialize the accumulator array M, and the array M represents the coordinates of each pixel in the parameter space of the Cartesian coordinate system.
步骤4-3-4、在左眼和右眼的眼部图片中左眼L和右眼R两个区域中画圆;画圆可以直接用专门的画圆算法,从而提取眼部精确的轮廓。Step 4-3-4, draw circles in the two areas of the left eye L and the right eye R in the eye pictures of the left eye and the right eye; for drawing a circle, a special circle drawing algorithm can be used directly to extract the precise outline of the eye .
步骤4-3-5、在累加器M中,计算该累加器M的最大值,该最大值为将要定位的瞳孔的圆形所在位置的圆心坐标,定位得到瞳孔圆心坐标为M(0,R),从而实现了人眼的精确定位。R是圆的半径,即瞳孔的坐标到边缘的距离。Step 4-3-5, in the accumulator M, calculate the maximum value of the accumulator M, the maximum value is the center coordinate of the position of the circle of the pupil to be located, and the center coordinate of the pupil obtained by positioning is M(0, R ), thus realizing the precise positioning of the human eye. R is the radius of the circle, the distance from the pupil's coordinates to the edge.
步骤4-4、根据所述人眼精确位置图像计算单位时间内眼睛闭合的百分比PERCLOS。Step 4-4: Calculate the percentage of eye closure PERCLOS per unit time according to the image of the precise position of the human eye.
本发明依靠PERCLOS P80准则进行疲劳判定,PERCLOS(percentage of eyelidclosure over the pupil over time,单位时间内眼睛闭合的百分比)的计算公式如下:The present invention relies on PERCLOS P80 criterion to carry out fatigue judgment, and the calculation formula of PERCLOS (percentage of eyelidclosure over the pupil over time, the percentage of eye closure per unit time) is as follows:
其中,P80指眼睑遮住瞳孔的面积超过80%就记为眼睛闭合,统计在一定时间内眼睛闭合时所占的时间比例作为PERCLOS值。Among them, P80 means that the eyelid covers more than 80% of the pupil as the eye is closed, and the proportion of the time when the eye is closed in a certain period of time is counted as the PERCLOS value.
依靠PERCLOS P80准则进行疲劳判定的方法,具体为:The method for determining fatigue based on the PERCLOS P80 criteria is as follows:
步骤4-4-1、根据所有的人眼图像,记录四个时间间隔:从人眼完全睁开至闭合p1%的时间间隔t1、从人眼完全睁开至闭合p2%的时间间隔t2、从人眼完全睁开至下一次睁开p1%的间隔时间t3、从人眼完全睁开至下一次睁开p2%的时间间隔t4;其中,p1%、p2%均为眼球占整个眼睛的比例。其中:p1=20,p2=80。Step 4-4-1. According to all the human eye images, record four time intervals: the time interval t1 from fully opening the human eye to closing p 1 %, and the time interval from fully opening the human eye to closing p 2 % t2, the interval time t3 from the time when the human eye is fully opened to the next opening p 1 %, and the time interval t4 from the fully opening of the human eye to the next opening p 2 %; wherein, p 1 % and p 2 % are both The ratio of the eyeball to the entire eye. where: p 1 =20, p 2 =80.
步骤4-4-2、根据t1、t2、t3、t4求取人眼PERCLOS指数值PERCLOS,所用公式为:Step 4-4-2, according to t1, t2, t3, t4 to obtain the human eye PERCLOS index value PERCLOS, the formula used is:
PERCLOS值超过80%判断为疲劳。Fatigue was judged when the PERCLOS value exceeded 80%.
步骤4-5、若所述PERCLOS超过80%,确定所述疲劳状态判断结果为驾驶员处于疲劳状态;Step 4-5, if the PERCLOS exceeds 80%, determine that the fatigue state judgment result is that the driver is in a fatigue state;
步骤4-6、若所述PERCLOS未超过80%,确定所述疲劳状态判断结果为驾驶员未处于疲劳状态。Step 4-6, if the PERCLOS does not exceed 80%, determine that the fatigue state judgment result is that the driver is not in a fatigue state.
步骤105:若所述疲劳状态判断结果为驾驶员处于疲劳状态,生成疲劳驾驶报警信息进行报警。报警方式为通过声音进行报警提示。Step 105: If the fatigue state determination result is that the driver is in a fatigue state, generate fatigue driving alarm information to give an alarm. The alarm method is to give an alarm prompt by sound.
若所述疲劳状态判断结果为驾驶员未处于疲劳状态,返回所述获取预设时间段内驾驶员的脸部视频的步骤101,继续根据脸部视频进行实时疲劳驾驶检测。If the fatigue state judgment result is that the driver is not in a fatigue state, return to step 101 of obtaining the driver's face video within a preset time period, and continue to perform real-time fatigue driving detection according to the face video.
本发明方法依靠人脸关键点的提取来判断眨眼及哈欠动作,对驾驶员即将进入疲劳危险期时进行提示,能够有效预防疲劳驾驶事故。同时通过PERCLOS算法准则计算人眼的睁开程度,从而对驾驶员进行疲劳检测进行预警,具有实时性和非接触性。此外,结合两者进行检测具有较高的检测精度、可靠性和实用性。The method of the invention judges blinking and yawning actions by extracting the key points of the human face, and prompts the driver when he is about to enter the fatigue danger period, which can effectively prevent fatigue driving accidents. At the same time, the opening degree of the human eye is calculated through the PERCLOS algorithm criterion, so as to provide early warning for the driver's fatigue detection, which is real-time and non-contact. In addition, combining the two for detection has high detection accuracy, reliability and practicability.
基于本发明提供的的驾驶员疲劳检测方法,本发明还提供一种基于计算机视觉的驾驶员疲劳检测系统,图7为本发明提供的基于计算机视觉的驾驶员疲劳检测系统的系统结构图。参见图7,所述系统包括:Based on the driver fatigue detection method provided by the present invention, the present invention also provides a computer vision-based driver fatigue detection system. FIG. 7 is a system structure diagram of the computer vision-based driver fatigue detection system provided by the present invention. Referring to Figure 7, the system includes:
脸部视频获取模块701,用于获取预设时间段内驾驶员的脸部视频;A face video acquisition module 701, configured to acquire a driver's face video within a preset time period;
人脸图片生成模块702,用于采用人脸检测分类器训练所述脸部视频,生成多帧人脸图片;A face picture generation module 702, configured to train the face video by using a face detection classifier to generate multiple frames of face pictures;
眨眼及打哈欠检测模块703,用于根据所述人脸图片进行眨眼和打哈欠的检测,生成疲劳危险提示信息;The blinking and yawning detection module 703 is used to detect blinking and yawning according to the face picture, and generate fatigue danger prompt information;
疲劳状态检测模块704,用于根据所述人脸图片和所述疲劳危险提示信息,采用PERCLOS算法检测驾驶员的疲劳状态,生成疲劳状态判断结果;The fatigue state detection module 704 is configured to detect the fatigue state of the driver by using the PERCLOS algorithm according to the face picture and the fatigue danger prompt information, and generate a fatigue state judgment result;
疲劳报警模块705,用于若所述疲劳状态判断结果为驾驶员处于疲劳状态,生成疲劳驾驶报警信息进行报警;A fatigue alarm module 705, configured to generate fatigue driving alarm information for alarming if the fatigue state judgment result is that the driver is in a fatigue state;
循环检测模块706,用于若所述疲劳状态判断结果为驾驶员未处于疲劳状态,返回所述获取预设时间段内驾驶员的脸部视频的步骤。The loop detection module 706 is configured to return to the step of obtaining the driver's face video within a preset time period if the fatigue state determination result is that the driver is not in the fatigue state.
其中,所述眨眼及打哈欠检测模块703具体包括:Wherein, the blinking and yawning detection module 703 specifically includes:
人脸特征点提取单元,用于采用人脸识别预测器提取所述人脸图片上的68个人脸特征点;所述68个人脸特征点包括对应眼部轮廓的眼部特征点和对应嘴巴轮廓的嘴部特征点;A face feature point extraction unit, used for extracting 68 face feature points on the face picture by using a face recognition predictor; the 68 face feature points include eye feature points corresponding to eye contours and corresponding mouth contours mouth feature points;
眨眼检测单元,用于根据所述眼部特征点进行眨眼检测,生成眨眼检测结果;a blink detection unit, configured to perform blink detection according to the eye feature points, and generate a blink detection result;
打哈欠检测单元,用于根据所述嘴部特征点进行打哈欠检测,生成打哈欠检测结果;a yawn detection unit, configured to perform yawn detection according to the mouth feature points, and generate a yawn detection result;
疲劳危险提示信息生成单元,用于根据所述眨眼检测结果和所述打哈欠检测结果生成疲劳危险提示信息。A fatigue risk prompt information generating unit, configured to generate fatigue risk prompt information according to the blink detection result and the yawn detection result.
所述眨眼检测单元具体包括:The blink detection unit specifically includes:
眼睛睁开度计算子单元,用于根据所述眼部特征点计算每帧人脸图片中人眼的眼睛睁开度;an eye opening degree calculation subunit, used for calculating the eye opening degree of the human eye in each frame of the face picture according to the eye feature points;
眨眼次数计算子单元,用于若连续两帧所述人脸图片中所述眼睛睁开度均小于睁开度阈值,将眨眼次数加1;A subunit for calculating the number of blinks, for adding 1 to the number of blinks if the degree of eye opening in the face pictures in two consecutive frames is less than the threshold of the opening degree;
眨眼检测结果确定子单元,用于若一分钟内所述眨眼次数超过20次,确定所述眨眼检测结果为眨眼次数超过眨眼预警值。The blink detection result determination subunit is configured to determine that the blink detection result is that the blink count exceeds the blink warning value if the blink count exceeds 20 times in one minute.
所述打哈欠检测单元具体包括:The yawn detection unit specifically includes:
张口度计算子单元,用于根据所述嘴部特征点计算每帧人脸图片中嘴巴的张口度;The mouth opening degree calculation subunit is used to calculate the mouth opening degree of the mouth in each frame of the face picture according to the mouth feature points;
打哈欠判断子单元,用于判断多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数是否超过帧数阈值,获得打哈欠检测结果;A yawning judging subunit, configured to judge whether the number of consecutive frames in which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face pictures exceeds the frame number threshold, and obtain a yawn detection result;
打哈欠动作确定子单元,用于若多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数超过帧数阈值,确定所述打哈欠检测结果为驾驶员存在打哈欠动作;The yawning action determination subunit is used to determine that the yawning detection result is that the driver has a yawning action if the continuous frame number of which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face pictures exceeds the frame number threshold;
无打哈欠动作确定子单元,用于若多帧所述人脸图片中所述张口度大于张口度阈值的连续帧数未超过帧数阈值,确定所述打哈欠检测结果为驾驶员不存在打哈欠动作。No yawning action determination subunit, for if the number of consecutive frames in which the mouth opening degree is greater than the mouth opening degree threshold in the multiple frames of the face picture does not exceed the frame number threshold, it is determined that the yawning detection result is that the driver does not have a yawn. Yawning action.
所述疲劳危险提示信息生成单元具体包括:The fatigue danger prompt information generating unit specifically includes:
疲劳危险提示信息生成子单元,用于若所述眨眼检测结果为眨眼次数超过眨眼预警值,或者所述打哈欠检测结果为驾驶员存在打哈欠动作,则生成疲劳危险提示信息;a fatigue danger prompt information generating subunit, configured to generate fatigue danger prompt information if the blink detection result is that the number of blinks exceeds the blink warning value, or the yawning detection result is that the driver has a yawning action;
疲劳危险提示子单元,用于根据所述疲劳危险提示信息对驾驶员进行疲劳危险提示。The fatigue risk prompting subunit is used for prompting the driver of the fatigue risk according to the fatigue risk prompt information.
所述疲劳状态检测模块704具体包括:The fatigue state detection module 704 specifically includes:
眼部图片生成单元,用于采用模式匹配算法对所述人脸图片中的人眼进行粗定位,得到左眼和右眼的眼部图片;an eye image generation unit, configured to use a pattern matching algorithm to roughly locate the human eyes in the face image to obtain eye images of the left eye and the right eye;
预处理单元,用于对所述眼部图片进行预处理,生成预处理后的眼部图像;a preprocessing unit, configured to preprocess the eye image to generate a preprocessed eye image;
精确定位单元,用于采用霍夫变换圆检测算法对所述预处理后的眼部图像中的人眼进行精确定位,生成人眼精确位置图像;a precise positioning unit, used for using the Hough transform circle detection algorithm to accurately locate the human eye in the preprocessed eye image, and generate an image of the precise position of the human eye;
PERCLOS计算单元,用于根据所述人眼精确位置图像计算单位时间内眼睛闭合的百分比PERCLOS;a PERCLOS calculation unit, configured to calculate the percentage PERCLOS of eye closure per unit time according to the image of the precise position of the human eye;
疲劳状态确定单元,用于若所述PERCLOS超过80%,确定所述疲劳状态判断结果为驾驶员处于疲劳状态;A fatigue state determination unit, configured to determine that the fatigue state judgment result is that the driver is in a fatigue state if the PERCLOS exceeds 80%;
未处于疲劳状态确定单元,用于若所述PERCLOS未超过80%,确定所述疲劳状态判断结果为驾驶员未处于疲劳状态。A not in fatigue state determination unit, configured to determine that the fatigue state judgment result is that the driver is not in a fatigue state if the PERCLOS does not exceed 80%.
本发明与现有技术相比,其显著优点为:Compared with the prior art, the present invention has the following significant advantages:
1)本发明在基于眼部识别的疲劳驾驶技术上,结合人脸特征点提取算法,在判定驾驶员疲劳之前先进行疲劳危险提示,从而在驾驶员疲劳之前有机会防止危险事故发生,降低疲劳驾驶事故发生概率;1) The present invention is based on the fatigue driving technology based on eye recognition, combined with the facial feature point extraction algorithm, before judging that the driver is fatigued, the fatigue danger prompt is firstly performed, so that there is an opportunity to prevent the occurrence of dangerous accidents before the driver is fatigued and reduce fatigue. the probability of a driving accident;
2)本发明基于计算机视觉检测疲劳,具有非接触性和实时性,不会对驾驶员正常驾驶产生干扰,使疲劳检测更加方便快捷;2) The present invention detects fatigue based on computer vision, has non-contact and real-time properties, does not interfere with the normal driving of the driver, and makes the fatigue detection more convenient and quick;
3)本发明可用于各类驾驶员的疲劳状态的检测及疲劳危险的预警,适用范围更广;3) The present invention can be used for the detection of the fatigue state of various drivers and the early warning of the fatigue risk, and the scope of application is wider;
4)本发明可直接调用人脸识别库,通过人脸关键点检测面部表情,省略了传统方法对图像的繁琐处理,可靠性高,应用灵活;4) The present invention can directly call the face recognition library, detect facial expressions through the key points of the face, omits the tedious processing of images by traditional methods, has high reliability, and is flexible in application;
5)通过多种算法对人眼进行精确定位,为了防止PERCLOS算法不准确,还通过眨眼和哈欠检测先预警疲劳,从而进一步提高疲劳报警的准确度。5) Precise positioning of the human eye through a variety of algorithms. In order to prevent the inaccuracy of the PERCLOS algorithm, it also provides early warning of fatigue through blinking and yawning detection, thereby further improving the accuracy of fatigue alarms.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method.
本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。In this paper, specific examples are used to illustrate the principles and implementations of the present invention. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the present invention; meanwhile, for those skilled in the art, according to the present invention There will be changes in the specific implementation and application scope. In conclusion, the contents of this specification should not be construed as limiting the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910221692.5A CN109934199A (en) | 2019-03-22 | 2019-03-22 | A method and system for driver fatigue detection based on computer vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910221692.5A CN109934199A (en) | 2019-03-22 | 2019-03-22 | A method and system for driver fatigue detection based on computer vision |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109934199A true CN109934199A (en) | 2019-06-25 |
Family
ID=66988107
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910221692.5A Pending CN109934199A (en) | 2019-03-22 | 2019-03-22 | A method and system for driver fatigue detection based on computer vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109934199A (en) |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110427830A (en) * | 2019-07-08 | 2019-11-08 | 太航常青汽车安全系统(苏州)股份有限公司 | Driver's abnormal driving real-time detection system for state and method |
CN110879973A (en) * | 2019-10-31 | 2020-03-13 | 安徽普华灵动机器人科技有限公司 | Driver fatigue state facial feature recognition and detection method |
CN111274963A (en) * | 2020-01-20 | 2020-06-12 | 西南科技大学 | Fatigue driving warning system based on image processing |
CN111753659A (en) * | 2020-05-20 | 2020-10-09 | 广州虹科电子科技有限公司 | Fatigue driving detection method, equipment, medium and device based on face registration point |
CN111797784A (en) * | 2020-07-09 | 2020-10-20 | 斑马网络技术有限公司 | Driving behavior monitoring method and device, electronic equipment and storage medium |
CN112016429A (en) * | 2020-08-21 | 2020-12-01 | 高新兴科技集团股份有限公司 | Fatigue driving detection method based on train cab scene |
CN112395900A (en) * | 2019-08-12 | 2021-02-23 | 天津大学青岛海洋技术研究院 | Fatigue driving state detection algorithm based on YOLOv3 algorithm |
CN112528767A (en) * | 2020-11-26 | 2021-03-19 | 天津大学 | Machine vision-based construction machinery operator fatigue operation detection system and method |
WO2021053806A1 (en) * | 2019-09-20 | 2021-03-25 | 三菱電機株式会社 | Information processing device, program, and information processing method |
CN112686161A (en) * | 2020-12-31 | 2021-04-20 | 遵义师范学院 | Fatigue driving detection method based on neural network |
CN112699768A (en) * | 2020-12-25 | 2021-04-23 | 哈尔滨工业大学(威海) | Fatigue driving detection method and device based on face information and readable storage medium |
CN113076885A (en) * | 2021-04-09 | 2021-07-06 | 中山大学 | Concentration degree grading method and system based on human eye action characteristics |
CN113838265A (en) * | 2021-09-27 | 2021-12-24 | 科大讯飞股份有限公司 | Fatigue driving early warning method and device and electronic equipment |
CN113989789A (en) * | 2021-11-16 | 2022-01-28 | 中国人民武装警察部队工程大学 | Face fatigue detection method based on multi-feature fusion in teaching scene |
CN114155513A (en) * | 2021-12-07 | 2022-03-08 | 西安建筑科技大学 | A driving risk behavior monitoring method, system, device and readable storage medium based on face multi-parameter detection |
CN114202794A (en) * | 2022-02-17 | 2022-03-18 | 之江实验室 | A kind of fatigue detection method and device based on face ppg signal |
CN114332829A (en) * | 2021-12-06 | 2022-04-12 | 江苏航天大为科技股份有限公司 | Driver fatigue detection method based on multiple strategies |
CN114937260A (en) * | 2022-05-16 | 2022-08-23 | 重庆大学 | Fatigue driving detection method based on combination of traditional method and deep neural network |
CN116189384A (en) * | 2023-02-27 | 2023-05-30 | 焦子欢 | A camera-based fatigue driving detection system and early warning device |
CN117333927A (en) * | 2023-12-01 | 2024-01-02 | 厦门磁北科技有限公司 | Vehicle-mounted face recognition alcohol detection method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106372621A (en) * | 2016-09-30 | 2017-02-01 | 防城港市港口区高创信息技术有限公司 | Face recognition-based fatigue driving detection method |
WO2017193272A1 (en) * | 2016-05-10 | 2017-11-16 | 深圳市赛亿科技开发有限公司 | Vehicle-mounted fatigue pre-warning system based on human face recognition and pre-warning method |
CN107491769A (en) * | 2017-09-11 | 2017-12-19 | 中国地质大学(武汉) | Method for detecting fatigue driving and system based on AdaBoost algorithms |
CN107679468A (en) * | 2017-09-19 | 2018-02-09 | 浙江师范大学 | A kind of embedded computer vision detects fatigue driving method and device |
-
2019
- 2019-03-22 CN CN201910221692.5A patent/CN109934199A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017193272A1 (en) * | 2016-05-10 | 2017-11-16 | 深圳市赛亿科技开发有限公司 | Vehicle-mounted fatigue pre-warning system based on human face recognition and pre-warning method |
CN106372621A (en) * | 2016-09-30 | 2017-02-01 | 防城港市港口区高创信息技术有限公司 | Face recognition-based fatigue driving detection method |
CN107491769A (en) * | 2017-09-11 | 2017-12-19 | 中国地质大学(武汉) | Method for detecting fatigue driving and system based on AdaBoost algorithms |
CN107679468A (en) * | 2017-09-19 | 2018-02-09 | 浙江师范大学 | A kind of embedded computer vision detects fatigue driving method and device |
Cited By (26)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110427830A (en) * | 2019-07-08 | 2019-11-08 | 太航常青汽车安全系统(苏州)股份有限公司 | Driver's abnormal driving real-time detection system for state and method |
CN112395900A (en) * | 2019-08-12 | 2021-02-23 | 天津大学青岛海洋技术研究院 | Fatigue driving state detection algorithm based on YOLOv3 algorithm |
JPWO2021053806A1 (en) * | 2019-09-20 | 2021-11-25 | 三菱電機株式会社 | Information processing equipment, programs and information processing methods |
JP6991401B2 (en) | 2019-09-20 | 2022-01-12 | 三菱電機株式会社 | Information processing equipment, programs and information processing methods |
WO2021053806A1 (en) * | 2019-09-20 | 2021-03-25 | 三菱電機株式会社 | Information processing device, program, and information processing method |
CN110879973A (en) * | 2019-10-31 | 2020-03-13 | 安徽普华灵动机器人科技有限公司 | Driver fatigue state facial feature recognition and detection method |
CN111274963A (en) * | 2020-01-20 | 2020-06-12 | 西南科技大学 | Fatigue driving warning system based on image processing |
CN111753659A (en) * | 2020-05-20 | 2020-10-09 | 广州虹科电子科技有限公司 | Fatigue driving detection method, equipment, medium and device based on face registration point |
CN111753659B (en) * | 2020-05-20 | 2024-11-29 | 广州虹科电子科技有限公司 | Fatigue driving detection method, equipment, medium and device based on face registration points |
CN111797784B (en) * | 2020-07-09 | 2024-03-05 | 斑马网络技术有限公司 | Driving behavior monitoring method and device, electronic equipment and storage medium |
CN111797784A (en) * | 2020-07-09 | 2020-10-20 | 斑马网络技术有限公司 | Driving behavior monitoring method and device, electronic equipment and storage medium |
CN112016429A (en) * | 2020-08-21 | 2020-12-01 | 高新兴科技集团股份有限公司 | Fatigue driving detection method based on train cab scene |
CN112528767A (en) * | 2020-11-26 | 2021-03-19 | 天津大学 | Machine vision-based construction machinery operator fatigue operation detection system and method |
CN112699768A (en) * | 2020-12-25 | 2021-04-23 | 哈尔滨工业大学(威海) | Fatigue driving detection method and device based on face information and readable storage medium |
CN112686161A (en) * | 2020-12-31 | 2021-04-20 | 遵义师范学院 | Fatigue driving detection method based on neural network |
CN113076885A (en) * | 2021-04-09 | 2021-07-06 | 中山大学 | Concentration degree grading method and system based on human eye action characteristics |
CN113076885B (en) * | 2021-04-09 | 2023-11-10 | 中山大学 | Concentration degree grading method and system based on human eye action characteristics |
CN113838265A (en) * | 2021-09-27 | 2021-12-24 | 科大讯飞股份有限公司 | Fatigue driving early warning method and device and electronic equipment |
CN113989789A (en) * | 2021-11-16 | 2022-01-28 | 中国人民武装警察部队工程大学 | Face fatigue detection method based on multi-feature fusion in teaching scene |
CN114332829A (en) * | 2021-12-06 | 2022-04-12 | 江苏航天大为科技股份有限公司 | Driver fatigue detection method based on multiple strategies |
CN114155513A (en) * | 2021-12-07 | 2022-03-08 | 西安建筑科技大学 | A driving risk behavior monitoring method, system, device and readable storage medium based on face multi-parameter detection |
CN114202794A (en) * | 2022-02-17 | 2022-03-18 | 之江实验室 | A kind of fatigue detection method and device based on face ppg signal |
CN114937260A (en) * | 2022-05-16 | 2022-08-23 | 重庆大学 | Fatigue driving detection method based on combination of traditional method and deep neural network |
CN116189384A (en) * | 2023-02-27 | 2023-05-30 | 焦子欢 | A camera-based fatigue driving detection system and early warning device |
CN117333927A (en) * | 2023-12-01 | 2024-01-02 | 厦门磁北科技有限公司 | Vehicle-mounted face recognition alcohol detection method and system |
CN117333927B (en) * | 2023-12-01 | 2024-04-16 | 厦门磁北科技有限公司 | Vehicle-mounted face recognition alcohol detection method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109934199A (en) | A method and system for driver fatigue detection based on computer vision | |
Guo et al. | Eyes tell all: Irregular pupil shapes reveal gan-generated faces | |
CN110363047B (en) | Face recognition method and device, electronic equipment and storage medium | |
CN103824420B (en) | Fatigue driving identification system based on heart rate variability non-contact measurement | |
Mbouna et al. | Visual analysis of eye state and head pose for driver alertness monitoring | |
WO2017152649A1 (en) | Method and system for automatically prompting distance from human eyes to screen | |
Batista | A drowsiness and point of attention monitoring system for driver vigilance | |
CN108596087B (en) | Driving fatigue degree detection regression model based on double-network result | |
CN102289660A (en) | Method for detecting illegal driving behavior based on hand gesture tracking | |
CN103150870B (en) | Train motorman fatigue detecting method based on videos | |
CN102254151A (en) | Driver fatigue detection method based on face video analysis | |
CN102902986A (en) | Automatic gender identification system and method | |
CN101923645A (en) | Adaptive Iris Segmentation Method for Low Quality Iris Images in Complex Application Scenarios | |
CN104318202A (en) | Method and system for recognizing facial feature points through face photograph | |
CN105205486A (en) | Vehicle logo recognition method and device | |
WO2022110917A1 (en) | Method for determining driving state of driver, computer storage medium, and electronic device | |
US8948517B2 (en) | Landmark localization via visual search | |
CN104915656A (en) | Quick human face recognition method based on binocular vision measurement technology | |
US20230237694A1 (en) | Method and system for detecting children's sitting posture based on face recognition of children | |
CN108108651B (en) | Method and system for detecting driver non-attentive driving based on video face analysis | |
CN109460704A (en) | A kind of fatigue detection method based on deep learning, system and computer equipment | |
JP2012221162A (en) | Object detection device and program | |
CN109308467A (en) | Traffic accident early warning device and early warning method based on machine learning | |
CN107315997B (en) | Sight orientation judgment method and system based on rapid feature point positioning | |
CN111241505A (en) | Terminal device, login verification method thereof and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB03 | Change of inventor or designer information |
Inventor after: Zhang Zhenghua Inventor after: Han Xue Inventor after: Ye Aobin Inventor after: Li Bin Inventor after: Cao Yongzhong Inventor after: Xu Yingyi Inventor after: Chen Hao Inventor after: Wen Dong Inventor before: Han Xue Inventor before: Zhang Zhenghua Inventor before: Ye Aobin Inventor before: Li Bin Inventor before: Cao Yongzhong Inventor before: Xu Yingyi Inventor before: Chen Hao Inventor before: Wen Dong |
|
CB03 | Change of inventor or designer information |