Skip to content

Commit

Permalink
Fixed aspect ratio and off-center displacement when attaching a clip …
Browse files Browse the repository at this point in the history
…to a tracked object
  • Loading branch information
BrennoCaldato committed Apr 21, 2021
1 parent f491d58 commit 0b8481f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/effects/ObjectDetection.cpp
Expand Up @@ -164,6 +164,8 @@ std::shared_ptr<Frame> ObjectDetection::GetFrame(std::shared_ptr<Frame> frame, i
// Get the Tracked Object's child clip
Clip* childClip = parentTimeline->GetClip(trackedObject->ChildClipId());
if (childClip){
std::shared_ptr<Frame> f(new Frame(1, frame->GetWidth(), frame->GetHeight(), "#00000000"));
std::shared_ptr<Frame> childClipFrame = childClip->GetFrame(f, frame_number);
// Get the image of the child clip for this frame
std::shared_ptr<Frame> childClipFrame = childClip->GetFrame(frame_number);
childClipImages.push_back(childClipFrame->GetImage());
Expand Down
3 changes: 2 additions & 1 deletion src/effects/Tracker.cpp
Expand Up @@ -141,7 +141,8 @@ std::shared_ptr<Frame> Tracker::GetFrame(std::shared_ptr<Frame> frame, int64_t f
Clip* childClip = parentTimeline->GetClip(trackedData->ChildClipId());
if (childClip){
// Get the image of the child clip for this frame
std::shared_ptr<Frame> childClipFrame = childClip->GetFrame(frame_number);
std::shared_ptr<Frame> f(new Frame(1, frame->GetWidth(), frame->GetHeight(), "#00000000"));
std::shared_ptr<Frame> childClipFrame = childClip->GetFrame(f, frame_number);
childClipImage = childClipFrame->GetImage();

// Set the Qt rectangle with the bounding-box properties
Expand Down

0 comments on commit 0b8481f

Please sign in to comment.