mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 09:07:47 +08:00
Make apriltag detection in same orientation than opencv
This commit is contained in:
@@ -574,10 +574,10 @@ std::map<int, MarkerInfo> MarkerDetector::detect(const cv::Mat & image,
|
|||||||
double err = estimate_tag_pose(&info, &pose);
|
double err = estimate_tag_pose(&info, &pose);
|
||||||
if (pose.R && pose.t)
|
if (pose.R && pose.t)
|
||||||
{
|
{
|
||||||
Transform t(MATD_EL(pose.R, 0, 0), MATD_EL(pose.R, 1, 0), MATD_EL(pose.R, 2, 0), MATD_EL(pose.t, 0, 0),
|
Transform t(MATD_EL(pose.R, 0, 0), MATD_EL(pose.R, 0, 1), MATD_EL(pose.R, 0, 2), MATD_EL(pose.t, 0, 0),
|
||||||
MATD_EL(pose.R, 0, 1), MATD_EL(pose.R, 1, 1), MATD_EL(pose.R, 2, 1), MATD_EL(pose.t, 1, 0),
|
MATD_EL(pose.R, 1, 0), MATD_EL(pose.R, 1, 1), MATD_EL(pose.R, 1, 2), MATD_EL(pose.t, 1, 0),
|
||||||
MATD_EL(pose.R, 0, 2), MATD_EL(pose.R, 1, 2), MATD_EL(pose.R, 2, 2), MATD_EL(pose.t, 2, 0));
|
MATD_EL(pose.R, 2, 0), MATD_EL(pose.R, 2, 1), MATD_EL(pose.R, 2, 2), MATD_EL(pose.t, 2, 0));
|
||||||
poses.push_back(t);
|
poses.push_back(t*Transform(-1,0,0,0, 0,1,0,0, 0,0,-1,0)); // Flip tag to match same frame than OpenCV (+x->-x, +z->-z)
|
||||||
|
|
||||||
corners.push_back(std::vector<cv::Point2f>(4));
|
corners.push_back(std::vector<cv::Point2f>(4));
|
||||||
for(int i=0; i<4; ++i)
|
for(int i=0; i<4; ++i)
|
||||||
|
|||||||
@@ -501,7 +501,7 @@ std::map<int, Transform> OptimizerGTSAM::optimize(
|
|||||||
t = iter->second.transform().inverse();
|
t = iter->second.transform().inverse();
|
||||||
std::swap(id1, id2); // should be node -> landmark
|
std::swap(id1, id2); // should be node -> landmark
|
||||||
}
|
}
|
||||||
|
UASSERT(isLandmarkWithRotation.find(id2) != isLandmarkWithRotation.end());
|
||||||
#ifdef RTABMAP_VERTIGO
|
#ifdef RTABMAP_VERTIGO
|
||||||
if(this->isRobust() && isLandmarkWithRotation.at(id2))
|
if(this->isRobust() && isLandmarkWithRotation.at(id2))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5239,6 +5239,7 @@ void MainWindow::drawKeypoints(const std::multimap<int, cv::KeyPoint> & refWords
|
|||||||
|
|
||||||
void MainWindow::drawLandmarks(cv::Mat & image, const Signature & signature)
|
void MainWindow::drawLandmarks(cv::Mat & image, const Signature & signature)
|
||||||
{
|
{
|
||||||
|
UDEBUG("%ld landmarks", signature.getLandmarks().size());
|
||||||
for(std::map<int, Link>::const_iterator iter=signature.getLandmarks().begin(); iter!=signature.getLandmarks().end(); ++iter)
|
for(std::map<int, Link>::const_iterator iter=signature.getLandmarks().begin(); iter!=signature.getLandmarks().end(); ++iter)
|
||||||
{
|
{
|
||||||
// Project in all cameras in which the landmark is visible
|
// Project in all cameras in which the landmark is visible
|
||||||
|
|||||||
Reference in New Issue
Block a user