Kinect – Getting Started – Control Camera Angle
In my last post Kinect .NET SDK–Getting Started I showed how to begin writing for Kinect using the new and cool .NET SDK For Kinect, and as I promised I‘ll keep on writing step by step to allow you to understand and get inside all the cool things in Kinect - But Step By Step
So in this post I’ll show to easy is to control Kinect Camera Angle (Change the position on the camera).
There is Minimum and Maximum angels you can control but as you can see from the last picture (right) you can move the Kinect Sensor manually and the Angle will change automatically.



Download Demo Project
Step 1: Create Kinect Application
First you need to create a basic WPF application Kinect .NET SDK–Getting Started.
Now when you initialize the KinectNui you can only use the UseColor option for this demo.
//Open the video and depth streams, and sets up the event handlers that the runtime calls when a video, depth, or skeleton frame is ready
//An application must initialize the Kinect sensor by calling Runtime.Initialize before calling any other methods on the Runtime object.
_kinectNui.Initialize(RuntimeOptions.UseColor);
Step 2: Obtain Camera Sensor
Create object from the Kinect Nui after the initialization
Camera _cam;
_cam = _kinectNui.NuiCamera;
txtCameraName.Text = _cam.UniqueDeviceName;
Here is the Camera Definition:
public class Camera
{
public static readonly int ElevationMaximum;
public static readonly int ElevationMinimum;
public int ElevationAngle { get; set; }
public string UniqueDeviceName { get; }
public void GetColorPixelCoordinatesFromDepthPixel(ImageResolution colorResolution, ImageViewArea viewArea,
int depthX, int depthY, short depthValue, out int colorX,
out int colorY); }
Step 3: Up and Down
Now when you do that you can control the camera angel as follow:
To increase the Camera Angel all you need to do is to increase camera ElevationAngle, there is Min and Max angels for the camera that you can control so don’t be afraid to push it to much. 
private void BtnCameraUpClick(object sender, RoutedEventArgs e)
{
try
{
_cam.ElevationAngle = _cam.ElevationAngle + 5;
}
catch (InvalidOperationException ex)
{
MessageBox.Show(ex.Message);
}
catch (ArgumentOutOfRangeException outOfRangeException)
{
//Elevation angle must be between Elevation Minimum/Maximum"
MessageBox.Show(outOfRangeException.Message);
}
And Down
private void BtnCameraDownClick(object sender, RoutedEventArgs e)
{
try {
_cam.ElevationAngle = _cam.ElevationAngle - 5;
}
catch (InvalidOperationException ex)
{ MessageBox.Show(ex.Message);
}
catch (ArgumentOutOfRangeException outOfRangeException)
{
//Elevation angle must be between Elevation Minimum/Maximum"
MessageBox.Show(outOfRangeException.Message);
}
}
Download Demo Project