diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-12-31 07:06:59 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-12-31 07:52:55 +0100 |
commit | 67145ae776064fe57b7a25573909190e4a6d6ac8 (patch) | |
tree | 6092d4e7951e12aaf849928ab49dd9f14879d2f1 /tracker-aruco/ftnoir_tracker_aruco.h | |
parent | b0d9aef7b6e9c3c06450cc11ee107abbf6af1d32 (diff) |
tracker/aruco: cycle threshold params if detection fails
Diffstat (limited to 'tracker-aruco/ftnoir_tracker_aruco.h')
-rw-r--r-- | tracker-aruco/ftnoir_tracker_aruco.h | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/tracker-aruco/ftnoir_tracker_aruco.h b/tracker-aruco/ftnoir_tracker_aruco.h index aa3c59f7..6e7db3f6 100644 --- a/tracker-aruco/ftnoir_tracker_aruco.h +++ b/tracker-aruco/ftnoir_tracker_aruco.h @@ -28,6 +28,7 @@ #include <opencv2/core.hpp> #include <opencv2/videoio.hpp> + using namespace options; struct settings : opts { @@ -83,6 +84,10 @@ private: void set_last_roi(); void set_rmat(); void set_roi_from_projection(); + void set_detector_params(); + void cycle_detection_params(); + + cv::Point3f rotate_model(float x, float y, settings::rot mode); cv::VideoCapture camera; QMutex camera_mtx; @@ -90,7 +95,7 @@ private: qshared<cv_video_widget> videoWidget; qshared<QHBoxLayout> layout; settings s; - double pose[6], fps; + double pose[6], fps, no_detection_timeout; cv::Mat frame, grayscale, color; cv::Matx33d r; std::vector<cv::Point3f> obj_points; @@ -105,9 +110,37 @@ private: cv::Vec3d euler; std::vector<cv::Point3f> roi_points; cv::Rect last_roi; - Timer fps_timer; - + Timer fps_timer, last_detection_timer; + unsigned adaptive_size_pos; volatile bool stop; + bool use_otsu; + + struct resolution_tuple + { + int width; + int height; + }; + + static constexpr const int adaptive_sizes[] = + { + 7, + 9, + //11, + 13, + //5, + }; + + static constexpr int adaptive_thres = 6; + + static constexpr const resolution_tuple resolution_choices[] = + { + { 640, 480 }, + { 320, 240 }, + { 0, 0 } + }; + + static constexpr double timeout = 1; + static constexpr double timeout_backoff_c = 4./11; static constexpr const float size_min = 0.05; static constexpr const float size_max = 0.3; |