本文整理汇总了C#中BodyFrameReader类的典型用法代码示例。如果您正苦于以下问题:C# BodyFrameReader类的具体用法?C# BodyFrameReader怎么用?C# BodyFrameReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BodyFrameReader类属于命名空间,在下文中一共展示了BodyFrameReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RelativeTime
public void RelativeTime()
{
bodyReader = GetBodyFrameReader();
using ( var bodyFrame = bodyReader.AcquireLatestFrame() ) {
Assert.AreNotEqual( 0, bodyFrame.RelativeTime() );
}
}
开发者ID:mbilwar,项目名称:Kinect2UnityWrapper,代码行数:7,代码来源:BodyFrameTest.cs
示例2: AcquireLatestFrame
public void AcquireLatestFrame()
{
bodyReader = GetBodyFrameReader();
using ( var bodyFrame = bodyReader.AcquireLatestFrame() ) {
}
using ( var bodyFrame = bodyReader.AcquireLatestFrame() ) {
}
}
开发者ID:mbilwar,项目名称:Kinect2UnityWrapper,代码行数:9,代码来源:BodyFrameTest.cs
示例3: GetAndRefreshBodyData
public void GetAndRefreshBodyData()
{
bodyReader = GetBodyFrameReader();
using ( var bodyFrame = bodyReader.AcquireLatestFrame() ) {
Body[] bodies = new Body[6];
bodyFrame.GetAndRefreshBodyData( bodies );
foreach ( var body in bodies ) {
}
}
}
开发者ID:mbilwar,项目名称:Kinect2UnityWrapper,代码行数:10,代码来源:BodyFrameTest.cs
示例4: DebugWindow
public DebugWindow(Controller.GameController GameController)
{
InitializeComponent();
db = new Helpers.DBHelper();
attGameController = GameController;
attks = KinectSensor.GetDefault();
attks.Open();
attBodyFrameReader = attks.BodyFrameSource.OpenReader();
attBodyFrameReader.FrameArrived += this.Reader_BodyFrameArrived;
}
开发者ID:Amebus,项目名称:KillersWearsPrada,代码行数:11,代码来源:DebugWindow.xaml.cs
示例5: Dispose
public void Dispose()
{
if (this.bodyFrameReader != null)
{
// BodyFrameReader is IDisposable
this.bodyFrameReader.Dispose();
this.bodyFrameReader = null;
}
if (this.kinectSensor != null)
{
this.kinectSensor.Close();
this.kinectSensor = null;
}
}
开发者ID:amirben,项目名称:VideoTherapy,代码行数:15,代码来源:DistanceWindow.xaml.cs
示例6: 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;
}
}
开发者ID:tomgarcia,项目名称:kinect-iot,代码行数:30,代码来源:MainWindow.xaml.cs
示例7: MainWindow
public MainWindow()
{
InitializeComponent();
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_sensor.Open();
_bodies = new Body[_sensor.BodyFrameSource.BodyCount];
_colorReader = _sensor.ColorFrameSource.OpenReader();
_colorReader.FrameArrived += ColorReader_FrameArrived;
_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 |
FaceFrameFeatures.LookingAway);
_faceReader = _faceSource.OpenReader();
_faceReader.FrameArrived += FaceReader_FrameArrived;
}
}
开发者ID:pghdotnet,项目名称:OxfordFace,代码行数:31,代码来源:MainWindow.xaml.cs
示例8: RunAsync
//Run the application async
static async Task RunAsync()
{
//Get the default Kinect Sensor
_kinectSensor = KinectSensor.GetDefault();
// open the reader for the body frames
_bodyFrameReader = _kinectSensor.BodyFrameSource.OpenReader();
// Set the coordinate Mapper
_coordinateMapper = _kinectSensor.CoordinateMapper;
//open the sensor
_kinectSensor.Open();
//Check if the Sensor is available
Console.WriteLine("Kinect sensor is " + (_kinectSensor.IsAvailable ? "available " : "missing. Waiting for sensor: press ctrl + c to abort"));
while (!_kinectSensor.IsAvailable)
{
//wait for sensor
}
Console.WriteLine("Kinect sensor is " + (_kinectSensor.IsAvailable ? "available " : "missing. Waiting for sensor: press ctrl + c to abort"));
//Init gesture
_handOverHeadDetector = new HandOverHeadDetector(HandDetectionType.BothHands, HandState.Open);
//Subscribe to completed event
_handOverHeadDetector.GestureCompleteEvent += HandOverHeadDetectorOnGestureCompleteEvent;
//Start reciving kinect Frames
if (_bodyFrameReader != null)
{
_bodyFrameReader.FrameArrived += Reader_FrameArrived;
}
}
开发者ID:Aniel,项目名称:SimpleKinectGestureExample,代码行数:34,代码来源:Program.cs
示例9: MainWindow
/// <summary>
/// コンストラクタ
/// </summary>
public MainWindow()
{
InitializeComponent();
// Init Kinect Sensors
this.kinect = KinectSensor.GetDefault();
if (kinect == null)
{
this.showCloseDialog("Kinectが接続されていないか、利用できません。アプリケーションを終了します。");
}
this.colorImageFormat = ColorImageFormat.Bgra;
this.colorFrameDescription = this.kinect.ColorFrameSource.CreateFrameDescription(this.colorImageFormat);
this.colorFrameReader = this.kinect.ColorFrameSource.OpenReader();
this.colorFrameReader.FrameArrived += ColorFrameReader_FrameArrived;
bodyFrameReader = kinect.BodyFrameSource.OpenReader();
bodyFrameReader.FrameArrived += bodyFrameReader_FrameArrived;
this.kinect.Open();
this.bodies = this.bodies = new Body[kinect.BodyFrameSource.BodyCount];
KinectRegion.SetKinectRegion(this, kinectRegion);
this.kinectRegion.KinectSensor = KinectSensor.GetDefault();
this.isTraining = false;
}
开发者ID:syv2357,项目名称:FASystem,代码行数:30,代码来源:MainWindow.xaml.cs
示例10: Recorder
public Recorder(string filename, Dispatcher dispatcher)
{
if (!sensor.IsOpen)
{
sensor.Open();
}
if (sensor.IsOpen)
{
bodyReader = sensor.BodyFrameSource.OpenReader();
colorReader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Body | FrameSourceTypes.Depth | FrameSourceTypes.Color);
logger.Trace("Kinect sensor is open");
}
else
{
logger.Error("Kinect sensor is not open");
}
metadata = MetadataFactory.Create();
fileStream = new FileStream(filename, FileMode.Create);
AppendMessageToFileStream(metadata.Serialize());
this.dispatcher = dispatcher;
}
开发者ID:wuyuntao,项目名称:Mokap,代码行数:26,代码来源:Recorder.cs
示例11: MainWindow
public MainWindow()
{
// Get the sensor
sensor = KinectSensor.GetDefault();
sensor.Open();
// Setup readers for each source of data we want to use
colorFrameReader = sensor.ColorFrameSource.OpenReader();
bodyFrameReader = sensor.BodyFrameSource.OpenReader();
// Setup event handlers that use what we get from the readers
colorFrameReader.FrameArrived += this.Reader_ColorFrameArrived;
bodyFrameReader.FrameArrived += this.Reader_BodyFrameArrived;
// Get ready to draw graphics
drawingGroup = new DrawingGroup();
// Initialize the components (controls) of the window
InitializeComponent();
// Initialize color components
// create the bitmap to display
colorBitmap = new WriteableBitmap(1920, 1080, 96.0, 96.0, PixelFormats.Bgr32, null);
ColorImage.Source = colorBitmap;
// Initialize the game components
birdHeight = this.Height / 2; // put the bird in the middle of the screen
prevRightHandHeight = 0;
prevLeftHandHeight = 0;
pipeX = -1;
pipeGapY = 250;
pipeGapLength = 170;
randomGenerator = new Random();
}
开发者ID:theAlexPatin,项目名称:FlappyKinectDEMO,代码行数:35,代码来源:MainWindow.xaml.cs
示例12: MainWindow
public MainWindow()
{
InitializeComponent();
network.init();
_sensor = KinectSensor.GetDefault();
if(_sensor != null)
{
_sensor.Open();
// Identify the bodies
_bodies = new Body[_sensor.BodyFrameSource.BodyCount];
_colorReader = _sensor.ColorFrameSource.OpenReader();
_colorReader.FrameArrived += ColorReader_FrameArrived;
_bodyReader = _sensor.BodyFrameSource.OpenReader();
_bodyReader.FrameArrived += BodyReader_FrameArrived;
// Initialize the face source with the desired features, some are commented out, include later.
_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;
}
}
开发者ID:Ramvling,项目名称:CS4903-Kinect-Improv,代码行数:33,代码来源:MainWindow.xaml.cs
示例13: MainWindow
public MainWindow()
{
InitializeComponent();
var hubConnection = new HubConnection("http://divewakeweb.azurewebsites.net/");
stockTickerHubProxy = hubConnection.CreateHubProxy("WakeHub");
hubConnection.Start().Wait();
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_sensor.Open();
_bodies = new Body[_sensor.BodyFrameSource.BodyCount];
_colorReader = _sensor.ColorFrameSource.OpenReader();
_colorReader.FrameArrived += ColorReader_FrameArrived;
_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.LeftEyeClosed |
FaceFrameFeatures.PointsInColorSpace |
FaceFrameFeatures.RightEyeClosed);
_faceReader = _faceSource.OpenReader();
_faceReader.FrameArrived += FaceReader_FrameArrived;
}
}
开发者ID:supershirin,项目名称:DriveWake,代码行数:30,代码来源:MainWindow.xaml.cs
示例14: MainWindow
/// <summary>
/// The main window of the app.
/// </summary>
public MainWindow()
{
InitializeComponent();
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
_depthReader = _sensor.DepthFrameSource.OpenReader();
_depthReader.FrameArrived += DepthReader_FrameArrived;
_infraredReader = _sensor.InfraredFrameSource.OpenReader();
_infraredReader.FrameArrived += InfraredReader_FrameArrived;
_bodyReader = _sensor.BodyFrameSource.OpenReader();
_bodyReader.FrameArrived += BodyReader_FrameArrived;
_bodies = new Body[_sensor.BodyFrameSource.BodyCount];
// Initialize the HandsController and subscribe to the HandsDetected event.
_handsController = new HandsController();
_handsController.HandsDetected += HandsController_HandsDetected;
_sensor.Open();
}
}
开发者ID:guozanhua,项目名称:Kinect-Finger-Tracking,代码行数:28,代码来源:MainWindow.xaml.cs
示例15: MainWindow
public MainWindow()
{
InitializeComponent();
try
{
///キネクト本体の接続を確保、たしか接続されてない場合はfalseとかになった記憶
this.kinect = KinectSensor.GetDefault();
///読み込む画像のフォーマット(rgbとか)を指定、どうやって読み込むかのリーダの設定も
this.colorImageFormat = ColorImageFormat.Bgra;
this.colorFrameDescription = this.kinect.ColorFrameSource.CreateFrameDescription(this.colorImageFormat);
this.colorFrameReader = this.kinect.ColorFrameSource.OpenReader();
this.colorFrameReader.FrameArrived += colorFrameReader_FrameArrived;
this.kinect.Open();//キネクト起動!!
if (!kinect.IsOpen)
{
this.errorLog.Visibility = Visibility.Visible;
this.errorLog.Content = "キネクトが見つからないよ!残念!";
throw new Exception("キネクトが見つかりませんでした!!!");
}
///bodyを格納するための配列作成
bodies = new Body[kinect.BodyFrameSource.BodyCount];
///ボディリーダーを開く
bodyFrameReader = kinect.BodyFrameSource.OpenReader();
bodyFrameReader.FrameArrived += bodyFrameReader_FrameArrived;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
Close();
}
}
开发者ID:TokisaSigure,项目名称:Kinectv2-Practice,代码行数:32,代码来源:MainWindow.xaml.cs
示例16: MainWindow
public MainWindow()
{
InitializeComponent();
_sensor = KinectSensor.GetDefault();
if (_sensor != null)
{
// Listen for body data.
_bodySource = _sensor.BodyFrameSource;
_bodyReader = _bodySource.OpenReader();
_bodyReader.FrameArrived += BodyReader_FrameArrived;
_colorReader = _sensor.ColorFrameSource.OpenReader();
_colorReader.FrameArrived += ColorReader_FrameArrived;
// Listen for HD face data.
_faceSource = new HighDefinitionFaceFrameSource(_sensor);
_faceSourceSub = new HighDefinitionFaceFrameSource(_sensor);
// _faceSource.TrackingIdLost += OnTrackingIdLost;
_faceReader = _faceSource.OpenReader();
_faceReaderSub = _faceSourceSub.OpenReader();
_faceReader.FrameArrived += FaceReader_FrameArrived;
_faceReaderSub.FrameArrived += FaceReaderSub_FrameArrived;
_faceModel = new FaceModel();
_faceAlignment = new FaceAlignment();
_faceAlignmentSub = new FaceAlignment();
// Start tracking!
_sensor.Open();
}
}
开发者ID:yuukinona,项目名称:Facetrack,代码行数:32,代码来源:MainWindow.xaml.cs
示例17: KinectController
public KinectController()
{
kinectSensor = KinectSensor.GetDefault();
// open the reader for the body frames
bodyReader = kinectSensor.BodyFrameSource.OpenReader();
kinectSensor.Open();
Arm = ArmPointing.Nothing;
hasPointed = false;
lastAveragePositionLeft = 0f;
lastAveragePositionRight = 0f;
frameCounterLeft = 0;
frameCounterRight = 0;
if (!File.Exists(OPT_FILE))
{
offsetX = 0;
offsetY = 0;
} else
{
string data = File.ReadAllText(OPT_FILE);
List <float> offset = JsonConvert.DeserializeObject<List<float>>(data);
offsetX = offset[0];
offsetY = offset[1];
}
}
开发者ID:NoMore201,项目名称:InteractiveMediaWindow,代码行数:27,代码来源:KinectController.cs
示例18: MainWindow_Loaded
void MainWindow_Loaded( object sender, RoutedEventArgs e )
{
kinect = Kinect2.KinectSensor.Default;
kinect.Open();
colorReader = kinect.ColorFrameSource.OpenReader();
bodyReader = kinect.BodyFrameSource.OpenReader();
CompositionTarget.Rendering += CompositionTarget_Rendering;
}
开发者ID:mbilwar,项目名称:Kinect2UnityWrapper,代码行数:9,代码来源:MainWindow.xaml.cs
示例19: KinectSensorBodyFrameProvider
/// <summary>
/// Constructor
/// </summary>
/// <param name="sensor">Kinect sensor</param>
public KinectSensorBodyFrameProvider(KinectSensor sensor)
{
if (sensor == null)
throw new ArgumentNullException("sensor");
this.sensor = sensor;
this.reader = this.sensor.BodyFrameSource.OpenReader();
this.reader.FrameArrived += this.FrameArrived;
}
开发者ID:semihguresci,项目名称:kgp,代码行数:13,代码来源:KinectSensorBodyFrameProvider.cs
示例20: HandOverheadEngagementModel
public HandOverheadEngagementModel(int engagedPeopleAllowed)
{
this.EngagedPeopleAllowed = engagedPeopleAllowed;
var sensor = KinectSensor.GetDefault();
this.bodyReader = sensor.BodyFrameSource.OpenReader();
this.bodyReader.FrameArrived += this.BodyReader_FrameArrived;
sensor.Open();
this.bodies = new Body[this.bodyReader.BodyFrameSource.BodyCount];
this.handsToEngage = new List<BodyHandPair>();
}
开发者ID:Jonathan1,项目名称:MasterThesis-PresentationTrainer,代码行数:10,代码来源:HandOverheadEngagementModel.cs
注:本文中的BodyFrameReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论