예제 #1
0
        private void Run()
        {
            faceLandmarkDetector = new FaceLandmarkDetector(shape_predictor_68_face_landmarks_dat_filepath);

            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> ();
            webCamTextureToMatHelper.Init();
        }
예제 #2
0
        private void Run()
        {
            //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();
            rotMat      = new Mat(3, 3, CvType.CV_64FC1);

            faceLandmarkDetector = new FaceLandmarkDetector(shape_predictor_68_face_landmarks_dat_filepath);

            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> ();
            webCamTextureToMatHelper.Init();
        }
예제 #3
0
 /// <summary>
 /// Raises the change camera button event.
 /// </summary>
 public void OnChangeCameraButton()
 {
     webCamTextureToMatHelper.Init(null, webCamTextureToMatHelper.requestWidth, webCamTextureToMatHelper.requestHeight, !webCamTextureToMatHelper.requestIsFrontFacing);
 }