diff options
Diffstat (limited to 'examples/02_opencv_motempl+particle_system')
-rw-r--r-- | examples/02_opencv_motempl+particle_system/02_opencv_motempl+particle_system.pd | 374 |
1 files changed, 374 insertions, 0 deletions
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 new file mode 100644 index 0000000..5dd353c --- /dev/null +++ b/examples/02_opencv_motempl+particle_system/02_opencv_motempl+particle_system.pd @@ -0,0 +1,374 @@ +#N canvas 0 25 1259 669 10; +#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 - - -; +#X floatatom 497 849 5 0 0 0 - - -; +#X floatatom 531 849 5 0 0 0 - - -; +#X floatatom 454 898 5 0 0 0 - - -; +#X floatatom 489 898 5 0 0 0 - - -; +#X floatatom 526 898 5 0 0 0 - - -; +#X floatatom 560 898 5 0 0 0 - - -; +#X floatatom 498 954 5 0 0 0 - - -; +#X floatatom 533 954 5 0 0 0 - - -; +#X floatatom 570 954 5 0 0 0 - - -; +#X floatatom 604 954 5 0 0 0 - - -; +#X obj 422 820 unpack 0 0 0 0 0; +#X obj 451 869 unpack 0 0 0 0 0; +#X obj 495 925 unpack 0 0 0 0 0; +#X floatatom 568 848 5 0 0 0 - - -; +#X floatatom 598 898 5 0 0 0 - - -; +#X floatatom 642 954 5 0 0 0 - - -; +#X text 544 820 (-1) means the whole image; +#X text 619 846 Xcenter Ycenter Width Height Angle; +#X text 640 897 Xcenter Ycenter Width Height Angle; +#X text 687 953 Xcenter Ycenter Width Height Angle; +#X obj 510 1244 part_head; +#X text 620 1410 set the number per frame; +#X text 634 1442 set the age to kill at; +#X msg 719 1351 0.2 0 0 0.3; +#X obj 510 1283 part_size 1; +#X obj 510 1405 part_source 5; +#X obj 510 1459 part_info; +#X obj 511 1533 separator; +#X obj 511 1559 translate 1 0 0 0; +#X obj 511 1582 color; +#X obj 511 1622 scale; +#X msg 620 1669 draw line; +#X msg 591 1279 2; +#X obj 662 1586 unpack 0 0 0; +#X text 717 1551 this is rather velocity; +#X text 721 1567 than rotation; +#X obj 621 1649 loadbang; +#X obj 512 1688 square 0.2; +#X msg 642 1529 \$1 \$2 0; +#X obj 510 1356 part_color; +#X msg 542 1331 1 0 0; +#X msg 594 1331 0 0 1; +#X text 596 1513 we don't allow particles spread along the z-axis; +#X msg 591 1250 1; +#X obj 597 1614 * 360; +#X obj 657 1612 * 360; +#X obj 724 1611 * 360; +#X obj 173 391 pix_separator; +#X obj 317 388 pix_separator; +#X obj 317 421 pix_resize 180 144; +#X obj 647 1308 loadbang; +#X obj 510 1380 part_velocity sphere 0 0 0 0.1; +#X obj 510 1430 part_killold 20; +#X msg 632 1352 0 0 0 0.1; +#X msg 701 1634 0; +#X obj 512 1653 rotateXYZ; +#X obj 915 1232 part_head; +#X text 1025 1391 set the number per frame; +#X text 1039 1423 set the age to kill at; +#X msg 1124 1332 0.2 0 0 0.3; +#X obj 915 1264 part_size 1; +#X obj 915 1386 part_source 5; +#X obj 915 1440 part_info; +#X obj 916 1514 separator; +#X obj 916 1540 translate 1 0 0 0; +#X obj 916 1563 color; +#X obj 916 1603 scale; +#X msg 1025 1650 draw line; +#X msg 999 1260 2; +#X obj 1067 1567 unpack 0 0 0; +#X text 1122 1532 this is rather velocity; +#X text 1126 1548 than rotation; +#X obj 1026 1630 loadbang; +#X obj 917 1669 square 0.2; +#X msg 1047 1510 \$1 \$2 0; +#X obj 915 1337 part_color; +#X msg 947 1312 1 0 0; +#X msg 999 1312 0 0 1; +#X text 1001 1494 we don't allow particles spread along the z-axis +; +#X msg 999 1231 1; +#X obj 1002 1595 * 360; +#X obj 1062 1593 * 360; +#X obj 1129 1592 * 360; +#X obj 1052 1289 loadbang; +#X obj 915 1361 part_velocity sphere 0 0 0 0.1; +#X obj 915 1411 part_killold 20; +#X msg 1037 1333 0 0 0 0.1; +#X msg 1106 1615 0; +#X obj 917 1634 rotateXYZ; +#X obj 454 961 moses 0; +#X obj 499 989 moses 0; +#X obj 453 993 t b; +#X obj 499 1015 t b; +#X obj 453 1016 s out0; +#X obj 499 1040 s out1; +#X obj -181 48 cnv 15 600 90 empty empty empty 20 12 0 14 -260097 -66577 +0; +#X text -158 87 1.- Create the Gem Window; +#N canvas 0 0 450 300 gemwin 0; +#X obj 132 136 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 132 112 create \, 1; +#X msg 198 112 destroy; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 3 0 6 0; +#X connect 3 1 5 0; +#X connect 3 1 7 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 314 104 pd gemwin; +#X msg 314 71 create; +#X obj -180 165 cnv 15 600 180 empty empty empty 20 12 0 14 -260097 +-66577 0; +#X obj 382 202 openpanel; +#X msg 382 222 open \$1; +#X msg 388 265 auto \$1; +#X msg 399 289 colorspace RGB; +#X obj 392 248 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 +1; +#X obj 384 182 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 317 317 pix_film; +#X obj 374 340 t b; +#X floatatom 372 318 5 0 0 0 - - -; +#X obj 317 173 gemhead; +#X text -157 204 2.- Load a video file.; +#X text -162 239 This example is to be used with the typical zenital +camera in an open space \, where you want to track the movement of +the poeple.; +#X text -160 288 A good video to test with can be found here ::; +#X text -162 313 http://muonics.net/cvMovies/Swarm_EindhovenTest_Watec_two-visitors.mov +; +#X text 409 180 <- Load a video file; +#X obj 419 246 loadbang; +#X obj -178 464 cnv 15 650 250 empty empty empty 20 12 0 14 -258113 +-66577 0; +#X floatatom 442 637 5 0 0 0 - - -; +#X floatatom 503 599 5 0 0 0 - - -; +#X text 482 639 Threshold value. (default 30); +#X text 545 598 Maximal duration of motion track in seconds. (default +1); +#X text 507 617 xxx; +#X msg 387 597 mhi_duration \$1; +#X floatatom 543 511 5 0 0 0 - - -; +#X msg 388 509 max_time_delta \$1; +#X floatatom 543 534 5 0 0 0 - - -; +#X msg 388 532 min_time_delta \$1; +#X floatatom 542 563 5 0 0 0 - - -; +#X msg 387 561 frame_buffer_num \$1; +#X floatatom 469 655 5 0 0 0 - - -; +#X floatatom 480 674 5 0 0 0 - - -; +#X text 520 676 Max size of the motion component (default 500); +#X text 510 655 Min size of the motion component (default 50); +#X text 584 562 Number of frames in the buffer. (default 4); +#X text 585 510 Max time delta in seconds. (default 0.5); +#X text 585 533 Min time delta in seconds. (default 0.05); +#X obj 317 680 pix_opencv_motempl; +#X text -155 514 For simple movement tracking you don't need \, the +default values will work well.; +#X text -156 487 3.- Setup the parameters for your analysis; +#X obj -180 1064 cnv 15 1250 170 empty empty empty 20 12 0 14 -261234 +-66577 0; +#X text 482 787 For each motion component; +#X text -157 1087 Here we convert the coordinates of detected motion +componets to gem coordinates \, and apply these values to two particle +systems. The example can be extended with many particle systems we +want or also to a generalized solution.; +#X obj 510 1124 gemhead; +#X obj 511 1207 rotateXYZ; +#X floatatom 572 1205 5 0 0 0 - - -; +#X obj 610 1090 - 72; +#X obj 566 1119 / 22.5; +#X obj 608 1119 / 18; +#X obj 568 1090 - 90; +#X obj 508 1168 translateXYZ; +#X obj 606 1141 * 1; +#X obj 915 1105 gemhead; +#X obj 916 1188 rotateXYZ; +#X floatatom 977 1188 5 0 0 0 - - -; +#X obj 1011 1076 - 72; +#X obj 967 1105 / 22.5; +#X obj 1009 1105 / 18; +#X obj 969 1076 - 90; +#X obj 913 1149 translateXYZ; +#X obj 1007 1127 * 1; +#X obj 646 1123 r out0; +#X msg 646 1151 -500; +#X msg 1054 1132 -500; +#X obj 1054 1104 r out1; +#X text 562 869 first component; +#X text 600 925 second component; +#X obj -179 1270 cnv 15 650 250 empty empty empty 20 12 0 14 -258113 +-66577 0; +#X text -157 1294 4.- Show/Hide analysis or original image; +#X obj 317 1356 pix_texture; +#X obj 173 1470 pix_texture; +#X obj 317 1384 square 4; +#X obj 173 1498 square 4; +#X obj 317 1326 spigot; +#X obj 350 1299 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 +0 1; +#X obj 173 1422 spigot; +#X obj 206 1396 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 +0 1; +#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 ->; +#X connect 0 0 13 0; +#X connect 0 1 14 0; +#X connect 0 2 15 0; +#X connect 5 0 92 0; +#X connect 5 0 151 0; +#X connect 6 0 148 0; +#X connect 9 0 93 0; +#X connect 9 0 160 0; +#X connect 10 0 157 0; +#X connect 13 0 1 0; +#X connect 13 1 2 0; +#X connect 13 2 3 0; +#X connect 13 3 4 0; +#X connect 13 4 16 0; +#X connect 14 0 5 0; +#X connect 14 1 6 0; +#X connect 14 2 7 0; +#X connect 14 3 8 0; +#X connect 14 4 17 0; +#X connect 15 0 9 0; +#X connect 15 1 10 0; +#X connect 15 2 11 0; +#X connect 15 3 12 0; +#X connect 15 4 18 0; +#X connect 23 0 27 0; +#X connect 26 0 54 2; +#X connect 27 0 42 0; +#X connect 28 0 55 0; +#X connect 29 0 30 0; +#X connect 29 2 41 0; +#X connect 29 3 32 1; +#X connect 29 4 36 0; +#X connect 29 5 33 1; +#X connect 30 0 31 0; +#X connect 31 0 32 0; +#X connect 32 0 33 0; +#X connect 33 0 58 0; +#X connect 34 0 40 0; +#X connect 35 0 27 1; +#X connect 36 0 47 0; +#X connect 36 1 48 0; +#X connect 36 2 49 0; +#X connect 39 0 34 0; +#X connect 41 0 31 2; +#X connect 42 0 54 0; +#X connect 43 0 42 1; +#X connect 44 0 42 2; +#X connect 46 0 27 1; +#X connect 50 0 177 0; +#X connect 51 0 52 0; +#X connect 52 0 139 0; +#X connect 53 0 44 0; +#X connect 53 0 43 0; +#X connect 54 0 28 0; +#X connect 55 0 29 0; +#X connect 56 0 54 2; +#X connect 57 0 58 3; +#X connect 58 0 40 0; +#X connect 59 0 63 0; +#X connect 62 0 87 2; +#X connect 63 0 78 0; +#X connect 64 0 88 0; +#X connect 65 0 66 0; +#X connect 65 2 77 0; +#X connect 65 3 68 1; +#X connect 65 4 72 0; +#X connect 65 5 69 1; +#X connect 66 0 67 0; +#X connect 67 0 68 0; +#X connect 68 0 69 0; +#X connect 69 0 91 0; +#X connect 70 0 76 0; +#X connect 71 0 63 1; +#X connect 72 0 83 0; +#X connect 72 1 84 0; +#X connect 72 2 85 0; +#X connect 75 0 70 0; +#X connect 77 0 67 2; +#X connect 78 0 87 0; +#X connect 79 0 78 1; +#X connect 80 0 78 2; +#X connect 82 0 63 1; +#X connect 86 0 80 0; +#X connect 86 0 79 0; +#X connect 87 0 64 0; +#X connect 88 0 65 0; +#X connect 89 0 87 2; +#X connect 90 0 91 3; +#X connect 91 0 76 0; +#X connect 92 0 94 0; +#X connect 93 0 95 0; +#X connect 94 0 96 0; +#X connect 95 0 97 0; +#X connect 100 0 101 0; +#X connect 101 0 100 0; +#X connect 103 0 104 0; +#X connect 104 0 109 0; +#X connect 105 0 109 0; +#X connect 106 0 109 0; +#X connect 107 0 105 0; +#X connect 108 0 103 0; +#X connect 109 0 50 0; +#X connect 109 0 51 0; +#X connect 109 2 110 0; +#X connect 110 0 111 0; +#X connect 111 0 109 1; +#X connect 112 0 109 0; +#X connect 118 0 107 0; +#X connect 120 0 139 1; +#X connect 121 0 125 0; +#X connect 125 0 139 0; +#X connect 126 0 127 0; +#X connect 127 0 139 0; +#X connect 128 0 129 0; +#X connect 129 0 139 0; +#X connect 130 0 131 0; +#X connect 131 0 139 0; +#X connect 132 0 139 2; +#X connect 133 0 139 3; +#X connect 139 0 175 0; +#X connect 139 1 0 0; +#X connect 145 0 152 0; +#X connect 146 0 23 0; +#X connect 147 0 146 2; +#X connect 148 0 150 0; +#X connect 149 0 152 1; +#X connect 150 0 153 0; +#X connect 151 0 149 0; +#X connect 152 0 146 0; +#X connect 153 0 152 2; +#X connect 154 0 161 0; +#X connect 155 0 59 0; +#X connect 156 0 155 2; +#X connect 157 0 159 0; +#X connect 158 0 161 1; +#X connect 159 0 162 0; +#X connect 160 0 158 0; +#X connect 161 0 155 0; +#X connect 162 0 161 2; +#X connect 163 0 164 0; +#X connect 164 0 152 1; +#X connect 164 0 152 2; +#X connect 165 0 161 1; +#X connect 165 0 161 2; +#X connect 166 0 165 0; +#X connect 171 0 173 0; +#X connect 172 0 174 0; +#X connect 175 0 171 0; +#X connect 176 0 175 1; +#X connect 177 0 172 0; +#X connect 178 0 177 1; +#X connect 180 0 178 0; |