paolobenve/myphotoshare

How to use OpenCV face detection?

Closed this issue · 4 comments

How can we check the results of OpenCV face detection used for the creation of the thumbnails?

Even if I've installed python-opencv dependencies, some thumbnails are not centered on the face on the picture.

  1. Is there a debug mode in the scanner to check that OpenCV is actually running?
  2. When OpenCV runs, can we check the results of face detection? For instance, by drawing a square around the face it targeted in the original picture.

It would be good to have these debug options in the myphotoshare.conf file.

opencv docs explain that a tweaking of some parameter may be needed. I don't think there is an optimal value, perhapes depending on the image, a different optimal value could be used if looking for it interactively. In an automated app like the scanner "best" option has to be used, or perhaps add another option for tweaking that value.

I moved into the options file the possibility to show the images with detected face

I added an option for modifying the scale factor too, face_cascade_scale_factor.

Is there a debug mode in the scanner to check that OpenCV is actually running?

Yes, the scanner outputs the messages with the face detection result (as numbers), activating the show_faces option should stop at every detection and show the image with squares where the faces are detected, and eyes too.

In my (little) experience the global result of face detection is quite good: it is worth using it!

Can we close this issue?

Yes, you can close it.
I'm going to test it and write documentation on it.

closing