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 Photometric Stereo nodes #1853

Merged
merged 23 commits into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1f49766
[photometricStereo] Add nodes for PS
jmelou Jul 20, 2022
0bd63b2
[ps] Add sphere selection in interface
jmelou Jul 20, 2022
70fc61c
New node : sphere detection
jmelou Mar 2, 2023
0718115
Interraction with node sphereDetection
jmelou Mar 2, 2023
05f66fa
[LightingCalibration] Add new method parameters
jmelou Mar 15, 2023
62e0bc5
[RTI] Add PS from RTI dome node
jmelou Mar 15, 2023
e1ea9f7
[RTI] Add RTI node
jmelou Apr 5, 2023
d0ff0e8
[RTI] Change RTI node file name
jmelou Apr 5, 2023
62570bd
[pipeline] Add RTI pipeline
jmelou Apr 5, 2023
8ccff7b
[pipeline] New PS pipeline
jmelou Apr 5, 2023
18b2894
[nodes] PhotometricStereo: declare output sfmData
fabiencastan Apr 6, 2023
bdd2d06
[pipeline] Stereophotometry: Update release version
fabiencastan Apr 12, 2023
bfd1db8
[PS] Remove options for first version
jmelou Apr 7, 2023
5e49ee3
[nodes] PS: Expose normal and albedo maps in Viewer
jmelou Apr 19, 2023
c983629
[PS] Fuse RTI and PS nodes part. 2
jmelou May 23, 2023
91bb5e5
[PS] Add outputs to PS node
jmelou May 23, 2023
3d333ac
[PS] Add some description, correct some typo
jmelou May 23, 2023
a89b36d
[nodes] remove RTI node and pipeline as it is integrated in photometr…
fabiencastan May 25, 2023
0ee4d1f
[nodes] SphereDetection: use env var for model by default
fabiencastan May 25, 2023
578d1ab
[nodes] SfMTransfer: Add a parameter to transfer landmarks
cbentejac May 31, 2023
f0f5b20
[nodes] StereoPhotometry: Update nodes' parameters and descriptions
cbentejac May 31, 2023
67d5235
[pipelines] StereoPhotometry: Update template and add `Publish` node
cbentejac May 31, 2023
8e4e373
[PS] Add nodes documentation
jmelou Jun 1, 2023
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
64 changes: 64 additions & 0 deletions meshroom/nodes/aliceVision/LightingCalibration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
__version__ = "1.0"

from meshroom.core import desc


class LightingCalibration(desc.CommandLineNode):
commandLine = 'aliceVision_lightingCalibration {allParams}'
category = 'Photometry'
documentation = '''
Evaluate the lighting in a scene using spheres placed in the scene.
Can also be used to calibrate a lighting dome (RTI type).
'''

inputs = [
desc.File(
name='inputPath',
label='SfMData',
description='Input file. Could be SfMData file or folder.',
value='',
uid=[0]
),
desc.File(
name='inputJSON',
label='Sphere Detection File',
description='Input JSON file containing spheres centers and radius.',
value='',
uid=[0]
),
desc.BoolParam(
name='saveAsModel',
label='Save As Model',
description='Check if this calibration file will be used with other datasets.',
value=False,
uid=[0]
),
desc.ChoiceParam(
name='method',
label='Calibration Method',
description='Method used for light calibration. Use "brightestPoint" for shiny spheres and "whiteSphere" for white matte spheres.',
values=['brightestPoint', 'whiteSphere'],
value='brightestPoint',
exclusive=True,
uid=[0]
),
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=[]
)
]

outputs = [
desc.File(
name='outputFile',
label='Light File',
description='Light information will be written here.',
value=desc.Node.internalFolder +'/lights.json' ,
uid=[]
)
]
55 changes: 55 additions & 0 deletions meshroom/nodes/aliceVision/NormalIntegration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
__version__ = "1.0"

from meshroom.core import desc

class NormalIntegration(desc.CommandLineNode):
commandLine = 'aliceVision_normalIntegration {allParams}'
category = 'Photometry'
documentation = '''
TODO.
'''

inputs = [
desc.File(
name='inputPath',
label='Normal Maps Folder',
description='Path to the folder containing the normal maps and the masks.',
value='',
uid=[0]
),
desc.File(
name='sfmDataFile',
label='SfMData',
description='Input SfMData file.',
value='',
uid=[0],
),
desc.IntParam(
name='downscale',
label='Downscale Factor',
description='Downscale factor for faster results.',
value=1,
range=(1, 10, 1),
advanced=True,
uid=[0]
),
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=[]
)
]

outputs = [
desc.File(
name='outputPath',
label='Output Path',
description='Path to the output folder.',
value=desc.Node.internalFolder,
uid=[]
)
]
147 changes: 147 additions & 0 deletions meshroom/nodes/aliceVision/PhotometricStereo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
__version__ = "1.0"

from meshroom.core import desc

class PhotometricStereo(desc.CommandLineNode):
commandLine = 'aliceVision_photometricStereo {allParams}'
category = 'Photometry'
documentation = '''
Reconstruction using Photometric Stereo. A normal map is evaluated from several photographs taken from the same point of view, but under different lighting conditions.
The lighting conditions are assumed to be known.
'''

inputs = [
desc.File(
name='inputPath',
label='SfMData',
description='Input file. Could be an SfMData file or folder containing images.',
value='',
uid=[0]
),
desc.File(
name='pathToJSONLightFile',
label='Light File',
description='Path to a JSON file containing the lighting information.\n'
'If empty, .txt files are expected in the image folder.',
value='defaultJSON.txt',
uid=[0]
),
desc.File(
name='maskPath',
label='Mask Folder Path',
description='Path to a folder containing masks or to a mask directly.',
value='',
uid=[0]
),
desc.ChoiceParam(
name='SHOrder',
label='Spherical Harmonics Order',
description='Order of the spherical harmonics.\n'
'- 0: directional\n'
'- 1: directional + ambiant\n'
'- 2: second order spherical harmonics',
values=['0', '1', '2'],
value='0',
exclusive=True,
advanced=True,
uid=[0]
),
desc.BoolParam(
name='removeAmbiant',
label='Remove Ambiant Light',
description='True if the ambiant light is to be removed on the PS images, false otherwise.',
value=False,
advanced=True,
uid=[0]
),
desc.BoolParam(
name='isRobust',
label='Use Robust Algorithm',
description='True to use the robust algorithm, false otherwise.',
value=False,
advanced=True,
uid=[0]
),
desc.IntParam(
name='downscale',
label='Downscale Factor',
description='Downscale factor for faster results.',
value=1,
range=(1, 10, 1),
advanced=True,
uid=[0]
),
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=[],
)
]

outputs = [
desc.File(
name='outputPath',
label='Output Folder',
description='Path to the output folder',
value=desc.Node.internalFolder,
uid=[],
),
desc.File(
name='outputSfmData',
label='SfMData',
description='Output path for the Sfm',
value=desc.Node.internalFolder + '/sfmData.sfm',
uid=[],
group='', # remove from command line
),
desc.File(
name='outputSfmDataAlbedo',
label='SfMData Albedo',
description='',
value=desc.Node.internalFolder + '/albedoMaps.sfm',
uid=[],
group='', # remove from command line
),
desc.File(
name='outputSfmDataNormal',
label='SfMData Normal',
description='',
value=desc.Node.internalFolder + '/normalMaps.sfm',
uid=[],
group='', # remove from command line
),
# these attributes are only here to describe more accurately the output of the node
# by specifying that it generates 2 sequences of images
# (see in Viewer2D.qml how these attributes can be used)
desc.File(
name='normals',
label='Normal Maps Camera',
description='Generated normal maps in the camera coordinate system.',
semantic='image',
value=desc.Node.internalFolder + '<POSE_ID>_normals.exr',
uid=[],
group='', # do not export on the command line
),
desc.File(
name='normalsWorld',
label='Normal Maps World',
description='Generated normal maps in the world coordinate system.',
semantic='image',
value=desc.Node.internalFolder + '<POSE_ID>_normals_w.exr',
uid=[],
group='', # do not export on the command line
),
desc.File(
name='albedo',
label='Albedo Maps',
description='Generated albedo maps.',
semantic='image',
value=desc.Node.internalFolder + '<POSE_ID>_albedo.exr',
uid=[],
group='', # do not export on the command line
),
]
9 changes: 8 additions & 1 deletion meshroom/nodes/aliceVision/SfMTransfer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.0"
__version__ = "2.1"

from meshroom.core import desc

Expand Down Expand Up @@ -80,6 +80,13 @@ class SfMTransfer(desc.AVCommandLineNode):
value=True,
uid=[0]
),
desc.BoolParam(
name='transferLandmarks',
label='Landmarks',
description='Transfer landmarks.',
value=True,
uid=[0]
),
desc.ChoiceParam(
name='verboseLevel',
label='Verbose Level',
Expand Down
92 changes: 92 additions & 0 deletions meshroom/nodes/aliceVision/SphereDetection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
__version__ = "1.0"

from meshroom.core import desc


class SphereDetection(desc.CommandLineNode):
commandLine = 'aliceVision_sphereDetection {allParams}'
category = 'Photometry'
documentation = '''
Detect spheres in pictures. These spheres will be used for lighting calibration.
Spheres can be automatically detected or manually defined in the interface.
'''

inputs = [
desc.File(
name='input',
label="SfMData",
description='Input SfMData file.',
value='',
uid=[0]
),
desc.File(
name='modelPath',
label='Detection Network',
description='Deep learning network for automatic calibration sphere detection.',
value='${ALICEVISION_SPHERE_DETECTION_MODEL}',
uid=[0]
),
desc.BoolParam(
name='autoDetect',
label='Automatic Sphere Detection',
description='Automatic detection of calibration spheres',
value=False,
uid=[0]
),
desc.FloatParam(
name="minScore",
label="Minimum Score",
description="Minimum score for the detection.",
value=0.0,
range=(0.0, 50.0, 0.01),
advanced=True,
uid=[0]
),
desc.GroupAttribute(
name="sphereCenter",
label="Sphere Center",
description="Center of the circle (XY offset to the center of the image in pixels).",
groupDesc=[
desc.FloatParam(
name="x", label="x", description="X Offset in pixels",
value=0.0,
uid=[0],
range=(-1000.0, 10000.0, 1.0)),
desc.FloatParam(
name="y", label="y", description="Y Offset in pixels",
value=0.0,
uid=[0],
range=(-1000.0, 10000.0, 1.0)),
],
enabled=lambda node: not node.autoDetect.value,
group=None # skip group from command line
),
desc.FloatParam(
name='sphereRadius',
label='Radius',
description='Sphere radius in pixels.',
value=500.0,
range=(0.0, 1000.0, 0.1),
enabled=lambda node: not node.autoDetect.value,
uid=[0]
),
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=[]
)
]

outputs = [
desc.File(
name='output',
label='Light File Folder',
description='Light information will be written here.',
value=desc.Node.internalFolder,
uid=[]
)
]
Loading