From 5293ff039b263174c40bd7fe58741aca35a7a2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?llu=C3=ADs=20g=C3=B3mez=20i=20bigord=C3=A0?= Date: Thu, 21 May 2009 12:59:13 +0000 Subject: added tree help files more detailed svn path=/trunk/externals/pdp_opencv/; revision=11473 --- pdp_opencv_bgsubstract-help.pd | 83 +++++++++-- pdp_opencv_contours_boundingrect-help.pd | 156 ++++++++++++++++---- pdp_opencv_contours_convexity-help.pd | 236 +++++++++++++++++++------------ 3 files changed, 345 insertions(+), 130 deletions(-) diff --git a/pdp_opencv_bgsubstract-help.pd b/pdp_opencv_bgsubstract-help.pd index 435449b..a6bee64 100644 --- a/pdp_opencv_bgsubstract-help.pd +++ b/pdp_opencv_bgsubstract-help.pd @@ -1,13 +1,70 @@ -#N canvas 0 0 521 599 10; -#X msg 101 -138 open /dev/video0; -#X obj 101 57 pdp_v4l2; -#X msg 207 60 set; -#X obj 101 99 pdp_opencv_bgsubstract; -#X floatatom 273 102 5 0 0 0 - - -; -#X obj 108 174 pdp_xv; -#X text 317 103 threshold (default 13); -#X connect 0 0 1 0; -#X connect 1 0 3 0; -#X connect 2 0 3 0; -#X connect 3 0 5 0; -#X connect 4 0 3 1; +#N canvas 572 68 734 841 10; +#X obj 41 -94 cnv 15 621 223 empty empty empty 20 12 0 14 -260097 -66577 +0; +#X obj 91 63 pdp_1394L; +#X msg 148 -37 open /dev/dv1394/0; +#X obj 71 -62 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 73 -37 metro 40; +#X msg 191 29 norm PAL; +#X msg 161 -8 close; +#X obj 281 -56 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 281 -29 metro 40; +#X msg 371 -2 close; +#X obj 301 69 pdp_v4l; +#X msg 358 -34 open /dev/video0; +#X obj 482 -54 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 482 -27 metro 40; +#X msg 572 0 close; +#X msg 559 -32 open /dev/video0; +#X obj 502 71 pdp_v4l2; +#X obj 43 142 cnv 15 621 73 empty empty empty 20 12 0 14 -260801 -66577 +0; +#X obj 91 177 pdp_convert bitmap/rgb/*; +#X text 255 171 COLORMODEL CONVERSION :: allways remember pdp_opencv +only works in RGB colormodel; +#X obj 44 230 cnv 15 621 113 empty empty empty 20 12 0 14 -258113 -66577 +0; +#X msg 261 254 set; +#X floatatom 261 292 5 0 0 0 - - -; +#X obj 91 368 pdp_xv; +#X obj 91 314 pdp_opencv_bgsubstract; +#X text 71 -91 FIRST OF ALL SETUP YOUR CAMERA; +#X text 44 -326 pdp_opencv_bgsubstract :: A simple background substract +and binarization object.; +#X text 43 -234 This object takes an image as a background reference +and the compare each incomming frame with that. On the output you get +a bw image \, black pixels are considered as background and white poixels +as foreground.; +#X text 43 -281 It is useful if you want to detect objects that are +in front of an static background and you want to isolate the foreground +siluete of the foreground objects.; +#X text 43 -173 pdp_opencv_bgsubstract works comparing color values +of each pixel \, so it can fail if the foreground object has the same +color that the background \, and also if the light conditions or the +shadows changes since you SET the background image.; +#X text 304 253 SET THE BACKGROUNG REFERENCE; +#X text 304 290 threshold (default 13) to use when comparing pixel +colors; +#X connect 1 0 18 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 4 0 1 0; +#X connect 5 0 1 0; +#X connect 6 0 1 0; +#X connect 7 0 8 0; +#X connect 8 0 10 0; +#X connect 9 0 10 0; +#X connect 10 0 18 0; +#X connect 11 0 10 0; +#X connect 12 0 13 0; +#X connect 13 0 16 0; +#X connect 14 0 16 0; +#X connect 15 0 16 0; +#X connect 16 0 18 0; +#X connect 18 0 24 0; +#X connect 21 0 24 0; +#X connect 22 0 24 1; +#X connect 24 0 23 0; diff --git a/pdp_opencv_contours_boundingrect-help.pd b/pdp_opencv_contours_boundingrect-help.pd index 8e7f1ea..e583f9c 100644 --- a/pdp_opencv_contours_boundingrect-help.pd +++ b/pdp_opencv_contours_boundingrect-help.pd @@ -1,28 +1,128 @@ -#N canvas 0 25 1247 665 10; -#X obj 133 49 pdp_v4l2; -#X msg 201 14 open /dev/video0; -#X obj 133 290 pdp_xv; -#X floatatom 355 325 5 0 0 0 - - -; -#X floatatom 390 325 5 0 0 0 - - -; -#X floatatom 427 325 5 0 0 0 - - -; -#X floatatom 461 325 5 0 0 0 - - -; -#X obj 352 296 unpack 0 0 0 0 0; -#X obj 352 245 route 0 1 2 3 4; -#X floatatom 242 163 5 0 0 0 - - -; -#X floatatom 352 180 5 0 0 0 - - -; -#X obj 133 213 pdp_opencv_contours_boundingrect; -#X text 284 159 min area in pixels (default 1); -#X text 399 179 max area in pixels (default 76800); -#X text 505 325 Xorigin Yorigin Width Height; -#X text 412 263 For each contour detected; -#X connect 0 0 11 0; -#X connect 1 0 0 0; -#X connect 7 0 3 0; -#X connect 7 1 4 0; -#X connect 7 2 5 0; -#X connect 7 3 6 0; -#X connect 8 0 7 0; -#X connect 9 0 11 1; -#X connect 10 0 11 2; -#X connect 11 0 2 0; -#X connect 11 1 8 0; +#N canvas 363 68 1249 684 10; +#X obj 41 -82 cnv 15 621 223 empty empty empty 20 12 0 14 -260097 -66577 +0; +#X obj 91 75 pdp_1394L; +#X msg 148 -25 open /dev/dv1394/0; +#X obj 71 -50 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 73 -25 metro 40; +#X msg 191 41 norm PAL; +#X msg 161 4 close; +#X obj 281 -44 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 +1; +#X obj 281 -17 metro 40; +#X msg 371 10 close; +#X obj 301 81 pdp_v4l; +#X msg 358 -22 open /dev/video0; +#X obj 482 -42 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 482 -15 metro 40; +#X msg 563 4 close; +#X msg 559 -20 open /dev/video0; +#X obj 502 83 pdp_v4l2; +#X obj 43 154 cnv 15 621 73 empty empty empty 20 12 0 14 -260801 -66577 +0; +#X obj 91 189 pdp_convert bitmap/rgb/*; +#X text 255 183 COLORMODEL CONVERSION :: allways remember pdp_opencv +only works in RGB colormodel; +#X obj 47 337 cnv 15 621 313 empty empty empty 20 12 0 14 -258113 -66577 +0; +#X text 71 -79 FIRST OF ALL SETUP YOUR CAMERA; +#X floatatom 185 509 5 0 0 0 - - -; +#X floatatom 220 509 5 0 0 0 - - -; +#X floatatom 257 509 5 0 0 0 - - -; +#X floatatom 291 509 5 0 0 0 - - -; +#X obj 185 482 unpack 0 0 0 0 0; +#X obj 185 446 route 0 1 2 3 4; +#X floatatom 312 345 5 0 0 0 - - -; +#X floatatom 312 368 5 0 0 0 - - -; +#X obj 91 387 pdp_opencv_contours_boundingrect; +#X text 335 509 Xorigin Yorigin Width Height; +#X floatatom 205 565 5 0 0 0 - - -; +#X floatatom 240 565 5 0 0 0 - - -; +#X floatatom 277 565 5 0 0 0 - - -; +#X floatatom 311 565 5 0 0 0 - - -; +#X obj 202 536 unpack 0 0 0 0 0; +#X text 355 565 Xorigin Yorigin Width Height; +#X obj 91 663 pdp_xv; +#X obj 44 244 cnv 15 621 73 empty empty empty 20 12 0 14 -260801 -66577 +0; +#X msg 242 270 set; +#X floatatom 242 294 5 0 0 0 - - -; +#X obj 91 294 pdp_opencv_bgsubstract; +#X text 280 293 threshold (default 13) to use when comparing pixel +colors; +#X text 277 269 set the background reference; +#X text 42 -273 It is useful as a motion tracker if you have well issolated +silouets of the objects you want to track.; +#X text 347 346 minimal area in pixels to be detected (default 1); +#X text 346 370 maximal area in pixels to be detected (default 76800) +; +#X msg 568 59 format \$1; +#X obj 569 37 hradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1 +-1 0; +#X text 43 -307 pdp_opencv_contours_boundingrect :: Calculates up-right +bounding rectangle of all contours of a binary image.; +#X text 42 -234 This object considers a contour to be analyzed any +group of white pixels in a black background \, for this reason you +will find useful to use pdp_bgsubstract or pdp_threshold to obtain +a correct input for pdp_opencv_contours_boundingrect.; +#X text 43 -173 pdp_opencv_contours_boundingrect works detecting any +white areas in the input image \, it's important to set max/min values +of the areas you want to detect to filter non interesting noise or +areas \, also sometimes you will need to use pdp_opencv_morphology +to transform the contours of the shapes to be analyzed..; +#X floatatom 278 409 5 0 0 0 - - -; +#X text 317 410 Number of detected contours; +#X floatatom 230 623 5 0 0 0 - - -; +#X floatatom 265 623 5 0 0 0 - - -; +#X floatatom 302 623 5 0 0 0 - - -; +#X floatatom 336 623 5 0 0 0 - - -; +#X obj 227 594 unpack 0 0 0 0 0; +#X text 380 623 Xorigin Yorigin Width Height; +#X text 288 451 For each contour detected; +#X text 288 438 We have the contours sorted bottom to top and left +to right; +#X obj 103 465 print; +#X connect 1 0 18 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 4 0 1 0; +#X connect 5 0 1 0; +#X connect 6 0 1 0; +#X connect 7 0 8 0; +#X connect 8 0 10 0; +#X connect 9 0 10 0; +#X connect 10 0 18 0; +#X connect 11 0 10 0; +#X connect 12 0 13 0; +#X connect 13 0 16 0; +#X connect 14 0 16 0; +#X connect 15 0 16 0; +#X connect 16 0 18 0; +#X connect 18 0 42 0; +#X connect 26 0 22 0; +#X connect 26 1 23 0; +#X connect 26 2 24 0; +#X connect 26 3 25 0; +#X connect 27 0 26 0; +#X connect 27 1 36 0; +#X connect 27 2 59 0; +#X connect 28 0 30 1; +#X connect 29 0 30 2; +#X connect 30 0 38 0; +#X connect 30 1 27 0; +#X connect 30 1 63 0; +#X connect 36 0 32 0; +#X connect 36 1 33 0; +#X connect 36 2 34 0; +#X connect 36 3 35 0; +#X connect 40 0 42 0; +#X connect 41 0 42 1; +#X connect 42 0 30 0; +#X connect 48 0 16 0; +#X connect 49 0 48 0; +#X connect 59 0 55 0; +#X connect 59 1 56 0; +#X connect 59 2 57 0; +#X connect 59 3 58 0; diff --git a/pdp_opencv_contours_convexity-help.pd b/pdp_opencv_contours_convexity-help.pd index ed33908..59446e5 100644 --- a/pdp_opencv_contours_convexity-help.pd +++ b/pdp_opencv_contours_convexity-help.pd @@ -1,92 +1,150 @@ -#N canvas 0 25 1247 665 10; -#X obj 143 68 pdp_v4l2; -#X msg 211 33 open /dev/video0; -#X obj 143 414 pdp_xv; -#X floatatom -128 627 5 0 0 0 - - -; -#X floatatom -93 627 5 0 0 0 - - -; -#X floatatom -63 608 5 0 0 0 - - -; -#X floatatom -29 608 5 0 0 0 - - -; -#X obj 341 445 route 0 1 2 3 4; -#X floatatom 207 311 5 0 0 0 - - -; -#X floatatom 269 327 5 0 0 0 - - -; -#X obj 143 350 pdp_opencv_contours_convexity; -#X floatatom 308 120 5 0 0 0 - - -; -#X msg 235 81 set; -#X obj 143 116 pdp_opencv_bgsubstract; -#X text 247 309 minarea (default 1); -#X text 316 326 maxarea (dfault 76800); -#X obj -94 563 unpack 0 0 0 0 0 0; -#X floatatom 1 589 5 0 0 0 - - -; -#X floatatom 35 589 5 0 0 0 - - -; -#X text 451 446 For each convexity defect in our contour; -#X text -55 628 Start point (X -Y); -#X text 9 608 Depth point (X -Y); -#X text 74 590 End point (X -Y); -#X floatatom 180 627 5 0 0 0 - - -; -#X floatatom 215 627 5 0 0 0 - - -; -#X floatatom 245 608 5 0 0 0 - - -; -#X floatatom 279 608 5 0 0 0 - - -; -#X obj 214 563 unpack 0 0 0 0 0 0; -#X floatatom 309 589 5 0 0 0 - - -; -#X floatatom 343 589 5 0 0 0 - - -; -#X text 253 628 Start point (X -Y); -#X text 317 608 Depth point (X -Y); -#X text 382 590 End point (X -Y); -#X floatatom 498 634 5 0 0 0 - - -; -#X floatatom 533 634 5 0 0 0 - - -; -#X floatatom 563 615 5 0 0 0 - - -; -#X floatatom 597 615 5 0 0 0 - - -; -#X obj 532 570 unpack 0 0 0 0 0 0; -#X floatatom 627 596 5 0 0 0 - - -; -#X floatatom 661 596 5 0 0 0 - - -; -#X text 571 635 Start point (X -Y); -#X text 635 615 Depth point (X -Y); -#X text 700 597 End point (X -Y); -#X floatatom 806 634 5 0 0 0 - - -; -#X floatatom 841 634 5 0 0 0 - - -; -#X floatatom 871 615 5 0 0 0 - - -; -#X floatatom 905 615 5 0 0 0 - - -; -#X obj 840 570 unpack 0 0 0 0 0 0; -#X floatatom 935 596 5 0 0 0 - - -; -#X floatatom 969 596 5 0 0 0 - - -; -#X text 879 635 Start point (X -Y); -#X text 943 615 Depth point (X -Y); -#X text 1008 597 End point (X -Y); -#X floatatom 242 381 5 0 0 0 - - -; -#X text 238 396 number convexity defects; -#X connect 0 0 13 0; -#X connect 1 0 0 0; -#X connect 7 0 16 0; -#X connect 7 1 27 0; -#X connect 7 2 37 0; -#X connect 7 3 47 0; -#X connect 10 0 2 0; -#X connect 10 1 53 0; -#X connect 10 2 7 0; -#X connect 11 0 13 1; +#N canvas 6 51 714 937 10; +#X obj -514 173 cnv 15 621 223 empty empty empty 20 12 0 14 -260097 +-66577 0; +#X obj -464 330 pdp_1394L; +#X msg -407 230 open /dev/dv1394/0; +#X obj -484 205 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 +0 1; +#X obj -482 230 metro 40; +#X msg -364 296 norm PAL; +#X msg -394 259 close; +#X obj -274 211 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 +0 1; +#X obj -274 238 metro 40; +#X msg -184 265 close; +#X obj -254 336 pdp_v4l; +#X msg -197 233 open /dev/video0; +#X obj -73 213 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj -73 240 metro 40; +#X msg 8 259 close; +#X msg 4 235 open /dev/video0; +#X obj -53 338 pdp_v4l2; +#X obj -512 409 cnv 15 621 73 empty empty empty 20 12 0 14 -260801 +-66577 0; +#X obj -464 444 pdp_convert bitmap/rgb/*; +#X text -300 438 COLORMODEL CONVERSION :: allways remember pdp_opencv +only works in RGB colormodel; +#X obj -508 592 cnv 15 621 313 empty empty empty 20 12 0 14 -258113 +-66577 0; +#X text -484 176 FIRST OF ALL SETUP YOUR CAMERA; +#X obj -511 499 cnv 15 621 73 empty empty empty 20 12 0 14 -260801 +-66577 0; +#X msg -313 525 set; +#X floatatom -313 549 5 0 0 0 - - -; +#X obj -464 549 pdp_opencv_bgsubstract; +#X text -275 548 threshold (default 13) to use when comparing pixel +colors; +#X text -278 524 set the background reference; +#X msg 13 314 format \$1; +#X obj 14 292 hradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1 +-1 0; +#X text -513 43 This object considers a contour to be analyzed any +group of white pixels in a black background \, for this reason you +will find useful to use pdp_bgsubstract or pdp_threshold to obtain +a correct input for pdp_opencv_contours_boundingrect.; +#X floatatom -329 791 5 0 0 0 - - -; +#X floatatom -294 791 5 0 0 0 - - -; +#X floatatom -264 772 5 0 0 0 - - -; +#X floatatom -230 772 5 0 0 0 - - -; +#X obj -292 689 route 0 1 2 3 4; +#X obj -464 624 pdp_opencv_contours_convexity; +#X obj -295 727 unpack 0 0 0 0 0 0; +#X floatatom -200 753 5 0 0 0 - - -; +#X floatatom -166 753 5 0 0 0 - - -; +#X text -182 690 For each convexity defect in our contour; +#X text -256 792 Start point (X -Y); +#X text -192 772 Depth point (X -Y); +#X text -127 754 End point (X -Y); +#X floatatom -285 880 5 0 0 0 - - -; +#X floatatom -250 880 5 0 0 0 - - -; +#X floatatom -220 861 5 0 0 0 - - -; +#X floatatom -186 861 5 0 0 0 - - -; +#X obj -251 816 unpack 0 0 0 0 0 0; +#X floatatom -156 842 5 0 0 0 - - -; +#X floatatom -122 842 5 0 0 0 - - -; +#X text -212 881 Start point (X -Y); +#X text -148 861 Depth point (X -Y); +#X text -83 843 End point (X -Y); +#X floatatom -224 976 5 0 0 0 - - -; +#X floatatom -189 976 5 0 0 0 - - -; +#X floatatom -159 957 5 0 0 0 - - -; +#X floatatom -125 957 5 0 0 0 - - -; +#X obj -190 912 unpack 0 0 0 0 0 0; +#X floatatom -95 938 5 0 0 0 - - -; +#X floatatom -61 938 5 0 0 0 - - -; +#X text -151 977 Start point (X -Y); +#X text -87 957 Depth point (X -Y); +#X text -22 939 End point (X -Y); +#X floatatom -152 1050 5 0 0 0 - - -; +#X floatatom -117 1050 5 0 0 0 - - -; +#X floatatom -87 1031 5 0 0 0 - - -; +#X floatatom -53 1031 5 0 0 0 - - -; +#X obj -118 986 unpack 0 0 0 0 0 0; +#X floatatom -23 1012 5 0 0 0 - - -; +#X floatatom 11 1012 5 0 0 0 - - -; +#X text -79 1051 Start point (X -Y); +#X text -15 1031 Depth point (X -Y); +#X text 50 1013 End point (X -Y); +#X floatatom -378 654 5 0 0 0 - - -; +#X obj -465 925 pdp_xv; +#X text -342 658 number convexity defects in our detected contour; +#X text -512 7 pdp_opencv_contours_convexity :: Finds convexity defects +of the bigest contour of a binary image.; +#X text -512 104 pdp_opencv_contours_boundingrect works detecting the +bigest white area in the input image \, sometimes you will need to +use pdp_opencv_morphology to transform the contours of the shape to +be analyzed..; +#X connect 1 0 18 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 4 0 1 0; +#X connect 5 0 1 0; +#X connect 6 0 1 0; +#X connect 7 0 8 0; +#X connect 8 0 10 0; +#X connect 9 0 10 0; +#X connect 10 0 18 0; +#X connect 11 0 10 0; #X connect 12 0 13 0; -#X connect 13 0 10 0; -#X connect 16 0 3 0; -#X connect 16 1 4 0; -#X connect 16 2 5 0; -#X connect 16 3 6 0; -#X connect 16 4 17 0; -#X connect 16 5 18 0; -#X connect 27 0 23 0; -#X connect 27 1 24 0; -#X connect 27 2 25 0; -#X connect 27 3 26 0; -#X connect 27 4 28 0; -#X connect 27 5 29 0; -#X connect 37 0 33 0; -#X connect 37 1 34 0; -#X connect 37 2 35 0; -#X connect 37 3 36 0; +#X connect 13 0 16 0; +#X connect 14 0 16 0; +#X connect 15 0 16 0; +#X connect 16 0 18 0; +#X connect 18 0 25 0; +#X connect 23 0 25 0; +#X connect 24 0 25 1; +#X connect 25 0 36 0; +#X connect 28 0 16 0; +#X connect 29 0 28 0; +#X connect 35 0 37 0; +#X connect 35 1 48 0; +#X connect 35 2 58 0; +#X connect 35 3 68 0; +#X connect 36 0 75 0; +#X connect 36 1 74 0; +#X connect 36 2 35 0; +#X connect 37 0 31 0; +#X connect 37 1 32 0; +#X connect 37 2 33 0; +#X connect 37 3 34 0; #X connect 37 4 38 0; #X connect 37 5 39 0; -#X connect 47 0 43 0; -#X connect 47 1 44 0; -#X connect 47 2 45 0; -#X connect 47 3 46 0; -#X connect 47 4 48 0; -#X connect 47 5 49 0; +#X connect 48 0 44 0; +#X connect 48 1 45 0; +#X connect 48 2 46 0; +#X connect 48 3 47 0; +#X connect 48 4 49 0; +#X connect 48 5 50 0; +#X connect 58 0 54 0; +#X connect 58 1 55 0; +#X connect 58 2 56 0; +#X connect 58 3 57 0; +#X connect 58 4 59 0; +#X connect 58 5 60 0; +#X connect 68 0 64 0; +#X connect 68 1 65 0; +#X connect 68 2 66 0; +#X connect 68 3 67 0; +#X connect 68 4 69 0; +#X connect 68 5 70 0; -- cgit v1.2.1