15namespace xrt::tracking::hand::mercury {
19constexpr uint32_t kNumHands = 2;
20constexpr uint32_t kNumViews = 2;
35 return data.optimizing;
42 return data.hand_size_refinement_schedule_y;
49 return data.target_hand_size;
55 bool foundROIthisFrame =
false;
67 bool this_frame_hand_detected =
false;
68 bool hand_seen_before =
false;
82 framePreOptimizer(std::span<const ViewData, kNumViews> views, std::span<const HandData, kNumHands> hands);
112 hand_size_refinement_schedule_x = &this->data.hand_size_refinement_schedule_x;
113 hand_size_refinement_schedule_y = &this->data.hand_size_refinement_schedule_y;
117 struct HandSizeRefinementData
119 float hand_size_refinement_schedule_x = 0;
120 float hand_size_refinement_schedule_y = 0;
121 bool optimizing =
true;
122 float target_hand_size = STANDARD_HAND_SIZE;
126 HandSizeRefinementData data{};
130 float m_accum_hand_size = 0;
131 uint8_t num_hands = 0;
132 bool any_hands_are_only_visible_in_one_view =
false;
136 FrameData frameData{};
Hides the details of how hand size refinement/optimization is managed.
Definition hg_hand_size_opt.hpp:27
bool isOptimizing() const noexcept
Should the hand size be optimized (normally)
Definition hg_hand_size_opt.hpp:33
void get_refinement_schedule_ptrs(float *&hand_size_refinement_schedule_x, float *&hand_size_refinement_schedule_y)
Pointers that the debug gui wants.
Definition hg_hand_size_opt.hpp:110
float getHandSizeErrorMul() const noexcept
Y component of hand size refinement schedule.
Definition hg_hand_size_opt.hpp:40
bool framePreOptimizer(std::span< const ViewData, kNumViews > views, std::span< const HandData, kNumHands > hands)
Perform the updates for a single frame before running the optimizer.
Definition hg_hand_size_opt.cpp:17
void newUserEvent()
Reset state after a new user is found.
Definition hg_hand_size_opt.cpp:95
void frameHandPostOptimizer(float hand_size, float reprojection_error, const one_frame_input &input)
Call after your optimizer run for a single hand.
Definition hg_hand_size_opt.cpp:77
float getTargetHandSize() const noexcept
Return the current target hand size.
Definition hg_hand_size_opt.hpp:47
void framePost()
Finish processing for a frame, once no more hands are left.
Definition hg_hand_size_opt.cpp:87
Random common stuff for Mercury kinematic optimizers.
Per-hand input data structure.
Definition hg_hand_size_opt.hpp:66
Per-view input data structure.
Definition hg_hand_size_opt.hpp:60
Per-hand data that goes in a per-view structure.
Definition hg_hand_size_opt.hpp:54