Skip to content

Commit aa368df

Browse files
author
Fabien Servant
committed
Use pixel aspect ratio for 3d viewer
1 parent 9c33c57 commit aa368df

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

meshroom/ui/qml/Viewer3D/Viewer3D.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ FocusScope {
269269
sourceComponent: ImageOverlay {
270270
id: imageOverlay
271271
source: root.viewpoint.undistortedImageSource
272-
imageRatio: root.viewpoint.orientedImageSize.width / root.viewpoint.orientedImageSize.height
272+
imageRatio: root.viewpoint.orientedImageSize.width * root.viewpoint.pixelAspectRatio / root.viewpoint.orientedImageSize.height
273273
uvCenterOffset: root.viewpoint.uvCenterOffset
274274
showFrame: Viewer3DSettings.showViewpointImageFrame
275275
imageOpacity: Viewer3DSettings.viewpointImageOverlayOpacity

meshroom/ui/reconstruction.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,14 @@ def fieldOfView(self):
367367
else:
368368
sensorHeight = self.solvedIntrinsics["sensorHeight"]
369369
return 2.0 * math.atan(float(sensorHeight) / (2.0 * float(focalLength))) * 180.0 / math.pi
370+
371+
@Property(type=float, notify=sfmParamsChanged)
372+
def pixelAspectRatio(self):
373+
""" Get camera pixel aspect ratio. """
374+
if not self.solvedIntrinsics:
375+
return 1.0
376+
377+
return float(self.solvedIntrinsics["pixelRatio"])
370378

371379
@Property(type=QUrl, notify=undistortedImageParamsChanged)
372380
def undistortedImageSource(self):

0 commit comments

Comments
 (0)