如何平滑处理Kinect采集的骨骼数据 | KinectAPI编程
2013-05-06 20:37
330 查看
1. What causes skeleton jitters?
Though the skeleton jitters could be caused by the application performance due to both software and hardware, there are several internal possible reasons for skeleton joints jittering. One of the main reasons is processing large amounts of data over a period of time during skeleton tracking. Because of the processing of large data, it's very difficult to calculate the accuracy of the joint movements.
2. Making skeleton movement softer
The Kinect for Windows SDK exposes some APIs for smoothing and filtering out the skeleton data. We can set smoothing parameters while setting up the skeleton stream data. The smoothing parameters solve the jittering problem by filtering the skeleton data and applying a smoothing algorithm to it. We have already seen that the SkeletonStream class has an overloaded Enable() method. This method accepts SmoothParameters as a parameter, which is a type of TransformSmoothParameters structure.
For example, the following code enables a skeleton stream using TransformSmoothParameters.
// create the smooth parameters
var smoothParameters = new TransformSmoothParameters
{
Correction = 0.1f,
JitterRadius = 0.05f,
MaxDeviationRadius = 0.05f,
Prediction = 0.1f,
Smoothing = 1.0f
};
// Enable the skeleton stream with smooth parameters
this.sensor.SkeletonStream.Enable(smoothParameters);
应用实例1:《Kinect应用开发实践 》 Page182
var parameters = new TransformSmoothParameters
{
Smoothing = 0.5f,
Correction = 0.5f,
Prediction = 0.5f,
JitterRadius = 0.05f,
MaxDeviationRadius = 0.04f
};
kinect.SkeletonStream.Enable(parameters);
// kinect.SkeletonStream.Enable(); // 以上等同于该指令的作用
应用实例2:《Programming with the Kinect for Windows SDK 》 Page134
参数设置与应用实例1相同,代码略
3. Smoothing parameters
TransformSmoothParameters is a public structure defined in the Microsoft. Kinect assembly. It has five public properties that enable the overall smoothing of skeleton data. The following table lists out the properties:
4. How to check if skeleton smoothing is enabled?
The SkeletonStream has a read-only property IsSmoothingEnabled to check if the smoothing is enabled. For example, you can use the property as follows:
bool isSmoothingEnable = this.sensor.SkeletonStream.IsSmoothingEnabled;
The IsSmoothingEnabled property is automatically set to true when the stream is
enabled with TransformSmoothParameters and false when the default Enable()
method is used.
5. Exponential smoothing
The Kinect for Windows SDK exposes an API to apply the smoothing parameter while enabling the skeleton stream and once it's applied, all the joint positions returned by the skeleton tracking engine will be smooth. The smoothing parameters
are applied to the data returned by the skeleton engine over time. The overall smoothing process uses statistical analysis to generate a moving average of joints, which reduces the noise. The Kinect for Windows SDK uses the Holt double exponential smoothing procedure to reduce the jitters from skeletal joint data. The exponential smoothing is applied to a series of time-based data to make a forecast.
The skeleton engine returns the skeleton frame in a regular time interval. The smoothing algorithm applies to each set of data and calculates a moving average based on the previous set of data. During the calculation of moving average, it uses
the values passed by the smoothing parameter. For example, from the following sample chart you can see the difference between the raw skeleton and smoothed data. If you noticed, the trend of data movement always remains the same as the original data but the deviation is less.
Applying smoothing on skeleton data could be very expensive in terms of application performance. This is because the skeleton stream data itself is massive, and applying smoothing filtering on it makes data processing slow and this highly depends on the parameters you are using.
本文摘自《Kinect for Windows SDK Programming Guide》 Abhijit Jana 著 PACKT Publishing (First Published 2012.12) 第六章:Human Skeleton Tracking
Though the skeleton jitters could be caused by the application performance due to both software and hardware, there are several internal possible reasons for skeleton joints jittering. One of the main reasons is processing large amounts of data over a period of time during skeleton tracking. Because of the processing of large data, it's very difficult to calculate the accuracy of the joint movements.
2. Making skeleton movement softer
The Kinect for Windows SDK exposes some APIs for smoothing and filtering out the skeleton data. We can set smoothing parameters while setting up the skeleton stream data. The smoothing parameters solve the jittering problem by filtering the skeleton data and applying a smoothing algorithm to it. We have already seen that the SkeletonStream class has an overloaded Enable() method. This method accepts SmoothParameters as a parameter, which is a type of TransformSmoothParameters structure.
For example, the following code enables a skeleton stream using TransformSmoothParameters.
// create the smooth parameters
var smoothParameters = new TransformSmoothParameters
{
Correction = 0.1f,
JitterRadius = 0.05f,
MaxDeviationRadius = 0.05f,
Prediction = 0.1f,
Smoothing = 1.0f
};
// Enable the skeleton stream with smooth parameters
this.sensor.SkeletonStream.Enable(smoothParameters);
应用实例1:《Kinect应用开发实践 》 Page182
var parameters = new TransformSmoothParameters
{
Smoothing = 0.5f,
Correction = 0.5f,
Prediction = 0.5f,
JitterRadius = 0.05f,
MaxDeviationRadius = 0.04f
};
kinect.SkeletonStream.Enable(parameters);
// kinect.SkeletonStream.Enable(); // 以上等同于该指令的作用
应用实例2:《Programming with the Kinect for Windows SDK 》 Page134
参数设置与应用实例1相同,代码略
3. Smoothing parameters
TransformSmoothParameters is a public structure defined in the Microsoft. Kinect assembly. It has five public properties that enable the overall smoothing of skeleton data. The following table lists out the properties:
4. How to check if skeleton smoothing is enabled?
The SkeletonStream has a read-only property IsSmoothingEnabled to check if the smoothing is enabled. For example, you can use the property as follows:
bool isSmoothingEnable = this.sensor.SkeletonStream.IsSmoothingEnabled;
The IsSmoothingEnabled property is automatically set to true when the stream is
enabled with TransformSmoothParameters and false when the default Enable()
method is used.
5. Exponential smoothing
The Kinect for Windows SDK exposes an API to apply the smoothing parameter while enabling the skeleton stream and once it's applied, all the joint positions returned by the skeleton tracking engine will be smooth. The smoothing parameters
are applied to the data returned by the skeleton engine over time. The overall smoothing process uses statistical analysis to generate a moving average of joints, which reduces the noise. The Kinect for Windows SDK uses the Holt double exponential smoothing procedure to reduce the jitters from skeletal joint data. The exponential smoothing is applied to a series of time-based data to make a forecast.
The skeleton engine returns the skeleton frame in a regular time interval. The smoothing algorithm applies to each set of data and calculates a moving average based on the previous set of data. During the calculation of moving average, it uses
the values passed by the smoothing parameter. For example, from the following sample chart you can see the difference between the raw skeleton and smoothed data. If you noticed, the trend of data movement always remains the same as the original data but the deviation is less.
Applying smoothing on skeleton data could be very expensive in terms of application performance. This is because the skeleton stream data itself is massive, and applying smoothing filtering on it makes data processing slow and this highly depends on the parameters you are using.
本文摘自《Kinect for Windows SDK Programming Guide》 Abhijit Jana 著 PACKT Publishing (First Published 2012.12) 第六章:Human Skeleton Tracking
相关文章推荐
- Kinect API 自带骨骼数据平滑处理
- Kinect 骨骼追踪数据的处理方法
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战004-Flink基于流的window操作002
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战011-DataStream与MySql自定义sink和source(Java版)003
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战002-Flink基于流的wordcount示例002
- Kinect 骨骼追踪数据的处理方法
- 【手机网络游戏 编程】C#异步socketAPI调用 处理数据的流程
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战012-Flink在流处理中常见的sink和source001
- 抓取网页中的内容、如何解决乱码问题、如何解决登录问题以及对所采集的数据进行处理显示的过程
- Kinect 骨骼追踪数据处理
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战005-Flink基于流的window操作003
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战013-Flink在流处理中常见的sink和source002
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战003-Flink基于流的window操作001
- kinect编程(二):添加事件处理,捕捉数据
- Kinect骨骼坐标系的转换 | KinectAPI编程
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战006-DataStream与MySql自定义sink和source(Scala版)001
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战007-DataStream与MySql自定义sink和source(Scala版)002
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战008-DataStream与MySql自定义sink和source(Scala版)003
- 云星数据---Apache Flink实战系列(精品版)】:Flink流处理API详解与编程实战009-DataStream与MySql自定义sink和source(Java版)001