aboutsummaryrefslogtreecommitdiff
path: root/pix_opencv_warpperspective-help.pd
blob: d9404bdf40dee9b7d075ee7b2a4a61e0277f4fff (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
#N canvas 622 378 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 203 571 print;
#X obj 24 591 rectangle 4 3;
#X obj 24 4 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X obj 24 539 pix_opencv_warpperspective;
#X msg 96 437 mapMatrix 1 0 0 0 1 0 0 0 1;
#X text 95 418 you can also set the map matrix directly;
#X msg 96 457 mapMatrix 0.5 0 0 0 0.5 0 0 0 1;
#X text 301 436 identity;
#X text 322 458 scale by 0.5;
#X msg 96 477 mapMatrix 0 1 0 1 0 0 0 0 2;
#X text 295 479 rotation by 90deg and scale by 0.5;
#X obj 24 93 pix_video;
#X obj 24 133 pix_flip;
#N canvas 3 81 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 obj 41 62 inlet;
#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 connect 24 0 16 0;
#X restore 161 604 pd wrap_perspective_GPU;
#X obj 24 113 pix_grey;
#X msg 43 233 dstMatrix 0 0 0 1 1 1 1 0;
#X msg 59 281 srcMatrix 0 0 0 1 1 1 1 0;
#X text 203 234 destination matrix;
#X text 103 261 source matrix;
#X text 229 279 the same as dst lead to identity map matrix;
#X msg 71 306 srcMatrix 1 0 1 1 2 1 2 0;
#X text 234 299 translation also lead to identity map matrix while
translation is not a perspective transformation;
#X text 126 327 TODO more src examples...;
#X text 112 88 pix_opencv_warpperspective computes the perspective
transformation between dstMatrix and srcMatrix and corrects the image
image according to this perspective transformation;
#X text 111 129 the trasnsformation matrix is also sent through the
right outlet to be applied in OpenGL for example;
#X text 114 159 the transformation matrix could also be set by mapMatrix
message to apply the transformation;
#X text 112 25 see examples/05-perspective_correction for an example
of the use of pix_opencv_warpperspective with pix_opencv_findchessboardcorners
to correct perspective;
#X connect 0 0 16 0;
#X connect 2 0 1 0;
#X connect 3 0 1 0;
#X connect 4 0 6 0;
#X connect 7 0 0 0;
#X connect 8 0 4 0;
#X connect 8 1 5 0;
#X connect 9 0 8 0;
#X connect 11 0 8 0;
#X connect 14 0 8 0;
#X connect 16 0 19 0;
#X connect 17 0 8 0;
#X connect 19 0 17 0;
#X connect 20 0 8 0;
#X connect 21 0 8 0;
#X connect 25 0 8 0;