void DoProcess() { if (!(imgMat.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("imgMat is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_imgMat = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat> (imgMat); if (!(color.Value is OpenCVForUnityPlayMakerActions.Scalar)) { LogError("color is not initialized. Add Action \"newScalar\"."); return; } OpenCVForUnity.CoreModule.Scalar wrapped_color = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Scalar, OpenCVForUnity.CoreModule.Scalar> (color); List <UnityEngine.Vector2> wrapped_points = new List <UnityEngine.Vector2> (points.Length); for (int i = 0; i < points.Length; i++) { wrapped_points.Add((Vector2)points.Get(i)); } OpenCVForUnityUtils.DrawFaceLandmark(wrapped_imgMat, wrapped_points, wrapped_color, thickness.Value); }
void DoProcess() { if (!(imgMat.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("imgMat is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_imgMat = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat> (imgMat); OpenCVForUnityUtils.DrawFaceRect(wrapped_imgMat, rect.Value, new OpenCVForUnity.CoreModule.Scalar((double)color_v0.Value, (double)color_v1.Value, (double)color_v2.Value, (double)color_v3.Value), thickness.Value); }
void DoProcess() { if (!(faceLandmarkDetector.Value is DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector)) { LogError("faceLandmarkDetector is not initialized. Add Action \"newFaceLandmarkDetector\"."); return; } DlibFaceLandmarkDetector.FaceLandmarkDetector wrapped_faceLandmarkDetector = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector, DlibFaceLandmarkDetector.FaceLandmarkDetector> (faceLandmarkDetector); if (!(imgMat.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("imgMat is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_imgMat = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat> (imgMat); OpenCVForUnityUtils.SetImage(wrapped_faceLandmarkDetector, wrapped_imgMat); }
void DoProcess () { if (!(imgMat.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError ("imgMat is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_imgMat = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject<OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat> (imgMat); if (!(color.Value is OpenCVForUnityPlayMakerActions.Scalar)) { LogError ("color is not initialized. Add Action \"newScalar\"."); return; } OpenCVForUnity.CoreModule.Scalar wrapped_color = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject<OpenCVForUnityPlayMakerActions.Scalar, OpenCVForUnity.CoreModule.Scalar> (color); OpenCVForUnityUtils.DrawFaceRect (wrapped_imgMat, rect.Value, wrapped_color, thickness.Value); }