summaryrefslogtreecommitdiffhomepage
path: root/tracker-aruco/ftnoir_tracker_aruco.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-12-03 07:12:20 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-12-03 07:12:20 +0100
commit7c5784780fd9c5d9fe0bf5cb3fb2ac2bf6dd0ae0 (patch)
tree1d15a1feaf398d7b2ab314c3f1071d1d08dcd5cc /tracker-aruco/ftnoir_tracker_aruco.cpp
parentd9df8ee0ab28c5ac46c8026dcaff135356ca6953 (diff)
tracker/aruco: simplify open-coded clamp()
Diffstat (limited to 'tracker-aruco/ftnoir_tracker_aruco.cpp')
-rw-r--r--tracker-aruco/ftnoir_tracker_aruco.cpp8
1 files changed, 4 insertions, 4 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);