summaryrefslogtreecommitdiffhomepage
path: root/tracker-aruco
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-aruco')
-rw-r--r--tracker-aruco/ftnoir_tracker_aruco.cpp8
-rw-r--r--tracker-aruco/ftnoir_tracker_aruco.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp
index 5473eb6f..02b1f830 100644
--- a/tracker-aruco/ftnoir_tracker_aruco.cpp
+++ b/tracker-aruco/ftnoir_tracker_aruco.cpp
@@ -38,8 +38,8 @@ static constexpr const resolution_tuple resolution_choices[] =
};
constexpr const double aruco_tracker::RC;
-constexpr const double aruco_tracker::size_min;
-constexpr const double aruco_tracker::size_max;
+constexpr const float aruco_tracker::size_min;
+constexpr const float aruco_tracker::size_max;
aruco_tracker::aruco_tracker() :
fps(0),
@@ -91,8 +91,8 @@ bool aruco_tracker::detect_with_roi()
{
if (last_roi.width > 1 && last_roi.height > 1)
{
- detector.setMinMaxSize(std::min(1., std::max(.01, size_min * grayscale.cols / last_roi.width)),
- std::max(.01, std::min(1., size_max * grayscale.cols / last_roi.width)));
+ detector.setMinMaxSize(clamp(size_min * grayscale.cols / last_roi.width, .01f, 1.f),
+ clamp(size_max * grayscale.cols / last_roi.width, .01f, 1.f));
detector.detect(grayscale(last_roi), markers, cv::Mat(), cv::Mat(), -1, false);
diff --git a/tracker-aruco/ftnoir_tracker_aruco.h b/tracker-aruco/ftnoir_tracker_aruco.h
index edec2437..cdea1e42 100644
--- a/tracker-aruco/ftnoir_tracker_aruco.h
+++ b/tracker-aruco/ftnoir_tracker_aruco.h
@@ -100,8 +100,8 @@ private:
volatile bool stop;
- static constexpr const double size_min = 0.05f;
- static constexpr const double size_max = 0.3f;
+ static constexpr const float size_min = 0.05;
+ static constexpr const float size_max = 0.3;
static constexpr const double RC = .25;
};