本文整理汇总了C#中KinectSensor.OpenMultiSourceFrameReader方法的典型用法代码示例。如果您正苦于以下问题:C# KinectSensor.OpenMultiSourceFrameReader方法的具体用法?C# KinectSensor.OpenMultiSourceFrameReader怎么用?C# KinectSensor.OpenMultiSourceFrameReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KinectSensor
的用法示例。
在下文中一共展示了KinectSensor.OpenMultiSourceFrameReader方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainPage
public MainPage()
{
InitializeComponent();
_navigationHelper = new NavigationHelper(this);
_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;
}
// Initialize the gesture detection objects for our gestures
this.gestureDetectorList = new List<GestureDetector>();
// Create a gesture detector for each body (6 bodies => 6 detectors)
int maxBodies = this._sensor.BodyFrameSource.BodyCount;
for (int i = 0; i < maxBodies; ++i)
{
GestureResultView result =
new GestureResultView(i, false, false, 0.0f);
GestureDetector detector =
new GestureDetector(this._sensor, result);
result.PropertyChanged += GestureResult_PropertyChanged;
this.gestureDetectorList.Add(detector);
}
}
示例2: Page_Loaded
private void Page_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;
_gestureController = new GestureController(GestureType.All);
_gestureController.GestureRecognized += GestureController_GestureRecognized;
}
}
示例3: BackgroundRemovalPage
public BackgroundRemovalPage()
{
InitializeComponent();
_navigationHelper = new NavigationHelper(this);
_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;
}
}
示例4: GesturesPage
public GesturesPage()
{
InitializeComponent();
_navigationHelper = new NavigationHelper(this);
_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;
}
}
示例5: SnapHand
public SnapHand()
{
this.InitializeComponent();
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_sensor.Open();
_reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
_reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
_playersController = new PlayersController();
_playersController.BodyEntered += UserReporter_BodyEntered;
_playersController.BodyLeft += UserReporter_BodyLeft;
_playersController.Start();
}
viewer.Visualization = Visualization.Color;
}
示例6: CameraPage
public CameraPage()
{
InitializeComponent();
_navigationHelper = new NavigationHelper(this);
_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 UsersController();
_userReporter.BodyEntered += UserReporter_BodyEntered;
_userReporter.BodyLeft += UserReporter_BodyLeft;
_userReporter.Start();
}
}
示例7: OnNavigatedTo
protected override void OnNavigatedTo( NavigationEventArgs e )
{
base.OnNavigatedTo( e );
try {
kinect = KinectSensor.GetDefault();
kinect.Open();
mapper = kinect.CoordinateMapper;
// カラー画像の情報を作成する(BGRAフォーマット)
colorFrameDesc = kinect.ColorFrameSource.CreateFrameDescription(
colorFormat );
colorBuffer = new byte[colorFrameDesc.LengthInPixels *
colorFrameDesc.BytesPerPixel];
// Depthデータの情報を取得する
depthFrameDesc = kinect.DepthFrameSource.FrameDescription;
depthBuffer = new ushort[depthFrameDesc.LengthInPixels];
// BodyIndexデータの情報を取得する
var bodyIndexFrameDesc = kinect.BodyIndexFrameSource.FrameDescription;
bodyIndexBuffer = new byte[bodyIndexFrameDesc.LengthInPixels];
// フレームリーダーを開く
multiReader = kinect.OpenMultiSourceFrameReader(
FrameSourceTypes.Color |
FrameSourceTypes.Depth |
FrameSourceTypes.BodyIndex );
multiReader.MultiSourceFrameArrived += multiReader_MultiSourceFrameArrived;
}
catch ( Exception ex ) {
MessageDialog dlg = new MessageDialog(ex.Message);
dlg.ShowAsync();
}
}
示例8: MainPage
public MainPage()
{
frame_counter=0;
// one sensor is currently supported
kinectSensor= KinectSensor.GetDefault();
SetupCurrentDisplay(DEFAULT_DISPLAYFRAMETYPE);
coordinateMapper=kinectSensor.CoordinateMapper;
multiSourceFrameReader=kinectSensor.OpenMultiSourceFrameReader(FrameSourceTypes.Infrared | FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.BodyIndex | FrameSourceTypes.Body);
// wire handler for frame arrival
multiSourceFrameReader.MultiSourceFrameArrived +=Reader_MultiSourceFrameArrived;
//multiSourceFrameReader.MultiSourceFrameArrived+=SensorSkeletonFrameReady;
multiSourceFrameReader.MultiSourceFrameArrived+=WritingData;
// set IsAvailableChanged event notifier
kinectSensor.IsAvailableChanged +=Sensor_IsAvailableChanged;
// use the window object as the view model in this simple example
DataContext= this;
Datapreparing=new DataPreparing();
// open the sensor
kinectSensor.Open();
InitializeComponent();
//this.Suspending+=OnSuspending;
CreateDelayTimer();
}
示例9: MainPage_Loaded
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
sensor = KinectSensor.GetDefault();
irReader = sensor.InfraredFrameSource.OpenReader();
FrameDescription fd = sensor.InfraredFrameSource.FrameDescription;
irData = new ushort[fd.LengthInPixels];
irDataConverted = new byte[fd.LengthInPixels * 4];
irBitmap = new WriteableBitmap(fd.Width, fd.Height);
image.Source = irBitmap;
bodies = new Body[6];
msfr = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Body | FrameSourceTypes.Infrared);
msfr.MultiSourceFrameArrived += msfr_MultiSourceFrameArrived;
sensor.Open();
}