Skip to content
Draft
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
8 changes: 7 additions & 1 deletion opensfm/exif.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,13 @@ def extract_opk(self, geo: Dict[str, Any]) -> Optional[Dict[str, Any]]:
# Unit vector pointing north
xnp /= m

znp = np.array([0, 0, -1]).T
# Unit vector pointing up and perpendicular to north(xnp)
znp = p1
znp -= znp.dot(xnp) * xnp
m = np.linalg.norm(znp)
if m == 0:
logger.debug("Cannot compute OPK angles, divider = 0")
return
ynp = np.cross(znp, xnp)

cen = np.array([xnp, ynp, znp]).T
Expand Down
Loading