Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New sfmFilter node: split sfm based on filenames regex #2582

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions meshroom/nodes/aliceVision/SfMFilter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
__version__ = "1.0"

from meshroom.core import desc
from meshroom.core.utils import VERBOSE_LEVEL


class SfMFilter(desc.CommandLineNode):
commandLine = 'aliceVision_sfmFilter {allParams}'
category = 'Utils'
documentation = '''
This node allows select views from sfmData file using a regular expresion.
'''

inputs = [
desc.File(
name="inputFile",
label="inputFile",
description="SfMData file.",
value="",
),
desc.StringParam(
name="fileMatchingPattern",
label="File Matching Pattern",
description="Matching regular expression.\n"
"You should capture specific parts of the filepath with parentheses to define matching elements.\n"
"Some examples of patterns:\n"
" - Match the filename without extension (default value): "
r'".*\/(.*?)\.\w{3}"' + "\n"
" - Match the filename suffix after \"_\": "
r'".*\/.*(_.*?\.\w{3})"' + "\n"
" - Match the filename prefix before \"_\": "
r'".*\/(.*?)_.*\.\w{3}"',
value=r'.*\/(.*?)\.\w{3}',
),
desc.ChoiceParam(
name="verboseLevel",
label="Verbose Level",
description="Verbosity level (fatal, error, warning, info, debug, trace).",
values=VERBOSE_LEVEL,
value="info",
),
]

outputs = [
desc.File(
name="outputSfMData_selected",
label="SfMData_selected",
description="Output SfMData file containing selected views.",
value=desc.Node.internalFolder + "/selectedSfmData.sfm",
),
desc.File(
name="outputSfMData_unselected",
label="SfMData_unselected",
description="Output SfMData file containing remaining views.",
value=desc.Node.internalFolder + "/unselectedSfmData.sfm",
),
]
11 changes: 6 additions & 5 deletions meshroom/nodes/aliceVision/SfMTransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ class SfMTransfer(desc.AVCommandLineNode):
name="method",
label="Matching Method",
description="Matching Method:\n"
" - from_viewid: Align cameras with same view ID.\n"
" - from_filepath: Align cameras with a filepath matching, using 'fileMatchingPattern'.\n"
" - from_metadata: Align cameras with matching metadata, using 'metadataMatchingList'.\n"
" - from_intrinsicid: Copy intrinsics parameters.\n",
" - from_viewid: Match cameras based on viewId.\n"
" - from_filepath: Match cameras with a filepath matching, using 'fileMatchingPattern'.\n"
" - from_metadata: Match cameras with matching metadata, using 'metadataMatchingList'.\n"
" - from_poseid: Match cameras based on poseId.\n"
" - from_intrinsicid: Match cameras based on intrinsicId.\n",
value="from_viewid",
values=["from_viewid", "from_filepath", "from_metadata", "from_intrinsicid"],
values=["from_viewid", "from_filepath", "from_metadata", "from_poseid", "from_intrinsicid"],
),
desc.StringParam(
name="fileMatchingPattern",
Expand Down
277 changes: 277 additions & 0 deletions meshroom/pipelines/multi-viewPhotometricStereo.mg
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
{
"header": {
"pipelineVersion": "2.2",
"releaseVersion": "2024.1.0-develop",
"fileVersion": "2.0",
"template": true,
"nodesVersions": {
"CameraInit": "11.0",
"DepthMap": "5.0",
"DepthMapFilter": "4.0",
"FeatureExtraction": "1.3",
"FeatureMatching": "2.0",
"ImageMatching": "2.0",
"LightingCalibration": "1.0",
"MeshFiltering": "3.0",
"Meshing": "7.0",
"PhotometricStereo": "1.0",
"PrepareDenseScene": "3.1",
"SfMFilter": "1.0",
"SfMTransfer": "2.1",
"SphereDetection": "1.0",
"StructureFromMotion": "3.3",
"Texturing": "6.0"
}
},
"graph": {
"CameraInit_1": {
"nodeType": "CameraInit",
"position": [
-400,
200
],
"inputs": {
"rawColorInterpretation": "LibRawWhiteBalancing"
}
},
"DepthMapFilter_1": {
"nodeType": "DepthMapFilter",
"position": [
1200,
0
],
"inputs": {
"input": "{DepthMap_1.input}",
"depthMapsFolder": "{DepthMap_1.output}"
}
},
"DepthMap_1": {
"nodeType": "DepthMap",
"position": [
1000,
0
],
"inputs": {
"input": "{PrepareDenseScene_1.input}",
"imagesFolder": "{PrepareDenseScene_1.output}"
}
},
"FeatureExtraction_1": {
"nodeType": "FeatureExtraction",
"position": [
0,
0
],
"inputs": {
"input": "{SfMFilter_1.outputSfMData_selected}"
}
},
"FeatureMatching_1": {
"nodeType": "FeatureMatching",
"position": [
400,
0
],
"inputs": {
"input": "{ImageMatching_1.input}",
"featuresFolders": "{ImageMatching_1.featuresFolders}",
"imagePairsList": "{ImageMatching_1.output}",
"describerTypes": "{FeatureExtraction_1.describerTypes}",
"maxIteration": 2048
}
},
"ImageMatching_1": {
"nodeType": "ImageMatching",
"position": [
200,
0
],
"inputs": {
"input": "{FeatureExtraction_1.input}",
"featuresFolders": [
"{FeatureExtraction_1.output}"
]
}
},
"LightingCalibration_1": {
"nodeType": "LightingCalibration",
"position": [
1200,
200
],
"inputs": {
"inputPath": "{SphereDetection_1.input}",
"inputDetection": "{SphereDetection_1.output}"
}
},
"MeshFiltering_1": {
"nodeType": "MeshFiltering",
"position": [
1600,
0
],
"inputs": {
"inputMesh": "{Meshing_1.outputMesh}"
}
},
"Meshing_1": {
"nodeType": "Meshing",
"position": [
1400,
0
],
"inputs": {
"input": "{DepthMapFilter_1.input}",
"depthMapsFolder": "{DepthMapFilter_1.output}"
}
},
"PhotometricStereo_1": {
"nodeType": "PhotometricStereo",
"position": [
1400,
200
],
"inputs": {
"inputPath": "{LightingCalibration_1.inputPath}",
"pathToJSONLightFile": "{LightingCalibration_1.outputFile}"
}
},
"PrepareDenseScene_1": {
"nodeType": "PrepareDenseScene",
"position": [
800,
0
],
"inputs": {
"input": "{StructureFromMotion_1.output}"
}
},
"PrepareDenseScene_2": {
"nodeType": "PrepareDenseScene",
"position": [
2200,
200
],
"inputs": {
"input": "{PhotometricStereo_1.outputSfmDataAlbedo}"
}
},
"PrepareDenseScene_3": {
"nodeType": "PrepareDenseScene",
"position": [
2200,
400
],
"inputs": {
"input": "{PhotometricStereo_1.outputSfmDataNormal}"
}
},
"PrepareDenseScene_4": {
"nodeType": "PrepareDenseScene",
"position": [
2200,
600
],
"inputs": {
"input": "{PhotometricStereo_1.outputSfmDataNormalPNG}"
}
},
"SfMFilter_1": {
"nodeType": "SfMFilter",
"position": [
-200,
200
],
"inputs": {
"inputFile": "{CameraInit_1.output}",
"fileMatchingPattern": ".*/.*ambiant.*"
}
},
"SfMTransfer_1": {
"nodeType": "SfMTransfer",
"position": [
800,
200
],
"inputs": {
"input": "{SfMFilter_1.outputSfMData_unselected}",
"reference": "{StructureFromMotion_1.output}",
"method": "from_poseid"
}
},
"SphereDetection_1": {
"nodeType": "SphereDetection",
"position": [
1000,
200
],
"inputs": {
"input": "{SfMTransfer_1.output}"
}
},
"StructureFromMotion_1": {
"nodeType": "StructureFromMotion",
"position": [
600,
0
],
"inputs": {
"input": "{FeatureMatching_1.input}",
"featuresFolders": "{FeatureMatching_1.featuresFolders}",
"matchesFolders": [
"{FeatureMatching_1.output}"
],
"describerTypes": "{FeatureMatching_1.describerTypes}",
"localizerEstimatorMaxIterations": 4096
}
},
"Texturing_1": {
"nodeType": "Texturing",
"position": [
1800,
0
],
"inputs": {
"input": "{Meshing_1.output}",
"imagesFolder": "{DepthMap_1.imagesFolder}",
"inputMesh": "{MeshFiltering_1.outputMesh}"
}
},
"Texturing_2": {
"nodeType": "Texturing",
"position": [
2400,
200
],
"inputs": {
"input": "{Meshing_1.output}",
"imagesFolder": "{PrepareDenseScene_2.output}",
"inputMesh": "{MeshFiltering_1.outputMesh}"
}
},
"Texturing_3": {
"nodeType": "Texturing",
"position": [
2400,
400
],
"inputs": {
"input": "{Meshing_1.output}",
"imagesFolder": "{PrepareDenseScene_3.output}",
"inputMesh": "{MeshFiltering_1.outputMesh}"
}
},
"Texturing_4": {
"nodeType": "Texturing",
"position": [
2400,
600
],
"inputs": {
"input": "{Meshing_1.output}",
"imagesFolder": "{PrepareDenseScene_4.output}",
"inputMesh": "{MeshFiltering_1.outputMesh}"
}
}
}
}
Loading