paolobenve / myphotoshare

MOVED TO GITLAB! --- A Web 2.0 Photo Gallery Done Right via Static JSON, Dynamic Javascript and a bit of php for sharing
15 stars 0 forks source link

How to use OpenCV face detection? #75

Closed pmetras closed 6 years ago

pmetras commented 6 years ago

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.

paolobenve commented 6 years ago

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

paolobenve commented 6 years ago

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?

pmetras commented 6 years ago

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

paolobenve commented 6 years ago

closing