Trial 04022025
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user