optv 0.2.8__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- optv-0.2.9/PKG-INFO +10 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/tracking_frame_buf.h +163 -163
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/tracking_run.h +36 -36
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/vec_utils.h +43 -43
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/epi.c +5 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/segmentation.c +537 -537
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/track.c +1275 -1275
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/tracking_frame_buf.c +724 -724
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/tracking_run.c +92 -92
- {optv-0.2.8 → optv-0.2.9}/optv/calibration.c +188 -172
- {optv-0.2.8 → optv-0.2.9}/optv/correspondences.c +202 -196
- {optv-0.2.8 → optv-0.2.9}/optv/epipolar.c +196 -187
- {optv-0.2.8 → optv-0.2.9}/optv/image_processing.c +194 -184
- {optv-0.2.8 → optv-0.2.9}/optv/imgcoord.c +350 -339
- {optv-0.2.8 → optv-0.2.9}/optv/orientation.c +639 -631
- {optv-0.2.8 → optv-0.2.9}/optv/parameters.c +200 -186
- {optv-0.2.8 → optv-0.2.9}/optv/segmentation.c +221 -192
- {optv-0.2.8 → optv-0.2.9}/optv/tracker.c +87 -65
- {optv-0.2.8 → optv-0.2.9}/optv/tracking_framebuf.c +490 -474
- {optv-0.2.8 → optv-0.2.9}/optv/transforms.c +197 -188
- optv-0.2.9/optv.egg-info/PKG-INFO +10 -0
- {optv-0.2.8 → optv-0.2.9}/optv.egg-info/requires.txt +1 -0
- {optv-0.2.8 → optv-0.2.9}/pyproject.toml +16 -15
- {optv-0.2.8 → optv-0.2.9}/setup.cfg +4 -4
- {optv-0.2.8 → optv-0.2.9}/setup.py +165 -163
- {optv-0.2.8 → optv-0.2.9}/test/test_burgers.py +3 -3
- {optv-0.2.8 → optv-0.2.9}/test/test_corresp.py +3 -3
- {optv-0.2.8 → optv-0.2.9}/test/test_segmentation.py +82 -82
- optv-0.2.8/PKG-INFO +0 -3
- optv-0.2.8/optv.egg-info/PKG-INFO +0 -3
- {optv-0.2.8 → optv-0.2.9}/README.txt +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/calibration.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/correspondences.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/epi.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/image_processing.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/imgcoord.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/lsqadj.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/multimed.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/orientation.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/parameters.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/ray_tracing.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/segmentation.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/sortgrid.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/track.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/include/optv/trafo.h +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/calibration.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/correspondences.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/image_processing.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/imgcoord.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/lsqadj.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/multimed.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/orientation.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/parameters.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/ray_tracing.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/sortgrid.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/trafo.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/liboptv/src/vec_utils.c +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/__init__.py +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/calibration.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/correspondences.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/epipolar.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/image_processing.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/imgcoord.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/orientation.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/parameters.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/segmentation.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/tracker.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/tracking_framebuf.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/transforms.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv/vec_utils.pxd +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv.egg-info/SOURCES.txt +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv.egg-info/dependency_links.txt +0 -0
- {optv-0.2.8 → optv-0.2.9}/optv.egg-info/top_level.txt +0 -0
- {optv-0.2.8 → optv-0.2.9}/test/test_calibration_binding.py +0 -0
- {optv-0.2.8 → optv-0.2.9}/test/test_epipolar.py +0 -0
- {optv-0.2.8 → optv-0.2.9}/test/test_framebuf.py +0 -0
- {optv-0.2.8 → optv-0.2.9}/test/test_image_processing.py +0 -0
- {optv-0.2.8 → optv-0.2.9}/test/test_img_coord.py +0 -0
- {optv-0.2.8 → optv-0.2.9}/test/test_orientation.py +0 -0
- {optv-0.2.8 → optv-0.2.9}/test/test_parameters_bindings.py +0 -0
- {optv-0.2.8 → optv-0.2.9}/test/test_tracker.py +0 -0
- {optv-0.2.8 → optv-0.2.9}/test/test_trafo_bindings.py +0 -0
optv-0.2.9/PKG-INFO
ADDED
|
@@ -1,163 +1,163 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Definition for the tracking frame buffers. Each frame holds target information
|
|
3
|
-
for all cameras, correspondence information and path links information.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
#ifndef TRACKING_FRAME_BUF_H
|
|
7
|
-
#define TRACKING_FRAME_BUF_H
|
|
8
|
-
|
|
9
|
-
/* For point positions */
|
|
10
|
-
#include "vec_utils.h"
|
|
11
|
-
|
|
12
|
-
#define POSI 80
|
|
13
|
-
#define STR_MAX_LEN 255
|
|
14
|
-
|
|
15
|
-
#define PT_UNUSED -999
|
|
16
|
-
|
|
17
|
-
typedef struct
|
|
18
|
-
{
|
|
19
|
-
int pnr;
|
|
20
|
-
double x, y;
|
|
21
|
-
int n, nx, ny, sumg;
|
|
22
|
-
int tnr;
|
|
23
|
-
}
|
|
24
|
-
target;
|
|
25
|
-
|
|
26
|
-
int compare_targets(target *t1, target *t2);
|
|
27
|
-
int read_targets(target buffer[], char* file_base, int frame_num);
|
|
28
|
-
int write_targets(target buffer[], int num_targets, char* file_base, \
|
|
29
|
-
int frame_num);
|
|
30
|
-
|
|
31
|
-
typedef struct
|
|
32
|
-
{
|
|
33
|
-
int nr;
|
|
34
|
-
int p[4];
|
|
35
|
-
}
|
|
36
|
-
corres;
|
|
37
|
-
|
|
38
|
-
int compare_corres(corres *c1, corres *c2);
|
|
39
|
-
#define CORRES_NONE -1
|
|
40
|
-
|
|
41
|
-
typedef float fitness_t;
|
|
42
|
-
|
|
43
|
-
typedef struct Pstruct
|
|
44
|
-
{
|
|
45
|
-
vec3d x; /*coordinates*/
|
|
46
|
-
int prev, next; /*pointer to prev or next link*/
|
|
47
|
-
int prio; /*Prority of link is used for differen levels*/
|
|
48
|
-
fitness_t decis[POSI]; /*Bin for decision critera of possible links to next dataset*/
|
|
49
|
-
fitness_t finaldecis; /*final decision critera by which the link was established*/
|
|
50
|
-
int linkdecis[POSI]; /* pointer of possible links to next data set*/
|
|
51
|
-
int inlist; /* Counter of number of possible links to next data set*/
|
|
52
|
-
} P;
|
|
53
|
-
|
|
54
|
-
int compare_path_info(P *p1, P *p2);
|
|
55
|
-
void register_link_candidate(P *self, fitness_t fitness, int cand);
|
|
56
|
-
#define PREV_NONE -1
|
|
57
|
-
#define NEXT_NONE -2
|
|
58
|
-
#define PRIO_DEFAULT 2
|
|
59
|
-
void reset_links(P *self);
|
|
60
|
-
|
|
61
|
-
int read_path_frame(corres *cor_buf, P *path_buf, \
|
|
62
|
-
char *corres_file_base, char *linkage_file_base,
|
|
63
|
-
char *prio_file_base, int frame_num);
|
|
64
|
-
int write_path_frame(corres *cor_buf, P *path_buf, int num_parts,\
|
|
65
|
-
char *corres_file_base, char *linkage_file_base,
|
|
66
|
-
char *prio_file_base, int frame_num);
|
|
67
|
-
|
|
68
|
-
typedef struct {
|
|
69
|
-
P *path_info;
|
|
70
|
-
corres *correspond;
|
|
71
|
-
target **targets;
|
|
72
|
-
int num_cams, max_targets;
|
|
73
|
-
int num_parts; /* Number of 3D particles in the correspondence buffer */
|
|
74
|
-
int *num_targets; /* Pointer to array of 2D particle counts per image. */
|
|
75
|
-
} frame;
|
|
76
|
-
|
|
77
|
-
void frame_init(frame *new_frame, int num_cams, int max_targets);
|
|
78
|
-
void free_frame(frame *self);
|
|
79
|
-
int read_frame(frame *self, char *corres_file_base, char *linkage_file_base,
|
|
80
|
-
char *prio_file_base, char **target_file_base, int frame_num);
|
|
81
|
-
int write_frame(frame *self, char *corres_file_base, char *linkage_file_base,
|
|
82
|
-
char *prio_file_base, char **target_file_base, int frame_num);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/*
|
|
86
|
-
* Following is the frame buffer class, that holds a given number of frame structs,
|
|
87
|
-
* and treats them as a deque (doube-ended queue, a queue that can advance forward
|
|
88
|
-
* or backward).
|
|
89
|
-
*
|
|
90
|
-
* The memory locations are advanced with fb_next()/fb_prev(). Filling out the new
|
|
91
|
-
* frame that joined the queue and flushing out the frame that exited the queue
|
|
92
|
-
* are respectively done using fb_read_frame_at_end() and fb_write_frame_from_start().
|
|
93
|
-
*
|
|
94
|
-
* To make it possible to read frames from different sources, we use a
|
|
95
|
-
* base-class/child-class structure. framebuf_base is the base class, and implements
|
|
96
|
-
* only the memory-advance methods. The filling-out of frames is done by
|
|
97
|
-
* "virtual" functions. That is to say, fb_read_frame_at_end, for example,
|
|
98
|
-
* only forwards the call to a function that really reads the data.
|
|
99
|
-
*
|
|
100
|
-
* The virtual functions are placed in the "vtable" by the constructor - the
|
|
101
|
-
* function that allocates and populates the child class.
|
|
102
|
-
*
|
|
103
|
-
* In tracking_framebuf.c and here there's an example child-class that reads
|
|
104
|
-
* frame information from *_target files. This is the original mode of
|
|
105
|
-
* liboptv. The struct framebuf *inherits* from framebuf_base (by incorporating
|
|
106
|
-
* the base as 1st member - the order is important). fb_init(), the constructor,
|
|
107
|
-
* then populates the vtable with fb_disk_* functions. These are the derived
|
|
108
|
-
* implementations of the base-class virtual functions.
|
|
109
|
-
*
|
|
110
|
-
* There is also a virtual destructor, fb_free(), which delegates to the free()
|
|
111
|
-
* virtual function, and implemented in the example by fb_disk_free().
|
|
112
|
-
*
|
|
113
|
-
* Note: fb_disk_free does not release the strings it holds, as I don't remember if
|
|
114
|
-
* it owns them.
|
|
115
|
-
*
|
|
116
|
-
* Yes, in C++ it's easier :)
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
// Virtual function table definitions for frame buffer objects:
|
|
120
|
-
typedef struct framebuf_base* fbp;
|
|
121
|
-
typedef struct {
|
|
122
|
-
void (*free)(fbp self);
|
|
123
|
-
int (*read_frame_at_end)(fbp self, int frame_num, int read_links);
|
|
124
|
-
int (*write_frame_from_start)(fbp self, int frame_num);
|
|
125
|
-
} fb_vtable;
|
|
126
|
-
|
|
127
|
-
typedef struct framebuf_base {
|
|
128
|
-
fb_vtable *_vptr;
|
|
129
|
-
|
|
130
|
-
/* _ring_vec is the underlying double-size vector, buf is the pointer to
|
|
131
|
-
the start of the ring. */
|
|
132
|
-
frame **buf, **_ring_vec;
|
|
133
|
-
int buf_len, num_cams;
|
|
134
|
-
} framebuf_base;
|
|
135
|
-
|
|
136
|
-
// These just call the corresponding virtual function.
|
|
137
|
-
// Actual implementations are below each child class.
|
|
138
|
-
void fb_free(framebuf_base *self);
|
|
139
|
-
int fb_read_frame_at_end(framebuf_base *self, int frame_num, int read_links);
|
|
140
|
-
int fb_write_frame_from_start(framebuf_base *self, int frame_num);
|
|
141
|
-
|
|
142
|
-
// Non-virtual methods of the base class.
|
|
143
|
-
void fb_base_init(framebuf_base *new_buf, int buf_len, int num_cams, int max_targets);
|
|
144
|
-
void fb_next(framebuf_base *self);
|
|
145
|
-
void fb_prev(framebuf_base *self);
|
|
146
|
-
|
|
147
|
-
// child class that reads from _target files.
|
|
148
|
-
typedef struct {
|
|
149
|
-
framebuf_base base; // must be 1st member.
|
|
150
|
-
|
|
151
|
-
char *corres_file_base, *linkage_file_base, *prio_file_base;
|
|
152
|
-
char **target_file_base;
|
|
153
|
-
} framebuf;
|
|
154
|
-
|
|
155
|
-
void fb_init(framebuf *new_buf, int buf_len, int num_cams, int max_targets,\
|
|
156
|
-
char *corres_file_base, char* linkage_file_base, char *prio_file_base,
|
|
157
|
-
char **target_file_base);
|
|
158
|
-
|
|
159
|
-
void fb_disk_free(framebuf_base *self);
|
|
160
|
-
int fb_disk_read_frame_at_end(framebuf_base *self, int frame_num, int read_links);
|
|
161
|
-
int fb_disk_write_frame_from_start(framebuf_base *self, int frame_num);
|
|
162
|
-
|
|
163
|
-
#endif
|
|
1
|
+
/*
|
|
2
|
+
Definition for the tracking frame buffers. Each frame holds target information
|
|
3
|
+
for all cameras, correspondence information and path links information.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef TRACKING_FRAME_BUF_H
|
|
7
|
+
#define TRACKING_FRAME_BUF_H
|
|
8
|
+
|
|
9
|
+
/* For point positions */
|
|
10
|
+
#include "vec_utils.h"
|
|
11
|
+
|
|
12
|
+
#define POSI 80
|
|
13
|
+
#define STR_MAX_LEN 255
|
|
14
|
+
|
|
15
|
+
#define PT_UNUSED -999
|
|
16
|
+
|
|
17
|
+
typedef struct
|
|
18
|
+
{
|
|
19
|
+
int pnr;
|
|
20
|
+
double x, y;
|
|
21
|
+
int n, nx, ny, sumg;
|
|
22
|
+
int tnr;
|
|
23
|
+
}
|
|
24
|
+
target;
|
|
25
|
+
|
|
26
|
+
int compare_targets(target *t1, target *t2);
|
|
27
|
+
int read_targets(target buffer[], char* file_base, int frame_num);
|
|
28
|
+
int write_targets(target buffer[], int num_targets, char* file_base, \
|
|
29
|
+
int frame_num);
|
|
30
|
+
|
|
31
|
+
typedef struct
|
|
32
|
+
{
|
|
33
|
+
int nr;
|
|
34
|
+
int p[4];
|
|
35
|
+
}
|
|
36
|
+
corres;
|
|
37
|
+
|
|
38
|
+
int compare_corres(corres *c1, corres *c2);
|
|
39
|
+
#define CORRES_NONE -1
|
|
40
|
+
|
|
41
|
+
typedef float fitness_t;
|
|
42
|
+
|
|
43
|
+
typedef struct Pstruct
|
|
44
|
+
{
|
|
45
|
+
vec3d x; /*coordinates*/
|
|
46
|
+
int prev, next; /*pointer to prev or next link*/
|
|
47
|
+
int prio; /*Prority of link is used for differen levels*/
|
|
48
|
+
fitness_t decis[POSI]; /*Bin for decision critera of possible links to next dataset*/
|
|
49
|
+
fitness_t finaldecis; /*final decision critera by which the link was established*/
|
|
50
|
+
int linkdecis[POSI]; /* pointer of possible links to next data set*/
|
|
51
|
+
int inlist; /* Counter of number of possible links to next data set*/
|
|
52
|
+
} P;
|
|
53
|
+
|
|
54
|
+
int compare_path_info(P *p1, P *p2);
|
|
55
|
+
void register_link_candidate(P *self, fitness_t fitness, int cand);
|
|
56
|
+
#define PREV_NONE -1
|
|
57
|
+
#define NEXT_NONE -2
|
|
58
|
+
#define PRIO_DEFAULT 2
|
|
59
|
+
void reset_links(P *self);
|
|
60
|
+
|
|
61
|
+
int read_path_frame(corres *cor_buf, P *path_buf, \
|
|
62
|
+
char *corres_file_base, char *linkage_file_base,
|
|
63
|
+
char *prio_file_base, int frame_num);
|
|
64
|
+
int write_path_frame(corres *cor_buf, P *path_buf, int num_parts,\
|
|
65
|
+
char *corres_file_base, char *linkage_file_base,
|
|
66
|
+
char *prio_file_base, int frame_num);
|
|
67
|
+
|
|
68
|
+
typedef struct {
|
|
69
|
+
P *path_info;
|
|
70
|
+
corres *correspond;
|
|
71
|
+
target **targets;
|
|
72
|
+
int num_cams, max_targets;
|
|
73
|
+
int num_parts; /* Number of 3D particles in the correspondence buffer */
|
|
74
|
+
int *num_targets; /* Pointer to array of 2D particle counts per image. */
|
|
75
|
+
} frame;
|
|
76
|
+
|
|
77
|
+
void frame_init(frame *new_frame, int num_cams, int max_targets);
|
|
78
|
+
void free_frame(frame *self);
|
|
79
|
+
int read_frame(frame *self, char *corres_file_base, char *linkage_file_base,
|
|
80
|
+
char *prio_file_base, char **target_file_base, int frame_num);
|
|
81
|
+
int write_frame(frame *self, char *corres_file_base, char *linkage_file_base,
|
|
82
|
+
char *prio_file_base, char **target_file_base, int frame_num);
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
* Following is the frame buffer class, that holds a given number of frame structs,
|
|
87
|
+
* and treats them as a deque (doube-ended queue, a queue that can advance forward
|
|
88
|
+
* or backward).
|
|
89
|
+
*
|
|
90
|
+
* The memory locations are advanced with fb_next()/fb_prev(). Filling out the new
|
|
91
|
+
* frame that joined the queue and flushing out the frame that exited the queue
|
|
92
|
+
* are respectively done using fb_read_frame_at_end() and fb_write_frame_from_start().
|
|
93
|
+
*
|
|
94
|
+
* To make it possible to read frames from different sources, we use a
|
|
95
|
+
* base-class/child-class structure. framebuf_base is the base class, and implements
|
|
96
|
+
* only the memory-advance methods. The filling-out of frames is done by
|
|
97
|
+
* "virtual" functions. That is to say, fb_read_frame_at_end, for example,
|
|
98
|
+
* only forwards the call to a function that really reads the data.
|
|
99
|
+
*
|
|
100
|
+
* The virtual functions are placed in the "vtable" by the constructor - the
|
|
101
|
+
* function that allocates and populates the child class.
|
|
102
|
+
*
|
|
103
|
+
* In tracking_framebuf.c and here there's an example child-class that reads
|
|
104
|
+
* frame information from *_target files. This is the original mode of
|
|
105
|
+
* liboptv. The struct framebuf *inherits* from framebuf_base (by incorporating
|
|
106
|
+
* the base as 1st member - the order is important). fb_init(), the constructor,
|
|
107
|
+
* then populates the vtable with fb_disk_* functions. These are the derived
|
|
108
|
+
* implementations of the base-class virtual functions.
|
|
109
|
+
*
|
|
110
|
+
* There is also a virtual destructor, fb_free(), which delegates to the free()
|
|
111
|
+
* virtual function, and implemented in the example by fb_disk_free().
|
|
112
|
+
*
|
|
113
|
+
* Note: fb_disk_free does not release the strings it holds, as I don't remember if
|
|
114
|
+
* it owns them.
|
|
115
|
+
*
|
|
116
|
+
* Yes, in C++ it's easier :)
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
// Virtual function table definitions for frame buffer objects:
|
|
120
|
+
typedef struct framebuf_base* fbp;
|
|
121
|
+
typedef struct {
|
|
122
|
+
void (*free)(fbp self);
|
|
123
|
+
int (*read_frame_at_end)(fbp self, int frame_num, int read_links);
|
|
124
|
+
int (*write_frame_from_start)(fbp self, int frame_num);
|
|
125
|
+
} fb_vtable;
|
|
126
|
+
|
|
127
|
+
typedef struct framebuf_base {
|
|
128
|
+
fb_vtable *_vptr;
|
|
129
|
+
|
|
130
|
+
/* _ring_vec is the underlying double-size vector, buf is the pointer to
|
|
131
|
+
the start of the ring. */
|
|
132
|
+
frame **buf, **_ring_vec;
|
|
133
|
+
int buf_len, num_cams;
|
|
134
|
+
} framebuf_base;
|
|
135
|
+
|
|
136
|
+
// These just call the corresponding virtual function.
|
|
137
|
+
// Actual implementations are below each child class.
|
|
138
|
+
void fb_free(framebuf_base *self);
|
|
139
|
+
int fb_read_frame_at_end(framebuf_base *self, int frame_num, int read_links);
|
|
140
|
+
int fb_write_frame_from_start(framebuf_base *self, int frame_num);
|
|
141
|
+
|
|
142
|
+
// Non-virtual methods of the base class.
|
|
143
|
+
void fb_base_init(framebuf_base *new_buf, int buf_len, int num_cams, int max_targets);
|
|
144
|
+
void fb_next(framebuf_base *self);
|
|
145
|
+
void fb_prev(framebuf_base *self);
|
|
146
|
+
|
|
147
|
+
// child class that reads from _target files.
|
|
148
|
+
typedef struct {
|
|
149
|
+
framebuf_base base; // must be 1st member.
|
|
150
|
+
|
|
151
|
+
char *corres_file_base, *linkage_file_base, *prio_file_base;
|
|
152
|
+
char **target_file_base;
|
|
153
|
+
} framebuf;
|
|
154
|
+
|
|
155
|
+
void fb_init(framebuf *new_buf, int buf_len, int num_cams, int max_targets,\
|
|
156
|
+
char *corres_file_base, char* linkage_file_base, char *prio_file_base,
|
|
157
|
+
char **target_file_base);
|
|
158
|
+
|
|
159
|
+
void fb_disk_free(framebuf_base *self);
|
|
160
|
+
int fb_disk_read_frame_at_end(framebuf_base *self, int frame_num, int read_links);
|
|
161
|
+
int fb_disk_write_frame_from_start(framebuf_base *self, int frame_num);
|
|
162
|
+
|
|
163
|
+
#endif
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/* An object representing a tracking run. Holds parameters but also
|
|
2
|
-
intermediate results collected on each step of tracking. For use in
|
|
3
|
-
tracking algorithms that need to communicate with sub-components such as
|
|
4
|
-
single-step tracking routine driven by a loop.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#ifndef TRACKING_RUN_H
|
|
8
|
-
#define TRACKING_RUN_H
|
|
9
|
-
|
|
10
|
-
#include "parameters.h"
|
|
11
|
-
#include "calibration.h"
|
|
12
|
-
#include "tracking_frame_buf.h"
|
|
13
|
-
|
|
14
|
-
typedef struct {
|
|
15
|
-
framebuf_base *fb;
|
|
16
|
-
sequence_par *seq_par;
|
|
17
|
-
track_par *tpar;
|
|
18
|
-
volume_par *vpar;
|
|
19
|
-
control_par *cpar;
|
|
20
|
-
Calibration **cal;
|
|
21
|
-
double flatten_tol; /* Tolerance for dist_to_flat() */
|
|
22
|
-
|
|
23
|
-
/* Intermediate calculations done in run setup phase and used in the loop: */
|
|
24
|
-
double ymin, ymax, lmax;
|
|
25
|
-
int npart, nlinks;
|
|
26
|
-
} tracking_run;
|
|
27
|
-
|
|
28
|
-
tracking_run* tr_new_legacy(char *seq_par_fname, char *tpar_fname,
|
|
29
|
-
char *vpar_fname, char *cpar_fnamei, Calibration **cal);
|
|
30
|
-
tracking_run* tr_new(sequence_par *seq_par, track_par *tpar,
|
|
31
|
-
volume_par *vpar, control_par *cpar, int buf_len, int max_targets,
|
|
32
|
-
char *corres_file_base, char *linkage_file_base, char *prio_file_base,
|
|
33
|
-
Calibration **cal, double flatten_tol);
|
|
34
|
-
void tr_free(tracking_run *tr);
|
|
35
|
-
|
|
36
|
-
#endif
|
|
1
|
+
/* An object representing a tracking run. Holds parameters but also
|
|
2
|
+
intermediate results collected on each step of tracking. For use in
|
|
3
|
+
tracking algorithms that need to communicate with sub-components such as
|
|
4
|
+
single-step tracking routine driven by a loop.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#ifndef TRACKING_RUN_H
|
|
8
|
+
#define TRACKING_RUN_H
|
|
9
|
+
|
|
10
|
+
#include "parameters.h"
|
|
11
|
+
#include "calibration.h"
|
|
12
|
+
#include "tracking_frame_buf.h"
|
|
13
|
+
|
|
14
|
+
typedef struct {
|
|
15
|
+
framebuf_base *fb;
|
|
16
|
+
sequence_par *seq_par;
|
|
17
|
+
track_par *tpar;
|
|
18
|
+
volume_par *vpar;
|
|
19
|
+
control_par *cpar;
|
|
20
|
+
Calibration **cal;
|
|
21
|
+
double flatten_tol; /* Tolerance for dist_to_flat() */
|
|
22
|
+
|
|
23
|
+
/* Intermediate calculations done in run setup phase and used in the loop: */
|
|
24
|
+
double ymin, ymax, lmax;
|
|
25
|
+
int npart, nlinks;
|
|
26
|
+
} tracking_run;
|
|
27
|
+
|
|
28
|
+
tracking_run* tr_new_legacy(char *seq_par_fname, char *tpar_fname,
|
|
29
|
+
char *vpar_fname, char *cpar_fnamei, Calibration **cal);
|
|
30
|
+
tracking_run* tr_new(sequence_par *seq_par, track_par *tpar,
|
|
31
|
+
volume_par *vpar, control_par *cpar, int buf_len, int max_targets,
|
|
32
|
+
char *corres_file_base, char *linkage_file_base, char *prio_file_base,
|
|
33
|
+
Calibration **cal, double flatten_tol);
|
|
34
|
+
void tr_free(tracking_run *tr);
|
|
35
|
+
|
|
36
|
+
#endif
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/* Utilities for handling simple 3d vectors implemented as an array of 3
|
|
2
|
-
doubles.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
#ifndef VEC_UTILS_H
|
|
6
|
-
#define VEC_UTILS_H
|
|
7
|
-
|
|
8
|
-
#include <math.h>
|
|
9
|
-
|
|
10
|
-
#ifdef NAN
|
|
11
|
-
#define EMPTY_CELL NAN
|
|
12
|
-
#else
|
|
13
|
-
#if _MSC_VER <= 1500 // Visual C 2008 - for Python 2.7, or earlier
|
|
14
|
-
#define MSVC_NAN_REQUIRED
|
|
15
|
-
double return_nan(void);
|
|
16
|
-
#define EMPTY_CELL return_nan()
|
|
17
|
-
#else // More modern compilers or non Visual Studio
|
|
18
|
-
#define EMPTY_CELL 0.0/0.0
|
|
19
|
-
#endif
|
|
20
|
-
#endif
|
|
21
|
-
|
|
22
|
-
#define is_empty(x) isnan(x)
|
|
23
|
-
#define norm(x,y,z) sqrt((x)*(x) + (y)*(y) + (z)*(z))
|
|
24
|
-
|
|
25
|
-
typedef double vec3d[3];
|
|
26
|
-
|
|
27
|
-
void vec_init(vec3d init);
|
|
28
|
-
void vec_set(vec3d dest, double x, double y, double z);
|
|
29
|
-
void vec_copy(vec3d dest, vec3d src);
|
|
30
|
-
void vec_subt(vec3d from, vec3d sub, vec3d output);
|
|
31
|
-
void vec_add(vec3d vec1, vec3d vec2, vec3d output);
|
|
32
|
-
void vec_scalar_mul(vec3d vec, double scalar, vec3d output);
|
|
33
|
-
double vec_norm(vec3d vec);
|
|
34
|
-
double vec_diff_norm(vec3d vec1, vec3d vec2);
|
|
35
|
-
double vec_dot(vec3d vec1, vec3d vec2);
|
|
36
|
-
void vec_cross(vec3d vec1, vec3d vec2, vec3d out);
|
|
37
|
-
int vec_cmp(vec3d vec1, vec3d vec2);
|
|
38
|
-
int vec_approx_cmp(vec3d vec1, vec3d vec2, double eps);
|
|
39
|
-
void unit_vector(vec3d vec, vec3d out);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
#endif
|
|
43
|
-
|
|
1
|
+
/* Utilities for handling simple 3d vectors implemented as an array of 3
|
|
2
|
+
doubles.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#ifndef VEC_UTILS_H
|
|
6
|
+
#define VEC_UTILS_H
|
|
7
|
+
|
|
8
|
+
#include <math.h>
|
|
9
|
+
|
|
10
|
+
#ifdef NAN
|
|
11
|
+
#define EMPTY_CELL NAN
|
|
12
|
+
#else
|
|
13
|
+
#if _MSC_VER <= 1500 // Visual C 2008 - for Python 2.7, or earlier
|
|
14
|
+
#define MSVC_NAN_REQUIRED
|
|
15
|
+
double return_nan(void);
|
|
16
|
+
#define EMPTY_CELL return_nan()
|
|
17
|
+
#else // More modern compilers or non Visual Studio
|
|
18
|
+
#define EMPTY_CELL 0.0/0.0
|
|
19
|
+
#endif
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#define is_empty(x) isnan(x)
|
|
23
|
+
#define norm(x,y,z) sqrt((x)*(x) + (y)*(y) + (z)*(z))
|
|
24
|
+
|
|
25
|
+
typedef double vec3d[3];
|
|
26
|
+
|
|
27
|
+
void vec_init(vec3d init);
|
|
28
|
+
void vec_set(vec3d dest, double x, double y, double z);
|
|
29
|
+
void vec_copy(vec3d dest, vec3d src);
|
|
30
|
+
void vec_subt(vec3d from, vec3d sub, vec3d output);
|
|
31
|
+
void vec_add(vec3d vec1, vec3d vec2, vec3d output);
|
|
32
|
+
void vec_scalar_mul(vec3d vec, double scalar, vec3d output);
|
|
33
|
+
double vec_norm(vec3d vec);
|
|
34
|
+
double vec_diff_norm(vec3d vec1, vec3d vec2);
|
|
35
|
+
double vec_dot(vec3d vec1, vec3d vec2);
|
|
36
|
+
void vec_cross(vec3d vec1, vec3d vec2, vec3d out);
|
|
37
|
+
int vec_cmp(vec3d vec1, vec3d vec2);
|
|
38
|
+
int vec_approx_cmp(vec3d vec1, vec3d vec2, double eps);
|
|
39
|
+
void unit_vector(vec3d vec, vec3d out);
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
#endif
|
|
43
|
+
|
|
@@ -201,6 +201,11 @@ int find_candidate (coord_2d *crd, target *pix, int num,
|
|
|
201
201
|
continue;
|
|
202
202
|
|
|
203
203
|
p2 = crd[j].pnr;
|
|
204
|
+
|
|
205
|
+
if (p2 >= num) {
|
|
206
|
+
printf("pnr out of range: %d\n", p2);
|
|
207
|
+
return -1;
|
|
208
|
+
}
|
|
204
209
|
|
|
205
210
|
/* quality of each parameter is a ratio of the values of the
|
|
206
211
|
size n, nx, ny and sum of grey values sumg */
|