Skip to content

Commit

Permalink
Added default class colors
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennoCaldato committed Apr 9, 2021
1 parent a106ed5 commit 9499211
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/TrackedObjectBBox.cpp
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/TrackedObjectBBox.h
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/effects/ObjectDetection.cpp
Expand Up @@ -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});
Expand Down

0 comments on commit 9499211

Please sign in to comment.