Working with depth range
The Kinect sensor captured data within a certain range of distance, which is specified by the Range
property of the
DepthStream
class. The Range
property sets the viewable range for the Kinect sensor, which is a type of DepthRange
enumeration.
A DepthRange
enumeration has the following two values:
Default
Near
By default, DepthRange
is set to Default
and the range varies from 800 mm to 4000 mm. You can change the range of the depth data stream as follows:
sensor.DepthStream.Range = DepthRange.Near;
The Near Mode feature helps us track a human body within a very close range (approximately 40 centimeters), and the range varies from 400 mm to 3000 mm. The following image shows the reliable range for both the default and Near Modes:
Note
This feature is limited to only the Kinect for Windows sensor. If you are using the Xbox sensor, you won't be able to work with Near Mode and the application will throw InvalidOperationException
.
To play around with different modes, let's extend...