-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrawer.cpp
More file actions
24 lines (20 loc) · 917 Bytes
/
drawer.cpp
File metadata and controls
24 lines (20 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include "drawer.hpp"
Drawer::Drawer(Config& config)
{
font = config.font;
labelColor = config.labelColor;
boxThickness = config.boxThickness;
labelThickness = config.labelThickness;
fontSize = config.fontSize;
colorPlate = config.colors;
}
void Drawer::draw(cv::Mat& frame, TrackingList& trackingList)
{
for (int i = 0; i < trackingList.trackers.size(); i++)
{
rectangle(frame, cv::Point(trackingList.trackingLabelPoints[i].x - 5, trackingList.trackingLabelPoints[i].y - 20), cv::Point(trackingList.trackingLabelPoints[i].x + 240, trackingList.trackingLabelPoints[i].y + 10), colorPlate[trackingList.trackingClasses[i]], -1);
cv::putText(frame, trackingList.trackingLabels[i], trackingList.trackingLabelPoints[i], font, fontSize, labelColor , labelThickness);
rectangle(frame, trackingList.trackingRectangles[i], colorPlate[trackingList.trackingClasses[i]], boxThickness);
}
}