Classes | Macros | Functions
apriltag_quad_thresh.c File Reference
#include <math.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include "apriltag.h"
#include "common/image_u8x3.h"
#include "common/zarray.h"
#include "common/unionfind.h"
#include "common/timeprofile.h"
#include "common/zmaxheap.h"
#include "common/postscript_utils.h"
#include "common/math_util.h"
Include dependency graph for apriltag_quad_thresh.c:

Go to the source code of this file.

Classes

struct  cluster_hash
 
struct  cluster_task
 
struct  line_fit_pt
 
struct  pt
 
struct  quad_task
 
struct  remove_vertex
 
struct  segment
 
struct  uint64_zarray_entry
 
struct  unionfind_task
 

Macros

#define DO_CONN(dx, dy)
 
#define DO_UNIONFIND2(dx, dy)   if (im->buf[(y + dy)*s + x + dx] == v) unionfind_connect(uf, y*w + x, (y + dy)*w + x + dx);
 
#define MAYBE_SWAP(arr, apos, bpos)
 
#define MERGE(apos, bpos)
 

Functions

zarray_tapriltag_quad_thresh (apriltag_detector_t *td, image_u8_t *im)
 
struct line_fit_ptcompute_lfps (int sz, zarray_t *cluster, image_u8_t *im)
 
unionfind_tconnected_components (apriltag_detector_t *td, image_u8_t *threshim, int w, int h, int ts)
 
static void do_cluster_task (void *p)
 
zarray_tdo_gradient_clusters (image_u8_t *threshim, int ts, int y0, int y1, int w, int nclustermap, unionfind_t *uf, zarray_t *clusters)
 
static void do_quad_task (void *p)
 
static void do_unionfind_first_line (unionfind_t *uf, image_u8_t *im, int h, int w, int s)
 
static void do_unionfind_line2 (unionfind_t *uf, image_u8_t *im, int h, int w, int s, int y)
 
static void do_unionfind_task2 (void *p)
 
int err_compare_descending (const void *_a, const void *_b)
 
void fit_line (struct line_fit_pt *lfps, int sz, int i0, int i1, double *lineparm, double *err, double *mse)
 
int fit_quad (apriltag_detector_t *td, image_u8_t *im, zarray_t *cluster, struct quad *quad, int tag_width, bool normal_border, bool reversed_border)
 
zarray_tfit_quads (apriltag_detector_t *td, int w, int h, zarray_t *clusters, image_u8_t *im)
 
zarray_tgradient_clusters (apriltag_detector_t *td, image_u8_t *threshim, int w, int h, int ts, unionfind_t *uf)
 
zarray_tmerge_clusters (zarray_t *c1, zarray_t *c2)
 
float pt_compare_angle (struct pt *a, struct pt *b)
 
static void ptsort (struct pt *pts, int sz)
 
int quad_segment_agg (apriltag_detector_t *td, zarray_t *cluster, struct line_fit_pt *lfps, int indices[4])
 
int quad_segment_maxima (apriltag_detector_t *td, zarray_t *cluster, struct line_fit_pt *lfps, int indices[4])
 
image_u8_tthreshold (apriltag_detector_t *td, image_u8_t *im)
 
image_u8_tthreshold_bayer (apriltag_detector_t *td, image_u8_t *im)
 
static uint32_t u64hash_2 (uint64_t x)
 

Macro Definition Documentation

◆ DO_CONN

#define DO_CONN (   dx,
  dy 
)

◆ DO_UNIONFIND2

#define DO_UNIONFIND2 (   dx,
  dy 
)    if (im->buf[(y + dy)*s + x + dx] == v) unionfind_connect(uf, y*w + x, (y + dy)*w + x + dx);

Definition at line 987 of file apriltag_quad_thresh.c.

◆ MAYBE_SWAP

#define MAYBE_SWAP (   arr,
  apos,
  bpos 
)
Value:
if (pt_compare_angle(&(arr[apos]), &(arr[bpos])) > 0) { \
tmp = arr[apos]; arr[apos] = arr[bpos]; arr[bpos] = tmp; \
};
float pt_compare_angle(struct pt *a, struct pt *b)

◆ MERGE

#define MERGE (   apos,
  bpos 
)
Value:
if (pt_compare_angle(&(as[apos]), &(bs[bpos])) < 0) \
pts[outpos++] = as[apos++]; \
else \
pts[outpos++] = bs[bpos++];
float pt_compare_angle(struct pt *a, struct pt *b)

Function Documentation

◆ apriltag_quad_thresh()

zarray_t* apriltag_quad_thresh ( apriltag_detector_t td,
image_u8_t im 
)

Definition at line 1770 of file apriltag_quad_thresh.c.

◆ compute_lfps()

struct line_fit_pt* compute_lfps ( int  sz,
zarray_t cluster,
image_u8_t im 
)

Compute statistics that allow line fit queries to be efficiently computed for any contiguous range of indices.

Definition at line 591 of file apriltag_quad_thresh.c.

◆ connected_components()

unionfind_t* connected_components ( apriltag_detector_t td,
image_u8_t threshim,
int  w,
int  h,
int  ts 
)

Definition at line 1435 of file apriltag_quad_thresh.c.

◆ do_cluster_task()

static void do_cluster_task ( void *  p)
static

Definition at line 1612 of file apriltag_quad_thresh.c.

◆ do_gradient_clusters()

zarray_t* do_gradient_clusters ( image_u8_t threshim,
int  ts,
int  y0,
int  y1,
int  w,
int  nclustermap,
unionfind_t uf,
zarray_t clusters 
)

Definition at line 1482 of file apriltag_quad_thresh.c.

◆ do_quad_task()

static void do_quad_task ( void *  p)
static

Definition at line 1054 of file apriltag_quad_thresh.c.

◆ do_unionfind_first_line()

static void do_unionfind_first_line ( unionfind_t uf,
image_u8_t im,
int  h,
int  w,
int  s 
)
static

Definition at line 989 of file apriltag_quad_thresh.c.

◆ do_unionfind_line2()

static void do_unionfind_line2 ( unionfind_t uf,
image_u8_t im,
int  h,
int  w,
int  s,
int  y 
)
static

Definition at line 1004 of file apriltag_quad_thresh.c.

◆ do_unionfind_task2()

static void do_unionfind_task2 ( void *  p)
static

Definition at line 1045 of file apriltag_quad_thresh.c.

◆ err_compare_descending()

int err_compare_descending ( const void *  _a,
const void *  _b 
)

Definition at line 269 of file apriltag_quad_thresh.c.

◆ fit_line()

void fit_line ( struct line_fit_pt lfps,
int  sz,
int  i0,
int  i1,
double *  lineparm,
double *  err,
double *  mse 
)

Definition at line 150 of file apriltag_quad_thresh.c.

◆ fit_quad()

int fit_quad ( apriltag_detector_t td,
image_u8_t im,
zarray_t cluster,
struct quad quad,
int  tag_width,
bool  normal_border,
bool  reversed_border 
)

Definition at line 728 of file apriltag_quad_thresh.c.

◆ fit_quads()

zarray_t* fit_quads ( apriltag_detector_t td,
int  w,
int  h,
zarray_t clusters,
image_u8_t im 
)

Definition at line 1721 of file apriltag_quad_thresh.c.

◆ gradient_clusters()

zarray_t* gradient_clusters ( apriltag_detector_t td,
image_u8_t threshim,
int  w,
int  h,
int  ts,
unionfind_t uf 
)

Definition at line 1659 of file apriltag_quad_thresh.c.

◆ merge_clusters()

zarray_t* merge_clusters ( zarray_t c1,
zarray_t c2 
)

Definition at line 1619 of file apriltag_quad_thresh.c.

◆ pt_compare_angle()

float pt_compare_angle ( struct pt a,
struct pt b 
)

Definition at line 265 of file apriltag_quad_thresh.c.

◆ ptsort()

static void ptsort ( struct pt pts,
int  sz 
)
inlinestatic

Definition at line 633 of file apriltag_quad_thresh.c.

◆ quad_segment_agg()

int quad_segment_agg ( apriltag_detector_t td,
zarray_t cluster,
struct line_fit_pt lfps,
int  indices[4] 
)

Definition at line 477 of file apriltag_quad_thresh.c.

◆ quad_segment_maxima()

int quad_segment_maxima ( apriltag_detector_t td,
zarray_t cluster,
struct line_fit_pt lfps,
int  indices[4] 
)

Definition at line 293 of file apriltag_quad_thresh.c.

◆ threshold()

image_u8_t* threshold ( apriltag_detector_t td,
image_u8_t im 
)

Definition at line 1092 of file apriltag_quad_thresh.c.

◆ threshold_bayer()

image_u8_t* threshold_bayer ( apriltag_detector_t td,
image_u8_t im 
)

Definition at line 1319 of file apriltag_quad_thresh.c.

◆ u64hash_2()

static uint32_t u64hash_2 ( uint64_t  x)
inlinestatic

Definition at line 53 of file apriltag_quad_thresh.c.



apriltag
Author(s): Edwin Olson , Max Krogius
autogenerated on Mon Jun 26 2023 02:26:35