Skip to content

Commit

Permalink
Field of view functions works for tall images
Browse files Browse the repository at this point in the history
  • Loading branch information
servantftechnicolor committed Nov 27, 2024
1 parent b5dda4e commit 7f72f81
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions meshroom/ui/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,18 @@ def fieldOfView(self):
if not self.solvedIntrinsics:
return None
focalLength = self.solvedIntrinsics["focalLength"]

#We assume that if the width is less than the weight
#It's because the image has been rotated and not
#because the sensor has some unusual shape
sensorWidth = self.solvedIntrinsics["sensorWidth"]
sensorHeight = self.solvedIntrinsics["sensorHeight"]
if self.imageSize.height() > self.imageSize.width():
sensorWidth, sensorHeight = sensorHeight, sensorWidth

if self.orientation in (5, 6, 7, 8):
sensorWidth = self.solvedIntrinsics["sensorWidth"]
return 2.0 * math.atan(float(sensorWidth) / (2.0 * float(focalLength))) * 180.0 / math.pi
else:
sensorHeight = self.solvedIntrinsics["sensorHeight"]
return 2.0 * math.atan(float(sensorHeight) / (2.0 * float(focalLength))) * 180.0 / math.pi

@Property(type=QUrl, notify=undistortedImageParamsChanged)
Expand Down

0 comments on commit 7f72f81

Please sign in to comment.