From 1ace16f537cfb804f2e07ce96822331b59570933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vital?= Date: Fri, 3 Mar 2023 15:48:08 +0100 Subject: [PATCH 01/11] [nodes] add undistortion to intrinsic attributes --- meshroom/nodes/aliceVision/CameraInit.py | 25 +++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/meshroom/nodes/aliceVision/CameraInit.py b/meshroom/nodes/aliceVision/CameraInit.py index 9631582225..1090336eff 100644 --- a/meshroom/nodes/aliceVision/CameraInit.py +++ b/meshroom/nodes/aliceVision/CameraInit.py @@ -91,7 +91,21 @@ label="Distortion Params", description="Distortion Parameters", ), - + desc.GroupAttribute( + name="undistortionOffset", + label="Undistortion Offset", + description="Undistortion Offset", + groupDesc=[ + desc.FloatParam(name="x", label="x", description="", value=0.0, uid=[0], range=(0.0, 10000.0, 1.0)), + desc.FloatParam(name="y", label="y", description="", value=0.0, uid=[0], range=(0.0, 10000.0, 1.0)), + ] + ), + desc.ListAttribute( + name="undistortionParams", + elementDesc=desc.FloatParam(name="p", label="", description="", value=0.0, uid=[0], range=(-0.1, 0.1, 0.01)), + label="Undistortion Params", + description="Undistortion Parameters" + ), desc.BoolParam(name='locked', label='Locked', description='If the camera has been calibrated, the internal camera parameters (intrinsics) can be locked. It should improve robustness and speedup the reconstruction.', value=False, uid=[0]), @@ -123,6 +137,14 @@ def readSfMData(sfmFile): if intrinsic['distortionParams'] == '': intrinsic['distortionParams'] = list() + offset = intrinsic['undistortionOffset'] + intrinsic['undistortionOffset'] = {} + intrinsic['undistortionOffset']['x'] = offset[0] + intrinsic['undistortionOffset']['y'] = offset[1] + + if intrinsic['undistortionParams'] == '': + intrinsic['undistortionParams'] = list() + viewsKeys = [v.name for v in Viewpoint] views = [{k: v for k, v in item.items() if k in viewsKeys} for item in data.get("views", [])] for view in views: @@ -411,6 +433,7 @@ def createViewpointsFile(self, node, additionalViews=()): intrinsics = node.intrinsics.getPrimitiveValue(exportDefault=True) for intrinsic in intrinsics: intrinsic['principalPoint'] = [intrinsic['principalPoint']['x'], intrinsic['principalPoint']['y']] + intrinsic['undistortionOffset'] = [intrinsic['undistortionOffset']['x'], intrinsic['undistortionOffset']['y']] views = node.viewpoints.getPrimitiveValue(exportDefault=False) # convert the metadata string into a map From 69887aecc347e4d44a29f4fa70a698c3c96c3ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vital?= Date: Fri, 3 Mar 2023 15:49:39 +0100 Subject: [PATCH 02/11] [nodes] update DistortionCalibration to use the output of a Checkerboard Detection --- .../aliceVision/DistortionCalibration.py | 31 ++++++------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/meshroom/nodes/aliceVision/DistortionCalibration.py b/meshroom/nodes/aliceVision/DistortionCalibration.py index b69a2b7c9e..a14a128b83 100644 --- a/meshroom/nodes/aliceVision/DistortionCalibration.py +++ b/meshroom/nodes/aliceVision/DistortionCalibration.py @@ -1,4 +1,4 @@ -__version__ = '2.0' +__version__ = '3.0' from meshroom.core import desc @@ -7,8 +7,9 @@ class DistortionCalibration(desc.AVCommandLineNode): commandLine = 'aliceVision_distortionCalibration {allParams}' size = desc.DynamicNodeSize('input') + category = 'Other' documentation = ''' - Calibration of a camera/lens couple distortion using a full screen checkerboard +Calibration of a camera/lens couple distortion using a full screen checkerboard. ''' inputs = [ @@ -19,26 +20,12 @@ class DistortionCalibration(desc.AVCommandLineNode): value='', uid=[0], ), - desc.ListAttribute( - elementDesc=desc.File( - name='lensGridImage', - label='Lens Grid Image', - description='', - value='', - uid=[0], - ), - name='lensGrid', - label='Lens Grid Images', - description='Lens grid images to estimate the optical distortions.', - ), - desc.ChoiceParam( - name='verboseLevel', - label='Verbose Level', - description='Verbosity level (fatal, error, warning, info, debug, trace).', - value='info', - values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'], - exclusive=True, - uid=[], + desc.File( + name='checkerboards', + label='Checkerboards folder', + description='Folder containing checkerboard JSON files', + value='', + uid=[0] ), ] From b6d15b911f850c73047737c59b2fe1d8d7eb3968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vital?= Date: Fri, 3 Mar 2023 15:50:14 +0100 Subject: [PATCH 03/11] [nodes] new ExportDistortion node --- .../nodes/aliceVision/ExportDistortion.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 meshroom/nodes/aliceVision/ExportDistortion.py diff --git a/meshroom/nodes/aliceVision/ExportDistortion.py b/meshroom/nodes/aliceVision/ExportDistortion.py new file mode 100644 index 0000000000..9eee081578 --- /dev/null +++ b/meshroom/nodes/aliceVision/ExportDistortion.py @@ -0,0 +1,31 @@ +__version__ = "1.0" + +from meshroom.core import desc + +class ExportDistortion(desc.AVCommandLineNode): + commandLine = 'aliceVision_exportDistortion {allParams}' + + category = 'Export' + documentation = ''' +Export the distortion model and parameters of cameras in a SfM scene. +''' + + inputs = [ + desc.File( + name='input', + label='Input SfMData', + description='SfMData file.', + value='', + uid=[0], + ), + ] + + outputs = [ + desc.File( + name='output', + label='Folder', + description='', + value=desc.Node.internalFolder, + uid=[], + ), + ] From 861a1c9f27fefd35b12ee00c6495310d52621456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vital?= Date: Fri, 3 Mar 2023 18:05:07 +0100 Subject: [PATCH 04/11] [nodes] DistortionCalibration: add cameraModel input attribute --- .../nodes/aliceVision/DistortionCalibration.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/meshroom/nodes/aliceVision/DistortionCalibration.py b/meshroom/nodes/aliceVision/DistortionCalibration.py index a14a128b83..4303c23ac3 100644 --- a/meshroom/nodes/aliceVision/DistortionCalibration.py +++ b/meshroom/nodes/aliceVision/DistortionCalibration.py @@ -16,16 +16,25 @@ class DistortionCalibration(desc.AVCommandLineNode): desc.File( name='input', label='SfmData', - description='SfmData File', + description='SfmData File.', value='', uid=[0], ), desc.File( name='checkerboards', label='Checkerboards folder', - description='Folder containing checkerboard JSON files', + description='Folder containing checkerboard JSON files.', value='', - uid=[0] + uid=[0], + ), + desc.ChoiceParam( + name='cameraModel', + label='Camera Model', + description='Camera model used to estimate distortion.', + value='3deanamorphic4', + values=['3deanamorphic4'], + exclusive=True, + uid=[0], ), ] @@ -33,7 +42,7 @@ class DistortionCalibration(desc.AVCommandLineNode): desc.File( name='outSfMData', label='SfmData File', - description='Path to the output sfmData file', + description='Path to the output sfmData file.', value=desc.Node.internalFolder + 'sfmData.sfm', uid=[], ) From 53cc8898c14989595cc7733913606f5936db5325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vital?= Date: Wed, 15 Mar 2023 17:12:50 +0100 Subject: [PATCH 05/11] [nodes] new ApplyCalibration node for aliceVision_applyCalibration software --- .../nodes/aliceVision/ApplyCalibration.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 meshroom/nodes/aliceVision/ApplyCalibration.py diff --git a/meshroom/nodes/aliceVision/ApplyCalibration.py b/meshroom/nodes/aliceVision/ApplyCalibration.py new file mode 100644 index 0000000000..d10672b8cb --- /dev/null +++ b/meshroom/nodes/aliceVision/ApplyCalibration.py @@ -0,0 +1,38 @@ +__version__ = "1.0" + +from meshroom.core import desc + +class ApplyCalibration(desc.AVCommandLineNode): + commandLine = 'aliceVision_applyCalibration {allParams}' + + category = 'Utils' + documentation = ''' +Overwrite intrinsics with a calibrated intrinsic. +''' + + inputs = [ + desc.File( + name='input', + label='Input SfMData', + description='SfMData file.', + value='', + uid=[0], + ), + desc.File( + name='calibration', + label='Calibration', + description='Calibration SfMData file.', + value='', + uid=[0], + ), + ] + + outputs = [ + desc.File( + name='output', + label='SfMData File.', + description='Path to the output sfmData file.', + value=desc.Node.internalFolder + 'sfmData.sfm', + uid=[], + ), + ] From 3bb610b30b2788f69dbcd71242abf579cccd0941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vital?= Date: Tue, 21 Mar 2023 18:26:29 +0100 Subject: [PATCH 06/11] [nodes] DistortionCalibration: rename outSfMData to output --- meshroom/nodes/aliceVision/DistortionCalibration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshroom/nodes/aliceVision/DistortionCalibration.py b/meshroom/nodes/aliceVision/DistortionCalibration.py index 4303c23ac3..eb38efaa8d 100644 --- a/meshroom/nodes/aliceVision/DistortionCalibration.py +++ b/meshroom/nodes/aliceVision/DistortionCalibration.py @@ -40,7 +40,7 @@ class DistortionCalibration(desc.AVCommandLineNode): outputs = [ desc.File( - name='outSfMData', + name='output', label='SfmData File', description='Path to the output sfmData file.', value=desc.Node.internalFolder + 'sfmData.sfm', From a9befd9607ce9dd5ee88c1fab3d3677a0b44683e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vital?= Date: Mon, 17 Apr 2023 16:41:22 +0200 Subject: [PATCH 07/11] [nodes] ApplyCalibration: chunkable output --- meshroom/nodes/aliceVision/ApplyCalibration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/meshroom/nodes/aliceVision/ApplyCalibration.py b/meshroom/nodes/aliceVision/ApplyCalibration.py index d10672b8cb..e3f0bd30e8 100644 --- a/meshroom/nodes/aliceVision/ApplyCalibration.py +++ b/meshroom/nodes/aliceVision/ApplyCalibration.py @@ -4,6 +4,7 @@ class ApplyCalibration(desc.AVCommandLineNode): commandLine = 'aliceVision_applyCalibration {allParams}' + size = desc.DynamicNodeSize('input') category = 'Utils' documentation = ''' From e895808e927749418bb7513f8be8c148a51fa99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vital?= Date: Thu, 27 Apr 2023 16:38:16 +0200 Subject: [PATCH 08/11] [pipelines] removed DistortionCalibration node from default pipelines --- meshroom/pipelines/cameraTracking.mg | 135 +++++----- .../photogrammetryAndCameraTracking.mg | 244 +++++++++--------- 2 files changed, 178 insertions(+), 201 deletions(-) diff --git a/meshroom/pipelines/cameraTracking.mg b/meshroom/pipelines/cameraTracking.mg index 24553e9f63..a583a6891c 100644 --- a/meshroom/pipelines/cameraTracking.mg +++ b/meshroom/pipelines/cameraTracking.mg @@ -1,105 +1,94 @@ { "header": { - "pipelineVersion": "2.2", - "releaseVersion": "2023.1.0", - "fileVersion": "1.1", - "template": true, + "pipelineVersion": "2.2", + "releaseVersion": "2023.2.0-develop", + "fileVersion": "1.1", + "template": true, "nodesVersions": { - "ExportAnimatedCamera": "2.0", - "FeatureMatching": "2.0", - "DistortionCalibration": "2.0", - "CameraInit": "9.0", - "ImageMatching": "2.0", - "FeatureExtraction": "1.1", + "ExportAnimatedCamera": "2.0", + "Publish": "1.2", "StructureFromMotion": "3.0", - "Publish": "1.2" + "FeatureExtraction": "1.1", + "FeatureMatching": "2.0", + "CameraInit": "9.0", + "ImageMatching": "2.0" } - }, + }, "graph": { - "DistortionCalibration_1": { - "inputs": { - "input": "{CameraInit_1.output}" - }, - "nodeType": "DistortionCalibration", - "position": [ - 200, - 160 - ] - }, "ImageMatching_1": { + "nodeType": "ImageMatching", + "position": [ + 400, + 0 + ], "inputs": { - "nbNeighbors": 10, - "nbMatches": 5, - "input": "{FeatureExtraction_1.input}", + "input": "{FeatureExtraction_1.input}", "featuresFolders": [ "{FeatureExtraction_1.output}" - ] - }, - "nodeType": "ImageMatching", + ], + "nbMatches": 5, + "nbNeighbors": 10 + } + }, + "FeatureExtraction_1": { + "nodeType": "FeatureExtraction", "position": [ - 400, + 200, 0 - ] - }, - "FeatureExtraction_1": { + ], "inputs": { "input": "{CameraInit_1.output}" - }, - "nodeType": "FeatureExtraction", + } + }, + "StructureFromMotion_1": { + "nodeType": "StructureFromMotion", "position": [ - 200, + 800, 0 - ] - }, - "StructureFromMotion_1": { + ], "inputs": { - "minAngleForLandmark": 0.5, - "minNumberOfObservationsForTriangulation": 3, - "describerTypes": "{FeatureMatching_1.describerTypes}", - "input": "{FeatureMatching_1.input}", - "featuresFolders": "{FeatureMatching_1.featuresFolders}", + "input": "{FeatureMatching_1.input}", + "featuresFolders": "{FeatureMatching_1.featuresFolders}", "matchesFolders": [ "{FeatureMatching_1.output}" - ], - "minInputTrackLength": 5, - "minAngleForTriangulation": 1.0 - }, - "nodeType": "StructureFromMotion", + ], + "describerTypes": "{FeatureMatching_1.describerTypes}", + "minInputTrackLength": 5, + "minNumberOfObservationsForTriangulation": 3, + "minAngleForTriangulation": 1.0, + "minAngleForLandmark": 0.5 + } + }, + "ExportAnimatedCamera_1": { + "nodeType": "ExportAnimatedCamera", "position": [ - 800, + 1000, 0 - ] - }, - "ExportAnimatedCamera_1": { + ], "inputs": { "input": "{StructureFromMotion_1.output}" - }, - "nodeType": "ExportAnimatedCamera", - "position": [ - 1000, - 0 - ] - }, + } + }, "CameraInit_1": { - "inputs": {}, - "nodeType": "CameraInit", + "nodeType": "CameraInit", "position": [ - 0, + 0, 0 - ] - }, + ], + "inputs": {} + }, "FeatureMatching_1": { - "inputs": { - "describerTypes": "{FeatureExtraction_1.describerTypes}", - "imagePairsList": "{ImageMatching_1.output}", - "input": "{DistortionCalibration_1.outSfMData}", - "featuresFolders": "{ImageMatching_1.featuresFolders}" - }, - "nodeType": "FeatureMatching", + "nodeType": "FeatureMatching", "position": [ - 600, + 600, 0 - ] + ], + "inputs": { + "input": "{ImageMatching_1.input}", + "featuresFolders": "{ImageMatching_1.featuresFolders}", + "imagePairsList": "{ImageMatching_1.output}", + "describerTypes": "{FeatureExtraction_1.describerTypes}" + } }, "Publish_1": { "nodeType": "Publish", diff --git a/meshroom/pipelines/photogrammetryAndCameraTracking.mg b/meshroom/pipelines/photogrammetryAndCameraTracking.mg index 6adc1b4acf..92df635284 100644 --- a/meshroom/pipelines/photogrammetryAndCameraTracking.mg +++ b/meshroom/pipelines/photogrammetryAndCameraTracking.mg @@ -1,178 +1,166 @@ { "header": { - "pipelineVersion": "2.2", - "releaseVersion": "2023.1.0", - "fileVersion": "1.1", - "template": true, + "pipelineVersion": "2.2", + "releaseVersion": "2023.2.0-develop", + "fileVersion": "1.1", + "template": true, "nodesVersions": { - "ExportAnimatedCamera": "2.0", - "FeatureMatching": "2.0", - "DistortionCalibration": "2.0", - "CameraInit": "9.0", - "ImageMatchingMultiSfM": "1.0", - "ImageMatching": "2.0", - "FeatureExtraction": "1.1", + "Publish": "1.2", "StructureFromMotion": "3.0", - "Publish": "1.2" + "FeatureExtraction": "1.1", + "FeatureMatching": "2.0", + "CameraInit": "9.0", + "ImageMatchingMultiSfM": "1.0", + "ImageMatching": "2.0", + "ExportAnimatedCamera": "2.0" } - }, + }, "graph": { - "DistortionCalibration_1": { - "inputs": { - "input": "{CameraInit_2.output}" - }, - "nodeType": "DistortionCalibration", - "position": [ - 1024, - 393 - ] - }, "ImageMatching_1": { + "nodeType": "ImageMatching", + "position": [ + 400, + 0 + ], "inputs": { - "input": "{FeatureExtraction_1.input}", + "input": "{FeatureExtraction_1.input}", "featuresFolders": [ "{FeatureExtraction_1.output}" ] - }, - "nodeType": "ImageMatching", + } + }, + "FeatureExtraction_1": { + "nodeType": "FeatureExtraction", "position": [ - 400, + 200, 0 - ] - }, - "FeatureExtraction_1": { + ], "inputs": { "input": "{CameraInit_1.output}" - }, - "nodeType": "FeatureExtraction", + } + }, + "StructureFromMotion_1": { + "nodeType": "StructureFromMotion", "position": [ - 200, + 800, 0 - ] - }, - "StructureFromMotion_1": { + ], "inputs": { - "describerTypes": "{FeatureMatching_1.describerTypes}", - "input": "{FeatureMatching_1.input}", - "featuresFolders": "{FeatureMatching_1.featuresFolders}", + "input": "{FeatureMatching_1.input}", + "featuresFolders": "{FeatureMatching_1.featuresFolders}", "matchesFolders": [ "{FeatureMatching_1.output}" - ] - }, - "nodeType": "StructureFromMotion", - "position": [ - 800, - 0 - ] - }, + ], + "describerTypes": "{FeatureMatching_1.describerTypes}" + } + }, "ExportAnimatedCamera_1": { - "inputs": { - "sfmDataFilter": "{StructureFromMotion_1.output}", - "input": "{StructureFromMotion_2.output}" - }, - "nodeType": "ExportAnimatedCamera", + "nodeType": "ExportAnimatedCamera", "position": [ - 1629, + 1629, 212 - ] - }, + ], + "inputs": { + "input": "{StructureFromMotion_2.output}", + "sfmDataFilter": "{StructureFromMotion_1.output}" + } + }, "CameraInit_1": { - "inputs": {}, - "nodeType": "CameraInit", + "nodeType": "CameraInit", "position": [ - 0, + 0, 0 - ] - }, + ], + "inputs": {} + }, "ImageMatchingMultiSfM_1": { + "nodeType": "ImageMatchingMultiSfM", + "position": [ + 1029, + 212 + ], "inputs": { - "nbNeighbors": 10, - "nbMatches": 5, - "input": "{FeatureExtraction_2.input}", - "inputB": "{StructureFromMotion_1.output}", + "input": "{FeatureExtraction_2.input}", + "inputB": "{StructureFromMotion_1.output}", "featuresFolders": [ "{FeatureExtraction_2.output}" - ] - }, - "nodeType": "ImageMatchingMultiSfM", + ], + "nbMatches": 5, + "nbNeighbors": 10 + } + }, + "FeatureMatching_1": { + "nodeType": "FeatureMatching", "position": [ - 1029, + 600, + 0 + ], + "inputs": { + "input": "{ImageMatching_1.input}", + "featuresFolders": "{ImageMatching_1.featuresFolders}", + "imagePairsList": "{ImageMatching_1.output}", + "describerTypes": "{FeatureExtraction_1.describerTypes}" + } + }, + "Publish_1": { + "nodeType": "Publish", + "position": [ + 1829, 212 - ] - }, + ], + "inputs": { + "inputFiles": [ + "{ExportAnimatedCamera_1.output}" + ] + } + }, "CameraInit_2": { - "inputs": {}, - "nodeType": "CameraInit", + "nodeType": "CameraInit", "position": [ - -2, + -2, 223 - ] - }, + ], + "inputs": {} + }, "FeatureExtraction_2": { - "inputs": { - "input": "{CameraInit_2.output}" - }, - "nodeType": "FeatureExtraction", + "nodeType": "FeatureExtraction", "position": [ - 198, + 198, 223 - ] - }, - "FeatureMatching_2": { + ], "inputs": { - "describerTypes": "{FeatureExtraction_2.describerTypes}", - "imagePairsList": "{ImageMatchingMultiSfM_1.output}", - "input": "{DistortionCalibration_1.outSfMData}", - "featuresFolders": "{ImageMatchingMultiSfM_1.featuresFolders}" - }, - "nodeType": "FeatureMatching", + "input": "{CameraInit_2.output}" + } + }, + "FeatureMatching_2": { + "nodeType": "FeatureMatching", "position": [ - 1229, + 1229, 212 - ] - }, - "FeatureMatching_1": { - "inputs": { - "describerTypes": "{FeatureExtraction_1.describerTypes}", - "imagePairsList": "{ImageMatching_1.output}", - "input": "{ImageMatching_1.input}", - "featuresFolders": "{ImageMatching_1.featuresFolders}" - }, - "nodeType": "FeatureMatching", - "position": [ - 600, - 0 - ] - }, - "StructureFromMotion_2": { + ], "inputs": { - "minAngleForLandmark": 0.5, - "minNumberOfObservationsForTriangulation": 3, - "describerTypes": "{FeatureMatching_2.describerTypes}", - "input": "{FeatureMatching_2.input}", - "featuresFolders": "{FeatureMatching_2.featuresFolders}", - "matchesFolders": [ - "{FeatureMatching_2.output}" - ], - "minInputTrackLength": 5, - "minAngleForTriangulation": 1.0 - }, - "nodeType": "StructureFromMotion", - "position": [ - 1429, - 212 - ] + "featuresFolders": "{ImageMatchingMultiSfM_1.featuresFolders}", + "imagePairsList": "{ImageMatchingMultiSfM_1.output}", + "describerTypes": "{FeatureExtraction_2.describerTypes}" + } }, - "Publish_1": { - "nodeType": "Publish", + "StructureFromMotion_2": { + "nodeType": "StructureFromMotion", "position": [ - 1829, + 1429, 212 ], "inputs": { - "inputFiles": [ - "{ExportAnimatedCamera_1.output}" - ] + "input": "{FeatureMatching_2.input}", + "featuresFolders": "{FeatureMatching_2.featuresFolders}", + "matchesFolders": [ + "{FeatureMatching_2.output}" + ], + "describerTypes": "{FeatureMatching_2.describerTypes}", + "minInputTrackLength": 5, + "minNumberOfObservationsForTriangulation": 3, + "minAngleForTriangulation": 1.0, + "minAngleForLandmark": 0.5 } } } From 73332694fa4d83bc0fadd2ccfffc8e02d8544193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 24 May 2023 11:17:02 +0200 Subject: [PATCH 09/11] [nodes] Improve labels and descriptions for distortion calibration nodes --- meshroom/nodes/aliceVision/ApplyCalibration.py | 4 ++-- meshroom/nodes/aliceVision/CameraInit.py | 6 +++--- meshroom/nodes/aliceVision/DistortionCalibration.py | 10 +++++----- meshroom/nodes/aliceVision/ExportDistortion.py | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/meshroom/nodes/aliceVision/ApplyCalibration.py b/meshroom/nodes/aliceVision/ApplyCalibration.py index e3f0bd30e8..43c88b4e88 100644 --- a/meshroom/nodes/aliceVision/ApplyCalibration.py +++ b/meshroom/nodes/aliceVision/ApplyCalibration.py @@ -31,8 +31,8 @@ class ApplyCalibration(desc.AVCommandLineNode): outputs = [ desc.File( name='output', - label='SfMData File.', - description='Path to the output sfmData file.', + label='SfMData File', + description='Path to the output SfMData file.', value=desc.Node.internalFolder + 'sfmData.sfm', uid=[], ), diff --git a/meshroom/nodes/aliceVision/CameraInit.py b/meshroom/nodes/aliceVision/CameraInit.py index 1090336eff..10cf4d6a41 100644 --- a/meshroom/nodes/aliceVision/CameraInit.py +++ b/meshroom/nodes/aliceVision/CameraInit.py @@ -89,12 +89,12 @@ name="distortionParams", elementDesc=desc.FloatParam(name="p", label="", description="", value=0.0, uid=[0], range=(-0.1, 0.1, 0.01)), label="Distortion Params", - description="Distortion Parameters", + description="Distortion parameters.", ), desc.GroupAttribute( name="undistortionOffset", label="Undistortion Offset", - description="Undistortion Offset", + description="Undistortion offset.", groupDesc=[ desc.FloatParam(name="x", label="x", description="", value=0.0, uid=[0], range=(0.0, 10000.0, 1.0)), desc.FloatParam(name="y", label="y", description="", value=0.0, uid=[0], range=(0.0, 10000.0, 1.0)), @@ -104,7 +104,7 @@ name="undistortionParams", elementDesc=desc.FloatParam(name="p", label="", description="", value=0.0, uid=[0], range=(-0.1, 0.1, 0.01)), label="Undistortion Params", - description="Undistortion Parameters" + description="Undistortion parameters." ), desc.BoolParam(name='locked', label='Locked', description='If the camera has been calibrated, the internal camera parameters (intrinsics) can be locked. It should improve robustness and speedup the reconstruction.', diff --git a/meshroom/nodes/aliceVision/DistortionCalibration.py b/meshroom/nodes/aliceVision/DistortionCalibration.py index eb38efaa8d..9bbfaa795c 100644 --- a/meshroom/nodes/aliceVision/DistortionCalibration.py +++ b/meshroom/nodes/aliceVision/DistortionCalibration.py @@ -15,14 +15,14 @@ class DistortionCalibration(desc.AVCommandLineNode): inputs = [ desc.File( name='input', - label='SfmData', - description='SfmData File.', + label='Input SfMData', + description='SfMData file.', value='', uid=[0], ), desc.File( name='checkerboards', - label='Checkerboards folder', + label='Checkerboards Folder', description='Folder containing checkerboard JSON files.', value='', uid=[0], @@ -41,8 +41,8 @@ class DistortionCalibration(desc.AVCommandLineNode): outputs = [ desc.File( name='output', - label='SfmData File', - description='Path to the output sfmData file.', + label='SfMData File', + description='Path to the output SfMData file.', value=desc.Node.internalFolder + 'sfmData.sfm', uid=[], ) diff --git a/meshroom/nodes/aliceVision/ExportDistortion.py b/meshroom/nodes/aliceVision/ExportDistortion.py index 9eee081578..a0a7373fba 100644 --- a/meshroom/nodes/aliceVision/ExportDistortion.py +++ b/meshroom/nodes/aliceVision/ExportDistortion.py @@ -24,7 +24,7 @@ class ExportDistortion(desc.AVCommandLineNode): desc.File( name='output', label='Folder', - description='', + description='Output folder.', value=desc.Node.internalFolder, uid=[], ), From 962e0fa65f1e67e5f82bbc42a814203d58d3e44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 24 May 2023 12:39:49 +0200 Subject: [PATCH 10/11] [nodes] ExportDistortion: Add ST maps as viewable outputs --- meshroom/nodes/aliceVision/ExportDistortion.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/meshroom/nodes/aliceVision/ExportDistortion.py b/meshroom/nodes/aliceVision/ExportDistortion.py index a0a7373fba..fa9d070fa9 100644 --- a/meshroom/nodes/aliceVision/ExportDistortion.py +++ b/meshroom/nodes/aliceVision/ExportDistortion.py @@ -28,4 +28,22 @@ class ExportDistortion(desc.AVCommandLineNode): value=desc.Node.internalFolder, uid=[], ), + desc.File( + name='distoStMap', + label='Distortion ST Map', + description='Calibrated distortion ST map.', + semantic='image', + value=desc.Node.internalFolder + '_distort.exr', + group='', # do not export on the command line + uid=[], + ), + desc.File( + name='undistoStMap', + label='Undistortion ST Map', + description='Calibrated undistortion ST map.', + semantic='image', + value=desc.Node.internalFolder + '_undistort.exr', + group='', # do not export on the command line + uid=[], + ), ] From 44a2ce7d0c153bd7000db04c8c9a87f82b4a8016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 24 May 2023 14:51:09 +0200 Subject: [PATCH 11/11] [pipelines] Add a new template for distortion calibration --- meshroom/pipelines/distortionCalibration.mg | 69 +++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 meshroom/pipelines/distortionCalibration.mg diff --git a/meshroom/pipelines/distortionCalibration.mg b/meshroom/pipelines/distortionCalibration.mg new file mode 100644 index 0000000000..de9a29a1ab --- /dev/null +++ b/meshroom/pipelines/distortionCalibration.mg @@ -0,0 +1,69 @@ +{ + "header": { + "pipelineVersion": "2.2", + "releaseVersion": "2023.2.0-develop", + "fileVersion": "1.1", + "template": true, + "nodesVersions": { + "Publish": "1.2", + "ExportDistortion": "1.0", + "CameraInit": "9.0", + "CheckerboardDetection": "1.0", + "DistortionCalibration": "3.0" + } + }, + "graph": { + "CheckerboardDetection_1": { + "nodeType": "CheckerboardDetection", + "position": [ + 200, + 0 + ], + "inputs": { + "input": "{CameraInit_1.output}", + "exportDebugImages": true + } + }, + "DistortionCalibration_1": { + "nodeType": "DistortionCalibration", + "position": [ + 400, + 0 + ], + "inputs": { + "input": "{CheckerboardDetection_1.input}", + "checkerboards": "{CheckerboardDetection_1.output}" + } + }, + "ExportDistortion_1": { + "nodeType": "ExportDistortion", + "position": [ + 600, + 0 + ], + "inputs": { + "input": "{DistortionCalibration_1.output}" + } + }, + "Publish_1": { + "nodeType": "Publish", + "position": [ + 800, + 0 + ], + "inputs": { + "inputFiles": [ + "{ExportDistortion_1.output}" + ] + } + }, + "CameraInit_1": { + "nodeType": "CameraInit", + "position": [ + 0, + 0 + ], + "inputs": {} + } + } +}