Skip to content
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 #4058

Merged
merged 57 commits into from
Jun 1, 2021
Merged

Effect parenting #4058

merged 57 commits into from
Jun 1, 2021

Conversation

BrennoCaldato
Copy link
Collaborator

@BrennoCaldato BrennoCaldato commented Mar 23, 2021

This PR adds in functionalities for using the new OpenCV-related effects. The main functionalities are:

  • Added transform handlers for the Tracker and Object Detection effects. The user can now modify and correct the tracked objects.
  • Fixed Tracker initial bounding box selection window
  • Allow the user to animate Clips or Images with the tracked objects. The clip will be transformed to follow the tracked object
  • Allow parenting clips. The transformations applied to a clip can be replicated to other clips.
  • Effects can be parented and replicated to other clips.
  • Improved usability of Tracker effect

Heavily related to OpenShot/libopenshot#649

Tracker and ObjectDetection transform handlers:
image

Clip attached to a tracked object
image

Effect parenting
image

Object Detection with transform handlers
image

BrennoCaldato and others added 29 commits November 28, 2020 18:18
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
…ffect

- JSON communication with tracker effect no longer needs to pass the frame_number as argument
- Added bounding box ID generator to Tracker effect
The GUI let's the user attach a clip to a tracked object's bounding-box showing all clip's and their respective tracked objects (if any) names and icons as a dropdown list.
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)
When using the ObjectDetection effect, it's now possible to select one detected object and update it's properties through it's transform handler.
Removed the necessity to append the detected object index (related to the frame) to the effect JSON - which makes the JSON smaller and the performance better.
Updated "attached_id" to "parentObjectId"
The transform handler of the Tracked Object will only be drawn if the it is visible in that frame.
Fixed typo on properties_tableview.py where it wouldn't show the Keyframe menu to let the user choose the interpolation type.
…spect ratio. When selecting regions from a Clip, the aspact ratio can be different than the project, and thus, we need to only show coordinates that match our clip image data.
There is still an issue when tracking a Emogi file. The svg size on clip.Reader() is 1024x1024 while Clip::apply_keyframes receives a 335x335 frame
@BrennoCaldato BrennoCaldato requested a review from ferdnyc March 23, 2021 01:34
Comment on lines -230 to +241
c.data = {property_key: c.data[property_key]}
clip_data = {property_key: clip_data[property_key]}
if object_id:
clip_data = {'objects': {object_id: clip_data}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the contents through clip_data like this, I don't believe the original c.data will be reduced — assigning a new value to clip_data breaks its reference to c.data. To gain the performance improvements, c.data needs to be updated directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants