aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAntoine Villeret <avilleret@users.sourceforge.net>2014-07-10 14:39:22 +0000
committerAntoine Villeret <avilleret@users.sourceforge.net>2014-07-10 14:39:22 +0000
commitba994f4404b6eadcab4e0ead46ef4d3ffeceb024 (patch)
tree099dcc6caf1391cf23947317287623c389b9982d /examples
parente44f63152eb063b5e2e1e05e332439d7c4b7f828 (diff)
lots of changes !
1. switch to a new build system based on automake (because we need to check for some lib on ./configure before make) 2. sort files in different directory 3. add some new features (some of them need OpenCV >= 2.4.5) svn path=/trunk/externals/pix_opencv/; revision=17324
Diffstat (limited to 'examples')
-rw-r--r--examples/00_opencv_haarcascade+pix_image/00_opencv_haarcascade+pix_image.pd13
-rwxr-xr-xexamples/01_boundingrect+pmpd_ambient/01_boundingrect+pmpd_ambient.pd (renamed from examples/01_opencv_contrours_boundingrect+pmpd_ambient/01_opencv_contrours_boundingrect+pmpd_ambient.pd)71
-rwxr-xr-xexamples/01_boundingrect+pmpd_ambient/pd_link.pd (renamed from examples/01_opencv_contrours_boundingrect+pmpd_ambient/pd_link.pd)0
-rwxr-xr-xexamples/01_boundingrect+pmpd_ambient/pd_mass.pd (renamed from examples/01_opencv_contrours_boundingrect+pmpd_ambient/pd_mass.pd)0
-rw-r--r--examples/02_opencv_motempl+particle_system/02_opencv_motempl+particle_system.pd13
-rw-r--r--examples/04_opencv_colorfilt+video_projector/04_opencv_colorfilt+video_projector.pd (renamed from examples/04_opencv_colorfilt+video_projector/05_opencv_colorfilt+video_projector.pd)0
-rw-r--r--examples/05_perspective_correction/05_perspective_correction.pd30
-rw-r--r--examples/07_shape_extractor/07_shape_extractor.pd72
-rw-r--r--examples/09_vp_calibration/01.flat_projection-help.pd30
-rw-r--r--examples/09_vp_calibration/09_vp_calibration_gpu.pd363
-rw-r--r--examples/09_vp_calibration/flat_projection.pd456
-rw-r--r--examples/09_vp_calibration/soft_edge.frag62
-rw-r--r--examples/09_vp_calibration/temp2.JPGbin0 -> 18421 bytes
-rw-r--r--examples/10-fast_blobtracker/10-fast_blob_tracker.pd165
-rw-r--r--examples/11-blobtracker2/11-blobtracker2.pd235
-rw-r--r--examples/Makefile.am39
-rw-r--r--examples/test-contours.bmpbin0 -> 921654 bytes
17 files changed, 1549 insertions, 0 deletions
diff --git a/examples/00_opencv_haarcascade+pix_image/00_opencv_haarcascade+pix_image.pd b/examples/00_opencv_haarcascade+pix_image/00_opencv_haarcascade+pix_image.pd
index 8220f35..17184cb 100644
--- a/examples/00_opencv_haarcascade+pix_image/00_opencv_haarcascade+pix_image.pd
+++ b/examples/00_opencv_haarcascade+pix_image/00_opencv_haarcascade+pix_image.pd
@@ -1,4 +1,9 @@
+<<<<<<< HEAD
#N canvas 52 71 946 685 8;
+=======
+#N canvas 563 174 946 685 8;
+#X declare -path ../../;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X obj 277 1021 pix_texture;
#X obj 277 1048 rectangle 4 3;
#X obj 277 347 pix_rgba;
@@ -41,7 +46,11 @@
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X restore 304 94 pd gemwin;
+<<<<<<< HEAD
#X msg 304 61 create;
+=======
+#X msg 304 61 destroy;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X obj -190 155 cnv 15 600 180 empty empty empty 20 12 0 14 -260097
-66577 0;
#X text -167 194 2.- Setup your camera;
@@ -123,6 +132,10 @@ change the size of the image accorrding;
#X obj 394 860 translateXYZ 0 0 0.2;
#X obj 454 629 -;
#X obj 484 626 * 2;
+<<<<<<< HEAD
+=======
+#X obj 503 87 declare -path ../../;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X connect 0 0 1 0;
#X connect 2 0 14 0;
#X connect 3 0 8 0;
diff --git a/examples/01_opencv_contrours_boundingrect+pmpd_ambient/01_opencv_contrours_boundingrect+pmpd_ambient.pd b/examples/01_boundingrect+pmpd_ambient/01_boundingrect+pmpd_ambient.pd
index 8e06b97..08bd136 100755
--- a/examples/01_opencv_contrours_boundingrect+pmpd_ambient/01_opencv_contrours_boundingrect+pmpd_ambient.pd
+++ b/examples/01_boundingrect+pmpd_ambient/01_boundingrect+pmpd_ambient.pd
@@ -1,4 +1,9 @@
+<<<<<<< HEAD
#N canvas 556 25 1099 664 12;
+=======
+#N canvas 556 80 1099 664 12;
+#X declare -path ../..;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#N canvas 310 102 970 684 structure 0;
#X obj 124 43 pd_mass -0.7 0.7 \$0;
#X obj 189 113 pd_link \$0;
@@ -399,7 +404,10 @@ and pd_link abstraction patches in same folder as this one.;
#X obj 1751 1203 unpack 0 0 0 0;
#X obj 698 894 cnv 15 310 20 empty empty empty 20 12 0 14 -258113 -66577
0;
+<<<<<<< HEAD
#X text 698 893 <- threshold fo the background substraction;
+=======
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X obj 699 941 cnv 15 310 20 empty empty empty 20 12 0 14 -258113 -66577
0;
#X obj 700 987 cnv 15 310 20 empty empty empty 20 12 0 14 -258113 -66577
@@ -461,7 +469,11 @@ of them we want to be able to interact with our structure;
0;
#X obj 287 1668 spigot;
#X obj 326 1643 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1
+<<<<<<< HEAD
1 1;
+=======
+0 1;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X text 46 886 4.- Setup the parameters for your analysis;
#X text 44 1654 5.- hide the analysis;
#X text 347 1641 <- click here to chow the original video image;
@@ -471,9 +483,17 @@ of them we want to be able to interact with our structure;
#X floatatom 654 1718 5 0 0 0 - - -;
#X obj 288 1724 translateXYZ 0 0 -0.05;
#X obj 492 834 pix_resize 180 144;
+<<<<<<< HEAD
#X connect 2 0 3 0;
#X connect 4 0 219 0;
#X connect 5 0 229 0;
+=======
+#X obj 764 243 declare -path ../..;
+#X text 698 893 <- threshold of the background substraction;
+#X connect 2 0 3 0;
+#X connect 4 0 218 0;
+#X connect 5 0 228 0;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X connect 6 0 7 0;
#X connect 8 0 69 0;
#X connect 11 0 13 0;
@@ -509,7 +529,11 @@ of them we want to be able to interact with our structure;
#X connect 60 0 51 0;
#X connect 61 0 51 0;
#X connect 65 0 66 1;
+<<<<<<< HEAD
#X connect 66 0 225 0;
+=======
+#X connect 66 0 224 0;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X connect 66 1 111 0;
#X connect 67 0 68 1;
#X connect 68 0 70 0;
@@ -558,7 +582,11 @@ of them we want to be able to interact with our structure;
#X connect 110 1 87 0;
#X connect 110 2 88 0;
#X connect 110 3 89 0;
+<<<<<<< HEAD
#X connect 111 0 204 0;
+=======
+#X connect 111 0 203 0;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X connect 111 1 110 0;
#X connect 111 2 140 0;
#X connect 111 3 169 0;
@@ -626,6 +654,7 @@ of them we want to be able to interact with our structure;
#X connect 169 1 146 0;
#X connect 169 2 147 0;
#X connect 169 3 148 0;
+<<<<<<< HEAD
#X connect 181 0 195 0;
#X connect 182 0 194 0;
#X connect 183 0 198 0;
@@ -666,3 +695,45 @@ of them we want to be able to interact with our structure;
#X connect 227 0 224 3;
#X connect 228 0 2 0;
#X connect 229 0 68 0;
+=======
+#X connect 180 0 194 0;
+#X connect 181 0 193 0;
+#X connect 182 0 197 0;
+#X connect 183 0 198 0;
+#X connect 184 0 188 0;
+#X connect 184 0 206 0;
+#X connect 185 0 192 0;
+#X connect 185 0 209 0;
+#X connect 186 0 188 1;
+#X connect 187 0 192 1;
+#X connect 188 0 189 0;
+#X connect 188 0 207 0;
+#X connect 191 0 185 0;
+#X connect 192 0 190 0;
+#X connect 192 0 208 0;
+#X connect 193 0 195 0;
+#X connect 194 0 196 0;
+#X connect 195 0 191 0;
+#X connect 196 0 184 0;
+#X connect 197 0 186 0;
+#X connect 198 0 187 0;
+#X connect 199 0 203 0;
+#X connect 200 0 210 0;
+#X connect 202 0 199 0;
+#X connect 203 0 180 0;
+#X connect 203 1 181 0;
+#X connect 203 2 182 0;
+#X connect 203 3 183 0;
+#X connect 206 0 210 0;
+#X connect 207 0 210 0;
+#X connect 208 0 210 0;
+#X connect 209 0 210 0;
+#X connect 218 0 225 0;
+#X connect 219 0 218 1;
+#X connect 223 0 6 0;
+#X connect 224 0 223 0;
+#X connect 225 0 227 0;
+#X connect 226 0 223 3;
+#X connect 227 0 2 0;
+#X connect 228 0 68 0;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
diff --git a/examples/01_opencv_contrours_boundingrect+pmpd_ambient/pd_link.pd b/examples/01_boundingrect+pmpd_ambient/pd_link.pd
index 288fb93..288fb93 100755
--- a/examples/01_opencv_contrours_boundingrect+pmpd_ambient/pd_link.pd
+++ b/examples/01_boundingrect+pmpd_ambient/pd_link.pd
diff --git a/examples/01_opencv_contrours_boundingrect+pmpd_ambient/pd_mass.pd b/examples/01_boundingrect+pmpd_ambient/pd_mass.pd
index a1083a9..a1083a9 100755
--- a/examples/01_opencv_contrours_boundingrect+pmpd_ambient/pd_mass.pd
+++ b/examples/01_boundingrect+pmpd_ambient/pd_mass.pd
diff --git a/examples/02_opencv_motempl+particle_system/02_opencv_motempl+particle_system.pd b/examples/02_opencv_motempl+particle_system/02_opencv_motempl+particle_system.pd
index 5dd353c..c884257 100644
--- a/examples/02_opencv_motempl+particle_system/02_opencv_motempl+particle_system.pd
+++ b/examples/02_opencv_motempl+particle_system/02_opencv_motempl+particle_system.pd
@@ -1,4 +1,9 @@
+<<<<<<< HEAD
#N canvas 0 25 1259 669 10;
+=======
+#N canvas 3 80 1259 669 10;
+#X declare -path ../..;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X obj 422 769 route -1 0 1 2 3 4;
#X floatatom 425 849 5 0 0 0 - - -;
#X floatatom 460 849 5 0 0 0 - - -;
@@ -213,13 +218,21 @@ want or also to a generalized solution.;
0 1;
#X obj 173 1422 spigot;
#X obj 206 1396 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1
+<<<<<<< HEAD
0 1;
+=======
+1 1;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X text -174 1438 This example is the typical video projection to the
floor following the movement of the people. So image to project must
be just a black background with the particles.;
#X obj 228 1395 loadbang;
#X text 222 1296 show/hide analysis ->;
#X text 39 1394 show/hide original image ->;
+<<<<<<< HEAD
+=======
+#X obj 735 273 declare -path ../..;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X connect 0 0 13 0;
#X connect 0 1 14 0;
#X connect 0 2 15 0;
diff --git a/examples/04_opencv_colorfilt+video_projector/05_opencv_colorfilt+video_projector.pd b/examples/04_opencv_colorfilt+video_projector/04_opencv_colorfilt+video_projector.pd
index 83ec09d..83ec09d 100644
--- a/examples/04_opencv_colorfilt+video_projector/05_opencv_colorfilt+video_projector.pd
+++ b/examples/04_opencv_colorfilt+video_projector/04_opencv_colorfilt+video_projector.pd
diff --git a/examples/05_perspective_correction/05_perspective_correction.pd b/examples/05_perspective_correction/05_perspective_correction.pd
index 19fe5f2..a013a19 100644
--- a/examples/05_perspective_correction/05_perspective_correction.pd
+++ b/examples/05_perspective_correction/05_perspective_correction.pd
@@ -1,4 +1,8 @@
+<<<<<<< HEAD
#N canvas 737 110 900 736 10;
+=======
+#N canvas 745 86 900 736 10;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X declare -path ../../;
#X obj 180 76 gemhead;
#X obj 180 96 pix_share_read 666 640 480 1;
@@ -55,7 +59,11 @@ positives;
#X obj 70 619 scaleXYZ 0.5 0.5 0;
#X msg 113 517 5.3333 320;
#X msg 189 517 4 240;
+<<<<<<< HEAD
#N canvas 1 110 450 300 format 0;
+=======
+#N canvas 3 79 450 300 format 0;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X obj 93 7 inlet;
#X obj 118 140 outlet;
#X msg 108 68 \$1 \$4 0 \$7 \$2 \$5 0 \$8 0 0 1 0 \$3 \$6 0 \$9;
@@ -140,7 +148,11 @@ matrix between srcMatrix and dstMatrix;
#X text 502 594 pix_opencv_findchessboardcorners finds chessboard corners
in the incomming image stream and send out corners coordinates as a
list trought its second outlet;
+<<<<<<< HEAD
#N canvas 737 406 715 644 generates_coords 0;
+=======
+#N canvas 743 388 715 644 generates_coords 1;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X obj 58 2 inlet;
#X obj 78 251 until;
#X obj 78 358 f;
@@ -258,13 +270,22 @@ scrMatrix for pix_opencv_warpperspective;
with pix_opencv_warpperspective and pix_opencv_findchessboardcorners
;
#X text -18 0 declare path to be sure externals were found...;
+<<<<<<< HEAD
#X text 354 95 <-- receive image from subprocess.pd;
#X obj 224 198 pix_flip;
+=======
+#X text 508 440 use the other patch to move the chessboard;
+#X text 354 95 <-- receive image from subprocess.pd;
+#X obj 207 159 pix_flip;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X text 102 162 the flip flag;
#X text 102 172 this is a bug;
#X text 184 159 -->;
#X obj 180 136 t a a;
+<<<<<<< HEAD
#X text 508 440 use subprocess patch to move the chessboard;
+=======
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X connect 0 0 1 0;
#X connect 1 0 13 0;
#X connect 2 0 74 0;
@@ -280,7 +301,11 @@ with pix_opencv_warpperspective and pix_opencv_findchessboardcorners
#X connect 11 0 10 0;
#X connect 12 0 2 0;
#X connect 12 0 70 0;
+<<<<<<< HEAD
#X connect 13 0 91 0;
+=======
+#X connect 13 0 92 0;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
#X connect 16 0 17 0;
#X connect 16 1 18 0;
#X connect 19 0 20 0;
@@ -323,4 +348,9 @@ with pix_opencv_warpperspective and pix_opencv_findchessboardcorners
#X connect 75 0 74 1;
#X connect 76 0 75 0;
#X connect 76 0 73 1;
+<<<<<<< HEAD
#X connect 91 0 2 0;
+=======
+#X connect 92 0 2 0;
+#X connect 92 1 88 0;
+>>>>>>> 09729232bf1a52aa509cf5341d4186ba42576589
diff --git a/examples/07_shape_extractor/07_shape_extractor.pd b/examples/07_shape_extractor/07_shape_extractor.pd
new file mode 100644
index 0000000..c747346
--- /dev/null
+++ b/examples/07_shape_extractor/07_shape_extractor.pd
@@ -0,0 +1,72 @@
+#N canvas 571 629 1037 415 10;
+#X declare -path ../..;
+#X obj 618 -87 gemhead;
+#X obj 645 -4 pix_texture;
+#X obj 51 202 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577
+0;
+#N canvas 1 86 454 304 gemwin 0;
+#X obj 67 89 outlet;
+#X obj 67 10 inlet;
+#X obj 67 41 route create;
+#X msg 67 70 set destroy;
+#X msg 182 68 set create;
+#X obj 160 260 gemwin;
+#X msg 159 207 create \, 1;
+#X msg 235 208 destroy;
+#X msg 281 180 frame 25;
+#X obj 162 170 t b b b;
+#X msg 353 192 color 0 0 1;
+#X obj 349 156 loadbang;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 0 9 0;
+#X connect 2 1 4 0;
+#X connect 2 1 7 0;
+#X connect 3 0 0 0;
+#X connect 4 0 0 0;
+#X connect 6 0 5 0;
+#X connect 7 0 5 0;
+#X connect 8 0 5 0;
+#X connect 9 0 6 0;
+#X connect 9 2 8 0;
+#X connect 10 0 5 0;
+#X connect 11 0 10 0;
+#X restore 56 246 pd gemwin;
+#X msg 56 225 destroy;
+#X text 57 207 Create window and render;
+#X obj 618 -45 t a a;
+#X obj 645 -24 pix_separator;
+#X obj 822 85 gemhead;
+#X obj 822 107 pix_texture;
+#X obj 822 147 scaleXYZ 0.5 0.5 0;
+#X obj 822 127 translateXYZ 0 2 0;
+#X obj 475 64 pix_opencv_distrans;
+#X obj 20 -69 declare -path ../..;
+#X obj 475 176 pix_texture;
+#X obj 475 196 translateXYZ 0 -2 0;
+#X obj 475 216 scaleXYZ 0.5 0.5 0;
+#X obj 475 236 rectangle 5.3333 4;
+#X obj 823 168 rectangle 5.3333 4;
+#X obj 475 156 pix_threshold;
+#X msg 550 133 \$1 0 0;
+#X floatatom 555 113 5 0 0 0 - - -, f 5;
+#X obj 618 -67 pix_image ../test-contours.bmp;
+#X connect 0 0 22 0;
+#X connect 1 1 9 1;
+#X connect 3 0 4 0;
+#X connect 4 0 3 0;
+#X connect 6 0 12 0;
+#X connect 6 1 7 0;
+#X connect 7 0 1 0;
+#X connect 8 0 9 0;
+#X connect 9 0 11 0;
+#X connect 10 0 18 0;
+#X connect 11 0 10 0;
+#X connect 12 0 19 0;
+#X connect 14 0 15 0;
+#X connect 15 0 16 0;
+#X connect 16 0 17 0;
+#X connect 19 0 14 0;
+#X connect 20 0 19 2;
+#X connect 21 0 20 0;
+#X connect 22 0 6 0;
diff --git a/examples/09_vp_calibration/01.flat_projection-help.pd b/examples/09_vp_calibration/01.flat_projection-help.pd
new file mode 100644
index 0000000..928203d
--- /dev/null
+++ b/examples/09_vp_calibration/01.flat_projection-help.pd
@@ -0,0 +1,30 @@
+#N canvas 363 186 996 500 10;
+#X obj 39 307 r render;
+#X obj 39 437 pix_texture;
+#X obj 110 353 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X obj 110 373 openpanel;
+#X msg 110 394 open \$1;
+#X obj 39 458 square 25;
+#X text 99 307 <- this object must be present in your patch to start
+the gemchain like in this example.;
+#X floatatom 109 462 5 0 0 0 - - -, f 5;
+#X obj 39 49 flat_projection 20;
+#X text 304 191 <- abstraction [flat_projection];
+#X msg 51 24 offset 1024 0;
+#X text 176 23 other messages to the gemwin;
+#X text 305 133 This define the way screen are physically connected
+to the computer.;
+#X text 306 93 This define the way screen are positioned in space to
+create a single image.;
+#X text 305 159 geometry screen and geometry computer can be diferents
+\, but should define the same number of screen.;
+#X obj 39 415 pix_image temp2.JPG;
+#X connect 0 0 15 0;
+#X connect 1 0 5 0;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;
+#X connect 4 0 15 0;
+#X connect 7 0 5 1;
+#X connect 10 0 8 0;
+#X connect 15 0 1 0;
diff --git a/examples/09_vp_calibration/09_vp_calibration_gpu.pd b/examples/09_vp_calibration/09_vp_calibration_gpu.pd
new file mode 100644
index 0000000..ed11234
--- /dev/null
+++ b/examples/09_vp_calibration/09_vp_calibration_gpu.pd
@@ -0,0 +1,363 @@
+#N canvas 347 203 1443 736 10;
+#X declare -path ../../;
+#X obj 17 13 declare -path ../../;
+#X text 7 -11 declare path to be sure externals were found...;
+#X obj 9 588 gemwin;
+#X obj 839 270 pix_texture;
+#X msg 23 555 destroy;
+#N canvas 969 388 826 658 compute_perspective 0;
+#N canvas 1 110 450 300 format 0;
+#X obj 93 7 inlet;
+#X obj 118 140 outlet;
+#X msg 108 68 \$1 \$4 0 \$7 \$2 \$5 0 \$8 0 0 1 0 \$3 \$6 0 \$9;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 17 474 pd format;
+#N canvas 1 86 643 318 mapMatrix 0;
+#X obj 110 263 pack 0 0 0 0 0 0 0 0 0;
+#X floatatom 110 121 5 0 0 0 - - -, f 5;
+#X floatatom 160 121 5 0 0 0 - - -, f 5;
+#X floatatom 210 121 5 0 0 0 - - -, f 5;
+#X floatatom 110 141 5 0 0 0 - - -, f 5;
+#X floatatom 160 141 5 0 0 0 - - -, f 5;
+#X floatatom 210 141 5 0 0 0 - - -, f 5;
+#X floatatom 110 161 5 0 0 0 - - -, f 5;
+#X floatatom 160 161 5 0 0 0 - - -, f 5;
+#X floatatom 210 161 5 0 0 0 - - -, f 5;
+#X obj 110 285 outlet;
+#X obj 110 29 inlet;
+#X obj 110 59 unpack 0 0 0 0 0 0 0 0 0;
+#X obj 146 195 t b f;
+#X obj 189 196 t b f;
+#X obj 231 196 t b f;
+#X obj 273 195 t b f;
+#X obj 316 195 t b f;
+#X obj 362 195 t b f;
+#X obj 406 195 t b f;
+#X obj 456 195 t b f;
+#X connect 0 0 10 0;
+#X connect 1 0 0 0;
+#X connect 2 0 13 0;
+#X connect 3 0 14 0;
+#X connect 4 0 15 0;
+#X connect 5 0 16 0;
+#X connect 6 0 17 0;
+#X connect 7 0 18 0;
+#X connect 8 0 19 0;
+#X connect 9 0 20 0;
+#X connect 11 0 12 0;
+#X connect 12 0 1 0;
+#X connect 12 1 2 0;
+#X connect 12 2 3 0;
+#X connect 12 3 4 0;
+#X connect 12 4 5 0;
+#X connect 12 5 6 0;
+#X connect 12 6 7 0;
+#X connect 12 7 8 0;
+#X connect 12 8 9 0;
+#X connect 13 0 0 0;
+#X connect 13 1 0 1;
+#X connect 14 0 0 0;
+#X connect 14 1 0 2;
+#X connect 15 0 0 0;
+#X connect 15 1 0 3;
+#X connect 16 0 0 0;
+#X connect 16 1 0 4;
+#X connect 17 0 0 0;
+#X connect 17 1 0 5;
+#X connect 18 0 0 0;
+#X connect 18 1 0 6;
+#X connect 19 0 0 0;
+#X connect 19 1 0 7;
+#X connect 20 0 0 0;
+#X connect 20 1 0 8;
+#X coords 0 -1 1 1 150 80 1 100 100;
+#X restore 17 391 pd mapMatrix;
+#X obj -136 371 pix_opencv_warpperspective;
+#X text 76 473 <-- transform into a 4x4;
+#X text 101 483 openGL transpose matrix;
+#X obj -137 194 loadbang;
+#X obj 101 101 cnv 15 240 60 empty empty VP_calib 20 12 0 14 -262130
+-66577 0;
+#X floatatom 253 124 5 0 0 0 - - -, f 5;
+#X floatatom 293 124 5 0 0 0 - - -, f 5;
+#X floatatom 253 144 5 0 0 0 - - -, f 5;
+#X floatatom 293 144 5 0 0 0 - - -, f 5;
+#X floatatom 111 124 5 0 0 0 - - -, f 5;
+#X floatatom 151 124 5 0 0 0 - - -, f 5;
+#X floatatom 111 144 5 0 0 0 - - -, f 5;
+#X floatatom 151 144 5 0 0 0 - - -, f 5;
+#X text 206 124 VP 1;
+#X obj 139 -12 unpack 0 0 0 0 0 0 0 0;
+#X obj 139 -52 loadbang;
+#X obj 74 258 pack 0 0 0 0 0 0 0 0;
+#X obj 74 217 t b f;
+#X obj 110 217 t b f;
+#X obj 146 217 t b f;
+#X obj 182 217 t b f;
+#X obj 218 217 t b f;
+#X obj 254 217 t b f;
+#X obj 290 217 t b f;
+#X msg 74 280 dstMatrix \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8;
+#X obj 17 496 outlet;
+#X obj -136 497 outlet;
+#X msg -136 214 srcMatrix -1 1 1 1 -1 -1 1 -1;
+#X obj 74 302 t b a;
+#X obj 201 107 bng 15 250 50 0 empty empty reset 17 7 0 10 -262144
+-1 -1;
+#X msg 124 330 invert \$1;
+#X obj 124 310 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+1;
+#X msg 139 -31 -1 1 1 1 -1 -1 1 -1;
+#X connect 0 0 27 0;
+#X connect 1 0 0 0;
+#X connect 2 0 28 0;
+#X connect 2 1 1 0;
+#X connect 5 0 29 0;
+#X connect 7 0 20 0;
+#X connect 8 0 21 0;
+#X connect 9 0 24 0;
+#X connect 10 0 25 0;
+#X connect 11 0 18 0;
+#X connect 12 0 19 0;
+#X connect 13 0 22 0;
+#X connect 14 0 23 0;
+#X connect 16 0 11 0;
+#X connect 16 1 12 0;
+#X connect 16 2 7 0;
+#X connect 16 3 8 0;
+#X connect 16 4 13 0;
+#X connect 16 5 14 0;
+#X connect 16 6 9 0;
+#X connect 16 7 10 0;
+#X connect 17 0 34 0;
+#X connect 18 0 26 0;
+#X connect 19 0 18 0;
+#X connect 19 1 18 1;
+#X connect 20 0 18 0;
+#X connect 20 1 18 2;
+#X connect 21 0 18 0;
+#X connect 21 1 18 3;
+#X connect 22 0 18 0;
+#X connect 22 1 18 4;
+#X connect 23 0 18 0;
+#X connect 23 1 18 5;
+#X connect 24 0 18 0;
+#X connect 24 1 18 6;
+#X connect 25 0 18 0;
+#X connect 25 1 18 7;
+#X connect 26 0 30 0;
+#X connect 29 0 2 0;
+#X connect 30 1 2 0;
+#X connect 31 0 34 0;
+#X connect 32 0 2 0;
+#X connect 33 0 32 0;
+#X connect 34 0 16 0;
+#X coords 0 -1 1 1 242 62 2 100 100;
+#X restore 751 135 pd compute_perspective;
+#X msg 9 527 color 0 0 1 1 \, dimen 640 480 \, create \, 1;
+#X obj 839 385 square 1 1;
+#X obj 839 333 GEMglMultTransposeMatrixf;
+#X text 396 -7 This demonstrates how to use pix_opencv_warpperspective
+to compute perspective transformation and to apply it with OpenGL;
+#X text 424 61 Very useful to quickly setup video projector;
+#X obj 839 312 scaleXYZ 1 1 1;
+#X obj 839 359 scaleXYZ 1 1 0;
+#X obj 1123 257 pix_texture;
+#N canvas 969 388 826 658 compute_perspective 0;
+#N canvas 1 110 450 300 format 0;
+#X obj 93 7 inlet;
+#X obj 118 140 outlet;
+#X msg 108 68 \$1 \$4 0 \$7 \$2 \$5 0 \$8 0 0 1 0 \$3 \$6 0 \$9;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 17 474 pd format;
+#N canvas 1 86 643 318 mapMatrix 0;
+#X obj 110 263 pack 0 0 0 0 0 0 0 0 0;
+#X floatatom 110 121 5 0 0 0 - - -, f 5;
+#X floatatom 160 121 5 0 0 0 - - -, f 5;
+#X floatatom 210 121 5 0 0 0 - - -, f 5;
+#X floatatom 110 141 5 0 0 0 - - -, f 5;
+#X floatatom 160 141 5 0 0 0 - - -, f 5;
+#X floatatom 210 141 5 0 0 0 - - -, f 5;
+#X floatatom 110 161 5 0 0 0 - - -, f 5;
+#X floatatom 160 161 5 0 0 0 - - -, f 5;
+#X floatatom 210 161 5 0 0 0 - - -, f 5;
+#X obj 110 285 outlet;
+#X obj 110 29 inlet;
+#X obj 110 59 unpack 0 0 0 0 0 0 0 0 0;
+#X obj 146 195 t b f;
+#X obj 189 196 t b f;
+#X obj 231 196 t b f;
+#X obj 273 195 t b f;
+#X obj 316 195 t b f;
+#X obj 362 195 t b f;
+#X obj 406 195 t b f;
+#X obj 456 195 t b f;
+#X connect 0 0 10 0;
+#X connect 1 0 0 0;
+#X connect 2 0 13 0;
+#X connect 3 0 14 0;
+#X connect 4 0 15 0;
+#X connect 5 0 16 0;
+#X connect 6 0 17 0;
+#X connect 7 0 18 0;
+#X connect 8 0 19 0;
+#X connect 9 0 20 0;
+#X connect 11 0 12 0;
+#X connect 12 0 1 0;
+#X connect 12 1 2 0;
+#X connect 12 2 3 0;
+#X connect 12 3 4 0;
+#X connect 12 4 5 0;
+#X connect 12 5 6 0;
+#X connect 12 6 7 0;
+#X connect 12 7 8 0;
+#X connect 12 8 9 0;
+#X connect 13 0 0 0;
+#X connect 13 1 0 1;
+#X connect 14 0 0 0;
+#X connect 14 1 0 2;
+#X connect 15 0 0 0;
+#X connect 15 1 0 3;
+#X connect 16 0 0 0;
+#X connect 16 1 0 4;
+#X connect 17 0 0 0;
+#X connect 17 1 0 5;
+#X connect 18 0 0 0;
+#X connect 18 1 0 6;
+#X connect 19 0 0 0;
+#X connect 19 1 0 7;
+#X connect 20 0 0 0;
+#X connect 20 1 0 8;
+#X coords 0 -1 1 1 150 80 1 100 100;
+#X restore 17 391 pd mapMatrix;
+#X obj -136 371 pix_opencv_warpperspective;
+#X text 76 473 <-- transform into a 4x4;
+#X text 101 483 openGL transpose matrix;
+#X obj -137 194 loadbang;
+#X obj 101 101 cnv 15 240 60 empty empty VP_calib 20 12 0 14 -262130
+-66577 0;
+#X floatatom 253 124 5 0 0 0 - - -, f 5;
+#X floatatom 293 124 5 0 0 0 - - -, f 5;
+#X floatatom 253 144 5 0 0 0 - - -, f 5;
+#X floatatom 293 144 5 0 0 0 - - -, f 5;
+#X floatatom 111 124 5 0 0 0 - - -, f 5;
+#X floatatom 151 124 5 0 0 0 - - -, f 5;
+#X floatatom 111 144 5 0 0 0 - - -, f 5;
+#X floatatom 151 144 5 0 0 0 - - -, f 5;
+#X text 206 124 VP 1;
+#X obj 139 -12 unpack 0 0 0 0 0 0 0 0;
+#X obj 139 -52 loadbang;
+#X obj 74 258 pack 0 0 0 0 0 0 0 0;
+#X obj 74 217 t b f;
+#X obj 110 217 t b f;
+#X obj 146 217 t b f;
+#X obj 182 217 t b f;
+#X obj 218 217 t b f;
+#X obj 254 217 t b f;
+#X obj 290 217 t b f;
+#X msg 74 280 dstMatrix \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8;
+#X obj 17 496 outlet;
+#X obj -136 497 outlet;
+#X msg -136 214 srcMatrix -1 1 1 1 -1 -1 1 -1;
+#X obj 74 302 t b a;
+#X obj 201 107 bng 15 250 50 0 empty empty reset 17 7 0 10 -262144
+-1 -1;
+#X msg 124 330 invert \$1;
+#X obj 124 310 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+1;
+#X msg 139 -31 -1 1 1 1 -1 -1 1 -1;
+#X connect 0 0 27 0;
+#X connect 1 0 0 0;
+#X connect 2 0 28 0;
+#X connect 2 1 1 0;
+#X connect 5 0 29 0;
+#X connect 7 0 20 0;
+#X connect 8 0 21 0;
+#X connect 9 0 24 0;
+#X connect 10 0 25 0;
+#X connect 11 0 18 0;
+#X connect 12 0 19 0;
+#X connect 13 0 22 0;
+#X connect 14 0 23 0;
+#X connect 16 0 11 0;
+#X connect 16 1 12 0;
+#X connect 16 2 7 0;
+#X connect 16 3 8 0;
+#X connect 16 4 13 0;
+#X connect 16 5 14 0;
+#X connect 16 6 9 0;
+#X connect 16 7 10 0;
+#X connect 17 0 34 0;
+#X connect 18 0 26 0;
+#X connect 19 0 18 0;
+#X connect 19 1 18 1;
+#X connect 20 0 18 0;
+#X connect 20 1 18 2;
+#X connect 21 0 18 0;
+#X connect 21 1 18 3;
+#X connect 22 0 18 0;
+#X connect 22 1 18 4;
+#X connect 23 0 18 0;
+#X connect 23 1 18 5;
+#X connect 24 0 18 0;
+#X connect 24 1 18 6;
+#X connect 25 0 18 0;
+#X connect 25 1 18 7;
+#X connect 26 0 30 0;
+#X connect 29 0 2 0;
+#X connect 30 1 2 0;
+#X connect 31 0 34 0;
+#X connect 32 0 2 0;
+#X connect 33 0 32 0;
+#X connect 34 0 16 0;
+#X coords 0 -1 1 1 242 62 2 100 100;
+#X restore 1035 134 pd compute_perspective;
+#X obj 1123 384 square 1 1;
+#X obj 1123 332 GEMglMultTransposeMatrixf;
+#X obj 1123 311 scaleXYZ 1 1 1;
+#X obj 1123 358 scaleXYZ 1 1 0;
+#X obj 1123 281 depth 0;
+#X obj 839 291 depth 0;
+#X obj 839 247 gemhead 2;
+#X obj 1123 226 gemhead 3;
+#X obj 460 133 flat_projection 20;
+#X obj 11 128 r render;
+#X obj 11 258 pix_texture;
+#X obj 82 174 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X obj 82 194 openpanel;
+#X msg 82 215 open \$1;
+#X obj 11 279 square 25;
+#X text 71 128 <- this object must be present in your patch to start
+the gemchain like in this example.;
+#X floatatom 81 283 5 0 0 0 - - -, f 5;
+#X obj 11 236 pix_image temp2.JPG;
+#X obj 1006 151 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1
+0 1;
+#X connect 3 0 20 0;
+#X connect 4 0 2 0;
+#X connect 5 1 8 1;
+#X connect 6 0 2 0;
+#X connect 8 0 12 0;
+#X connect 11 0 8 0;
+#X connect 12 0 7 0;
+#X connect 13 0 19 0;
+#X connect 14 1 16 1;
+#X connect 16 0 18 0;
+#X connect 17 0 16 0;
+#X connect 18 0 15 0;
+#X connect 19 0 17 0;
+#X connect 20 0 11 0;
+#X connect 21 0 3 0;
+#X connect 22 0 13 0;
+#X connect 24 0 32 0;
+#X connect 25 0 29 0;
+#X connect 26 0 27 0;
+#X connect 27 0 28 0;
+#X connect 28 0 32 0;
+#X connect 31 0 29 1;
+#X connect 32 0 25 0;
+#X connect 33 0 21 0;
+#X connect 33 0 22 0;
diff --git a/examples/09_vp_calibration/flat_projection.pd b/examples/09_vp_calibration/flat_projection.pd
new file mode 100644
index 0000000..febb3b3
--- /dev/null
+++ b/examples/09_vp_calibration/flat_projection.pd
@@ -0,0 +1,456 @@
+#N canvas 73 150 1376 699 10;
+#X obj 263 277 gemhead;
+#X obj 263 351 gemframebuffer;
+#X obj 263 402 s render;
+#X msg 285 326 rectangle 0;
+#X obj 285 307 loadbang;
+#X obj 263 376 translateXYZ 0 0 -4;
+#N canvas 190 83 1090 559 size 0;
+#X obj 29 20 inlet;
+#X obj 29 91 unpack f f;
+#X obj 142 91 unpack f f;
+#X obj 336 91 unpack f f;
+#X obj 142 122 - 1;
+#X obj 199 124 - 1;
+#X obj 142 187 *;
+#X obj 155 163 t b f;
+#X obj 199 187 *;
+#X obj 212 163 t b f;
+#X obj 42 233 t b f;
+#X obj 126 233 t b f;
+#X obj 29 330 pack f f;
+#X obj 441 160 t b b f;
+#X obj 29 494 outlet;
+#X obj 29 147 *;
+#X obj 42 123 t b f;
+#X obj 86 147 *;
+#X obj 99 123 t b f;
+#X obj 257 329 pack f f;
+#X obj 257 407 outlet;
+#X obj 29 257 -;
+#X obj 113 257 -;
+#X obj 113 285 f;
+#X obj 29 285 f;
+#N canvas 260 83 450 300 change2 0;
+#X obj 41 24 inlet;
+#X obj 41 47 unpack f f;
+#X obj 80 176 pack f f;
+#X obj 98 132 t b f;
+#X obj 80 201 outlet;
+#X obj 41 149 moses 2;
+#X obj 41 89 change;
+#X obj 98 89 change;
+#X connect 0 0 1 0;
+#X connect 1 0 6 0;
+#X connect 1 1 7 0;
+#X connect 2 0 4 0;
+#X connect 3 0 6 0;
+#X connect 3 1 2 1;
+#X connect 5 1 2 0;
+#X connect 6 0 5 0;
+#X connect 7 0 3 0;
+#X restore 257 366 pd change2;
+#N canvas 260 83 450 300 change2 0;
+#X obj 41 24 inlet;
+#X obj 41 47 unpack f f;
+#X obj 80 176 pack f f;
+#X obj 98 132 t b f;
+#X obj 80 201 outlet;
+#X obj 41 149 moses 2;
+#X obj 41 89 change;
+#X obj 98 89 change;
+#X connect 0 0 1 0;
+#X connect 1 0 6 0;
+#X connect 1 1 7 0;
+#X connect 2 0 4 0;
+#X connect 3 0 6 0;
+#X connect 3 1 2 1;
+#X connect 5 1 2 0;
+#X connect 6 0 5 0;
+#X connect 7 0 3 0;
+#X restore 29 350 pd change2;
+#X obj 581 311 pack f f;
+#X obj 594 265 t b f;
+#X obj 651 265 t b f;
+#X obj 581 289 /;
+#X obj 638 289 /;
+#X obj 579 171 pack f f;
+#X obj 305 428 /;
+#X obj 305 448 * 4;
+#X msg 305 468 \$1 4;
+#X msg 29 369 dimen \$1 \$2;
+#X obj 57 392 /;
+#X msg 57 472 perspec \$1 \$2 -1 1 1 20;
+#X obj 57 452 pack f f;
+#X obj 57 411 t f f;
+#X obj 57 431 * -1;
+#X obj 441 91 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+1;
+#X text 467 90 basic FSAA;
+#X obj 29 46 route screen_size geometry_screen geometry_computer overlap
+FSAA;
+#X obj 239 91 unpack f f;
+#X obj 239 137 *;
+#X obj 252 113 t b f;
+#X obj 296 137 *;
+#X obj 309 113 t b f;
+#X obj 579 191 s \$0-glsl_geometry_screen;
+#X obj 578 224 s \$0-glsl_geometry_computer;
+#X obj 581 331 s \$0-glsl_overlap;
+#X obj 305 490 s \$0-size_gemwin;
+#X obj 388 255 r \$0-altern;
+#X obj 407 311 list;
+#X obj 388 276 sel 0 1;
+#X obj 388 341 list;
+#X obj 29 307 + 0;
+#X obj 113 308 + 0;
+#X text 480 108 not full implemented yet!;
+#X connect 0 0 44 0;
+#X connect 1 0 15 0;
+#X connect 1 0 28 0;
+#X connect 1 0 46 0;
+#X connect 1 1 17 0;
+#X connect 1 1 29 0;
+#X connect 1 1 48 0;
+#X connect 2 0 4 0;
+#X connect 2 0 16 0;
+#X connect 2 0 32 0;
+#X connect 2 1 5 0;
+#X connect 2 1 18 0;
+#X connect 2 1 32 1;
+#X connect 3 0 7 0;
+#X connect 3 0 30 0;
+#X connect 3 1 9 0;
+#X connect 3 1 31 0;
+#X connect 4 0 6 0;
+#X connect 5 0 8 0;
+#X connect 6 0 10 0;
+#X connect 7 0 6 0;
+#X connect 7 1 6 1;
+#X connect 8 0 11 0;
+#X connect 9 0 8 0;
+#X connect 9 1 8 1;
+#X connect 10 0 21 0;
+#X connect 10 1 21 1;
+#X connect 11 0 22 0;
+#X connect 11 1 22 1;
+#X connect 12 0 26 0;
+#X connect 12 0 37 0;
+#X connect 13 0 24 0;
+#X connect 13 1 23 0;
+#X connect 13 2 58 1;
+#X connect 13 2 59 1;
+#X connect 15 0 21 0;
+#X connect 16 0 15 0;
+#X connect 16 1 15 1;
+#X connect 17 0 22 0;
+#X connect 18 0 17 0;
+#X connect 18 1 17 1;
+#X connect 19 0 25 0;
+#X connect 21 0 24 0;
+#X connect 22 0 23 0;
+#X connect 23 0 59 0;
+#X connect 24 0 58 0;
+#X connect 25 0 20 0;
+#X connect 25 0 33 0;
+#X connect 26 0 36 0;
+#X connect 27 0 52 0;
+#X connect 28 0 30 0;
+#X connect 28 1 30 1;
+#X connect 29 0 31 0;
+#X connect 29 1 31 1;
+#X connect 30 0 27 0;
+#X connect 31 0 27 1;
+#X connect 32 0 50 0;
+#X connect 33 0 34 0;
+#X connect 34 0 35 0;
+#X connect 35 0 53 0;
+#X connect 36 0 14 0;
+#X connect 37 0 40 0;
+#X connect 38 0 14 0;
+#X connect 39 0 38 0;
+#X connect 40 0 41 0;
+#X connect 40 1 39 1;
+#X connect 41 0 39 0;
+#X connect 42 0 13 0;
+#X connect 44 0 1 0;
+#X connect 44 1 2 0;
+#X connect 44 1 55 1;
+#X connect 44 2 45 0;
+#X connect 44 2 51 0;
+#X connect 44 2 57 1;
+#X connect 44 3 3 0;
+#X connect 44 4 42 0;
+#X connect 45 0 47 0;
+#X connect 45 1 49 0;
+#X connect 46 0 19 0;
+#X connect 47 0 46 0;
+#X connect 47 1 46 1;
+#X connect 48 0 19 1;
+#X connect 49 0 48 0;
+#X connect 49 1 48 1;
+#X connect 54 0 56 0;
+#X connect 55 0 45 0;
+#X connect 55 0 51 0;
+#X connect 56 0 57 0;
+#X connect 56 1 55 0;
+#X connect 57 0 45 0;
+#X connect 57 0 51 0;
+#X connect 58 0 12 0;
+#X connect 59 0 12 1;
+#X restore 528 320 pd size;
+#X msg 605 523 0 \, destroy;
+#X obj 594 551 gemwin;
+#X obj 428 519 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X obj 281 631 rectangle;
+#X obj 306 589 unpack f f;
+#X floatatom 380 610 5 0 0 0 - - -, f 5;
+#X floatatom 319 612 5 0 0 0 - - -, f 5;
+#N canvas 0 50 743 323 init_glsl 0;
+#X obj 129 184 outlet;
+#X msg 129 120 overlap \$1 \$2;
+#X obj 129 95 pack f f;
+#X obj 249 98 pack f f;
+#X obj 434 99 pack f f;
+#X msg 249 119 geometry_screen \$1 \$2;
+#X msg 434 120 geometry_computer \$1 \$2;
+#X obj 434 76 r \$0-glsl_geometry_computer;
+#X obj 249 75 r \$0-glsl_geometry_screen;
+#X obj 129 72 r \$0-glsl_overlap;
+#X obj 38 27 r \$0-init_glsl;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X connect 3 0 5 0;
+#X connect 4 0 6 0;
+#X connect 5 0 0 0;
+#X connect 6 0 0 0;
+#X connect 7 0 4 0;
+#X connect 8 0 3 0;
+#X connect 9 0 2 0;
+#X connect 10 0 3 0;
+#X connect 10 0 2 0;
+#X connect 10 0 4 0;
+#X restore 418 497 pd init_glsl;
+#X obj 292 500 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X obj 281 539 pix_texture;
+#X obj 281 428 gemhead 60;
+#X obj 528 343 print framebuffer;
+#X obj 604 415 print gem_window;
+#N canvas 0 50 669 667 glsl_frag 0;
+#X obj 78 598 glsl_program;
+#X msg 35 325 print;
+#X obj 172 387 change;
+#X msg 34 545 print;
+#X obj 78 367 glsl_fragment;
+#X floatatom 172 413 2 0 0 0 ID - -, f 2;
+#X obj 190 459 print linking;
+#X text 97 546 after linking \, click "print" to get some info about
+the compiled shader program;
+#X obj 13 52 inlet;
+#X obj 78 634 outlet;
+#X obj 577 95 inlet;
+#X obj 13 75 route bang;
+#X obj 141 87 gemhead 1;
+#X msg 141 109 1;
+#X obj 141 133 change;
+#X obj 141 157 t b;
+#X obj 157 619 change;
+#X obj 157 640 t b;
+#X obj 157 661 outlet;
+#X msg 172 438 link \$1;
+#X msg 87 324 open soft_edge.frag;
+#X connect 0 0 9 0;
+#X connect 0 1 16 0;
+#X connect 1 0 4 0;
+#X connect 2 0 5 0;
+#X connect 3 0 0 0;
+#X connect 4 0 0 0;
+#X connect 4 1 2 0;
+#X connect 5 0 19 0;
+#X connect 8 0 11 0;
+#X connect 10 0 0 0;
+#X connect 11 0 20 0;
+#X connect 11 1 4 0;
+#X connect 12 0 13 0;
+#X connect 13 0 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 20 0;
+#X connect 16 0 17 0;
+#X connect 17 0 18 0;
+#X connect 19 0 0 0;
+#X connect 19 0 6 0;
+#X connect 20 0 4 0;
+#X restore 281 518 pd glsl_frag _______;
+#X obj 605 470 sel 0 1;
+#X msg 624 500 border 0 \, create \, 1;
+#X obj 528 67 pack f f;
+#X obj 638 48 t b f;
+#X obj 831 65 pack f f;
+#X obj 941 46 t b f;
+#X msg 528 97 screen_size \$1 \$2;
+#X msg 831 92 geometry_screen \$1 \$2;
+#X obj 1151 65 pack f f;
+#X obj 1281 46 t b f;
+#X msg 746 93 2 2;
+#X msg 746 67 set \$1 \$2;
+#X obj 683 67 loadbang;
+#X msg 1151 92 geometry_computer \$1 \$2;
+#X msg 1066 67 set \$1 \$2;
+#X obj 1003 67 loadbang;
+#X msg 1066 93 4 1;
+#X msg 446 67 set \$1 \$2;
+#X obj 383 67 loadbang;
+#X msg 446 93 160 120;
+#X obj 446 114 unpack f f;
+#X obj 746 114 unpack f f;
+#X obj 1066 114 unpack f f;
+#X obj 1003 236 loadbang;
+#X msg 1066 262 0 0;
+#X msg 1151 282 overlap \$1 \$1;
+#X msg 567 576 0;
+#X msg 594 392 dimen \$1 \$2;
+#X obj 567 369 t b l;
+#X obj 100 235 cnv 15 250 20 empty empty PUT_AN_OBJECT_[r_render]_IN_YOUR_PATCH
+10 10 0 10 -258113 -66577 0;
+#X obj 100 20 cnv 15 250 215 empty empty empty 20 12 0 14 -260097 -66577
+0;
+#X obj 108 163 nbx 5 14 0 5000 0 0 \$0-overlap \$0-overlap empty 0
+-8 0 10 -99865 -1 -1 0 256;
+#X obj 108 187 tgl 15 0 \$0-createDestroy \$0-createDestroy empty 17
+7 0 10 -1 -262144 -1 0 1;
+#X text 128 187 Create/Destroy Gem window;
+#X obj 108 29 nbx 4 12 -1e+37 1e+37 0 0 \$0-sizeScreenX \$0-sizeScreenX
+empty 0 -8 0 10 -1 -262144 -1 160 256;
+#X text 166 163 Overlap X and Y (pixels);
+#X obj 108 45 nbx 4 12 -1e+37 1e+37 0 0 \$0-sizeScreenY \$0-sizeScreenY
+empty 0 -8 0 10 -1 -262144 -1 120 256;
+#X obj 108 83 nbx 4 12 -1e+37 1e+37 0 0 \$0-Geom-screenY \$0-Geom-screenY
+empty 0 -8 0 10 -257985 -1 -1 2 256;
+#X obj 108 67 nbx 4 12 -1e+37 1e+37 0 0 \$0-Geom-screenX \$0-Geom-screenX
+empty 0 -8 0 10 -257985 -1 -1 2 256;
+#X obj 108 143 tgl 10 0 \$0-altern \$0-altern empty 17 7 0 10 -1 -262144
+-1 0 1;
+#X obj 108 121 nbx 4 12 -1e+37 1e+37 0 0 \$0-Geom-computerY \$0-Geom-computerY
+empty 0 -8 0 10 -257985 -1 -1 1 256;
+#X obj 108 105 nbx 4 12 -1e+37 1e+37 0 0 \$0-Geom-computerX \$0-Geom-computerX
+empty 0 -8 0 10 -257985 -1 -1 4 256;
+#X text 158 65 Geometry screen (X);
+#X text 158 81 Geometry screen (Y);
+#X text 158 103 Geometry computer (X);
+#X text 158 119 Geometry computer (Y);
+#X text 158 28 Screens size (X);
+#X text 158 44 Screens size (Y);
+#X obj 108 212 bng 15 250 50 0 \$0-save \$0-receiveNothing empty 17
+7 0 10 -258113 -1 -1;
+#X text 128 212 Save parameters;
+#X obj 446 156 s \$0-sizeScreenX;
+#X obj 503 136 s \$0-sizeScreenY;
+#X obj 746 155 s \$0-Geom-screenX;
+#X obj 803 135 s \$0-Geom-screenY;
+#X obj 1123 135 s \$0-Geom-computerY;
+#X obj 1066 155 s \$0-Geom-computerX;
+#X obj 1066 304 s \$0-overlap;
+#X obj 605 449 r \$0-createDestroy;
+#X obj 567 596 s \$0-createDestroy;
+#X obj 418 540 s \$0-init_glsl;
+#X obj 306 569 r \$0-size_gemwin;
+#X obj 528 27 r \$0-sizeScreenX;
+#X obj 638 27 r \$0-sizeScreenY;
+#X obj 831 25 r \$0-Geom-screenX;
+#X obj 941 25 r \$0-Geom-screenY;
+#X obj 1281 25 r \$0-Geom-computerY;
+#X obj 1151 25 r \$0-Geom-computerX;
+#X obj 1151 215 r \$0-overlap;
+#X obj 100 271 r \$0-save;
+#X msg 1066 236 set \$1 \$1;
+#X obj 100 317 s pd-soft_edge.pd;
+#X msg 100 292 menusave;
+#X text 856 481 'soft-edge.pd' by Cyrille Henry (GUI by Jack/RYBN)
+;
+#X text 121 140 View computer(0)/screen(1);
+#X obj 388 16 inlet;
+#X obj 444 643 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 5 0;
+#X connect 1 1 16 1;
+#X connect 3 0 1 0;
+#X connect 4 0 3 0;
+#X connect 5 0 2 0;
+#X connect 6 0 1 0;
+#X connect 6 0 18 0;
+#X connect 6 1 49 0;
+#X connect 7 0 8 0;
+#X connect 9 0 80 0;
+#X connect 11 0 10 1;
+#X connect 11 0 13 0;
+#X connect 11 1 10 2;
+#X connect 11 1 12 0;
+#X connect 14 0 20 1;
+#X connect 15 0 20 0;
+#X connect 16 0 10 0;
+#X connect 16 1 96 0;
+#X connect 17 0 20 0;
+#X connect 20 0 16 0;
+#X connect 20 1 80 0;
+#X connect 21 0 7 0;
+#X connect 21 1 22 0;
+#X connect 22 0 8 0;
+#X connect 23 0 27 0;
+#X connect 23 0 38 0;
+#X connect 24 0 23 0;
+#X connect 24 1 23 1;
+#X connect 25 0 28 0;
+#X connect 25 0 32 0;
+#X connect 26 0 25 0;
+#X connect 26 1 25 1;
+#X connect 27 0 6 0;
+#X connect 28 0 6 0;
+#X connect 29 0 34 0;
+#X connect 29 0 35 0;
+#X connect 30 0 29 0;
+#X connect 30 1 29 1;
+#X connect 31 0 28 0;
+#X connect 31 0 42 0;
+#X connect 32 0 31 0;
+#X connect 33 0 31 0;
+#X connect 34 0 6 0;
+#X connect 35 0 37 0;
+#X connect 36 0 37 0;
+#X connect 37 0 34 0;
+#X connect 37 0 43 0;
+#X connect 38 0 40 0;
+#X connect 39 0 40 0;
+#X connect 40 0 27 0;
+#X connect 40 0 41 0;
+#X connect 41 0 71 0;
+#X connect 41 1 72 0;
+#X connect 42 0 73 0;
+#X connect 42 1 74 0;
+#X connect 43 0 76 0;
+#X connect 43 1 75 0;
+#X connect 44 0 45 0;
+#X connect 45 0 46 0;
+#X connect 45 0 77 0;
+#X connect 46 0 6 0;
+#X connect 47 0 79 0;
+#X connect 48 0 8 0;
+#X connect 48 0 19 0;
+#X connect 49 0 47 0;
+#X connect 49 1 48 0;
+#X connect 78 0 21 0;
+#X connect 81 0 11 0;
+#X connect 82 0 23 0;
+#X connect 83 0 24 0;
+#X connect 84 0 25 0;
+#X connect 85 0 26 0;
+#X connect 86 0 30 0;
+#X connect 87 0 29 0;
+#X connect 88 0 46 0;
+#X connect 88 0 90 0;
+#X connect 89 0 92 0;
+#X connect 90 0 45 0;
+#X connect 92 0 91 0;
+#X connect 95 0 8 0;
+#X coords 0 -1 1 1 250 235 2 100 20;
diff --git a/examples/09_vp_calibration/soft_edge.frag b/examples/09_vp_calibration/soft_edge.frag
new file mode 100644
index 0000000..1c2e35f
--- /dev/null
+++ b/examples/09_vp_calibration/soft_edge.frag
@@ -0,0 +1,62 @@
+// Cyrille Henry 2010
+
+//#extension GL_ARB_texture_rectangle : enable
+//uniform sampler2DRect MyTex;
+uniform sampler2D MyTex;
+uniform vec2 overlap, geometry_screen, geometry_computer;
+
+void main (void)
+{
+// FSAA
+
+// change coord from computer matrix to screen matrice
+ vec2 coord = (gl_TextureMatrix[0] * gl_TexCoord[0]).st;
+ vec2 pos_new = coord;
+ pos_new *= geometry_computer;
+ float screen_num = floor(pos_new.x)+floor(pos_new.y)*geometry_computer.x; // number of the screen
+ pos_new = fract(pos_new); // coord in 1 screen (from 0 to 1)
+ pos_new.x += fract(screen_num/geometry_screen.x)*geometry_screen.x;
+ pos_new.y += floor(screen_num/geometry_screen.x);
+ pos_new /= geometry_screen;
+
+// compute position regarding to the overlap
+ vec2 pos = pos_new;
+ pos *= geometry_screen;
+
+ vec2 pos_over = fract(pos);
+ pos_over *= overlap;
+ pos_over -= overlap/2.;
+ pos += pos_over;
+ pos += overlap/2.;
+ pos /= geometry_screen + overlap;
+ vec4 color = texture2D(MyTex, pos);
+
+// compute fade on Top and Right
+ vec2 black = pos_new;
+ black *= geometry_screen;
+ black = fract(black);
+ black *= 1. + (overlap/ (geometry_screen/2.));
+ black -= 1.;
+ black = max(black,0.);
+ black *= (geometry_screen / 2.) / overlap;
+ if ( ( floor(pos_new.x*geometry_screen.x) < geometry_screen.x-1. ) && (overlap.x != 0.) )
+ color *= (1.-black.x);
+ if ( ( floor(pos_new.y*geometry_screen.y) < geometry_screen.y-1. ) && (overlap.x != 0.) )
+ color *= (1.-black.y);
+
+// compute fade on Left and bottom
+ black = pos_new;
+ black *= geometry_screen;
+ black = fract(black);
+ black = vec2(1.) - black;
+ black *= 1. + (overlap/ (geometry_screen/2.));
+ black -= 1.;
+ black = max(black,0.);
+ black *= (geometry_screen / 2.) / overlap;
+ if ( ( floor(pos_new.x*geometry_screen.x) > 0. ) && (overlap.x != 0.) )
+ color *= (1.-black.x);
+ if ( ( floor(pos_new.y*geometry_screen.y) > 0. ) && (overlap.x != 0.) )
+ color *= (1.-black.y);
+
+ gl_FragColor = color;
+}
diff --git a/examples/09_vp_calibration/temp2.JPG b/examples/09_vp_calibration/temp2.JPG
new file mode 100644
index 0000000..0152c1b
--- /dev/null
+++ b/examples/09_vp_calibration/temp2.JPG
Binary files differ
diff --git a/examples/10-fast_blobtracker/10-fast_blob_tracker.pd b/examples/10-fast_blobtracker/10-fast_blob_tracker.pd
new file mode 100644
index 0000000..6c2041d
--- /dev/null
+++ b/examples/10-fast_blobtracker/10-fast_blob_tracker.pd
@@ -0,0 +1,165 @@
+#N canvas 616 283 966 610 10;
+#X declare -path ../..;
+#X obj 106 90 cnv 15 100 25 empty empty 1 20 12 0 14 -4034 -66577 0
+;
+#X obj 106 132 cnv 15 280 60 empty empty 2 20 12 0 14 -4034 -66577
+0;
+#X obj 106 217 cnv 15 360 120 empty empty 3 20 12 0 14 -4034 -66577
+0;
+#X obj 106 390 cnv 15 210 60 empty empty 4 20 12 0 14 -4034 -66577
+0;
+#X obj 144 94 pix_video;
+#X obj 144 54 gemhead;
+#X obj 282 44 declare -path ../..;
+#X obj 144 284 pix_opencv_contours;
+#X obj 144 404 pix_opencv_trackKnn;
+#X obj 144 506 pix_texture;
+#X obj 39 59 gemwin;
+#X msg 39 17 create \, 1;
+#X msg 46 38 destroy;
+#X obj 144 528 rectangle 4 3;
+#N canvas 622 298 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 530 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 357 \$6;
+#X obj 521 379 > 0;
+#X obj 521 400 sel 1 0;
+#X msg 520 421 1 0 0 0.2;
+#X msg 540 441 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 446 scaleXYZ 10.666 -8 0;
+#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 677 text2d;
+#X obj 141 310 print oneblob;
+#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 7 1 44 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 32 0;
+#X connect 18 0 10 0;
+#X connect 19 0 43 0;
+#X connect 20 0 43 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 43 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 32 0 11 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 12 1;
+#X connect 42 0 12 2;
+#X restore 255 429 pd cvblob;
+#X obj 144 149 pix_gray;
+#X msg 160 252 area \$1;
+#X obj 144 170 pix_opencv_threshold;
+#X obj 255 305 route count;
+#X obj 261 147 nbx 5 14 -1e+37 1e+37 0 1 empty empty luminance_threshold
+0 -8 0 10 -262144 -1 -1 214 256;
+#X obj 160 232 nbx 5 14 -1e+37 1e+37 0 1 empty empty area_threshold
+0 -8 0 10 -262144 -1 -1 100 256;
+#X obj 253 229 loadbang;
+#X text 519 110 This example shows how to make a simple tracking algorithm.
+;
+#X text 534 134 1 First take a video source (here a video source like
+a webcam);
+#X text 534 164 2 process it to extract features of interessed \, here
+I use a very simple (and not so accurate) gray convertion and thresholding
+based on luminance. This is the binarisation stage.;
+#X msg 253 252 cvblobOutput 1 \, hierarchy_level 0;
+#X text 534 224 3 find blob contours. Select only blob greater than
+an area threshold. Also we only get the outer contour (not the inner
+holes) of the shape thanks to the [hierarchy_level 0( message.;
+#X text 534 284 4 the found blobs are send to [pix_opencv_trackKnn]
+to sort there id according to the Knn algorithm.;
+#X text 532 322 To complete this process we could add a Kalmann filter
+to forseen tracking data in case of hiding or somethign else.;
+#X text 515 522 Antoine Villeret - 2013;
+#X connect 4 0 15 0;
+#X connect 5 0 4 0;
+#X connect 7 0 8 0;
+#X connect 7 2 18 0;
+#X connect 8 0 9 0;
+#X connect 8 1 14 0;
+#X connect 9 0 13 0;
+#X connect 11 0 10 0;
+#X connect 12 0 10 0;
+#X connect 15 0 17 0;
+#X connect 16 0 7 0;
+#X connect 17 0 7 0;
+#X connect 18 1 8 0;
+#X connect 19 0 17 2;
+#X connect 20 0 16 0;
+#X connect 21 0 25 0;
+#X connect 25 0 7 0;
diff --git a/examples/11-blobtracker2/11-blobtracker2.pd b/examples/11-blobtracker2/11-blobtracker2.pd
new file mode 100644
index 0000000..103744a
--- /dev/null
+++ b/examples/11-blobtracker2/11-blobtracker2.pd
@@ -0,0 +1,235 @@
+#N canvas 1132 438 541 486 10;
+#X declare -path ../.. -lib pix_opencv;
+#X obj 74 -87 declare -path ../.. -lib pix_opencv;
+#X obj 0 155 pix_opencv_backgroundsubtractor;
+#N canvas 780 394 504 512 src 0;
+#X obj 302 -79 gemhead;
+#X obj 314 -52 bng 25 250 50 0 load empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 359 34 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144
+-1 -1;
+#X floatatom 353 18 5 0 10000 1 frame# - -, f 5;
+#X obj 314 -23 openpanel;
+#X obj 302 36 pix_film;
+#N canvas 1 250 299 199 vswitch 0;
+#X obj 36 128 outlet;
+#X obj 36 26 inlet;
+#X obj 130 26 inlet;
+#X obj 175 27 inlet;
+#X obj 81 61 == 0;
+#X obj 36 83 spigot 1;
+#X obj 130 84 spigot 0;
+#X connect 1 0 5 0;
+#X connect 2 0 6 0;
+#X connect 3 0 4 0;
+#X connect 3 0 6 1;
+#X connect 4 0 5 1;
+#X connect 5 0 0 0;
+#X connect 6 0 0 0;
+#X restore 62 118 pd vswitch;
+#X obj 163 -188 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1
+1 1;
+#X obj 62 45 pix_video;
+#X obj 62 -79 gemhead;
+#X text 180 -190 switch source (camera / film);
+#X msg 314 -3 open \$1 \, auto 1;
+#X obj 173 -253 loadbang;
+#X msg 173 -230 0;
+#X obj 169 -123 == 0;
+#X obj 130 -284 inlet;
+#X text 168 -282 src selection : 0 = camera \, 1 = file;
+#X obj 345 -113 sel 1;
+#X obj 62 140 outlet;
+#X obj 169 -144 t a a a a;
+#X connect 0 0 5 0;
+#X connect 1 0 4 0;
+#X connect 2 0 3 0;
+#X connect 3 0 5 1;
+#X connect 4 0 11 0;
+#X connect 5 0 6 1;
+#X connect 5 2 2 0;
+#X connect 6 0 18 0;
+#X connect 7 0 19 0;
+#X connect 8 0 6 0;
+#X connect 9 0 8 0;
+#X connect 11 0 5 0;
+#X connect 12 0 13 0;
+#X connect 13 0 7 0;
+#X connect 14 0 9 0;
+#X connect 15 0 7 0;
+#X connect 17 0 1 0;
+#X connect 19 0 14 0;
+#X connect 19 1 0 0;
+#X connect 19 2 6 2;
+#X connect 19 3 17 0;
+#X restore 0 26 pd src;
+#X obj 0 -11 vradio 15 1 0 2 empty empty empty 0 -8 0 10 -262144 -1
+-1 1;
+#N canvas 1 120 450 300 gray/rgba 0;
+#X obj 62 36 pix_grey;
+#X obj 121 36 pix_rgba;
+#X obj 62 11 spigot 1;
+#X obj 107 -34 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+1;
+#X text 125 -37 switch color mode ( grey / rgba );
+#X obj 107 -11 == 0;
+#X obj 121 11 spigot 0;
+#X obj 62 98 t a;
+#X obj 121 61 alpha;
+#X obj 62 -92 inlet;
+#X obj 62 120 outlet;
+#X obj 107 -60 inlet;
+#X connect 0 0 7 0;
+#X connect 1 0 8 0;
+#X connect 2 0 0 0;
+#X connect 3 0 5 0;
+#X connect 3 0 6 1;
+#X connect 5 0 2 1;
+#X connect 6 0 1 0;
+#X connect 7 0 10 0;
+#X connect 8 0 7 0;
+#X connect 9 0 2 0;
+#X connect 9 0 6 0;
+#X connect 11 0 3 0;
+#X restore 0 85 pd gray/rgba;
+#X obj 69 49 vradio 15 1 0 2 empty empty empty 0 -8 0 10 -262144 -1
+-1 1;
+#X text 87 49 gray;
+#X text 87 63 RGBA;
+#X text 16 -12 camera;
+#X text 16 3 video file;
+#X obj 0 207 pix_opencv_contours;
+#X obj 0 259 pix_opencv_trackKnn;
+#X obj 0 281 pix_texture;
+#X obj 0 303 rectangle 5.3333 4;
+#X obj 238 -47 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577
+0;
+#N canvas 3 81 454 304 gemwin 0;
+#X obj 67 89 outlet;
+#X obj 67 10 inlet;
+#X obj 65 41 route create;
+#X msg 67 70 set destroy;
+#X msg 182 68 set create;
+#N canvas 87 154 247 179 Gem.init 0;
+#X obj 118 46 loadbang;
+#X msg 118 81 reset;
+#X obj 118 113 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X restore 289 80 pd Gem.init;
+#X obj 162 241 gemwin;
+#X msg 342 184 destroy;
+#X msg 283 161 frame 25;
+#X obj 164 126 t b b b;
+#X msg 161 189 dimen 640 560 \, create \, 1;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 0 9 0;
+#X connect 2 1 4 0;
+#X connect 2 1 7 0;
+#X connect 3 0 0 0;
+#X connect 4 0 0 0;
+#X connect 7 0 6 0;
+#X connect 8 0 6 0;
+#X connect 9 0 10 0;
+#X connect 9 2 8 0;
+#X connect 10 0 6 0;
+#X restore 248 -1 pd gemwin;
+#X msg 248 -21 destroy;
+#X text 246 -41 Create window and render;
+#N canvas 552 204 596 300 draw_contour_gemvertexbuffer 1;
+#X obj 175 173 loadbang;
+#X obj 135 65 translateXYZ -0.5 -0.5 0;
+#X obj 135 42 scaleXYZ 10.6666 -8 1;
+#X obj 135 -9 gemhead 1000;
+#X obj 135 17 alpha 0;
+#X msg 162 130 posX drawX \, posY drawY \, colorG drawZ \, colorA drawZ
+;
+#X msg 175 193 draw line;
+#X obj 135 245 gemvertexbuffer;
+#X obj 186 97 inlet;
+#X obj 347 41 r point_number;
+#X msg 269 201 resize \$1;
+#X obj 310 92 f;
+#X obj 135 87 t a b b;
+#X obj 298 166 max 3;
+#X connect 0 0 6 0;
+#X connect 1 0 12 0;
+#X connect 2 0 1 0;
+#X connect 3 0 4 0;
+#X connect 4 0 2 0;
+#X connect 5 0 7 0;
+#X connect 6 0 7 0;
+#X connect 8 0 5 0;
+#X connect 9 0 11 1;
+#X connect 10 0 7 0;
+#X connect 11 0 13 0;
+#X connect 12 0 7 0;
+#X connect 12 1 5 0;
+#X connect 12 2 11 0;
+#X connect 13 0 10 0;
+#X restore 321 81 pd draw_contour_gemvertexbuffer;
+#X obj 321 60 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X text 337 61 draw with gemvertexbuffer;
+#N canvas 1 90 450 300 parameters 0;
+#X obj 45 25 loadbang;
+#X msg 45 47 contours 1 \, hierarchy_level 0 \, cvblobOutput 1 \, settab
+drawX drawY drawZ;
+#X obj 45 82 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X restore 29 175 pd parameters;
+#X obj 161 232 route count;
+#X obj 161 275 s point_number;
+#X msg 161 254 \$2;
+#X obj 321 102 table drawX 1000;
+#X obj 321 122 table drawY 1000;
+#X obj 321 142 table drawZ 1000;
+#N canvas 363 684 450 300 parameters 1;
+#X obj 45 200 outlet;
+#X obj 45 -10 inlet;
+#X obj 72 55 f;
+#X obj 96 56 + 1;
+#X obj 72 77 sel 50;
+#X obj 45 12 t a b;
+#X obj 72 35 spigot 1;
+#X obj 45 148 spigot;
+#X obj 72 99 t b b;
+#X msg 72 121 1, f 4;
+#X msg 151 127 0;
+#X msg 69 178 algo BackgroundSubtractor.GMG;
+#X connect 1 0 5 0;
+#X connect 2 0 3 0;
+#X connect 2 0 4 0;
+#X connect 3 0 2 1;
+#X connect 4 0 8 0;
+#X connect 5 0 7 0;
+#X connect 5 1 6 0;
+#X connect 6 0 2 0;
+#X connect 7 0 0 0;
+#X connect 8 0 10 0;
+#X connect 8 0 9 0;
+#X connect 8 1 11 0;
+#X connect 9 0 7 1;
+#X connect 10 0 6 1;
+#X connect 11 0 0 0;
+#X restore 0 124 pd parameters;
+#X obj 178 192 print;
+#X connect 1 0 10 0;
+#X connect 1 1 29 0;
+#X connect 2 0 4 0;
+#X connect 3 0 2 0;
+#X connect 4 0 28 0;
+#X connect 5 0 4 1;
+#X connect 10 0 11 0;
+#X connect 10 2 22 0;
+#X connect 11 0 12 0;
+#X connect 12 0 13 0;
+#X connect 15 0 16 0;
+#X connect 16 0 15 0;
+#X connect 19 0 18 0;
+#X connect 21 0 10 0;
+#X connect 22 0 24 0;
+#X connect 24 0 23 0;
+#X connect 28 0 1 0;
diff --git a/examples/Makefile.am b/examples/Makefile.am
new file mode 100644
index 0000000..4d3e6a6
--- /dev/null
+++ b/examples/Makefile.am
@@ -0,0 +1,39 @@
+AUTOMAKE_OPTIONS = foreign
+
+pix_opencvexamplesdir=$(pkglibdir)/examples
+
+nobase_dist_pix_opencvexamples_DATA = \
+00_opencv_haarcascade+pix_image/00_opencv_haarcascade+pix_image.pd \
+00_opencv_haarcascade+pix_image/bocadillo.gif \
+00_opencv_haarcascade+pix_image/haarcascade_frontalface_alt.xml \
+01_boundingrect+pmpd_ambient/01_boundingrect+pmpd_ambient.pd \
+01_boundingrect+pmpd_ambient/pd_link.pd \
+01_boundingrect+pmpd_ambient/pd_mass.pd \
+02_opencv_motempl+particle_system/02_opencv_motempl+particle_system.pd \
+03_opencv_hist_compare+text_trigger/03_opencv_hist_compare+text_trigger.pd \
+03_opencv_hist_compare+text_trigger/vera.ttf \
+04_opencv_colorfilt+video_projector/04_opencv_colorfilt+video_projector.pd \
+04_opencv_colorfilt+video_projector/anim-1.mov \
+04_opencv_colorfilt+video_projector/tmp.pd \
+05_perspective_correction/05_perspective_correction.pd \
+05_perspective_correction/pattern.png \
+05_perspective_correction/subprocess.pd \
+06_GPU_opticalflow/06_GPU_opticalflow.pd \
+06_GPU_opticalflow/of.frag \
+07_shape_extractor/07_shape_extractor.pd \
+08_GPU_morphology/08_GPU_morphology.pd \
+08_GPU_morphology/dilate.frag \
+08_GPU_morphology/erode.frag \
+08_GPU_morphology/glsl_morph.pd \
+09_vp_calibration/01.flat_projection-help.pd \
+09_vp_calibration/09_vp_calibration_gpu.pd \
+09_vp_calibration/09_vp_calibration.pd \
+09_vp_calibration/flat_projection.pd \
+09_vp_calibration/pattern.png \
+09_vp_calibration/soft_edge.frag \
+09_vp_calibration/subprocess.pd \
+09_vp_calibration/temp2.JPG \
+10-fast_blobtracker/10-fast_blob_tracker.pd \
+11-blobtracker2/11-blobtracker2.pd \
+dessin.tif \
+test-contours.bmp
diff --git a/examples/test-contours.bmp b/examples/test-contours.bmp
new file mode 100644
index 0000000..fbef23f
--- /dev/null
+++ b/examples/test-contours.bmp
Binary files differ