mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-20 20:46:28 +02:00
Use principal point in scenePreview
This commit is contained in:
parent
f48785ff77
commit
d46707a7d5
1 changed files with 8 additions and 0 deletions
|
@ -104,6 +104,13 @@ def setupCamera(intrinsic, pose):
|
||||||
camData.sensor_width = float(intrinsic['sensorWidth'])
|
camData.sensor_width = float(intrinsic['sensorWidth'])
|
||||||
camData.lens = float(intrinsic['focalLength'])
|
camData.lens = float(intrinsic['focalLength'])
|
||||||
|
|
||||||
|
#shift is normalized with the largest resolution
|
||||||
|
fwidth = float(intrinsic['width'])
|
||||||
|
fheight = float(intrinsic['height'])
|
||||||
|
maxSize = max(fwidth, fheight)
|
||||||
|
camData.shift_x = - float(intrinsic['principalPoint'][0]) / maxSize
|
||||||
|
camData.shift_y = float(intrinsic['principalPoint'][1]) / maxSize
|
||||||
|
|
||||||
tr = pose['pose']['transform']
|
tr = pose['pose']['transform']
|
||||||
matPose = mathutils.Matrix.Identity(4)
|
matPose = mathutils.Matrix.Identity(4)
|
||||||
matPose[0][0] = float(tr['rotation'][0])
|
matPose[0][0] = float(tr['rotation'][0])
|
||||||
|
@ -301,6 +308,7 @@ def setupPointCloudShading(obj, color, size):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
argv = sys.argv
|
argv = sys.argv
|
||||||
|
|
||||||
if "--" not in argv:
|
if "--" not in argv:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue