Exemple #1
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.Tracker))
            {
                LogError("owner is not initialized. Add Action \"newTracker\".");
                return;
            }
            OpenCVForUnity.VideoModule.Tracker wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Tracker, OpenCVForUnity.VideoModule.Tracker>(owner);

            if (!(image.Value is OpenCVForUnityPlayMakerActions.Mat))
            {
                LogError("image is not initialized. Add Action \"newMat\".");
                return;
            }
            OpenCVForUnity.CoreModule.Mat wrapped_image = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(image);

            if (!(boundingBox.Value is OpenCVForUnityPlayMakerActions.Rect))
            {
                LogError("boundingBox is not initialized. Add Action \"newRect\".");
                return;
            }
            OpenCVForUnity.CoreModule.Rect wrapped_boundingBox = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect, OpenCVForUnity.CoreModule.Rect>(boundingBox);

            wrapped_owner.init(wrapped_image, wrapped_boundingBox);
        }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.Tracker))
            {
                LogError("owner is not initialized. Add Action \"newTracker\".");
                return;
            }
            OpenCVForUnity.VideoModule.Tracker wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Tracker, OpenCVForUnity.VideoModule.Tracker>(owner);

            if (!(image.Value is OpenCVForUnityPlayMakerActions.Mat))
            {
                LogError("image is not initialized. Add Action \"newMat\".");
                return;
            }
            OpenCVForUnity.CoreModule.Mat wrapped_image = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(image);

            wrapped_owner.init(wrapped_image, new OpenCVForUnity.CoreModule.Rect((int)boundingBox_x.Value, (int)boundingBox_y.Value, (int)boundingBox_width.Value, (int)boundingBox_height.Value));
        }