Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Example/Tracking Test.blend
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ The following is a recommended workflow for working with the addon:
11. Ensure the video footage from all cameras match up in real time.
12. In Blender, track the points of interest using the motion tracker, ensuring the camera settings such as focal length are set to the same as the real cameras, and that tracks for any given feature have the same name across all videos.
13. For each video, select all the tracks and use `Movie Clip Editor > Reconstruction > Link Empty to Track`, making sure they are associated with the correct Blender camera.
14. Select all the generated empties, and invoke `View3D > Object > Resolve Camera Tracks`.
14. Select all the generated empties, and invoke `Object > Resolve Camera Tracks`.
15. You should now have a set of Empty objects that track in 3D the locations of the real-world markers. These can now be used for animation; for example, as hooks for a rig.

Usage
-----

The operator is accessible via `View3D > Object > Resolve Camera Tracks`, or `Search > Resolve Camera Tracks`.
The operator is accessible via `Object > Resolve Camera Tracks`, or `Search > Resolve Camera Tracks`.

### Before

Expand Down
20 changes: 10 additions & 10 deletions Resolve Camera Tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"author": "Anthony Zhang",
"category": "Animation",
"version": (1, 1),
"blender": (2, 75, 0),
"location": "View3D > Object > Resolve Camera Tracks or Search > Resolve Camera Tracks",
"blender": (2, 93, 0),
"location": "Object > Resolve Camera Tracks or Search > Resolve Camera Tracks",
"description": "3D point reconstruction from multiple camera angles",
}

Expand Down Expand Up @@ -50,7 +50,7 @@ def execute(self, context):

# select the resolved empties
bpy.ops.object.select_all(action="DESELECT")
for empty in resolved_empties: empty.select = True
for empty in resolved_empties: empty.select_set(True)

return {"FINISHED"}

Expand Down Expand Up @@ -180,8 +180,8 @@ def add_resolved_empty(self, targets):
# make the resolved track object more identifiable
track, _ = self.get_target_track(targets[0])
resolved.name = "{}_tracked".format(track.name)
resolved.empty_draw_type = "SPHERE"
resolved.empty_draw_size = 0.1
resolved.empty_display_type = "SPHERE"
resolved.empty_display_size = 0.1

self.report({"INFO"}, "{}: min error {} (frame {}), max error {} (frame {})".format(resolved.name, min_distance / 2, min_distance_frame, max_distance / 2, max_distance_frame))
return resolved
Expand All @@ -197,11 +197,11 @@ def closest_point(cam1, cam2, point1, point2):
dir1 = point1 - cam1
dir2 = point2 - cam2
dir3 = cam2 - cam1
a = dir1 * dir1
b = -dir1 * dir2
c = dir2 * dir2
d = dir3 * dir1
e = -dir3 * dir2
a = dir1.dot(dir1)
b = -dir1.dot(dir2)
c = dir2.dot(dir2)
d = dir3.dot(dir1)
e = -dir3.dot(dir2)
if abs((c * a) - (b ** 2)) < 0.0001: # lines are nearly parallel
raise Exception("Lines are too close to parallel")
extent1 = ((d * c) - (e * b)) / ((c * a) - (b ** 2))
Expand Down
Binary file modified Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.