[ui] Reconstruction: the active sfm node can be a StructureFromMotion or a PanoramaEstimation node

This commit is contained in:
Fabien Castan 2020-06-25 01:10:25 +02:00
parent 9e03f67c9b
commit 49c03bc239
2 changed files with 32 additions and 30 deletions

View file

@ -347,30 +347,3 @@ It iterates like that, adding cameras and triangulating new 2D features into 3D
uid=[],
),
]
@staticmethod
def getResults(node):
"""
Parse SfM result and return views, poses and intrinsics as three dicts with viewId, poseId and intrinsicId as keys.
"""
reportFile = node.outputViewsAndPoses.value
if not os.path.exists(reportFile):
return {}, {}, {}
with open(reportFile) as jsonFile:
report = json.load(jsonFile)
views = dict()
poses = dict()
intrinsics = dict()
for view in report['views']:
views[view['viewId']] = view
for pose in report['poses']:
poses[pose['poseId']] = pose['pose']
for intrinsic in report['intrinsics']:
intrinsics[intrinsic['intrinsicId']] = intrinsic
return views, poses, intrinsics