From 0b8481f335fa4eb507cafdc850776de414c4ed5d Mon Sep 17 00:00:00 2001 From: Brenno Date: Tue, 20 Apr 2021 23:09:07 -0300 Subject: [PATCH] Fixed aspect ratio and off-center displacement when attaching a clip to a tracked object --- src/effects/ObjectDetection.cpp | 2 ++ src/effects/Tracker.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/effects/ObjectDetection.cpp b/src/effects/ObjectDetection.cpp index a5940601..de91c7a7 100644 --- a/src/effects/ObjectDetection.cpp +++ b/src/effects/ObjectDetection.cpp @@ -164,6 +164,8 @@ std::shared_ptr ObjectDetection::GetFrame(std::shared_ptr frame, i // Get the Tracked Object's child clip Clip* childClip = parentTimeline->GetClip(trackedObject->ChildClipId()); if (childClip){ + std::shared_ptr f(new Frame(1, frame->GetWidth(), frame->GetHeight(), "#00000000")); + std::shared_ptr childClipFrame = childClip->GetFrame(f, frame_number); // Get the image of the child clip for this frame std::shared_ptr childClipFrame = childClip->GetFrame(frame_number); childClipImages.push_back(childClipFrame->GetImage()); diff --git a/src/effects/Tracker.cpp b/src/effects/Tracker.cpp index ae2dbafd..d04d7e30 100644 --- a/src/effects/Tracker.cpp +++ b/src/effects/Tracker.cpp @@ -141,7 +141,8 @@ std::shared_ptr Tracker::GetFrame(std::shared_ptr 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 childClipFrame = childClip->GetFrame(frame_number); + std::shared_ptr f(new Frame(1, frame->GetWidth(), frame->GetHeight(), "#00000000")); + std::shared_ptr childClipFrame = childClip->GetFrame(f, frame_number); childClipImage = childClipFrame->GetImage(); // Set the Qt rectangle with the bounding-box properties