They have asked me to do something simple in kinect
but in C#
(I have been studying for 1 week C#
since it is not my language).
Thanks to the codes that Microsoft shares when you install the SDK, I have the code where your kinect image appears and an image in the background.
Someone who controls C#
or has worked with kinect
that I can guide me?
I've got:
public MainWindow()
{
// get the kinectSensor object
this.kinectSensor = KinectSensor.GetDefault();
// open the reader for the depth frames
this.bodyIndexFrameReader = this.kinectSensor.BodyIndexFrameSource.OpenReader();
// wire handler for frame arrival
this.bodyIndexFrameReader.FrameArrived += this.Reader_FrameArrived;
this.bodyIndexFrameDescription = this.kinectSensor.BodyIndexFrameSource.FrameDescription;
// allocate space to put the pixels being converted
this.bodyIndexPixels = new uint[this.bodyIndexFrameDescription.Width * this.bodyIndexFrameDescription.Height];
// create the bitmap to display
this.bodyIndexBitmap = new WriteableBitmap(this.bodyIndexFrameDescription.Width, this.bodyIndexFrameDescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);
// set IsAvailableChanged event notifier
this.kinectSensor.IsAvailableChanged += this.Sensor_IsAvailableChanged;
// open the sensor
this.kinectSensor.Open();
// set the status text
this.StatusText = this.kinectSensor.IsAvailable ? Properties.Resources.RunningStatusText
: Properties.Resources.NoSensorStatusText;
// use the window object as the view model in this simple example
this.DataContext = this;
// initialize the components (controls) of the window
this.InitializeComponent();
//Inicializo el TIMER
inicioTimer();
}
When the application starts, a WPF is opened with an IMAGE object where what the KINECT shows appears, after the TIMER ends, a series of methods are started and I need the KINECT to start again, which method would I have to call from the what do I have in the MainWindow?
Thank you
this could help