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

            if (!(detections.Value is OpenCVForUnityPlayMakerActions.MatOfRotatedRect))
            {
                LogError("detections is not initialized. Add Action \"newMatOfRotatedRect\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfRotatedRect wrapped_detections = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfRotatedRect, OpenCVForUnity.CoreModule.MatOfRotatedRect>(detections);

            wrapped_owner.detectTextRectangles(wrapped_frame, wrapped_detections);
        }
Beispiel #2
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.TextDetectionModel))
            {
                LogError("owner is not initialized. Add Action \"newTextDetectionModel\".");
                return;
            }
            OpenCVForUnity.DnnModule.TextDetectionModel wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.TextDetectionModel, OpenCVForUnity.DnnModule.TextDetectionModel>(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.MatOfPoint> wrapped_detections = new List <OpenCVForUnity.CoreModule.MatOfPoint>();

            OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.MatOfPoint, OpenCVForUnity.CoreModule.MatOfPoint>(detections, wrapped_detections);

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

            wrapped_owner.detect(wrapped_frame, wrapped_detections, wrapped_confidences);

            OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.MatOfPoint, OpenCVForUnityPlayMakerActions.MatOfPoint>(wrapped_detections, detections);
        }
 public TextDetectionModel(OpenCVForUnity.DnnModule.TextDetectionModel nativeObj) : base(nativeObj)
 {
 }