Пример #1
0
 public Stream(Boolean shouldSendCloud, Boolean shouldSendSkeleton, IPAddress ipAdress, int cloudPort, int maxNumberOfPoints, int skullPort, int numberOfVerticesToSkip)
 {
     kinect = new Kinect();
     /* TODO : avoid senders initialization if should not send */
     pointsSender   = new PointsSender(ipAdress, cloudPort, maxNumberOfPoints, numberOfVerticesToSkip);
     skullSender    = new SkullSender(ipAdress, skullPort);
     frameProcessor = new FrameProcessor(shouldSendCloud, shouldSendSkeleton, pointsSender, skullSender);
 }
Пример #2
0
 /// <summary>
 /// This method starts a kinect sensor and opens its streams.
 /// </summary>
 public Boolean OpenKinectSensor(FrameProcessor frameProcessor)
 {
     kinectSensor = KinectSensor.GetDefault();
     if (kinectSensor != null)
     {
         kinectSensor.Open();
         if (true) // TODO : kinectSensor.IsAvailable returns a false value when we use a video in KinectStudio ??
         {
             multiSourceFrameReader = kinectSensor.OpenMultiSourceFrameReader(FrameSourceTypes.Depth | FrameSourceTypes.Color | FrameSourceTypes.Body | FrameSourceTypes.BodyIndex);
             multiSourceFrameReader.MultiSourceFrameArrived += frameProcessor.FrameArrivedEventHandler;
             Console.WriteLine("Association with Kinect Sensor is working.");
             return(true);
         }
     }
     return(false);
 }