Skip to content

Commit d797692

Browse files
authored
Merge pull request #2533 from alicevision/dev/anamorphicFocal
[Viewer3D] Apply the pixel aspect ratio for the Frame Overlay
2 parents 705d00b + 0bf2c41 commit d797692

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
@@ -248,7 +248,7 @@ FocusScope {
248248
sourceComponent: ImageOverlay {
249249
id: imageOverlay
250250
source: root.viewpoint.undistortedImageSource
251-
imageRatio: root.viewpoint.orientedImageSize.width / root.viewpoint.orientedImageSize.height
251+
imageRatio: root.viewpoint.orientedImageSize.width * root.viewpoint.pixelAspectRatio / root.viewpoint.orientedImageSize.height
252252
uvCenterOffset: root.viewpoint.uvCenterOffset
253253
showFrame: Viewer3DSettings.showViewpointImageFrame
254254
imageOpacity: Viewer3DSettings.viewpointImageOverlayOpacity

meshroom/ui/reconstruction.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,14 @@ def fieldOfView(self):
374374
return 2.0 * math.atan(float(sensorWidth) / (2.0 * float(focalLength))) * 180.0 / math.pi
375375
else:
376376
return 2.0 * math.atan(float(sensorHeight) / (2.0 * float(focalLength))) * 180.0 / math.pi
377+
378+
@Property(type=float, notify=sfmParamsChanged)
379+
def pixelAspectRatio(self):
380+
""" Get camera pixel aspect ratio. """
381+
if not self.solvedIntrinsics:
382+
return 1.0
383+
384+
return float(self.solvedIntrinsics["pixelRatio"])
377385

378386
@Property(type=QUrl, notify=undistortedImageParamsChanged)
379387
def undistortedImageSource(self):

0 commit comments

Comments
 (0)