From dfc508bb15821d1c83211657881601e42af9f62f Mon Sep 17 00:00:00 2001 From: laurentBerger Date: Mon, 11 May 2015 13:45:08 +0200 Subject: [PATCH] problem float constant and position of > in vector --- samples/cpp/exampleBLOB.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/samples/cpp/exampleBLOB.cpp b/samples/cpp/exampleBLOB.cpp index de6f0c607..a1a020f06 100644 --- a/samples/cpp/exampleBLOB.cpp +++ b/samples/cpp/exampleBLOB.cpp @@ -16,7 +16,7 @@ static void help() } -String Legende(SimpleBlobDetector::Params &pAct) +static String Legende(SimpleBlobDetector::Params &pAct) { String s = ""; if (pAct.filterByArea) @@ -103,13 +103,13 @@ int main(int argc, char *argv[]) pDefaultBLOB.maxArea = 5000; pDefaultBLOB.filterByCircularity = false; pDefaultBLOB.minCircularity = 0.9f; - pDefaultBLOB.maxCircularity = std::numeric_limits::max(); + pDefaultBLOB.maxCircularity = (float)1e37; pDefaultBLOB.filterByInertia = false; pDefaultBLOB.minInertiaRatio = 0.1f; - pDefaultBLOB.maxInertiaRatio = std::numeric_limits::max(); + pDefaultBLOB.maxInertiaRatio = (float)1e37; pDefaultBLOB.filterByConvexity = false; pDefaultBLOB.minConvexity = 0.95f; - pDefaultBLOB.maxConvexity = std::numeric_limits::max(); + pDefaultBLOB.maxConvexity = (float)1e37; // Descriptor array (BLOB or MSER) vector typeDesc; // Param array for BLOB @@ -125,12 +125,8 @@ int main(int argc, char *argv[]) } help(); - typeDesc.push_back("BLOB"); - pBLOB.push_back(pDefaultBLOB); - pBLOB.back().filterByColor = true; - pBLOB.back().blobColor = 0; - // This descriptor are going to be detect and compute BLOBS with 5 differents params + // This descriptor are going to be detect and compute BLOBS with 6 differents params // Param for first BLOB detector we want all typeDesc.push_back("BLOB"); // see http://docs.opencv.org/trunk/d0/d7a/classcv_1_1SimpleBlobDetector.html pBLOB.push_back(pDefaultBLOB); @@ -153,12 +149,17 @@ int main(int argc, char *argv[]) pBLOB.back().filterByInertia = true; pBLOB.back().minInertiaRatio = 0; pBLOB.back().maxInertiaRatio = (float)0.2; - // Param for Fourth BLOB detector we want ratio inertia + // Param for fifth BLOB detector we want ratio inertia typeDesc.push_back("BLOB"); pBLOB.push_back(pDefaultBLOB); pBLOB.back().filterByConvexity = true; pBLOB.back().minConvexity = 0.; pBLOB.back().maxConvexity = (float)0.9; + // Param for six BLOB detector we want blob with gravity center color equal to 0 bug #4321 must be fixed + typeDesc.push_back("BLOB"); + pBLOB.push_back(pDefaultBLOB); + pBLOB.back().filterByColor = true; + pBLOB.back().blobColor = 0; itBLOB = pBLOB.begin(); vector desMethCmp; @@ -180,7 +181,7 @@ int main(int argc, char *argv[]) // We can detect keypoint with detect method vector keyImg; vector zone; - vector> region; + vector > region; Mat desc, result(img.rows, img.cols, CV_8UC3); if (b.dynamicCast() != NULL) {