0

I have a collection of face images, with 1 or sometimes 2 faces in each image. What I wanna do, is find the face in each image and then crop It. I've tested a couple of methods, which are implemented in python using openCV, but the results weren't that good. These methods are:

1- Implementation 1

2- Implementation 2

There's one more model that I've tested, but I'm not allowed to post more than two links. The problem is that these Haar-Feature based algorithms, are not robust to face size, and when I tried them on images which were taken close to the face, they couldn't find any faces. Someone mentioned to try deep learning based algorithms, but I couldn't find one corresponding to what I want to do. Basically, I guess I need a pre-trained model, which can give me the coordinates of the face bounding box in the image, or better, a pre-trained model which gives out the cropped face image as output.

L1nu5
  • 79
  • 2
  • 9
  • 1
    You need to understood face detection parameters of OpenCV. **scaleFactor(This parameter strongly affects to performance)** and minNeighbors etc. – Sagar Patel Sep 27 '17 at 11:15

1 Answers1

2

You don't need machine learning algorithms, Graph-Algorithms is enough. For example Snapchats face recognition algorithm works as follows:

  1. Create a Graph with Nodes and Edges from a most common Face ("Standard Face").

  2. Deform that Graph / Recoordinate the Nodes to the fitted pixels in the Input Image

  3. voila you got the face recognized in the Input Image.

Easy said, but harder to code. We implemented in our university the Dijkstra Algorithm for example and I can hand you my "Graph" Class if you need it. But I wrote it in C++.

With these graph-algorithm you can crop out the faces more efficient.

Rebar
  • 1,076
  • 10
  • 19
  • Is this the same as dlib's face and face landmark detector? And if you have the Graph class ob Github that will help many of us. – Totoro Sep 28 '17 at 00:59