예제 #1
0
 /// <summary>
 /// Draws a face rect.
 /// </summary>
 /// <param name="imgMat">Image mat.</param>
 /// <param name="rect">RectDetection.</param>
 /// <param name="color">Color.</param>
 /// <param name="thickness">Thickness.</param>
 public static void DrawFaceRect(Mat imgMat, DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection rect, Scalar color, int thickness)
 {
     UnityEngine.Rect _rect = rect.rect;
     Imgproc.putText(imgMat, "detection_confidence : " + rect.detection_confidence, new Point(_rect.xMin, _rect.yMin - 20), Imgproc.FONT_HERSHEY_SIMPLEX, 0.5, new Scalar(255, 255, 255, 255), 1, Imgproc.LINE_AA, false);
     Imgproc.putText(imgMat, "weight_index : " + rect.weight_index, new Point(_rect.xMin, _rect.yMin - 5), Imgproc.FONT_HERSHEY_SIMPLEX, 0.5, new Scalar(255, 255, 255, 255), 1, Imgproc.LINE_AA, false);
     Imgproc.rectangle(imgMat, new Point(_rect.xMin, _rect.yMin), new Point(_rect.xMax, _rect.yMax), color, thickness);
 }
예제 #2
0
        void DoProcess()
        {
            if (!(owner.Value is DlibFaceLandmarkDetectorPlayMakerActions.RectDetection))
            {
                LogError("owner is not initialized. Add Action \"newRectDetection\".");
                return;
            }
            DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection wrapped_owner = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.RectDetection, DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection> (owner);


            storeResult.Value = wrapped_owner.rect;
        }
        void DoProcess()
        {
            if (!(owner.Value is DlibFaceLandmarkDetectorPlayMakerActions.RectDetection))
            {
                LogError("owner is not initialized. Add Action \"newRectDetection\".");
                return;
            }
            DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection wrapped_owner = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.RectDetection, DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection> (owner);


            if (!(storeResult.Value is DlibFaceLandmarkDetectorPlayMakerActions.Double))
            {
                storeResult.Value = new DlibFaceLandmarkDetectorPlayMakerActions.Double();
            }
            ((DlibFaceLandmarkDetectorPlayMakerActions.Double)storeResult.Value).wrappedObject = wrapped_owner.detection_confidence;
        }
 public RectDetection(DlibFaceLandmarkDetector.FaceLandmarkDetector.RectDetection nativeObj)
     : base(nativeObj)
 {
 }