我必须在骨骼关节上应用平滑。我使用了 this link 提出的 union 过滤,但它没有给出正确的结果。是否有任何其他过滤器或任何其他方式将平滑应用于骨架?
例如:我已将所有 Kinect 关节传递给 Update
函数
KinectJointFilter.cpp(我从上面的链接中得到)。但是同样的数据
正在作为输出。我没有感觉到骨架平滑有任何变化。
请告诉我我的实现是否正确。
最佳答案
您可能需要在初始化之后调用具有不同平滑参数的 Init()
方法。
FilterDoubleExponential fde = new FilterDoubleExponential();
FLOAT fSmoothing = 0.7f;
FLOAT fCorrection = 0.3f;
FLOAT fPrediction = 1.0f;
FLOAT fJitterRadius = 1.0f;
FLOAT fMaxDeviationRadius = 1.0f;
// The above parameters provide very smoothed joints,
// but also an high latency.
// Change them as you prefer
// Set transform parameters.
fde.Init(fSmoothing, fCorrection, fPrediction, fJitterRadius, fMaxDeviationRadius);
现在,每当您有一个新骨架时,将其传递给 Update()
方法并使用 GetFilteredJoints()
以获得平滑的关节。
上面的代码我没有试过,但应该可以。
您可以在 this page 中找到一些有用的参数组合(指的是SDK 1.8,但示例中的参数在这种情况下也很好)。
关于c++ - 骨架平滑无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30400314/