From 28435564d6738cd3a935add3d1507124f1c795cd Mon Sep 17 00:00:00 2001 From: samilyjcc Date: Tue, 14 Jun 2016 14:45:44 +0200 Subject: [PATCH] only show one box --- src/papillon.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/papillon.cpp b/src/papillon.cpp index acc8fb9..360ce71 100644 --- a/src/papillon.cpp +++ b/src/papillon.cpp @@ -12,8 +12,9 @@ using namespace std; class Traite_image { public: - const static int SENSITIVITY_VALUE = 40; + const static int SENSITIVITY_VALUE = 30; const static int BLUR_Size = 15; + const static int CLOSE_SIZE = 50; cv::Mat prev; @@ -161,7 +162,7 @@ class Traite_image { //~ dilated_thres.copyTo(output); cv::Mat closed_thres; - cv::Mat structuringElement = getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(40, 40)); + cv::Mat structuringElement = getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(CLOSE_SIZE, CLOSE_SIZE)); cv::morphologyEx( thres, closed_thres, cv::MORPH_CLOSE, structuringElement ); //closed_thres.copyTo(output); @@ -190,11 +191,13 @@ class Traite_image { //largestContourVec.push_back(contours.at(contours.size()-1)); //make a bounding rectangle around the largest contour then find its centroid //this will be the object's final esticv::Mated position. - for(int i=0; i