summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_aruco
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-08-07 05:50:21 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-08-07 05:57:30 +0200
commit9e58eb6d5eebb3ca67bf4dba6b7fef58588d492e (patch)
tree083bf108b535080aadf2b947af4b3eca5d151522 /ftnoir_tracker_aruco
parent149403bf828e83b91e049eca1a4e89ef5874b974 (diff)
aruco: don't hardcode thres param 2
Diffstat (limited to 'ftnoir_tracker_aruco')
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
index 08ddd3b2..a6889f82 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
@@ -144,11 +144,12 @@ void Tracker::run()
if (!camera.read(color))
continue;
}
+ static constexpr int thres_param2 = 5;
cv::Mat grayscale;
cv::cvtColor(color, grayscale, cv::COLOR_RGB2GRAY);
const int scale = grayscale.cols > 480 ? 2 : 1;
- detector.setThresholdParams(box_sizes[box_idx], 5);
+ detector.setThresholdParams(box_sizes[box_idx], thres_param2);
static constexpr double pi = 3.1415926f;
const int w = grayscale.cols, h = grayscale.rows;
@@ -177,7 +178,7 @@ void Tracker::run()
if (last_roi.width > 0 && last_roi.height)
{
- detector.setThresholdParams(box_sizes[box_idx], 5);
+ detector.setThresholdParams(box_sizes[box_idx], thres_param2);
detector.setMinMaxSize(std::max(0.01, size_min * grayscale.cols / last_roi.width),
std::min(1.0, size_max * grayscale.cols / last_roi.width));
@@ -206,7 +207,7 @@ void Tracker::run()
qDebug() << "aruco: box size now" << box_sizes[box_idx];
failed = 0;
}
- detector.setThresholdParams(box_sizes[box_idx], 5);
+ detector.setThresholdParams(box_sizes[box_idx], thres_param2);
detector.setMinMaxSize(size_min, size_max);
detector.detect(grayscale, markers, cv::Mat(), cv::Mat(), -1, false);
}