From 29721d11813a97918242c08238c97b1dd9708740 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 8 Jul 2016 14:32:17 +0200 Subject: tracker/aruco: pre-initialize pose with DLS for LM --- tracker-aruco/ftnoir_tracker_aruco.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tracker-aruco/ftnoir_tracker_aruco.cpp') diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp index d9579743..b8e5f848 100644 --- a/tracker-aruco/ftnoir_tracker_aruco.cpp +++ b/tracker-aruco/ftnoir_tracker_aruco.cpp @@ -53,6 +53,7 @@ Tracker::Tracker() : detector.setThresholdParams(5, -1); detector.setDesiredSpeed(3); detector._thresMethod = aruco::MarkerDetector::FIXED_THRES; + detector.setCornerRefinementMethod(aruco::MarkerDetector::HARRIS); } Tracker::~Tracker() @@ -365,7 +366,10 @@ void Tracker::run() { set_points(); - if (!cv::solvePnP(obj_points, markers[0], intrinsics, dist_coeffs, rvec, tvec, false, cv::SOLVEPNP_ITERATIVE)) + if (!cv::solvePnP(obj_points, markers[0], intrinsics, dist_coeffs, rvec, tvec, false, cv::SOLVEPNP_DLS)) + goto fail; + + if (!cv::solvePnP(obj_points, markers[0], intrinsics, dist_coeffs, rvec, tvec, true, cv::SOLVEPNP_ITERATIVE)) goto fail; set_last_roi(); -- cgit v1.2.3