Hey Guys, i hope you can help me
I would like to keep my hands present if one gets out of sight of the sensor. For this I have selected the PostProcessProvider Class, as it is used in the two examples "InertiaPostProcessProvider" and "ProjectionPostProcessProvider".
Here I would have intercepted both hands in the section "public override void ProcessFrame (ref Frame inputFrame)", same like in both examples, and if one of them disappears, I would have replaced it with the hand that was detected last. Unfortunately, it somehow doesn't quite work, although I can't see a mistake in my thinking, maybe someone of you has already worked on something like that and has a solution or an idea how I could approach it.
the two variables "last_leftHand" and "last_rightHand" are private Variables, so they can not get reseted over the different frames progressing in time.
Here is my Code:
public override void ProcessFrame(ref Frame inputFrame)
{
Hand leftHand = inputFrame.Hands.Query().FirstOrDefault(h => h.IsLeft);
Hand rightHand = inputFrame.Hands.Query().FirstOrDefault(h => !h.IsLeft);
if (PermaHandOn) //only a bool, so I can deactivate it quick
{
//Realization of the left Hand
if (leftHand != null)
{
last_leftHand = leftHand;
}
else
{
if (last_leftHand != null)
{
leftHand = last_leftHand;
inputFrame.Hands.Add(leftHand);
}
//Realization of the right Hand
if (rightHand != null)
{
last_rightHand = rightHand;
}
else
{
if (last_rightHand != null)
{
rightHand = last_rightHand;
inputFrame.Hands.Add(rightHand);
}
}
}
}
It works in itself if I only had one hand (for example the left on) in the picture and take it out again, but when the other hand comes into the view, the left hand gets exceeded with zero and disappears, which should not actually be because both hands are actually completely independent (at least for me, maybe i am false ).
Thank you guys