From 15b30fe20b401d079c2b3c6a8e77eee827813de3 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Tue, 17 Mar 2015 22:54:19 +0000 Subject: Gem 096ed6ef786b7a9d6e11a437ff8526619c89a1fd osx/x86_64 built 'master:096ed6ef786b7a9d6e11a437ff8526619c89a1fd' for osx/x86_64 --- Gem/examples/04.video/00.SimpleVideo.pd | 87 +++++++++++ Gem/examples/04.video/01.VideoPaint.pd | 123 +++++++++++++++ Gem/examples/04.video/02.VideoSphere.pd | 99 ++++++++++++ Gem/examples/04.video/03.movement_detection.pd | 87 +++++++++++ Gem/examples/04.video/04.videoRTX.pd | 101 +++++++++++++ Gem/examples/04.video/05.buffer_rtx.pd | 109 ++++++++++++++ Gem/examples/04.video/06.frame_diff_tracking.pd | 184 +++++++++++++++++++++++ Gem/examples/04.video/07.bg_subtract_tracking.pd | 184 +++++++++++++++++++++++ Gem/examples/04.video/08.color_classification.pd | 109 ++++++++++++++ 9 files changed, 1083 insertions(+) create mode 100644 Gem/examples/04.video/00.SimpleVideo.pd create mode 100644 Gem/examples/04.video/01.VideoPaint.pd create mode 100644 Gem/examples/04.video/02.VideoSphere.pd create mode 100644 Gem/examples/04.video/03.movement_detection.pd create mode 100644 Gem/examples/04.video/04.videoRTX.pd create mode 100644 Gem/examples/04.video/05.buffer_rtx.pd create mode 100644 Gem/examples/04.video/06.frame_diff_tracking.pd create mode 100644 Gem/examples/04.video/07.bg_subtract_tracking.pd create mode 100644 Gem/examples/04.video/08.color_classification.pd (limited to 'Gem/examples/04.video') diff --git a/Gem/examples/04.video/00.SimpleVideo.pd b/Gem/examples/04.video/00.SimpleVideo.pd new file mode 100644 index 0000000..7b59713 --- /dev/null +++ b/Gem/examples/04.video/00.SimpleVideo.pd @@ -0,0 +1,87 @@ +#N canvas 147 59 659 387 12; +#X obj 134 180 cnv 15 500 40 empty empty empty 20 12 0 14 -245500 -66577 +0; +#X obj 55 78 gemhead; +#X obj 55 299 rectangle 4 3; +#X obj 55 265 pix_texture; +#X obj 55 229 pix_video; +#X msg 142 190 dialog; +#X text 49 16 Click on the [create( message to see live video in Gem. +(You must have a camera attached before loading this patch).; +#X text 199 188 pop-up dialog to configure the camera (Windows and +Mac OS X); +#X msg 98 139 device 0; +#N canvas 162 133 570 420 serin 0; +#X obj 205 60 cnv 20 20 20 empty \$0-open-canvas 0 4 10 0 16 -233017 +-1 0; +#X obj 60 61 hradio 18 1 1 8 empty empty empty 0 -6 0 8 -225271 -1 +-1 0; +#X obj 60 13 inlet; +#X msg 200 202 label \$1; +#X obj 200 180 makefilename %d; +#X obj 59 108 int; +#X obj 59 337 outlet; +#X msg 201 306 set \$1 \$2; +#X obj 59 266 trigger bang anything; +#X obj 201 286 list; +#X obj 200 225 send \$0-open-canvas; +#X msg 60 210 device \$1; +#X connect 1 0 5 0; +#X connect 2 0 1 0; +#X connect 3 0 10 0; +#X connect 4 0 3 0; +#X connect 5 0 4 0; +#X connect 5 0 11 0; +#X connect 7 0 6 0; +#X connect 8 0 6 0; +#X connect 8 1 9 0; +#X connect 9 0 7 0; +#X connect 11 0 8 0; +#X coords 0 -1 1 1 165 20 1 60 60; +#X restore 98 115 pd serin; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 +-1 -1 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 502 304 pd gemwin; +#X connect 1 0 4 0; +#X connect 3 0 2 0; +#X connect 4 0 3 0; +#X connect 5 0 4 0; +#X connect 8 0 4 0; +#X connect 9 0 8 0; diff --git a/Gem/examples/04.video/01.VideoPaint.pd b/Gem/examples/04.video/01.VideoPaint.pd new file mode 100644 index 0000000..9c38a80 --- /dev/null +++ b/Gem/examples/04.video/01.VideoPaint.pd @@ -0,0 +1,123 @@ +#N canvas 38 374 800 574 10; +#X obj 50 130 gemhead; +#X obj 50 493 square; +#X obj 50 371 alpha; +#X obj 50 174 pix_video; +#X obj 50 267 pix_texture; +#X msg 136 456 4; +#X msg 167 456 2; +#X obj 50 392 depth; +#X obj 50 243 pix_threshold; +#X text 375 217 click on bang to; +#X text 187 90 click on these for fun; +#X text 388 69 turn on rendering before turning on the metro.; +#X text 437 86 If you don't \, it may crash/not work; +#X text 375 229 clear the screen; +#X obj 50 447 rotate; +#X obj 50 89 t b b; +#X floatatom 192 179 5 0 100 2 threshold - -; +#X obj 50 9 tgl 15 0 empty empty run 0 -6 0 10 -4034 -1 -1 0 1; +#X obj 195 144 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 10 -228856 +-1 -1 0 1; +#X obj 176 230 hsl 128 15 0 1 0 1 empty empty R 12 8 1 12 -261689 -1 +-1 12700 1; +#X obj 176 250 hsl 128 15 0 1 0 1 empty empty G 12 8 1 12 -225271 -1 +-1 12700 1; +#X obj 176 270 hsl 128 15 0 1 0 1 empty empty B 12 8 1 12 -228992 -1 +-1 12700 1; +#X obj 218 458 hsl 128 15 0.5 5 0 0 empty empty empty -2 -6 0 10 -232576 +-1 -1 0 1; +#X floatatom 219 481 5 0 0 0 - - -; +#X obj 83 40 hsl 128 15 10 127 0 1 empty empty empty -2 -6 0 10 -204786 +-1 -1 9900 1; +#X floatatom 93 63 5 0 0 0 - - -; +#X obj 50 62 metro; +#X obj 207 354 + 1; +#X obj 482 243 bng 15 250 50 0 empty empty empty 0 -6 0 10 -128992 +-1 -1; +#X msg 80 18 100; +#X obj 176 290 hsl 128 15 0 1 0 1 empty empty A 12 8 1 12 -195568 -1 +-1 12700 1; +#X obj 50 319 colorRGB 1 1 1 0.15; +#X obj 233 354 % 360; +#X obj 180 354 i; +#X floatatom 180 375 5 0 0 0 - - -; +#N canvas 87 154 247 179 Gem.init 0; +#X obj 118 46 loadbang; +#X obj 118 113 outlet; +#X msg 118 81 reset \, buffer 1; +#X connect 0 0 2 0; +#X connect 2 0 1 0; +#X restore 533 345 pd Gem.init; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 +-1 -1 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 503 362 pd gemwin; +#X connect 0 0 3 0; +#X connect 2 0 7 0; +#X connect 3 0 8 0; +#X connect 4 0 31 0; +#X connect 5 0 1 1; +#X connect 6 0 1 1; +#X connect 7 0 14 0; +#X connect 8 0 4 0; +#X connect 14 0 1 0; +#X connect 15 0 0 0; +#X connect 15 1 33 0; +#X connect 16 0 8 1; +#X connect 17 0 26 0; +#X connect 18 0 16 0; +#X connect 19 0 31 1; +#X connect 20 0 31 2; +#X connect 21 0 31 3; +#X connect 22 0 1 1; +#X connect 22 0 23 0; +#X connect 24 0 25 0; +#X connect 24 0 26 1; +#X connect 26 0 15 0; +#X connect 27 0 32 0; +#X connect 28 0 36 0; +#X connect 29 0 24 0; +#X connect 30 0 31 4; +#X connect 31 0 2 0; +#X connect 32 0 33 1; +#X connect 33 0 27 0; +#X connect 33 0 34 0; +#X connect 34 0 14 1; +#X connect 35 0 36 0; diff --git a/Gem/examples/04.video/02.VideoSphere.pd b/Gem/examples/04.video/02.VideoSphere.pd new file mode 100644 index 0000000..165b5c5 --- /dev/null +++ b/Gem/examples/04.video/02.VideoSphere.pd @@ -0,0 +1,99 @@ +#N canvas 84 483 743 466 10; +#X obj 57 215 pix_texture; +#X text 187 75 click on any of these; +#X text 40 25 texture live video onto a sphere; +#X obj 183 196 hsl 128 15 0 360 0 0 empty empty X 12 8 1 12 -233017 +-1 -1 0 1; +#X obj 183 216 hsl 128 15 0 360 0 0 empty empty Y 12 8 1 12 -233017 +-1 -1 0 1; +#X obj 183 236 hsl 128 15 0 360 0 0 empty empty Z 12 8 1 12 -233017 +-1 -1 0 1; +#X obj 57 255 rotateXYZ 0 0 0; +#X obj 183 266 hsl 128 15 0 1 0 1 empty empty R 12 8 1 12 -261689 -1 +-1 12700 1; +#X obj 183 286 hsl 128 15 0 1 0 1 empty empty G 12 8 1 12 -225271 -1 +-1 12700 1; +#X obj 183 306 hsl 128 15 0 1 0 1 empty empty B 12 8 1 12 -228992 -1 +-1 12700 1; +#X obj 57 325 colorRGB 1 1 1; +#X obj 57 70 gemhead; +#X obj 57 114 pix_video; +#X obj 57 163 pix_threshold; +#X floatatom 185 122 5 0 100 1 threshold - -; +#X obj 184 103 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 10 -228856 +-1 -1 0 1; +#X obj 183 348 hsl 128 15 0.5 5 0 1 empty empty empty -2 -6 0 10 -232576 +-1 -1 4233 1; +#X floatatom 185 367 5 0 0 1 size - -; +#X obj 183 388 hsl 128 15 5 50 0 1 empty empty empty -2 -6 0 10 -204800 +-1 -1 12700 1; +#X floatatom 185 407 5 0 0 1 segments - -; +#X obj 57 410 sphere; +#X msg 182 143 0.1 0.1 0.1; +#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 488 249 pd Gem.init; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 +-1 -1 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 458 266 pd gemwin; +#X connect 0 0 6 0; +#X connect 3 0 6 1; +#X connect 4 0 6 2; +#X connect 5 0 6 3; +#X connect 6 0 10 0; +#X connect 7 0 10 1; +#X connect 8 0 10 2; +#X connect 9 0 10 3; +#X connect 10 0 20 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 13 0 0 0; +#X connect 15 0 14 0; +#X connect 15 0 13 1; +#X connect 16 0 17 0; +#X connect 16 0 20 1; +#X connect 18 0 19 0; +#X connect 18 0 20 2; +#X connect 21 0 13 2; +#X connect 22 0 23 0; diff --git a/Gem/examples/04.video/03.movement_detection.pd b/Gem/examples/04.video/03.movement_detection.pd new file mode 100644 index 0000000..34efdef --- /dev/null +++ b/Gem/examples/04.video/03.movement_detection.pd @@ -0,0 +1,87 @@ +#N canvas 378 405 793 522 10; +#X floatatom 227 258 6 0 0 0 - - -; +#X floatatom 280 258 6 0 0 0 - - -; +#X floatatom 339 258 6 0 0 0 - - -; +#X obj 44 222 pix_blob 4; +#X obj 44 91 gemhead; +#X obj 44 150 pix_movement; +#X obj 44 364 pix_texture; +#X obj 44 401 square 4; +#X obj 201 383 gemhead; +#X obj 201 407 translateXYZ; +#X obj 201 434 cube 0.5; +#X obj 227 304 * 8; +#X obj 227 326 - 4; +#X obj 280 304 * 8; +#X obj 280 326 - 4; +#X obj 339 325 * 2; +#X obj 44 117 pix_video; +#X text 57 40 a very simple movement detector; +#X text 388 255 <<- calculate world-coordinates from normalized pix-coordinates +; +#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 511 359 pd Gem.init; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 +-1 -1 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 481 376 pd gemwin; +#X connect 0 0 11 0; +#X connect 1 0 13 0; +#X connect 2 0 15 0; +#X connect 3 0 6 0; +#X connect 3 1 0 0; +#X connect 3 2 1 0; +#X connect 3 3 2 0; +#X connect 4 0 16 0; +#X connect 5 0 3 0; +#X connect 6 0 7 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 11 0 12 0; +#X connect 12 0 9 1; +#X connect 13 0 14 0; +#X connect 14 0 9 2; +#X connect 15 0 9 3; +#X connect 16 0 5 0; +#X connect 19 0 20 0; diff --git a/Gem/examples/04.video/04.videoRTX.pd b/Gem/examples/04.video/04.videoRTX.pd new file mode 100644 index 0000000..6d71805 --- /dev/null +++ b/Gem/examples/04.video/04.videoRTX.pd @@ -0,0 +1,101 @@ +#N canvas 67 70 636 509 10; +#X obj 43 89 gemhead; +#X obj 190 380 pix_texture; +#X obj 43 380 pix_texture; +#X obj 190 298 pix_rtx; +#X msg 328 180 clear; +#X msg 327 270 mode 1; +#X msg 327 247 mode 0; +#X text 380 179 clear the buffer; +#X text 47 14 pix_rtx; +#X text 188 14 transform the x-axis into the t-axis and vice-versa +on the fly; +#X text 42 447 upper-picture; +#X text 198 448 lower-picture; +#X text 38 465 NO transformation; +#X text 198 467 RTX-tranformed; +#X text 46 24 =======; +#X text 380 248 lock time on x-axis; +#X text 376 272 lock x on x-axis; +#X text 495 272 (default); +#X msg 329 211 set; +#X text 363 213 fill the buffer with current frame; +#X obj 43 113 pix_video; +#X obj 190 401 translateXYZ 0 -2 0; +#X obj 43 184 separator; +#X obj 190 185 separator; +#X obj 43 401 translateXYZ 0 2 0; +#X obj 190 208 pix_separator; +#X obj 190 422 rectangle 3 1.5; +#X obj 43 422 rectangle 3 1.5; +#X msg 177 96 dimen 256 128; +#X msg 177 117 dimen 64 64; +#X text 281 101 pix-streams to be rtx-transformed must have the same +properties (width \, height \, colorspace) \;; +#X obj 43 149 trigger anything anything; +#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 454 405 pd Gem.init; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 +-1 -1 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 424 422 pd gemwin; +#X connect 0 0 20 0; +#X connect 1 0 21 0; +#X connect 2 0 24 0; +#X connect 3 0 1 0; +#X connect 4 0 3 0; +#X connect 5 0 3 0; +#X connect 6 0 3 0; +#X connect 18 0 3 0; +#X connect 20 0 31 0; +#X connect 21 0 26 0; +#X connect 22 0 2 0; +#X connect 23 0 25 0; +#X connect 24 0 27 0; +#X connect 25 0 3 0; +#X connect 28 0 20 0; +#X connect 29 0 20 0; +#X connect 31 0 22 0; +#X connect 31 1 23 0; +#X connect 32 0 33 0; diff --git a/Gem/examples/04.video/05.buffer_rtx.pd b/Gem/examples/04.video/05.buffer_rtx.pd new file mode 100644 index 0000000..4a29ad6 --- /dev/null +++ b/Gem/examples/04.video/05.buffer_rtx.pd @@ -0,0 +1,109 @@ +#N canvas 109 48 758 483 10; +#X obj 29 30 gemhead; +#X obj 29 163 pix_video; +#X obj 29 100 gemframebuffer; +#X obj 29 122 translateXYZ 0 0 -4; +#X obj 559 342 pix_texture; +#X obj 559 410 rectangle 4 3; +#X obj 559 315 pix_rtx; +#X obj 29 185 pix_texture; +#X obj 29 245 square 4; +#X obj 159 365 pix_snap; +#X obj 204 322 loadbang; +#X msg 69 325 snap; +#X obj 159 434 pix_buffer_write \$0-depot; +#X obj 43 56 loadbang; +#X obj 559 262 pix_buffer_read \$0-depot; +#X obj 559 172 gemhead 51; +#X floatatom 116 193 5 0 0 0 - - -; +#X obj 29 215 rotateXYZ 0 0 0; +#X msg 306 413 0; +#X obj 362 420 pix_buffer \$0-depot 1; +#X msg 700 241 0; +#X text 43 11 render rotated video into buffer; +#X text 528 148 feed the buffer into pix_rtx; +#X obj 119 171 hsl 128 15 0 360 0 0 empty empty empty -2 -8 0 10 -262144 +-1 -1 0 1; +#X obj 159 387 trigger anything bang; +#X text 117 155 rotate the video image; +#X text 111 280 this is how you write to a framebuffer (pix_buffer) +; +#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 547 62 pd Gem.init; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 +-1 -1 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 546 79 pd gemwin; +#X msg 204 344 256 256; +#X msg 43 76 dimen 256 256; +#X obj 69 305 t b a; +#X obj 559 212 t a b; +#X connect 0 0 2 0; +#X connect 1 0 7 0; +#X connect 2 0 3 0; +#X connect 3 0 1 0; +#X connect 4 0 5 0; +#X connect 6 0 4 0; +#X connect 7 0 17 0; +#X connect 8 0 31 0; +#X connect 9 0 24 0; +#X connect 10 0 29 0; +#X connect 11 0 9 0; +#X connect 13 0 30 0; +#X connect 14 0 6 0; +#X connect 15 0 32 0; +#X connect 16 0 17 3; +#X connect 17 0 8 0; +#X connect 18 0 12 1; +#X connect 20 0 14 1; +#X connect 23 0 16 0; +#X connect 24 0 12 0; +#X connect 24 1 18 0; +#X connect 27 0 28 0; +#X connect 29 0 9 2; +#X connect 30 0 2 0; +#X connect 31 0 11 0; +#X connect 31 1 9 0; +#X connect 32 0 14 0; +#X connect 32 1 20 0; diff --git a/Gem/examples/04.video/06.frame_diff_tracking.pd b/Gem/examples/04.video/06.frame_diff_tracking.pd new file mode 100644 index 0000000..3ade8da --- /dev/null +++ b/Gem/examples/04.video/06.frame_diff_tracking.pd @@ -0,0 +1,184 @@ +#N canvas 42 41 639 499 10; +#X obj 140 80 gemhead; +#X obj 140 271 pix_diff; +#X obj 23 397 pix_texture; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 +-1 -1 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 534 15 pd gemwin; +#X obj 23 442 rectangle 4 3; +#X obj 140 198 pix_separator; +#X obj 229 198 pix_separator; +#X obj 140 134 pix_grey; +#X obj 140 109 pix_video; +#X obj 140 346 pix_blob; +#N canvas 10 40 620 460 cursor 0; +#X obj 17 14 inlet; +#X obj 89 18 inlet; +#X obj 101 346 translateXYZ; +#X text 63 148 0.64; +#X text 37 151 1; +#X obj 23 63 t f f; +#X obj 37 176 -; +#X text 62 177 X-Range; +#X text 196 176 Y-Range; +#X obj 63 240 expr (8/$f1); +#X obj 33 241 -; +#X obj 51 267 *; +#X obj 29 95 max 0; +#X obj 71 95 min 10; +#X obj 59 132 f; +#X obj 33 131 f; +#X obj 52 293 - 4; +#X text 193 146 0.64; +#X text 167 149 1; +#X obj 153 61 t f f; +#X obj 167 174 -; +#X obj 193 238 expr (8/$f1); +#X obj 163 239 -; +#X obj 181 265 *; +#X obj 159 93 max 0; +#X obj 201 93 min 10; +#X obj 189 130 f; +#X obj 163 129 f; +#X text 188 171 comment; +#X obj 154 298 expr (-1*$f1)+4; +#X obj 293 27 inlet; +#X obj 94 320 gemhead 15; +#X obj 157 509 circle 0.1; +#X obj 17 423 separator; +#X obj 87 423 separator; +#X obj 17 484 rectangle 0.2 0.01; +#X obj 157 423 separator; +#X msg 185 478 draw line; +#X obj 185 457 loadbang; +#X obj 77 386 colorRGB 1 0 0 1; +#X obj 17 462 rectangle 0.01 0.2; +#X msg 256 478 width \$1; +#X obj 296 342 int; +#X obj 275 413 + 1; +#X obj 283 63 * 100; +#X connect 0 0 5 0; +#X connect 1 0 19 0; +#X connect 2 0 39 0; +#X connect 5 0 10 0; +#X connect 5 0 12 0; +#X connect 5 1 13 0; +#X connect 6 0 9 0; +#X connect 9 0 11 1; +#X connect 10 0 11 0; +#X connect 11 0 16 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 6 1; +#X connect 14 0 10 1; +#X connect 14 0 13 1; +#X connect 15 0 6 0; +#X connect 15 0 12 1; +#X connect 16 0 2 1; +#X connect 19 0 22 0; +#X connect 19 0 24 0; +#X connect 19 1 25 0; +#X connect 20 0 21 0; +#X connect 21 0 23 1; +#X connect 22 0 23 0; +#X connect 23 0 29 0; +#X connect 24 0 27 0; +#X connect 25 0 26 0; +#X connect 26 0 20 1; +#X connect 26 0 22 1; +#X connect 26 0 25 1; +#X connect 27 0 20 0; +#X connect 27 0 24 1; +#X connect 29 0 2 2; +#X connect 30 0 44 0; +#X connect 31 0 2 0; +#X connect 33 0 40 0; +#X connect 34 0 35 0; +#X connect 36 0 32 0; +#X connect 37 0 32 0; +#X connect 38 0 37 0; +#X connect 39 0 33 0; +#X connect 39 0 34 0; +#X connect 39 0 36 0; +#X connect 41 0 32 0; +#X connect 42 0 43 0; +#X connect 43 0 41 0; +#X connect 44 0 32 1; +#X connect 44 0 42 0; +#X restore 154 388 pd cursor; +#X obj 23 420 translateXYZ 0 0 -0.1; +#X obj 140 316 pix_threshold; +#X obj 180 294 hsl 128 15 0 1 0 1 empty empty threshold 8 8 0 10 -262130 +-1 -1 900 0; +#X obj 229 230 pix_delay 1; +#X text 28 12 This is an example of simple video tracking using the +difference between the current frame and the previous frame \, then +using blob detection.; +#X text 356 108 <-- get the video camera; +#X text 356 133 <-- convert to grey for easier tracking; +#X text 356 196 <-- make two copies of the frame; +#X obj 140 165 trigger anything anything; +#X text 356 229 <-- delay one copy by one frame; +#X text 356 305 <-- set the threshold to filter out; +#X text 381 281 difference between the two frames; +#X text 356 270 <-- find the absolute value of the; +#X text 381 316 small changes; +#X text 356 344 <-- track the (x \, y) coordinates and size; +#X text 380 357 of the "blob" of the difference; +#X text 356 384 <-- render a cursor using the (x \, y) and size; +#X text 6 460 render the video of the; +#X text 6 472 frame difference; +#X connect 0 0 8 0; +#X connect 1 0 12 0; +#X connect 2 0 11 0; +#X connect 5 0 1 0; +#X connect 6 0 14 0; +#X connect 7 0 19 0; +#X connect 8 0 7 0; +#X connect 9 1 10 0; +#X connect 9 2 10 1; +#X connect 9 3 10 2; +#X connect 11 0 4 0; +#X connect 12 0 9 0; +#X connect 12 0 2 0; +#X connect 13 0 12 1; +#X connect 14 0 1 1; +#X connect 19 0 6 0; +#X connect 19 1 5 0; diff --git a/Gem/examples/04.video/07.bg_subtract_tracking.pd b/Gem/examples/04.video/07.bg_subtract_tracking.pd new file mode 100644 index 0000000..7527569 --- /dev/null +++ b/Gem/examples/04.video/07.bg_subtract_tracking.pd @@ -0,0 +1,184 @@ +#N canvas 22 22 620 460 10; +#X obj 8 10 cnv 15 400 40 empty empty tracking_using_background_subtraction +20 12 0 16 -228992 -66577 0; +#X obj 179 223 pix_grey; +#X msg 204 251 reset; +#X obj 179 280 pix_background; +#X msg 272 259 \$1 \$1 \$1; +#X obj 123 316 pix_blob; +#N canvas 10 40 620 460 cursor 0; +#X obj 17 14 inlet; +#X obj 89 18 inlet; +#X obj 101 346 translateXYZ; +#X text 63 148 0.64; +#X text 37 151 1; +#X obj 23 63 t f f; +#X obj 37 176 -; +#X text 62 177 X-Range; +#X text 196 176 Y-Range; +#X obj 63 240 expr (8/$f1); +#X obj 33 241 -; +#X obj 51 267 *; +#X obj 29 95 max 0; +#X obj 71 95 min 10; +#X obj 59 132 f; +#X obj 33 131 f; +#X obj 52 293 - 4; +#X text 193 146 0.64; +#X text 167 149 1; +#X obj 153 61 t f f; +#X obj 167 174 -; +#X obj 193 238 expr (8/$f1); +#X obj 163 239 -; +#X obj 181 265 *; +#X obj 159 93 max 0; +#X obj 201 93 min 10; +#X obj 189 130 f; +#X obj 163 129 f; +#X text 188 171 comment; +#X obj 154 298 expr (-1*$f1)+4; +#X obj 293 27 inlet; +#X obj 283 63 * 10; +#X obj 94 320 gemhead 15; +#X obj 157 509 circle 0.1; +#X obj 17 423 separator; +#X obj 87 423 separator; +#X obj 17 484 rectangle 0.2 0.01; +#X obj 157 423 separator; +#X msg 185 478 draw line; +#X obj 185 457 loadbang; +#X obj 77 386 colorRGB 1 0 0 1; +#X obj 17 462 rectangle 0.01 0.2; +#X msg 256 478 width \$1; +#X obj 296 342 int; +#X obj 275 413 + 1; +#X connect 0 0 5 0; +#X connect 1 0 19 0; +#X connect 2 0 40 0; +#X connect 5 0 10 0; +#X connect 5 0 12 0; +#X connect 5 1 13 0; +#X connect 6 0 9 0; +#X connect 9 0 11 1; +#X connect 10 0 11 0; +#X connect 11 0 16 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 6 1; +#X connect 14 0 10 1; +#X connect 14 0 13 1; +#X connect 15 0 6 0; +#X connect 15 0 12 1; +#X connect 16 0 2 1; +#X connect 19 0 22 0; +#X connect 19 0 24 0; +#X connect 19 1 25 0; +#X connect 20 0 21 0; +#X connect 21 0 23 1; +#X connect 22 0 23 0; +#X connect 23 0 29 0; +#X connect 24 0 27 0; +#X connect 25 0 26 0; +#X connect 26 0 20 1; +#X connect 26 0 22 1; +#X connect 26 0 25 1; +#X connect 27 0 20 0; +#X connect 27 0 24 1; +#X connect 29 0 2 2; +#X connect 30 0 31 0; +#X connect 31 0 33 1; +#X connect 31 0 43 0; +#X connect 32 0 2 0; +#X connect 34 0 41 0; +#X connect 35 0 36 0; +#X connect 37 0 33 0; +#X connect 38 0 33 0; +#X connect 39 0 38 0; +#X connect 40 0 34 0; +#X connect 40 0 35 0; +#X connect 40 0 37 0; +#X connect 42 0 33 0; +#X connect 43 0 44 0; +#X connect 44 0 42 0; +#X restore 137 348 pd cursor; +#X obj 392 163 separator; +#X obj 392 184 pix_texture; +#X obj 392 205 square 4; +#X obj 378 368 pix_texture; +#X obj 179 200 separator; +#X obj 378 348 alpha; +#X obj 378 328 colourRGB 1 1 1 0.65; +#X obj 378 388 translateXYZ -2.4 -2.4 0; +#X obj 378 408 square 1.5; +#X obj 337 98 gemhead 10; +#X obj 337 119 pix_video; +#X text 376 309 Show pix_background output; +#X text 136 369 Show centroid/size; +#X text 368 257 Set noise threshold; +#X text 391 145 Render source video; +#X obj 275 237 hsl 128 15 0 1 0 1 empty empty empty -2 -8 0 10 -262130 +-1 -1 1200 1; +#X floatatom 331 259 5 0 0 0 - - -; +#X text 21 64 1) make sure no one is in the camera picture; +#X text 21 84 2) click the [reset( message; +#X text 21 104 3) set the noise threshold for best results; +#N canvas 340 107 682 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 +-1 -1 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 483 25 pd gemwin; +#X connect 1 0 3 0; +#X connect 2 0 3 0; +#X connect 3 0 5 0; +#X connect 3 0 13 0; +#X connect 4 0 3 1; +#X connect 5 1 6 0; +#X connect 5 2 6 1; +#X connect 5 3 6 2; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 10 0 14 0; +#X connect 11 0 1 0; +#X connect 12 0 10 0; +#X connect 13 0 12 0; +#X connect 14 0 15 0; +#X connect 16 0 17 0; +#X connect 17 0 7 0; +#X connect 17 0 11 0; +#X connect 22 0 23 0; +#X connect 22 0 4 0; diff --git a/Gem/examples/04.video/08.color_classification.pd b/Gem/examples/04.video/08.color_classification.pd new file mode 100644 index 0000000..dd933b2 --- /dev/null +++ b/Gem/examples/04.video/08.color_classification.pd @@ -0,0 +1,109 @@ +#N canvas 55 233 930 428 10; +#X obj 297 283 separator; +#X obj 297 304 pix_texture; +#X obj 96 130 gemhead 10; +#X obj 96 190 pix_video; +#X text 298 264 Render source video; +#X obj 297 344 square 4; +#X msg 166 153 device 2; +#N canvas 162 133 570 420 serin 0; +#X obj 205 60 cnv 20 20 20 empty \$0-open-canvas 2 4 10 0 16 -233017 +-1 0; +#X obj 60 61 hradio 18 1 1 8 empty empty empty 0 -6 0 8 -225271 -1 +-1 2; +#X obj 60 13 inlet; +#X msg 200 202 label \$1; +#X obj 200 180 makefilename %d; +#X obj 59 108 int; +#X obj 59 337 outlet; +#X msg 201 306 set \$1 \$2; +#X obj 59 266 trigger bang anything; +#X obj 201 286 list; +#X obj 200 225 send \$0-open-canvas; +#X msg 60 210 device \$1; +#X connect 1 0 5 0; +#X connect 2 0 1 0; +#X connect 3 0 10 0; +#X connect 4 0 3 0; +#X connect 5 0 4 0; +#X connect 5 0 11 0; +#X connect 7 0 6 0; +#X connect 8 0 6 0; +#X connect 8 1 9 0; +#X connect 9 0 7 0; +#X connect 11 0 8 0; +#X coords 0 -1 1 1 165 20 1 60 60; +#X restore 166 129 pd serin; +#X msg 321 153 colorspace RGBA; +#X msg 430 152 dialog; +#X obj 297 324 rotateXYZ 0 180 0; +#X obj 65 285 pix_texture; +#X obj 65 347 square 1.5; +#X obj 65 326 rotateXYZ 0 180 0; +#X obj 65 305 translateXYZ -2.4 -2.4 0.1; +#X text 72 264 Show color detection output; +#N canvas 249 346 1447 322 gemwin 0; +#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 +-1 -1 0 1; +#X obj 102 161 r \$0-gemstart; +#X obj 102 182 select 1 0; +#X msg 102 214 create \, 1; +#X msg 177 215 destroy; +#X obj 102 239 t a; +#X obj 318 54 inlet; +#X obj 318 255 gemwin; +#X obj 318 100 t a a; +#X obj 318 287 outlet; +#X obj 350 128 route create destroy; +#X obj 350 150 t b; +#X msg 350 172 1; +#X obj 390 150 t b; +#X msg 390 172 0; +#X obj 350 195 t f; +#X msg 350 219 set \$1; +#X text 118 122 rendering; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 4 0; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 8 1 10 0; +#X connect 10 0 11 0; +#X connect 10 1 13 0; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X coords 0 -1 1 1 85 40 1 100 100; +#X restore 388 14 pd gemwin; +#X text 6 21 Reliable colors are detected in an incoming video \, each +pixel being classified into 6 classes: Red \, Green \, Blue \, Yellow +\, Black \, and White. A light brown color is used to visualize the +pixels whose color could not be reliably classified. The detector is +high precision with moderate recall \, meaning it avoids false positives +at the expense of a smaller number of classified pixels.; +#X msg 228 153 dimen 320 240; +#X obj 65 240 pix_colorclassify; +#X text 7 385 Author: Ricardo Fabbri labmacambira.sf.net rfabbri at +gmail; +#X connect 0 0 1 0; +#X connect 1 0 10 0; +#X connect 2 0 3 0; +#X connect 3 0 0 0; +#X connect 3 0 19 0; +#X connect 6 0 3 0; +#X connect 7 0 6 0; +#X connect 8 0 3 0; +#X connect 9 0 3 0; +#X connect 10 0 5 0; +#X connect 11 0 14 0; +#X connect 13 0 12 0; +#X connect 14 0 13 0; +#X connect 18 0 3 0; +#X connect 19 0 11 0; -- cgit v1.2.1