1 #ifndef __SPARROW_EDGES_H__
2 #define __SPARROW_EDGES_H__
7 /* for discarding outliers */
8 #define OUTLIER_RADIUS 7
9 #define OUTLIER_THRESHOLD (OUTLIER_RADIUS * OUTLIER_RADIUS)
11 #define BAD_PIXEL 0xffff
13 #define FL_DUMPFILE "/tmp/edges.dump"
15 #define COLOUR_QUANT 1
16 #define COLOUR_MASK (0xff >> COLOUR_QUANT)
18 /*XXX should dither */
19 #define QUANTISE_DELTA(d)(((d) + LINE_PERIOD / 2) / LINE_PERIOD)
21 typedef enum corner_status
{
28 typedef enum edges_state
{
37 typedef struct sparrow_estimator_s
{
44 //int mul; /* estimate: x1,y1 + mul * diff */
45 } sparrow_estimator_t
;
47 typedef struct sparrow_corner_s
{
50 /*dyr -> dy to next point right
51 dxd ->dx to next point down */
56 corner_status_t status
;
59 typedef struct sparrow_voter_s
{
65 typedef struct sparrow_cluster_s
{
67 sparrow_voter_t voters
[8];
71 typedef union sparrow_signal_s
{
77 typedef struct sparrow_intersect_s
{
80 } sparrow_intersect_t
;
82 typedef struct sparrow_line_s
{
88 /*condensed version of <struct sparrow_find_lines_s> for saving: contains no
89 pointers or other unnecessary things that might vary in size across
91 typedef struct sparrow_fl_condensed
{
94 } sparrow_fl_condensed_t
;
96 typedef struct sparrow_find_lines_s
{
97 sparrow_line_t
*h_lines
;
98 sparrow_line_t
*v_lines
;
99 sparrow_line_t
**shuffled_lines
;
106 sparrow_intersect_t
*map
;
107 sparrow_corner_t
*mesh
;
108 sparrow_cluster_t
*clusters
;
114 } sparrow_find_lines_t
;
117 #define DEBUG_FIND_LINES(fl)GST_DEBUG( \
119 " sparrow_line_t *h_lines: %p\n" \
120 " sparrow_line_t *v_lines: %p\n" \
121 " sparrow_line_t **shuffled_lines: %p\n" \
122 " int current: %d\n" \
123 " int n_lines: %d\n" \
124 " int n_vlines: %d\n" \
125 " int n_hlines: %d\n" \
126 " gint shift1: %d\n" \
127 " gint shift2: %d\n" \
128 " sparrow_intersect_t *map: %p\n" \
129 " sparrow_corner_t *mesh: %p\n" \
130 " sparrow_cluster_t *clusters: %p\n" \
131 " IplImage *debug: %p\n" \
132 " IplImage *threshold: %p\n" \
133 " IplImage *working: %p\n" \
134 " IplImage *input: %p\n" \
135 " edges_state_t state: %d\n" \
139 (fl)->shuffled_lines, \
155 //#undef debug_find_lines
156 //#define debug_find_lines(x) /* */
159 #endif /*have this .h*/