Monado OpenXR Runtime
Loading...
Searching...
No Matches
t_rift_blobwatch.h
Go to the documentation of this file.
1// Copyright 2026, Beyley Cardellio
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Header defining the Rift blobwatch parameters and creation function.
6 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
7 * @ingroup xrt_iface
8 */
9
10#pragma once
11
12#include "xrt/xrt_config_build.h"
13
15
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21// On CV1, the camera tends to detect very little noise, so we can be much more lenient with what pixels are considered
22// for being a blob.
23#define RIFT_BLOBWATCH_PIXEL_THRESHOLD_CV1 0x24
24// On DK2, the camera sees much more noise, so we need to be much stricter about what pixels get included as a blob.
25#define RIFT_BLOBWATCH_PIXEL_THRESHOLD_DK2 0x7f
26// Require a pixel of this brightness to be included in a blob at all, to help filter out general noise.
27#define RIFT_BLOBWATCH_BLOB_REQUIRED_THRESHOLD 0x40
28#define RIFT_BLOBWATCH_DEFAULT_MAX_MATCH_DIST 50.0f
29// @todo Revisit this number.
30#define RIFT_BLOBWATCH_DEFAULT_MAX_BLOB_WIDTH 50
31
33{
34 //! Minimum pixel magnitude to be included in a blob at all
36 /*!
37 * Require at least 1 pixel over this threshold in a blob, allows for collecting fainter blobs, as long as they
38 * have a bright point somewhere, and helps to eliminate generally faint background noise
39 */
41 /*!
42 * Maximum distance (in pixels) for matching a blob between frames.
43 * Matches beyond this distance are rejected, preventing newly appeared blobs
44 * from inheriting incorrect velocity from distant unrelated blobs.
45 */
47 /*!
48 * The maximum width of a single blob in pixels. Blobs larger than this will be ignored. This is to prevent
49 * large areas of brightness, such as the sun or a window, from being considered as a single large blob.
50 */
52};
53
54/*!
55 * @public @memberof t_rift_blobwatch
56 */
57int
58t_rift_blobwatch_create(const struct t_rift_blobwatch_params *params,
59 struct xrt_frame_context *xfctx,
60 struct t_blob_sink *blob_sink,
61 struct xrt_frame_sink **out_frame_sink,
62 struct t_blobwatch **out_blobwatch);
63
64#ifdef XRT_FEATURE_RERUN
65/*!
66 * Sets data to allow the blobwatch to send data to Rerun.
67 */
68void
69t_rift_blobwatch_set_rerun_data(struct t_blobwatch *tbw,
70 struct t_constellation_tracker *tracker,
71 uint32_t mosaic_index,
72 uint32_t camera_index);
73#endif
74
75#ifdef __cplusplus
76}
77#endif
A generic interface to allow a tracking system to receive "snapshots" of seen t_blob in a frame.
Definition t_constellation.h:101
Definition t_constellation.h:152
Definition t_rift_blobwatch.h:33
float max_match_dist
Maximum distance (in pixels) for matching a blob between frames.
Definition t_rift_blobwatch.h:46
uint8_t blob_required_threshold
Require at least 1 pixel over this threshold in a blob, allows for collecting fainter blobs,...
Definition t_rift_blobwatch.h:40
uint16_t max_blob_width
The maximum width of a single blob in pixels.
Definition t_rift_blobwatch.h:51
uint8_t pixel_threshold
Minimum pixel magnitude to be included in a blob at all.
Definition t_rift_blobwatch.h:35
Object used to track all sinks and frame producers in a graph.
Definition xrt_frame.h:108
A object that is sent frames.
Definition xrt_frame.h:58
Header defining the constellation tracker parameters and functions.