예제 #1
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.DMatch))
            {
                LogError("owner is not initialized. Add Action \"newDMatch\".");
                return;
            }
            OpenCVForUnity.CoreModule.DMatch wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.DMatch, OpenCVForUnity.CoreModule.DMatch>(owner);

            storeResult.Value = wrapped_owner.lessThan(new OpenCVForUnity.CoreModule.DMatch((int)it_queryIdx.Value, (int)it_trainIdx.Value, (int)it_imgIdx.Value, (float)it_distance.Value));

            Fsm.Event(storeResult.Value ? trueEvent : falseEvent);
        }
        void DoProcess()
        {
            OpenCVForUnity.CoreModule.DMatch[] wrapped_ap = new OpenCVForUnity.CoreModule.DMatch[ap.Length];
            OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToArray <OpenCVForUnityPlayMakerActions.DMatch, OpenCVForUnity.CoreModule.DMatch>(ap, wrapped_ap);

            if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.MatOfDMatch))
            {
                storeResult.Value = new OpenCVForUnityPlayMakerActions.MatOfDMatch();
            }
            ((OpenCVForUnityPlayMakerActions.MatOfDMatch)storeResult.Value).wrappedObject = new OpenCVForUnity.CoreModule.MatOfDMatch(wrapped_ap);

            OpenCVForUnityPlayMakerActionsUtils.ConvertArrayToFsmArray <OpenCVForUnity.CoreModule.DMatch, OpenCVForUnityPlayMakerActions.DMatch>(wrapped_ap, ap);
        }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.MatOfDMatch))
            {
                LogError("owner is not initialized. Add Action \"newMatOfDMatch\".");
                return;
            }
            OpenCVForUnity.CoreModule.MatOfDMatch wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfDMatch, OpenCVForUnity.CoreModule.MatOfDMatch>(owner);

            OpenCVForUnity.CoreModule.DMatch[] wrapped_a = new OpenCVForUnity.CoreModule.DMatch[a.Length];
            OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToArray <OpenCVForUnityPlayMakerActions.DMatch, OpenCVForUnity.CoreModule.DMatch>(a, wrapped_a);

            wrapped_owner.fromArray(wrapped_a);

            OpenCVForUnityPlayMakerActionsUtils.ConvertArrayToFsmArray <OpenCVForUnity.CoreModule.DMatch, OpenCVForUnityPlayMakerActions.DMatch>(wrapped_a, a);
        }
예제 #4
0
        public DMatch[] toArray()
        {
            int num = (int)total();

            DMatch[] a = new DMatch[num];
            if (num == 0)
            {
                return(a);
            }
            float[] buff = new float[num * _channels];
            get(0, 0, buff);  //TODO: check ret val!
            for (int i = 0; i < num; i++)
            {
                a[i] = new DMatch((int)buff[_channels * i + 0], (int)buff[_channels * i + 1], (int)buff[_channels * i + 2], buff[_channels * i + 3]);
            }
            return(a);
        }
예제 #5
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.DMatch))
            {
                LogError("owner is not initialized. Add Action \"newDMatch\".");
                return;
            }
            OpenCVForUnity.CoreModule.DMatch wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.DMatch, OpenCVForUnity.CoreModule.DMatch>(owner);

            if (!(it.Value is OpenCVForUnityPlayMakerActions.DMatch))
            {
                LogError("it is not initialized. Add Action \"newDMatch\".");
                return;
            }
            OpenCVForUnity.CoreModule.DMatch wrapped_it = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.DMatch, OpenCVForUnity.CoreModule.DMatch>(it);

            storeResult.Value = wrapped_owner.lessThan(wrapped_it);

            Fsm.Event(storeResult.Value ? trueEvent : falseEvent);
        }
예제 #6
0
        public void fromArray(params DMatch[] a)
        {
            if (a == null || a.Length == 0)
            {
                return;
            }
            int num = a.Length;

            alloc(num);
            float[] buff = new float[num * _channels];
            for (int i = 0; i < num; i++)
            {
                DMatch m = a[i];
                buff[_channels * i + 0] = m.queryIdx;
                buff[_channels * i + 1] = m.trainIdx;
                buff[_channels * i + 2] = m.imgIdx;
                buff[_channels * i + 3] = m.distance;
            }
            put(0, 0, buff);  //TODO: check ret val!
        }
 public DMatch(OpenCVForUnity.CoreModule.DMatch nativeObj) : base(nativeObj)
 {
 }
예제 #8
0
 public bool lessThan(DMatch it)
 {
     return(distance < it.distance);
 }