void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.WeChatQRCode)) { LogError("owner is not initialized. Add Action \"newWeChatQRCode\"."); return; } OpenCVForUnity.Wechat_qrcodeModule.WeChatQRCode wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.WeChatQRCode, OpenCVForUnity.Wechat_qrcodeModule.WeChatQRCode>(owner); if (!(img.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("img is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_img = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(img); List <string> wrapped_storeResult = wrapped_owner.detectAndDecode(wrapped_img); if (!storeResult.IsNone) { if (storeResult.Length != wrapped_storeResult.Count) { storeResult.Resize(wrapped_storeResult.Count); } for (int i = 0; i < wrapped_storeResult.Count; i++) { storeResult.Set(i, (string)wrapped_storeResult[i]); } storeResult.SaveChanges(); } }
void DoProcess() { if (!(owner.Value is DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector)) { LogError("owner is not initialized. Add Action \"newFaceLandmarkDetector\"."); return; } DlibFaceLandmarkDetector.FaceLandmarkDetector wrapped_owner = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector, DlibFaceLandmarkDetector.FaceLandmarkDetector> (owner); if (!(adjust_threshold.Value is DlibFaceLandmarkDetectorPlayMakerActions.Double)) { LogError("adjust_threshold is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_adjust_threshold = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.Double, System.Double> (adjust_threshold); List <UnityEngine.Rect> wrapped_storeResult = wrapped_owner.Detect(wrapped_adjust_threshold); if (!storeResult.IsNone) { if (storeResult.Length != wrapped_storeResult.Count) { storeResult.Resize(wrapped_storeResult.Count); } for (int i = 0; i < wrapped_storeResult.Count; i++) { storeResult.Set(i, wrapped_storeResult[i]); } } }
void DoProcess() { if (!(owner.Value is DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector)) { LogError("owner is not initialized. Add Action \"newFaceLandmarkDetector\"."); return; } DlibFaceLandmarkDetector.FaceLandmarkDetector wrapped_owner = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector, DlibFaceLandmarkDetector.FaceLandmarkDetector> (owner); double[] casted_storeResult = wrapped_owner.DetectArray((float)adjust_threshold.Value); if (!storeResult.IsNone) { if (storeResult.Length != casted_storeResult.Length) { storeResult.Resize(casted_storeResult.Length); } for (int i = 0; i < casted_storeResult.Length; i++) { storeResult.Set(i, (float)casted_storeResult[i]); } storeResult.SaveChanges(); } }
void DoProcess() { if (!(owner.Value is DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector)) { LogError("owner is not initialized. Add Action \"newFaceLandmarkDetector\"."); return; } DlibFaceLandmarkDetector.FaceLandmarkDetector wrapped_owner = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector, DlibFaceLandmarkDetector.FaceLandmarkDetector> (owner); List <UnityEngine.Vector2> wrapped_storeResult = wrapped_owner.DetectLandmark((float)left.Value, (float)right.Value, (float)width.Value, (float)height.Value); if (!storeResult.IsNone) { if (storeResult.Length != wrapped_storeResult.Count) { storeResult.Resize(wrapped_storeResult.Count); } for (int i = 0; i < wrapped_storeResult.Count; i++) { storeResult.Set(i, wrapped_storeResult[i]); } } }
void DoProcess() { if (!(src.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("src is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_src = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(src); if (!(mtxR.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("mtxR is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_mtxR = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(mtxR); if (!(mtxQ.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("mtxQ is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_mtxQ = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(mtxQ); if (!(Qx.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("Qx is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_Qx = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(Qx); if (!(Qy.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("Qy is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_Qy = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(Qy); if (!(Qz.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("Qz is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_Qz = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(Qz); double[] casted_storeResult = OpenCVForUnity.Calib3dModule.Calib3d.RQDecomp3x3(wrapped_src, wrapped_mtxR, wrapped_mtxQ, wrapped_Qx, wrapped_Qy, wrapped_Qz); if (!storeResult.IsNone) { if (storeResult.Length != casted_storeResult.Length) { storeResult.Resize(casted_storeResult.Length); } for (int i = 0; i < casted_storeResult.Length; i++) { storeResult.Set(i, (float)casted_storeResult[i]); } storeResult.SaveChanges(); } }
void DoProcess() { if (!(owner.Value is DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector)) { LogError("owner is not initialized. Add Action \"newFaceLandmarkDetector\"."); return; } DlibFaceLandmarkDetector.FaceLandmarkDetector wrapped_owner = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector, DlibFaceLandmarkDetector.FaceLandmarkDetector> (owner); if (!(left.Value is DlibFaceLandmarkDetectorPlayMakerActions.Double)) { LogError("left is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_left = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.Double, System.Double> (left); if (!(right.Value is DlibFaceLandmarkDetectorPlayMakerActions.Double)) { LogError("right is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_right = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.Double, System.Double> (right); if (!(width.Value is DlibFaceLandmarkDetectorPlayMakerActions.Double)) { LogError("width is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_width = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.Double, System.Double> (width); if (!(height.Value is DlibFaceLandmarkDetectorPlayMakerActions.Double)) { LogError("height is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_height = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.Double, System.Double> (height); List <UnityEngine.Vector2> wrapped_storeResult = wrapped_owner.DetectLandmark(wrapped_left, wrapped_right, wrapped_width, wrapped_height); if (!storeResult.IsNone) { if (storeResult.Length != wrapped_storeResult.Count) { storeResult.Resize(wrapped_storeResult.Count); } for (int i = 0; i < wrapped_storeResult.Count; i++) { storeResult.Set(i, wrapped_storeResult[i]); } } }
void DoProcess() { if (!(owner.Value is DlibFaceLandmarkDetectorPlayMakerActions.DoubleArray)) { owner.Value = new DlibFaceLandmarkDetectorPlayMakerActions.DoubleArray(new System.Double[0]); } System.Double[] wrapped_owner = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.DoubleArray, System.Double[]> (owner); storeResult.Resize(wrapped_owner.Length); for (int i = 0; i < wrapped_owner.Length; i++) { storeResult.Set(i, (float)wrapped_owner[i]); } }
void DoProcess() { List <int> wrapped_storeResult = OpenCVForUnity.DnnModule.Dnn.getAvailableTargets(be.Value); if (!storeResult.IsNone) { if (storeResult.Length != wrapped_storeResult.Count) { storeResult.Resize(wrapped_storeResult.Count); } for (int i = 0; i < wrapped_storeResult.Count; i++) { storeResult.Set(i, (int)wrapped_storeResult[i]); } storeResult.SaveChanges(); } }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.CharArray)) { owner.Value = new OpenCVForUnityPlayMakerActions.CharArray(new System.Char[0]); } System.Char[] wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.CharArray, System.Char[]>(owner); storeResult.Resize(wrapped_owner.Length); for (int i = 0; i < wrapped_owner.Length; i++) { storeResult.Set(i, (string)wrapped_owner[i].ToString()); } storeResult.SaveChanges(); }
public static void ConvertArrayToFsmArray <V, T> (V[] array, HutongGames.PlayMaker.FsmArray fsmArray) where T : DlibFaceLandmarkDetectorPlayMakerActions.DlibObject, new () { if (fsmArray.Length != array.Length) { fsmArray.Resize(array.Length); } for (int i = 0; i < array.Length; i++) { if (fsmArray.Values[i] != null) { T tmp = (T)fsmArray.Values[i]; tmp.wrappedObject = array[i]; } else { T tmp = new T(); tmp.wrappedObject = array[i]; fsmArray.Set(i, tmp); } } }
public static void ConvertListToFsmArray <V, T> (List <V> list, HutongGames.PlayMaker.FsmArray fsmArray) where T : DlibFaceLandmarkDetectorPlayMakerActions.DlibObject, new () { if (fsmArray.Length != list.Count) { fsmArray.Resize(list.Count); } for (int i = 0; i < list.Count; i++) { if (fsmArray.Values[i] != null) { T tmp = (T)fsmArray.Values[i]; tmp.wrappedObject = list[i]; } else { T tmp = new T(); tmp.wrappedObject = list[i]; fsmArray.Set(i, tmp); } } }
public static void ConvertArrayToFsmArray <V, T>(V[] array, HutongGames.PlayMaker.FsmArray fsmArray) where T : OpenCVForUnityPlayMakerActions.OpenCVObject, new() { if (fsmArray.Length != array.Length) { fsmArray.Resize(array.Length); } for (int i = 0; i < array.Length; i++) { if (fsmArray.Values[i] != null) { T tmp = (T)fsmArray.Values[i]; tmp.wrappedObject = array[i]; } else { T tmp = new T(); tmp.wrappedObject = array[i]; fsmArray.Set(i, tmp); } } fsmArray.SaveChanges(); }
public static void ConvertListToFsmArray <V, T>(List <V> list, HutongGames.PlayMaker.FsmArray fsmArray) where T : OpenCVForUnityPlayMakerActions.OpenCVObject, new() { if (fsmArray.Length != list.Count) { fsmArray.Resize(list.Count); } for (int i = 0; i < list.Count; i++) { if (fsmArray.Values[i] != null) { T tmp = (T)fsmArray.Values[i]; tmp.wrappedObject = list[i]; } else { T tmp = new T(); tmp.wrappedObject = list[i]; fsmArray.Set(i, tmp); } } fsmArray.SaveChanges(); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.EM)) { LogError("owner is not initialized. Add Action \"newEM\"."); return; } OpenCVForUnity.MlModule.EM wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.EM, OpenCVForUnity.MlModule.EM>(owner); if (!(sample.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("sample is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_sample = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(sample); if (!(probs.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("probs is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_probs = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(probs); double[] casted_storeResult = wrapped_owner.predict2(wrapped_sample, wrapped_probs); if (!storeResult.IsNone) { if (storeResult.Length != casted_storeResult.Length) { storeResult.Resize(casted_storeResult.Length); } for (int i = 0; i < casted_storeResult.Length; i++) { storeResult.Set(i, (float)casted_storeResult[i]); } storeResult.SaveChanges(); } }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("owner is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(owner); int[] int_idx = idx.intValues; int[] casted_idx = new int[int_idx.Length]; for (int i = 0; i < casted_idx.Length; i++) { casted_idx[i] = (int)int_idx[i]; } double[] casted_storeResult = wrapped_owner.get(casted_idx); for (int i = 0; i < casted_idx.Length; i++) { idx.Set(i, (int)casted_idx[i]); } idx.SaveChanges(); if (!storeResult.IsNone) { if (storeResult.Length != casted_storeResult.Length) { storeResult.Resize(casted_storeResult.Length); } for (int i = 0; i < casted_storeResult.Length; i++) { storeResult.Set(i, (float)casted_storeResult[i]); } storeResult.SaveChanges(); } }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); List <string> wrapped_storeResult = wrapped_owner.getLayerNames(); if (!storeResult.IsNone) { if (storeResult.Length != wrapped_storeResult.Count) { storeResult.Resize(wrapped_storeResult.Count); } for (int i = 0; i < wrapped_storeResult.Count; i++) { storeResult.Set(i, (string)wrapped_storeResult[i]); } storeResult.SaveChanges(); } }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.MatOfFloat4)) { LogError("owner is not initialized. Add Action \"newMatOfFloat4\"."); return; } OpenCVForUnity.CoreModule.MatOfFloat4 wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfFloat4, OpenCVForUnity.CoreModule.MatOfFloat4>(owner); List <float> wrapped_storeResult = wrapped_owner.toList(); if (!storeResult.IsNone) { if (storeResult.Length != wrapped_storeResult.Count) { storeResult.Resize(wrapped_storeResult.Count); } for (int i = 0; i < wrapped_storeResult.Count; i++) { storeResult.Set(i, (float)wrapped_storeResult[i]); } storeResult.SaveChanges(); } }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.MatOfFloat6)) { LogError("owner is not initialized. Add Action \"newMatOfFloat6\"."); return; } OpenCVForUnity.CoreModule.MatOfFloat6 wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfFloat6, OpenCVForUnity.CoreModule.MatOfFloat6>(owner); float[] casted_storeResult = wrapped_owner.toArray(); if (!storeResult.IsNone) { if (storeResult.Length != casted_storeResult.Length) { storeResult.Resize(casted_storeResult.Length); } for (int i = 0; i < casted_storeResult.Length; i++) { storeResult.Set(i, (float)casted_storeResult[i]); } storeResult.SaveChanges(); } }