MCPcopy Create free account
hub / github.com/colmap/colmap / DrawKeypoints

Function DrawKeypoints

src/colmap/ui/qt_utils.cc:83–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void DrawKeypoints(QPixmap* pixmap,
84 const FeatureKeypoints& points,
85 const QColor& color) {
86 if (pixmap->isNull()) {
87 return;
88 }
89
90 const int pen_width = std::max(pixmap->width(), pixmap->height()) / 2048 + 1;
91 const int radius = 3 * pen_width + (3 * pen_width) % 2;
92 const float radius2 = radius / 2.0f;
93
94 QPainter painter(pixmap);
95 painter.setRenderHint(QPainter::Antialiasing);
96
97 QPen pen;
98 pen.setWidth(pen_width);
99 pen.setColor(color);
100 painter.setPen(pen);
101
102 for (const auto& point : points) {
103 painter.drawEllipse(point.x - radius2, point.y - radius2, radius, radius);
104 }
105}
106
107QPixmap DrawMatches(const QPixmap& image1,
108 const QPixmap& image2,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected