Skip to content

Commit 7f72f81

Browse files
author
Fabien Servant
committed
Field of view functions works for tall images
1 parent b5dda4e commit 7f72f81

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

meshroom/ui/reconstruction.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,18 @@ def fieldOfView(self):
361361
if not self.solvedIntrinsics:
362362
return None
363363
focalLength = self.solvedIntrinsics["focalLength"]
364+
365+
#We assume that if the width is less than the weight
366+
#It's because the image has been rotated and not
367+
#because the sensor has some unusual shape
368+
sensorWidth = self.solvedIntrinsics["sensorWidth"]
369+
sensorHeight = self.solvedIntrinsics["sensorHeight"]
370+
if self.imageSize.height() > self.imageSize.width():
371+
sensorWidth, sensorHeight = sensorHeight, sensorWidth
372+
364373
if self.orientation in (5, 6, 7, 8):
365-
sensorWidth = self.solvedIntrinsics["sensorWidth"]
366374
return 2.0 * math.atan(float(sensorWidth) / (2.0 * float(focalLength))) * 180.0 / math.pi
367375
else:
368-
sensorHeight = self.solvedIntrinsics["sensorHeight"]
369376
return 2.0 * math.atan(float(sensorHeight) / (2.0 * float(focalLength))) * 180.0 / math.pi
370377

371378
@Property(type=QUrl, notify=undistortedImageParamsChanged)

0 commit comments

Comments
 (0)