示例#1
0
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.Facemark))
            {
                LogError("owner is not initialized. Add Action \"newFacemark\".");
                return;
            }
            OpenCVForUnity.FaceModule.Facemark wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Facemark, OpenCVForUnity.FaceModule.Facemark>(owner);

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

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

            List <OpenCVForUnity.CoreModule.MatOfPoint2f> wrapped_landmarks = new List <OpenCVForUnity.CoreModule.MatOfPoint2f>();

            OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.MatOfPoint2f, OpenCVForUnity.CoreModule.MatOfPoint2f>(landmarks, wrapped_landmarks);

            storeResult.Value = wrapped_owner.fit(wrapped_image, wrapped_faces, wrapped_landmarks);

            OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.MatOfPoint2f, OpenCVForUnityPlayMakerActions.MatOfPoint2f>(wrapped_landmarks, landmarks);

            Fsm.Event(storeResult.Value ? trueEvent : falseEvent);
        }
示例#2
0
        //
        // C++:  Ptr_Facemark cv::face::createFacemarkLBF()
        //

        //javadoc: createFacemarkLBF()
        public static Facemark createFacemarkLBF()
        {
#if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
            Facemark retVal = Facemark.__fromPtr__(face_Face_createFacemarkLBF_10());

            return(retVal);
#else
            return(null);
#endif
        }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.Facemark))
            {
                LogError("owner is not initialized. Add Action \"newFacemark\".");
                return;
            }
            OpenCVForUnity.FaceModule.Facemark wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Facemark, OpenCVForUnity.FaceModule.Facemark>(owner);

            wrapped_owner.loadModel(model.Value);
        }
 public Facemark(OpenCVForUnity.FaceModule.Facemark nativeObj) : base(nativeObj)
 {
 }
示例#5
0
        //
        // C++:  Ptr_Facemark cv::face::createFacemarkLBF()
        //

        public static Facemark createFacemarkLBF()
        {
            return(Facemark.__fromPtr__(face_Face_createFacemarkLBF_10()));
        }
示例#6
0
        //
        // C++:  Ptr_Facemark cv::face::createFacemarkKazemi()
        //

        public static Facemark createFacemarkKazemi()
        {
            return(Facemark.__fromPtr__(face_Face_createFacemarkKazemi_10()));
        }