mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-05 13:28:16 +00:00
xrt: Rename some hand-tracking structs and document them better
This commit is contained in:
parent
9063c7dd82
commit
1718d01fb1
|
@ -287,7 +287,7 @@ ht_device_create_index(struct xrt_prober *xp, struct t_stereo_camera_calibration
|
|||
sync = t_hand_tracking_sync_old_rgb_create(calib);
|
||||
} else {
|
||||
|
||||
struct hand_tracking_image_boundary_info info;
|
||||
struct t_image_boundary_info info;
|
||||
info.views[0].type = HT_IMAGE_BOUNDARY_CIRCLE;
|
||||
info.views[1].type = HT_IMAGE_BOUNDARY_CIRCLE;
|
||||
|
||||
|
@ -357,9 +357,9 @@ ht_device_create_index(struct xrt_prober *xp, struct t_stereo_camera_calibration
|
|||
int
|
||||
ht_device_create(struct xrt_frame_context *xfctx,
|
||||
struct t_stereo_camera_calibration *calib,
|
||||
enum hand_tracking_output_space output_space,
|
||||
enum hand_tracking_algorithm algorithm_choice,
|
||||
struct hand_tracking_image_boundary_info boundary_info,
|
||||
enum t_hand_tracking_output_space output_space,
|
||||
enum t_hand_tracking_algorithm algorithm_choice,
|
||||
struct t_image_boundary_info boundary_info,
|
||||
struct xrt_slam_sinks **out_sinks,
|
||||
struct xrt_device **out_device)
|
||||
{
|
||||
|
@ -400,7 +400,7 @@ ht_device_create_depthai_ov9282()
|
|||
|
||||
struct t_hand_tracking_sync *sync;
|
||||
|
||||
struct hand_tracking_image_boundary_info info;
|
||||
struct t_image_boundary_info info;
|
||||
info.views[0].type = HT_IMAGE_BOUNDARY_NONE;
|
||||
info.views[1].type = HT_IMAGE_BOUNDARY_NONE;
|
||||
|
||||
|
|
|
@ -55,9 +55,9 @@ ht_device_create_index(struct xrt_prober *xp, struct t_stereo_camera_calibration
|
|||
int
|
||||
ht_device_create(struct xrt_frame_context *xfctx,
|
||||
struct t_stereo_camera_calibration *calib,
|
||||
enum hand_tracking_output_space output_space,
|
||||
enum hand_tracking_algorithm algorithm_choice,
|
||||
struct hand_tracking_image_boundary_info boundary_info,
|
||||
enum t_hand_tracking_output_space output_space,
|
||||
enum t_hand_tracking_algorithm algorithm_choice,
|
||||
struct t_hand_tracking_image_boundary_info boundary_info,
|
||||
struct xrt_slam_sinks **out_sinks,
|
||||
struct xrt_device **out_device);
|
||||
|
||||
|
|
|
@ -1488,7 +1488,7 @@ wmr_hmd_hand_track(struct wmr_hmd *wh,
|
|||
#ifdef XRT_BUILD_DRIVER_HANDTRACKING
|
||||
//!@todo Turning it off is okay for now, but we should plug metric_radius (or whatever it's called) in, at some
|
||||
//! point.
|
||||
struct hand_tracking_image_boundary_info boundary_info;
|
||||
struct t_hand_tracking_image_boundary_info boundary_info;
|
||||
boundary_info.views[0].type = HT_IMAGE_BOUNDARY_NONE;
|
||||
boundary_info.views[1].type = HT_IMAGE_BOUNDARY_NONE;
|
||||
|
||||
|
|
|
@ -18,25 +18,27 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum hand_tracking_output_space
|
||||
{
|
||||
HT_OUTPUT_SPACE_LEFT_CAMERA,
|
||||
HT_OUTPUT_SPACE_CENTER_OF_STEREO_CAMERA,
|
||||
};
|
||||
|
||||
enum hand_tracking_algorithm
|
||||
{
|
||||
HT_ALGORITHM_MERCURY,
|
||||
HT_ALGORITHM_OLD_RGB
|
||||
};
|
||||
|
||||
enum hand_tracking_image_boundary_type
|
||||
/*!
|
||||
* @brief Image boundary type.
|
||||
*
|
||||
* Currently used by hand-tracking to determine if parts of the hand are not visible to the camera, ie. they are outside
|
||||
* of the camera's vignette.
|
||||
* @ingroup xrt_iface
|
||||
*/
|
||||
enum t_image_boundary_type
|
||||
{
|
||||
HT_IMAGE_BOUNDARY_NONE,
|
||||
HT_IMAGE_BOUNDARY_CIRCLE,
|
||||
};
|
||||
|
||||
struct hand_tracking_image_boundary_circle
|
||||
/*!
|
||||
* @brief Circular image boundary.
|
||||
*
|
||||
* Currently used by hand-tracking to determine if parts of the hand are not visible to the camera, ie. they are outside
|
||||
* of the camera's vignette.
|
||||
* @ingroup xrt_iface
|
||||
*/
|
||||
struct t_image_boundary_circle
|
||||
{
|
||||
// The center, in normalized 0-1 UV coordinates.
|
||||
// Should probably be between 0 and 1 in pixel coordinates.
|
||||
|
@ -46,19 +48,58 @@ struct hand_tracking_image_boundary_circle
|
|||
float normalized_radius;
|
||||
};
|
||||
|
||||
struct hand_tracking_image_boundary_info_one_view
|
||||
/*!
|
||||
* @brief Image boundary for one view.
|
||||
*
|
||||
* Currently used by hand-tracking to determine if parts of the hand are not visible to the camera, ie. they are outside
|
||||
* of the camera's vignette.
|
||||
* @ingroup xrt_iface
|
||||
*/
|
||||
struct t_image_boundary_info_one_view
|
||||
{
|
||||
enum hand_tracking_image_boundary_type type;
|
||||
enum t_image_boundary_type type;
|
||||
union {
|
||||
struct hand_tracking_image_boundary_circle circle;
|
||||
struct t_image_boundary_circle circle;
|
||||
} boundary;
|
||||
};
|
||||
|
||||
|
||||
struct hand_tracking_image_boundary_info
|
||||
/*!
|
||||
* @brief Image boundaries for all the cameras used in a tracking system.
|
||||
*
|
||||
* Currently used by hand-tracking to determine if parts of the hand are not visible to the camera, ie. they are outside
|
||||
* of the camera's vignette.
|
||||
* @ingroup xrt_iface
|
||||
*/
|
||||
struct t_image_boundary_info
|
||||
{
|
||||
//!@todo Hardcoded to 2 - needs to increase as we support headsets with more cameras.
|
||||
struct hand_tracking_image_boundary_info_one_view views[2];
|
||||
struct t_image_boundary_info_one_view views[2];
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief Output coordinate system of the hand-tracking system.
|
||||
*
|
||||
* In HT_OUTPUT_SPACE_LEFT_CAMERA, the origin is at the left camera.
|
||||
* In HT_OUTPUT_SPACE_CENTER_OF_STEREO_CAMERA (which you should not be using, because it assumes that your camera is a
|
||||
* parallel stereo camera), the origin is at the "centerline" between the two main cameras.
|
||||
* @ingroup xrt_iface
|
||||
*/
|
||||
enum t_hand_tracking_output_space
|
||||
{
|
||||
HT_OUTPUT_SPACE_LEFT_CAMERA,
|
||||
HT_OUTPUT_SPACE_CENTER_OF_STEREO_CAMERA,
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief Which hand-tracking algorithm should we use?
|
||||
*
|
||||
* Never use HT_ALGORITHM_OLD_RGB. The tracking quality is extremely poor.
|
||||
* @ingroup xrt_iface
|
||||
*/
|
||||
enum t_hand_tracking_algorithm
|
||||
{
|
||||
HT_ALGORITHM_MERCURY,
|
||||
HT_ALGORITHM_OLD_RGB
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
|
@ -23,8 +23,8 @@ extern "C" {
|
|||
*/
|
||||
struct t_hand_tracking_sync *
|
||||
t_hand_tracking_sync_mercury_create(struct t_stereo_camera_calibration *calib,
|
||||
enum hand_tracking_output_space output_space,
|
||||
struct hand_tracking_image_boundary_info boundary_info);
|
||||
enum t_hand_tracking_output_space output_space,
|
||||
struct t_image_boundary_info boundary_info);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
|
@ -276,7 +276,9 @@ applyJointWidths(struct HandTracking *hgt, struct xrt_hand_joint_set *set)
|
|||
|
||||
template <typename Vec>
|
||||
static inline bool
|
||||
check_outside_view(struct HandTracking *hgt, struct hand_tracking_image_boundary_info_one_view boundary, Vec &keypoint)
|
||||
check_outside_view(struct HandTracking *hgt,
|
||||
struct t_hand_tracking_image_boundary_info_one_view boundary,
|
||||
Vec &keypoint)
|
||||
{
|
||||
// Regular case - the keypoint is literally outside the image
|
||||
if (keypoint.y > hgt->calibration_one_view_size_px.h || //
|
||||
|
@ -679,7 +681,7 @@ scribble_image_boundary(struct HandTracking *hgt)
|
|||
struct ht_view *view = &hgt->views[view_idx];
|
||||
|
||||
cv::Mat &debug_frame = view->debug_out_to_this;
|
||||
hand_tracking_image_boundary_info_one_view &info = hgt->image_boundary_info.views[view_idx];
|
||||
t_hand_tracking_image_boundary_info_one_view &info = hgt->image_boundary_info.views[view_idx];
|
||||
|
||||
if (info.type == HT_IMAGE_BOUNDARY_CIRCLE) {
|
||||
int center_x = hgt->last_frame_one_view_size_px.w * info.boundary.circle.normalized_center.x;
|
||||
|
@ -1024,8 +1026,8 @@ using namespace xrt::tracking::hand::mercury;
|
|||
|
||||
extern "C" t_hand_tracking_sync *
|
||||
t_hand_tracking_sync_mercury_create(struct t_stereo_camera_calibration *calib,
|
||||
enum hand_tracking_output_space output_space,
|
||||
struct hand_tracking_image_boundary_info boundary_info)
|
||||
enum t_hand_tracking_output_space output_space,
|
||||
struct t_hand_tracking_image_boundary_info boundary_info)
|
||||
{
|
||||
XRT_TRACE_MARKER();
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ public:
|
|||
|
||||
bool use_fisheye;
|
||||
|
||||
enum hand_tracking_output_space output_space;
|
||||
enum t_hand_tracking_output_space output_space;
|
||||
|
||||
struct t_stereo_camera_calibration *calib;
|
||||
|
||||
|
@ -244,7 +244,7 @@ public:
|
|||
|
||||
|
||||
struct xrt_pose left_in_right = {};
|
||||
struct hand_tracking_image_boundary_info image_boundary_info;
|
||||
struct t_image_boundary_info image_boundary_info;
|
||||
|
||||
u_frame_times_widget ft_widget = {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue