#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"
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_t * | apriltag_quad_thresh (apriltag_detector_t *td, image_u8_t *im) |
struct line_fit_pt * | compute_lfps (int sz, zarray_t *cluster, image_u8_t *im) |
unionfind_t * | connected_components (apriltag_detector_t *td, image_u8_t *threshim, int w, int h, int ts) |
static void | do_cluster_task (void *p) |
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) |
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_t * | fit_quads (apriltag_detector_t *td, int w, int h, zarray_t *clusters, image_u8_t *im) |
zarray_t * | gradient_clusters (apriltag_detector_t *td, image_u8_t *threshim, int w, int h, int ts, unionfind_t *uf) |
zarray_t * | merge_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_t * | threshold (apriltag_detector_t *td, image_u8_t *im) |
image_u8_t * | threshold_bayer (apriltag_detector_t *td, image_u8_t *im) |
static uint32_t | u64hash_2 (uint64_t x) |
#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); |
Definition at line 987 of file apriltag_quad_thresh.c.
#define MAYBE_SWAP | ( | arr, | |
apos, | |||
bpos | |||
) |
#define MERGE | ( | apos, | |
bpos | |||
) |
zarray_t* apriltag_quad_thresh | ( | apriltag_detector_t * | td, |
image_u8_t * | im | ||
) |
Definition at line 1770 of file apriltag_quad_thresh.c.
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.
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.
|
static |
Definition at line 1612 of file apriltag_quad_thresh.c.
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.
|
static |
Definition at line 1054 of file apriltag_quad_thresh.c.
|
static |
Definition at line 989 of file apriltag_quad_thresh.c.
|
static |
Definition at line 1004 of file apriltag_quad_thresh.c.
|
static |
Definition at line 1045 of file apriltag_quad_thresh.c.
int err_compare_descending | ( | const void * | _a, |
const void * | _b | ||
) |
Definition at line 269 of file apriltag_quad_thresh.c.
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.
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.
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.
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.
Definition at line 1619 of file apriltag_quad_thresh.c.
Definition at line 265 of file apriltag_quad_thresh.c.
|
inlinestatic |
Definition at line 633 of file apriltag_quad_thresh.c.
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.
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.
image_u8_t* threshold | ( | apriltag_detector_t * | td, |
image_u8_t * | im | ||
) |
Definition at line 1092 of file apriltag_quad_thresh.c.
image_u8_t* threshold_bayer | ( | apriltag_detector_t * | td, |
image_u8_t * | im | ||
) |
Definition at line 1319 of file apriltag_quad_thresh.c.
|
inlinestatic |
Definition at line 53 of file apriltag_quad_thresh.c.