Some faces not detection
Hello members, This is my first question on this forum. Just, I started project on openCV. By using java file I am uploading image after uploading it detect faces and make rectangle to face. In my image there are 14 faces and its detecting 12 faces.
this is code
String file ="C:/EXAMPLES/OpenCV/group12.jpg";
Mat src = Imgcodecs.imread(file);
// Instantiating the CascadeClassifier
String xmlFile = "C:/EXAMPLES/facedetect/lbpcascade_frontalface.xml";
CascadeClassifier classifier = new CascadeClassifier(xmlFile);
// Detecting the face in the snap
MatOfRect faceDetections = new MatOfRect();
classifier.detectMultiScale(src, faceDetections);
System.out.println(String.format("Detected %s faces",
faceDetections.toArray().length));
// Drawing boxes
for (Rect rect : faceDetections.toArray()) {
Imgproc.rectangle(
src, // where to draw the box
new Point(rect.x, rect.y), // bottom left
new Point(rect.x + rect.width, rect.y + rect.height), // top right
new Scalar(0, 0, 255),
3 // RGB colour
);
}
try another cascade (e.g. one with glasses)
(the guy on the right -- that's uncureable, he's looking away from the cam, no full face visible)
ok one guy looking down, but red shirt guy also not recognized, other person also has glass
@berak , i am waiting for ur reply
what do you want, or even expect ? try some things, live with the outcome.
(i don't think, there's much we can do here)