diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-17 11:24:12 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-17 11:24:12 +0200 |
commit | eb1a95e3cea400340e5a64c2791a4a09ca3a0074 (patch) | |
tree | 238ad2f3a3e392074dfefb4abdf3437f867fa0c4 /ftnoir_tracker_aruco | |
parent | 547b8f94b2f2814a6ef86e6022c6525b03fcbd2d (diff) | |
parent | 619d3d8010b3c093fba8e87f831cc438d8822479 (diff) |
Merge commit 'f78b96a' into unstable
* commit 'f78b96a':
gcc too much a piece of work often
submit mapped data to filter, not raw
nonsense
drop decimal places for rot/trans in UI
rotation below -99 didn't display, just froze
add-comment
Diffstat (limited to 'ftnoir_tracker_aruco')
-rw-r--r-- | ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 13 | ||||
-rw-r--r-- | ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index fd8a8ce1..87c5315e 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -203,6 +203,12 @@ void Tracker::run() auto tm = cv::getTickCount(); cv::Mat grayscale; + { + std::vector<cv::Mat> tmp; + cv::split(color, tmp); + // red only, best on CCD, also artifacts on blue ps3eye + grayscale = tmp[2]; + } cv::cvtColor(color, grayscale, cv::COLOR_BGR2GRAY); const int scale = frame.cols > 480 ? 2 : 1; @@ -221,7 +227,7 @@ void Tracker::run() std::vector< aruco::Marker > markers; const double size_min = 0.04; - const double size_max = 0.38; + const double size_max = 0.28; bool roi_valid = false; @@ -229,6 +235,7 @@ void Tracker::run() { detector.setMinMaxSize(std::max(0.01, size_min * grayscale.cols / last_roi.width), std::min(1.0, size_max * grayscale.cols / last_roi.width)); + if (detector.detect(grayscale(last_roi), markers, cv::Mat(), cv::Mat(), -1, false), markers.size() == 1 && markers[0].size() == 4) { @@ -299,7 +306,7 @@ void Tracker::run() cv::Vec3d rvec, tvec; - cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec, tvec, false, cv::P3P); + cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec, tvec, false, cv::ITERATIVE); std::vector<cv::Point2f> roi_projection(4); @@ -324,7 +331,7 @@ void Tracker::run() { cv::Mat rvec_, tvec_; - cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec_, tvec_, false, cv::P3P); + cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec_, tvec_, false, cv::ITERATIVE); tvec = tvec_; } diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index 3d37dacd..090cf478 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -43,7 +43,7 @@ struct settings { class Tracker : protected QThread, public ITracker { Q_OBJECT - static constexpr double c_search_window = 2.2; + static constexpr double c_search_window = 2.65; public: Tracker(); ~Tracker() override; |