aboutsummaryrefslogtreecommitdiff
path: root/pix_opencv_contours-help.pd
blob: c6a27d11224b6e9fa6c3fb847a8e38de264fa2e1 (plain)
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
#N canvas 759 213 794 706 10;
#X obj 472 35 cnv 15 300 400 empty empty empty 20 12 0 14 -228992 -66577
0;
#X obj 11 56 cnv 15 450 200 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 11 307 cnv 15 450 380 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 13 315 Inlets:;
#X obj 11 267 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577
0;
#X text 20 266 Arguments:;
#X text 12 386 Outlets:;
#X text 478 20 Example:;
#X text 58 21 Class: pix_opencv;
#X text 11 60 Description: finds contours;
#X text 66 276 none;
#X text 30 349 Inlet 1: message: epsilon [float];
#X obj 353 315 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577
0;
#N canvas 1 104 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 358 354 pd gemwin;
#X msg 358 335 destroy;
#X text 354 314 Create window:;
#X text 30 329 Inlet 1: binarized image;
#X text 354 314 Create window:;
#X text 30 329 Inlet 1: binarized image;
#X text 20 448 info;
#X text 30 519 <number of segments> <2> <x \, y corner coordinate pairs>
;
#X text 25 397 Outlet 1: gemlist output;
#X text 25 417 Outlet 3: info output;
#X text 37 5 Synopsis: [pix_opencv_contours];
#X text 21 508 contour (for each of them);
#X text 37 75 [pix_opencv_contours] finds contours in incomming image
\, simplifies it according to the epsilon value and outputs contours
with area greater than a threshold.;
#X text 30 339 Inlet 1: message: area threshold [float];
#X text 25 407 Outlet 2: contour \, convexhull and convexity defect
output;
#X text 37 126 contrary to [pix_opencv_contour_convexhull] \, [pix_opencv_contours]
outputs all contours found not only the biggest.;
#X text 37 175 it can also output rotated bounding rectangle \, convexhull
and cenvexity defects;
#X text 37 215 you can choose the hierarchy level of output contour
;
#X text 37 235 so this external replaces all old pix_opencv_contours_*
;
#X text 29 458 <contour area> <rotrect corners coordinates (8 floats)>
<rotrect center position (2 floats)> <rotrect size (2 floats)> <angle
in degrees> <number of points> 0 0 0 0 0;
#X text 30 549 <number of segments> <2> <x \, y corner coordinate pairs>
;
#X text 21 536 convexhull (for each contour);
#X text 20 567 convexixitydefects (for each contour);
#X text 30 579 <number of segments> <7> <start point (2 floats)> <end
point (2 floats)> <depth point (2 floats)> depth;
#X text 26 649 by antoine villeret - 2012;
#X text 16 669 bug \, feedback \, comment... on the pd-list;
#X obj 476 193 cnv 15 280 80 empty empty empty 20 12 0 14 -4034 -66577
0;
#X obj 541 151 pix_texture;
#X obj 487 171 pix_gray;
#X obj 487 141 pix_buf;
#X obj 487 76 t b a a;
#X obj 487 57 gemhead 1;
#X msg 542 214 epsilon \$1;
#X floatatom 542 197 5 0 0 0 - - -;
#X obj 625 121 loadbang;
#X obj 541 171 rectangle 5.333 4;
#X obj 514 116 t a a;
#X msg 617 214 area \$1;
#X floatatom 617 197 5 0 0 0 - - -;
#X msg 659 142 10;
#X msg 625 141 2;
#N canvas 1177 234 474 845 draw_rotrect 0;
#X obj 71 506 GEMglVertex2d;
#X obj 71 586 GEMglVertex2d;
#X obj 71 666 GEMglVertex2d;
#X obj 71 746 GEMglVertex2d;
#X obj 71 766 GEMglEnd;
#X obj 71 277 alpha;
#X obj 143 178 list split 1;
#X obj 71 420 GEMglBegin GL_LINE_LOOP;
#X obj 177 198 list split 8;
#X msg 363 324 0 0 0 0 0 0 0 0;
#X obj 32 -8 inlet INFO;
#X obj 71 256 gemhead;
#X obj 15 147 loadbang;
#X msg 15 168 0;
#X obj 71 52 t b a b;
#X obj 211 504 list split 2;
#X obj 177 448 list split 2;
#X obj 137 472 unpack;
#X obj 211 525 unpack;
#X obj 245 564 list split 2;
#X obj 245 585 unpack;
#X obj 279 664 list split 2;
#X obj 279 685 unpack;
#X obj 90 84 list split 2;
#X obj 95 154 list append;
#X obj 292 81 t b;
#X obj 32 32 route 0;
#X floatatom 342 463 5 0 0 0 - - -;
#X obj 342 442 list length;
#X obj 71 400 GEMglLineWidth 1;
#X obj 71 327 translateXYZ -5.3333 4 0;
#X obj 71 361 scaleXYZ 10.6666 -8 0;
#X obj 124 107 list split 20;
#X obj 71 302 color 1 1 0 1;
#X obj 124 128 t b b a;
#X obj 32 13 route info;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 5 0 33 0;
#X connect 6 1 8 0;
#X connect 7 0 0 0;
#X connect 8 0 16 0;
#X connect 9 0 16 0;
#X connect 10 0 35 0;
#X connect 11 0 5 0;
#X connect 12 0 13 0;
#X connect 13 0 11 0;
#X connect 14 1 23 0;
#X connect 14 2 25 0;
#X connect 15 0 18 0;
#X connect 15 1 19 0;
#X connect 16 0 17 0;
#X connect 16 1 15 0;
#X connect 17 0 0 1;
#X connect 17 1 0 2;
#X connect 18 0 1 1;
#X connect 18 1 1 2;
#X connect 19 0 20 0;
#X connect 19 1 21 0;
#X connect 20 0 2 1;
#X connect 20 1 2 2;
#X connect 21 0 22 0;
#X connect 22 0 3 1;
#X connect 22 1 3 2;
#X connect 23 1 32 0;
#X connect 24 0 32 0;
#X connect 25 0 9 0;
#X connect 26 1 14 0;
#X connect 28 0 27 0;
#X connect 29 0 7 0;
#X connect 30 0 31 0;
#X connect 31 0 29 0;
#X connect 32 0 34 0;
#X connect 32 1 24 1;
#X connect 33 0 30 0;
#X connect 34 0 24 0;
#X connect 34 1 11 0;
#X connect 34 2 6 0;
#X connect 34 2 28 0;
#X connect 35 0 26 0;
#X restore 658 323 pd draw_rotrect;
#X obj 487 240 pix_opencv_contours;
#X obj 479 320 pix_opencv_drawcontours;
#X obj 514 96 pix_image dessin.tif;
#N canvas 969 295 674 695 drawdefects 0;
#X obj 191 301 gemhead;
#X obj 134 217 loadbang;
#X msg 134 238 0;
#X obj 210 116 list split 2;
#X obj 215 186 list append;
#X obj 191 375 scaleXYZ 10.6666 -8 0;
#X obj 244 160 t b b a;
#X obj 210 76 inlet DEFECTS;
#X obj 210 96 route convexitydefects;
#X obj 244 139 list split 7;
#X obj 191 335 color 1 0 0 1;
#X obj 191 355 translateXYZ -5.3333 4 0;
#N canvas 897 569 739 379 ortho_point 0;
#X obj 192 7 inlet;
#X obj 192 57 t a a;
#X obj 204 238 *;
#X obj 174 238 *;
#X obj 114 124 unpack 0 0 0 0;
#X obj 114 279 +;
#X obj 154 279 +;
#X obj 114 340 outlet;
#X obj 174 320 outlet;
#X obj 153 198 -;
#X msg 153 178 1 \$1;
#X obj 144 238 *;
#X obj 114 238 *;
#X obj 219 84 list split 6;
#X text 519 123 dot product;
#X floatatom 244 163 5 0 0 0 - - -;
#X obj 300 29 t b;
#X msg 343 68 0 1 1 1 0.5 0.5;
#X obj 219 124 expr abs(($f3-$f1)*($f6-$f2)+($f4-$f2)*($f5-$f1));
#X obj 302 158 expr $f1*sqrt(10.666*8);
#X connect 0 0 1 0;
#X connect 1 0 4 0;
#X connect 1 1 13 0;
#X connect 2 0 6 1;
#X connect 3 0 5 1;
#X connect 4 0 12 0;
#X connect 4 1 11 0;
#X connect 4 2 3 0;
#X connect 4 3 2 0;
#X connect 5 0 7 0;
#X connect 6 0 8 0;
#X connect 9 0 11 1;
#X connect 9 0 12 1;
#X connect 10 0 9 0;
#X connect 11 0 6 0;
#X connect 12 0 5 0;
#X connect 13 0 18 0;
#X connect 16 0 17 0;
#X connect 17 0 1 0;
#X connect 18 0 15 0;
#X connect 18 0 19 0;
#X connect 19 0 2 1;
#X connect 19 0 3 1;
#X connect 19 0 10 0;
#X restore 328 515 pd ortho_point;
#X obj 191 475 translateXYZ 10.6666 -8 0;
#X msg 240 451 \$5;
#X msg 289 451 \$6;
#X obj 191 556 circle 0.01;
#X msg 204 530 draw line;
#X obj 204 506 loadbang;
#X obj 354 369 t a;
#X connect 0 0 10 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 1 9 0;
#X connect 4 0 9 0;
#X connect 5 0 13 0;
#X connect 6 0 4 0;
#X connect 6 1 0 0;
#X connect 6 2 19 0;
#X connect 7 0 8 0;
#X connect 8 0 3 0;
#X connect 9 0 6 0;
#X connect 9 1 4 1;
#X connect 10 0 11 0;
#X connect 11 0 5 0;
#X connect 13 0 16 0;
#X connect 14 0 13 1;
#X connect 15 0 13 2;
#X connect 17 0 16 0;
#X connect 18 0 17 0;
#X connect 19 0 15 0;
#X connect 19 0 14 0;
#X restore 542 294 pd drawdefects;
#N canvas 797 706 562 219 options 0;
#X obj 57 97 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X msg 57 117 contours \$1;
#X obj 57 165 outlet;
#X obj 147 97 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 247 97 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X msg 147 117 convexhulls \$1;
#X msg 247 117 convexitydefects \$1;
#X text 25 7 set hierarchy level (which contour to send out);
#X obj 24 33 nbx 5 14 -1 1e+37 0 1 empty empty empty 0 -8 0 10 -262144
-1 -1 -1 256;
#X msg 24 50 hierarchy_level \$1;
#X text 71 75 send out different kind of infos (all on by default)
:;
#X text 25 17 -1 for all contours (default);
#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 restore 674 213 pd options;
#X text 489 347 color legend :;
#X text 522 364 yellow = bounding box;
#X text 528 374 green = contour;
#X text 534 385 blue = convexhull;
#X text 534 397 pink = convexhull edge with defects;
#X text 540 409 red = farthest point from convexhull;
#X connect 13 0 14 0;
#X connect 14 0 13 0;
#X connect 40 0 48 0;
#X connect 41 0 55 0;
#X connect 42 0 41 0;
#X connect 43 0 42 0;
#X connect 43 1 57 0;
#X connect 44 0 43 0;
#X connect 45 0 55 0;
#X connect 46 0 45 0;
#X connect 47 0 53 0;
#X connect 47 0 52 0;
#X connect 49 0 42 0;
#X connect 49 1 40 0;
#X connect 50 0 55 0;
#X connect 51 0 50 0;
#X connect 52 0 51 0;
#X connect 53 0 46 0;
#X connect 55 1 56 0;
#X connect 55 1 58 0;
#X connect 55 2 54 0;
#X connect 57 0 49 0;
#X connect 59 0 55 0;