Fixed aspect ratio and off-center displacement when attaching a clip to a tracked object

This commit is contained in:
Brenno
2021-04-20 23:09:07 -03:00
parent f491d585fc
commit 0b8481f335
2 changed files with 4 additions and 1 deletions

View File

@@ -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());

View File

@@ -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