本文整理汇总了C#中Microsoft.Kinect.KinectSensor.OpenMultiSourceFrameReader方法的典型用法代码示例。如果您正苦于以下问题:C# KinectSensor.OpenMultiSourceFrameReader方法的具体用法?C# KinectSensor.OpenMultiSourceFrameReader怎么用?C# KinectSensor.OpenMultiSourceFrameReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Kinect.KinectSensor
的用法示例。
在下文中一共展示了KinectSensor.OpenMultiSourceFrameReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Window_Loaded
// Primary function. Runs when the window loads in.
private void Window_Loaded(object sender, RoutedEventArgs e)
{
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_sensor.Open();
_bodies = new Body[_sensor.BodyFrameSource.BodyCount];
_reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
_reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
_bodyReader = _sensor.BodyFrameSource.OpenReader();
_bodyReader.FrameArrived += BodyReader_FrameArrived;
// 2) Initialize the face source with the desired features
_faceSource = new FaceFrameSource(_sensor, 0, FaceFrameFeatures.BoundingBoxInColorSpace |
FaceFrameFeatures.FaceEngagement |
FaceFrameFeatures.Glasses |
FaceFrameFeatures.Happy |
FaceFrameFeatures.LeftEyeClosed |
FaceFrameFeatures.MouthOpen |
FaceFrameFeatures.PointsInColorSpace |
FaceFrameFeatures.RightEyeClosed);
_faceReader = _faceSource.OpenReader();
_faceReader.FrameArrived += FaceReader_FrameArrived;
}
}
示例2: KinectStreamer
private KinectStreamer()
{
KinectStreamerConfig = new KinectStreamerConfig();
kinectSensor = KinectSensor.GetDefault();
CoordinateMapper = kinectSensor.CoordinateMapper;
multiSourceFrameReader = kinectSensor.OpenMultiSourceFrameReader(FrameSourceTypes.Depth | FrameSourceTypes.Color | FrameSourceTypes.Body);
multiSourceFrameReader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
ColorFrameDescription = kinectSensor.ColorFrameSource.FrameDescription;
DepthFrameDescription = kinectSensor.DepthFrameSource.FrameDescription;
depthBitmap = new WriteableBitmap(DepthFrameDescription.Width, DepthFrameDescription.Height, 96.0, 96.0, PixelFormats.Gray8, null);
colorBitmap = new WriteableBitmap(ColorFrameDescription.Width, ColorFrameDescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);
bitmapBackBufferSize = (uint)((colorBitmap.BackBufferStride * (colorBitmap.PixelHeight - 1)) + (colorBitmap.PixelWidth * this.bytesPerPixel));
colorPixels = new byte[ColorFrameDescription.Width * ColorFrameDescription.Height];
depthPixels = new byte[DepthFrameDescription.Width * DepthFrameDescription.Height];
depthArray = new ushort[DepthFrameDescription.Width * DepthFrameDescription.Height];
SetupBody();
kinectSensor.Open();
}
示例3: KinectReader
public KinectReader(WriteableBitmap depthBitmap, WriteableBitmap colorBitmap)
{
this.depthBitmap = depthBitmap;
this.colorBitmap = colorBitmap;
this.sensor = KinectSensor.GetDefault();
sensor.Open();
this.reader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Depth | FrameSourceTypes.Color);
reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
}
示例4: Core
public Core()
{
InitExercises();
sensor = KinectSensor.GetDefault();
sensor.Open();
reader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
frameLock = new Mutex();
}
示例5: MainWindow
public MainWindow()
{
InitializeComponent();
mySensor = KinectSensor.GetDefault();
mySensor.Open();
myReader = mySensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Body);
myReader.MultiSourceFrameArrived += myReader_MultiSourceFrameArrived;
myBitmap = new WriteableBitmap(1920, 1080, 96.0, 96.0, PixelFormats.Pbgra32, null);
image1.Source = myBitmap;
}
示例6: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_sensor.Open();
_reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
_reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
}
}
示例7: KinectFrameServer
/// <summary>
/// Constructor
/// </summary>
/// <param name="port">Server port</param>
/// <param name="sensor"></param>
public KinectFrameServer(int port, KinectSensor sensor)
{
this.sensor = sensor;
this.listener = new KinectClientListener(port);
this.listener.ClientConnected += listener_ClientConnected;
this.depthCompressor = new SnappyFrameCompressor(KinectFrameInformation.DepthFrame);
this.bodyIndexCompressor = new SnappyFrameCompressor(KinectFrameInformation.BodyIndexFrame);
this.multiSourceReader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.BodyIndex | FrameSourceTypes.Depth);
this.multiSourceReader.MultiSourceFrameArrived += multiSourceReader_MultiSourceFrameArrived;
}
示例8: BackgroundRemovalPage
public BackgroundRemovalPage()
{
InitializeComponent();
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_sensor.Open();
_reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body | FrameSourceTypes.BodyIndex);
_reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
}
}
示例9: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
_kinectSensor = KinectSensor.GetDefault();
InitializeInfrared();
_kinectSensor.Open();
if (_kinectSensor != null)
{
_utils = new Utils(_kinectSensor.CoordinateMapper);
_reader =
_kinectSensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth |
FrameSourceTypes.BodyIndex);
}
_reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
}
示例10: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_sensor.Open();
// 2) Initialize the background removal tool.
_backgroundRemovalTool = new BackgroundRemovalTool(_sensor.CoordinateMapper);
_reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.BodyIndex);
_reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
}
}
示例11: Main
static void Main(string[] args)
{
sensor = KinectSensor.GetDefault();
sensor.IsAvailableChanged += Sensor_IsAvailableChanged;
sensor.Open();
_multiReader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Body);
_multiReader.MultiSourceFrameArrived += OnMultipleFramesArrivedHandler;
VirtualMouse.MoveTo(900, 39);
VirtualMouse.LeftClick();
Console.ReadKey();
}
示例12: GesturesPage
public GesturesPage()
{
InitializeComponent();
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_sensor.Open();
_reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
_reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
_gestureController = new GestureController();
_gestureController.GestureRecognized += GestureController_GestureRecognized;
}
}
示例13: FrameReader
public FrameReader()
{
_sensor = KinectSensor.GetDefault();
if (_sensor == null)
{
throw new ScannerNotFoundException("No valid plugged-in Kinect sensor found.");
}
if (!_sensor.IsOpen)
{
_sensor.Open();
}
_reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body | FrameSourceTypes.BodyIndex);
_reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
}
示例14: InitializeSceen
private void InitializeSceen()
{
_sensor = KinectSensor.GetDefault();
_sensor.Open();
FrameDescription colorFrameDescription = _sensor.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Bgra);
// create the bitmap to display
this._colorBitmap = new WriteableBitmap(colorFrameDescription.Width, colorFrameDescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);
_jedi = new JediGestureRecognizer(_sensor);
_jedi.ForceApplying += ForceApplying;
_jedi.ForceDispel += ForceDispel;
_frameReader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Body | FrameSourceTypes.Depth | FrameSourceTypes.Color);
_frameReader.MultiSourceFrameArrived +=MultiSourceFrameArrived;
}
示例15: AnglePage
public AnglePage()
{
InitializeComponent();
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_sensor.Open();
_reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
_reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
_userReporter = new PlayersController();
_userReporter.BodyEntered += UserReporter_BodyEntered;
_userReporter.BodyLeft += UserReporter_BodyLeft;
_userReporter.Start();
}
}