diff options
author | N.N. <sevyves@users.sourceforge.net> | 2009-08-30 20:38:26 +0000 |
---|---|---|
committer | N.N. <sevyves@users.sourceforge.net> | 2009-08-30 20:38:26 +0000 |
commit | 98f00d5f6e0db2e39779e0ab2e05ce3b78209fa0 (patch) | |
tree | 985449502b34c4dfa9a9e19f0309f722fe5d2918 | |
parent | f29ff03b88ab33d418c575a28447d65167d054bb (diff) |
added adaptive threshold + fix help patches ( frame 15 )
svn path=/trunk/externals/pix_opencv/; revision=12148
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | pix_opencv_bgsubstract-help.pd | 36 | ||||
-rw-r--r-- | pix_opencv_contours_boundingrect-help.pd | 100 | ||||
-rw-r--r-- | pix_opencv_contours_boundingrect.cc | 95 | ||||
-rw-r--r-- | pix_opencv_contours_boundingrect.h | 9 | ||||
-rw-r--r-- | pix_opencv_contours_convexity-help.pd | 36 | ||||
-rwxr-xr-x | pix_opencv_dft-help.pd | 32 | ||||
-rw-r--r-- | pix_opencv_distrans-help.pd | 82 | ||||
-rw-r--r-- | pix_opencv_edge-help.pd | 32 | ||||
-rw-r--r-- | pix_opencv_haarcascade-help.pd | 32 | ||||
-rwxr-xr-x | pix_opencv_hist_compare-help.pd | 30 | ||||
-rwxr-xr-x | pix_opencv_hist_compare.cc | 24 | ||||
-rwxr-xr-x | pix_opencv_knear-help.pd | 63 | ||||
-rw-r--r-- | pix_opencv_laplace-help.pd | 34 | ||||
-rw-r--r-- | pix_opencv_morphology-help.pd | 30 | ||||
-rw-r--r-- | pix_opencv_motempl-help.pd | 32 | ||||
-rw-r--r-- | pix_opencv_motempl.cc | 1 | ||||
-rwxr-xr-x | pix_opencv_threshold-help.pd | 34 |
18 files changed, 428 insertions, 276 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 +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 all: $(SOURCES:.cc=.$(EXTENSION)) diff --git a/pix_opencv_bgsubstract-help.pd b/pix_opencv_bgsubstract-help.pd index cd3aa34..cfdfd55 100644 --- a/pix_opencv_bgsubstract-help.pd +++ b/pix_opencv_bgsubstract-help.pd @@ -2,17 +2,14 @@ #X obj 618 -33 gemhead; #X obj 364 374 pix_texture; #X obj 364 402 square 2; -#X obj 20 159 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 +#X obj 20 165 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 454 304 gemwin 0; -#X obj 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,19 +17,26 @@ #X connect 0 0 1 0; #X connect 1 0 2 0; #X restore 289 80 pd Gem.init; +#X obj 192 276 gemwin; +#X msg 191 223 create \, 1; +#X msg 267 224 destroy; +#X msg 313 196 frame 15; +#X obj 194 186 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X restore 25 203 pd gemwin; -#X msg 25 179 destroy; -#X text 21 159 Create window and render; +#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 25 209 pd gemwin; +#X msg 25 185 destroy; +#X text 21 165 Create window and render; #X obj 200 368 pix_texture; #X obj 200 396 square 2; #X obj 266 167 translateXYZ -2 0 0; diff --git a/pix_opencv_contours_boundingrect-help.pd b/pix_opencv_contours_boundingrect-help.pd index 10376d5..eadc72e 100644 --- a/pix_opencv_contours_boundingrect-help.pd +++ b/pix_opencv_contours_boundingrect-help.pd @@ -1,18 +1,15 @@ -#N canvas 68 50 1040 775 10; +#N canvas 73 50 1040 775 10; #X obj 441 -19 gemhead; -#X obj 365 456 pix_texture; -#X obj 365 484 square 2; -#X obj 21 444 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 +#X obj 364 510 pix_texture; +#X obj 364 538 square 2; +#X obj 25 436 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 5 49 454 304 gemwin 0; -#X obj 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 92 178 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,24 +17,31 @@ #X connect 0 0 1 0; #X connect 1 0 2 0; #X restore 289 80 pd Gem.init; +#X obj 161 230 gemwin; +#X msg 160 177 create \, 1; +#X msg 236 178 destroy; +#X msg 282 150 frame 15; +#X obj 163 140 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X restore 26 488 pd gemwin; -#X msg 26 464 destroy; -#X text 22 444 Create window and render; +#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 30 480 pd gemwin; +#X msg 30 456 destroy; +#X text 26 436 Create window and render; #X obj 200 368 pix_texture; #X obj 200 396 square 2; #X obj 266 167 translateXYZ -2 0 0; #X obj 281 199 separator; -#X obj 344 254 cnv 15 550 180 empty empty empty 20 12 0 14 -24198 -66577 +#X obj 344 246 cnv 15 550 250 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; @@ -55,24 +59,24 @@ #X obj 479 5 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 281 227 translateXYZ 4 0 0; -#X floatatom 482 374 5 0 0 0 - - -; -#X obj 365 406 pix_opencv_contours_boundingrect; +#X floatatom 481 432 5 0 0 0 - - -; +#X obj 364 464 pix_opencv_contours_boundingrect; #X obj 378 110 pix_invert; #X obj 319 135 pix_threshold; #X floatatom 322 103 5 0 0 0 - - -; #X msg 289 101 0.33; #X obj 234 101 loadbang; -#X text 517 370 min area in pixels (default 1); -#X floatatom 568 388 5 0 0 0 - - -; -#X text 606 387 max area in pixels (default 76800); -#X floatatom 498 542 5 0 0 0 - - -; -#X floatatom 533 542 5 0 0 0 - - -; -#X floatatom 570 542 5 0 0 0 - - -; -#X floatatom 604 542 5 0 0 0 - - -; -#X obj 495 513 unpack 0 0 0 0 0; -#X obj 495 462 route 0 1 2 3 4; -#X text 648 542 Xorigin Yorigin Width Height; -#X text 555 480 For each contour detected; +#X text 516 428 min area in pixels (default 1); +#X floatatom 567 446 5 0 0 0 - - -; +#X text 605 445 max area in pixels (default 76800); +#X floatatom 497 596 5 0 0 0 - - -; +#X floatatom 532 596 5 0 0 0 - - -; +#X floatatom 569 596 5 0 0 0 - - -; +#X floatatom 603 596 5 0 0 0 - - -; +#X obj 494 567 unpack 0 0 0 0 0; +#X obj 494 516 route 0 1 2 3 4; +#X text 647 596 Xorigin Yorigin Width Height; +#X text 554 534 For each contour detected; #X text 655 -107 It is useful as a motion tracker if you have well isolated silouets of the objects you want to track.; #X msg 385 260 mode \$1; @@ -100,13 +104,24 @@ 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 pix_opencv_morphology to transform the contours of the shapes to be analyzed..; -#X msg 490 350 clear; -#X floatatom 598 445 5 0 0 0 - - -; -#X text 636 446 number of contours; +#X floatatom 597 499 5 0 0 0 - - -; +#X text 635 500 number of contours; #X msg 531 87 colorspace RGBA; #X msg 521 66 colorspace RGB; #X msg 513 46 colorspace Gray; #X obj 562 21 loadbang; +#X msg 462 355 nightmode \$1; +#X obj 552 356 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 541 377 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 554 399 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X msg 481 376 draw \$1; +#X text 568 375 draw bounding rectangle ( default : on ); +#X msg 496 397 show \$1; +#X text 581 396 draw the detected contours ( default : off ); +#X text 575 356 hide original image ( default : off ); #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -132,7 +147,7 @@ to transform the contours of the shapes to be analyzed..; #X connect 25 0 26 1; #X connect 26 0 1 0; #X connect 26 1 40 0; -#X connect 26 2 60 0; +#X connect 26 2 59 0; #X connect 27 0 28 0; #X connect 28 0 9 0; #X connect 29 0 28 1; @@ -152,8 +167,13 @@ to transform the contours of the shapes to be analyzed..; #X connect 51 0 50 0; #X connect 52 0 53 0; #X connect 53 0 26 0; -#X connect 59 0 26 0; +#X connect 61 0 21 0; #X connect 62 0 21 0; #X connect 63 0 21 0; -#X connect 64 0 21 0; -#X connect 65 0 62 0; +#X connect 64 0 61 0; +#X connect 65 0 26 0; +#X connect 66 0 65 0; +#X connect 67 0 69 0; +#X connect 68 0 71 0; +#X connect 69 0 26 0; +#X connect 71 0 26 0; diff --git a/pix_opencv_contours_boundingrect.cc b/pix_opencv_contours_boundingrect.cc index 8a21b0d..e3f124e 100644 --- a/pix_opencv_contours_boundingrect.cc +++ b/pix_opencv_contours_boundingrect.cc @@ -44,6 +44,9 @@ pix_opencv_contours_boundingrect :: pix_opencv_contours_boundingrect() rgb = NULL; x_ftolerance = 5; x_mmove = 10; + x_nightmode = 0; + x_show = 0; + x_draw = 1; x_cmode = CV_RETR_LIST; x_cmethod = CV_CHAIN_APPROX_SIMPLE; @@ -131,6 +134,10 @@ void pix_opencv_contours_boundingrect :: processRGBAImage(imageStruct &image) // Convert to grayscale cvCvtColor(orig, gray, CV_RGBA2GRAY); + if ( x_nightmode ) + { + cvZero( orig ); + } CvSeq* contours; CvMemStorage* stor02; @@ -178,9 +185,17 @@ void pix_opencv_contours_boundingrect :: processRGBAImage(imageStruct &image) oi = this->mark(rect.x, rect.y ); } - cvRectangle( orig, cvPoint(rect.x,rect.y), cvPoint(rect.x+rect.width,rect.y+rect.height), CV_RGB(255,0,0), 2, 8 , 0 ); - sprintf( tindex, "%d", oi ); - cvPutText( orig, tindex, cvPoint(rect.x,rect.y), &font, CV_RGB(255,255,255)); + if ( x_draw ) + { + cvRectangle( orig, cvPoint(rect.x,rect.y), cvPoint(rect.x+rect.width,rect.y+rect.height), CV_RGB(255,0,0), 2, 8 , 0 ); + sprintf( tindex, "%d", oi ); + cvPutText( orig, tindex, cvPoint(rect.x,rect.y), &font, CV_RGB(255,255,255)); + } + + if ( x_show ) + { + cvDrawContours( orig, contours, CV_RGB(255,255,255), CV_RGB(255,255,255), 0, 1, 8, cvPoint(0,0) ); + } t_atom rlist[4]; SETFLOAT(&rlist[0], oi); @@ -242,6 +257,10 @@ void pix_opencv_contours_boundingrect :: processRGBImage(imageStruct &image) // Convert to grayscale cvCvtColor(rgb, gray, CV_RGB2GRAY); + if ( x_nightmode ) + { + cvZero( rgb ); + } CvSeq* contours; CvMemStorage* stor02; @@ -289,9 +308,17 @@ void pix_opencv_contours_boundingrect :: processRGBImage(imageStruct &image) oi = this->mark(rect.x, rect.y ); } - cvRectangle( rgb, cvPoint(rect.x,rect.y), cvPoint(rect.x+rect.width,rect.y+rect.height), CV_RGB(255,0,0), 2, 8 , 0 ); - sprintf( tindex, "%d", oi ); - cvPutText( rgb, tindex, cvPoint(rect.x,rect.y), &font, CV_RGB(255,255,255)); + if ( x_draw ) + { + cvRectangle( rgb, cvPoint(rect.x,rect.y), cvPoint(rect.x+rect.width,rect.y+rect.height), CV_RGB(255,0,0), 2, 8 , 0 ); + sprintf( tindex, "%d", oi ); + cvPutText( rgb, tindex, cvPoint(rect.x,rect.y), &font, CV_RGB(255,255,255)); + } + + if ( x_show ) + { + cvDrawContours( rgb, contours, CV_RGB(255,255,255), CV_RGB(255,255,255), 0, 1, 8, cvPoint(0,0) ); + } t_atom rlist[4]; SETFLOAT(&rlist[0], oi); @@ -359,6 +386,10 @@ void pix_opencv_contours_boundingrect :: processGrayImage(imageStruct &image) // http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html memcpy( gray->imageData, image.data, image.xsize*image.ysize ); memcpy( cnt_img->imageData, image.data, image.xsize*image.ysize ); + if ( x_nightmode ) + { + cvZero( cnt_img ); + } CvSeq* contours; CvMemStorage* stor02; @@ -406,9 +437,17 @@ void pix_opencv_contours_boundingrect :: processGrayImage(imageStruct &image) oi = this->mark(rect.x, rect.y ); } - cvRectangle( cnt_img, cvPoint(rect.x,rect.y), cvPoint(rect.x+rect.width,rect.y+rect.height), cvScalarAll(255), 2, 8 , 0 ); - sprintf( tindex, "%d", oi ); - cvPutText( cnt_img, tindex, cvPoint(rect.x,rect.y), &font, cvScalarAll(255)); + if ( x_draw ) + { + cvRectangle( cnt_img, cvPoint(rect.x,rect.y), cvPoint(rect.x+rect.width,rect.y+rect.height), cvScalarAll(255), 2, 8 , 0 ); + sprintf( tindex, "%d", oi ); + cvPutText( cnt_img, tindex, cvPoint(rect.x,rect.y), &font, cvScalarAll(255)); + } + + if ( x_show ) + { + cvDrawContours( cnt_img, contours, CV_RGB(255,255,255), CV_RGB(255,255,255), 0, 1, 8, cvPoint(0,0) ); + } t_atom rlist[4]; SETFLOAT(&rlist[0], oi); @@ -555,6 +594,21 @@ void pix_opencv_contours_boundingrect :: floatClearMess (void) } } +void pix_opencv_contours_boundingrect :: floatNightmodeMess (float nightmode) +{ + if ( ((int)nightmode==1) || ((int)nightmode==0) ) x_nightmode = (int)nightmode; +} + +void pix_opencv_contours_boundingrect :: floatShowMess (float show) +{ + if ( ((int)show==1) || ((int)show==0) ) x_show = (int)show; +} + +void pix_opencv_contours_boundingrect :: floatDrawMess (float draw) +{ + if ( ((int)draw==1) || ((int)draw==0) ) x_draw = (int)draw; +} + ///////////////////////////////////////////////////////// // static member function // @@ -574,7 +628,13 @@ void pix_opencv_contours_boundingrect :: obj_setupCallback(t_class *classPtr) class_addmethod(classPtr, (t_method)&pix_opencv_contours_boundingrect::floatCMethodMessCallback, gensym("cmethod"), A_FLOAT, A_NULL); class_addmethod(classPtr, (t_method)&pix_opencv_contours_boundingrect::floatClearMessCallback, - gensym("clear"), A_FLOAT, A_NULL); + gensym("clear"), A_NULL); + class_addmethod(classPtr, (t_method)&pix_opencv_contours_boundingrect::floatNightmodeMessCallback, + gensym("nightmode"), A_FLOAT, A_NULL); + class_addmethod(classPtr, (t_method)&pix_opencv_contours_boundingrect::floatShowMessCallback, + gensym("show"), A_FLOAT, A_NULL); + class_addmethod(classPtr, (t_method)&pix_opencv_contours_boundingrect::floatDrawMessCallback, + gensym("draw"), A_FLOAT, A_NULL); } void pix_opencv_contours_boundingrect :: floatMaxAreaMessCallback(void *data, t_floatarg maxarea) @@ -611,3 +671,18 @@ void pix_opencv_contours_boundingrect :: floatClearMessCallback(void *data) { GetMyClass(data)->floatClearMess(); } + +void pix_opencv_contours_boundingrect :: floatNightmodeMessCallback(void *data, t_floatarg nightmode) +{ + GetMyClass(data)->floatNightmodeMess(nightmode); +} + +void pix_opencv_contours_boundingrect :: floatShowMessCallback(void *data, t_floatarg show) +{ + GetMyClass(data)->floatShowMess(show); +} + +void pix_opencv_contours_boundingrect :: floatDrawMessCallback(void *data, t_floatarg draw) +{ + GetMyClass(data)->floatDrawMess(draw); +} diff --git a/pix_opencv_contours_boundingrect.h b/pix_opencv_contours_boundingrect.h index cdec706..81517b9 100644 --- a/pix_opencv_contours_boundingrect.h +++ b/pix_opencv_contours_boundingrect.h @@ -69,6 +69,9 @@ class GEM_EXTERN pix_opencv_contours_boundingrect : public GemPixObj void floatCModeMess(float maxarea); void floatCMethodMess(float maxarea); void floatClearMess(void); + void floatNightmodeMess(float nightmode); + void floatShowMess(float show); + void floatDrawMess(float draw); int mark(float fx, float fy ); void deleteMark(float findex); // The new minimal/maximal area @@ -82,6 +85,9 @@ class GEM_EXTERN pix_opencv_contours_boundingrect : public GemPixObj int x_found[MAX_MARKERS]; int x_ftolerance; int x_mmove; + int x_nightmode; + int x_draw; + int x_show; // contours retrieval mode int x_cmode; @@ -101,6 +107,9 @@ class GEM_EXTERN pix_opencv_contours_boundingrect : public GemPixObj static void floatCModeMessCallback(void *data, t_floatarg cmode); static void floatCMethodMessCallback(void *data, t_floatarg cmethod); static void floatClearMessCallback(void *data); + static void floatNightmodeMessCallback(void *data, t_floatarg nightmode); + static void floatShowMessCallback(void *data, t_floatarg show); + static void floatDrawMessCallback(void *data, t_floatarg draw); ///////// // IplImage needed diff --git a/pix_opencv_contours_convexity-help.pd b/pix_opencv_contours_convexity-help.pd index 5552b48..b3fc71b 100644 --- a/pix_opencv_contours_convexity-help.pd +++ b/pix_opencv_contours_convexity-help.pd @@ -1,18 +1,15 @@ -#N canvas 1 49 1424 780 10; +#N canvas -23 38 1018 740 10; #X obj 264 18 gemhead; #X obj 195 378 pix_texture; #X obj 195 406 square 2; #X obj 558 -22 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 454 304 gemwin 0; -#X obj 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,19 +17,26 @@ #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 15; +#X obj 162 170 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 563 22 pd gemwin; -#X msg 563 -2 destroy; -#X text 559 -22 Create window and render; +#X msg 564 0 create; +#X text 560 -20 Create window and render; #X obj 31 372 pix_texture; #X obj 31 400 square 2; #X obj 97 171 translateXYZ -2 0 0; @@ -52,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 0 1 +#X obj 348 12 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X obj 195 263 translateXYZ 4 0 0; #X obj 209 114 pix_invert; diff --git a/pix_opencv_dft-help.pd b/pix_opencv_dft-help.pd index 39a24c4..3096cc0 100755 --- a/pix_opencv_dft-help.pd +++ b/pix_opencv_dft-help.pd @@ -5,14 +5,11 @@ #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 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,19 +17,26 @@ #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 15; +#X obj 162 170 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 15 -26 Create window and render; +#X msg 14 -5 destroy; +#X text 15 -23 Create window and render; #X obj 200 368 pix_texture; #X obj 200 396 square 2; #X obj 367 159 translateXYZ -2 0 0; diff --git a/pix_opencv_distrans-help.pd b/pix_opencv_distrans-help.pd index a8e8dd7..6498fb4 100644 --- a/pix_opencv_distrans-help.pd +++ b/pix_opencv_distrans-help.pd @@ -1,18 +1,15 @@ -#N canvas 1 49 1424 780 10; +#N canvas 0 0 871 658 10; #X obj 286 -33 gemhead; #X obj 363 431 pix_texture; #X obj 363 459 square 2; -#X obj 20 159 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 +#X obj 21 160 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 454 304 gemwin 0; -#X obj 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,24 +17,30 @@ #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 15; +#X obj 162 170 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 25 203 pd gemwin; -#X msg 25 179 destroy; -#X text 21 159 Create window and render; +#X msg 26 180 create; +#X text 22 160 Create window and render; #X obj 200 368 pix_texture; #X obj 200 396 square 2; #X obj 266 167 translateXYZ -2 0 0; #X obj 367 224 separator; -#X floatatom 518 386 5 0 0 0 - - -; #X obj 335 278 cnv 15 400 150 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 @@ -53,7 +56,7 @@ #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 517 8 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X msg 528 50 colorspace Grey; #X obj 367 253 translateXYZ 4 0 0; @@ -74,33 +77,34 @@ video frames; #X text 23 80 written by lluis gomez i bigorda ( lluisgomez@hangar.org ); #X text 22 41 pix_opencv_distrans : distance processing; -#X connect 0 0 22 0; +#X floatatom 512 384 5 0 0 0 - - -; +#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 26 0; -#X connect 11 0 27 1; -#X connect 13 0 20 0; -#X connect 14 0 15 0; -#X connect 14 1 16 0; -#X connect 14 2 17 0; -#X connect 18 0 19 0; -#X connect 19 0 22 1; +#X connect 10 0 25 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 22 0; -#X connect 22 0 9 0; -#X connect 22 1 14 0; -#X connect 22 2 18 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 23 0; -#X connect 25 0 22 0; -#X connect 26 0 27 0; -#X connect 27 0 1 0; +#X connect 24 0 21 0; +#X connect 25 0 26 0; +#X connect 26 0 1 0; +#X connect 27 0 26 0; #X connect 28 0 27 0; -#X connect 29 0 28 0; -#X connect 35 0 27 0; -#X connect 36 0 27 0; -#X connect 37 0 27 0; +#X connect 34 0 26 0; +#X connect 35 0 26 0; +#X connect 36 0 26 0; +#X connect 40 0 26 1; diff --git a/pix_opencv_edge-help.pd b/pix_opencv_edge-help.pd index dfbca66..3598e54 100644 --- a/pix_opencv_edge-help.pd +++ b/pix_opencv_edge-help.pd @@ -5,14 +5,11 @@ #X obj 23 230 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 454 304 gemwin 0; -#X obj 132 136 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; -#X obj 67 41 route create; +#X obj 69 37 route create; #X msg 67 70 set destroy; #X msg 182 68 set create; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,19 +17,26 @@ #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 15; +#X obj 162 170 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 28 274 pd gemwin; #X msg 28 250 destroy; -#X text 24 230 Create window and render; +#X text 29 232 Create window and render; #X obj 266 365 pix_texture; #X obj 266 393 square 2; #X obj 266 167 translateXYZ -2 0 0; diff --git a/pix_opencv_haarcascade-help.pd b/pix_opencv_haarcascade-help.pd index 3aa9b81..4af36e2 100644 --- a/pix_opencv_haarcascade-help.pd +++ b/pix_opencv_haarcascade-help.pd @@ -1,18 +1,15 @@ -#N canvas 386 81 1091 744 10; +#N canvas 349 81 1091 744 10; #X obj 266 -83 gemhead; #X obj 87 544 pix_texture; #X obj 87 577 square 2; #X obj 9 -74 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 454 304 gemwin 0; -#X obj 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,18 +17,25 @@ #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 15; +#X obj 162 170 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 -30 pd gemwin; -#X msg 14 -54 destroy; +#X msg 14 -52 destroy; #X text 10 -74 Create window and render; #X obj 5 544 pix_texture; #X obj 5 572 square 2; diff --git a/pix_opencv_hist_compare-help.pd b/pix_opencv_hist_compare-help.pd index 17268b7..fa34135 100755 --- a/pix_opencv_hist_compare-help.pd +++ b/pix_opencv_hist_compare-help.pd @@ -5,14 +5,11 @@ #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 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,19 +17,26 @@ #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 15; +#X obj 162 170 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 15 -26 Create window and render; +#X text 12 -26 Create window and render; #X obj 216 478 pix_texture; #X obj 216 506 square 2; #X obj 367 159 translateXYZ -2 0 0; diff --git a/pix_opencv_hist_compare.cc b/pix_opencv_hist_compare.cc index 865b090..ccdb50c 100755 --- a/pix_opencv_hist_compare.cc +++ b/pix_opencv_hist_compare.cc @@ -194,14 +194,14 @@ void pix_opencv_hist_compare :: processRGBAImage(imageStruct &image) cvCalcHist( planes, hist, 0, 0 ); //Compute histogram cvNormalizeHist( hist, 1.0 ); //Normalize it - double tato[MAX_HISTOGRAMS_TO_COMPARE]; - t_atom datalist[MAX_HISTOGRAMS_TO_COMPARE]; + double tato[nbsaved]; + t_atom datalist[nbsaved]; int nearest = -1; double max = 0; int n; if ( nbsaved > 0 ) - for (n=0; n<MAX_HISTOGRAMS_TO_COMPARE; n++) { + for (n=0; n<nbsaved; n++) { tato[n] = cvCompareHist(hist, saved_hist[n], CV_COMP_INTERSECT); SETFLOAT(&datalist[n], tato[n]); if (tato[n]>max) { @@ -212,7 +212,7 @@ void pix_opencv_hist_compare :: processRGBAImage(imageStruct &image) if ( nbsaved > 0 ) { outlet_float(m_dataout, (float)nearest); - outlet_list( m_measureout, 0, MAX_HISTOGRAMS_TO_COMPARE , datalist ); + outlet_list( m_measureout, 0, nbsaved , datalist ); } else outlet_float(m_dataout, -1.0); @@ -326,14 +326,14 @@ void pix_opencv_hist_compare :: processRGBImage(imageStruct &image) cvCalcHist( planes, hist, 0, 0 ); //Compute histogram cvNormalizeHist( hist, 1.0 ); //Normalize it - double tato[MAX_HISTOGRAMS_TO_COMPARE]; - t_atom datalist[MAX_HISTOGRAMS_TO_COMPARE]; + double tato[nbsaved]; + t_atom datalist[nbsaved]; int nearest = -1; double max = 0; int n; if ( nbsaved > 0 ) - for (n=0; n<MAX_HISTOGRAMS_TO_COMPARE; n++) { + for (n=0; n<nbsaved; n++) { tato[n] = cvCompareHist(hist, saved_hist[n], CV_COMP_INTERSECT); SETFLOAT(&datalist[n], tato[n]); if (tato[n]>max) { @@ -344,7 +344,7 @@ void pix_opencv_hist_compare :: processRGBImage(imageStruct &image) if ( nbsaved > 0 ) { outlet_float(m_dataout, (float)nearest); - outlet_list( m_measureout, 0, MAX_HISTOGRAMS_TO_COMPARE , datalist ); + outlet_list( m_measureout, 0, nbsaved , datalist ); } else outlet_float(m_dataout, -1.0); @@ -464,14 +464,14 @@ void pix_opencv_hist_compare :: processGrayImage(imageStruct &image) cvCalcHist( planes, hist, 0, 0 ); //Compute histogram cvNormalizeHist( hist, 1.0 ); //Normalize it - double tato[MAX_HISTOGRAMS_TO_COMPARE]; - t_atom datalist[MAX_HISTOGRAMS_TO_COMPARE]; + double tato[nbsaved]; + t_atom datalist[nbsaved]; int nearest = -1; double max = 0; int n; if ( nbsaved > 0 ) - for (n=0; n<MAX_HISTOGRAMS_TO_COMPARE; n++) { + for (n=0; n<nbsaved; n++) { tato[n] = cvCompareHist(hist, saved_hist[n], CV_COMP_INTERSECT); SETFLOAT(&datalist[n], tato[n]); if (tato[n]>max) { @@ -482,7 +482,7 @@ void pix_opencv_hist_compare :: processGrayImage(imageStruct &image) if ( nbsaved > 0 ) { outlet_float(m_dataout, (float)nearest); - outlet_list( m_measureout, 0, MAX_HISTOGRAMS_TO_COMPARE , datalist ); + outlet_list( m_measureout, 0, nbsaved , datalist ); } else outlet_float(m_dataout, -1.0); diff --git a/pix_opencv_knear-help.pd b/pix_opencv_knear-help.pd index 4620175..eb232ae 100755 --- a/pix_opencv_knear-help.pd +++ b/pix_opencv_knear-help.pd @@ -1,35 +1,38 @@ -#N canvas 266 117 1154 642 10; +#N canvas 435 113 1154 642 10; #X obj 384 31 gemhead; #X obj 365 414 pix_texture; #X obj 365 442 square 2; #X obj 9 -28 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 5 49 454 304 gemwin 0; -#X obj 131 180 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; #X obj 67 39 route create; #X msg 67 70 set destroy; #X msg 182 68 set create; -#X msg 115 143 create \, 1; -#X msg 238 112 destroy; -#X msg 191 141 dimen 256 128; -#X obj 152 119 t b b; +#X msg 156 142 dimen 256 128; +#X obj 127 212 gemwin; +#X msg 120 172 create \, 1; +#X msg 208 175 destroy; +#X msg 248 132 frame 15; +#X obj 129 122 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 9 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 0; -#X connect 9 0 8 0; -#X connect 9 1 6 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 5 0 6 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 1 5 0; +#X connect 10 2 9 0; #X restore 14 16 pd gemwin; #X msg 14 -8 destroy; -#X text 15 -26 Create window and render; +#X text 15 -25 Create window and render; #X obj 200 368 pix_texture; #X obj 200 396 square 2; #X obj 367 159 translateXYZ -2 0 0; @@ -55,14 +58,14 @@ #X text 663 356 Distance of the incoming frame compared to the patterns ; #X obj 384 72 pix_image; -#X msg 560 310 load /usr/local/pd/pdp_opencv/doc/plus 50; #X obj 365 335 pix_opencv_knear /usr/local/pd/pdp_opencv/doc/plus 50 ; #X obj 592 380 print distance; #X obj 572 251 loadbang; #X obj 382 110 pix_grey; -#X text 433 -33 load patterns \, freate the Gem window and then load +#X text 433 -33 load patterns \, create the Gem window and then load a character image; +#X msg 560 310 load /usr/local/pd/pdp_opencv/plus 50; #X connect 0 0 27 0; #X connect 1 0 2 0; #X connect 4 0 5 0; @@ -75,13 +78,13 @@ a character image; #X connect 12 0 20 0; #X connect 13 0 14 0; #X connect 14 0 27 0; -#X connect 15 0 29 0; -#X connect 20 0 29 0; -#X connect 24 0 29 0; -#X connect 27 0 32 0; -#X connect 28 0 29 0; -#X connect 29 0 1 0; -#X connect 29 1 25 0; -#X connect 29 1 30 0; -#X connect 31 0 20 0; -#X connect 32 0 9 0; +#X connect 15 0 28 0; +#X connect 20 0 28 0; +#X connect 24 0 28 0; +#X connect 27 0 31 0; +#X connect 28 0 1 0; +#X connect 28 1 25 0; +#X connect 28 1 29 0; +#X connect 30 0 20 0; +#X connect 31 0 9 0; +#X connect 33 0 28 0; diff --git a/pix_opencv_laplace-help.pd b/pix_opencv_laplace-help.pd index ce65535..f287197 100644 --- a/pix_opencv_laplace-help.pd +++ b/pix_opencv_laplace-help.pd @@ -5,14 +5,11 @@ #X obj 20 159 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 454 304 gemwin 0; -#X obj 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,16 +17,23 @@ #X connect 0 0 1 0; #X connect 1 0 2 0; #X restore 289 80 pd Gem.init; +#X obj 171 266 gemwin; +#X msg 164 226 create \, 1; +#X msg 252 229 destroy; +#X msg 292 186 frame 15; +#X obj 173 176 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 25 203 pd gemwin; #X msg 25 179 destroy; #X text 21 159 Create window and render; @@ -62,10 +66,10 @@ #X msg 476 298 5; #X msg 508 298 7; #X text 371 280 aperture size ( default 3 ); -#X text 26 56 Written by Lluis Gomez i Bigorda ( lluisgomez@hangar.org +#X text 25 60 Written by Lluis Gomez i Bigorda ( lluisgomez@hangar.org ); -#X text 26 45 used as an edge detector; -#X text 25 32 pix_opencv_laplace : laplace filter; +#X text 25 49 used as an edge detector; +#X text 24 36 pix_opencv_laplace : laplace filter; #X connect 0 0 21 0; #X connect 1 0 2 0; #X connect 4 0 5 0; diff --git a/pix_opencv_morphology-help.pd b/pix_opencv_morphology-help.pd index d2532e4..a47ee3a 100644 --- a/pix_opencv_morphology-help.pd +++ b/pix_opencv_morphology-help.pd @@ -5,14 +5,11 @@ #X obj 36 256 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 454 304 gemwin 0; -#X obj 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,16 +17,23 @@ #X connect 0 0 1 0; #X connect 1 0 2 0; #X restore 289 80 pd Gem.init; +#X obj 171 266 gemwin; +#X msg 164 226 create \, 1; +#X msg 252 229 destroy; +#X msg 292 186 frame 15; +#X obj 173 176 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 43 300 pd gemwin; #X msg 43 276 destroy; #X text 39 256 Create window and render; @@ -69,7 +73,7 @@ #X text 524 291 switch open/close and erode/dilate modes; #X text 528 375 number of iterations -10/+10 (be carefull); #X obj 361 405 pix_opencv_morphology; -#X text 467 493 written by Lluis Gomez i Bigorda ( lluisgomez@hangar.org +#X text 468 494 written by Lluis Gomez i Bigorda ( lluisgomez@hangar.org ); #X text 468 455 pdp_opencv_morphology : morphology filter ( erosion / dilatation ); diff --git a/pix_opencv_motempl-help.pd b/pix_opencv_motempl-help.pd index cfd1bbf..b1ac6d0 100644 --- a/pix_opencv_motempl-help.pd +++ b/pix_opencv_motempl-help.pd @@ -1,18 +1,15 @@ -#N canvas 1 49 1424 780 10; +#N canvas 1 49 1025 780 10; #X obj 398 31 gemhead; #X obj 373 555 pix_texture; #X obj 373 583 square 2; #X obj 37 457 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 454 304 gemwin 0; -#X obj 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,19 +17,26 @@ #X connect 0 0 1 0; #X connect 1 0 2 0; #X restore 289 80 pd Gem.init; +#X obj 171 266 gemwin; +#X msg 164 226 create \, 1; +#X msg 252 229 destroy; +#X msg 292 186 frame 15; +#X obj 173 176 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 42 501 pd gemwin; #X msg 42 477 destroy; -#X text 38 457 Create window and render; +#X text 39 460 Create window and render; #X obj 200 368 pix_texture; #X obj 200 396 square 2; #X obj 266 167 translateXYZ -2 0 0; diff --git a/pix_opencv_motempl.cc b/pix_opencv_motempl.cc index 29cded9..cde22b5 100644 --- a/pix_opencv_motempl.cc +++ b/pix_opencv_motempl.cc @@ -37,6 +37,7 @@ pix_opencv_motempl :: pix_opencv_motempl() m_dataout = outlet_new(this->x_obj, 0); mhi_duration = 1.0; + aperture = 3; diff_threshold = 30; last = 0; comp_xsize = 0; diff --git a/pix_opencv_threshold-help.pd b/pix_opencv_threshold-help.pd index f924aea..19c1cae 100755 --- a/pix_opencv_threshold-help.pd +++ b/pix_opencv_threshold-help.pd @@ -1,18 +1,15 @@ -#N canvas 1 49 1424 780 10; +#N canvas 1 49 820 711 10; #X obj 277 -24 gemhead; #X obj 182 509 pix_texture; #X obj 182 537 square 2; #X obj 554 196 cnv 15 220 70 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 454 304 gemwin 0; -#X obj 132 136 gemwin; #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; -#X msg 132 112 create \, 1; -#X msg 238 112 destroy; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; @@ -20,18 +17,25 @@ #X connect 0 0 1 0; #X connect 1 0 2 0; #X restore 289 80 pd Gem.init; +#X obj 171 266 gemwin; +#X msg 164 226 create \, 1; +#X msg 252 229 destroy; +#X msg 292 186 frame 15; +#X obj 173 176 t b b b; +#X connect 1 0 2 0; #X connect 2 0 3 0; -#X connect 3 0 4 0; -#X connect 3 0 6 0; -#X connect 3 1 5 0; -#X connect 3 1 7 0; -#X connect 4 0 1 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 7 0 0 0; -#X connect 8 0 0 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 564 240 pd gemwin; -#X msg 564 222 destroy; +#X msg 564 222 create; #X obj 29 508 pix_texture; #X obj 29 536 square 2; #X obj 158 168 translateXYZ -2 0 0; @@ -54,7 +58,7 @@ #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 0; -#X text 562 202 Create window and render; +#X text 562 199 Create window and render; #X floatatom 306 359 5 0 0 0 - - -; #X msg 490 438 mode \$1; #X floatatom 260 340 5 0 0 0 - - -; |