1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
|
#N canvas 715 154 789 554 10;
#X obj 483 42 cnv 15 300 500 empty empty empty 20 12 0 14 -228992 -66577
0;
#X obj 22 63 cnv 15 450 200 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 22 314 cnv 15 450 180 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 24 322 Inlets:;
#X obj 22 274 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577
0;
#X text 31 273 Arguments:;
#X text 26 377 Outlets:;
#X text 489 27 Example:;
#X text 69 28 Class: pix_opencv;
#X text 77 283 none;
#X obj 363 194 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577
0;
#N canvas 1 122 450 300 gemwin 0;
#X obj 132 156 gemwin;
#X obj 67 89 outlet;
#X obj 67 10 inlet;
#X obj 67 41 route create;
#X msg 67 70 set destroy;
#X msg 142 68 set create;
#X msg 198 112 destroy;
#X msg 132 132 reset \, dimen 640 480 \, create \, 1;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 0 7 0;
#X connect 3 1 5 0;
#X connect 3 1 6 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X restore 368 233 pd gemwin;
#X msg 368 214 destroy;
#X text 364 193 Create window:;
#X text 39 388 Outlet 1: gemlist output;
#X text 39 398 Outlet 2: contour \, convexhull and convexity defect
output;
#X text 59 515 bug \, feedback \, comment... on the pd-list;
#X obj 489 355 cnv 15 280 80 empty empty empty 20 12 0 14 -4034 -66577
0;
#X obj 498 64 gemhead 1;
#X obj 565 39 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#N canvas 1014 357 709 722 cvblob 0;
#X obj 279 316 gemlist;
#X obj 279 296 t b a;
#X obj 291 50 gemhead 70;
#X obj 129 258 list append;
#X obj 124 170 list split 2;
#X obj 124 114 list append;
#X obj 291 73 t b a;
#X obj 158 232 t b a;
#X obj 279 506 translateXYZ;
#X msg 420 349 \$2;
#X obj 279 356 alpha 1;
#X obj 279 466 translateXYZ -0.5 -0.5 0;
#X obj 279 549 scaleXYZ 0.125 0.25 0;
#X msg 459 349 \$3;
#X msg 434 463 \$4;
#X obj 463 328 t a a;
#X obj 279 576 circle 0.5;
#X obj 279 426 color 1 0 0 0.2;
#X obj 279 336 separator;
#X msg 499 499 \$1;
#X obj 279 616 color 1 1 0 1;
#X obj 158 198 list split 6;
#X msg 227 166 \$2;
#X obj 366 622 loadbang;
#X msg 366 641 12;
#X msg 521 377 \$6;
#X obj 521 399 > 0;
#X obj 521 420 sel 1 0;
#X msg 520 441 1 0 0 0.2;
#X msg 540 461 0 1 0 0.2;
#X obj 279 596 translateXYZ 0.2 0.2 0;
#X text 348 252 here is an example on how to display blobs with Gem
;
#X obj 279 677 text2d;
#X text 253 167 <- be careful ! the size of the cvblob matrix could
change;
#X text 335 184 please check second element to gets matrix width (number
of value per blob);
#X obj 124 136 t a a;
#X obj 187 13 inlet cvblob;
#X obj 187 35 route cvblob;
#X msg 333 26 0;
#X obj 333 6 loadbang;
#X obj 187 57 t a b;
#X msg 291 27 1, f 5;
#X obj 432 485 sqrt;
#X obj 279 446 scaleXYZ 10.666 -8 0;
#X obj 390 520 / 2;
#X obj 361 522 / 3;
#X connect 0 0 18 0;
#X connect 1 0 0 0;
#X connect 1 1 15 0;
#X connect 2 0 6 0;
#X connect 3 0 21 0;
#X connect 4 1 21 0;
#X connect 5 0 35 0;
#X connect 6 0 5 0;
#X connect 6 1 0 1;
#X connect 7 0 3 0;
#X connect 7 1 1 0;
#X connect 8 0 12 0;
#X connect 9 0 8 1;
#X connect 10 0 17 0;
#X connect 11 0 8 0;
#X connect 12 0 16 0;
#X connect 13 0 8 2;
#X connect 14 0 42 0;
#X connect 15 0 13 0;
#X connect 15 0 9 0;
#X connect 15 1 14 0;
#X connect 15 1 19 0;
#X connect 15 1 25 0;
#X connect 16 0 30 0;
#X connect 17 0 43 0;
#X connect 18 0 10 0;
#X connect 19 0 32 0;
#X connect 20 0 32 0;
#X connect 21 0 7 0;
#X connect 21 1 3 1;
#X connect 22 0 21 1;
#X connect 23 0 24 0;
#X connect 24 0 32 1;
#X connect 25 0 26 0;
#X connect 26 0 27 0;
#X connect 27 0 28 0;
#X connect 27 1 29 0;
#X connect 28 0 17 1;
#X connect 29 0 17 1;
#X connect 30 0 20 0;
#X connect 35 0 4 0;
#X connect 35 1 22 0;
#X connect 36 0 37 0;
#X connect 37 0 40 0;
#X connect 38 0 2 0;
#X connect 39 0 38 0;
#X connect 40 0 5 1;
#X connect 40 1 41 0;
#X connect 41 0 2 0;
#X connect 42 0 44 0;
#X connect 42 0 45 0;
#X connect 43 0 11 0;
#X connect 44 0 12 2;
#X connect 45 0 12 1;
#X restore 609 410 pd cvblob;
#X text 39 408 Outlet 3: info output;
#X text 50 11 Synopsis: [pix_opencv_trackKnn];
#X text 48 82 [pix_opencv_trackKnn] uses the Knn algorithm to keep
the ids of tracked features.;
#X text 29 65 Description: keep track of detected features;
#X text 41 336 Inlet 1: message: cvblob <list>;
#X text 69 500 by antoine villeret - 2013;
#X obj 498 106 pix_film;
#X obj 631 76 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#N canvas 1 95 450 300 open&loop 0;
#X obj -107 89 openpanel;
#X msg -130 131 open \$1 \, auto 1;
#X obj -131 89 t b;
#X obj -131 110 symbol;
#X obj -131 50 inlet;
#X obj -86 48 inlet;
#X obj -129 158 outlet;
#X connect 0 0 3 0;
#X connect 1 0 6 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 4 0 2 0;
#X connect 5 0 0 0;
#X restore 562 105 pd open&loop;
#X floatatom 628 27 5 0 0 0 - - -, f 5;
#X msg 628 46 auto \$1;
#X obj 498 386 pix_opencv_trackKnn;
#X msg 525 364 reset;
#X text 48 114 This could be use in conjonction of some tracking technique
technique. This help shows how to use it with a contour based tracker.
;
#X text 41 346 Inlet 1: message: reset : clear the internal memory
\, reset the counter;
#N canvas 1 130 450 358 find_blobs 0;
#X msg 182 191 epsilon \$1;
#X floatatom 182 174 5 0 0 0 - - -, f 5;
#X obj 223 132 loadbang;
#X msg 257 191 area \$1;
#X floatatom 257 174 5 0 0 0 - - -, f 5;
#X msg 257 153 10;
#X msg 223 152 2;
#X obj 127 217 pix_opencv_contours;
#X obj 127 96 pix_opencv_threshold;
#X obj 127 116 pix_grey;
#X obj 238 238 route count;
#X obj 127 40 inlet;
#X obj 127 310 outlet;
#N canvas 521 748 562 291 options 0;
#X obj 57 147 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X msg 57 167 contours \$1;
#X obj 57 251 outlet;
#X obj 147 147 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 247 147 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X msg 147 167 convexhulls \$1;
#X msg 247 167 convexitydefects \$1;
#X text 25 37 set hierarchy level (which contour to send out);
#X obj 24 83 nbx 5 14 -2 1e+37 0 1 empty empty empty 0 -8 0 10 -262144
-1 -1 0 256;
#X msg 24 100 hierarchy_level \$1;
#X text 71 125 send out different kind of infos (all on by default)
:;
#X text 25 47 -1 for all contours (default);
#X msg 383 167 cvblobOutput \$1;
#X obj 383 148 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X text 25 57 -2 for only contours with no child (aka holes);
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 3 0 5 0;
#X connect 4 0 6 0;
#X connect 5 0 2 0;
#X connect 6 0 2 0;
#X connect 8 0 9 0;
#X connect 9 0 2 0;
#X connect 12 0 2 0;
#X connect 13 0 12 0;
#X restore 142 142 pd options;
#X obj 244 74 inlet;
#X connect 0 0 7 0;
#X connect 1 0 0 0;
#X connect 2 0 6 0;
#X connect 2 0 5 0;
#X connect 3 0 7 0;
#X connect 4 0 3 0;
#X connect 5 0 4 0;
#X connect 6 0 1 0;
#X connect 7 0 12 0;
#X connect 7 2 10 0;
#X connect 8 0 9 0;
#X connect 9 0 7 0;
#X connect 10 1 12 0;
#X connect 11 0 8 0;
#X connect 13 0 7 0;
#X connect 14 0 8 2;
#X restore 498 213 pd find_blobs;
#X obj 498 458 pix_texture;
#X obj 498 478 rectangle 5.333 4;
#X text 32 432 <num of contour> 20 <contour area> <rotrect corners
coordinates (8 floats)> <rotrect center position (2 floats)> <rotrect
size (2 floats)> <angle in degrees> <number of points> <contour length>
0 0 0 0;
#X text 23 422 cvblob;
#X floatatom 573 192 5 0 0 1 binarization_threshold - -, f 5;
#X connect 11 0 12 0;
#X connect 12 0 11 0;
#X connect 18 0 27 0;
#X connect 19 0 18 0;
#X connect 27 0 36 0;
#X connect 27 2 29 0;
#X connect 28 0 29 1;
#X connect 29 0 27 0;
#X connect 30 0 31 0;
#X connect 31 0 27 0;
#X connect 32 0 37 0;
#X connect 32 1 20 0;
#X connect 33 0 32 0;
#X connect 36 0 32 0;
#X connect 37 0 38 0;
#X connect 41 0 36 1;
|