/** * Constructor of the model * It does all the important stuff to use our camera. Its so FANCY ! * Like enabling all important tracker(Hand, Face), the stream and builds up the configuration. * blib blub */ public Model() { emotions["Anger"] = 0; emotions["Fear"] = 0; emotions["Disgust"] = 0; emotions["Surprise"] = 0; emotions["Joy"] = 0; emotions["Sadness"] = 0; emotions["Contempt"] = 0; width = 1920; height = 1080; framerate = 30; senseManager = PXCMSenseManager.CreateInstance(); senseManager.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, width, height, framerate); // Enable Face detection senseManager.EnableFace(); senseManager.Init(); face = senseManager.QueryFace(); faceConfig = face.CreateActiveConfiguration(); faceConfig.SetTrackingMode(PXCMFaceConfiguration.TrackingModeType.FACE_MODE_COLOR_PLUS_DEPTH); faceConfig.detection.isEnabled = true; faceConfig.pose.isEnabled = true; faceConfig.ApplyChanges(); faceConfig.Update(); modules = new List <RSModule>(); }
// Initialise all the things public override void Init(PXCMSenseManager sManager) { senseManager = sManager; module = senseManager.QueryFace(); PXCMFaceConfiguration config = module.CreateActiveConfiguration(); config.SetTrackingMode(PXCMFaceConfiguration.TrackingModeType.FACE_MODE_COLOR); config.detection.isEnabled = true; config.ApplyChanges(); config.Update(); }
// Initialise all the things public override void Init(PXCMSenseManager sManager) { senseManager = sManager; module = senseManager.QueryFace(); fg = module.CreateActiveConfiguration(); fg.SetTrackingMode(PXCMFaceConfiguration.TrackingModeType.FACE_MODE_COLOR); fg.detection.isEnabled = true; // Set to enable all alerts fg.EnableAllAlerts(); // Apply changes fg.ApplyChanges(); fg.Update(); }
public Model() { width = 640; height = 480; framerate = 30; senseManager = PXCMSenseManager.CreateInstance(); senseManager.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, width, height, framerate); // Enable Face detection senseManager.EnableFace(); senseManager.EnableHand(); senseManager.Init(); face = senseManager.QueryFace(); faceConfig = face.CreateActiveConfiguration(); faceConfig.SetTrackingMode(PXCMFaceConfiguration.TrackingModeType.FACE_MODE_COLOR); faceConfig.detection.isEnabled = true; faceConfig.QueryExpressions(); PXCMFaceConfiguration.ExpressionsConfiguration expc = faceConfig.QueryExpressions(); expc.Enable(); expc.EnableAllExpressions(); faceConfig.ApplyChanges(); faceConfig.Update(); //faceData = face.CreateOutput(); //faceData.Update(); hand = senseManager.QueryHand(); PXCMHandConfiguration config = hand.CreateActiveConfiguration(); config.SetTrackingMode(PXCMHandData.TrackingModeType.TRACKING_MODE_FULL_HAND); config.ApplyChanges(); config.Update(); //handData = hand.CreateOutput(); //handData.Update(); modules = new List <RSModule>(); }
/** * Constructor of the model * It does all the important stuff to use our camera. Its so FANCY ! * Like enabling all important tracker(Hand, Face), the stream and builds up the configuration. */ public Model(bool s) { stream = s; emotions[Emotion.ANGER] = 0; emotions[Emotion.CONTEMPT] = 0; emotions[Emotion.DISGUST] = 0; emotions[Emotion.FEAR] = 0; emotions[Emotion.JOY] = 0; emotions[Emotion.SADNESS] = 0; emotions[Emotion.SURPRISE] = 0; if (stream) { width = 1920; height = 1080; framerate = 30; senseManager = PXCMSenseManager.CreateInstance(); senseManager.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, width, height, framerate); // Enable Face detection senseManager.EnableFace(); bool couldInit = senseManager.Init().IsSuccessful(); if (!couldInit) { MessageBox.Show("Could not connect to the hardware! Make sure you have the camera-drivers installed.", "Aww, dang"); Environment.Exit(1); } face = senseManager.QueryFace(); faceConfig = face.CreateActiveConfiguration(); faceConfig.SetTrackingMode(PXCMFaceConfiguration.TrackingModeType.FACE_MODE_COLOR_PLUS_DEPTH); faceConfig.detection.isEnabled = true; faceConfig.pose.isEnabled = true; faceConfig.ApplyChanges(); faceConfig.Update(); modules = new List <RSModule>(); } }