Added default class colors

This commit is contained in:
Brenno
2021-04-08 22:07:03 -03:00
parent a106ed5671
commit 94992117a9
3 changed files with 9 additions and 1 deletions

View File

@@ -48,6 +48,13 @@ TrackedObjectBBox::TrackedObjectBBox() : delta_x(0.0), delta_y(0.0), scale_x(1.0
return;
}
TrackedObjectBBox::TrackedObjectBBox(int Red, int Green, int Blue, int Alfa) : delta_x(0.0), delta_y(0.0), scale_x(1.0), scale_y(1.0), rotation(0.0),
stroke_width(2) , background_alpha(1.0), stroke_alpha(0.0), background_corner(0),
stroke(Red,Green,Blue,Alfa), background(0,0,255,0)
{
this->TimeScale = 1.0;
return;
}
// Add a BBox to the BoxVec map
void TrackedObjectBBox::AddBox(int64_t _frame_num, float _cx, float _cy, float _width, float _height, float _angle)

View File

@@ -179,6 +179,7 @@ namespace openshot
/// Default Constructor
TrackedObjectBBox();
TrackedObjectBBox(int Red, int Green, int Blue, int Alfa);
/// Add a BBox to the BoxVec map
void AddBox(int64_t _frame_num, float _cx, float _cy, float _width, float _height, float _angle) override;

View File

@@ -281,7 +281,7 @@ bool ObjectDetection::LoadObjDetectdData(std::string inputFilePath){
else
{
// There is no tracked object with that id, so insert a new one
TrackedObjectBBox trackedObj;
TrackedObjectBBox trackedObj((int)classesColor[classId](0), (int)classesColor[classId](1), (int)classesColor[classId](2), (int)0);
trackedObj.AddBox(id, x+(w/2), y+(h/2), w, h, 0.0);
std::shared_ptr<TrackedObjectBBox> trackedObjPtr = std::make_shared<TrackedObjectBBox>(trackedObj);
trackedObjects.insert({objectId, trackedObjPtr});