// Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor>();

            displayFacePointsToggle.isOn   = displayFacePoints;
            displayAxesToggle.isOn         = displayAxes;
            displayHeadToggle.isOn         = displayHead;
            displayEffectsToggle.isOn      = displayEffects;
            enableDownScaleToggle.isOn     = enableDownScale;
            enableSkipFrameToggle.isOn     = enableSkipFrame;
            enableLowPassFilterToggle.isOn = enableLowPassFilter;

            imageOptimizationHelper  = gameObject.GetComponent <ImageOptimizationHelper>();
            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper>();


            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
#if UNITY_WEBGL && !UNITY_EDITOR
            getFilePath_Coroutine = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => {
                getFilePath_Coroutine = null;

                dlibShapePredictorFilePath = result;
                Run();
            });
            StartCoroutine(getFilePath_Coroutine);
#else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName);
            Run();
#endif
        }
예제 #2
0
        // Use this for initialization
        public void Start()
        {
            faceDirHorButton.onClick.AddListener(faceDirHor);
            faceDirVerButton.onClick.AddListener(faceDirVer);
            headShakeButton.onClick.AddListener(setHeadShakeMonitor);
            headNodButton.onClick.AddListener(setHeadNodMonitor);
            mouthButton.onClick.AddListener(mouthDetect);
            // smileButton.onClick.AddListener(smileDetect);
            recab.onClick.AddListener(recab_points);
            colorOfObject.onClick.AddListener(color_of_object);

            smileButton.onClick.AddListener(emotionDetect);

            fpsMonitor = GetComponent <FpsMonitor> ();

            adjustPixelsDirectionToggle.isOn = true;

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            var getFilePath_Coroutine = Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => {
                coroutines.Clear();

                dlibShapePredictorFilePath = result;
                Run();
            });
            coroutines.Push(getFilePath_Coroutine);
            StartCoroutine(getFilePath_Coroutine);
            #else
            dlibShapePredictorFilePath = Utils.getFilePath(dlibShapePredictorFileName);
            Run();
            #endif
        }
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            displayFacePointsToggle.isOn   = displayFacePoints;
            displayAxesToggle.isOn         = displayAxes;
            displayHeadToggle.isOn         = displayHead;
            displayEffectsToggle.isOn      = displayEffects;
            enableLowPassFilterToggle.isOn = enableLowPassFilter;

            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> ();


            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            var getFilePath_Coroutine = DlibFaceLandmarkDetector.Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => {
                coroutines.Clear();

                dlibShapePredictorFilePath = result;
                Run();
            });
            coroutines.Push(getFilePath_Coroutine);
            StartCoroutine(getFilePath_Coroutine);
            #else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.Utils.getFilePath(dlibShapePredictorFileName);
            Run();
            #endif
        }
예제 #4
0
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            #if UNITY_WEBGL && !UNITY_EDITOR
            getFilePath_Coroutine = GetFilePath();
            StartCoroutine(getFilePath_Coroutine);
            #else
            object_detector_filepath = Utils.getFilePath(OBJECT_DETECTOR_FILENAME);
            shape_predictor_filepath = Utils.getFilePath(SHAPE_PREDICTOR_FILENAME);
            Run();
            #endif
        }
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            #if UNITY_WEBGL && !UNITY_EDITOR
            var getFilePath_Coroutine = GetFilePath();
            coroutines.Push(getFilePath_Coroutine);
            StartCoroutine(getFilePath_Coroutine);
            #else
            frontal_cat_face_svm_filepath = Utils.getFilePath("frontal_cat_face.svm");
            sp_cat_face_68_dat_filepath   = Utils.getFilePath("sp_cat_face_68.dat");
            Run();
            #endif
        }
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor>();

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
#if UNITY_WEBGL && !UNITY_EDITOR
            getFilePath_Coroutine = GetFilePath();
            StartCoroutine(getFilePath_Coroutine);
#else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName);
            video_filepath             = OpenCVForUnity.UnityUtils.Utils.getFilePath(VIDEO_FILENAME);
            Run();
#endif
        }
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            var getFilePath_Coroutine = GetFilePath();
            coroutines.Push(getFilePath_Coroutine);
            StartCoroutine(getFilePath_Coroutine);
            #else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.Utils.getFilePath(dlibShapePredictorFileName);
            couple_avi_filepath        = OpenCVForUnity.Utils.getFilePath("couple.avi");
            Run();
            #endif
        }
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor>();

            sourceToMatHelper = gameObject.GetComponent <VideoCaptureToMatHelper>();


            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
#if UNITY_WEBGL
            getFilePath_Coroutine = GetFilePath();
            StartCoroutine(getFilePath_Coroutine);
#else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName);
            Run();
#endif
        }
예제 #9
0
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            getFilePath_Coroutine = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => {
                getFilePath_Coroutine = null;

                dlibShapePredictorFilePath = result;
                Run();
            });
            StartCoroutine(getFilePath_Coroutine);
            #else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName);
            Run();
            #endif
        }
예제 #10
0
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            drawLowPassFilterToggle.isOn     = drawLowPassFilter;
            drawKalmanFilterToggle.isOn      = drawKalmanFilter;
            drawOpticalFlowFilterToggle.isOn = drawOpticalFlowFilter;
            drawOFAndLPFilterToggle.isOn     = drawOFAndLPFilter;

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            getFilePath_Coroutine = GetFilePath();
            StartCoroutine(getFilePath_Coroutine);
            #else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName);
            video_filepath             = OpenCVForUnity.UnityUtils.Utils.getFilePath(VIDEO_FILENAME);
            Run();
            #endif
        }
예제 #11
0
        void Start()
        {
            joystick = new vJoy();
            iReport  = new vJoy.JoystickState();

            if (joystick.vJoyEnabled())
            {
                VjdStat status        = joystick.GetVJDStatus(1);
                bool    AxisX         = joystick.GetVJDAxisExist(id, HID_USAGES.HID_USAGE_X);
                int     nButtons      = joystick.GetVJDButtonNumber(id);
                int     ContPovNumber = joystick.GetVJDContPovNumber(id);
                int     DiscPovNumber = joystick.GetVJDDiscPovNumber(id);
                joystick.AcquireVJD(id);
                joystick.ResetVJD(id);
            }

            fpsMonitor = GetComponent <FpsMonitor> ();

            displayFacePointsToggle.isOn   = displayFacePoints;
            displayAxesToggle.isOn         = displayAxes;
            displayHeadToggle.isOn         = displayHead;
            displayEffectsToggle.isOn      = displayEffects;
            enableLowPassFilterToggle.isOn = enableLowPassFilter;

            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> ();


            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            getFilePath_Coroutine = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => {
                getFilePath_Coroutine = null;

                dlibShapePredictorFilePath = result;
                Run();
            });
            StartCoroutine(getFilePath_Coroutine);
            #else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName);
            Run();
            #endif
        }
예제 #12
0
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            displayFacePointsToggle.isOn = displayFacePoints;
            displayAxesToggle.isOn       = displayAxes;
            displayHeadToggle.isOn       = displayHead;
            displayEffectsToggle.isOn    = displayEffects;


            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            var getFilePath_Coroutine = GetFilePath();
            coroutines.Push(getFilePath_Coroutine);
            StartCoroutine(getFilePath_Coroutine);
            #else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.Utils.getFilePath(dlibShapePredictorFileName);
            dance_avi_filepath         = OpenCVForUnity.Utils.getFilePath("dance.avi");
            Run();
            #endif
        }
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            adjustPixelsDirectionToggle.isOn = adjustPixelsDirection;

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            var getFilePath_Coroutine = Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => {
                coroutines.Clear();

                dlibShapePredictorFilePath = result;
                Run();
            });
            coroutines.Push(getFilePath_Coroutine);
            StartCoroutine(getFilePath_Coroutine);
            #else
            dlibShapePredictorFilePath = Utils.getFilePath(dlibShapePredictorFileName);
            Run();
            #endif
        }
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            enableDownScaleToggle.isOn       = enableDownScale;
            enableSkipFrameToggle.isOn       = enableSkipFrame;
            useOpenCVFaceDetectorToggle.isOn = useOpenCVFaceDetector;

            imageOptimizationHelper  = gameObject.GetComponent <ImageOptimizationHelper> ();
            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> ();

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            getFilePath_Coroutine = GetFilePath();
            StartCoroutine(getFilePath_Coroutine);
            #else
            haarcascade_frontalface_alt_xml_filepath = OpenCVForUnity.UnityUtils.Utils.getFilePath("haarcascade_frontalface_alt.xml");
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName);
            Run();
            #endif
        }
예제 #15
0
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor> ();

            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> ();

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
            #if UNITY_WEBGL && !UNITY_EDITOR
            var getFilePath_Coroutine = DlibFaceLandmarkDetector.Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => {
                coroutines.Clear();

                dlibShapePredictorFilePath = result;
                Run();
            });
            coroutines.Push(getFilePath_Coroutine);
            StartCoroutine(getFilePath_Coroutine);
            #else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.Utils.getFilePath(dlibShapePredictorFileName);
            Run();
            #endif
        }
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor>();

            drawLowPassFilterToggle.isOn     = drawLowPassFilter;
            drawKalmanFilterToggle.isOn      = drawKalmanFilter;
            drawOpticalFlowFilterToggle.isOn = drawOpticalFlowFilter;
            drawOFAndLPFilterToggle.isOn     = drawOFAndLPFilter;

            sourceToMatHelper = gameObject.GetComponent <VideoCaptureToMatHelper>();


            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
#if UNITY_WEBGL
            getFilePath_Coroutine = GetFilePath();
            StartCoroutine(getFilePath_Coroutine);
#else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName);
            Run();
#endif
        }
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor>();

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
#if UNITY_WEBGL && !UNITY_EDITOR
            getFilePath_Coroutine = Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => {
                getFilePath_Coroutine = null;

                dlibShapePredictorFilePath = result;
                Run();
            });
            StartCoroutine(getFilePath_Coroutine);
#else
            dlibShapePredictorFilePath = Utils.getFilePath(dlibShapePredictorFileName);
            //You can set the relative file path from the project folder.
            //dlibShapePredictorFilePath = "./Assets/StreamingAssets/"+dlibShapePredictorFileName;

            Run();
#endif
        }
예제 #18
0
        // Use this for initialization
        void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor>();

            filterModeDropdown.value = (int)filterMode;

            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper>();

            dlibShapePredictorFileName = DlibFaceLandmarkDetectorExample.dlibShapePredictorFileName;
#if UNITY_WEBGL && !UNITY_EDITOR
            getFilePath_Coroutine = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePathAsync(dlibShapePredictorFileName, (result) => {
                getFilePath_Coroutine = null;

                dlibShapePredictorFilePath = result;
                Run();
            });
            StartCoroutine(getFilePath_Coroutine);
#else
            dlibShapePredictorFilePath = DlibFaceLandmarkDetector.UnityUtils.Utils.getFilePath(dlibShapePredictorFileName);
            Run();
#endif
        }