Eye status using histogram

3 次查看(过去 30 天)
Dalal Alhabsi
Dalal Alhabsi 2016-5-20
Hello i'm doing a project for fatigue detection in real time the problem that i get is with eye status, i want to use histogram to compare between open eye and close eye and then find the difference between them so i can detect eye blink,i found a code that is very helpful, the problem is i want to save a reference image which is (open eye) from the camera , and then compare it with other frames , how can i do that? i want the reference image saved from real time stored in other location so it can't overwrite with other image.
please help
  1 个评论
Dalal Alhabsi
Dalal Alhabsi 2016-5-20
Im1 = imread('Eeye1.jpg'); Im2 = imread('Eeye.jpg');
Im1 = rgb2gray(Im1); Im2 = rgb2gray(Im2);
% convert images to type double (range from from 0 to 1 instead of from 0 to 255) Im1 = im2double(Im1); Im2 = im2double(Im2);
% Calculate the Normalized Histogram of Image 1 and Image 2 hn1 = imhist(Im1)./numel(Im1); hn2 = imhist(Im2)./numel(Im2);
% Calculate the histogram error f = sum((hn1 - hn2).^2); f; %display the result to console subplot(3,4,[9 10 11 12]); plot(1:size(hn1,1),mean(hn1,2),'b'); hold on plot(1:size(hn2,1),mean(hn2,2),'r');
this is the code i use it for histogram

请先登录,再进行评论。

回答(3 个)

Image Analyst
Image Analyst 2016-5-20
When the driving first starts, take the histogram average over many frames - like for a minute or so. The idea being that when they first start driving, their eyes will be open most of the time. Then after a certain number of frames, save out that average histogram.
Or just read how other people have successfully done it here: http://www.visionbib.com/bibliography/motion-f725.html#Driver%20Monitoring,%20Eyes,%20Gaze
  2 个评论
Dalal Alhabsi
Dalal Alhabsi 2016-5-20
but how can i convert that to image? like the code?
Image Analyst
Image Analyst 2016-5-20
You can use MATLAB to write it yourself. Or you can contact the authors and ask if you can buy their code.

请先登录,再进行评论。


asd
asd 2016-11-22
If you looking for the simplest method for the real time detection of the eye blinking which can be simply implemented. you find it in the blog (Designing a simple eye-blink detection algorithm for EEG). I hope this is what you want.
  3 个评论
Vaishnavi M Pastay
Vaishnavi M Pastay 2021-6-10
I am doing the project on Drowsiness Driver Detection using MatLab code. Here is the program for completely Eye opened and closed coding. Please can anyone help me for opened,closed, half closed and or about to close the eyes.
Image Analyst
Image Analyst 2021-6-10
@Vaishnavi M Pastay, you said "Here is the program for completely Eye opened and closed coding." but you forgot to attach it or say where someone could get it. Are you talking about your own code, or the web site @asd mentioned but forgot to include (though I managed to find it and put the link for it in my comment above)?

请先登录,再进行评论。


Vaishnavi M Pastay
Vaishnavi M Pastay 2021-6-10
And it also detect wearing a spectacule.

类别

Help CenterFile Exchange 中查找有关 Feature Detection and Extraction 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by