Ask Your Question
0

How to detect sunglasses in a human/facial region?

asked 2017-05-12 07:22:42 -0600

nickcong gravatar image

Hi guys,

I am working on a project to detect human and check whether he/she is wearing a protection goggle(I simply assume its a sunglasses-like object)

This is what I did:

Trained my own classifier with linear SVM and HOG features,the data set came from Dalal's paper's resource plus my own images. Its performance is acceptable but not that good. (a very high FP rate when detecting). It worked fine in a given background..

Then I tried to detect the goggle in the human body region. I took 50 more pictures and saved the [forehead+sunglasses+noses] regions and trained them with linear SVM and HOG (2x2 pixels each cell and 2x2 cells each block) then almost every thing can be detected on the body excepted for the real sunglasses region....I am wondering if there is a good way to conduct the sunglasses detection? I am in hurry and have not time to try each features one by one....

(My training set is like this image description)

Sorry for my english and a great many thanks guys!

Nick

edit retag flag offensive close merge delete

Comments

If my post need to modified please let me know :)

nickcong gravatar imagenickcong ( 2017-05-12 07:24:15 -0600 )edit

You can use face detection

Than ROI for eyes Then use DFT

Opencvfaq gravatar imageOpencvfaq ( 2017-05-24 14:19:34 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-06-01 04:59:43 -0600

arunponnusamy gravatar image

updated 2018-06-01 05:06:44 -0600

Hello Nick,

How did you train your SVM classifier ?

Did you take a look at dlib's object detector ? It's really good. Look at the following example. It has neat comments. https://github.com/davisking/dlib/blob/master/python_examples/train_object_detector.py

you can detect faces first and then look for sunglasses inside the detected face rectangle. For face detection, you can use dlib's frontal face detector if you are just dealing with frontal faces. If your input image has faces in all angles you can consider using cvlib. It detects faces in all angles. (uses OpenCV's dnn module underneath)

Here is a comparison between dlib's frontal and CNN face detector.

Hope this helps. Cheers.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-05-12 07:22:06 -0600

Seen: 2,584 times

Last updated: Jun 01 '18