diff --git a/meshroom/nodes/aliceVision/LightingCalibration.py b/meshroom/nodes/aliceVision/LightingCalibration.py index c612b6b529..97b795af19 100644 --- a/meshroom/nodes/aliceVision/LightingCalibration.py +++ b/meshroom/nodes/aliceVision/LightingCalibration.py @@ -6,7 +6,7 @@ class LightingCalibration(desc.CommandLineNode): commandLine = 'aliceVision_lightingCalibration {allParams}' - category = 'Photometry' + category = 'Photometric Stereo' documentation = ''' Evaluate the lighting in a scene using spheres placed in the scene. Can also be used to calibrate a lighting dome (RTI type). @@ -21,7 +21,7 @@ class LightingCalibration(desc.CommandLineNode): uid=[0], ), desc.File( - name="inputJSON", + name="inputDetection", label="Sphere Detection File", description="Input JSON file containing sphere centers and radiuses.", value="", @@ -34,12 +34,20 @@ class LightingCalibration(desc.CommandLineNode): value=False, uid=[0], ), + desc.BoolParam( + name="ellipticEstimation", + label="Use elliptic estimation", + description="Consider the right projection of the sphere. Fit the circle tool on the small axe of the ellipse.", + value=False, + uid=[0], + ), desc.ChoiceParam( name="method", label="Calibration Method", description="Method used for light calibration.\n" - "Use 'brightestPoint' for shiny spheres and 'whiteSphere' for white matte spheres.", - values=["brightestPoint", "whiteSphere"], + "Use 'brightestPoint' for shiny spheres and 'whiteSphere' for white matte spheres.\n" + "Spherical Harmonic lighting can be estimated using 'SH' method.", + values=["brightestPoint", "whiteSphere", "SH"], value="brightestPoint", exclusive=True, uid=[0], @@ -63,4 +71,12 @@ class LightingCalibration(desc.CommandLineNode): value=desc.Node.internalFolder + "/lights.json", uid=[], ), + desc.File( + name="lightingEstimationVisualization", + label="Estimated Lighting Visualization", + description="Estimated Lighting Visualization.", + semantic="image", + value=desc.Node.internalFolder + "/_{methodValue}.png", + uid=[], + ), ] diff --git a/meshroom/nodes/aliceVision/NormalIntegration.py b/meshroom/nodes/aliceVision/NormalIntegration.py index 18888db946..0f4567b0a1 100644 --- a/meshroom/nodes/aliceVision/NormalIntegration.py +++ b/meshroom/nodes/aliceVision/NormalIntegration.py @@ -5,9 +5,9 @@ class NormalIntegration(desc.CommandLineNode): commandLine = 'aliceVision_normalIntegration {allParams}' - category = 'Photometry' + category = 'Photometric Stereo' documentation = ''' -TODO. +Evaluate a depth map from a normals map (currently in development) ''' inputs = [ @@ -47,10 +47,12 @@ class NormalIntegration(desc.CommandLineNode): outputs = [ desc.File( - name="outputPath", - label="Output Path", - description="Path to the output folder.", - value=desc.Node.internalFolder, + name="depthMap", + label="Depth Map Camera", + description="Generated depth in the camera coordinate system.", + semantic="image", + value=desc.Node.internalFolder + "_depthMap.exr", uid=[], - ), + group="", # do not export on the command line + ) ] diff --git a/meshroom/nodes/aliceVision/PhotometricStereo.py b/meshroom/nodes/aliceVision/PhotometricStereo.py index f174b12b2e..a316821fc8 100644 --- a/meshroom/nodes/aliceVision/PhotometricStereo.py +++ b/meshroom/nodes/aliceVision/PhotometricStereo.py @@ -5,7 +5,7 @@ class PhotometricStereo(desc.CommandLineNode): commandLine = 'aliceVision_photometricStereo {allParams}' - category = 'Photometry' + category = 'Photometric Stereo' 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. @@ -39,7 +39,7 @@ class PhotometricStereo(desc.CommandLineNode): label="Spherical Harmonics Order", description="Order of the spherical harmonics:\n" " - 0: directional.\n" - " - 1: directional + ambiant.\n" + " - 1: directional + ambient.\n" " - 2: second order spherical harmonics.", values=["0", "1", "2"], value="0", @@ -48,9 +48,9 @@ class PhotometricStereo(desc.CommandLineNode): 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.", + name="removeAmbient", + label="Remove Ambient Light", + description="True if the ambient light is to be removed on the PS images, false otherwise.", value=False, advanced=True, uid=[0], @@ -91,14 +91,6 @@ class PhotometricStereo(desc.CommandLineNode): value=desc.Node.internalFolder, uid=[], ), - desc.File( - name="outputSfmData", - label="SfMData", - description="Output path for the SfMData file.", - value=desc.Node.internalFolder + "/sfmData.sfm", - uid=[], - group="", # remove from command line - ), desc.File( name="outputSfmDataAlbedo", label="SfMData Albedo", @@ -115,6 +107,14 @@ class PhotometricStereo(desc.CommandLineNode): uid=[], group="", # remove from command line ), + desc.File( + name="outputSfmDataNormalPNG", + label="SfMData Normal PNG", + description="Output SfMData file containing the normal maps information.", + value=desc.Node.internalFolder + "/normalMapsPNG.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) @@ -127,6 +127,15 @@ class PhotometricStereo(desc.CommandLineNode): uid=[], group="", # do not export on the command line ), + desc.File( + name="normalsPNG", + label="Normal Maps Camera (in false colors)", + description="Generated normal maps in the camera coordinate system (in false colors).", + semantic="image", + value=desc.Node.internalFolder + "_normals.png", + uid=[], + group="", # do not export on the command line + ), desc.File( name="normalsWorld", label="Normal Maps World", @@ -136,12 +145,13 @@ class PhotometricStereo(desc.CommandLineNode): 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 + "_albedo.exr", + value=desc.Node.internalFolder + "_albedo.png", uid=[], group="", # do not export on the command line ), diff --git a/meshroom/nodes/aliceVision/SphereDetection.py b/meshroom/nodes/aliceVision/SphereDetection.py index c8a9de7255..5ee3ff368b 100644 --- a/meshroom/nodes/aliceVision/SphereDetection.py +++ b/meshroom/nodes/aliceVision/SphereDetection.py @@ -6,7 +6,7 @@ class SphereDetection(desc.CommandLineNode): commandLine = 'aliceVision_sphereDetection {allParams}' - category = 'Photometry' + category = 'Photometric Stereo' documentation = ''' Detect spheres in pictures. These spheres will be used for lighting calibration. Spheres can be automatically detected or manually defined in the interface. @@ -91,9 +91,9 @@ class SphereDetection(desc.CommandLineNode): outputs = [ desc.File( name="output", - label="Output Folder", + label="Output Path", description="Sphere detection information will be written here.", - value=desc.Node.internalFolder, - uid=[], - ), + value=desc.Node.internalFolder + "/detection.json", + uid=[] + ) ] diff --git a/meshroom/nodes/aliceVision/Texturing.py b/meshroom/nodes/aliceVision/Texturing.py index f67eaf0f85..cce12fc8ed 100644 --- a/meshroom/nodes/aliceVision/Texturing.py +++ b/meshroom/nodes/aliceVision/Texturing.py @@ -41,6 +41,13 @@ class Texturing(desc.AVCommandLineNode): value="", uid=[0], ), + desc.File( + name="normalsFolder", + label="Normals Folder", + description="Use normal maps from a specific folder to texture the mesh.\nFilename should be : uid_normalMap.", + value="", + uid=[0], + ), desc.File( name="inputMesh", label="Mesh", diff --git a/meshroom/pipelines/stereoPhotometry.mg b/meshroom/pipelines/photometricStereo.mg similarity index 83% rename from meshroom/pipelines/stereoPhotometry.mg rename to meshroom/pipelines/photometricStereo.mg index c4d31df292..e73f235928 100644 --- a/meshroom/pipelines/stereoPhotometry.mg +++ b/meshroom/pipelines/photometricStereo.mg @@ -29,7 +29,7 @@ ], "inputs": { "inputPath": "{SphereDetection_1.input}", - "inputJSON": "{SphereDetection_1.output}" + "inputDetection": "{SphereDetection_1.output}" } }, "PhotometricStereo_1": { @@ -51,12 +51,15 @@ ], "inputs": { "inputFiles": [ - "{PhotometricStereo_1.outputSfmData}", "{PhotometricStereo_1.outputSfmDataNormal}", "{PhotometricStereo_1.normals}", "{PhotometricStereo_1.normalsWorld}", "{PhotometricStereo_1.albedo}", - "{PhotometricStereo_1.outputSfmDataAlbedo}" + "{PhotometricStereo_1.outputSfmDataAlbedo}", + "{PhotometricStereo_1.inputPath}", + "{PhotometricStereo_1.outputSfmDataNormalPNG}", + "{PhotometricStereo_1.normalsPNG}", + "{PhotometricStereo_1.pathToJSONLightFile}" ] } }, @@ -72,4 +75,4 @@ } } } -} \ No newline at end of file +} diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 61ea8c1332..eabb76b5c0 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -714,7 +714,7 @@ FocusScope { json = null if (activeNode.attribute("autoDetect").value) { // auto detection enabled - var jsonPath = activeNode.attribute("output").value + "/detection.json" + var jsonPath = activeNode.attribute("output").value Request.get(Filepath.stringToUrl(jsonPath), function(xhr) { if (xhr.readyState === XMLHttpRequest.DONE) { try { diff --git a/start.sh b/start.sh index a7ec5f043a..7e5779fe6d 100755 --- a/start.sh +++ b/start.sh @@ -9,4 +9,4 @@ export PYTHONPATH=$MESHROOM_ROOT:$PYTHONPATH # using alicevision built source #export PATH=$PATH:/foo/build/Linux-x86_64/ -python "$MESHROOM_ROOT/meshroom/ui" +python3 "$MESHROOM_ROOT/meshroom/ui"