diff options
author | N.N. <sevyves@users.sourceforge.net> | 2009-09-03 19:12:57 +0000 |
---|---|---|
committer | N.N. <sevyves@users.sourceforge.net> | 2009-09-03 19:12:57 +0000 |
commit | 8de84ee6ee3fdccd6da261e6c8761eec908a52bc (patch) | |
tree | 22cbdf8f3579f55cbb73ae539d1ab69c39dc2edf | |
parent | f1531ff7bb1b23443b3b8492ae48b1e43ce451fa (diff) |
added pix_opencv_hough_circles
svn path=/trunk/externals/pix_opencv/; revision=12230
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | pix_opencv_athreshold-help.pd | 38 | ||||
-rw-r--r-- | pix_opencv_bgstats-help.pd | 8 | ||||
-rw-r--r-- | pix_opencv_bgsubstract-help.pd | 26 | ||||
-rwxr-xr-x | pix_opencv_camshift-help.pd | 2 | ||||
-rw-r--r-- | pix_opencv_contours_boundingrect-help.pd | 2 | ||||
-rw-r--r-- | pix_opencv_contours_convexity-help.pd | 80 | ||||
-rwxr-xr-x | pix_opencv_dft-help.pd | 16 | ||||
-rw-r--r-- | pix_opencv_distrans-help.pd | 2 | ||||
-rw-r--r-- | pix_opencv_edge-help.pd | 2 | ||||
-rwxr-xr-x | pix_opencv_floodfill-help.pd | 90 | ||||
-rw-r--r-- | pix_opencv_haarcascade-help.pd | 78 | ||||
-rwxr-xr-x | pix_opencv_hist_compare-help.pd | 32 | ||||
-rwxr-xr-x | pix_opencv_hough_circles-help.pd | 145 | ||||
-rwxr-xr-x | pix_opencv_hough_circles.cc | 314 | ||||
-rwxr-xr-x | pix_opencv_hough_circles.h | 102 | ||||
-rwxr-xr-x | pix_opencv_hu_compare-help.pd | 97 | ||||
-rwxr-xr-x | pix_opencv_knear-help.pd | 2 | ||||
-rw-r--r-- | pix_opencv_laplace-help.pd | 28 | ||||
-rwxr-xr-x | pix_opencv_lk-help.pd | 106 | ||||
-rw-r--r-- | pix_opencv_morphology-help.pd | 32 | ||||
-rw-r--r-- | pix_opencv_motempl-help.pd | 84 | ||||
-rwxr-xr-x | pix_opencv_pgh_compare-help.pd | 91 | ||||
-rwxr-xr-x | pix_opencv_threshold-help.pd | 68 |
24 files changed, 1041 insertions, 406 deletions
@@ -35,7 +35,7 @@ endif .SUFFIXES = $(EXTENSION) -SOURCES = pix_opencv_edge.cc pix_opencv_laplace.cc pix_opencv_morphology.cc pix_opencv_distrans.cc pix_opencv_motempl.cc pix_opencv_haarcascade.cc pix_opencv_contours_boundingrect.cc pix_opencv_bgsubstract.cc pix_opencv_contours_convexity.cc pix_opencv_dft.cc pix_opencv_lk.cc pix_opencv_hist_compare.cc pix_opencv_knear.cc pix_opencv_threshold.cc pix_opencv_floodfill.cc pix_opencv_athreshold.cc pix_opencv_bgstats.cc pix_opencv_camshift.cc pix_opencv_hu_compare.cc pix_opencv_pgh_compare.cc +SOURCES = pix_opencv_edge.cc pix_opencv_laplace.cc pix_opencv_morphology.cc pix_opencv_distrans.cc pix_opencv_motempl.cc pix_opencv_haarcascade.cc pix_opencv_contours_boundingrect.cc pix_opencv_bgsubstract.cc pix_opencv_contours_convexity.cc pix_opencv_dft.cc pix_opencv_lk.cc pix_opencv_hist_compare.cc pix_opencv_knear.cc pix_opencv_threshold.cc pix_opencv_floodfill.cc pix_opencv_athreshold.cc pix_opencv_bgstats.cc pix_opencv_camshift.cc pix_opencv_hu_compare.cc pix_opencv_pgh_compare.cc pix_opencv_hough_circles.cc all: $(SOURCES:.cc=.$(EXTENSION)) diff --git a/pix_opencv_athreshold-help.pd b/pix_opencv_athreshold-help.pd index 7e40898..48dcb6c 100755 --- a/pix_opencv_athreshold-help.pd +++ b/pix_opencv_athreshold-help.pd @@ -1,4 +1,4 @@ -#N canvas 355 82 925 684 10; +#N canvas -29 149 925 684 10; #X obj 277 -24 gemhead; #X obj 183 555 pix_texture; #X obj 183 574 square 2; @@ -20,7 +20,7 @@ #X obj 162 241 gemwin; #X msg 161 188 create \, 1; #X msg 237 189 destroy; -#X msg 283 161 frame 15; +#X msg 283 161 frame 5; #X obj 164 126 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -59,7 +59,6 @@ #X obj 178 299 cnv 15 600 250 empty empty empty 20 12 0 14 -4034 -66577 0; #X text 562 202 Create window and render; -#X msg 187 58 colorspace Grey; #X obj 183 508 pix_opencv_athreshold; #X floatatom 360 498 5 0 0 0 - - -; #X msg 298 405 mode \$1; @@ -86,6 +85,10 @@ filter only the pixels above or below that threshold \, depending on the mode BINARY or BINARY:INVERTED; #X text 400 40 pix_opencv_threshold : adaptive thresholding; +#X msg 271 18 colorspace RGBA; +#X msg 376 18 colorspace RGB; +#X msg 480 18 colorspace Grey; +#X obj 277 -2 loadbang; #X connect 0 0 19 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -107,16 +110,19 @@ the mode BINARY or BINARY:INVERTED; #X connect 19 2 15 0; #X connect 20 0 19 0; #X connect 21 0 20 0; -#X connect 22 0 26 0; -#X connect 25 0 19 0; -#X connect 26 0 1 0; -#X connect 27 0 26 2; -#X connect 28 0 26 0; -#X connect 29 0 26 1; -#X connect 31 0 28 0; -#X connect 32 0 28 0; -#X connect 38 0 40 0; -#X connect 39 0 40 0; -#X connect 40 0 26 0; -#X connect 44 0 26 0; -#X connect 45 0 44 0; +#X connect 22 0 25 0; +#X connect 25 0 1 0; +#X connect 26 0 25 2; +#X connect 27 0 25 0; +#X connect 28 0 25 1; +#X connect 30 0 27 0; +#X connect 31 0 27 0; +#X connect 37 0 39 0; +#X connect 38 0 39 0; +#X connect 39 0 25 0; +#X connect 43 0 25 0; +#X connect 44 0 43 0; +#X connect 49 0 19 0; +#X connect 50 0 19 0; +#X connect 51 0 19 0; +#X connect 52 0 49 0; diff --git a/pix_opencv_bgstats-help.pd b/pix_opencv_bgstats-help.pd index 6b35001..ba8a518 100644 --- a/pix_opencv_bgstats-help.pd +++ b/pix_opencv_bgstats-help.pd @@ -1,4 +1,4 @@ -#N canvas 153 45 1070 675 10; +#N canvas -60 46 1070 675 10; #X obj 407 -28 gemhead; #X obj 365 487 pix_texture; #X obj 365 515 square 2; @@ -20,7 +20,7 @@ #X obj 192 276 gemwin; #X msg 191 223 create \, 1; #X msg 267 224 destroy; -#X msg 313 196 frame 15; +#X msg 313 196 frame 5; #X obj 194 186 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -85,6 +85,8 @@ the foreground ( default : 0.1 seconds ); #X text 512 348 ( default : 2 ); #X msg 561 47 colorspace RGBA; #X obj 584 20 loadbang; +#X msg 678 45 colorspace RGB; +#X msg 778 45 colorspace Grey; #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -119,3 +121,5 @@ the foreground ( default : 0.1 seconds ); #X connect 37 0 28 0; #X connect 44 0 21 0; #X connect 45 0 44 0; +#X connect 46 0 21 0; +#X connect 47 0 21 0; diff --git a/pix_opencv_bgsubstract-help.pd b/pix_opencv_bgsubstract-help.pd index cfdfd55..b3ed1bc 100644 --- a/pix_opencv_bgsubstract-help.pd +++ b/pix_opencv_bgsubstract-help.pd @@ -1,4 +1,4 @@ -#N canvas 515 94 691 547 10; +#N canvas -7 146 691 547 10; #X obj 618 -33 gemhead; #X obj 364 374 pix_texture; #X obj 364 402 square 2; @@ -20,7 +20,7 @@ #X obj 192 276 gemwin; #X msg 191 223 create \, 1; #X msg 267 224 destroy; -#X msg 313 196 frame 15; +#X msg 313 196 frame 5; #X obj 194 186 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -51,14 +51,13 @@ #X floatatom 613 151 5 0 0 3 height - -; #X obj 568 109 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 -1 -1; -#X floatatom 550 74 5 0 10000 1 frame# - -; +#X floatatom 572 92 5 0 10000 1 frame# - -; #X obj 511 -37 openpanel; #X msg 511 -17 open \$1; #X obj 499 92 pix_film; #X msg 517 26 auto \$1; #X obj 517 8 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; -#X msg 528 50 colorspace Grey; #X obj 364 259 translateXYZ 4 0 0; #X floatatom 529 321 5 0 0 0 - - -; #X obj 364 322 pix_opencv_bgsubstract; @@ -78,6 +77,10 @@ silhouete of the foreground objects.; 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 msg 561 47 colorspace RGBA; +#X obj 584 20 loadbang; +#X msg 678 45 colorspace RGB; +#X msg 778 45 colorspace Grey; #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -85,7 +88,7 @@ shadows changes since you SET the background image.; #X connect 7 0 8 0; #X connect 9 0 7 0; #X connect 9 0 10 0; -#X connect 10 0 25 0; +#X connect 10 0 24 0; #X connect 12 0 19 0; #X connect 13 0 14 0; #X connect 13 1 15 0; @@ -99,8 +102,11 @@ shadows changes since you SET the background image.; #X connect 21 2 17 0; #X connect 22 0 21 0; #X connect 23 0 22 0; -#X connect 24 0 21 0; -#X connect 25 0 27 0; -#X connect 26 0 27 1; -#X connect 27 0 1 0; -#X connect 28 0 27 0; +#X connect 24 0 26 0; +#X connect 25 0 26 1; +#X connect 26 0 1 0; +#X connect 27 0 26 0; +#X connect 34 0 21 0; +#X connect 35 0 34 0; +#X connect 36 0 21 0; +#X connect 37 0 21 0; diff --git a/pix_opencv_camshift-help.pd b/pix_opencv_camshift-help.pd index 1c65fa7..eb89ecd 100755 --- a/pix_opencv_camshift-help.pd +++ b/pix_opencv_camshift-help.pd @@ -17,7 +17,7 @@ #X msg 62 93 reset; #X obj 49 135 outlet; #X msg 107 89 dimen 320 240; -#X msg 202 89 frame 15; +#X msg 202 89 frame 5; #X obj 107 51 t b b b; #X connect 0 0 5 0; #X connect 1 0 2 0; diff --git a/pix_opencv_contours_boundingrect-help.pd b/pix_opencv_contours_boundingrect-help.pd index eadc72e..bb9d32d 100644 --- a/pix_opencv_contours_boundingrect-help.pd +++ b/pix_opencv_contours_boundingrect-help.pd @@ -20,7 +20,7 @@ #X obj 161 230 gemwin; #X msg 160 177 create \, 1; #X msg 236 178 destroy; -#X msg 282 150 frame 15; +#X msg 282 150 frame 5; #X obj 163 140 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; diff --git a/pix_opencv_contours_convexity-help.pd b/pix_opencv_contours_convexity-help.pd index b3fc71b..3d06f75 100644 --- a/pix_opencv_contours_convexity-help.pd +++ b/pix_opencv_contours_convexity-help.pd @@ -1,4 +1,4 @@ -#N canvas -23 38 1018 740 10; +#N canvas 0 38 1018 740 10; #X obj 264 18 gemhead; #X obj 195 378 pix_texture; #X obj 195 406 square 2; @@ -20,7 +20,7 @@ #X obj 160 260 gemwin; #X msg 159 207 create \, 1; #X msg 235 208 destroy; -#X msg 281 180 frame 15; +#X msg 281 180 frame 5; #X obj 162 170 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -56,7 +56,7 @@ #X msg 342 -13 open \$1; #X obj 330 96 pix_film; #X msg 348 30 auto \$1; -#X obj 348 12 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 +#X obj 348 12 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 195 263 translateXYZ 4 0 0; #X obj 209 114 pix_invert; @@ -64,7 +64,6 @@ #X floatatom 256 146 5 0 0 0 - - -; #X msg 272 195 0.33; #X obj 310 196 loadbang; -#X msg 359 54 colorspace RGBA; #X obj 195 328 pix_opencv_contours_convexity; #X floatatom 286 614 5 0 0 0 - - -; #X floatatom 321 614 5 0 0 0 - - -; @@ -120,6 +119,10 @@ pix_opencv_contours_boundingrect.; bigest white area in the input image \, sometimes you will need to use pix_opencv_morphology to transform the contours of the shape to be analyzed..; +#X msg 390 54 colorspace RGBA; +#X obj 413 27 loadbang; +#X msg 497 55 colorspace RGB; +#X msg 596 55 colorspace Grey; #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -141,41 +144,44 @@ be analyzed..; #X connect 21 2 17 0; #X connect 22 0 21 0; #X connect 23 0 22 0; -#X connect 24 0 31 0; +#X connect 24 0 30 0; #X connect 25 0 26 0; #X connect 26 0 9 0; #X connect 27 0 26 1; #X connect 28 0 27 0; #X connect 29 0 28 0; -#X connect 30 0 21 0; -#X connect 31 0 1 0; -#X connect 31 1 74 0; -#X connect 31 2 36 0; -#X connect 36 0 37 0; -#X connect 36 1 48 0; -#X connect 36 2 58 0; -#X connect 36 3 68 0; -#X connect 37 0 32 0; -#X connect 37 1 33 0; -#X connect 37 2 34 0; -#X connect 37 3 35 0; -#X connect 37 4 38 0; -#X connect 37 5 39 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; +#X connect 30 0 1 0; +#X connect 30 1 73 0; +#X connect 30 2 35 0; +#X connect 35 0 36 0; +#X connect 35 1 47 0; +#X connect 35 2 57 0; +#X connect 35 3 67 0; +#X connect 36 0 31 0; +#X connect 36 1 32 0; +#X connect 36 2 33 0; +#X connect 36 3 34 0; +#X connect 36 4 37 0; +#X connect 36 5 38 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 57 0 53 0; +#X connect 57 1 54 0; +#X connect 57 2 55 0; +#X connect 57 3 56 0; +#X connect 57 4 58 0; +#X connect 57 5 59 0; +#X connect 67 0 63 0; +#X connect 67 1 64 0; +#X connect 67 2 65 0; +#X connect 67 3 66 0; +#X connect 67 4 68 0; +#X connect 67 5 69 0; +#X connect 78 0 21 0; +#X connect 79 0 78 0; +#X connect 80 0 21 0; +#X connect 81 0 21 0; diff --git a/pix_opencv_dft-help.pd b/pix_opencv_dft-help.pd index 3096cc0..c302d11 100755 --- a/pix_opencv_dft-help.pd +++ b/pix_opencv_dft-help.pd @@ -20,7 +20,7 @@ #X obj 160 260 gemwin; #X msg 159 207 create \, 1; #X msg 235 208 destroy; -#X msg 281 180 frame 15; +#X msg 281 180 frame 5; #X obj 162 170 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -51,7 +51,7 @@ #X floatatom 613 151 5 0 0 3 height - -; #X obj 568 109 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 -1 -1; -#X floatatom 550 74 5 0 10000 1 frame# - -; +#X floatatom 561 89 5 0 10000 1 frame# - -; #X obj 511 -37 openpanel; #X msg 511 -17 open \$1; #X obj 499 92 pix_film; @@ -74,8 +74,10 @@ ; #X text 592 306 frame so it is just processed when it receives a bang ; -#X obj 580 26 loadbang; -#X msg 528 50 colorspace RGBA; +#X msg 579 28 colorspace RGBA; +#X obj 602 1 loadbang; +#X msg 685 28 colorspace RGB; +#X msg 784 29 colorspace Grey; #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -103,5 +105,7 @@ #X connect 30 0 32 0; #X connect 31 0 30 0; #X connect 32 0 25 0; -#X connect 36 0 37 0; -#X connect 37 0 21 0; +#X connect 36 0 21 0; +#X connect 37 0 36 0; +#X connect 38 0 21 0; +#X connect 39 0 21 0; diff --git a/pix_opencv_distrans-help.pd b/pix_opencv_distrans-help.pd index 6498fb4..84bc754 100644 --- a/pix_opencv_distrans-help.pd +++ b/pix_opencv_distrans-help.pd @@ -20,7 +20,7 @@ #X obj 160 260 gemwin; #X msg 159 207 create \, 1; #X msg 235 208 destroy; -#X msg 281 180 frame 15; +#X msg 281 180 frame 5; #X obj 162 170 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; diff --git a/pix_opencv_edge-help.pd b/pix_opencv_edge-help.pd index 3598e54..e28c9f9 100644 --- a/pix_opencv_edge-help.pd +++ b/pix_opencv_edge-help.pd @@ -20,7 +20,7 @@ #X obj 160 260 gemwin; #X msg 159 207 create \, 1; #X msg 235 208 destroy; -#X msg 281 180 frame 15; +#X msg 281 180 frame 5; #X obj 162 170 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; diff --git a/pix_opencv_floodfill-help.pd b/pix_opencv_floodfill-help.pd index 356ce1c..e6aca60 100755 --- a/pix_opencv_floodfill-help.pd +++ b/pix_opencv_floodfill-help.pd @@ -14,7 +14,7 @@ #X msg 62 93 reset; #X obj 49 135 outlet; #X msg 107 89 dimen 320 240; -#X msg 202 89 frame 15; +#X msg 202 89 frame 5; #X obj 107 51 t b b b; #X connect 0 0 5 0; #X connect 1 0 2 0; @@ -62,17 +62,15 @@ #X msg 511 -17 open \$1; #X obj 499 92 pix_film; #X msg 517 26 auto \$1; -#X obj 517 8 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 +#X obj 517 8 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; -#X obj 580 26 loadbang; -#X msg 528 50 colorspace RGBA; -#X obj 771 5 gemmouse; -#X obj 827 112 f; -#X obj 797 111 f; -#X obj 841 83 t b b; -#X obj 797 139 pack f f; -#X obj 817 33 route 1; -#X msg 838 58 bang; +#X obj 822 22 gemmouse; +#X obj 878 129 f; +#X obj 848 128 f; +#X obj 892 100 t b b; +#X obj 848 156 pack f f; +#X obj 868 50 route 1; +#X msg 889 75 bang; #X obj 367 424 pix_opencv_floodfill; #X text -38 44 used in tracking algorithms as an object selector; #X text -38 71 and Yves Degoyon ( ydegoyon@gmail.com ); @@ -114,8 +112,12 @@ specific color; #X msg 439 330 connectivity 8; #X obj 211 525 pix_resize 320 240; #X obj 212 555 rectangle 4 3; +#X msg 581 30 colorspace RGBA; +#X obj 604 3 loadbang; +#X msg 686 29 colorspace RGB; +#X msg 682 5 colorspace Grey; #X connect 0 0 16 0; -#X connect 1 0 64 0; +#X connect 1 0 62 0; #X connect 3 0 4 0; #X connect 4 0 3 0; #X connect 7 0 14 0; @@ -126,38 +128,40 @@ specific color; #X connect 13 0 16 1; #X connect 14 0 15 0; #X connect 15 0 16 0; -#X connect 16 0 28 0; +#X connect 16 0 26 0; #X connect 16 1 8 0; #X connect 16 2 12 0; #X connect 17 0 16 0; #X connect 18 0 17 0; -#X connect 19 0 20 0; -#X connect 20 0 16 0; -#X connect 21 0 23 1; -#X connect 21 1 22 1; -#X connect 21 2 26 0; -#X connect 22 0 25 1; -#X connect 23 0 25 0; -#X connect 24 0 23 0; -#X connect 24 1 22 0; -#X connect 25 0 35 0; -#X connect 26 0 27 0; -#X connect 27 0 24 0; -#X connect 28 0 1 0; -#X connect 28 1 51 0; -#X connect 33 0 28 1; -#X connect 34 0 28 2; -#X connect 35 0 28 0; -#X connect 36 0 28 0; -#X connect 37 0 36 0; -#X connect 39 0 28 0; -#X connect 44 0 28 0; -#X connect 45 0 28 0; -#X connect 51 0 56 0; -#X connect 56 0 52 0; -#X connect 56 1 53 0; -#X connect 56 2 54 0; -#X connect 56 3 55 0; -#X connect 62 0 28 0; -#X connect 63 0 28 0; -#X connect 64 0 65 0; +#X connect 19 0 21 1; +#X connect 19 1 20 1; +#X connect 19 2 24 0; +#X connect 20 0 23 1; +#X connect 21 0 23 0; +#X connect 22 0 21 0; +#X connect 22 1 20 0; +#X connect 23 0 33 0; +#X connect 24 0 25 0; +#X connect 25 0 22 0; +#X connect 26 0 1 0; +#X connect 26 1 49 0; +#X connect 31 0 26 1; +#X connect 32 0 26 2; +#X connect 33 0 26 0; +#X connect 34 0 26 0; +#X connect 35 0 34 0; +#X connect 37 0 26 0; +#X connect 42 0 26 0; +#X connect 43 0 26 0; +#X connect 49 0 54 0; +#X connect 54 0 50 0; +#X connect 54 1 51 0; +#X connect 54 2 52 0; +#X connect 54 3 53 0; +#X connect 60 0 26 0; +#X connect 61 0 26 0; +#X connect 62 0 63 0; +#X connect 64 0 16 0; +#X connect 65 0 64 0; +#X connect 66 0 16 0; +#X connect 67 0 16 0; diff --git a/pix_opencv_haarcascade-help.pd b/pix_opencv_haarcascade-help.pd index 4af36e2..433d0be 100644 --- a/pix_opencv_haarcascade-help.pd +++ b/pix_opencv_haarcascade-help.pd @@ -20,7 +20,7 @@ #X obj 160 260 gemwin; #X msg 159 207 create \, 1; #X msg 235 208 destroy; -#X msg 281 180 frame 15; +#X msg 281 180 frame 5; #X obj 162 170 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -46,14 +46,13 @@ -1; #X obj 335 119 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 -1 -1; -#X floatatom 317 84 5 0 10000 1 frame# - -; +#X floatatom 332 102 5 0 10000 1 frame# - -; #X obj 278 -27 openpanel; #X msg 278 -7 open \$1; #X obj 266 102 pix_film; #X msg 284 36 auto \$1; #X obj 284 18 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; -#X msg 295 60 colorspace Grey; #X obj 87 221 translateXYZ 4 0 0; #X floatatom 264 583 5 0 0 0 - - -; #X floatatom 299 583 5 0 0 0 - - -; @@ -110,13 +109,17 @@ the subsequent scans (default 1.1); be specified is CV_HAAR_DO_CANNY_PRUNING ( 0 ); #X text 401 -47 pix_opencv_haarscasccade : object recognition based on Haar's cascade algorithm; +#X msg 348 69 colorspace RGBA; +#X obj 371 42 loadbang; +#X msg 453 68 colorspace RGB; +#X msg 449 44 colorspace Grey; #X connect 0 0 16 0; #X connect 1 0 2 0; #X connect 4 0 5 0; #X connect 5 0 4 0; #X connect 7 0 8 0; #X connect 9 0 7 0; -#X connect 9 0 30 0; +#X connect 9 0 29 0; #X connect 11 0 14 0; #X connect 12 0 13 0; #X connect 13 0 16 1; @@ -126,35 +129,38 @@ on Haar's cascade algorithm; #X connect 16 2 12 0; #X connect 17 0 16 0; #X connect 18 0 17 0; -#X connect 19 0 16 0; -#X connect 20 0 29 0; -#X connect 29 0 1 0; -#X connect 29 1 54 0; -#X connect 29 2 32 0; -#X connect 30 0 20 0; -#X connect 31 0 40 0; -#X connect 32 0 35 0; -#X connect 32 1 36 0; -#X connect 32 2 37 0; -#X connect 35 0 21 0; -#X connect 35 1 22 0; -#X connect 35 2 23 0; -#X connect 36 0 24 0; -#X connect 36 1 25 0; -#X connect 36 2 26 0; -#X connect 37 0 27 0; -#X connect 37 1 28 0; -#X connect 37 2 38 0; -#X connect 40 0 29 0; -#X connect 42 0 31 0; -#X connect 43 0 48 0; -#X connect 44 0 47 0; -#X connect 45 0 29 0; -#X connect 46 0 45 0; -#X connect 47 0 29 0; -#X connect 48 0 29 0; -#X connect 50 0 29 0; -#X connect 51 0 50 0; -#X connect 61 0 29 0; -#X connect 62 0 61 0; -#X connect 63 0 29 0; +#X connect 19 0 28 0; +#X connect 28 0 1 0; +#X connect 28 1 53 0; +#X connect 28 2 31 0; +#X connect 29 0 19 0; +#X connect 30 0 39 0; +#X connect 31 0 34 0; +#X connect 31 1 35 0; +#X connect 31 2 36 0; +#X connect 34 0 20 0; +#X connect 34 1 21 0; +#X connect 34 2 22 0; +#X connect 35 0 23 0; +#X connect 35 1 24 0; +#X connect 35 2 25 0; +#X connect 36 0 26 0; +#X connect 36 1 27 0; +#X connect 36 2 37 0; +#X connect 39 0 28 0; +#X connect 41 0 30 0; +#X connect 42 0 47 0; +#X connect 43 0 46 0; +#X connect 44 0 28 0; +#X connect 45 0 44 0; +#X connect 46 0 28 0; +#X connect 47 0 28 0; +#X connect 49 0 28 0; +#X connect 50 0 49 0; +#X connect 60 0 28 0; +#X connect 61 0 60 0; +#X connect 62 0 28 0; +#X connect 68 0 16 0; +#X connect 69 0 68 0; +#X connect 70 0 16 0; +#X connect 71 0 16 0; diff --git a/pix_opencv_hist_compare-help.pd b/pix_opencv_hist_compare-help.pd index fa34135..f274d25 100755 --- a/pix_opencv_hist_compare-help.pd +++ b/pix_opencv_hist_compare-help.pd @@ -20,7 +20,7 @@ #X obj 160 260 gemwin; #X msg 159 207 create \, 1; #X msg 235 208 destroy; -#X msg 281 180 frame 15; +#X msg 281 180 frame 5; #X obj 162 170 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -59,8 +59,6 @@ #X obj 517 8 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 364 259 translateXYZ 4 0 0; -#X obj 580 26 loadbang; -#X msg 528 50 colorspace RGBA; #X obj 439 290 hradio 15 1 0 5 empty empty empty 0 -8 0 10 -262144 -1 -1 0; #X text 522 289 save an histogram at position nth ( 0 <= n <= 80 ) @@ -86,6 +84,10 @@ again; #X obj 364 315 pix_opencv_hist_compare; #X text 7 -100 pix_opencv_hist_compare : image recognition using histograms ; +#X msg 583 44 colorspace RGBA; +#X obj 606 17 loadbang; +#X msg 688 43 colorspace RGB; +#X msg 684 19 colorspace Grey; #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -107,14 +109,16 @@ again; #X connect 21 2 17 0; #X connect 22 0 21 0; #X connect 23 0 22 0; -#X connect 24 0 41 0; -#X connect 25 0 26 0; -#X connect 26 0 21 0; -#X connect 27 0 41 1; -#X connect 33 0 36 0; -#X connect 33 1 37 0; -#X connect 33 2 38 0; -#X connect 33 3 39 0; -#X connect 41 0 1 0; -#X connect 41 1 32 0; -#X connect 41 2 33 0; +#X connect 24 0 39 0; +#X connect 25 0 39 1; +#X connect 31 0 34 0; +#X connect 31 1 35 0; +#X connect 31 2 36 0; +#X connect 31 3 37 0; +#X connect 39 0 1 0; +#X connect 39 1 30 0; +#X connect 39 2 31 0; +#X connect 41 0 21 0; +#X connect 42 0 41 0; +#X connect 43 0 21 0; +#X connect 44 0 21 0; diff --git a/pix_opencv_hough_circles-help.pd b/pix_opencv_hough_circles-help.pd new file mode 100755 index 0000000..5452ae6 --- /dev/null +++ b/pix_opencv_hough_circles-help.pd @@ -0,0 +1,145 @@ +#N canvas 41 167 1154 642 10; +#X obj 396 -37 gemhead; +#X obj 369 497 pix_texture; +#X obj 371 518 square 2; +#X obj 9 -28 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 +0; +#N canvas 0 22 454 304 gemwin 0; +#X obj 67 89 outlet; +#X obj 67 10 inlet; +#X obj 67 41 route create; +#X msg 67 70 set destroy; +#X msg 182 68 set create; +#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 289 80 pd Gem.init; +#X obj 160 260 gemwin; +#X msg 159 207 create \, 1; +#X msg 235 208 destroy; +#X msg 281 180 frame 5; +#X obj 162 170 t b b b; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 10 0; +#X connect 2 1 4 0; +#X connect 2 1 8 0; +#X connect 3 0 0 0; +#X connect 4 0 0 0; +#X connect 7 0 6 0; +#X connect 8 0 6 0; +#X connect 9 0 6 0; +#X connect 10 0 7 0; +#X connect 10 2 9 0; +#X restore 14 16 pd gemwin; +#X msg 14 -8 destroy; +#X text 12 -26 Create window and render; +#X obj 216 478 pix_texture; +#X obj 216 506 square 2; +#X obj 364 112 translateXYZ -2 0 0; +#X obj 365 138 separator; +#X obj 344 187 cnv 15 600 300 empty empty empty 20 12 0 14 -24198 -66577 +0; +#X obj 511 -66 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 524 128 unpack 0 0 0; +#X floatatom 514 151 5 0 0 3 length - -; +#X floatatom 563 151 5 0 0 3 width - -; +#X floatatom 613 151 5 0 0 3 height - -; +#X obj 568 109 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 +-1 -1; +#X floatatom 550 74 5 0 10000 1 frame# - -; +#X obj 511 -37 openpanel; +#X msg 511 -17 open \$1; +#X obj 499 92 pix_film; +#X msg 517 26 auto \$1; +#X obj 517 8 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#X obj 366 163 translateXYZ 4 0 0; +#X obj 580 26 loadbang; +#X msg 580 51 colorspace RGBA; +#X obj 372 389 pix_opencv_hough_circles; +#X obj 615 355 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X msg 530 353 nightmode \$1; +#X text 634 356 set nightmode; +#X floatatom 553 230 5 0 0 0 - - -; +#X msg 464 227 threshold \$1; +#X floatatom 598 307 5 0 0 0 - - -; +#X floatatom 617 332 5 0 0 0 - - -; +#X floatatom 539 201 5 0 0 0 - - -; +#X msg 449 200 maxcircles \$1; +#X text 579 200 maximum nuber of circles detected ( default : 10 ) +; +#X floatatom 575 258 5 0 0 0 - - -; +#X msg 487 257 threshold2 \$1; +#X text 614 270 see documentation of cvHoughCircles for the meaning +of thresholds; +#X msg 512 306 mindist \$1; +#X text 635 305 minimum distance between circles ( default : 30 ); +#X msg 517 330 resolution \$1; +#X text 660 331 detector resolution ( default 1 ); +#X text 592 226 threshold ( default 100 ); +#X text 614 253 threshold2 ( default 10 ); +#X floatatom 542 458 5 0 0 0 - - -; +#X floatatom 578 459 5 0 0 0 - - -; +#X obj 542 418 route 1 2 3 4 5 6 7 8 9 10; +#X text 545 472 X1; +#X text 581 472 Y1; +#X floatatom 615 459 5 0 0 0 - - -; +#X text 711 418 position of each circle; +#X text 618 473 radius; +#X obj 542 439 unpack f f f; +#X text 9 -66 written by Lluis Gomez i Bigorda ( lluisgomez@hangar.org +) and Yves Degoyon ( ydegoyon@gmail.com ); +#X text 9 -81 pix_opencv_hough_circles : Hough circles detection algorithm +; +#X msg 685 51 colorspace RGB; +#X msg 789 51 colorspace Grey; +#X connect 0 0 21 0; +#X connect 1 0 2 0; +#X connect 4 0 5 0; +#X connect 5 0 4 0; +#X connect 7 0 8 0; +#X connect 9 0 7 0; +#X connect 9 0 10 0; +#X connect 10 0 24 0; +#X connect 12 0 19 0; +#X connect 13 0 14 0; +#X connect 13 1 15 0; +#X connect 13 2 16 0; +#X connect 17 0 18 0; +#X connect 18 0 21 1; +#X connect 19 0 20 0; +#X connect 20 0 21 0; +#X connect 21 0 9 0; +#X connect 21 1 13 0; +#X connect 21 2 17 0; +#X connect 22 0 21 0; +#X connect 23 0 22 0; +#X connect 24 0 27 0; +#X connect 25 0 26 0; +#X connect 26 0 21 0; +#X connect 27 0 1 0; +#X connect 27 1 49 0; +#X connect 28 0 29 0; +#X connect 29 0 27 0; +#X connect 31 0 32 0; +#X connect 32 0 27 0; +#X connect 33 0 41 0; +#X connect 34 0 43 0; +#X connect 35 0 36 0; +#X connect 36 0 27 0; +#X connect 38 0 39 0; +#X connect 39 0 27 0; +#X connect 41 0 27 0; +#X connect 43 0 27 0; +#X connect 49 0 55 0; +#X connect 55 0 47 0; +#X connect 55 1 48 0; +#X connect 55 2 52 0; +#X connect 58 0 21 0; +#X connect 59 0 21 0; diff --git a/pix_opencv_hough_circles.cc b/pix_opencv_hough_circles.cc new file mode 100755 index 0000000..40595d1 --- /dev/null +++ b/pix_opencv_hough_circles.cc @@ -0,0 +1,314 @@ +//////////////////////////////////////////////////////// +// +// GEM - Graphics Environment for Multimedia +// +// zmoelnig@iem.kug.ac.at +// +// Implementation file +// +// Copyright (c) 1997-2000 Mark Danks. +// Copyright (c) Günther Geiger. +// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute. IEM +// Copyright (c) 2002 James Tittle & Chris Clepper +// For information on usage and redistribution, and for a DISCLAIMER OF ALL +// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. +// +///////////////////////////////////////////////////////// + +#include "pix_opencv_hough_circles.h" +#include <stdio.h> + +CPPEXTERN_NEW(pix_opencv_hough_circles) + +///////////////////////////////////////////////////////// +// +// pix_opencv_hough_circles +// +///////////////////////////////////////////////////////// +// Constructor +// +///////////////////////////////////////////////////////// + +pix_opencv_hough_circles :: pix_opencv_hough_circles() +{ + int i; + + comp_xsize=320; + comp_ysize=240; + + m_dataout = outlet_new(this->x_obj, &s_anything); + + x_threshold = 100; + x_threshold2 = 10; + x_maxcircles = 10; + x_mindist = 30.0; + x_resolution = 1.0; + night_mode = 0; + + // initialize font + cvInitFont( &font, CV_FONT_HERSHEY_PLAIN, 1.0, 1.0, 0, 1, 8 ); + + rgba = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 4); + rgb = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 3); + gray = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 1); + +} + +///////////////////////////////////////////////////////// +// Destructor +// +///////////////////////////////////////////////////////// +pix_opencv_hough_circles :: ~pix_opencv_hough_circles() +{ + //Destroy cv_images to clean memory + cvReleaseImage(&rgba); + cvReleaseImage(&rgb); + cvReleaseImage(&gray); +} + +///////////////////////////////////////////////////////// +// processImage +// +///////////////////////////////////////////////////////// +void pix_opencv_hough_circles :: processRGBAImage(imageStruct &image) +{ + int i, ucircles; + + if ((this->comp_xsize!=image.xsize)&&(this->comp_ysize!=image.ysize)) + { + + this->comp_xsize=image.xsize; + this->comp_ysize=image.ysize; + + cvReleaseImage(&rgba); + cvReleaseImage(&rgb); + cvReleaseImage(&gray); + + rgba = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 4); + rgb = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 3); + gray = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 1); + + } + + memcpy( rgba->imageData, image.data, image.xsize*image.ysize*4 ); + cvCvtColor( rgba, gray, CV_BGRA2GRAY ); + + if( night_mode ) + cvZero( rgba ); + + x_storage = cvCreateMemStorage(0); + + cvSmooth( gray, gray, CV_GAUSSIAN, 9, 9 ); + CvSeq* circles = cvHoughCircles( gray, x_storage, CV_HOUGH_GRADIENT, x_resolution, x_mindist, x_threshold, x_threshold2 ); + ucircles = (circles->total>x_maxcircles)?x_maxcircles:circles->total; + for( i = 0; i < ucircles; i++ ) + { + float* p = (float*)cvGetSeqElem( circles, i ); + char tindex[10]; + + cvCircle( rgba, cvPoint(cvRound(p[0]),cvRound(p[1])), 3, CV_RGB(0,255,0), -1, 8, 0 ); + cvCircle( rgba, cvPoint(cvRound(p[0]),cvRound(p[1])), cvRound(p[2]), CV_RGB(255,0,0), 3, 8, 0 ); + SETFLOAT(&x_list[0], i); + SETFLOAT(&x_list[1], cvRound(p[0])); + SETFLOAT(&x_list[2], cvRound(p[1])); + SETFLOAT(&x_list[3], cvRound(p[2])); + outlet_list( m_dataout, 0, 4, x_list ); + sprintf( tindex, "%d", i ); + cvPutText( rgba, tindex, cvPoint(cvRound(p[0]),cvRound(p[1])), &font, CV_RGB(255,255,255)); + } + + cvReleaseMemStorage( &x_storage ); + + memcpy( image.data, rgba->imageData, image.xsize*image.ysize*4 ); + +} + +void pix_opencv_hough_circles :: processRGBImage(imageStruct &image) +{ + int i, ucircles; + + if ((this->comp_xsize!=image.xsize)&&(this->comp_ysize!=image.ysize)) + { + + this->comp_xsize=image.xsize; + this->comp_ysize=image.ysize; + + cvReleaseImage(&rgba); + cvReleaseImage(&rgb); + cvReleaseImage(&gray); + + rgba = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 4); + rgb = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 3); + gray = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 1); + + } + + memcpy( rgb->imageData, image.data, image.xsize*image.ysize*3 ); + cvCvtColor( rgb, gray, CV_BGR2GRAY ); + + if( night_mode ) + cvZero( rgb ); + + x_storage = cvCreateMemStorage(0); + + cvSmooth( gray, gray, CV_GAUSSIAN, 9, 9 ); + CvSeq* circles = cvHoughCircles( gray, x_storage, CV_HOUGH_GRADIENT, x_resolution, x_mindist, x_threshold, x_threshold2 ); + ucircles = (circles->total>x_maxcircles)?x_maxcircles:circles->total; + for( i = 0; i < ucircles; i++ ) + { + float* p = (float*)cvGetSeqElem( circles, i ); + char tindex[10]; + + cvCircle( rgb, cvPoint(cvRound(p[0]),cvRound(p[1])), 3, CV_RGB(0,255,0), -1, 8, 0 ); + cvCircle( rgb, cvPoint(cvRound(p[0]),cvRound(p[1])), cvRound(p[2]), CV_RGB(255,0,0), 3, 8, 0 ); + SETFLOAT(&x_list[0], i); + SETFLOAT(&x_list[1], cvRound(p[0])); + SETFLOAT(&x_list[2], cvRound(p[1])); + SETFLOAT(&x_list[3], cvRound(p[2])); + outlet_list( m_dataout, 0, 4, x_list ); + sprintf( tindex, "%d", i ); + cvPutText( rgb, tindex, cvPoint(cvRound(p[0]),cvRound(p[1])), &font, CV_RGB(255,255,255)); + } + + cvReleaseMemStorage( &x_storage ); + memcpy( image.data, rgb->imageData, image.xsize*image.ysize*3 ); + +} + +void pix_opencv_hough_circles :: processYUVImage(imageStruct &image) +{ + post( "pix_opencv_hough_circles : yuv format not supported" ); +} + +void pix_opencv_hough_circles :: processGrayImage(imageStruct &image) +{ + int i, ucircles; + + if ((this->comp_xsize!=image.xsize)&&(this->comp_ysize!=image.ysize)) + { + + this->comp_xsize=image.xsize; + this->comp_ysize=image.ysize; + + cvReleaseImage(&rgba); + cvReleaseImage(&rgb); + cvReleaseImage(&gray); + + rgba = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 4); + rgb = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 3); + gray = cvCreateImage(cvSize(comp_xsize,comp_ysize), IPL_DEPTH_8U, 1); + + } + + memcpy( gray->imageData, image.data, image.xsize*image.ysize ); + + if( night_mode ) + cvZero( gray ); + + x_storage = cvCreateMemStorage(0); + + cvSmooth( gray, gray, CV_GAUSSIAN, 9, 9 ); + CvSeq* circles = cvHoughCircles( gray, x_storage, CV_HOUGH_GRADIENT, x_resolution, x_mindist, x_threshold, x_threshold2 ); + ucircles = (circles->total>x_maxcircles)?x_maxcircles:circles->total; + for( i = 0; i < ucircles; i++ ) + { + float* p = (float*)cvGetSeqElem( circles, i ); + char tindex[10]; + + cvCircle( gray, cvPoint(cvRound(p[0]),cvRound(p[1])), 3, CV_RGB(0,255,0), -1, 8, 0 ); + cvCircle( gray, cvPoint(cvRound(p[0]),cvRound(p[1])), cvRound(p[2]), CV_RGB(255,0,0), 3, 8, 0 ); + SETFLOAT(&x_list[0], i); + SETFLOAT(&x_list[1], cvRound(p[0])); + SETFLOAT(&x_list[2], cvRound(p[1])); + SETFLOAT(&x_list[3], cvRound(p[2])); + outlet_list( m_dataout, 0, 4, x_list ); + sprintf( tindex, "%d", i ); + cvPutText( gray, tindex, cvPoint(cvRound(p[0]),cvRound(p[1])), &font, CV_RGB(255,255,255)); + } + + cvReleaseMemStorage( &x_storage ); + memcpy( image.data, gray->imageData, image.xsize*image.ysize ); + +} + +///////////////////////////////////////////////////////// +// static member function +// +///////////////////////////////////////////////////////// + +void pix_opencv_hough_circles :: obj_setupCallback(t_class *classPtr) +{ + class_addmethod(classPtr, (t_method)&pix_opencv_hough_circles::floatNightModeMessCallback, + gensym("nightmode"), A_FLOAT, A_NULL); + class_addmethod(classPtr, (t_method)&pix_opencv_hough_circles::floatThresholdMessCallback, + gensym("threshold"), A_FLOAT, A_NULL); + class_addmethod(classPtr, (t_method)&pix_opencv_hough_circles::floatThreshold2MessCallback, + gensym("threshold2"), A_FLOAT, A_NULL); + class_addmethod(classPtr, (t_method)&pix_opencv_hough_circles::floatMinDistMessCallback, + gensym("mindist"), A_FLOAT, A_NULL); + class_addmethod(classPtr, (t_method)&pix_opencv_hough_circles::floatResolutionMessCallback, + gensym("resolution"), A_FLOAT, A_NULL); + class_addmethod(classPtr, (t_method)&pix_opencv_hough_circles::floatMaxCirclesMessCallback, + gensym("maxcircles"), A_FLOAT, A_NULL); +} + +void pix_opencv_hough_circles :: floatNightModeMessCallback(void *data, t_floatarg nightmode) +{ + GetMyClass(data)->floatNightModeMess((float)nightmode); +} + +void pix_opencv_hough_circles :: floatThresholdMessCallback(void *data, t_floatarg threshold) +{ + GetMyClass(data)->floatThresholdMess((float)threshold); +} + +void pix_opencv_hough_circles :: floatThreshold2MessCallback(void *data, t_floatarg threshold) +{ + GetMyClass(data)->floatThreshold2Mess((float)threshold); +} + +void pix_opencv_hough_circles :: floatMinDistMessCallback(void *data, t_floatarg mindist) +{ + GetMyClass(data)->floatMinDistMess((float)mindist); +} + +void pix_opencv_hough_circles :: floatResolutionMessCallback(void *data, t_floatarg resolution) +{ + GetMyClass(data)->floatResolutionMess((float)resolution); +} + +void pix_opencv_hough_circles :: floatMaxCirclesMessCallback(void *data, t_floatarg maxcircles) +{ + GetMyClass(data)->floatMaxCirclesMess((float)maxcircles); +} + +void pix_opencv_hough_circles :: floatNightModeMess(float nightmode) +{ + if ((nightmode==0.0)||(nightmode==1.0)) night_mode = (int)nightmode; +} + +void pix_opencv_hough_circles :: floatThresholdMess(float threshold) +{ + if (threshold>0.0) x_threshold = (int)threshold; +} + +void pix_opencv_hough_circles :: floatThreshold2Mess(float threshold) +{ + if (threshold>0.0) x_threshold2 = (int)threshold; +} + +void pix_opencv_hough_circles :: floatMinDistMess(float mindist) +{ + if (mindist>0.0) x_mindist = (int)mindist; +} + +void pix_opencv_hough_circles :: floatResolutionMess(float resolution) +{ + if (resolution>0.0) x_resolution = (int)resolution; +} + +void pix_opencv_hough_circles :: floatMaxCirclesMess(float maxcircles) +{ + if (maxcircles>0.0) x_maxcircles = (int)maxcircles; +} + diff --git a/pix_opencv_hough_circles.h b/pix_opencv_hough_circles.h new file mode 100755 index 0000000..9c2a63b --- /dev/null +++ b/pix_opencv_hough_circles.h @@ -0,0 +1,102 @@ +/*----------------------------------------------------------------- +LOG + GEM - Graphics Environment for Multimedia + + Hough circles detection algorithm + + Copyright (c) 1997-1999 Mark Danks. mark@danks.org + Copyright (c) Günther Geiger. geiger@epy.co.at + Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute. IEM. zmoelnig@iem.kug.ac.at + Copyright (c) 2002 James Tittle & Chris Clepper + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + +-----------------------------------------------------------------*/ + +#ifndef INCLUDE_PIX_OPENCV_HOUGH_CIRCLES_H_ +#define INCLUDE_PIX_OPENCV_HOUGH_CIRCLES_H_ + +#include "Base/GemPixObj.h" + +#ifndef _EiC +#include "cv.h" +#endif + +#define MAX_HISTOGRAMS_TO_COMPARE 80 + +/*----------------------------------------------------------------- +------------------------------------------------------------------- +CLASS + pix_opencv_hough_circles + + Hough circles detection algorithm + +KEYWORDS + pix + +DESCRIPTION + +-----------------------------------------------------------------*/ + +class GEM_EXTERN pix_opencv_hough_circles : public GemPixObj +{ + CPPEXTERN_HEADER(pix_opencv_hough_circles, GemPixObj) + + public: + + ////////// + // Constructor + pix_opencv_hough_circles(); + + protected: + + ////////// + // Destructor + virtual ~pix_opencv_hough_circles(); + + ////////// + // Do the processing + virtual void processRGBAImage(imageStruct &image); + virtual void processRGBImage(imageStruct &image); + virtual void processYUVImage(imageStruct &image); + virtual void processGrayImage(imageStruct &image); + + int comp_xsize; + int comp_ysize; + + void floatNightModeMess(t_float nightmode); + void floatThresholdMess(t_floatarg threshold); + void floatThreshold2Mess(t_floatarg threshold); + void floatMinDistMess(t_floatarg mindist); + void floatResolutionMess(t_floatarg resolution); + void floatMaxCirclesMess(t_floatarg maxcircles); + + t_outlet *m_dataout; + + int x_threshold; + int x_threshold2; + int x_maxcircles; + double x_mindist; + double x_resolution; + int night_mode; + + private: + + ////////// + // Static member functions + static void floatNightModeMessCallback(void *data, t_floatarg nightmode); + static void floatThresholdMessCallback(void *data, t_floatarg threshold); + static void floatThreshold2MessCallback(void *data, t_floatarg threshold); + static void floatMinDistMessCallback(void *data, t_floatarg mindist); + static void floatResolutionMessCallback(void *data, t_floatarg resolution); + static void floatMaxCirclesMessCallback(void *data, t_floatarg maxcircles); + + // The output and temporary images + IplImage *rgba, *rgb, *gray; + CvFont font; + CvMemStorage* x_storage; + CvSeq* x_circles; + t_atom x_list[4]; +}; + +#endif // for header file diff --git a/pix_opencv_hu_compare-help.pd b/pix_opencv_hu_compare-help.pd index cf36bcc..ff7c697 100755 --- a/pix_opencv_hu_compare-help.pd +++ b/pix_opencv_hu_compare-help.pd @@ -20,7 +20,7 @@ #X obj 160 260 gemwin; #X msg 159 207 create \, 1; #X msg 235 208 destroy; -#X msg 281 180 frame 15; +#X msg 281 180 frame 5; #X obj 162 170 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -50,8 +50,6 @@ #X msg 491 2 auto \$1; #X obj 491 -16 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; -#X obj 554 2 loadbang; -#X msg 502 26 colorspace RGBA; #X obj 373 395 pix_opencv_hu_compare; #X floatatom 506 439 30 0 0 0 - - -; #X text 511 422 distance; @@ -115,7 +113,11 @@ colors; #X obj 755 39 pix_resize 320 240; #X obj 755 186 translateXYZ 4 0 0; #X obj 474 122 pix_resize 320 240; -#X connect 0 0 51 0; +#X obj 549 -24 loadbang; +#X msg 549 1 colorspace RGBA; +#X msg 650 0 colorspace RGB; +#X msg 612 -25 colorspace Grey; +#X connect 0 0 49 0; #X connect 1 0 2 0; #X connect 4 0 5 0; #X connect 5 0 4 0; @@ -124,47 +126,52 @@ colors; #X connect 10 0 13 1; #X connect 11 0 12 0; #X connect 12 0 13 0; -#X connect 13 0 71 0; +#X connect 13 0 69 0; #X connect 13 2 9 0; #X connect 14 0 13 0; #X connect 15 0 14 0; -#X connect 16 0 17 0; -#X connect 17 0 13 0; -#X connect 18 0 1 0; -#X connect 18 1 19 0; -#X connect 19 0 23 0; -#X connect 21 0 22 0; -#X connect 23 0 21 0; -#X connect 24 0 23 1; -#X connect 24 0 26 0; -#X connect 29 0 18 0; -#X connect 30 0 29 0; -#X connect 33 0 35 0; -#X connect 35 0 36 0; -#X connect 36 0 18 0; -#X connect 37 0 18 0; -#X connect 38 0 37 0; -#X connect 40 0 18 0; -#X connect 42 0 40 0; -#X connect 47 0 52 0; -#X connect 51 0 69 0; -#X connect 52 0 54 0; -#X connect 53 0 70 0; -#X connect 54 0 51 0; -#X connect 55 0 65 2; -#X connect 57 0 58 0; -#X connect 58 0 55 0; -#X connect 59 0 55 0; -#X connect 60 0 63 0; -#X connect 60 0 66 2; -#X connect 61 0 62 0; -#X connect 62 0 60 0; -#X connect 64 0 67 0; -#X connect 65 0 53 0; -#X connect 65 0 64 0; -#X connect 65 0 18 1; -#X connect 66 0 18 0; -#X connect 68 0 65 0; -#X connect 69 0 68 0; -#X connect 70 0 13 0; -#X connect 71 0 66 0; +#X connect 16 0 1 0; +#X connect 16 1 17 0; +#X connect 17 0 21 0; +#X connect 19 0 20 0; +#X connect 21 0 19 0; +#X connect 22 0 21 1; +#X connect 22 0 24 0; +#X connect 27 0 16 0; +#X connect 28 0 27 0; +#X connect 31 0 33 0; +#X connect 33 0 34 0; +#X connect 34 0 16 0; +#X connect 35 0 16 0; +#X connect 36 0 35 0; +#X connect 38 0 16 0; +#X connect 40 0 38 0; +#X connect 45 0 50 0; +#X connect 49 0 67 0; +#X connect 50 0 52 0; +#X connect 51 0 68 0; +#X connect 52 0 49 0; +#X connect 53 0 63 2; +#X connect 55 0 56 0; +#X connect 56 0 53 0; +#X connect 57 0 53 0; +#X connect 58 0 61 0; +#X connect 58 0 64 2; +#X connect 59 0 60 0; +#X connect 60 0 58 0; +#X connect 62 0 65 0; +#X connect 63 0 51 0; +#X connect 63 0 62 0; +#X connect 63 0 16 1; +#X connect 64 0 16 0; +#X connect 66 0 63 0; +#X connect 67 0 66 0; +#X connect 68 0 13 0; +#X connect 69 0 64 0; +#X connect 70 0 71 0; +#X connect 71 0 13 0; +#X connect 71 0 49 0; +#X connect 72 0 49 0; +#X connect 72 0 13 0; +#X connect 73 0 13 0; +#X connect 73 0 49 0; diff --git a/pix_opencv_knear-help.pd b/pix_opencv_knear-help.pd index eb232ae..657b425 100755 --- a/pix_opencv_knear-help.pd +++ b/pix_opencv_knear-help.pd @@ -14,7 +14,7 @@ #X obj 127 212 gemwin; #X msg 120 172 create \, 1; #X msg 208 175 destroy; -#X msg 248 132 frame 15; +#X msg 248 132 frame 5; #X obj 129 122 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; diff --git a/pix_opencv_laplace-help.pd b/pix_opencv_laplace-help.pd index f287197..da1e8b7 100644 --- a/pix_opencv_laplace-help.pd +++ b/pix_opencv_laplace-help.pd @@ -20,7 +20,7 @@ #X obj 171 266 gemwin; #X msg 164 226 create \, 1; #X msg 252 229 destroy; -#X msg 292 186 frame 15; +#X msg 292 186 frame 5; #X obj 173 176 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -51,14 +51,13 @@ #X floatatom 613 151 5 0 0 3 height - -; #X obj 568 109 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 -1 -1; -#X floatatom 550 74 5 0 10000 1 frame# - -; +#X floatatom 559 91 5 0 10000 1 frame# - -; #X obj 511 -37 openpanel; #X msg 511 -17 open \$1; #X obj 499 92 pix_film; #X msg 517 26 auto \$1; #X obj 517 8 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; -#X msg 528 50 colorspace Grey; #X obj 364 259 translateXYZ 4 0 0; #X obj 364 323 pix_opencv_laplace; #X msg 409 298 1; @@ -70,6 +69,10 @@ ); #X text 25 49 used as an edge detector; #X text 24 36 pix_opencv_laplace : laplace filter; +#X obj 574 14 loadbang; +#X msg 574 39 colorspace RGBA; +#X msg 675 38 colorspace RGB; +#X msg 637 13 colorspace Grey; #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -77,7 +80,7 @@ #X connect 7 0 8 0; #X connect 9 0 7 0; #X connect 9 0 10 0; -#X connect 10 0 25 0; +#X connect 10 0 24 0; #X connect 12 0 19 0; #X connect 13 0 14 0; #X connect 13 1 15 0; @@ -91,10 +94,13 @@ #X connect 21 2 17 0; #X connect 22 0 21 0; #X connect 23 0 22 0; -#X connect 24 0 21 0; -#X connect 25 0 26 0; -#X connect 26 0 1 0; -#X connect 27 0 26 1; -#X connect 28 0 26 1; -#X connect 29 0 26 1; -#X connect 30 0 26 1; +#X connect 24 0 25 0; +#X connect 25 0 1 0; +#X connect 26 0 25 1; +#X connect 27 0 25 1; +#X connect 28 0 25 1; +#X connect 29 0 25 1; +#X connect 34 0 35 0; +#X connect 35 0 21 0; +#X connect 36 0 21 0; +#X connect 37 0 21 0; diff --git a/pix_opencv_lk-help.pd b/pix_opencv_lk-help.pd index d4cb0e4..6a6aa78 100755 --- a/pix_opencv_lk-help.pd +++ b/pix_opencv_lk-help.pd @@ -17,7 +17,7 @@ #X msg 62 93 reset; #X obj 49 135 outlet; #X msg 107 89 dimen 320 240; -#X msg 202 89 frame 15; +#X msg 202 89 frame 5; #X obj 107 51 t b b b; #X connect 0 0 5 0; #X connect 1 0 2 0; @@ -57,15 +57,13 @@ #X floatatom 613 151 5 0 0 3 height - -; #X obj 568 109 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 -1 -1; -#X floatatom 550 74 5 0 10000 1 frame# - -; +#X floatatom 560 92 5 0 10000 1 frame# - -; #X obj 511 -37 openpanel; #X msg 511 -17 open \$1; #X obj 499 92 pix_film; #X msg 517 26 auto \$1; #X obj 517 8 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; -#X obj 580 26 loadbang; -#X msg 528 50 colorspace RGBA; #X floatatom 488 520 5 0 0 0 - - -; #X text 523 519 window size; #X obj 553 262 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 @@ -135,8 +133,12 @@ #X floatatom 1022 254 5 0 0 0 - - -; #X obj 208 534 rectangle 4 3; #X obj 212 489 pix_resize 320 240; +#X obj 588 13 loadbang; +#X msg 588 38 colorspace RGBA; +#X msg 692 38 colorspace RGB; +#X msg 651 12 colorspace Grey; #X connect 0 0 16 0; -#X connect 1 0 81 0; +#X connect 1 0 79 0; #X connect 3 0 4 0; #X connect 4 0 3 0; #X connect 7 0 14 0; @@ -147,53 +149,55 @@ #X connect 13 0 16 1; #X connect 14 0 15 0; #X connect 15 0 16 0; -#X connect 16 0 53 0; +#X connect 16 0 51 0; #X connect 16 1 8 0; #X connect 16 2 12 0; #X connect 17 0 16 0; #X connect 18 0 17 0; -#X connect 19 0 20 0; -#X connect 20 0 16 0; -#X connect 21 0 53 1; -#X connect 23 0 24 0; -#X connect 24 0 53 0; -#X connect 26 0 53 0; -#X connect 27 0 26 0; -#X connect 28 0 29 0; -#X connect 29 0 53 0; -#X connect 31 0 53 0; -#X connect 33 0 34 0; -#X connect 34 0 27 0; -#X connect 35 0 53 0; -#X connect 36 0 53 0; -#X connect 38 0 53 0; -#X connect 40 0 53 0; -#X connect 42 0 40 0; -#X connect 44 0 33 0; -#X connect 45 0 44 0; -#X connect 46 0 47 0; -#X connect 46 1 48 0; -#X connect 51 0 46 0; -#X connect 53 0 1 0; -#X connect 53 1 51 0; -#X connect 54 0 56 1; -#X connect 54 1 55 1; -#X connect 54 2 60 0; -#X connect 55 0 58 1; -#X connect 55 0 79 0; -#X connect 56 0 58 0; -#X connect 56 0 78 0; -#X connect 57 0 56 0; -#X connect 57 1 55 0; -#X connect 58 0 35 0; -#X connect 60 0 61 0; -#X connect 61 0 57 0; -#X connect 62 0 53 0; -#X connect 63 0 53 0; -#X connect 67 0 53 0; -#X connect 68 0 53 0; -#X connect 70 0 53 0; -#X connect 71 0 53 0; -#X connect 72 0 71 0; -#X connect 77 0 36 0; -#X connect 81 0 80 0; +#X connect 19 0 51 1; +#X connect 21 0 22 0; +#X connect 22 0 51 0; +#X connect 24 0 51 0; +#X connect 25 0 24 0; +#X connect 26 0 27 0; +#X connect 27 0 51 0; +#X connect 29 0 51 0; +#X connect 31 0 32 0; +#X connect 32 0 25 0; +#X connect 33 0 51 0; +#X connect 34 0 51 0; +#X connect 36 0 51 0; +#X connect 38 0 51 0; +#X connect 40 0 38 0; +#X connect 42 0 31 0; +#X connect 43 0 42 0; +#X connect 44 0 45 0; +#X connect 44 1 46 0; +#X connect 49 0 44 0; +#X connect 51 0 1 0; +#X connect 51 1 49 0; +#X connect 52 0 54 1; +#X connect 52 1 53 1; +#X connect 52 2 58 0; +#X connect 53 0 56 1; +#X connect 53 0 77 0; +#X connect 54 0 56 0; +#X connect 54 0 76 0; +#X connect 55 0 54 0; +#X connect 55 1 53 0; +#X connect 56 0 33 0; +#X connect 58 0 59 0; +#X connect 59 0 55 0; +#X connect 60 0 51 0; +#X connect 61 0 51 0; +#X connect 65 0 51 0; +#X connect 66 0 51 0; +#X connect 68 0 51 0; +#X connect 69 0 51 0; +#X connect 70 0 69 0; +#X connect 75 0 34 0; +#X connect 79 0 78 0; +#X connect 80 0 81 0; +#X connect 81 0 16 0; +#X connect 82 0 16 0; +#X connect 83 0 16 0; diff --git a/pix_opencv_morphology-help.pd b/pix_opencv_morphology-help.pd index a47ee3a..636a22f 100644 --- a/pix_opencv_morphology-help.pd +++ b/pix_opencv_morphology-help.pd @@ -20,7 +20,7 @@ #X obj 171 266 gemwin; #X msg 164 226 create \, 1; #X msg 252 229 destroy; -#X msg 292 186 frame 15; +#X msg 292 186 frame 5; #X obj 173 176 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -51,14 +51,13 @@ #X floatatom 613 151 5 0 0 3 height - -; #X obj 568 109 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 -1 -1; -#X floatatom 550 74 5 0 10000 1 frame# - -; +#X floatatom 560 92 5 0 10000 1 frame# - -; #X obj 511 -37 openpanel; #X msg 511 -17 open \$1; #X obj 499 92 pix_film; #X msg 517 26 auto \$1; #X obj 517 8 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; -#X msg 528 50 colorspace Grey; #X obj 364 259 translateXYZ 4 0 0; #X floatatom 475 377 5 0 0 0 - - -; #X obj 501 291 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 @@ -78,6 +77,10 @@ #X text 468 455 pdp_opencv_morphology : morphology filter ( erosion / dilatation ); #X text 468 480 used as a filter to focus on bright or dark zones; +#X obj 576 12 loadbang; +#X msg 576 37 colorspace RGBA; +#X msg 680 37 colorspace RGB; +#X msg 639 11 colorspace Grey; #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -85,7 +88,7 @@ #X connect 7 0 8 0; #X connect 9 0 7 0; #X connect 9 0 10 0; -#X connect 10 0 25 0; +#X connect 10 0 24 0; #X connect 12 0 19 0; #X connect 13 0 14 0; #X connect 13 1 15 0; @@ -99,12 +102,15 @@ #X connect 21 2 17 0; #X connect 22 0 21 0; #X connect 23 0 22 0; -#X connect 24 0 21 0; -#X connect 25 0 37 0; -#X connect 26 0 37 1; -#X connect 27 0 31 0; -#X connect 28 0 37 0; -#X connect 29 0 37 0; -#X connect 30 0 37 0; -#X connect 31 0 37 0; -#X connect 37 0 1 0; +#X connect 24 0 36 0; +#X connect 25 0 36 1; +#X connect 26 0 30 0; +#X connect 27 0 36 0; +#X connect 28 0 36 0; +#X connect 29 0 36 0; +#X connect 30 0 36 0; +#X connect 36 0 1 0; +#X connect 40 0 41 0; +#X connect 41 0 21 0; +#X connect 42 0 21 0; +#X connect 43 0 21 0; diff --git a/pix_opencv_motempl-help.pd b/pix_opencv_motempl-help.pd index b1ac6d0..e30eea2 100644 --- a/pix_opencv_motempl-help.pd +++ b/pix_opencv_motempl-help.pd @@ -20,7 +20,7 @@ #X obj 171 266 gemwin; #X msg 164 226 create \, 1; #X msg 252 229 destroy; -#X msg 292 186 frame 15; +#X msg 292 186 frame 5; #X obj 173 176 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -51,14 +51,13 @@ #X floatatom 576 180 5 0 0 3 height - -; #X obj 531 138 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 -1 -1; -#X floatatom 513 103 5 0 10000 1 frame# - -; +#X floatatom 522 121 5 0 10000 1 frame# - -; #X obj 474 -8 openpanel; #X msg 474 12 open \$1; #X obj 462 121 pix_film; #X msg 480 55 auto \$1; #X obj 480 37 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; -#X msg 491 79 colorspace Grey; #X obj 361 240 translateXYZ 4 0 0; #X obj 504 533 route -1 0 1 2 3 4; #X floatatom 507 613 5 0 0 0 - - -; @@ -112,6 +111,10 @@ ); #X text 26 64 pix_opencv_motempl : opencv motion detection based on movement history; +#X obj 537 45 loadbang; +#X msg 537 70 colorspace RGBA; +#X msg 641 70 colorspace RGB; +#X msg 600 44 colorspace Grey; #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -119,7 +122,7 @@ movement history; #X connect 7 0 8 0; #X connect 9 0 7 0; #X connect 9 0 10 0; -#X connect 10 0 25 0; +#X connect 10 0 24 0; #X connect 12 0 19 0; #X connect 13 0 14 0; #X connect 13 1 15 0; @@ -133,40 +136,43 @@ movement history; #X connect 21 2 17 0; #X connect 22 0 21 0; #X connect 23 0 22 0; -#X connect 24 0 21 0; -#X connect 25 0 67 0; -#X connect 26 0 39 0; -#X connect 26 1 40 0; -#X connect 26 2 41 0; -#X connect 39 0 27 0; -#X connect 39 1 28 0; -#X connect 39 2 29 0; -#X connect 39 3 30 0; +#X connect 24 0 66 0; +#X connect 25 0 38 0; +#X connect 25 1 39 0; +#X connect 25 2 40 0; +#X connect 38 0 26 0; +#X connect 38 1 27 0; +#X connect 38 2 28 0; +#X connect 38 3 29 0; +#X connect 38 4 41 0; +#X connect 39 0 30 0; +#X connect 39 1 31 0; +#X connect 39 2 32 0; +#X connect 39 3 33 0; #X connect 39 4 42 0; -#X connect 40 0 31 0; -#X connect 40 1 32 0; -#X connect 40 2 33 0; -#X connect 40 3 34 0; +#X connect 40 0 34 0; +#X connect 40 1 35 0; +#X connect 40 2 36 0; +#X connect 40 3 37 0; #X connect 40 4 43 0; -#X connect 41 0 35 0; -#X connect 41 1 36 0; -#X connect 41 2 37 0; -#X connect 41 3 38 0; -#X connect 41 4 44 0; -#X connect 50 0 67 1; -#X connect 51 0 53 0; -#X connect 53 0 67 0; -#X connect 54 0 55 0; -#X connect 55 0 67 0; -#X connect 56 0 57 0; -#X connect 57 0 67 0; -#X connect 58 0 59 0; -#X connect 59 0 67 0; -#X connect 60 0 67 2; -#X connect 61 0 67 3; -#X connect 67 0 1 0; -#X connect 67 1 26 0; -#X connect 68 0 67 0; -#X connect 70 0 68 0; -#X connect 71 0 68 0; -#X connect 72 0 68 0; +#X connect 49 0 66 1; +#X connect 50 0 52 0; +#X connect 52 0 66 0; +#X connect 53 0 54 0; +#X connect 54 0 66 0; +#X connect 55 0 56 0; +#X connect 56 0 66 0; +#X connect 57 0 58 0; +#X connect 58 0 66 0; +#X connect 59 0 66 2; +#X connect 60 0 66 3; +#X connect 66 0 1 0; +#X connect 66 1 25 0; +#X connect 67 0 66 0; +#X connect 69 0 67 0; +#X connect 70 0 67 0; +#X connect 71 0 67 0; +#X connect 75 0 76 0; +#X connect 76 0 21 0; +#X connect 77 0 21 0; +#X connect 78 0 21 0; diff --git a/pix_opencv_pgh_compare-help.pd b/pix_opencv_pgh_compare-help.pd index 1209a6d..ae9787e 100755 --- a/pix_opencv_pgh_compare-help.pd +++ b/pix_opencv_pgh_compare-help.pd @@ -20,7 +20,7 @@ #X obj 160 260 gemwin; #X msg 159 207 create \, 1; #X msg 235 208 destroy; -#X msg 281 180 frame 15; +#X msg 281 180 frame 5; #X obj 162 170 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -50,8 +50,6 @@ #X msg 491 2 auto \$1; #X obj 491 -16 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; -#X obj 554 2 loadbang; -#X msg 502 26 colorspace RGBA; #X floatatom 506 439 30 0 0 0 - - -; #X text 511 422 distance; #X obj 730 457 route 1; @@ -110,7 +108,11 @@ their PGH histograms.; example code from OpenCV book; #X obj 683 458 < 0.05; #X text 612 326 ( adjust to your situation : default : 0.05 ); -#X connect 0 0 42 0; +#X obj 548 -27 loadbang; +#X msg 548 -2 colorspace RGBA; +#X msg 652 -2 colorspace RGB; +#X msg 611 -28 colorspace Grey; +#X connect 0 0 40 0; #X connect 1 0 2 0; #X connect 4 0 5 0; #X connect 5 0 4 0; @@ -119,44 +121,49 @@ example code from OpenCV book; #X connect 10 0 13 1; #X connect 11 0 12 0; #X connect 12 0 13 0; -#X connect 13 0 62 0; +#X connect 13 0 60 0; #X connect 13 2 9 0; #X connect 14 0 13 0; #X connect 15 0 14 0; -#X connect 16 0 17 0; -#X connect 17 0 13 0; -#X connect 18 0 66 0; -#X connect 20 0 21 0; -#X connect 22 0 24 0; -#X connect 22 0 66 1; -#X connect 27 0 63 0; -#X connect 28 0 27 0; -#X connect 30 0 63 0; -#X connect 31 0 30 0; -#X connect 33 0 63 0; -#X connect 35 0 33 0; -#X connect 38 0 43 0; -#X connect 42 0 60 0; -#X connect 43 0 45 0; -#X connect 44 0 61 0; -#X connect 45 0 42 0; -#X connect 46 0 56 2; -#X connect 48 0 49 0; -#X connect 49 0 46 0; -#X connect 50 0 46 0; -#X connect 51 0 54 0; -#X connect 51 0 57 2; -#X connect 52 0 53 0; -#X connect 53 0 51 0; -#X connect 55 0 58 0; -#X connect 56 0 44 0; -#X connect 56 0 55 0; -#X connect 56 0 63 1; -#X connect 57 0 63 0; -#X connect 59 0 56 0; -#X connect 60 0 59 0; -#X connect 61 0 13 0; -#X connect 62 0 57 0; -#X connect 63 0 1 0; -#X connect 63 1 18 0; -#X connect 66 0 20 0; +#X connect 16 0 64 0; +#X connect 18 0 19 0; +#X connect 20 0 22 0; +#X connect 20 0 64 1; +#X connect 25 0 61 0; +#X connect 26 0 25 0; +#X connect 28 0 61 0; +#X connect 29 0 28 0; +#X connect 31 0 61 0; +#X connect 33 0 31 0; +#X connect 36 0 41 0; +#X connect 40 0 58 0; +#X connect 41 0 43 0; +#X connect 42 0 59 0; +#X connect 43 0 40 0; +#X connect 44 0 54 2; +#X connect 46 0 47 0; +#X connect 47 0 44 0; +#X connect 48 0 44 0; +#X connect 49 0 52 0; +#X connect 49 0 55 2; +#X connect 50 0 51 0; +#X connect 51 0 49 0; +#X connect 53 0 56 0; +#X connect 54 0 42 0; +#X connect 54 0 53 0; +#X connect 54 0 61 1; +#X connect 55 0 61 0; +#X connect 57 0 54 0; +#X connect 58 0 57 0; +#X connect 59 0 13 0; +#X connect 60 0 55 0; +#X connect 61 0 1 0; +#X connect 61 1 16 0; +#X connect 64 0 18 0; +#X connect 66 0 67 0; +#X connect 67 0 13 0; +#X connect 67 0 40 0; +#X connect 68 0 40 0; +#X connect 68 0 13 0; +#X connect 69 0 13 0; +#X connect 69 0 40 0; diff --git a/pix_opencv_threshold-help.pd b/pix_opencv_threshold-help.pd index 19c1cae..698d4ea 100755 --- a/pix_opencv_threshold-help.pd +++ b/pix_opencv_threshold-help.pd @@ -20,7 +20,7 @@ #X obj 171 266 gemwin; #X msg 164 226 create \, 1; #X msg 252 229 destroy; -#X msg 292 186 frame 15; +#X msg 292 186 frame 5; #X obj 173 176 t b b b; #X connect 1 0 2 0; #X connect 2 0 3 0; @@ -42,10 +42,6 @@ #X obj 180 240 separator; #X obj 170 -57 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 337 144 unpack 0 0 0; -#X floatatom 327 167 5 0 0 3 length - -; -#X floatatom 376 167 5 0 0 3 width - -; -#X floatatom 426 167 5 0 0 3 height - -; #X obj 227 118 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144 -1 -1; #X floatatom 209 83 5 0 10000 1 frame# - -; @@ -53,7 +49,7 @@ #X msg 170 -8 open \$1; #X obj 158 101 pix_film; #X msg 176 35 auto \$1; -#X obj 176 17 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 +#X obj 176 17 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 177 275 translateXYZ 4 0 0; #X obj 178 298 cnv 15 600 180 empty empty empty 20 12 0 14 -4034 -66577 @@ -76,41 +72,43 @@ #X text 566 392 pixel <= threshold set to 0; #X text 590 414 pixel >= threshold set to 0; #X obj 198 384 pix_opencv_threshold; -#X text 399 71 written by Lluis Gomez i Bigorda ( lluisgomez@hangar.org +#X text 402 118 written by Lluis Gomez i Bigorda ( lluisgomez@hangar.org ); -#X text 398 59 used as a filter to detect bright or dark piksels; -#X text 399 46 pix_opencv_threshold : pixel thresholding; +#X text 401 106 used as a filter to detect bright or dark piksels; +#X text 402 93 pix_opencv_threshold : pixel thresholding; #X text 339 360 ( default 50 ); -#X msg 187 58 colorspace Grey; -#X connect 0 0 19 0; +#X obj 247 27 loadbang; +#X msg 247 52 colorspace RGBA; +#X msg 351 52 colorspace RGB; +#X msg 310 26 colorspace Grey; +#X connect 0 0 15 0; #X connect 1 0 2 0; #X connect 4 0 5 0; #X connect 5 0 4 0; #X connect 6 0 7 0; #X connect 8 0 6 0; #X connect 8 0 9 0; -#X connect 9 0 22 0; -#X connect 10 0 17 0; +#X connect 9 0 18 0; +#X connect 10 0 13 0; #X connect 11 0 12 0; -#X connect 11 1 13 0; -#X connect 11 2 14 0; -#X connect 15 0 16 0; -#X connect 16 0 19 1; -#X connect 17 0 18 0; -#X connect 18 0 19 0; -#X connect 19 0 8 0; -#X connect 19 1 11 0; -#X connect 19 2 15 0; -#X connect 20 0 19 0; -#X connect 21 0 20 0; -#X connect 22 0 41 0; -#X connect 25 0 41 2; -#X connect 26 0 41 0; -#X connect 27 0 41 1; -#X connect 29 0 26 0; -#X connect 30 0 26 0; -#X connect 31 0 26 0; -#X connect 32 0 26 0; -#X connect 33 0 26 0; -#X connect 41 0 1 0; -#X connect 46 0 19 0; +#X connect 12 0 15 1; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 8 0; +#X connect 15 2 11 0; +#X connect 16 0 15 0; +#X connect 17 0 16 0; +#X connect 18 0 37 0; +#X connect 21 0 37 2; +#X connect 22 0 37 0; +#X connect 23 0 37 1; +#X connect 25 0 22 0; +#X connect 26 0 22 0; +#X connect 27 0 22 0; +#X connect 28 0 22 0; +#X connect 29 0 22 0; +#X connect 37 0 1 0; +#X connect 42 0 43 0; +#X connect 43 0 15 0; +#X connect 44 0 15 0; +#X connect 45 0 15 0; |