-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Effect parenting #649
Effect parenting #649
Conversation
The keyframe collections would better integrate with effects that uses bounding boxes, skeletons and facial points.
(still needs some fine-tuning)
It's now possible to adjust the tracked bounding box from the preview window. Some work is needed to make it generic to the ObjectDetection effect and future effects
-Moved the methods that handles protobuf data from Tracker to KeyframeBBox -Displacement and scale keyframes are now properties of KeyframeBBox -Changed interface that updates the KeyframeBBox properties.
Changed the bounding-box struct point convention to (cx, cy, width, height, angle). The GetFrame member function from Tracker class now uses the cv::RotatedRect object to represent the bounding-box and draw it on screen. The JSON and Protobuf communication between the backend and frontend still uses the (x1,y1)(x2,y2) point convention, the backend performs the adequate transformations.
- Added KeyframeBase class - Adjusted the inheritance of KeyframeBase to KeyframeBBox and Keyframe - Added feature to attach clip to bounding box - Added support to select tracked object with a dropdown list and removed keyframebbox downcasting
Modified Clip.cpp PropertiesJSON function and applied minor fixes to Keyframe_Tests
The Clip's Keyframes are no longer modified when it's attached to an object, and the bounding-box properties are requested by the Timeline's frame, not the Clip's frame.
Added new base class TrackedObjectBase, changed class KeyframeBBox to TrackedObjectBBox and changes it's inheritance from KeyframeBase to TrackedObjectBase.
Fixed bug that caused the clip to not attach correctly if the tracked object's parent clip wasn't in the position 0 of the timeline. Fixed bug that caused the wrong scale adjustment when an emoji or picture was attached to a tracked object.
Fixed bug that caused the tracked object bounding box to be incorrectly updated when the user interacted with it's transform handler.
Fixed bug that made Openshot crash if two or more Tracker effects were added to the same video. Fixed bug that made the clips to be incorrectly attached to tracked objects in the exported video.
Added "has_tracked_object" property on EffectBase so that the AddEffect function checks for this property instead of the Tracker effect name - this way it's possible to support other effects that have tracked objects but different names.
This feature let's the user attach a clip to an object detected by the Object Detection effect, in the same way it is done with the Tracker Effect.
Added support to show transform handlers for the bounding-boxes (Tracked Objects) detected by the Object Detection effect and update their Keyframes.
Only show the tracked object's icon (on the mini-GUI to attach a clip to it) and transform handler if the object appears on the screen (i.e. it has data for the requested frame)
Merge conflicts have been detected on this PR, please resolve. |
// Make sure the trackedData is empty | ||
trackedDataById.clear(); | ||
// Draw the child clip image inside the bounding-box | ||
painter.drawImage(boxRect, *childClipImage, QRectF(0, 0, frameImage.size().width(), frameImage.size().height())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
painter.drawImage(boxRect, *childClipImage, QRectF(0, 0, frameImage.size().width(), frameImage.size().height())); | |
painter.drawImage(boxRect, *childClipImage, QRectF(frameImage.rect())); |
(Though, if you're drawing the entire image, I don't think this is necessary. If I'm not mistaken, QImage's drawImage()
defaults to drawing the entire source image in the area specified, scaled accordingly. So that would make this equivalent):
painter.drawImage(boxRect, *childClipImage);
Small reversion on @ferdync changes because the if statement is not working on my setup
Changed JSON communication for detected objects
Merge conflicts have been detected on this PR, please resolve. |
@jonoomph following our last call I am merging this branch with develop. It's a big one. Fingers crossed |
This PR adds in functionalities for using the new OpenCV-related effects. The main functionalities are:
A TrackedObjectBase class was created to handle custom objects and interact with them. TrackedObjectBBox allows storing and manipulating the bounding box information of a tracked object. The base class can be further extended to other objects such as facial tracking, body joints, etc.
Related to OpenShot/openshot-qt#4058
Tracker and ObjectDetection transform handlers:
Clip attached to a tracked object
Effect parenting
Object Detection with transform handlers