How to detect faces with jviolajones library?
-
27-10-2019 - |
Pergunta
I'm trying count faces in the picture with jviolajones library. I want to do this in pure Java with no extra dependencies so OpenCV is not an option. My code is like:
detector.getFaces("filePath", 1.2f,1.1f,.05f, 2,true);
I've tried haarcascade_frontalface_alt and haarcascade_frontalface_default from OpenCV. But results are bad about 5 pictures recognized good for 30 tested. I've tried adjust parameters but it didn't help. Any suggestion for better results, or maybe another library. I was wondering, maybe I have to prepare pictures before detecting faces?
Solução
This works:
detector.getFaces("filePath", 1.2f,1.1f,.05f, 2,true);
But I had to scaled my photos to 640x480 and transform them to gray, this works with haarcascade_frontalface_default.xml classifier from OpenCV.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow