commit 27/2025
Tambah Crop Setting
This commit is contained in:
@@ -24,8 +24,14 @@ public class DetectorResult {
|
||||
Eyes.add(eye);
|
||||
}
|
||||
|
||||
// trouble di sini
|
||||
public void FaceRectangle(UMat mat){
|
||||
if (mat == null || mat.empty()) return;
|
||||
if (Face == null || Face.width() <= 0 || Face.height() <= 0) return;
|
||||
if (Face.x() < 0 || Face.y() < 0) return; // ignore negative coordinates
|
||||
if (Face.x() + Face.width() > mat.cols() || Face.y() + Face.height() > mat.rows()) return; // ignore out of bounds
|
||||
if (haveFace()){
|
||||
|
||||
try{
|
||||
rectangle(mat, Face, Scalar.GREEN, linethickness, linetype, lineshift);
|
||||
|
||||
@@ -33,9 +39,17 @@ public class DetectorResult {
|
||||
}
|
||||
}
|
||||
|
||||
// trouble di sini
|
||||
public void EyesRectangle(UMat mat){
|
||||
if (mat == null || mat.empty()) return;
|
||||
|
||||
if (haveEyes()){
|
||||
|
||||
for(Rect eye : Eyes){
|
||||
if (eye == null || eye.width() <= 0 || eye.height() <= 0) continue;
|
||||
if (eye.x() < 0 || eye.y() < 0) continue; // ignore negative coordinates
|
||||
if (eye.x() + eye.width() > mat.cols() || eye.y() + eye.height() > mat.rows()) continue; // ignore out of bounds
|
||||
|
||||
try{
|
||||
rectangle(mat, eye, Scalar.BLUE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user