void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.TextRecognitionModel))
            {
                LogError("owner is not initialized. Add Action \"newTextRecognitionModel\".");
                return;
            }
            OpenCVForUnity.DnnModule.TextRecognitionModel wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.TextRecognitionModel, OpenCVForUnity.DnnModule.TextRecognitionModel>(owner);

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

            List <OpenCVForUnity.CoreModule.Mat> wrapped_roiRects = new List <OpenCVForUnity.CoreModule.Mat>();

            OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(roiRects, wrapped_roiRects);

            string[]      string_results  = results.stringValues;
            List <string> wrapped_results = new List <string>(string_results);

            wrapped_owner.recognize(wrapped_frame, wrapped_roiRects, wrapped_results);

            OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.Mat, OpenCVForUnityPlayMakerActions.Mat>(wrapped_roiRects, roiRects);

            for (int i = 0; i < wrapped_results.Count; i++)
            {
                results.Set(i, (string)wrapped_results[i]);
            }
            results.SaveChanges();
        }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.TextRecognitionModel))
            {
                LogError("owner is not initialized. Add Action \"newTextRecognitionModel\".");
                return;
            }
            OpenCVForUnity.DnnModule.TextRecognitionModel wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.TextRecognitionModel, OpenCVForUnity.DnnModule.TextRecognitionModel>(owner);

            storeResult.Value = wrapped_owner.getDecodeType();
        }
Ejemplo n.º 3
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.TextRecognitionModel))
            {
                LogError("owner is not initialized. Add Action \"newTextRecognitionModel\".");
                return;
            }
            OpenCVForUnity.DnnModule.TextRecognitionModel wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.TextRecognitionModel, OpenCVForUnity.DnnModule.TextRecognitionModel>(owner);

            if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.TextRecognitionModel))
            {
                storeResult.Value = new OpenCVForUnityPlayMakerActions.TextRecognitionModel();
            }
            ((OpenCVForUnityPlayMakerActions.TextRecognitionModel)storeResult.Value).wrappedObject = wrapped_owner.setDecodeOptsCTCPrefixBeamSearch(beamSize.Value);
        }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.TextRecognitionModel))
            {
                LogError("owner is not initialized. Add Action \"newTextRecognitionModel\".");
                return;
            }
            OpenCVForUnity.DnnModule.TextRecognitionModel wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.TextRecognitionModel, OpenCVForUnity.DnnModule.TextRecognitionModel>(owner);

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

            storeResult.Value = wrapped_owner.recognize(wrapped_frame);
        }
Ejemplo n.º 5
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.TextRecognitionModel))
            {
                LogError("owner is not initialized. Add Action \"newTextRecognitionModel\".");
                return;
            }
            OpenCVForUnity.DnnModule.TextRecognitionModel wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.TextRecognitionModel, OpenCVForUnity.DnnModule.TextRecognitionModel>(owner);

            List <string> wrapped_storeResult = wrapped_owner.getVocabulary();

            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();
            }
        }
Ejemplo n.º 6
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.TextRecognitionModel))
            {
                LogError("owner is not initialized. Add Action \"newTextRecognitionModel\".");
                return;
            }
            OpenCVForUnity.DnnModule.TextRecognitionModel wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.TextRecognitionModel, OpenCVForUnity.DnnModule.TextRecognitionModel>(owner);

            string[]      string_vocabulary  = vocabulary.stringValues;
            List <string> wrapped_vocabulary = new List <string>(string_vocabulary);

            if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.TextRecognitionModel))
            {
                storeResult.Value = new OpenCVForUnityPlayMakerActions.TextRecognitionModel();
            }
            ((OpenCVForUnityPlayMakerActions.TextRecognitionModel)storeResult.Value).wrappedObject = wrapped_owner.setVocabulary(wrapped_vocabulary);

            for (int i = 0; i < wrapped_vocabulary.Count; i++)
            {
                vocabulary.Set(i, (string)wrapped_vocabulary[i]);
            }
            vocabulary.SaveChanges();
        }
Ejemplo n.º 7
0
 public TextRecognitionModel(OpenCVForUnity.DnnModule.TextRecognitionModel nativeObj) : base(nativeObj)
 {
 }