void DoProcess()
        {
            if (!(contour.Value is OpenCVForUnityPlayMakerActions.MatOfPoint))
            {
                LogError("contour is not initialized. Add Action \"newMatOfPoint\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfPoint wrapped_contour = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfPoint, OpenCVForUnity.CoreModule.MatOfPoint>(contour);

            if (!(convexhull.Value is OpenCVForUnityPlayMakerActions.MatOfInt))
            {
                LogError("convexhull is not initialized. Add Action \"newMatOfInt\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfInt wrapped_convexhull = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(convexhull);

            if (!(convexityDefects.Value is OpenCVForUnityPlayMakerActions.MatOfInt4))
            {
                LogError("convexityDefects is not initialized. Add Action \"newMatOfInt4\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfInt4 wrapped_convexityDefects = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt4, OpenCVForUnity.CoreModule.MatOfInt4>(convexityDefects);

            OpenCVForUnity.ImgprocModule.Imgproc.convexityDefects(wrapped_contour, wrapped_convexhull, wrapped_convexityDefects);
        }
コード例 #2
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.MatOfInt4))
            {
                LogError("owner is not initialized. Add Action \"newMatOfInt4\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfInt4 wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt4, OpenCVForUnity.CoreModule.MatOfInt4>(owner);

            wrapped_owner.alloc(elemNumber.Value);
        }
コード例 #3
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.MatOfInt4))
            {
                LogError("owner is not initialized. Add Action \"newMatOfInt4\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfInt4 wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt4, OpenCVForUnity.CoreModule.MatOfInt4>(owner);

            int[]      int_lb     = lb.intValues;
            List <int> wrapped_lb = new List <int>(int_lb);

            wrapped_owner.fromList(wrapped_lb);

            for (int i = 0; i < wrapped_lb.Count; i++)
            {
                lb.Set(i, (int)wrapped_lb[i]);
            }
            lb.SaveChanges();
        }
コード例 #4
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.MatOfInt4))
            {
                LogError("owner is not initialized. Add Action \"newMatOfInt4\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfInt4 wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt4, OpenCVForUnity.CoreModule.MatOfInt4>(owner);

            List <int> 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, (int)wrapped_storeResult[i]);
                }
                storeResult.SaveChanges();
            }
        }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.MatOfInt4))
            {
                LogError("owner is not initialized. Add Action \"newMatOfInt4\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfInt4 wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt4, OpenCVForUnity.CoreModule.MatOfInt4>(owner);

            int[] int_a    = a.intValues;
            int[] casted_a = new int[int_a.Length];
            for (int i = 0; i < casted_a.Length; i++)
            {
                casted_a[i] = (int)int_a[i];
            }

            wrapped_owner.fromArray(casted_a);

            for (int i = 0; i < casted_a.Length; i++)
            {
                a.Set(i, (int)casted_a[i]);
            }
            a.SaveChanges();
        }
コード例 #6
0
 public MatOfInt4(OpenCVForUnity.CoreModule.MatOfInt4 nativeObj) : base(nativeObj)
 {
 }