summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_aruco
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-06-07 06:26:15 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-06-07 06:26:42 +0200
commit6594411a8a2cfc477e1b8162fe5c269b7d3b4810 (patch)
tree1765719f349501487e5897700d023b26f01784d5 /ftnoir_tracker_aruco
parenta75a809461a20ecb86b6d1bdc9d8a06a4f11d4d8 (diff)
aruco: use DLS pose estimation
Diffstat (limited to 'ftnoir_tracker_aruco')
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
index 4fa4fffe..fc820d56 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
@@ -233,10 +233,10 @@ void Tracker::run()
obj_points.at<float>(x4,0)= -size + s.headpos_x;
obj_points.at<float>(x4,1)= size + s.headpos_y;
obj_points.at<float>(x4,2)= 0 + s.headpos_z;
-
- cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec, tvec, roi_valid, cv::SOLVEPNP_ITERATIVE);
-
- std::vector<cv::Point2f> roi_projection(4);
+
+ std::vector<cv::Point2f> img_points = m;
+ cv::solvePnP(obj_points, img_points, intrinsics, dist_coeffs, rvec, tvec, false, cv::SOLVEPNP_DLS);
+ cv::solvePnP(obj_points, img_points, intrinsics, dist_coeffs, rvec, tvec, true, cv::SOLVEPNP_ITERATIVE);
{
std::vector<cv::Point2f> repr2;
@@ -261,6 +261,7 @@ void Tracker::run()
cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec_, tvec_, false, cv::SOLVEPNP_ITERATIVE);
cv::Mat roi_points = obj_points * c_search_window;
+ std::vector<cv::Point2f> roi_projection(4);
cv::projectPoints(roi_points, rvec_, tvec_, intrinsics, dist_coeffs, roi_projection);
last_roi = cv::Rect(color.cols-1, color.rows-1, 0, 0);