Trial 04022025

This commit is contained in:
2025-02-04 08:48:28 +07:00
parent a60fe56510
commit 29884c03ed
24 changed files with 16423 additions and 158594 deletions

View File

@@ -39,7 +39,7 @@ import java.time.LocalDateTime;
import java.util.concurrent.atomic.AtomicBoolean;
import static Config.SomeCodes.*;
import static id.co.gtc.erhacam.Detectors.faceDetector;
import static id.co.gtc.erhacam.Detectors.frontalfaceDetector;
import static org.bytedeco.opencv.global.opencv_core.CV_8UC3;
import static org.bytedeco.opencv.global.opencv_core.mean;
import static org.bytedeco.opencv.global.opencv_imgcodecs.imwrite;
@@ -706,12 +706,12 @@ public class Cameradetail_Arducam {
if (use_face){
RectVector face = DetectFace(graymat);
if (face!=null && face.size()>0){
if (event!=null) event.onFaceDetector(true,photoWidth, photoHeight);
if (event!=null) event.onFrontalFaceDetector(true,photoWidth, photoHeight);
for(int i=0; i<face.size(); i++){
val rect = face.get(i);
rectangle(umat, rect, Scalar.GREEN);
}
} else if (event!=null) event.onFaceDetector(false, photoWidth, photoHeight);
} else if (event!=null) event.onFrontalFaceDetector(false, photoWidth, photoHeight);
}
@@ -783,9 +783,9 @@ public class Cameradetail_Arducam {
* @return true if face detected, otherwise false
*/
private RectVector DetectFace(UMat graymat){
if (faceDetector!=null){
if (frontalfaceDetector!=null){
val face = new RectVector();
faceDetector.detectMultiScale(graymat, face);
frontalfaceDetector.detectMultiScale(graymat, face);
return face;
}
return null;