Ejemplo n.º 1
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.FaceRecognizer))
            {
                LogError("owner is not initialized. Add Action \"newFaceRecognizer\".");
                return;
            }
            OpenCVForUnity.FaceModule.FaceRecognizer wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.FaceRecognizer, OpenCVForUnity.FaceModule.FaceRecognizer>(owner);

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

            if (!(collector.Value is OpenCVForUnityPlayMakerActions.PredictCollector))
            {
                LogError("collector is not initialized. Add Action \"newPredictCollector\".");
                return;
            }
            OpenCVForUnity.FaceModule.PredictCollector wrapped_collector = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.PredictCollector, OpenCVForUnity.FaceModule.PredictCollector>(collector);

            wrapped_owner.predict_collect(wrapped_src, wrapped_collector);
        }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.FaceRecognizer))
            {
                LogError("owner is not initialized. Add Action \"newFaceRecognizer\".");
                return;
            }
            OpenCVForUnity.FaceModule.FaceRecognizer wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.FaceRecognizer, OpenCVForUnity.FaceModule.FaceRecognizer>(owner);

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

            wrapped_owner.write(filename.Value);
        }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.FaceRecognizer))
            {
                LogError("owner is not initialized. Add Action \"newFaceRecognizer\".");
                return;
            }
            OpenCVForUnity.FaceModule.FaceRecognizer wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.FaceRecognizer, OpenCVForUnity.FaceModule.FaceRecognizer>(owner);

            if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.MatOfInt))
            {
                storeResult.Value = new OpenCVForUnityPlayMakerActions.MatOfInt();
            }
            ((OpenCVForUnityPlayMakerActions.MatOfInt)storeResult.Value).wrappedObject = wrapped_owner.getLabelsByString(str.Value);
        }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.FaceRecognizer))
            {
                LogError("owner is not initialized. Add Action \"newFaceRecognizer\".");
                return;
            }
            OpenCVForUnity.FaceModule.FaceRecognizer wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.FaceRecognizer, OpenCVForUnity.FaceModule.FaceRecognizer>(owner);

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

            int[] int_label    = label.intValues;
            int[] casted_label = new int[int_label.Length];
            for (int i = 0; i < casted_label.Length; i++)
            {
                casted_label[i] = (int)int_label[i];
            }

            float[]  float_confidence  = confidence.floatValues;
            double[] casted_confidence = new double[float_confidence.Length];
            float_confidence.CopyTo(casted_confidence, 0);

            wrapped_owner.predict(wrapped_src, casted_label, casted_confidence);

            for (int i = 0; i < casted_label.Length; i++)
            {
                label.Set(i, (int)casted_label[i]);
            }
            label.SaveChanges();

            for (int i = 0; i < casted_confidence.Length; i++)
            {
                confidence.Set(i, (float)casted_confidence[i]);
            }
            confidence.SaveChanges();
        }
Ejemplo n.º 6
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.FaceRecognizer))
            {
                LogError("owner is not initialized. Add Action \"newFaceRecognizer\".");
                return;
            }
            OpenCVForUnity.FaceModule.FaceRecognizer wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.FaceRecognizer, OpenCVForUnity.FaceModule.FaceRecognizer>(owner);

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

            OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(src, wrapped_src);

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

            wrapped_owner.update(wrapped_src, wrapped_labels);

            OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.Mat, OpenCVForUnityPlayMakerActions.Mat>(wrapped_src, src);
        }
Ejemplo n.º 7
0
 public FaceRecognizer(OpenCVForUnity.FaceModule.FaceRecognizer nativeObj) : base(nativeObj)
 {
 }