示例#1
0
        // Use this for initialization
        void Start()
        {
            faceLandmarkDetector = new FaceLandmarkDetector(DlibFaceLandmarkDetector.Utils.getFilePath("shape_predictor_68_face_landmarks.dat"));

            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> ();
            webCamTextureToMatHelper.Init();
        }
        // Use this for initialization
        void Start()
        {
            //set 3d face object points.
            objectPoints = new MatOfPoint3f(
                new Point3(-31, 72, 86),               //l eye
                new Point3(31, 72, 86),                //r eye
                new Point3(0, 40, 114),                //nose
                new Point3(-20, 15, 90),               //l mouse
                new Point3(20, 15, 90),                //r mouse
                new Point3(-69, 76, -2),               //l ear
                new Point3(69, 76, -2)                 //r ear
                );
            imagePoints = new MatOfPoint2f();
            rvec        = new Mat();
            tvec        = new Mat();
            rotM        = new Mat(3, 3, CvType.CV_64FC1);

            faceLandmarkDetector = new FaceLandmarkDetector(DlibFaceLandmarkDetector.Utils.getFilePath("shape_predictor_68_face_landmarks.dat"));

            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> ();
            webCamTextureToMatHelper.Init();
        }