aboutsummaryrefslogtreecommitdiff
path: root/pix_opencv_warpperspective-help.pd
blob: 33f24522bbbfa72bb0a98ac7e371b4907bb93d5f (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
#N canvas 295 24 980 660 10;
#X obj 24 25 gemhead;
#X obj 411 543 gemwin;
#X msg 411 509 create \, 1;
#X msg 492 509 destroy;
#X obj 24 565 pix_texture;
#X obj 24 93 pix_film;
#X obj 187 328 pix_texture;
#X obj 187 308 pix_opencv_findchessboardcorners;
#X obj 187 254 pack 6 7;
#X floatatom 187 234 5 0 0 0 - - -;
#X floatatom 240 234 5 0 0 0 - - -;
#X msg 187 274 patternSize \$1 \$2;
#N canvas 502 24 715 644 generates_coords 0;
#X obj 49 31 inlet;
#X obj 77 251 until;
#X obj 77 358 f;
#X msg 95 335 0;
#X obj 90 118 unpack;
#X obj 81 462 pack;
#X obj 77 188 f;
#X obj 177 251 until;
#X obj 209 358 f;
#X msg 227 335 0;
#X obj 177 287 t b b;
#X obj 177 188 f;
#X obj 90 143 t b f;
#X obj 81 501 list;
#X obj 57 521 list;
#X obj 81 482 list prepend;
#X obj 58 591 outlet;
#X text 185 97 generates source coordinates to find homography;
#X obj 89 437 + 0;
#X obj 221 437 + 0;
#X floatatom 420 348 5 0 0 0 offset_y - -;
#X obj 57 89 t b l b;
#X obj 77 208 t f b;
#X obj 177 208 t f b;
#X floatatom 420 328 5 0 0 0 offset_x - -;
#X floatatom 420 308 5 0 0 0 taille_du_cote_en_m - -;
#X obj 105 358 + 0.25;
#X obj 237 358 + 0.25;
#X msg 90 62 6 7;
#X obj 57 545 list prepend dstMatrix;
#X obj 57 566 route list;
#X obj 267 269 t b a;
#X obj 411 185 loadbang;
#X obj 352 399 t b a;
#X obj 277 389 t b a;
#X msg 409 216 11;
#X msg 450 216 493;
#X msg 492 216 137;
#X connect 0 0 21 0;
#X connect 1 0 2 0;
#X connect 2 0 18 0;
#X connect 2 0 26 0;
#X connect 3 0 2 1;
#X connect 4 0 12 0;
#X connect 4 1 11 1;
#X connect 5 0 15 0;
#X connect 6 0 22 0;
#X connect 7 0 10 0;
#X connect 8 0 19 0;
#X connect 8 0 27 0;
#X connect 9 0 8 1;
#X connect 10 0 6 0;
#X connect 10 1 8 0;
#X connect 11 0 23 0;
#X connect 12 0 11 0;
#X connect 12 1 6 1;
#X connect 13 0 14 1;
#X connect 13 0 15 1;
#X connect 14 0 29 0;
#X connect 15 0 13 0;
#X connect 18 0 5 0;
#X connect 19 0 5 1;
#X connect 20 0 33 0;
#X connect 21 0 14 0;
#X connect 21 1 4 0;
#X connect 21 2 15 1;
#X connect 22 0 1 0;
#X connect 22 1 3 0;
#X connect 23 0 7 0;
#X connect 23 1 9 0;
#X connect 24 0 34 0;
#X connect 25 0 31 0;
#X connect 26 0 2 1;
#X connect 27 0 8 1;
#X connect 28 0 21 0;
#X connect 29 0 30 0;
#X connect 30 0 16 0;
#X connect 31 0 28 0;
#X connect 31 1 27 1;
#X connect 31 1 26 1;
#X connect 32 0 35 0;
#X connect 32 0 36 0;
#X connect 32 0 37 0;
#X connect 33 0 28 0;
#X connect 33 1 19 1;
#X connect 34 0 28 0;
#X connect 34 1 18 1;
#X connect 35 0 25 0;
#X connect 36 0 24 0;
#X connect 37 0 20 0;
#X restore 426 309 pd generates_coords;
#X obj 408 350 list prepend srcMatrix;
#X obj 187 348 translateXYZ 2 2 0;
#X obj 187 368 rectangle 2 1.5;
#X obj 408 377 route list;
#X obj 203 571 print;
#X obj 24 512 separator;
#X obj 50 49 loadbang;
#X obj 104 262 spigot;
#X obj 139 139 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X msg 50 69 open shoot-2.mov \, auto 1;
#X obj 24 301 spigot 1;
#X obj 112 240 == 0;
#X obj 24 113 pix_grey;
#X obj 24 591 rectangle 4 3;
#X obj 23 -3 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X text 485 9 pix_opencv_wapperspective finds the transformation matrix
between srcMatrix and dstMatrix;
#X text 485 38 it sends through its second outlet the 3x3 transformation
matrix when a correct scrMatrix message is received;
#X text 484 65 you should first initiliaze dstMatrix;
#X obj 24 539 pix_opencv_warpperspective;
#X text 482 86 it also applied the tansformation matrix on incomming
image stream;
#X text 482 151 pix_opencv_findchessboardcorners finds chessboard corners
in the incomming image stream and send out corners coordinates as a
list trought its second outlet;
#X text 484 200 it also prints found corners on the image stream;
#X msg 409 423 mapMatrix 1 0 0 0 1 0 0 0 1;
#X text 408 404 you can also set the map matrix directly;
#X msg 409 443 mapMatrix 0.5 0 0 0 0.5 0 0 0 1;
#X text 614 422 identity;
#X text 635 444 scale by 0.5;
#X msg 409 463 mapMatrix 0 1 0 1 0 0 0 0 2;
#X text 608 465 rotation by 90deg and scale by 0.5;
#X text 156 134 switch to find corners and mapMatrix and switch back
to apply it;
#X text 186 211 number of inner corners in each direction;
#N canvas 0 0 936 545 wrap_perspective_GPU 0;
#X obj 251 443 mesh_square 10 10;
#X obj 301 277 /;
#X obj 351 278 /;
#X obj 301 233 loadbang;
#X obj 251 356 GEMglMultTransposeMatrixf;
#X obj 251 414 translateXYZ 1 1 0;
#X obj 251 299 scaleXYZ 0.003 0.003 0;
#X obj 251 376 scaleXYZ 639 479 0;
#X obj 251 212 translateXYZ -5.33333 -4 0;
#X obj 251 395 scaleXYZ 0.5 0.5 0;
#X msg 301 255 5.3333 320;
#X msg 377 255 4 240;
#X msg 423 330 \$1 \$4 0 \$7 \$2 \$5 0 \$8 0 0 1 0 \$3 \$6 0 \$9;
#X text 46 22 wrap_persective can be easilly computed by the GPU in
order to boost performace;
#X obj 251 188 spigot;
#X obj 290 138 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 39 105 t a a;
#X obj 39 190 spigot 1;
#X obj 92 164 == 0;
#X obj 39 253 rectangle 4 3;
#X obj 39 233 pix_texture;
#X obj 39 211 pix_opencv_warpperspective;
#X text 306 137 switch CPU / GPU;
#X text 454 256 Since the matrice is computed for somthing that range
from 0 to 639 in X \, and from 0 to 479 in Y \, one have to convert
(scale / translate) the primitive coordinate to fit the transformation
matrix.;
#X connect 1 0 6 1;
#X connect 2 0 6 2;
#X connect 3 0 10 0;
#X connect 3 0 11 0;
#X connect 4 0 7 0;
#X connect 5 0 0 0;
#X connect 6 0 4 0;
#X connect 7 0 9 0;
#X connect 8 0 6 0;
#X connect 9 0 5 0;
#X connect 10 0 1 0;
#X connect 11 0 2 0;
#X connect 12 0 4 1;
#X connect 14 0 8 0;
#X connect 15 0 14 1;
#X connect 15 0 18 0;
#X connect 16 0 17 0;
#X connect 16 1 14 0;
#X connect 17 0 21 0;
#X connect 18 0 17 1;
#X connect 20 0 19 0;
#X connect 21 0 20 0;
#X connect 21 1 12 0;
#X restore 413 589 pd wrap_perspective_GPU;
#X connect 0 0 5 0;
#X connect 2 0 1 0;
#X connect 3 0 1 0;
#X connect 4 0 26 0;
#X connect 5 0 25 0;
#X connect 5 2 22 0;
#X connect 6 0 14 0;
#X connect 7 0 6 0;
#X connect 7 1 13 0;
#X connect 8 0 11 0;
#X connect 8 0 12 0;
#X connect 9 0 8 0;
#X connect 10 0 8 1;
#X connect 11 0 7 0;
#X connect 12 0 31 0;
#X connect 13 0 16 0;
#X connect 14 0 15 0;
#X connect 16 0 31 0;
#X connect 18 0 31 0;
#X connect 19 0 22 0;
#X connect 20 0 7 0;
#X connect 21 0 20 1;
#X connect 21 0 24 0;
#X connect 22 0 5 0;
#X connect 23 0 18 0;
#X connect 24 0 23 1;
#X connect 25 0 23 0;
#X connect 25 0 20 0;
#X connect 27 0 0 0;
#X connect 31 0 4 0;
#X connect 31 1 17 0;
#X connect 35 0 31 0;
#X connect 37 0 31 0;
#X connect 40 0 31 0;