aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Villeret <avilleret@users.sourceforge.net>2012-12-19 07:50:32 +0000
committerAntoine Villeret <avilleret@users.sourceforge.net>2012-12-19 07:50:32 +0000
commitd8a6537813878b9f6d74b4c1ebfaaa219291fc3c (patch)
tree24062397d8c10e3139720dab360247405f31cf7f
parentab713f07610a223600d964ccc1a9c72c99b111ac (diff)
fix extension for pix_opencv_matchshape and pix_opencv_contours
svn path=/trunk/externals/pix_opencv/; revision=16700
-rw-r--r--pix_opencv_contours-help.pd60
-rw-r--r--pix_opencv_contours.cc2
2 files changed, 33 insertions, 29 deletions
diff --git a/pix_opencv_contours-help.pd b/pix_opencv_contours-help.pd
index c845e1d..d12cffd 100644
--- a/pix_opencv_contours-help.pd
+++ b/pix_opencv_contours-help.pd
@@ -1,4 +1,4 @@
-#N canvas 804 301 836 479 10;
+#N canvas 802 307 836 479 10;
#X obj 472 38 cnv 15 220 250 empty empty empty 20 12 0 14 -228992 -66577
0;
#X obj 11 56 cnv 15 450 100 empty empty empty 20 12 0 14 -233017 -66577
@@ -11,16 +11,12 @@
#X text 21 166 Arguments:;
#X text 13 281 Outlets:;
#X text 478 20 Example:;
-#X text 37 5 Synopsis: [pix_opencv_contours_convexhull2];
#X text 58 21 Class: pix_opencv;
#X text 11 60 Description: finds contours;
#X text 67 176 none;
#X text 31 234 Inlet 1: message: area [float];
#X text 31 244 Inlet 1: message: epsilon [float];
#X obj 541 151 pix_texture;
-#X text 37 75 [pix_opencv_contours_convexhull2] finds contours in incomming
-image \, simplifies it according to the epsilon value and outputs contours
-with area greater than area value on second outlet;
#X obj 487 171 pix_gray;
#X obj 487 141 pix_buf;
#N canvas 868 284 919 782 drawcontours 0;
@@ -430,7 +426,6 @@ with area greater than area value on second outlet;
#X text 355 214 Create window:;
#X text 31 224 Inlet 1: binarized image;
#X text 21 343 info;
-#X text 21 393 contour;
#X text 31 403 <number of segments> <2> <x \, y corner coordinate pairs>
;
#X obj 575 265 route contour;
@@ -439,27 +434,36 @@ with area greater than area value on second outlet;
#X text 26 302 Outlet 2: contour output;
#X text 26 292 Outlet 1: gemlist output;
#X text 26 312 Outlet 3: info output;
-#X connect 14 0 24 0;
-#X connect 16 0 45 0;
-#X connect 17 0 16 0;
-#X connect 19 0 17 0;
-#X connect 19 1 26 0;
-#X connect 19 2 18 1;
+#X text 37 5 Synopsis: [pix_opencv_contours];
+#X text 37 75 [pix_opencv_contours] finds contours in incomming image
+\, simplifies it according to the epsilon value and outputs contours
+with area greater than area value on second outlet;
+#X text 22 392 contour (for each of them);
+#X text 527 386 see also : [pix_opencv_contour_convexhull];
+#X text 37 114 contrary to [pix_opencv_contour_convexhull] \, [pix_opencv_contours]
+outputs all contours found not only the biggest and it find also concave
+contours.;
+#X connect 13 0 22 0;
+#X connect 14 0 42 0;
+#X connect 15 0 14 0;
+#X connect 17 0 15 0;
+#X connect 17 1 24 0;
+#X connect 17 2 16 1;
+#X connect 18 0 17 0;
+#X connect 19 0 42 0;
#X connect 20 0 19 0;
-#X connect 21 0 45 0;
-#X connect 22 0 21 0;
-#X connect 23 0 35 0;
-#X connect 23 0 29 0;
-#X connect 25 0 17 0;
-#X connect 25 1 14 0;
+#X connect 21 0 33 0;
+#X connect 21 0 27 0;
+#X connect 23 0 15 0;
+#X connect 23 1 13 0;
+#X connect 24 0 23 0;
+#X connect 25 0 42 0;
#X connect 26 0 25 0;
-#X connect 27 0 45 0;
-#X connect 28 0 27 0;
-#X connect 29 0 28 0;
-#X connect 31 0 32 0;
-#X connect 32 0 31 0;
-#X connect 35 0 22 0;
-#X connect 43 0 18 0;
-#X connect 44 0 36 0;
-#X connect 45 1 43 0;
-#X connect 45 2 44 0;
+#X connect 27 0 26 0;
+#X connect 29 0 30 0;
+#X connect 30 0 29 0;
+#X connect 33 0 20 0;
+#X connect 40 0 16 0;
+#X connect 41 0 34 0;
+#X connect 42 1 40 0;
+#X connect 42 2 41 0;
diff --git a/pix_opencv_contours.cc b/pix_opencv_contours.cc
index 842cbf2..7c0bdc0 100644
--- a/pix_opencv_contours.cc
+++ b/pix_opencv_contours.cc
@@ -123,7 +123,7 @@ void pix_opencv_contours :: processGrayImage(imageStruct &image)
}
SETFLOAT(info, (float) count);
if (count) outlet_anything(m_dataout_right, gensym("info"), count*14+2, info);
- else outlet_list(m_dataout_right, gensym("info"), 1, 0);
+ else outlet_float(m_dataout_right, 0);
for( std::vector<std::vector<cv::Point> >::iterator it = m_contours.begin(); it != m_contours.end(); ++it ) {
if (!it->empty() && it->size() > 2) {