Loading repository data…
Loading repository data…
woorimlee / repository
To identify the driver's drowsiness based on real-time camera image and image processing techniques. 졸음운전 감지 시스템. OpenCV
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
: In this repository, a program was developed to identify the driver's drowsiness based on real-time camera image and image processing techniques, and this program makes warning alarms go off for each level of drowsiness when it detects drowsiness driving.
: 실시간 영상과 영상 처리 기술을 기반으로 운전자의 졸음 상태를 판별하고 졸음운전 중이라면 특정 수준에 따라 경고 알람이 울리게 하는 프로그램을 제작하였습니다. 실시간 Vision System에 운전자의 얼굴 및 안구 검출 기법, 조명 영향 제거에 따른 안구 오검출 제거 방법, 졸음 감지 기법, 지도 학습 알고리즘을 사용한 졸음 단계 판별법 등을 구현하였습니다.
: Based on the real-time Vision System, drivers' face and eye detection techniques were added, as well as removing lighting effects due to the eye detection false positives, drowsiness detection techniques, and supervised learning algorithms to identify drowsiness level.
The Histogram of Oriented Gradients technology and the learned Face Landmark estimation techniques were used to detect faces and eyes.
In order to eliminate the effects of lighting, the light channels of the original images were separated and reversed, and then composed with the grayscale images of original images.
Furthermore the concept of Eye Aspect Ratio was used to detect drivers' drowsiness.
Finally, the KNN algorithm was used to divide the drivers' level of drowsiness into three stages, and differential alarms go off for each stages.
Through these works, we could research and make technology of intelligent vehicle systems and vision computing, which is gaining much attention recently.
: 얼굴 및 안구 검출을 하기 위해 Histogram of Oriented Gradients 기술과 학습된 Face landmark estimation 기법을 사용하였습니다. 조명 영향을 제거하기 위해선 원본 영상의 조명 채널을 분리해 역 조명을 쏘아 Grayscale 된 이미지와 합쳐주었고, 졸음 상태를 감지하기 위해선 Eye Aspect Ratio라는 개념을 사용하였습니다. 마지막으로 운전자의 졸음 위험 수준을 세 단계로 나눠 단계별로 차등 알람이 울리게 하였고, 단계를 나누는 과정에서 KNN 알고리즘을 사용했다.
This code is in Python 3.6
Get face images from the camera -> Grayscaling -> Light processing -> HOG & find face -> Face Landmark Estimation -> Detect drowsiness driving.
0 : The filming.
10 : Lightness preprocessing.
100 : Detecting drowsiness.
110 : Getting face's image.
120 : Finding eyes region.
130 : Determining the value of the EAR normally.
140 : Determining drowsiness driving.
141 : Calculating the value of the EAR.
142 : Calculating the amount of time eyes are closed.
143 : Calculating the amount of time eyes are opened.
144 : Determining the level of the drowsiness.
Calculated EAR
The calculated EAR will have a value more than zero when the eyes are open, and a value close to zero when the eyes are closed.
This program has set a 50% value from the average EAR value to the threshold value. So, 1) measures the average EAR value when the eyes are open, 2) measures the average EAR value when the driver is closing his eyes, and 3) sets the threshold using the above two results.
.1) == 과정 1), 2) == 과정 2), 3) == 과정 3) (in drowsiness_detector code)
계산된 EAR은 눈을 뜨고 있을 땐 0이 아닌 어떤 값을 갖게 되고, 눈을 감을 땐 0에 가까운 값을 갖습니다. 여기에 어떤 Constant로 Threshold를(졸음운전을 판단할 때 사용하는 임곗값) 설정할 시 그 값보다 EAR 값이 작아지는지 확인하는 방식으로 운전자가 졸음운전 중이라는 것을 감지할 수 있습니다.
추가로 졸음운전 판별 시 양쪽 눈을 따로 검사할 필요는 없기 때문에 양쪽 눈 각각의 EAR 값을 평균 계산해서 사용하였습니다.
Threshold 값은 눈을 가장 크게 떴을 때 EAR 값의 50%로 설정했습니다. 이보다 작을 때는(눈 크기가 작아졌을 때) 운전자가 졸린 상태인 것으로 판단, 운전자가 졸려 하는지에 관심을 뒀기 때문에 완전 수면에 빠지지 않더라도 알람이 울립니다.
이 알고리즘을 적용하기 위해 다음의 세 과정을 적용했습니다. 1) 운전자가 눈을 뜨고 있을 때 평균 EAR 값을 결정, 2) 운전자가 눈을 감고 있을 때 평균 EAR 값을 결정, 3) 위의 두 값을 이용해 눈을 뜨고 있는 상태의 50%가 되는 EAR 값을 결정.
. 1. Create arrays with random (x, y)-coordinates.
Labeling
Define K value.
Test KNN algorithm.