本文整理汇总了C#中Microsoft.Kinect.KinectSensor.Start方法的典型用法代码示例。如果您正苦于以下问题:C# KinectSensor.Start方法的具体用法?C# KinectSensor.Start怎么用?C# KinectSensor.Start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Kinect.KinectSensor
的用法示例。
在下文中一共展示了KinectSensor.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InicializarKinect
private void InicializarKinect()
{
Kinect = InicializadorKinect.InicializarPrimeiroSensor(0);
Kinect.Start();
Kinect.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
Kinect.ColorFrameReady += Kinect_ColorFrameReady;
}
示例2: Window_Loaded_1
private void Window_Loaded_1(object sender, RoutedEventArgs e)
{
miKinect = KinectSensor.KinectSensors[0];
miKinect.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
miKinect.Start();
miKinect.ColorFrameReady += miKinect_ColorFrameReady;
}
示例3: KinectControl
public KinectControl(HoverButton kinectButton, double layoutHeight, double layoutWidth, List<Button> buttons, TextBox debugBox = null)
{
_kinectButton = kinectButton;
_layoutHeight = layoutHeight;
_layoutWidth = layoutWidth;
_buttons = buttons;
_debugBox = debugBox;
_kinect = KinectSensor.KinectSensors.FirstOrDefault();
if (_kinect != null)
{
_kinect.Start();
_kinect.ColorStream.Enable();
_kinect.SkeletonStream.Enable(new TransformSmoothParameters
{
Smoothing = 0.7f,
Correction = 0.1f,
Prediction = 0.1f,
JitterRadius = 0.05f,
MaxDeviationRadius = 0.05f
});
_kinect.SkeletonFrameReady += kinect_SkeletonFrameReady;
}
_activeRecognizer = CreateRecognizer();
_kinectButton.Click += KinectButton_Click;
}
示例4: StartKinect
/// <summary>
/// Starts up Kinect
/// </summary>
void StartKinect()
{
try
{
kinect = KinectSensor.KinectSensors.FirstOrDefault();
kinect.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(runtime_SkeletonFrameReady);
TransformSmoothParameters parameters = new TransformSmoothParameters()
{
Smoothing = 0.75f,
Correction = 0.0f,
Prediction = 0.0f,
JitterRadius = 0.05f,
MaxDeviationRadius = 0.4f
};
kinect.SkeletonStream.Enable(parameters);
this.skeletonData = new Skeleton[kinect.SkeletonStream.FrameSkeletonArrayLength];
kinect.Start();
Trace.WriteLine("Kinect initialized");
}
catch (Exception)
{
Trace.WriteLine("Error while initializing Kinect. Trying again in 5 seconds...");
kinectRetryTimer.Start();
}
}
示例5: Main
static void Main()
{
Init();
try
{
logic = new Logic();
sensor = KinectSensor.KinectSensors[0];
sensor.Start();
sensor.SkeletonStream.Enable();
sensor.SkeletonStream.EnableTrackingInNearRange = true;
timer = new Timer();
timer.Interval = 500;
timer.Elapsed += Timer_Elapsed;
timer.Enabled = true;
}
catch (Exception e)
{
Console.WriteLine(e);
}
Console.ReadLine();
}
示例6: Window_Loaded_1
private void Window_Loaded_1(object sender, RoutedEventArgs e)
{
if (KinectSensor.KinectSensors.Count == 0)
{
MessageBox.Show("No se detecta ningun kinect");
Application.Current.Shutdown();
}
miKinect = KinectSensor.KinectSensors.FirstOrDefault();
try
{
miKinect.SkeletonStream.Enable();
miKinect.ColorStream.Enable();
miKinect.Start();
}
catch
{
MessageBox.Show("La inicializacion del Kinect fallo");
Application.Current.Shutdown();
}
miKinect.SkeletonFrameReady += miKinect_SkeletonFrameReady;
miKinect.ColorFrameReady += miKinect_ColorFrameReady;
}
示例7: Window_Loaded_1
private void Window_Loaded_1(object sender, RoutedEventArgs e)
{
miKinect = KinectSensor.KinectSensors.FirstOrDefault();
miKinect.Start();
miKinect.ColorStream.Enable();
miKinect.ColorFrameReady += miKinect_ColorFrameReady;
}
示例8: initialize
public void initialize( int elevationAngle = 0 )
{
try { kinectSensor = KinectSensor.KinectSensors[0]; }
catch (Exception e)
{
Console.WriteLine("kinect not detected, continuing with kinect disabled {0}",e);
return;
}
// limits elevation angle to keep the motors from trying too extreme an angle
if (elevationAngle >= 26 )
{
elevationAngle = 26;
}
else if (elevationAngle <= -26)
{
elevationAngle = -26;
}
// Only initializes Skeletal Tracking
kinectSensor.SkeletonStream.Enable();
// set a call back function to process skeleton data
kinectSensor.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(kinectSkeletonFrameReadyCallback);
kinectSensor.Start();
kinectSensor.ElevationAngle = elevationAngle;
}
示例9: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// Check to see if a Kinect is available
if (KinectSensor.KinectSensors.Count == 0)
{
MessageBox.Show("No Kinects detected", "Camera Viewer");
Application.Current.Shutdown();
}
// Get the first Kinect on the computer
myKinect = KinectSensor.KinectSensors[0];
DateTime date = DateTime.Now;
sessiondate = date.ToLongDateString();
// Start the Kinect running and select the depth camera
try
{
myKinect.SkeletonStream.Enable();
myKinect.Start();
}
catch
{
MessageBox.Show("Kinect initialise failed", "Camera Viewer");
Application.Current.Shutdown();
}
// connect a handler to the event that fires when new frames are available
myKinect.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(myKinect_SkeletonFrameReady);
}
示例10: KinectGrabWheelController
public KinectGrabWheelController(WheelDelegate wheelDelegate, ScreenManager screenManager, KinectSensor kinect)
{
this.device = screenManager.GraphicsDevice;
this.wheelDelegate = wheelDelegate;
position = new Vector2();
positionScreen = new Vector2();
this.kinectSensor = kinect;
//if (!kinect.IsRunning)
//{
var parameters = new TransformSmoothParameters
{
Smoothing = 0.1f,
Correction = 0.0f,
Prediction = 0.0f,
JitterRadius = 1.0f,
MaxDeviationRadius = 0.5f
};
kinect.SkeletonStream.Enable(parameters);
kinect.DepthStream.Enable();
kinect.ColorStream.Enable();
kinect.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>(ks_AllFramesReady);
interactionStream = new Microsoft.Kinect.Toolkit.Interaction.InteractionStream(kinect, new myIntClient());
interactionStream.InteractionFrameReady += new EventHandler<InteractionFrameReadyEventArgs>(intStream_InteractionFrameReady);
kinect.Start();
//}
}
示例11: InitilizeKinect
private static void InitilizeKinect()
{
_sensor = KinectSensor.KinectSensors.SingleOrDefault();
_sensor.SkeletonStream.Enable();
_sensor.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(Sensor_SkeletonFrameReady);
_sensor.Start();
}
示例12: btnStream_Click
private void btnStream_Click(object sender, EventArgs e)
{
if (btnStream.Text == "Stream")
{
if (KinectSensor.KinectSensors.Count > 0)
{
sensor = KinectSensor.KinectSensors[0];
btnStream.Text = "Stop";
KinectSensor.KinectSensors.StatusChanged += KinectSensors_StatusChanged;
sensor.Start();
lblConID.Text = sensor.DeviceConnectionId;
sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
sensor.ColorFrameReady += Sensor_ColorFrameReady;
sensor.ElevationAngle = 0;
sliderValue.Text = sliderAngle.Value.ToString();
sliderAngle.Value = 0;
}
}
else
{
if (sensor != null && sensor.IsRunning)
{
sensor.Stop();
btnStream.Text = "Stream";
pb.Image = null;
}
}
}
示例13: OnLoaded
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
{
if (DesignerProperties.GetIsInDesignMode(this))
return;
// this is just a test, so it only works with one Kinect, and quits if that is not available.
_sensor = KinectSensor.KinectSensors.FirstOrDefault();
if (_sensor == null)
{
MessageBox.Show("No Kinect Sensor detected!");
Close();
return;
}
//_sensor.SkeletonStream.EnableTrackingInNearRange = true;
_sensor.SkeletonStream.Enable();
_sensor.SkeletonFrameReady += NuiSkeletonFrameReady;
_sensor.Start();
IGestureDetector gestureDetector = new InteractiveGestureDetector(_sensor);
((InteractiveGestureDetector)gestureDetector).DumpReady += InteractionStreamOnInteractionFrameReady;
IGestureDetector voiceDetector = new VoiceRecognition.KinectVoiceGestureDetector(_sensor);
ICommandSender commandSender = new XbmcCommandSender();
adapter = new GestureToCommandAdapter(@"GestureToCommand.XML", commandSender, gestureDetector, voiceDetector);
adapter.ShowNotification = true;
//Gestures
gestureDetector.GestureDetected += gestureDetector_GestureDetected;
}
示例14: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
sensor = KinectSensor.KinectSensors[0];
sensor.ColorStream.Enable();
sensor.ColorFrameReady += VideoFrameReady;
sensor.Start();
}
示例15: Load
public override void Load()
{
try
{
IsEnabled = true;
_kinect = KinectSensor.KinectSensors[0];
var parameters = new TransformSmoothParameters
{
Smoothing = 0.3f,
Correction = 0.0f,
Prediction = 0.0f,
JitterRadius = 1.0f,
MaxDeviationRadius = 0.5f
};
_kinect.SkeletonStream.Enable(parameters);
_kinect.AllFramesReady += _kinect_AllFramesReady;
_kinect.Start();
RawRotation = Quaternion.Identity;
}
catch (Exception exc)
{
Logger.Instance.Error(exc.Message, exc);
IsEnabled = false;
}
}