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"
16 typedef enum corner_status
{
22 typedef enum edges_state
{
31 typedef struct sparrow_corner_s
{
34 /*dyr -> dy to next point right
35 dxd ->dx to next point down */
40 corner_status_t status
;
43 typedef struct sparrow_voter_s
{
49 typedef struct sparrow_cluster_s
{
51 sparrow_voter_t voters
[8];
55 typedef union sparrow_signal_s
{
61 typedef struct sparrow_intersect_s
{
64 } sparrow_intersect_t
;
66 typedef struct sparrow_line_s
{
72 /*condensed version of <struct sparrow_find_lines_s> for saving: contains no
73 pointers or other unnecessary things that might vary in size across
75 typedef struct sparrow_fl_condensed
{
78 } sparrow_fl_condensed_t
;
80 typedef struct sparrow_find_lines_s
{
81 sparrow_line_t
*h_lines
;
82 sparrow_line_t
*v_lines
;
83 sparrow_line_t
**shuffled_lines
;
90 sparrow_intersect_t
*map
;
91 sparrow_corner_t
*mesh
;
92 sparrow_cluster_t
*clusters
;
98 } sparrow_find_lines_t
;
101 #define DEBUG_FIND_LINES(fl)GST_DEBUG( \
103 " sparrow_line_t *h_lines: %p\n" \
104 " sparrow_line_t *v_lines: %p\n" \
105 " sparrow_line_t **shuffled_lines: %p\n" \
106 " int current: %d\n" \
107 " int n_lines: %d\n" \
108 " int n_vlines: %d\n" \
109 " int n_hlines: %d\n" \
110 " gint shift1: %d\n" \
111 " gint shift2: %d\n" \
112 " sparrow_intersect_t *map: %p\n" \
113 " sparrow_corner_t *mesh: %p\n" \
114 " sparrow_cluster_t *clusters: %p\n" \
115 " IplImage *debug: %p\n" \
116 " IplImage *threshold: %p\n" \
117 " IplImage *working: %p\n" \
118 " IplImage *input: %p\n" \
119 " edges_state_t state: %d\n" \
123 (fl)->shuffled_lines, \
139 //#undef debug_find_lines
140 //#define debug_find_lines(x) /* */
143 #endif /*have this .h*/