mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-10 14:51:54 +02:00
[reconstruction] ViewpointWrapper: fix uvCenterOffset for rotated images
correctly apply image transformation to principal point correction in uv coordinates.
This commit is contained in:
parent
633b8c0e00
commit
ae91f3bcd5
1 changed files with 6 additions and 1 deletions
|
@ -332,7 +332,12 @@ class ViewpointWrapper(QObject):
|
||||||
uvPP = QVector2D(float(pp[0]) / self.imageSize.width(), float(pp[1]) / self.imageSize.height())
|
uvPP = QVector2D(float(pp[0]) / self.imageSize.width(), float(pp[1]) / self.imageSize.height())
|
||||||
# convert to offset
|
# convert to offset
|
||||||
offset = uvPP - QVector2D(0.5, 0.5)
|
offset = uvPP - QVector2D(0.5, 0.5)
|
||||||
return offset if self.orientation == 1 else -offset
|
# apply orientation to principal point correction
|
||||||
|
if self.orientation == 6:
|
||||||
|
offset = QVector2D(-offset.y(), offset.x())
|
||||||
|
elif self.orientation == 8:
|
||||||
|
offset = QVector2D(offset.y(), -offset.x())
|
||||||
|
return offset
|
||||||
|
|
||||||
@Property(type=float, notify=sfmParamsChanged)
|
@Property(type=float, notify=sfmParamsChanged)
|
||||||
def fieldOfView(self):
|
def fieldOfView(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue