This commit is contained in:
NikolajDanger
2022-10-31 15:20:21 +01:00
parent 9cc3b41f87
commit f93a046270

View File

@ -309,7 +309,10 @@ class Camera(object):
if not isinstance(self.ids, type(None)): if not isinstance(self.ids, type(None)):
dists = np.linalg.norm(self.tvecs, axis=len(self.tvecs.shape) - 1) * 100 dists = np.zeros(len(self.tvects), dtype=self.tvecs.dtype)
for i, tvec in enumerate(self.tvecs):
dists[i] = np.sqrt(tvec[0][0]**2 + tvec[0][2]**2)
# Make sure we always return properly shaped arrays # Make sure we always return properly shaped arrays
dists = dists.reshape((dists.shape[0],)) dists = dists.reshape((dists.shape[0],))
ids = self.ids.reshape((self.ids.shape[0],)) ids = self.ids.reshape((self.ids.shape[0],))