Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions slam/include/FrameDrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class FrameDrawer

void DrawTextInfo(cv::Mat &im, int nState, cv::Mat &imText);

void DrawRectangleAndCircle(float x, float y, float width);

// Info of the frame to be drawn
cv::Mat mIm;
int N;
Expand Down
48 changes: 23 additions & 25 deletions slam/src/FrameDrawer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,42 +124,33 @@ namespace ORB_SLAM2 {

// This is a match to a MapPoint in the map
if (vbMap[i]) {

glColor3f(0, 1.0f, 0);
glBegin(GL_LINE_LOOP);
glVertex2f(x1 - width, y1 - width);
glVertex2f(x1 - width, y1 + width);
glVertex2f(x1 + width, y1 + width);
glVertex2f(x1 + width, y1 - width);
glEnd();

glBegin(GL_POINTS);
glVertex2f(x1, y1);
glEnd();

DrawRectangleAndCircle(x1, y1, width);
mnTracked++;
}
else // This is match to a "visual odometry" MapPoint created in the last frame
{
glColor3f(0, 1.0f, 0);
glBegin(GL_LINE_LOOP);
glVertex2f(x1 - width, y1 - width);
glVertex2f(x1 - width, y1 + width);
glVertex2f(x1 + width, y1 + width);
glVertex2f(x1 + width, y1 - width);
glEnd();

glBegin(GL_POINTS);
glVertex2f(x1, y1);
glEnd();

DrawRectangleAndCircle(x1, y1, width);
mnTrackedVO++;
}
}
}
}
}

void FrameDrawer::DrawRectangleAndCircle(float x, float y, float width) {
glColor3f(0, 1.0f, 0);
glBegin(GL_LINE_LOOP);
glVertex2f(x - width, y - width);
glVertex2f(x - width, y + width);
glVertex2f(x + width, y + width);
glVertex2f(x + width, y - width);
glEnd();

glBegin(GL_POINTS);
glVertex2f(x, y);
glEnd();
}


void FrameDrawer::DrawTextInfo(cv::Mat &im, int nState, cv::Mat &imText) {
stringstream s;
Expand Down Expand Up @@ -191,6 +182,13 @@ namespace ORB_SLAM2 {
imText.rowRange(im.rows, imText.rows) = cv::Mat::zeros(textSize.height + 10, im.cols, im.type());
cv::putText(imText, s.str(), cv::Point(5, imText.rows - 5), cv::FONT_HERSHEY_PLAIN, 1,
cv::Scalar(255, 255, 255), 1, 8);
/*glColor3f(1.0f, 1.0f, 1.0f);
glRasterPos2f(5, imText.rows - 5);
int len, i;
len = s.str().size();
for (i = 0; i < len; i++) {
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, s.str()[i]);
}*/

}

Expand Down
Loading