How to programmatically stop tracking a HandPoint?

Looking through the src it appears that PointProcessor keeps track of the points. I’d like to programmatically disregard a point by its TrackingID. Thank you in advance.

There’s no way to do this right now, but it would not be difficult to add this feature.

I’d like to understand more about your scenario. What are you using the hand tracker for, and when would you want to stop tracking a hand point?

Hi Josh. I’ve done a lot with the Intel RealSense f200 and I’m really happy with my Orbbec Astra Pro. Pass my kudos on to the team please. I need several hand gestures to control (at least rotate) a 3D scene. I’d like the HandPoint to stop tracking (go away) when the user stops moving their hand. When they want to resume, they wave again, then get a HandPoint and continue until they stop. Is there a better way? I don’t believe you have a set of recognized hand gestures yet but perhaps I’m wrong.
Thank you in advance.

Could I just stop then start the stream to have it forget any active HandPoints? Or if from within SimpleHandViewer-SFML, I could get a reference to HandTracker from the PluginServiceProxy, that I could call handTracker.reset. I should be able to find it in the src but if you happen to have a snippet that would save me some time.
Thank you

Thanks for the kind words. :slight_smile:

You won’t be able to get a concrete reference to any class within a plugin. Stopping and starting the hand stream won’t necessarily reset everything. For your scenario, I’d suggest copying and adapting the trajectory_analyzer class into your own project. It provides wave gesture and steady recognition. Using it on the hand point stream won’t interrupt the hand tracker itself, as it only looks for the wave gesture for hand initialization.

RFE (request for enhancement) for TrajectoryAnalyzer gesture states to be propogated to the HandPoint.
Benefits: It would allow c++api to receive gesture events (simplicitly outlined below) and avoids
having 2X TrajectoryAnalyzer cpu cycles. The alternative is dragging your hand out of the frame
but for 3D worlds, it will be very difficult to know when the user was truly finished unless STEADY_DETECTED is known. This would dramatically improve usability.
Picture your hand over the left part of a scene.
To pan the camera you would:
1.) [WaveGesture] → pan hand (move hand right) → [SteadyGesture].
2.) Move your hand back to the left (handpoint is ignored).
3.) Repeat steps 1-3 to pan to the right continuously around a 3D world.
Proposed Changes:
A.) Add an enum to hand_types.h (detail below)
B.) Add HandPoint.gesture() method returning astra_handgesture
C.) Add a few code lines to TrajectoryAnalyzer where gestures
are detected to set the HandPoint.gesture()

————————— detail —————————
A.) New enum indicating a gesture happened (within the last timeout
period to ensure I get the event if frames are skipped):

typedef enum astra_handgesture 
    WAVE_DETECTED,         //per TrajectoryAnalyzer
    WAVE_TIMEDOUT,         //possibly refactor to GESTURE_TIMEOUT
    WAVE_RESET,               //per TrajectoryAnalyzer
    STEADY_DETECTED,    //my code ignores movement
} astra_handgesture;

Instead of re-implemnting TrajectoryAnalyzer, developers would only need the following:

  void processHandFrame(astra::Frame& frame) 
      astra::HandFrame handFrame = frame.get();
      m_handPoints = handFrame.handpoints();
      for (auto hp : m_handPoints) 
          if (hp.status() != HAND_STATUS_TRACKING) continue;
          if (hp.gesture() == WAVE_DETECTED) 
              isPanning = true; //pan the camera
          if(hp.gesture() == STEADY_DETECTED) {
              isPanning = false; //move hand back for further panning