found a helper function for dataless ipl images; use it
[sparrow.git] / edges.h
blobe998701703d0400f6d24a2d01a33c8b29fbe65b2
1 #ifndef __SPARROW_EDGES_H__
2 #define __SPARROW_EDGES_H__
4 typedef enum corner_status {
5 CORNER_UNUSED,
6 CORNER_PROJECTED,
7 CORNER_EXACT,
8 } corner_status_t;
10 typedef struct sparrow_corner_s {
11 int in_x;
12 int in_y;
13 /*dyr -> dy to next point right
14 dxd ->dx to next point down */
15 int dxr;
16 int dyr;
17 int dxd;
18 int dyd;
19 corner_status_t status;
20 } sparrow_corner_t;
22 typedef struct sparrow_voter_s {
23 int x;
24 int y;
25 guint32 signal;
26 } sparrow_voter_t;
28 typedef struct sparrow_cluster_s {
29 int n;
30 sparrow_voter_t voters[8];
31 } sparrow_cluster_t;
34 typedef union sparrow_signal_s {
35 guint16 v_signal;
36 guint16 h_signal;
37 } sparrow_signal_t;
40 typedef struct sparrow_intersect_s {
41 guint16 lines[2];
42 guint16 signal[2];
43 } sparrow_intersect_t;
45 typedef struct sparrow_line_s {
46 gint offset;
47 sparrow_axis_t dir;
48 gint index;
49 } sparrow_line_t;
51 typedef struct sparrow_find_lines_s {
52 //sparrow_line_t *lines;
53 sparrow_line_t *h_lines;
54 sparrow_line_t *v_lines;
55 sparrow_line_t **shuffled_lines;
56 int current;
57 int n_lines;
58 int n_vlines;
59 int n_hlines;
60 gint threshold;
61 gint shift1;
62 gint shift2;
63 sparrow_intersect_t *map;
64 sparrow_corner_t *mesh;
65 sparrow_cluster_t *clusters;
66 IplImage *debug;
67 int counter;
68 } sparrow_find_lines_t;
71 #define DEBUG_FIND_LINES(fl)GST_DEBUG( \
72 "fl:\n" \
73 " sparrow_line_t *h_lines: %p\n" \
74 " sparrow_line_t *v_lines: %p\n" \
75 " sparrow_line_t **shuffled_lines: %p\n" \
76 " int current: %d\n" \
77 " int n_lines: %d\n" \
78 " int n_vlines: %d\n" \
79 " int n_hlines: %d\n" \
80 " gint threshold: %d\n" \
81 " gint shift1: %d\n" \
82 " gint shift2: %d\n" \
83 " sparrow_intersect_t *map: %p\n" \
84 " sparrow_corner_t *mesh: %p\n" \
85 " sparrow_cluster_t *clusters: %p\n" \
86 , \
87 (fl)->h_lines, \
88 (fl)->v_lines, \
89 (fl)->shuffled_lines, \
90 (fl)->current, \
91 (fl)->n_lines, \
92 (fl)->n_vlines, \
93 (fl)->n_hlines, \
94 (fl)->threshold, \
95 (fl)->shift1, \
96 (fl)->shift2, \
97 (fl)->map, \
98 (fl)->mesh, \
99 (fl)->clusters) \
101 //#undef debug_find_lines
102 //#define debug_find_lines(x) /* */
105 #endif /*have this .h*/