From d49730bca5bd35af05638c7a3b00a697c6cd880a Mon Sep 17 00:00:00 2001 From: Antoine Villeret Date: Tue, 15 Jan 2013 16:16:20 +0000 Subject: improve help patch according to last commit svn path=/trunk/externals/pix_opencv/; revision=16870 --- pix_opencv_contours-help.pd | 124 +++++++++++++++++++++++++++++++------------- 1 file changed, 87 insertions(+), 37 deletions(-) diff --git a/pix_opencv_contours-help.pd b/pix_opencv_contours-help.pd index ffde46b..f213132 100644 --- a/pix_opencv_contours-help.pd +++ b/pix_opencv_contours-help.pd @@ -1,5 +1,5 @@ -#N canvas 968 140 794 706 10; -#X obj 472 35 cnv 15 300 400 empty empty empty 20 12 0 14 -228992 -66577 +#N canvas 944 268 794 766 10; +#X obj 472 35 cnv 15 300 500 empty empty empty 20 12 0 14 -228992 -66577 0; #X obj 11 56 cnv 15 450 200 empty empty empty 20 12 0 14 -233017 -66577 0; @@ -9,7 +9,7 @@ #X obj 11 267 cnv 15 450 30 empty empty empty 20 12 0 14 -195568 -66577 0; #X text 20 266 Arguments:; -#X text 12 386 Outlets:; +#X text 12 436 Outlets:; #X text 478 20 Example:; #X text 58 21 Class: pix_opencv; #X text 11 60 Description: finds contours; @@ -17,7 +17,7 @@ #X text 30 349 Inlet 1: message: epsilon [float]; #X obj 353 315 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 0; -#N canvas 1 104 450 300 gemwin 0; +#N canvas 1 122 450 300 gemwin 0; #X obj 132 156 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; @@ -41,18 +41,18 @@ #X text 30 329 Inlet 1: binarized image; #X text 354 314 Create window:; #X text 30 329 Inlet 1: binarized image; -#X text 20 448 info; -#X text 30 529 <2> +#X text 20 488 info; +#X text 30 569 <2> ; -#X text 25 397 Outlet 1: gemlist output; -#X text 25 417 Outlet 3: info output; +#X text 25 447 Outlet 1: gemlist output; +#X text 25 467 Outlet 3: info output; #X text 37 5 Synopsis: [pix_opencv_contours]; -#X text 21 518 contour (for each of them); +#X text 21 558 contour (for each of them); #X text 37 75 [pix_opencv_contours] finds contours in incomming image \, simplifies it according to the epsilon value and outputs contours with area greater than a threshold.; #X text 30 339 Inlet 1: message: area threshold [float]; -#X text 25 407 Outlet 2: contour \, convexhull and convexity defect +#X text 25 457 Outlet 2: contour \, convexhull and convexity defect output; #X text 37 126 contrary to [pix_opencv_contour_convexhull] \, [pix_opencv_contours] outputs all contours found not only the biggest.; @@ -62,14 +62,14 @@ and cenvexity defects; ; #X text 37 235 so this external replaces all old pix_opencv_contours_* ; -#X text 30 559 <2> +#X text 30 599 <2> ; -#X text 21 546 convexhull (for each contour); -#X text 20 577 convexixitydefects (for each contour); -#X text 30 589 <7> <7> depth; -#X text 26 649 by antoine villeret - 2012; -#X text 16 669 bug \, feedback \, comment... on the pd-list; +#X text 26 699 by antoine villeret - 2012; +#X text 16 719 bug \, feedback \, comment... on the pd-list; #X obj 476 193 cnv 15 280 80 empty empty empty 20 12 0 14 -4034 -66577 0; #X obj 541 151 pix_texture; @@ -86,7 +86,7 @@ point (2 floats)> depth; #X floatatom 617 197 5 0 0 0 - - -; #X msg 659 142 10; #X msg 625 141 2; -#N canvas 1177 234 474 845 draw_rotrect 0; +#N canvas 1175 234 474 845 draw_rotrect 0; #X obj 71 506 GEMglVertex2d; #X obj 71 586 GEMglVertex2d; #X obj 71 666 GEMglVertex2d; @@ -172,7 +172,7 @@ point (2 floats)> depth; #X restore 658 323 pd draw_rotrect; #X obj 487 240 pix_opencv_contours; #X obj 514 96 pix_image examples/dessin.tif; -#N canvas 969 295 674 695 drawdefects 0; +#N canvas 965 307 674 695 drawdefects 0; #X obj 191 301 gemhead; #X obj 134 217 loadbang; #X msg 134 238 0; @@ -261,24 +261,41 @@ point (2 floats)> depth; #X connect 19 0 15 0; #X connect 19 0 14 0; #X restore 542 294 pd drawdefects; -#N canvas 797 706 562 219 options 0; -#X obj 57 97 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 1 -; -#X msg 57 117 contours \$1; -#X obj 57 165 outlet; -#X obj 147 97 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 +#N canvas 118 725 1126 316 options 0; +#X obj 57 147 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 +1; +#X msg 57 167 contours \$1; +#X obj 57 215 outlet; +#X obj 147 147 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; -#X obj 247 97 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1 +#X obj 247 147 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; -#X msg 147 117 convexhulls \$1; -#X msg 247 117 convexitydefects \$1; -#X text 25 7 set hierarchy level (which contour to send out); -#X obj 24 33 nbx 5 14 -1 1e+37 0 1 empty empty empty 0 -8 0 10 -262144 +#X msg 147 167 convexhulls \$1; +#X msg 247 167 convexitydefects \$1; +#X text 25 57 set hierarchy level (which contour to send out); +#X obj 24 83 nbx 5 14 -1 1e+37 0 1 empty empty empty 0 -8 0 10 -262144 -1 -1 -1 256; -#X msg 24 50 hierarchy_level \$1; -#X text 71 75 send out different kind of infos (all on by default) +#X msg 24 100 hierarchy_level \$1; +#X text 71 125 send out different kind of infos (all on by default) :; -#X text 25 17 -1 for all contours (default); +#X text 25 67 -1 for all contours (default); +#X obj 564 89 table drawX 1000; +#X obj 564 109 table drawY 1000; +#X obj 564 129 table drawZ 1000; +#X msg 559 168 settab drawX drawY drawZ; +#X obj 558 200 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X msg 558 229 taboutput \$1; +#X text 544 5 to improve performance and avoid "stack overflow" (because +contours could a huge number of points) you can use table output instead +of list output; +#X text 550 71 first set some tables (they are dynamically resized) +; +#X text 550 151 tell it what tables to use; +#X text 582 200 enable disable table output (automatically enable when +ou set table); +#X text 569 256 see [pd draw_contour_gemvertexbuffer] for an example +of drawing contours; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 3 0 5 0; @@ -287,6 +304,9 @@ point (2 floats)> depth; #X connect 6 0 2 0; #X connect 8 0 9 0; #X connect 9 0 2 0; +#X connect 15 0 2 0; +#X connect 16 0 17 0; +#X connect 17 0 2 0; #X restore 674 213 pd options; #X text 489 347 color legend :; #X text 522 364 yellow = bounding box; @@ -294,7 +314,7 @@ point (2 floats)> depth; #X text 534 385 blue = convexhull; #X text 534 397 pink = convexhull edge with defects; #X text 540 409 red = farthest point from convexhull; -#N canvas 1 86 632 734 draw_contours 0; +#N canvas 1 110 632 734 draw_contours 0; #X obj 178 132 list split 2; #X obj 170 593 GEMglEnd; #X obj 300 590 GEMglVertex2d; @@ -435,8 +455,8 @@ point (2 floats)> depth; #X text -181 127 numbers of values for each contour; #X obj 111 194 list prepend set; #X obj 111 214 list trim; -#X msg -120 262 0.827996 0.211303 0.774474 0.147076 0.80827 0.0970073 -0.861792 0.161234; +#X msg -120 262 0.681584 0.808552 0.679688 0.789583 0.704353 0.785198 +0.70625 0.804167; #X text -123 245 rotrect corners coordinates; #X text 160 424 length of contour (in pixels); #X connect 6 0 16 0; @@ -468,10 +488,40 @@ point (2 floats)> depth; #X connect 41 0 42 0; #X connect 42 0 43 0; #X restore 675 294 pd info; -#X text 29 458 20 20 0 0 0 0; +#N canvas 870 312 596 300 draw_contour_gemvertexbuffer 0; +#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 87 t a b; +#X obj 136 247 gemvertexbuffer; +#X obj 135 -9 gemhead 1000; +#X obj 135 17 alpha 0; +#X msg 152 134 posX drawX \, posY drawY \, colorG drawZ \, colorA drawZ +; +#X msg 175 193 draw line; +#X connect 0 0 8 0; +#X connect 1 0 3 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 3 1 7 0; +#X connect 5 0 6 0; +#X connect 6 0 2 0; +#X connect 7 0 4 0; +#X connect 8 0 4 0; +#X restore 539 443 pd draw_contour_gemvertexbuffer; +#X obj 554 32 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X text 30 369 Inlet 1: message: contours <0|1>; +#X text 30 379 Inlet 1: message: convexhull <0|1>; +#X text 30 389 Inlet 1: message: convexitydefects <0|1>; +#X text 30 399 Inlet 1: message: settab tabname1 tabname2 tabname3 +; +#X text 30 409 Inlet 1: message: taboutput <0|1>; +#X text 30 359 Inlet 1: message: hierarchy_level [float]; #X connect 13 0 14 0; #X connect 14 0 13 0; #X connect 39 0 47 0; @@ -485,7 +535,6 @@ size (2 floats)> #X connect 46 0 52 0; #X connect 46 0 51 0; #X connect 48 0 41 0; -#X connect 48 1 39 0; #X connect 49 0 54 0; #X connect 50 0 49 0; #X connect 51 0 50 0; @@ -496,3 +545,4 @@ size (2 floats)> #X connect 54 2 65 0; #X connect 55 0 48 0; #X connect 57 0 54 0; +#X connect 68 0 43 0; -- cgit v1.2.1