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)
22 typedef enum corner_status
{
28 typedef enum edges_state
{
37 typedef struct sparrow_corner_s
{
40 /*dyr -> dy to next point right
41 dxd ->dx to next point down */
46 corner_status_t status
;
49 typedef struct sparrow_voter_s
{
55 typedef struct sparrow_cluster_s
{
57 sparrow_voter_t voters
[8];
61 typedef union sparrow_signal_s
{
67 typedef struct sparrow_intersect_s
{
70 } sparrow_intersect_t
;
72 typedef struct sparrow_line_s
{
78 /*condensed version of <struct sparrow_find_lines_s> for saving: contains no
79 pointers or other unnecessary things that might vary in size across
81 typedef struct sparrow_fl_condensed
{
84 } sparrow_fl_condensed_t
;
86 typedef struct sparrow_find_lines_s
{
87 sparrow_line_t
*h_lines
;
88 sparrow_line_t
*v_lines
;
89 sparrow_line_t
**shuffled_lines
;
96 sparrow_intersect_t
*map
;
97 sparrow_corner_t
*mesh
;
98 sparrow_cluster_t
*clusters
;
104 } sparrow_find_lines_t
;
107 #define DEBUG_FIND_LINES(fl)GST_DEBUG( \
109 " sparrow_line_t *h_lines: %p\n" \
110 " sparrow_line_t *v_lines: %p\n" \
111 " sparrow_line_t **shuffled_lines: %p\n" \
112 " int current: %d\n" \
113 " int n_lines: %d\n" \
114 " int n_vlines: %d\n" \
115 " int n_hlines: %d\n" \
116 " gint shift1: %d\n" \
117 " gint shift2: %d\n" \
118 " sparrow_intersect_t *map: %p\n" \
119 " sparrow_corner_t *mesh: %p\n" \
120 " sparrow_cluster_t *clusters: %p\n" \
121 " IplImage *debug: %p\n" \
122 " IplImage *threshold: %p\n" \
123 " IplImage *working: %p\n" \
124 " IplImage *input: %p\n" \
125 " edges_state_t state: %d\n" \
129 (fl)->shuffled_lines, \
145 //#undef debug_find_lines
146 //#define debug_find_lines(x) /* */
149 #endif /*have this .h*/