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

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

            if (!(Bbox.Value is OpenCVForUnityPlayMakerActions.MatOfRect))
            {
                LogError("Bbox is not initialized. Add Action \"newMatOfRect\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfRect wrapped_Bbox = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfRect, OpenCVForUnity.CoreModule.MatOfRect>(Bbox);

            if (!(confidence.Value is OpenCVForUnityPlayMakerActions.MatOfFloat))
            {
                LogError("confidence is not initialized. Add Action \"newMatOfFloat\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfFloat wrapped_confidence = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfFloat, OpenCVForUnity.CoreModule.MatOfFloat>(confidence);

            wrapped_owner.detect(wrapped_inputImage, wrapped_Bbox, wrapped_confidence);
        }