Page MenuHome

Tracking: Store lens principal point in normalized space
ClosedPublic

Authored by Sergey Sharybin (sergey) on Nov 21 2022, 3:32 PM.

Details

Summary

This avoids need to do special trickery detecting whether the principal
point is to be changed when reloading movie clip. This also allows to
transfer the optical center from high-res footage to possibly its lower
resolution proxy without manual adjustment.

On a user level the difference is that the principal point is exposed in
the normalized coordinates: frame center has coordinate of (0, 0), left
bottom corner of a frame has coordinate of (-1, -1) and the right top
corner has coordinate of (1, 1).

Another user-visible change is that there is no more operator for setting
the principal point to center: use backspace on the center sliders will
reset values to 0 which corresponds to the center.

The code implements versioning in both directions, so it should be
possible to open file in older Blender versions without loosing
configuration.

From the python API a new property is to be accessed: it is now called
principal_point. This is more descriptive name, and allows to clearly
catch cases when the old-style pixel value is assigned to to a property
which expects to be in the normalized space.

Diff Detail

Repository
rB Blender
Branch
tracking_refactor_v5 (branched from master)
Build Status
Buildable 24762
Build 24762: arc lint + arc unit

Event Timeline

Sergey Sharybin (sergey) requested review of this revision.Nov 21 2022, 3:32 PM
Sergey Sharybin (sergey) created this revision.

There is only one addon which uses the tracking.camera.principal property, and it is only done for read-only. There are few options here:

  • Update the addon to use the new property
  • Expose the old-named property and do the normalized-to-pixel conversion from the RNA's get()/set() callbacks
  • Expose it, but only for read-only

@Brecht Van Lommel (brecht), do you have strong opinion here?

And for the completeness, can also do principal_point_pixels, similar to how we have it for the focal length where it is possible to have read/write access to both millimeters and pixels.

EDIT: Not really sure how to device a custom getter/setter for an fixed-sized float array property.

Added the principal_point_pixels.

Suggest to simply update the addon which uses the principal point, and stick to the new API.

Correct subtype of the normalized principal point: it is no longer pixels.

This revision is now accepted and ready to land.Nov 21 2022, 7:55 PM