From c1b34d897f6962349581cf581f1de7dd548705fa Mon Sep 17 00:00:00 2001 From: "N.N." Date: Tue, 16 Jun 2009 03:47:58 +0000 Subject: use mutiplication of result svn path=/trunk/externals/pdp_opencv/; revision=11784 --- pdp_opencv_dft-help.pd | 219 ++++++++++++++++++++++++++----------------------- 1 file changed, 118 insertions(+), 101 deletions(-) (limited to 'pdp_opencv_dft-help.pd') diff --git a/pdp_opencv_dft-help.pd b/pdp_opencv_dft-help.pd index a9ce5d8..e4a86fe 100755 --- a/pdp_opencv_dft-help.pd +++ b/pdp_opencv_dft-help.pd @@ -19,49 +19,24 @@ #X text -145 -113 Camera input; #X text -188 -181 written by yves degoyon ( ydegoyon@gmail.com ); #X text 376 -143 input 1; -#X obj 447 -146 cnv 15 250 250 empty empty empty 20 12 0 14 -260097 +#X obj 440 -146 cnv 15 250 250 empty empty empty 20 12 0 14 -260097 -66577 0; -#X obj 480 -94 openpanel; -#X msg 461 -123 bang; -#X obj 460 -26 pdp_background; -#X obj 460 51 pdp_imgloader; -#X obj 460 -49 metro 40; -#X msg 479 -70 load \$1 0 0; -#X floatatom 555 -24 5 0 0 0 - - -; -#X text 507 -124 loading a pattern image; -#X text 455 -143 input 2 ( pattern ); -#X obj 55 186 pdp_opencv_dft; -#X obj 462 179 pdp_opencv_dft; +#X obj 473 -94 openpanel; +#X msg 454 -123 bang; +#X obj 453 -26 pdp_background; +#X obj 453 51 pdp_imgloader; +#X obj 453 -49 metro 40; +#X msg 472 -70 load \$1 0 0; +#X floatatom 548 -24 5 0 0 0 - - -; +#X text 500 -124 loading a pattern image; +#X text 448 -143 input 2 ( pattern ); #X obj -11 43 pdp_scale 320 240; -#X msg 99 156 bang; -#X msg 480 152 bang; -#X obj 191 390 pdp_xv; -#X obj 298 340 pdp_hue; -#X floatatom 298 367 5 0 0 0 - - -; -#X obj 460 81 pdp_xv; +#X obj 453 81 pdp_xv; #X obj -11 74 pdp_xv; -#X floatatom 325 254 5 0 0 0 - - -; -#X obj 189 352 pdp_xor; -#X text 425 435 <- average value of pixels; -#X text 445 461 the input image is close to the pattern; -#X obj 265 155 metro 1000; -#X obj 265 131 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X obj 222 251 loadbang; -#X obj 300 301 pdp_binary ----------------; -#X obj 123 301 pdp_binary --------------; -#X obj 264 105 loadbang; #X text -187 -211 pdp_opencv_dft : discrete fourier transform; #X text -187 -197 this can be used for pattern matching; -#X obj 460 21 pdp_scale 320 240; -#X obj 460 -2 pdp_convert image/YCrCb/*; -#X obj 328 460 route 1; -#X msg 380 460 bang; -#X floatatom 383 436 5 0 0 0 - - -; -#X obj 301 460 <; -#X obj 300 386 t f b; -#X obj 347 411 f; -#X text 445 448 when it's close to its minimum; +#X obj 453 21 pdp_scale 320 240; +#X obj 453 -2 pdp_convert image/YCrCb/*; #X obj 216 65 pdp_qt; #X obj 249 1 metro 40; #X msg 249 -27 bang; @@ -73,87 +48,129 @@ #X obj 330 28 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X obj 330 -54 loadbang; -#X text 259 -121 playing a video file; -#X text 506 -112 ( try chini.jpg ); -#X text 281 -108 ( try chini.mov ); -#X obj 314 435 f 1000; +#X text 267 -123 playing a video file; +#X text 499 -112 ( try chini.jpg ); +#X text 285 -110 ( try chini.mov ); #X msg 264 65 105; #X msg 292 65 bang; -#X msg 525 -49 1000; -#X obj 566 -51 s max; -#X obj 378 411 r max; -#X msg 284 252 60; -#X obj 80 356 pdp_xv; -#X text 369 254 Threshold the fft to eliminate noise; -#X text 369 266 60 is a godd value to eliminate noise; -#X text 369 277 and keep meaningful points; +#X obj 559 -51 s max; +#X msg 518 -49 0; +#X obj -189 109 cnv 15 880 150 empty empty empty 20 12 0 14 -258113 +-66577 0; +#X obj -53 212 pdp_opencv_dft; +#X obj 215 206 pdp_opencv_dft; +#X msg -25 178 bang; +#X msg 206 175 bang; +#X obj 114 164 metro 1000; +#X obj 114 140 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 113 114 loadbang; +#X text 302 185 <-- Calculate Discrete Fourier Transform of the pattern +; +#X text 324 196 pdp_opencv_dft is too greedy to be calculayed for every +; +#X text 322 209 frame so it is just processed when it receives a bang +; +#X obj -187 267 cnv 15 880 180 empty empty empty 20 12 0 14 -4034 -66577 +0; +#X obj 1 381 pdp_xv; +#X obj 108 331 pdp_hue; +#X floatatom 108 358 5 0 0 0 - - -; +#X floatatom 132 271 5 0 0 0 - - -; +#X obj 36 269 loadbang; +#X obj 110 292 pdp_binary ----------------; +#X obj -67 292 pdp_binary --------------; +#X floatatom 160 378 5 0 0 0 - - -; +#X msg 97 269 60; +#X obj -1 343 pdp_mul; +#X text 220 390 when it's close to its maximum; +#X text 310 307 60 is a good value to eliminate noise; +#X text 312 319 while keeping meaningful points; +#X text 286 295 <-- Threshold the fft to eliminate noise; +#X text 458 116 processing discrete fourier transform; +#X text 485 270 analyzing/comparing dft outputs; +#X text -115 343 multiply dfts -->; +#X text 201 377 <- average value of dft(i1) x dft(i2); +#X text 221 403 the input image the closest to the pattern; +#N canvas 10 73 450 300 cmax 0; +#X obj 70 144 route 1; +#X msg 122 144 bang; +#X obj 42 70 t f b; +#X obj 89 95 f; +#X obj 120 95 r max; +#X obj 43 144 >; +#X obj 56 119 f 0; +#X obj 45 44 inlet; +#X obj 73 180 outlet; +#X connect 0 0 1 0; +#X connect 1 0 3 0; +#X connect 1 0 6 0; +#X connect 2 0 3 1; +#X connect 2 0 5 0; +#X connect 2 1 6 0; +#X connect 3 0 6 1; +#X connect 4 0 6 1; +#X connect 5 0 0 0; +#X connect 6 0 5 1; +#X connect 6 0 8 0; +#X connect 7 0 2 0; +#X restore 109 377 pd cmax; #X connect 1 0 2 0; #X connect 2 0 4 0; #X connect 3 0 4 0; -#X connect 4 0 28 0; +#X connect 4 0 26 0; #X connect 5 0 4 0; #X connect 6 0 7 0; #X connect 7 0 10 0; #X connect 8 0 10 0; #X connect 9 0 10 0; -#X connect 10 0 28 0; +#X connect 10 0 26 0; #X connect 11 0 10 0; #X connect 12 0 11 0; #X connect 17 0 22 0; #X connect 18 0 17 0; #X connect 18 0 21 0; -#X connect 19 0 49 0; +#X connect 19 0 32 0; #X connect 20 0 27 0; -#X connect 20 0 34 0; +#X connect 20 0 52 0; #X connect 21 0 19 0; #X connect 22 0 20 0; -#X connect 22 0 73 0; +#X connect 22 0 49 0; #X connect 23 0 19 3; -#X connect 26 0 44 0; -#X connect 27 0 43 0; -#X connect 28 0 35 0; -#X connect 28 0 26 0; -#X connect 29 0 26 0; -#X connect 30 0 27 0; -#X connect 32 0 33 0; -#X connect 33 0 54 0; -#X connect 36 0 43 6; -#X connect 36 0 44 6; -#X connect 37 0 31 0; -#X connect 37 0 32 0; -#X connect 40 0 26 0; -#X connect 40 0 27 0; +#X connect 26 0 28 0; +#X connect 26 0 51 0; +#X connect 31 0 20 0; +#X connect 32 0 31 0; +#X connect 33 0 26 0; +#X connect 34 0 33 0; +#X connect 35 0 34 0; +#X connect 36 0 34 0; +#X connect 37 0 38 0; +#X connect 38 0 33 0; +#X connect 39 0 37 0; +#X connect 40 0 33 0; #X connect 41 0 40 0; -#X connect 42 0 76 0; -#X connect 43 0 37 1; -#X connect 44 0 37 0; -#X connect 44 0 77 0; -#X connect 45 0 41 0; -#X connect 48 0 20 0; +#X connect 42 0 41 0; +#X connect 42 0 35 0; +#X connect 46 0 33 1; +#X connect 47 0 33 0; #X connect 49 0 48 0; -#X connect 50 0 51 0; -#X connect 51 0 55 0; -#X connect 51 0 70 0; -#X connect 53 0 50 0; -#X connect 54 0 53 0; -#X connect 54 0 55 1; -#X connect 54 1 70 0; -#X connect 55 0 70 1; -#X connect 57 0 28 0; -#X connect 58 0 57 0; -#X connect 59 0 58 0; -#X connect 60 0 58 0; -#X connect 61 0 62 0; -#X connect 62 0 57 0; -#X connect 63 0 61 0; -#X connect 64 0 57 0; -#X connect 65 0 64 0; -#X connect 66 0 65 0; -#X connect 66 0 59 0; -#X connect 70 0 52 0; -#X connect 70 0 53 1; -#X connect 71 0 57 1; -#X connect 72 0 57 0; -#X connect 73 0 74 0; -#X connect 75 0 70 1; -#X connect 76 0 36 0; +#X connect 51 0 68 0; +#X connect 52 0 67 0; +#X connect 53 0 51 0; +#X connect 54 0 52 0; +#X connect 55 0 51 0; +#X connect 55 0 52 0; +#X connect 56 0 55 0; +#X connect 57 0 56 0; +#X connect 63 0 64 0; +#X connect 64 0 81 0; +#X connect 65 0 67 6; +#X connect 65 0 68 6; +#X connect 66 0 70 0; +#X connect 67 0 71 1; +#X connect 68 0 71 0; +#X connect 70 0 65 0; +#X connect 71 0 62 0; +#X connect 71 0 63 0; +#X connect 81 0 69 0; -- cgit v1.2.1