Monado OpenXR Runtime
Loading...
Searching...
No Matches
t_rift_blobwatch.c File Reference

Blob thresholding and tracking in camera frames. More...

#include "xrt/xrt_defines.h"
#include "xrt/xrt_frame.h"
#include "util/u_logging.h"
#include "util/u_misc.h"
#include "util/u_frame.h"
#include "util/u_time.h"
#include "os/os_threading.h"
#include "tracking/t_constellation.h"
#include "math/m_api.h"
#include "t_rift_blobwatch.h"
#include <string.h>
Include dependency graph for t_rift_blobwatch.c:

Data Structures

struct  blob
 
struct  blobservation
 
struct  extent
 
struct  extent_line
 
struct  blobservation_queue
 
struct  t_rift_blobwatch
 

Macros

#define LED_INVALID_ID   ((led_id_t)(-1))
 
#define LED_NOISE_ID   ((led_id_t)(-2))
 
#define LED_LOCAL_ID(l)   (((l) == LED_INVALID_ID) ? (l) : (l) & 0xFF)
 
#define LED_OBJECT_ID(l)   (((l) == LED_INVALID_ID) ? (l) : (l) >> 8)
 
#define LED_MAKE_ID(o, n)   ((led_id_t)(((led_id_t)(o)) << 8 | ((led_id_t)(n))))
 
#define NUM_FRAMES_HISTORY   5
 
#define MAX_EXTENTS_PER_LINE   30
 
#define CONSISTENCY_CHECKS   0
 
#define QUEUE_ENTRIES   (NUM_FRAMES_HISTORY + 1)
 

Typedefs

typedef uint16_t led_id_t
 

Functions

static void init_queue (struct blobservation_queue *q)
 
static void push_queue (struct blobservation_queue *q, struct blobservation *b)
 
static struct blobservationpop_queue (struct blobservation_queue *q)
 
static struct t_rift_blobwatcht_rift_blobwatch (struct t_blobwatch *bw)
 
static void compute_greysum (struct t_rift_blobwatch *bw, struct xrt_frame *frame, struct extent *e, int end_y, float *led_x, float *led_y)
 
static void store_blob (struct extent *e, int index, int end_y, struct blob *b, uint32_t blob_id, float led_x, float led_y, uint8_t brightness)
 
static void extent_to_blobs (struct t_rift_blobwatch *bw, struct blobservation *ob, struct extent *e, int y, struct xrt_frame *frame)
 
static void process_scanline (uint8_t *line, struct t_rift_blobwatch *bw, uint32_t y, struct extent_line *el, struct extent_line *prev_el, struct xrt_frame *frame, struct blobservation *ob)
 
static void process_frame (struct t_rift_blobwatch *bw, struct blobservation *ob, struct xrt_frame *frame)
 
static int find_free_track (uint8_t *tracked)
 
static void copy_matching_blob (struct blob *to, struct blob *from)
 
static void blobwatch_release_observation (struct t_rift_blobwatch *bw, struct blobservation *ob)
 
static void blobwatch_process (struct t_rift_blobwatch *bw, struct xrt_frame *frame, struct blobservation **output)
 
static void t_rift_blobwatch_push_frame (struct xrt_frame_sink *sink, struct xrt_frame *frame)
 
static void t_rift_blobwatch_node_break_apart (struct xrt_frame_node *node)
 
static void t_rift_blobwatch_node_destroy (struct xrt_frame_node *node)
 
static void t_rift_blobwatch_fake_destroy (struct t_blobwatch *xbw)
 
static void t_rift_blobwatch_mark_blob_device (struct t_blobwatch *xbw, const struct t_blob_observation *xbo, t_constellation_device_id_t device_id)
 
int t_rift_blobwatch_create (const struct t_rift_blobwatch_params *params, struct xrt_frame_context *xfctx, struct t_blob_sink *blob_sink, struct xrt_frame_sink **out_frame_sink, struct t_blobwatch **out_blobwatch)
 

Detailed Description