@@ -78,9 +78,9 @@ std::shared_ptr<Frame> ObjectDetection::GetFrame(std::shared_ptr<Frame> frame, i
78
78
}
79
79
80
80
// Initialize the Qt rectangle that will hold the positions of the bounding-box
81
- std::vector<QRectF> boxRects;
82
- // Initialize the image of the TrackedObject child clip
83
- std::vector<std::shared_ptr<QImage>> childClipImages;
81
+ std::vector<QRectF> boxRects;
82
+ // Initialize the image of the TrackedObject child clip
83
+ std::vector<std::shared_ptr<QImage>> childClipImages;
84
84
85
85
// Check if track data exists for the requested frame
86
86
if (detectionsData.find (frame_number) != detectionsData.end ()) {
@@ -122,15 +122,6 @@ std::shared_ptr<Frame> ObjectDetection::GetFrame(std::shared_ptr<Frame> frame, i
122
122
std::vector<int > bg_rgba = trackedObject->background .GetColorRGBA (frame_number);
123
123
float bg_alpha = trackedObject->background_alpha .GetValue (frame_number);
124
124
125
- // Create a rotated rectangle object that holds the bounding box
126
- // cv::RotatedRect box ( cv::Point2f( (int)(trackedBox.cx*fw), (int)(trackedBox.cy*fh) ),
127
- // cv::Size2f( (int)(trackedBox.width*fw), (int)(trackedBox.height*fh) ),
128
- // (int) (trackedBox.angle) );
129
-
130
- // DrawRectangleRGBA(cv_image, box, bg_rgba, bg_alpha, 1, true);
131
- // DrawRectangleRGBA(cv_image, box, stroke_rgba, stroke_alpha, stroke_width, false);
132
-
133
-
134
125
cv::Rect2d box (
135
126
(int )( (trackedBox.cx -trackedBox.width /2 )*fw),
136
127
(int )( (trackedBox.cy -trackedBox.height /2 )*fh),
@@ -160,9 +151,8 @@ std::shared_ptr<Frame> ObjectDetection::GetFrame(std::shared_ptr<Frame> frame, i
160
151
Clip* childClip = parentTimeline->GetClip (trackedObject->ChildClipId ());
161
152
162
153
if (childClip){
163
- std::shared_ptr<Frame> f (new Frame (1 , frame->GetWidth (), frame->GetHeight (), " #00000000" ));
164
154
// Get the image of the child clip for this frame
165
- std::shared_ptr<Frame> childClipFrame = childClip->GetFrame (f, frame_number);
155
+ std::shared_ptr<Frame> childClipFrame = childClip->GetFrame (frame_number);
166
156
childClipImages.push_back (childClipFrame->GetImage ());
167
157
168
158
// Set the Qt rectangle with the bounding-box properties
@@ -182,15 +172,15 @@ std::shared_ptr<Frame> ObjectDetection::GetFrame(std::shared_ptr<Frame> frame, i
182
172
// Update Qt image with new Opencv frame
183
173
frame->SetImageCV (cv_image);
184
174
185
- // Set the bounding-box image with the Tracked Object's child clip image
186
- if (boxRects.size () > 0 ){
175
+ // Set the bounding-box image with the Tracked Object's child clip image
176
+ if (boxRects.size () > 0 ){
187
177
// Get the frame image
188
178
QImage frameImage = *(frame->GetImage ());
189
179
for (int i; i < boxRects.size ();i++){
190
180
// Set a Qt painter to the frame image
191
181
QPainter painter (&frameImage);
192
182
// Draw the child clip image inside the bounding-box
193
- painter.drawImage (boxRects[i], *childClipImages[i], QRectF ( 0 , 0 , frameImage. size (). width (), frameImage. size (). height ()) );
183
+ painter.drawImage (boxRects[i], *childClipImages[i]);
194
184
}
195
185
// Set the frame image as the composed image
196
186
frame->AddImage (std::make_shared<QImage>(frameImage));
@@ -362,7 +352,7 @@ bool ObjectDetection::LoadObjDetectdData(std::string inputFilePath){
362
352
363
353
std::shared_ptr<TrackedObjectBBox> trackedObjPtr = std::make_shared<TrackedObjectBBox>(trackedObj);
364
354
ClipBase* parentClip = this ->ParentClip ();
365
- trackedObjPtr->ParentClip (parentClip);
355
+ trackedObjPtr->ParentClip (parentClip);
366
356
367
357
// Create a temp ID. This ID is necessary to initialize the object_id Json list
368
358
// this Id will be replaced by the one created in the UI
0 commit comments