Exemplo n.º 1
0
        void faceModelBuilder_CollectionCompleted(object sender, FaceModelBuilderCollectionCompletedEventArgs e)
        {
            var modelData = e.ModelData;

            faceModel = modelData.ProduceFaceModel();
            produced  = true;

            faceModelBuilder.Dispose();
            faceModelBuilder = null;
        }
Exemplo n.º 2
0
        private void HdFaceBuilder_CollectionCompleted(object sender, FaceModelBuilderCollectionCompletedEventArgs e)
        {
            var modelData = e.ModelData;

            currentFaceModel = modelData.ProduceFaceModel();

            faceModelBuilder.Dispose();
            faceModelBuilder = null;

            status = "Capture Complete";
            this.Log(status);
        }
Exemplo n.º 3
0
        public override bool StartSensor()
        {
            _bodySource = _kinect.BodyFrameSource;
            _bodyReader = _bodySource.OpenReader();
            _bodyReader.FrameArrived += BodyReader_FrameArrived;

            _hdFaceFrameSource =
                new HighDefinitionFaceFrameSource(_kinect);
            _hdFaceFrameSource.TrackingIdLost +=
                HdFaceSource_TrackingIdLost;

            _hdFaceFrameReader =
                _hdFaceFrameSource.OpenReader();
            _hdFaceFrameReader.FrameArrived +=
                HdFaceReader_FrameArrived;

            _currentFaceModel     = new FaceModel();
            _currentFaceAlignment = new FaceAlignment();

            InitializeMesh();
            UpdateMesh();

            // Text style for our jig

            _style      = new TextStyle();
            _style.Font =
                new FontDescriptor("standard.shx", false, false, 0, 0);
            _style.TextSize = 10;

            var res = base.StartSensor();

            if (res)
            {
                if (_faceModelBuilder != null)
                {
                    _faceModelBuilder.Dispose();
                }
                _faceModelBuilder =
                    _hdFaceFrameSource.OpenModelBuilder(
                        FaceModelBuilderAttributes.None
                        );
                _faceModelBuilder.BeginFaceDataCollection();
                _faceModelBuilder.CollectionCompleted +=
                    HdFaceBuilder_CollectionCompleted;
            }
            return(res);
        }
 void collectFaceModelCompleted(FaceModelData faceModelData)
 {
     print("Model created!");
     faceModel = faceModelData.ProduceFaceModel();
     faceModelBuilder.Dispose();
     faceModelBuilder            = null;
     IsFaceModelCollectCompleted = true;
 }