ToString( "hh\:mm\:ss")) ĪddOrUpdateDeviceData( "Accelerometer: X", ( Math. We’re also asking the device to start spitting out IMU data with the _device.StartImu(), keeping a reference to the UI context and then running the ImuCapture() and CameraCapture() methods on background threads.īefore we jump into our ImuCapture() method implementation, let’s finish off the StopCamera() implementation which should set _applicationIsRunning, give the background threads 1 second to finish off then stop the sensors and dispose of the device:ĪddOrUpdateDeviceData( "Accelerometer: Timestamp", imu. The SynchronizedImagesOnly field ensures that our images from both cameras are synchronised. KINECT SKELETON VIEWER 1080PWe’re asking for the colour camera to start at 1080p (30 frames per second) with a 32 bit colour format and we’re asking for the depth and passive IR cameras to be started at captured at 512x512 with a wide field of view. Next we start the camera with our desired configuration. KINECT SKELETON VIEWER CODEWhat this code is doing is first checking that any devices are connected at all before opening the default device and retaining a reference to it with the _device = Device.Open() call. We’ll be creating a simple C# WPF app with an MVVM pattern so if you’re unsure about Dependency properties and the like, it might be worth brushing up on them by reading through Microsoft’s dependency properties overview documentation.įinally, we’ll be getting the camera output in a background thread and marshaling it back to the UI thread using the UI SynchronizationContext so it might be worth having a look at that if you’re not familiar with multithreaded apps in WPF. Hit me up on Twitter if you’re interested in AI with speech and the Kinect DK. I may do a tutorial using AI speech models in future if there’s enough call for it. We also won’t be using the 7-microphone array (2). We won’t be using it in these tutorials for AI purposes. Secondly, we’ll be using parts of the Accelerometer and gyroscope (4) but we’ll just be outputting the data. In order to combine the two outputs into a single video stream we need to do some offset transformations, luckily the SDK gives us some handy tools for that. If you look at the image here you’ll see that the 12 MP RGB video camera camera (3) sits on the front-left of the device whilst the 1 MP depth sensor (1) sits perfectly centre on the device. Firstly, the device itself and the sensor offset. % Get the joint indices of the tracked bodies with respect to the color % image.ĬolorJointIndices = lastframeMetadata.There are a couple of quick concepts to discuss before we jump into the code. TrackedBodies = find(lastframeMetadata.IsBodyTracked) % Find the indexes of the tracked bodies.ĪnyBodiesTracked = any(lastframeMetadata.IsBodyTracked ~= 0) % Extract the 90th frame and tracked body information. % SpineBase = 1 % SpineMid = 2 % Neck = 3 % Head = 4 % ShoulderLeft = 5 % ElbowLeft = 6 % WristLeft = 7 % HandLeft = 8 % ShoulderRight = 9 % ElbowRight = 10 % WristRight = 11 % HandRight = 12 % HipLeft = 13 % KneeLeft = 14 % AnkleLeft = 15 % FootLeft = 16 % HipRight = 17 % KneeRight = 18 % AnkleRight = 19 % FootRight = 20 % SpineShoulder = 21 % HandTipLeft = 22 % ThumbLeft = 23 % HandTipRight = 24 % ThumbRight = 25 % Create skeleton connection map to link the joints. % These are the order of joints returned by the kinect adaptor. % Get images and metadata from the color and depth device objects. 'Depth_512x424' video data to be logged upon START. Summary of Video Input Object Using 'Kinect V2 Depth Sensor'.Īcquisition Source(s): Kinect V2 Depth Source is available.Īcquisition Parameters: 'Kinect V2 Depth Source' is the current selected source. Trigger Parameters: 1 'immediate' trigger(s) on START. 'BGR_1920x1080' video data to be logged upon START. Summary of Video Input Object Using 'Kinect V2 Color Sensor'.Īcquisition Source(s): Kinect V2 Color Source is available.Īcquisition Parameters: 'Kinect V2 Color Source' is the current selected source.ġ0 frames per trigger using the selected source.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |