Commit 25042025

This commit is contained in:
2025-05-05 15:46:15 +07:00
parent 257eb50640
commit 2cf206b306
7 changed files with 143 additions and 29 deletions

View File

@@ -14,7 +14,7 @@ public class Detectors {
private static CascadeClassifier eyeDetector;
private static CascadeClassifier profilefaceDetector;
private static double scaleFactor = 1.1;
private static double scaleFactor = 1.05;
private final static int minNeighbors = 3;
private final static int flags = 0;
private static Size FaceminSize;
@@ -94,7 +94,10 @@ public class Detectors {
dr.setFace(face);
if (eyes!=null && eyes.size()>=2){
for(Rect eye : eyes.get()){
if (SomeCodes.IsInsideRect(eye, face)) dr.AddEye(eye);
if (SomeCodes.IsInsideRect(eye, face)) {
dr.AddEye(eye);
System.out.println("face width : " + face.width() + " eye width : " + eye.width());
}
}
}
result.add(dr);
@@ -180,7 +183,7 @@ public class Detectors {
*/
public static RectVector DetectEye(UMat graymat, int facewidth){
//return Detect(graymat, eyeDetector);
int minwidth = Math.max((int)(facewidth*0.25), 24);
int minwidth = (int)(facewidth*0.2);
int maxwidth = (int)(facewidth*0.4);
Size minsize = new Size(minwidth, minwidth);
Size maxsize = new Size(maxwidth, maxwidth);