From 70832cc3b198998fa506211bd2d90f1a9c3e3458 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 24 Jun 2017 12:03:41 +0200 Subject: tracker/aruco: add experimental canny threshold ifdef --- tracker-aruco/ftnoir_tracker_aruco.cpp | 8 ++++++++ tracker-aruco/ftnoir_tracker_aruco.h | 11 +++++++++-- tracker-aruco/include/markerdetector.h | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'tracker-aruco') diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp index f2a2e3b8..171e3f26 100644 --- a/tracker-aruco/ftnoir_tracker_aruco.cpp +++ b/tracker-aruco/ftnoir_tracker_aruco.cpp @@ -328,17 +328,23 @@ void aruco_tracker::set_detector_params() { detector.setDesiredSpeed(3); detector.setThresholdParams(adaptive_sizes[adaptive_size_pos], adaptive_thres); +#if !defined USE_EXPERIMENTAL_CANNY if (use_otsu) detector._thresMethod = aruco::MarkerDetector::FIXED_THRES; else detector._thresMethod = aruco::MarkerDetector::ADPT_THRES; +#else + detector._thresMethod = aruco::MarkerDetector::CANNY; +#endif } void aruco_tracker::cycle_detection_params() { +#if !defined USE_EXPERIMENTAL_CANNY if (!use_otsu) use_otsu = true; else +#endif { use_otsu = false; @@ -349,7 +355,9 @@ void aruco_tracker::cycle_detection_params() set_detector_params(); qDebug() << "aruco: switched thresholding params" +#if !defined USE_EXPERIMENTAL_CANNY << "otsu:" << use_otsu +#endif << "size:" << adaptive_sizes[adaptive_size_pos]; } diff --git a/tracker-aruco/ftnoir_tracker_aruco.h b/tracker-aruco/ftnoir_tracker_aruco.h index 8531bef9..4b3bde73 100644 --- a/tracker-aruco/ftnoir_tracker_aruco.h +++ b/tracker-aruco/ftnoir_tracker_aruco.h @@ -31,6 +31,9 @@ // value 0->1 //#define DEBUG_UNSHARP_MASKING .75 +//canny thresholding +//#define USE_EXPERIMENTAL_CANNY + using namespace options; struct settings : opts { @@ -127,11 +130,15 @@ private: static constexpr const int adaptive_sizes[] = { +#if defined USE_EXPERIMENTAL_CANNY + 3, + 5, + 7, +#else 7, 9, - //11, 13, - //5, +#endif }; static constexpr int adaptive_thres = 6; diff --git a/tracker-aruco/include/markerdetector.h b/tracker-aruco/include/markerdetector.h index 79a952a9..edcad976 100644 --- a/tracker-aruco/include/markerdetector.h +++ b/tracker-aruco/include/markerdetector.h @@ -278,6 +278,7 @@ private: */ void detectRectangles(const cv::Mat &thresImg,vector & candidates); public: + std::vector> contours; //Current threshold method ThresholdMethods _thresMethod; //Threshold parameters -- cgit v1.2.3