Skip to content

Commit 0aa163d

Browse files
authored
Merge pull request #2582 from alicevision/dev/sfmFilter
New MultiView Photometric Stereo pipeline and new sfmFilter node
2 parents c2d4159 + 92a4db4 commit 0aa163d

File tree

3 files changed

+340
-5
lines changed

3 files changed

+340
-5
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
__version__ = "1.0"
2+
3+
from meshroom.core import desc
4+
from meshroom.core.utils import VERBOSE_LEVEL
5+
6+
7+
class SfMFilter(desc.CommandLineNode):
8+
commandLine = 'aliceVision_sfmFilter {allParams}'
9+
category = 'Utils'
10+
documentation = '''
11+
This node allows select views from sfmData file using a regular expresion.
12+
'''
13+
14+
inputs = [
15+
desc.File(
16+
name="inputFile",
17+
label="inputFile",
18+
description="SfMData file.",
19+
value="",
20+
),
21+
desc.StringParam(
22+
name="fileMatchingPattern",
23+
label="File Matching Pattern",
24+
description="Matching regular expression.\n"
25+
"You should capture specific parts of the filepath with parentheses to define matching elements.\n"
26+
"Some examples of patterns:\n"
27+
" - Match the filename without extension (default value): "
28+
r'".*\/(.*?)\.\w{3}"' + "\n"
29+
" - Match the filename suffix after \"_\": "
30+
r'".*\/.*(_.*?\.\w{3})"' + "\n"
31+
" - Match the filename prefix before \"_\": "
32+
r'".*\/(.*?)_.*\.\w{3}"',
33+
value=r'.*\/(.*?)\.\w{3}',
34+
),
35+
desc.ChoiceParam(
36+
name="verboseLevel",
37+
label="Verbose Level",
38+
description="Verbosity level (fatal, error, warning, info, debug, trace).",
39+
values=VERBOSE_LEVEL,
40+
value="info",
41+
),
42+
]
43+
44+
outputs = [
45+
desc.File(
46+
name="outputSfMData_selected",
47+
label="SfMData_selected",
48+
description="Output SfMData file containing selected views.",
49+
value=desc.Node.internalFolder + "/selectedSfmData.sfm",
50+
),
51+
desc.File(
52+
name="outputSfMData_unselected",
53+
label="SfMData_unselected",
54+
description="Output SfMData file containing remaining views.",
55+
value=desc.Node.internalFolder + "/unselectedSfmData.sfm",
56+
),
57+
]

meshroom/nodes/aliceVision/SfMTransfer.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ class SfMTransfer(desc.AVCommandLineNode):
3232
name="method",
3333
label="Matching Method",
3434
description="Matching Method:\n"
35-
" - from_viewid: Align cameras with same view ID.\n"
36-
" - from_filepath: Align cameras with a filepath matching, using 'fileMatchingPattern'.\n"
37-
" - from_metadata: Align cameras with matching metadata, using 'metadataMatchingList'.\n"
38-
" - from_intrinsicid: Copy intrinsics parameters.\n",
35+
" - from_viewid: Match cameras based on viewId.\n"
36+
" - from_filepath: Match cameras with a filepath matching, using 'fileMatchingPattern'.\n"
37+
" - from_metadata: Match cameras with matching metadata, using 'metadataMatchingList'.\n"
38+
" - from_poseid: Match cameras based on poseId.\n"
39+
" - from_intrinsicid: Match cameras based on intrinsicId.\n",
3940
value="from_viewid",
40-
values=["from_viewid", "from_filepath", "from_metadata", "from_intrinsicid"],
41+
values=["from_viewid", "from_filepath", "from_metadata", "from_poseid", "from_intrinsicid"],
4142
),
4243
desc.StringParam(
4344
name="fileMatchingPattern",
Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
{
2+
"header": {
3+
"pipelineVersion": "2.2",
4+
"releaseVersion": "2024.1.0-develop",
5+
"fileVersion": "2.0",
6+
"template": true,
7+
"nodesVersions": {
8+
"CameraInit": "11.0",
9+
"DepthMap": "5.0",
10+
"DepthMapFilter": "4.0",
11+
"FeatureExtraction": "1.3",
12+
"FeatureMatching": "2.0",
13+
"ImageMatching": "2.0",
14+
"LightingCalibration": "1.0",
15+
"MeshFiltering": "3.0",
16+
"Meshing": "7.0",
17+
"PhotometricStereo": "1.0",
18+
"PrepareDenseScene": "3.1",
19+
"SfMFilter": "1.0",
20+
"SfMTransfer": "2.1",
21+
"SphereDetection": "1.0",
22+
"StructureFromMotion": "3.3",
23+
"Texturing": "6.0"
24+
}
25+
},
26+
"graph": {
27+
"CameraInit_1": {
28+
"nodeType": "CameraInit",
29+
"position": [
30+
-400,
31+
200
32+
],
33+
"inputs": {
34+
"rawColorInterpretation": "LibRawWhiteBalancing"
35+
}
36+
},
37+
"DepthMapFilter_1": {
38+
"nodeType": "DepthMapFilter",
39+
"position": [
40+
1200,
41+
0
42+
],
43+
"inputs": {
44+
"input": "{DepthMap_1.input}",
45+
"depthMapsFolder": "{DepthMap_1.output}"
46+
}
47+
},
48+
"DepthMap_1": {
49+
"nodeType": "DepthMap",
50+
"position": [
51+
1000,
52+
0
53+
],
54+
"inputs": {
55+
"input": "{PrepareDenseScene_1.input}",
56+
"imagesFolder": "{PrepareDenseScene_1.output}"
57+
}
58+
},
59+
"FeatureExtraction_1": {
60+
"nodeType": "FeatureExtraction",
61+
"position": [
62+
0,
63+
0
64+
],
65+
"inputs": {
66+
"input": "{SfMFilter_1.outputSfMData_selected}"
67+
}
68+
},
69+
"FeatureMatching_1": {
70+
"nodeType": "FeatureMatching",
71+
"position": [
72+
400,
73+
0
74+
],
75+
"inputs": {
76+
"input": "{ImageMatching_1.input}",
77+
"featuresFolders": "{ImageMatching_1.featuresFolders}",
78+
"imagePairsList": "{ImageMatching_1.output}",
79+
"describerTypes": "{FeatureExtraction_1.describerTypes}",
80+
"maxIteration": 2048
81+
}
82+
},
83+
"ImageMatching_1": {
84+
"nodeType": "ImageMatching",
85+
"position": [
86+
200,
87+
0
88+
],
89+
"inputs": {
90+
"input": "{FeatureExtraction_1.input}",
91+
"featuresFolders": [
92+
"{FeatureExtraction_1.output}"
93+
]
94+
}
95+
},
96+
"LightingCalibration_1": {
97+
"nodeType": "LightingCalibration",
98+
"position": [
99+
1200,
100+
200
101+
],
102+
"inputs": {
103+
"inputPath": "{SphereDetection_1.input}",
104+
"inputDetection": "{SphereDetection_1.output}"
105+
}
106+
},
107+
"MeshFiltering_1": {
108+
"nodeType": "MeshFiltering",
109+
"position": [
110+
1600,
111+
0
112+
],
113+
"inputs": {
114+
"inputMesh": "{Meshing_1.outputMesh}"
115+
}
116+
},
117+
"Meshing_1": {
118+
"nodeType": "Meshing",
119+
"position": [
120+
1400,
121+
0
122+
],
123+
"inputs": {
124+
"input": "{DepthMapFilter_1.input}",
125+
"depthMapsFolder": "{DepthMapFilter_1.output}"
126+
}
127+
},
128+
"PhotometricStereo_1": {
129+
"nodeType": "PhotometricStereo",
130+
"position": [
131+
1400,
132+
200
133+
],
134+
"inputs": {
135+
"inputPath": "{LightingCalibration_1.inputPath}",
136+
"pathToJSONLightFile": "{LightingCalibration_1.outputFile}"
137+
}
138+
},
139+
"PrepareDenseScene_1": {
140+
"nodeType": "PrepareDenseScene",
141+
"position": [
142+
800,
143+
0
144+
],
145+
"inputs": {
146+
"input": "{StructureFromMotion_1.output}"
147+
}
148+
},
149+
"PrepareDenseScene_2": {
150+
"nodeType": "PrepareDenseScene",
151+
"position": [
152+
2200,
153+
200
154+
],
155+
"inputs": {
156+
"input": "{PhotometricStereo_1.outputSfmDataAlbedo}"
157+
}
158+
},
159+
"PrepareDenseScene_3": {
160+
"nodeType": "PrepareDenseScene",
161+
"position": [
162+
2200,
163+
400
164+
],
165+
"inputs": {
166+
"input": "{PhotometricStereo_1.outputSfmDataNormal}"
167+
}
168+
},
169+
"PrepareDenseScene_4": {
170+
"nodeType": "PrepareDenseScene",
171+
"position": [
172+
2200,
173+
600
174+
],
175+
"inputs": {
176+
"input": "{PhotometricStereo_1.outputSfmDataNormalPNG}"
177+
}
178+
},
179+
"SfMFilter_1": {
180+
"nodeType": "SfMFilter",
181+
"position": [
182+
-200,
183+
200
184+
],
185+
"inputs": {
186+
"inputFile": "{CameraInit_1.output}",
187+
"fileMatchingPattern": ".*/.*ambiant.*"
188+
}
189+
},
190+
"SfMTransfer_1": {
191+
"nodeType": "SfMTransfer",
192+
"position": [
193+
800,
194+
200
195+
],
196+
"inputs": {
197+
"input": "{SfMFilter_1.outputSfMData_unselected}",
198+
"reference": "{StructureFromMotion_1.output}",
199+
"method": "from_poseid"
200+
}
201+
},
202+
"SphereDetection_1": {
203+
"nodeType": "SphereDetection",
204+
"position": [
205+
1000,
206+
200
207+
],
208+
"inputs": {
209+
"input": "{SfMTransfer_1.output}"
210+
}
211+
},
212+
"StructureFromMotion_1": {
213+
"nodeType": "StructureFromMotion",
214+
"position": [
215+
600,
216+
0
217+
],
218+
"inputs": {
219+
"input": "{FeatureMatching_1.input}",
220+
"featuresFolders": "{FeatureMatching_1.featuresFolders}",
221+
"matchesFolders": [
222+
"{FeatureMatching_1.output}"
223+
],
224+
"describerTypes": "{FeatureMatching_1.describerTypes}",
225+
"localizerEstimatorMaxIterations": 4096
226+
}
227+
},
228+
"Texturing_1": {
229+
"nodeType": "Texturing",
230+
"position": [
231+
1800,
232+
0
233+
],
234+
"inputs": {
235+
"input": "{Meshing_1.output}",
236+
"imagesFolder": "{DepthMap_1.imagesFolder}",
237+
"inputMesh": "{MeshFiltering_1.outputMesh}"
238+
}
239+
},
240+
"Texturing_2": {
241+
"nodeType": "Texturing",
242+
"position": [
243+
2400,
244+
200
245+
],
246+
"inputs": {
247+
"input": "{Meshing_1.output}",
248+
"imagesFolder": "{PrepareDenseScene_2.output}",
249+
"inputMesh": "{MeshFiltering_1.outputMesh}"
250+
}
251+
},
252+
"Texturing_3": {
253+
"nodeType": "Texturing",
254+
"position": [
255+
2400,
256+
400
257+
],
258+
"inputs": {
259+
"input": "{Meshing_1.output}",
260+
"imagesFolder": "{PrepareDenseScene_3.output}",
261+
"inputMesh": "{MeshFiltering_1.outputMesh}"
262+
}
263+
},
264+
"Texturing_4": {
265+
"nodeType": "Texturing",
266+
"position": [
267+
2400,
268+
600
269+
],
270+
"inputs": {
271+
"input": "{Meshing_1.output}",
272+
"imagesFolder": "{PrepareDenseScene_4.output}",
273+
"inputMesh": "{MeshFiltering_1.outputMesh}"
274+
}
275+
}
276+
}
277+
}

0 commit comments

Comments
 (0)