Dlib face detection from low brightness image - python

I want to detect face from image with low brightness. I'm using dlib for detecting the face from image. But the dlib detector is detecting no face at all. I've the following code to detect faces from image.
detector=dlib.get_frontal_face_detector()
faces=detector(image)
when i try to print the length of the faces it displays zero.
Can anybody help me, what shall I do? Is there other way to detect images from low brightness images? thanks.

Dlib face detector is a very precise one. But as a cost it has low recall, especially when images are bad and/or faces are small.
Try another face detector, like
Seeta https://github.com/seetaface/SeetaFaceEngine
Pico https://github.com/nenadmarkus/pico
or OpenCV
Those may provide detections. But false detections as well.

Related

How to stabilize facial landmarks from Dlib or Mediapipe?

I'm using dlib and mediapipe to get facial landmarks arround a face image. My question is about the jittering. In Mediapipe, the researchers advise us to use temporal filter like the one euro filter to reduce the jittering. But I noticed that, in two consecutives frames that are similar, without mouvement, the facial landmarks is not stable. So I observe the detected bounding box arround the face, and it is not stable too. Is it a common solution to stabilized the detected bounding box before the estimation of the facial landmarks?

Opencv haar cascade negative images

I want to make an object detector with OpenCV haarcascade. When my project is working, the background will be always white.
How should I add negative images?
Thank you for your support.

How to Detect Only Hand Movement using OpenCV HSV and Background Subtraction?

I am having difficulty creating a detector for hand and its movement due to the program didn't run when I put BgSubtraction and HSV codes altogether. It can only run with HSV code with the following result
The code is in python and I got it from OpenCV doc with a few modifications
here's the link
What I want is for the camera to detect only the hand model without noise and the background, I read it in a journal and it needs HSV Thresholding and Background Subtraction. Is it possible? Any solution?
Thank you.

Using a different face detector with dlib's landmark detector

I am currently working on a python implementation of Adrian Rosebrock's video blink detector with dlib blog post:
https://www.pyimagesearch.com/author/adrian/
Basically, I am using dlib's frontal face detector and passing the bounding box around the face to dlib's landmark detector as seen in this picture:
https://imgur.com/xvkfNeG
Sometimes dlib's frontal face detector doesn't find a face, but other face detectors like OpenCV's do. Adrian's blog made it sound like I could use openCV's frontal face detector and pass the bounding box along instead.
However when I do this the landmark detector can't find the eyes of the person correctly as seen in this photo:
https://imgur.com/3eAFFsQ
Is there way I could use an alternative face detector with dlib's landmark detector? Or am I stuck using dlib's frontal face detector because the bounding box passed by a different face detector will be ever so slightly incorrect for the dlib landmark detector?
Thank you for your time!
Checking the images you are providing it just look like you are not passing the correct parameters to the plotting method. The results look correct, just upside-down.
You can use your own face detector. You just have to use dlib.rectangle() function. First, find the bounding boxes from your face detector and after that map them to dlib.rectangle(x,y,w,h).
Then you can pass the bounding boxes from this list to predictor(img, rect).

dlib face detection failing to catch

Ive been exploring dlib's face detector over its python API. On most images in my data set it seems to perform slightly better than cv2 on most images so I kept playing around with it on multiple faces in picture scenarios.
Going through dlib's python examples it seems like it would be possible to train these images but I am wondering if anyone has a suggestion how to make sure that the two faces on the far left and right are detected out of the box?
This is he image that I am having trouble finding all 6 faces on (https://images2.onionstatic.com/onionstudios/6215/original/600.jpg)
Dlib has a very precise face detector. But it works bad detecting not frontal (like far left) and/or occluded faces (like far right).
Seeta (https://github.com/seetaface/SeetaFaceEngine) works better with those. But it's less precise.
Also I tried retraining Dlib's face detector. And obtained much lower precise than DLIB and less recall than Seeta. So, re-training DLIB seems not perfect idea.
In my experience, Dlib does not do very well out of the box with obscured and profile faces out of the box. I would recommend training Dlib with more data of this kind.

Categories

Resources